diff --git a/.coveragerc b/.coveragerc index 36f0f7879af..1e1776fd566 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,5 +1,5 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 [paths] source = diff --git a/.gitattributes b/.gitattributes index 222c26f0cf7..1e84d118156 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,14 +1,8 @@ * text eol=lf *.cmd text eol=crlf -# we do not own any headers checked in, don't touch them -*.h binary -*.hpp binary -# Exception: headers we own -cuda_bindings/cuda/bindings/_bindings/*.h -binary text diff -cuda_bindings/cuda/bindings/_lib/*.h -binary text diff -cuda_core/cuda/core/_cpp/*.h -binary text diff -cuda_core/cuda/core/_cpp/*.hpp -binary text diff +# Keep the vendored DLPack header byte-for-byte, but still show text diffs. +cuda_core/cuda/core/_include/dlpack.h -text !eol diff # git should not convert line endings in PNG files *.png binary *.svg binary diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml new file mode 100644 index 00000000000..db23ece3410 --- /dev/null +++ b/.github/actionlint.yaml @@ -0,0 +1,10 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +# Self-hosted runner labels used in CI workflows. +# Without this config, actionlint rejects non-GitHub-hosted labels. +self-hosted-runner: + labels: + - linux-amd64-cpu8 + - linux-amd64-gpu-l4-latest-1 diff --git a/.github/actions/doc_preview/action.yml b/.github/actions/doc_preview/action.yml index e427c298a50..0c60b899fbf 100644 --- a/.github/actions/doc_preview/action.yml +++ b/.github/actions/doc_preview/action.yml @@ -22,7 +22,7 @@ runs: # Note: the PR previews will be removed once merged to main or release/* (see below) - name: Deploy doc preview if: ${{ github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }} - uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8 # v4.7.3 + uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0 with: git-config-name: cuda-python-bot git-config-email: cuda-python-bot@users.noreply.github.com @@ -32,7 +32,7 @@ runs: - name: Leave a comment after deployment if: ${{ github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }} - uses: marocchino/sticky-pull-request-comment@67d0dec7b07ed060a405f9b2a64b8ab319fdd7db # v2.9.2 + uses: marocchino/sticky-pull-request-comment@d4d6b0936434b21bc8345ad45a440c5f7d2c40ff # v3.0.3 with: header: pr-preview number: ${{ inputs.pr-number }} @@ -49,7 +49,7 @@ runs: # The steps below are executed only when building on main or release/*. - name: Remove doc preview if: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release/') }} - uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8 # v4.7.3 + uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0 with: git-config-name: cuda-python-bot git-config-email: cuda-python-bot@users.noreply.github.com @@ -59,7 +59,7 @@ runs: - name: Leave a comment after removal if: ${{ github.ref_name == 'main' || startsWith(github.ref_name, 'release/') }} - uses: marocchino/sticky-pull-request-comment@67d0dec7b07ed060a405f9b2a64b8ab319fdd7db # v2.9.2 + uses: marocchino/sticky-pull-request-comment@d4d6b0936434b21bc8345ad45a440c5f7d2c40ff # v3.0.3 with: header: pr-preview number: ${{ inputs.pr-number }} diff --git a/.github/actions/fetch_ctk/action.yml b/.github/actions/fetch_ctk/action.yml index e938fcc5b31..b4a49789779 100644 --- a/.github/actions/fetch_ctk/action.yml +++ b/.github/actions/fetch_ctk/action.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 @@ -14,7 +14,7 @@ inputs: cuda-components: description: "A list of the CTK components to install as a comma-separated list. e.g. 'cuda_nvcc,cuda_nvrtc,cuda_cudart'" required: false - default: "cuda_nvcc,cuda_cudart,cuda_crt,libnvvm,cuda_nvrtc,cuda_profiler_api,cuda_cccl,cuda_cupti,libnvjitlink,libcufile,libnvfatbin" + default: "cuda_nvcc,cuda_cudart,cuda_crt,libnvvm,cuda_nvrtc,cuda_profiler_api,cuda_cccl,cuda_cupti,libnvjitlink,libcufile,libnvfatbin,libcudla" cuda-path: description: "where the CTK components will be installed to, relative to $PWD" required: false @@ -27,24 +27,15 @@ runs: shell: bash --noprofile --norc -xeuo pipefail {0} run: | # Pre-process the component list to ensure hash uniqueness + # Use the runtime workspace mount so this also works inside container jobs. + CTK_REDIST_TOOL="${GITHUB_WORKSPACE}/ci/tools/fetch_ctk_redistrib.py" CTK_CACHE_COMPONENTS=${{ inputs.cuda-components }} - # Conditionally strip out libnvjitlink for CUDA versions < 12 - CUDA_MAJOR_VER="$(cut -d '.' -f 1 <<< ${{ inputs.cuda-version }})" - 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 - # Cleanup stray commas after removing components - CTK_CACHE_COMPONENTS="${CTK_CACHE_COMPONENTS//,,/,}" + CTK_JSON_URL="https://developer.download.nvidia.com/compute/cuda/redist/redistrib_${{ inputs.cuda-version }}.json" + CTK_CACHE_COMPONENTS="$(python "$CTK_REDIST_TOOL" filter-components \ + --host-platform "${{ inputs.host-platform }}" \ + --cuda-version "${{ inputs.cuda-version }}" \ + --components "$CTK_CACHE_COMPONENTS" \ + --metadata-url "$CTK_JSON_URL")" HASH=$(echo -n "${CTK_CACHE_COMPONENTS}" | sha256sum | awk '{print $1}') echo "CTK_CACHE_KEY=mini-ctk-${{ inputs.cuda-version }}-${{ inputs.host-platform }}-$HASH" >> $GITHUB_ENV @@ -60,7 +51,7 @@ runs: - name: Download CTK cache id: ctk-get-cache - uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 continue-on-error: true with: key: ${{ env.CTK_CACHE_KEY }} @@ -78,19 +69,17 @@ runs: mkdir $CACHE_TMP_DIR # The binary archives (redist) are guaranteed to be updated as part of the release posting. + # Use the runtime workspace mount so this also works inside container jobs. + CTK_REDIST_TOOL="${GITHUB_WORKSPACE}/ci/tools/fetch_ctk_redistrib.py" CTK_BASE_URL="https://developer.download.nvidia.com/compute/cuda/redist/" CTK_JSON_URL="$CTK_BASE_URL/redistrib_${{ inputs.cuda-version }}.json" + CTK_JSON_FILE="$CACHE_TMP_DIR/redistrib.json" + curl -LSs "$CTK_JSON_URL" -o "$CTK_JSON_FILE" if [[ "${{ inputs.host-platform }}" == linux* ]]; then - if [[ "${{ inputs.host-platform }}" == "linux-64" ]]; then - CTK_SUBDIR="linux-x86_64" - elif [[ "${{ inputs.host-platform }}" == "linux-aarch64" ]]; then - CTK_SUBDIR="linux-sbsa" - fi function extract() { tar -xvf $1 -C $CACHE_TMP_DIR --strip-components=1 } elif [[ "${{ inputs.host-platform }}" == "win-64" ]]; then - CTK_SUBDIR="windows-x86_64" function extract() { _TEMP_DIR_=$(mktemp -d) unzip $1 -d $_TEMP_DIR_ @@ -103,11 +92,13 @@ runs: function populate_cuda_path() { # take the component name as a argument function download() { - curl -kLSs $1 -o $2 + curl -LSs $1 -o $2 } CTK_COMPONENT=$1 - CTK_COMPONENT_REL_PATH="$(curl -s $CTK_JSON_URL | - python -c "import sys, json; print(json.load(sys.stdin)['${CTK_COMPONENT}']['${CTK_SUBDIR}']['relative_path'])")" + CTK_COMPONENT_REL_PATH="$(python "$CTK_REDIST_TOOL" component-relative-path \ + --host-platform "${{ inputs.host-platform }}" \ + --component "$CTK_COMPONENT" \ + --metadata-path "$CTK_JSON_FILE")" CTK_COMPONENT_URL="${CTK_BASE_URL}/${CTK_COMPONENT_REL_PATH}" CTK_COMPONENT_COMPONENT_FILENAME="$(basename $CTK_COMPONENT_REL_PATH)" download $CTK_COMPONENT_URL $CTK_COMPONENT_COMPONENT_FILENAME @@ -142,7 +133,7 @@ runs: - name: Upload CTK cache if: ${{ !cancelled() && steps.ctk-get-cache.outputs.cache-hit != 'true' }} - uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 with: key: ${{ env.CTK_CACHE_KEY }} path: ./${{ env.CTK_CACHE_FILENAME }} diff --git a/.github/actions/sccache-summary/action.yml b/.github/actions/sccache-summary/action.yml new file mode 100644 index 00000000000..28734116f62 --- /dev/null +++ b/.github/actions/sccache-summary/action.yml @@ -0,0 +1,80 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +name: sccache summary +description: Parse sccache stats JSON and write a summary table to GITHUB_STEP_SUMMARY + +# Inspired by NVIDIA/cccl's prepare-execution-summary.py (PR #3621). + +inputs: + json-file: + description: "Path to the sccache stats JSON file (from sccache --show-stats --stats-format=json)" + required: true + label: + description: "Label for the stats row (e.g. cuda.bindings, cuda.core)" + required: false + default: "sccache" + build-step: + description: "Name of the cibuildwheel build step (for deep-link in summary)" + required: false + default: "" + +runs: + using: composite + steps: + - name: Report sccache stats + shell: bash --noprofile --norc -euo pipefail {0} + env: + SCCACHE_JSON: ${{ inputs.json-file }} + SCCACHE_LABEL: ${{ inputs.label }} + SCCACHE_BUILD_STEP: ${{ inputs.build-step }} + run: | + if [ ! -f "$SCCACHE_JSON" ]; then + echo "::warning::sccache stats file not found: $SCCACHE_JSON" + exit 0 + fi + + python3 - <<'PYEOF' + import json, os, urllib.parse + + json_file = os.environ["SCCACHE_JSON"] + label = os.environ["SCCACHE_LABEL"] + build_step = os.environ.get("SCCACHE_BUILD_STEP", "") + + with open(json_file) as f: + stats = json.load(f)["stats"] + + # compile_requests only counts top-level nvcc invocations, but each + # invocation spawns sub-tool compilations (cudafe++, cicc, ptxas) that + # sccache tracks under separate language keys. Count all of them so + # the reported rate matches sccache's own "Cache hits rate". + counted_languages = {"C/C++", "CUDA", "CUDA (Device code)", "PTX", "CUBIN"} + hits = sum( + v for k, v in stats.get("cache_hits", {}).get("counts", {}).items() + if k in counted_languages + ) + misses = sum( + v for k, v in stats.get("cache_misses", {}).get("counts", {}).items() + if k in counted_languages + ) + total = hits + misses + pct = int(100 * hits / total) if total > 0 else 0 + + # Build a deep-link to the cibuildwheel step if step name is provided. + # GHA step summary links use the format: #step:N:L but we can't know the + # step number here. Instead, link to the job page with a search hint. + link_note = "" + if build_step: + link_note = f"\n\n_Full stats in the **{build_step}** step log._\n" + + summary_file = os.environ.get("GITHUB_STEP_SUMMARY", "") + if summary_file: + with open(summary_file, "a") as sf: + sf.write(f"### 📊 {label} — sccache stats\n") + sf.write("| Hit Rate | Hits | Misses | Requests |\n") + sf.write("|----------|------|--------|----------|\n") + sf.write(f"| {pct}% | {hits} | {misses} | {total} |{link_note}\n") + + print(f"{label}: {pct}% hit rate ({hits}/{total})") + PYEOF diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 1a39f424f22..8c8e4274c41 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 00000000000..62b46533816 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,24 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +# Configuration for https://github.com/actions/labeler +# Auto-applies labels based on which files a PR changes. + +cuda.bindings: + - changed-files: + - any-glob-to-any-file: 'cuda_bindings/**' + +cuda.core: + - changed-files: + - any-glob-to-any-file: 'cuda_core/**' + +cuda.pathfinder: + - changed-files: + - any-glob-to-any-file: 'cuda_pathfinder/**' + +CI/CD: + - changed-files: + - any-glob-to-any-file: + - '.github/**' + - 'ci/**' diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index f983b36379a..a3573bc14d4 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -34,7 +34,7 @@ jobs: }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Load branch name id: get-branch @@ -43,7 +43,7 @@ jobs: echo "OLD_BRANCH=${OLD_BRANCH}" >> $GITHUB_ENV - name: Create backport pull requests - uses: korthout/backport-action@01619ebc9a6e3f6820274221b9956b3e7365000a # v4.1.0 + uses: korthout/backport-action@66065406958f46e82238fd59546f5a99e69e22aa # v4.5.2 with: copy_assignees: true copy_labels_pattern: true @@ -54,7 +54,7 @@ jobs: if: github.repository_owner == 'nvidia' && github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Load branch from environment name if: inputs.backport-branch == null @@ -67,7 +67,7 @@ jobs: run: echo "BACKPORT_BRANCH=${{ inputs.backport-branch }}" >> $GITHUB_ENV - name: Create backport pull requests - uses: korthout/backport-action@01619ebc9a6e3f6820274221b9956b3e7365000a # v4.1.0 + uses: korthout/backport-action@66065406958f46e82238fd59546f5a99e69e22aa # v4.5.2 with: copy_assignees: true copy_labels_pattern: true diff --git a/.github/workflows/bandit.yml b/.github/workflows/bandit.yml index 7ecbcdd1a1d..bd09d8e66ce 100644 --- a/.github/workflows/bandit.yml +++ b/.github/workflows/bandit.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 @@ -8,6 +8,7 @@ on: push: branches: - "pull-request/[0-9]+" + - "ctk-next" - "main" concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} @@ -17,13 +18,15 @@ jobs: analyze: runs-on: ubuntu-latest permissions: + actions: read + contents: read security-events: write steps: - name: Checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Install uv - uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1 + uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 with: enable-cache: false @@ -38,10 +41,10 @@ jobs: echo "codes=$(uvx toml2json ./ruff.toml | jq -r '.lint.ignore | map(select(test("^S\\d+"))) | join(",")')" >> "$GITHUB_OUTPUT" - name: Perform Bandit Analysis using Ruff - uses: astral-sh/ruff-action@4919ec5cf1f49eff0871dbcea0da843445b837e6 # v3.6.1 + uses: astral-sh/ruff-action@0ce1b0bf8b818ef400413f810f8a11cdbda0034b # v4.0.0 with: args: "check --select S --ignore ${{ steps.ignore-codes.outputs.codes }} --output-format sarif --output-file results.sarif" - name: Upload SARIF file - uses: github/codeql-action/upload-sarif@v4.32.5 + uses: github/codeql-action/upload-sarif@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 with: sarif_file: results.sarif diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index adbf8a11be7..7bb70809556 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 @@ -33,6 +33,16 @@ on: required: false default: false type: boolean + deploy-docs: + description: "Deploy generated docs to GitHub Pages or preview branches" + required: false + default: true + type: boolean + docs-branch: + description: "Branch that receives deployed docs" + required: false + default: "gh-pages" + type: string jobs: build: @@ -45,14 +55,21 @@ jobs: shell: bash -el {0} steps: - name: Checkout ${{ github.event.repository.name }} - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: - fetch-depth: 0 + fetch-depth: 1 ref: ${{ inputs.git-tag }} - name: Read build CTK version run: | - BUILD_CTK_VER=$(yq '.cuda.build.version' ci/versions.yml) + if [[ -f ci/versions.yml ]]; then + BUILD_CTK_VER=$(yq '.cuda.build.version' ci/versions.yml) + elif [[ -f ci/versions.json ]]; then + BUILD_CTK_VER=$(jq -r '.cuda.build.version' ci/versions.json) + else + echo "error: cannot find ci/versions.yml or ci/versions.json" >&2 + exit 1 + fi if [[ ! "${BUILD_CTK_VER}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "error: derived CTK build version ${BUILD_CTK_VER} does not match MAJOR.MINOR.MICRO" >&2 exit 1 @@ -62,7 +79,7 @@ jobs: # TODO: This workflow runs on GH-hosted runner and cannot use the proxy cache - name: Set up miniforge - uses: conda-incubator/setup-miniconda@fc2d68f6413eb2d87b895e92f8584b5b94a10167 # v3.3.0 + uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4.0.1 with: activate-environment: cuda-python-docs environment-file: ./cuda_python/docs/environment-docs.yml @@ -91,15 +108,18 @@ jobs: if [[ ${{ inputs.is-release }} == "true" ]]; then FILE_HASH="*" - COMMIT_HASH="${{ inputs.git-tag }}" + DOCS_GITHUB_REF="${{ inputs.git-tag }}" + if [[ -z "${DOCS_GITHUB_REF}" ]]; then + DOCS_GITHUB_REF="${GITHUB_REF_NAME}" + fi else FILE_HASH="${{ github.sha }}" - COMMIT_HASH="${{ github.sha }}" + DOCS_GITHUB_REF="${{ github.sha }}" fi # make outputs from the previous job as env vars CUDA_CORE_ARTIFACT_BASENAME="cuda-core-python${PYTHON_VERSION_FORMATTED}-linux-64" - echo "COMMIT_HASH=${COMMIT_HASH}" >> $GITHUB_ENV + echo "CUDA_PYTHON_DOCS_GITHUB_REF=${DOCS_GITHUB_REF}" >> $GITHUB_ENV echo "CUDA_CORE_ARTIFACT_BASENAME=${CUDA_CORE_ARTIFACT_BASENAME}" >> $GITHUB_ENV echo "CUDA_CORE_ARTIFACT_NAME=${CUDA_CORE_ARTIFACT_BASENAME}-${FILE_HASH}" >> $GITHUB_ENV echo "CUDA_CORE_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_core/dist")" >> $GITHUB_ENV @@ -109,7 +129,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@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: cuda-python-wheel path: . @@ -122,7 +142,7 @@ jobs: ls -lahR . - name: Download cuda-pathfinder build artifacts - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: cuda-pathfinder-wheel path: ./cuda_pathfinder @@ -136,14 +156,14 @@ jobs: - name: Download cuda.bindings build artifacts if: ${{ !inputs.is-release }} - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 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@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: pattern: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} merge-multiple: true @@ -158,14 +178,14 @@ jobs: - name: Download cuda.core build artifacts if: ${{ !inputs.is-release }} - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 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@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: pattern: ${{ env.CUDA_CORE_ARTIFACT_NAME }} merge-multiple: true @@ -192,7 +212,9 @@ jobs: pip install *.whl popd - pip install cuda_python*.whl + # Subpackages are already installed from CI artifacts above. + # --no-deps avoids re-resolving cuda-core from PyPI during tag releases. + pip install --no-deps cuda_python*.whl # This step sets the PR_NUMBER/BUILD_LATEST/BUILD_PREVIEW env vars. - name: Get PR number @@ -242,15 +264,82 @@ jobs: fi mv ${COMPONENT}/docs/build/html/* artifacts/docs/${TARGET} - # TODO: Consider removing this step? - - name: Upload doc artifacts - uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0 + - name: Write rendered docs file list + if: ${{ !inputs.is-release && github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }} + run: | + find "${GITHUB_WORKSPACE}/artifacts/docs" -type f -name '*.html' ! -path '*/_static/*' \ + | LC_ALL=C sort > lychee-rendered-html-files.txt + if [[ ! -s lychee-rendered-html-files.txt ]]; then + echo "error: no rendered HTML pages found for lychee" >&2 + exit 1 + fi + wc -l lychee-rendered-html-files.txt + + - name: Restore lychee cache + if: ${{ !inputs.is-release && github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }} + id: restore-lychee-cache + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: .lycheecache + key: docs-rendered-lychee-${{ env.PR_NUMBER }}-${{ github.sha }} + restore-keys: | + docs-rendered-lychee-${{ env.PR_NUMBER }}- + + - name: Check rendered docs links + if: ${{ !inputs.is-release && github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }} + uses: lycheeverse/lychee-action@6da1d14f3a43098a294b7696d93d938aa8d20fc0 # unreleased: supports v0.24.x archive layout + with: + # PR-preview canonical URLs are checked by the preview deployment workflow. + # The cuda-bindings #id links are docutils "problematic" anchors from generated API docs. + # TODO: Remove this exclusion after cybind stops emitting those problematic anchors. + # Preferred Networks rejects hosted-runner GETs, but the URL is browser reachable. + args: >- + --files-from ${{ github.workspace }}/lychee-rendered-html-files.txt + --include-fragments=full + --cache + --max-cache-age 1d + --max-concurrency 16 + --host-concurrency 2 + --host-request-interval 250ms + --max-retries 3 + --retry-wait-time 5 + --timeout 30 + --no-progress + --exclude '^https://nvidia\.github\.io/cuda-python/pr-preview/pr-[0-9]+/' + --exclude '^file://.*/cuda-bindings/latest/module/(driver|runtime)\.html#id[0-9]+$' + --exclude '^https://www\.preferred\.jp/en/?$' + fail: true + failIfEmpty: true + format: markdown + jobSummary: false + lycheeVersion: v0.24.2 + output: lychee-rendered-html.md + token: ${{ github.token }} + + - name: Save lychee cache + if: ${{ always() && !inputs.is-release && github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') && steps.restore-lychee-cache.outputs.cache-hit != 'true' && steps.restore-lychee-cache.outputs.cache-primary-key != '' }} + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: .lycheecache + key: ${{ steps.restore-lychee-cache.outputs.cache-primary-key }} + + - name: Upload docs GitHub Pages artifact + if: ${{ inputs.deploy-docs }} + uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 with: path: artifacts/ retention-days: 3 + - name: Upload dry-run docs artifact + if: ${{ !inputs.deploy-docs || (inputs.is-release && inputs.docs-branch != 'gh-pages') }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: release-docs-dry-run-${{ inputs.component }}-${{ inputs.git-tag }} + path: artifacts/docs/ + retention-days: 3 + - name: Deploy or clean up doc preview - if: ${{ !inputs.is-release }} + if: ${{ inputs.deploy-docs && !inputs.is-release }} uses: ./.github/actions/doc_preview with: source-folder: ${{ (github.ref_name != 'main' && 'artifacts/docs') || @@ -258,12 +347,13 @@ jobs: pr-number: ${{ env.PR_NUMBER }} - name: Deploy doc update - if: ${{ github.ref_name == 'main' || inputs.is-release }} + if: ${{ inputs.deploy-docs && (github.ref_name == 'main' || inputs.is-release) }} uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0 with: git-config-name: cuda-python-bot git-config-email: cuda-python-bot@users.noreply.github.com + branch: ${{ inputs.docs-branch }} folder: artifacts/docs/ target-folder: docs/ - commit-message: "Deploy ${{ (inputs.is-release && 'release') || 'latest' }} docs: ${{ env.COMMIT_HASH }}" + commit-message: "Deploy ${{ (inputs.is-release && 'release') || 'latest' }} docs: ${{ env.CUDA_PYTHON_DOCS_GITHUB_REF }}" clean: false diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 2a227d4ee9f..4dac9c8eca9 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -34,28 +34,38 @@ jobs: - "3.13" - "3.14" - "3.14t" + - "3.15" + - "3.15t" name: py${{ matrix.python-version }} runs-on: ${{ (inputs.host-platform == 'linux-64' && 'linux-amd64-cpu8') || (inputs.host-platform == 'linux-aarch64' && 'linux-arm64-cpu8') || (inputs.host-platform == 'win-64' && 'windows-2022') }} steps: - name: Checkout ${{ github.event.repository.name }} - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: + # Treeless clone: setuptools-scm needs the commit graph (`git describe`) + # but not historical blobs. fetch-depth: 0 + filter: blob:none - # The env vars ACTIONS_CACHE_SERVICE_V2, ACTIONS_RESULTS_URL, and ACTIONS_RUNTIME_TOKEN - # are exposed by this action. - - name: Enable sccache - uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # 0.0.9 + - name: Install latest rapidsai/sccache + if: ${{ startsWith(inputs.host-platform, 'linux') }} + run: | + curl -fsSL "https://github.com/rapidsai/sccache/releases/latest/download/sccache-$(uname -m)-unknown-linux-musl.tar.gz" \ + | sudo tar -C /usr/local/bin -xvzf - --wildcards --strip-components=1 -x '*/sccache' + echo "SCCACHE_PATH=/usr/local/bin/sccache" >> "$GITHUB_ENV" # xref: https://github.com/orgs/community/discussions/42856#discussioncomment-7678867 - name: Adding addtional GHA cache-related env vars - uses: actions/github-script@v8 + uses: actions/github-script@v9 with: script: | - core.exportVariable('ACTIONS_CACHE_URL', process.env['ACTIONS_CACHE_URL']) - core.exportVariable('ACTIONS_RUNTIME_URL', process.env['ACTIONS_RUNTIME_URL']) + core.exportVariable('ACTIONS_CACHE_SERVICE_V2', 'on'); + core.exportVariable('ACTIONS_CACHE_URL', process.env['ACTIONS_CACHE_URL'] || ''); + core.exportVariable('ACTIONS_RESULTS_URL', process.env['ACTIONS_RESULTS_URL'] || ''); + core.exportVariable('ACTIONS_RUNTIME_URL', process.env['ACTIONS_RUNTIME_URL'] || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env['ACTIONS_RUNTIME_TOKEN'] || ''); - name: Setup proxy cache uses: nv-gha-runners/setup-proxy-cache@main @@ -67,7 +77,7 @@ jobs: - name: Set up Python id: setup-python1 - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: # WAR: setup-python is not relocatable, and cibuildwheel hard-wires to 3.12... # see https://github.com/actions/setup-python/issues/871 @@ -75,20 +85,26 @@ jobs: - name: Set up MSVC if: ${{ startsWith(inputs.host-platform, 'win') }} - uses: ilammy/msvc-dev-cmd@v1 # TODO: ask admin to allow pinning commits + uses: step-security/msvc-dev-cmd@22c98154b708dbd743e6f27a933cf6ceba3305c4 # v1.13.1 - name: Set up yq # GitHub made an unprofessional decision to not provide it in their Windows VMs, # see https://github.com/actions/runner-images/issues/7443. if: ${{ startsWith(inputs.host-platform, 'win') }} env: - # doesn't seem there's an easy way to avoid hard-coding it? - YQ_URL: https://github.com/mikefarah/yq/releases/latest/download/yq_windows_amd64.exe - YQ_DIR: yq_latest + YQ_VERSION: v4.52.5 + YQ_SHA256: 47594981f3848a4b4447494adeca9555f908f7cf0a89c4da3fd0243a4631da1c + YQ_DIR: yq shell: pwsh -command ". '{0}'" run: | + $yqUrl = "https://github.com/mikefarah/yq/releases/download/${env:YQ_VERSION}/yq_windows_amd64.exe" mkdir -Force -ErrorAction SilentlyContinue "${env:YQ_DIR}" | Out-Null - Invoke-WebRequest -UseBasicParsing -OutFile "${env:YQ_DIR}/yq.exe" -Uri "$env:YQ_URL" + Invoke-WebRequest -UseBasicParsing -OutFile "${env:YQ_DIR}/yq.exe" -Uri "$yqUrl" + $hash = (Get-FileHash -Algorithm SHA256 "${env:YQ_DIR}/yq.exe").Hash.ToLower() + if ($hash -ne $env:YQ_SHA256) { + Write-Error "SHA256 mismatch for yq: expected $env:YQ_SHA256, got $hash" + exit 1 + } ls -l $env:YQ_DIR echo "$((Get-Location).Path)\\$env:YQ_DIR" >> $env:GITHUB_PATH $env:Path += ";$((Get-Location).Path)\\$env:YQ_DIR" @@ -136,7 +152,7 @@ jobs: - name: Upload cuda.pathfinder build artifacts if: ${{ strategy.job-index == 0 && inputs.host-platform == 'linux-64' }} - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: cuda-pathfinder-wheel path: cuda_pathfinder/*.whl @@ -150,12 +166,17 @@ jobs: cuda-version: ${{ inputs.cuda-version }} - name: Build cuda.bindings wheel - uses: pypa/cibuildwheel@298ed2fb2c105540f5ed055e8a6ad78d82dd3a7e # v3.3.1 + uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0 with: package-dir: ./cuda_bindings/ output-dir: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} env: CIBW_BUILD: ${{ env.CIBW_BUILD }} + # TODO: remove cpython-prerelease once 3.15 is officially supported + # Allow CPython pre-release builds (currently 3.15 / 3.15t). This is a + # no-op for stable Python versions because CIBW_BUILD still filters + # the target version. + CIBW_ENABLE: cpython-prerelease # CIBW mounts the host filesystem under /host CIBW_ENVIRONMENT_LINUX: > CUDA_PATH=/host/${{ env.CUDA_PATH }} @@ -175,13 +196,22 @@ jobs: CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} # check cache stats before leaving cibuildwheel CIBW_BEFORE_TEST_LINUX: > - "/host/${{ env.SCCACHE_PATH }}" --show-stats + "/host/${{ env.SCCACHE_PATH }}" --show-adv-stats && + "/host/${{ env.SCCACHE_PATH }}" --show-stats --stats-format=json > /host/${{ github.workspace }}/sccache_bindings.json # force the test stage to be run (so that before-test is not skipped) # TODO: we might want to think twice on adding this, it does a lot of # things before reaching this command. CIBW_TEST_COMMAND: > echo "ok!" + - name: Report sccache stats (cuda.bindings) + if: ${{ inputs.host-platform != 'win-64' }} + uses: ./.github/actions/sccache-summary + with: + json-file: sccache_bindings.json + label: "cuda.bindings" + build-step: "Build cuda.bindings wheel" + - name: List the cuda.bindings artifacts directory run: | if [[ "${{ inputs.host-platform }}" == win* ]]; then @@ -197,19 +227,24 @@ jobs: twine check --strict ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl - name: Upload cuda.bindings build artifacts - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl if-no-files-found: error - name: Build cuda.core wheel - uses: pypa/cibuildwheel@298ed2fb2c105540f5ed055e8a6ad78d82dd3a7e # v3.3.1 + uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0 with: package-dir: ./cuda_core/ output-dir: ${{ env.CUDA_CORE_ARTIFACTS_DIR }} env: CIBW_BUILD: ${{ env.CIBW_BUILD }} + # TODO: remove cpython-prerelease once 3.15 is officially supported + # Allow CPython pre-release builds (currently 3.15 / 3.15t). This is a + # no-op for stable Python versions because CIBW_BUILD still filters + # the target version. + CIBW_ENABLE: cpython-prerelease # CIBW mounts the host filesystem under /host CIBW_ENVIRONMENT_LINUX: > CUDA_PATH=/host/${{ env.CUDA_PATH }} @@ -233,13 +268,22 @@ jobs: PIP_FIND_LINKS="$(cygpath -w ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }})" # check cache stats before leaving cibuildwheel CIBW_BEFORE_TEST_LINUX: > - "/host${{ env.SCCACHE_PATH }}" --show-stats + "/host${{ env.SCCACHE_PATH }}" --show-adv-stats && + "/host${{ env.SCCACHE_PATH }}" --show-stats --stats-format=json > /host/${{ github.workspace }}/sccache_core.json # force the test stage to be run (so that before-test is not skipped) # TODO: we might want to think twice on adding this, it does a lot of # things before reaching this command. CIBW_TEST_COMMAND: > echo "ok!" + - name: Report sccache stats (cuda.core) + if: ${{ inputs.host-platform != 'win-64' }} + uses: ./.github/actions/sccache-summary + with: + json-file: sccache_core.json + label: "cuda.core" + build-step: "Build cuda.core wheel" + - name: List the cuda.core artifacts directory and rename run: | if [[ "${{ inputs.host-platform }}" == win* ]]; then @@ -284,7 +328,7 @@ jobs: - name: Upload cuda-python build artifacts if: ${{ strategy.job-index == 0 && inputs.host-platform == 'linux-64' }} - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: cuda-python-wheel path: cuda_python/*.whl @@ -292,9 +336,11 @@ jobs: - name: Set up Python id: setup-python2 - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: ${{ matrix.python-version }} + # TODO: remove allow-prereleases once 3.15 is officially supported + allow-prereleases: ${{ startsWith(matrix.python-version, '3.15') }} - name: verify free-threaded build if: endsWith(matrix.python-version, 't') @@ -314,6 +360,71 @@ jobs: run: | pip install cuda_pathfinder/*.whl + - name: Hide GNU link.exe so Meson finds MSVC link.exe + if: ${{ startsWith(inputs.host-platform, 'win') }} + run: | + if [ -f "/c/Program Files/Git/usr/bin/link.exe" ]; then + mv "/c/Program Files/Git/usr/bin/link.exe" "/c/Program Files/Git/usr/bin/link.exe.bak" + fi + + # TODO: remove the numpy pre-build steps once 3.15 is officially supported + # (numpy will publish pre-built 3.15 wheels at that point) + - name: Download and patch numpy sdist (pre-release Python) + if: ${{ startsWith(matrix.python-version, '3.15') }} + run: | + pip download --no-binary numpy --no-deps "numpy>=1.21.1" -d numpy-sdist/ + cd numpy-sdist && tar xf numpy-*.tar.gz && rm numpy-*.tar.gz + # WAR: numpy 2.4.x ships [tool.cibuildwheel] config that is + # incompatible with cibuildwheel v4.0 (cpython-freethreading enable + # group, OpenBLAS before-build scripts, etc.). Strip the cibuildwheel + # sections but preserve [tool.meson-python] (vendored meson path). + python -c " + import glob + for f in glob.glob('numpy-*/pyproject.toml'): + lines, skip = open(f).readlines(), False + out = [] + for line in lines: + hdr = line.strip() + if hdr.startswith('[tool.cibuildwheel') or hdr.startswith('[[tool.cibuildwheel'): + skip = True + continue + if skip and hdr.startswith('[') and 'cibuildwheel' not in hdr: + skip = False + if not skip: + out.append(line) + open(f, 'w').writelines(out) + " + echo "NUMPY_SRC_DIR=$(pwd)/$(ls -d numpy-*/)" >> $GITHUB_ENV + + - name: Build numpy wheel (pre-release Python) + if: ${{ startsWith(matrix.python-version, '3.15') }} + uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0 + env: + CIBW_BUILD: ${{ env.CIBW_BUILD }} + CIBW_SKIP: "*-musllinux* *-win32" + CIBW_ARCHS_LINUX: "native" + CIBW_BUILD_VERBOSITY: 1 + CIBW_CONFIG_SETTINGS: "setup-args=-Dallow-noblas=true" + CIBW_CONFIG_SETTINGS_WINDOWS: "setup-args=--vsenv setup-args=-Dallow-noblas=true" + CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel" + CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}" + CIBW_ENABLE: "cpython-prerelease" + with: + package-dir: ${{ env.NUMPY_SRC_DIR }} + output-dir: numpy-wheel/ + + - name: Upload numpy wheel + if: ${{ startsWith(matrix.python-version, '3.15') }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: numpy-python${{ env.PYTHON_VERSION_FORMATTED }}-${{ inputs.host-platform }} + path: numpy-wheel/*.whl + if-no-files-found: error + + - name: Install numpy wheel + if: ${{ startsWith(matrix.python-version, '3.15') }} + run: pip install numpy-wheel/*.whl + - name: Build cuda.bindings Cython tests run: | pip install ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl --group ./cuda_bindings/pyproject.toml:test @@ -322,7 +433,7 @@ jobs: popd - name: Upload cuda.bindings Cython tests - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}-tests path: ${{ env.CUDA_BINDINGS_CYTHON_TESTS_DIR }}/test_*${{ env.PY_EXT_SUFFIX }} @@ -336,7 +447,7 @@ jobs: popd - name: Upload cuda.core Cython tests - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-tests path: ${{ env.CUDA_CORE_CYTHON_TESTS_DIR }}/test_*${{ env.PY_EXT_SUFFIX }} @@ -351,6 +462,21 @@ jobs: cuda-version: ${{ inputs.prev-cuda-version }} cuda-path: "./cuda_toolkit_prev" + - name: Build cuda.core test binaries + run: | + nvcc --version + python "${{ env.CUDA_CORE_TEST_BINARIES_DIR }}/build_test_binaries.py" + + - name: Upload cuda.core test binaries + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-test-binaries + path: | + ${{ env.CUDA_CORE_TEST_BINARIES_DIR }}/*.o + ${{ env.CUDA_CORE_TEST_BINARIES_DIR }}/*.a + ${{ env.CUDA_CORE_TEST_BINARIES_DIR }}/*.lib + if-no-files-found: error + - name: Download cuda.bindings build artifacts from the prior branch env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -369,11 +495,7 @@ jobs: OLD_BRANCH=$(yq '.backport_branch' ci/versions.yml) 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 "ci.yml" -s success -R NVIDIA/cuda-python --json databaseId | jq '.[]| .databaseId') - if [[ "$LATEST_PRIOR_RUN_ID" == "" ]]; then - echo "LATEST_PRIOR_RUN_ID not found!" - exit 1 - fi + LATEST_PRIOR_RUN_ID=$(./ci/tools/lookup-run-id --branch "${OLD_BRANCH}" NVIDIA/cuda-python "CI") gh run download $LATEST_PRIOR_RUN_ID -p ${OLD_BASENAME} -R NVIDIA/cuda-python rm -rf ${OLD_BASENAME}-tests # exclude cython test artifacts @@ -383,12 +505,17 @@ jobs: rmdir $OLD_BASENAME - name: Build cuda.core wheel - uses: pypa/cibuildwheel@298ed2fb2c105540f5ed055e8a6ad78d82dd3a7e # v3.3.1 + uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0 with: package-dir: ./cuda_core/ output-dir: ${{ env.CUDA_CORE_ARTIFACTS_DIR }} env: CIBW_BUILD: ${{ env.CIBW_BUILD }} + # TODO: remove cpython-prerelease once 3.15 is officially supported + # Allow CPython pre-release builds (currently 3.15 / 3.15t). This is a + # no-op for stable Python versions because CIBW_BUILD still filters + # the target version. + CIBW_ENABLE: cpython-prerelease # CIBW mounts the host filesystem under /host CIBW_ENVIRONMENT_LINUX: > CUDA_PATH=/host/${{ env.CUDA_PATH }} @@ -412,13 +539,22 @@ jobs: PIP_FIND_LINKS="$(cygpath -w ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }})" # check cache stats before leaving cibuildwheel CIBW_BEFORE_TEST_LINUX: > - "/host${{ env.SCCACHE_PATH }}" --show-stats + "/host${{ env.SCCACHE_PATH }}" --show-adv-stats && + "/host${{ env.SCCACHE_PATH }}" --show-stats --stats-format=json > /host/${{ github.workspace }}/sccache_core_prev.json # force the test stage to be run (so that before-test is not skipped) # TODO: we might want to think twice on adding this, it does a lot of # things before reaching this command. CIBW_TEST_COMMAND: > echo "ok!" + - name: Report sccache stats (cuda.core prev) + if: ${{ inputs.host-platform != 'win-64' }} + uses: ./.github/actions/sccache-summary + with: + json-file: sccache_core_prev.json + label: "cuda.core (prev CTK)" + build-step: "Build cuda.core wheel" + - name: List the cuda.core artifacts directory and rename run: | if [[ "${{ inputs.host-platform }}" == win* ]]; then @@ -455,7 +591,7 @@ jobs: twine check --strict ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl - name: Upload cuda.core build artifacts - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: ${{ env.CUDA_CORE_ARTIFACT_NAME }} path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl diff --git a/.github/workflows/ci-nightly.yml b/.github/workflows/ci-nightly.yml new file mode 100644 index 00000000000..0188ebf2524 --- /dev/null +++ b/.github/workflows/ci-nightly.yml @@ -0,0 +1,365 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +# Nightly CI pipeline that tests optional dependencies (PyTorch, numba-cuda) +# against the latest cuda-python wheels built on main, runs the standard +# test suite on runners reserved for nightly-only use (e.g. arm64 l4×2), and +# exercises release-time CI helper scripts so they do not silently rot between releases. +# +# This workflow does NOT build wheels — it downloads them from the latest +# successful CI run on main and runs integration/standard tests. + +name: "CI: Nightly optional-deps" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} + cancel-in-progress: true + +on: + schedule: + # 2:17 AM UTC daily, after the midnight main CI build finishes. + # Avoid minute 0 because GitHub documents high scheduled-workflow load + # at the start of every hour, where queued jobs may be delayed or dropped. + - cron: "17 2 * * *" + workflow_dispatch: + inputs: + run-id: + description: > + Override the CI run ID to download artifacts from. + Leave empty to auto-detect the latest successful main run. + type: string + default: '' + +jobs: + test-ci-tools-for-release: + name: "Nightly: CI tools for release" + if: ${{ github.repository_owner == 'nvidia' }} + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + with: + fetch-depth: 1 + + - name: Run CI tools unit tests + run: | + python -m pip install pytest + # Standalone CI tool tests; skip repo-root conftest.py (imports cuda.pathfinder). + python -m pytest -v --noconftest ci/tools/tests + + find-wheels: + runs-on: ubuntu-latest + outputs: + RUN_ID: ${{ steps.find.outputs.run_id }} + HEAD_SHA: ${{ steps.find.outputs.head_sha }} + CUDA_BUILD_VER: ${{ steps.find.outputs.cuda_build_ver }} + steps: + - name: Checkout repository + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + fetch-depth: 1 + + - name: Find latest successful CI run on main + id: find + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + if [[ -n "${{ inputs.run-id }}" ]]; then + RUN_ID="${{ inputs.run-id }}" + HEAD_SHA=$(gh run view "$RUN_ID" \ + -R "${{ github.repository }}" \ + --json headSha | jq -r '.headSha') + else + # lookup-run-id --branch --head-sha prints two lines: run_id then head_sha + OUTPUT=$(./ci/tools/lookup-run-id --branch main --head-sha "${{ github.repository }}" "CI") + RUN_ID=$(echo "$OUTPUT" | sed -n '1p') + HEAD_SHA=$(echo "$OUTPUT" | sed -n '2p') + fi + + if [[ -z "$HEAD_SHA" || "$HEAD_SHA" == "null" ]]; then + echo "::error::Could not resolve head SHA for CI run $RUN_ID" + exit 1 + fi + + CUDA_BUILD_VER=$(gh api \ + "repos/${{ github.repository }}/contents/ci/versions.yml?ref=$HEAD_SHA" \ + --jq '.content' \ + | base64 -d \ + | yq '.cuda.build.version') + + if [[ -z "$CUDA_BUILD_VER" || "$CUDA_BUILD_VER" == "null" ]]; then + echo "::error::Could not resolve CUDA build version from $HEAD_SHA" + exit 1 + fi + + echo "run_id=$RUN_ID" >> $GITHUB_OUTPUT + echo "head_sha=$HEAD_SHA" >> $GITHUB_OUTPUT + echo "cuda_build_ver=$CUDA_BUILD_VER" >> $GITHUB_OUTPUT + + # ── PyTorch interop tests ── + + test-pytorch-linux: + name: "Nightly PyTorch (linux-64)" + if: ${{ github.repository_owner == 'nvidia' }} + needs: find-wheels + permissions: + contents: read + actions: read + secrets: inherit + uses: ./.github/workflows/test-wheel-linux.yml + with: + build-type: nightly + host-platform: linux-64 + build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_BUILD_VER }} + run-id: ${{ needs.find-wheels.outputs.RUN_ID }} + sha: ${{ needs.find-wheels.outputs.HEAD_SHA }} + test-mode: nightly-pytorch + matrix_filter: 'map(select(.ENV.MODE == "nightly-pytorch"))' + + test-pytorch-linux-aarch64: + name: "Nightly PyTorch (linux-aarch64)" + if: ${{ github.repository_owner == 'nvidia' }} + needs: find-wheels + permissions: + contents: read + actions: read + secrets: inherit + uses: ./.github/workflows/test-wheel-linux.yml + with: + build-type: nightly + host-platform: linux-aarch64 + build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_BUILD_VER }} + run-id: ${{ needs.find-wheels.outputs.RUN_ID }} + sha: ${{ needs.find-wheels.outputs.HEAD_SHA }} + test-mode: nightly-pytorch + matrix_filter: 'map(select(.ENV.MODE == "nightly-pytorch"))' + + test-pytorch-windows: + name: "Nightly PyTorch (win-64)" + if: ${{ github.repository_owner == 'nvidia' }} + needs: find-wheels + permissions: + contents: read + actions: read + secrets: inherit + uses: ./.github/workflows/test-wheel-windows.yml + with: + build-type: nightly + host-platform: win-64 + build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_BUILD_VER }} + run-id: ${{ needs.find-wheels.outputs.RUN_ID }} + sha: ${{ needs.find-wheels.outputs.HEAD_SHA }} + test-mode: nightly-pytorch + matrix_filter: 'map(select(.ENV.MODE == "nightly-pytorch"))' + + # ── numba-cuda tests ── + + test-numba-cuda-linux-64: + name: "Nightly numba-cuda (linux-64)" + if: ${{ github.repository_owner == 'nvidia' }} + needs: find-wheels + permissions: + contents: read + actions: read + secrets: inherit + uses: ./.github/workflows/test-wheel-linux.yml + with: + build-type: nightly + host-platform: linux-64 + build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_BUILD_VER }} + run-id: ${{ needs.find-wheels.outputs.RUN_ID }} + sha: ${{ needs.find-wheels.outputs.HEAD_SHA }} + test-mode: nightly-numba-cuda + matrix_filter: 'map(select(.ENV.MODE == "nightly-numba-cuda"))' + + test-numba-cuda-linux-aarch64: + name: "Nightly numba-cuda (linux-aarch64)" + if: ${{ github.repository_owner == 'nvidia' }} + needs: find-wheels + permissions: + contents: read + actions: read + secrets: inherit + uses: ./.github/workflows/test-wheel-linux.yml + with: + build-type: nightly + host-platform: linux-aarch64 + build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_BUILD_VER }} + run-id: ${{ needs.find-wheels.outputs.RUN_ID }} + sha: ${{ needs.find-wheels.outputs.HEAD_SHA }} + test-mode: nightly-numba-cuda + matrix_filter: 'map(select(.ENV.MODE == "nightly-numba-cuda"))' + + test-numba-cuda-windows: + name: "Nightly numba-cuda (win-64)" + if: ${{ github.repository_owner == 'nvidia' }} + needs: find-wheels + permissions: + contents: read + actions: read + secrets: inherit + uses: ./.github/workflows/test-wheel-windows.yml + with: + build-type: nightly + host-platform: win-64 + build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_BUILD_VER }} + run-id: ${{ needs.find-wheels.outputs.RUN_ID }} + sha: ${{ needs.find-wheels.outputs.HEAD_SHA }} + test-mode: nightly-numba-cuda + matrix_filter: 'map(select(.ENV.MODE == "nightly-numba-cuda"))' + + # ── numba-cuda-mlir tests ── + + test-numba-cuda-mlir-linux-64: + name: "Nightly numba-cuda-mlir (linux-64)" + if: ${{ github.repository_owner == 'nvidia' }} + needs: find-wheels + permissions: + contents: read + actions: read + secrets: inherit + uses: ./.github/workflows/test-wheel-linux.yml + with: + build-type: nightly + host-platform: linux-64 + build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_BUILD_VER }} + run-id: ${{ needs.find-wheels.outputs.RUN_ID }} + sha: ${{ needs.find-wheels.outputs.HEAD_SHA }} + test-mode: nightly-numba-cuda-mlir + matrix_filter: 'map(select(.ENV.MODE == "nightly-numba-cuda-mlir"))' + + test-numba-cuda-mlir-windows: + name: "Nightly numba-cuda-mlir (win-64)" + if: ${{ github.repository_owner == 'nvidia' }} + needs: find-wheels + permissions: + contents: read + actions: read + secrets: inherit + uses: ./.github/workflows/test-wheel-windows.yml + with: + build-type: nightly + host-platform: win-64 + build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_BUILD_VER }} + run-id: ${{ needs.find-wheels.outputs.RUN_ID }} + sha: ${{ needs.find-wheels.outputs.HEAD_SHA }} + test-mode: nightly-numba-cuda-mlir + matrix_filter: 'map(select(.ENV.MODE == "nightly-numba-cuda-mlir"))' + + # ── Released cuda-core against main pathfinder/bindings ── + + test-cuda-core-linux-64: + name: "Nightly cuda-core (linux-64)" + if: ${{ github.repository_owner == 'nvidia' }} + needs: find-wheels + permissions: + contents: read + actions: read + secrets: inherit + uses: ./.github/workflows/test-wheel-linux.yml + with: + build-type: nightly + host-platform: linux-64 + build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_BUILD_VER }} + run-id: ${{ needs.find-wheels.outputs.RUN_ID }} + sha: ${{ needs.find-wheels.outputs.HEAD_SHA }} + test-mode: nightly-cuda-core + matrix_filter: 'map(select(.ENV.MODE == "nightly-cuda-core"))' + + test-cuda-core-windows: + name: "Nightly cuda-core (win-64)" + if: ${{ github.repository_owner == 'nvidia' }} + needs: find-wheels + permissions: + contents: read + actions: read + secrets: inherit + uses: ./.github/workflows/test-wheel-windows.yml + with: + build-type: nightly + host-platform: win-64 + build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_BUILD_VER }} + run-id: ${{ needs.find-wheels.outputs.RUN_ID }} + sha: ${{ needs.find-wheels.outputs.HEAD_SHA }} + test-mode: nightly-cuda-core + matrix_filter: 'map(select(.ENV.MODE == "nightly-cuda-core"))' + + # ── Standard tests on nightly-only runners ── + + test-standard-linux-aarch64: + name: "Nightly standard (linux-aarch64)" + if: ${{ github.repository_owner == 'nvidia' }} + needs: find-wheels + permissions: + contents: read + actions: read + secrets: inherit + uses: ./.github/workflows/test-wheel-linux.yml + with: + build-type: nightly + host-platform: linux-aarch64 + build-ctk-ver: ${{ needs.find-wheels.outputs.CUDA_BUILD_VER }} + run-id: ${{ needs.find-wheels.outputs.RUN_ID }} + sha: ${{ needs.find-wheels.outputs.HEAD_SHA }} + test-mode: standard + matrix_filter: 'map(select(.ENV.MODE == "nightly-standard"))' + + # ── Status check ── + + checks: + name: Nightly check status + if: always() + runs-on: ubuntu-latest + needs: + - test-ci-tools-for-release + - find-wheels + - test-pytorch-linux + - test-pytorch-linux-aarch64 + - test-pytorch-windows + - test-numba-cuda-linux-64 + - test-numba-cuda-linux-aarch64 + - test-numba-cuda-windows + - test-numba-cuda-mlir-linux-64 + - test-numba-cuda-mlir-windows + - test-cuda-core-linux-64 + - test-cuda-core-windows + - test-standard-linux-aarch64 + steps: + - name: Exit + run: | + # If any dependency was cancelled or failed, that's a failure. + # + # See ci.yml for the full rationale on why we must use always() + # and explicitly check each result rather than relying on the + # default behaviour. + if ${{ needs.test-ci-tools-for-release.result == 'cancelled' || + needs.test-ci-tools-for-release.result == 'failure' || + needs.find-wheels.result != 'success' }}; then + exit 1 + fi + if ${{ needs.test-pytorch-linux.result == 'cancelled' || + needs.test-pytorch-linux.result == 'failure' || + needs.test-pytorch-linux-aarch64.result == 'cancelled' || + needs.test-pytorch-linux-aarch64.result == 'failure' || + needs.test-pytorch-windows.result == 'cancelled' || + needs.test-pytorch-windows.result == 'failure' || + needs.test-numba-cuda-linux-64.result == 'cancelled' || + needs.test-numba-cuda-linux-64.result == 'failure' || + needs.test-numba-cuda-linux-aarch64.result == 'cancelled' || + needs.test-numba-cuda-linux-aarch64.result == 'failure' || + needs.test-numba-cuda-windows.result == 'cancelled' || + needs.test-numba-cuda-windows.result == 'failure' || + needs.test-numba-cuda-mlir-linux-64.result == 'cancelled' || + needs.test-numba-cuda-mlir-linux-64.result == 'failure' || + needs.test-numba-cuda-mlir-windows.result == 'cancelled' || + needs.test-numba-cuda-mlir-windows.result == 'failure' || + needs.test-cuda-core-linux-64.result == 'cancelled' || + needs.test-cuda-core-linux-64.result == 'failure' || + needs.test-cuda-core-windows.result == 'cancelled' || + needs.test-cuda-core-windows.result == 'failure' || + needs.test-standard-linux-aarch64.result == 'cancelled' || + needs.test-standard-linux-aarch64.result == 'failure' }}; then + exit 1 + fi + exit 0 diff --git a/.github/workflows/ci-pixi-source-test.yml b/.github/workflows/ci-pixi-source-test.yml new file mode 100644 index 00000000000..563b69d0e23 --- /dev/null +++ b/.github/workflows/ci-pixi-source-test.yml @@ -0,0 +1,149 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +# Validates the `pixi run test` developer workflow (source build + Cython +# codegen + test suite via the pixi-managed environment). +# +# WHY THIS EXISTS: the main CI (ci.yml / test-wheel-*.yml) tests prebuilt +# *wheels*; it never exercises the pixi *source build*. That path rots silently +# whenever the CUDA pin, generated bindings, conda-forge packages, or the +# cython-test build mechanics drift (see #2182, #2183). This workflow is the +# only thing that runs the pixi source build end to end. +# +# Two tiers, to spend GPU minutes deliberately (GPUs are scarce): +# - build-smoke (PRs): CPU-only. Source-builds bindings + core, imports them, +# builds the cython test extensions and checks placement. Catches the +# compile / ABI / .so-placement regressions WITHOUT a GPU. +# - full-test (nightly + manual): GPU runner, full `pixi run test`. + +name: "CI: pixi run test (source build)" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} + cancel-in-progress: true + +on: + schedule: + # 2:37 AM UTC daily — offset from ci-nightly.yml (2:17) to avoid contending + # for the same scheduled-workflow window. + - cron: "37 2 * * *" + pull_request: + # Only the files that can break the source-build path (see #2182/#2183). + paths: + - "**/pixi.toml" + - "**/pixi.lock" + - "cuda_bindings/build_hooks.py" + - "cuda_core/build_hooks.py" + - "cuda_bindings/cuda/bindings/**" # generated bindings sources + - "cuda_bindings/tests/cython/**" + - "cuda_core/tests/cython/**" + - "ci/versions.yml" + - ".github/workflows/ci-pixi-source-test.yml" + workflow_dispatch: + inputs: + cuda-env: + description: "pixi environment to test (cu13 or cu12)." + type: string + default: "cu13" + +defaults: + run: + shell: bash --noprofile --norc -xeuo pipefail {0} + +env: + PIXI_VERSION: "v0.66.0" # keep in sync with the version developers run locally + +jobs: + # ── PR guard: CPU-only build + import + placement smoke ── + build-smoke: + name: "build smoke (cu13, linux-64, CPU)" + if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - name: Checkout ${{ github.event.repository.name }} + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + # Full history + tags so setuptools-scm derives the real (13.x) + # package version; a shallow checkout yields 0.1.dev1, which trips + # cuda.core's "cuda.bindings 12.x or 13.x must be installed" guard. + fetch-depth: 0 + + - name: Setup pixi + # Pinned to a commit SHA; install logic lives in the action and is + # auditable/pinned (vs. a curl|bash of an unverified installer). + uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.6 + with: + pixi-version: ${{ env.PIXI_VERSION }} + run-install: false + + - name: Source-build + import + cython-placement smoke + env: + CUDA_ENV: ${{ inputs.cuda-env || 'cu13' }} + run: | + # pathfinder: pure-Python, no GPU. + pixi run -e "${CUDA_ENV}" test-pathfinder + + # bindings + core: force the source build (catches nvrtc/driver + # compile errors like #2182) and import them (catches ABI mismatches). + pixi run --manifest-path cuda_bindings -e "${CUDA_ENV}" \ + python -c "import cuda.bindings.driver, cuda.bindings.nvrtc, cuda.bindings.runtime; print('bindings import OK')" + pixi run --manifest-path cuda_core -e "${CUDA_ENV}" \ + python -c "import cuda.core; print('core import OK')" + + # cython test extensions: build them and confirm each .so landed next + # to its .pyx in tests/cython (catches the placement regression #2180). + pixi run --manifest-path cuda_bindings -e "${CUDA_ENV}" build-cython-tests + pixi run --manifest-path cuda_core -e "${CUDA_ENV}" build-cython-tests + for d in cuda_bindings/tests/cython cuda_core/tests/cython; do + if ! compgen -G "${d}/*.cpython-*.so" > /dev/null; then + echo "::error::no compiled cython test .so in ${d} (placement regression)" + exit 1 + fi + done + echo "cython test extensions placed correctly" + + # ── Nightly: full `pixi run test` on a GPU runner ── + full-test: + name: "pixi run test (${{ inputs.cuda-env || 'cu13' }}, linux-64, GPU)" + if: ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && github.repository_owner == 'nvidia' }} + runs-on: "linux-amd64-gpu-l4-latest-1" # same label scheme as test-wheel-linux.yml + timeout-minutes: 90 + container: + options: -u root --security-opt seccomp=unconfined --shm-size 16g + image: ubuntu:24.04 + steps: + - name: Ensure GPU is working + run: nvidia-smi + + - name: Install system packages + run: | + apt-get update + # ca-certificates + git for checkout; libgl1/libegl1 for pyglet + # (pulled in by the test env). pixi itself is installed by setup-pixi. + apt-get install -y --no-install-recommends \ + ca-certificates git libgl1 libegl1 + + - name: Checkout ${{ github.event.repository.name }} + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + # Full history + tags so setuptools-scm derives the real (13.x) + # package version; a shallow checkout yields 0.1.dev1, which trips + # cuda.core's "cuda.bindings 12.x or 13.x must be installed" guard. + fetch-depth: 0 + + - name: Setup proxy cache + uses: nv-gha-runners/setup-proxy-cache@main + continue-on-error: true + + - name: Setup pixi + # Pinned to a commit SHA; install logic lives in the action and is + # auditable/pinned (vs. a curl|bash of an unverified installer). + uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.6 + with: + pixi-version: ${{ env.PIXI_VERSION }} + run-install: false + + - name: pixi run test + run: pixi run -e "${{ inputs.cuda-env || 'cu13' }}" test diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7e0c652243..fe43b52d01a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,7 @@ on: schedule: # every 24 hours at midnight UTC - cron: "0 0 * * *" + workflow_dispatch: {} jobs: ci-vars: @@ -33,9 +34,9 @@ jobs: CUDA_PREV_BUILD_VER: ${{ steps.get-vars.outputs.cuda_prev_build_ver }} steps: - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: - fetch-depth: 0 + fetch-depth: 1 - name: Get CUDA build versions id: get-vars run: | @@ -52,7 +53,7 @@ jobs: doc-only: ${{ steps.get-should-skip.outputs.doc_only }} steps: - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Compute whether to skip builds and tests id: get-should-skip env: @@ -71,6 +72,162 @@ jobs: echo "skip=${skip}" >> "$GITHUB_OUTPUT" echo "doc_only=${doc_only}" >> "$GITHUB_OUTPUT" + # Detect which top-level modules were touched by the PR so downstream build + # and test jobs can avoid rebuilding/retesting modules unaffected by the + # change. See issue #299. + # + # Dependency graph (verified in pyproject.toml files): + # cuda_pathfinder -> (no internal deps) + # cuda_bindings -> cuda_pathfinder + # cuda_core -> cuda_pathfinder, cuda_bindings + # cuda_python -> cuda_bindings (meta package) + # + # A change to cuda_pathfinder (or shared infra) forces a rebuild of every + # downstream module. A change to cuda_bindings forces rebuild of cuda_core. + # A change to cuda_core alone skips rebuilding/retesting cuda_bindings. + # On push to main, tag refs, schedule, or workflow_dispatch events we + # unconditionally run everything because there is no meaningful "changed + # paths" baseline for those events. + detect-changes: + runs-on: ubuntu-latest + outputs: + bindings: ${{ steps.compose.outputs.bindings }} + core: ${{ steps.compose.outputs.core }} + pathfinder: ${{ steps.compose.outputs.pathfinder }} + python_meta: ${{ steps.compose.outputs.python_meta }} + test_helpers: ${{ steps.compose.outputs.test_helpers }} + shared: ${{ steps.compose.outputs.shared }} + build_bindings: ${{ steps.compose.outputs.build_bindings }} + build_core: ${{ steps.compose.outputs.build_core }} + build_pathfinder: ${{ steps.compose.outputs.build_pathfinder }} + test_bindings: ${{ steps.compose.outputs.test_bindings }} + test_core: ${{ steps.compose.outputs.test_core }} + test_pathfinder: ${{ steps.compose.outputs.test_pathfinder }} + steps: + - name: Checkout repository + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + # Treeless clone: commit graph is needed for `git merge-base` and + # `git diff --name-only` below, but historical blobs aren't. + fetch-depth: 0 + filter: blob:none + + # copy-pr-bot pushes every PR (whether it targets main or a backport + # branch such as 12.9.x) to pull-request/, so the base branch + # cannot be inferred from github.ref_name. Look it up via the + # upstream PR metadata so the diff below is rooted at the right place. + - name: Resolve PR base branch + id: pr-info + if: ${{ startsWith(github.ref_name, 'pull-request/') }} + uses: nv-gha-runners/get-pr-info@main + + - name: Detect changed paths + id: filter + if: ${{ startsWith(github.ref_name, 'pull-request/') }} + env: + # GitHub Actions evaluates step-level `env:` expressions eagerly — + # the step's `if:` gate does NOT short-circuit them. On non-PR + # events (push/tag/schedule), `pr-info` is skipped and its outputs + # are empty strings, so `fromJSON('')` would raise a template error + # and fail the step despite `if:` being false. Guard the + # `fromJSON` call with a short-circuit so the expression resolves + # to an empty string on non-PR events; the step is still gated + # off by `if:`, so `BASE_REF` is never consumed there. + BASE_REF: ${{ steps.pr-info.outputs.pr-info && fromJSON(steps.pr-info.outputs.pr-info).base.ref || '' }} + run: | + # Diff against the merge base with the PR's actual target branch. + # Uses merge-base so diverged branches only show files changed on + # the PR side, not upstream commits. + if [[ -z "${BASE_REF}" ]]; then + echo "Could not resolve PR base branch from get-pr-info output" >&2 + exit 1 + fi + base=$(git merge-base HEAD "origin/${BASE_REF}") + changed=$(git diff --name-only "$base"...HEAD) + + has_match() { + grep -qE "$1" <<< "$changed" && echo true || echo false + } + + { + echo "bindings=$(has_match '^cuda_bindings/')" + echo "core=$(has_match '^cuda_core/')" + echo "pathfinder=$(has_match '^cuda_pathfinder/')" + echo "python_meta=$(has_match '^cuda_python/')" + echo "test_helpers=$(has_match '^cuda_python_test_helpers/')" + echo "shared=$(has_match '^(\.github/|ci/|scripts/|toolshed/|conftest\.py$|pyproject\.toml$|pixi\.(toml|lock)$|pytest\.ini$|ruff\.toml$)')" + } >> "$GITHUB_OUTPUT" + + - name: Compose gating outputs + id: compose + env: + IS_PR: ${{ startsWith(github.ref_name, 'pull-request/') }} + BINDINGS: ${{ steps.filter.outputs.bindings || 'false' }} + CORE: ${{ steps.filter.outputs.core || 'false' }} + PATHFINDER: ${{ steps.filter.outputs.pathfinder || 'false' }} + PYTHON_META: ${{ steps.filter.outputs.python_meta || 'false' }} + TEST_HELPERS: ${{ steps.filter.outputs.test_helpers || 'false' }} + SHARED: ${{ steps.filter.outputs.shared || 'false' }} + run: | + set -euxo pipefail + # Non-PR events (push to main, tag push, schedule, workflow_dispatch) + # always exercise the full pipeline because there is no baseline for + # a meaningful diff. + if [[ "${IS_PR}" != "true" ]]; then + bindings=true + core=true + pathfinder=true + python_meta=true + test_helpers=true + shared=true + else + bindings="${BINDINGS}" + core="${CORE}" + pathfinder="${PATHFINDER}" + python_meta="${PYTHON_META}" + test_helpers="${TEST_HELPERS}" + shared="${SHARED}" + fi + + or_flag() { + for v in "$@"; do + if [[ "${v}" == "true" ]]; then + echo "true" + return + fi + done + echo "false" + } + + # Build gating: pathfinder change forces rebuild of bindings and + # core; bindings change forces rebuild of core. shared changes force + # a full rebuild. + build_pathfinder="$(or_flag "${shared}" "${pathfinder}")" + build_bindings="$(or_flag "${shared}" "${pathfinder}" "${bindings}")" + build_core="$(or_flag "${shared}" "${pathfinder}" "${bindings}" "${core}")" + + # Test gating: tests for a module must run whenever that module, any + # of its runtime dependencies, the shared test helper package, or + # shared infra changes. pathfinder tests are cheap and always run. + test_pathfinder=true + test_bindings="$(or_flag "${shared}" "${pathfinder}" "${bindings}" "${test_helpers}")" + test_core="$(or_flag "${shared}" "${pathfinder}" "${bindings}" "${core}" "${test_helpers}")" + + { + echo "bindings=${bindings}" + echo "core=${core}" + echo "pathfinder=${pathfinder}" + echo "python_meta=${python_meta}" + echo "test_helpers=${test_helpers}" + echo "shared=${shared}" + echo "build_bindings=${build_bindings}" + echo "build_core=${build_core}" + echo "build_pathfinder=${build_pathfinder}" + echo "test_bindings=${test_bindings}" + echo "test_core=${test_core}" + echo "test_pathfinder=${test_pathfinder}" + } >> "$GITHUB_OUTPUT" + # NOTE: Build jobs are intentionally split by platform rather than using a single # matrix. This allows each test job to depend only on its corresponding build, # so faster platforms can proceed through build & test without waiting for slower @@ -133,6 +290,37 @@ jobs: cuda-version: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} prev-cuda-version: ${{ needs.ci-vars.outputs.CUDA_PREV_BUILD_VER }} + # NOTE: test-sdist jobs are split by platform (mirroring build-* and test-wheel-*) + # so platform-specific sources (e.g. cuda_bindings/*_windows.pyx selected by + # build_hooks.py) are exercised on their target OS. Keep these job definitions + # textually identical except for: + # - host-platform value + # - uses: (test-sdist-linux.yml vs test-sdist-windows.yml) + test-sdist-linux: + needs: + - ci-vars + - should-skip + name: Test sdist linux-64 + if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) && !fromJSON(needs.should-skip.outputs.doc-only) }} + secrets: inherit + uses: ./.github/workflows/test-sdist-linux.yml + with: + host-platform: linux-64 + cuda-version: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} + + # See test-sdist-linux for why sdist test jobs are split by platform. + test-sdist-windows: + needs: + - ci-vars + - should-skip + name: Test sdist win-64 + if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) && !fromJSON(needs.should-skip.outputs.doc-only) }} + secrets: inherit + uses: ./.github/workflows/test-sdist-windows.yml + with: + host-platform: win-64 + cuda-version: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} + # NOTE: Test jobs are split by platform for the same reason as build jobs (see # build-linux-64). Keep these job definitions textually identical except for: # - host-platform value @@ -151,6 +339,7 @@ jobs: needs: - ci-vars - should-skip + - detect-changes - build-linux-64 secrets: inherit uses: ./.github/workflows/test-wheel-linux.yml @@ -158,7 +347,8 @@ jobs: build-type: pull-request host-platform: ${{ matrix.host-platform }} build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} - nruns: ${{ (github.event_name == 'schedule' && 100) || 1}} + nruns: ${{ (github.event_name == 'schedule' && 5) || 1}} + skip-bindings-test: ${{ !fromJSON(needs.detect-changes.outputs.test_bindings) }} # See test-linux-64 for why test jobs are split by platform. test-linux-aarch64: @@ -174,6 +364,7 @@ jobs: needs: - ci-vars - should-skip + - detect-changes - build-linux-aarch64 secrets: inherit uses: ./.github/workflows/test-wheel-linux.yml @@ -181,7 +372,8 @@ jobs: build-type: pull-request host-platform: ${{ matrix.host-platform }} build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} - nruns: ${{ (github.event_name == 'schedule' && 100) || 1}} + nruns: ${{ (github.event_name == 'schedule' && 5) || 1}} + skip-bindings-test: ${{ !fromJSON(needs.detect-changes.outputs.test_bindings) }} # See test-linux-64 for why test jobs are split by platform. test-windows: @@ -197,6 +389,7 @@ jobs: needs: - ci-vars - should-skip + - detect-changes - build-windows secrets: inherit uses: ./.github/workflows/test-wheel-windows.yml @@ -204,7 +397,8 @@ jobs: build-type: pull-request host-platform: ${{ matrix.host-platform }} build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} - nruns: ${{ (github.event_name == 'schedule' && 100) || 1}} + nruns: ${{ (github.event_name == 'schedule' && 5) || 1}} + skip-bindings-test: ${{ !fromJSON(needs.detect-changes.outputs.test_bindings) }} doc: name: Docs @@ -228,6 +422,9 @@ jobs: runs-on: ubuntu-latest needs: - should-skip + - detect-changes + - test-sdist-linux + - test-sdist-windows - test-linux-64 - test-linux-aarch64 - test-windows @@ -235,37 +432,42 @@ jobs: steps: - name: Exit run: | - # if any dependencies were cancelled or failed, that's a failure - # - # see https://docs.github.com/en/actions/reference/workflows-and-actions/expressions#always - # and https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks - # for why this cannot be encoded in the job-level `if:` field - # - # TL; DR: `$REASONS` - # - # The intersection of skipped-as-success and required status checks - # creates a scenario where if you DON'T `always()` run this job, the - # status check UI will block merging and if you DO `always()` run and - # a dependency is _cancelled_ (due to a critical failure, which is - # somehow not considered a failure ¯\_(ツ)_/¯) then the critically - # failing job(s) will timeout causing a cancellation here and the - # build to succeed which we don't want (originally this was just - # 'exit 0') - # - # Note: When [doc-only] is in PR title, test jobs are intentionally - # skipped and should not cause failure. - doc_only=${{ needs.should-skip.outputs.doc-only }} - if ${{ needs.doc.result == 'cancelled' || needs.doc.result == 'failure' }}; then - exit 1 + # GitHub treats `result == 'skipped'` as success for required + # status checks (see CCCL gate comment + cccl#605). The previous + # `cancelled || failure` predicate let upstream build failures + # propagate as `skipped` on downstream test jobs and silently + # pass this aggregator. Adopt CCCL's `check_result` pattern: + # require an explicit `expected` status per dependency, where + # anything else (including `skipped` from a failed upstream) + # fails the gate. `if: always()` on the job still ensures this + # step runs even when needs are skipped. + if [[ "${{ needs.should-skip.outputs.skip }}" == "true" ]]; then + echo "[no-ci] - skipping aggregator checks" + exit 0 fi - if [[ "${doc_only}" != "true" ]]; then - if ${{ needs.test-linux-64.result == 'cancelled' || - needs.test-linux-64.result == 'failure' || - needs.test-linux-aarch64.result == 'cancelled' || - needs.test-linux-aarch64.result == 'failure' || - needs.test-windows.result == 'cancelled' || - needs.test-windows.result == 'failure' }}; then - exit 1 + + doc_only="${{ needs.should-skip.outputs.doc-only }}" + status="success" + check_result() { + name=$1; expected=$2; result=$3 + echo "Checking $name: result='$result' (expected '$expected')" + if [[ "$result" != "$expected" ]]; then + echo "::error::$name did not match expected result" + status="failed" fi - fi - exit 0 + } + + # always expected to succeed (even in [doc-only] mode) + check_result "should-skip" "success" "${{ needs.should-skip.result }}" + check_result "detect-changes" "success" "${{ needs.detect-changes.result }}" + check_result "doc" "success" "${{ needs.doc.result }}" + + # [doc-only] flips these from 'success' to 'skipped' + if [[ "$doc_only" == "true" ]]; then expected="skipped"; else expected="success"; fi + check_result "test-sdist-linux" "$expected" "${{ needs.test-sdist-linux.result }}" + check_result "test-sdist-windows" "$expected" "${{ needs.test-sdist-windows.result }}" + check_result "test-linux-64" "$expected" "${{ needs.test-linux-64.result }}" + check_result "test-linux-aarch64" "$expected" "${{ needs.test-linux-aarch64.result }}" + check_result "test-windows" "$expected" "${{ needs.test-windows.result }}" + + [[ "$status" == "success" ]] diff --git a/.github/workflows/cleanup-pr-previews.yml b/.github/workflows/cleanup-pr-previews.yml index a0811a0de2b..de9e348f430 100644 --- a/.github/workflows/cleanup-pr-previews.yml +++ b/.github/workflows/cleanup-pr-previews.yml @@ -28,10 +28,12 @@ jobs: if: github.repository_owner == 'NVIDIA' steps: - name: Checkout repository - uses: actions/checkout@v6.0.2 + uses: actions/checkout@v7.0.0 with: - # Fetch all history and branches for worktree operations + # Treeless clone: `git worktree add gh-pages` needs the commit graph, + # but historical blobs aren't required. fetch-depth: 0 + filter: blob:none - name: Configure git identity run: | diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index eea2466f7d5..87bcd8e58d5 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 @@ -8,6 +8,7 @@ on: push: branches: - "pull-request/[0-9]+" + - "ctk-next" - "main" concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} @@ -18,6 +19,8 @@ jobs: name: Analyze (${{ matrix.language }}) runs-on: ubuntu-latest permissions: + actions: read + contents: read security-events: write strategy: @@ -28,16 +31,16 @@ jobs: build-mode: none steps: - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Initialize CodeQL - uses: github/codeql-action/init@40f0fa95c41fede7b43f035cb47aac899ee0ba0a # v3.31.8 + uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 with: languages: ${{ matrix.language }} build-mode: ${{ matrix.build-mode }} queries: security-extended - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@40f0fa95c41fede7b43f035cb47aac899ee0ba0a # v3.31.8 + uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 3c0d4fa7009..f1b8eb9f3a2 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -22,7 +22,7 @@ jobs: CUDA_VER: ${{ steps.get-vars.outputs.cuda_ver }} steps: - name: Checkout ${{ github.event.repository.name }} - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Get CUDA version id: get-vars run: | @@ -47,9 +47,10 @@ jobs: # TODO: use a different (nvidia?) container container: options: -u root --security-opt seccomp=unconfined --shm-size 16g - image: ubuntu:22.04 + image: ubuntu:24.04 env: NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }} + PIP_CACHE_DIR: "/tmp/pip-cache" steps: - name: Ensure GPU is working run: nvidia-smi @@ -63,9 +64,16 @@ jobs: apt-get install -y git - name: Checkout ${{ github.event.repository.name }} - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: + # Treeless clone: setuptools-scm needs the commit graph (`git describe`) + # but not historical blobs. fetch-depth: 0 + filter: blob:none + + - name: Fix workspace ownership + run: | + chown -R $(id -u):$(id -g) "$GITHUB_WORKSPACE" - name: Install dependencies uses: ./.github/actions/install_unix_deps @@ -91,7 +99,7 @@ jobs: echo "CUDA_PYTHON_COVERAGE=1" >> $GITHUB_ENV - name: Set up Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: ${{ env.PY_VER }} env: @@ -159,7 +167,7 @@ jobs: ls -lh $REPO_ROOT/.coverage.linux - name: Upload Linux coverage data - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: coverage-data-linux path: .coverage.linux @@ -168,7 +176,7 @@ jobs: if-no-files-found: error - name: Upload cuda source code for coverage mapping - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: cuda-source-linux path: ${{ env.INSTALL_ROOT }}/cuda/ @@ -191,17 +199,20 @@ jobs: CUDA_VER: ${{ needs.coverage-vars.outputs.CUDA_VER }} steps: - name: Checkout ${{ github.event.repository.name }} - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: + # Treeless clone: setuptools-scm needs the commit graph (`git describe`) + # but not historical blobs. fetch-depth: 0 + filter: blob:none - name: Set up Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: ${{ env.PY_VER }} - name: Set up MSVC - uses: ilammy/msvc-dev-cmd@v1 + uses: step-security/msvc-dev-cmd@22c98154b708dbd743e6f27a933cf6ceba3305c4 # v1.13.1 - name: Set up mini CTK uses: ./.github/actions/fetch_ctk @@ -237,7 +248,7 @@ jobs: ls -lahR ./wheels/ - name: Upload Windows wheel artifacts - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: coverage-windows-wheels path: ./wheels/*.whl @@ -262,28 +273,30 @@ jobs: shell: bash --noprofile --norc -xeuo pipefail {0} steps: - name: Checkout ${{ github.event.repository.name }} - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: - fetch-depth: 0 + fetch-depth: 1 - name: Setup proxy cache uses: nv-gha-runners/setup-proxy-cache@main continue-on-error: true - - name: Update driver + # DRIVER above is 'latest' so install_gpu_driver.ps1 is intentionally + # skipped (it errors on latest/earliest); configure_driver_mode.ps1 + # still runs to put the pre-installed driver into TCC mode. + - name: Configure driver mode shell: powershell env: DRIVER_MODE: "TCC" - GPU_TYPE: "a100" run: | - ci/tools/install_gpu_driver.ps1 + ci/tools/configure_driver_mode.ps1 - name: Ensure GPU is working run: | nvidia-smi - name: Set up Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: ${{ env.PY_VER }} @@ -295,7 +308,7 @@ jobs: cuda-version: ${{ env.CUDA_VER }} - name: Download Windows wheel artifacts - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: coverage-windows-wheels path: ./wheels/ @@ -341,46 +354,25 @@ jobs: cd "${{ steps.install-root.outputs.INSTALL_ROOT }}" "$GITHUB_WORKSPACE/.venv/Scripts/pytest" -v --cov=./cuda --cov-append --cov-context=test --cov-config="$GITHUB_WORKSPACE/.coveragerc" "$GITHUB_WORKSPACE/cuda_pathfinder/tests" + # Cython linetrace under coverage on Windows needs more stack than the + # default 1 MB thread size. The helper runs pytest on an 8 MB thread. - name: Run cuda.bindings tests (with 8MB stack) continue-on-error: true run: | - cd "${{ steps.install-root.outputs.INSTALL_ROOT }}" - # Run pytest in 8MB stack thread (Cython linetrace requirement) - "$GITHUB_WORKSPACE/.venv/Scripts/python" << PYTEST_EOF - import os - import sys - import threading - import pytest - - os.chdir(r'${{ steps.install-root.outputs.INSTALL_ROOT }}') - threading.stack_size(8 * 1024 * 1024) - result = {'code': 1} - - def _run(): - workspace = os.environ['GITHUB_WORKSPACE'] - result['code'] = pytest.main([ - '-v', - '--cov=./cuda', - '--cov-append', - '--cov-context=test', - f'--cov-config={workspace}/.coveragerc', - f'{workspace}/cuda_bindings/tests' - ]) - - t = threading.Thread(target=_run) - t.start() - t.join() - - print(f'Bindings tests exit code: {result["code"]}') - # Exit with actual code (continue-on-error handles it) - sys.exit(result['code']) - PYTEST_EOF + "$GITHUB_WORKSPACE/.venv/Scripts/python" "$GITHUB_WORKSPACE/ci/tools/run_pytest_with_stack.py" \ + --cwd "${{ steps.install-root.outputs.INSTALL_ROOT }}" \ + -v --cov=./cuda --cov-append --cov-context=test \ + --cov-config="$GITHUB_WORKSPACE/.coveragerc" \ + "$GITHUB_WORKSPACE/cuda_bindings/tests" - - name: Run cuda.core tests + - name: Run cuda.core tests (with 8MB stack) continue-on-error: true run: | - cd "${{ steps.install-root.outputs.INSTALL_ROOT }}" - "$GITHUB_WORKSPACE/.venv/Scripts/pytest" -v --cov=./cuda --cov-append --cov-context=test --cov-config="$GITHUB_WORKSPACE/.coveragerc" "$GITHUB_WORKSPACE/cuda_core/tests" + "$GITHUB_WORKSPACE/.venv/Scripts/python" "$GITHUB_WORKSPACE/ci/tools/run_pytest_with_stack.py" \ + --cwd "${{ steps.install-root.outputs.INSTALL_ROOT }}" \ + -v --cov=./cuda --cov-append --cov-context=test \ + --cov-config="$GITHUB_WORKSPACE/.coveragerc" \ + "$GITHUB_WORKSPACE/cuda_core/tests" - name: Copy Windows coverage file to workspace run: | @@ -389,7 +381,7 @@ jobs: ls -lh "$GITHUB_WORKSPACE/.coverage.windows" - name: Upload Windows coverage data - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: coverage-data-windows path: .coverage.windows @@ -407,10 +399,10 @@ jobs: contents: write steps: - name: Checkout ${{ github.event.repository.name }} - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Set up Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: ${{ env.PY_VER }} @@ -420,19 +412,19 @@ jobs: pip install coverage[toml] Cython - name: Download Linux coverage data - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: coverage-data-linux path: ./ - name: Download cuda source code - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: cuda-source-linux path: ./cuda/ - name: Download Windows coverage data - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: coverage-data-windows path: ./ @@ -491,7 +483,7 @@ jobs: echo "[SUCCESS] Coverage reports generated successfully" - name: Archive combined coverage results - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: coverage-combined path: docs/coverage/ diff --git a/.github/workflows/pr-auto-label.yml b/.github/workflows/pr-auto-label.yml new file mode 100644 index 00000000000..dfd77156a26 --- /dev/null +++ b/.github/workflows/pr-auto-label.yml @@ -0,0 +1,23 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +name: "CI: Auto-label PRs by path" + +on: + pull_request_target: + types: + - opened + - synchronize + +jobs: + auto-label: + name: Auto-label by changed paths + if: github.repository_owner == 'NVIDIA' + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - name: Apply labels + uses: actions/labeler@e52e4fb63ed5cd0e07abaad9826b2a893ccb921f # main (include actions/labeler#917) diff --git a/.github/workflows/pr-metadata-check.yml b/.github/workflows/pr-metadata-check.yml new file mode 100644 index 00000000000..6f60ec45bf4 --- /dev/null +++ b/.github/workflows/pr-metadata-check.yml @@ -0,0 +1,135 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +name: "CI: Enforce assignee/label/milestone on PRs" + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + - assigned + - unassigned + - labeled + - unlabeled + - reopened + - ready_for_review + +jobs: + check-metadata: + name: PR has assignee, labels, and milestone + if: github.repository_owner == 'NVIDIA' + runs-on: ubuntu-latest + steps: + - name: Check for assignee, labels, and milestone + env: + PR_URL: ${{ github.event.pull_request.html_url }} + PR_NUMBER: ${{ github.event.pull_request.number }} + GH_REPO: ${{ github.repository }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + IS_BOT: ${{ github.actor == 'dependabot[bot]' || github.actor == 'pre-commit-ci[bot]' || github.actor == 'copy-pr-bot[bot]' }} + IS_DRAFT: ${{ github.event.pull_request.draft }} + run: | + if [ "$IS_BOT" = "true" ] || [ "$IS_DRAFT" = "true" ]; then + echo "Skipping check for bot or draft PR." + exit 0 + fi + + # Fetch live PR data to avoid stale event payload (race condition + # when labels/milestone are added shortly after PR creation). + PR_JSON=$(gh pr view "${PR_NUMBER}" --repo "${GH_REPO}" \ + --json assignees,labels,milestone \ + --jq '{assignees: .assignees, labels: .labels, milestone: (.milestone.title // empty)}') + ASSIGNEES=$(echo "$PR_JSON" | jq '.assignees') + LABELS=$(echo "$PR_JSON" | jq '.labels') + MILESTONE=$(echo "$PR_JSON" | jq -r '.milestone') + + ERRORS="" + + ASSIGNEE_COUNT=$(echo "$ASSIGNEES" | jq 'length') + if [ "$ASSIGNEE_COUNT" -eq 0 ]; then + ERRORS="${ERRORS}- **Missing assignee**: assign at least one person to this PR.\n" + fi + + # Module labels identify which package the PR touches. + # Cross-cutting labels exempt PRs from needing a module label. + # Read label names line-by-line (jq outputs one per line) so + # multi-word GitHub labels are not split by shell word-splitting. + MODULE_LABELS="cuda.bindings cuda.core cuda.pathfinder" + MODULE_EXEMPT_LABELS="CI/CD" + HAS_MODULE=false + while IFS= read -r label; do + [ -n "$label" ] || continue + for mod in $MODULE_LABELS $MODULE_EXEMPT_LABELS; do + if [ "$label" = "$mod" ]; then + HAS_MODULE=true + break 2 + fi + done + done < <(echo "$LABELS" | jq -r '.[].name') + + if [ "$HAS_MODULE" = "false" ]; then + ERRORS="${ERRORS}- **Missing module label**: add at least one of: \`cuda.bindings\`, \`cuda.core\`, \`cuda.pathfinder\` (or a cross-cutting label such as \`CI/CD\`).\n" + fi + + # Type labels categorize the kind of change. + TYPE_LABELS="bug enhancement feature documentation test example CI/CD packaging dependencies performance experiment RFC support P0 P1 P2" + HAS_TYPE=false + while IFS= read -r label; do + [ -n "$label" ] || continue + for typ in $TYPE_LABELS; do + if [ "$label" = "$typ" ]; then + HAS_TYPE=true + break 2 + fi + done + done < <(echo "$LABELS" | jq -r '.[].name') + + if [ "$HAS_TYPE" = "false" ]; then + ERRORS="${ERRORS}- **Missing type label**: add at least one of: \`bug\`, \`enhancement\`, \`feature\`, \`documentation\`, \`test\`, \`example\`, \`CI/CD\`, \`packaging\`, \`dependencies\`, \`performance\`, \`experiment\`, \`RFC\`, \`support\`, \`P0\`, \`P1\`, \`P2\`.\n" + fi + + if [ -z "$MILESTONE" ]; then + ERRORS="${ERRORS}- **Missing milestone**: assign a milestone to this PR.\n" + fi + + # Block PRs with labels that indicate they are not ready to merge. + # Match blocked label names exactly (case-insensitively); emit the + # original spelling from the payload so error text matches GitHub. + BLOCKED_LABELS=$(jq -r ' + (["blocked", "do not merge"]) as $blocking + | .[] + | .name as $n + | if ($blocking | index($n | ascii_downcase)) != null + then $n + else empty + end + ' <<<"$LABELS") + while IFS= read -r label; do + [ -n "$label" ] || continue + ERRORS="${ERRORS}- **Blocked label detected**: label \`$label\` prevents merging. Remove it when the PR is ready.\n" + done <<<"$BLOCKED_LABELS" + + if [ -n "$ERRORS" ]; then + echo "::error::This PR is missing required metadata. See the job summary for details." + { + echo "## PR Metadata Check Failed" + echo "" + printf '%b' "$ERRORS" + echo "" + echo "Please update the PR at: $PR_URL" + } >> "$GITHUB_STEP_SUMMARY" + exit 1 + fi + + ASSIGNEE_LIST=$(echo "$ASSIGNEES" | jq -r '.[].login' | paste -sd ', ' -) + LABEL_LIST=$(echo "$LABELS" | jq -r '.[].name' | paste -sd ', ' -) + { + echo "## PR Metadata Check Passed" + echo "" + echo "- **Assignees**: $ASSIGNEE_LIST" + echo "- **Labels**: $LABEL_LIST" + echo "- **Milestone**: $MILESTONE" + } >> "$GITHUB_STEP_SUMMARY" diff --git a/.github/workflows/release-cuda-pathfinder.yml b/.github/workflows/release-cuda-pathfinder.yml index c2ba575eccb..f3d1952e9ec 100644 --- a/.github/workflows/release-cuda-pathfinder.yml +++ b/.github/workflows/release-cuda-pathfinder.yml @@ -59,9 +59,11 @@ jobs: echo "version=${version}" } >> "$GITHUB_OUTPUT" - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: - fetch-depth: 0 + # lookup-run-id resolves the git tag to a SHA; we need tags but not history. + fetch-depth: 1 + fetch-tags: true # Resolve only the exact tag ref; checkout fails if the tag does not exist. ref: refs/tags/${{ steps.vars.outputs.tag }} @@ -159,9 +161,9 @@ jobs: TAG: ${{ needs.prepare.outputs.tag }} RUN_ID: ${{ needs.prepare.outputs.run-id }} steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: - fetch-depth: 0 + fetch-depth: 1 ref: ${{ needs.prepare.outputs.tag }} - name: Create source archive @@ -231,7 +233,7 @@ jobs: ls -la dist - name: Publish to TestPyPI - uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 + uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0 with: repository-url: https://test.pypi.org/legacy/ @@ -308,7 +310,7 @@ jobs: ls -la dist - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 + uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0 # -------------------------------------------------------------------------- # Verify the PyPI package installs and imports correctly. diff --git a/.github/workflows/release-upload.yml b/.github/workflows/release-upload.yml index 52a34e6c77f..77681096ed9 100644 --- a/.github/workflows/release-upload.yml +++ b/.github/workflows/release-upload.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 @@ -18,6 +18,11 @@ on: description: "Component to download wheels for" type: string required: true + dry-run: + description: "Validate release artifacts without uploading them to the GitHub release" + type: boolean + required: false + default: false concurrency: # Concurrency group that uses the workflow name and PR number if available @@ -41,9 +46,9 @@ jobs: ARCHIVE_NAME: ${{ github.event.repository.name }}-${{ inputs.git-tag }} steps: - name: Checkout Source - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: - fetch-depth: 0 + fetch-depth: 1 ref: ${{ inputs.git-tag }} - name: Create Release Directory @@ -64,6 +69,7 @@ jobs: > "release/${{ env.ARCHIVE_NAME }}.tar.gz.sha256sum" - name: Upload Archive + if: ${{ !inputs.dry-run }} env: GH_TOKEN: ${{ github.token }} run: > @@ -72,7 +78,7 @@ jobs: --repo "${{ github.repository }}" release/* - - name: Download and Upload Wheels + - name: Download and Validate Wheels env: GH_TOKEN: ${{ github.token }} run: | @@ -82,8 +88,20 @@ jobs: # Validate that release wheels match the expected version from tag. ./ci/tools/validate-release-wheels "${{ inputs.git-tag }}" "${{ inputs.component }}" "release/wheels" - # Upload wheels to the release + - name: Upload Wheels + if: ${{ !inputs.dry-run }} + env: + GH_TOKEN: ${{ github.token }} + run: | 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 + + - name: Upload dry-run release artifacts + if: ${{ inputs.dry-run }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: release-artifacts-dry-run-${{ inputs.component }}-${{ inputs.git-tag }} + path: release/ + retention-days: 3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 97d58d8ae59..37322974a02 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 @@ -6,7 +6,29 @@ name: "CI: Release" # Manually-triggered release workflow. Creates a release draft if one doesn't exist # for the given tag, or uses an existing draft, then publishes the selected wheels -# to TestPyPI followed by PyPI. +# to TestPyPI followed by PyPI. The dry-run mode validates the release path +# without publishing to external release surfaces. +# +# Maintenance note: non-trivial changes to this workflow should be validated +# with dry-run workflow_dispatch runs before merging. Suggested focused matrix: +# - mainline: +# component=cuda-bindings +# git-tag= +# backport-git-tag=not planned +# run-id= +# dry-run-docs-branch=gh-pages-dry-run +# - backport sequence: +# 1. component=cuda-bindings +# git-tag= +# backport-git-tag= +# 2. component=cuda-python +# git-tag= +# backport-git-tag= +# run-id= +# dry-run-docs-branch=gh-pages-dry-run +# Leave run-id blank so determine-run-id is exercised. For exhaustive coverage, +# add a mainline cuda-python dry-run when changes could affect metapackage +# artifact validation, docs routing, or component-specific release behavior. on: workflow_dispatch: @@ -20,16 +42,33 @@ on: - cuda-bindings - cuda-pathfinder - cuda-python - - all + release-action: + description: "What to run" + required: true + type: choice + options: + - dry-run + - full-release + default: dry-run git-tag: description: "The release git tag" required: true type: string + backport-git-tag: + description: "Mainline cuda-bindings/cuda-python only: planned backport tag, or 'not planned'. Leave blank for backport releases." + required: false + type: string + default: "" run-id: description: "The GHA run ID that generated validated artifacts (optional - auto-detects successful tag-triggered CI run for git-tag)" required: false type: string default: "" + dry-run-docs-branch: + description: "Dry-run only: optional gh-pages-* branch to receive generated docs, for example gh-pages-dry-run" + required: false + type: string + default: "" defaults: run: @@ -42,33 +81,58 @@ jobs: run-id: ${{ steps.lookup-run-id.outputs.run-id }} steps: - name: Checkout Source - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: - # fetch-depth: 0 is required so the lookup-run-id script can access all git tags - fetch-depth: 0 + # lookup-run-id resolves the git tag to a SHA; we need tags but not history. + fetch-depth: 1 + fetch-tags: true - name: Determine Run ID id: lookup-run-id env: GH_TOKEN: ${{ github.token }} run: | - echo "Auto-detecting successful tag-triggered 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" + if [[ -n "${{ inputs.run-id }}" ]]; then + echo "Using provided run ID: ${{ inputs.run-id }}" + RUN_ID="${{ inputs.run-id }}" + else + echo "Auto-detecting successful tag-triggered 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" + fi echo "run-id=$RUN_ID" >> "$GITHUB_OUTPUT" check-tag: runs-on: ubuntu-latest steps: - name: Checkout Source - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: - fetch-depth: 0 + # Dry-run validation resolves the requested tag locally; we need tags but not history. + fetch-depth: 1 + fetch-tags: true - - name: Check or create draft release for the tag + - name: Check release tag and draft state env: GH_TOKEN: ${{ github.token }} + RELEASE_ACTION: ${{ inputs.release-action }} + RELEASE_GIT_TAG: ${{ inputs.git-tag }} + DRY_RUN_DOCS_BRANCH: ${{ inputs.dry-run-docs-branch }} run: | + if [[ "$RELEASE_ACTION" == "full-release" && -n "$DRY_RUN_DOCS_BRANCH" ]]; then + echo "error: dry-run-docs-branch is only valid with release-action=dry-run" >&2 + exit 1 + fi + if [[ "$RELEASE_ACTION" == "dry-run" && -n "$DRY_RUN_DOCS_BRANCH" && ! "$DRY_RUN_DOCS_BRANCH" =~ ^gh-pages-[[:alnum:]._/-]+$ ]]; then + echo "error: dry-run-docs-branch must be a non-production gh-pages-* branch" >&2 + exit 1 + fi + if [[ "$RELEASE_ACTION" == "dry-run" ]]; then + git rev-parse --verify "${RELEASE_GIT_TAG}^{commit}" + echo "Dry-run selected; not checking or creating a GitHub release draft." + exit 0 + fi + mapfile -t tags < <(gh release list -R "${{ github.repository }}" --json tagName --jq '.[] | .tagName') mapfile -t is_draft < <(gh release list -R "${{ github.repository }}" --json isDraft --jq '.[] | .isDraft') @@ -89,6 +153,24 @@ jobs: gh release create "${{ inputs.git-tag }}" --draft --repo "${{ github.repository }}" --title "Release ${{ inputs.git-tag }}" --notes "Release ${{ inputs.git-tag }}" fi + check-release-notes: + runs-on: ubuntu-latest + steps: + - name: Checkout Source + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + + - name: Set up Python + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 + with: + python-version: "3.12" + + - name: Check versioned release notes exist + run: | + python ci/tools/check_release_notes.py \ + --git-tag "${{ inputs.git-tag }}" \ + --component "${{ inputs.component }}" \ + --backport-git-tag "${{ inputs.backport-git-tag }}" + doc: name: Build release docs if: ${{ github.repository_owner == 'nvidia' }} @@ -99,6 +181,7 @@ jobs: pull-requests: write needs: - check-tag + - check-release-notes - determine-run-id secrets: inherit uses: ./.github/workflows/build-docs.yml @@ -107,13 +190,16 @@ jobs: git-tag: ${{ inputs.git-tag }} run-id: ${{ needs.determine-run-id.outputs.run-id }} is-release: true + deploy-docs: ${{ inputs.release-action == 'full-release' || inputs.dry-run-docs-branch != '' }} + docs-branch: ${{ (inputs.release-action == 'dry-run' && inputs.dry-run-docs-branch) || 'gh-pages' }} upload-archive: - name: Upload source archive + name: Validate release artifacts permissions: contents: write needs: - check-tag + - check-release-notes - determine-run-id - doc secrets: inherit @@ -122,22 +208,25 @@ jobs: git-tag: ${{ inputs.git-tag }} run-id: ${{ needs.determine-run-id.outputs.run-id }} component: ${{ inputs.component }} + dry-run: ${{ inputs.release-action == 'dry-run' }} publish-testpypi: name: Publish wheels to TestPyPI + if: ${{ inputs.release-action == 'full-release' }} runs-on: ubuntu-latest needs: - check-tag + - check-release-notes - determine-run-id - doc environment: name: testpypi - url: https://test.pypi.org/${{ inputs.component != 'all' && format('p/{0}/', inputs.component) || '' }} + url: https://test.pypi.org/p/${{ inputs.component }}/ permissions: id-token: write steps: - name: Checkout Source - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Download component wheels env: @@ -150,24 +239,25 @@ jobs: ./ci/tools/validate-release-wheels "${{ inputs.git-tag }}" "${{ inputs.component }}" "dist" - name: Publish package distributions to TestPyPI - uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 + uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0 with: repository-url: https://test.pypi.org/legacy/ publish-pypi: name: Publish wheels to PyPI + if: ${{ inputs.release-action == 'full-release' }} runs-on: ubuntu-latest needs: - determine-run-id - publish-testpypi environment: name: pypi - url: https://pypi.org/${{ inputs.component != 'all' && format('p/{0}/', inputs.component) || '' }} + url: https://pypi.org/p/${{ inputs.component }}/ permissions: id-token: write steps: - name: Checkout Source - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Download component wheels env: @@ -180,6 +270,6 @@ jobs: ./ci/tools/validate-release-wheels "${{ inputs.git-tag }}" "${{ inputs.component }}" "dist" - name: Publish package distributions to PyPI - uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 + uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0 # TODO: add another job to make the release leave the draft state? diff --git a/.github/workflows/test-sdist-linux.yml b/.github/workflows/test-sdist-linux.yml new file mode 100644 index 00000000000..9d077912f3c --- /dev/null +++ b/.github/workflows/test-sdist-linux.yml @@ -0,0 +1,110 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +on: + workflow_call: + inputs: + host-platform: + required: true + type: string + cuda-version: + required: true + type: string + +defaults: + run: + shell: bash --noprofile --norc -xeuo pipefail {0} + +permissions: + contents: read # This is required for actions/checkout + +jobs: + test-sdist: + name: Test sdist builds + timeout-minutes: 60 + runs-on: linux-amd64-cpu8 + steps: + - name: Checkout ${{ github.event.repository.name }} + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + # Treeless clone: setuptools-scm (invoked via `python -m build`) needs + # the commit graph (`git describe`) but not historical blobs. + fetch-depth: 0 + filter: blob:none + + - name: Set up Python + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 + with: + python-version: "3.12" + + - name: Install build tools + run: pip install build + + # Pure Python packages -- no CTK needed. + - name: Build cuda.pathfinder sdist and wheel-from-sdist + run: | + python -m build --sdist cuda_pathfinder/ + pip wheel --no-deps --wheel-dir cuda_pathfinder/dist cuda_pathfinder/dist/*.tar.gz + + - name: Build cuda-python sdist and wheel-from-sdist + run: | + python -m build --sdist cuda_python/ + pip wheel --no-deps --wheel-dir cuda_python/dist cuda_python/dist/*.tar.gz + + # Cython packages need CTK + sccache. + # The env vars ACTIONS_CACHE_SERVICE_V2, ACTIONS_RESULTS_URL, and ACTIONS_RUNTIME_TOKEN + # are exposed by this action. + - name: Enable sccache + uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # 0.0.10 + with: + disable_annotations: 'true' + + # xref: https://github.com/orgs/community/discussions/42856#discussioncomment-7678867 + - name: Adding additional GHA cache-related env vars + uses: actions/github-script@v9 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env['ACTIONS_CACHE_URL']) + core.exportVariable('ACTIONS_RUNTIME_URL', process.env['ACTIONS_RUNTIME_URL']) + + - name: Setup proxy cache + uses: nv-gha-runners/setup-proxy-cache@main + continue-on-error: true + with: + enable-apt: true + + - name: Set up mini CTK + uses: ./.github/actions/fetch_ctk + continue-on-error: false + with: + host-platform: ${{ inputs.host-platform }} + cuda-version: ${{ inputs.cuda-version }} + + # cuda_bindings/setup.py parses CUDA headers at import time, so CUDA_PATH + # (set by fetch_ctk) must be available for both sdist and wheel builds. + - name: Build cuda.bindings sdist and wheel-from-sdist + run: | + export CUDA_PYTHON_PARALLEL_LEVEL=$(nproc) + export CC="sccache cc" + export CXX="sccache c++" + export PIP_FIND_LINKS="$(pwd)/cuda_pathfinder/dist" + python -m build --sdist cuda_bindings/ + pip wheel --no-deps --wheel-dir cuda_bindings/dist cuda_bindings/dist/*.tar.gz + + # cuda_core sdist delegates to setuptools (no CTK needed), but + # wheel-from-sdist needs CTK and cuda-bindings (dynamic build dep via + # get_requires_for_build_wheel in build_hooks.py). + - name: Build cuda.core sdist and wheel-from-sdist + run: | + export CUDA_PYTHON_PARALLEL_LEVEL=$(nproc) + export CUDA_CORE_BUILD_MAJOR="$(echo '${{ inputs.cuda-version }}' | cut -d. -f1)" + export CC="sccache cc" + export CXX="sccache c++" + export PIP_FIND_LINKS="$(pwd)/cuda_bindings/dist $(pwd)/cuda_pathfinder/dist" + python -m build --sdist cuda_core/ + pip wheel --no-deps --wheel-dir cuda_core/dist cuda_core/dist/*.tar.gz + + - name: Show sccache stats + if: always() + run: sccache --show-stats diff --git a/.github/workflows/test-sdist-windows.yml b/.github/workflows/test-sdist-windows.yml new file mode 100644 index 00000000000..043bacc1cad --- /dev/null +++ b/.github/workflows/test-sdist-windows.yml @@ -0,0 +1,96 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +# Windows counterpart of test-sdist-linux.yml. Exists so that platform-gated +# sources (e.g. cuda_bindings/*_windows.pyx selected by build_hooks.py) are +# exercised by the sdist completeness test. Keep the shape of this file in +# sync with test-sdist-linux.yml aside from Windows-specific setup (MSVC, +# no sccache, no proxy cache). + +on: + workflow_call: + inputs: + host-platform: + required: true + type: string + cuda-version: + required: true + type: string + +defaults: + run: + shell: bash --noprofile --norc -xeuo pipefail {0} + +permissions: + contents: read # This is required for actions/checkout + +jobs: + test-sdist: + name: Test sdist builds + timeout-minutes: 60 + runs-on: windows-2022 + steps: + - name: Checkout ${{ github.event.repository.name }} + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + # Treeless clone: setuptools-scm (invoked via `python -m build`) needs + # the commit graph (`git describe`) but not historical blobs. + fetch-depth: 0 + filter: blob:none + + - name: Set up Python + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 + with: + python-version: "3.12" + + - name: Set up MSVC + uses: step-security/msvc-dev-cmd@22c98154b708dbd743e6f27a933cf6ceba3305c4 # v1.13.1 + + - name: Install build tools + run: pip install build + + # Pure Python packages -- no CTK needed. + - name: Build cuda.pathfinder sdist and wheel-from-sdist + run: | + python -m build --sdist cuda_pathfinder/ + pip wheel --no-deps --wheel-dir cuda_pathfinder/dist cuda_pathfinder/dist/*.tar.gz + + - name: Build cuda-python sdist and wheel-from-sdist + run: | + python -m build --sdist cuda_python/ + pip wheel --no-deps --wheel-dir cuda_python/dist cuda_python/dist/*.tar.gz + + # Cython packages need CTK. No sccache on Windows (this is a correctness + # smoke test, not a production build; see build-wheel.yml which also + # limits sccache to Linux). + - name: Set up mini CTK + uses: ./.github/actions/fetch_ctk + continue-on-error: false + with: + host-platform: ${{ inputs.host-platform }} + cuda-version: ${{ inputs.cuda-version }} + + # cuda_bindings/setup.py parses CUDA headers at import time, so CUDA_PATH + # (set by fetch_ctk) must be available for both sdist and wheel builds. + # PIP_FIND_LINKS is passed as a native Windows path via cygpath because + # pip on Windows treats space-separated entries as separators and is + # picky about mixed path styles (see build-wheel.yml for the same + # convention). + - name: Build cuda.bindings sdist and wheel-from-sdist + run: | + export CUDA_PYTHON_PARALLEL_LEVEL=$(nproc) + export PIP_FIND_LINKS="$(cygpath -w "$(pwd)/cuda_pathfinder/dist")" + python -m build --sdist cuda_bindings/ + pip wheel --no-deps --wheel-dir cuda_bindings/dist cuda_bindings/dist/*.tar.gz + + # cuda_core sdist delegates to setuptools (no CTK needed), but + # wheel-from-sdist needs CTK and cuda-bindings (dynamic build dep via + # get_requires_for_build_wheel in build_hooks.py). + - name: Build cuda.core sdist and wheel-from-sdist + run: | + export CUDA_PYTHON_PARALLEL_LEVEL=$(nproc) + export CUDA_CORE_BUILD_MAJOR="$(echo '${{ inputs.cuda-version }}' | cut -d. -f1)" + export PIP_FIND_LINKS="$(cygpath -w "$(pwd)/cuda_bindings/dist") $(cygpath -w "$(pwd)/cuda_pathfinder/dist")" + python -m build --sdist cuda_core/ + pip wheel --no-deps --wheel-dir cuda_core/dist cuda_core/dist/*.tar.gz diff --git a/.github/workflows/test-wheel-linux.yml b/.github/workflows/test-wheel-linux.yml index c5061a16ebe..ae1e2e5dafc 100644 --- a/.github/workflows/test-wheel-linux.yml +++ b/.github/workflows/test-wheel-linux.yml @@ -22,6 +22,32 @@ on: nruns: type: number default: 1 + # When true, cuda.bindings tests (and the Cython tests that depend on + # them) are skipped even when CTK majors match. Callers set this based + # on the output of the detect-changes job in ci.yml so PRs that only + # touch unrelated modules avoid the expensive bindings test suite. + skip-bindings-test: + type: boolean + default: false + run-id: + description: > + Workflow run ID to download artifacts from. + Defaults to the current run when empty. + type: string + default: '' + test-mode: + description: > + Test mode: 'standard' (default), 'nightly-pytorch', + 'nightly-numba-cuda', 'nightly-numba-cuda-mlir', or + 'nightly-cuda-core'. + type: string + default: 'standard' + sha: + description: > + Commit SHA used to construct artifact names. + Defaults to github.sha (current run) when empty. + type: string + default: '' defaults: run: @@ -39,7 +65,7 @@ jobs: OLD_BRANCH: ${{ steps.compute-matrix.outputs.OLD_BRANCH }} steps: - name: Checkout ${{ github.event.repository.name }} - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Validate Test Type run: | @@ -60,8 +86,13 @@ jobs: # Read base matrix from YAML file for the specific architecture TEST_MATRIX=$(yq -o json ".linux[\"${MATRIX_TYPE}\"] | map(select(.ARCH == \"${ARCH}\"))" ci/test-matrix.yml) - # Apply matrix filter and wrap in include structure - MATRIX=$(echo "$TEST_MATRIX" | jq -c '${{ inputs.matrix_filter }} | if (. | length) > 0 then {include: .} else "Error: Empty matrix\n" | halt_error(1) end') + # Apply matrix filter; reject custom DRIVER + FLAVOR=wsl (the + # in-container driver swap doesn't work under WSL); add a + # RUNNER_DRIVER field that maps any custom version back to + # 'latest' (the install script swaps the driver itself, so we + # need to land on the runner that ships with the most recent + # pre-installed driver); wrap in include structure. + MATRIX=$(echo "$TEST_MATRIX" | jq -c '${{ inputs.matrix_filter }} | if any(.[]; .DRIVER != "latest" and .DRIVER != "earliest" and .FLAVOR == "wsl") then "Error: custom DRIVER is not supported with FLAVOR=wsl\n" | halt_error(1) else . end | map(. + {RUNNER_DRIVER: (if .DRIVER == "latest" or .DRIVER == "earliest" then .DRIVER else "latest" end)}) | if (. | length) > 0 then {include: .} else "Error: Empty matrix\n" | halt_error(1) end') echo "MATRIX=${MATRIX}" | tee --append "${GITHUB_OUTPUT}" @@ -70,27 +101,31 @@ jobs: echo "OLD_BRANCH=${OLD_BRANCH}" >> "$GITHUB_OUTPUT" test: - name: py${{ matrix.PY_VER }}, ${{ matrix.CUDA_VER }}, ${{ (matrix.LOCAL_CTK == '1' && 'local') || 'wheels' }}, ${{ matrix.GPU }}${{ matrix.GPU_COUNT != '1' && format('(x{0})', matrix.GPU_COUNT) || '' }} + name: Python ${{ matrix.PY_VER }}, CUDA ${{ matrix.CUDA_VER }} (${{ (matrix.LOCAL_CTK == '1' && 'local') || 'wheels' }}), GPU ${{ matrix.GPU }}${{ matrix.GPU_COUNT != '1' && format(' (x{0})', matrix.GPU_COUNT) || '' }}${{ matrix.FLAVOR && format(', {0}', matrix.FLAVOR) || '' }}${{ matrix.ENV.TORCH_VER && format(', {0}+{1}', matrix.ENV.TORCH_VER, matrix.ENV.TORCH_CUDA) || '' }}${{ matrix.ENV.MODE == 'nightly-numba-cuda' && ', latest' || '' }} + timeout-minutes: 60 needs: compute-matrix strategy: fail-fast: false matrix: ${{ fromJSON(needs.compute-matrix.outputs.MATRIX) }} - runs-on: "linux-${{ matrix.ARCH }}-gpu-${{ matrix.GPU }}-${{ matrix.DRIVER }}-${{ matrix.GPU_COUNT }}" + runs-on: "${{ matrix.FLAVOR || 'linux' }}-${{ matrix.ARCH }}-gpu-${{ matrix.GPU }}-${{ matrix.RUNNER_DRIVER }}-${{ matrix.GPU_COUNT }}" + # TODO: remove continue-on-error once 3.15 is officially supported + continue-on-error: ${{ startsWith(matrix.PY_VER, '3.15') }} # The build stage could fail but we want the CI to keep moving. if: ${{ github.repository_owner == 'nvidia' && !cancelled() }} # Our self-hosted runners require a container # TODO: use a different (nvidia?) container container: - options: -u root --security-opt seccomp=unconfined --shm-size 16g - image: ubuntu:22.04 + # Custom-DRIVER rows need --privileged --pid=host so install_gpu_driver.sh + # can nsenter to the host for the install + refresh the toolkit bind mounts + # back inside the container. Stock options for latest/earliest rows. + options: ${{ ((matrix.DRIVER == 'latest' || matrix.DRIVER == 'earliest') && '-u root --security-opt seccomp=unconfined --shm-size 16g') || '-u root --security-opt seccomp=unconfined --shm-size 16g --privileged --pid=host' }} + image: ubuntu:24.04 env: NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }} + PIP_CACHE_DIR: "/tmp/pip-cache" steps: - - name: Ensure GPU is working - run: nvidia-smi - - name: Checkout ${{ github.event.repository.name }} - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Setup proxy cache uses: nv-gha-runners/setup-proxy-cache@main @@ -100,10 +135,22 @@ jobs: uses: ./.github/actions/install_unix_deps continue-on-error: false with: - # for artifact fetching, graphics libs - dependencies: "jq wget libgl1 libegl1" + # for artifact fetching, graphics libs, g++ required for cffi in + # example; util-linux for `nsenter` (custom-DRIVER rows re-exec + # install_gpu_driver.sh onto the host through nsenter) + dependencies: "jq wget libgl1 libegl1 g++ util-linux" dependent_exes: "jq wget" + - name: Install GPU driver + if: ${{ matrix.DRIVER != 'latest' && matrix.DRIVER != 'earliest' }} + env: + DRIVER: ${{ matrix.DRIVER }} + GPU_TYPE: ${{ matrix.GPU }} + run: ./ci/tools/install_gpu_driver.sh + + - name: Ensure GPU is working + run: nvidia-smi + - name: Set environment variables env: BUILD_CUDA_VER: ${{ inputs.build-ctk-ver }} @@ -111,31 +158,44 @@ jobs: HOST_PLATFORM: ${{ inputs.host-platform }} LOCAL_CTK: ${{ matrix.LOCAL_CTK }} PY_VER: ${{ matrix.PY_VER }} - SHA: ${{ github.sha }} + SHA: ${{ inputs.sha || github.sha }} + SKIP_BINDINGS_TEST_OVERRIDE: ${{ inputs.skip-bindings-test && '1' || '0' }} run: ./ci/tools/env-vars test + - name: Apply extra matrix environment variables + if: ${{ matrix.ENV }} + env: + MATRIX_ENV: ${{ toJSON(matrix.ENV) }} + run: echo "$MATRIX_ENV" | jq -r 'to_entries[] | "\(.key)=\(.value)"' >> "$GITHUB_ENV" + - name: Download cuda-pathfinder build artifacts - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: cuda-pathfinder-wheel path: ./cuda_pathfinder + run-id: ${{ inputs.run-id || github.run_id }} + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Download cuda-python build artifacts - if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0'}} - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + if: ${{ env.BINDINGS_SOURCE == 'main' }} + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: cuda-python-wheel path: . + run-id: ${{ inputs.run-id || github.run_id }} + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Download cuda.bindings build artifacts - if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0'}} - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + if: ${{ env.BINDINGS_SOURCE == 'main' }} + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} + run-id: ${{ inputs.run-id || github.run_id }} + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Download cuda-python & cuda.bindings build artifacts from the prior branch - if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '1'}} + if: ${{ env.BINDINGS_SOURCE == 'backport' }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | @@ -151,11 +211,7 @@ jobs: OLD_BRANCH=${{ needs.compute-matrix.outputs.OLD_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 "ci.yml" -s success -R NVIDIA/cuda-python --json databaseId | jq '.[]| .databaseId') - if [[ "$LATEST_PRIOR_RUN_ID" == "" ]]; then - echo "LATEST_PRIOR_RUN_ID not found!" - exit 1 - fi + LATEST_PRIOR_RUN_ID=$(./ci/tools/lookup-run-id --branch "${OLD_BRANCH}" NVIDIA/cuda-python "CI") gh run download $LATEST_PRIOR_RUN_ID -p ${OLD_BASENAME} -R NVIDIA/cuda-python rm -rf ${OLD_BASENAME}-tests # exclude cython test artifacts @@ -170,21 +226,25 @@ jobs: rmdir cuda-python-wheel - name: Display structure of downloaded cuda-python artifacts + if: ${{ env.BINDINGS_SOURCE != 'published' }} run: | pwd - ls -lahR . + ls -lah cuda_python*.whl cuda_pathfinder/ - name: Display structure of downloaded cuda.bindings artifacts + if: ${{ env.BINDINGS_SOURCE != 'published' }} run: | pwd ls -lahR $CUDA_BINDINGS_ARTIFACTS_DIR - name: Download cuda.bindings Cython tests if: ${{ env.SKIP_CYTHON_TEST == '0' }} - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}-tests path: ${{ env.CUDA_BINDINGS_CYTHON_TESTS_DIR }} + run-id: ${{ inputs.run-id || github.run_id }} + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Display structure of downloaded cuda.bindings Cython tests if: ${{ env.SKIP_CYTHON_TEST == '0' }} @@ -193,10 +253,12 @@ jobs: ls -lahR $CUDA_BINDINGS_CYTHON_TESTS_DIR - name: Download cuda.core build artifacts - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: ${{ env.CUDA_CORE_ARTIFACT_NAME }} path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }} + run-id: ${{ inputs.run-id || github.run_id }} + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Display structure of downloaded cuda.core build artifacts run: | @@ -205,10 +267,12 @@ jobs: - name: Download cuda.core Cython tests if: ${{ env.SKIP_CYTHON_TEST == '0' }} - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-tests path: ${{ env.CUDA_CORE_CYTHON_TESTS_DIR }} + run-id: ${{ inputs.run-id || github.run_id }} + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Display structure of downloaded cuda.core Cython tests if: ${{ env.SKIP_CYTHON_TEST == '0' }} @@ -216,10 +280,25 @@ jobs: pwd ls -lahR $CUDA_CORE_CYTHON_TESTS_DIR + - name: Download cuda.core test binaries + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-test-binaries + path: ${{ env.CUDA_CORE_TEST_BINARIES_DIR }} + run-id: ${{ inputs.run-id || github.run_id }} + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Display structure of downloaded cuda.core test binaries + run: | + pwd + ls -lahR $CUDA_CORE_TEST_BINARIES_DIR + - name: Set up Python ${{ matrix.PY_VER }} - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: ${{ matrix.PY_VER }} + # TODO: remove allow-prereleases once 3.15 is officially supported + allow-prereleases: ${{ startsWith(matrix.PY_VER, '3.15') }} env: # we use self-hosted runners on which setup-python behaves weirdly (Python include can't be found)... AGENT_TOOLSDIRECTORY: "/opt/hostedtoolcache" @@ -232,6 +311,18 @@ jobs: host-platform: ${{ inputs.host-platform }} cuda-version: ${{ matrix.CUDA_VER }} + # TODO: remove the numpy wheel steps once 3.15 is officially supported + - name: Download numpy wheel (pre-release Python) + if: ${{ startsWith(matrix.PY_VER, '3.15') }} + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: numpy-python${{ env.PYTHON_VERSION_FORMATTED }}-${{ inputs.host-platform }} + path: numpy-wheel + + - name: Install numpy wheel (pre-release Python) + if: ${{ startsWith(matrix.PY_VER, '3.15') }} + run: pip install numpy-wheel/*.whl + - name: Set up latest cuda_sanitizer_api if: ${{ env.SETUP_SANITIZER == '1' }} uses: ./.github/actions/fetch_ctk @@ -247,7 +338,9 @@ jobs: - name: Set up test repetition on nightly runs run: echo "PYTEST_ADDOPTS=\"--count=${{ inputs.nruns }}\"" >> "$GITHUB_ENV" + # ── Standard test steps (skipped for nightly modes) ── - name: Run cuda.pathfinder tests with see_what_works + if: ${{ inputs.test-mode == 'standard' }} env: CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: see_what_works CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS: see_what_works @@ -255,37 +348,40 @@ jobs: run: run-tests pathfinder - name: Run cuda.bindings tests - if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }} + if: ${{ inputs.test-mode == 'standard' && env.SKIP_CUDA_BINDINGS_TEST == '0' }} env: CUDA_VER: ${{ matrix.CUDA_VER }} LOCAL_CTK: ${{ matrix.LOCAL_CTK }} run: run-tests bindings - - name: Run cuda.bindings examples - if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }} - env: - CUDA_VER: ${{ matrix.CUDA_VER }} - LOCAL_CTK: ${{ matrix.LOCAL_CTK }} + - name: Run cuda.bindings benchmarks (smoke test) + if: ${{ inputs.test-mode == 'standard' && env.SKIP_CUDA_BINDINGS_TEST == '0' }} run: | - pushd cuda_bindings - ${SANITIZER_CMD} pytest -ra -s -vv examples/ + pip install pyperf + pushd benchmarks/cuda_bindings + python run_pyperf.py --debug-single-value popd - name: Run cuda.core tests + if: ${{ inputs.test-mode == 'standard' }} env: CUDA_VER: ${{ matrix.CUDA_VER }} LOCAL_CTK: ${{ matrix.LOCAL_CTK }} run: run-tests core - name: Ensure cuda-python installable + if: ${{ inputs.test-mode == 'standard' && env.BINDINGS_SOURCE == 'main' }} run: | + # Subpackages are already installed from CI artifacts; --no-deps keeps + # tag-release cuda-core wheels from being replaced by PyPI pins. if [[ "${{ matrix.LOCAL_CTK }}" == 1 ]]; then - pip install --only-binary=:all: cuda_python*.whl + pip install --only-binary=:all: --no-deps cuda_python*.whl else - pip install --only-binary=:all: $(ls cuda_python*.whl)[all] + pip install --only-binary=:all: --no-deps $(ls cuda_python*.whl)[all] fi - name: Install cuda.pathfinder extra wheels for testing + if: ${{ inputs.test-mode == 'standard' }} run: | set -euo pipefail pushd cuda_pathfinder @@ -294,8 +390,145 @@ jobs: popd - name: Run cuda.pathfinder tests with all_must_work + if: ${{ inputs.test-mode == 'standard' }} env: CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: all_must_work CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS: all_must_work CUDA_PATHFINDER_TEST_FIND_NVIDIA_BITCODE_LIB_STRICTNESS: all_must_work run: run-tests pathfinder + + # ── Nightly: install wheels + optional dep together ── + - name: Install cuda-python wheels + PyTorch + if: ${{ inputs.test-mode == 'nightly-pytorch' }} + env: + CUDA_VER: ${{ matrix.CUDA_VER }} + LOCAL_CTK: ${{ matrix.LOCAL_CTK }} + run: run-tests nightly-pytorch + + - name: Install cuda-python wheels + numba-cuda + if: ${{ inputs.test-mode == 'nightly-numba-cuda' }} + env: + CUDA_VER: ${{ matrix.CUDA_VER }} + LOCAL_CTK: ${{ matrix.LOCAL_CTK }} + run: run-tests nightly-numba-cuda + + - name: Install cuda-python wheels + numba-cuda-mlir + if: ${{ inputs.test-mode == 'nightly-numba-cuda-mlir' }} + env: + CUDA_VER: ${{ matrix.CUDA_VER }} + LOCAL_CTK: ${{ matrix.LOCAL_CTK }} + run: run-tests nightly-numba-cuda-mlir + + - name: Install main pathfinder/bindings + released cuda-core + if: ${{ inputs.test-mode == 'nightly-cuda-core' }} + env: + CUDA_VER: ${{ matrix.CUDA_VER }} + LOCAL_CTK: ${{ matrix.LOCAL_CTK }} + run: run-tests nightly-cuda-core + + # ── Nightly: run tests ── + - name: Run PyTorch interop tests + if: ${{ inputs.test-mode == 'nightly-pytorch' }} + run: | + pushd cuda_core + pytest -rxXs -v --durations=0 tests/test_utils.py tests/example_tests/ + popd + + - name: Run numba-cuda tests + if: ${{ inputs.test-mode == 'nightly-numba-cuda' }} + run: python -m numba.runtests numba.cuda.tests + + - name: Checkout numba-cuda-mlir tests at matching tag + if: ${{ inputs.test-mode == 'nightly-numba-cuda-mlir' && env.NUMBA_CUDA_MLIR_VER != '' }} + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + with: + repository: NVIDIA/numba-cuda-mlir + ref: v${{ env.NUMBA_CUDA_MLIR_VER }} + path: numba-cuda-mlir-released + + - name: Run numba-cuda-mlir tests + if: ${{ inputs.test-mode == 'nightly-numba-cuda-mlir' && env.NUMBA_CUDA_MLIR_VER != '' }} + run: | + pushd numba-cuda-mlir-released + # Install this tag's test deps (pytest + plugins + ml-dtypes + ...). + pip install --upgrade "pip>=25.1" + pip install --group test + # Skip tests/benchmarks/ and tests/doc_examples/ — they import the + # numba package at collection time, which cuSIMT intentionally does + # not depend on. See NVIDIA/numba-cuda-mlir#136. + # + # Version-gated deselects: when a newer numba-cuda-mlir release + # ships with the referenced fix, the guard evaluates false and the + # tests get run automatically. If they still fail on the newer + # version we hear about it loudly (rather than silently masking). + DESELECTS=() + if python -c "from packaging.version import Version; import sys; sys.exit(0 if Version('${NUMBA_CUDA_MLIR_VER}') <= Version('0.4.0') else 1)"; then + # NVIDIA/numba-cuda-mlir#135: serial-pytest contamination of + # numba_cuda_mlir.cuda.cudadrv from an xfailed test in + # test_nrt_comprehensive.py contaminates any later test that + # touches cuda.cudadrv.driver. Upstream CI hides it via + # `-n auto --dist loadscope`. Which specific tests fail depends + # on collection order (we saw different subsets on linux-64 vs + # win-64 across runs), so we deselect the union of all tests + # #135 lists as vulnerable + test_fortran_contiguous (observed + # to hit the same contamination in our runs). + # + # test_nvjitlink_jit_with_linkable_code_lto_dump_assembly_warn: + # subprocess-invokes `cuobjdump`, not on PATH in the base + # ubuntu:24.04 container. (Linux-only; Windows runners ship + # cuobjdump with the local CTK. No upstream fix yet — pending + # a skip-guard bug to be filed against NVIDIA/numba-cuda-mlir.) + DESELECTS+=( + --deselect 'tests/numba_cuda_tests/cudadrv/test_cuda_array_slicing.py::CudaArraySetting::test_no_sync_default_stream' + --deselect 'tests/numba_cuda_tests/cudadrv/test_cuda_array_slicing.py::CudaArraySetting::test_no_sync_supplied_stream' + --deselect 'tests/numba_cuda_tests/cudadrv/test_cuda_array_slicing.py::CudaArraySetting::test_sync' + --deselect 'tests/numba_cuda_tests/cudapy/test_cuda_array_interface.py::TestCudaArrayInterface::test_consume_no_sync' + --deselect 'tests/numba_cuda_tests/cudapy/test_cuda_array_interface.py::TestCudaArrayInterface::test_consume_sync' + --deselect 'tests/numba_cuda_tests/cudapy/test_cuda_array_interface.py::TestCudaArrayInterface::test_launch_no_sync' + --deselect 'tests/numba_cuda_tests/cudapy/test_cuda_array_interface.py::TestCudaArrayInterface::test_launch_sync' + --deselect 'tests/numba_cuda_tests/cudapy/test_cuda_array_interface.py::TestCudaArrayInterface::test_launch_sync_two_streams' + --deselect 'tests/numba_cuda_tests/cudapy/test_cuda_array_interface.py::TestCudaArrayInterface::test_fortran_contiguous' + --deselect 'tests/numba_cuda_tests/cudadrv/test_nvjitlink.py::TestLinkerDumpAssembly::test_nvjitlink_jit_with_linkable_code_lto_dump_assembly_warn' + ) + fi + pytest -rxXs -v --durations=0 \ + --ignore=tests/benchmarks \ + --ignore=tests/doc_examples \ + "${DESELECTS[@]}" \ + tests/ + popd + + - name: Checkout released cuda-core tests at matching tag + if: ${{ inputs.test-mode == 'nightly-cuda-core' && env.CUDA_CORE_RELEASED_VER != '' }} + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + with: + ref: cuda-core-v${{ env.CUDA_CORE_RELEASED_VER }} + path: cuda-core-released + + - name: Run released cuda-core tests + if: ${{ inputs.test-mode == 'nightly-cuda-core' && env.CUDA_CORE_RELEASED_VER != '' }} + run: | + pushd cuda-core-released/cuda_core + # Install the released tag's test group so we exercise the exact deps + # that cuda-core version shipped with. + pip install --upgrade "pip>=25.1" + pip install --group "${CUDA_CORE_TEST_GROUP}" + # Cap pytest below 9.1: released cuda-core <=1.0.1 has parametrize + # patterns that pytest 9.1 rejects; the main-side fix (#2212) has + # not yet shipped in a cuda-core release. + pip install "pytest<9.1" + # Version-gated deselect: drops automatically when a newer + # cuda-core release with the wrapper-mapping update ships. + DESELECTS=() + if python -c "from packaging.version import Version; import sys; sys.exit(0 if Version('${CUDA_CORE_RELEASED_VER}') <= Version('1.0.1') else 1)"; then + # NvlinkVersion: v1.0.1's wrapper mapping predates + # NvlinkVersion.VERSION_6_0 which main cuda-bindings adds. + # Expected drift on this mode until released cuda-core catches up. + DESELECTS+=( + --deselect 'tests/test_enum_coverage.py::test_wrapper_covers_all_binding_members[NvlinkVersion]' + ) + fi + pytest -rxXs -v --durations=0 --randomly-dont-reorganize \ + "${DESELECTS[@]}" \ + tests/ + popd diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 478826c525c..46937cbd12d 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -22,6 +22,32 @@ on: nruns: type: number default: 1 + # When true, cuda.bindings tests (and the Cython tests that depend on + # them) are skipped even when CTK majors match. Callers set this based + # on the output of the detect-changes job in ci.yml so PRs that only + # touch unrelated modules avoid the expensive bindings test suite. + skip-bindings-test: + type: boolean + default: false + run-id: + description: > + Workflow run ID to download artifacts from. + Defaults to the current run when empty. + type: string + default: '' + test-mode: + description: > + Test mode: 'standard' (default), 'nightly-pytorch', + 'nightly-numba-cuda', 'nightly-numba-cuda-mlir', or + 'nightly-cuda-core'. + type: string + default: 'standard' + sha: + description: > + Commit SHA used to construct artifact names. + Defaults to github.sha (current run) when empty. + type: string + default: '' jobs: compute-matrix: @@ -36,7 +62,7 @@ jobs: MATRIX: ${{ steps.compute-matrix.outputs.MATRIX }} steps: - name: Checkout ${{ github.event.repository.name }} - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Validate Test Type run: | @@ -56,23 +82,29 @@ jobs: # Read base matrix from YAML file for the specific architecture TEST_MATRIX=$(yq -o json ".windows[\"${MATRIX_TYPE}\"] | map(select(.ARCH == \"${ARCH}\"))" ci/test-matrix.yml) - # Apply matrix filter and wrap in include structure - MATRIX=$(echo "$TEST_MATRIX" | jq -c '${{ inputs.matrix_filter }} | if (. | length) > 0 then {include: .} else "Error: Empty matrix\n" | halt_error(1) end') + # Apply matrix filter; add a RUNNER_DRIVER field that maps any + # custom DRIVER version back to 'latest' (install_gpu_driver.ps1 + # swaps the driver itself, so the runner must be the one that + # ships the most recent pre-installed driver); wrap in include. + MATRIX=$(echo "$TEST_MATRIX" | jq -c '${{ inputs.matrix_filter }} | map(. + {RUNNER_DRIVER: (if .DRIVER == "latest" or .DRIVER == "earliest" then .DRIVER else "latest" end)}) | if (. | length) > 0 then {include: .} else "Error: Empty matrix\n" | halt_error(1) end') echo "MATRIX=${MATRIX}" | tee --append "${GITHUB_OUTPUT}" test: - name: py${{ matrix.PY_VER }}, ${{ matrix.CUDA_VER }}, ${{ (matrix.LOCAL_CTK == '1' && 'local') || 'wheels' }}, ${{ matrix.GPU }} (${{ matrix.DRIVER_MODE }}) + name: Python ${{ matrix.PY_VER }}, CUDA ${{ matrix.CUDA_VER }} (${{ (matrix.LOCAL_CTK == '1' && 'local') || 'wheels' }}), GPU ${{ matrix.GPU }}${{ matrix.GPU_COUNT != '1' && format(' (x{0})', matrix.GPU_COUNT) || '' }} (${{ matrix.DRIVER_MODE }})${{ matrix.ENV.TORCH_VER && format(', {0}+{1}', matrix.ENV.TORCH_VER, matrix.ENV.TORCH_CUDA) || '' }}${{ matrix.ENV.MODE == 'nightly-numba-cuda' && ', latest' || '' }} + timeout-minutes: 60 # 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() }} - runs-on: "windows-${{ matrix.ARCH }}-gpu-${{ matrix.GPU }}-${{ matrix.DRIVER }}-${{ matrix.GPU_COUNT }}" + # TODO: remove continue-on-error once 3.15 is officially supported + continue-on-error: ${{ startsWith(matrix.PY_VER, '3.15') }} + runs-on: "windows-${{ matrix.ARCH }}-gpu-${{ matrix.GPU }}-${{ matrix.RUNNER_DRIVER }}-${{ matrix.GPU_COUNT }}" steps: - name: Checkout ${{ github.event.repository.name }} - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Setup proxy cache uses: nv-gha-runners/setup-proxy-cache@main @@ -80,13 +112,20 @@ jobs: with: enable-apt: true - - name: Update driver + - name: Install GPU driver + if: ${{ matrix.DRIVER != 'latest' && matrix.DRIVER != 'earliest' }} env: - DRIVER_MODE: ${{ matrix.DRIVER_MODE }} + DRIVER: ${{ matrix.DRIVER }} GPU_TYPE: ${{ matrix.GPU }} run: | ci/tools/install_gpu_driver.ps1 + - name: Configure driver mode + env: + DRIVER_MODE: ${{ matrix.DRIVER_MODE }} + run: | + ci/tools/configure_driver_mode.ps1 + - name: Ensure GPU is working run: | nvidia-smi @@ -106,72 +145,86 @@ jobs: HOST_PLATFORM: ${{ inputs.host-platform }} LOCAL_CTK: ${{ matrix.LOCAL_CTK }} PY_VER: ${{ matrix.PY_VER }} - SHA: ${{ github.sha }} + SHA: ${{ inputs.sha || github.sha }} + SKIP_BINDINGS_TEST_OVERRIDE: ${{ inputs.skip-bindings-test && '1' || '0' }} shell: bash --noprofile --norc -xeuo pipefail {0} run: ./ci/tools/env-vars test + - name: Apply extra matrix environment variables + if: ${{ matrix.ENV }} + env: + MATRIX_ENV: ${{ toJSON(matrix.ENV) }} + shell: bash --noprofile --norc -xeuo pipefail {0} + run: echo "$MATRIX_ENV" | jq -r 'to_entries[] | "\(.key)=\(.value)"' >> "$GITHUB_ENV" + - name: Download cuda-pathfinder build artifacts - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: cuda-pathfinder-wheel path: ./cuda_pathfinder + run-id: ${{ inputs.run-id || github.run_id }} + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Download cuda-python build artifacts - if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0'}} - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + if: ${{ env.BINDINGS_SOURCE == 'main' }} + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: cuda-python-wheel path: . + run-id: ${{ inputs.run-id || github.run_id }} + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Download cuda.bindings build artifacts - if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0'}} - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + if: ${{ env.BINDINGS_SOURCE == 'main' }} + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} + run-id: ${{ inputs.run-id || github.run_id }} + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Download cuda-python & cuda.bindings build artifacts from the prior branch - if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '1'}} + if: ${{ env.BINDINGS_SOURCE == 'backport' }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash --noprofile --norc -xeuo pipefail {0} run: | - $OLD_BRANCH = yq '.backport_branch' ci/versions.yml - $OLD_BASENAME = "cuda-bindings-python${env:PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}*" - $runData = gh run list -b $OLD_BRANCH -L 1 -w "ci.yml" -s success -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 - } - $LATEST_PRIOR_RUN_ID = $runData[0].databaseId + OLD_BRANCH=$(yq '.backport_branch' ci/versions.yml) + OLD_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}*" + LATEST_PRIOR_RUN_ID=$(./ci/tools/lookup-run-id --branch "${OLD_BRANCH}" NVIDIA/cuda-python "CI") - 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 }}" - Remove-Item -Path $OLD_BASENAME -Force + 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 }}"/ + rmdir $OLD_BASENAME gh run download $LATEST_PRIOR_RUN_ID -p cuda-python-wheel -R NVIDIA/cuda-python - Get-ChildItem -Path cuda-python-wheel - Move-Item -Path "cuda-python-wheel/*.whl" -Destination . - Remove-Item -Path cuda-python-wheel -Force + ls -al cuda-python-wheel + mv cuda-python-wheel/*.whl . + rmdir cuda-python-wheel - name: Display structure of downloaded cuda-python artifacts + if: ${{ env.BINDINGS_SOURCE != 'published' }} run: | Get-Location - Get-ChildItem -Recurse -Force | Select-Object Mode, LastWriteTime, Length, FullName + Get-ChildItem cuda_python*.whl | Select-Object Mode, LastWriteTime, Length, FullName - name: Display structure of downloaded cuda.bindings artifacts + if: ${{ env.BINDINGS_SOURCE != 'published' }} run: | Get-Location Get-ChildItem -Recurse -Force $env:CUDA_BINDINGS_ARTIFACTS_DIR | Select-Object Mode, LastWriteTime, Length, FullName - name: Download cuda.bindings Cython tests if: ${{ env.SKIP_CYTHON_TEST == '0' }} - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}-tests path: ${{ env.CUDA_BINDINGS_CYTHON_TESTS_DIR }} + run-id: ${{ inputs.run-id || github.run_id }} + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Display structure of downloaded cuda.bindings Cython tests if: ${{ env.SKIP_CYTHON_TEST == '0' }} @@ -180,10 +233,12 @@ 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@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: ${{ env.CUDA_CORE_ARTIFACT_NAME }} path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }} + run-id: ${{ inputs.run-id || github.run_id }} + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Display structure of downloaded cuda.core build artifacts run: | @@ -192,10 +247,12 @@ jobs: - name: Download cuda.core Cython tests if: ${{ env.SKIP_CYTHON_TEST == '0' }} - uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-tests path: ${{ env.CUDA_CORE_CYTHON_TESTS_DIR }} + run-id: ${{ inputs.run-id || github.run_id }} + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Display structure of downloaded cuda.core Cython tests if: ${{ env.SKIP_CYTHON_TEST == '0' }} @@ -203,11 +260,33 @@ jobs: Get-Location Get-ChildItem -Recurse -Force $env:CUDA_CORE_CYTHON_TESTS_DIR | Select-Object Mode, LastWriteTime, Length, FullName + - name: Download cuda.core test binaries + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-test-binaries + path: ${{ env.CUDA_CORE_TEST_BINARIES_DIR }} + run-id: ${{ inputs.run-id || github.run_id }} + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Display structure of downloaded cuda.core test binaries + run: | + Get-Location + Get-ChildItem -Recurse -Force $env:CUDA_CORE_TEST_BINARIES_DIR | Select-Object Mode, LastWriteTime, Length, FullName + - name: Set up Python ${{ matrix.PY_VER }} - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: ${{ matrix.PY_VER }} + - name: Verify LongPathsEnabled + run: | + $val = (Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled').LongPathsEnabled + echo "LongPathsEnabled = $val" + if ($val -ne 1) { + echo "::error::LongPathsEnabled is not set to 1 (see issue #1820)" + exit 1 + } + - name: Set up mini CTK if: ${{ matrix.LOCAL_CTK == '1' }} uses: ./.github/actions/fetch_ctk @@ -216,11 +295,26 @@ jobs: host-platform: ${{ inputs.host-platform }} cuda-version: ${{ matrix.CUDA_VER }} + # TODO: remove the numpy wheel steps once 3.15 is officially supported + - name: Download numpy wheel (pre-release Python) + if: ${{ startsWith(matrix.PY_VER, '3.15') }} + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: numpy-python${{ env.PYTHON_VERSION_FORMATTED }}-${{ inputs.host-platform }} + path: numpy-wheel + + - name: Install numpy wheel (pre-release Python) + if: ${{ startsWith(matrix.PY_VER, '3.15') }} + shell: bash --noprofile --norc -xeuo pipefail {0} + run: pip install numpy-wheel/*.whl + - name: Set up test repetition on nightly runs shell: bash --noprofile --norc -xeuo pipefail {0} run: echo "PYTEST_ADDOPTS=\"--count=${{ inputs.nruns }}\"" >> "$GITHUB_ENV" + # ── Standard test steps (skipped for nightly modes) ── - name: Run cuda.pathfinder tests with see_what_works + if: ${{ inputs.test-mode == 'standard' }} env: CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: see_what_works CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS: see_what_works @@ -229,25 +323,15 @@ jobs: run: run-tests pathfinder - name: Run cuda.bindings tests - if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }} + if: ${{ inputs.test-mode == 'standard' && env.SKIP_CUDA_BINDINGS_TEST == '0' }} env: CUDA_VER: ${{ matrix.CUDA_VER }} LOCAL_CTK: ${{ matrix.LOCAL_CTK }} shell: bash --noprofile --norc -xeuo pipefail {0} run: run-tests bindings - - name: Run cuda.bindings examples - if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }} - env: - CUDA_VER: ${{ matrix.CUDA_VER }} - LOCAL_CTK: ${{ matrix.LOCAL_CTK }} - shell: bash --noprofile --norc -xeuo pipefail {0} - run: | - pushd cuda_bindings - ${SANITIZER_CMD} pytest -ra -s -vv examples/ - popd - - name: Run cuda.core tests + if: ${{ inputs.test-mode == 'standard' }} env: CUDA_VER: ${{ matrix.CUDA_VER }} LOCAL_CTK: ${{ matrix.LOCAL_CTK }} @@ -255,14 +339,18 @@ jobs: run: run-tests core - name: Ensure cuda-python installable + if: ${{ inputs.test-mode == 'standard' && env.BINDINGS_SOURCE == 'main' }} run: | + # Subpackages are already installed from CI artifacts; --no-deps keeps + # tag-release cuda-core wheels from being replaced by PyPI pins. if ('${{ matrix.LOCAL_CTK }}' -eq '1') { - pip install --only-binary=:all: (Get-ChildItem -Filter cuda_python*.whl).FullName + pip install --only-binary=:all: --no-deps (Get-ChildItem -Filter cuda_python*.whl).FullName } else { - pip install --only-binary=:all: "$((Get-ChildItem -Filter cuda_python*.whl).FullName)[all]" + pip install --only-binary=:all: --no-deps "$((Get-ChildItem -Filter cuda_python*.whl).FullName)[all]" } - name: Install cuda.pathfinder extra wheels for testing + if: ${{ inputs.test-mode == 'standard' }} shell: bash --noprofile --norc -xeuo pipefail {0} run: | pushd cuda_pathfinder @@ -271,9 +359,146 @@ jobs: popd - name: Run cuda.pathfinder tests with all_must_work + if: ${{ inputs.test-mode == 'standard' }} env: CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: all_must_work CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS: all_must_work CUDA_PATHFINDER_TEST_FIND_NVIDIA_BITCODE_LIB_STRICTNESS: all_must_work shell: bash --noprofile --norc -xeuo pipefail {0} run: run-tests pathfinder + + # ── Nightly: install wheels + optional dep together ── + - name: Install Visual C++ Redistributable (required by PyTorch on Windows) + if: ${{ inputs.test-mode == 'nightly-pytorch' }} + run: | + Invoke-WebRequest -Uri "https://aka.ms/vs/17/release/vc_redist.x64.exe" -OutFile "vc_redist.x64.exe" + Start-Process -FilePath ".\vc_redist.x64.exe" -ArgumentList "/install", "/quiet", "/norestart" -Wait + Remove-Item "vc_redist.x64.exe" + + - name: Install cuda-python wheels + PyTorch + if: ${{ inputs.test-mode == 'nightly-pytorch' }} + env: + CUDA_VER: ${{ matrix.CUDA_VER }} + LOCAL_CTK: ${{ matrix.LOCAL_CTK }} + shell: bash --noprofile --norc -xeuo pipefail {0} + run: run-tests nightly-pytorch + + - name: Install cuda-python wheels + numba-cuda + if: ${{ inputs.test-mode == 'nightly-numba-cuda' }} + env: + CUDA_VER: ${{ matrix.CUDA_VER }} + LOCAL_CTK: ${{ matrix.LOCAL_CTK }} + shell: bash --noprofile --norc -xeuo pipefail {0} + run: run-tests nightly-numba-cuda + + - name: Install cuda-python wheels + numba-cuda-mlir + if: ${{ inputs.test-mode == 'nightly-numba-cuda-mlir' }} + env: + CUDA_VER: ${{ matrix.CUDA_VER }} + LOCAL_CTK: ${{ matrix.LOCAL_CTK }} + shell: bash --noprofile --norc -xeuo pipefail {0} + run: run-tests nightly-numba-cuda-mlir + + - name: Install main pathfinder/bindings + released cuda-core + if: ${{ inputs.test-mode == 'nightly-cuda-core' }} + env: + CUDA_VER: ${{ matrix.CUDA_VER }} + LOCAL_CTK: ${{ matrix.LOCAL_CTK }} + shell: bash --noprofile --norc -xeuo pipefail {0} + run: run-tests nightly-cuda-core + + # ── Nightly: run tests ── + - name: Run PyTorch interop tests + if: ${{ inputs.test-mode == 'nightly-pytorch' }} + shell: bash --noprofile --norc -xeuo pipefail {0} + run: | + pushd cuda_core + pytest -rxXs -v --durations=0 tests/test_utils.py tests/example_tests/ + popd + + - name: Run numba-cuda tests + if: ${{ inputs.test-mode == 'nightly-numba-cuda' }} + shell: bash --noprofile --norc -xeuo pipefail {0} + run: python -m numba.runtests numba.cuda.tests + + - name: Checkout numba-cuda-mlir tests at matching tag + if: ${{ inputs.test-mode == 'nightly-numba-cuda-mlir' && env.NUMBA_CUDA_MLIR_VER != '' }} + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + with: + repository: NVIDIA/numba-cuda-mlir + ref: v${{ env.NUMBA_CUDA_MLIR_VER }} + path: numba-cuda-mlir-released + + - name: Run numba-cuda-mlir tests + if: ${{ inputs.test-mode == 'nightly-numba-cuda-mlir' && env.NUMBA_CUDA_MLIR_VER != '' }} + shell: bash --noprofile --norc -xeuo pipefail {0} + run: | + pushd numba-cuda-mlir-released + pip install --upgrade "pip>=25.1" + pip install --group test + # Version-gated deselects — dropped automatically when newer + # cuSIMT release ships. See linux step for full rationale. + # NVIDIA/numba-cuda-mlir#135 poisons a subset of tests that + # varies across runs based on collection order, so we deselect + # the full union rather than trying to enumerate what happened + # to fail on the most recent nightly. + DESELECTS=() + if python -c "from packaging.version import Version; import sys; sys.exit(0 if Version('${NUMBA_CUDA_MLIR_VER}') <= Version('0.4.0') else 1)"; then + DESELECTS+=( + --deselect 'tests/numba_cuda_tests/cudadrv/test_cuda_array_slicing.py::CudaArraySetting::test_no_sync_default_stream' + --deselect 'tests/numba_cuda_tests/cudadrv/test_cuda_array_slicing.py::CudaArraySetting::test_no_sync_supplied_stream' + --deselect 'tests/numba_cuda_tests/cudadrv/test_cuda_array_slicing.py::CudaArraySetting::test_sync' + --deselect 'tests/numba_cuda_tests/cudapy/test_cuda_array_interface.py::TestCudaArrayInterface::test_consume_no_sync' + --deselect 'tests/numba_cuda_tests/cudapy/test_cuda_array_interface.py::TestCudaArrayInterface::test_consume_sync' + --deselect 'tests/numba_cuda_tests/cudapy/test_cuda_array_interface.py::TestCudaArrayInterface::test_launch_no_sync' + --deselect 'tests/numba_cuda_tests/cudapy/test_cuda_array_interface.py::TestCudaArrayInterface::test_launch_sync' + --deselect 'tests/numba_cuda_tests/cudapy/test_cuda_array_interface.py::TestCudaArrayInterface::test_launch_sync_two_streams' + --deselect 'tests/numba_cuda_tests/cudapy/test_cuda_array_interface.py::TestCudaArrayInterface::test_fortran_contiguous' + ) + fi + pytest -rxXs -v --durations=0 \ + --ignore=tests/benchmarks \ + --ignore=tests/doc_examples \ + "${DESELECTS[@]}" \ + tests/ + popd + + - name: Checkout released cuda-core tests at matching tag + if: ${{ inputs.test-mode == 'nightly-cuda-core' && env.CUDA_CORE_RELEASED_VER != '' }} + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + with: + ref: cuda-core-v${{ env.CUDA_CORE_RELEASED_VER }} + path: cuda-core-released + + - name: Run released cuda-core tests + if: ${{ inputs.test-mode == 'nightly-cuda-core' && env.CUDA_CORE_RELEASED_VER != '' }} + shell: bash --noprofile --norc -xeuo pipefail {0} + run: | + pushd cuda-core-released/cuda_core + pip install --upgrade "pip>=25.1" + pip install --group "${CUDA_CORE_TEST_GROUP}" + # Cap pytest below 9.1 — released cuda-core <=1.0.1 has parametrize + # patterns that pytest 9.1 rejects (see #2212). + pip install "pytest<9.1" + # Version-gated deselects — dropped automatically when a newer + # cuda-core release ships. See linux step for full rationale on + # NvlinkVersion. The Windows-only tests are: + # - test_rlcompleter_patch: env-dependent expectation that + # passes on Linux, fails on Windows MCDM. + # - test_non_managed_resources_report_not_managed[pinned]: same + # MCDM mempool OOM v1.0.1 already xfails in + # test_pinned_memory_resource_initialization (TODO(#9999)); + # main fixed the parametrized case via #2139 but v1.0.1 lacks + # the fix. + DESELECTS=() + if python -c "from packaging.version import Version; import sys; sys.exit(0 if Version('${CUDA_CORE_RELEASED_VER}') <= Version('1.0.1') else 1)"; then + DESELECTS+=( + --deselect 'tests/test_enum_coverage.py::test_wrapper_covers_all_binding_members[NvlinkVersion]' + --deselect 'tests/test_rlcompleter_patch.py::test_opt_out_env_var_disables_patch_even_when_interactive' + --deselect 'tests/test_memory.py::test_non_managed_resources_report_not_managed[pinned]' + ) + fi + pytest -rxXs -v --durations=0 --randomly-dont-reorganize \ + "${DESELECTS[@]}" \ + tests/ + popd diff --git a/.gitignore b/.gitignore index 7d9bcd38c37..a66da355940 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ __pycache__/ # CUDA Python specific .cache/ +.lycheecache .pytest_cache/ .benchmarks/ *.cpp @@ -17,39 +18,30 @@ __pycache__/ cache_driver cache_runtime cache_nvrtc -cuda_bindings/cuda/bindings/_lib/utils.pxi + +# cuda.core test object fixtures built locally / downloaded as CI artifacts +cuda_core/tests/test_binaries/*.o +cuda_core/tests/test_binaries/*.a +cuda_core/tests/test_binaries/*.lib # CUDA Python specific (auto-generated) -cuda_bindings/cuda/bindings/_bindings/cydriver.pxd -cuda_bindings/cuda/bindings/_bindings/cydriver.pyx cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pxd cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pyx -cuda_bindings/cuda/bindings/_bindings/cynvrtc.pxd -cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx -cuda_bindings/cuda/bindings/_internal/_nvml.pyx +cuda_bindings/cuda/bindings/_internal/driver.pyx +cuda_bindings/cuda/bindings/_internal/nvrtc.pyx cuda_bindings/cuda/bindings/_internal/cufile.pyx cuda_bindings/cuda/bindings/_internal/nvfatbin.pyx cuda_bindings/cuda/bindings/_internal/nvjitlink.pyx cuda_bindings/cuda/bindings/_internal/nvml.pyx cuda_bindings/cuda/bindings/_internal/nvvm.pyx -cuda_bindings/cuda/bindings/_lib/utils.pxd -cuda_bindings/cuda/bindings/_lib/utils.pyx -cuda_bindings/cuda/bindings/cydriver.pxd -cuda_bindings/cuda/bindings/cydriver.pyx cuda_bindings/cuda/bindings/cyruntime.pxd cuda_bindings/cuda/bindings/cyruntime.pyx cuda_bindings/cuda/bindings/cyruntime_functions.pxi cuda_bindings/cuda/bindings/cyruntime_types.pxi -cuda_bindings/cuda/bindings/cynvrtc.pxd -cuda_bindings/cuda/bindings/cynvrtc.pyx -cuda_bindings/cuda/bindings/driver.pxd -cuda_bindings/cuda/bindings/driver.pyx cuda_bindings/cuda/bindings/runtime.pxd cuda_bindings/cuda/bindings/runtime.pyx -cuda_bindings/cuda/bindings/nvrtc.pxd -cuda_bindings/cuda/bindings/nvrtc.pyx cuda_bindings/cuda/bindings/utils/_get_handle.pyx # Version files from setuptools_scm @@ -120,6 +112,7 @@ instance/ # Sphinx documentation docs_src/_build/ */docs/source/generated/ +*/docs/source/module/generated/ # PyBuilder .pybuilder/ @@ -195,3 +188,4 @@ cython_debug/ # Cursor .cursorrules +.claude/settings.local.json diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 781923d4f05..029e69da916 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,30 +9,47 @@ ci: autoupdate_branch: '' autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate' autoupdate_schedule: quarterly + skip: [lychee, check-precommit-installed] submodules: false # Please update the rev: SHAs below with this command: # pre-commit autoupdate --freeze repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 5ba58aca0bd5bc7c0e1c0fc45af2e88d6a2bde83 # frozen: v0.14.10 + rev: c60c980e561ed3e73101667fe8365c609d19a438 # frozen: v0.15.9 hooks: - id: ruff-check args: [--fix, --show-fixes] - exclude: ^cuda_bindings/cuda/bindings/_internal/_fast_enum\.py$ + exclude: (^cuda_bindings/cuda/bindings/_internal/_fast_enum\.py$)|(.*\.pyi$) - id: ruff-format + exclude: .*\.pyi$ - repo: local hooks: + - id: check-precommit-installed + name: Warn if the pre-commit git hook is not installed + entry: python ./toolshed/check_precommit_installed.py + language: python + always_run: true + pass_filenames: false + verbose: true + - id: check-spdx name: Check SPDX Headers entry: python ./toolshed/check_spdx.py language: python additional_dependencies: - https://files.pythonhosted.org/packages/cc/20/ff623b09d963f88bfde16306a54e12ee5ea43e9b597108672ff3a408aad6/pathspec-0.12.1-py3-none-any.whl - exclude: '(.*pixi\.lock)|(\.git_archival\.txt)|(.*\.patch$)' + exclude: '(.*pixi\.lock)|(\.git_archival\.txt)|(.*\.patch$)|(^cuda_core/cuda/core/_vendored/)' args: ["--fix"] + - id: check-generated-file-seals + name: Check generated-file seals + entry: python ./toolshed/check_generated_file_seals.py + language: python + files: ^cuda_bindings/ + types: [text] + - id: no-markdown-in-docs-source name: Prevent markdown files in docs/source directories entry: bash -c @@ -42,6 +59,28 @@ repos: language: system files: '^.*/docs/source/.*\.md$' + - id: stubgen-pyx-cuda-core + name: Generate .pyi stubs for cuda_core + entry: stubgen-pyx cuda_core/cuda --continue-on-error --include-private + language: python + files: ^cuda_core/cuda/.*\.(pyx|pxd)$ + pass_filenames: false + additional_dependencies: + - stubgen-pyx==0.2.6 + - Cython==3.2.4 + + # Link checking for authored documentation files + - repo: https://github.com/lycheeverse/lychee + rev: 2bba271688c1abb1503097a064e6c3bc1d1b6a9b # frozen: lychee-v0.24.2 + hooks: + - id: lychee + args: + - --cache + - --max-concurrency=4 + - --max-retries=3 + - --no-progress + files: '\.(md|rst)$' + # Standard hooks - repo: https://github.com/pre-commit/pre-commit-hooks rev: "3e8a8703264a2f4a69428a0aa4dcb512790b2c8c" # frozen: v6.0.0 @@ -56,7 +95,7 @@ repos: - id: check-yaml - id: debug-statements - id: end-of-file-fixer - exclude: &gen_exclude '^(?:cuda_python/README\.md|cuda_bindings/cuda/bindings/.*\.in?|cuda_bindings/docs/source/module/.*\.rst?)$' + exclude: &gen_exclude '^(?:cuda_python/README\.md|cuda_bindings/cuda/bindings/.*\.in?|cuda_bindings/docs/source/module/.*\.rst?|.*\.pyi)$' - id: mixed-line-ending - id: trailing-whitespace exclude: | @@ -76,22 +115,32 @@ repos: - id: rst-inline-touching-normal - repo: https://github.com/pre-commit/mirrors-mypy - rev: a66e98df7b4aeeb3724184b332785976d062b92e # frozen: v1.19.1 + rev: 8e5c80792e2ec0c87804d8ef915bf35e2caea6da # frozen: v1.20.0 hooks: - id: mypy + alias: mypy-pathfinder name: mypy-pathfinder files: ^cuda_pathfinder/cuda/.*\.py$ # Exclude tests directory args: [--config-file=cuda_pathfinder/pyproject.toml] + - id: mypy + alias: mypy-cuda-core + name: mypy-cuda-core + files: ^cuda_core/cuda/.*\.(py|pyi)$ + exclude: ^cuda_core/cuda/core/_vendored/ + pass_filenames: false + args: [--config-file=cuda_core/pyproject.toml, cuda_core/cuda/core] + additional_dependencies: + - numpy==2.4.2 - repo: https://github.com/rhysd/actionlint - rev: "0933c147c9d6587653d45fdcb4c497c57a65f9af" # frozen: v1.7.10 + rev: "914e7df21a07ef503a81201c76d2b11c789d3fca" # frozen: v1.7.12 hooks: - id: actionlint args: ["-shellcheck="] exclude: ^\.github/workflows/coverage.yml$ - repo: https://github.com/MarcoGorelli/cython-lint - rev: "d9ff7ce99ef4f2ae8fba93079ca9d76c4651d4ac" # frozen: v0.18.0 + rev: "7c6152f6c8f9087684ff2e09a9227941e233bafb" # frozen: v0.19.0 hooks: - id: cython-lint args: [--no-pycodestyle] diff --git a/.spdx-ignore b/.spdx-ignore index 7263b5414f7..c0bf98105e7 100644 --- a/.spdx-ignore +++ b/.spdx-ignore @@ -1,4 +1,4 @@ -LICENSE +LICENSE* *.html *.json *.md @@ -10,5 +10,10 @@ cuda_bindings/examples/* # Vendored cuda_core/cuda/core/_include/dlpack.h +cuda_core/cuda/core/_include/aoti_shim.h +cuda_core/cuda/core/_include/aoti_shim.def + +# Generated by stubgen-pyx; regenerated on every commit so a header would be lost +cuda_core/cuda/**/*.pyi qa/ctk-next.drawio.svg diff --git a/AGENTS.md b/AGENTS.md index 525d3008015..e66437159b0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -12,6 +12,30 @@ guide for package-specific conventions and workflows. - `cuda_core/`: High-level Pythonic CUDA APIs built on top of bindings. - `cuda_python/`: Metapackage and docs aggregation. +# Pull requests + +**Never push branches or commits to the upstream repo (github.com/NVIDIA/cuda-python). +Treat it as read-only.** All branch creation and pushes must go to the contributor's +personal fork. Before pushing, confirm which remote points to the contributor's +personal fork (not `upstream`) by running `git remote -v`, then push there +(`git push `). Open the PR from that fork with +`gh pr create`. Do not use `git push upstream` or any command that writes to +the `upstream` remote. + +When creating pull requests with `gh pr create`, always assign at least one +label and a milestone. CI enforces this via the `pr-metadata-check` workflow +and will block PRs that are missing labels or a milestone. Use `--label` and +`--milestone` flags, for example: + +``` +gh pr create --title "..." --body "..." --label "bug" --milestone "v1.0" +``` + +If you are unsure which label or milestone to use, check the existing labels +and milestones on the repository with `gh label list` and `gh api +repos/{owner}/{repo}/milestones --jq '.[].title'`, and pick the best match. + + # General - When searching for text or files, prefer using `rg` or `rg --files` @@ -23,6 +47,12 @@ guide for package-specific conventions and workflows. (search), `read_file`, `list_dir`, `glob_file_search`, `apply_patch`, `todo_write/update_plan`. Use `cmd`/`run_terminal_cmd` only when no listed tool can perform the action. +- If `pixi` is available for this repo, prefer `pixi run ...` or the matching + `pixi` task over invoking raw `python`, `pytest`, `pip`, or similar tools + directly so commands run in the repository-managed environment. +- When extracting or transforming JSON in shell workflows, prefer `jq` over + one-off Python parsing. For `gh` commands that return JSON, prefer the + built-in `--jq` flag instead of piping the output into `python`. - When multiple tool calls can be parallelized (e.g., todo updates with other actions, file searches, reading files), make these tool calls in parallel instead of sequential. Avoid single calls that might not yield a useful @@ -83,6 +113,44 @@ guide for package-specific conventions and workflows. end on clarifications unless truly blocked. Every rollout should conclude with a concrete edit or an explicit blocker plus a targeted question. +## Test authorship markers + +Use pytest markers to make the provenance of newly added unit tests explicit. +Keep this provenance system minimal: choose from only these three markers. +Place the marker immediately above each test function. A class-level marker is +acceptable only when every test method in the class has the same provenance. +Do not use module-level `pytestmark` for authorship provenance; it is too easy +to miss in large files and makes later per-test provenance changes ambiguous. + +- `@pytest.mark.agent_authored(model="")`: the test was authored by an + agent and has not yet been materially reviewed or rewritten by a human. + Agents must add this marker when generating new unit tests, for example: + + ```python + import pytest + + @pytest.mark.agent_authored(model="gpt-5.5") + def test_something(): + ... + ``` + +- `@pytest.mark.human_reviewed`: a human has materially reviewed or rewritten + an agent-authored test. Prefer replacing + `@pytest.mark.agent_authored(model="")` with this marker instead of + keeping both. +- `@pytest.mark.human_authored`: the test was authored by a human, or + rewritten enough that the authorship is primarily human. + +Use at most one authorship marker per test. Treat missing markers as legacy or +unknown provenance, not as implicit `@pytest.mark.human_authored`. Because +these are pytest markers, tests can be selected with `pytest -m`, for example +`pytest -m agent_authored`. + +When an agent notices a human adding a new test or materially modifying an +existing test, suggest adding `@pytest.mark.human_authored` or replacing +`@pytest.mark.agent_authored(model="")` with +`@pytest.mark.human_reviewed` as appropriate. + # Editing constraints diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7c531066d18..012126cc842 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,18 +9,51 @@ Thank you for your interest in contributing to CUDA Python! Based on the type of 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 refer to each component's guideline: + - Before starting work on an existing issue, please comment on the issue to express your interest and wait to be assigned by a maintainer. This helps avoid redundant effort in case the issue is already being worked on by another contributor or an NVIDIA team member. + - 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)[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) - +- [Contributing to CUDA Python](#contributing-to-cuda-python) + - [Table of Contents](#table-of-contents) + - [Type stubs for cuda.core](#type-stubs-for-cudacore) + - [Pre-commit](#pre-commit) + - [Signing Your Work](#signing-your-work) + - [Code signing](#code-signing) + - [Developer Certificate of Origin (DCO)](#developer-certificate-of-origin-dco) + - [CI infrastructure overview](#ci-infrastructure-overview) + - [CI Pipeline Flow](#ci-pipeline-flow) + - [Pipeline Execution Details](#pipeline-execution-details) + - [Branch-specific Artifact Flow](#branch-specific-artifact-flow) + - [Main Branch](#main-branch) + - [Backport Branches](#backport-branches) + - [Key Infrastructure Details](#key-infrastructure-details) + - [Code coverage](#code-coverage) + + +## Type stubs for cuda.core + +`cuda.core` is a PEP 561-compliant package: it ships a `py.typed` marker and +`.pyi` stub files alongside the Cython extensions. The stubs +are checked into the repository. + +**You do not need to run stubgen-pyx manually.** A pre-commit hook +regenerates the corresponding `.pyi` files automatically when you commit. +The results are then also tested with `mypy`. + +A few things to keep in mind: + +- **Do not edit `.pyi` files by hand.** They are regenerated from the Cython + sources on every commit that touches those sources; manual edits will be + overwritten. +- **Type annotations belong in the `.pyx`/`.pxd` source.** stubgen-pyx reads + Cython type annotations and docstrings to build the stubs, so keeping the + source well-annotated is the right way to improve stub quality. +- **To run mypy manually (outside of pre-commit)**: `python -m mypy + --config-file cuda_core/pyproject.toml ## Pre-commit This project uses [pre-commit.ci](https://pre-commit.ci/) with GitHub Actions. All pull requests are automatically checked for pre-commit compliance, and any pre-commit failures will block merging until resolved. @@ -28,21 +61,41 @@ This project uses [pre-commit.ci](https://pre-commit.ci/) with GitHub Actions. A To set yourself up for running pre-commit checks locally and to catch issues before pushing your changes, follow these steps: * Install pre-commit with: `pip install pre-commit` +* Run this once per checkout: `pre-commit install` * You can manually check all files at any time by running: `pre-commit run --all-files` This command runs all configured hooks (such as linters and formatters) across your repository, letting you review and address issues before committing. -**Optional: Enable automatic checks on every commit** -If you want pre-commit hooks to run automatically each time you make a commit, install the git hook with: +Installing the hook is required, not optional. Some of the automated checks +(the SPDX header updater and the `.pyi` stub generator for `cuda_core`) only +keep the tree consistent if they run on *every* commit. Relying on manual +`pre-commit run --all-files` invocations means these checks can be skipped +between commits, leaving stale headers or out-of-date stubs in the history. +If the hook isn't installed, `pre-commit run` (and CI) will print a visible +warning reminding you to run `pre-commit install`. + + +## Signing Your Work -`pre-commit install` +Contributions to files licensed under Apache 2.0 must be certified under the +[Developer Certificate of Origin (DCO)](#developer-certificate-of-origin-dco). +Sign off every commit with the `-s` option: -This sets up a git pre-commit hook so that all configured checks will run before each commit is accepted. If any hook fails, the commit will be blocked until the issues are resolved. +```console +git commit -s -m "Describe your change" +``` + +Git uses your configured name and email address to add a trailer like this to +the commit message: -**Note on workflow flexibility** -Some contributors prefer to commit intermediate or work-in-progress changes that may not pass all pre-commit checks, and only clean up their commits before pushing (for example, by squashing and running `pre-commit run --all-files` manually at the end). If this fits your workflow, you may choose not to run `pre-commit install` and instead rely on manual checks. This approach avoids disruption during iterative development, while still ensuring code quality before code is shared or merged. +```text +Signed-off-by: Your Name +``` -Choose the setup that best fits your workflow and development style. +Use your real name and an email address associated with your contribution. The +sign-off certifies that you have the right to submit the contribution under the +DCO below. DCO sign-off is separate from the cryptographic commit signing +described in the next section; both requirements apply. ## Code signing diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000000..d6f74778be8 --- /dev/null +++ b/LICENSE @@ -0,0 +1,178 @@ +Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index 692f03777e7..00000000000 --- a/LICENSE.md +++ /dev/null @@ -1,6 +0,0 @@ -This repository is structured in a way that files are licensed differently - - [`cuda.python`](./cuda_python/LICENSE): NVIDIA Software License - - [`cuda.bindings`](./cuda_bindings/LICENSE): NVIDIA Software License - - [`cuda.core`](./cuda_core/LICENSE): Apache 2.0 - - [`cuda.pathfinder`](./cuda_pathfinder/LICENSE): Apache 2.0 - - Repo metadata, CI tools, GitHub workflows: Apache 2.0 diff --git a/README.md b/README.md index 6da895bbb9b..243669b69ee 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,9 @@ 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 functionality * [cuda.bindings](https://nvidia.github.io/cuda-python/cuda-bindings/latest): Low-level Python bindings to CUDA C APIs * [cuda.pathfinder](https://nvidia.github.io/cuda-python/cuda-pathfinder/latest): Utilities for locating CUDA components installed in the user's Python environment -* [cuda.coop](https://nvidia.github.io/cccl/python/coop): A Python module providing CCCL's reusable block-wide and warp-wide *device* primitives for use within Numba CUDA kernels -* [cuda.compute](https://nvidia.github.io/cccl/python/compute): 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.coop](https://nvidia.github.io/cccl/unstable/python/coop.html): A Python module providing CCCL's reusable block-wide and warp-wide *device* primitives for use within Numba CUDA kernels +* [cuda.compute](https://nvidia.github.io/cccl/unstable/python/compute/index.html): 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-mlir](https://nvidia.github.io/numba-cuda-mlir/): An evolution of Numba CUDA that improves upon its technical foundation and performance to provide the future of CUDA Python JIT compilation. It currently supports developing CUDA **SIMT** kernels in Python, providing Python bindings for accelerated device libraries, and serving as a compiler for user-defined functions in accelerated libraries. * [numba.cuda](https://nvidia.github.io/numba-cuda/): A Python DSL that exposes CUDA **SIMT** programming model and compiles a restricted subset of Python code into CUDA kernels and device functions * [cuda.tile](https://docs.nvidia.com/cuda/cutile-python/): A new Python DSL that exposes CUDA **Tile** programming model and allows users to write NumPy-like code in CUDA kernels * [nvmath-python](https://docs.nvidia.com/cuda/nvmath-python/latest): Pythonic access to NVIDIA CPU & GPU Math Libraries, with [*host*](https://docs.nvidia.com/cuda/nvmath-python/latest/overview.html#host-apis), [*device*](https://docs.nvidia.com/cuda/nvmath-python/latest/overview.html#device-apis), and [*distributed*](https://docs.nvidia.com/cuda/nvmath-python/latest/distributed-apis/index.html) 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)). @@ -44,4 +45,11 @@ The list of available interfaces is: * NVRTC * nvJitLink * NVVM +* nvFatbin * cuFile +* NVML + +## License + +CUDA Python is licensed under the [Apache License 2.0](./LICENSE). Third-party +attributions for `cuda.core` are listed in [`cuda_core/NOTICE`](./cuda_core/NOTICE). diff --git a/SECURITY.md b/SECURITY.md index 42835415566..63ef6e4950c 100755 --- a/SECURITY.md +++ b/SECURITY.md @@ -29,6 +29,17 @@ disclosure policy. Please visit our [Product Security Incident Response Team (PSIRT)](https://www.nvidia.com/en-us/security/psirt-policies/) policies page for more information. +## CUDA IPC and Python serialization + +`cuda.core.Buffer` objects allocated from IPC-enabled memory resources can be +pickled for transfer between same-host processes. Unpickling performs an IPC +memory import using the embedded `IPCBufferDescriptor`. Only unpickle buffers +(and call `Buffer.from_ipc_descriptor`) with descriptors from trusted peers; +malicious descriptors can trigger invalid memory operations. + +When sharing CUDA objects across processes, use `multiprocessing` with the +`spawn` start method. + ## NVIDIA Product Security For all security-related concerns, please visit NVIDIA's Product Security portal at diff --git a/benchmarks/cuda_bindings/.gitignore b/benchmarks/cuda_bindings/.gitignore new file mode 100644 index 00000000000..b795782a321 --- /dev/null +++ b/benchmarks/cuda_bindings/.gitignore @@ -0,0 +1,16 @@ +# Build artifacts +.build/ +__pycache__/ + +# Benchmark results +*.json +.benchmarks/ + +# Pixi environments +.pixi/ + +# Override root .gitignore *.cpp rule (which targets Cython-generated files) +!benchmarks/cpp/*.cpp + +results-python.json +results-cpp.json diff --git a/benchmarks/cuda_bindings/AGENTS.md b/benchmarks/cuda_bindings/AGENTS.md new file mode 100644 index 00000000000..b9096a737f8 --- /dev/null +++ b/benchmarks/cuda_bindings/AGENTS.md @@ -0,0 +1,6 @@ +# cuda.bindings benchmarks + +Read the README.md in this directory for more details about the benchmarks. + +When generating code verify that that the code is correct based on the source for cuda-bindings +that can be found in ../../cuda_bindings diff --git a/benchmarks/cuda_bindings/README.md b/benchmarks/cuda_bindings/README.md new file mode 100644 index 00000000000..33b2bf30ce1 --- /dev/null +++ b/benchmarks/cuda_bindings/README.md @@ -0,0 +1,80 @@ +# cuda.bindings benchmarks + +These benchmarks are intended to measure the latency overhead of calling CUDA +Driver APIs through cuda.bindings, relative to a similar C++ baseline. + +The goal is to benchmark how much overhead does the Python layer adds to calling +CUDA APIs and what operations are not in our target of less than 1us of overhead. + +Most Python benchmarks have a C++ counterpart that is used as a comparative +baseline. We try to make each implementation perform small operations and +nearly the same work as possible and are run under similar conditions. + +A few benchmarks (e.g. in `bench_enum.py`) are intentionally Python-only +because they measure costs with no direct C++ equivalent — such as enum +construction and member access on `cuda.bindings` enum classes. + +These are **not** throughput benchmarks to measure the overall performance +of kernels and applications. + +## Usage + +Requires pixi. + +There are a couple of environments defined based on how `cuda.bindings` is installed: + +- `wheel`: Installs from conda packages +- `source`: Installs from source + +There are a couple of tasks defined: + +- `bench`: Runs the Python benchmarks +- `bench-cpp`: Runs the C++ benchmarks + +### System tuning + +For more stable results on Linux, tune the system before running benchmarks. +See: https://pyperf.readthedocs.io/en/latest/system.html#system + +```bash +# Show current system state +pixi run -e wheel -- python -m pyperf system show + +# Apply tuning (may require root) +$(pixi run -e wheel -- which python) -m pyperf system tune +``` + +### Running benchmarks + +To run the benchmarks combine the environment and task: + +```bash +# Run the Python benchmarks in the wheel environment +pixi run -e wheel bench +pixi run -e wheel bench --min-time 0.1 + +# Run the Python benchmarks in the source environment +pixi run -e source bench + +# Run the C++ benchmarks +pixi run -e wheel bench-cpp +pixi run -e wheel bench-cpp --min-time 0.1 +``` + +Both runners automatically save results to JSON files in the benchmarks +directory: `results-python.json` and `results-cpp.json`. + +## Output JSON and analysis + +The benchmarks are run using [pyperf](https://pyperf.readthedocs.io/en/latest/). +Both Python and C++ results are saved in pyperf-compatible JSON format, +which can be analyzed with pyperf commands: + +```bash +# Show results and statistics +pixi run -e wheel -- python -m pyperf stats results-python.json +pixi run -e wheel -- python -m pyperf stats results-cpp.json + +# Compare C++ vs Python results +pixi run -e wheel -- python -m pyperf compare_to results-cpp.json results-python.json +``` diff --git a/benchmarks/cuda_bindings/benchmarks/bench_ctx_device.py b/benchmarks/cuda_bindings/benchmarks/bench_ctx_device.py new file mode 100644 index 00000000000..7f619ae4a39 --- /dev/null +++ b/benchmarks/cuda_bindings/benchmarks/bench_ctx_device.py @@ -0,0 +1,79 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +import time + +from runner.runtime import ensure_context + +from cuda.bindings import driver as cuda + +CTX = ensure_context() + +_, DEVICE = cuda.cuDeviceGet(0) +ATTRIBUTE = cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR + +# Outer retain so the benchmarked retain/release pair just bumps the refcount. +_err, _PRIMARY_CTX = cuda.cuDevicePrimaryCtxRetain(DEVICE) +if _err != cuda.CUresult.CUDA_SUCCESS: + raise RuntimeError(f"cuDevicePrimaryCtxRetain failed during setup: {_err}") + + +def bench_ctx_get_current(loops: int) -> float: + _fn = cuda.cuCtxGetCurrent + + t0 = time.perf_counter() + for _ in range(loops): + _fn() + return time.perf_counter() - t0 + + +def bench_ctx_set_current(loops: int) -> float: + _fn = cuda.cuCtxSetCurrent + _ctx = CTX + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_ctx) + return time.perf_counter() - t0 + + +def bench_ctx_get_device(loops: int) -> float: + _fn = cuda.cuCtxGetDevice + + t0 = time.perf_counter() + for _ in range(loops): + _fn() + return time.perf_counter() - t0 + + +def bench_device_get(loops: int) -> float: + _fn = cuda.cuDeviceGet + + t0 = time.perf_counter() + for _ in range(loops): + _fn(0) + return time.perf_counter() - t0 + + +def bench_device_get_attribute(loops: int) -> float: + _fn = cuda.cuDeviceGetAttribute + _attr = ATTRIBUTE + _dev = DEVICE + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_attr, _dev) + return time.perf_counter() - t0 + + +def bench_device_primary_ctx_retain(loops: int) -> float: + _retain = cuda.cuDevicePrimaryCtxRetain + _release = cuda.cuDevicePrimaryCtxRelease + _dev = DEVICE + + t0 = time.perf_counter() + for _ in range(loops): + _retain(_dev) + _release(_dev) + return time.perf_counter() - t0 diff --git a/benchmarks/cuda_bindings/benchmarks/bench_enum.py b/benchmarks/cuda_bindings/benchmarks/bench_enum.py new file mode 100644 index 00000000000..42bfd47ed3e --- /dev/null +++ b/benchmarks/cuda_bindings/benchmarks/bench_enum.py @@ -0,0 +1,34 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +import time + +from cuda.bindings import driver as cuda + + +def bench_curesult_construction(loops: int) -> float: + _cls = cuda.CUresult + + t0 = time.perf_counter() + for _ in range(loops): + _cls(0) + return time.perf_counter() - t0 + + +def bench_curesult_member_access(loops: int) -> float: + _cls = cuda.CUresult + + t0 = time.perf_counter() + for _ in range(loops): + _cls.CUDA_SUCCESS # noqa: B018 + return time.perf_counter() - t0 + + +def bench_device_attribute_construction(loops: int) -> float: + _cls = cuda.CUdevice_attribute + + t0 = time.perf_counter() + for _ in range(loops): + _cls(1) + return time.perf_counter() - t0 diff --git a/benchmarks/cuda_bindings/benchmarks/bench_event.py b/benchmarks/cuda_bindings/benchmarks/bench_event.py new file mode 100644 index 00000000000..041adc25538 --- /dev/null +++ b/benchmarks/cuda_bindings/benchmarks/bench_event.py @@ -0,0 +1,62 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +import time + +from runner.runtime import ensure_context + +from cuda.bindings import driver as cuda + +ensure_context() + +_err, STREAM = cuda.cuStreamCreate(cuda.CUstream_flags.CU_STREAM_NON_BLOCKING.value) +_err, EVENT = cuda.cuEventCreate(cuda.CUevent_flags.CU_EVENT_DISABLE_TIMING.value) + +cuda.cuEventRecord(EVENT, STREAM) +cuda.cuStreamSynchronize(STREAM) + +EVENT_FLAGS = cuda.CUevent_flags.CU_EVENT_DISABLE_TIMING.value + + +def bench_event_create_destroy(loops: int) -> float: + _create = cuda.cuEventCreate + _destroy = cuda.cuEventDestroy + _flags = EVENT_FLAGS + + t0 = time.perf_counter() + for _ in range(loops): + _, e = _create(_flags) + _destroy(e) + return time.perf_counter() - t0 + + +def bench_event_record(loops: int) -> float: + _fn = cuda.cuEventRecord + _event = EVENT + _stream = STREAM + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_event, _stream) + return time.perf_counter() - t0 + + +def bench_event_query(loops: int) -> float: + _fn = cuda.cuEventQuery + _event = EVENT + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_event) + return time.perf_counter() - t0 + + +def bench_event_synchronize(loops: int) -> float: + _fn = cuda.cuEventSynchronize + _event = EVENT + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_event) + return time.perf_counter() - t0 diff --git a/benchmarks/cuda_bindings/benchmarks/bench_launch.py b/benchmarks/cuda_bindings/benchmarks/bench_launch.py new file mode 100644 index 00000000000..eb3392b09d1 --- /dev/null +++ b/benchmarks/cuda_bindings/benchmarks/bench_launch.py @@ -0,0 +1,406 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +import ctypes +import time + +from runner.runtime import alloc_persistent, assert_drv, compile_and_load + +from cuda.bindings import driver as cuda + +# Compile kernels lazily so benchmark discovery does not need NVRTC. +KERNEL_SOURCE = """\ +extern "C" __global__ void empty_kernel() { return; } +extern "C" __global__ void small_kernel(float *f) { *f = 0.0f; } + +#define ITEM_PARAM(x, T) T x +#define REP1(x, T) , ITEM_PARAM(x, T) +#define REP2(x, T) REP1(x##0, T) REP1(x##1, T) +#define REP4(x, T) REP2(x##0, T) REP2(x##1, T) +#define REP8(x, T) REP4(x##0, T) REP4(x##1, T) +#define REP16(x, T) REP8(x##0, T) REP8(x##1, T) +#define REP32(x, T) REP16(x##0, T) REP16(x##1, T) +#define REP64(x, T) REP32(x##0, T) REP32(x##1, T) +#define REP128(x, T) REP64(x##0, T) REP64(x##1, T) +#define REP256(x, T) REP128(x##0, T) REP128(x##1, T) + +template +struct KernelFunctionParam { + unsigned char p[maxBytes]; +}; + +extern "C" __global__ +void small_kernel_16_args( + ITEM_PARAM(F, int*) + REP1(A, int*) + REP2(A, int*) + REP4(A, int*) + REP8(A, int*)) +{ *F = 0; } + +extern "C" __global__ +void small_kernel_256_args( + ITEM_PARAM(F, int*) + REP1(A, int*) + REP2(A, int*) + REP4(A, int*) + REP8(A, int*) + REP16(A, int*) + REP32(A, int*) + REP64(A, int*) + REP128(A, int*)) +{ *F = 0; } + +extern "C" __global__ +void small_kernel_512_args( + ITEM_PARAM(F, int*) + REP1(A, int*) + REP2(A, int*) + REP4(A, int*) + REP8(A, int*) + REP16(A, int*) + REP32(A, int*) + REP64(A, int*) + REP128(A, int*) + REP256(A, int*)) +{ *F = 0; } + +extern "C" __global__ +void small_kernel_512_bools( + ITEM_PARAM(F, bool) + REP1(A, bool) + REP2(A, bool) + REP4(A, bool) + REP8(A, bool) + REP16(A, bool) + REP32(A, bool) + REP64(A, bool) + REP128(A, bool) + REP256(A, bool)) +{ return; } + +extern "C" __global__ +void small_kernel_512_ints( + ITEM_PARAM(F, int) + REP1(A, int) + REP2(A, int) + REP4(A, int) + REP8(A, int) + REP16(A, int) + REP32(A, int) + REP64(A, int) + REP128(A, int) + REP256(A, int)) +{ return; } + +extern "C" __global__ +void small_kernel_512_doubles( + ITEM_PARAM(F, double) + REP1(A, double) + REP2(A, double) + REP4(A, double) + REP8(A, double) + REP16(A, double) + REP32(A, double) + REP64(A, double) + REP128(A, double) + REP256(A, double)) +{ return; } + +extern "C" __global__ +void small_kernel_512_chars( + ITEM_PARAM(F, char) + REP1(A, char) + REP2(A, char) + REP4(A, char) + REP8(A, char) + REP16(A, char) + REP32(A, char) + REP64(A, char) + REP128(A, char) + REP256(A, char)) +{ return; } + +extern "C" __global__ +void small_kernel_512_longlongs( + ITEM_PARAM(F, long long) + REP1(A, long long) + REP2(A, long long) + REP4(A, long long) + REP8(A, long long) + REP16(A, long long) + REP32(A, long long) + REP64(A, long long) + REP128(A, long long) + REP256(A, long long)) +{ return; } + +extern "C" __global__ +void small_kernel_2048B(KernelFunctionParam<2048> param) { + // Do not touch param to prevent compiler from copying + // the whole structure from const bank to lmem. +} +""" + +MODULE = None +EMPTY_KERNEL = None +SMALL_KERNEL = None +KERNEL_16_ARGS = None +KERNEL_256_ARGS = None +KERNEL_512_ARGS = None +KERNEL_512_BOOLS = None +KERNEL_512_INTS = None +KERNEL_512_DOUBLES = None +KERNEL_512_CHARS = None +KERNEL_512_LONGLONGS = None +KERNEL_2048B = None +STREAM = None +FLOAT_PTR = None +INT_PTRS_512 = None +_VAL_PS_16 = None +_VAL_PS_512 = None +PACKED_16 = None +PACKED_512 = None + + +class _Struct2048B(ctypes.Structure): + _fields_ = [("values", ctypes.c_uint8 * 2048)] + + +STRUCT_2048B = _Struct2048B() + + +def _ensure_launch_state() -> None: + global MODULE, EMPTY_KERNEL, SMALL_KERNEL + global KERNEL_16_ARGS, KERNEL_256_ARGS, KERNEL_512_ARGS + global KERNEL_512_BOOLS, KERNEL_512_INTS, KERNEL_512_DOUBLES + global KERNEL_512_CHARS, KERNEL_512_LONGLONGS, KERNEL_2048B + global STREAM, FLOAT_PTR, INT_PTRS_512 + global _VAL_PS_16, _VAL_PS_512, PACKED_16, PACKED_512 + + if EMPTY_KERNEL is not None: + return + + module = compile_and_load(KERNEL_SOURCE) + + def get_func(name): + err, func = cuda.cuModuleGetFunction(module, name.encode()) + assert_drv(err) + return func + + err, stream = cuda.cuStreamCreate(cuda.CUstream_flags.CU_STREAM_NON_BLOCKING.value) + assert_drv(err) + + float_ptr = alloc_persistent(ctypes.sizeof(ctypes.c_float)) + int_ptrs_512 = tuple(alloc_persistent(ctypes.sizeof(ctypes.c_int)) for _ in range(512)) + + # Pre-pack 16 args + val_ps_16 = [ctypes.c_void_p(int(ptr)) for ptr in int_ptrs_512[:16]] + packed_16 = (ctypes.c_void_p * 16)() + for i, vp in enumerate(val_ps_16): + packed_16[i] = ctypes.addressof(vp) + + # Pre-pack 512 args + val_ps_512 = [ctypes.c_void_p(int(ptr)) for ptr in int_ptrs_512] + packed_512 = (ctypes.c_void_p * 512)() + for i, vp in enumerate(val_ps_512): + packed_512[i] = ctypes.addressof(vp) + + MODULE = module + EMPTY_KERNEL = get_func("empty_kernel") + SMALL_KERNEL = get_func("small_kernel") + KERNEL_16_ARGS = get_func("small_kernel_16_args") + KERNEL_256_ARGS = get_func("small_kernel_256_args") + KERNEL_512_ARGS = get_func("small_kernel_512_args") + KERNEL_512_BOOLS = get_func("small_kernel_512_bools") + KERNEL_512_INTS = get_func("small_kernel_512_ints") + KERNEL_512_DOUBLES = get_func("small_kernel_512_doubles") + KERNEL_512_CHARS = get_func("small_kernel_512_chars") + KERNEL_512_LONGLONGS = get_func("small_kernel_512_longlongs") + KERNEL_2048B = get_func("small_kernel_2048B") + STREAM = stream + FLOAT_PTR = float_ptr + INT_PTRS_512 = int_ptrs_512 + _VAL_PS_16 = val_ps_16 + _VAL_PS_512 = val_ps_512 + PACKED_16 = packed_16 + PACKED_512 = packed_512 + + +def bench_launch_empty_kernel(loops: int) -> float: + _ensure_launch_state() + _fn = cuda.cuLaunchKernel + _kernel = EMPTY_KERNEL + _stream = STREAM + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_kernel, 1, 1, 1, 1, 1, 1, 0, _stream, 0, 0) + return time.perf_counter() - t0 + + +def bench_launch_small_kernel(loops: int) -> float: + _ensure_launch_state() + _fn = cuda.cuLaunchKernel + _kernel = SMALL_KERNEL + _stream = STREAM + _args = (FLOAT_PTR,) + _arg_types = (None,) + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_kernel, 1, 1, 1, 1, 1, 1, 0, _stream, (_args, _arg_types), 0) + return time.perf_counter() - t0 + + +def bench_launch_16_args(loops: int) -> float: + _ensure_launch_state() + _fn = cuda.cuLaunchKernel + _kernel = KERNEL_16_ARGS + _stream = STREAM + _args = INT_PTRS_512[:16] + _arg_types = (None,) * 16 + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_kernel, 1, 1, 1, 1, 1, 1, 0, _stream, (_args, _arg_types), 0) + return time.perf_counter() - t0 + + +def bench_launch_16_args_pre_packed(loops: int) -> float: + _ensure_launch_state() + _fn = cuda.cuLaunchKernel + _kernel = KERNEL_16_ARGS + _stream = STREAM + _packed = PACKED_16 + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_kernel, 1, 1, 1, 1, 1, 1, 0, _stream, _packed, 0) + return time.perf_counter() - t0 + + +def bench_launch_256_args(loops: int) -> float: + _ensure_launch_state() + _fn = cuda.cuLaunchKernel + _kernel = KERNEL_256_ARGS + _stream = STREAM + _args = INT_PTRS_512[:256] + _arg_types = (None,) * 256 + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_kernel, 1, 1, 1, 1, 1, 1, 0, _stream, (_args, _arg_types), 0) + return time.perf_counter() - t0 + + +def bench_launch_512_args(loops: int) -> float: + _ensure_launch_state() + _fn = cuda.cuLaunchKernel + _kernel = KERNEL_512_ARGS + _stream = STREAM + _args = INT_PTRS_512 + _arg_types = (None,) * 512 + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_kernel, 1, 1, 1, 1, 1, 1, 0, _stream, (_args, _arg_types), 0) + return time.perf_counter() - t0 + + +def bench_launch_512_args_pre_packed(loops: int) -> float: + _ensure_launch_state() + _fn = cuda.cuLaunchKernel + _kernel = KERNEL_512_ARGS + _stream = STREAM + _packed = PACKED_512 + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_kernel, 1, 1, 1, 1, 1, 1, 0, _stream, _packed, 0) + return time.perf_counter() - t0 + + +def bench_launch_512_bools(loops: int) -> float: + _ensure_launch_state() + _fn = cuda.cuLaunchKernel + _kernel = KERNEL_512_BOOLS + _stream = STREAM + _args = (True,) * 512 + _arg_types = (ctypes.c_bool,) * 512 + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_kernel, 1, 1, 1, 1, 1, 1, 0, _stream, (_args, _arg_types), 0) + return time.perf_counter() - t0 + + +def bench_launch_512_ints(loops: int) -> float: + _ensure_launch_state() + _fn = cuda.cuLaunchKernel + _kernel = KERNEL_512_INTS + _stream = STREAM + _args = (123,) * 512 + _arg_types = (ctypes.c_int,) * 512 + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_kernel, 1, 1, 1, 1, 1, 1, 0, _stream, (_args, _arg_types), 0) + return time.perf_counter() - t0 + + +def bench_launch_512_doubles(loops: int) -> float: + _ensure_launch_state() + _fn = cuda.cuLaunchKernel + _kernel = KERNEL_512_DOUBLES + _stream = STREAM + _args = (1.2345,) * 512 + _arg_types = (ctypes.c_double,) * 512 + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_kernel, 1, 1, 1, 1, 1, 1, 0, _stream, (_args, _arg_types), 0) + return time.perf_counter() - t0 + + +def bench_launch_512_bytes(loops: int) -> float: + _ensure_launch_state() + _fn = cuda.cuLaunchKernel + _kernel = KERNEL_512_CHARS + _stream = STREAM + _args = (127,) * 512 + _arg_types = (ctypes.c_byte,) * 512 + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_kernel, 1, 1, 1, 1, 1, 1, 0, _stream, (_args, _arg_types), 0) + return time.perf_counter() - t0 + + +def bench_launch_512_longlongs(loops: int) -> float: + _ensure_launch_state() + _fn = cuda.cuLaunchKernel + _kernel = KERNEL_512_LONGLONGS + _stream = STREAM + _args = (9223372036854775806,) * 512 + _arg_types = (ctypes.c_longlong,) * 512 + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_kernel, 1, 1, 1, 1, 1, 1, 0, _stream, (_args, _arg_types), 0) + return time.perf_counter() - t0 + + +def bench_launch_2048b(loops: int) -> float: + _ensure_launch_state() + _fn = cuda.cuLaunchKernel + _kernel = KERNEL_2048B + _stream = STREAM + _args = (STRUCT_2048B,) + _arg_types = (None,) + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_kernel, 1, 1, 1, 1, 1, 1, 0, _stream, (_args, _arg_types), 0) + return time.perf_counter() - t0 diff --git a/benchmarks/cuda_bindings/benchmarks/bench_memory.py b/benchmarks/cuda_bindings/benchmarks/bench_memory.py new file mode 100644 index 00000000000..875c0604066 --- /dev/null +++ b/benchmarks/cuda_bindings/benchmarks/bench_memory.py @@ -0,0 +1,88 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +import time + +import numpy as np +from runner.runtime import alloc_persistent, ensure_context + +from cuda.bindings import driver as cuda + +ensure_context() + +# Allocation size for alloc/free benchmarks +ALLOC_SIZE = 1024 + +# Small transfer size (8 bytes) to measure call overhead, not bandwidth +COPY_SIZE = 8 + +# Pre-allocate device memory and host buffers for memcpy benchmarks +DST_DPTR = alloc_persistent(COPY_SIZE) +SRC_DPTR = alloc_persistent(COPY_SIZE) +HOST_SRC = np.zeros(COPY_SIZE, dtype=np.uint8) +HOST_DST = np.zeros(COPY_SIZE, dtype=np.uint8) + +# Stream for async operations +_err, STREAM = cuda.cuStreamCreate(cuda.CUstream_flags.CU_STREAM_NON_BLOCKING.value) + + +def bench_mem_alloc_free(loops: int) -> float: + _alloc = cuda.cuMemAlloc + _free = cuda.cuMemFree + _size = ALLOC_SIZE + + t0 = time.perf_counter() + for _ in range(loops): + _, ptr = _alloc(_size) + _free(ptr) + return time.perf_counter() - t0 + + +def bench_mem_alloc_async_free_async(loops: int) -> float: + _alloc = cuda.cuMemAllocAsync + _free = cuda.cuMemFreeAsync + _size = ALLOC_SIZE + _stream = STREAM + + t0 = time.perf_counter() + for _ in range(loops): + _, ptr = _alloc(_size, _stream) + _free(ptr, _stream) + return time.perf_counter() - t0 + + +def bench_memcpy_htod(loops: int) -> float: + _fn = cuda.cuMemcpyHtoD + _dst = DST_DPTR + _src = HOST_SRC + _size = COPY_SIZE + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_dst, _src, _size) + return time.perf_counter() - t0 + + +def bench_memcpy_dtoh(loops: int) -> float: + _fn = cuda.cuMemcpyDtoH + _dst = HOST_DST + _src = SRC_DPTR + _size = COPY_SIZE + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_dst, _src, _size) + return time.perf_counter() - t0 + + +def bench_memcpy_dtod(loops: int) -> float: + _fn = cuda.cuMemcpyDtoD + _dst = DST_DPTR + _src = SRC_DPTR + _size = COPY_SIZE + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_dst, _src, _size) + return time.perf_counter() - t0 diff --git a/benchmarks/cuda_bindings/benchmarks/bench_module.py b/benchmarks/cuda_bindings/benchmarks/bench_module.py new file mode 100644 index 00000000000..0c2b317c3a1 --- /dev/null +++ b/benchmarks/cuda_bindings/benchmarks/bench_module.py @@ -0,0 +1,57 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +import time + +from runner.runtime import assert_drv, compile_cubin, ensure_context, register_module + +from cuda.bindings import driver as cuda + +ensure_context() + +# Compile a trivial kernel to cubin once; reuse for all benchmarks +KERNEL_SOURCE = 'extern "C" __global__ void empty_kernel() { return; }' +CUBIN = compile_cubin(KERNEL_SOURCE) + +# Load a persistent module + function for the get_function / get_attribute benchmarks +_err, MODULE = cuda.cuModuleLoadData(CUBIN) +assert_drv(_err) +register_module(MODULE) +_err, FUNCTION = cuda.cuModuleGetFunction(MODULE, b"empty_kernel") +assert_drv(_err) + +FUNC_ATTRIBUTE = cuda.CUfunction_attribute.CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK + + +def bench_module_load_unload(loops: int) -> float: + _load = cuda.cuModuleLoadData + _unload = cuda.cuModuleUnload + _cubin = CUBIN + + t0 = time.perf_counter() + for _ in range(loops): + _, m = _load(_cubin) + _unload(m) + return time.perf_counter() - t0 + + +def bench_module_get_function(loops: int) -> float: + _fn = cuda.cuModuleGetFunction + _module = MODULE + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_module, b"empty_kernel") + return time.perf_counter() - t0 + + +def bench_func_get_attribute(loops: int) -> float: + _fn = cuda.cuFuncGetAttribute + _attr = FUNC_ATTRIBUTE + _func = FUNCTION + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_attr, _func) + return time.perf_counter() - t0 diff --git a/benchmarks/cuda_bindings/benchmarks/bench_nvrtc.py b/benchmarks/cuda_bindings/benchmarks/bench_nvrtc.py new file mode 100644 index 00000000000..0b2598aaa4e --- /dev/null +++ b/benchmarks/cuda_bindings/benchmarks/bench_nvrtc.py @@ -0,0 +1,83 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +import time + +from runner.runtime import assert_drv, ensure_context + +from cuda.bindings import driver as cuda +from cuda.bindings import nvrtc + +ensure_context() + +KERNEL_SOURCE = b'extern "C" __global__ void empty_kernel() { return; }' +PROGRAM_NAME = b"benchmark_kernel.cu" + +# Compute the arch flag once for compile benchmarks +_err, _device = cuda.cuDeviceGet(0) +assert_drv(_err) +_err, _major = cuda.cuDeviceGetAttribute(cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, _device) +assert_drv(_err) +_err, _minor = cuda.cuDeviceGetAttribute(cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, _device) +assert_drv(_err) +ARCH_FLAG = f"--gpu-architecture=sm_{_major}{_minor}".encode() +COMPILE_OPTIONS = [b"--fmad=false", ARCH_FLAG] + +# Pre-build 100 empty headers for the headers benchmark +HEADER_NAMES = [f"header_{i}.cuh".encode() for i in range(100)] +HEADER_SOURCES = [b"// empty" for _ in range(100)] + + +def bench_nvrtc_create_program(loops: int) -> float: + _create = nvrtc.nvrtcCreateProgram + _destroy = nvrtc.nvrtcDestroyProgram + _assert = assert_drv + _src = KERNEL_SOURCE + _name = PROGRAM_NAME + + t0 = time.perf_counter() + for _ in range(loops): + err, prog = _create(_src, _name, 0, [], []) + _assert(err) + (err,) = _destroy(prog) + _assert(err) + return time.perf_counter() - t0 + + +def bench_nvrtc_create_program_100_headers(loops: int) -> float: + _create = nvrtc.nvrtcCreateProgram + _destroy = nvrtc.nvrtcDestroyProgram + _assert = assert_drv + _src = KERNEL_SOURCE + _name = PROGRAM_NAME + _headers = HEADER_SOURCES + _header_names = HEADER_NAMES + + t0 = time.perf_counter() + for _ in range(loops): + err, prog = _create(_src, _name, 100, _headers, _header_names) + _assert(err) + (err,) = _destroy(prog) + _assert(err) + return time.perf_counter() - t0 + + +def bench_nvrtc_compile_program(loops: int) -> float: + _create = nvrtc.nvrtcCreateProgram + _compile = nvrtc.nvrtcCompileProgram + _destroy = nvrtc.nvrtcDestroyProgram + _assert = assert_drv + _src = KERNEL_SOURCE + _name = PROGRAM_NAME + _options = COMPILE_OPTIONS + + t0 = time.perf_counter() + for _ in range(loops): + err, prog = _create(_src, _name, 0, [], []) + _assert(err) + (err,) = _compile(prog, 2, _options) + _assert(err) + (err,) = _destroy(prog) + _assert(err) + return time.perf_counter() - t0 diff --git a/benchmarks/cuda_bindings/benchmarks/bench_pointer_attributes.py b/benchmarks/cuda_bindings/benchmarks/bench_pointer_attributes.py new file mode 100644 index 00000000000..3cc7ad015c1 --- /dev/null +++ b/benchmarks/cuda_bindings/benchmarks/bench_pointer_attributes.py @@ -0,0 +1,45 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +import time + +from runner.runtime import alloc_persistent + +from cuda.bindings import driver as cuda + +# Allocate memory used by the tests +PTR = alloc_persistent(1 << 18) +ATTRIBUTE = cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_MEMORY_TYPE + +ATTRIBUTES = ( + cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_MEMORY_TYPE, + cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_DEVICE_POINTER, + cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_HOST_POINTER, + cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_BUFFER_ID, +) +NUM_ATTRIBUTES = len(ATTRIBUTES) + + +def bench_pointer_get_attribute(loops: int) -> float: + # Local references to avoid global lookups in the hot loop + _fn = cuda.cuPointerGetAttribute + _attr = ATTRIBUTE + _ptr = PTR + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_attr, _ptr) + return time.perf_counter() - t0 + + +def bench_pointer_get_attributes(loops: int) -> float: + _fn = cuda.cuPointerGetAttributes + _num = NUM_ATTRIBUTES + _attrs = ATTRIBUTES + _ptr = PTR + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_num, _attrs, _ptr) + return time.perf_counter() - t0 diff --git a/benchmarks/cuda_bindings/benchmarks/bench_stream.py b/benchmarks/cuda_bindings/benchmarks/bench_stream.py new file mode 100644 index 00000000000..3aab9288fc6 --- /dev/null +++ b/benchmarks/cuda_bindings/benchmarks/bench_stream.py @@ -0,0 +1,45 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +import time + +from runner.runtime import ensure_context + +from cuda.bindings import driver as cuda + +ensure_context() + +_err, STREAM = cuda.cuStreamCreate(cuda.CUstream_flags.CU_STREAM_NON_BLOCKING.value) + + +def bench_stream_create_destroy(loops: int) -> float: + _create = cuda.cuStreamCreate + _destroy = cuda.cuStreamDestroy + _flags = cuda.CUstream_flags.CU_STREAM_NON_BLOCKING.value + + t0 = time.perf_counter() + for _ in range(loops): + _, s = _create(_flags) + _destroy(s) + return time.perf_counter() - t0 + + +def bench_stream_query(loops: int) -> float: + _fn = cuda.cuStreamQuery + _stream = STREAM + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_stream) + return time.perf_counter() - t0 + + +def bench_stream_synchronize(loops: int) -> float: + _fn = cuda.cuStreamSynchronize + _stream = STREAM + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_stream) + return time.perf_counter() - t0 diff --git a/benchmarks/cuda_bindings/benchmarks/bench_tensormap.py b/benchmarks/cuda_bindings/benchmarks/bench_tensormap.py new file mode 100644 index 00000000000..e2a596820b7 --- /dev/null +++ b/benchmarks/cuda_bindings/benchmarks/bench_tensormap.py @@ -0,0 +1,203 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +import time + +from runner.runtime import alloc_persistent, ensure_context + +from cuda.bindings import driver as cuda + +ensure_context() + +PTR = alloc_persistent(1 << 20) + +cuuint32_t = cuda.cuuint32_t +cuuint64_t = cuda.cuuint64_t + +# Tiled: rank-2 float32, 128x128, 64x64 tile. +TILED_DTYPE = cuda.CUtensorMapDataType.CU_TENSOR_MAP_DATA_TYPE_FLOAT32 +TILED_RANK = 2 +TILED_GLOBAL_DIM = (cuuint64_t(128), cuuint64_t(128)) +TILED_GLOBAL_STRIDES = (cuuint64_t(128 * 4),) +TILED_BOX_DIM = (cuuint32_t(64), cuuint32_t(64)) +TILED_ELEMENT_STRIDES = (cuuint32_t(1), cuuint32_t(1)) +TILED_INTERLEAVE = cuda.CUtensorMapInterleave.CU_TENSOR_MAP_INTERLEAVE_NONE +TILED_SWIZZLE = cuda.CUtensorMapSwizzle.CU_TENSOR_MAP_SWIZZLE_NONE +TILED_L2 = cuda.CUtensorMapL2promotion.CU_TENSOR_MAP_L2_PROMOTION_NONE +TILED_OOB = cuda.CUtensorMapFloatOOBfill.CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE + +# Im2col: rank-3 float16, 32x64x64. +IM2COL_DTYPE = cuda.CUtensorMapDataType.CU_TENSOR_MAP_DATA_TYPE_FLOAT16 +IM2COL_RANK = 3 +IM2COL_GLOBAL_DIM = (cuuint64_t(32), cuuint64_t(64), cuuint64_t(64)) +IM2COL_GLOBAL_STRIDES = (cuuint64_t(32 * 2), cuuint64_t(32 * 64 * 2)) +IM2COL_PIXEL_BOX_LOWER = (0,) +IM2COL_PIXEL_BOX_UPPER = (0,) +IM2COL_CHANNELS = 32 +IM2COL_PIXELS = 32 +IM2COL_ELEMENT_STRIDES = (cuuint32_t(1), cuuint32_t(1), cuuint32_t(1)) +IM2COL_INTERLEAVE = cuda.CUtensorMapInterleave.CU_TENSOR_MAP_INTERLEAVE_NONE +IM2COL_SWIZZLE = cuda.CUtensorMapSwizzle.CU_TENSOR_MAP_SWIZZLE_NONE +IM2COL_L2 = cuda.CUtensorMapL2promotion.CU_TENSOR_MAP_L2_PROMOTION_NONE +IM2COL_OOB = cuda.CUtensorMapFloatOOBfill.CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE + +_SUCCESS = cuda.CUresult.CUDA_SUCCESS + +# Resolve bindings once at module load. A missing attribute (old binding that +# predates a TMA API) is the only legitimate reason for a probe to skip — +# everything else (signature mismatches, unexpected TypeError, etc.) should +# surface loudly instead of being reclassified as "unsupported". +_ENCODE_TILED = getattr(cuda, "cuTensorMapEncodeTiled", None) +_ENCODE_IM2COL = getattr(cuda, "cuTensorMapEncodeIm2col", None) +_ENCODE_IM2COL_WIDE = getattr(cuda, "cuTensorMapEncodeIm2colWide", None) +_IM2COL_WIDE_MODE_CLS = getattr(cuda, "CUtensorMapIm2ColWideMode", None) + + +def _probe_tiled() -> bool: + if _ENCODE_TILED is None: + return False + err, _ = _ENCODE_TILED( + TILED_DTYPE, + TILED_RANK, + PTR, + TILED_GLOBAL_DIM, + TILED_GLOBAL_STRIDES, + TILED_BOX_DIM, + TILED_ELEMENT_STRIDES, + TILED_INTERLEAVE, + TILED_SWIZZLE, + TILED_L2, + TILED_OOB, + ) + return err == _SUCCESS + + +def _probe_im2col() -> bool: + if _ENCODE_IM2COL is None: + return False + err, _ = _ENCODE_IM2COL( + IM2COL_DTYPE, + IM2COL_RANK, + PTR, + IM2COL_GLOBAL_DIM, + IM2COL_GLOBAL_STRIDES, + IM2COL_PIXEL_BOX_LOWER, + IM2COL_PIXEL_BOX_UPPER, + IM2COL_CHANNELS, + IM2COL_PIXELS, + IM2COL_ELEMENT_STRIDES, + IM2COL_INTERLEAVE, + IM2COL_SWIZZLE, + IM2COL_L2, + IM2COL_OOB, + ) + return err == _SUCCESS + + +def _probe_im2col_wide() -> bool: + if _ENCODE_IM2COL_WIDE is None or _IM2COL_WIDE_MODE_CLS is None: + return False + mode = _IM2COL_WIDE_MODE_CLS.CU_TENSOR_MAP_IM2COL_WIDE_MODE_W + err, _ = _ENCODE_IM2COL_WIDE( + IM2COL_DTYPE, + IM2COL_RANK, + PTR, + IM2COL_GLOBAL_DIM, + IM2COL_GLOBAL_STRIDES, + 0, + 0, + IM2COL_CHANNELS, + IM2COL_PIXELS, + IM2COL_ELEMENT_STRIDES, + IM2COL_INTERLEAVE, + mode, + cuda.CUtensorMapSwizzle.CU_TENSOR_MAP_SWIZZLE_128B, + IM2COL_L2, + IM2COL_OOB, + ) + return err == _SUCCESS + + +_TILED_OK = _probe_tiled() +_IM2COL_OK = _probe_im2col() +_IM2COL_WIDE_OK = _probe_im2col_wide() + +if _IM2COL_WIDE_OK: + _IM2COL_WIDE_MODE_W = _IM2COL_WIDE_MODE_CLS.CU_TENSOR_MAP_IM2COL_WIDE_MODE_W + _IM2COL_WIDE_SWIZZLE = cuda.CUtensorMapSwizzle.CU_TENSOR_MAP_SWIZZLE_128B + +SKIPPED_BENCHMARKS: set[str] = set() +if not _TILED_OK: + SKIPPED_BENCHMARKS.add("bench_tensor_map_encode_tiled") +if not _IM2COL_OK: + SKIPPED_BENCHMARKS.add("bench_tensor_map_encode_im2col") +if not _IM2COL_WIDE_OK: + SKIPPED_BENCHMARKS.add("bench_tensor_map_encode_im2col_wide") + + +def bench_tensor_map_encode_tiled(loops: int) -> float: + _fn = cuda.cuTensorMapEncodeTiled + _dt = TILED_DTYPE + _rank = TILED_RANK + _addr = PTR + _gdim = TILED_GLOBAL_DIM + _gstr = TILED_GLOBAL_STRIDES + _bdim = TILED_BOX_DIM + _estr = TILED_ELEMENT_STRIDES + _inter = TILED_INTERLEAVE + _swz = TILED_SWIZZLE + _l2 = TILED_L2 + _oob = TILED_OOB + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_dt, _rank, _addr, _gdim, _gstr, _bdim, _estr, _inter, _swz, _l2, _oob) + return time.perf_counter() - t0 + + +def bench_tensor_map_encode_im2col(loops: int) -> float: + _fn = cuda.cuTensorMapEncodeIm2col + _dt = IM2COL_DTYPE + _rank = IM2COL_RANK + _addr = PTR + _gdim = IM2COL_GLOBAL_DIM + _gstr = IM2COL_GLOBAL_STRIDES + _lower = IM2COL_PIXEL_BOX_LOWER + _upper = IM2COL_PIXEL_BOX_UPPER + _ch = IM2COL_CHANNELS + _px = IM2COL_PIXELS + _estr = IM2COL_ELEMENT_STRIDES + _inter = IM2COL_INTERLEAVE + _swz = IM2COL_SWIZZLE + _l2 = IM2COL_L2 + _oob = IM2COL_OOB + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_dt, _rank, _addr, _gdim, _gstr, _lower, _upper, _ch, _px, _estr, _inter, _swz, _l2, _oob) + return time.perf_counter() - t0 + + +def bench_tensor_map_encode_im2col_wide(loops: int) -> float: + _fn = _ENCODE_IM2COL_WIDE + _dt = IM2COL_DTYPE + _rank = IM2COL_RANK + _addr = PTR + _gdim = IM2COL_GLOBAL_DIM + _gstr = IM2COL_GLOBAL_STRIDES + _lower_w = 0 + _upper_w = 0 + _ch = IM2COL_CHANNELS + _px = IM2COL_PIXELS + _estr = IM2COL_ELEMENT_STRIDES + _inter = IM2COL_INTERLEAVE + _mode = _IM2COL_WIDE_MODE_W + _swz = _IM2COL_WIDE_SWIZZLE + _l2 = IM2COL_L2 + _oob = IM2COL_OOB + + t0 = time.perf_counter() + for _ in range(loops): + _fn(_dt, _rank, _addr, _gdim, _gstr, _lower_w, _upper_w, _ch, _px, _estr, _inter, _mode, _swz, _l2, _oob) + return time.perf_counter() - t0 diff --git a/benchmarks/cuda_bindings/benchmarks/cpp/CMakeLists.txt b/benchmarks/cuda_bindings/benchmarks/cpp/CMakeLists.txt new file mode 100644 index 00000000000..9811ec1f099 --- /dev/null +++ b/benchmarks/cuda_bindings/benchmarks/cpp/CMakeLists.txt @@ -0,0 +1,95 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.24) +project(cuda_bindings_cpp_benchmarks LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +set(CUDA_HOME_HINT "$ENV{CUDA_HOME}") +set(CONDA_PREFIX_HINT "$ENV{CONDA_PREFIX}") + +# Find cuda.h (driver API header) +find_path( + CUDA_DRIVER_INCLUDE_DIR + cuda.h + HINTS + "${CUDA_HOME_HINT}/include" + "${CONDA_PREFIX_HINT}/targets/x86_64-linux/include" + "${CONDA_PREFIX_HINT}/include" +) + +# Find libcuda (driver API library) — lives on the system, not in toolkit +find_library( + CUDA_DRIVER_LIBRARY + NAMES cuda + HINTS + "/usr/lib/x86_64-linux-gnu" + "/usr/lib64" + "${CUDA_HOME_HINT}/lib64/stubs" + "${CUDA_HOME_HINT}/lib/stubs" + "${CONDA_PREFIX_HINT}/targets/x86_64-linux/lib/stubs" + "${CONDA_PREFIX_HINT}/lib/stubs" +) + +# Find nvrtc.h and libnvrtc (for runtime compilation benchmarks) +find_path( + NVRTC_INCLUDE_DIR + nvrtc.h + HINTS + "${CUDA_HOME_HINT}/include" + "${CONDA_PREFIX_HINT}/targets/x86_64-linux/include" + "${CONDA_PREFIX_HINT}/include" +) + +find_library( + NVRTC_LIBRARY + NAMES nvrtc + HINTS + "${CUDA_HOME_HINT}/lib64" + "${CUDA_HOME_HINT}/lib" + "${CONDA_PREFIX_HINT}/targets/x86_64-linux/lib" + "${CONDA_PREFIX_HINT}/lib" +) + +if(NOT CUDA_DRIVER_INCLUDE_DIR) + message(FATAL_ERROR "Could not find cuda.h. Ensure CUDA_HOME is set or install cuda-crt-dev.") +endif() + +if(NOT CUDA_DRIVER_LIBRARY) + message(FATAL_ERROR "Could not find libcuda. Ensure the NVIDIA driver is installed.") +endif() + +# Helper: add a benchmark that only needs the driver API +function(add_driver_benchmark name) + add_executable(${name}_cpp ${name}.cpp) + target_include_directories(${name}_cpp PRIVATE "${CUDA_DRIVER_INCLUDE_DIR}") + target_link_libraries(${name}_cpp PRIVATE "${CUDA_DRIVER_LIBRARY}") +endfunction() + +# Helper: add a benchmark that needs driver API + NVRTC +function(add_nvrtc_benchmark name) + add_executable(${name}_cpp ${name}.cpp) + target_include_directories(${name}_cpp PRIVATE "${CUDA_DRIVER_INCLUDE_DIR}" "${NVRTC_INCLUDE_DIR}") + target_link_libraries(${name}_cpp PRIVATE "${CUDA_DRIVER_LIBRARY}" "${NVRTC_LIBRARY}") +endfunction() + +# Driver-only benchmarks +add_driver_benchmark(bench_pointer_attributes) +add_driver_benchmark(bench_ctx_device) +add_driver_benchmark(bench_stream) +add_driver_benchmark(bench_event) +add_driver_benchmark(bench_memory) +add_driver_benchmark(bench_tensormap) + +# NVRTC benchmarks (require nvrtc for kernel compilation) +if(NVRTC_INCLUDE_DIR AND NVRTC_LIBRARY) + add_nvrtc_benchmark(bench_launch) + add_nvrtc_benchmark(bench_module) + add_nvrtc_benchmark(bench_nvrtc) +else() + message(WARNING "NVRTC not found — skipping bench_launch, bench_module, bench_nvrtc. Install cuda-nvrtc-dev.") +endif() diff --git a/benchmarks/cuda_bindings/benchmarks/cpp/bench_ctx_device.cpp b/benchmarks/cuda_bindings/benchmarks/cpp/bench_ctx_device.cpp new file mode 100644 index 00000000000..29358867186 --- /dev/null +++ b/benchmarks/cuda_bindings/benchmarks/cpp/bench_ctx_device.cpp @@ -0,0 +1,106 @@ +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +#include + +#include "bench_support.hpp" + +#include +#include + + +static void check_cu(CUresult status, const char* message) { + if (status != CUDA_SUCCESS) { + const char* error_name = nullptr; + cuGetErrorName(status, &error_name); + std::cerr << message << ": " << (error_name ? error_name : "unknown") << '\n'; + std::exit(1); + } +} + + +int main(int argc, char** argv) { + bench::Options options = bench::parse_args(argc, argv); + + // Setup: init CUDA and create a context + check_cu(cuInit(0), "cuInit failed"); + + CUdevice device; + check_cu(cuDeviceGet(&device, 0), "cuDeviceGet failed"); + + CUcontext ctx; + CUctxCreateParams ctxParams = {}; + check_cu(cuCtxCreate(&ctx, &ctxParams, 0, device), "cuCtxCreate failed"); + + bench::BenchmarkSuite suite(options); + + // --- ctx_get_current --- + { + CUcontext current_ctx = nullptr; + suite.run("ctx_device.ctx_get_current", [&]() { + check_cu(cuCtxGetCurrent(¤t_ctx), "cuCtxGetCurrent failed"); + }); + } + + // --- ctx_set_current --- + { + suite.run("ctx_device.ctx_set_current", [&]() { + check_cu(cuCtxSetCurrent(ctx), "cuCtxSetCurrent failed"); + }); + } + + // --- ctx_get_device --- + { + CUdevice dev; + suite.run("ctx_device.ctx_get_device", [&]() { + check_cu(cuCtxGetDevice(&dev), "cuCtxGetDevice failed"); + }); + } + + // --- device_get --- + { + CUdevice dev; + suite.run("ctx_device.device_get", [&]() { + check_cu(cuDeviceGet(&dev, 0), "cuDeviceGet failed"); + }); + } + + // --- device_get_attribute --- + { + int value = 0; + suite.run("ctx_device.device_get_attribute", [&]() { + check_cu( + cuDeviceGetAttribute(&value, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, device), + "cuDeviceGetAttribute failed" + ); + }); + } + + // --- device_primary_ctx_retain --- + // Outer retain so the benchmarked retain/release pair just bumps the refcount. + CUcontext primary_outer = nullptr; + check_cu( + cuDevicePrimaryCtxRetain(&primary_outer, device), + "cuDevicePrimaryCtxRetain (setup) failed" + ); + { + CUcontext primary = nullptr; + suite.run("ctx_device.device_primary_ctx_retain", [&]() { + check_cu(cuDevicePrimaryCtxRetain(&primary, device), "cuDevicePrimaryCtxRetain failed"); + check_cu(cuDevicePrimaryCtxRelease(device), "cuDevicePrimaryCtxRelease failed"); + }); + } + check_cu( + cuDevicePrimaryCtxRelease(device), + "cuDevicePrimaryCtxRelease (teardown) failed" + ); + + // Cleanup + check_cu(cuCtxDestroy(ctx), "cuCtxDestroy failed"); + + // Write all results + suite.write(); + + return 0; +} diff --git a/benchmarks/cuda_bindings/benchmarks/cpp/bench_event.cpp b/benchmarks/cuda_bindings/benchmarks/cpp/bench_event.cpp new file mode 100644 index 00000000000..c24aa983199 --- /dev/null +++ b/benchmarks/cuda_bindings/benchmarks/cpp/bench_event.cpp @@ -0,0 +1,95 @@ +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +#include + +#include "bench_support.hpp" + +#include +#include + + +static void check_cu(CUresult status, const char* message) { + if (status != CUDA_SUCCESS) { + const char* error_name = nullptr; + cuGetErrorName(status, &error_name); + std::cerr << message << ": " << (error_name ? error_name : "unknown") << '\n'; + std::exit(1); + } +} + + +int main(int argc, char** argv) { + bench::Options options = bench::parse_args(argc, argv); + + // Setup + check_cu(cuInit(0), "cuInit failed"); + + CUdevice device; + check_cu(cuDeviceGet(&device, 0), "cuDeviceGet failed"); + + CUcontext ctx; + CUctxCreateParams ctxParams = {}; + check_cu(cuCtxCreate(&ctx, &ctxParams, 0, device), "cuCtxCreate failed"); + + CUstream stream; + check_cu(cuStreamCreate(&stream, CU_STREAM_NON_BLOCKING), "cuStreamCreate failed"); + + // Persistent event for query/synchronize/record benchmarks + CUevent event; + check_cu(cuEventCreate(&event, CU_EVENT_DISABLE_TIMING), "cuEventCreate failed"); + + // Record and sync so the event starts in a completed state + check_cu(cuEventRecord(event, stream), "cuEventRecord failed"); + check_cu(cuStreamSynchronize(stream), "cuStreamSynchronize failed"); + + bench::BenchmarkSuite suite(options); + // Drain the persistent stream after calibration so event_record (which + // enqueues onto the stream) and event_synchronize start from a known state. + suite.set_post_calibrate([&]() { + check_cu(cuStreamSynchronize(stream), "post-calibrate sync failed"); + }); + + // --- event_create_destroy --- + { + CUevent e; + suite.run("event.event_create_destroy", [&]() { + check_cu(cuEventCreate(&e, CU_EVENT_DISABLE_TIMING), "cuEventCreate failed"); + check_cu(cuEventDestroy(e), "cuEventDestroy failed"); + }); + } + + // --- event_record --- + { + suite.run("event.event_record", [&]() { + check_cu(cuEventRecord(event, stream), "cuEventRecord failed"); + }); + } + + // Re-sync so event is in a known completed state after the record benchmark + check_cu(cuStreamSynchronize(stream), "cuStreamSynchronize failed"); + + { + suite.run("event.event_query", [&]() { + // Returns CUDA_SUCCESS if complete, CUDA_ERROR_NOT_READY if not + cuEventQuery(event); + }); + } + + // --- event_synchronize --- + { + suite.run("event.event_synchronize", [&]() { + check_cu(cuEventSynchronize(event), "cuEventSynchronize failed"); + }); + } + + // Cleanup + check_cu(cuEventDestroy(event), "cuEventDestroy failed"); + check_cu(cuStreamDestroy(stream), "cuStreamDestroy failed"); + check_cu(cuCtxDestroy(ctx), "cuCtxDestroy failed"); + + suite.write(); + + return 0; +} diff --git a/benchmarks/cuda_bindings/benchmarks/cpp/bench_launch.cpp b/benchmarks/cuda_bindings/benchmarks/cpp/bench_launch.cpp new file mode 100644 index 00000000000..4897859a61a --- /dev/null +++ b/benchmarks/cuda_bindings/benchmarks/cpp/bench_launch.cpp @@ -0,0 +1,341 @@ +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +#include +#include + +#include "bench_support.hpp" + +#include +#include +#include +#include +#include +#include + + +static void check_cu(CUresult status, const char* message) { + if (status != CUDA_SUCCESS) { + const char* error_name = nullptr; + cuGetErrorName(status, &error_name); + std::cerr << message << ": " << (error_name ? error_name : "unknown") << '\n'; + std::exit(1); + } +} + +static void check_nvrtc(nvrtcResult status, const char* message) { + if (status != NVRTC_SUCCESS) { + std::cerr << message << ": " << nvrtcGetErrorString(status) << '\n'; + std::exit(1); + } +} + +static CUmodule compile_and_load(const char* source, CUdevice device) { + int major = 0, minor = 0; + check_cu(cuDeviceGetAttribute(&major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, device), + "cuDeviceGetAttribute failed"); + check_cu(cuDeviceGetAttribute(&minor, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, device), + "cuDeviceGetAttribute failed"); + + nvrtcProgram prog; + check_nvrtc(nvrtcCreateProgram(&prog, source, "benchmark_kernel.cu", 0, nullptr, nullptr), + "nvrtcCreateProgram failed"); + + std::string arch = "--gpu-architecture=sm_" + std::to_string(major) + std::to_string(minor); + const char* opts[] = {"--fmad=false", arch.c_str()}; + nvrtcResult compile_result = nvrtcCompileProgram(prog, 2, opts); + + if (compile_result != NVRTC_SUCCESS) { + size_t log_size = 0; + nvrtcGetProgramLogSize(prog, &log_size); + std::vector log(log_size); + nvrtcGetProgramLog(prog, log.data()); + std::cerr << "NVRTC compile failed:\n" << log.data() << '\n'; + std::exit(1); + } + + size_t cubin_size = 0; + check_nvrtc(nvrtcGetCUBINSize(prog, &cubin_size), "nvrtcGetCUBINSize failed"); + std::vector cubin(cubin_size); + check_nvrtc(nvrtcGetCUBIN(prog, cubin.data()), "nvrtcGetCUBIN failed"); + nvrtcDestroyProgram(&prog); + + CUmodule module; + check_cu(cuModuleLoadData(&module, cubin.data()), "cuModuleLoadData failed"); + return module; +} + + +static const char* KERNEL_SOURCE = R"( +extern "C" __global__ void empty_kernel() { return; } +extern "C" __global__ void small_kernel(float *f) { *f = 0.0f; } + +#define ITEM_PARAM(x, T) T x +#define REP1(x, T) , ITEM_PARAM(x, T) +#define REP2(x, T) REP1(x##0, T) REP1(x##1, T) +#define REP4(x, T) REP2(x##0, T) REP2(x##1, T) +#define REP8(x, T) REP4(x##0, T) REP4(x##1, T) +#define REP16(x, T) REP8(x##0, T) REP8(x##1, T) +#define REP32(x, T) REP16(x##0, T) REP16(x##1, T) +#define REP64(x, T) REP32(x##0, T) REP32(x##1, T) +#define REP128(x, T) REP64(x##0, T) REP64(x##1, T) +#define REP256(x, T) REP128(x##0, T) REP128(x##1, T) + +template +struct KernelFunctionParam { + unsigned char p[maxBytes]; +}; + +extern "C" __global__ +void small_kernel_16_args( + ITEM_PARAM(F, int*) + REP1(A, int*) REP2(A, int*) REP4(A, int*) REP8(A, int*)) +{ *F = 0; } + +extern "C" __global__ +void small_kernel_256_args( + ITEM_PARAM(F, int*) + REP1(A, int*) REP2(A, int*) REP4(A, int*) REP8(A, int*) + REP16(A, int*) REP32(A, int*) REP64(A, int*) REP128(A, int*)) +{ *F = 0; } + +extern "C" __global__ +void small_kernel_512_args( + ITEM_PARAM(F, int*) + REP1(A, int*) REP2(A, int*) REP4(A, int*) REP8(A, int*) + REP16(A, int*) REP32(A, int*) REP64(A, int*) REP128(A, int*) + REP256(A, int*)) +{ *F = 0; } + +extern "C" __global__ +void small_kernel_512_bools( + ITEM_PARAM(F, bool) + REP1(A, bool) REP2(A, bool) REP4(A, bool) REP8(A, bool) + REP16(A, bool) REP32(A, bool) REP64(A, bool) REP128(A, bool) + REP256(A, bool)) +{ return; } + +extern "C" __global__ +void small_kernel_512_ints( + ITEM_PARAM(F, int) + REP1(A, int) REP2(A, int) REP4(A, int) REP8(A, int) + REP16(A, int) REP32(A, int) REP64(A, int) REP128(A, int) + REP256(A, int)) +{ return; } + +extern "C" __global__ +void small_kernel_512_doubles( + ITEM_PARAM(F, double) + REP1(A, double) REP2(A, double) REP4(A, double) REP8(A, double) + REP16(A, double) REP32(A, double) REP64(A, double) REP128(A, double) + REP256(A, double)) +{ return; } + +extern "C" __global__ +void small_kernel_512_chars( + ITEM_PARAM(F, char) + REP1(A, char) REP2(A, char) REP4(A, char) REP8(A, char) + REP16(A, char) REP32(A, char) REP64(A, char) REP128(A, char) + REP256(A, char)) +{ return; } + +extern "C" __global__ +void small_kernel_512_longlongs( + ITEM_PARAM(F, long long) + REP1(A, long long) REP2(A, long long) REP4(A, long long) REP8(A, long long) + REP16(A, long long) REP32(A, long long) REP64(A, long long) REP128(A, long long) + REP256(A, long long)) +{ return; } + +extern "C" __global__ +void small_kernel_2048B(KernelFunctionParam<2048> param) {} +)"; + + +int main(int argc, char** argv) { + bench::Options options = bench::parse_args(argc, argv); + + // Setup + check_cu(cuInit(0), "cuInit failed"); + + CUdevice device; + check_cu(cuDeviceGet(&device, 0), "cuDeviceGet failed"); + + CUcontext ctx; + CUctxCreateParams ctxParams = {}; + check_cu(cuCtxCreate(&ctx, &ctxParams, 0, device), "cuCtxCreate failed"); + + CUmodule module = compile_and_load(KERNEL_SOURCE, device); + + // Get all kernel handles + auto get_func = [&](const char* name) { + CUfunction f; + check_cu(cuModuleGetFunction(&f, module, name), "GetFunction failed"); + return f; + }; + + CUfunction empty_kernel = get_func("empty_kernel"); + CUfunction small_kernel = get_func("small_kernel"); + CUfunction kernel_16_args = get_func("small_kernel_16_args"); + CUfunction kernel_256_args = get_func("small_kernel_256_args"); + CUfunction kernel_512_args = get_func("small_kernel_512_args"); + CUfunction kernel_512_bools = get_func("small_kernel_512_bools"); + CUfunction kernel_512_ints = get_func("small_kernel_512_ints"); + CUfunction kernel_512_doubles = get_func("small_kernel_512_doubles"); + CUfunction kernel_512_chars = get_func("small_kernel_512_chars"); + CUfunction kernel_512_longlongs = get_func("small_kernel_512_longlongs"); + CUfunction kernel_2048B = get_func("small_kernel_2048B"); + + CUstream stream; + check_cu(cuStreamCreate(&stream, CU_STREAM_NON_BLOCKING), "cuStreamCreate failed"); + + // Allocate device memory + CUdeviceptr float_ptr; + check_cu(cuMemAlloc(&float_ptr, sizeof(float)), "cuMemAlloc failed"); + + CUdeviceptr int_ptrs[512]; + for (int i = 0; i < 512; ++i) { + check_cu(cuMemAlloc(&int_ptrs[i], sizeof(int)), "cuMemAlloc failed"); + } + + // Pre-pack pointer params + void* packed_16[16]; + for (int i = 0; i < 16; ++i) + packed_16[i] = &int_ptrs[i]; + + void* packed_256[256]; + for (int i = 0; i < 256; ++i) + packed_256[i] = &int_ptrs[i]; + + void* packed_512[512]; + for (int i = 0; i < 512; ++i) + packed_512[i] = &int_ptrs[i]; + + // Typed args for 512-arg benchmarks + bool bool_args[512]; + void* bool_params[512]; + for (int i = 0; i < 512; ++i) { bool_args[i] = true; bool_params[i] = &bool_args[i]; } + + int int_args[512]; + void* int_params[512]; + for (int i = 0; i < 512; ++i) { int_args[i] = 123; int_params[i] = &int_args[i]; } + + double double_args[512]; + void* double_params[512]; + for (int i = 0; i < 512; ++i) { double_args[i] = 1.2345; double_params[i] = &double_args[i]; } + + char char_args[512]; + void* char_params[512]; + for (int i = 0; i < 512; ++i) { char_args[i] = 127; char_params[i] = &char_args[i]; } + + long long ll_args[512]; + void* ll_params[512]; + for (int i = 0; i < 512; ++i) { ll_args[i] = 9223372036854775806LL; ll_params[i] = &ll_args[i]; } + + // 2048-byte struct + struct alignas(8) Struct2048B { unsigned char p[2048]; } struct_2048B = {}; + void* struct_params[] = {&struct_2048B}; + + bench::BenchmarkSuite suite(options); + // After calibration, drain the persistent stream so the first measured + // sample does not start on a backlogged stream. Calibration for enqueue- + // style ops (kernel launches) may queue many thousands of operations. + suite.set_post_calibrate([&]() { + check_cu(cuStreamSynchronize(stream), "post-calibrate sync failed"); + }); + + suite.run("launch.launch_empty_kernel", [&]() { + check_cu(cuLaunchKernel(empty_kernel, 1, 1, 1, 1, 1, 1, 0, stream, nullptr, nullptr), + "cuLaunchKernel failed"); + }); + check_cu(cuStreamSynchronize(stream), "sync"); + + { + void* params[] = {&float_ptr}; + suite.run("launch.launch_small_kernel", [&]() { + check_cu(cuLaunchKernel(small_kernel, 1, 1, 1, 1, 1, 1, 0, stream, params, nullptr), + "cuLaunchKernel failed"); + }); + } + check_cu(cuStreamSynchronize(stream), "sync"); + + suite.run("launch.launch_16_args", [&]() { + check_cu(cuLaunchKernel(kernel_16_args, 1, 1, 1, 1, 1, 1, 0, stream, packed_16, nullptr), + "cuLaunchKernel failed"); + }); + check_cu(cuStreamSynchronize(stream), "sync"); + + suite.run("launch.launch_16_args_pre_packed", [&]() { + check_cu(cuLaunchKernel(kernel_16_args, 1, 1, 1, 1, 1, 1, 0, stream, packed_16, nullptr), + "cuLaunchKernel failed"); + }); + check_cu(cuStreamSynchronize(stream), "sync"); + + suite.run("launch.launch_256_args", [&]() { + check_cu(cuLaunchKernel(kernel_256_args, 1, 1, 1, 1, 1, 1, 0, stream, packed_256, nullptr), + "cuLaunchKernel failed"); + }); + check_cu(cuStreamSynchronize(stream), "sync"); + + suite.run("launch.launch_512_args", [&]() { + check_cu(cuLaunchKernel(kernel_512_args, 1, 1, 1, 1, 1, 1, 0, stream, packed_512, nullptr), + "cuLaunchKernel failed"); + }); + check_cu(cuStreamSynchronize(stream), "sync"); + + suite.run("launch.launch_512_args_pre_packed", [&]() { + check_cu(cuLaunchKernel(kernel_512_args, 1, 1, 1, 1, 1, 1, 0, stream, packed_512, nullptr), + "cuLaunchKernel failed"); + }); + check_cu(cuStreamSynchronize(stream), "sync"); + + suite.run("launch.launch_512_bools", [&]() { + check_cu(cuLaunchKernel(kernel_512_bools, 1, 1, 1, 1, 1, 1, 0, stream, bool_params, nullptr), + "cuLaunchKernel failed"); + }); + check_cu(cuStreamSynchronize(stream), "sync"); + + suite.run("launch.launch_512_ints", [&]() { + check_cu(cuLaunchKernel(kernel_512_ints, 1, 1, 1, 1, 1, 1, 0, stream, int_params, nullptr), + "cuLaunchKernel failed"); + }); + check_cu(cuStreamSynchronize(stream), "sync"); + + suite.run("launch.launch_512_doubles", [&]() { + check_cu(cuLaunchKernel(kernel_512_doubles, 1, 1, 1, 1, 1, 1, 0, stream, double_params, nullptr), + "cuLaunchKernel failed"); + }); + check_cu(cuStreamSynchronize(stream), "sync"); + + suite.run("launch.launch_512_bytes", [&]() { + check_cu(cuLaunchKernel(kernel_512_chars, 1, 1, 1, 1, 1, 1, 0, stream, char_params, nullptr), + "cuLaunchKernel failed"); + }); + check_cu(cuStreamSynchronize(stream), "sync"); + + suite.run("launch.launch_512_longlongs", [&]() { + check_cu(cuLaunchKernel(kernel_512_longlongs, 1, 1, 1, 1, 1, 1, 0, stream, ll_params, nullptr), + "cuLaunchKernel failed"); + }); + check_cu(cuStreamSynchronize(stream), "sync"); + + suite.run("launch.launch_2048b", [&]() { + check_cu(cuLaunchKernel(kernel_2048B, 1, 1, 1, 1, 1, 1, 0, stream, struct_params, nullptr), + "cuLaunchKernel failed"); + }); + check_cu(cuStreamSynchronize(stream), "sync"); + + // Cleanup + for (int i = 0; i < 512; ++i) { + check_cu(cuMemFree(int_ptrs[i]), "cuMemFree failed"); + } + check_cu(cuMemFree(float_ptr), "cuMemFree failed"); + check_cu(cuStreamDestroy(stream), "cuStreamDestroy failed"); + check_cu(cuModuleUnload(module), "cuModuleUnload failed"); + check_cu(cuCtxDestroy(ctx), "cuCtxDestroy failed"); + + suite.write(); + + return 0; +} diff --git a/benchmarks/cuda_bindings/benchmarks/cpp/bench_memory.cpp b/benchmarks/cuda_bindings/benchmarks/cpp/bench_memory.cpp new file mode 100644 index 00000000000..803363be480 --- /dev/null +++ b/benchmarks/cuda_bindings/benchmarks/cpp/bench_memory.cpp @@ -0,0 +1,111 @@ +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +#include + +#include "bench_support.hpp" + +#include +#include +#include +#include + + +static void check_cu(CUresult status, const char* message) { + if (status != CUDA_SUCCESS) { + const char* error_name = nullptr; + cuGetErrorName(status, &error_name); + std::cerr << message << ": " << (error_name ? error_name : "unknown") << '\n'; + std::exit(1); + } +} + + +static constexpr size_t ALLOC_SIZE = 1024; +static constexpr size_t COPY_SIZE = 8; + + +int main(int argc, char** argv) { + bench::Options options = bench::parse_args(argc, argv); + + // Setup + check_cu(cuInit(0), "cuInit failed"); + + CUdevice device; + check_cu(cuDeviceGet(&device, 0), "cuDeviceGet failed"); + + CUcontext ctx; + CUctxCreateParams ctxParams = {}; + check_cu(cuCtxCreate(&ctx, &ctxParams, 0, device), "cuCtxCreate failed"); + + CUstream stream; + check_cu(cuStreamCreate(&stream, CU_STREAM_NON_BLOCKING), "cuStreamCreate failed"); + + // Pre-allocate device memory for memcpy benchmarks + CUdeviceptr dst_dptr, src_dptr; + check_cu(cuMemAlloc(&dst_dptr, COPY_SIZE), "cuMemAlloc failed"); + check_cu(cuMemAlloc(&src_dptr, COPY_SIZE), "cuMemAlloc failed"); + + // Host buffers for memcpy + uint8_t host_src[COPY_SIZE] = {}; + uint8_t host_dst[COPY_SIZE] = {}; + + bench::BenchmarkSuite suite(options); + // Drain the persistent stream after calibration so async benchmarks + // (mem_alloc_async_free_async) don't start measurement on a backlogged stream. + suite.set_post_calibrate([&]() { + check_cu(cuStreamSynchronize(stream), "post-calibrate sync failed"); + }); + + // --- mem_alloc_free --- + { + CUdeviceptr ptr; + suite.run("memory.mem_alloc_free", [&]() { + check_cu(cuMemAlloc(&ptr, ALLOC_SIZE), "cuMemAlloc failed"); + check_cu(cuMemFree(ptr), "cuMemFree failed"); + }); + } + + // --- mem_alloc_async_free_async --- + { + CUdeviceptr ptr; + suite.run("memory.mem_alloc_async_free_async", [&]() { + check_cu(cuMemAllocAsync(&ptr, ALLOC_SIZE, stream), "cuMemAllocAsync failed"); + check_cu(cuMemFreeAsync(ptr, stream), "cuMemFreeAsync failed"); + }); + } + + check_cu(cuStreamSynchronize(stream), "cuStreamSynchronize failed"); + + // --- memcpy_htod --- + { + suite.run("memory.memcpy_htod", [&]() { + check_cu(cuMemcpyHtoD(dst_dptr, host_src, COPY_SIZE), "cuMemcpyHtoD failed"); + }); + } + + // --- memcpy_dtoh --- + { + suite.run("memory.memcpy_dtoh", [&]() { + check_cu(cuMemcpyDtoH(host_dst, src_dptr, COPY_SIZE), "cuMemcpyDtoH failed"); + }); + } + + // --- memcpy_dtod --- + { + suite.run("memory.memcpy_dtod", [&]() { + check_cu(cuMemcpyDtoD(dst_dptr, src_dptr, COPY_SIZE), "cuMemcpyDtoD failed"); + }); + } + + // Cleanup + check_cu(cuMemFree(dst_dptr), "cuMemFree failed"); + check_cu(cuMemFree(src_dptr), "cuMemFree failed"); + check_cu(cuStreamDestroy(stream), "cuStreamDestroy failed"); + check_cu(cuCtxDestroy(ctx), "cuCtxDestroy failed"); + + suite.write(); + + return 0; +} diff --git a/benchmarks/cuda_bindings/benchmarks/cpp/bench_module.cpp b/benchmarks/cuda_bindings/benchmarks/cpp/bench_module.cpp new file mode 100644 index 00000000000..802025a6506 --- /dev/null +++ b/benchmarks/cuda_bindings/benchmarks/cpp/bench_module.cpp @@ -0,0 +1,130 @@ +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +#include +#include + +#include "bench_support.hpp" + +#include +#include +#include +#include + + +static void check_cu(CUresult status, const char* message) { + if (status != CUDA_SUCCESS) { + const char* error_name = nullptr; + cuGetErrorName(status, &error_name); + std::cerr << message << ": " << (error_name ? error_name : "unknown") << '\n'; + std::exit(1); + } +} + +static void check_nvrtc(nvrtcResult status, const char* message) { + if (status != NVRTC_SUCCESS) { + std::cerr << message << ": " << nvrtcGetErrorString(status) << '\n'; + std::exit(1); + } +} + +static std::vector compile_cubin(const char* source, CUdevice device) { + int major = 0, minor = 0; + check_cu(cuDeviceGetAttribute(&major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, device), + "cuDeviceGetAttribute failed"); + check_cu(cuDeviceGetAttribute(&minor, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, device), + "cuDeviceGetAttribute failed"); + + nvrtcProgram prog; + check_nvrtc(nvrtcCreateProgram(&prog, source, "benchmark_kernel.cu", 0, nullptr, nullptr), + "nvrtcCreateProgram failed"); + + std::string arch = "--gpu-architecture=sm_" + std::to_string(major) + std::to_string(minor); + const char* opts[] = {"--fmad=false", arch.c_str()}; + nvrtcResult compile_result = nvrtcCompileProgram(prog, 2, opts); + + if (compile_result != NVRTC_SUCCESS) { + size_t log_size = 0; + nvrtcGetProgramLogSize(prog, &log_size); + std::vector log(log_size); + nvrtcGetProgramLog(prog, log.data()); + std::cerr << "NVRTC compile failed:\n" << log.data() << '\n'; + std::exit(1); + } + + size_t cubin_size = 0; + check_nvrtc(nvrtcGetCUBINSize(prog, &cubin_size), "nvrtcGetCUBINSize failed"); + std::vector cubin(cubin_size); + check_nvrtc(nvrtcGetCUBIN(prog, cubin.data()), "nvrtcGetCUBIN failed"); + nvrtcDestroyProgram(&prog); + + return cubin; +} + + +static const char* KERNEL_SOURCE = R"( +extern "C" __global__ void empty_kernel() { return; } +)"; + + +int main(int argc, char** argv) { + bench::Options options = bench::parse_args(argc, argv); + + // Setup + check_cu(cuInit(0), "cuInit failed"); + + CUdevice device; + check_cu(cuDeviceGet(&device, 0), "cuDeviceGet failed"); + + CUcontext ctx; + CUctxCreateParams ctxParams = {}; + check_cu(cuCtxCreate(&ctx, &ctxParams, 0, device), "cuCtxCreate failed"); + + std::vector cubin = compile_cubin(KERNEL_SOURCE, device); + + // Load a persistent module + function for get_function / get_attribute benchmarks + CUmodule persistent_module; + check_cu(cuModuleLoadData(&persistent_module, cubin.data()), "cuModuleLoadData failed"); + + CUfunction function; + check_cu(cuModuleGetFunction(&function, persistent_module, "empty_kernel"), + "cuModuleGetFunction failed"); + + bench::BenchmarkSuite suite(options); + + // --- module_load_unload --- + { + CUmodule m; + suite.run("module.module_load_unload", [&]() { + check_cu(cuModuleLoadData(&m, cubin.data()), "cuModuleLoadData failed"); + check_cu(cuModuleUnload(m), "cuModuleUnload failed"); + }); + } + + // --- module_get_function --- + { + CUfunction f; + suite.run("module.module_get_function", [&]() { + check_cu(cuModuleGetFunction(&f, persistent_module, "empty_kernel"), + "cuModuleGetFunction failed"); + }); + } + + // --- func_get_attribute --- + { + int value = 0; + suite.run("module.func_get_attribute", [&]() { + check_cu(cuFuncGetAttribute(&value, CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK, function), + "cuFuncGetAttribute failed"); + }); + } + + // Cleanup + check_cu(cuModuleUnload(persistent_module), "cuModuleUnload failed"); + check_cu(cuCtxDestroy(ctx), "cuCtxDestroy failed"); + + suite.write(); + + return 0; +} diff --git a/benchmarks/cuda_bindings/benchmarks/cpp/bench_nvrtc.cpp b/benchmarks/cuda_bindings/benchmarks/cpp/bench_nvrtc.cpp new file mode 100644 index 00000000000..842b7353cf4 --- /dev/null +++ b/benchmarks/cuda_bindings/benchmarks/cpp/bench_nvrtc.cpp @@ -0,0 +1,115 @@ +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +#include +#include + +#include "bench_support.hpp" + +#include +#include +#include +#include + + +static void check_cu(CUresult status, const char* message) { + if (status != CUDA_SUCCESS) { + const char* error_name = nullptr; + cuGetErrorName(status, &error_name); + std::cerr << message << ": " << (error_name ? error_name : "unknown") << '\n'; + std::exit(1); + } +} + +static void check_nvrtc(nvrtcResult status, const char* message) { + if (status != NVRTC_SUCCESS) { + std::cerr << message << ": " << nvrtcGetErrorString(status) << '\n'; + std::exit(1); + } +} + + +static const char* KERNEL_SOURCE = R"(extern "C" __global__ void empty_kernel() { return; })"; +static const char* PROGRAM_NAME = "benchmark_kernel.cu"; + +static constexpr int NUM_HEADERS = 100; + + +int main(int argc, char** argv) { + bench::Options options = bench::parse_args(argc, argv); + + // Setup: need CUDA init to query compute capability for compile options + check_cu(cuInit(0), "cuInit failed"); + + CUdevice device; + check_cu(cuDeviceGet(&device, 0), "cuDeviceGet failed"); + + int major = 0, minor = 0; + check_cu(cuDeviceGetAttribute(&major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, device), + "cuDeviceGetAttribute failed"); + check_cu(cuDeviceGetAttribute(&minor, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, device), + "cuDeviceGetAttribute failed"); + + std::string arch = "--gpu-architecture=sm_" + std::to_string(major) + std::to_string(minor); + const char* compile_opts[] = {"--fmad=false", arch.c_str()}; + + // Pre-build 100 empty headers + std::vector header_name_strs(NUM_HEADERS); + std::vector header_names(NUM_HEADERS); + std::vector header_sources(NUM_HEADERS); + static const char* empty_header = "// empty"; + for (int i = 0; i < NUM_HEADERS; ++i) { + header_name_strs[i] = "header_" + std::to_string(i) + ".cuh"; + header_names[i] = header_name_strs[i].c_str(); + header_sources[i] = empty_header; + } + + bench::BenchmarkSuite suite(options); + + // --- nvrtc_create_program (no headers) --- + { + nvrtcProgram prog; + suite.run("nvrtc.nvrtc_create_program", [&]() { + check_nvrtc( + nvrtcCreateProgram(&prog, KERNEL_SOURCE, PROGRAM_NAME, 0, nullptr, nullptr), + "nvrtcCreateProgram failed" + ); + check_nvrtc(nvrtcDestroyProgram(&prog), "nvrtcDestroyProgram failed"); + }); + } + + // --- nvrtc_create_program_100_headers --- + { + nvrtcProgram prog; + suite.run("nvrtc.nvrtc_create_program_100_headers", [&]() { + check_nvrtc( + nvrtcCreateProgram(&prog, KERNEL_SOURCE, PROGRAM_NAME, + NUM_HEADERS, header_sources.data(), header_names.data()), + "nvrtcCreateProgram failed" + ); + check_nvrtc(nvrtcDestroyProgram(&prog), "nvrtcDestroyProgram failed"); + }); + } + + // --- nvrtc_compile_program --- + { + nvrtcProgram prog; + std::uint64_t compile_loops = std::min(options.loops, static_cast(10)); + suite.run("nvrtc.nvrtc_compile_program", compile_loops, [&]() { + check_nvrtc( + nvrtcCreateProgram(&prog, KERNEL_SOURCE, PROGRAM_NAME, 0, nullptr, nullptr), + "nvrtcCreateProgram failed" + ); + check_nvrtc( + nvrtcCompileProgram(prog, 2, compile_opts), + "nvrtcCompileProgram failed" + ); + check_nvrtc(nvrtcDestroyProgram(&prog), "nvrtcDestroyProgram failed"); + }); + } + + suite.write(); + + return 0; +} diff --git a/benchmarks/cuda_bindings/benchmarks/cpp/bench_pointer_attributes.cpp b/benchmarks/cuda_bindings/benchmarks/cpp/bench_pointer_attributes.cpp new file mode 100644 index 00000000000..6c6f42a58e1 --- /dev/null +++ b/benchmarks/cuda_bindings/benchmarks/cpp/bench_pointer_attributes.cpp @@ -0,0 +1,82 @@ +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +#include + +#include "bench_support.hpp" + +#include +#include + + +static void check_cu(CUresult status, const char* message) { + if (status != CUDA_SUCCESS) { + const char* error_name = nullptr; + cuGetErrorName(status, &error_name); + std::cerr << message << ": " << (error_name ? error_name : "unknown") << '\n'; + std::exit(1); + } +} + + +int main(int argc, char** argv) { + bench::Options options = bench::parse_args(argc, argv); + + // Setup: init CUDA, allocate memory + check_cu(cuInit(0), "cuInit failed"); + + CUdevice device; + check_cu(cuDeviceGet(&device, 0), "cuDeviceGet failed"); + + CUcontext ctx; + CUctxCreateParams ctxParams = {}; + check_cu(cuCtxCreate(&ctx, &ctxParams, 0, device), "cuCtxCreate failed"); + + CUdeviceptr ptr; + check_cu(cuMemAlloc(&ptr, 1 << 18), "cuMemAlloc failed"); + + bench::BenchmarkSuite suite(options); + + // --- pointer_get_attribute --- + { + unsigned int memory_type = 0; + suite.run("pointer_attributes.pointer_get_attribute", [&]() { + check_cu( + cuPointerGetAttribute(&memory_type, CU_POINTER_ATTRIBUTE_MEMORY_TYPE, ptr), + "cuPointerGetAttribute failed" + ); + }); + } + + // --- pointer_get_attributes --- + { + unsigned int memory_type = 0; + CUdeviceptr dev_ptr_out = 0; + void* host_ptr_out = nullptr; + unsigned long long buffer_id = 0; + + CUpointer_attribute attrs[4] = { + CU_POINTER_ATTRIBUTE_MEMORY_TYPE, + CU_POINTER_ATTRIBUTE_DEVICE_POINTER, + CU_POINTER_ATTRIBUTE_HOST_POINTER, + CU_POINTER_ATTRIBUTE_BUFFER_ID, + }; + void* data[4] = {&memory_type, &dev_ptr_out, &host_ptr_out, &buffer_id}; + + suite.run("pointer_attributes.pointer_get_attributes", [&]() { + check_cu( + cuPointerGetAttributes(4, attrs, data, ptr), + "cuPointerGetAttributes failed" + ); + }); + } + + // Cleanup + check_cu(cuMemFree(ptr), "cuMemFree failed"); + check_cu(cuCtxDestroy(ctx), "cuCtxDestroy failed"); + + suite.write(); + + return 0; +} diff --git a/benchmarks/cuda_bindings/benchmarks/cpp/bench_stream.cpp b/benchmarks/cuda_bindings/benchmarks/cpp/bench_stream.cpp new file mode 100644 index 00000000000..95ad0790f9f --- /dev/null +++ b/benchmarks/cuda_bindings/benchmarks/cpp/bench_stream.cpp @@ -0,0 +1,80 @@ +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +#include + +#include "bench_support.hpp" + +#include +#include + + +static void check_cu(CUresult status, const char* message) { + if (status != CUDA_SUCCESS) { + const char* error_name = nullptr; + cuGetErrorName(status, &error_name); + std::cerr << message << ": " << (error_name ? error_name : "unknown") << '\n'; + std::exit(1); + } +} + + +int main(int argc, char** argv) { + bench::Options options = bench::parse_args(argc, argv); + + // Setup + check_cu(cuInit(0), "cuInit failed"); + + CUdevice device; + check_cu(cuDeviceGet(&device, 0), "cuDeviceGet failed"); + + CUcontext ctx; + CUctxCreateParams ctxParams = {}; + check_cu(cuCtxCreate(&ctx, &ctxParams, 0, device), "cuCtxCreate failed"); + + // Persistent stream for query/synchronize benchmarks + CUstream stream; + check_cu(cuStreamCreate(&stream, CU_STREAM_NON_BLOCKING), "cuStreamCreate failed"); + + bench::BenchmarkSuite suite(options); + // Drain the persistent stream after calibration for completeness. + // stream_create_destroy uses a local stream, but stream_query/synchronize + // observe the persistent one. + suite.set_post_calibrate([&]() { + check_cu(cuStreamSynchronize(stream), "post-calibrate sync failed"); + }); + + // --- stream_create_destroy --- + { + CUstream s; + suite.run("stream.stream_create_destroy", [&]() { + check_cu(cuStreamCreate(&s, CU_STREAM_NON_BLOCKING), "cuStreamCreate failed"); + check_cu(cuStreamDestroy(s), "cuStreamDestroy failed"); + }); + } + + // --- stream_query --- + { + suite.run("stream.stream_query", [&]() { + // cuStreamQuery returns CUDA_SUCCESS if stream is idle, + // CUDA_ERROR_NOT_READY if busy — both are valid here. + cuStreamQuery(stream); + }); + } + + // --- stream_synchronize --- + { + suite.run("stream.stream_synchronize", [&]() { + check_cu(cuStreamSynchronize(stream), "cuStreamSynchronize failed"); + }); + } + + // Cleanup + check_cu(cuStreamDestroy(stream), "cuStreamDestroy failed"); + check_cu(cuCtxDestroy(ctx), "cuCtxDestroy failed"); + + suite.write(); + + return 0; +} diff --git a/benchmarks/cuda_bindings/benchmarks/cpp/bench_support.hpp b/benchmarks/cuda_bindings/benchmarks/cpp/bench_support.hpp new file mode 100644 index 00000000000..1207ee7c4dc --- /dev/null +++ b/benchmarks/cuda_bindings/benchmarks/cpp/bench_support.hpp @@ -0,0 +1,483 @@ +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace bench { + +struct Options { + std::uint64_t loops = 1000; + std::uint64_t warmups = 5; + std::uint64_t values = 20; + std::uint64_t runs = 20; + double min_time_sec = 0.0; + // Safety cap for the calibration doubling loop. Set high enough that even + // sub-nanosecond ops can reach typical --min-time targets (e.g. 100ms). + // A warning is printed if calibration hits this cap before reaching min-time. + std::uint64_t max_loops = 100000000; + std::uint64_t calibrate_rounds = 3; + std::string output_path; + std::string benchmark_name; +}; + +// A single run result: warmup values and timed values (seconds per loop) +struct RunResult { + std::string date; + double duration_sec; + std::vector warmup_values; // seconds per loop + std::vector values; // seconds per loop +}; + +inline Options parse_args(int argc, char** argv) { + Options options; + for (int i = 1; i < argc; ++i) { + const std::string arg(argv[i]); + if (arg == "--loops" && i + 1 < argc) { + options.loops = std::strtoull(argv[++i], nullptr, 10); + continue; + } + if (arg == "--warmups" && i + 1 < argc) { + options.warmups = std::strtoull(argv[++i], nullptr, 10); + continue; + } + if (arg == "--min-time" && i + 1 < argc) { + options.min_time_sec = std::strtod(argv[++i], nullptr); + continue; + } + if (arg == "--max-loops" && i + 1 < argc) { + options.max_loops = std::strtoull(argv[++i], nullptr, 10); + continue; + } + if (arg == "--calibrate-rounds" && i + 1 < argc) { + options.calibrate_rounds = std::strtoull(argv[++i], nullptr, 10); + continue; + } + if (arg == "--values" && i + 1 < argc) { + options.values = std::strtoull(argv[++i], nullptr, 10); + continue; + } + if (arg == "--runs" && i + 1 < argc) { + options.runs = std::strtoull(argv[++i], nullptr, 10); + continue; + } + if ((arg == "-o" || arg == "--output") && i + 1 < argc) { + options.output_path = argv[++i]; + continue; + } + if (arg == "--name" && i + 1 < argc) { + options.benchmark_name = argv[++i]; + continue; + } + if (arg == "--help" || arg == "-h") { + std::cout << "Usage: benchmark [options]\n" + << " --loops N Loop iterations per value (default: 1000)\n" + << " --warmups N Warmup values per run (default: 5)\n" + << " --values N Timed values per run (default: 20)\n" + << " --runs N Number of runs (default: 20)\n" + << " --min-time S Calibrate loops to reach S seconds per value\n" + << " --max-loops N Safety cap for calibration loop count (default: 100000000)\n" + << " --calibrate-rounds N Calibration passes (default: 3)\n" + << " -o, --output F Write pyperf-compatible JSON to file\n" + << " --name S Benchmark name (overrides default)\n"; + std::exit(0); + } + + std::cerr << "Unknown argument: " << arg << '\n'; + std::exit(2); + } + return options; +} + +inline std::string iso_now() { + const auto now = std::chrono::system_clock::now(); + const std::time_t t = std::chrono::system_clock::to_time_t(now); + std::tm tm{}; +#ifdef _WIN32 + gmtime_s(&tm, &t); +#else + gmtime_r(&t, &tm); +#endif + char buf[64]; + std::strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", &tm); + return std::string(buf); +} + +// Calibrate loop count to hit a minimum wall time per value. +// Returns the chosen loop count. If `capped_out` is non-null, it is set to +// true when calibration reached `max_loops` before hitting `min_time_sec` +// (meaning --min-time was NOT actually satisfied by the calibration). +template +std::uint64_t calibrate_loops( + const Options& options, + Fn&& fn, + const std::function& post_calibrate = {}, + bool* capped_out = nullptr, + double* last_elapsed_out = nullptr +) { + if (options.min_time_sec <= 0.0) { + if (capped_out) *capped_out = false; + if (last_elapsed_out) *last_elapsed_out = 0.0; + return options.loops; + } + + // Allow callers (e.g. the explicit-loop overload) to request a minimum + // starting loop count via options.loops. + const std::uint64_t start_loops = std::max(1, options.loops); + const std::uint64_t max_loops = std::max(start_loops, options.max_loops); + const std::uint64_t rounds = std::max(1, options.calibrate_rounds); + + // Track the round that produced the best (largest) loop count so the + // returned loop count, capped flag, and last-elapsed time all describe + // the same round. + std::uint64_t best_loops = 0; + bool best_capped = false; + double best_elapsed = 0.0; + + for (std::uint64_t round = 0; round < rounds; ++round) { + std::uint64_t loops = start_loops; + bool round_capped = false; + double elapsed = 0.0; + + while (true) { + const auto t0 = std::chrono::steady_clock::now(); + for (std::uint64_t i = 0; i < loops; ++i) { + fn(); + } + const auto t1 = std::chrono::steady_clock::now(); + elapsed = std::chrono::duration(t1 - t0).count(); + + // Drain any state left behind by this probe (e.g. queued async + // work on a persistent stream) before the next probe, the next + // round, or the first measured warmup/value runs. + if (post_calibrate) { + post_calibrate(); + } + if (elapsed >= options.min_time_sec) { + break; + } + if (loops >= max_loops) { + round_capped = true; + break; + } + if (loops > max_loops / 2) { + loops = max_loops; + } else { + loops *= 2; + } + } + + if (loops >= best_loops) { + best_loops = loops; + best_capped = round_capped; + best_elapsed = elapsed; + } + } + + if (capped_out) *capped_out = best_capped; + if (last_elapsed_out) *last_elapsed_out = best_elapsed; + return best_loops; +} + +// Run a benchmark function. The function signature is: void fn() — one call = one operation. +// The harness calls fn() in a tight loop `loops` times per value. +template +std::vector run_benchmark(const Options& options, Fn&& fn) { + std::vector results; + results.reserve(options.runs); + + for (std::uint64_t r = 0; r < options.runs; ++r) { + RunResult run; + run.date = iso_now(); + const auto run_start = std::chrono::steady_clock::now(); + + // Warmups + for (std::uint64_t w = 0; w < options.warmups; ++w) { + const auto t0 = std::chrono::steady_clock::now(); + for (std::uint64_t i = 0; i < options.loops; ++i) { + fn(); + } + const auto t1 = std::chrono::steady_clock::now(); + const double elapsed = std::chrono::duration(t1 - t0).count(); + run.warmup_values.push_back(elapsed / static_cast(options.loops)); + } + + // Timed values + for (std::uint64_t v = 0; v < options.values; ++v) { + const auto t0 = std::chrono::steady_clock::now(); + for (std::uint64_t i = 0; i < options.loops; ++i) { + fn(); + } + const auto t1 = std::chrono::steady_clock::now(); + const double elapsed = std::chrono::duration(t1 - t0).count(); + run.values.push_back(elapsed / static_cast(options.loops)); + } + + const auto run_end = std::chrono::steady_clock::now(); + run.duration_sec = std::chrono::duration(run_end - run_start).count(); + results.push_back(std::move(run)); + } + + return results; +} + +inline void print_summary(const std::string& name, const std::vector& results) { + // Collect all timed values + std::vector all_values; + for (const auto& run : results) { + for (double v : run.values) { + all_values.push_back(v); + } + } + if (all_values.empty()) + return; + + double sum = 0; + for (double v : all_values) + sum += v; + + double mean = sum / static_cast(all_values.size()); + + double sq_sum = 0; + for (double v : all_values) { + double diff = v - mean; + sq_sum += diff * diff; + } + double stdev = std::sqrt(sq_sum / static_cast(all_values.size())); + + std::cout << name << ": Mean +- std dev: " + << std::fixed << std::setprecision(0) + << (mean * 1e9) << " ns +- " + << (stdev * 1e9) << " ns\n"; +} + +// Escape a JSON string (minimal — no control chars expected) +inline std::string json_str(const std::string& s) { + return "\"" + s + "\""; +} + +inline void write_pyperf_json( + const std::string& output_path, + const std::string& name, + std::uint64_t loops, + const std::vector& results +) { + std::ofstream out(output_path); + if (!out) { + std::cerr << "Failed to open output file: " << output_path << '\n'; + std::exit(3); + } + + out << std::setprecision(17); + + out << "{\"version\": \"1.0\", "; + out << "\"metadata\": {"; + out << "\"name\": " << json_str(name) << ", "; + out << "\"loops\": " << loops << ", "; + out << "\"unit\": \"second\""; + out << "}, "; + + out << "\"benchmarks\": [{\"runs\": ["; + + for (std::size_t r = 0; r < results.size(); ++r) { + const auto& run = results[r]; + if (r > 0) out << ", "; + + out << "{\"metadata\": {"; + out << "\"date\": " << json_str(run.date) << ", "; + out << "\"duration\": " << run.duration_sec; + out << "}, "; + + // Warmups: array of [loops, value] pairs + out << "\"warmups\": ["; + for (std::size_t w = 0; w < run.warmup_values.size(); ++w) { + if (w > 0) out << ", "; + out << "[" << loops << ", " << run.warmup_values[w] << "]"; + } + out << "], "; + + // Values + out << "\"values\": ["; + for (std::size_t v = 0; v < run.values.size(); ++v) { + if (v > 0) out << ", "; + out << run.values[v]; + } + out << "]}"; + } + + out << "]}]}\n"; +} + +// A collected benchmark entry: name, loops, and run results +struct BenchmarkEntry { + std::string name; + std::uint64_t loops; + std::vector results; +}; + +// Collect multiple benchmarks from a single binary and write them all +// to one pyperf-compatible JSON file. +class BenchmarkSuite { +public: + explicit BenchmarkSuite(Options options) : options_(std::move(options)) {} + + // Post-calibration hook. If set, invoked between calibration probes so + // async benchmarks can drain state left behind by each probe before the + // next one runs. The final probe leaves the benchmark in a drained state + // before the first measured warmup/value. Can be overridden per-call via + // the `post_calibrate` parameter on `run()`. + void set_post_calibrate(std::function hook) { + post_calibrate_ = std::move(hook); + } + + // Run a benchmark and record it. The name is used as the benchmark ID. + // If --min-time is set, loop count is auto-calibrated. `post_calibrate`, + // if provided, runs between calibration probes to reset async state. + template + void run( + const std::string& name, + Fn&& fn, + std::function post_calibrate = {} + ) { + std::uint64_t loops = options_.loops; + Options custom = options_; + if (options_.min_time_sec > 0.0) { + loops = calibrate_and_warn(name, options_, fn, select_post_calibrate(post_calibrate)); + custom.loops = loops; + } + auto results = run_benchmark(custom, std::forward(fn)); + print_summary(name, results); + entries_.push_back({name, loops, std::move(results)}); + } + + // Run a benchmark with a custom loop count (used as a floor for fast ops + // or a fixed count for slow ops like compilation). When --min-time is set, + // calibration still runs but starts from `loops_override` as the minimum. + template + void run( + const std::string& name, + std::uint64_t loops_override, + Fn&& fn, + std::function post_calibrate = {} + ) { + std::uint64_t loops = loops_override; + Options custom = options_; + custom.loops = loops_override; + if (options_.min_time_sec > 0.0) { + Options calib_opts = options_; + calib_opts.loops = loops_override; // floor + loops = calibrate_and_warn(name, calib_opts, fn, select_post_calibrate(post_calibrate)); + custom.loops = loops; + } + auto results = run_benchmark(custom, std::forward(fn)); + print_summary(name, results); + entries_.push_back({name, loops, std::move(results)}); + } + + // Write all collected benchmarks to the output file (if -o was given). + void write() const { + if (options_.output_path.empty() || entries_.empty()) + return; + write_multi_pyperf_json(options_.output_path, entries_); + } + +private: + Options options_; + std::vector entries_; + std::function post_calibrate_; + + std::function select_post_calibrate(const std::function& per_call) const { + if (per_call) { + return per_call; + } + return post_calibrate_; + } + + template + std::uint64_t calibrate_and_warn( + const std::string& name, + const Options& calib_opts, + Fn&& fn, + const std::function& post_calibrate + ) const { + bool capped = false; + double last_elapsed = 0.0; + std::uint64_t loops = calibrate_loops( + calib_opts, std::forward(fn), post_calibrate, &capped, &last_elapsed + ); + if (capped) { + std::cerr << "WARNING: " << name + << ": calibration hit --max-loops (" << calib_opts.max_loops + << ") before reaching --min-time (" << calib_opts.min_time_sec + << "s). Last sample: " << last_elapsed + << "s. Raise --max-loops to satisfy --min-time for this benchmark.\n"; + } + return loops; + } + + static void write_multi_pyperf_json( + const std::string& output_path, + const std::vector& entries + ) { + std::ofstream out(output_path); + if (!out) { + std::cerr << "Failed to open output file: " << output_path << '\n'; + std::exit(3); + } + + out << std::setprecision(17); + out << "{\"version\": \"1.0\", \"benchmarks\": ["; + + for (std::size_t e = 0; e < entries.size(); ++e) { + const auto& entry = entries[e]; + if (e > 0) out << ", "; + + out << "{\"metadata\": {"; + out << "\"name\": " << json_str(entry.name) << ", "; + out << "\"loops\": " << entry.loops << ", "; + out << "\"unit\": \"second\""; + out << "}, \"runs\": ["; + + for (std::size_t r = 0; r < entry.results.size(); ++r) { + const auto& run = entry.results[r]; + if (r > 0) out << ", "; + + out << "{\"metadata\": {"; + out << "\"date\": " << json_str(run.date) << ", "; + out << "\"duration\": " << run.duration_sec; + out << "}, "; + + out << "\"warmups\": ["; + for (std::size_t w = 0; w < run.warmup_values.size(); ++w) { + if (w > 0) out << ", "; + out << "[" << entry.loops << ", " << run.warmup_values[w] << "]"; + } + out << "], "; + + out << "\"values\": ["; + for (std::size_t v = 0; v < run.values.size(); ++v) { + if (v > 0) out << ", "; + out << run.values[v]; + } + out << "]}"; + } + out << "]}"; + } + out << "]}\n"; + } +}; + +} // namespace bench diff --git a/benchmarks/cuda_bindings/benchmarks/cpp/bench_tensormap.cpp b/benchmarks/cuda_bindings/benchmarks/cpp/bench_tensormap.cpp new file mode 100644 index 00000000000..d2ea5d6b20c --- /dev/null +++ b/benchmarks/cuda_bindings/benchmarks/cpp/bench_tensormap.cpp @@ -0,0 +1,218 @@ +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +#include + +#include "bench_support.hpp" + +#include +#include + + +static void check_cu(CUresult status, const char* message) { + if (status != CUDA_SUCCESS) { + const char* error_name = nullptr; + cuGetErrorName(status, &error_name); + std::cerr << message << ": " << (error_name ? error_name : "unknown") << '\n'; + std::exit(1); + } +} + + +int main(int argc, char** argv) { + bench::Options options = bench::parse_args(argc, argv); + + // Setup: init CUDA, allocate device memory + check_cu(cuInit(0), "cuInit failed"); + + CUdevice device; + check_cu(cuDeviceGet(&device, 0), "cuDeviceGet failed"); + + CUcontext ctx; + CUctxCreateParams ctxParams = {}; + check_cu(cuCtxCreate(&ctx, &ctxParams, 0, device), "cuCtxCreate failed"); + + CUdeviceptr ptr; + check_cu(cuMemAlloc(&ptr, 1 << 20), "cuMemAlloc failed"); + + // CUtensorMap must be 64-byte aligned. + alignas(64) CUtensorMap tensor_map{}; + + bench::BenchmarkSuite suite(options); + + // --- tensor_map_encode_tiled --- + { + const cuuint64_t global_dim[2] = {128ull, 128ull}; + const cuuint64_t global_strides[1] = {128ull * 4ull}; + const cuuint32_t box_dim[2] = {64u, 64u}; + const cuuint32_t element_strides[2] = {1u, 1u}; + + CUresult probe = cuTensorMapEncodeTiled( + &tensor_map, + CU_TENSOR_MAP_DATA_TYPE_FLOAT32, + 2u, + reinterpret_cast(ptr), + global_dim, + global_strides, + box_dim, + element_strides, + CU_TENSOR_MAP_INTERLEAVE_NONE, + CU_TENSOR_MAP_SWIZZLE_NONE, + CU_TENSOR_MAP_L2_PROMOTION_NONE, + CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE + ); + if (probe == CUDA_SUCCESS) { + suite.run("tensormap.tensor_map_encode_tiled", [&]() { + check_cu( + cuTensorMapEncodeTiled( + &tensor_map, + CU_TENSOR_MAP_DATA_TYPE_FLOAT32, + 2u, + reinterpret_cast(ptr), + global_dim, + global_strides, + box_dim, + element_strides, + CU_TENSOR_MAP_INTERLEAVE_NONE, + CU_TENSOR_MAP_SWIZZLE_NONE, + CU_TENSOR_MAP_L2_PROMOTION_NONE, + CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE + ), + "cuTensorMapEncodeTiled failed" + ); + }); + } else { + const char* err_name = nullptr; + cuGetErrorName(probe, &err_name); + std::cerr << "Skipping tensormap.tensor_map_encode_tiled: " + << (err_name ? err_name : "unknown") << '\n'; + } + } + + // --- tensor_map_encode_im2col --- + { + const cuuint64_t global_dim[3] = {32ull, 64ull, 64ull}; + const cuuint64_t global_strides[2] = {32ull * 2ull, 32ull * 64ull * 2ull}; + const int pixel_box_lower[1] = {0}; + const int pixel_box_upper[1] = {0}; + const cuuint32_t element_strides[3] = {1u, 1u, 1u}; + + CUresult probe = cuTensorMapEncodeIm2col( + &tensor_map, + CU_TENSOR_MAP_DATA_TYPE_FLOAT16, + 3u, + reinterpret_cast(ptr), + global_dim, + global_strides, + pixel_box_lower, + pixel_box_upper, + 32u, + 32u, + element_strides, + CU_TENSOR_MAP_INTERLEAVE_NONE, + CU_TENSOR_MAP_SWIZZLE_NONE, + CU_TENSOR_MAP_L2_PROMOTION_NONE, + CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE + ); + if (probe == CUDA_SUCCESS) { + suite.run("tensormap.tensor_map_encode_im2col", [&]() { + check_cu( + cuTensorMapEncodeIm2col( + &tensor_map, + CU_TENSOR_MAP_DATA_TYPE_FLOAT16, + 3u, + reinterpret_cast(ptr), + global_dim, + global_strides, + pixel_box_lower, + pixel_box_upper, + 32u, + 32u, + element_strides, + CU_TENSOR_MAP_INTERLEAVE_NONE, + CU_TENSOR_MAP_SWIZZLE_NONE, + CU_TENSOR_MAP_L2_PROMOTION_NONE, + CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE + ), + "cuTensorMapEncodeIm2col failed" + ); + }); + } else { + const char* err_name = nullptr; + cuGetErrorName(probe, &err_name); + std::cerr << "Skipping tensormap.tensor_map_encode_im2col: " + << (err_name ? err_name : "unknown") << '\n'; + } + } + +#if defined(CUDA_VERSION) && CUDA_VERSION >= 12080 + // --- tensor_map_encode_im2col_wide --- + { + const cuuint64_t global_dim[3] = {32ull, 64ull, 64ull}; + const cuuint64_t global_strides[2] = {32ull * 2ull, 32ull * 64ull * 2ull}; + const cuuint32_t element_strides[3] = {1u, 1u, 1u}; + + CUresult probe = cuTensorMapEncodeIm2colWide( + &tensor_map, + CU_TENSOR_MAP_DATA_TYPE_FLOAT16, + 3u, + reinterpret_cast(ptr), + global_dim, + global_strides, + 0, + 0, + 32u, + 32u, + element_strides, + CU_TENSOR_MAP_INTERLEAVE_NONE, + CU_TENSOR_MAP_IM2COL_WIDE_MODE_W, + CU_TENSOR_MAP_SWIZZLE_128B, + CU_TENSOR_MAP_L2_PROMOTION_NONE, + CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE + ); + + if (probe == CUDA_SUCCESS) { + suite.run("tensormap.tensor_map_encode_im2col_wide", [&]() { + check_cu( + cuTensorMapEncodeIm2colWide( + &tensor_map, + CU_TENSOR_MAP_DATA_TYPE_FLOAT16, + 3u, + reinterpret_cast(ptr), + global_dim, + global_strides, + 0, + 0, + 32u, + 32u, + element_strides, + CU_TENSOR_MAP_INTERLEAVE_NONE, + CU_TENSOR_MAP_IM2COL_WIDE_MODE_W, + CU_TENSOR_MAP_SWIZZLE_128B, + CU_TENSOR_MAP_L2_PROMOTION_NONE, + CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE + ), + "cuTensorMapEncodeIm2colWide failed" + ); + }); + } else { + const char* err_name = nullptr; + cuGetErrorName(probe, &err_name); + std::cerr << "Skipping tensormap.tensor_map_encode_im2col_wide: " + << (err_name ? err_name : "unknown") << '\n'; + } + } +#else + std::cerr << "Skipping tensormap.tensor_map_encode_im2col_wide: " + "built against CUDA_VERSION < 12080.\n"; +#endif + + // Cleanup + check_cu(cuMemFree(ptr), "cuMemFree failed"); + check_cu(cuCtxDestroy(ctx), "cuCtxDestroy failed"); + + suite.write(); + + return 0; +} diff --git a/benchmarks/cuda_bindings/compare.py b/benchmarks/cuda_bindings/compare.py new file mode 100644 index 00000000000..ca1b398ceb2 --- /dev/null +++ b/benchmarks/cuda_bindings/compare.py @@ -0,0 +1,163 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +"""Compare Python and C++ benchmark results in a summary table.""" + +import argparse +import json +import statistics +import sys +from pathlib import Path + +PROJECT_ROOT = Path(__file__).resolve().parent +DEFAULT_PYTHON = PROJECT_ROOT / "results-python.json" +DEFAULT_CPP = PROJECT_ROOT / "results-cpp.json" + + +def load_benchmarks(path: Path) -> dict[str, list[float]]: + """Load a pyperf JSON file and return {name: [values]}.""" + with open(path) as f: + data = json.load(f) + + results: dict[str, list[float]] = {} + for bench in data.get("benchmarks", []): + name = bench.get("metadata", {}).get("name", "") + if not name: + # Try to find name in run metadata + for run in bench.get("runs", []): + name = run.get("metadata", {}).get("name", "") + if name: + break + values: list[float] = [] + for run in bench.get("runs", []): + values.extend(run.get("values", [])) + if name and values: + results[name] = values + return results + + +def stats(values: list[float]) -> tuple[float, float, float, int]: + mean = statistics.mean(values) + stdev = statistics.pstdev(values) if len(values) > 1 else 0.0 + rsd = (stdev / mean) if mean else 0.0 + return mean, stdev, rsd, len(values) + + +def fmt_rsd(rsd: float | None) -> str: + if rsd is None: + return "-" + return f"{rsd * 100:.1f}%" + + +def fmt_ns(seconds: float) -> str: + """Format a duration in nanoseconds with a thousands separator. + + Using a single unit across the whole table makes side-by-side comparison + easier, even when some entries get into the multi-microsecond range. + """ + return f"{seconds * 1e9:,.0f}" + + +def fmt_overhead_ns(py_mean: float, cpp_mean: float) -> str: + return f"{(py_mean - cpp_mean) * 1e9:+,.0f}" + + +def fmt_overhead_pct(py_mean: float, cpp_mean: float) -> str: + if cpp_mean <= 0.0: + return "-" + pct = (py_mean - cpp_mean) / cpp_mean * 100 + return f"{pct:+,.0f}%" + + +def main() -> None: + parser = argparse.ArgumentParser(description="Compare Python vs C++ benchmark results") + parser.add_argument( + "--python", + type=Path, + default=DEFAULT_PYTHON, + help=f"Python results JSON (default: {DEFAULT_PYTHON.name})", + ) + parser.add_argument( + "--cpp", + type=Path, + default=DEFAULT_CPP, + help=f"C++ results JSON (default: {DEFAULT_CPP.name})", + ) + args = parser.parse_args() + + if not args.python.exists(): + print(f"Python results not found: {args.python}", file=sys.stderr) + print("Run: pixi run -e wheel bench", file=sys.stderr) + sys.exit(1) + + py_benchmarks = load_benchmarks(args.python) + cpp_benchmarks = load_benchmarks(args.cpp) if args.cpp.exists() else {} + + if not py_benchmarks: + print("No benchmarks found in Python results.", file=sys.stderr) + sys.exit(1) + + # Column widths + all_names = sorted(set(py_benchmarks) | set(cpp_benchmarks)) + name_width = max(len(n) for n in all_names) + name_width = max(name_width, len("Benchmark")) + + # Right-aligned numeric columns. Widths chosen so header text fits and + # multi-microsecond ns values with thousands separators still align. + cpp_w = 12 + py_w = 12 + rsd_w = 8 + oh_ns_w = 12 + oh_pct_w = 10 + + # Header + if cpp_benchmarks: + header = ( + f"{'Benchmark':<{name_width}} " + f"{'C++ (ns)':>{cpp_w}} {'C++ RSD':>{rsd_w}} " + f"{'Python (ns)':>{py_w}} {'Py RSD':>{rsd_w}} " + f"{'Overhead ns':>{oh_ns_w}} {'Overhead %':>{oh_pct_w}}" + ) + else: + header = f"{'Benchmark':<{name_width}} {'Python (ns)':>{py_w}} {'Py RSD':>{rsd_w}}" + + sep = "-" * len(header) + print(sep) + print(header) + print(sep) + + for name in all_names: + py_vals = py_benchmarks.get(name) + cpp_vals = cpp_benchmarks.get(name) + + py_stats = stats(py_vals) if py_vals else None + cpp_stats = stats(cpp_vals) if cpp_vals else None + + py_str = fmt_ns(py_stats[0]) if py_stats else "-" + cpp_str = fmt_ns(cpp_stats[0]) if cpp_stats else "-" + py_rsd = fmt_rsd(py_stats[2]) if py_stats else "-" + cpp_rsd = fmt_rsd(cpp_stats[2]) if cpp_stats else "-" + + if py_stats and cpp_stats: + overhead_ns_str = fmt_overhead_ns(py_stats[0], cpp_stats[0]) + overhead_pct_str = fmt_overhead_pct(py_stats[0], cpp_stats[0]) + else: + overhead_ns_str = "-" + overhead_pct_str = "-" + + if cpp_benchmarks: + print( + f"{name:<{name_width}} " + f"{cpp_str:>{cpp_w}} {cpp_rsd:>{rsd_w}} " + f"{py_str:>{py_w}} {py_rsd:>{rsd_w}} " + f"{overhead_ns_str:>{oh_ns_w}} {overhead_pct_str:>{oh_pct_w}}" + ) + else: + print(f"{name:<{name_width}} {py_str:>{py_w}} {py_rsd:>{rsd_w}}") + + print(sep) + + +if __name__ == "__main__": + main() diff --git a/benchmarks/cuda_bindings/pixi.lock b/benchmarks/cuda_bindings/pixi.lock new file mode 100644 index 00000000000..8f754621bd2 --- /dev/null +++ b/benchmarks/cuda_bindings/pixi.lock @@ -0,0 +1,1767 @@ +version: 6 +environments: + default: + channels: + - url: https://conda.anaconda.org/conda-forge/ + options: + channel-priority: disabled + pypi-prerelease-mode: if-necessary-or-explicit + packages: {} + source: + channels: + - url: https://conda.anaconda.org/conda-forge/ + options: + channel-priority: disabled + pypi-prerelease-mode: if-necessary-or-explicit + packages: + linux-64: + - conda: https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-20_gnu.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/attr-2.5.2-h39aace5_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/binutils-2.45.1-default_h4852527_101.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/binutils_impl_linux-64-2.45.1-default_hfdba357_101.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/binutils_linux-64-2.45.1-default_h4852527_101.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hda65f42_9.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/c-ares-1.34.6-hb03c661_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/c-compiler-1.11.0-h4d9bdce_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.2.25-hbd8a1cb_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cffi-2.0.0-py314h4a8dc5f_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cfgv-3.5.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cmake-4.2.3-hc85cc9f_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/colorama-0.4.6-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/conda-gcc-specs-14.3.0-he8ccf15_18.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_linux-64-13.2.27-ha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_linux-64-13.2.51-ha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-13.2.51-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-dev-13.2.51-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_linux-64-13.2.51-h376f20c_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-static-13.2.51-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_linux-64-13.2.51-h376f20c_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_linux-64-13.2.51-h376f20c_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-driver-dev_linux-64-13.2.51-h376f20c_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvrtc-13.2.78-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvrtc-dev-13.2.78-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-13.2.51-h69a702a_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_linux-64-13.2.51-ha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-impl-13.2.51-h4bc722e_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-tools-13.2.51-h4bc722e_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-13.2-he2cc418_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cxx-compiler-1.11.0-hfcd1e18_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/distlib-0.4.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.3.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/filelock-3.25.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gcc-14.3.0-h0dff253_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gcc_impl_linux-64-14.3.0-hbdf3cc3_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gcc_linux-64-14.3.0-h298d278_21.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gxx-14.3.0-h76987e4_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gxx_impl_linux-64-14.3.0-h2185e75_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gxx_linux-64-14.3.0-he467f4b_21.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/icu-78.2-h33c6efd_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/identify-2.6.17-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/importlib-metadata-8.7.0-pyhe01879c_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/iniconfig-2.3.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/kernel-headers_linux-64-4.18.0-he073ed8_9.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/keyutils-1.6.3-hb9d3cd8_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/krb5-1.22.2-ha1258a1_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.45.1-default_hbd61a6d_101.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libblas-3.11.0-5_h4a7cf45_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcap-2.77-h3ff7636_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcblas-3.11.0-5_h0358290_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcufile-1.17.1.22-h85c024f_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcurl-8.18.0-hcf29cc6_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libedit-3.1.20250104-pl5321h7949ede_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libev-4.33-hd590300_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.7.4-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libffi-3.5.2-h3435931_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-15.2.0-he0feb66_18.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/libgcc-devel_linux-64-14.3.0-hf649bbc_118.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-15.2.0-h69a702a_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran-15.2.0-h69a702a_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-15.2.0-h68bc16d_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgomp-15.2.0-he0feb66_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/liblapack-3.11.0-5_h47877c9_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/liblzma-5.8.2-hb03c661_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libmpdec-4.0.0-hb03c661_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnghttp2-1.67.0-had1ee68_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnl-3.11.0-hb9d3cd8_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnvfatbin-13.2.51-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnvjitlink-13.2.51-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenblas-0.3.30-pthreads_h94d23a6_4.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsanitizer-14.3.0-h8f1669f_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.51.2-hf4e2dac_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libssh2-1.11.1-hcf80075_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-15.2.0-h934c35e_18.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/libstdcxx-devel_linux-64-14.3.0-h9f08a49_118.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsystemd0-257.10-hd0affe5_4.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libudev1-257.10-hd0affe5_4.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.41.3-h5347b49_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libuv-1.51.0-hb03c661_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.1-hb9d3cd8_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.5-h2d0b736_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ninja-1.13.2-h171cf75_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/nodeenv-1.10.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/numpy-2.4.2-py314h2b28147_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.6.1-h35e630c_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-26.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.9.4-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pluggy-1.6.0-pyhf9edf01_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pre-commit-4.5.1-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/py-cpuinfo-9.0.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pycparser-2.22-pyh29332c3_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pygments-2.19.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pyperf-2.9.0-py314hdafbbf9_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-9.0.2-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-benchmark-5.2.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/python-3.14.3-h32b2ec7_101_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python-discovery-1.1.3-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.14-8_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pyyaml-6.0.3-py314h67df5f8_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/rdma-core-61.0-h192683f_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/readline-8.3-h853b02a_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/rhash-1.4.6-hb9d3cd8_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/six-1.17.0-pyhe01879c_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sysroot_linux-64-2.28-h4ee821c_9.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_h366c992_103.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.4.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.15.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ukkonen-1.1.0-py314h9891dd4_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/virtualenv-21.2.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/yaml-0.2.5-h280c20c_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/zipp-3.23.0-pyhcf101f3_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_6.conda + - conda: ../../cuda_bindings + - conda: ../../cuda_pathfinder + wheel: + channels: + - url: https://conda.anaconda.org/conda-forge/ + options: + channel-priority: disabled + pypi-prerelease-mode: if-necessary-or-explicit + packages: + linux-64: + - conda: https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-20_gnu.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/attr-2.5.2-h39aace5_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/binutils-2.45.1-default_h4852527_101.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/binutils_impl_linux-64-2.45.1-default_hfdba357_101.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/binutils_linux-64-2.45.1-default_h4852527_101.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hda65f42_9.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/c-ares-1.34.6-hb03c661_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/c-compiler-1.11.0-h4d9bdce_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.2.25-hbd8a1cb_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cffi-2.0.0-py314h4a8dc5f_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cfgv-3.5.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cmake-4.2.3-hc85cc9f_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/colorama-0.4.6-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/conda-gcc-specs-14.3.0-he8ccf15_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-bindings-13.1.0-py314ha160325_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_linux-64-13.1.115-ha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_linux-64-13.1.115-ha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-13.1.80-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-dev-13.1.80-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_linux-64-13.1.80-h376f20c_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-static-13.1.80-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_linux-64-13.1.80-h376f20c_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_linux-64-13.1.80-h376f20c_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-driver-dev_linux-64-13.1.80-h376f20c_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvrtc-13.1.115-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvrtc-dev-13.1.115-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-impl-13.1.115-h4bc722e_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-pathfinder-1.4.0-pyhc364b38_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-13.1-h2ff5cdb_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cxx-compiler-1.11.0-hfcd1e18_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/distlib-0.4.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.3.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/filelock-3.25.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gcc-14.3.0-h0dff253_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gcc_impl_linux-64-14.3.0-hbdf3cc3_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gcc_linux-64-14.3.0-h298d278_21.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gxx-14.3.0-h76987e4_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gxx_impl_linux-64-14.3.0-h2185e75_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/gxx_linux-64-14.3.0-he467f4b_21.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/icu-78.2-h33c6efd_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/identify-2.6.17-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/importlib-metadata-8.7.0-pyhe01879c_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/iniconfig-2.3.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/kernel-headers_linux-64-4.18.0-he073ed8_9.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/keyutils-1.6.3-hb9d3cd8_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/krb5-1.22.2-ha1258a1_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.45.1-default_hbd61a6d_101.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libblas-3.11.0-5_h4a7cf45_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcap-2.77-h3ff7636_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcblas-3.11.0-5_h0358290_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcufile-1.16.1.26-hd07211c_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcurl-8.18.0-hcf29cc6_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libedit-3.1.20250104-pl5321h7949ede_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libev-4.33-hd590300_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.7.4-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libffi-3.5.2-h3435931_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-15.2.0-he0feb66_18.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/libgcc-devel_linux-64-14.3.0-hf649bbc_118.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-15.2.0-h69a702a_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran-15.2.0-h69a702a_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-15.2.0-h68bc16d_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgomp-15.2.0-he0feb66_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/liblapack-3.11.0-5_h47877c9_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/liblzma-5.8.2-hb03c661_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libmpdec-4.0.0-hb03c661_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnghttp2-1.67.0-had1ee68_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnl-3.11.0-hb9d3cd8_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnvjitlink-13.1.115-hecca717_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenblas-0.3.30-pthreads_h94d23a6_4.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsanitizer-14.3.0-h8f1669f_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.51.2-hf4e2dac_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libssh2-1.11.1-hcf80075_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-15.2.0-h934c35e_18.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/libstdcxx-devel_linux-64-14.3.0-h9f08a49_118.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsystemd0-257.10-hd0affe5_4.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libudev1-257.10-hd0affe5_4.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.41.3-h5347b49_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libuv-1.51.0-hb03c661_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.1-hb9d3cd8_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.5-h2d0b736_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ninja-1.13.2-h171cf75_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/nodeenv-1.10.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/numpy-2.4.2-py314h2b28147_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.6.1-h35e630c_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-26.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.9.4-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pluggy-1.6.0-pyhf9edf01_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pre-commit-4.5.1-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/py-cpuinfo-9.0.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pycparser-2.22-pyh29332c3_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pygments-2.19.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pyperf-2.9.0-py314hdafbbf9_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-9.0.2-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-benchmark-5.2.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/python-3.14.3-h32b2ec7_101_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python-discovery-1.1.3-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.14-8_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pyyaml-6.0.3-py314h67df5f8_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/rdma-core-61.0-h192683f_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/readline-8.3-h853b02a_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/rhash-1.4.6-hb9d3cd8_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/six-1.17.0-pyhe01879c_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sysroot_linux-64-2.28-h4ee821c_9.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_h366c992_103.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.4.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.15.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ukkonen-1.1.0-py314h9891dd4_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/virtualenv-21.2.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/yaml-0.2.5-h280c20c_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/zipp-3.23.0-pyhcf101f3_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_6.conda +packages: +- conda: https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-20_gnu.conda + build_number: 20 + sha256: 1dd3fffd892081df9726d7eb7e0dea6198962ba775bd88842135a4ddb4deb3c9 + md5: a9f577daf3de00bca7c3c76c0ecbd1de + depends: + - __glibc >=2.17,<3.0.a0 + - libgomp >=7.5.0 + constrains: + - openmp_impl <0.0a0 + license: BSD-3-Clause + license_family: BSD + size: 28948 + timestamp: 1770939786096 +- conda: https://conda.anaconda.org/conda-forge/linux-64/attr-2.5.2-h39aace5_0.conda + sha256: a9c114cbfeda42a226e2db1809a538929d2f118ef855372293bd188f71711c48 + md5: 791365c5f65975051e4e017b5da3abf5 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + license: GPL-2.0-or-later + license_family: GPL + size: 68072 + timestamp: 1756738968573 +- conda: https://conda.anaconda.org/conda-forge/linux-64/binutils-2.45.1-default_h4852527_101.conda + sha256: 2851d34944b056d028543f0440fb631aeeff204151ea09589d8d9c13882395de + md5: 9902aeb08445c03fb31e01beeb173988 + depends: + - binutils_impl_linux-64 >=2.45.1,<2.45.2.0a0 + license: GPL-3.0-only + license_family: GPL + size: 35128 + timestamp: 1770267175160 +- conda: https://conda.anaconda.org/conda-forge/linux-64/binutils_impl_linux-64-2.45.1-default_hfdba357_101.conda + sha256: 74341b26a2b9475dc14ba3cf12432fcd10a23af285101883e720216d81d44676 + md5: 83aa53cb3f5fc849851a84d777a60551 + depends: + - ld_impl_linux-64 2.45.1 default_hbd61a6d_101 + - sysroot_linux-64 + - zstd >=1.5.7,<1.6.0a0 + license: GPL-3.0-only + license_family: GPL + size: 3744895 + timestamp: 1770267152681 +- conda: https://conda.anaconda.org/conda-forge/linux-64/binutils_linux-64-2.45.1-default_h4852527_101.conda + sha256: 4826f97d33cbe54459970a1e84500dbe0cccf8326aaf370e707372ae20ec5a47 + md5: dec96579f9a7035a59492bf6ee613b53 + depends: + - binutils_impl_linux-64 2.45.1 default_hfdba357_101 + license: GPL-3.0-only + license_family: GPL + size: 36060 + timestamp: 1770267177798 +- conda: https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hda65f42_9.conda + sha256: 0b75d45f0bba3e95dc693336fa51f40ea28c980131fec438afb7ce6118ed05f6 + md5: d2ffd7602c02f2b316fd921d39876885 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: bzip2-1.0.6 + license_family: BSD + size: 260182 + timestamp: 1771350215188 +- conda: https://conda.anaconda.org/conda-forge/linux-64/c-ares-1.34.6-hb03c661_0.conda + sha256: cc9accf72fa028d31c2a038460787751127317dcfa991f8d1f1babf216bb454e + md5: 920bb03579f15389b9e512095ad995b7 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: MIT + license_family: MIT + size: 207882 + timestamp: 1765214722852 +- conda: https://conda.anaconda.org/conda-forge/linux-64/c-compiler-1.11.0-h4d9bdce_0.conda + sha256: 8e7a40f16400d7839c82581410aa05c1f8324a693c9d50079f8c50dc9fb241f0 + md5: abd85120de1187b0d1ec305c2173c71b + depends: + - binutils + - gcc + - gcc_linux-64 14.* + license: BSD-3-Clause + license_family: BSD + size: 6693 + timestamp: 1753098721814 +- conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.2.25-hbd8a1cb_0.conda + sha256: 67cc7101b36421c5913a1687ef1b99f85b5d6868da3abbf6ec1a4181e79782fc + md5: 4492fd26db29495f0ba23f146cd5638d + depends: + - __unix + license: ISC + size: 147413 + timestamp: 1772006283803 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cffi-2.0.0-py314h4a8dc5f_1.conda + sha256: c6339858a0aaf5d939e00d345c98b99e4558f285942b27232ac098ad17ac7f8e + md5: cf45f4278afd6f4e6d03eda0f435d527 + depends: + - __glibc >=2.17,<3.0.a0 + - libffi >=3.5.2,<3.6.0a0 + - libgcc >=14 + - pycparser + - python >=3.14,<3.15.0a0 + - python_abi 3.14.* *_cp314 + license: MIT + license_family: MIT + size: 300271 + timestamp: 1761203085220 +- conda: https://conda.anaconda.org/conda-forge/noarch/cfgv-3.5.0-pyhd8ed1ab_0.conda + sha256: aa589352e61bb221351a79e5946d56916e3c595783994884accdb3b97fe9d449 + md5: 381bd45fb7aa032691f3063aff47e3a1 + depends: + - python >=3.10 + license: MIT + license_family: MIT + size: 13589 + timestamp: 1763607964133 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cmake-4.2.3-hc85cc9f_1.conda + sha256: 5ece78754577b8d9030ec1f09ce1cd481125f27d8d6fcdcfe2c1017661830c61 + md5: 51d37989c1758b5edfe98518088bf700 + depends: + - __glibc >=2.17,<3.0.a0 + - bzip2 >=1.0.8,<2.0a0 + - libcurl >=8.18.0,<9.0a0 + - libexpat >=2.7.4,<3.0a0 + - libgcc >=14 + - liblzma >=5.8.2,<6.0a0 + - libstdcxx >=14 + - libuv >=1.51.0,<2.0a0 + - libzlib >=1.3.1,<2.0a0 + - ncurses >=6.5,<7.0a0 + - rhash >=1.4.6,<2.0a0 + - zstd >=1.5.7,<1.6.0a0 + license: BSD-3-Clause + license_family: BSD + size: 22330508 + timestamp: 1771383666798 +- conda: https://conda.anaconda.org/conda-forge/noarch/colorama-0.4.6-pyhd8ed1ab_1.conda + sha256: ab29d57dc70786c1269633ba3dff20288b81664d3ff8d21af995742e2bb03287 + md5: 962b9857ee8e7018c22f2776ffa0b2d7 + depends: + - python >=3.9 + license: BSD-3-Clause + license_family: BSD + size: 27011 + timestamp: 1733218222191 +- conda: https://conda.anaconda.org/conda-forge/linux-64/conda-gcc-specs-14.3.0-he8ccf15_18.conda + sha256: b90ec0e6a9eb22f7240b3584fe785457cff961fec68d40e6aece5d596f9bbd9a + md5: 0e3e144115c43c9150d18fa20db5f31c + depends: + - gcc_impl_linux-64 >=14.3.0,<14.3.1.0a0 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 31705 + timestamp: 1771378159534 +- conda: ../../cuda_bindings + name: cuda-bindings + version: 13.2.0 + build: hb0f4dca_0 + subdir: linux-64 + variants: + target_platform: linux-64 + depends: + - python + - cuda-version + - cuda-pathfinder + - libnvjitlink + - cuda-nvrtc + - cuda-nvrtc >=13.2.78,<14.0a0 + - cuda-nvvm + - libnvfatbin + - libcufile + - libcufile >=1.17.1.22,<2.0a0 + - libgcc >=15 + - libgcc >=15 + - libstdcxx >=15 + - python_abi 3.14.* *_cp314 + license: Apache-2.0 + sources: + cuda-pathfinder: + path: ../cuda_pathfinder +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-bindings-13.1.0-py314ha160325_1.conda + sha256: aecfbbc9a687e5daba66b896613a00c617e3eadc21a31b19e53e8e642e83d7a7 + md5: 3bd3abdf71e1b8c53310195677bf00be + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-nvrtc >=13,<14.0a0 + - cuda-nvvm-impl >=13,<14.0a0 + - cuda-pathfinder >=1.1.0,<2 + - cuda-version >=13,<14.0a0 + - libcufile >=1,<2.0a0 + - libgcc >=14 + - libnvjitlink >=13.0,<14.0a0 + - libstdcxx >=14 + - numpy + - python >=3.14,<3.15.0a0 + - python_abi 3.14.* *_cp314 + constrains: + - cuda-python >=13.1.0,<13.2.0a0 + - cuda-cudart >=13,<14.0a0 + license: LicenseRef-NVIDIA-SOFTWARE-LICENSE + size: 7267159 + timestamp: 1764919647948 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_linux-64-13.1.115-ha770c72_0.conda + sha256: 0715f15da71587238600f0584bc8d243d8fde602c3d8856f421b58dff3fb9422 + md5: a179486129ff28d053bb16fdb533568e + depends: + - cuda-version >=13.1,<13.2.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 1277295 + timestamp: 1768272295906 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_linux-64-13.2.27-ha770c72_0.conda + sha256: e539baa32e3be63f89bd11d421911363faac322903caf58a15a46ba68ae29867 + md5: 4910b7b709f1168baffc2a742b39a222 + depends: + - cuda-version >=13.2,<13.3.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 1415308 + timestamp: 1773098874302 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_linux-64-13.1.115-ha770c72_0.conda + sha256: 82ae1f3e492146722e258e237daa537f4d4df8157b2dfa49a0869eb41a11d284 + md5: 3723bca2a84e6cc0f0a98427b71bec73 + depends: + - cuda-version >=13.1,<13.2.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 96480 + timestamp: 1768280269206 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_linux-64-13.2.51-ha770c72_0.conda + sha256: dd9a74a40b196b1ea150b17ca8fb539dd8f75edd349af354a7bae6dbb43e43b4 + md5: 6f4a609f3d142d4b22728823955249e9 + depends: + - cuda-version >=13.2,<13.3.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 97122 + timestamp: 1773115163637 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-13.1.80-hecca717_0.conda + sha256: 00acb7564e7c7dd60be431bd2a1a937856e38a86535d72281461cd193500a0a4 + md5: 2e2b71c8d67f6ceb1d3820aa438f3580 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-cudart_linux-64 13.1.80 h376f20c_0 + - cuda-version >=13.1,<13.2.0a0 + - libgcc >=14 + - libstdcxx >=14 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 24159 + timestamp: 1764883525821 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-13.2.51-hecca717_0.conda + sha256: 9cc44fd4914738a32cf5c801925a08c61ce45b5534833cf1df1621236a9a321d + md5: 29f5b46965bd82b0e9cc27a96d13f2bd + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-cudart_linux-64 13.2.51 h376f20c_0 + - cuda-version >=13.2,<13.3.0a0 + - libgcc >=14 + - libstdcxx >=14 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 24534 + timestamp: 1773104357094 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-dev-13.1.80-hecca717_0.conda + sha256: 12aa5dcf82cdf863be18a48a9ad4d271aa864ef985752bc9707371b84085f0c8 + md5: e3cbe24bf8ae135e9f82450be520e886 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-cudart 13.1.80 hecca717_0 + - cuda-cudart-dev_linux-64 13.1.80 h376f20c_0 + - cuda-cudart-static 13.1.80 hecca717_0 + - cuda-version >=13.1,<13.2.0a0 + - libgcc >=14 + - libstdcxx >=14 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 24597 + timestamp: 1764883573873 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-dev-13.2.51-hecca717_0.conda + sha256: f6d81c961b6212389c07ffc9dc1268966db63aa351d46875effee40447eb9dd8 + md5: 9b35a56418b6cbbde5ea5f7d84c26317 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-cudart 13.2.51 hecca717_0 + - cuda-cudart-dev_linux-64 13.2.51 h376f20c_0 + - cuda-cudart-static 13.2.51 hecca717_0 + - cuda-version >=13.2,<13.3.0a0 + - libgcc >=14 + - libstdcxx >=14 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 24961 + timestamp: 1773104406956 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_linux-64-13.1.80-h376f20c_0.conda + sha256: 41a1cc86f2759ef6ae47cc68e2180baaeb4b989709931366ee0cdc90f8e10f5f + md5: a36776a49ae0e47a26e129bdc82aeb3e + depends: + - cuda-cccl_linux-64 + - cuda-cudart-static_linux-64 + - cuda-cudart_linux-64 + - cuda-version >=13.1,<13.2.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 392459 + timestamp: 1764883538793 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_linux-64-13.2.51-h376f20c_0.conda + sha256: 86dd0dc301bab5263d63f13d47b02507e0cf2fd22ff9aefa37dea2dd03c6df83 + md5: 7e5cf4b991525b7b1a2cfa3f1c81462e + depends: + - cuda-cccl_linux-64 + - cuda-cudart-static_linux-64 + - cuda-cudart_linux-64 + - cuda-version >=13.2,<13.3.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 399921 + timestamp: 1773104368666 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-static-13.1.80-hecca717_0.conda + sha256: 7cbf145b3e59d360052556bfe9425753b119c33cbba0c1f20f0191a7330ced5c + md5: 0e5edde73725a13f7d62ddf96b7656b9 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-cudart-static_linux-64 13.1.80 h376f20c_0 + - cuda-version >=13.1,<13.2.0a0 + - libgcc >=14 + - libstdcxx >=14 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 24119 + timestamp: 1764883551735 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-static-13.2.51-hecca717_0.conda + sha256: d4a316038b02161e04a864c8cd146d2ec62cbd114eb951197c6ef6042d3c46c4 + md5: daec4c4dc0355adcdf009dceb3b94259 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-cudart-static_linux-64 13.2.51 h376f20c_0 + - cuda-version >=13.2,<13.3.0a0 + - libgcc >=14 + - libstdcxx >=14 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 24494 + timestamp: 1773104383494 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_linux-64-13.1.80-h376f20c_0.conda + sha256: 2252e12fa9a806f685684b6395a660d845dc95bdc95e52a6bc09dba8a9eccec3 + md5: be9f8ef5a01fca1f28c8d523f8501771 + depends: + - cuda-version >=13.1,<13.2.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 1121385 + timestamp: 1764883490595 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_linux-64-13.2.51-h376f20c_0.conda + sha256: e3cc51809bd8be0a96bbe01a668f08e6e611c8fba60426c4d9f10926f3159456 + md5: aa9c7d5cd427042ffbd59c9ef6014f98 + depends: + - cuda-version >=13.2,<13.3.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 1103784 + timestamp: 1773104321614 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_linux-64-13.1.80-h376f20c_0.conda + sha256: fca2951815564c36cf5a4e0f7ed0222429d206fda3d4e1aa3d52a969a293b868 + md5: 4dc4c3a1e010e06035f01d661c1b70bd + depends: + - cuda-version >=13.1,<13.2.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 199654 + timestamp: 1764883502803 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_linux-64-13.2.51-h376f20c_0.conda + sha256: e1d943a5582c8e171c9dcf2c0c72ddd5bf0a2ac9acd6ed15898d69d618cf53c6 + md5: 51a1624c7e26d8821b5d959ee7ecb517 + depends: + - cuda-version >=13.2,<13.3.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 203460 + timestamp: 1773104333900 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-driver-dev_linux-64-13.1.80-h376f20c_0.conda + sha256: 83bf37d5a3b4a85853cded6a8b90db302b014845b7d9461ccdb84db8c2abfbc3 + md5: 1d7073905d0359ff234545494a933d59 + depends: + - cuda-version >=13.1,<13.2.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 38992 + timestamp: 1764883514338 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-driver-dev_linux-64-13.2.51-h376f20c_0.conda + sha256: 1b372b7af937a3a2fdb1cbd5356e6b365f3495d899a413ebf98369ab0c5c0c79 + md5: 970891239574056829fc1cfc208278a7 + depends: + - cuda-version >=13.2,<13.3.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 39485 + timestamp: 1773104345638 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvrtc-13.1.115-hecca717_0.conda + sha256: 9cc4f9df70c02eea5121cdb0e865207b04cd52591f57ebcac2ba44fada10eb5b + md5: df16c9049d882cdaf4f83a5b90079589 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-version >=13.1,<13.2.0a0 + - libgcc >=14 + - libstdcxx >=14 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 35339417 + timestamp: 1768272955912 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvrtc-13.2.78-hecca717_0.conda + sha256: 73fbc9d15c062c3ea60891e8183002f6b055fa6638402d17581677af0aaa20d8 + md5: 66623d882c42506fa3f1780b90841400 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-version >=13.2,<13.3.0a0 + - libgcc >=14 + - libstdcxx >=14 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 35670504 + timestamp: 1776109867257 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvrtc-dev-13.1.115-hecca717_0.conda + sha256: 2c929c592ca1909e3944edec62b77403d256156a4010bfa17fb0b948d33e54d3 + md5: 1096fce4abad7dd975ce6d9953fceb6a + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-nvrtc 13.1.115 hecca717_0 + - cuda-version >=13.1,<13.2.0a0 + - libgcc >=14 + - libstdcxx >=14 + constrains: + - cuda-nvrtc-static >=13.1.115 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 35845 + timestamp: 1768273073971 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvrtc-dev-13.2.78-hecca717_0.conda + sha256: 12505f1bbc222acf2a63da5c84e4176d2f9c18b458e2bde28939fdf326b6d292 + md5: cc313f0ea18ebc6e713a8980611431f5 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-nvrtc 13.2.78 hecca717_0 + - cuda-version >=13.2,<13.3.0a0 + - libgcc >=14 + - libstdcxx >=14 + constrains: + - cuda-nvrtc-static >=13.2.78 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 36312 + timestamp: 1776109983818 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-13.2.51-h69a702a_0.conda + sha256: d0111ba8fa12b96d38989d2016ecec0c11410c0e566d839ed54f3925591efb0b + md5: 03cd3639b8e13623c7b91b1cb0136402 + depends: + - cuda-nvvm-dev_linux-64 13.2.51.* + - cuda-nvvm-impl 13.2.51.* + - cuda-nvvm-tools 13.2.51.* + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 25494 + timestamp: 1773157399568 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_linux-64-13.2.51-ha770c72_0.conda + sha256: f00fce92bf7f1da314654f7693f571a014aaa2ba1fae3762634f3e5be254da83 + md5: 57724ac113f7435762d0c39e1b1ad341 + depends: + - cuda-version >=13.2,<13.3.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 28399 + timestamp: 1773115185916 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-impl-13.1.115-h4bc722e_0.conda + sha256: 12d84615684f1279799c023ce4ccc7c34f151bec2a90e0c8d04798a8c8af437c + md5: bf76661bc0de83a60537c4913f339fb3 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-version >=13.1,<13.2.0a0 + - libgcc >=12 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 21873791 + timestamp: 1768280315627 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-impl-13.2.51-h4bc722e_0.conda + sha256: bea7cbd2ff0f8bf07e0b90d522b4834533b4024237322c09f1b3875970c4abc9 + md5: 3c3872ff2bd6cc6368dcd4b35bb995f2 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-version >=13.2,<13.3.0a0 + - libgcc >=12 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 22202489 + timestamp: 1773115209641 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-tools-13.2.51-h4bc722e_0.conda + sha256: da5fd2dc57df2047215ff76f295685b1e1e586a46c2e46214120458cee18ee80 + md5: 2df6cd3b3d6d1365a2979285703056f9 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-version >=13.2,<13.3.0a0 + - libgcc >=12 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 25988523 + timestamp: 1773115248060 +- conda: ../../cuda_pathfinder + name: cuda-pathfinder + version: 1.3.4a0 + build: pyh4616a5c_0 + subdir: noarch + variants: + target_platform: noarch + depends: + - python >=3.10 + - python * + license: Apache-2.0 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-pathfinder-1.4.0-pyhc364b38_0.conda + sha256: edf16fdfbcce5bbb445118fd8d070dda8afe36b4b437a94f472fde153bc38151 + md5: 2d13e524da66b60e6e7d5c6585729ea8 + depends: + - python >=3.10 + - cuda-version >=12.0,<14 + - python + license: Apache-2.0 + license_family: APACHE + size: 39327 + timestamp: 1772059437166 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-13.1-h2ff5cdb_3.conda + sha256: 176ac20fdb95611af8fb2bf0d3d16fee998019b1d0f12fc9ddd5fa0df4553992 + md5: d85448460c25ee43ff2f8346bb9ad52b + constrains: + - cudatoolkit 13.1|13.1.* + - __cuda >=13 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 21511 + timestamp: 1757017115788 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-13.2-he2cc418_3.conda + sha256: 64aebe8ccb3a2c3ff446d3c0c0e88ef4fdb069a5732c03539bf3a37243c4c679 + md5: 45676e3dd76b30ec613f1f822d450eff + constrains: + - __cuda >=13 + - cudatoolkit 13.2|13.2.* + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 21908 + timestamp: 1773093709154 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cxx-compiler-1.11.0-hfcd1e18_0.conda + sha256: 3fcc97ae3e89c150401a50a4de58794ffc67b1ed0e1851468fcc376980201e25 + md5: 5da8c935dca9186673987f79cef0b2a5 + depends: + - c-compiler 1.11.0 h4d9bdce_0 + - gxx + - gxx_linux-64 14.* + license: BSD-3-Clause + license_family: BSD + size: 6635 + timestamp: 1753098722177 +- conda: https://conda.anaconda.org/conda-forge/noarch/distlib-0.4.0-pyhd8ed1ab_0.conda + sha256: 6d977f0b2fc24fee21a9554389ab83070db341af6d6f09285360b2e09ef8b26e + md5: 003b8ba0a94e2f1e117d0bd46aebc901 + depends: + - python >=3.9 + license: Apache-2.0 + license_family: APACHE + size: 275642 + timestamp: 1752823081585 +- conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.3.1-pyhd8ed1ab_0.conda + sha256: ee6cf346d017d954255bbcbdb424cddea4d14e4ed7e9813e429db1d795d01144 + md5: 8e662bd460bda79b1ea39194e3c4c9ab + depends: + - python >=3.10 + - typing_extensions >=4.6.0 + license: MIT and PSF-2.0 + size: 21333 + timestamp: 1763918099466 +- conda: https://conda.anaconda.org/conda-forge/noarch/filelock-3.25.2-pyhd8ed1ab_0.conda + sha256: dddea9ec53d5e179de82c24569d41198f98db93314f0adae6b15195085d5567f + md5: f58064cec97b12a7136ebb8a6f8a129b + depends: + - python >=3.10 + license: Unlicense + size: 25845 + timestamp: 1773314012590 +- conda: https://conda.anaconda.org/conda-forge/linux-64/gcc-14.3.0-h0dff253_18.conda + sha256: 9b34b57b06b485e33a40d430f71ac88c8f381673592507cf7161c50ff0832772 + md5: 52d6457abc42e320787ada5f9033fa99 + depends: + - conda-gcc-specs + - gcc_impl_linux-64 14.3.0 hbdf3cc3_18 + license: BSD-3-Clause + license_family: BSD + size: 29506 + timestamp: 1771378321585 +- conda: https://conda.anaconda.org/conda-forge/linux-64/gcc_impl_linux-64-14.3.0-hbdf3cc3_18.conda + sha256: 3b31a273b806c6851e16e9cf63ef87cae28d19be0df148433f3948e7da795592 + md5: 30bb690150536f622873758b0e8d6712 + depends: + - binutils_impl_linux-64 >=2.45 + - libgcc >=14.3.0 + - libgcc-devel_linux-64 14.3.0 hf649bbc_118 + - libgomp >=14.3.0 + - libsanitizer 14.3.0 h8f1669f_18 + - libstdcxx >=14.3.0 + - libstdcxx-devel_linux-64 14.3.0 h9f08a49_118 + - sysroot_linux-64 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 76302378 + timestamp: 1771378056505 +- conda: https://conda.anaconda.org/conda-forge/linux-64/gcc_linux-64-14.3.0-h298d278_21.conda + sha256: 27ad0cd10dccffca74e20fb38c9f8643ff8fce56eee260bf89fa257d5ab0c90a + md5: 1403ed5fe091bd7442e4e8a229d14030 + depends: + - gcc_impl_linux-64 14.3.0.* + - binutils_linux-64 + - sysroot_linux-64 + license: BSD-3-Clause + license_family: BSD + size: 28946 + timestamp: 1770908213807 +- conda: https://conda.anaconda.org/conda-forge/linux-64/gxx-14.3.0-h76987e4_18.conda + sha256: 1b490c9be9669f9c559db7b2a1f7d8b973c58ca0c6f21a5d2ba3f0ab2da63362 + md5: 19189121d644d4ef75fed05383bc75f5 + depends: + - gcc 14.3.0 h0dff253_18 + - gxx_impl_linux-64 14.3.0 h2185e75_18 + license: BSD-3-Clause + license_family: BSD + size: 28883 + timestamp: 1771378355605 +- conda: https://conda.anaconda.org/conda-forge/linux-64/gxx_impl_linux-64-14.3.0-h2185e75_18.conda + sha256: 38ffca57cc9c264d461ac2ce9464a9d605e0f606d92d831de9075cb0d95fc68a + md5: 6514b3a10e84b6a849e1b15d3753eb22 + depends: + - gcc_impl_linux-64 14.3.0 hbdf3cc3_18 + - libstdcxx-devel_linux-64 14.3.0 h9f08a49_118 + - sysroot_linux-64 + - tzdata + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 14566100 + timestamp: 1771378271421 +- conda: https://conda.anaconda.org/conda-forge/linux-64/gxx_linux-64-14.3.0-he467f4b_21.conda + sha256: 1e07c197e0779fa9105e59cd55a835ded96bfde59eb169439736a89b27b48e5d + md5: 7b51f4ff82eeb1f386bfee20a7bed3ed + depends: + - gxx_impl_linux-64 14.3.0.* + - gcc_linux-64 ==14.3.0 h298d278_21 + - binutils_linux-64 + - sysroot_linux-64 + license: BSD-3-Clause + license_family: BSD + size: 27503 + timestamp: 1770908213813 +- conda: https://conda.anaconda.org/conda-forge/linux-64/icu-78.2-h33c6efd_0.conda + sha256: 142a722072fa96cf16ff98eaaf641f54ab84744af81754c292cb81e0881c0329 + md5: 186a18e3ba246eccfc7cff00cd19a870 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + license: MIT + license_family: MIT + size: 12728445 + timestamp: 1767969922681 +- conda: https://conda.anaconda.org/conda-forge/noarch/identify-2.6.17-pyhd8ed1ab_0.conda + sha256: 7cd5eccdb171a0adbf83a1ad8fc4e17822f4fc3f5518da9040de64e88bc07343 + md5: 5b7ae2ec4e0750e094f804a6cf1b2a37 + depends: + - python >=3.10 + - ukkonen + license: MIT + license_family: MIT + size: 79520 + timestamp: 1772402363021 +- conda: https://conda.anaconda.org/conda-forge/noarch/importlib-metadata-8.7.0-pyhe01879c_1.conda + sha256: c18ab120a0613ada4391b15981d86ff777b5690ca461ea7e9e49531e8f374745 + md5: 63ccfdc3a3ce25b027b8767eb722fca8 + depends: + - python >=3.9 + - zipp >=3.20 + - python + license: Apache-2.0 + license_family: APACHE + size: 34641 + timestamp: 1747934053147 +- conda: https://conda.anaconda.org/conda-forge/noarch/iniconfig-2.3.0-pyhd8ed1ab_0.conda + sha256: e1a9e3b1c8fe62dc3932a616c284b5d8cbe3124bbfbedcf4ce5c828cb166ee19 + md5: 9614359868482abba1bd15ce465e3c42 + depends: + - python >=3.10 + license: MIT + license_family: MIT + size: 13387 + timestamp: 1760831448842 +- conda: https://conda.anaconda.org/conda-forge/noarch/kernel-headers_linux-64-4.18.0-he073ed8_9.conda + sha256: 41557eeadf641de6aeae49486cef30d02a6912d8da98585d687894afd65b356a + md5: 86d9cba083cd041bfbf242a01a7a1999 + constrains: + - sysroot_linux-64 ==2.28 + license: LGPL-2.0-or-later AND LGPL-2.0-or-later WITH exceptions AND GPL-2.0-or-later + license_family: GPL + size: 1278712 + timestamp: 1765578681495 +- conda: https://conda.anaconda.org/conda-forge/linux-64/keyutils-1.6.3-hb9d3cd8_0.conda + sha256: 0960d06048a7185d3542d850986d807c6e37ca2e644342dd0c72feefcf26c2a4 + md5: b38117a3c920364aff79f870c984b4a3 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + license: LGPL-2.1-or-later + size: 134088 + timestamp: 1754905959823 +- conda: https://conda.anaconda.org/conda-forge/linux-64/krb5-1.22.2-ha1258a1_0.conda + sha256: 3e307628ca3527448dd1cb14ad7bb9d04d1d28c7d4c5f97ba196ae984571dd25 + md5: fb53fb07ce46a575c5d004bbc96032c2 + depends: + - __glibc >=2.17,<3.0.a0 + - keyutils >=1.6.3,<2.0a0 + - libedit >=3.1.20250104,<3.2.0a0 + - libedit >=3.1.20250104,<4.0a0 + - libgcc >=14 + - libstdcxx >=14 + - openssl >=3.5.5,<4.0a0 + license: MIT + license_family: MIT + size: 1386730 + timestamp: 1769769569681 +- conda: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.45.1-default_hbd61a6d_101.conda + sha256: 565941ac1f8b0d2f2e8f02827cbca648f4d18cd461afc31f15604cd291b5c5f3 + md5: 12bd9a3f089ee6c9266a37dab82afabd + depends: + - __glibc >=2.17,<3.0.a0 + - zstd >=1.5.7,<1.6.0a0 + constrains: + - binutils_impl_linux-64 2.45.1 + license: GPL-3.0-only + license_family: GPL + size: 725507 + timestamp: 1770267139900 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libblas-3.11.0-5_h4a7cf45_openblas.conda + build_number: 5 + sha256: 18c72545080b86739352482ba14ba2c4815e19e26a7417ca21a95b76ec8da24c + md5: c160954f7418d7b6e87eaf05a8913fa9 + depends: + - libopenblas >=0.3.30,<0.3.31.0a0 + - libopenblas >=0.3.30,<1.0a0 + constrains: + - mkl <2026 + - liblapack 3.11.0 5*_openblas + - libcblas 3.11.0 5*_openblas + - blas 2.305 openblas + - liblapacke 3.11.0 5*_openblas + license: BSD-3-Clause + license_family: BSD + size: 18213 + timestamp: 1765818813880 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libcap-2.77-h3ff7636_0.conda + sha256: 9517cce5193144af0fcbf19b7bd67db0a329c2cc2618f28ffecaa921a1cbe9d3 + md5: 09c264d40c67b82b49a3f3b89037bd2e + depends: + - __glibc >=2.17,<3.0.a0 + - attr >=2.5.2,<2.6.0a0 + - libgcc >=14 + license: BSD-3-Clause + license_family: BSD + size: 121429 + timestamp: 1762349484074 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libcblas-3.11.0-5_h0358290_openblas.conda + build_number: 5 + sha256: 0cbdcc67901e02dc17f1d19e1f9170610bd828100dc207de4d5b6b8ad1ae7ad8 + md5: 6636a2b6f1a87572df2970d3ebc87cc0 + depends: + - libblas 3.11.0 5_h4a7cf45_openblas + constrains: + - liblapacke 3.11.0 5*_openblas + - blas 2.305 openblas + - liblapack 3.11.0 5*_openblas + license: BSD-3-Clause + license_family: BSD + size: 18194 + timestamp: 1765818837135 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libcufile-1.16.1.26-hd07211c_0.conda + sha256: 8c44b5bf947afad827df0df49fe7483cf1b2916694081b2db4fecdfd6a2bacd1 + md5: 48418c48dac04671fa46cb446122b8a5 + depends: + - __glibc >=2.28,<3.0.a0 + - cuda-version >=13.1,<13.2.0a0 + - libgcc >=14 + - libstdcxx >=14 + - rdma-core >=60.0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 990938 + timestamp: 1768273732081 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libcufile-1.17.1.22-h85c024f_0.conda + sha256: a24ad0ca488aa3e237049cd5b5c6d7fe3d2d4330682ed329203064e332ea1d74 + md5: 056a67706108efd1f9c24682ba8d3685 + depends: + - __glibc >=2.28,<3.0.a0 + - cuda-version >=13.2,<13.3.0a0 + - libgcc >=14 + - libstdcxx >=14 + - rdma-core >=61.0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 1082447 + timestamp: 1776110053053 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libcurl-8.18.0-hcf29cc6_1.conda + sha256: c84e8dccb65ad5149c0121e4b54bdc47fa39303fd5f4979b8c44bb51b39a369b + md5: 1707cdd636af2ff697b53186572c9f77 + depends: + - __glibc >=2.17,<3.0.a0 + - krb5 >=1.22.2,<1.23.0a0 + - libgcc >=14 + - libnghttp2 >=1.67.0,<2.0a0 + - libssh2 >=1.11.1,<2.0a0 + - libzlib >=1.3.1,<2.0a0 + - openssl >=3.5.5,<4.0a0 + - zstd >=1.5.7,<1.6.0a0 + license: curl + license_family: MIT + size: 463621 + timestamp: 1770892808818 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libedit-3.1.20250104-pl5321h7949ede_0.conda + sha256: d789471216e7aba3c184cd054ed61ce3f6dac6f87a50ec69291b9297f8c18724 + md5: c277e0a4d549b03ac1e9d6cbbe3d017b + depends: + - ncurses + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - ncurses >=6.5,<7.0a0 + license: BSD-2-Clause + license_family: BSD + size: 134676 + timestamp: 1738479519902 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libev-4.33-hd590300_2.conda + sha256: 1cd6048169fa0395af74ed5d8f1716e22c19a81a8a36f934c110ca3ad4dd27b4 + md5: 172bf1cd1ff8629f2b1179945ed45055 + depends: + - libgcc-ng >=12 + license: BSD-2-Clause + license_family: BSD + size: 112766 + timestamp: 1702146165126 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.7.4-hecca717_0.conda + sha256: d78f1d3bea8c031d2f032b760f36676d87929b18146351c4464c66b0869df3f5 + md5: e7f7ce06ec24cfcfb9e36d28cf82ba57 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + constrains: + - expat 2.7.4.* + license: MIT + license_family: MIT + size: 76798 + timestamp: 1771259418166 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libffi-3.5.2-h3435931_0.conda + sha256: 31f19b6a88ce40ebc0d5a992c131f57d919f73c0b92cd1617a5bec83f6e961e6 + md5: a360c33a5abe61c07959e449fa1453eb + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: MIT + license_family: MIT + size: 58592 + timestamp: 1769456073053 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-15.2.0-he0feb66_18.conda + sha256: faf7d2017b4d718951e3a59d081eb09759152f93038479b768e3d612688f83f5 + md5: 0aa00f03f9e39fb9876085dee11a85d4 + depends: + - __glibc >=2.17,<3.0.a0 + - _openmp_mutex >=4.5 + constrains: + - libgcc-ng ==15.2.0=*_18 + - libgomp 15.2.0 he0feb66_18 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 1041788 + timestamp: 1771378212382 +- conda: https://conda.anaconda.org/conda-forge/noarch/libgcc-devel_linux-64-14.3.0-hf649bbc_118.conda + sha256: 1abc6a81ee66e8ac9ac09a26e2d6ad7bba23f0a0cc3a6118654f036f9c0e1854 + md5: 06901733131833f5edd68cf3d9679798 + depends: + - __unix + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 3084533 + timestamp: 1771377786730 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-15.2.0-h69a702a_18.conda + sha256: e318a711400f536c81123e753d4c797a821021fb38970cebfb3f454126016893 + md5: d5e96b1ed75ca01906b3d2469b4ce493 + depends: + - libgcc 15.2.0 he0feb66_18 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 27526 + timestamp: 1771378224552 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran-15.2.0-h69a702a_18.conda + sha256: d2c9fad338fd85e4487424865da8e74006ab2e2475bd788f624d7a39b2a72aee + md5: 9063115da5bc35fdc3e1002e69b9ef6e + depends: + - libgfortran5 15.2.0 h68bc16d_18 + constrains: + - libgfortran-ng ==15.2.0=*_18 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 27523 + timestamp: 1771378269450 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-15.2.0-h68bc16d_18.conda + sha256: 539b57cf50ec85509a94ba9949b7e30717839e4d694bc94f30d41c9d34de2d12 + md5: 646855f357199a12f02a87382d429b75 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=15.2.0 + constrains: + - libgfortran 15.2.0 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 2482475 + timestamp: 1771378241063 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libgomp-15.2.0-he0feb66_18.conda + sha256: 21337ab58e5e0649d869ab168d4e609b033509de22521de1bfed0c031bfc5110 + md5: 239c5e9546c38a1e884d69effcf4c882 + depends: + - __glibc >=2.17,<3.0.a0 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 603262 + timestamp: 1771378117851 +- conda: https://conda.anaconda.org/conda-forge/linux-64/liblapack-3.11.0-5_h47877c9_openblas.conda + build_number: 5 + sha256: c723b6599fcd4c6c75dee728359ef418307280fa3e2ee376e14e85e5bbdda053 + md5: b38076eb5c8e40d0106beda6f95d7609 + depends: + - libblas 3.11.0 5_h4a7cf45_openblas + constrains: + - blas 2.305 openblas + - liblapacke 3.11.0 5*_openblas + - libcblas 3.11.0 5*_openblas + license: BSD-3-Clause + license_family: BSD + size: 18200 + timestamp: 1765818857876 +- conda: https://conda.anaconda.org/conda-forge/linux-64/liblzma-5.8.2-hb03c661_0.conda + sha256: 755c55ebab181d678c12e49cced893598f2bab22d582fbbf4d8b83c18be207eb + md5: c7c83eecbb72d88b940c249af56c8b17 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + constrains: + - xz 5.8.2.* + license: 0BSD + size: 113207 + timestamp: 1768752626120 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libmpdec-4.0.0-hb03c661_1.conda + sha256: fe171ed5cf5959993d43ff72de7596e8ac2853e9021dec0344e583734f1e0843 + md5: 2c21e66f50753a083cbe6b80f38268fa + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: BSD-2-Clause + license_family: BSD + size: 92400 + timestamp: 1769482286018 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libnghttp2-1.67.0-had1ee68_0.conda + sha256: a4a7dab8db4dc81c736e9a9b42bdfd97b087816e029e221380511960ac46c690 + md5: b499ce4b026493a13774bcf0f4c33849 + depends: + - __glibc >=2.17,<3.0.a0 + - c-ares >=1.34.5,<2.0a0 + - libev >=4.33,<4.34.0a0 + - libev >=4.33,<5.0a0 + - libgcc >=14 + - libstdcxx >=14 + - libzlib >=1.3.1,<2.0a0 + - openssl >=3.5.2,<4.0a0 + license: MIT + license_family: MIT + size: 666600 + timestamp: 1756834976695 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libnl-3.11.0-hb9d3cd8_0.conda + sha256: ba7c5d294e3d80f08ac5a39564217702d1a752e352e486210faff794ac5001b4 + md5: db63358239cbe1ff86242406d440e44a + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + license: LGPL-2.1-or-later + license_family: LGPL + size: 741323 + timestamp: 1731846827427 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libnvfatbin-13.2.51-hecca717_0.conda + sha256: 66b7bbe40d259e4927b9c264569afd49d0e31a3813c585beea63f3415577f1b3 + md5: 7e6534bce7252c84efdedae1fae2148e + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-version >=13.2,<13.3.0a0 + - libgcc >=14 + - libstdcxx >=14 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 471076 + timestamp: 1773100181931 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libnvjitlink-13.1.115-hecca717_1.conda + sha256: 6b5300bf9952da4bfdbfb45c13b042d786a0daffb1bd2fa45ea9ad971703fe96 + md5: 851acc1af02d31c732b931b9ffddc2d9 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-version >=13,<13.2.0a0 + - libgcc >=14 + - libstdcxx >=14 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 31328660 + timestamp: 1771443943495 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libnvjitlink-13.2.51-hecca717_0.conda + sha256: 2ca45a2c9e6cc307cea3c8a1bf27bceb745fa5e1150d7b768b63a781eeaee7a2 + md5: 20a82402e6851e5d4e0b13ee1083d370 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-version >=13,<13.3.0a0 + - libgcc >=14 + - libstdcxx >=14 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 31691081 + timestamp: 1773100788615 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libopenblas-0.3.30-pthreads_h94d23a6_4.conda + sha256: 199d79c237afb0d4780ccd2fbf829cea80743df60df4705202558675e07dd2c5 + md5: be43915efc66345cccb3c310b6ed0374 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libgfortran + - libgfortran5 >=14.3.0 + constrains: + - openblas >=0.3.30,<0.3.31.0a0 + license: BSD-3-Clause + license_family: BSD + size: 5927939 + timestamp: 1763114673331 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libsanitizer-14.3.0-h8f1669f_18.conda + sha256: e03ed186eefb46d7800224ad34bad1268c9d19ecb8f621380a50601c6221a4a7 + md5: ad3a0e2dc4cce549b2860e2ef0e6d75b + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14.3.0 + - libstdcxx >=14.3.0 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 7949259 + timestamp: 1771377982207 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.51.2-hf4e2dac_0.conda + sha256: 04596fcee262a870e4b7c9807224680ff48d4d0cc0dac076a602503d3dc6d217 + md5: da5be73701eecd0e8454423fd6ffcf30 + depends: + - __glibc >=2.17,<3.0.a0 + - icu >=78.2,<79.0a0 + - libgcc >=14 + - libzlib >=1.3.1,<2.0a0 + license: blessing + size: 942808 + timestamp: 1768147973361 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libssh2-1.11.1-hcf80075_0.conda + sha256: fa39bfd69228a13e553bd24601332b7cfeb30ca11a3ca50bb028108fe90a7661 + md5: eecce068c7e4eddeb169591baac20ac4 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - libzlib >=1.3.1,<2.0a0 + - openssl >=3.5.0,<4.0a0 + license: BSD-3-Clause + license_family: BSD + size: 304790 + timestamp: 1745608545575 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-15.2.0-h934c35e_18.conda + sha256: 78668020064fdaa27e9ab65cd2997e2c837b564ab26ce3bf0e58a2ce1a525c6e + md5: 1b08cd684f34175e4514474793d44bcb + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc 15.2.0 he0feb66_18 + constrains: + - libstdcxx-ng ==15.2.0=*_18 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 5852330 + timestamp: 1771378262446 +- conda: https://conda.anaconda.org/conda-forge/noarch/libstdcxx-devel_linux-64-14.3.0-h9f08a49_118.conda + sha256: b1c3824769b92a1486bf3e2cc5f13304d83ae613ea061b7bc47bb6080d6dfdba + md5: 865a399bce236119301ebd1532fced8d + depends: + - __unix + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 20171098 + timestamp: 1771377827750 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libsystemd0-257.10-hd0affe5_4.conda + sha256: f0356bb344a684e7616fc84675cfca6401140320594e8686be30e8ac7547aed2 + md5: 1d4c18d75c51ed9d00092a891a547a7d + depends: + - __glibc >=2.17,<3.0.a0 + - libcap >=2.77,<2.78.0a0 + - libgcc >=14 + license: LGPL-2.1-or-later + size: 491953 + timestamp: 1770738638119 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libudev1-257.10-hd0affe5_4.conda + sha256: ed4d2c01fbeb1330f112f7e399408634db277d3dfb2dec1d0395f56feaa24351 + md5: 6c74fba677b61a0842cbf0f63eee683b + depends: + - __glibc >=2.17,<3.0.a0 + - libcap >=2.77,<2.78.0a0 + - libgcc >=14 + license: LGPL-2.1-or-later + size: 144654 + timestamp: 1770738650966 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.41.3-h5347b49_0.conda + sha256: 1a7539cfa7df00714e8943e18de0b06cceef6778e420a5ee3a2a145773758aee + md5: db409b7c1720428638e7c0d509d3e1b5 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: BSD-3-Clause + license_family: BSD + size: 40311 + timestamp: 1766271528534 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libuv-1.51.0-hb03c661_1.conda + sha256: c180f4124a889ac343fc59d15558e93667d894a966ec6fdb61da1604481be26b + md5: 0f03292cc56bf91a077a134ea8747118 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: MIT + license_family: MIT + size: 895108 + timestamp: 1753948278280 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.1-hb9d3cd8_2.conda + sha256: d4bfe88d7cb447768e31650f06257995601f89076080e76df55e3112d4e47dc4 + md5: edb0dca6bc32e4f4789199455a1dbeb8 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + constrains: + - zlib 1.3.1 *_2 + license: Zlib + license_family: Other + size: 60963 + timestamp: 1727963148474 +- conda: https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.5-h2d0b736_3.conda + sha256: 3fde293232fa3fca98635e1167de6b7c7fda83caf24b9d6c91ec9eefb4f4d586 + md5: 47e340acb35de30501a76c7c799c41d7 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + license: X11 AND BSD-3-Clause + size: 891641 + timestamp: 1738195959188 +- conda: https://conda.anaconda.org/conda-forge/linux-64/ninja-1.13.2-h171cf75_0.conda + sha256: 6f7d59dbec0a7b00bf5d103a4306e8886678b796ff2151b62452d4582b2a53fb + md5: b518e9e92493721281a60fa975bddc65 + depends: + - libstdcxx >=14 + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + license: Apache-2.0 + license_family: APACHE + size: 186323 + timestamp: 1763688260928 +- conda: https://conda.anaconda.org/conda-forge/noarch/nodeenv-1.10.0-pyhd8ed1ab_0.conda + sha256: 4fa40e3e13fc6ea0a93f67dfc76c96190afd7ea4ffc1bac2612d954b42cdc3ee + md5: eb52d14a901e23c39e9e7b4a1a5c015f + depends: + - python >=3.10 + - setuptools + license: BSD-3-Clause + license_family: BSD + size: 40866 + timestamp: 1766261270149 +- conda: https://conda.anaconda.org/conda-forge/linux-64/numpy-2.4.2-py314h2b28147_1.conda + sha256: 1d8377c8001c15ed12c2713b723213474b435706ab9d34ede69795d64af9e94d + md5: 4ea6b620fdf24a1a0bc4f1c7134dfafb + depends: + - python + - libstdcxx >=14 + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + - libcblas >=3.9.0,<4.0a0 + - python_abi 3.14.* *_cp314 + - libblas >=3.9.0,<4.0a0 + - liblapack >=3.9.0,<4.0a0 + constrains: + - numpy-base <0a0 + license: BSD-3-Clause + license_family: BSD + size: 8926994 + timestamp: 1770098474394 +- conda: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.6.1-h35e630c_1.conda + sha256: 44c877f8af015332a5d12f5ff0fb20ca32f896526a7d0cdb30c769df1144fb5c + md5: f61eb8cd60ff9057122a3d338b99c00f + depends: + - __glibc >=2.17,<3.0.a0 + - ca-certificates + - libgcc >=14 + license: Apache-2.0 + license_family: Apache + size: 3164551 + timestamp: 1769555830639 +- conda: https://conda.anaconda.org/conda-forge/noarch/packaging-26.0-pyhcf101f3_0.conda + sha256: c1fc0f953048f743385d31c468b4a678b3ad20caffdeaa94bed85ba63049fd58 + md5: b76541e68fea4d511b1ac46a28dcd2c6 + depends: + - python >=3.8 + - python + license: Apache-2.0 + license_family: APACHE + size: 72010 + timestamp: 1769093650580 +- conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.9.4-pyhcf101f3_0.conda + sha256: 0289f0a38337ee201d984f8f31f11f6ef076cfbbfd0ab9181d12d9d1d099bf46 + md5: 82c1787f2a65c0155ef9652466ee98d6 + depends: + - python >=3.10 + - python + license: MIT + license_family: MIT + size: 25646 + timestamp: 1773199142345 +- conda: https://conda.anaconda.org/conda-forge/noarch/pluggy-1.6.0-pyhf9edf01_1.conda + sha256: e14aafa63efa0528ca99ba568eaf506eb55a0371d12e6250aaaa61718d2eb62e + md5: d7585b6550ad04c8c5e21097ada2888e + depends: + - python >=3.9 + - python + license: MIT + license_family: MIT + size: 25877 + timestamp: 1764896838868 +- conda: https://conda.anaconda.org/conda-forge/noarch/pre-commit-4.5.1-pyha770c72_0.conda + sha256: 5b81b7516d4baf43d0c185896b245fa7384b25dc5615e7baa504b7fa4e07b706 + md5: 7f3ac694319c7eaf81a0325d6405e974 + depends: + - cfgv >=2.0.0 + - identify >=1.0.0 + - nodeenv >=0.11.1 + - python >=3.10 + - pyyaml >=5.1 + - virtualenv >=20.10.0 + license: MIT + license_family: MIT + size: 200827 + timestamp: 1765937577534 +- conda: https://conda.anaconda.org/conda-forge/noarch/py-cpuinfo-9.0.0-pyhd8ed1ab_1.conda + sha256: 6d8f03c13d085a569fde931892cded813474acbef2e03381a1a87f420c7da035 + md5: 46830ee16925d5ed250850503b5dc3a8 + depends: + - python >=3.9 + license: MIT + license_family: MIT + size: 25766 + timestamp: 1733236452235 +- conda: https://conda.anaconda.org/conda-forge/noarch/pycparser-2.22-pyh29332c3_1.conda + sha256: 79db7928d13fab2d892592223d7570f5061c192f27b9febd1a418427b719acc6 + md5: 12c566707c80111f9799308d9e265aef + depends: + - python >=3.9 + - python + license: BSD-3-Clause + license_family: BSD + size: 110100 + timestamp: 1733195786147 +- conda: https://conda.anaconda.org/conda-forge/noarch/pygments-2.19.2-pyhd8ed1ab_0.conda + sha256: 5577623b9f6685ece2697c6eb7511b4c9ac5fb607c9babc2646c811b428fd46a + md5: 6b6ece66ebcae2d5f326c77ef2c5a066 + depends: + - python >=3.9 + license: BSD-2-Clause + license_family: BSD + size: 889287 + timestamp: 1750615908735 +- conda: https://conda.anaconda.org/conda-forge/linux-64/pyperf-2.9.0-py314hdafbbf9_0.conda + sha256: 438c41b42530874928733299ca815f5994f36996c86024f3f37ca220ed910a07 + md5: ed166875b3876d5d7e6e39d2e8d1c6e3 + depends: + - python >=3.14,<3.15.0a0 + - python_abi 3.14.* *_cp314 + - six + license: MIT + license_family: MIT + size: 273897 + timestamp: 1765980972868 +- conda: https://conda.anaconda.org/conda-forge/noarch/pytest-9.0.2-pyhcf101f3_0.conda + sha256: 9e749fb465a8bedf0184d8b8996992a38de351f7c64e967031944978de03a520 + md5: 2b694bad8a50dc2f712f5368de866480 + depends: + - pygments >=2.7.2 + - python >=3.10 + - iniconfig >=1.0.1 + - packaging >=22 + - pluggy >=1.5,<2 + - tomli >=1 + - colorama >=0.4 + - exceptiongroup >=1 + - python + constrains: + - pytest-faulthandler >=2 + license: MIT + license_family: MIT + size: 299581 + timestamp: 1765062031645 +- conda: https://conda.anaconda.org/conda-forge/noarch/pytest-benchmark-5.2.3-pyhd8ed1ab_0.conda + sha256: 2f2229415a6e5387c1faaedf442ea8c07471cb2bf5ad1007b9cfb83ea85ca29a + md5: 0e7294ed4af8b833fcd2c101d647c3da + depends: + - py-cpuinfo + - pytest >=8.1 + - python >=3.10 + license: BSD-2-Clause + license_family: BSD + size: 43976 + timestamp: 1762716480208 +- conda: https://conda.anaconda.org/conda-forge/linux-64/python-3.14.3-h32b2ec7_101_cp314.conda + build_number: 101 + sha256: cb0628c5f1732f889f53a877484da98f5a0e0f47326622671396fb4f2b0cd6bd + md5: c014ad06e60441661737121d3eae8a60 + depends: + - __glibc >=2.17,<3.0.a0 + - bzip2 >=1.0.8,<2.0a0 + - ld_impl_linux-64 >=2.36.1 + - libexpat >=2.7.3,<3.0a0 + - libffi >=3.5.2,<3.6.0a0 + - libgcc >=14 + - liblzma >=5.8.2,<6.0a0 + - libmpdec >=4.0.0,<5.0a0 + - libsqlite >=3.51.2,<4.0a0 + - libuuid >=2.41.3,<3.0a0 + - libzlib >=1.3.1,<2.0a0 + - ncurses >=6.5,<7.0a0 + - openssl >=3.5.5,<4.0a0 + - python_abi 3.14.* *_cp314 + - readline >=8.3,<9.0a0 + - tk >=8.6.13,<8.7.0a0 + - tzdata + - zstd >=1.5.7,<1.6.0a0 + license: Python-2.0 + size: 36702440 + timestamp: 1770675584356 + python_site_packages_path: lib/python3.14/site-packages +- conda: https://conda.anaconda.org/conda-forge/noarch/python-discovery-1.1.3-pyhcf101f3_0.conda + sha256: 36429765f626c345710fbae14aeeda676c1745427667eb480bb855b7089affba + md5: 69fc0a99fc21b26b81026c72e00f83df + depends: + - python >=3.10 + - filelock >=3.15.4 + - platformdirs <5,>=4.3.6 + - python + license: MIT + license_family: MIT + size: 33996 + timestamp: 1773161039118 +- conda: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.14-8_cp314.conda + build_number: 8 + sha256: ad6d2e9ac39751cc0529dd1566a26751a0bf2542adb0c232533d32e176e21db5 + md5: 0539938c55b6b1a59b560e843ad864a4 + constrains: + - python 3.14.* *_cp314 + license: BSD-3-Clause + license_family: BSD + size: 6989 + timestamp: 1752805904792 +- conda: https://conda.anaconda.org/conda-forge/linux-64/pyyaml-6.0.3-py314h67df5f8_1.conda + sha256: b318fb070c7a1f89980ef124b80a0b5ccf3928143708a85e0053cde0169c699d + md5: 2035f68f96be30dc60a5dfd7452c7941 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - python >=3.14,<3.15.0a0 + - python_abi 3.14.* *_cp314 + - yaml >=0.2.5,<0.3.0a0 + license: MIT + license_family: MIT + size: 202391 + timestamp: 1770223462836 +- conda: https://conda.anaconda.org/conda-forge/linux-64/rdma-core-61.0-h192683f_0.conda + sha256: 8e0b7962cf8bec9a016cd91a6c6dc1f9ebc8e7e316b1d572f7b9047d0de54717 + md5: d487d93d170e332ab39803e05912a762 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libnl >=3.11.0,<4.0a0 + - libstdcxx >=14 + - libsystemd0 >=257.10 + - libudev1 >=257.10 + license: Linux-OpenIB + license_family: BSD + size: 1268666 + timestamp: 1769154883613 +- conda: https://conda.anaconda.org/conda-forge/linux-64/readline-8.3-h853b02a_0.conda + sha256: 12ffde5a6f958e285aa22c191ca01bbd3d6e710aa852e00618fa6ddc59149002 + md5: d7d95fc8287ea7bf33e0e7116d2b95ec + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - ncurses >=6.5,<7.0a0 + license: GPL-3.0-only + license_family: GPL + size: 345073 + timestamp: 1765813471974 +- conda: https://conda.anaconda.org/conda-forge/linux-64/rhash-1.4.6-hb9d3cd8_1.conda + sha256: d5c73079c1dd2c2a313c3bfd81c73dbd066b7eb08d213778c8bff520091ae894 + md5: c1c9b02933fdb2cfb791d936c20e887e + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + license: MIT + license_family: MIT + size: 193775 + timestamp: 1748644872902 +- conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0.conda + sha256: 82088a6e4daa33329a30bc26dc19a98c7c1d3f05c0f73ce9845d4eab4924e9e1 + md5: 8e194e7b992f99a5015edbd4ebd38efd + depends: + - python >=3.10 + license: MIT + license_family: MIT + size: 639697 + timestamp: 1773074868565 +- conda: https://conda.anaconda.org/conda-forge/noarch/six-1.17.0-pyhe01879c_1.conda + sha256: 458227f759d5e3fcec5d9b7acce54e10c9e1f4f4b7ec978f3bfd54ce4ee9853d + md5: 3339e3b65d58accf4ca4fb8748ab16b3 + depends: + - python >=3.9 + - python + license: MIT + license_family: MIT + size: 18455 + timestamp: 1753199211006 +- conda: https://conda.anaconda.org/conda-forge/noarch/sysroot_linux-64-2.28-h4ee821c_9.conda + sha256: c47299fe37aebb0fcf674b3be588e67e4afb86225be4b0d452c7eb75c086b851 + md5: 13dc3adbc692664cd3beabd216434749 + depends: + - __glibc >=2.28 + - kernel-headers_linux-64 4.18.0 he073ed8_9 + - tzdata + license: LGPL-2.0-or-later AND LGPL-2.0-or-later WITH exceptions AND GPL-2.0-or-later + license_family: GPL + size: 24008591 + timestamp: 1765578833462 +- conda: https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_h366c992_103.conda + sha256: cafeec44494f842ffeca27e9c8b0c27ed714f93ac77ddadc6aaf726b5554ebac + md5: cffd3bdd58090148f4cfcd831f4b26ab + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libzlib >=1.3.1,<2.0a0 + constrains: + - xorg-libx11 >=1.8.12,<2.0a0 + license: TCL + license_family: BSD + size: 3301196 + timestamp: 1769460227866 +- conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.4.0-pyhcf101f3_0.conda + sha256: 62940c563de45790ba0f076b9f2085a842a65662268b02dd136a8e9b1eaf47a8 + md5: 72e780e9aa2d0a3295f59b1874e3768b + depends: + - python >=3.10 + - python + license: MIT + license_family: MIT + size: 21453 + timestamp: 1768146676791 +- conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.15.0-pyhcf101f3_0.conda + sha256: 032271135bca55aeb156cee361c81350c6f3fb203f57d024d7e5a1fc9ef18731 + md5: 0caa1af407ecff61170c9437a808404d + depends: + - python >=3.10 + - python + license: PSF-2.0 + license_family: PSF + size: 51692 + timestamp: 1756220668932 +- conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1.conda + sha256: 1d30098909076af33a35017eed6f2953af1c769e273a0626a04722ac4acaba3c + md5: ad659d0a2b3e47e38d829aa8cad2d610 + license: LicenseRef-Public-Domain + size: 119135 + timestamp: 1767016325805 +- conda: https://conda.anaconda.org/conda-forge/linux-64/ukkonen-1.1.0-py314h9891dd4_0.conda + sha256: c84034056dc938c853e4f61e72e5bd37e2ec91927a661fb9762f678cbea52d43 + md5: 5d3c008e54c7f49592fca9c32896a76f + depends: + - __glibc >=2.17,<3.0.a0 + - cffi + - libgcc >=14 + - libstdcxx >=14 + - python >=3.14,<3.15.0a0 + - python_abi 3.14.* *_cp314 + license: MIT + license_family: MIT + size: 15004 + timestamp: 1769438727085 +- conda: https://conda.anaconda.org/conda-forge/noarch/virtualenv-21.2.0-pyhcf101f3_0.conda + sha256: b83246d145ba0e6814d2ed0b616293e56924e6c7d6649101f5a4f97f9e757ed1 + md5: 704c22301912f7e37d0a92b2e7d5942d + depends: + - python >=3.10 + - distlib >=0.3.7,<1 + - filelock <4,>=3.24.2 + - importlib-metadata >=6.6 + - platformdirs >=3.9.1,<5 + - python-discovery >=1 + - typing_extensions >=4.13.2 + - python + license: MIT + license_family: MIT + size: 4647775 + timestamp: 1773133660203 +- conda: https://conda.anaconda.org/conda-forge/linux-64/yaml-0.2.5-h280c20c_3.conda + sha256: 6d9ea2f731e284e9316d95fa61869fe7bbba33df7929f82693c121022810f4ad + md5: a77f85f77be52ff59391544bfe73390a + depends: + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + license: MIT + license_family: MIT + size: 85189 + timestamp: 1753484064210 +- conda: https://conda.anaconda.org/conda-forge/noarch/zipp-3.23.0-pyhcf101f3_1.conda + sha256: b4533f7d9efc976511a73ef7d4a2473406d7f4c750884be8e8620b0ce70f4dae + md5: 30cd29cb87d819caead4d55184c1d115 + depends: + - python >=3.10 + - python + license: MIT + license_family: MIT + size: 24194 + timestamp: 1764460141901 +- conda: https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_6.conda + sha256: 68f0206ca6e98fea941e5717cec780ed2873ffabc0e1ed34428c061e2c6268c7 + md5: 4a13eeac0b5c8e5b8ab496e6c4ddd829 + depends: + - __glibc >=2.17,<3.0.a0 + - libzlib >=1.3.1,<2.0a0 + license: BSD-3-Clause + license_family: BSD + size: 601375 + timestamp: 1764777111296 diff --git a/benchmarks/cuda_bindings/pixi.toml b/benchmarks/cuda_bindings/pixi.toml new file mode 100644 index 00000000000..92b7b2e336f --- /dev/null +++ b/benchmarks/cuda_bindings/pixi.toml @@ -0,0 +1,83 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +[workspace] +channels = ["conda-forge"] +platforms = ["linux-64"] +preview = ["pixi-build"] +channel-priority = "disabled" + +[feature.cu13.system-requirements] +cuda = "13" + +[feature.cu13-pinned.dependencies] +cuda-version = "13.1.*" + +[feature.cu13-source.dependencies] +cuda-version = "13.*" + +[feature.bench.dependencies] +python = "3.14.*" +pyperf = "*" +pytest = "*" +pytest-benchmark = "*" +numpy = "*" + +[feature.cpp-bench.dependencies] +cmake = "*" +ninja = "*" +cxx-compiler = "*" +cuda-cudart-dev = "*" +cuda-nvrtc-dev = "*" + +[feature.cpp-bench.target.linux-64.dependencies] +cuda-crt-dev_linux-64 = "*" +cuda-driver-dev_linux-64 = "*" + +[feature.cpp-bench.target.linux-64.activation.env] +CUDA_HOME = "$CONDA_PREFIX/targets/x86_64-linux" + +[feature.dev.dependencies] +pre-commit = "*" + +[feature.bindings-wheel.dependencies] +cuda-bindings = "==13.1.0" + +[feature.bindings-source.dependencies] +cuda-bindings = { path = "../../cuda_bindings" } + +[environments] +wheel = { features = ["cu13", "cu13-pinned", "bench", "cpp-bench", "dev", "bindings-wheel"] } +source = { features = ["cu13", "cu13-source", "bench", "cpp-bench", "dev", "bindings-source"] } + +[target.linux.tasks.bench] +cmd = ["python", "$PIXI_PROJECT_ROOT/run_pyperf.py"] + +[target.linux.tasks.bench-smoke-test] +cmd = ["python", "$PIXI_PROJECT_ROOT/run_pyperf.py", "--debug-single-value"] + +[target.linux.tasks.bench-cpp-configure] +cmd = [ + "cmake", + "-S", + "$PIXI_PROJECT_ROOT/benchmarks/cpp", + "-B", + "$PIXI_PROJECT_ROOT/.build/cpp", + "-G", + "Ninja", +] + +[target.linux.tasks.bench-cpp-build] +cmd = ["cmake", "--build", "$PIXI_PROJECT_ROOT/.build/cpp"] +depends-on = [{ task = "bench-cpp-configure" }] + +[target.linux.tasks.bench-cpp] +cmd = ["python", "$PIXI_PROJECT_ROOT/run_cpp.py"] +depends-on = [{ task = "bench-cpp-build" }] + +[target.linux.tasks.bench-compare] +cmd = ["python", "$PIXI_PROJECT_ROOT/compare.py"] + +[target.linux.tasks.lint] +cmd = ["pre-commit", "run", "--all-files"] diff --git a/benchmarks/cuda_bindings/run_cpp.py b/benchmarks/cuda_bindings/run_cpp.py new file mode 100644 index 00000000000..96e50cb890f --- /dev/null +++ b/benchmarks/cuda_bindings/run_cpp.py @@ -0,0 +1,8 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from runner.cpp import main + +if __name__ == "__main__": + main() diff --git a/benchmarks/cuda_bindings/run_pyperf.py b/benchmarks/cuda_bindings/run_pyperf.py new file mode 100644 index 00000000000..f45af8c69a3 --- /dev/null +++ b/benchmarks/cuda_bindings/run_pyperf.py @@ -0,0 +1,8 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from runner.main import main + +if __name__ == "__main__": + main() diff --git a/benchmarks/cuda_bindings/runner/__init__.py b/benchmarks/cuda_bindings/runner/__init__.py new file mode 100644 index 00000000000..27422b3cb7e --- /dev/null +++ b/benchmarks/cuda_bindings/runner/__init__.py @@ -0,0 +1,3 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 diff --git a/benchmarks/cuda_bindings/runner/cpp.py b/benchmarks/cuda_bindings/runner/cpp.py new file mode 100644 index 00000000000..f752d677100 --- /dev/null +++ b/benchmarks/cuda_bindings/runner/cpp.py @@ -0,0 +1,189 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +import argparse +import json +import subprocess +import sys +import tempfile +from pathlib import Path + +PROJECT_ROOT = Path(__file__).resolve().parent.parent +BUILD_DIR = PROJECT_ROOT / ".build" / "cpp" +DEFAULT_OUTPUT = PROJECT_ROOT / "results-cpp.json" + +BINARY_PREFIX = "bench_" +BINARY_SUFFIX = "_cpp" + + +def discover_binaries() -> dict[str, Path]: + """Discover C++ benchmark binaries in the build directory""" + if not BUILD_DIR.is_dir(): + return {} + + registry: dict[str, Path] = {} + for path in sorted(BUILD_DIR.iterdir()): + if not path.is_file() or not path.name.startswith(BINARY_PREFIX): + continue + if not path.name.endswith(BINARY_SUFFIX): + continue + name = path.name.removeprefix(BINARY_PREFIX).removesuffix(BINARY_SUFFIX) + registry[name] = path + return registry + + +def strip_output_args(argv: list[str]) -> list[str]: + cleaned: list[str] = [] + skip_next = False + for arg in argv: + if skip_next: + skip_next = False + continue + if arg in ("-o", "--output"): + skip_next = True + continue + if arg.startswith(("-o=", "--output=")): + continue + cleaned.append(arg) + return cleaned + + +def merge_pyperf_json(individual_files: list[Path], output_path: Path) -> int: + """Merge individual pyperf JSON files into a single BenchmarkSuite file. + + Each C++ binary produces a file with structure: + {"version": "1.0", "metadata": {...}, "benchmarks": [{...}]} + + We merge them by collecting all benchmark entries into one file. + """ + all_benchmarks = [] + + for path in individual_files: + with open(path) as f: + data = json.load(f) + + file_metadata = data.get("metadata", {}) + bench_name = file_metadata.get("name", "") + loops = file_metadata.get("loops") + unit = file_metadata.get("unit", "second") + + for bench in data.get("benchmarks", []): + for run in bench.get("runs", []): + run_meta = run.setdefault("metadata", {}) + if bench_name: + run_meta.setdefault("name", bench_name) + if loops is not None: + run_meta.setdefault("loops", loops) + run_meta.setdefault("unit", unit) + + all_benchmarks.append(bench) + + merged = { + "version": "1.0", + "benchmarks": all_benchmarks, + } + + with open(output_path, "w") as f: + json.dump(merged, f) + + return len(all_benchmarks) + + +def parse_args(argv: list[str]) -> tuple[argparse.Namespace, list[str]]: + parser = argparse.ArgumentParser( + description="Run C++ CUDA benchmarks", + add_help=False, + ) + parser.add_argument( + "--benchmark", + action="append", + default=[], + help="Benchmark name to run (e.g. 'ctx_device'). Repeat for multiple. Defaults to all.", + ) + parser.add_argument( + "--list", + action="store_true", + help="Print discovered benchmark names and exit.", + ) + parser.add_argument( + "-o", + "--output", + type=Path, + default=DEFAULT_OUTPUT, + help=f"JSON output file path (default: {DEFAULT_OUTPUT.name})", + ) + parsed, remaining = parser.parse_known_args(argv) + return parsed, remaining + + +def main() -> None: + parsed, remaining_argv = parse_args(sys.argv[1:]) + + registry = discover_binaries() + if not registry: + print( + f"No C++ benchmark binaries found in {BUILD_DIR}.\nRun 'pixi run bench-cpp-build' first.", + file=sys.stderr, + ) + sys.exit(1) + + if parsed.list: + for name in sorted(registry): + print(name) + return + + if parsed.benchmark: + missing = sorted(set(parsed.benchmark) - set(registry)) + if missing: + known = ", ".join(sorted(registry)) + unknown = ", ".join(missing) + print( + f"Unknown benchmark(s): {unknown}. Known benchmarks: {known}", + file=sys.stderr, + ) + sys.exit(1) + names = parsed.benchmark + else: + names = sorted(registry) + + # Strip any --output args to avoid conflicts with our output handling + passthrough_argv = strip_output_args(remaining_argv) + + output_path = parsed.output.resolve() + failed = False + individual_files: list[Path] = [] + + with tempfile.TemporaryDirectory(prefix="cuda_bench_cpp_") as tmpdir: + tmpdir_path = Path(tmpdir) + + for name in names: + binary = registry[name] + tmp_json = tmpdir_path / f"{name}.json" + cmd = [str(binary), "-o", str(tmp_json), *passthrough_argv] + result = subprocess.run(cmd, check=False) # noqa: S603 + if result.returncode != 0: + print(f"FAILED: {name} (exit code {result.returncode})", file=sys.stderr) + failed = True + elif tmp_json.exists(): + individual_files.append(tmp_json) + + if individual_files: + count = merge_pyperf_json(individual_files, output_path) + print(f"\nResults saved to {output_path} ({count} benchmark(s))") + + if not individual_files and not failed: + print( + "No C++ benchmark results were produced. The selected benchmark " + "binaries may have skipped every benchmark on this driver/device. " + "Existing output file (if any) was left untouched.", + file=sys.stderr, + ) + sys.exit(1) + + if failed: + sys.exit(1) + + +if __name__ == "__main__": + main() diff --git a/benchmarks/cuda_bindings/runner/main.py b/benchmarks/cuda_bindings/runner/main.py new file mode 100644 index 00000000000..9c984c340d6 --- /dev/null +++ b/benchmarks/cuda_bindings/runner/main.py @@ -0,0 +1,317 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +import argparse +import ast +import importlib.util +import os +import sys +from collections.abc import Callable +from pathlib import Path +from types import ModuleType + +import pyperf + +PROJECT_ROOT = Path(__file__).resolve().parent.parent +BENCH_DIR = PROJECT_ROOT / "benchmarks" +DEFAULT_OUTPUT = PROJECT_ROOT / "results-python.json" +DEFAULT_MODULE_NAME_PREFIX = "cuda_bindings_bench" +# Env var used to propagate the --benchmark filter from the parent to pyperf +# worker subprocesses. pyperf reconstructs worker argv from scratch and drops +# custom flags like --benchmark, so without this the worker would register the +# full bench list and pyperf would run the wrong bench by task index. +DEFAULT_BENCH_FILTER_ENV_VAR = "CUDA_BINDINGS_BENCH_FILTER" + +BASE_PYPERF_INHERITED_ENV_VARS = ( + "CUDA_HOME", + "CUDA_PATH", + "CUDA_VISIBLE_DEVICES", + "LD_LIBRARY_PATH", + "NVIDIA_VISIBLE_DEVICES", +) +_MODULE_CACHE: dict[Path, ModuleType] = {} + + +def load_module(module_path: Path, module_name_prefix: str = DEFAULT_MODULE_NAME_PREFIX) -> ModuleType: + module_path = module_path.resolve() + cached_module = _MODULE_CACHE.get(module_path) + if cached_module is not None: + return cached_module + + module_name = f"{module_name_prefix}_{module_path.stem}" + spec = importlib.util.spec_from_file_location(module_name, module_path) + if spec is None or spec.loader is None: + raise RuntimeError(f"Failed to load benchmark module: {module_path}") + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + _MODULE_CACHE[module_path] = module + return module + + +def benchmark_id(module_name: str, function_name: str) -> str: + module_suffix = module_name.removeprefix("bench_") + suffix = function_name.removeprefix("bench_") + return f"{module_suffix}.{suffix}" + + +def _discover_module_functions(module_path: Path) -> list[str]: + tree = ast.parse(module_path.read_text(encoding="utf-8"), filename=str(module_path)) + return [ + node.name + for node in tree.body + if isinstance(node, ast.FunctionDef | ast.AsyncFunctionDef) and node.name.startswith("bench_") + ] + + +def _lazy_benchmark( + module_path: Path, + function_name: str, + module_name_prefix: str = DEFAULT_MODULE_NAME_PREFIX, +) -> Callable[[int], float]: + loaded_function: Callable[[int], float] | None = None + + def run(loops: int) -> float: + nonlocal loaded_function + if loaded_function is None: + module = load_module(module_path, module_name_prefix=module_name_prefix) + loaded_function = getattr(module, function_name) + return loaded_function(loops) + + run.__name__ = function_name + # Expose the binding source so the runner can introspect skip lists before + # handing the benchmark to pyperf. Accessing these attributes does not + # trigger module import — discovery stays lazy. + run._bench_module_path = module_path # type: ignore[attr-defined] + run._bench_function_name = function_name # type: ignore[attr-defined] + return run + + +def _collect_skipped_benchmarks( + bench_ids: list[str], + registry: dict[str, Callable[[int], float]], + module_name_prefix: str = DEFAULT_MODULE_NAME_PREFIX, +) -> set[str]: + """Return bench IDs that the owning module has marked as unsupported. + + Benchmark modules may declare a module-level + ``SKIPPED_BENCHMARKS: set[str]`` containing the names of ``bench_*`` + functions whose underlying API is unavailable on the current driver or + device (e.g. TMA encoders on pre-Hopper GPUs). Loading the module runs + its import-time probe, so this call is the same cost as the first + real invocation would have been. + """ + skipped: set[str] = set() + loaded_modules: dict[Path, ModuleType] = {} + for bench_id in bench_ids: + fn = registry[bench_id] + module_path = getattr(fn, "_bench_module_path", None) + function_name = getattr(fn, "_bench_function_name", None) + if module_path is None or function_name is None: + continue + module = loaded_modules.get(module_path) + if module is None: + module = load_module(module_path, module_name_prefix=module_name_prefix) + loaded_modules[module_path] = module + module_skip = getattr(module, "SKIPPED_BENCHMARKS", None) + if module_skip and function_name in module_skip: + skipped.add(bench_id) + return skipped + + +def discover_benchmarks( + bench_dir: Path | None = None, + module_name_prefix: str = DEFAULT_MODULE_NAME_PREFIX, +) -> dict[str, Callable[[int], float]]: + """Discover bench_ functions. + + Each bench_ function must have the signature: bench_*(loops: int) -> float + where it calls the operation `loops` times and returns the total elapsed + time in seconds (using time.perf_counter). + """ + # Resolve the default inside the call so tests (and embedders) can + # monkeypatch ``BENCH_DIR`` at the module level — Python binds default + # args at def-time, so a literal default would ignore later patches. + if bench_dir is None: + bench_dir = BENCH_DIR + registry: dict[str, Callable[[int], float]] = {} + for module_path in sorted(bench_dir.glob("bench_*.py")): + module_name = module_path.stem + for function_name in _discover_module_functions(module_path): + bench_id = benchmark_id(module_name, function_name) + if bench_id in registry: + raise ValueError(f"Duplicate benchmark ID discovered: {bench_id}") + registry[bench_id] = _lazy_benchmark(module_path, function_name, module_name_prefix=module_name_prefix) + return registry + + +def strip_pyperf_output_args(argv: list[str]) -> list[str]: + cleaned: list[str] = [] + skip_next = False + for arg in argv: + if skip_next: + skip_next = False + continue + if arg in ("-o", "--output", "--append"): + skip_next = True + continue + if arg.startswith(("-o=", "--output=", "--append=")): + continue + cleaned.append(arg) + return cleaned + + +def _split_env_vars(arg_value: str) -> list[str]: + return [env_var for env_var in arg_value.split(",") if env_var] + + +def ensure_pyperf_worker_env( + argv: list[str], + extra_env_vars: tuple[str, ...] = (DEFAULT_BENCH_FILTER_ENV_VAR,), +) -> list[str]: + if "--copy-env" in argv: + return list(argv) + + inherited_env: list[str] = [] + cleaned: list[str] = [] + skip_next = False + for arg in argv: + if skip_next: + inherited_env.extend(_split_env_vars(arg)) + skip_next = False + continue + if arg == "--inherit-environ": + skip_next = True + continue + if arg.startswith("--inherit-environ="): + inherited_env.extend(_split_env_vars(arg.partition("=")[2])) + continue + cleaned.append(arg) + + if skip_next: + raise ValueError("Missing value for --inherit-environ") + + for env_var in (*BASE_PYPERF_INHERITED_ENV_VARS, *extra_env_vars): + if env_var in os.environ: + inherited_env.append(env_var) + + deduped_env: list[str] = [] + for env_var in inherited_env: + if env_var not in deduped_env: + deduped_env.append(env_var) + + if deduped_env: + cleaned.extend(["--inherit-environ", ",".join(deduped_env)]) + + return cleaned + + +def parse_args(argv: list[str], default_output: Path = DEFAULT_OUTPUT) -> tuple[argparse.Namespace, list[str]]: + parser = argparse.ArgumentParser(add_help=False) + parser.add_argument( + "--benchmark", + action="append", + default=[], + help="Benchmark ID to run. Repeat to run multiple IDs. Defaults to all.", + ) + parser.add_argument( + "--list", + action="store_true", + help="Print discovered benchmark IDs and exit.", + ) + parser.add_argument( + "-o", + "--output", + type=Path, + default=default_output, + help=f"JSON output file path (default: {default_output.name})", + ) + parsed, remaining = parser.parse_known_args(argv) + return parsed, remaining + + +def main( + *, + bench_dir: Path = BENCH_DIR, + default_output: Path = DEFAULT_OUTPUT, + module_name_prefix: str = DEFAULT_MODULE_NAME_PREFIX, + bench_filter_env_var: str = DEFAULT_BENCH_FILTER_ENV_VAR, +) -> None: + parsed, remaining_argv = parse_args(sys.argv[1:], default_output=default_output) + + registry = discover_benchmarks(bench_dir=bench_dir, module_name_prefix=module_name_prefix) + if not registry: + raise RuntimeError(f"No benchmark functions found in {bench_dir}") + + if parsed.list: + for bench_id in sorted(registry): + print(bench_id) + return + + # The --benchmark filter must be the same in the parent and in any pyperf + # worker subprocess, otherwise pyperf's task-index bookkeeping points at + # the wrong bench. pyperf drops unknown CLI flags when spawning workers, + # so fall back to an env var carrying the filter. + requested = list(parsed.benchmark) + env_filter = os.environ.get(bench_filter_env_var, "") + if not requested and env_filter: + requested = [bid for bid in env_filter.split(",") if bid] + + if requested: + missing = sorted(set(requested) - set(registry)) + if missing: + known = ", ".join(sorted(registry)) + unknown = ", ".join(missing) + raise ValueError(f"Unknown benchmark(s): {unknown}. Known benchmarks: {known}") + benchmark_ids = requested + # Propagate to any pyperf worker we're about to spawn. + os.environ[bench_filter_env_var] = ",".join(benchmark_ids) + else: + benchmark_ids = sorted(registry) + + # Strip any --output args to avoid conflicts with our output handling. + output_path = parsed.output.resolve() + remaining_argv = strip_pyperf_output_args(remaining_argv) + remaining_argv = ensure_pyperf_worker_env(remaining_argv, extra_env_vars=(bench_filter_env_var,)) + is_worker = "--worker" in remaining_argv + + # Drop benchmarks that the owning module has marked as unavailable on + # this driver/device. Without this step a single unsupported bench + # (e.g. TMA on a pre-Hopper GPU) would abort the whole pyperf run, + # since pyperf treats a raised exception as a fatal worker failure. + skipped = _collect_skipped_benchmarks(benchmark_ids, registry, module_name_prefix=module_name_prefix) + if skipped and not is_worker: + for bench_id in sorted(skipped): + print(f"Skipping {bench_id}: unsupported on this driver/device", file=sys.stderr) + benchmark_ids = [bench_id for bench_id in benchmark_ids if bench_id not in skipped] + + # If every selected benchmark was skipped, fail loudly instead of silently + # printing "Results saved" with no output. Leave any existing output file + # untouched so a prior successful run is not destroyed. + if not benchmark_ids: + if not is_worker: + print( + "No benchmarks to run: every selected benchmark is unsupported " + "on this driver/device. Existing output file (if any) was left " + "untouched.", + file=sys.stderr, + ) + sys.exit(1) + + # Delete the file so this run starts fresh. Only destructive once we know + # at least one benchmark will actually run. + if not is_worker: + output_path.unlink(missing_ok=True) + + sys.argv = [sys.argv[0], "--append", str(output_path), *remaining_argv] + + runner = pyperf.Runner() + for bench_id in benchmark_ids: + runner.bench_time_func(bench_id, registry[bench_id]) + + if not is_worker: + print(f"\nResults saved to {output_path}") + + +if __name__ == "__main__": + main() diff --git a/benchmarks/cuda_bindings/runner/runtime.py b/benchmarks/cuda_bindings/runner/runtime.py new file mode 100644 index 00000000000..153d92f259d --- /dev/null +++ b/benchmarks/cuda_bindings/runner/runtime.py @@ -0,0 +1,117 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +import atexit + +from cuda.bindings import driver as cuda +from cuda.bindings import nvrtc + +_ctx = None +_device = None +_persistent_ptrs: list[int] = [] +_modules: list = [] + + +def assert_drv(err) -> None: + if err != cuda.CUresult.CUDA_SUCCESS: + raise RuntimeError(f"Cuda Error: {err}") + + +def ensure_context() -> int: + global _ctx, _device + if _ctx is not None: + return _ctx + + (err,) = cuda.cuInit(0) + assert_drv(err) + + err, device = cuda.cuDeviceGet(0) + assert_drv(err) + _device = device + + err, ctx = cuda.cuCtxCreate(None, 0, device) + assert_drv(err) + _ctx = ctx + return ctx + + +def alloc_persistent(size: int) -> int: + ensure_context() + err, ptr = cuda.cuMemAlloc(size) + assert_drv(err) + _persistent_ptrs.append(ptr) + return ptr + + +def register_module(module) -> int: + _modules.append(module) + return module + + +def compile_cubin(kernel_source: str) -> bytes: + """Compile CUDA C source with NVRTC and return the raw cubin bytes.""" + ensure_context() + + err, major = cuda.cuDeviceGetAttribute( + cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, _device + ) + assert_drv(err) + err, minor = cuda.cuDeviceGetAttribute( + cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, _device + ) + assert_drv(err) + + err, prog = nvrtc.nvrtcCreateProgram(kernel_source.encode(), b"benchmark_kernel.cu", 0, [], []) + assert_drv(err) + + arch_flag = f"--gpu-architecture=sm_{major}{minor}".encode() + (err,) = nvrtc.nvrtcCompileProgram(prog, 2, [b"--fmad=false", arch_flag]) + + # check for compile errors + err_log, log_size = nvrtc.nvrtcGetProgramLogSize(prog) + assert_drv(err_log) + log = b" " * log_size + (err_log,) = nvrtc.nvrtcGetProgramLog(prog, log) + assert_drv(err_log) + assert_drv(err) + + err, cubin_size = nvrtc.nvrtcGetCUBINSize(prog) + assert_drv(err) + cubin = b" " * cubin_size + (err,) = nvrtc.nvrtcGetCUBIN(prog, cubin) + assert_drv(err) + (err,) = nvrtc.nvrtcDestroyProgram(prog) + assert_drv(err) + + return cubin + + +def compile_and_load(kernel_source: str) -> int: + """Compile CUDA C source and return the CUmodule handle.""" + cubin = compile_cubin(kernel_source) + err, module = cuda.cuModuleLoadData(cubin) + assert_drv(err) + return register_module(module) + + +def cleanup() -> None: + global _ctx + for ptr in reversed(_persistent_ptrs): + (err,) = cuda.cuMemFree(ptr) + assert_drv(err) + _persistent_ptrs.clear() + + for module in reversed(_modules): + (err,) = cuda.cuModuleUnload(module) + assert_drv(err) + _modules.clear() + + if _ctx is None: + return + (err,) = cuda.cuCtxDestroy(_ctx) + assert_drv(err) + _ctx = None + + +atexit.register(cleanup) diff --git a/benchmarks/cuda_bindings/tests/test_runner.py b/benchmarks/cuda_bindings/tests/test_runner.py new file mode 100644 index 00000000000..56d88444c9e --- /dev/null +++ b/benchmarks/cuda_bindings/tests/test_runner.py @@ -0,0 +1,166 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +import importlib.util +import itertools +import sys +import types +from pathlib import Path + +REPO_ROOT = Path(__file__).resolve().parents[3] +RUNNER_MAIN_PATH = REPO_ROOT / "benchmarks/cuda_bindings/runner/main.py" +BENCH_LAUNCH_PATH = REPO_ROOT / "benchmarks/cuda_bindings/benchmarks/bench_launch.py" + + +def load_module_from_path(module_name: str, module_path: Path): + spec = importlib.util.spec_from_file_location(module_name, module_path) + if spec is None or spec.loader is None: + raise RuntimeError(f"Failed to load test module: {module_path}") + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +def load_runner_main(monkeypatch): + pyperf_module = types.ModuleType("pyperf") + + class FakeRunner: + def bench_time_func(self, *_args, **_kwargs) -> None: + raise AssertionError("FakeRunner should not be used in these tests") + + pyperf_module.Runner = FakeRunner + monkeypatch.setitem(sys.modules, "pyperf", pyperf_module) + return load_module_from_path("test_cuda_bindings_bench_runner_main", RUNNER_MAIN_PATH) + + +def load_bench_launch(monkeypatch, calls: list[tuple]): + pointer_values = itertools.count(1000) + + runtime_module = types.ModuleType("runner.runtime") + + def alloc_persistent(size: int) -> int: + calls.append(("alloc_persistent", size)) + return next(pointer_values) + + def assert_drv(err) -> None: + calls.append(("assert_drv", err)) + assert err == 0 + + def compile_and_load(source: str) -> str: + calls.append(("compile_and_load", source)) + return "module" + + runtime_module.alloc_persistent = alloc_persistent + runtime_module.assert_drv = assert_drv + runtime_module.compile_and_load = compile_and_load + + runner_module = types.ModuleType("runner") + runner_module.runtime = runtime_module + + driver_module = types.ModuleType("cuda.bindings.driver") + + class FakeCUresult: + CUDA_SUCCESS = 0 + + class FakeCUstreamFlags: + CU_STREAM_NON_BLOCKING = types.SimpleNamespace(value=1) + + def cuModuleGetFunction(module, name): + calls.append(("cuModuleGetFunction", module, name)) + return 0, name + + def cuStreamCreate(flags): + calls.append(("cuStreamCreate", flags)) + return 0, "stream" + + def cuLaunchKernel(*args): + calls.append(("cuLaunchKernel", args)) + return 0 + + driver_module.CUresult = FakeCUresult + driver_module.CUstream_flags = FakeCUstreamFlags + driver_module.cuModuleGetFunction = cuModuleGetFunction + driver_module.cuStreamCreate = cuStreamCreate + driver_module.cuLaunchKernel = cuLaunchKernel + + cuda_module = types.ModuleType("cuda") + bindings_module = types.ModuleType("cuda.bindings") + bindings_module.driver = driver_module + cuda_module.bindings = bindings_module + + monkeypatch.setitem(sys.modules, "runner", runner_module) + monkeypatch.setitem(sys.modules, "runner.runtime", runtime_module) + monkeypatch.setitem(sys.modules, "cuda", cuda_module) + monkeypatch.setitem(sys.modules, "cuda.bindings", bindings_module) + monkeypatch.setitem(sys.modules, "cuda.bindings.driver", driver_module) + + return load_module_from_path("test_cuda_bindings_bench_launch", BENCH_LAUNCH_PATH) + + +def test_discover_benchmarks_is_lazy(monkeypatch, tmp_path): + runner_main = load_runner_main(monkeypatch) + + marker_path = tmp_path / "imported.txt" + bench_path = tmp_path / "bench_lazy.py" + bench_path.write_text( + "\n".join( + ( + "from pathlib import Path", + f"Path({str(marker_path)!r}).write_text('imported')", + "", + "def helper() -> float:", + " return 0.0", + "", + "def bench_visible(loops: int) -> float:", + " return loops + 0.5", + "", + ) + ), + encoding="utf-8", + ) + + monkeypatch.setattr(runner_main, "BENCH_DIR", tmp_path) + runner_main._MODULE_CACHE.clear() + + registry = runner_main.discover_benchmarks() + + assert sorted(registry) == ["lazy.visible"] + assert not marker_path.exists() + assert registry["lazy.visible"](3) == 3.5 + assert marker_path.read_text(encoding="utf-8") == "imported" + + +def test_ensure_pyperf_worker_env_preserves_existing_args(monkeypatch): + runner_main = load_runner_main(monkeypatch) + + for env_var in runner_main.BASE_PYPERF_INHERITED_ENV_VARS: + monkeypatch.delenv(env_var, raising=False) + monkeypatch.setenv("CUDA_PATH", "/opt/cuda") + monkeypatch.setenv("LD_LIBRARY_PATH", "/opt/cuda/lib64") + + argv = runner_main.ensure_pyperf_worker_env(["--fast", "--inherit-environ=FOO,BAR"]) + + assert argv == ["--fast", "--inherit-environ", "FOO,BAR,CUDA_PATH,LD_LIBRARY_PATH"] + + +def test_bench_launch_initializes_on_first_use(monkeypatch): + calls: list[tuple] = [] + bench_launch = load_bench_launch(monkeypatch, calls) + + assert calls == [] + + bench_launch.bench_launch_empty_kernel(1) + compile_calls = [call for call in calls if call[0] == "compile_and_load"] + launch_calls = [call for call in calls if call[0] == "cuLaunchKernel"] + + assert len(compile_calls) == 1 + assert len(launch_calls) == 1 + + bench_launch.bench_launch_16_args_pre_packed(1) + compile_calls = [call for call in calls if call[0] == "compile_and_load"] + launch_calls = [call for call in calls if call[0] == "cuLaunchKernel"] + + assert len(compile_calls) == 1 + assert len(launch_calls) == 2 diff --git a/benchmarks/cuda_core/.gitignore b/benchmarks/cuda_core/.gitignore new file mode 100644 index 00000000000..b795782a321 --- /dev/null +++ b/benchmarks/cuda_core/.gitignore @@ -0,0 +1,16 @@ +# Build artifacts +.build/ +__pycache__/ + +# Benchmark results +*.json +.benchmarks/ + +# Pixi environments +.pixi/ + +# Override root .gitignore *.cpp rule (which targets Cython-generated files) +!benchmarks/cpp/*.cpp + +results-python.json +results-cpp.json diff --git a/benchmarks/cuda_core/AGENTS.md b/benchmarks/cuda_core/AGENTS.md new file mode 100644 index 00000000000..d2a3a3357cd --- /dev/null +++ b/benchmarks/cuda_core/AGENTS.md @@ -0,0 +1,11 @@ +# cuda.core benchmarks + +Read the README.md in this directory for more details about the benchmarks. + +When generating code verify that that the code is correct based on the source for cuda-core +that can be found in ../../cuda_core. + +This suite shares the pyperf runner with `../cuda_bindings/` via a sys.path +insert in `run_pyperf.py`. The per-suite setup (`runtime.py`, the `benchmarks/` +module files) lives here. Benchmark IDs are kept identical to the cuda.bindings +suite so `compare.py` can diff them directly. diff --git a/benchmarks/cuda_core/README.md b/benchmarks/cuda_core/README.md new file mode 100644 index 00000000000..de124f7ff73 --- /dev/null +++ b/benchmarks/cuda_core/README.md @@ -0,0 +1,73 @@ +# cuda.core benchmarks + +These benchmarks measure the latency overhead of the `cuda.core` public API +on top of `cuda.bindings`. Every benchmark ID here has a 1:1 counterpart in +`../cuda_bindings/benchmarks/` so a `compare.py` run produces a side-by-side +"bindings vs core" overhead table for every operation. + +This suite is **not** a throughput benchmark and does not test kernel +performance — it measures Python-side call overhead only. No C++ baseline +is built or run for `cuda.core`: the comparative baseline is the +`cuda.bindings` Python results file at +`../cuda_bindings/results-python.json`. + +The pyperf runner (`runner/main.py`) is shared with the cuda.bindings +suite via a `sys.path` insert in `run_pyperf.py`; only the per-suite +`runtime.py` and `benchmarks/*.py` live here. + +## Usage + +Requires pixi. + +Environments: + +- `wheel`: Installs released `cuda-core` from conda-forge. +- `source`: Installs `cuda-core` and `cuda-bindings` from the in-tree + sources, so local changes are exercised. + +Tasks: + +- `bench`: Runs the full suite. +- `bench-smoke-test`: Runs each bench with `--debug-single-value` for + a quick smoke check (not meaningful for timing). +- `bench-compare`: Prints a side-by-side table against + `../cuda_bindings/results-python.json`. + +### System tuning + +For more stable results on Linux, tune the system before running. +See: https://pyperf.readthedocs.io/en/latest/system.html#system + +```bash +pixi run -e wheel -- python -m pyperf system show +$(pixi run -e wheel -- which python) -m pyperf system tune +``` + +### Running benchmarks + +```bash +# Wheel env +pixi run -e wheel bench +pixi run -e wheel bench --min-time 0.1 + +# Source env (picks up local cuda.core / cuda.bindings changes) +pixi run -e source bench + +# Side-by-side comparison vs cuda.bindings +pixi run -e wheel bench-compare +``` + +Results are saved to `results-python.json` in this directory. Compare +against the cuda.bindings baseline by running that suite's `bench` task +first so `../cuda_bindings/results-python.json` exists. + +## Output JSON and analysis + +The suite uses [pyperf](https://pyperf.readthedocs.io/en/latest/). The +output JSON is pyperf-compatible: + +```bash +pixi run -e wheel -- python -m pyperf stats results-python.json +pixi run -e wheel -- python -m pyperf compare_to \ + ../cuda_bindings/results-python.json results-python.json +``` diff --git a/benchmarks/cuda_core/benchmarks/bench_ctx_device.py b/benchmarks/cuda_core/benchmarks/bench_ctx_device.py new file mode 100644 index 00000000000..ce646ee1f14 --- /dev/null +++ b/benchmarks/cuda_core/benchmarks/bench_ctx_device.py @@ -0,0 +1,54 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +import time + +from runtime import ensure_device + +from cuda.core import Device + +DEV = ensure_device() + + +def bench_ctx_get_current(loops: int) -> float: + # Device() with no args returns the TLS-cached "current" device. + _fn = Device + + t0 = time.perf_counter() + for _ in range(loops): + _fn() + return time.perf_counter() - t0 + + +def bench_ctx_set_current(loops: int) -> float: + _fn = DEV.set_current + + t0 = time.perf_counter() + for _ in range(loops): + _fn() + return time.perf_counter() - t0 + + +def bench_device_get(loops: int) -> float: + # Device(id) hits the same TLS cache after the first construction. + _fn = Device + + t0 = time.perf_counter() + for _ in range(loops): + _fn(0) + return time.perf_counter() - t0 + + +def bench_device_get_attribute(loops: int) -> float: + # Matches the cuda.bindings bench's CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR + # call. cuda.core caches this attribute in DeviceProperties, so every + # iteration past the first is a dict lookup rather than a driver call + # — the bench therefore measures the user-visible cost of the public + # API, which is legitimately faster than cuda.bindings here. + _props = DEV.properties + + t0 = time.perf_counter() + for _ in range(loops): + _props.compute_capability_major # noqa: B018 + return time.perf_counter() - t0 diff --git a/benchmarks/cuda_core/benchmarks/bench_event.py b/benchmarks/cuda_core/benchmarks/bench_event.py new file mode 100644 index 00000000000..883c470be1f --- /dev/null +++ b/benchmarks/cuda_core/benchmarks/bench_event.py @@ -0,0 +1,53 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +import time + +from runtime import ensure_device + +DEV = ensure_device() +STREAM = DEV.create_stream() + +# Pre-recorded event, completed, reused for record/query/sync benches. +EVENT = STREAM.record() +STREAM.sync() + + +def bench_event_create_destroy(loops: int) -> float: + _create = DEV.create_event + + t0 = time.perf_counter() + for _ in range(loops): + e = _create() + e.close() + return time.perf_counter() - t0 + + +def bench_event_record(loops: int) -> float: + # Reuse EVENT so we measure cuEventRecord, not event allocation. + _record = STREAM.record + _event = EVENT + + t0 = time.perf_counter() + for _ in range(loops): + _record(_event) + return time.perf_counter() - t0 + + +def bench_event_query(loops: int) -> float: + _event = EVENT + + t0 = time.perf_counter() + for _ in range(loops): + _event.is_done # noqa: B018 + return time.perf_counter() - t0 + + +def bench_event_synchronize(loops: int) -> float: + _fn = EVENT.sync + + t0 = time.perf_counter() + for _ in range(loops): + _fn() + return time.perf_counter() - t0 diff --git a/benchmarks/cuda_core/benchmarks/bench_launch.py b/benchmarks/cuda_core/benchmarks/bench_launch.py new file mode 100644 index 00000000000..c08f866c63c --- /dev/null +++ b/benchmarks/cuda_core/benchmarks/bench_launch.py @@ -0,0 +1,187 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +import time + +from runtime import compile_module, ensure_device + +from cuda.core import LaunchConfig, launch + +# Same source as the cuda.bindings launch bench, minus the variants we +# don't need here. Pointer args are passed as Python ints (via int(handle)) +# or Buffer instances; cuda.core's ParamHolder treats both as intptr_t. +KERNEL_SOURCE = """\ +extern "C" __global__ void empty_kernel() { return; } +extern "C" __global__ void small_kernel(float *f) { *f = 0.0f; } + +#define ITEM_PARAM(x, T) T x +#define REP1(x, T) , ITEM_PARAM(x, T) +#define REP2(x, T) REP1(x##0, T) REP1(x##1, T) +#define REP4(x, T) REP2(x##0, T) REP2(x##1, T) +#define REP8(x, T) REP4(x##0, T) REP4(x##1, T) +#define REP16(x, T) REP8(x##0, T) REP8(x##1, T) +#define REP32(x, T) REP16(x##0, T) REP16(x##1, T) +#define REP64(x, T) REP32(x##0, T) REP32(x##1, T) +#define REP128(x, T) REP64(x##0, T) REP64(x##1, T) +#define REP256(x, T) REP128(x##0, T) REP128(x##1, T) + +extern "C" __global__ +void small_kernel_16_args( + ITEM_PARAM(F, int*) + REP1(A, int*) + REP2(A, int*) + REP4(A, int*) + REP8(A, int*)) +{ *F = 0; } + +extern "C" __global__ +void small_kernel_256_args( + ITEM_PARAM(F, int*) + REP1(A, int*) + REP2(A, int*) + REP4(A, int*) + REP8(A, int*) + REP16(A, int*) + REP32(A, int*) + REP64(A, int*) + REP128(A, int*)) +{ *F = 0; } + +extern "C" __global__ +void small_kernel_512_args( + ITEM_PARAM(F, int*) + REP1(A, int*) + REP2(A, int*) + REP4(A, int*) + REP8(A, int*) + REP16(A, int*) + REP32(A, int*) + REP64(A, int*) + REP128(A, int*) + REP256(A, int*)) +{ *F = 0; } +""" + +KERNEL_NAMES = ( + "empty_kernel", + "small_kernel", + "small_kernel_16_args", + "small_kernel_256_args", + "small_kernel_512_args", +) + +DEV = ensure_device() +STREAM = DEV.create_stream() +CONFIG = LaunchConfig(grid=1, block=1) + +MODULE = None +EMPTY_KERNEL = None +SMALL_KERNEL = None +KERNEL_16_ARGS = None +KERNEL_256_ARGS = None +KERNEL_512_ARGS = None +FLOAT_BUF = None +INT_BUFS_512: tuple = () +INT_PTRS_512: tuple = () + + +def _ensure_launch_state() -> None: + global MODULE, EMPTY_KERNEL, SMALL_KERNEL + global KERNEL_16_ARGS, KERNEL_256_ARGS, KERNEL_512_ARGS + global FLOAT_BUF, INT_BUFS_512, INT_PTRS_512 + + if EMPTY_KERNEL is not None: + return + + module = compile_module(KERNEL_SOURCE, KERNEL_NAMES) + + # Pre-allocate buffers for the kernel args. Allocate on STREAM so the + # pool-async allocs are stream-ordered with the launches we will issue + # on the same stream below — matches the cuda.bindings bench, which + # uses synchronous cuMemAlloc and therefore has the pointers ready + # before the first timed launch. Use ints (raw pointer addresses) in + # the launch hot path so ParamHolder skips the Buffer type check and + # goes through its int fast-path. + float_buf = DEV.allocate(4, STREAM) + int_bufs_512 = tuple(DEV.allocate(4, STREAM) for _ in range(512)) + int_ptrs_512 = tuple(int(b.handle) for b in int_bufs_512) + + MODULE = module + EMPTY_KERNEL = module.get_kernel("empty_kernel") + SMALL_KERNEL = module.get_kernel("small_kernel") + KERNEL_16_ARGS = module.get_kernel("small_kernel_16_args") + KERNEL_256_ARGS = module.get_kernel("small_kernel_256_args") + KERNEL_512_ARGS = module.get_kernel("small_kernel_512_args") + FLOAT_BUF = float_buf + INT_BUFS_512 = int_bufs_512 + INT_PTRS_512 = int_ptrs_512 + + +def bench_launch_empty_kernel(loops: int) -> float: + _ensure_launch_state() + _launch = launch + _kernel = EMPTY_KERNEL + _stream = STREAM + _config = CONFIG + + t0 = time.perf_counter() + for _ in range(loops): + _launch(_stream, _config, _kernel) + return time.perf_counter() - t0 + + +def bench_launch_small_kernel(loops: int) -> float: + _ensure_launch_state() + _launch = launch + _kernel = SMALL_KERNEL + _stream = STREAM + _config = CONFIG + _ptr = int(FLOAT_BUF.handle) + + t0 = time.perf_counter() + for _ in range(loops): + _launch(_stream, _config, _kernel, _ptr) + return time.perf_counter() - t0 + + +def bench_launch_16_args(loops: int) -> float: + _ensure_launch_state() + _launch = launch + _kernel = KERNEL_16_ARGS + _stream = STREAM + _config = CONFIG + _args = INT_PTRS_512[:16] + + t0 = time.perf_counter() + for _ in range(loops): + _launch(_stream, _config, _kernel, *_args) + return time.perf_counter() - t0 + + +def bench_launch_256_args(loops: int) -> float: + _ensure_launch_state() + _launch = launch + _kernel = KERNEL_256_ARGS + _stream = STREAM + _config = CONFIG + _args = INT_PTRS_512[:256] + + t0 = time.perf_counter() + for _ in range(loops): + _launch(_stream, _config, _kernel, *_args) + return time.perf_counter() - t0 + + +def bench_launch_512_args(loops: int) -> float: + _ensure_launch_state() + _launch = launch + _kernel = KERNEL_512_ARGS + _stream = STREAM + _config = CONFIG + _args = INT_PTRS_512 + + t0 = time.perf_counter() + for _ in range(loops): + _launch(_stream, _config, _kernel, *_args) + return time.perf_counter() - t0 diff --git a/benchmarks/cuda_core/benchmarks/bench_memory.py b/benchmarks/cuda_core/benchmarks/bench_memory.py new file mode 100644 index 00000000000..445f85e5121 --- /dev/null +++ b/benchmarks/cuda_core/benchmarks/bench_memory.py @@ -0,0 +1,37 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +import time + +from runtime import ensure_device + +DEV = ensure_device() +STREAM = DEV.create_stream() + +# Small allocation size: we measure call overhead, not the allocator. +ALLOC_SIZE = 1024 + + +def bench_mem_alloc_free(loops: int) -> float: + # No-stream variant: dev.allocate() uses the default stream internally. + _alloc = DEV.allocate + _size = ALLOC_SIZE + + t0 = time.perf_counter() + for _ in range(loops): + buf = _alloc(_size) + buf.close() + return time.perf_counter() - t0 + + +def bench_mem_alloc_async_free_async(loops: int) -> float: + _alloc = DEV.allocate + _size = ALLOC_SIZE + _stream = STREAM + + t0 = time.perf_counter() + for _ in range(loops): + buf = _alloc(_size, _stream) + buf.close(_stream) + return time.perf_counter() - t0 diff --git a/benchmarks/cuda_core/benchmarks/bench_stream.py b/benchmarks/cuda_core/benchmarks/bench_stream.py new file mode 100644 index 00000000000..f1501c6f658 --- /dev/null +++ b/benchmarks/cuda_core/benchmarks/bench_stream.py @@ -0,0 +1,29 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +import time + +from runtime import ensure_device + +DEV = ensure_device() +STREAM = DEV.create_stream() + + +def bench_stream_create_destroy(loops: int) -> float: + _create = DEV.create_stream + + t0 = time.perf_counter() + for _ in range(loops): + s = _create() + s.close() + return time.perf_counter() - t0 + + +def bench_stream_synchronize(loops: int) -> float: + _fn = STREAM.sync + + t0 = time.perf_counter() + for _ in range(loops): + _fn() + return time.perf_counter() - t0 diff --git a/benchmarks/cuda_core/compare.py b/benchmarks/cuda_core/compare.py new file mode 100644 index 00000000000..20fa1c5f2aa --- /dev/null +++ b/benchmarks/cuda_core/compare.py @@ -0,0 +1,214 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +"""Compare cuda.core and cuda.bindings benchmark results side by side. + +Benchmark IDs are kept intentionally identical across the two suites +(e.g. ``stream.stream_create_destroy``) so a result present in both +files can be diffed directly. IDs that exist in only one suite are +rendered with ``-`` in the missing column. +""" + +import argparse +import json +import statistics +import sys +from pathlib import Path + +HERE = Path(__file__).resolve().parent +DEFAULT_CORE = HERE / "results-python.json" +DEFAULT_BINDINGS = HERE.parent / "cuda_bindings" / "results-python.json" + +# Benchmark IDs where the cuda.core path invokes a different driver +# symbol, makes an additional driver call, or hits a cuda.core-side cache +# compared to the cuda.bindings bench — i.e. the "Delta" column is NOT +# pure Python wrapper overhead on top of the same driver call. +# Unstarred rows compare like-for-like driver calls. Per-row rationale +# is inlined below as a comment next to each ID. +DIFFERENT_CODEPATH_BENCHMARKS: frozenset[str] = frozenset( + { + # cuCtxGetDevice (core) vs cuCtxGetCurrent (bindings). + "ctx_device.ctx_get_current", + # TLS list lookup (core) vs cuDeviceGet (bindings). + "ctx_device.device_get", + # DeviceProperties dict cache hit (core) vs cuDeviceGetAttribute + # (bindings) on every iteration. + "ctx_device.device_get_attribute", + # cuStreamCreateWithPriority + cuCtxGetStreamPriorityRange (core) + # vs cuStreamCreate (bindings). + "stream.stream_create_destroy", + # cuMemAllocFromPoolAsync on default stream (core) vs synchronous + # cuMemAlloc (bindings). + "memory.mem_alloc_free", + # cuMemAllocFromPoolAsync with explicit pool handle (core) vs + # cuMemAllocAsync with implicit default pool (bindings). + "memory.mem_alloc_async_free_async", + # cuLaunchKernelEx + per-call ParamHolder (core) vs cuLaunchKernel + # with pre-built arg tuple (bindings). + "launch.launch_empty_kernel", + "launch.launch_small_kernel", + "launch.launch_16_args", + "launch.launch_256_args", + "launch.launch_512_args", + } +) +DIFFERENT_CODEPATH_MARKER = "*" + + +def load_benchmarks(path: Path) -> dict[str, list[float]]: + """Load a pyperf JSON file and return {name: [values]}.""" + with open(path) as f: + data = json.load(f) + + results: dict[str, list[float]] = {} + for bench in data.get("benchmarks", []): + name = bench.get("metadata", {}).get("name", "") + if not name: + for run in bench.get("runs", []): + name = run.get("metadata", {}).get("name", "") + if name: + break + values: list[float] = [] + for run in bench.get("runs", []): + values.extend(run.get("values", [])) + if name and values: + results[name] = values + return results + + +def stats(values: list[float]) -> tuple[float, float, float, int]: + mean = statistics.mean(values) + stdev = statistics.pstdev(values) if len(values) > 1 else 0.0 + rsd = (stdev / mean) if mean else 0.0 + return mean, stdev, rsd, len(values) + + +def fmt_rsd(rsd: float | None) -> str: + if rsd is None: + return "-" + return f"{rsd * 100:.1f}%" + + +def fmt_ns(seconds: float) -> str: + return f"{seconds * 1e9:,.0f}" + + +def fmt_delta_ns(core_mean: float, bindings_mean: float) -> str: + return f"{(core_mean - bindings_mean) * 1e9:+,.0f}" + + +def fmt_delta_pct(core_mean: float, bindings_mean: float) -> str: + if bindings_mean <= 0.0: + return "-" + pct = (core_mean - bindings_mean) / bindings_mean * 100 + return f"{pct:+,.0f}%" + + +def main() -> None: + parser = argparse.ArgumentParser(description="Compare cuda.core vs cuda.bindings benchmark results") + parser.add_argument( + "--core", + type=Path, + default=DEFAULT_CORE, + help=f"cuda.core results JSON (default: {DEFAULT_CORE.name})", + ) + parser.add_argument( + "--bindings", + type=Path, + default=DEFAULT_BINDINGS, + help=f"cuda.bindings results JSON (default: {DEFAULT_BINDINGS})", + ) + args = parser.parse_args() + + if not args.core.exists(): + print(f"cuda.core results not found: {args.core}", file=sys.stderr) + print("Run: pixi run -e source bench", file=sys.stderr) + sys.exit(1) + + core_benchmarks = load_benchmarks(args.core) + bindings_benchmarks = load_benchmarks(args.bindings) if args.bindings.exists() else {} + + if not core_benchmarks: + print("No benchmarks found in cuda.core results.", file=sys.stderr) + sys.exit(1) + + all_names = sorted(set(core_benchmarks) | set(bindings_benchmarks)) + + # Reserve a trailing column of space for the "different codepath" marker + # so it does not collide visually with the benchmark ID. + display_names = { + name: f"{name} {DIFFERENT_CODEPATH_MARKER}" if name in DIFFERENT_CODEPATH_BENCHMARKS else name + for name in all_names + } + name_width = max(len(display_names[n]) for n in all_names) + name_width = max(name_width, len("Benchmark")) + + bind_w = 14 + core_w = 14 + rsd_w = 8 + delta_ns_w = 12 + delta_pct_w = 10 + + if bindings_benchmarks: + header = ( + f"{'Benchmark':<{name_width}} " + f"{'bindings (ns)':>{bind_w}} {'RSD':>{rsd_w}} " + f"{'core (ns)':>{core_w}} {'RSD':>{rsd_w}} " + f"{'Delta ns':>{delta_ns_w}} {'Delta %':>{delta_pct_w}}" + ) + else: + header = f"{'Benchmark':<{name_width}} {'core (ns)':>{core_w}} {'RSD':>{rsd_w}}" + + sep = "-" * len(header) + + if bindings_benchmarks: + # Keep legend lines shorter than the table so they don't overflow. + print("Delta = core mean - bindings mean (positive = cuda.core slower).") + print(f"{DIFFERENT_CODEPATH_MARKER} marks benchmarks where the cuda.core path invokes a different driver") + print(" symbol, makes an additional driver call, or hits a cuda.core-side cache") + print(" — so Delta is not pure Python wrapper overhead on top of the same driver") + print(" call. Unstarred rows compare like-for-like driver calls; their Delta is") + print(" wrapper overhead.") + print() + + print(sep) + print(header) + print(sep) + + for name in all_names: + core_vals = core_benchmarks.get(name) + bind_vals = bindings_benchmarks.get(name) + + core_stats = stats(core_vals) if core_vals else None + bind_stats = stats(bind_vals) if bind_vals else None + + core_str = fmt_ns(core_stats[0]) if core_stats else "-" + bind_str = fmt_ns(bind_stats[0]) if bind_stats else "-" + core_rsd = fmt_rsd(core_stats[2]) if core_stats else "-" + bind_rsd = fmt_rsd(bind_stats[2]) if bind_stats else "-" + + if core_stats and bind_stats: + delta_ns_str = fmt_delta_ns(core_stats[0], bind_stats[0]) + delta_pct_str = fmt_delta_pct(core_stats[0], bind_stats[0]) + else: + delta_ns_str = "-" + delta_pct_str = "-" + + display_name = display_names[name] + + if bindings_benchmarks: + print( + f"{display_name:<{name_width}} " + f"{bind_str:>{bind_w}} {bind_rsd:>{rsd_w}} " + f"{core_str:>{core_w}} {core_rsd:>{rsd_w}} " + f"{delta_ns_str:>{delta_ns_w}} {delta_pct_str:>{delta_pct_w}}" + ) + else: + print(f"{display_name:<{name_width}} {core_str:>{core_w}} {core_rsd:>{rsd_w}}") + + print(sep) + + +if __name__ == "__main__": + main() diff --git a/benchmarks/cuda_core/pixi.lock b/benchmarks/cuda_core/pixi.lock new file mode 100644 index 00000000000..e5eca8b36ee --- /dev/null +++ b/benchmarks/cuda_core/pixi.lock @@ -0,0 +1,972 @@ +version: 6 +environments: + default: + channels: + - url: https://conda.anaconda.org/conda-forge/ + options: + channel-priority: disabled + pypi-prerelease-mode: if-necessary-or-explicit + packages: {} + source: + channels: + - url: https://conda.anaconda.org/conda-forge/ + options: + channel-priority: disabled + pypi-prerelease-mode: if-necessary-or-explicit + packages: + linux-64: + - conda: https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-20_gnu.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hda65f42_9.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.4.22-hbd8a1cb_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cffi-2.0.0-py314h4a8dc5f_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cfgv-3.5.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-bindings-13.2.0-py314ha0b5721_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-13.2.75-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_linux-64-13.2.75-h376f20c_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvrtc-13.2.78-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-impl-13.2.78-h4bc722e_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-pathfinder-1.5.4-pyhc364b38_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-13.2-he2cc418_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/distlib-0.4.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/filelock-3.29.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/icu-78.3-h33c6efd_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/identify-2.6.19-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/importlib-metadata-8.8.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.45.1-default_hbd61a6d_102.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libblas-3.11.0-6_h4a7cf45_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcap-2.77-hd0affe5_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcblas-3.11.0-6_h0358290_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcufile-1.17.1.22-h85c024f_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.7.5-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libffi-3.5.2-h3435931_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-15.2.0-he0feb66_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran-15.2.0-h69a702a_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-15.2.0-h68bc16d_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgomp-15.2.0-he0feb66_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/liblapack-3.11.0-6_h47877c9_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/liblzma-5.8.3-hb03c661_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libmpdec-4.0.0-hb03c661_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnl-3.11.0-hb9d3cd8_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnvjitlink-13.2.78-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenblas-0.3.32-pthreads_h94d23a6_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.53.0-hf4e2dac_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-15.2.0-h934c35e_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsystemd0-257.13-hd0affe5_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libudev1-257.13-hd0affe5_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.42-h5347b49_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.2-h25fd6f3_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.6-hdb14827_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/nodeenv-1.10.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/numpy-2.4.3-py314h2b28147_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.6.2-h35e630c_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.9.6-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pre-commit-4.6.0-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pycparser-2.22-pyh29332c3_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pyperf-2.9.0-py314hdafbbf9_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/python-3.14.4-habeac84_100_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python-discovery-1.2.2-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.14-8_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pyyaml-6.0.3-py314h67df5f8_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/rdma-core-61.0-h192683f_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/readline-8.3-h853b02a_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/six-1.17.0-pyhe01879c_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_h366c992_103.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.15.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ukkonen-1.1.0-py314h9891dd4_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/virtualenv-21.3.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/yaml-0.2.5-h280c20c_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/zipp-3.23.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_6.conda + - conda: ../../cuda_core + wheel: + channels: + - url: https://conda.anaconda.org/conda-forge/ + options: + channel-priority: disabled + pypi-prerelease-mode: if-necessary-or-explicit + packages: + linux-64: + - conda: https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-20_gnu.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hda65f42_9.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.4.22-hbd8a1cb_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cffi-2.0.0-py314h4a8dc5f_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cfgv-3.5.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-bindings-13.2.0-py314ha0b5721_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-core-0.7.0-cuda13_py314h025f531_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvrtc-13.1.115-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-impl-13.1.115-h4bc722e_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-pathfinder-1.5.4-pyhc364b38_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-13.1-h2ff5cdb_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/distlib-0.4.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/filelock-3.29.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/icu-78.3-h33c6efd_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/identify-2.6.19-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/importlib-metadata-8.8.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.45.1-default_hbd61a6d_102.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libblas-3.11.0-6_h4a7cf45_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcap-2.77-hd0affe5_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcblas-3.11.0-6_h0358290_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcufile-1.16.1.26-hd07211c_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.7.5-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libffi-3.5.2-h3435931_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-15.2.0-he0feb66_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran-15.2.0-h69a702a_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-15.2.0-h68bc16d_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgomp-15.2.0-he0feb66_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/liblapack-3.11.0-6_h47877c9_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/liblzma-5.8.3-hb03c661_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libmpdec-4.0.0-hb03c661_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnl-3.11.0-hb9d3cd8_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnvjitlink-13.2.78-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenblas-0.3.32-pthreads_h94d23a6_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.53.0-hf4e2dac_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-15.2.0-h934c35e_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsystemd0-257.13-hd0affe5_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libudev1-257.13-hd0affe5_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.42-h5347b49_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.2-h25fd6f3_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.6-hdb14827_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/nodeenv-1.10.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/numpy-2.4.3-py314h2b28147_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.6.2-h35e630c_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.9.6-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pre-commit-4.6.0-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pycparser-2.22-pyh29332c3_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pyperf-2.9.0-py314hdafbbf9_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/python-3.14.4-habeac84_100_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python-discovery-1.2.2-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.14-8_cp314.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pyyaml-6.0.3-py314h67df5f8_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/rdma-core-61.0-h192683f_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/readline-8.3-h853b02a_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/six-1.17.0-pyhe01879c_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_h366c992_103.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.15.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ukkonen-1.1.0-py314h9891dd4_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/virtualenv-21.3.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/yaml-0.2.5-h280c20c_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/zipp-3.23.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_6.conda +packages: +- conda: https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-20_gnu.conda + build_number: 20 + sha256: 1dd3fffd892081df9726d7eb7e0dea6198962ba775bd88842135a4ddb4deb3c9 + md5: a9f577daf3de00bca7c3c76c0ecbd1de + depends: + - __glibc >=2.17,<3.0.a0 + - libgomp >=7.5.0 + constrains: + - openmp_impl <0.0a0 + license: BSD-3-Clause + license_family: BSD + size: 28948 + timestamp: 1770939786096 +- conda: https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hda65f42_9.conda + sha256: 0b75d45f0bba3e95dc693336fa51f40ea28c980131fec438afb7ce6118ed05f6 + md5: d2ffd7602c02f2b316fd921d39876885 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: bzip2-1.0.6 + license_family: BSD + size: 260182 + timestamp: 1771350215188 +- conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.4.22-hbd8a1cb_0.conda + sha256: c9dbcc8039a52023660d6d1bbf87594a93dd69c6ac5a2a44323af2c92976728d + md5: e18ad67cf881dcadee8b8d9e2f8e5f73 + depends: + - __unix + license: ISC + size: 131039 + timestamp: 1776865545798 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cffi-2.0.0-py314h4a8dc5f_1.conda + sha256: c6339858a0aaf5d939e00d345c98b99e4558f285942b27232ac098ad17ac7f8e + md5: cf45f4278afd6f4e6d03eda0f435d527 + depends: + - __glibc >=2.17,<3.0.a0 + - libffi >=3.5.2,<3.6.0a0 + - libgcc >=14 + - pycparser + - python >=3.14,<3.15.0a0 + - python_abi 3.14.* *_cp314 + license: MIT + license_family: MIT + size: 300271 + timestamp: 1761203085220 +- conda: https://conda.anaconda.org/conda-forge/noarch/cfgv-3.5.0-pyhd8ed1ab_0.conda + sha256: aa589352e61bb221351a79e5946d56916e3c595783994884accdb3b97fe9d449 + md5: 381bd45fb7aa032691f3063aff47e3a1 + depends: + - python >=3.10 + license: MIT + license_family: MIT + size: 13589 + timestamp: 1763607964133 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-bindings-13.2.0-py314ha0b5721_0.conda + sha256: f77e397cbf7b173dae7470aca3052184779431b7a7bcce3ecc56c2822c83cdb4 + md5: 29baeabdf5e58a696a68625b7bd8d9f8 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-nvrtc >=13,<14.0a0 + - cuda-nvvm-impl >=13,<14.0a0 + - cuda-pathfinder >=1.1.0,<2 + - cuda-version >=13,<14.0a0 + - libcufile >=1,<2.0a0 + - libgcc >=14 + - libnvjitlink >=13.0,<14.0a0 + - libstdcxx >=14 + - python >=3.14,<3.15.0a0 + - python_abi 3.14.* *_cp314 + constrains: + - cuda-cudart >=13,<14.0a0 + - cuda-python >=13.2.0,<13.3.0a0 + license: LicenseRef-NVIDIA-SOFTWARE-LICENSE + size: 4281852 + timestamp: 1773284503198 +- conda: ../../cuda_core + name: cuda-core + version: 0.7.0 + build: hb0f4dca_0 + subdir: linux-64 + variants: + target_platform: linux-64 + depends: + - python + - cuda-version + - numpy + - cuda-bindings + - cuda-pathfinder + - libgcc >=15 + - libgcc >=15 + - libstdcxx >=15 + - python_abi 3.14.* *_cp314 + - cuda-nvrtc >=13.2.78,<14.0a0 + - cuda-cudart >=13.2.75,<14.0a0 + license: Apache-2.0 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-core-0.7.0-cuda13_py314h025f531_0.conda + sha256: 25841761aa7cfb2a9295afbefea5ab96ac15f07aa56fc35acb36d254c92e6747 + md5: 60c216b8b88821564e7f2409d6437bb5 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-bindings >=13,<14.0a0 + - cuda-pathfinder >=1.4.2,<2 + - cuda-version >=13,<14.0a0 + - libgcc >=14 + - libstdcxx >=14 + - numpy + - python >=3.14,<3.15.0a0 + - python_abi 3.14.* *_cp314 + license: Apache-2.0 + license_family: APACHE + size: 1541620 + timestamp: 1775673907706 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-13.2.75-hecca717_0.conda + sha256: 633bc9ba458a12a20a42776bf3fa25cecfddc65a22e4ed207fe09b9adcd9de58 + md5: 9b7dcd83f8a965efcf7377dc54203619 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-cudart_linux-64 13.2.75 h376f20c_0 + - cuda-version >=13.2,<13.3.0a0 + - libgcc >=14 + - libstdcxx >=14 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 24542 + timestamp: 1776110472025 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_linux-64-13.2.75-h376f20c_0.conda + sha256: cd03c67b2005e2e74ff278f6f8b17ca7d6f18cf43fb00775833669508d301a83 + md5: ff98f2b9b87eb8b3a4b36745d3d5b93e + depends: + - cuda-version >=13.2,<13.3.0a0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 203339 + timestamp: 1776110448238 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvrtc-13.1.115-hecca717_0.conda + sha256: 9cc4f9df70c02eea5121cdb0e865207b04cd52591f57ebcac2ba44fada10eb5b + md5: df16c9049d882cdaf4f83a5b90079589 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-version >=13.1,<13.2.0a0 + - libgcc >=14 + - libstdcxx >=14 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 35339417 + timestamp: 1768272955912 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvrtc-13.2.78-hecca717_0.conda + sha256: 73fbc9d15c062c3ea60891e8183002f6b055fa6638402d17581677af0aaa20d8 + md5: 66623d882c42506fa3f1780b90841400 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-version >=13.2,<13.3.0a0 + - libgcc >=14 + - libstdcxx >=14 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 35670504 + timestamp: 1776109867257 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-impl-13.1.115-h4bc722e_0.conda + sha256: 12d84615684f1279799c023ce4ccc7c34f151bec2a90e0c8d04798a8c8af437c + md5: bf76661bc0de83a60537c4913f339fb3 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-version >=13.1,<13.2.0a0 + - libgcc >=12 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 21873791 + timestamp: 1768280315627 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-impl-13.2.78-h4bc722e_0.conda + sha256: 944d132f61f240131abff67646da4040ae585a1f43c6b38fabebb6cc075a7c16 + md5: 5e1021b4c73e795deabbf35ed1317dcb + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-version >=13.2,<13.3.0a0 + - libgcc >=12 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 22205958 + timestamp: 1776121258973 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-pathfinder-1.5.4-pyhc364b38_0.conda + sha256: 662046880e1dd8f62cd2ad8ac9618ace683cb7a3f3af93c52e425a772c9b4f00 + md5: 42d4610b52102122741f9bf68f2866ed + depends: + - python >=3.10 + - cuda-version >=12.0,<14 + - python + license: Apache-2.0 + license_family: APACHE + size: 45892 + timestamp: 1777330272729 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-13.1-h2ff5cdb_3.conda + sha256: 176ac20fdb95611af8fb2bf0d3d16fee998019b1d0f12fc9ddd5fa0df4553992 + md5: d85448460c25ee43ff2f8346bb9ad52b + constrains: + - cudatoolkit 13.1|13.1.* + - __cuda >=13 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 21511 + timestamp: 1757017115788 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-13.2-he2cc418_3.conda + sha256: 64aebe8ccb3a2c3ff446d3c0c0e88ef4fdb069a5732c03539bf3a37243c4c679 + md5: 45676e3dd76b30ec613f1f822d450eff + constrains: + - __cuda >=13 + - cudatoolkit 13.2|13.2.* + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 21908 + timestamp: 1773093709154 +- conda: https://conda.anaconda.org/conda-forge/noarch/distlib-0.4.0-pyhd8ed1ab_0.conda + sha256: 6d977f0b2fc24fee21a9554389ab83070db341af6d6f09285360b2e09ef8b26e + md5: 003b8ba0a94e2f1e117d0bd46aebc901 + depends: + - python >=3.9 + license: Apache-2.0 + license_family: APACHE + size: 275642 + timestamp: 1752823081585 +- conda: https://conda.anaconda.org/conda-forge/noarch/filelock-3.29.0-pyhd8ed1ab_0.conda + sha256: 6b471a18372bbd52bdf32fc965f71de3bc1b5219418b8e6b3875a67a7b08c483 + md5: 8fa8358d022a3a9bd101384a808044c6 + depends: + - python >=3.10 + license: Unlicense + size: 34211 + timestamp: 1776621506566 +- conda: https://conda.anaconda.org/conda-forge/linux-64/icu-78.3-h33c6efd_0.conda + sha256: fbf86c4a59c2ed05bbffb2ba25c7ed94f6185ec30ecb691615d42342baa1a16a + md5: c80d8a3b84358cb967fa81e7075fbc8a + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + license: MIT + license_family: MIT + size: 12723451 + timestamp: 1773822285671 +- conda: https://conda.anaconda.org/conda-forge/noarch/identify-2.6.19-pyhd8ed1ab_0.conda + sha256: 381cedccf0866babfc135d65ee40b778bd20e927d2a5ec810f750c5860a7c5b8 + md5: 84a3233b709a289a4ddd7a2fd27dd988 + depends: + - python >=3.10 + - ukkonen + license: MIT + license_family: MIT + size: 79757 + timestamp: 1776455344188 +- conda: https://conda.anaconda.org/conda-forge/noarch/importlib-metadata-8.8.0-pyhcf101f3_0.conda + sha256: 82ab2a0d91ca1e7e63ab6a4939356667ef683905dea631bc2121aa534d347b16 + md5: 080594bf4493e6bae2607e65390c520a + depends: + - python >=3.10 + - zipp >=3.20 + - python + license: Apache-2.0 + license_family: APACHE + size: 34387 + timestamp: 1773931568510 +- conda: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.45.1-default_hbd61a6d_102.conda + sha256: 3d584956604909ff5df353767f3a2a2f60e07d070b328d109f30ac40cd62df6c + md5: 18335a698559cdbcd86150a48bf54ba6 + depends: + - __glibc >=2.17,<3.0.a0 + - zstd >=1.5.7,<1.6.0a0 + constrains: + - binutils_impl_linux-64 2.45.1 + license: GPL-3.0-only + license_family: GPL + size: 728002 + timestamp: 1774197446916 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libblas-3.11.0-6_h4a7cf45_openblas.conda + build_number: 6 + sha256: 7bfe936dbb5db04820cf300a9cc1f5ee8d5302fc896c2d66e30f1ee2f20fbfd6 + md5: 6d6d225559bfa6e2f3c90ee9c03d4e2e + depends: + - libopenblas >=0.3.32,<0.3.33.0a0 + - libopenblas >=0.3.32,<1.0a0 + constrains: + - blas 2.306 openblas + - liblapack 3.11.0 6*_openblas + - liblapacke 3.11.0 6*_openblas + - libcblas 3.11.0 6*_openblas + - mkl <2026 + license: BSD-3-Clause + license_family: BSD + size: 18621 + timestamp: 1774503034895 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libcap-2.77-hd0affe5_1.conda + sha256: 37c41b1024d0c75da76822e3c079aabaf121618a32fe05e53a897b35a88008fc + md5: 499cd8e2d4358986dbe3b30e8fe1bf6a + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: BSD-3-Clause + license_family: BSD + size: 124432 + timestamp: 1774333989027 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libcblas-3.11.0-6_h0358290_openblas.conda + build_number: 6 + sha256: 57edafa7796f6fa3ebbd5367692dd4c7f552be42109c2dd1a7c89b55089bf374 + md5: 36ae340a916635b97ac8a0655ace2a35 + depends: + - libblas 3.11.0 6_h4a7cf45_openblas + constrains: + - blas 2.306 openblas + - liblapack 3.11.0 6*_openblas + - liblapacke 3.11.0 6*_openblas + license: BSD-3-Clause + license_family: BSD + size: 18622 + timestamp: 1774503050205 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libcufile-1.16.1.26-hd07211c_0.conda + sha256: 8c44b5bf947afad827df0df49fe7483cf1b2916694081b2db4fecdfd6a2bacd1 + md5: 48418c48dac04671fa46cb446122b8a5 + depends: + - __glibc >=2.28,<3.0.a0 + - cuda-version >=13.1,<13.2.0a0 + - libgcc >=14 + - libstdcxx >=14 + - rdma-core >=60.0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 990938 + timestamp: 1768273732081 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libcufile-1.17.1.22-h85c024f_0.conda + sha256: a24ad0ca488aa3e237049cd5b5c6d7fe3d2d4330682ed329203064e332ea1d74 + md5: 056a67706108efd1f9c24682ba8d3685 + depends: + - __glibc >=2.28,<3.0.a0 + - cuda-version >=13.2,<13.3.0a0 + - libgcc >=14 + - libstdcxx >=14 + - rdma-core >=61.0 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 1082447 + timestamp: 1776110053053 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.7.5-hecca717_0.conda + sha256: e8c2b57f6aacabdf2f1b0924bd4831ce5071ba080baa4a9e8c0d720588b6794c + md5: 49f570f3bc4c874a06ea69b7225753af + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + constrains: + - expat 2.7.5.* + license: MIT + license_family: MIT + size: 76624 + timestamp: 1774719175983 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libffi-3.5.2-h3435931_0.conda + sha256: 31f19b6a88ce40ebc0d5a992c131f57d919f73c0b92cd1617a5bec83f6e961e6 + md5: a360c33a5abe61c07959e449fa1453eb + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: MIT + license_family: MIT + size: 58592 + timestamp: 1769456073053 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-15.2.0-he0feb66_18.conda + sha256: faf7d2017b4d718951e3a59d081eb09759152f93038479b768e3d612688f83f5 + md5: 0aa00f03f9e39fb9876085dee11a85d4 + depends: + - __glibc >=2.17,<3.0.a0 + - _openmp_mutex >=4.5 + constrains: + - libgcc-ng ==15.2.0=*_18 + - libgomp 15.2.0 he0feb66_18 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 1041788 + timestamp: 1771378212382 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran-15.2.0-h69a702a_18.conda + sha256: d2c9fad338fd85e4487424865da8e74006ab2e2475bd788f624d7a39b2a72aee + md5: 9063115da5bc35fdc3e1002e69b9ef6e + depends: + - libgfortran5 15.2.0 h68bc16d_18 + constrains: + - libgfortran-ng ==15.2.0=*_18 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 27523 + timestamp: 1771378269450 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-15.2.0-h68bc16d_18.conda + sha256: 539b57cf50ec85509a94ba9949b7e30717839e4d694bc94f30d41c9d34de2d12 + md5: 646855f357199a12f02a87382d429b75 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=15.2.0 + constrains: + - libgfortran 15.2.0 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 2482475 + timestamp: 1771378241063 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libgomp-15.2.0-he0feb66_18.conda + sha256: 21337ab58e5e0649d869ab168d4e609b033509de22521de1bfed0c031bfc5110 + md5: 239c5e9546c38a1e884d69effcf4c882 + depends: + - __glibc >=2.17,<3.0.a0 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 603262 + timestamp: 1771378117851 +- conda: https://conda.anaconda.org/conda-forge/linux-64/liblapack-3.11.0-6_h47877c9_openblas.conda + build_number: 6 + sha256: 371f517eb7010b21c6cc882c7606daccebb943307cb9a3bf2c70456a5c024f7d + md5: 881d801569b201c2e753f03c84b85e15 + depends: + - libblas 3.11.0 6_h4a7cf45_openblas + constrains: + - blas 2.306 openblas + - liblapacke 3.11.0 6*_openblas + - libcblas 3.11.0 6*_openblas + license: BSD-3-Clause + license_family: BSD + size: 18624 + timestamp: 1774503065378 +- conda: https://conda.anaconda.org/conda-forge/linux-64/liblzma-5.8.3-hb03c661_0.conda + sha256: ec30e52a3c1bf7d0425380a189d209a52baa03f22fb66dd3eb587acaa765bd6d + md5: b88d90cad08e6bc8ad540cb310a761fb + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + constrains: + - xz 5.8.3.* + license: 0BSD + size: 113478 + timestamp: 1775825492909 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libmpdec-4.0.0-hb03c661_1.conda + sha256: fe171ed5cf5959993d43ff72de7596e8ac2853e9021dec0344e583734f1e0843 + md5: 2c21e66f50753a083cbe6b80f38268fa + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: BSD-2-Clause + license_family: BSD + size: 92400 + timestamp: 1769482286018 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libnl-3.11.0-hb9d3cd8_0.conda + sha256: ba7c5d294e3d80f08ac5a39564217702d1a752e352e486210faff794ac5001b4 + md5: db63358239cbe1ff86242406d440e44a + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + license: LGPL-2.1-or-later + license_family: LGPL + size: 741323 + timestamp: 1731846827427 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libnvjitlink-13.2.78-hecca717_0.conda + sha256: 2ece599a2a1090eb70916061ab8b49670ee9b143e1f3b41efa0e32e0336a9465 + md5: 641ddee63cb39856291275114ce15d13 + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-version >=13,<13.3.0a0 + - libgcc >=14 + - libstdcxx >=14 + license: LicenseRef-NVIDIA-End-User-License-Agreement + size: 31659345 + timestamp: 1776110062236 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libopenblas-0.3.32-pthreads_h94d23a6_0.conda + sha256: 6dc30b28f32737a1c52dada10c8f3a41bc9e021854215efca04a7f00487d09d9 + md5: 89d61bc91d3f39fda0ca10fcd3c68594 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libgfortran + - libgfortran5 >=14.3.0 + constrains: + - openblas >=0.3.32,<0.3.33.0a0 + license: BSD-3-Clause + license_family: BSD + size: 5928890 + timestamp: 1774471724897 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.53.0-hf4e2dac_0.conda + sha256: ec37c79f737933bbac965f5dc0f08ef2790247129a84bb3114fad4900adce401 + md5: 810d83373448da85c3f673fbcb7ad3a3 + depends: + - __glibc >=2.17,<3.0.a0 + - icu >=78.3,<79.0a0 + - libgcc >=14 + - libzlib >=1.3.2,<2.0a0 + license: blessing + size: 958864 + timestamp: 1775753750179 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-15.2.0-h934c35e_18.conda + sha256: 78668020064fdaa27e9ab65cd2997e2c837b564ab26ce3bf0e58a2ce1a525c6e + md5: 1b08cd684f34175e4514474793d44bcb + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc 15.2.0 he0feb66_18 + constrains: + - libstdcxx-ng ==15.2.0=*_18 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + size: 5852330 + timestamp: 1771378262446 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libsystemd0-257.13-hd0affe5_0.conda + sha256: c5008b602cb5c819f7b52d418b3ed17e1818cbbf6705b189e7ab36bb70cce3d8 + md5: 8ee3cb7f64be0e8c4787f3a4dbe024e6 + depends: + - __glibc >=2.17,<3.0.a0 + - libcap >=2.77,<2.78.0a0 + - libgcc >=14 + license: LGPL-2.1-or-later + size: 492799 + timestamp: 1773797095649 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libudev1-257.13-hd0affe5_0.conda + sha256: 1a1e367c04d66030aa93b4d33905f7f6fbb59cfc292e816fe3e9c1e8b3f4d1e2 + md5: 2c2270f93d6f9073cbf72d821dfc7d72 + depends: + - __glibc >=2.17,<3.0.a0 + - libcap >=2.77,<2.78.0a0 + - libgcc >=14 + license: LGPL-2.1-or-later + size: 145087 + timestamp: 1773797108513 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.42-h5347b49_0.conda + sha256: bc1b08c92626c91500fd9f26f2c797f3eb153b627d53e9c13cd167f1e12b2829 + md5: 38ffe67b78c9d4de527be8315e5ada2c + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: BSD-3-Clause + license_family: BSD + size: 40297 + timestamp: 1775052476770 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.2-h25fd6f3_2.conda + sha256: 55044c403570f0dc26e6364de4dc5368e5f3fc7ff103e867c487e2b5ab2bcda9 + md5: d87ff7921124eccd67248aa483c23fec + depends: + - __glibc >=2.17,<3.0.a0 + constrains: + - zlib 1.3.2 *_2 + license: Zlib + license_family: Other + size: 63629 + timestamp: 1774072609062 +- conda: https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.6-hdb14827_0.conda + sha256: fc89f74bbe362fb29fa3c037697a89bec140b346a2469a90f7936d1d7ea4d8a3 + md5: fc21868a1a5aacc937e7a18747acb8a5 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: X11 AND BSD-3-Clause + size: 918956 + timestamp: 1777422145199 +- conda: https://conda.anaconda.org/conda-forge/noarch/nodeenv-1.10.0-pyhd8ed1ab_0.conda + sha256: 4fa40e3e13fc6ea0a93f67dfc76c96190afd7ea4ffc1bac2612d954b42cdc3ee + md5: eb52d14a901e23c39e9e7b4a1a5c015f + depends: + - python >=3.10 + - setuptools + license: BSD-3-Clause + license_family: BSD + size: 40866 + timestamp: 1766261270149 +- conda: https://conda.anaconda.org/conda-forge/linux-64/numpy-2.4.3-py314h2b28147_0.conda + sha256: f2ba8cb0d86a6461a6bcf0d315c80c7076083f72c6733c9290086640723f79ec + md5: 36f5b7eb328bdc204954a2225cf908e2 + depends: + - python + - libstdcxx >=14 + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + - python_abi 3.14.* *_cp314 + - libcblas >=3.9.0,<4.0a0 + - liblapack >=3.9.0,<4.0a0 + - libblas >=3.9.0,<4.0a0 + constrains: + - numpy-base <0a0 + license: BSD-3-Clause + license_family: BSD + size: 8927860 + timestamp: 1773839233468 +- conda: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.6.2-h35e630c_0.conda + sha256: c0ef482280e38c71a08ad6d71448194b719630345b0c9c60744a2010e8a8e0cb + md5: da1b85b6a87e141f5140bb9924cecab0 + depends: + - __glibc >=2.17,<3.0.a0 + - ca-certificates + - libgcc >=14 + license: Apache-2.0 + license_family: Apache + size: 3167099 + timestamp: 1775587756857 +- conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.9.6-pyhcf101f3_0.conda + sha256: 8f29915c172f1f7f4f7c9391cd5dac3ebf5d13745c8b7c8006032615246345a5 + md5: 89c0b6d1793601a2a3a3f7d2d3d8b937 + depends: + - python >=3.10 + - python + license: MIT + license_family: MIT + size: 25862 + timestamp: 1775741140609 +- conda: https://conda.anaconda.org/conda-forge/noarch/pre-commit-4.6.0-pyha770c72_0.conda + sha256: 716960bf0a9eb334458a26b3bdcb17b8d0786062138a4f48c7f335c8418c5d0b + md5: 7859736b4f8ebe6c8481bf48d91c9a1e + depends: + - cfgv >=2.0.0 + - identify >=1.0.0 + - nodeenv >=0.11.1 + - python >=3.10 + - pyyaml >=5.1 + - virtualenv >=20.10.0 + license: MIT + license_family: MIT + size: 201606 + timestamp: 1776858157327 +- conda: https://conda.anaconda.org/conda-forge/noarch/pycparser-2.22-pyh29332c3_1.conda + sha256: 79db7928d13fab2d892592223d7570f5061c192f27b9febd1a418427b719acc6 + md5: 12c566707c80111f9799308d9e265aef + depends: + - python >=3.9 + - python + license: BSD-3-Clause + license_family: BSD + size: 110100 + timestamp: 1733195786147 +- conda: https://conda.anaconda.org/conda-forge/linux-64/pyperf-2.9.0-py314hdafbbf9_0.conda + sha256: 438c41b42530874928733299ca815f5994f36996c86024f3f37ca220ed910a07 + md5: ed166875b3876d5d7e6e39d2e8d1c6e3 + depends: + - python >=3.14,<3.15.0a0 + - python_abi 3.14.* *_cp314 + - six + license: MIT + license_family: MIT + size: 273897 + timestamp: 1765980972868 +- conda: https://conda.anaconda.org/conda-forge/linux-64/python-3.14.4-habeac84_100_cp314.conda + build_number: 100 + sha256: dec247c5badc811baa34d6085df9d0465535883cf745e22e8d79092ad54a3a7b + md5: a443f87920815d41bfe611296e507995 + depends: + - __glibc >=2.17,<3.0.a0 + - bzip2 >=1.0.8,<2.0a0 + - ld_impl_linux-64 >=2.36.1 + - libexpat >=2.7.5,<3.0a0 + - libffi >=3.5.2,<3.6.0a0 + - libgcc >=14 + - liblzma >=5.8.2,<6.0a0 + - libmpdec >=4.0.0,<5.0a0 + - libsqlite >=3.52.0,<4.0a0 + - libuuid >=2.42,<3.0a0 + - libzlib >=1.3.2,<2.0a0 + - ncurses >=6.5,<7.0a0 + - openssl >=3.5.6,<4.0a0 + - python_abi 3.14.* *_cp314 + - readline >=8.3,<9.0a0 + - tk >=8.6.13,<8.7.0a0 + - tzdata + - zstd >=1.5.7,<1.6.0a0 + license: Python-2.0 + size: 36705460 + timestamp: 1775614357822 + python_site_packages_path: lib/python3.14/site-packages +- conda: https://conda.anaconda.org/conda-forge/noarch/python-discovery-1.2.2-pyhcf101f3_0.conda + sha256: 498ad019d75ba31c7891dc6d9efc8a7ed48cd5d5973f3a9377eb1b174577d3db + md5: feb2e11368da12d6ce473b6573efab41 + depends: + - python >=3.10 + - filelock >=3.15.4 + - platformdirs <5,>=4.3.6 + - python + license: MIT + license_family: MIT + size: 34341 + timestamp: 1775586706825 +- conda: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.14-8_cp314.conda + build_number: 8 + sha256: ad6d2e9ac39751cc0529dd1566a26751a0bf2542adb0c232533d32e176e21db5 + md5: 0539938c55b6b1a59b560e843ad864a4 + constrains: + - python 3.14.* *_cp314 + license: BSD-3-Clause + license_family: BSD + size: 6989 + timestamp: 1752805904792 +- conda: https://conda.anaconda.org/conda-forge/linux-64/pyyaml-6.0.3-py314h67df5f8_1.conda + sha256: b318fb070c7a1f89980ef124b80a0b5ccf3928143708a85e0053cde0169c699d + md5: 2035f68f96be30dc60a5dfd7452c7941 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - python >=3.14,<3.15.0a0 + - python_abi 3.14.* *_cp314 + - yaml >=0.2.5,<0.3.0a0 + license: MIT + license_family: MIT + size: 202391 + timestamp: 1770223462836 +- conda: https://conda.anaconda.org/conda-forge/linux-64/rdma-core-61.0-h192683f_0.conda + sha256: 8e0b7962cf8bec9a016cd91a6c6dc1f9ebc8e7e316b1d572f7b9047d0de54717 + md5: d487d93d170e332ab39803e05912a762 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libnl >=3.11.0,<4.0a0 + - libstdcxx >=14 + - libsystemd0 >=257.10 + - libudev1 >=257.10 + license: Linux-OpenIB + license_family: BSD + size: 1268666 + timestamp: 1769154883613 +- conda: https://conda.anaconda.org/conda-forge/linux-64/readline-8.3-h853b02a_0.conda + sha256: 12ffde5a6f958e285aa22c191ca01bbd3d6e710aa852e00618fa6ddc59149002 + md5: d7d95fc8287ea7bf33e0e7116d2b95ec + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - ncurses >=6.5,<7.0a0 + license: GPL-3.0-only + license_family: GPL + size: 345073 + timestamp: 1765813471974 +- conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0.conda + sha256: 82088a6e4daa33329a30bc26dc19a98c7c1d3f05c0f73ce9845d4eab4924e9e1 + md5: 8e194e7b992f99a5015edbd4ebd38efd + depends: + - python >=3.10 + license: MIT + license_family: MIT + size: 639697 + timestamp: 1773074868565 +- conda: https://conda.anaconda.org/conda-forge/noarch/six-1.17.0-pyhe01879c_1.conda + sha256: 458227f759d5e3fcec5d9b7acce54e10c9e1f4f4b7ec978f3bfd54ce4ee9853d + md5: 3339e3b65d58accf4ca4fb8748ab16b3 + depends: + - python >=3.9 + - python + license: MIT + license_family: MIT + size: 18455 + timestamp: 1753199211006 +- conda: https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_h366c992_103.conda + sha256: cafeec44494f842ffeca27e9c8b0c27ed714f93ac77ddadc6aaf726b5554ebac + md5: cffd3bdd58090148f4cfcd831f4b26ab + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libzlib >=1.3.1,<2.0a0 + constrains: + - xorg-libx11 >=1.8.12,<2.0a0 + license: TCL + license_family: BSD + size: 3301196 + timestamp: 1769460227866 +- conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.15.0-pyhcf101f3_0.conda + sha256: 032271135bca55aeb156cee361c81350c6f3fb203f57d024d7e5a1fc9ef18731 + md5: 0caa1af407ecff61170c9437a808404d + depends: + - python >=3.10 + - python + license: PSF-2.0 + license_family: PSF + size: 51692 + timestamp: 1756220668932 +- conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1.conda + sha256: 1d30098909076af33a35017eed6f2953af1c769e273a0626a04722ac4acaba3c + md5: ad659d0a2b3e47e38d829aa8cad2d610 + license: LicenseRef-Public-Domain + size: 119135 + timestamp: 1767016325805 +- conda: https://conda.anaconda.org/conda-forge/linux-64/ukkonen-1.1.0-py314h9891dd4_0.conda + sha256: c84034056dc938c853e4f61e72e5bd37e2ec91927a661fb9762f678cbea52d43 + md5: 5d3c008e54c7f49592fca9c32896a76f + depends: + - __glibc >=2.17,<3.0.a0 + - cffi + - libgcc >=14 + - libstdcxx >=14 + - python >=3.14,<3.15.0a0 + - python_abi 3.14.* *_cp314 + license: MIT + license_family: MIT + size: 15004 + timestamp: 1769438727085 +- conda: https://conda.anaconda.org/conda-forge/noarch/virtualenv-21.3.0-pyhcf101f3_0.conda + sha256: defaf2bc2a3cf6f1455149531e8be4d03e18eb1d022ffe4f4d964d49bbf0fe34 + md5: da6e70a64226740cef159121dbe40b95 + depends: + - python >=3.10 + - distlib >=0.3.7,<1 + - filelock <4,>=3.24.2 + - importlib-metadata >=6.6 + - platformdirs >=3.9.1,<5 + - python-discovery >=1 + - typing_extensions >=4.13.2 + - python + license: MIT + license_family: MIT + size: 5161814 + timestamp: 1777321763628 +- conda: https://conda.anaconda.org/conda-forge/linux-64/yaml-0.2.5-h280c20c_3.conda + sha256: 6d9ea2f731e284e9316d95fa61869fe7bbba33df7929f82693c121022810f4ad + md5: a77f85f77be52ff59391544bfe73390a + depends: + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + license: MIT + license_family: MIT + size: 85189 + timestamp: 1753484064210 +- conda: https://conda.anaconda.org/conda-forge/noarch/zipp-3.23.1-pyhcf101f3_0.conda + sha256: 523616c0530d305d2216c2b4a8dfd3872628b60083255b89c5e0d8c42e738cca + md5: e1c36c6121a7c9c76f2f148f1e83b983 + depends: + - python >=3.10 + - python + license: MIT + license_family: MIT + size: 24461 + timestamp: 1776131454755 +- conda: https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_6.conda + sha256: 68f0206ca6e98fea941e5717cec780ed2873ffabc0e1ed34428c061e2c6268c7 + md5: 4a13eeac0b5c8e5b8ab496e6c4ddd829 + depends: + - __glibc >=2.17,<3.0.a0 + - libzlib >=1.3.1,<2.0a0 + license: BSD-3-Clause + license_family: BSD + size: 601375 + timestamp: 1764777111296 diff --git a/benchmarks/cuda_core/pixi.toml b/benchmarks/cuda_core/pixi.toml new file mode 100644 index 00000000000..419dfd91b92 --- /dev/null +++ b/benchmarks/cuda_core/pixi.toml @@ -0,0 +1,52 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +[workspace] +channels = ["conda-forge"] +platforms = ["linux-64"] +preview = ["pixi-build"] +channel-priority = "disabled" + +[feature.cu13.system-requirements] +cuda = "13" + +[feature.cu13-pinned.dependencies] +cuda-version = "13.1.*" + +[feature.cu13-source.dependencies] +cuda-version = "13.*" + +[feature.bench.dependencies] +python = "3.14.*" +pyperf = "*" +numpy = "*" + +[feature.dev.dependencies] +pre-commit = "*" + +# Wheel environment: released cuda-core from conda-forge. +[feature.core-wheel.dependencies] +cuda-core = "==0.7.0" + +# Source environment: build cuda-core + cuda-bindings from the in-tree +# sources so local changes are exercised. Mirrors cuda_core/pixi.toml. +[feature.core-source.dependencies] +cuda-core = { path = "../../cuda_core" } +cuda-bindings = { path = "../../cuda_bindings" } + +[environments] +wheel = { features = ["cu13", "cu13-pinned", "bench", "dev", "core-wheel"] } +source = { features = ["cu13", "cu13-source", "bench", "dev", "core-source"] } + +[target.linux.tasks.bench] +cmd = ["python", "$PIXI_PROJECT_ROOT/run_pyperf.py"] + +[target.linux.tasks.bench-smoke-test] +cmd = ["python", "$PIXI_PROJECT_ROOT/run_pyperf.py", "--debug-single-value"] + +[target.linux.tasks.bench-compare] +cmd = ["python", "$PIXI_PROJECT_ROOT/compare.py"] + +[target.linux.tasks.lint] +cmd = ["pre-commit", "run", "--all-files"] diff --git a/benchmarks/cuda_core/run_pyperf.py b/benchmarks/cuda_core/run_pyperf.py new file mode 100644 index 00000000000..1f0c4b130b1 --- /dev/null +++ b/benchmarks/cuda_core/run_pyperf.py @@ -0,0 +1,32 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +"""Entry point for the cuda.core latency benchmark suite. + +The pyperf runner lives in the cuda_bindings suite. Reuse it by putting +that directory on sys.path, then call main() with this suite's paths. +pyperf workers re-execute this script, so the sys.path tweak is done +before the worker can import anything. +""" + +import sys +from pathlib import Path + +HERE = Path(__file__).resolve().parent +CUDA_BINDINGS_SUITE = HERE.parent / "cuda_bindings" + +# Share the runner with cuda_bindings; keep cuda_core's own modules +# (benchmarks/, runtime.py) resolvable via the script's own directory. +if str(CUDA_BINDINGS_SUITE) not in sys.path: + sys.path.append(str(CUDA_BINDINGS_SUITE)) + +from runner.main import main + +if __name__ == "__main__": + main( + bench_dir=HERE / "benchmarks", + default_output=HERE / "results-python.json", + module_name_prefix="cuda_core_bench", + bench_filter_env_var="CUDA_CORE_BENCH_FILTER", + ) diff --git a/benchmarks/cuda_core/runtime.py b/benchmarks/cuda_core/runtime.py new file mode 100644 index 00000000000..d2942f40240 --- /dev/null +++ b/benchmarks/cuda_core/runtime.py @@ -0,0 +1,53 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +"""Shared cuda.core setup for the latency benchmarks. + +Holds the one Device/stream/ObjectCode instance that every bench module +reuses. No state is shared with the cuda_bindings suite — each suite +runs standalone in its own process. +""" + +import atexit + +from cuda.core import Device, Program, ProgramOptions + +_device: Device | None = None +_modules: list = [] + + +def ensure_device() -> Device: + """Return the primary Device, initializing it on first call.""" + global _device + if _device is not None: + return _device + dev = Device() + dev.set_current() + _device = dev + return dev + + +def register_module(module) -> object: + """Keep a reference to an ObjectCode so its kernels stay alive.""" + _modules.append(module) + return module + + +def compile_module(kernel_source: str, name_expressions: tuple[str, ...]) -> object: + """Compile a CUDA C++ source with NVRTC via cuda.core.Program. + + name_expressions must list every __global__ function the caller + intends to fetch via ObjectCode.get_kernel(). + """ + dev = ensure_device() + options = ProgramOptions(arch=f"sm_{dev.arch}", fma=False) + prog = Program(kernel_source, code_type="c++", options=options) + return register_module(prog.compile("cubin", name_expressions=name_expressions)) + + +def cleanup() -> None: + _modules.clear() + + +atexit.register(cleanup) diff --git a/ci/test-matrix.yml b/ci/test-matrix.yml index b1adcee61aa..cd0944f2000 100644 --- a/ci/test-matrix.yml +++ b/ci/test-matrix.yml @@ -1,10 +1,10 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # 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. +# and ARCH values are hard-coded for each architecture: various GPUs for amd64, +# alternating a100/l4 for arm64. # # Please keep the matrices sorted in ascending order by the following: # @@ -13,74 +13,136 @@ # Windows entries also include DRIVER_MODE. # # Notes: +# - DRIVER accepts: +# * 'latest' - use the runner's pre-installed latest driver (no install step) +# * 'earliest' - use the runner's pre-installed earliest driver (no install step) +# * a version string (e.g. '580.65.06') +# - install that version via ci/tools/install_gpu_driver.sh (Linux) +# or ci/tools/install_gpu_driver.ps1 (Windows) at the start of the +# job. The matrix row is routed to the 'latest' runner image (the +# install scripts swap the driver themselves). # - DRIVER: 'earliest' does not work with CUDA 12.9.1 +# - DRIVER: a custom version is not supported with FLAVOR=wsl on Linux. +# - ENV: optional map of extra environment variables to inject into the test +# job. Every key/value pair is written to GITHUB_ENV after the standard +# environment-variable setup step, so the variables are visible to all +# subsequent steps (including the cuda.bindings and cuda.core test +# steps). Nightly rows also use ENV.MODE as a matrix-filter tag (see +# ci-nightly.yml). Examples: +# ENV: { CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM: '1' } +# ENV: { MODE: 'nightly-pytorch', TORCH_VER: '2.12.1', TORCH_CUDA: 'cu126' } linux: pull-request: # linux-64 - { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '12.9.1', LOCAL_CTK: '1', GPU: 'v100', GPU_COUNT: '1', DRIVER: 'latest' } - { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '13.0.2', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } - - { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '13.2.0', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } + - { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '13.3.0', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } - { ARCH: 'amd64', PY_VER: '3.11', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 'rtxpro6000', GPU_COUNT: '1', DRIVER: 'latest' } - { ARCH: 'amd64', PY_VER: '3.11', CUDA_VER: '13.0.2', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } - - { ARCH: 'amd64', PY_VER: '3.11', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } - - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '12.9.1', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } + - { ARCH: 'amd64', PY_VER: '3.11', CUDA_VER: '13.3.0', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } + - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '12.9.1', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', ENV: { CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM: '1' } } - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '13.0.2', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } - - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '13.2.0', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } + - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '13.3.0', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } - { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 'v100', GPU_COUNT: '1', DRIVER: 'latest' } - { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '13.0.2', LOCAL_CTK: '1', GPU: 'rtxpro6000', GPU_COUNT: '1', DRIVER: 'latest' } - - { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'rtxpro6000', GPU_COUNT: '1', DRIVER: 'latest' } + - { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '13.3.0', LOCAL_CTK: '1', GPU: 'rtxpro6000', GPU_COUNT: '1', DRIVER: '610.43.02' } - { ARCH: 'amd64', PY_VER: '3.14', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 't4', GPU_COUNT: '1', DRIVER: 'latest' } - { ARCH: 'amd64', PY_VER: '3.14', CUDA_VER: '13.0.2', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } - - { ARCH: 'amd64', PY_VER: '3.14', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } + - { ARCH: 'amd64', PY_VER: '3.14', CUDA_VER: '13.3.0', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: '610.43.02' } - { ARCH: 'amd64', PY_VER: '3.14t', CUDA_VER: '12.9.1', LOCAL_CTK: '1', GPU: 't4', GPU_COUNT: '1', DRIVER: 'latest' } - { ARCH: 'amd64', PY_VER: '3.14t', CUDA_VER: '13.0.2', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } - - { ARCH: 'amd64', PY_VER: '3.14t', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } + - { ARCH: 'amd64', PY_VER: '3.14t', CUDA_VER: '13.3.0', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } + - { ARCH: 'amd64', PY_VER: '3.15', CUDA_VER: '13.3.0', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } + - { ARCH: 'amd64', PY_VER: '3.15t', CUDA_VER: '13.3.0', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } # linux-aarch64 - { ARCH: 'arm64', PY_VER: '3.10', CUDA_VER: '12.9.1', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' } - - { ARCH: 'arm64', PY_VER: '3.10', CUDA_VER: '13.0.2', LOCAL_CTK: '0', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' } - - { ARCH: 'arm64', PY_VER: '3.10', CUDA_VER: '13.2.0', LOCAL_CTK: '0', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' } - - { ARCH: 'arm64', PY_VER: '3.11', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.10', CUDA_VER: '13.0.2', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.10', CUDA_VER: '13.3.0', LOCAL_CTK: '0', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.11', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } - { ARCH: 'arm64', PY_VER: '3.11', CUDA_VER: '13.0.2', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' } - - { ARCH: 'arm64', PY_VER: '3.11', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.11', CUDA_VER: '13.3.0', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } - { ARCH: 'arm64', PY_VER: '3.12', CUDA_VER: '12.9.1', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' } - - { ARCH: 'arm64', PY_VER: '3.12', CUDA_VER: '13.0.2', LOCAL_CTK: '0', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' } - - { ARCH: 'arm64', PY_VER: '3.12', CUDA_VER: '13.2.0', LOCAL_CTK: '0', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' } - - { ARCH: 'arm64', PY_VER: '3.13', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.12', CUDA_VER: '13.0.2', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.12', CUDA_VER: '13.3.0', LOCAL_CTK: '0', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.13', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } - { ARCH: 'arm64', PY_VER: '3.13', CUDA_VER: '13.0.2', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' } - - { ARCH: 'arm64', PY_VER: '3.13', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.13', CUDA_VER: '13.3.0', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } - { ARCH: 'arm64', PY_VER: '3.14', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' } - - { ARCH: 'arm64', PY_VER: '3.14', CUDA_VER: '13.0.2', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' } - - { ARCH: 'arm64', PY_VER: '3.14', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' } - - { ARCH: 'arm64', PY_VER: '3.14t', CUDA_VER: '12.9.1', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.14', CUDA_VER: '13.0.2', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.14', CUDA_VER: '13.3.0', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.14t', CUDA_VER: '12.9.1', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } - { ARCH: 'arm64', PY_VER: '3.14t', CUDA_VER: '13.0.2', LOCAL_CTK: '0', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' } - - { ARCH: 'arm64', PY_VER: '3.14t', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.14t', CUDA_VER: '13.3.0', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' } # special runners - { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '13.0.2', LOCAL_CTK: '1', GPU: 'h100', GPU_COUNT: '1', DRIVER: 'latest' } - - { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'h100', GPU_COUNT: '1', DRIVER: 'latest' } - - { ARCH: 'amd64', PY_VER: '3.14', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 't4', GPU_COUNT: '2', DRIVER: 'latest' } - - { ARCH: 'amd64', PY_VER: '3.14t', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'h100', GPU_COUNT: '2', DRIVER: 'latest' } - nightly: [] + - { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '13.3.0', LOCAL_CTK: '1', GPU: 'h100', GPU_COUNT: '1', DRIVER: 'latest' } + - { ARCH: 'amd64', PY_VER: '3.14', CUDA_VER: '13.3.0', LOCAL_CTK: '1', GPU: 't4', GPU_COUNT: '2', DRIVER: 'latest' } + - { ARCH: 'amd64', PY_VER: '3.14t', CUDA_VER: '13.3.0', LOCAL_CTK: '1', GPU: 'h100', GPU_COUNT: '2', DRIVER: 'latest' } + - { ARCH: 'amd64', PY_VER: '3.11', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 't4', GPU_COUNT: '1', DRIVER: 'latest', FLAVOR: 'wsl' } + - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '13.3.0', LOCAL_CTK: '0', GPU: 'rtx4090', GPU_COUNT: '1', DRIVER: 'latest', FLAVOR: 'wsl' } + nightly: + # nightly-pytorch + - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '12.6.3', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', ENV: { MODE: 'nightly-pytorch', TORCH_VER: '2.12.1', TORCH_CUDA: 'cu126' } } + - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '13.0.2', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', ENV: { MODE: 'nightly-pytorch', TORCH_VER: '2.12.1', TORCH_CUDA: 'cu130' } } + - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '12.6.3', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', ENV: { MODE: 'nightly-pytorch', TORCH_VER: '2.9.1', TORCH_CUDA: 'cu126' } } + - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '13.0.2', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', ENV: { MODE: 'nightly-pytorch', TORCH_VER: '2.9.1', TORCH_CUDA: 'cu130' } } + - { ARCH: 'arm64', PY_VER: '3.12', CUDA_VER: '12.6.3', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', ENV: { MODE: 'nightly-pytorch', TORCH_VER: '2.12.1', TORCH_CUDA: 'cu126' } } + - { ARCH: 'arm64', PY_VER: '3.12', CUDA_VER: '13.0.2', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', ENV: { MODE: 'nightly-pytorch', TORCH_VER: '2.12.1', TORCH_CUDA: 'cu130' } } + - { ARCH: 'arm64', PY_VER: '3.12', CUDA_VER: '12.6.3', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', ENV: { MODE: 'nightly-pytorch', TORCH_VER: '2.9.1', TORCH_CUDA: 'cu126' } } + - { ARCH: 'arm64', PY_VER: '3.12', CUDA_VER: '13.0.2', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', ENV: { MODE: 'nightly-pytorch', TORCH_VER: '2.9.1', TORCH_CUDA: 'cu130' } } + # nightly-numba-cuda + - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', ENV: { MODE: 'nightly-numba-cuda' } } + - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '13.3.0', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: '580.65.06', ENV: { MODE: 'nightly-numba-cuda' } } + - { ARCH: 'arm64', PY_VER: '3.12', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', ENV: { MODE: 'nightly-numba-cuda' } } + - { ARCH: 'arm64', PY_VER: '3.12', CUDA_VER: '13.3.0', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', ENV: { MODE: 'nightly-numba-cuda' } } + # nightly-numba-cuda-mlir (MLIR backend, linux-64 only) + - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 'rtxpro6000', GPU_COUNT: '1', DRIVER: 'latest', ENV: { MODE: 'nightly-numba-cuda-mlir' } } + - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '13.3.0', LOCAL_CTK: '0', GPU: 'rtxpro6000', GPU_COUNT: '1', DRIVER: 'latest', ENV: { MODE: 'nightly-numba-cuda-mlir' } } + # nightly-cuda-core (released cuda-core from PyPI against main pathfinder/bindings) + - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '13.3.0', LOCAL_CTK: '0', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest', ENV: { MODE: 'nightly-cuda-core' } } + # nightly-standard (arm64 nightly-only runners — per runner team request) + # TODO: gh200 row disabled — currently hangs on stream-ordered memory + # allocator (cudaMallocAsync); runner pool needs fixing first. + # - { ARCH: 'arm64', PY_VER: '3.14', CUDA_VER: '13.3.0', LOCAL_CTK: '1', GPU: 'gh200', GPU_COUNT: '1', DRIVER: 'latest', ENV: { MODE: 'nightly-standard' } } + - { ARCH: 'arm64', PY_VER: '3.14', CUDA_VER: '13.3.0', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '2', DRIVER: 'latest', ENV: { MODE: 'nightly-standard' } } + - { ARCH: 'arm64', PY_VER: '3.14t', CUDA_VER: '13.3.0', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '2', DRIVER: 'latest', ENV: { MODE: 'nightly-standard' } } windows: pull-request: # win-64 - { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 'rtx2080', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'WDDM' } - { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '13.0.2', LOCAL_CTK: '1', GPU: 'rtxpro6000', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'TCC' } - - { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'rtxpro6000', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'TCC' } + - { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '13.3.0', LOCAL_CTK: '1', GPU: 'rtxpro6000', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'TCC' } - { ARCH: 'amd64', PY_VER: '3.11', CUDA_VER: '12.9.1', LOCAL_CTK: '1', GPU: 'v100', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'MCDM' } - { ARCH: 'amd64', PY_VER: '3.11', CUDA_VER: '13.0.2', LOCAL_CTK: '0', GPU: 'rtx4090', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'WDDM' } - - { ARCH: 'amd64', PY_VER: '3.11', CUDA_VER: '13.2.0', LOCAL_CTK: '0', GPU: 'rtx4090', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'WDDM' } + - { ARCH: 'amd64', PY_VER: '3.11', CUDA_VER: '13.3.0', LOCAL_CTK: '0', GPU: 'rtx4090', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'WDDM' } - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'MCDM' } - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '13.0.2', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'TCC' } - - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'TCC' } + - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '13.3.0', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'TCC' } - { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '12.9.1', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'TCC' } - { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '13.0.2', LOCAL_CTK: '0', GPU: 'rtxpro6000', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'MCDM' } - - { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '13.2.0', LOCAL_CTK: '0', GPU: 'rtxpro6000', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'MCDM' } + - { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '13.3.0', LOCAL_CTK: '0', GPU: 'rtxpro6000', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'MCDM', ENV: { CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM: '1' } } - { ARCH: 'amd64', PY_VER: '3.14', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 'v100', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'TCC' } - { ARCH: 'amd64', PY_VER: '3.14', CUDA_VER: '13.0.2', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'MCDM' } - - { ARCH: 'amd64', PY_VER: '3.14', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'MCDM' } + - { ARCH: 'amd64', PY_VER: '3.14', CUDA_VER: '13.3.0', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'MCDM' } - { ARCH: 'amd64', PY_VER: '3.14t', CUDA_VER: '12.9.1', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'TCC' } - { ARCH: 'amd64', PY_VER: '3.14t', CUDA_VER: '13.0.2', LOCAL_CTK: '0', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'MCDM' } - - { ARCH: 'amd64', PY_VER: '3.14t', CUDA_VER: '13.2.0', LOCAL_CTK: '0', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'MCDM' } - nightly: [] + - { ARCH: 'amd64', PY_VER: '3.14t', CUDA_VER: '13.3.0', LOCAL_CTK: '0', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'MCDM' } + # special runners + - { ARCH: 'amd64', PY_VER: '3.14', CUDA_VER: '13.3.0', LOCAL_CTK: '1', GPU: 't4', GPU_COUNT: '2', DRIVER: 'latest', DRIVER_MODE: 'TCC' } + - { ARCH: 'amd64', PY_VER: '3.14', CUDA_VER: '13.3.0', LOCAL_CTK: '0', GPU: 'h100', GPU_COUNT: '2', DRIVER: 'latest', DRIVER_MODE: 'MCDM' } + nightly: + # nightly-pytorch + - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '12.6.3', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'TCC', ENV: { MODE: 'nightly-pytorch', TORCH_VER: '2.12.1', TORCH_CUDA: 'cu126' } } + - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '13.0.2', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'TCC', ENV: { MODE: 'nightly-pytorch', TORCH_VER: '2.12.1', TORCH_CUDA: 'cu130' } } + - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '12.6.3', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'TCC', ENV: { MODE: 'nightly-pytorch', TORCH_VER: '2.9.1', TORCH_CUDA: 'cu126' } } + - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '13.0.2', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'TCC', ENV: { MODE: 'nightly-pytorch', TORCH_VER: '2.9.1', TORCH_CUDA: 'cu130' } } + # nightly-numba-cuda + - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'TCC', ENV: { MODE: 'nightly-numba-cuda' } } + - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '13.3.0', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: '596.36', DRIVER_MODE: 'TCC', ENV: { MODE: 'nightly-numba-cuda' } } + # nightly-numba-cuda-mlir (MLIR backend, win-64) + - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 'rtxpro6000', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'MCDM', ENV: { MODE: 'nightly-numba-cuda-mlir' } } + - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '13.3.0', LOCAL_CTK: '0', GPU: 'rtxpro6000', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'MCDM', ENV: { MODE: 'nightly-numba-cuda-mlir' } } + # nightly-cuda-core (released cuda-core from PyPI against main pathfinder/bindings) + - { ARCH: 'amd64', PY_VER: '3.14', CUDA_VER: '13.3.0', LOCAL_CTK: '0', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'MCDM', ENV: { MODE: 'nightly-cuda-core' } } diff --git a/ci/tools/check_release_notes.py b/ci/tools/check_release_notes.py new file mode 100644 index 00000000000..75d2c9871f0 --- /dev/null +++ b/ci/tools/check_release_notes.py @@ -0,0 +1,256 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""Check that versioned release-notes files exist before releasing. + +Usage: + python check_release_notes.py --git-tag --component + +Exit codes: + 0 — release notes present and non-empty (or .post version, skipped) + 1 — release notes missing or empty + 2 — invalid arguments (including unparsable tag, or component/tag-prefix mismatch) +""" + +from __future__ import annotations + +import argparse +import os +import re +import sys + +COMPONENT_TO_PACKAGE: dict[str, str] = { + "cuda-core": "cuda_core", + "cuda-bindings": "cuda_bindings", + "cuda-pathfinder": "cuda_pathfinder", + "cuda-python": "cuda_python", +} + +# Version characters are restricted to digit-prefixed word chars and dots, so +# malformed inputs like "v../evil" or "v1/2/3" cannot flow into the notes path. +_VERSION_PATTERN = r"\d[\w.]*" + +# Each component has exactly one valid tag-prefix form. cuda-bindings and +# cuda-python share the bare "v" namespace (setuptools-scm lookup). +COMPONENT_TO_TAG_RE: dict[str, re.Pattern[str]] = { + "cuda-bindings": re.compile(rf"^v(?P{_VERSION_PATTERN})$"), + "cuda-python": re.compile(rf"^v(?P{_VERSION_PATTERN})$"), + "cuda-core": re.compile(rf"^cuda-core-v(?P{_VERSION_PATTERN})$"), + "cuda-pathfinder": re.compile(rf"^cuda-pathfinder-v(?P{_VERSION_PATTERN})$"), +} + +BACKPORT_PLANNING_COMPONENTS = frozenset({"cuda-bindings", "cuda-python"}) +BACKPORT_NOT_PLANNED = "not planned" +BACKPORT_BRANCH_RE = re.compile(r"""^backport_branch:\s*["']?(?P[^"'\s#]+)""") +BACKPORT_BRANCH_NAME_RE = re.compile(r"^\d+\.\d+\.x$") + + +def parse_version_from_tag(git_tag: str, component: str) -> str | None: + """Extract the version string from a tag, given the target component. + + Returns None if the tag does not match the component's expected prefix + or contains characters outside the allowed version set. + """ + pattern = COMPONENT_TO_TAG_RE.get(component) + if pattern is None: + return None + m = pattern.match(git_tag) + return m.group("version") if m else None + + +def is_post_release(version: str) -> bool: + return ".post" in version + + +def load_backport_branch(repo_root: str = ".") -> str | None: + path = os.path.join(repo_root, "ci", "versions.yml") + try: + with open(path, encoding="utf-8") as f: + for line in f: + m = BACKPORT_BRANCH_RE.match(line.strip()) + if m: + return m.group("branch") + except FileNotFoundError: + pass + github_ref_name = os.environ.get("GITHUB_REF_NAME", "") + if BACKPORT_BRANCH_NAME_RE.match(github_ref_name): + return github_ref_name + return None + + +def is_backport_version(version: str, backport_branch: str) -> bool: + if backport_branch.endswith(".x"): + return version.startswith(backport_branch[:-1]) + return version == backport_branch + + +def notes_path(package: str, version: str) -> str: + return os.path.join(package, "docs", "source", "release", f"{version}-notes.rst") + + +def check_release_notes(git_tag: str, component: str, repo_root: str = ".") -> list[tuple[str, str]]: + """Return a list of (path, reason) for missing or empty release notes. + + Returns an empty list when notes are present and non-empty, or when the + tag is a .post release (no new notes required). + """ + if component not in COMPONENT_TO_PACKAGE: + return [("", f"unknown component '{component}'")] + + version = parse_version_from_tag(git_tag, component) + if version is None: + return [("", f"cannot parse version from tag '{git_tag}' for component '{component}'")] + + if is_post_release(version): + return [] + + path = notes_path(COMPONENT_TO_PACKAGE[component], version) + full = os.path.join(repo_root, path) + if not os.path.isfile(full): + return [(path, "missing")] + if os.path.getsize(full) == 0: + return [(path, "empty")] + return [] + + +def write_step_summary(message: str) -> None: + summary_path = os.environ.get("GITHUB_STEP_SUMMARY") + if not summary_path: + return + with open(summary_path, "a", encoding="utf-8") as f: + f.write(message) + if not message.endswith("\n"): + f.write("\n") + + +def warn_missing_backport_notes(git_tag: str, component: str, problems: list[tuple[str, str]]) -> None: + print(f"WARNING: missing or empty release notes for backport tag {git_tag}:") + summary_lines = [ + "## Release Notes Reminder", + "", + f"Backport release `{git_tag}` for `{component}` is allowed to continue,", + "but the following release-note files are missing or empty in the workflow source:", + "", + ] + for path, reason in problems: + print(f"::warning file={path}::Release notes for backport tag {git_tag} are {reason}.") + print(f" - {path} ({reason})") + summary_lines.append(f"- `{path}` ({reason})") + summary_lines.extend(["", "Please add the backport release notes on `main` if they are not already present."]) + write_step_summary("\n".join(summary_lines)) + + +def validate_backport_decision( + *, + git_tag: str, + component: str, + version: str, + backport_git_tag: str, + backport_branch: str | None, + repo_root: str, +) -> tuple[int | None, list[tuple[str, str]]]: + if component not in BACKPORT_PLANNING_COMPONENTS or is_post_release(version): + return None, [] + + if backport_branch is None: + print("ERROR: cannot determine backport branch from ci/versions.yml or GITHUB_REF_NAME.", file=sys.stderr) + return 2, [] + + if is_backport_version(version, backport_branch): + problems = check_release_notes(git_tag, component, repo_root) + if problems: + warn_missing_backport_notes(git_tag, component, problems) + else: + print(f"Release notes present for backport tag {git_tag}, component {component}.") + return 0, [] + + decision = backport_git_tag.strip() + if not decision: + return ( + 1, + [ + ( + "", + f"required for {component} mainline releases; use a backport tag or '{BACKPORT_NOT_PLANNED}'", + ) + ], + ) + + if decision == BACKPORT_NOT_PLANNED: + print(f"Backport release not planned for {git_tag}, skipping backport release-notes check.") + return None, [] + + backport_version = parse_version_from_tag(decision, component) + if backport_version is None: + print( + f"ERROR: backport tag {decision!r} does not match the expected format for component {component!r}.", + file=sys.stderr, + ) + return 2, [] + + if not is_backport_version(backport_version, backport_branch): + print( + f"ERROR: backport tag {decision!r} does not match configured backport branch {backport_branch!r}.", + file=sys.stderr, + ) + return 2, [] + + problems = check_release_notes(decision, component, repo_root) + if problems: + return 1, problems + return None, [] + + +def main(argv: list[str] | None = None) -> int: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--git-tag", required=True) + parser.add_argument("--component", required=True, choices=list(COMPONENT_TO_PACKAGE)) + parser.add_argument("--repo-root", default=".") + parser.add_argument("--backport-git-tag", default="") + parser.add_argument("--backport-branch", default="") + args = parser.parse_args(argv) + + version = parse_version_from_tag(args.git_tag, args.component) + if version is None: + print( + f"ERROR: tag {args.git_tag!r} does not match the expected format for component {args.component!r}.", + file=sys.stderr, + ) + return 2 + + if is_post_release(version): + print(f"Post-release tag ({args.git_tag}), skipping release-notes check.") + return 0 + + backport_branch = args.backport_branch or load_backport_branch(args.repo_root) + rc, problems = validate_backport_decision( + git_tag=args.git_tag, + component=args.component, + version=version, + backport_git_tag=args.backport_git_tag, + backport_branch=backport_branch, + repo_root=args.repo_root, + ) + if rc is not None: + if problems: + print(f"ERROR: release notes policy failed for tag {args.git_tag}:", file=sys.stderr) + for path, reason in problems: + print(f" - {path} ({reason})", file=sys.stderr) + return rc + + if not problems: + problems = check_release_notes(args.git_tag, args.component, args.repo_root) + + if not problems: + print(f"Release notes present for tag {args.git_tag}, component {args.component}.") + return 0 + + print(f"ERROR: missing or empty release notes for tag {args.git_tag}:", file=sys.stderr) + for path, reason in problems: + print(f" - {path} ({reason})", file=sys.stderr) + print("Add versioned release notes before releasing.", file=sys.stderr) + return 1 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/ci/tools/configure_driver_mode.ps1 b/ci/tools/configure_driver_mode.ps1 new file mode 100644 index 00000000000..b055ca39102 --- /dev/null +++ b/ci/tools/configure_driver_mode.ps1 @@ -0,0 +1,62 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# configure_driver_mode.ps1 -- set the NVIDIA driver mode on a Windows CI +# runner and cycle the display devices so the new mode takes effect +# without rebooting. Always runs (whether or not install_gpu_driver.ps1 +# just ran). When install_gpu_driver.ps1 has run, this single device +# cycle also activates the freshly-installed driver. +# +# Inputs (env): +# DRIVER_MODE One of WDDM, TCC, MCDM. + +function Set-DriverMode { + + # Map matrix DRIVER_MODE to nvidia-smi -fdm code. + # This assumes we have the prior knowledge on which GPU can use which mode. + $driver_mode = $env:DRIVER_MODE + if ($driver_mode -eq "WDDM") { + Write-Output "Setting driver mode to WDDM..." + nvidia-smi -fdm 0 + } elseif ($driver_mode -eq "TCC") { + Write-Output "Setting driver mode to TCC..." + nvidia-smi -fdm 1 + } elseif ($driver_mode -eq "MCDM") { + Write-Output "Setting driver mode to MCDM..." + nvidia-smi -fdm 2 + } else { + Write-Output "Unknown driver mode: $driver_mode" + exit 1 + } + + # Only restart NVIDIA display adapters, not other display devices (e.g. QEMU VGA). + $nvidia_devices = @(Get-PnpDevice -Class Display -FriendlyName "NVIDIA*") + $gpu_count = $nvidia_devices.Count + foreach ($device in $nvidia_devices) { + Write-Output "Restarting device: $($device.FriendlyName) ($($device.InstanceId))" + pnputil /disable-device "$($device.InstanceId)" + pnputil /enable-device "$($device.InstanceId)" + } + + # Initial settle after the device cycle. + Start-Sleep -Seconds 5 + + # Poll nvidia-smi for N consecutive successes (N == cycled GPUs) + # so a mid-init "ok" flap doesn't fool the loop; bail after ~60s. + Write-Output "Waiting for nvidia-smi/NVML to come back up after device cycle..." + $deadline = (Get-Date).AddSeconds(60) + $consecutive_ok = 0 + do { + Start-Sleep -Seconds 3 + & nvidia-smi.exe 2>&1 | Out-Null + if ($LASTEXITCODE -eq 0) { $consecutive_ok++ } else { $consecutive_ok = 0 } + } while ($consecutive_ok -lt $gpu_count -and (Get-Date) -lt $deadline) + if ($consecutive_ok -lt $gpu_count) { + Write-Error "nvidia-smi did not return cleanly $gpu_count times in a row within 60s of the device cycle" + exit 1 + } +} + +# Run the functions +Set-DriverMode diff --git a/ci/tools/download-wheels b/ci/tools/download-wheels index a3141afb33b..20f31fb73d5 100755 --- a/ci/tools/download-wheels +++ b/ci/tools/download-wheels @@ -56,6 +56,13 @@ do continue fi + # TODO: remove the Python 3.15 exclusion once 3.15 is officially supported + # exclude pre-release Python (3.15) wheels from releasing + if [[ "${p}" == *python315* ]]; then + echo "Skipping pre-release Python artifact: $p" + continue + fi + # If we're not downloading "all", only process matching component if [[ "$COMPONENT" != "all" && "$p" != ${COMPONENT}* ]]; then continue diff --git a/ci/tools/env-vars b/ci/tools/env-vars index bbc3ed66c50..8ffbfa13472 100755 --- a/ci/tools/env-vars +++ b/ci/tools/env-vars @@ -34,6 +34,7 @@ CUDA_CORE_ARTIFACT_BASENAME="cuda-core-python${PYTHON_VERSION_FORMATTED}-${HOST_ echo "CUDA_CORE_ARTIFACT_NAME=${CUDA_CORE_ARTIFACT_BASENAME}-${SHA}" echo "CUDA_CORE_ARTIFACTS_DIR=$(realpath "${REPO_DIR}/cuda_core/dist")" echo "CUDA_CORE_CYTHON_TESTS_DIR=$(realpath "${REPO_DIR}/cuda_core/tests/cython")" + echo "CUDA_CORE_TEST_BINARIES_DIR=$(realpath "${REPO_DIR}/cuda_core/tests/test_binaries")" echo "PYTHON_VERSION_FORMATTED=${PYTHON_VERSION_FORMATTED}" } >> $GITHUB_ENV @@ -52,24 +53,44 @@ elif [[ "${1}" == "test" ]]; then BUILD_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${BUILD_CUDA_VER})" TEST_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${CUDA_VER})" CUDA_BINDINGS_ARTIFACT_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${BUILD_CUDA_VER}-${HOST_PLATFORM}" + + # BINDINGS_SOURCE controls which cuda-bindings to install at test time: + # main — use the just-built bindings wheel from this CI run + # backport — fetch bindings from the prior (N-1) branch + # published — install from PyPI (cuda-bindings==${TEST_CUDA_MAJOR}.${TEST_CUDA_MINOR}.*) + # + # SKIP_CUDA_BINDINGS_TEST / SKIP_CYTHON_TEST control which *tests* to run + # (they do NOT affect installation — that's BINDINGS_SOURCE's job). + + BUILD_CUDA_MINOR="$(cut -d '.' -f 2 <<< ${BUILD_CUDA_VER})" + TEST_CUDA_MINOR="$(cut -d '.' -f 2 <<< ${CUDA_VER})" + if [[ ${BUILD_CUDA_MAJOR} != ${TEST_CUDA_MAJOR} ]]; then + # Major mismatch (e.g. build=13.x, test=12.x): use the backport branch. + BINDINGS_SOURCE=backport + SKIP_CUDA_BINDINGS_TEST=1 + SKIP_CYTHON_TEST=1 + elif [[ ${BUILD_CUDA_MINOR} != ${TEST_CUDA_MINOR} ]]; then + # Same major, minor mismatch (e.g. build=13.2, test=13.0): use published + # bindings from PyPI to test the real-world backward-compat scenario. + BINDINGS_SOURCE=published SKIP_CUDA_BINDINGS_TEST=1 SKIP_CYTHON_TEST=1 else - SKIP_CUDA_BINDINGS_TEST=0 - BUILD_CUDA_MINOR="$(cut -d '.' -f 2 <<< ${BUILD_CUDA_VER})" - TEST_CUDA_MINOR="$(cut -d '.' -f 2 <<< ${CUDA_VER})" - if [[ ${BUILD_CUDA_MINOR} != ${TEST_CUDA_MINOR} ]]; then - SKIP_CYTHON_TEST=1 + # Exact match: use the just-built bindings wheel. + BINDINGS_SOURCE=main + if [[ "${SKIP_BINDINGS_TEST_OVERRIDE:-0}" == "1" ]]; then + SKIP_CUDA_BINDINGS_TEST=1 else - SKIP_CYTHON_TEST=0 + SKIP_CUDA_BINDINGS_TEST=0 fi + SKIP_CYTHON_TEST=0 fi # We don't test compute-sanitizer on CTK<12 because backporting fixes is too much effort # 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 $TEST_CUDA_MAJOR)" >> $GITHUB_ENV + echo "LATEST_CUDA_VERSION=$(bash ci/tools/guess_latest.sh $TEST_CUDA_MAJOR)" >> $GITHUB_ENV SETUP_SANITIZER=1 else SETUP_SANITIZER=0 @@ -77,9 +98,11 @@ elif [[ "${1}" == "test" ]]; then fi { echo "SETUP_SANITIZER=${SETUP_SANITIZER}" + echo "BINDINGS_SOURCE=${BINDINGS_SOURCE}" echo "SKIP_CUDA_BINDINGS_TEST=${SKIP_CUDA_BINDINGS_TEST}" echo "SKIP_CYTHON_TEST=${SKIP_CYTHON_TEST}" echo "TEST_CUDA_MAJOR=${TEST_CUDA_MAJOR}" + echo "TEST_CUDA_MINOR=${TEST_CUDA_MINOR}" } >> $GITHUB_ENV fi diff --git a/ci/tools/fetch_ctk_redistrib.py b/ci/tools/fetch_ctk_redistrib.py new file mode 100644 index 00000000000..5007765516e --- /dev/null +++ b/ci/tools/fetch_ctk_redistrib.py @@ -0,0 +1,186 @@ +#!/usr/bin/env python3 +# +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +"""Resolve mini-CTK components from NVIDIA redistrib metadata.""" + +from __future__ import annotations + +import argparse +import json +import sys +import urllib.error +import urllib.parse +import urllib.request +from pathlib import Path +from typing import Any + +HOST_PLATFORM_TO_SUBDIR: dict[str, str] = { + "linux-64": "linux-x86_64", + "linux-aarch64": "linux-sbsa", + "win-64": "windows-x86_64", +} + +# CTK 13.3.0 renamed the redistrib key from cuda_cccl to cccl. +COMPONENT_ALIASES: dict[str, tuple[str, ...]] = { + "cuda_cccl": ("cccl",), +} + + +def host_platform_to_subdir(host_platform: str) -> str: + try: + return HOST_PLATFORM_TO_SUBDIR[host_platform] + except KeyError as exc: + raise ValueError(f"unsupported host-platform: {host_platform!r}") from exc + + +def split_components(components: str) -> list[str]: + return [component for component in components.split(",") if component] + + +def filter_static_components(components: list[str], host_platform: str, cuda_version: str) -> list[str]: + try: + cuda_major = int(cuda_version.split(".", 1)[0]) + except ValueError as exc: + raise ValueError(f"invalid cuda-version: {cuda_version!r}") from exc + + filtered = [] + for component in components: + if component == "libnvjitlink" and cuda_major < 12: + continue + if component in {"cuda_crt", "libnvvm"} and cuda_major < 13: + continue + if component == "libcufile" and host_platform.startswith("win-"): + continue + filtered.append(component) + return filtered + + +def validate_metadata_url(metadata_url: str) -> str: + parsed = urllib.parse.urlsplit(metadata_url) + if parsed.scheme != "https" or not parsed.netloc: + raise ValueError(f"metadata URL must be an https URL: {metadata_url!r}") + return metadata_url + + +def load_metadata(*, metadata_path: str | None, metadata_url: str | None) -> dict[str, Any]: + if (metadata_path is None) == (metadata_url is None): + raise ValueError("exactly one of --metadata-path or --metadata-url is required") + + if metadata_path is not None: + return json.loads(Path(metadata_path).read_text(encoding="utf-8")) + + assert metadata_url is not None + metadata_url = validate_metadata_url(metadata_url) + with urllib.request.urlopen(metadata_url) as response: # noqa: S310 - scheme is restricted to https above + return json.load(response) + + +def resolve_component_name(metadata: dict[str, Any], component: str) -> str: + if component in metadata: + return component + + for alias in COMPONENT_ALIASES.get(component, ()): + if alias in metadata: + return alias + + return component + + +def filter_components( + metadata: dict[str, Any], + *, + host_platform: str, + cuda_version: str, + components: str, +) -> tuple[list[str], list[str]]: + ctk_subdir = host_platform_to_subdir(host_platform) + filtered = [] + skipped = [] + for component in filter_static_components(split_components(components), host_platform, cuda_version): + resolved_component = resolve_component_name(metadata, component) + if ctk_subdir in metadata.get(resolved_component, {}): + filtered.append(resolved_component) + else: + skipped.append(component) + return filtered, skipped + + +def get_component_relative_path(metadata: dict[str, Any], *, host_platform: str, component: str) -> str: + ctk_subdir = host_platform_to_subdir(host_platform) + component = resolve_component_name(metadata, component) + component_info = metadata.get(component) + if component_info is None: + raise KeyError(f"unknown CTK component {component!r}") + + subdir_info = component_info.get(ctk_subdir) + if subdir_info is None: + raise KeyError(f"CTK component {component!r} is not available for redistrib subdir {ctk_subdir!r}") + + relative_path = subdir_info.get("relative_path") + if relative_path is None: + raise KeyError(f"CTK component {component!r} for redistrib subdir {ctk_subdir!r} is missing 'relative_path'") + return relative_path + + +def parse_args(argv: list[str] | None = None) -> argparse.Namespace: + parser = argparse.ArgumentParser(description=__doc__) + subparsers = parser.add_subparsers(dest="command", required=True) + + filter_parser = subparsers.add_parser("filter-components") + filter_parser.add_argument("--host-platform", required=True) + filter_parser.add_argument("--cuda-version", required=True) + filter_parser.add_argument("--components", required=True) + filter_parser.add_argument("--metadata-path") + filter_parser.add_argument("--metadata-url") + + relpath_parser = subparsers.add_parser("component-relative-path") + relpath_parser.add_argument("--host-platform", required=True) + relpath_parser.add_argument("--component", required=True) + relpath_parser.add_argument("--metadata-path") + relpath_parser.add_argument("--metadata-url") + + return parser.parse_args(argv) + + +def main(argv: list[str] | None = None) -> int: + args = parse_args(argv) + + try: + metadata = load_metadata(metadata_path=args.metadata_path, metadata_url=args.metadata_url) + + if args.command == "filter-components": + filtered, skipped = filter_components( + metadata, + host_platform=args.host_platform, + cuda_version=args.cuda_version, + components=args.components, + ) + for component in skipped: + print( + f"Skipping unsupported CTK component {component!r} for host-platform {args.host_platform!r}", + file=sys.stderr, + ) + print(",".join(filtered)) + return 0 + + if args.command == "component-relative-path": + print( + get_component_relative_path( + metadata, + host_platform=args.host_platform, + component=args.component, + ) + ) + return 0 + + raise AssertionError(f"unexpected command: {args.command!r}") + except (ValueError, KeyError, OSError, urllib.error.URLError, json.JSONDecodeError) as exc: + print(f"ERROR: {exc}", file=sys.stderr) + return 1 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/.github/workflows/guess_latest.sh b/ci/tools/guess_latest.sh similarity index 100% rename from .github/workflows/guess_latest.sh rename to ci/tools/guess_latest.sh diff --git a/ci/tools/install_gpu_driver.ps1 b/ci/tools/install_gpu_driver.ps1 index c98416c87e2..e61c6bbdbb1 100644 --- a/ci/tools/install_gpu_driver.ps1 +++ b/ci/tools/install_gpu_driver.ps1 @@ -1,13 +1,30 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 +# +# install_gpu_driver.ps1 -- install a specific NVIDIA driver version on a +# Windows CI runner. Driver-mode selection and the post-install device +# power-cycle are the responsibility of configure_driver_mode.ps1, which +# the workflow runs immediately after this script (or by itself when +# DRIVER is 'latest'/'earliest' and the runner already brings up the +# right driver). +# +# Inputs (env): +# DRIVER Driver version, e.g. "610.47". Must NOT be 'latest' or +# 'earliest' -- those are runner-pre-installed and the +# workflow is expected to skip this script for them. +# GPU_TYPE Lower-case GPU label from the matrix (e.g. "l4", "rtx4090"). +# Selects the data-center vs desktop installer variant. # Install the driver function Install-Driver { - # Set the correct URL, filename, and arguments to the installer - # This driver is picked to support Windows 11 & CUDA 13.0 - $version = '581.15' + # Driver version is plumbed from the matrix via the DRIVER env var. + $version = $env:DRIVER + if (-not $version -or $version -eq 'latest' -or $version -eq 'earliest') { + Write-Error "DRIVER env var must be a specific version string (e.g. '610.47'); got '$version'." + exit 1 + } # Get GPU type from environment variable $gpu_type = $env:GPU_TYPE @@ -54,33 +71,7 @@ function Install-Driver { # Install the file with the specified path from earlier Write-Output 'Running the driver installer...' Start-Process -FilePath $filepath -ArgumentList $install_args -Wait - Write-Output 'Done!' - - # Handle driver mode configuration - # This assumes we have the prior knowledge on which GPU can use which mode. - $driver_mode = $env:DRIVER_MODE - if ($driver_mode -eq "WDDM") { - Write-Output "Setting driver mode to WDDM..." - nvidia-smi -fdm 0 - } elseif ($driver_mode -eq "TCC") { - Write-Output "Setting driver mode to TCC..." - nvidia-smi -fdm 1 - } elseif ($driver_mode -eq "MCDM") { - Write-Output "Setting driver mode to MCDM..." - nvidia-smi -fdm 2 - } else { - Write-Output "Unknown driver mode: $driver_mode" - exit 1 - } - # Only restart NVIDIA display adapters, not other display devices (e.g. QEMU VGA) - $nvidia_devices = Get-PnpDevice -Class Display -FriendlyName "NVIDIA*" - foreach ($device in $nvidia_devices) { - Write-Output "Restarting device: $($device.FriendlyName) ($($device.InstanceId))" - pnputil /disable-device "$($device.InstanceId)" - pnputil /enable-device "$($device.InstanceId)" - } - # Give it a minute to settle: - Start-Sleep -Seconds 5 + Write-Output 'Install complete; driver mode + device cycle handled by configure_driver_mode.ps1.' } # Run the functions diff --git a/ci/tools/install_gpu_driver.sh b/ci/tools/install_gpu_driver.sh new file mode 100755 index 00000000000..777edd63519 --- /dev/null +++ b/ci/tools/install_gpu_driver.sh @@ -0,0 +1,220 @@ +#!/bin/bash +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# install_gpu_driver.sh -- install a specific NVIDIA driver version on a +# Linux CI runner. Adapted from nv-gha-runners/vm-images PR #256 +# (`nvgha-driver` CLI), trimmed and parameterised for cuda-python's CI. +# +# !!! ALPHA !!! +# Performs live modifications to the host driver stack (kernel module +# reload, package replacement, and -- inside containers -- toolkit +# bind-mount refresh) and may cause issues. +# +# Inputs (env): +# DRIVER Driver version, e.g. "580.65.06". Must NOT be 'latest' or +# 'earliest' -- those are runner-pre-installed and the +# workflow is expected to skip this script for them. +# GPU_TYPE Lower-case GPU label from the matrix (e.g. "v100", "l4", +# "h100"). Used only to pick the kernel module flavor +# (Volta needs the proprietary/legacy module; everything +# newer can use the open module). +# +# Arch is detected from `uname -m`. +# +# When the script runs inside a container (the cuda-python Linux jobs do) +# it re-execs itself on the host via `nsenter`. The job must declare +# `options: --privileged --pid=host` (the workflow only does this for +# matrix rows with a custom DRIVER). After the host-side install, the +# container's bind-mounted nvidia libs/binaries are refreshed in-place so +# the new driver is visible without restarting the container. +set -euo pipefail + +: "${DRIVER:?DRIVER env var is required (e.g. 580.65.06)}" +: "${GPU_TYPE:?GPU_TYPE env var is required (e.g. l4)}" + +case "$DRIVER" in + latest|earliest) + echo "::error::install_gpu_driver.sh must not be invoked with DRIVER=$DRIVER (runner-pre-installed)" >&2 + exit 1 + ;; +esac + +VERSION="$DRIVER" + +# Volta (V100) requires the legacy/proprietary kernel module; all newer +# GPUs in this matrix support the open module. Extend this if/when older +# GPUs return to the matrix. +case "$GPU_TYPE" in + v100) KMT=proprietary ;; + *) KMT=open ;; +esac + +case "$(uname -m)" in + x86_64) + ARCH_DIR=Linux-x86_64 + ARCH_SUFFIX=x86_64 + ;; + aarch64) + ARCH_DIR=Linux-aarch64 + ARCH_SUFFIX=aarch64 + ;; + *) + echo "::error::unsupported arch: $(uname -m)" >&2 + exit 1 + ;; +esac + +URL="https://us.download.nvidia.com/XFree86/${ARCH_DIR}/${VERSION}/NVIDIA-Linux-${ARCH_SUFFIX}-${VERSION}.run" + +# Re-elevate to root if needed (sudo is preinstalled on the runner image). +if [ "$(id -u)" != 0 ]; then + exec sudo -E DRIVER="$DRIVER" GPU_TYPE="$GPU_TYPE" "$0" "$@" +fi + +echo "install_gpu_driver.sh is ALPHA -- it performs live modifications to the host driver stack and may cause issues" >&2 +echo "DRIVER=${VERSION} GPU_TYPE=${GPU_TYPE} KMT=${KMT} ARCH=${ARCH_SUFFIX}" >&2 +echo "URL=${URL}" >&2 + +# Toolkit packages we keep across the purge: dockerd's --runtime=nvidia +# resolves nvidia-container-runtime through these, and removing them +# breaks `docker exec` against any container started with that runtime. +KEEP_RE='^(nvidia-container-toolkit(-base)?|libnvidia-container1|libnvidia-container-tools)$' + +in_container() { + [ -f /.dockerenv ] || grep -qE '/(docker|kubepods|containerd)' /proc/1/cgroup 2>/dev/null +} + +host_install() { + apt-get -y install build-essential dkms "linux-headers-$(uname -r)" psmisc kmod + + systemctl stop nvidia-persistenced dcgm-exporter || true + # if-test instead of `fuser ... || true` so a kill failure surfaces + # (fuser exits 1 when nothing holds the device, which is the happy path). + if fuser /dev/nvidia* >/dev/null 2>&1; then + fuser -kv /dev/nvidia* + fi + sleep 1 + for m in nvidia_uvm nvidia_drm nvidia_modeset nvidia; do + rmmod "$m" 2>/dev/null || true + done + + # Purge existing nvidia/libnvidia packages, except the toolkit pieces + # captured by KEEP_RE. Tolerate apt failures: postrm scripts can trip + # and the .run installer is about to replace everything anyway. + dpkg-query -W -f='${Package}\n' 'nvidia-*' 'libnvidia-*' 2>/dev/null \ + | awk -v re="$KEEP_RE" '$0 !~ re' \ + | xargs -r apt-get -y remove --purge || true + + local d + d=$(mktemp -d) + ( cd "$d" \ + && wget -q -O installer.run "$URL" \ + && sh installer.run --silent --dkms --no-questions \ + --accept-license --ui=none --no-cc-version-check --kernel-module-type="$KMT" ) + modprobe nvidia nvidia_uvm nvidia_modeset + + # Bring nvidia-persistenced back up. NVML state-changing calls from + # inside the test container (e.g. nvmlDeviceSetPersistenceMode, which + # cuda.core's test_persistence_mode_enabled exercises) talk to the + # daemon via /run/nvidia-persistenced/socket; without a live daemon + # they return NVML_ERROR_UNKNOWN. + # + # systemctl can't start the unit (the `--silent --no-questions` .run + # installer drops /usr/bin/nvidia-persistenced but no usable systemd + # unit), so exec the binary directly -- it self-daemonizes. + # + # `--user root` because the default `nvidia-persistenced` user was + # deleted along with `nvidia-compute-utils-*` in the purge above; + # without this flag the daemon's post-fork setuid() fails silently + # and the process exits. + # + # nv-gha-runners/vm-images' `nvgha-driver` has the same latent gap; + # its CUDA-runtime validation workload never issues an NVML SET + # write so it hasn't surfaced there. + /usr/bin/nvidia-persistenced --verbose --user root || true +} + +# Replace the toolkit's bind-mounted nvidia libs/binaries inside this +# container with copies from the host's new install. `cp` (not +# `mount --bind`) because procfs-routed binds drop the exec bit. +refresh_container_libs() { + # Walk /proc/self/mountinfo and match the toolkit-injected nvidia + # binds via mount point (field 5) so deleted source paths -- which + # the kernel suffixes field 4 with " (deleted)" once the host unlinks + # the old lib -- don't break discovery. Filters skip what we can't or + # shouldn't refresh: + # $3 ~ /^0:/ tmpfs/proc/sysfs (e.g. the toolkit hook tmpfs) + # $5 must be under /usr/(bin|lib) binaries + libs only -- explicitly + # NOT /run/nvidia-persistenced/socket + # (cp'ing the daemon's IPC socket unlinks + # the container's view and turns later + # NVML state-changing calls into + # NVML_ERROR_UNKNOWN); NOT /dev/nvidia* + # (character devices); NOT /proc/driver/nvidia + # (procfs); NOT /tmp/nvidia-mps (runtime). + # $5 ~ /\.json$/ vulkan/glvnd config remaps (not version-bound) + # $5 ~ /\/(firmware|xorg)\// firmware loads host-side; xorg unused in CUDA containers + local mounts + mounts=$(awk ' + $3 !~ /^0:/ && + $5 ~ /^\/usr\/(bin|lib)/ && + $5 !~ /\.json$/ && + $5 !~ /\/(firmware|xorg)\// && + $5 ~ /(nvidia|libcuda)/ { print $5 } + ' /proc/self/mountinfo | sort -u) + + for tgt in $mounts; do + local src="/proc/1/root$tgt" + if [ ! -e "$src" ]; then + # Driver swap rewrites the version suffix (libfoo.so.595.71.05 -> + # libfoo.so.580.65.06); strip it and find the new file. + local base + base=$(basename "$tgt") + base="${base%.so.*}.so" + src=$(find "/proc/1/root$(dirname "$tgt")" -maxdepth 1 -name "${base}.*" 2>/dev/null \ + | sort -V | tail -n1) + [ -n "$src" ] || { echo "skip $tgt: no host source" >&2; continue; } + fi + umount "$tgt" 2>/dev/null || true + # --preserve=mode keeps the SUID bit so the refresh doesn't silently + # de-privilege binaries like nvidia-modprobe that ship 4755 (the + # runner-team's nvgha-driver uses plain `cp` and has the same gap). + cp -f --preserve=mode --remove-destination "$src" "$tgt" \ + || echo "WARN: refresh failed for $tgt (src=$src)" >&2 + done + ldconfig +} + +if [ -z "${_NVDRV_NSENTERED:-}" ] && in_container; then + # Re-exec on the host. The runner-team's `nvgha-driver` script lives at a + # host-side absolute path so `"$0"` survives the mount-namespace flip; + # ours lives in the GH workspace mount (container-only), so we pipe the + # script body in via stdin instead -- the `< "$0"` fd is opened before + # nsenter and stays valid across the namespace switch. Env vars (DRIVER, + # GPU_TYPE, _NVDRV_NSENTERED) are inherited by the host-side bash. + _NVDRV_NSENTERED=1 nsenter -t 1 -m -p -n -i -u -- bash -s < "$0" \ + || { echo "::error::container needs 'options: --privileged --pid=host'" >&2; exit 1; } + refresh_container_libs + + # Re-bind /run/nvidia-persistenced from the host. The container's + # original bind mount was pinned to the host's at-container-start + # inode; the daemon stop+restart cycle recreates the dir under a + # fresh inode, stranding the bind mount on the deleted one (socket + # shows up with link count 0 inside the container, NVML SET calls + # return NVML_ERROR_UNKNOWN). Re-bind from /proc/1/root so the + # container picks up the live host dir. Needs CAP_SYS_ADMIN, which + # the workflow grants via --privileged --pid=host on custom-DRIVER + # rows. + if [ -d /proc/1/root/run/nvidia-persistenced ]; then + umount /run/nvidia-persistenced 2>/dev/null || true + mkdir -p /run/nvidia-persistenced + mount --bind /proc/1/root/run/nvidia-persistenced /run/nvidia-persistenced + fi +else + host_install +fi + +nvidia-smi >/dev/null +grep -qF "$VERSION" /proc/driver/nvidia/version diff --git a/ci/tools/lookup-run-id b/ci/tools/lookup-run-id index 092f8369ae1..bd8ba413974 100755 --- a/ci/tools/lookup-run-id +++ b/ci/tools/lookup-run-id @@ -1,62 +1,131 @@ #!/usr/bin/env bash -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 -# A utility script to find the GitHub Actions workflow run ID for a given git tag. -# This script requires a successful CI run that was triggered by the tag push. +# A utility script to find a GitHub Actions workflow run ID. +# +# Two modes: +# --tag Find the successful CI run triggered by a tag push. +# --branch Find the latest successful CI run on a branch. +# +# Outputs the run ID on stdout. All diagnostic messages go to stderr. +# When --head-sha is passed, a second line with the run's head SHA is printed. 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 +usage() { + cat >&2 < [workflow-name] + $0 --branch [workflow-name] + +Options: + --tag Find run by git tag (requires local git repo with the tag) + --branch Find latest successful run on the given branch + --head-sha Also print the run's head commit SHA (second line) + +Examples: + $0 --tag v13.0.1 NVIDIA/cuda-python + $0 --branch main NVIDIA/cuda-python + $0 --branch main --head-sha NVIDIA/cuda-python "CI" +EOF exit 1 +} + +# ── Parse arguments ── +MODE="" +REF="" +HEAD_SHA_FLAG=0 + +while [[ $# -gt 0 ]]; do + case "${1}" in + --tag) + [[ -n "${MODE}" && "${MODE}" != "tag" ]] && { echo "Error: --tag and --branch are mutually exclusive" >&2; exit 1; } + MODE="tag"; REF="${2}"; shift 2 ;; + --branch) + [[ -n "${MODE}" && "${MODE}" != "branch" ]] && { echo "Error: --tag and --branch are mutually exclusive" >&2; exit 1; } + MODE="branch"; REF="${2}"; shift 2 ;; + --head-sha) + HEAD_SHA_FLAG=1; shift ;; + -h|--help) + usage ;; + *) + break ;; + esac +done + +if [[ -z "${MODE}" ]]; then + # Legacy positional interface: [workflow-name] + # Kept for backward compatibility with release.yml. + if [[ $# -lt 2 ]]; then usage; fi + MODE="tag" + REF="${1}"; shift fi -GIT_TAG="${1}" -REPOSITORY="${2}" -WORKFLOW_NAME="${3:-CI}" +REPOSITORY="${1:-}"; shift || true +WORKFLOW_NAME="${1:-CI}" -# Ensure we have required tools +if [[ -z "${REPOSITORY}" ]]; then usage; fi + +# ── Prerequisite checks ── 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 +for cmd in jq gh; do + if ! command -v "${cmd}" >/dev/null 2>&1; then + echo "Error: ${cmd} is required but not installed" >&2 + exit 1 + fi +done + +# ── Mode: branch ── +if [[ "${MODE}" == "branch" ]]; then + echo "Looking up latest successful '${WORKFLOW_NAME}' run on branch: ${REF}" >&2 + + RUN_ID=$(gh run list \ + -b "${REF}" \ + -L 1 \ + -w "${WORKFLOW_NAME}" \ + -s success \ + -R "${REPOSITORY}" \ + --json databaseId \ + | jq -r '.[0].databaseId // empty') + + if [[ -z "${RUN_ID}" ]]; then + echo "Error: No successful '${WORKFLOW_NAME}' run found on branch '${REF}'" >&2 + exit 1 + fi + + echo "Found run ID: ${RUN_ID}" >&2 + echo "${RUN_ID}" + + if [[ "${HEAD_SHA_FLAG}" == 1 ]]; then + HEAD_SHA=$(gh run view "${RUN_ID}" \ + -R "${REPOSITORY}" \ + --json headSha \ + | jq -r '.headSha') + echo "Head SHA: ${HEAD_SHA}" >&2 + echo "${HEAD_SHA}" + fi + exit 0 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 +# ── Mode: tag ── +echo "Looking up run ID for tag: ${REF} 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 +if ! COMMIT_SHA=$(git rev-parse "${REF}^{commit}"); then + echo "Error: Could not resolve git tag '${REF}' 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} (tag: ${GIT_TAG})" >&2 +echo "Resolved tag '${REF}' to commit: ${COMMIT_SHA}" >&2 +echo "Searching for '${WORKFLOW_NAME}' workflow runs for commit: ${COMMIT_SHA} (tag: ${REF})" >&2 -# Get completed workflow runs for this commit. RUN_DATA=$(gh run list \ --repo "${REPOSITORY}" \ --commit "${COMMIT_SHA}" \ @@ -72,8 +141,7 @@ if [[ -z "${RUN_DATA}" || "${RUN_DATA}" == "[]" ]]; then exit 1 fi -# Filter for successful push runs from the tag ref. -RUN_ID=$(echo "${RUN_DATA}" | jq -r --arg tag "${GIT_TAG}" ' +RUN_ID=$(echo "${RUN_DATA}" | jq -r --arg tag "${REF}" ' map(select(.conclusion == "success" and .event == "push" and .headBranch == $tag)) | sort_by(.createdAt) | reverse @@ -81,7 +149,7 @@ RUN_ID=$(echo "${RUN_DATA}" | jq -r --arg tag "${GIT_TAG}" ' ') if [[ -z "${RUN_ID}" ]]; then - echo "Error: No successful '${WORKFLOW_NAME}' workflow runs found for tag '${GIT_TAG}'." >&2 + echo "Error: No successful '${WORKFLOW_NAME}' workflow runs found for tag '${REF}'." >&2 echo "This release workflow now requires artifacts from a tag-triggered CI run." >&2 echo "If you just pushed the tag, wait for CI on that tag to finish and retry." >&2 echo "" >&2 @@ -90,9 +158,8 @@ if [[ -z "${RUN_ID}" ]]; then exit 1 fi -echo "Found workflow run ID: ${RUN_ID} for tag '${GIT_TAG}'" >&2 +echo "Found workflow run ID: ${RUN_ID} for tag '${REF}'" >&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 "") @@ -100,5 +167,11 @@ 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}" + +if [[ "${HEAD_SHA_FLAG}" == 1 ]]; then + HEAD_SHA=$(echo "${RUN_DATA}" | jq -r --arg id "${RUN_ID}" ' + map(select(.databaseId == ($id | tonumber))) | .[0].headSha // empty') + echo "Head SHA: ${HEAD_SHA}" >&2 + echo "${HEAD_SHA}" +fi diff --git a/ci/tools/run-tests b/ci/tools/run-tests index 891a20905c9..c5c0cc12336 100755 --- a/ci/tools/run-tests +++ b/ci/tools/run-tests @@ -13,19 +13,22 @@ if [[ ${#} -ne 1 ]]; then echo "Error: This script requires exactly 1 argument. You provided ${#}" exit 1 fi -if [[ "${1}" != "bindings" && "${1}" != "core" && "${1}" != "pathfinder" ]]; then - echo "Error: Invalid test module '${1}'. Must be 'bindings', 'core', or 'pathfinder'" +if [[ "${1}" != "bindings" && "${1}" != "core" && "${1}" != "pathfinder" && "${1}" != nightly-* ]]; then + echo "Error: Invalid test module '${1}'. Must be 'bindings', 'core', 'pathfinder', or 'nightly-*'" exit 1 fi test_module=${1} -# Unconditionally install pathfinder wheel -# (it is a direct dependency of bindings, and a transitive dependency of core) -pushd ./cuda_pathfinder -echo "Installing pathfinder wheel" -pip install ./*.whl --group test -popd +# For standard modes, install pathfinder up front (it is a direct dependency +# of bindings, and a transitive dependency of core). Nightly modes install +# all wheels together in a single pip call further below. +if [[ "${test_module}" != nightly-* ]]; then + pushd ./cuda_pathfinder + echo "Installing pathfinder wheel" + pip install ./*.whl --group test + popd +fi if [[ "${test_module}" == "pathfinder" ]]; then pushd ./cuda_pathfinder @@ -53,42 +56,131 @@ elif [[ "${test_module}" == "bindings" ]]; then ${SANITIZER_CMD} pytest -rxXs -v --durations=0 --randomly-dont-reorganize tests/cython fi popd -elif [[ "${test_module}" == "core" ]]; then - # If build/test majors match: cuda.bindings is installed in the previous step. - # If mismatch: cuda.bindings is installed from the backport branch. - if [[ "${SKIP_CUDA_BINDINGS_TEST}" == 1 ]]; then - echo "Installing bindings wheel" - if [[ "${LOCAL_CTK}" == 1 ]]; then - pip install "${CUDA_BINDINGS_ARTIFACTS_DIR}"/*.whl - else - pip install $(ls "${CUDA_BINDINGS_ARTIFACTS_DIR}"/*.whl)[all] - fi - fi +elif [[ "${test_module}" == "core" || "${test_module}" == nightly-* ]]; then + # Shared setup for core and nightly modes. TEST_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${CUDA_VER})" - echo "Installing core wheel" + CUDA_VER_MINOR="$(cut -d '.' -f 1-2 <<< "${CUDA_VER}")" FREE_THREADING="" if python -c 'import sys; assert not sys._is_gil_enabled()' 2> /dev/null; then FREE_THREADING+="-ft" fi - pushd ./cuda_core - CUDA_VER_MINOR="$(cut -d '.' -f 1-2 <<< "${CUDA_VER}")" - if [[ "${LOCAL_CTK}" == 1 ]]; then - # We already installed cuda-bindings, and all CTK components exist locally, - # so just install the test dependencies. - # Constrain cuda-toolkit to match the local CTK version to avoid - # pip pulling in a newer nvidia-cuda-runtime that conflicts with it. - pip install "${CUDA_CORE_ARTIFACTS_DIR}"/*.whl --group "test-cu${TEST_CUDA_MAJOR}${FREE_THREADING}" "cuda-toolkit==${CUDA_VER_MINOR}.*" + # Resolve bindings based on BINDINGS_SOURCE (set by env-vars): + # main/backport → local wheel from artifacts dir + # published → install from PyPI by version + BINDINGS_ARGS=() + if [[ "${BINDINGS_SOURCE}" == "published" ]]; then + BINDINGS_ARGS+=("cuda-bindings==${TEST_CUDA_MAJOR}.${TEST_CUDA_MINOR}.*") else - pip install $(ls "${CUDA_CORE_ARTIFACTS_DIR}"/*.whl)["cu${TEST_CUDA_MAJOR}"] --group "test-cu${TEST_CUDA_MAJOR}${FREE_THREADING}" + BINDINGS_ARGS=("${CUDA_BINDINGS_ARTIFACTS_DIR}"/*.whl) + if [[ "${LOCAL_CTK}" != 1 ]]; then + BINDINGS_ARGS=("${BINDINGS_ARGS[0]}[all]") + fi fi - echo "Running core tests" - ${SANITIZER_CMD} pytest -rxXs -v --durations=0 --randomly-dont-reorganize tests/ - # Currently our CI always installs the latest bindings (from either major version). - # This is not compatible with the test requirements. - if [[ "${SKIP_CYTHON_TEST}" == 0 ]]; then - ${SANITIZER_CMD} pytest -rxXs -v --durations=0 --randomly-dont-reorganize tests/cython + + # Resolve core wheel, adding the published cuda.bindings extra + # when this job is resolving against wheel-installed CTK packages. + CORE_WHL=("${CUDA_CORE_ARTIFACTS_DIR}"/*.whl) + if [[ "${LOCAL_CTK}" != 1 ]]; then + CORE_WHL=("${CORE_WHL[0]}[cu${TEST_CUDA_MAJOR}]") + fi + + if [[ "${test_module}" == nightly-* ]]; then + # Resolve pathfinder wheel to absolute path before pushd. + # CUDA_BINDINGS_ARTIFACTS_DIR and CUDA_CORE_ARTIFACTS_DIR are already + # absolute (set via realpath in env-vars). + PATHFINDER_WHL=($(realpath ./cuda_pathfinder/*.whl)) + fi + + if [[ "${test_module}" == "core" ]]; then + # pushd so --group reads test dependency groups from cuda_core/pyproject.toml. + pushd ./cuda_core + echo "Installing bindings (source: ${BINDINGS_SOURCE})" + pip install "${BINDINGS_ARGS[@]}" + echo "Installing core wheel" + # Constrain cuda-toolkit to the requested CTK version to avoid + # pip pulling in a newer nvidia-cuda-runtime that conflicts with it. + pip install "${CORE_WHL[@]}" --group "test-cu${TEST_CUDA_MAJOR}${FREE_THREADING}" "cuda-toolkit==${CUDA_VER_MINOR}.*" + echo "Installed packages before core tests:" + pip list + echo "Running core tests" + ${SANITIZER_CMD} pytest -rxXs -v --durations=0 --randomly-dont-reorganize tests/ + # Currently our CI always installs the latest bindings (from either major version). + # This is not compatible with the test requirements. + if [[ "${SKIP_CYTHON_TEST}" == 0 ]]; then + ${SANITIZER_CMD} pytest -rxXs -v --durations=0 --randomly-dont-reorganize tests/cython + fi + popd + elif [[ "${test_module}" == "nightly-cuda-core" ]]; then + # Test the *released* cuda-core (from PyPI) against *main*-built pathfinder + # and cuda-bindings. The workflow follows up with an actions/checkout of the + # matching cuda-core-v tag so the released version's own test suite + # (which is not shipped in the wheel) can be exercised. + echo "Installing pathfinder + bindings from main + released cuda-core from PyPI" + pip install "${PATHFINDER_WHL[@]}" "${BINDINGS_ARGS[@]}" "cuda-core[cu${TEST_CUDA_MAJOR}]" + + released_ver=$(pip show cuda-core | awk '/^Version:/{print $2}') + if [[ -n "${GITHUB_ENV:-}" ]]; then + echo "CUDA_CORE_RELEASED_VER=${released_ver}" >> "${GITHUB_ENV}" + echo "CUDA_CORE_TEST_GROUP=test-cu${TEST_CUDA_MAJOR}${FREE_THREADING}" >> "${GITHUB_ENV}" + fi + echo "Installed packages before released cuda-core tests:" + pip list + else + # Nightly optional-dependency testing: nightly-pytorch, nightly-numba-cuda, + # nightly-numba-cuda-mlir. Install ALL cuda-python wheels (pathfinder + + # bindings + core) and the optional dep in a single pip call so pip resolves + # version constraints in one shot. + pushd ./cuda_core + PIP_ARGS=( + "${PATHFINDER_WHL[@]}" + "${BINDINGS_ARGS[@]}" + "${CORE_WHL[@]}" + --group "test-cu${TEST_CUDA_MAJOR}${FREE_THREADING}" + ) + + if [[ "${test_module}" == "nightly-pytorch" ]]; then + # TORCH_VER and TORCH_CUDA must be set by the caller. + # Use cuda-toolkit[cudart] only — torch brings its own nvcc/nvrtc/etc. + # This avoids version conflicts between our nvidia-* pins and torch's. + echo "Installing pathfinder + bindings + core + test deps + PyTorch ${TORCH_VER} (${TORCH_CUDA})" + PIP_ARGS+=("cuda-toolkit[cudart]==${CUDA_VER_MINOR}.*") + if [[ "${TORCH_VER}" == "latest" ]]; then + PIP_ARGS+=(torch) + else + PIP_ARGS+=("torch==${TORCH_VER}") + fi + PIP_ARGS+=(--extra-index-url "https://download.pytorch.org/whl/${TORCH_CUDA}") + elif [[ "${test_module}" == "nightly-numba-cuda" ]]; then + echo "Installing pathfinder + bindings + core + test deps + numba-cuda" + # numba-cuda's test-cuXX group deps (can't use --group for a wheel install): + PIP_ARGS+=( + "cuda-toolkit[curand,cublas]==${CUDA_VER_MINOR}.*" + "numba-cuda[cu${TEST_CUDA_MAJOR}]" + "cupy-cuda${TEST_CUDA_MAJOR}x" + psutil cffi pytest-xdist pytest-benchmark filecheck ml_dtypes statistics + ) + elif [[ "${test_module}" == "nightly-numba-cuda-mlir" ]]; then + echo "Installing pathfinder + bindings + core + numba-cuda-mlir" + # numpy<2.5: numba-cuda-mlir 0.4.0 registers np.row_stack, which was + # removed in NumPy 2.5. See NVIDIA/numba-cuda-mlir#154. + PIP_ARGS+=("numba-cuda-mlir[cu${TEST_CUDA_MAJOR}]" "numpy<2.5") + fi + + pip install "${PIP_ARGS[@]}" + echo "Nightly install complete — installed packages:" + pip list + popd + + if [[ "${test_module}" == "nightly-numba-cuda-mlir" ]]; then + # Expose the installed numba-cuda-mlir version so the workflow can + # actions/checkout the matching v tag from NVIDIA/numba-cuda-mlir + # (the wheel does not ship test_*.py files). + installed_ver=$(pip show numba-cuda-mlir | awk '/^Version:/{print $2}') + if [[ -n "${GITHUB_ENV:-}" ]]; then + echo "NUMBA_CUDA_MLIR_VER=${installed_ver}" >> "${GITHUB_ENV}" + fi + fi fi - popd fi diff --git a/ci/tools/run_pytest_with_stack.py b/ci/tools/run_pytest_with_stack.py new file mode 100644 index 00000000000..e1e1f782ba1 --- /dev/null +++ b/ci/tools/run_pytest_with_stack.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 + +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +"""Run pytest on a thread with a larger stack size. + +Cython linetrace instrumentation under coverage on Windows can exceed the +default 1 MB thread stack. This helper spawns a single worker thread with +a configurable stack (default 8 MB) so the rest of the CI workflow stays +readable. + +Usage: + python run_pytest_with_stack.py [--stack-mb N] [--cwd DIR] [pytest args ...] +""" + +import argparse +import concurrent.futures +import os +import sys +import threading + +import pytest + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument( + "--stack-mb", + type=int, + default=8, + help="Thread stack size in megabytes (default: 8)", + ) + parser.add_argument( + "--cwd", + default=None, + help="Working directory for the test run", + ) + args, pytest_args = parser.parse_known_args() + + if args.cwd: + os.chdir(args.cwd) + + threading.stack_size(args.stack_mb * 1024 * 1024) + + with concurrent.futures.ThreadPoolExecutor(max_workers=1) as pool: + code = pool.submit(pytest.main, pytest_args).result() + + sys.exit(code) + + +if __name__ == "__main__": + main() diff --git a/ci/tools/setup-sanitizer b/ci/tools/setup-sanitizer index e4904ca58ce..cce78cedfa9 100755 --- a/ci/tools/setup-sanitizer +++ b/ci/tools/setup-sanitizer @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 @@ -12,7 +12,15 @@ set -euo pipefail if [[ "${SETUP_SANITIZER}" == 1 ]]; then COMPUTE_SANITIZER="${CUDA_HOME}/bin/compute-sanitizer" COMPUTE_SANITIZER_VERSION=$(${COMPUTE_SANITIZER} --version | grep -Eo "[0-9]{4}\.[0-9]\.[0-9]" | sed -e 's/\.//g') - SANITIZER_CMD="${COMPUTE_SANITIZER} --target-processes=all --launch-timeout=0 --tool=memcheck --error-exitcode=1 --report-api-errors=no" + # --target-processes=application-only: attach the sanitizer to the parent + # pytest process only. Spawned multiprocessing.Process children run without + # the sanitizer. This aims to mitigate a class of CI hangs where child + # processes take an extreme amount of time to spawn (>30 seconds). Test bugs + # triggered by that specific condition are typically uncovered only in CI, + # where they become emergencies and are difficult to debug. The parent + # process is still fully sanitized, which is where most of the interesting + # host-side IPC plumbing runs anyway. + SANITIZER_CMD="${COMPUTE_SANITIZER} --target-processes=application-only --launch-timeout=0 --tool=memcheck --error-exitcode=1 --report-api-errors=no" if [[ "$COMPUTE_SANITIZER_VERSION" -ge 202111 ]]; then SANITIZER_CMD="${SANITIZER_CMD} --padding=32" fi diff --git a/ci/tools/tests/test_check_release_notes.py b/ci/tools/tests/test_check_release_notes.py new file mode 100644 index 00000000000..4f65404eed5 --- /dev/null +++ b/ci/tools/tests/test_check_release_notes.py @@ -0,0 +1,333 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +import os +import sys + +sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) +from check_release_notes import ( + check_release_notes, + is_post_release, + load_backport_branch, + main, + parse_version_from_tag, +) + + +class TestParseVersionFromTag: + def test_plain_tag_bindings(self): + assert parse_version_from_tag("v13.1.0", "cuda-bindings") == "13.1.0" + + def test_plain_tag_python(self): + assert parse_version_from_tag("v13.1.0", "cuda-python") == "13.1.0" + + def test_component_prefix_core(self): + assert parse_version_from_tag("cuda-core-v0.7.0", "cuda-core") == "0.7.0" + + def test_component_prefix_pathfinder(self): + assert parse_version_from_tag("cuda-pathfinder-v1.5.2", "cuda-pathfinder") == "1.5.2" + + def test_post_release(self): + assert parse_version_from_tag("v12.6.2.post1", "cuda-bindings") == "12.6.2.post1" + + def test_invalid_tag(self): + assert parse_version_from_tag("not-a-tag", "cuda-core") is None + + def test_no_v_prefix(self): + assert parse_version_from_tag("13.1.0", "cuda-bindings") is None + + def test_component_prefix_mismatch(self): + # cuda-core-v* must not be accepted for component=cuda-pathfinder + assert parse_version_from_tag("cuda-core-v0.7.0", "cuda-pathfinder") is None + + def test_bare_v_rejected_for_core(self): + # bare v* belongs to cuda-bindings/cuda-python, not cuda-core + assert parse_version_from_tag("v0.7.0", "cuda-core") is None + + def test_unknown_component(self): + assert parse_version_from_tag("v13.1.0", "bogus") is None + + def test_path_traversal_rejected(self): + assert parse_version_from_tag("v1.0.0/../evil", "cuda-bindings") is None + + def test_path_separator_rejected(self): + assert parse_version_from_tag("v1/2/3", "cuda-bindings") is None + + def test_leading_dot_rejected(self): + assert parse_version_from_tag("v.1.0", "cuda-bindings") is None + + def test_whitespace_rejected(self): + assert parse_version_from_tag("v1.0.0 ", "cuda-bindings") is None + + def test_trailing_suffix_rejected(self): + # \w permits alphanumerics + underscore only; hyphens and shell meta-chars are out + assert parse_version_from_tag("v1.0.0-extra", "cuda-bindings") is None + + +class TestIsPostRelease: + def test_normal(self): + assert not is_post_release("13.1.0") + + def test_post(self): + assert is_post_release("12.6.2.post1") + + def test_post_no_number(self): + assert is_post_release("1.0.0.post") + + +class TestCheckReleaseNotes: + def _make_notes(self, tmp_path, pkg, version, content="Release notes."): + d = tmp_path / pkg / "docs" / "source" / "release" + d.mkdir(parents=True, exist_ok=True) + f = d / f"{version}-notes.rst" + f.write_text(content) + return f + + def test_present_and_nonempty(self, tmp_path): + self._make_notes(tmp_path, "cuda_core", "0.7.0") + problems = check_release_notes("cuda-core-v0.7.0", "cuda-core", str(tmp_path)) + assert problems == [] + + def test_missing(self, tmp_path): + problems = check_release_notes("cuda-core-v0.7.0", "cuda-core", str(tmp_path)) + assert len(problems) == 1 + assert problems[0][1] == "missing" + + def test_empty(self, tmp_path): + self._make_notes(tmp_path, "cuda_core", "0.7.0", content="") + problems = check_release_notes("cuda-core-v0.7.0", "cuda-core", str(tmp_path)) + assert len(problems) == 1 + assert problems[0][1] == "empty" + + def test_post_release_skipped(self, tmp_path): + problems = check_release_notes("v12.6.2.post1", "cuda-bindings", str(tmp_path)) + assert problems == [] + + def test_invalid_tag(self, tmp_path): + problems = check_release_notes("not-a-tag", "cuda-core", str(tmp_path)) + assert len(problems) == 1 + assert "cannot parse" in problems[0][1] + + def test_component_prefix_mismatch(self, tmp_path): + # Pass a cuda-core tag with component=cuda-pathfinder; must be rejected. + problems = check_release_notes("cuda-core-v0.7.0", "cuda-pathfinder", str(tmp_path)) + assert len(problems) == 1 + assert "cannot parse" in problems[0][1] + + def test_unknown_component(self, tmp_path): + problems = check_release_notes("v13.1.0", "bogus", str(tmp_path)) + assert len(problems) == 1 + assert "unknown component" in problems[0][1] + + def test_plain_v_tag(self, tmp_path): + self._make_notes(tmp_path, "cuda_python", "13.1.0") + problems = check_release_notes("v13.1.0", "cuda-python", str(tmp_path)) + assert problems == [] + + +class TestLoadBackportBranch: + def test_from_versions_yml(self, tmp_path): + d = tmp_path / "ci" + d.mkdir(parents=True) + (d / "versions.yml").write_text('backport_branch: "12.9.x"\n') + + assert load_backport_branch(str(tmp_path)) == "12.9.x" + + def test_from_github_ref_name_for_legacy_backport_branch(self, tmp_path, monkeypatch): + monkeypatch.setenv("GITHUB_REF_NAME", "12.9.x") + + assert load_backport_branch(str(tmp_path)) == "12.9.x" + + def test_ignores_non_backport_github_ref_name(self, tmp_path, monkeypatch): + monkeypatch.setenv("GITHUB_REF_NAME", "main") + + assert load_backport_branch(str(tmp_path)) is None + + +class TestMain: + def _make_notes(self, tmp_path, pkg, version, content="Release notes."): + d = tmp_path / pkg / "docs" / "source" / "release" + d.mkdir(parents=True, exist_ok=True) + (d / f"{version}-notes.rst").write_text(content) + + def test_success(self, tmp_path): + d = tmp_path / "cuda_core" / "docs" / "source" / "release" + d.mkdir(parents=True) + (d / "0.7.0-notes.rst").write_text("Notes here.") + rc = main(["--git-tag", "cuda-core-v0.7.0", "--component", "cuda-core", "--repo-root", str(tmp_path)]) + assert rc == 0 + + def test_failure(self, tmp_path): + rc = main(["--git-tag", "cuda-core-v0.7.0", "--component", "cuda-core", "--repo-root", str(tmp_path)]) + assert rc == 1 + + def test_post_skip(self, tmp_path): + rc = main(["--git-tag", "v12.6.2.post1", "--component", "cuda-bindings", "--repo-root", str(tmp_path)]) + assert rc == 0 + + def test_unparsable_tag_returns_2(self, tmp_path): + rc = main(["--git-tag", "not-a-tag", "--component", "cuda-core", "--repo-root", str(tmp_path)]) + assert rc == 2 + + def test_path_traversal_returns_2(self, tmp_path): + rc = main(["--git-tag", "v1.0.0/../evil", "--component", "cuda-bindings", "--repo-root", str(tmp_path)]) + assert rc == 2 + + def test_component_prefix_mismatch_returns_2(self, tmp_path): + rc = main( + [ + "--git-tag", + "cuda-core-v0.7.0", + "--component", + "cuda-pathfinder", + "--repo-root", + str(tmp_path), + ] + ) + assert rc == 2 + + def test_mainline_bindings_requires_backport_decision(self, tmp_path, capsys): + rc = main( + [ + "--git-tag", + "v13.3.0", + "--component", + "cuda-bindings", + "--repo-root", + str(tmp_path), + "--backport-branch", + "12.9.x", + ] + ) + + captured = capsys.readouterr() + assert rc == 1 + assert "" in captured.err + + def test_mainline_bindings_accepts_not_planned(self, tmp_path): + self._make_notes(tmp_path, "cuda_bindings", "13.3.0") + + rc = main( + [ + "--git-tag", + "v13.3.0", + "--component", + "cuda-bindings", + "--repo-root", + str(tmp_path), + "--backport-branch", + "12.9.x", + "--backport-git-tag", + "not planned", + ] + ) + + assert rc == 0 + + def test_mainline_bindings_checks_planned_backport_notes(self, tmp_path, capsys): + self._make_notes(tmp_path, "cuda_bindings", "13.3.0") + + rc = main( + [ + "--git-tag", + "v13.3.0", + "--component", + "cuda-bindings", + "--repo-root", + str(tmp_path), + "--backport-branch", + "12.9.x", + "--backport-git-tag", + "v12.9.7", + ] + ) + + captured = capsys.readouterr() + assert rc == 1 + assert "12.9.7-notes.rst" in captured.err + + def test_mainline_bindings_accepts_planned_backport_notes(self, tmp_path): + self._make_notes(tmp_path, "cuda_bindings", "13.3.0") + self._make_notes(tmp_path, "cuda_bindings", "12.9.7") + + rc = main( + [ + "--git-tag", + "v13.3.0", + "--component", + "cuda-bindings", + "--repo-root", + str(tmp_path), + "--backport-branch", + "12.9.x", + "--backport-git-tag", + "v12.9.7", + ] + ) + + assert rc == 0 + + def test_mainline_cuda_python_accepts_planned_backport_notes(self, tmp_path): + self._make_notes(tmp_path, "cuda_python", "13.3.0") + self._make_notes(tmp_path, "cuda_python", "12.9.7") + + rc = main( + [ + "--git-tag", + "v13.3.0", + "--component", + "cuda-python", + "--repo-root", + str(tmp_path), + "--backport-branch", + "12.9.x", + "--backport-git-tag", + "v12.9.7", + ] + ) + + assert rc == 0 + + def test_backport_bindings_missing_notes_warns_without_failing(self, tmp_path, monkeypatch, capsys): + summary_path = tmp_path / "summary.md" + monkeypatch.setenv("GITHUB_STEP_SUMMARY", str(summary_path)) + + rc = main( + [ + "--git-tag", + "v12.9.7", + "--component", + "cuda-bindings", + "--repo-root", + str(tmp_path), + "--backport-branch", + "12.9.x", + ] + ) + + captured = capsys.readouterr() + assert rc == 0 + assert "::warning file=cuda_bindings/docs/source/release/12.9.7-notes.rst::" in captured.out + assert "12.9.7-notes.rst" in summary_path.read_text() + + def test_mainline_bindings_rejects_non_backport_tag(self, tmp_path): + self._make_notes(tmp_path, "cuda_bindings", "13.3.0") + + rc = main( + [ + "--git-tag", + "v13.3.0", + "--component", + "cuda-bindings", + "--repo-root", + str(tmp_path), + "--backport-branch", + "12.9.x", + "--backport-git-tag", + "v13.2.0", + ] + ) + + assert rc == 2 diff --git a/ci/tools/validate-release-wheels b/ci/tools/validate-release-wheels index 5757ca17bc4..52d24df4731 100755 --- a/ci/tools/validate-release-wheels +++ b/ci/tools/validate-release-wheels @@ -9,11 +9,12 @@ from __future__ import annotations import argparse -import re import sys from collections import defaultdict from pathlib import Path +from check_release_notes import parse_version_from_tag + COMPONENT_TO_DISTRIBUTIONS: dict[str, set[str]] = { "cuda-core": {"cuda_core"}, "cuda-bindings": {"cuda_bindings"}, @@ -22,11 +23,13 @@ COMPONENT_TO_DISTRIBUTIONS: dict[str, set[str]] = { "all": {"cuda_core", "cuda_bindings", "cuda_pathfinder", "cuda_python"}, } -TAG_PATTERNS = ( - re.compile(r"^v(?P\d+\.\d+\.\d+)"), - re.compile(r"^cuda-core-v(?P\d+\.\d+\.\d+)"), - re.compile(r"^cuda-pathfinder-v(?P\d+\.\d+\.\d+)"), -) +COMPONENT_TO_TAG_COMPONENTS: dict[str, tuple[str, ...]] = { + "cuda-core": ("cuda-core",), + "cuda-bindings": ("cuda-bindings",), + "cuda-pathfinder": ("cuda-pathfinder",), + "cuda-python": ("cuda-python",), + "all": ("cuda-core", "cuda-bindings", "cuda-pathfinder", "cuda-python"), +} def parse_args() -> argparse.Namespace: @@ -42,15 +45,18 @@ def parse_args() -> argparse.Namespace: return parser.parse_args() -def version_from_tag(tag: str) -> str: - for pattern in TAG_PATTERNS: - match = pattern.match(tag) - if match: - return match.group("version") +def version_from_tag(tag: str, component: str) -> str: + versions = { + version + for tag_component in COMPONENT_TO_TAG_COMPONENTS[component] + if (version := parse_version_from_tag(tag, tag_component)) is not None + } + if len(versions) == 1: + return versions.pop() raise ValueError( "Unsupported git tag format " - f"{tag!r}; expected tags beginning with vX.Y.Z, cuda-core-vX.Y.Z, " - "or cuda-pathfinder-vX.Y.Z." + f"{tag!r} for component {component!r}; expected vX.Y.Z[.postN], " + "cuda-core-vX.Y.Z[.postN], or cuda-pathfinder-vX.Y.Z[.postN]." ) @@ -64,7 +70,12 @@ def parse_wheel_dist_and_version(path: Path) -> tuple[str, str]: def main() -> int: args = parse_args() - expected_version = version_from_tag(args.git_tag) + try: + expected_version = version_from_tag(args.git_tag, args.component) + except ValueError as exc: + print(f"Error: {exc}", file=sys.stderr) + return 1 + expected_distributions = COMPONENT_TO_DISTRIBUTIONS[args.component] wheel_dir = Path(args.wheel_dir) diff --git a/ci/versions.yml b/ci/versions.yml index 153cc708919..0f0ab251e50 100644 --- a/ci/versions.yml +++ b/ci/versions.yml @@ -5,6 +5,6 @@ backport_branch: "12.9.x" # keep in sync with target-branch in .github/dependab cuda: build: - version: "13.2.0" + version: "13.3.0" prev_build: version: "12.9.1" diff --git a/conftest.py b/conftest.py index 7cea6e66127..7a0c59065d5 100644 --- a/conftest.py +++ b/conftest.py @@ -1,13 +1,31 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 + import os import pytest +from cuda.pathfinder import get_cuda_path_or_home + + +# Please keep in sync with the copy in cuda_core/tests/conftest.py. +def _cuda_headers_available() -> bool: + """Return True if CUDA headers are available, False if no CUDA path is set. + + Raises AssertionError if a CUDA path is set but has no include/ subdirectory. + """ + cuda_path = get_cuda_path_or_home() + if cuda_path is None: + return False + assert os.path.isdir(os.path.join(cuda_path, "include")), ( + f"CUDA path {cuda_path} does not contain an 'include' subdirectory" + ) + return True + def pytest_collection_modifyitems(config, items): # noqa: ARG001 - cuda_home = os.environ.get("CUDA_HOME") + have_headers = _cuda_headers_available() for item in items: nodeid = item.nodeid.replace("\\", "/") @@ -31,6 +49,10 @@ def pytest_collection_modifyitems(config, items): # noqa: ARG001 ): 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")) + # Gate core cython tests on CUDA_PATH + if "core" in item.keywords and not have_headers: + item.add_marker( + pytest.mark.skip( + reason="Environment variable CUDA_PATH or CUDA_HOME is not set: skipping core cython tests" + ) + ) diff --git a/context7.json b/context7.json new file mode 100644 index 00000000000..d87afcd31e6 --- /dev/null +++ b/context7.json @@ -0,0 +1,4 @@ +{ + "url": "https://context7.com/nvidia/cuda-python", + "public_key": "pk_gupaHhsdvsuT1j3BZpb7i" +} diff --git a/cuda_bindings/AGENTS.md b/cuda_bindings/AGENTS.md index 9688c9f94ca..d9324997a9f 100644 --- a/cuda_bindings/AGENTS.md +++ b/cuda_bindings/AGENTS.md @@ -44,7 +44,6 @@ subpackage in the `cuda-python` monorepo. - run: `pytest tests/cython/` - **Examples**: example coverage is pytest-based under `examples/`. - **Benchmarks**: run with `pytest --benchmark-only benchmarks/` when needed. -- **Orchestrated run**: from repo root, `scripts/run_tests.sh bindings`. ## Build and environment notes diff --git a/cuda_bindings/DESCRIPTION.rst b/cuda_bindings/DESCRIPTION.rst index f61b10f2e72..3129c9ca471 100644 --- a/cuda_bindings/DESCRIPTION.rst +++ b/cuda_bindings/DESCRIPTION.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 **************************************** cuda-bindings: Low-level CUDA interfaces diff --git a/cuda_bindings/LICENSE b/cuda_bindings/LICENSE index a5a65097cdc..d6f74778be8 100644 --- a/cuda_bindings/LICENSE +++ b/cuda_bindings/LICENSE @@ -1,48 +1,178 @@ -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. - -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. - -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. -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. - -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. - -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. - -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. - -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. - -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. - -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. - -(v. May 12, 2021) +Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/cuda_bindings/MANIFEST.in b/cuda_bindings/MANIFEST.in index 39073c42fdf..4394e5d9fe3 100644 --- a/cuda_bindings/MANIFEST.in +++ b/cuda_bindings/MANIFEST.in @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 recursive-include cuda/ *.pyx *.pxd *.pxi *.pyx.in *.pxd.in *.pxi.in *.h # at least with setuptools 75.0.0 this folder was added erroneously diff --git a/cuda_bindings/README.md b/cuda_bindings/README.md index a0657706d06..cc6a8948db3 100644 --- a/cuda_bindings/README.md +++ b/cuda_bindings/README.md @@ -10,6 +10,14 @@ Please refer to the [Installation page](https://nvidia.github.io/cuda-python/cud This subpackage adheres to the developing practices described in the parent metapackage [CONTRIBUTING.md](https://github.com/NVIDIA/cuda-python/blob/main/CONTRIBUTING.md). +## Debugging + +Pass the `pip` / `uv` configuration option `-C="debug=True"` or +`--config-settings="debug=True"` to explicitly to build debuggable binaries. +Debuggable binaries are built by default for editable builds. + +Debuggable builds are not supported on Windows. + ## Testing Testing dependencies can be installed using the `[test]` optional dependency identifier. For example, `pip install -v -e .[test]`. @@ -33,7 +41,7 @@ To run these tests: Cython tests are located in `tests/cython` and need to be built. These builds have the same CUDA Toolkit header requirements as [Installing from Source](https://nvidia.github.io/cuda-python/cuda-bindings/latest/install.html#requirements) where the major.minor version must match `cuda.bindings`. To build them: -1. Setup environment variable `CUDA_HOME` with the path to the CUDA Toolkit installation. +1. Setup environment variable `CUDA_PATH` (or `CUDA_HOME`) with the path to the CUDA Toolkit installation. Note: If both are set, `CUDA_PATH` takes precedence. 2. Run `build_tests` script located in `test/cython` appropriate to your platform. This will both cythonize the tests and build them. To run these tests: @@ -50,9 +58,6 @@ In addition, extra examples are included: launch a kernel on the device. Includes device memory allocation / deallocation, transfers between host and device, creation and usage of streams, and context management. -* `examples/extra/numba_emm_plugin.py`: Implements a Numba External Memory Management - plugin, showing that this CUDA Python Driver API can coexist with other - wrappers of the driver API. To run these samples: * `python -m pytest tests/cython/` against editable installations diff --git a/cuda_bindings/benchmarks/conftest.py b/cuda_bindings/benchmarks/conftest.py deleted file mode 100644 index 0ea7b1d7723..00000000000 --- a/cuda_bindings/benchmarks/conftest.py +++ /dev/null @@ -1,93 +0,0 @@ -# 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 - -from cuda.bindings import driver as cuda -from cuda.bindings import nvrtc -from cuda.bindings import runtime as cudart - - -def ASSERT_DRV(err): - if isinstance(err, cuda.CUresult): - if err != cuda.CUresult.CUDA_SUCCESS: - raise RuntimeError(f"Cuda Error: {err}") - elif isinstance(err, cudart.cudaError_t): - if err != cudart.cudaError_t.cudaSuccess: - raise RuntimeError(f"Cudart Error: {err}") - elif isinstance(err, nvrtc.nvrtcResult): - if err != nvrtc.nvrtcResult.NVRTC_SUCCESS: - raise RuntimeError(f"Nvrtc Error: {err}") - else: - raise RuntimeError(f"Unknown error type: {err}") - - -@pytest.fixture -def init_cuda(): - # Initialize - (err,) = cuda.cuInit(0) - ASSERT_DRV(err) - err, device = cuda.cuDeviceGet(0) - ASSERT_DRV(err) - err, ctx = cuda.cuCtxCreate(None, 0, device) - ASSERT_DRV(err) - - # create stream - err, stream = cuda.cuStreamCreate(cuda.CUstream_flags.CU_STREAM_NON_BLOCKING.value) - ASSERT_DRV(err) - - yield device, ctx, stream - - (err,) = cuda.cuStreamDestroy(stream) - ASSERT_DRV(err) - (err,) = cuda.cuCtxDestroy(ctx) - ASSERT_DRV(err) - - -@pytest.fixture -def load_module(): - module = None - - def _load_module(kernel_string, device): - nonlocal module - # Get module - err, major = cuda.cuDeviceGetAttribute( - cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, device - ) - ASSERT_DRV(err) - err, minor = cuda.cuDeviceGetAttribute( - cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, device - ) - ASSERT_DRV(err) - - err, prog = nvrtc.nvrtcCreateProgram(str.encode(kernel_string), b"kernelString.cu", 0, [], []) - ASSERT_DRV(err) - opts = [b"--fmad=false", bytes("--gpu-architecture=sm_" + str(major) + str(minor), "ascii")] - (err,) = nvrtc.nvrtcCompileProgram(prog, 2, opts) - - err_log, logSize = nvrtc.nvrtcGetProgramLogSize(prog) - ASSERT_DRV(err_log) - log = b" " * logSize - (err_log,) = nvrtc.nvrtcGetProgramLog(prog, log) - ASSERT_DRV(err_log) - result = log.decode() - if len(result) > 1: - print(result) - - ASSERT_DRV(err) - err, cubinSize = nvrtc.nvrtcGetCUBINSize(prog) - ASSERT_DRV(err) - cubin = b" " * cubinSize - (err,) = nvrtc.nvrtcGetCUBIN(prog, cubin) - ASSERT_DRV(err) - cubin = np.char.array(cubin) - err, module = cuda.cuModuleLoadData(cubin) - ASSERT_DRV(err) - - return module - - yield _load_module - - (err,) = cuda.cuModuleUnload(module) - ASSERT_DRV(err) diff --git a/cuda_bindings/benchmarks/kernels.py b/cuda_bindings/benchmarks/kernels.py deleted file mode 100644 index 36646fba003..00000000000 --- a/cuda_bindings/benchmarks/kernels.py +++ /dev/null @@ -1,159 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -kernel_string = """\ -#define ITEM_PARAM(x, T) T x -#define REP1(x, T) , ITEM_PARAM(x, T) -#define REP2(x, T) REP1(x##0, T) REP1(x##1, T) -#define REP4(x, T) REP2(x##0, T) REP2(x##1, T) -#define REP8(x, T) REP4(x##0, T) REP4(x##1, T) -#define REP16(x, T) REP8(x##0, T) REP8(x##1, T) -#define REP32(x, T) REP16(x##0, T) REP16(x##1, T) -#define REP64(x, T) REP32(x##0, T) REP32(x##1, T) -#define REP128(x, T) REP64(x##0, T) REP64(x##1, T) -#define REP256(x, T) REP128(x##0, T) REP128(x##1, T) - -template -struct KernelFunctionParam -{ - unsigned char p[maxBytes]; -}; - -extern "C" __global__ void small_kernel(float *f) -{ - *f = 0.0f; -} - -extern "C" __global__ void empty_kernel() -{ - return; -} - -extern "C" __global__ -void small_kernel_512_args( - ITEM_PARAM(F, int*) - REP1(A, int*) - REP2(A, int*) - REP4(A, int*) - REP8(A, int*) - REP16(A, int*) - REP32(A, int*) - REP64(A, int*) - REP128(A, int*) - REP256(A, int*)) -{ - *F = 0; -} - -extern "C" __global__ -void small_kernel_512_bools( - ITEM_PARAM(F, bool) - REP1(A, bool) - REP2(A, bool) - REP4(A, bool) - REP8(A, bool) - REP16(A, bool) - REP32(A, bool) - REP64(A, bool) - REP128(A, bool) - REP256(A, bool)) -{ - return; -} - -extern "C" __global__ -void small_kernel_512_ints( - ITEM_PARAM(F, int) - REP1(A, int) - REP2(A, int) - REP4(A, int) - REP8(A, int) - REP16(A, int) - REP32(A, int) - REP64(A, int) - REP128(A, int) - REP256(A, int)) -{ - return; -} - -extern "C" __global__ -void small_kernel_512_doubles( - ITEM_PARAM(F, double) - REP1(A, double) - REP2(A, double) - REP4(A, double) - REP8(A, double) - REP16(A, double) - REP32(A, double) - REP64(A, double) - REP128(A, double) - REP256(A, double)) -{ - return; -} - -extern "C" __global__ -void small_kernel_512_chars( - ITEM_PARAM(F, char) - REP1(A, char) - REP2(A, char) - REP4(A, char) - REP8(A, char) - REP16(A, char) - REP32(A, char) - REP64(A, char) - REP128(A, char) - REP256(A, char)) -{ - return; -} - -extern "C" __global__ -void small_kernel_512_longlongs( - ITEM_PARAM(F, long long) - REP1(A, long long) - REP2(A, long long) - REP4(A, long long) - REP8(A, long long) - REP16(A, long long) - REP32(A, long long) - REP64(A, long long) - REP128(A, long long) - REP256(A, long long)) -{ - return; -} - -extern "C" __global__ -void small_kernel_256_args( - ITEM_PARAM(F, int*) - REP1(A, int*) - REP2(A, int*) - REP4(A, int*) - REP8(A, int*) - REP16(A, int*) - REP32(A, int*) - REP64(A, int*) - REP128(A, int*)) -{ - *F = 0; -} - -extern "C" __global__ -void small_kernel_16_args( - ITEM_PARAM(F, int*) - REP1(A, int*) - REP2(A, int*) - REP4(A, int*) - REP8(A, int*)) -{ - *F = 0; -} - -extern "C" __global__ void small_kernel_2048B(KernelFunctionParam<2048> param) -{ - // Do not touch param to prevent compiler from copying - // the whole structure from const bank to lmem. -} -""" diff --git a/cuda_bindings/benchmarks/test_cupy.py b/cuda_bindings/benchmarks/test_cupy.py deleted file mode 100644 index 76dd6e6a45f..00000000000 --- a/cuda_bindings/benchmarks/test_cupy.py +++ /dev/null @@ -1,199 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -import ctypes - -import pytest - -try: - import cupy - - skip_tests = False -except ImportError: - skip_tests = True - -from kernels import kernel_string - - -def launch(kernel, args=()): - kernel((1,), (1,), args) - - -# Measure launch latency with no parmaeters -@pytest.mark.skipif(skip_tests, reason="cupy is not installed") -@pytest.mark.benchmark(group="cupy") -def test_launch_latency_empty_kernel(benchmark): - module = cupy.RawModule(code=kernel_string) - kernel = module.get_function("empty_kernel") - - stream = cupy.cuda.stream.Stream(non_blocking=True) - - with stream: - benchmark(launch, kernel) - stream.synchronize() - - -# Measure launch latency with a single parameter -@pytest.mark.skipif(skip_tests, reason="cupy is not installed") -@pytest.mark.benchmark(group="cupy") -def test_launch_latency_small_kernel(benchmark): - module = cupy.RawModule(code=kernel_string) - kernel = module.get_function("small_kernel") - cupy.cuda.set_allocator() - arg = cupy.cuda.alloc(ctypes.sizeof(ctypes.c_float)) - - stream = cupy.cuda.stream.Stream(non_blocking=True) - - with stream: - benchmark(launch, kernel, (arg,)) - stream.synchronize() - - -# Measure launch latency with many parameters using builtin parameter packing -@pytest.mark.skipif(skip_tests, reason="cupy is not installed") -@pytest.mark.benchmark(group="cupy") -def test_launch_latency_small_kernel_512_args(benchmark): - module = cupy.RawModule(code=kernel_string) - kernel = module.get_function("small_kernel_512_args") - cupy.cuda.set_allocator() - - args = [] - for _ in range(512): - args.append(cupy.cuda.alloc(ctypes.sizeof(ctypes.c_int))) - args = tuple(args) - - stream = cupy.cuda.stream.Stream(non_blocking=True) - - with stream: - benchmark(launch, kernel, args) - stream.synchronize() - - -# Measure launch latency with many parameters using builtin parameter packing -@pytest.mark.skipif(skip_tests, reason="cupy is not installed") -@pytest.mark.benchmark(group="cupy") -def test_launch_latency_small_kernel_512_bools(benchmark): - module = cupy.RawModule(code=kernel_string) - kernel = module.get_function("small_kernel_512_bools") - cupy.cuda.set_allocator() - - args = [True] * 512 - args = tuple(args) - - stream = cupy.cuda.stream.Stream(non_blocking=True) - - with stream: - benchmark(launch, kernel, args) - stream.synchronize() - - -# Measure launch latency with many parameters using builtin parameter packing -@pytest.mark.skipif(skip_tests, reason="cupy is not installed") -@pytest.mark.benchmark(group="cupy") -def test_launch_latency_small_kernel_512_doubles(benchmark): - module = cupy.RawModule(code=kernel_string) - kernel = module.get_function("small_kernel_512_doubles") - cupy.cuda.set_allocator() - - args = [1.2345] * 512 - args = tuple(args) - - stream = cupy.cuda.stream.Stream(non_blocking=True) - - with stream: - benchmark(launch, kernel, args) - stream.synchronize() - - -# Measure launch latency with many parameters using builtin parameter packing -@pytest.mark.skipif(skip_tests, reason="cupy is not installed") -@pytest.mark.benchmark(group="cupy") -def test_launch_latency_small_kernel_512_ints(benchmark): - module = cupy.RawModule(code=kernel_string) - kernel = module.get_function("small_kernel_512_ints") - cupy.cuda.set_allocator() - - args = [123] * 512 - args = tuple(args) - - stream = cupy.cuda.stream.Stream(non_blocking=True) - - with stream: - benchmark(launch, kernel, args) - stream.synchronize() - - -# Measure launch latency with many parameters using builtin parameter packing -@pytest.mark.skipif(skip_tests, reason="cupy is not installed") -@pytest.mark.benchmark(group="cupy") -def test_launch_latency_small_kernel_512_bytes(benchmark): - module = cupy.RawModule(code=kernel_string) - kernel = module.get_function("small_kernel_512_chars") - cupy.cuda.set_allocator() - - args = [127] * 512 - args = tuple(args) - - stream = cupy.cuda.stream.Stream(non_blocking=True) - - with stream: - benchmark(launch, kernel, args) - stream.synchronize() - - -# Measure launch latency with many parameters using builtin parameter packing -@pytest.mark.skipif(skip_tests, reason="cupy is not installed") -@pytest.mark.benchmark(group="cupy") -def test_launch_latency_small_kernel_512_longlongs(benchmark): - module = cupy.RawModule(code=kernel_string) - kernel = module.get_function("small_kernel_512_longlongs") - cupy.cuda.set_allocator() - - args = [9223372036854775806] * 512 - args = tuple(args) - - stream = cupy.cuda.stream.Stream(non_blocking=True) - - with stream: - benchmark(launch, kernel, args) - stream.synchronize() - - -# Measure launch latency with many parameters using builtin parameter packing -@pytest.mark.skipif(skip_tests, reason="cupy is not installed") -@pytest.mark.benchmark(group="cupy") -def test_launch_latency_small_kernel_256_args(benchmark): - module = cupy.RawModule(code=kernel_string) - kernel = module.get_function("small_kernel_256_args") - cupy.cuda.set_allocator() - - args = [] - for _ in range(256): - args.append(cupy.cuda.alloc(ctypes.sizeof(ctypes.c_int))) - args = tuple(args) - - stream = cupy.cuda.stream.Stream(non_blocking=True) - - with stream: - benchmark(launch, kernel, args) - stream.synchronize() - - -# Measure launch latency with many parameters using builtin parameter packing -@pytest.mark.skipif(skip_tests, reason="cupy is not installed") -@pytest.mark.benchmark(group="cupy") -def test_launch_latency_small_kernel_16_args(benchmark): - module = cupy.RawModule(code=kernel_string) - kernel = module.get_function("small_kernel_16_args") - cupy.cuda.set_allocator() - - args = [] - for _ in range(16): - args.append(cupy.cuda.alloc(ctypes.sizeof(ctypes.c_int))) - args = tuple(args) - - stream = cupy.cuda.stream.Stream(non_blocking=True) - - with stream: - benchmark(launch, kernel, args) - stream.synchronize() diff --git a/cuda_bindings/benchmarks/test_launch_latency.py b/cuda_bindings/benchmarks/test_launch_latency.py deleted file mode 100755 index dd994081a0a..00000000000 --- a/cuda_bindings/benchmarks/test_launch_latency.py +++ /dev/null @@ -1,336 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -import ctypes - -import pytest -from kernels import kernel_string - -from conftest import ASSERT_DRV -from cuda.bindings import driver as cuda - - -def launch(kernel, stream, args=(), arg_types=()): - cuda.cuLaunchKernel( - kernel, - 1, - 1, - 1, # grid dim - 1, - 1, - 1, # block dim - 0, - stream, # shared mem and stream - (args, arg_types), - 0, - ) # arguments - - -def launch_packed(kernel, stream, params): - cuda.cuLaunchKernel( - kernel, - 1, - 1, - 1, # grid dim - 1, - 1, - 1, # block dim - 0, - stream, # shared mem and stream - params, - 0, - ) # arguments - - -# Measure launch latency with no parmaeters -@pytest.mark.benchmark(group="launch-latency") -def test_launch_latency_empty_kernel(benchmark, init_cuda, load_module): - device, ctx, stream = init_cuda - module = load_module(kernel_string, device) - - err, func = cuda.cuModuleGetFunction(module, b"empty_kernel") - ASSERT_DRV(err) - - benchmark(launch, func, stream) - - cuda.cuCtxSynchronize() - - -# Measure launch latency with a single parameter -@pytest.mark.benchmark(group="launch-latency") -def test_launch_latency_small_kernel(benchmark, init_cuda, load_module): - device, ctx, stream = init_cuda - module = load_module(kernel_string, device) - - err, func = cuda.cuModuleGetFunction(module, b"small_kernel") - ASSERT_DRV(err) - - err, f = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_float)) - ASSERT_DRV(err) - - benchmark(launch, func, stream, args=(f,), arg_types=(None,)) - - cuda.cuCtxSynchronize() - - (err,) = cuda.cuMemFree(f) - ASSERT_DRV(err) - - -# Measure launch latency with many parameters using builtin parameter packing -@pytest.mark.benchmark(group="launch-latency") -def test_launch_latency_small_kernel_512_args(benchmark, init_cuda, load_module): - device, ctx, stream = init_cuda - module = load_module(kernel_string, device) - - err, func = cuda.cuModuleGetFunction(module, b"small_kernel_512_args") - ASSERT_DRV(err) - - args = [] - arg_types = [None] * 512 - for _ in arg_types: - err, p = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_int)) - ASSERT_DRV(err) - args.append(p) - - args = tuple(args) - arg_types = tuple(arg_types) - - benchmark(launch, func, stream, args=args, arg_types=arg_types) - - cuda.cuCtxSynchronize() - - for p in args: - (err,) = cuda.cuMemFree(p) - ASSERT_DRV(err) - - -@pytest.mark.benchmark(group="launch-latency") -def test_launch_latency_small_kernel_512_bools(benchmark, init_cuda, load_module): - device, ctx, stream = init_cuda - module = load_module(kernel_string, device) - - err, func = cuda.cuModuleGetFunction(module, b"small_kernel_512_bools") - ASSERT_DRV(err) - - args = [True] * 512 - arg_types = [ctypes.c_bool] * 512 - - args = tuple(args) - arg_types = tuple(arg_types) - - benchmark(launch, func, stream, args=args, arg_types=arg_types) - - cuda.cuCtxSynchronize() - - -@pytest.mark.benchmark(group="launch-latency") -def test_launch_latency_small_kernel_512_doubles(benchmark, init_cuda, load_module): - device, ctx, stream = init_cuda - module = load_module(kernel_string, device) - - err, func = cuda.cuModuleGetFunction(module, b"small_kernel_512_doubles") - ASSERT_DRV(err) - - args = [1.2345] * 512 - arg_types = [ctypes.c_double] * 512 - - args = tuple(args) - arg_types = tuple(arg_types) - - benchmark(launch, func, stream, args=args, arg_types=arg_types) - - cuda.cuCtxSynchronize() - - -@pytest.mark.benchmark(group="launch-latency") -def test_launch_latency_small_kernel_512_ints(benchmark, init_cuda, load_module): - device, ctx, stream = init_cuda - module = load_module(kernel_string, device) - - err, func = cuda.cuModuleGetFunction(module, b"small_kernel_512_ints") - ASSERT_DRV(err) - - args = [123] * 512 - arg_types = [ctypes.c_int] * 512 - - args = tuple(args) - arg_types = tuple(arg_types) - - benchmark(launch, func, stream, args=args, arg_types=arg_types) - - cuda.cuCtxSynchronize() - - -@pytest.mark.benchmark(group="launch-latency") -def test_launch_latency_small_kernel_512_bytes(benchmark, init_cuda, load_module): - device, ctx, stream = init_cuda - module = load_module(kernel_string, device) - - err, func = cuda.cuModuleGetFunction(module, b"small_kernel_512_chars") - ASSERT_DRV(err) - - args = [127] * 512 - arg_types = [ctypes.c_byte] * 512 - - args = tuple(args) - arg_types = tuple(arg_types) - - benchmark(launch, func, stream, args=args, arg_types=arg_types) - - cuda.cuCtxSynchronize() - - -@pytest.mark.benchmark(group="launch-latency") -def test_launch_latency_small_kernel_512_longlongs(benchmark, init_cuda, load_module): - device, ctx, stream = init_cuda - module = load_module(kernel_string, device) - - err, func = cuda.cuModuleGetFunction(module, b"small_kernel_512_longlongs") - ASSERT_DRV(err) - - args = [9223372036854775806] * 512 - arg_types = [ctypes.c_longlong] * 512 - - args = tuple(args) - arg_types = tuple(arg_types) - - benchmark(launch, func, stream, args=args, arg_types=arg_types) - - cuda.cuCtxSynchronize() - - -# Measure launch latency with many parameters using builtin parameter packing -@pytest.mark.benchmark(group="launch-latency") -def test_launch_latency_small_kernel_256_args(benchmark, init_cuda, load_module): - device, ctx, stream = init_cuda - module = load_module(kernel_string, device) - - err, func = cuda.cuModuleGetFunction(module, b"small_kernel_256_args") - ASSERT_DRV(err) - - args = [] - arg_types = [None] * 256 - for _ in arg_types: - err, p = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_int)) - ASSERT_DRV(err) - args.append(p) - - args = tuple(args) - arg_types = tuple(arg_types) - - benchmark(launch, func, stream, args=args, arg_types=arg_types) - - cuda.cuCtxSynchronize() - - for p in args: - (err,) = cuda.cuMemFree(p) - ASSERT_DRV(err) - - -# Measure launch latency with many parameters using builtin parameter packing -@pytest.mark.benchmark(group="launch-latency") -def test_launch_latency_small_kernel_16_args(benchmark, init_cuda, load_module): - device, ctx, stream = init_cuda - module = load_module(kernel_string, device) - - err, func = cuda.cuModuleGetFunction(module, b"small_kernel_16_args") - ASSERT_DRV(err) - - args = [] - arg_types = [None] * 16 - for _ in arg_types: - err, p = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_int)) - ASSERT_DRV(err) - args.append(p) - - args = tuple(args) - arg_types = tuple(arg_types) - - benchmark(launch, func, stream, args=args, arg_types=arg_types) - - cuda.cuCtxSynchronize() - - for p in args: - (err,) = cuda.cuMemFree(p) - ASSERT_DRV(err) - - -# Measure launch latency with many parameters, excluding parameter packing -@pytest.mark.benchmark(group="launch-latency") -def test_launch_latency_small_kernel_512_args_ctypes(benchmark, init_cuda, load_module): - device, ctx, stream = init_cuda - module = load_module(kernel_string, device) - - err, func = cuda.cuModuleGetFunction(module, b"small_kernel_512_args") - ASSERT_DRV(err) - - vals = [] - val_ps = [] - for i in range(512): - err, p = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_int)) - ASSERT_DRV(err) - vals.append(p) - val_ps.append(ctypes.c_void_p(int(vals[i]))) - - packagedParams = (ctypes.c_void_p * 512)() - for i in range(512): - packagedParams[i] = ctypes.addressof(val_ps[i]) - - benchmark(launch_packed, func, stream, packagedParams) - - cuda.cuCtxSynchronize() - - for p in vals: - (err,) = cuda.cuMemFree(p) - ASSERT_DRV(err) - - -def pack_and_launch(kernel, stream, params): - packed_params = (ctypes.c_void_p * len(params))() - ptrs = [0] * len(params) - for i in range(len(params)): - ptrs[i] = ctypes.c_void_p(int(params[i])) - packed_params[i] = ctypes.addressof(ptrs[i]) - - cuda.cuLaunchKernel(kernel, 1, 1, 1, 1, 1, 1, 0, stream, packed_params, 0) - - -# Measure launch latency plus parameter packing using ctypes -@pytest.mark.benchmark(group="launch-latency") -def test_launch_latency_small_kernel_512_args_ctypes_with_packing(benchmark, init_cuda, load_module): - device, ctx, stream = init_cuda - module = load_module(kernel_string, device) - - err, func = cuda.cuModuleGetFunction(module, b"small_kernel_512_args") - ASSERT_DRV(err) - - vals = [] - for i in range(512): - err, p = cuda.cuMemAlloc(ctypes.sizeof(ctypes.c_int)) - ASSERT_DRV(err) - vals.append(p) - - benchmark(pack_and_launch, func, stream, vals) - - cuda.cuCtxSynchronize() - - for p in vals: - (err,) = cuda.cuMemFree(p) - ASSERT_DRV(err) - - -# Measure launch latency with a single large struct parameter -@pytest.mark.benchmark(group="launch-latency") -def test_launch_latency_small_kernel_2048B(benchmark, init_cuda, load_module): - device, ctx, stream = init_cuda - module = load_module(kernel_string, device) - - err, func = cuda.cuModuleGetFunction(module, b"small_kernel_2048B") - ASSERT_DRV(err) - - class struct_2048B(ctypes.Structure): - _fields_ = [("values", ctypes.c_uint8 * 2048)] - - benchmark(launch, func, stream, args=(struct_2048B(),), arg_types=(None,)) - - cuda.cuCtxSynchronize() diff --git a/cuda_bindings/benchmarks/test_numba.py b/cuda_bindings/benchmarks/test_numba.py deleted file mode 100644 index dfe084c6b1c..00000000000 --- a/cuda_bindings/benchmarks/test_numba.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 - -try: - from numba import cuda - - skip_tests = False -except ImportError: - skip_tests = True - - -def launch_empty(kernel, stream): - kernel[1, 1, stream]() - - -def launch(kernel, stream, arg): - kernel[1, 1, stream](arg) - - -# Measure launch latency with no parmaeters -@pytest.mark.skipif(skip_tests, reason="Numba is not installed") -@pytest.mark.benchmark(group="numba", min_rounds=1000) -def test_launch_latency_empty_kernel(benchmark): - stream = cuda.stream() - - @cuda.jit - def empty_kernel(): - return - - benchmark(launch_empty, empty_kernel, stream) - - cuda.synchronize() - - -# Measure launch latency with a single parameter -@pytest.mark.skipif(skip_tests, reason="Numba is not installed") -@pytest.mark.benchmark(group="numba", min_rounds=1000) -def test_launch_latency_small_kernel(benchmark): - stream = cuda.stream() - - arg = cuda.device_array(1, dtype=np.float32, stream=stream) - - @cuda.jit - def small_kernel(array): - array[0] = 0.0 - - benchmark(launch, small_kernel, stream, arg) - - cuda.synchronize() diff --git a/cuda_bindings/benchmarks/test_pointer_attributes.py b/cuda_bindings/benchmarks/test_pointer_attributes.py deleted file mode 100644 index fae72ffd79a..00000000000 --- a/cuda_bindings/benchmarks/test_pointer_attributes.py +++ /dev/null @@ -1,112 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -import random - -import pytest - -from conftest import ASSERT_DRV -from cuda.bindings import driver as cuda - -random.seed(0) - -idx = 0 - - -def query_attribute(attribute, ptrs): - global idx - ptr = ptrs[idx] - idx = (idx + 1) % len(ptrs) - - cuda.cuPointerGetAttribute(attribute, ptr) - - -def query_attributes(attributes, ptrs): - global idx - ptr = ptrs[idx] - idx = (idx + 1) % len(ptrs) - - cuda.cuPointerGetAttributes(len(attributes), attributes, ptr) - - -@pytest.mark.benchmark(group="pointer-attributes") -# Measure cuPointerGetAttribute in the same way as C benchmarks -def test_pointer_get_attribute(benchmark, init_cuda): - _ = init_cuda - - ptrs = [] - for _ in range(500): - err, ptr = cuda.cuMemAlloc(1 << 18) - ASSERT_DRV(err) - ptrs.append(ptr) - - random.shuffle(ptrs) - - benchmark(query_attribute, cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_MEMORY_TYPE, ptrs) - - for p in ptrs: - (err,) = cuda.cuMemFree(p) - ASSERT_DRV(err) - - -@pytest.mark.benchmark(group="pointer-attributes") -# Measure cuPointerGetAttributes with all attributes -def test_pointer_get_attributes_all(benchmark, init_cuda): - _ = init_cuda - - ptrs = [] - for _ in range(500): - err, ptr = cuda.cuMemAlloc(1 << 18) - ASSERT_DRV(err) - ptrs.append(ptr) - - random.shuffle(ptrs) - - attributes = [ - cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_CONTEXT, - cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_MEMORY_TYPE, - cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_HOST_POINTER, - cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_P2P_TOKENS, - cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_SYNC_MEMOPS, - cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_BUFFER_ID, - cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_IS_MANAGED, - cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL, - cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE, - cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_RANGE_START_ADDR, - cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_RANGE_SIZE, - cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_MAPPED, - cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES, - cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE, - cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_ACCESS_FLAGS, - cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE, - ] - - benchmark(query_attributes, attributes, ptrs) - - for p in ptrs: - (err,) = cuda.cuMemFree(p) - ASSERT_DRV(err) - - -@pytest.mark.benchmark(group="pointer-attributes") -# Measure cuPointerGetAttributes with a single attribute -def test_pointer_get_attributes_single(benchmark, init_cuda): - _ = init_cuda - - ptrs = [] - for _ in range(500): - err, ptr = cuda.cuMemAlloc(1 << 18) - ASSERT_DRV(err) - ptrs.append(ptr) - - random.shuffle(ptrs) - - attributes = [ - cuda.CUpointer_attribute.CU_POINTER_ATTRIBUTE_MEMORY_TYPE, - ] - - benchmark(query_attributes, attributes, ptrs) - - for p in ptrs: - (err,) = cuda.cuMemFree(p) - ASSERT_DRV(err) diff --git a/cuda_bindings/build_hooks.py b/cuda_bindings/build_hooks.py index b2d3029c696..a23d0949258 100644 --- a/cuda_bindings/build_hooks.py +++ b/cuda_bindings/build_hooks.py @@ -1,5 +1,5 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # This module implements basic PEP 517 backend support to defer CUDA-dependent # logic (header parsing, code generation, cythonization) to build time. See: @@ -33,24 +33,51 @@ _extensions = None +# Please keep in sync with the copy in cuda_core/build_hooks.py. +def _import_get_cuda_path_or_home(): + """Import get_cuda_path_or_home, working around PEP 517 namespace shadowing. + + See https://github.com/NVIDIA/cuda-python/issues/1824 for why this helper is needed. + """ + try: + import cuda.pathfinder + except ModuleNotFoundError as exc: + if exc.name not in ("cuda", "cuda.pathfinder"): + raise + try: + import cuda + except ModuleNotFoundError: + cuda = None + + for p in sys.path: + sp_cuda = os.path.join(p, "cuda") + if os.path.isdir(os.path.join(sp_cuda, "pathfinder")): + cuda.__path__ = list(cuda.__path__) + [sp_cuda] + break + else: + raise ModuleNotFoundError( + "cuda-pathfinder is not installed in the build environment. " + "Ensure 'cuda-pathfinder>=1.5' is in build-system.requires." + ) + import cuda.pathfinder + + return cuda.pathfinder.get_cuda_path_or_home + + @functools.cache -def _get_cuda_paths() -> list[str]: - CUDA_HOME = os.environ.get("CUDA_HOME", os.environ.get("CUDA_PATH", None)) - if not CUDA_HOME: - raise RuntimeError("Environment variable CUDA_HOME or CUDA_PATH is not set") - CUDA_HOME = CUDA_HOME.split(os.pathsep) - print("CUDA paths:", CUDA_HOME) - return CUDA_HOME +def _get_cuda_path() -> str: + get_cuda_path_or_home = _import_get_cuda_path_or_home() + cuda_path = get_cuda_path_or_home() + if not cuda_path: + raise RuntimeError("Environment variable CUDA_PATH or CUDA_HOME is not set") + print("CUDA path:", cuda_path) + return cuda_path # ----------------------------------------------------------------------- # Header parsing helpers (called only from _build_cuda_bindings) _REQUIRED_HEADERS = { - "driver": [ - "cuda.h", - "cudaProfiler.h", - ], "runtime": [ "driver_types.h", "vector_types.h", @@ -63,9 +90,7 @@ def _get_cuda_paths() -> list[str]: "driver_functions.h", "cuda_profiler_api.h", ], - "nvrtc": [ - "nvrtc.h", - ], + # nvrtc: headers no longer parsed at build time (pre-generated by cybind). # During compilation, Cython will reference C headers that are not # explicitly parsed above. These are the known dependencies: # @@ -80,13 +105,32 @@ def __init__(self, name, members): self._name = name self._member_names = [] self._member_types = [] + self._member_declarators = [] for var_name, var_type, _ in members: - var_type = var_type[0] - var_type = var_type.removeprefix("struct ") - var_type = var_type.removeprefix("union ") + base_type = var_type[0] + base_type = base_type.removeprefix("struct ") + base_type = base_type.removeprefix("union ") self._member_names += [var_name] - self._member_types += [var_type] + self._member_types += [base_type] + self._member_declarators += [tuple(var_type[1:])] + + def member_type(self, member_name): + try: + return self._member_types[self._member_names.index(member_name)] + except ValueError: + return None + + def member_array_length(self, member_name): + try: + declarators = self._member_declarators[self._member_names.index(member_name)] + except ValueError: + return None + + for declarator in declarators: + if isinstance(declarator, list) and len(declarator) == 1: + return declarator[0] + return None def discoverMembers(self, memberDict, prefix, seen=None): if seen is None: @@ -133,8 +177,8 @@ def _fetch_header_paths(required_headers, include_path_list): if missing_headers: error_message = "Couldn't find required headers: " error_message += ", ".join(missing_headers) - cuda_paths = _get_cuda_paths() - raise RuntimeError(f'{error_message}\nIs CUDA_HOME setup correctly? (CUDA_HOME="{cuda_paths}")') + cuda_path = _get_cuda_path() + raise RuntimeError(f'{error_message}\nIs CUDA_PATH setup correctly? (CUDA_PATH="{cuda_path}")') return header_dict @@ -163,6 +207,7 @@ def _parse_headers(header_dict, include_path_list, parser_caching): # Since we only support 64 bit architectures, we can inline the sizeof(T*) to 8 and then compute the # result in Python. The arithmetic expression is preserved to help with clarity and understanding r"char reserved\[52 - sizeof\(CUcheckpointGpuPair \*\)\];": rf"char reserved[{52 - 8}];", + r"char reserved\[64 - sizeof\(CUcheckpointGpuPair \*\) - sizeof\(unsigned int\)\];": rf"char reserved[{64 - 8 - 4}];", } print(f'Parsing headers in "{include_path_list}" (Caching = {parser_caching})', flush=True) @@ -280,7 +325,7 @@ def _prep_extensions(sources, libraries, include_dirs, library_dirs, extra_compi # Main build function -def _build_cuda_bindings(strip=False): +def _build_cuda_bindings(debug=False): """Build all cuda-bindings extensions. All CUDA-dependent logic (header parsing, code generation, cythonization) @@ -291,7 +336,7 @@ def _build_cuda_bindings(strip=False): global _extensions - cuda_paths = _get_cuda_paths() + cuda_path = _get_cuda_path() if os.environ.get("PARALLEL_LEVEL") is not None: warn( @@ -307,11 +352,18 @@ def _build_cuda_bindings(strip=False): compile_for_coverage = bool(int(os.environ.get("CUDA_PYTHON_COVERAGE", "0"))) # Parse CUDA headers - include_path_list = [os.path.join(path, "include") for path in cuda_paths] + include_path_list = [os.path.join(cuda_path, "include")] header_dict = _fetch_header_paths(_REQUIRED_HEADERS, include_path_list) found_types, found_functions, found_values, found_struct, struct_list = _parse_headers( header_dict, include_path_list, parser_caching ) + struct_field_types = {} + struct_field_array_lengths = {} + for struct_name, struct in struct_list.items(): + for member_name in struct._member_names: + key = f"{struct_name}.{member_name}" + struct_field_types[key] = struct.member_type(member_name) + struct_field_array_lengths[key] = struct.member_array_length(member_name) # Generate code from .in templates path_list = [ @@ -334,6 +386,8 @@ def _build_cuda_bindings(strip=False): "found_values": found_values, "found_struct": found_struct, "struct_list": struct_list, + "struct_field_types": struct_field_types, + "struct_field_array_lengths": struct_field_array_lengths, "os": os, "sys": sys, "platform": platform, @@ -347,26 +401,28 @@ def _build_cuda_bindings(strip=False): ] + include_path_list library_dirs = [sysconfig.get_path("platlib"), os.path.join(os.sys.prefix, "lib")] cudalib_subdirs = [r"lib\x64"] if sys.platform == "win32" else ["lib64", "lib"] - library_dirs.extend(os.path.join(prefix, subdir) for prefix in cuda_paths for subdir in cudalib_subdirs) + library_dirs.extend(os.path.join(cuda_path, subdir) for subdir in cudalib_subdirs) extra_compile_args = [] extra_link_args = [] extra_cythonize_kwargs = {} - if sys.platform != "win32": + if sys.platform == "win32": + if debug: + raise RuntimeError("Debuggable builds are not supported on Windows.") + else: extra_compile_args += [ "-std=c++14", "-fpermissive", "-Wno-deprecated-declarations", "-fno-var-tracking-assignments", ] - if "--debug" in sys.argv: + if debug: extra_cythonize_kwargs["gdb_debug"] = True extra_compile_args += ["-g", "-O0"] extra_compile_args += ["-D _GLIBCXX_ASSERTIONS"] else: extra_compile_args += ["-O3"] - if strip and sys.platform == "linux": - extra_link_args += ["-Wl,--strip-all"] + extra_link_args += ["-Wl,--strip-all"] if compile_for_coverage: # CYTHON_TRACE_NOGIL indicates to trace nogil functions. It is not # related to free-threading builds. @@ -389,8 +445,6 @@ def _cleanup_dst_files(): cuda_bindings_files = [f for f in cuda_bindings_files if "cufile" not in f] sources_list = [ # private - (["cuda/bindings/_bindings/cydriver.pyx", "cuda/bindings/_bindings/loader.cpp"], None), - (["cuda/bindings/_bindings/cynvrtc.pyx"], None), (["cuda/bindings/_bindings/cyruntime.pyx"], static_runtime_libraries), (["cuda/bindings/_bindings/cyruntime_ptds.pyx"], static_runtime_libraries), # utils @@ -426,10 +480,13 @@ def _cleanup_dst_files(): def build_wheel(wheel_directory, config_settings=None, metadata_directory=None): - _build_cuda_bindings(strip=True) + debug = config_settings.get("debug", False) if config_settings else False + _build_cuda_bindings(debug=debug) return _build_meta.build_wheel(wheel_directory, config_settings, metadata_directory) def build_editable(wheel_directory, config_settings=None, metadata_directory=None): - _build_cuda_bindings(strip=False) + debug_default = sys.platform != "win32" # Debug builds not supported on Windows + debug = config_settings.get("debug", debug_default) if config_settings else debug_default + _build_cuda_bindings(debug=debug) return _build_meta.build_editable(wheel_directory, config_settings, metadata_directory) diff --git a/cuda_bindings/cuda/bindings/__init__.py b/cuda_bindings/cuda/bindings/__init__.py index 38d71fcfde4..ea1daae3e0b 100644 --- a/cuda_bindings/cuda/bindings/__init__.py +++ b/cuda_bindings/cuda/bindings/__init__.py @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 from cuda.bindings import utils from cuda.bindings._version import __version__ diff --git a/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in deleted file mode 100644 index a5e73b4e995..00000000000 --- a/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in +++ /dev/null @@ -1,16926 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -# This code was automatically generated with version 13.2.0, generator version 8797618. Do not modify it directly. -{{if 'Windows' == platform.system()}} -import os -cimport cuda.bindings._lib.windll as windll -{{else}} -cimport cuda.bindings._lib.dlfcn as dlfcn -{{endif}} -from libc.stdint cimport intptr_t, uintptr_t -import os -import sys -cimport cuda.bindings._bindings.loader as loader -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}} -{{if 'cuInit' in found_functions}}cdef void *__cuInit = NULL{{endif}} -{{if 'cuDriverGetVersion' in found_functions}}cdef void *__cuDriverGetVersion = NULL{{endif}} -{{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_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}} -{{if 'cuDeviceGetDefaultMemPool' in found_functions}}cdef void *__cuDeviceGetDefaultMemPool = NULL{{endif}} -{{if 'cuDeviceGetExecAffinitySupport' in found_functions}}cdef void *__cuDeviceGetExecAffinitySupport = NULL{{endif}} -{{if 'cuFlushGPUDirectRDMAWrites' in found_functions}}cdef void *__cuFlushGPUDirectRDMAWrites = NULL{{endif}} -{{if 'cuDeviceGetProperties' in found_functions}}cdef void *__cuDeviceGetProperties = NULL{{endif}} -{{if 'cuDeviceComputeCapability' in found_functions}}cdef void *__cuDeviceComputeCapability = NULL{{endif}} -{{if 'cuDevicePrimaryCtxRetain' in found_functions}}cdef void *__cuDevicePrimaryCtxRetain = NULL{{endif}} -{{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}}cdef void *__cuDevicePrimaryCtxRelease_v2 = NULL{{endif}} -{{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_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}} -{{if 'cuCtxPopCurrent_v2' in found_functions}}cdef void *__cuCtxPopCurrent_v2 = NULL{{endif}} -{{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}} -{{if 'cuCtxSetCacheConfig' in found_functions}}cdef void *__cuCtxSetCacheConfig = NULL{{endif}} -{{if 'cuCtxGetApiVersion' in found_functions}}cdef void *__cuCtxGetApiVersion = NULL{{endif}} -{{if 'cuCtxGetStreamPriorityRange' in found_functions}}cdef void *__cuCtxGetStreamPriorityRange = NULL{{endif}} -{{if 'cuCtxResetPersistingL2Cache' in found_functions}}cdef void *__cuCtxResetPersistingL2Cache = NULL{{endif}} -{{if 'cuCtxGetExecAffinity' in found_functions}}cdef void *__cuCtxGetExecAffinity = NULL{{endif}} -{{if 'cuCtxRecordEvent' in found_functions}}cdef void *__cuCtxRecordEvent = NULL{{endif}} -{{if 'cuCtxWaitEvent' in found_functions}}cdef void *__cuCtxWaitEvent = NULL{{endif}} -{{if 'cuCtxAttach' in found_functions}}cdef void *__cuCtxAttach = NULL{{endif}} -{{if 'cuCtxDetach' in found_functions}}cdef void *__cuCtxDetach = NULL{{endif}} -{{if 'cuCtxGetSharedMemConfig' in found_functions}}cdef void *__cuCtxGetSharedMemConfig = NULL{{endif}} -{{if 'cuCtxSetSharedMemConfig' in found_functions}}cdef void *__cuCtxSetSharedMemConfig = NULL{{endif}} -{{if 'cuModuleLoad' in found_functions}}cdef void *__cuModuleLoad = NULL{{endif}} -{{if 'cuModuleLoadData' in found_functions}}cdef void *__cuModuleLoadData = NULL{{endif}} -{{if 'cuModuleLoadDataEx' in found_functions}}cdef void *__cuModuleLoadDataEx = NULL{{endif}} -{{if 'cuModuleLoadFatBinary' in found_functions}}cdef void *__cuModuleLoadFatBinary = NULL{{endif}} -{{if 'cuModuleUnload' in found_functions}}cdef void *__cuModuleUnload = NULL{{endif}} -{{if 'cuModuleGetLoadingMode' in found_functions}}cdef void *__cuModuleGetLoadingMode = NULL{{endif}} -{{if 'cuModuleGetFunction' in found_functions}}cdef void *__cuModuleGetFunction = NULL{{endif}} -{{if 'cuModuleGetFunctionCount' in found_functions}}cdef void *__cuModuleGetFunctionCount = NULL{{endif}} -{{if 'cuModuleEnumerateFunctions' in found_functions}}cdef void *__cuModuleEnumerateFunctions = NULL{{endif}} -{{if 'cuModuleGetGlobal_v2' in found_functions}}cdef void *__cuModuleGetGlobal_v2 = NULL{{endif}} -{{if 'cuLinkCreate_v2' in found_functions}}cdef void *__cuLinkCreate_v2 = NULL{{endif}} -{{if 'cuLinkAddData_v2' in found_functions}}cdef void *__cuLinkAddData_v2 = NULL{{endif}} -{{if 'cuLinkAddFile_v2' in found_functions}}cdef void *__cuLinkAddFile_v2 = NULL{{endif}} -{{if 'cuLinkComplete' in found_functions}}cdef void *__cuLinkComplete = NULL{{endif}} -{{if 'cuLinkDestroy' in found_functions}}cdef void *__cuLinkDestroy = NULL{{endif}} -{{if 'cuModuleGetTexRef' in found_functions}}cdef void *__cuModuleGetTexRef = NULL{{endif}} -{{if 'cuModuleGetSurfRef' in found_functions}}cdef void *__cuModuleGetSurfRef = NULL{{endif}} -{{if 'cuLibraryLoadData' in found_functions}}cdef void *__cuLibraryLoadData = NULL{{endif}} -{{if 'cuLibraryLoadFromFile' in found_functions}}cdef void *__cuLibraryLoadFromFile = NULL{{endif}} -{{if 'cuLibraryUnload' in found_functions}}cdef void *__cuLibraryUnload = NULL{{endif}} -{{if 'cuLibraryGetKernel' in found_functions}}cdef void *__cuLibraryGetKernel = NULL{{endif}} -{{if 'cuLibraryGetKernelCount' in found_functions}}cdef void *__cuLibraryGetKernelCount = NULL{{endif}} -{{if 'cuLibraryEnumerateKernels' in found_functions}}cdef void *__cuLibraryEnumerateKernels = NULL{{endif}} -{{if 'cuLibraryGetModule' in found_functions}}cdef void *__cuLibraryGetModule = NULL{{endif}} -{{if 'cuKernelGetFunction' in found_functions}}cdef void *__cuKernelGetFunction = NULL{{endif}} -{{if 'cuKernelGetLibrary' in found_functions}}cdef void *__cuKernelGetLibrary = NULL{{endif}} -{{if 'cuLibraryGetGlobal' in found_functions}}cdef void *__cuLibraryGetGlobal = NULL{{endif}} -{{if 'cuLibraryGetManaged' in found_functions}}cdef void *__cuLibraryGetManaged = NULL{{endif}} -{{if 'cuLibraryGetUnifiedFunction' in found_functions}}cdef void *__cuLibraryGetUnifiedFunction = NULL{{endif}} -{{if 'cuKernelGetAttribute' in found_functions}}cdef void *__cuKernelGetAttribute = NULL{{endif}} -{{if 'cuKernelSetAttribute' in found_functions}}cdef void *__cuKernelSetAttribute = NULL{{endif}} -{{if 'cuKernelSetCacheConfig' in found_functions}}cdef void *__cuKernelSetCacheConfig = NULL{{endif}} -{{if 'cuKernelGetName' in found_functions}}cdef void *__cuKernelGetName = NULL{{endif}} -{{if 'cuKernelGetParamInfo' in found_functions}}cdef void *__cuKernelGetParamInfo = NULL{{endif}} -{{if 'cuKernelGetParamCount' in found_functions}}cdef void *__cuKernelGetParamCount = NULL{{endif}} -{{if 'cuMemGetInfo_v2' in found_functions}}cdef void *__cuMemGetInfo_v2 = NULL{{endif}} -{{if 'cuMemAlloc_v2' in found_functions}}cdef void *__cuMemAlloc_v2 = NULL{{endif}} -{{if 'cuMemAllocPitch_v2' in found_functions}}cdef void *__cuMemAllocPitch_v2 = NULL{{endif}} -{{if 'cuMemFree_v2' in found_functions}}cdef void *__cuMemFree_v2 = NULL{{endif}} -{{if 'cuMemGetAddressRange_v2' in found_functions}}cdef void *__cuMemGetAddressRange_v2 = NULL{{endif}} -{{if 'cuMemAllocHost_v2' in found_functions}}cdef void *__cuMemAllocHost_v2 = NULL{{endif}} -{{if 'cuMemFreeHost' in found_functions}}cdef void *__cuMemFreeHost = NULL{{endif}} -{{if 'cuMemHostAlloc' in found_functions}}cdef void *__cuMemHostAlloc = NULL{{endif}} -{{if 'cuMemHostGetDevicePointer_v2' in found_functions}}cdef void *__cuMemHostGetDevicePointer_v2 = NULL{{endif}} -{{if 'cuMemHostGetFlags' in found_functions}}cdef void *__cuMemHostGetFlags = NULL{{endif}} -{{if 'cuMemAllocManaged' in found_functions}}cdef void *__cuMemAllocManaged = NULL{{endif}} -{{if 'cuDeviceRegisterAsyncNotification' in found_functions}}cdef void *__cuDeviceRegisterAsyncNotification = NULL{{endif}} -{{if 'cuDeviceUnregisterAsyncNotification' in found_functions}}cdef void *__cuDeviceUnregisterAsyncNotification = NULL{{endif}} -{{if 'cuDeviceGetByPCIBusId' in found_functions}}cdef void *__cuDeviceGetByPCIBusId = NULL{{endif}} -{{if 'cuDeviceGetPCIBusId' in found_functions}}cdef void *__cuDeviceGetPCIBusId = NULL{{endif}} -{{if 'cuIpcGetEventHandle' in found_functions}}cdef void *__cuIpcGetEventHandle = NULL{{endif}} -{{if 'cuIpcOpenEventHandle' in found_functions}}cdef void *__cuIpcOpenEventHandle = NULL{{endif}} -{{if 'cuIpcGetMemHandle' in found_functions}}cdef void *__cuIpcGetMemHandle = NULL{{endif}} -{{if 'cuIpcOpenMemHandle_v2' in found_functions}}cdef void *__cuIpcOpenMemHandle_v2 = NULL{{endif}} -{{if 'cuIpcCloseMemHandle' in found_functions}}cdef void *__cuIpcCloseMemHandle = NULL{{endif}} -{{if 'cuMemHostRegister_v2' in found_functions}}cdef void *__cuMemHostRegister_v2 = NULL{{endif}} -{{if 'cuMemHostUnregister' in found_functions}}cdef void *__cuMemHostUnregister = NULL{{endif}} -{{if 'cuMemcpy' in found_functions}}cdef void *__cuMemcpy = NULL{{endif}} -{{if 'cuMemcpyPeer' in found_functions}}cdef void *__cuMemcpyPeer = NULL{{endif}} -{{if 'cuMemcpyHtoD_v2' in found_functions}}cdef void *__cuMemcpyHtoD_v2 = NULL{{endif}} -{{if 'cuMemcpyDtoH_v2' in found_functions}}cdef void *__cuMemcpyDtoH_v2 = NULL{{endif}} -{{if 'cuMemcpyDtoD_v2' in found_functions}}cdef void *__cuMemcpyDtoD_v2 = NULL{{endif}} -{{if 'cuMemcpyDtoA_v2' in found_functions}}cdef void *__cuMemcpyDtoA_v2 = NULL{{endif}} -{{if 'cuMemcpyAtoD_v2' in found_functions}}cdef void *__cuMemcpyAtoD_v2 = NULL{{endif}} -{{if 'cuMemcpyHtoA_v2' in found_functions}}cdef void *__cuMemcpyHtoA_v2 = NULL{{endif}} -{{if 'cuMemcpyAtoH_v2' in found_functions}}cdef void *__cuMemcpyAtoH_v2 = NULL{{endif}} -{{if 'cuMemcpyAtoA_v2' in found_functions}}cdef void *__cuMemcpyAtoA_v2 = NULL{{endif}} -{{if 'cuMemcpy2D_v2' in found_functions}}cdef void *__cuMemcpy2D_v2 = NULL{{endif}} -{{if 'cuMemcpy2DUnaligned_v2' in found_functions}}cdef void *__cuMemcpy2DUnaligned_v2 = NULL{{endif}} -{{if 'cuMemcpy3D_v2' in found_functions}}cdef void *__cuMemcpy3D_v2 = NULL{{endif}} -{{if 'cuMemcpy3DPeer' in found_functions}}cdef void *__cuMemcpy3DPeer = NULL{{endif}} -{{if 'cuMemcpyAsync' in found_functions}}cdef void *__cuMemcpyAsync = NULL{{endif}} -{{if 'cuMemcpyPeerAsync' in found_functions}}cdef void *__cuMemcpyPeerAsync = NULL{{endif}} -{{if 'cuMemcpyHtoDAsync_v2' in found_functions}}cdef void *__cuMemcpyHtoDAsync_v2 = NULL{{endif}} -{{if 'cuMemcpyDtoHAsync_v2' in found_functions}}cdef void *__cuMemcpyDtoHAsync_v2 = NULL{{endif}} -{{if 'cuMemcpyDtoDAsync_v2' in found_functions}}cdef void *__cuMemcpyDtoDAsync_v2 = NULL{{endif}} -{{if 'cuMemcpyHtoAAsync_v2' in found_functions}}cdef void *__cuMemcpyHtoAAsync_v2 = NULL{{endif}} -{{if 'cuMemcpyAtoHAsync_v2' in found_functions}}cdef void *__cuMemcpyAtoHAsync_v2 = NULL{{endif}} -{{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_v2' in found_functions}}cdef void *__cuMemcpyBatchAsync_v2 = NULL{{endif}} -{{if 'cuMemcpy3DBatchAsync_v2' in found_functions}}cdef void *__cuMemcpy3DBatchAsync_v2 = NULL{{endif}} -{{if 'cuMemcpyWithAttributesAsync' in found_functions}}cdef void *__cuMemcpyWithAttributesAsync = NULL{{endif}} -{{if 'cuMemcpy3DWithAttributesAsync' in found_functions}}cdef void *__cuMemcpy3DWithAttributesAsync = 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}} -{{if 'cuMemsetD2D8_v2' in found_functions}}cdef void *__cuMemsetD2D8_v2 = NULL{{endif}} -{{if 'cuMemsetD2D16_v2' in found_functions}}cdef void *__cuMemsetD2D16_v2 = NULL{{endif}} -{{if 'cuMemsetD2D32_v2' in found_functions}}cdef void *__cuMemsetD2D32_v2 = NULL{{endif}} -{{if 'cuMemsetD8Async' in found_functions}}cdef void *__cuMemsetD8Async = NULL{{endif}} -{{if 'cuMemsetD16Async' in found_functions}}cdef void *__cuMemsetD16Async = NULL{{endif}} -{{if 'cuMemsetD32Async' in found_functions}}cdef void *__cuMemsetD32Async = NULL{{endif}} -{{if 'cuMemsetD2D8Async' in found_functions}}cdef void *__cuMemsetD2D8Async = NULL{{endif}} -{{if 'cuMemsetD2D16Async' in found_functions}}cdef void *__cuMemsetD2D16Async = NULL{{endif}} -{{if 'cuMemsetD2D32Async' in found_functions}}cdef void *__cuMemsetD2D32Async = NULL{{endif}} -{{if 'cuArrayCreate_v2' in found_functions}}cdef void *__cuArrayCreate_v2 = NULL{{endif}} -{{if 'cuArrayGetDescriptor_v2' in found_functions}}cdef void *__cuArrayGetDescriptor_v2 = NULL{{endif}} -{{if 'cuArrayGetSparseProperties' in found_functions}}cdef void *__cuArrayGetSparseProperties = NULL{{endif}} -{{if 'cuMipmappedArrayGetSparseProperties' in found_functions}}cdef void *__cuMipmappedArrayGetSparseProperties = NULL{{endif}} -{{if 'cuArrayGetMemoryRequirements' in found_functions}}cdef void *__cuArrayGetMemoryRequirements = NULL{{endif}} -{{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}}cdef void *__cuMipmappedArrayGetMemoryRequirements = NULL{{endif}} -{{if 'cuArrayGetPlane' in found_functions}}cdef void *__cuArrayGetPlane = NULL{{endif}} -{{if 'cuArrayDestroy' in found_functions}}cdef void *__cuArrayDestroy = NULL{{endif}} -{{if 'cuArray3DCreate_v2' in found_functions}}cdef void *__cuArray3DCreate_v2 = NULL{{endif}} -{{if 'cuArray3DGetDescriptor_v2' in found_functions}}cdef void *__cuArray3DGetDescriptor_v2 = NULL{{endif}} -{{if 'cuMipmappedArrayCreate' in found_functions}}cdef void *__cuMipmappedArrayCreate = NULL{{endif}} -{{if 'cuMipmappedArrayGetLevel' in found_functions}}cdef void *__cuMipmappedArrayGetLevel = NULL{{endif}} -{{if 'cuMipmappedArrayDestroy' in found_functions}}cdef void *__cuMipmappedArrayDestroy = NULL{{endif}} -{{if 'cuMemGetHandleForAddressRange' in found_functions}}cdef void *__cuMemGetHandleForAddressRange = NULL{{endif}} -{{if 'cuMemBatchDecompressAsync' in found_functions}}cdef void *__cuMemBatchDecompressAsync = NULL{{endif}} -{{if 'cuMemAddressReserve' in found_functions}}cdef void *__cuMemAddressReserve = NULL{{endif}} -{{if 'cuMemAddressFree' in found_functions}}cdef void *__cuMemAddressFree = NULL{{endif}} -{{if 'cuMemCreate' in found_functions}}cdef void *__cuMemCreate = NULL{{endif}} -{{if 'cuMemRelease' in found_functions}}cdef void *__cuMemRelease = NULL{{endif}} -{{if 'cuMemMap' in found_functions}}cdef void *__cuMemMap = NULL{{endif}} -{{if 'cuMemMapArrayAsync' in found_functions}}cdef void *__cuMemMapArrayAsync = NULL{{endif}} -{{if 'cuMemUnmap' in found_functions}}cdef void *__cuMemUnmap = NULL{{endif}} -{{if 'cuMemSetAccess' in found_functions}}cdef void *__cuMemSetAccess = NULL{{endif}} -{{if 'cuMemGetAccess' in found_functions}}cdef void *__cuMemGetAccess = NULL{{endif}} -{{if 'cuMemExportToShareableHandle' in found_functions}}cdef void *__cuMemExportToShareableHandle = NULL{{endif}} -{{if 'cuMemImportFromShareableHandle' in found_functions}}cdef void *__cuMemImportFromShareableHandle = NULL{{endif}} -{{if 'cuMemGetAllocationGranularity' in found_functions}}cdef void *__cuMemGetAllocationGranularity = NULL{{endif}} -{{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}}cdef void *__cuMemGetAllocationPropertiesFromHandle = NULL{{endif}} -{{if 'cuMemRetainAllocationHandle' in found_functions}}cdef void *__cuMemRetainAllocationHandle = NULL{{endif}} -{{if 'cuMemFreeAsync' in found_functions}}cdef void *__cuMemFreeAsync = NULL{{endif}} -{{if 'cuMemAllocAsync' in found_functions}}cdef void *__cuMemAllocAsync = NULL{{endif}} -{{if 'cuMemPoolTrimTo' in found_functions}}cdef void *__cuMemPoolTrimTo = NULL{{endif}} -{{if 'cuMemPoolSetAttribute' in found_functions}}cdef void *__cuMemPoolSetAttribute = NULL{{endif}} -{{if 'cuMemPoolGetAttribute' in found_functions}}cdef void *__cuMemPoolGetAttribute = NULL{{endif}} -{{if 'cuMemPoolSetAccess' in found_functions}}cdef void *__cuMemPoolSetAccess = NULL{{endif}} -{{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}} -{{if 'cuMemPoolExportPointer' in found_functions}}cdef void *__cuMemPoolExportPointer = NULL{{endif}} -{{if 'cuMemPoolImportPointer' in found_functions}}cdef void *__cuMemPoolImportPointer = NULL{{endif}} -{{if 'cuMulticastCreate' in found_functions}}cdef void *__cuMulticastCreate = NULL{{endif}} -{{if 'cuMulticastAddDevice' in found_functions}}cdef void *__cuMulticastAddDevice = NULL{{endif}} -{{if 'cuMulticastBindMem' in found_functions}}cdef void *__cuMulticastBindMem = NULL{{endif}} -{{if 'cuMulticastBindMem_v2' in found_functions}}cdef void *__cuMulticastBindMem_v2 = NULL{{endif}} -{{if 'cuMulticastBindAddr' in found_functions}}cdef void *__cuMulticastBindAddr = NULL{{endif}} -{{if 'cuMulticastBindAddr_v2' in found_functions}}cdef void *__cuMulticastBindAddr_v2 = NULL{{endif}} -{{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_v2' in found_functions}}cdef void *__cuMemPrefetchAsync_v2 = 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}} -{{if 'cuPointerGetAttributes' in found_functions}}cdef void *__cuPointerGetAttributes = NULL{{endif}} -{{if 'cuStreamCreate' in found_functions}}cdef void *__cuStreamCreate = NULL{{endif}} -{{if 'cuStreamCreateWithPriority' in found_functions}}cdef void *__cuStreamCreateWithPriority = NULL{{endif}} -{{if 'cuStreamBeginCaptureToCig' in found_functions}}cdef void *__cuStreamBeginCaptureToCig = NULL{{endif}} -{{if 'cuStreamEndCaptureToCig' in found_functions}}cdef void *__cuStreamEndCaptureToCig = NULL{{endif}} -{{if 'cuStreamGetPriority' in found_functions}}cdef void *__cuStreamGetPriority = NULL{{endif}} -{{if 'cuStreamGetDevice' in found_functions}}cdef void *__cuStreamGetDevice = NULL{{endif}} -{{if 'cuStreamGetFlags' in found_functions}}cdef void *__cuStreamGetFlags = NULL{{endif}} -{{if 'cuStreamGetId' in found_functions}}cdef void *__cuStreamGetId = NULL{{endif}} -{{if 'cuStreamGetCtx' in found_functions}}cdef void *__cuStreamGetCtx = NULL{{endif}} -{{if 'cuStreamGetCtx_v2' in found_functions}}cdef void *__cuStreamGetCtx_v2 = NULL{{endif}} -{{if 'cuStreamWaitEvent' in found_functions}}cdef void *__cuStreamWaitEvent = NULL{{endif}} -{{if 'cuStreamAddCallback' in found_functions}}cdef void *__cuStreamAddCallback = NULL{{endif}} -{{if 'cuStreamBeginCapture_v2' in found_functions}}cdef void *__cuStreamBeginCapture_v2 = NULL{{endif}} -{{if 'cuStreamBeginCaptureToGraph' in found_functions}}cdef void *__cuStreamBeginCaptureToGraph = NULL{{endif}} -{{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_v3' in found_functions}}cdef void *__cuStreamGetCaptureInfo_v3 = 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}} -{{if 'cuStreamSynchronize' in found_functions}}cdef void *__cuStreamSynchronize = NULL{{endif}} -{{if 'cuStreamDestroy_v2' in found_functions}}cdef void *__cuStreamDestroy_v2 = NULL{{endif}} -{{if 'cuStreamCopyAttributes' in found_functions}}cdef void *__cuStreamCopyAttributes = NULL{{endif}} -{{if 'cuStreamGetAttribute' in found_functions}}cdef void *__cuStreamGetAttribute = NULL{{endif}} -{{if 'cuStreamSetAttribute' in found_functions}}cdef void *__cuStreamSetAttribute = NULL{{endif}} -{{if 'cuEventCreate' in found_functions}}cdef void *__cuEventCreate = NULL{{endif}} -{{if 'cuEventRecord' in found_functions}}cdef void *__cuEventRecord = NULL{{endif}} -{{if 'cuEventRecordWithFlags' in found_functions}}cdef void *__cuEventRecordWithFlags = NULL{{endif}} -{{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_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}} -{{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}}cdef void *__cuExternalMemoryGetMappedMipmappedArray = NULL{{endif}} -{{if 'cuDestroyExternalMemory' in found_functions}}cdef void *__cuDestroyExternalMemory = NULL{{endif}} -{{if 'cuImportExternalSemaphore' in found_functions}}cdef void *__cuImportExternalSemaphore = NULL{{endif}} -{{if 'cuSignalExternalSemaphoresAsync' in found_functions}}cdef void *__cuSignalExternalSemaphoresAsync = NULL{{endif}} -{{if 'cuWaitExternalSemaphoresAsync' in found_functions}}cdef void *__cuWaitExternalSemaphoresAsync = NULL{{endif}} -{{if 'cuDestroyExternalSemaphore' in found_functions}}cdef void *__cuDestroyExternalSemaphore = NULL{{endif}} -{{if 'cuStreamWaitValue32_v2' in found_functions}}cdef void *__cuStreamWaitValue32_v2 = NULL{{endif}} -{{if 'cuStreamWaitValue64_v2' in found_functions}}cdef void *__cuStreamWaitValue64_v2 = NULL{{endif}} -{{if 'cuStreamWriteValue32_v2' in found_functions}}cdef void *__cuStreamWriteValue32_v2 = NULL{{endif}} -{{if 'cuStreamWriteValue64_v2' in found_functions}}cdef void *__cuStreamWriteValue64_v2 = NULL{{endif}} -{{if 'cuStreamBatchMemOp_v2' in found_functions}}cdef void *__cuStreamBatchMemOp_v2 = NULL{{endif}} -{{if 'cuFuncGetAttribute' in found_functions}}cdef void *__cuFuncGetAttribute = NULL{{endif}} -{{if 'cuFuncSetAttribute' in found_functions}}cdef void *__cuFuncSetAttribute = NULL{{endif}} -{{if 'cuFuncSetCacheConfig' in found_functions}}cdef void *__cuFuncSetCacheConfig = NULL{{endif}} -{{if 'cuFuncGetModule' in found_functions}}cdef void *__cuFuncGetModule = NULL{{endif}} -{{if 'cuFuncGetName' in found_functions}}cdef void *__cuFuncGetName = NULL{{endif}} -{{if 'cuFuncGetParamInfo' in found_functions}}cdef void *__cuFuncGetParamInfo = NULL{{endif}} -{{if 'cuFuncGetParamCount' in found_functions}}cdef void *__cuFuncGetParamCount = NULL{{endif}} -{{if 'cuFuncIsLoaded' in found_functions}}cdef void *__cuFuncIsLoaded = NULL{{endif}} -{{if 'cuFuncLoad' in found_functions}}cdef void *__cuFuncLoad = NULL{{endif}} -{{if 'cuLaunchKernel' in found_functions}}cdef void *__cuLaunchKernel = NULL{{endif}} -{{if 'cuLaunchKernelEx' in found_functions}}cdef void *__cuLaunchKernelEx = NULL{{endif}} -{{if 'cuLaunchCooperativeKernel' in found_functions}}cdef void *__cuLaunchCooperativeKernel = NULL{{endif}} -{{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}}cdef void *__cuLaunchCooperativeKernelMultiDevice = NULL{{endif}} -{{if 'cuLaunchHostFunc' in found_functions}}cdef void *__cuLaunchHostFunc = NULL{{endif}} -{{if 'cuLaunchHostFunc_v2' in found_functions}}cdef void *__cuLaunchHostFunc_v2 = NULL{{endif}} -{{if 'cuFuncSetBlockShape' in found_functions}}cdef void *__cuFuncSetBlockShape = NULL{{endif}} -{{if 'cuFuncSetSharedSize' in found_functions}}cdef void *__cuFuncSetSharedSize = NULL{{endif}} -{{if 'cuParamSetSize' in found_functions}}cdef void *__cuParamSetSize = NULL{{endif}} -{{if 'cuParamSeti' in found_functions}}cdef void *__cuParamSeti = NULL{{endif}} -{{if 'cuParamSetf' in found_functions}}cdef void *__cuParamSetf = NULL{{endif}} -{{if 'cuParamSetv' in found_functions}}cdef void *__cuParamSetv = NULL{{endif}} -{{if 'cuLaunch' in found_functions}}cdef void *__cuLaunch = NULL{{endif}} -{{if 'cuLaunchGrid' in found_functions}}cdef void *__cuLaunchGrid = NULL{{endif}} -{{if 'cuLaunchGridAsync' in found_functions}}cdef void *__cuLaunchGridAsync = NULL{{endif}} -{{if 'cuParamSetTexRef' in found_functions}}cdef void *__cuParamSetTexRef = NULL{{endif}} -{{if 'cuFuncSetSharedMemConfig' in found_functions}}cdef void *__cuFuncSetSharedMemConfig = NULL{{endif}} -{{if 'cuGraphCreate' in found_functions}}cdef void *__cuGraphCreate = NULL{{endif}} -{{if 'cuGraphAddKernelNode_v2' in found_functions}}cdef void *__cuGraphAddKernelNode_v2 = NULL{{endif}} -{{if 'cuGraphKernelNodeGetParams_v2' in found_functions}}cdef void *__cuGraphKernelNodeGetParams_v2 = NULL{{endif}} -{{if 'cuGraphKernelNodeSetParams_v2' in found_functions}}cdef void *__cuGraphKernelNodeSetParams_v2 = NULL{{endif}} -{{if 'cuGraphAddMemcpyNode' in found_functions}}cdef void *__cuGraphAddMemcpyNode = NULL{{endif}} -{{if 'cuGraphMemcpyNodeGetParams' in found_functions}}cdef void *__cuGraphMemcpyNodeGetParams = NULL{{endif}} -{{if 'cuGraphMemcpyNodeSetParams' in found_functions}}cdef void *__cuGraphMemcpyNodeSetParams = NULL{{endif}} -{{if 'cuGraphAddMemsetNode' in found_functions}}cdef void *__cuGraphAddMemsetNode = NULL{{endif}} -{{if 'cuGraphMemsetNodeGetParams' in found_functions}}cdef void *__cuGraphMemsetNodeGetParams = NULL{{endif}} -{{if 'cuGraphMemsetNodeSetParams' in found_functions}}cdef void *__cuGraphMemsetNodeSetParams = NULL{{endif}} -{{if 'cuGraphAddHostNode' in found_functions}}cdef void *__cuGraphAddHostNode = NULL{{endif}} -{{if 'cuGraphHostNodeGetParams' in found_functions}}cdef void *__cuGraphHostNodeGetParams = NULL{{endif}} -{{if 'cuGraphHostNodeSetParams' in found_functions}}cdef void *__cuGraphHostNodeSetParams = NULL{{endif}} -{{if 'cuGraphAddChildGraphNode' in found_functions}}cdef void *__cuGraphAddChildGraphNode = NULL{{endif}} -{{if 'cuGraphChildGraphNodeGetGraph' in found_functions}}cdef void *__cuGraphChildGraphNodeGetGraph = NULL{{endif}} -{{if 'cuGraphAddEmptyNode' in found_functions}}cdef void *__cuGraphAddEmptyNode = NULL{{endif}} -{{if 'cuGraphAddEventRecordNode' in found_functions}}cdef void *__cuGraphAddEventRecordNode = NULL{{endif}} -{{if 'cuGraphEventRecordNodeGetEvent' in found_functions}}cdef void *__cuGraphEventRecordNodeGetEvent = NULL{{endif}} -{{if 'cuGraphEventRecordNodeSetEvent' in found_functions}}cdef void *__cuGraphEventRecordNodeSetEvent = NULL{{endif}} -{{if 'cuGraphAddEventWaitNode' in found_functions}}cdef void *__cuGraphAddEventWaitNode = NULL{{endif}} -{{if 'cuGraphEventWaitNodeGetEvent' in found_functions}}cdef void *__cuGraphEventWaitNodeGetEvent = NULL{{endif}} -{{if 'cuGraphEventWaitNodeSetEvent' in found_functions}}cdef void *__cuGraphEventWaitNodeSetEvent = NULL{{endif}} -{{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}}cdef void *__cuGraphAddExternalSemaphoresSignalNode = NULL{{endif}} -{{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}}cdef void *__cuGraphExternalSemaphoresSignalNodeGetParams = NULL{{endif}} -{{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}}cdef void *__cuGraphExternalSemaphoresSignalNodeSetParams = NULL{{endif}} -{{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}}cdef void *__cuGraphAddExternalSemaphoresWaitNode = NULL{{endif}} -{{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}}cdef void *__cuGraphExternalSemaphoresWaitNodeGetParams = NULL{{endif}} -{{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}}cdef void *__cuGraphExternalSemaphoresWaitNodeSetParams = NULL{{endif}} -{{if 'cuGraphAddBatchMemOpNode' in found_functions}}cdef void *__cuGraphAddBatchMemOpNode = NULL{{endif}} -{{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}}cdef void *__cuGraphBatchMemOpNodeGetParams = NULL{{endif}} -{{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}}cdef void *__cuGraphBatchMemOpNodeSetParams = NULL{{endif}} -{{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}}cdef void *__cuGraphExecBatchMemOpNodeSetParams = NULL{{endif}} -{{if 'cuGraphAddMemAllocNode' in found_functions}}cdef void *__cuGraphAddMemAllocNode = NULL{{endif}} -{{if 'cuGraphMemAllocNodeGetParams' in found_functions}}cdef void *__cuGraphMemAllocNodeGetParams = NULL{{endif}} -{{if 'cuGraphAddMemFreeNode' in found_functions}}cdef void *__cuGraphAddMemFreeNode = NULL{{endif}} -{{if 'cuGraphMemFreeNodeGetParams' in found_functions}}cdef void *__cuGraphMemFreeNodeGetParams = NULL{{endif}} -{{if 'cuDeviceGraphMemTrim' in found_functions}}cdef void *__cuDeviceGraphMemTrim = NULL{{endif}} -{{if 'cuDeviceGetGraphMemAttribute' in found_functions}}cdef void *__cuDeviceGetGraphMemAttribute = NULL{{endif}} -{{if 'cuDeviceSetGraphMemAttribute' in found_functions}}cdef void *__cuDeviceSetGraphMemAttribute = NULL{{endif}} -{{if 'cuGraphClone' in found_functions}}cdef void *__cuGraphClone = NULL{{endif}} -{{if 'cuGraphNodeFindInClone' in found_functions}}cdef void *__cuGraphNodeFindInClone = NULL{{endif}} -{{if 'cuGraphNodeGetType' in found_functions}}cdef void *__cuGraphNodeGetType = NULL{{endif}} -{{if 'cuGraphNodeGetContainingGraph' in found_functions}}cdef void *__cuGraphNodeGetContainingGraph = NULL{{endif}} -{{if 'cuGraphNodeGetLocalId' in found_functions}}cdef void *__cuGraphNodeGetLocalId = NULL{{endif}} -{{if 'cuGraphNodeGetToolsId' in found_functions}}cdef void *__cuGraphNodeGetToolsId = NULL{{endif}} -{{if 'cuGraphGetId' in found_functions}}cdef void *__cuGraphGetId = NULL{{endif}} -{{if 'cuGraphExecGetId' in found_functions}}cdef void *__cuGraphExecGetId = NULL{{endif}} -{{if 'cuGraphGetNodes' in found_functions}}cdef void *__cuGraphGetNodes = NULL{{endif}} -{{if 'cuGraphGetRootNodes' in found_functions}}cdef void *__cuGraphGetRootNodes = NULL{{endif}} -{{if 'cuGraphGetEdges_v2' in found_functions}}cdef void *__cuGraphGetEdges_v2 = NULL{{endif}} -{{if 'cuGraphNodeGetDependencies_v2' in found_functions}}cdef void *__cuGraphNodeGetDependencies_v2 = NULL{{endif}} -{{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}}cdef void *__cuGraphNodeGetDependentNodes_v2 = NULL{{endif}} -{{if 'cuGraphAddDependencies_v2' in found_functions}}cdef void *__cuGraphAddDependencies_v2 = 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}} -{{if 'cuGraphInstantiateWithParams' in found_functions}}cdef void *__cuGraphInstantiateWithParams = NULL{{endif}} -{{if 'cuGraphExecGetFlags' in found_functions}}cdef void *__cuGraphExecGetFlags = NULL{{endif}} -{{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}}cdef void *__cuGraphExecKernelNodeSetParams_v2 = NULL{{endif}} -{{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}}cdef void *__cuGraphExecMemcpyNodeSetParams = NULL{{endif}} -{{if 'cuGraphExecMemsetNodeSetParams' in found_functions}}cdef void *__cuGraphExecMemsetNodeSetParams = NULL{{endif}} -{{if 'cuGraphExecHostNodeSetParams' in found_functions}}cdef void *__cuGraphExecHostNodeSetParams = NULL{{endif}} -{{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}}cdef void *__cuGraphExecChildGraphNodeSetParams = NULL{{endif}} -{{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}}cdef void *__cuGraphExecEventRecordNodeSetEvent = NULL{{endif}} -{{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}}cdef void *__cuGraphExecEventWaitNodeSetEvent = NULL{{endif}} -{{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}}cdef void *__cuGraphExecExternalSemaphoresSignalNodeSetParams = NULL{{endif}} -{{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}}cdef void *__cuGraphExecExternalSemaphoresWaitNodeSetParams = NULL{{endif}} -{{if 'cuGraphNodeSetEnabled' in found_functions}}cdef void *__cuGraphNodeSetEnabled = NULL{{endif}} -{{if 'cuGraphNodeGetEnabled' in found_functions}}cdef void *__cuGraphNodeGetEnabled = NULL{{endif}} -{{if 'cuGraphUpload' in found_functions}}cdef void *__cuGraphUpload = NULL{{endif}} -{{if 'cuGraphLaunch' in found_functions}}cdef void *__cuGraphLaunch = NULL{{endif}} -{{if 'cuGraphExecDestroy' in found_functions}}cdef void *__cuGraphExecDestroy = NULL{{endif}} -{{if 'cuGraphDestroy' in found_functions}}cdef void *__cuGraphDestroy = NULL{{endif}} -{{if 'cuGraphExecUpdate_v2' in found_functions}}cdef void *__cuGraphExecUpdate_v2 = NULL{{endif}} -{{if 'cuGraphKernelNodeCopyAttributes' in found_functions}}cdef void *__cuGraphKernelNodeCopyAttributes = NULL{{endif}} -{{if 'cuGraphKernelNodeGetAttribute' in found_functions}}cdef void *__cuGraphKernelNodeGetAttribute = NULL{{endif}} -{{if 'cuGraphKernelNodeSetAttribute' in found_functions}}cdef void *__cuGraphKernelNodeSetAttribute = NULL{{endif}} -{{if 'cuGraphDebugDotPrint' in found_functions}}cdef void *__cuGraphDebugDotPrint = NULL{{endif}} -{{if 'cuUserObjectCreate' in found_functions}}cdef void *__cuUserObjectCreate = NULL{{endif}} -{{if 'cuUserObjectRetain' in found_functions}}cdef void *__cuUserObjectRetain = NULL{{endif}} -{{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_v2' in found_functions}}cdef void *__cuGraphAddNode_v2 = NULL{{endif}} -{{if 'cuGraphNodeSetParams' in found_functions}}cdef void *__cuGraphNodeSetParams = NULL{{endif}} -{{if 'cuGraphNodeGetParams' in found_functions}}cdef void *__cuGraphNodeGetParams = NULL{{endif}} -{{if 'cuGraphExecNodeSetParams' in found_functions}}cdef void *__cuGraphExecNodeSetParams = NULL{{endif}} -{{if 'cuGraphConditionalHandleCreate' in found_functions}}cdef void *__cuGraphConditionalHandleCreate = NULL{{endif}} -{{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}}cdef void *__cuOccupancyMaxActiveBlocksPerMultiprocessor = NULL{{endif}} -{{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}}cdef void *__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags = NULL{{endif}} -{{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}}cdef void *__cuOccupancyMaxPotentialBlockSize = NULL{{endif}} -{{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}}cdef void *__cuOccupancyMaxPotentialBlockSizeWithFlags = NULL{{endif}} -{{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}}cdef void *__cuOccupancyAvailableDynamicSMemPerBlock = NULL{{endif}} -{{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}}cdef void *__cuOccupancyMaxPotentialClusterSize = NULL{{endif}} -{{if 'cuOccupancyMaxActiveClusters' in found_functions}}cdef void *__cuOccupancyMaxActiveClusters = NULL{{endif}} -{{if 'cuTexRefSetArray' in found_functions}}cdef void *__cuTexRefSetArray = NULL{{endif}} -{{if 'cuTexRefSetMipmappedArray' in found_functions}}cdef void *__cuTexRefSetMipmappedArray = NULL{{endif}} -{{if 'cuTexRefSetAddress_v2' in found_functions}}cdef void *__cuTexRefSetAddress_v2 = NULL{{endif}} -{{if 'cuTexRefSetAddress2D_v3' in found_functions}}cdef void *__cuTexRefSetAddress2D_v3 = NULL{{endif}} -{{if 'cuTexRefSetFormat' in found_functions}}cdef void *__cuTexRefSetFormat = NULL{{endif}} -{{if 'cuTexRefSetAddressMode' in found_functions}}cdef void *__cuTexRefSetAddressMode = NULL{{endif}} -{{if 'cuTexRefSetFilterMode' in found_functions}}cdef void *__cuTexRefSetFilterMode = NULL{{endif}} -{{if 'cuTexRefSetMipmapFilterMode' in found_functions}}cdef void *__cuTexRefSetMipmapFilterMode = NULL{{endif}} -{{if 'cuTexRefSetMipmapLevelBias' in found_functions}}cdef void *__cuTexRefSetMipmapLevelBias = NULL{{endif}} -{{if 'cuTexRefSetMipmapLevelClamp' in found_functions}}cdef void *__cuTexRefSetMipmapLevelClamp = NULL{{endif}} -{{if 'cuTexRefSetMaxAnisotropy' in found_functions}}cdef void *__cuTexRefSetMaxAnisotropy = NULL{{endif}} -{{if 'cuTexRefSetBorderColor' in found_functions}}cdef void *__cuTexRefSetBorderColor = NULL{{endif}} -{{if 'cuTexRefSetFlags' in found_functions}}cdef void *__cuTexRefSetFlags = NULL{{endif}} -{{if 'cuTexRefGetAddress_v2' in found_functions}}cdef void *__cuTexRefGetAddress_v2 = NULL{{endif}} -{{if 'cuTexRefGetArray' in found_functions}}cdef void *__cuTexRefGetArray = NULL{{endif}} -{{if 'cuTexRefGetMipmappedArray' in found_functions}}cdef void *__cuTexRefGetMipmappedArray = NULL{{endif}} -{{if 'cuTexRefGetAddressMode' in found_functions}}cdef void *__cuTexRefGetAddressMode = NULL{{endif}} -{{if 'cuTexRefGetFilterMode' in found_functions}}cdef void *__cuTexRefGetFilterMode = NULL{{endif}} -{{if 'cuTexRefGetFormat' in found_functions}}cdef void *__cuTexRefGetFormat = NULL{{endif}} -{{if 'cuTexRefGetMipmapFilterMode' in found_functions}}cdef void *__cuTexRefGetMipmapFilterMode = NULL{{endif}} -{{if 'cuTexRefGetMipmapLevelBias' in found_functions}}cdef void *__cuTexRefGetMipmapLevelBias = NULL{{endif}} -{{if 'cuTexRefGetMipmapLevelClamp' in found_functions}}cdef void *__cuTexRefGetMipmapLevelClamp = NULL{{endif}} -{{if 'cuTexRefGetMaxAnisotropy' in found_functions}}cdef void *__cuTexRefGetMaxAnisotropy = NULL{{endif}} -{{if 'cuTexRefGetBorderColor' in found_functions}}cdef void *__cuTexRefGetBorderColor = NULL{{endif}} -{{if 'cuTexRefGetFlags' in found_functions}}cdef void *__cuTexRefGetFlags = NULL{{endif}} -{{if 'cuTexRefCreate' in found_functions}}cdef void *__cuTexRefCreate = NULL{{endif}} -{{if 'cuTexRefDestroy' in found_functions}}cdef void *__cuTexRefDestroy = NULL{{endif}} -{{if 'cuSurfRefSetArray' in found_functions}}cdef void *__cuSurfRefSetArray = NULL{{endif}} -{{if 'cuSurfRefGetArray' in found_functions}}cdef void *__cuSurfRefGetArray = NULL{{endif}} -{{if 'cuTexObjectCreate' in found_functions}}cdef void *__cuTexObjectCreate = NULL{{endif}} -{{if 'cuTexObjectDestroy' in found_functions}}cdef void *__cuTexObjectDestroy = NULL{{endif}} -{{if 'cuTexObjectGetResourceDesc' in found_functions}}cdef void *__cuTexObjectGetResourceDesc = NULL{{endif}} -{{if 'cuTexObjectGetTextureDesc' in found_functions}}cdef void *__cuTexObjectGetTextureDesc = NULL{{endif}} -{{if 'cuTexObjectGetResourceViewDesc' in found_functions}}cdef void *__cuTexObjectGetResourceViewDesc = NULL{{endif}} -{{if 'cuSurfObjectCreate' in found_functions}}cdef void *__cuSurfObjectCreate = NULL{{endif}} -{{if 'cuSurfObjectDestroy' in found_functions}}cdef void *__cuSurfObjectDestroy = NULL{{endif}} -{{if 'cuSurfObjectGetResourceDesc' in found_functions}}cdef void *__cuSurfObjectGetResourceDesc = NULL{{endif}} -{{if 'cuTensorMapEncodeTiled' in found_functions}}cdef void *__cuTensorMapEncodeTiled = NULL{{endif}} -{{if 'cuTensorMapEncodeIm2col' in found_functions}}cdef void *__cuTensorMapEncodeIm2col = NULL{{endif}} -{{if 'cuTensorMapEncodeIm2colWide' in found_functions}}cdef void *__cuTensorMapEncodeIm2colWide = NULL{{endif}} -{{if 'cuTensorMapReplaceAddress' in found_functions}}cdef void *__cuTensorMapReplaceAddress = NULL{{endif}} -{{if 'cuDeviceCanAccessPeer' in found_functions}}cdef void *__cuDeviceCanAccessPeer = NULL{{endif}} -{{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}} -{{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}}cdef void *__cuGraphicsResourceGetMappedPointer_v2 = NULL{{endif}} -{{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}}cdef void *__cuGraphicsResourceSetMapFlags_v2 = NULL{{endif}} -{{if 'cuGraphicsMapResources' in found_functions}}cdef void *__cuGraphicsMapResources = NULL{{endif}} -{{if 'cuGraphicsUnmapResources' in found_functions}}cdef void *__cuGraphicsUnmapResources = NULL{{endif}} -{{if 'cuGetProcAddress_v2' in found_functions}}cdef void *__cuGetProcAddress_v2 = NULL{{endif}} -{{if 'cuCoredumpGetAttribute' in found_functions}}cdef void *__cuCoredumpGetAttribute = NULL{{endif}} -{{if 'cuCoredumpGetAttributeGlobal' in found_functions}}cdef void *__cuCoredumpGetAttributeGlobal = NULL{{endif}} -{{if 'cuCoredumpSetAttribute' in found_functions}}cdef void *__cuCoredumpSetAttribute = NULL{{endif}} -{{if 'cuCoredumpSetAttributeGlobal' in found_functions}}cdef void *__cuCoredumpSetAttributeGlobal = NULL{{endif}} -{{if 'cuCoredumpRegisterStartCallback' in found_functions}}cdef void *__cuCoredumpRegisterStartCallback = NULL{{endif}} -{{if 'cuCoredumpRegisterCompleteCallback' in found_functions}}cdef void *__cuCoredumpRegisterCompleteCallback = NULL{{endif}} -{{if 'cuCoredumpDeregisterStartCallback' in found_functions}}cdef void *__cuCoredumpDeregisterStartCallback = NULL{{endif}} -{{if 'cuCoredumpDeregisterCompleteCallback' in found_functions}}cdef void *__cuCoredumpDeregisterCompleteCallback = NULL{{endif}} -{{if 'cuGetExportTable' in found_functions}}cdef void *__cuGetExportTable = NULL{{endif}} -{{if 'cuGreenCtxCreate' in found_functions}}cdef void *__cuGreenCtxCreate = NULL{{endif}} -{{if 'cuGreenCtxDestroy' in found_functions}}cdef void *__cuGreenCtxDestroy = NULL{{endif}} -{{if 'cuCtxFromGreenCtx' in found_functions}}cdef void *__cuCtxFromGreenCtx = NULL{{endif}} -{{if 'cuDeviceGetDevResource' in found_functions}}cdef void *__cuDeviceGetDevResource = NULL{{endif}} -{{if 'cuCtxGetDevResource' in found_functions}}cdef void *__cuCtxGetDevResource = NULL{{endif}} -{{if 'cuGreenCtxGetDevResource' in found_functions}}cdef void *__cuGreenCtxGetDevResource = NULL{{endif}} -{{if 'cuDevSmResourceSplitByCount' in found_functions}}cdef void *__cuDevSmResourceSplitByCount = NULL{{endif}} -{{if 'cuDevSmResourceSplit' in found_functions}}cdef void *__cuDevSmResourceSplit = NULL{{endif}} -{{if 'cuDevResourceGenerateDesc' in found_functions}}cdef void *__cuDevResourceGenerateDesc = NULL{{endif}} -{{if 'cuGreenCtxRecordEvent' in found_functions}}cdef void *__cuGreenCtxRecordEvent = NULL{{endif}} -{{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 'cuStreamGetDevResource' in found_functions}}cdef void *__cuStreamGetDevResource = 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}} -{{if 'cuLogsDumpToFile' in found_functions}}cdef void *__cuLogsDumpToFile = NULL{{endif}} -{{if 'cuLogsDumpToMemory' in found_functions}}cdef void *__cuLogsDumpToMemory = NULL{{endif}} -{{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}}cdef void *__cuCheckpointProcessGetRestoreThreadId = NULL{{endif}} -{{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}} -{{if True}}cdef void *__cuGraphicsEGLRegisterImage = NULL{{endif}} -{{if True}}cdef void *__cuEGLStreamConsumerConnect = NULL{{endif}} -{{if True}}cdef void *__cuEGLStreamConsumerConnectWithFlags = NULL{{endif}} -{{if True}}cdef void *__cuEGLStreamConsumerDisconnect = NULL{{endif}} -{{if True}}cdef void *__cuEGLStreamConsumerAcquireFrame = NULL{{endif}} -{{if True}}cdef void *__cuEGLStreamConsumerReleaseFrame = NULL{{endif}} -{{if True}}cdef void *__cuEGLStreamProducerConnect = NULL{{endif}} -{{if True}}cdef void *__cuEGLStreamProducerDisconnect = NULL{{endif}} -{{if True}}cdef void *__cuEGLStreamProducerPresentFrame = NULL{{endif}} -{{if True}}cdef void *__cuEGLStreamProducerReturnFrame = NULL{{endif}} -{{if True}}cdef void *__cuGraphicsResourceGetMappedEglFrame = NULL{{endif}} -{{if True}}cdef void *__cuEventCreateFromEGLSync = NULL{{endif}} -{{if True}}cdef void *__cuGraphicsGLRegisterBuffer = NULL{{endif}} -{{if True}}cdef void *__cuGraphicsGLRegisterImage = NULL{{endif}} -{{if True}}cdef void *__cuGLGetDevices_v2 = NULL{{endif}} -{{if True}}cdef void *__cuVDPAUGetDevice = NULL{{endif}} -{{if True}}cdef void *__cuVDPAUCtxCreate_v2 = NULL{{endif}} -{{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 - cdef char libPath[260] - - 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') - else: - {{if 'Windows' == platform.system()}} - path = 'nvcuda.dll' - {{else}} - path = 'libcuda.so.1' - {{endif}} - - {{if 'Windows' == platform.system()}} - 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: - raise RuntimeError('Failed to dlopen ' + path) - {{endif}} - - # Get latest __cuGetProcAddress_v2 - global __cuGetProcAddress_v2 - {{if 'Windows' == platform.system()}} - __cuGetProcAddress_v2 = windll.GetProcAddress(handle, 'cuGetProcAddress_v2') - {{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 'cuMemcpyWithAttributesAsync' in found_functions}} - global __cuMemcpyWithAttributesAsync - _F_cuGetProcAddress_v2('cuMemcpyWithAttributesAsync', &__cuMemcpyWithAttributesAsync, 13020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) - {{endif}} - {{if 'cuMemcpy3DWithAttributesAsync' in found_functions}} - global __cuMemcpy3DWithAttributesAsync - _F_cuGetProcAddress_v2('cuMemcpy3DWithAttributesAsync', &__cuMemcpy3DWithAttributesAsync, 13020, 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 'cuStreamBeginCaptureToCig' in found_functions}} - global __cuStreamBeginCaptureToCig - _F_cuGetProcAddress_v2('cuStreamBeginCaptureToCig', &__cuStreamBeginCaptureToCig, 13020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) - {{endif}} - {{if 'cuStreamEndCaptureToCig' in found_functions}} - global __cuStreamEndCaptureToCig - _F_cuGetProcAddress_v2('cuStreamEndCaptureToCig', &__cuStreamEndCaptureToCig, 13020, 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 'cuLaunchHostFunc_v2' in found_functions}} - global __cuLaunchHostFunc_v2 - _F_cuGetProcAddress_v2('cuLaunchHostFunc', &__cuLaunchHostFunc_v2, 13020, 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}} - {{if 'cuStreamGetDevResource' in found_functions}} - global __cuStreamGetDevResource - _F_cuGetProcAddress_v2('cuStreamGetDevResource', &__cuStreamGetDevResource, 13010, 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 'cuMemcpyWithAttributesAsync' in found_functions}} - global __cuMemcpyWithAttributesAsync - _F_cuGetProcAddress_v2('cuMemcpyWithAttributesAsync', &__cuMemcpyWithAttributesAsync, 13020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemcpy3DWithAttributesAsync' in found_functions}} - global __cuMemcpy3DWithAttributesAsync - _F_cuGetProcAddress_v2('cuMemcpy3DWithAttributesAsync', &__cuMemcpy3DWithAttributesAsync, 13020, 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 'cuStreamBeginCaptureToCig' in found_functions}} - global __cuStreamBeginCaptureToCig - _F_cuGetProcAddress_v2('cuStreamBeginCaptureToCig', &__cuStreamBeginCaptureToCig, 13020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuStreamEndCaptureToCig' in found_functions}} - global __cuStreamEndCaptureToCig - _F_cuGetProcAddress_v2('cuStreamEndCaptureToCig', &__cuStreamEndCaptureToCig, 13020, 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 'cuLaunchHostFunc_v2' in found_functions}} - global __cuLaunchHostFunc_v2 - _F_cuGetProcAddress_v2('cuLaunchHostFunc', &__cuLaunchHostFunc_v2, 13020, 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}} - {{if 'cuStreamGetDevResource' in found_functions}} - global __cuStreamGetDevResource - _F_cuGetProcAddress_v2('cuStreamGetDevResource', &__cuStreamGetDevResource, 13010, 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 'cuGetErrorName' in found_functions}} - global __cuGetErrorName - _F_cuGetProcAddress_v2('cuGetErrorName', &__cuGetErrorName, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuInit' in found_functions}} - global __cuInit - _F_cuGetProcAddress_v2('cuInit', &__cuInit, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDriverGetVersion' in found_functions}} - global __cuDriverGetVersion - _F_cuGetProcAddress_v2('cuDriverGetVersion', &__cuDriverGetVersion, 2020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGet' in found_functions}} - global __cuDeviceGet - _F_cuGetProcAddress_v2('cuDeviceGet', &__cuDeviceGet, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetCount' in found_functions}} - global __cuDeviceGetCount - _F_cuGetProcAddress_v2('cuDeviceGetCount', &__cuDeviceGetCount, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetName' in found_functions}} - global __cuDeviceGetName - _F_cuGetProcAddress_v2('cuDeviceGetName', &__cuDeviceGetName, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetUuid_v2' in found_functions}} - global __cuDeviceGetUuid_v2 - _F_cuGetProcAddress_v2('cuDeviceGetUuid', &__cuDeviceGetUuid_v2, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetLuid' in found_functions}} - global __cuDeviceGetLuid - _F_cuGetProcAddress_v2('cuDeviceGetLuid', &__cuDeviceGetLuid, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceTotalMem_v2' in found_functions}} - global __cuDeviceTotalMem_v2 - _F_cuGetProcAddress_v2('cuDeviceTotalMem', &__cuDeviceTotalMem_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}} - global __cuDeviceGetTexture1DLinearMaxWidth - _F_cuGetProcAddress_v2('cuDeviceGetTexture1DLinearMaxWidth', &__cuDeviceGetTexture1DLinearMaxWidth, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetAttribute' in found_functions}} - global __cuDeviceGetAttribute - _F_cuGetProcAddress_v2('cuDeviceGetAttribute', &__cuDeviceGetAttribute, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetHostAtomicCapabilities' in found_functions}} - global __cuDeviceGetHostAtomicCapabilities - _F_cuGetProcAddress_v2('cuDeviceGetHostAtomicCapabilities', &__cuDeviceGetHostAtomicCapabilities, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} - global __cuDeviceGetNvSciSyncAttributes - _F_cuGetProcAddress_v2('cuDeviceGetNvSciSyncAttributes', &__cuDeviceGetNvSciSyncAttributes, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceSetMemPool' in found_functions}} - global __cuDeviceSetMemPool - _F_cuGetProcAddress_v2('cuDeviceSetMemPool', &__cuDeviceSetMemPool, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetMemPool' in found_functions}} - global __cuDeviceGetMemPool - _F_cuGetProcAddress_v2('cuDeviceGetMemPool', &__cuDeviceGetMemPool, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetDefaultMemPool' in found_functions}} - global __cuDeviceGetDefaultMemPool - _F_cuGetProcAddress_v2('cuDeviceGetDefaultMemPool', &__cuDeviceGetDefaultMemPool, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetExecAffinitySupport' in found_functions}} - global __cuDeviceGetExecAffinitySupport - _F_cuGetProcAddress_v2('cuDeviceGetExecAffinitySupport', &__cuDeviceGetExecAffinitySupport, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuFlushGPUDirectRDMAWrites' in found_functions}} - global __cuFlushGPUDirectRDMAWrites - _F_cuGetProcAddress_v2('cuFlushGPUDirectRDMAWrites', &__cuFlushGPUDirectRDMAWrites, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetProperties' in found_functions}} - global __cuDeviceGetProperties - _F_cuGetProcAddress_v2('cuDeviceGetProperties', &__cuDeviceGetProperties, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceComputeCapability' in found_functions}} - global __cuDeviceComputeCapability - _F_cuGetProcAddress_v2('cuDeviceComputeCapability', &__cuDeviceComputeCapability, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDevicePrimaryCtxRetain' in found_functions}} - global __cuDevicePrimaryCtxRetain - _F_cuGetProcAddress_v2('cuDevicePrimaryCtxRetain', &__cuDevicePrimaryCtxRetain, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}} - global __cuDevicePrimaryCtxRelease_v2 - _F_cuGetProcAddress_v2('cuDevicePrimaryCtxRelease', &__cuDevicePrimaryCtxRelease_v2, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}} - global __cuDevicePrimaryCtxSetFlags_v2 - _F_cuGetProcAddress_v2('cuDevicePrimaryCtxSetFlags', &__cuDevicePrimaryCtxSetFlags_v2, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDevicePrimaryCtxGetState' in found_functions}} - global __cuDevicePrimaryCtxGetState - _F_cuGetProcAddress_v2('cuDevicePrimaryCtxGetState', &__cuDevicePrimaryCtxGetState, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDevicePrimaryCtxReset_v2' in found_functions}} - global __cuDevicePrimaryCtxReset_v2 - _F_cuGetProcAddress_v2('cuDevicePrimaryCtxReset', &__cuDevicePrimaryCtxReset_v2, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxCreate_v4' in found_functions}} - global __cuCtxCreate_v4 - _F_cuGetProcAddress_v2('cuCtxCreate', &__cuCtxCreate_v4, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxDestroy_v2' in found_functions}} - global __cuCtxDestroy_v2 - _F_cuGetProcAddress_v2('cuCtxDestroy', &__cuCtxDestroy_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxPushCurrent_v2' in found_functions}} - global __cuCtxPushCurrent_v2 - _F_cuGetProcAddress_v2('cuCtxPushCurrent', &__cuCtxPushCurrent_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxPopCurrent_v2' in found_functions}} - global __cuCtxPopCurrent_v2 - _F_cuGetProcAddress_v2('cuCtxPopCurrent', &__cuCtxPopCurrent_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxSetCurrent' in found_functions}} - global __cuCtxSetCurrent - _F_cuGetProcAddress_v2('cuCtxSetCurrent', &__cuCtxSetCurrent, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetCurrent' in found_functions}} - global __cuCtxGetCurrent - _F_cuGetProcAddress_v2('cuCtxGetCurrent', &__cuCtxGetCurrent, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetDevice' in found_functions}} - global __cuCtxGetDevice - _F_cuGetProcAddress_v2('cuCtxGetDevice', &__cuCtxGetDevice, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetDevice_v2' in found_functions}} - global __cuCtxGetDevice_v2 - _F_cuGetProcAddress_v2('cuCtxGetDevice', &__cuCtxGetDevice_v2, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetFlags' in found_functions}} - global __cuCtxGetFlags - _F_cuGetProcAddress_v2('cuCtxGetFlags', &__cuCtxGetFlags, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxSetFlags' in found_functions}} - global __cuCtxSetFlags - _F_cuGetProcAddress_v2('cuCtxSetFlags', &__cuCtxSetFlags, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetId' in found_functions}} - global __cuCtxGetId - _F_cuGetProcAddress_v2('cuCtxGetId', &__cuCtxGetId, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxSynchronize' in found_functions}} - global __cuCtxSynchronize - _F_cuGetProcAddress_v2('cuCtxSynchronize', &__cuCtxSynchronize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxSynchronize_v2' in found_functions}} - global __cuCtxSynchronize_v2 - _F_cuGetProcAddress_v2('cuCtxSynchronize', &__cuCtxSynchronize_v2, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxSetLimit' in found_functions}} - global __cuCtxSetLimit - _F_cuGetProcAddress_v2('cuCtxSetLimit', &__cuCtxSetLimit, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetLimit' in found_functions}} - global __cuCtxGetLimit - _F_cuGetProcAddress_v2('cuCtxGetLimit', &__cuCtxGetLimit, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetCacheConfig' in found_functions}} - global __cuCtxGetCacheConfig - _F_cuGetProcAddress_v2('cuCtxGetCacheConfig', &__cuCtxGetCacheConfig, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxSetCacheConfig' in found_functions}} - global __cuCtxSetCacheConfig - _F_cuGetProcAddress_v2('cuCtxSetCacheConfig', &__cuCtxSetCacheConfig, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetApiVersion' in found_functions}} - global __cuCtxGetApiVersion - _F_cuGetProcAddress_v2('cuCtxGetApiVersion', &__cuCtxGetApiVersion, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetStreamPriorityRange' in found_functions}} - global __cuCtxGetStreamPriorityRange - _F_cuGetProcAddress_v2('cuCtxGetStreamPriorityRange', &__cuCtxGetStreamPriorityRange, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxResetPersistingL2Cache' in found_functions}} - global __cuCtxResetPersistingL2Cache - _F_cuGetProcAddress_v2('cuCtxResetPersistingL2Cache', &__cuCtxResetPersistingL2Cache, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetExecAffinity' in found_functions}} - global __cuCtxGetExecAffinity - _F_cuGetProcAddress_v2('cuCtxGetExecAffinity', &__cuCtxGetExecAffinity, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxRecordEvent' in found_functions}} - global __cuCtxRecordEvent - _F_cuGetProcAddress_v2('cuCtxRecordEvent', &__cuCtxRecordEvent, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxWaitEvent' in found_functions}} - global __cuCtxWaitEvent - _F_cuGetProcAddress_v2('cuCtxWaitEvent', &__cuCtxWaitEvent, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxAttach' in found_functions}} - global __cuCtxAttach - _F_cuGetProcAddress_v2('cuCtxAttach', &__cuCtxAttach, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxDetach' in found_functions}} - global __cuCtxDetach - _F_cuGetProcAddress_v2('cuCtxDetach', &__cuCtxDetach, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetSharedMemConfig' in found_functions}} - global __cuCtxGetSharedMemConfig - _F_cuGetProcAddress_v2('cuCtxGetSharedMemConfig', &__cuCtxGetSharedMemConfig, 4020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxSetSharedMemConfig' in found_functions}} - global __cuCtxSetSharedMemConfig - _F_cuGetProcAddress_v2('cuCtxSetSharedMemConfig', &__cuCtxSetSharedMemConfig, 4020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleLoad' in found_functions}} - global __cuModuleLoad - _F_cuGetProcAddress_v2('cuModuleLoad', &__cuModuleLoad, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleLoadData' in found_functions}} - global __cuModuleLoadData - _F_cuGetProcAddress_v2('cuModuleLoadData', &__cuModuleLoadData, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleLoadDataEx' in found_functions}} - global __cuModuleLoadDataEx - _F_cuGetProcAddress_v2('cuModuleLoadDataEx', &__cuModuleLoadDataEx, 2010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleLoadFatBinary' in found_functions}} - global __cuModuleLoadFatBinary - _F_cuGetProcAddress_v2('cuModuleLoadFatBinary', &__cuModuleLoadFatBinary, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleUnload' in found_functions}} - global __cuModuleUnload - _F_cuGetProcAddress_v2('cuModuleUnload', &__cuModuleUnload, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleGetLoadingMode' in found_functions}} - global __cuModuleGetLoadingMode - _F_cuGetProcAddress_v2('cuModuleGetLoadingMode', &__cuModuleGetLoadingMode, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleGetFunction' in found_functions}} - global __cuModuleGetFunction - _F_cuGetProcAddress_v2('cuModuleGetFunction', &__cuModuleGetFunction, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleGetFunctionCount' in found_functions}} - global __cuModuleGetFunctionCount - _F_cuGetProcAddress_v2('cuModuleGetFunctionCount', &__cuModuleGetFunctionCount, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleEnumerateFunctions' in found_functions}} - global __cuModuleEnumerateFunctions - _F_cuGetProcAddress_v2('cuModuleEnumerateFunctions', &__cuModuleEnumerateFunctions, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleGetGlobal_v2' in found_functions}} - global __cuModuleGetGlobal_v2 - _F_cuGetProcAddress_v2('cuModuleGetGlobal', &__cuModuleGetGlobal_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLinkCreate_v2' in found_functions}} - global __cuLinkCreate_v2 - _F_cuGetProcAddress_v2('cuLinkCreate', &__cuLinkCreate_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLinkAddData_v2' in found_functions}} - global __cuLinkAddData_v2 - _F_cuGetProcAddress_v2('cuLinkAddData', &__cuLinkAddData_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLinkAddFile_v2' in found_functions}} - global __cuLinkAddFile_v2 - _F_cuGetProcAddress_v2('cuLinkAddFile', &__cuLinkAddFile_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLinkComplete' in found_functions}} - global __cuLinkComplete - _F_cuGetProcAddress_v2('cuLinkComplete', &__cuLinkComplete, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLinkDestroy' in found_functions}} - global __cuLinkDestroy - _F_cuGetProcAddress_v2('cuLinkDestroy', &__cuLinkDestroy, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleGetTexRef' in found_functions}} - global __cuModuleGetTexRef - _F_cuGetProcAddress_v2('cuModuleGetTexRef', &__cuModuleGetTexRef, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleGetSurfRef' in found_functions}} - global __cuModuleGetSurfRef - _F_cuGetProcAddress_v2('cuModuleGetSurfRef', &__cuModuleGetSurfRef, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryLoadData' in found_functions}} - global __cuLibraryLoadData - _F_cuGetProcAddress_v2('cuLibraryLoadData', &__cuLibraryLoadData, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryLoadFromFile' in found_functions}} - global __cuLibraryLoadFromFile - _F_cuGetProcAddress_v2('cuLibraryLoadFromFile', &__cuLibraryLoadFromFile, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryUnload' in found_functions}} - global __cuLibraryUnload - _F_cuGetProcAddress_v2('cuLibraryUnload', &__cuLibraryUnload, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryGetKernel' in found_functions}} - global __cuLibraryGetKernel - _F_cuGetProcAddress_v2('cuLibraryGetKernel', &__cuLibraryGetKernel, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryGetKernelCount' in found_functions}} - global __cuLibraryGetKernelCount - _F_cuGetProcAddress_v2('cuLibraryGetKernelCount', &__cuLibraryGetKernelCount, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryEnumerateKernels' in found_functions}} - global __cuLibraryEnumerateKernels - _F_cuGetProcAddress_v2('cuLibraryEnumerateKernels', &__cuLibraryEnumerateKernels, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryGetModule' in found_functions}} - global __cuLibraryGetModule - _F_cuGetProcAddress_v2('cuLibraryGetModule', &__cuLibraryGetModule, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuKernelGetFunction' in found_functions}} - global __cuKernelGetFunction - _F_cuGetProcAddress_v2('cuKernelGetFunction', &__cuKernelGetFunction, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuKernelGetLibrary' in found_functions}} - global __cuKernelGetLibrary - _F_cuGetProcAddress_v2('cuKernelGetLibrary', &__cuKernelGetLibrary, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryGetGlobal' in found_functions}} - global __cuLibraryGetGlobal - _F_cuGetProcAddress_v2('cuLibraryGetGlobal', &__cuLibraryGetGlobal, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryGetManaged' in found_functions}} - global __cuLibraryGetManaged - _F_cuGetProcAddress_v2('cuLibraryGetManaged', &__cuLibraryGetManaged, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryGetUnifiedFunction' in found_functions}} - global __cuLibraryGetUnifiedFunction - _F_cuGetProcAddress_v2('cuLibraryGetUnifiedFunction', &__cuLibraryGetUnifiedFunction, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuKernelGetAttribute' in found_functions}} - global __cuKernelGetAttribute - _F_cuGetProcAddress_v2('cuKernelGetAttribute', &__cuKernelGetAttribute, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuKernelSetAttribute' in found_functions}} - global __cuKernelSetAttribute - _F_cuGetProcAddress_v2('cuKernelSetAttribute', &__cuKernelSetAttribute, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuKernelSetCacheConfig' in found_functions}} - global __cuKernelSetCacheConfig - _F_cuGetProcAddress_v2('cuKernelSetCacheConfig', &__cuKernelSetCacheConfig, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuKernelGetName' in found_functions}} - global __cuKernelGetName - _F_cuGetProcAddress_v2('cuKernelGetName', &__cuKernelGetName, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuKernelGetParamInfo' in found_functions}} - global __cuKernelGetParamInfo - _F_cuGetProcAddress_v2('cuKernelGetParamInfo', &__cuKernelGetParamInfo, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuKernelGetParamCount' in found_functions}} - global __cuKernelGetParamCount - _F_cuGetProcAddress_v2('cuKernelGetParamCount', &__cuKernelGetParamCount, 13020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemGetInfo_v2' in found_functions}} - global __cuMemGetInfo_v2 - _F_cuGetProcAddress_v2('cuMemGetInfo', &__cuMemGetInfo_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemAlloc_v2' in found_functions}} - global __cuMemAlloc_v2 - _F_cuGetProcAddress_v2('cuMemAlloc', &__cuMemAlloc_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemAllocPitch_v2' in found_functions}} - global __cuMemAllocPitch_v2 - _F_cuGetProcAddress_v2('cuMemAllocPitch', &__cuMemAllocPitch_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemFree_v2' in found_functions}} - global __cuMemFree_v2 - _F_cuGetProcAddress_v2('cuMemFree', &__cuMemFree_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemGetAddressRange_v2' in found_functions}} - global __cuMemGetAddressRange_v2 - _F_cuGetProcAddress_v2('cuMemGetAddressRange', &__cuMemGetAddressRange_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemAllocHost_v2' in found_functions}} - global __cuMemAllocHost_v2 - _F_cuGetProcAddress_v2('cuMemAllocHost', &__cuMemAllocHost_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemFreeHost' in found_functions}} - global __cuMemFreeHost - _F_cuGetProcAddress_v2('cuMemFreeHost', &__cuMemFreeHost, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemHostAlloc' in found_functions}} - global __cuMemHostAlloc - _F_cuGetProcAddress_v2('cuMemHostAlloc', &__cuMemHostAlloc, 2020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemHostGetDevicePointer_v2' in found_functions}} - global __cuMemHostGetDevicePointer_v2 - _F_cuGetProcAddress_v2('cuMemHostGetDevicePointer', &__cuMemHostGetDevicePointer_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemHostGetFlags' in found_functions}} - global __cuMemHostGetFlags - _F_cuGetProcAddress_v2('cuMemHostGetFlags', &__cuMemHostGetFlags, 2030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemAllocManaged' in found_functions}} - global __cuMemAllocManaged - _F_cuGetProcAddress_v2('cuMemAllocManaged', &__cuMemAllocManaged, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceRegisterAsyncNotification' in found_functions}} - global __cuDeviceRegisterAsyncNotification - _F_cuGetProcAddress_v2('cuDeviceRegisterAsyncNotification', &__cuDeviceRegisterAsyncNotification, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceUnregisterAsyncNotification' in found_functions}} - global __cuDeviceUnregisterAsyncNotification - _F_cuGetProcAddress_v2('cuDeviceUnregisterAsyncNotification', &__cuDeviceUnregisterAsyncNotification, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetByPCIBusId' in found_functions}} - global __cuDeviceGetByPCIBusId - _F_cuGetProcAddress_v2('cuDeviceGetByPCIBusId', &__cuDeviceGetByPCIBusId, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetPCIBusId' in found_functions}} - global __cuDeviceGetPCIBusId - _F_cuGetProcAddress_v2('cuDeviceGetPCIBusId', &__cuDeviceGetPCIBusId, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuIpcGetEventHandle' in found_functions}} - global __cuIpcGetEventHandle - _F_cuGetProcAddress_v2('cuIpcGetEventHandle', &__cuIpcGetEventHandle, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuIpcOpenEventHandle' in found_functions}} - global __cuIpcOpenEventHandle - _F_cuGetProcAddress_v2('cuIpcOpenEventHandle', &__cuIpcOpenEventHandle, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuIpcGetMemHandle' in found_functions}} - global __cuIpcGetMemHandle - _F_cuGetProcAddress_v2('cuIpcGetMemHandle', &__cuIpcGetMemHandle, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuIpcOpenMemHandle_v2' in found_functions}} - global __cuIpcOpenMemHandle_v2 - _F_cuGetProcAddress_v2('cuIpcOpenMemHandle', &__cuIpcOpenMemHandle_v2, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuIpcCloseMemHandle' in found_functions}} - global __cuIpcCloseMemHandle - _F_cuGetProcAddress_v2('cuIpcCloseMemHandle', &__cuIpcCloseMemHandle, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemHostRegister_v2' in found_functions}} - global __cuMemHostRegister_v2 - _F_cuGetProcAddress_v2('cuMemHostRegister', &__cuMemHostRegister_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemHostUnregister' in found_functions}} - global __cuMemHostUnregister - _F_cuGetProcAddress_v2('cuMemHostUnregister', &__cuMemHostUnregister, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuArrayCreate_v2' in found_functions}} - global __cuArrayCreate_v2 - _F_cuGetProcAddress_v2('cuArrayCreate', &__cuArrayCreate_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuArrayGetDescriptor_v2' in found_functions}} - global __cuArrayGetDescriptor_v2 - _F_cuGetProcAddress_v2('cuArrayGetDescriptor', &__cuArrayGetDescriptor_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuArrayGetSparseProperties' in found_functions}} - global __cuArrayGetSparseProperties - _F_cuGetProcAddress_v2('cuArrayGetSparseProperties', &__cuArrayGetSparseProperties, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMipmappedArrayGetSparseProperties' in found_functions}} - global __cuMipmappedArrayGetSparseProperties - _F_cuGetProcAddress_v2('cuMipmappedArrayGetSparseProperties', &__cuMipmappedArrayGetSparseProperties, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuArrayGetMemoryRequirements' in found_functions}} - global __cuArrayGetMemoryRequirements - _F_cuGetProcAddress_v2('cuArrayGetMemoryRequirements', &__cuArrayGetMemoryRequirements, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}} - global __cuMipmappedArrayGetMemoryRequirements - _F_cuGetProcAddress_v2('cuMipmappedArrayGetMemoryRequirements', &__cuMipmappedArrayGetMemoryRequirements, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuArrayGetPlane' in found_functions}} - global __cuArrayGetPlane - _F_cuGetProcAddress_v2('cuArrayGetPlane', &__cuArrayGetPlane, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuArrayDestroy' in found_functions}} - global __cuArrayDestroy - _F_cuGetProcAddress_v2('cuArrayDestroy', &__cuArrayDestroy, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuArray3DCreate_v2' in found_functions}} - global __cuArray3DCreate_v2 - _F_cuGetProcAddress_v2('cuArray3DCreate', &__cuArray3DCreate_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuArray3DGetDescriptor_v2' in found_functions}} - global __cuArray3DGetDescriptor_v2 - _F_cuGetProcAddress_v2('cuArray3DGetDescriptor', &__cuArray3DGetDescriptor_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMipmappedArrayCreate' in found_functions}} - global __cuMipmappedArrayCreate - _F_cuGetProcAddress_v2('cuMipmappedArrayCreate', &__cuMipmappedArrayCreate, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMipmappedArrayGetLevel' in found_functions}} - global __cuMipmappedArrayGetLevel - _F_cuGetProcAddress_v2('cuMipmappedArrayGetLevel', &__cuMipmappedArrayGetLevel, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMipmappedArrayDestroy' in found_functions}} - global __cuMipmappedArrayDestroy - _F_cuGetProcAddress_v2('cuMipmappedArrayDestroy', &__cuMipmappedArrayDestroy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemGetHandleForAddressRange' in found_functions}} - global __cuMemGetHandleForAddressRange - _F_cuGetProcAddress_v2('cuMemGetHandleForAddressRange', &__cuMemGetHandleForAddressRange, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemAddressReserve' in found_functions}} - global __cuMemAddressReserve - _F_cuGetProcAddress_v2('cuMemAddressReserve', &__cuMemAddressReserve, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemAddressFree' in found_functions}} - global __cuMemAddressFree - _F_cuGetProcAddress_v2('cuMemAddressFree', &__cuMemAddressFree, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemCreate' in found_functions}} - global __cuMemCreate - _F_cuGetProcAddress_v2('cuMemCreate', &__cuMemCreate, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemRelease' in found_functions}} - global __cuMemRelease - _F_cuGetProcAddress_v2('cuMemRelease', &__cuMemRelease, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemMap' in found_functions}} - global __cuMemMap - _F_cuGetProcAddress_v2('cuMemMap', &__cuMemMap, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemUnmap' in found_functions}} - global __cuMemUnmap - _F_cuGetProcAddress_v2('cuMemUnmap', &__cuMemUnmap, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemSetAccess' in found_functions}} - global __cuMemSetAccess - _F_cuGetProcAddress_v2('cuMemSetAccess', &__cuMemSetAccess, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemGetAccess' in found_functions}} - global __cuMemGetAccess - _F_cuGetProcAddress_v2('cuMemGetAccess', &__cuMemGetAccess, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemExportToShareableHandle' in found_functions}} - global __cuMemExportToShareableHandle - _F_cuGetProcAddress_v2('cuMemExportToShareableHandle', &__cuMemExportToShareableHandle, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemImportFromShareableHandle' in found_functions}} - global __cuMemImportFromShareableHandle - _F_cuGetProcAddress_v2('cuMemImportFromShareableHandle', &__cuMemImportFromShareableHandle, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemGetAllocationGranularity' in found_functions}} - global __cuMemGetAllocationGranularity - _F_cuGetProcAddress_v2('cuMemGetAllocationGranularity', &__cuMemGetAllocationGranularity, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}} - global __cuMemGetAllocationPropertiesFromHandle - _F_cuGetProcAddress_v2('cuMemGetAllocationPropertiesFromHandle', &__cuMemGetAllocationPropertiesFromHandle, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemRetainAllocationHandle' in found_functions}} - global __cuMemRetainAllocationHandle - _F_cuGetProcAddress_v2('cuMemRetainAllocationHandle', &__cuMemRetainAllocationHandle, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolTrimTo' in found_functions}} - global __cuMemPoolTrimTo - _F_cuGetProcAddress_v2('cuMemPoolTrimTo', &__cuMemPoolTrimTo, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolSetAttribute' in found_functions}} - global __cuMemPoolSetAttribute - _F_cuGetProcAddress_v2('cuMemPoolSetAttribute', &__cuMemPoolSetAttribute, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolGetAttribute' in found_functions}} - global __cuMemPoolGetAttribute - _F_cuGetProcAddress_v2('cuMemPoolGetAttribute', &__cuMemPoolGetAttribute, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolSetAccess' in found_functions}} - global __cuMemPoolSetAccess - _F_cuGetProcAddress_v2('cuMemPoolSetAccess', &__cuMemPoolSetAccess, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolGetAccess' in found_functions}} - global __cuMemPoolGetAccess - _F_cuGetProcAddress_v2('cuMemPoolGetAccess', &__cuMemPoolGetAccess, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolCreate' in found_functions}} - global __cuMemPoolCreate - _F_cuGetProcAddress_v2('cuMemPoolCreate', &__cuMemPoolCreate, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolDestroy' in found_functions}} - global __cuMemPoolDestroy - _F_cuGetProcAddress_v2('cuMemPoolDestroy', &__cuMemPoolDestroy, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemGetDefaultMemPool' in found_functions}} - global __cuMemGetDefaultMemPool - _F_cuGetProcAddress_v2('cuMemGetDefaultMemPool', &__cuMemGetDefaultMemPool, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemGetMemPool' in found_functions}} - global __cuMemGetMemPool - _F_cuGetProcAddress_v2('cuMemGetMemPool', &__cuMemGetMemPool, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemSetMemPool' in found_functions}} - global __cuMemSetMemPool - _F_cuGetProcAddress_v2('cuMemSetMemPool', &__cuMemSetMemPool, 13000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolExportToShareableHandle' in found_functions}} - global __cuMemPoolExportToShareableHandle - _F_cuGetProcAddress_v2('cuMemPoolExportToShareableHandle', &__cuMemPoolExportToShareableHandle, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolImportFromShareableHandle' in found_functions}} - global __cuMemPoolImportFromShareableHandle - _F_cuGetProcAddress_v2('cuMemPoolImportFromShareableHandle', &__cuMemPoolImportFromShareableHandle, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolExportPointer' in found_functions}} - global __cuMemPoolExportPointer - _F_cuGetProcAddress_v2('cuMemPoolExportPointer', &__cuMemPoolExportPointer, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolImportPointer' in found_functions}} - global __cuMemPoolImportPointer - _F_cuGetProcAddress_v2('cuMemPoolImportPointer', &__cuMemPoolImportPointer, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMulticastCreate' in found_functions}} - global __cuMulticastCreate - _F_cuGetProcAddress_v2('cuMulticastCreate', &__cuMulticastCreate, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMulticastAddDevice' in found_functions}} - global __cuMulticastAddDevice - _F_cuGetProcAddress_v2('cuMulticastAddDevice', &__cuMulticastAddDevice, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMulticastBindMem' in found_functions}} - global __cuMulticastBindMem - _F_cuGetProcAddress_v2('cuMulticastBindMem', &__cuMulticastBindMem, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMulticastBindMem_v2' in found_functions}} - global __cuMulticastBindMem_v2 - _F_cuGetProcAddress_v2('cuMulticastBindMem', &__cuMulticastBindMem_v2, 13010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMulticastBindAddr' in found_functions}} - global __cuMulticastBindAddr - _F_cuGetProcAddress_v2('cuMulticastBindAddr', &__cuMulticastBindAddr, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMulticastBindAddr_v2' in found_functions}} - global __cuMulticastBindAddr_v2 - _F_cuGetProcAddress_v2('cuMulticastBindAddr', &__cuMulticastBindAddr_v2, 13010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMulticastUnbind' in found_functions}} - global __cuMulticastUnbind - _F_cuGetProcAddress_v2('cuMulticastUnbind', &__cuMulticastUnbind, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMulticastGetGranularity' in found_functions}} - global __cuMulticastGetGranularity - _F_cuGetProcAddress_v2('cuMulticastGetGranularity', &__cuMulticastGetGranularity, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuPointerGetAttribute' in found_functions}} - global __cuPointerGetAttribute - _F_cuGetProcAddress_v2('cuPointerGetAttribute', &__cuPointerGetAttribute, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemAdvise_v2' in found_functions}} - global __cuMemAdvise_v2 - _F_cuGetProcAddress_v2('cuMemAdvise', &__cuMemAdvise_v2, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemRangeGetAttribute' in found_functions}} - global __cuMemRangeGetAttribute - _F_cuGetProcAddress_v2('cuMemRangeGetAttribute', &__cuMemRangeGetAttribute, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemRangeGetAttributes' in found_functions}} - global __cuMemRangeGetAttributes - _F_cuGetProcAddress_v2('cuMemRangeGetAttributes', &__cuMemRangeGetAttributes, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuPointerSetAttribute' in found_functions}} - global __cuPointerSetAttribute - _F_cuGetProcAddress_v2('cuPointerSetAttribute', &__cuPointerSetAttribute, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuPointerGetAttributes' in found_functions}} - global __cuPointerGetAttributes - _F_cuGetProcAddress_v2('cuPointerGetAttributes', &__cuPointerGetAttributes, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuStreamCreate' in found_functions}} - global __cuStreamCreate - _F_cuGetProcAddress_v2('cuStreamCreate', &__cuStreamCreate, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuStreamCreateWithPriority' in found_functions}} - global __cuStreamCreateWithPriority - _F_cuGetProcAddress_v2('cuStreamCreateWithPriority', &__cuStreamCreateWithPriority, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuThreadExchangeStreamCaptureMode' in found_functions}} - global __cuThreadExchangeStreamCaptureMode - _F_cuGetProcAddress_v2('cuThreadExchangeStreamCaptureMode', &__cuThreadExchangeStreamCaptureMode, 10010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuStreamDestroy_v2' in found_functions}} - global __cuStreamDestroy_v2 - _F_cuGetProcAddress_v2('cuStreamDestroy', &__cuStreamDestroy_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuEventCreate' in found_functions}} - global __cuEventCreate - _F_cuGetProcAddress_v2('cuEventCreate', &__cuEventCreate, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuEventQuery' in found_functions}} - global __cuEventQuery - _F_cuGetProcAddress_v2('cuEventQuery', &__cuEventQuery, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuEventSynchronize' in found_functions}} - global __cuEventSynchronize - _F_cuGetProcAddress_v2('cuEventSynchronize', &__cuEventSynchronize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuEventDestroy_v2' in found_functions}} - global __cuEventDestroy_v2 - _F_cuGetProcAddress_v2('cuEventDestroy', &__cuEventDestroy_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{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 'cuFuncGetParamCount' in found_functions}} - global __cuFuncGetParamCount - _F_cuGetProcAddress_v2('cuFuncGetParamCount', &__cuFuncGetParamCount, 13020, 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 'cuGraphNodeGetContainingGraph' in found_functions}} - global __cuGraphNodeGetContainingGraph - _F_cuGetProcAddress_v2('cuGraphNodeGetContainingGraph', &__cuGraphNodeGetContainingGraph, 13010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphNodeGetLocalId' in found_functions}} - global __cuGraphNodeGetLocalId - _F_cuGetProcAddress_v2('cuGraphNodeGetLocalId', &__cuGraphNodeGetLocalId, 13010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphNodeGetToolsId' in found_functions}} - global __cuGraphNodeGetToolsId - _F_cuGetProcAddress_v2('cuGraphNodeGetToolsId', &__cuGraphNodeGetToolsId, 13010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphGetId' in found_functions}} - global __cuGraphGetId - _F_cuGetProcAddress_v2('cuGraphGetId', &__cuGraphGetId, 13010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecGetId' in found_functions}} - global __cuGraphExecGetId - _F_cuGetProcAddress_v2('cuGraphExecGetId', &__cuGraphExecGetId, 13010, 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 'cuGraphNodeGetParams' in found_functions}} - global __cuGraphNodeGetParams - _F_cuGetProcAddress_v2('cuGraphNodeGetParams', &__cuGraphNodeGetParams, 13020, 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 'cuCoredumpRegisterStartCallback' in found_functions}} - global __cuCoredumpRegisterStartCallback - _F_cuGetProcAddress_v2('cuCoredumpRegisterStartCallback', &__cuCoredumpRegisterStartCallback, 13020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCoredumpRegisterCompleteCallback' in found_functions}} - global __cuCoredumpRegisterCompleteCallback - _F_cuGetProcAddress_v2('cuCoredumpRegisterCompleteCallback', &__cuCoredumpRegisterCompleteCallback, 13020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCoredumpDeregisterStartCallback' in found_functions}} - global __cuCoredumpDeregisterStartCallback - _F_cuGetProcAddress_v2('cuCoredumpDeregisterStartCallback', &__cuCoredumpDeregisterStartCallback, 13020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCoredumpDeregisterCompleteCallback' in found_functions}} - global __cuCoredumpDeregisterCompleteCallback - _F_cuGetProcAddress_v2('cuCoredumpDeregisterCompleteCallback', &__cuCoredumpDeregisterCompleteCallback, 13020, 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 'cuDevSmResourceSplit' in found_functions}} - global __cuDevSmResourceSplit - _F_cuGetProcAddress_v2('cuDevSmResourceSplit', &__cuDevSmResourceSplit, 13010, 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 '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) - {{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}} - global __cuMemcpy - __cuMemcpy = windll.GetProcAddress(handle, 'cuMemcpy_ptds') - {{endif}} - {{if 'cuMemcpyPeer' in found_functions}} - global __cuMemcpyPeer - __cuMemcpyPeer = windll.GetProcAddress(handle, 'cuMemcpyPeer_ptds') - {{endif}} - {{if 'cuMemcpyHtoD_v2' in found_functions}} - global __cuMemcpyHtoD_v2 - __cuMemcpyHtoD_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoD_v2_ptds') - {{endif}} - {{if 'cuMemcpyDtoH_v2' in found_functions}} - global __cuMemcpyDtoH_v2 - __cuMemcpyDtoH_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoH_v2_ptds') - {{endif}} - {{if 'cuMemcpyDtoD_v2' in found_functions}} - global __cuMemcpyDtoD_v2 - __cuMemcpyDtoD_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoD_v2_ptds') - {{endif}} - {{if 'cuMemcpyDtoA_v2' in found_functions}} - global __cuMemcpyDtoA_v2 - __cuMemcpyDtoA_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoA_v2_ptds') - {{endif}} - {{if 'cuMemcpyAtoD_v2' in found_functions}} - global __cuMemcpyAtoD_v2 - __cuMemcpyAtoD_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoD_v2_ptds') - {{endif}} - {{if 'cuMemcpyHtoA_v2' in found_functions}} - global __cuMemcpyHtoA_v2 - __cuMemcpyHtoA_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoA_v2_ptds') - {{endif}} - {{if 'cuMemcpyAtoH_v2' in found_functions}} - global __cuMemcpyAtoH_v2 - __cuMemcpyAtoH_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoH_v2_ptds') - {{endif}} - {{if 'cuMemcpyAtoA_v2' in found_functions}} - global __cuMemcpyAtoA_v2 - __cuMemcpyAtoA_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoA_v2_ptds') - {{endif}} - {{if 'cuMemcpy2D_v2' in found_functions}} - global __cuMemcpy2D_v2 - __cuMemcpy2D_v2 = windll.GetProcAddress(handle, 'cuMemcpy2D_v2_ptds') - {{endif}} - {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} - global __cuMemcpy2DUnaligned_v2 - __cuMemcpy2DUnaligned_v2 = windll.GetProcAddress(handle, 'cuMemcpy2DUnaligned_v2_ptds') - {{endif}} - {{if 'cuMemcpy3D_v2' in found_functions}} - global __cuMemcpy3D_v2 - __cuMemcpy3D_v2 = windll.GetProcAddress(handle, 'cuMemcpy3D_v2_ptds') - {{endif}} - {{if 'cuMemcpy3DPeer' in found_functions}} - global __cuMemcpy3DPeer - __cuMemcpy3DPeer = windll.GetProcAddress(handle, 'cuMemcpy3DPeer_ptds') - {{endif}} - {{if 'cuMemcpyAsync' in found_functions}} - global __cuMemcpyAsync - __cuMemcpyAsync = windll.GetProcAddress(handle, 'cuMemcpyAsync_ptsz') - {{endif}} - {{if 'cuMemcpyPeerAsync' in found_functions}} - global __cuMemcpyPeerAsync - __cuMemcpyPeerAsync = windll.GetProcAddress(handle, 'cuMemcpyPeerAsync_ptsz') - {{endif}} - {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} - global __cuMemcpyHtoDAsync_v2 - __cuMemcpyHtoDAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoDAsync_v2_ptsz') - {{endif}} - {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} - global __cuMemcpyDtoHAsync_v2 - __cuMemcpyDtoHAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoHAsync_v2_ptsz') - {{endif}} - {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} - global __cuMemcpyDtoDAsync_v2 - __cuMemcpyDtoDAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoDAsync_v2_ptsz') - {{endif}} - {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} - global __cuMemcpyHtoAAsync_v2 - __cuMemcpyHtoAAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoAAsync_v2_ptsz') - {{endif}} - {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} - global __cuMemcpyAtoHAsync_v2 - __cuMemcpyAtoHAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoHAsync_v2_ptsz') - {{endif}} - {{if 'cuMemcpy2DAsync_v2' in found_functions}} - global __cuMemcpy2DAsync_v2 - __cuMemcpy2DAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpy2DAsync_v2_ptsz') - {{endif}} - {{if 'cuMemcpy3DAsync_v2' in found_functions}} - global __cuMemcpy3DAsync_v2 - __cuMemcpy3DAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpy3DAsync_v2_ptsz') - {{endif}} - {{if 'cuMemcpy3DPeerAsync' in found_functions}} - global __cuMemcpy3DPeerAsync - __cuMemcpy3DPeerAsync = windll.GetProcAddress(handle, 'cuMemcpy3DPeerAsync_ptsz') - {{endif}} - {{if 'cuMemcpyBatchAsync_v2' in found_functions}} - global __cuMemcpyBatchAsync_v2 - __cuMemcpyBatchAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyBatchAsync_v2_ptsz') - {{endif}} - {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} - global __cuMemcpy3DBatchAsync_v2 - __cuMemcpy3DBatchAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpy3DBatchAsync_v2_ptsz') - {{endif}} - {{if 'cuMemcpyWithAttributesAsync' in found_functions}} - global __cuMemcpyWithAttributesAsync - __cuMemcpyWithAttributesAsync = windll.GetProcAddress(handle, 'cuMemcpyWithAttributesAsync_ptsz') - {{endif}} - {{if 'cuMemcpy3DWithAttributesAsync' in found_functions}} - global __cuMemcpy3DWithAttributesAsync - __cuMemcpy3DWithAttributesAsync = windll.GetProcAddress(handle, 'cuMemcpy3DWithAttributesAsync_ptsz') - {{endif}} - {{if 'cuMemsetD8_v2' in found_functions}} - global __cuMemsetD8_v2 - __cuMemsetD8_v2 = windll.GetProcAddress(handle, 'cuMemsetD8_v2_ptds') - {{endif}} - {{if 'cuMemsetD16_v2' in found_functions}} - global __cuMemsetD16_v2 - __cuMemsetD16_v2 = windll.GetProcAddress(handle, 'cuMemsetD16_v2_ptds') - {{endif}} - {{if 'cuMemsetD32_v2' in found_functions}} - global __cuMemsetD32_v2 - __cuMemsetD32_v2 = windll.GetProcAddress(handle, 'cuMemsetD32_v2_ptds') - {{endif}} - {{if 'cuMemsetD2D8_v2' in found_functions}} - global __cuMemsetD2D8_v2 - __cuMemsetD2D8_v2 = windll.GetProcAddress(handle, 'cuMemsetD2D8_v2_ptds') - {{endif}} - {{if 'cuMemsetD2D16_v2' in found_functions}} - global __cuMemsetD2D16_v2 - __cuMemsetD2D16_v2 = windll.GetProcAddress(handle, 'cuMemsetD2D16_v2_ptds') - {{endif}} - {{if 'cuMemsetD2D32_v2' in found_functions}} - global __cuMemsetD2D32_v2 - __cuMemsetD2D32_v2 = windll.GetProcAddress(handle, 'cuMemsetD2D32_v2_ptds') - {{endif}} - {{if 'cuMemsetD8Async' in found_functions}} - global __cuMemsetD8Async - __cuMemsetD8Async = windll.GetProcAddress(handle, 'cuMemsetD8Async_ptsz') - {{endif}} - {{if 'cuMemsetD16Async' in found_functions}} - global __cuMemsetD16Async - __cuMemsetD16Async = windll.GetProcAddress(handle, 'cuMemsetD16Async_ptsz') - {{endif}} - {{if 'cuMemsetD32Async' in found_functions}} - global __cuMemsetD32Async - __cuMemsetD32Async = windll.GetProcAddress(handle, 'cuMemsetD32Async_ptsz') - {{endif}} - {{if 'cuMemsetD2D8Async' in found_functions}} - global __cuMemsetD2D8Async - __cuMemsetD2D8Async = windll.GetProcAddress(handle, 'cuMemsetD2D8Async_ptsz') - {{endif}} - {{if 'cuMemsetD2D16Async' in found_functions}} - global __cuMemsetD2D16Async - __cuMemsetD2D16Async = windll.GetProcAddress(handle, 'cuMemsetD2D16Async_ptsz') - {{endif}} - {{if 'cuMemsetD2D32Async' in found_functions}} - global __cuMemsetD2D32Async - __cuMemsetD2D32Async = windll.GetProcAddress(handle, 'cuMemsetD2D32Async_ptsz') - {{endif}} - {{if 'cuMemBatchDecompressAsync' in found_functions}} - global __cuMemBatchDecompressAsync - __cuMemBatchDecompressAsync = windll.GetProcAddress(handle, 'cuMemBatchDecompressAsync_ptsz') - {{endif}} - {{if 'cuMemMapArrayAsync' in found_functions}} - global __cuMemMapArrayAsync - __cuMemMapArrayAsync = windll.GetProcAddress(handle, 'cuMemMapArrayAsync_ptsz') - {{endif}} - {{if 'cuMemFreeAsync' in found_functions}} - global __cuMemFreeAsync - __cuMemFreeAsync = windll.GetProcAddress(handle, 'cuMemFreeAsync_ptsz') - {{endif}} - {{if 'cuMemAllocAsync' in found_functions}} - global __cuMemAllocAsync - __cuMemAllocAsync = windll.GetProcAddress(handle, 'cuMemAllocAsync_ptsz') - {{endif}} - {{if 'cuMemAllocFromPoolAsync' in found_functions}} - global __cuMemAllocFromPoolAsync - __cuMemAllocFromPoolAsync = windll.GetProcAddress(handle, 'cuMemAllocFromPoolAsync_ptsz') - {{endif}} - {{if 'cuMemPrefetchAsync_v2' in found_functions}} - global __cuMemPrefetchAsync_v2 - __cuMemPrefetchAsync_v2 = windll.GetProcAddress(handle, 'cuMemPrefetchAsync_v2_ptsz') - {{endif}} - {{if 'cuMemPrefetchBatchAsync' in found_functions}} - global __cuMemPrefetchBatchAsync - __cuMemPrefetchBatchAsync = windll.GetProcAddress(handle, 'cuMemPrefetchBatchAsync_ptsz') - {{endif}} - {{if 'cuMemDiscardBatchAsync' in found_functions}} - global __cuMemDiscardBatchAsync - __cuMemDiscardBatchAsync = windll.GetProcAddress(handle, 'cuMemDiscardBatchAsync_ptsz') - {{endif}} - {{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} - global __cuMemDiscardAndPrefetchBatchAsync - __cuMemDiscardAndPrefetchBatchAsync = windll.GetProcAddress(handle, 'cuMemDiscardAndPrefetchBatchAsync_ptsz') - {{endif}} - {{if 'cuStreamBeginCaptureToCig' in found_functions}} - global __cuStreamBeginCaptureToCig - __cuStreamBeginCaptureToCig = windll.GetProcAddress(handle, 'cuStreamBeginCaptureToCig_ptsz') - {{endif}} - {{if 'cuStreamEndCaptureToCig' in found_functions}} - global __cuStreamEndCaptureToCig - __cuStreamEndCaptureToCig = windll.GetProcAddress(handle, 'cuStreamEndCaptureToCig_ptsz') - {{endif}} - {{if 'cuStreamGetPriority' in found_functions}} - global __cuStreamGetPriority - __cuStreamGetPriority = windll.GetProcAddress(handle, 'cuStreamGetPriority_ptsz') - {{endif}} - {{if 'cuStreamGetDevice' in found_functions}} - global __cuStreamGetDevice - __cuStreamGetDevice = windll.GetProcAddress(handle, 'cuStreamGetDevice_ptsz') - {{endif}} - {{if 'cuStreamGetFlags' in found_functions}} - global __cuStreamGetFlags - __cuStreamGetFlags = windll.GetProcAddress(handle, 'cuStreamGetFlags_ptsz') - {{endif}} - {{if 'cuStreamGetId' in found_functions}} - global __cuStreamGetId - __cuStreamGetId = windll.GetProcAddress(handle, 'cuStreamGetId_ptsz') - {{endif}} - {{if 'cuStreamGetCtx' in found_functions}} - global __cuStreamGetCtx - __cuStreamGetCtx = windll.GetProcAddress(handle, 'cuStreamGetCtx_ptsz') - {{endif}} - {{if 'cuStreamGetCtx_v2' in found_functions}} - global __cuStreamGetCtx_v2 - __cuStreamGetCtx_v2 = windll.GetProcAddress(handle, 'cuStreamGetCtx_v2_ptsz') - {{endif}} - {{if 'cuStreamWaitEvent' in found_functions}} - global __cuStreamWaitEvent - __cuStreamWaitEvent = windll.GetProcAddress(handle, 'cuStreamWaitEvent_ptsz') - {{endif}} - {{if 'cuStreamAddCallback' in found_functions}} - global __cuStreamAddCallback - __cuStreamAddCallback = windll.GetProcAddress(handle, 'cuStreamAddCallback_ptsz') - {{endif}} - {{if 'cuStreamBeginCapture_v2' in found_functions}} - global __cuStreamBeginCapture_v2 - __cuStreamBeginCapture_v2 = windll.GetProcAddress(handle, 'cuStreamBeginCapture_v2_ptsz') - {{endif}} - {{if 'cuStreamBeginCaptureToGraph' in found_functions}} - global __cuStreamBeginCaptureToGraph - __cuStreamBeginCaptureToGraph = windll.GetProcAddress(handle, 'cuStreamBeginCaptureToGraph_ptsz') - {{endif}} - {{if 'cuStreamEndCapture' in found_functions}} - global __cuStreamEndCapture - __cuStreamEndCapture = windll.GetProcAddress(handle, 'cuStreamEndCapture_ptsz') - {{endif}} - {{if 'cuStreamIsCapturing' in found_functions}} - global __cuStreamIsCapturing - __cuStreamIsCapturing = windll.GetProcAddress(handle, 'cuStreamIsCapturing_ptsz') - {{endif}} - {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} - global __cuStreamGetCaptureInfo_v3 - __cuStreamGetCaptureInfo_v3 = windll.GetProcAddress(handle, 'cuStreamGetCaptureInfo_v3_ptsz') - {{endif}} - {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} - global __cuStreamUpdateCaptureDependencies_v2 - __cuStreamUpdateCaptureDependencies_v2 = windll.GetProcAddress(handle, 'cuStreamUpdateCaptureDependencies_v2_ptsz') - {{endif}} - {{if 'cuStreamAttachMemAsync' in found_functions}} - global __cuStreamAttachMemAsync - __cuStreamAttachMemAsync = windll.GetProcAddress(handle, 'cuStreamAttachMemAsync_ptsz') - {{endif}} - {{if 'cuStreamQuery' in found_functions}} - global __cuStreamQuery - __cuStreamQuery = windll.GetProcAddress(handle, 'cuStreamQuery_ptsz') - {{endif}} - {{if 'cuStreamSynchronize' in found_functions}} - global __cuStreamSynchronize - __cuStreamSynchronize = windll.GetProcAddress(handle, 'cuStreamSynchronize_ptsz') - {{endif}} - {{if 'cuStreamCopyAttributes' in found_functions}} - global __cuStreamCopyAttributes - __cuStreamCopyAttributes = windll.GetProcAddress(handle, 'cuStreamCopyAttributes_ptsz') - {{endif}} - {{if 'cuStreamGetAttribute' in found_functions}} - global __cuStreamGetAttribute - __cuStreamGetAttribute = windll.GetProcAddress(handle, 'cuStreamGetAttribute_ptsz') - {{endif}} - {{if 'cuStreamSetAttribute' in found_functions}} - global __cuStreamSetAttribute - __cuStreamSetAttribute = windll.GetProcAddress(handle, 'cuStreamSetAttribute_ptsz') - {{endif}} - {{if 'cuEventRecord' in found_functions}} - global __cuEventRecord - __cuEventRecord = windll.GetProcAddress(handle, 'cuEventRecord_ptsz') - {{endif}} - {{if 'cuEventRecordWithFlags' in found_functions}} - global __cuEventRecordWithFlags - __cuEventRecordWithFlags = windll.GetProcAddress(handle, 'cuEventRecordWithFlags_ptsz') - {{endif}} - {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} - global __cuSignalExternalSemaphoresAsync - __cuSignalExternalSemaphoresAsync = windll.GetProcAddress(handle, 'cuSignalExternalSemaphoresAsync_ptsz') - {{endif}} - {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} - global __cuWaitExternalSemaphoresAsync - __cuWaitExternalSemaphoresAsync = windll.GetProcAddress(handle, 'cuWaitExternalSemaphoresAsync_ptsz') - {{endif}} - {{if 'cuStreamWaitValue32_v2' in found_functions}} - global __cuStreamWaitValue32_v2 - __cuStreamWaitValue32_v2 = windll.GetProcAddress(handle, 'cuStreamWaitValue32_v2_ptsz') - {{endif}} - {{if 'cuStreamWaitValue64_v2' in found_functions}} - global __cuStreamWaitValue64_v2 - __cuStreamWaitValue64_v2 = windll.GetProcAddress(handle, 'cuStreamWaitValue64_v2_ptsz') - {{endif}} - {{if 'cuStreamWriteValue32_v2' in found_functions}} - global __cuStreamWriteValue32_v2 - __cuStreamWriteValue32_v2 = windll.GetProcAddress(handle, 'cuStreamWriteValue32_v2_ptsz') - {{endif}} - {{if 'cuStreamWriteValue64_v2' in found_functions}} - global __cuStreamWriteValue64_v2 - __cuStreamWriteValue64_v2 = windll.GetProcAddress(handle, 'cuStreamWriteValue64_v2_ptsz') - {{endif}} - {{if 'cuStreamBatchMemOp_v2' in found_functions}} - global __cuStreamBatchMemOp_v2 - __cuStreamBatchMemOp_v2 = windll.GetProcAddress(handle, 'cuStreamBatchMemOp_v2_ptsz') - {{endif}} - {{if 'cuLaunchKernel' in found_functions}} - global __cuLaunchKernel - __cuLaunchKernel = windll.GetProcAddress(handle, 'cuLaunchKernel_ptsz') - {{endif}} - {{if 'cuLaunchKernelEx' in found_functions}} - global __cuLaunchKernelEx - __cuLaunchKernelEx = windll.GetProcAddress(handle, 'cuLaunchKernelEx_ptsz') - {{endif}} - {{if 'cuLaunchCooperativeKernel' in found_functions}} - global __cuLaunchCooperativeKernel - __cuLaunchCooperativeKernel = windll.GetProcAddress(handle, 'cuLaunchCooperativeKernel_ptsz') - {{endif}} - {{if 'cuLaunchHostFunc' in found_functions}} - global __cuLaunchHostFunc - __cuLaunchHostFunc = windll.GetProcAddress(handle, 'cuLaunchHostFunc_ptsz') - {{endif}} - {{if 'cuLaunchHostFunc_v2' in found_functions}} - global __cuLaunchHostFunc_v2 - __cuLaunchHostFunc_v2 = windll.GetProcAddress(handle, 'cuLaunchHostFunc_v2_ptsz') - {{endif}} - {{if 'cuGraphInstantiateWithParams' in found_functions}} - global __cuGraphInstantiateWithParams - __cuGraphInstantiateWithParams = windll.GetProcAddress(handle, 'cuGraphInstantiateWithParams_ptsz') - {{endif}} - {{if 'cuGraphUpload' in found_functions}} - global __cuGraphUpload - __cuGraphUpload = windll.GetProcAddress(handle, 'cuGraphUpload_ptsz') - {{endif}} - {{if 'cuGraphLaunch' in found_functions}} - global __cuGraphLaunch - __cuGraphLaunch = windll.GetProcAddress(handle, 'cuGraphLaunch_ptsz') - {{endif}} - {{if 'cuGraphicsMapResources' in found_functions}} - global __cuGraphicsMapResources - __cuGraphicsMapResources = windll.GetProcAddress(handle, 'cuGraphicsMapResources_ptsz') - {{endif}} - {{if 'cuGraphicsUnmapResources' in found_functions}} - global __cuGraphicsUnmapResources - __cuGraphicsUnmapResources = windll.GetProcAddress(handle, 'cuGraphicsUnmapResources_ptsz') - {{endif}} - {{if 'cuStreamGetDevResource' in found_functions}} - global __cuStreamGetDevResource - __cuStreamGetDevResource = windll.GetProcAddress(handle, 'cuStreamGetDevResource_ptsz') - {{endif}} - else: - # Else get the regular version - pass - {{if 'cuMemcpy' in found_functions}} - global __cuMemcpy - __cuMemcpy = windll.GetProcAddress(handle, 'cuMemcpy') - {{endif}} - {{if 'cuMemcpyPeer' in found_functions}} - global __cuMemcpyPeer - __cuMemcpyPeer = windll.GetProcAddress(handle, 'cuMemcpyPeer') - {{endif}} - {{if 'cuMemcpyHtoD_v2' in found_functions}} - global __cuMemcpyHtoD_v2 - __cuMemcpyHtoD_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoD_v2') - {{endif}} - {{if 'cuMemcpyDtoH_v2' in found_functions}} - global __cuMemcpyDtoH_v2 - __cuMemcpyDtoH_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoH_v2') - {{endif}} - {{if 'cuMemcpyDtoD_v2' in found_functions}} - global __cuMemcpyDtoD_v2 - __cuMemcpyDtoD_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoD_v2') - {{endif}} - {{if 'cuMemcpyDtoA_v2' in found_functions}} - global __cuMemcpyDtoA_v2 - __cuMemcpyDtoA_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoA_v2') - {{endif}} - {{if 'cuMemcpyAtoD_v2' in found_functions}} - global __cuMemcpyAtoD_v2 - __cuMemcpyAtoD_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoD_v2') - {{endif}} - {{if 'cuMemcpyHtoA_v2' in found_functions}} - global __cuMemcpyHtoA_v2 - __cuMemcpyHtoA_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoA_v2') - {{endif}} - {{if 'cuMemcpyAtoH_v2' in found_functions}} - global __cuMemcpyAtoH_v2 - __cuMemcpyAtoH_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoH_v2') - {{endif}} - {{if 'cuMemcpyAtoA_v2' in found_functions}} - global __cuMemcpyAtoA_v2 - __cuMemcpyAtoA_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoA_v2') - {{endif}} - {{if 'cuMemcpy2D_v2' in found_functions}} - global __cuMemcpy2D_v2 - __cuMemcpy2D_v2 = windll.GetProcAddress(handle, 'cuMemcpy2D_v2') - {{endif}} - {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} - global __cuMemcpy2DUnaligned_v2 - __cuMemcpy2DUnaligned_v2 = windll.GetProcAddress(handle, 'cuMemcpy2DUnaligned_v2') - {{endif}} - {{if 'cuMemcpy3D_v2' in found_functions}} - global __cuMemcpy3D_v2 - __cuMemcpy3D_v2 = windll.GetProcAddress(handle, 'cuMemcpy3D_v2') - {{endif}} - {{if 'cuMemcpy3DPeer' in found_functions}} - global __cuMemcpy3DPeer - __cuMemcpy3DPeer = windll.GetProcAddress(handle, 'cuMemcpy3DPeer') - {{endif}} - {{if 'cuMemcpyAsync' in found_functions}} - global __cuMemcpyAsync - __cuMemcpyAsync = windll.GetProcAddress(handle, 'cuMemcpyAsync') - {{endif}} - {{if 'cuMemcpyPeerAsync' in found_functions}} - global __cuMemcpyPeerAsync - __cuMemcpyPeerAsync = windll.GetProcAddress(handle, 'cuMemcpyPeerAsync') - {{endif}} - {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} - global __cuMemcpyHtoDAsync_v2 - __cuMemcpyHtoDAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoDAsync_v2') - {{endif}} - {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} - global __cuMemcpyDtoHAsync_v2 - __cuMemcpyDtoHAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoHAsync_v2') - {{endif}} - {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} - global __cuMemcpyDtoDAsync_v2 - __cuMemcpyDtoDAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoDAsync_v2') - {{endif}} - {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} - global __cuMemcpyHtoAAsync_v2 - __cuMemcpyHtoAAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoAAsync_v2') - {{endif}} - {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} - global __cuMemcpyAtoHAsync_v2 - __cuMemcpyAtoHAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoHAsync_v2') - {{endif}} - {{if 'cuMemcpy2DAsync_v2' in found_functions}} - global __cuMemcpy2DAsync_v2 - __cuMemcpy2DAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpy2DAsync_v2') - {{endif}} - {{if 'cuMemcpy3DAsync_v2' in found_functions}} - global __cuMemcpy3DAsync_v2 - __cuMemcpy3DAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpy3DAsync_v2') - {{endif}} - {{if 'cuMemcpy3DPeerAsync' in found_functions}} - global __cuMemcpy3DPeerAsync - __cuMemcpy3DPeerAsync = windll.GetProcAddress(handle, 'cuMemcpy3DPeerAsync') - {{endif}} - {{if 'cuMemcpyBatchAsync_v2' in found_functions}} - global __cuMemcpyBatchAsync_v2 - __cuMemcpyBatchAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyBatchAsync_v2') - {{endif}} - {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} - global __cuMemcpy3DBatchAsync_v2 - __cuMemcpy3DBatchAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpy3DBatchAsync_v2') - {{endif}} - {{if 'cuMemcpyWithAttributesAsync' in found_functions}} - global __cuMemcpyWithAttributesAsync - __cuMemcpyWithAttributesAsync = windll.GetProcAddress(handle, 'cuMemcpyWithAttributesAsync') - {{endif}} - {{if 'cuMemcpy3DWithAttributesAsync' in found_functions}} - global __cuMemcpy3DWithAttributesAsync - __cuMemcpy3DWithAttributesAsync = windll.GetProcAddress(handle, 'cuMemcpy3DWithAttributesAsync') - {{endif}} - {{if 'cuMemsetD8_v2' in found_functions}} - global __cuMemsetD8_v2 - __cuMemsetD8_v2 = windll.GetProcAddress(handle, 'cuMemsetD8_v2') - {{endif}} - {{if 'cuMemsetD16_v2' in found_functions}} - global __cuMemsetD16_v2 - __cuMemsetD16_v2 = windll.GetProcAddress(handle, 'cuMemsetD16_v2') - {{endif}} - {{if 'cuMemsetD32_v2' in found_functions}} - global __cuMemsetD32_v2 - __cuMemsetD32_v2 = windll.GetProcAddress(handle, 'cuMemsetD32_v2') - {{endif}} - {{if 'cuMemsetD2D8_v2' in found_functions}} - global __cuMemsetD2D8_v2 - __cuMemsetD2D8_v2 = windll.GetProcAddress(handle, 'cuMemsetD2D8_v2') - {{endif}} - {{if 'cuMemsetD2D16_v2' in found_functions}} - global __cuMemsetD2D16_v2 - __cuMemsetD2D16_v2 = windll.GetProcAddress(handle, 'cuMemsetD2D16_v2') - {{endif}} - {{if 'cuMemsetD2D32_v2' in found_functions}} - global __cuMemsetD2D32_v2 - __cuMemsetD2D32_v2 = windll.GetProcAddress(handle, 'cuMemsetD2D32_v2') - {{endif}} - {{if 'cuMemsetD8Async' in found_functions}} - global __cuMemsetD8Async - __cuMemsetD8Async = windll.GetProcAddress(handle, 'cuMemsetD8Async') - {{endif}} - {{if 'cuMemsetD16Async' in found_functions}} - global __cuMemsetD16Async - __cuMemsetD16Async = windll.GetProcAddress(handle, 'cuMemsetD16Async') - {{endif}} - {{if 'cuMemsetD32Async' in found_functions}} - global __cuMemsetD32Async - __cuMemsetD32Async = windll.GetProcAddress(handle, 'cuMemsetD32Async') - {{endif}} - {{if 'cuMemsetD2D8Async' in found_functions}} - global __cuMemsetD2D8Async - __cuMemsetD2D8Async = windll.GetProcAddress(handle, 'cuMemsetD2D8Async') - {{endif}} - {{if 'cuMemsetD2D16Async' in found_functions}} - global __cuMemsetD2D16Async - __cuMemsetD2D16Async = windll.GetProcAddress(handle, 'cuMemsetD2D16Async') - {{endif}} - {{if 'cuMemsetD2D32Async' in found_functions}} - global __cuMemsetD2D32Async - __cuMemsetD2D32Async = windll.GetProcAddress(handle, 'cuMemsetD2D32Async') - {{endif}} - {{if 'cuMemBatchDecompressAsync' in found_functions}} - global __cuMemBatchDecompressAsync - __cuMemBatchDecompressAsync = windll.GetProcAddress(handle, 'cuMemBatchDecompressAsync') - {{endif}} - {{if 'cuMemMapArrayAsync' in found_functions}} - global __cuMemMapArrayAsync - __cuMemMapArrayAsync = windll.GetProcAddress(handle, 'cuMemMapArrayAsync') - {{endif}} - {{if 'cuMemFreeAsync' in found_functions}} - global __cuMemFreeAsync - __cuMemFreeAsync = windll.GetProcAddress(handle, 'cuMemFreeAsync') - {{endif}} - {{if 'cuMemAllocAsync' in found_functions}} - global __cuMemAllocAsync - __cuMemAllocAsync = windll.GetProcAddress(handle, 'cuMemAllocAsync') - {{endif}} - {{if 'cuMemAllocFromPoolAsync' in found_functions}} - global __cuMemAllocFromPoolAsync - __cuMemAllocFromPoolAsync = windll.GetProcAddress(handle, 'cuMemAllocFromPoolAsync') - {{endif}} - {{if 'cuMemPrefetchAsync_v2' in found_functions}} - global __cuMemPrefetchAsync_v2 - __cuMemPrefetchAsync_v2 = windll.GetProcAddress(handle, 'cuMemPrefetchAsync_v2') - {{endif}} - {{if 'cuMemPrefetchBatchAsync' in found_functions}} - global __cuMemPrefetchBatchAsync - __cuMemPrefetchBatchAsync = windll.GetProcAddress(handle, 'cuMemPrefetchBatchAsync') - {{endif}} - {{if 'cuMemDiscardBatchAsync' in found_functions}} - global __cuMemDiscardBatchAsync - __cuMemDiscardBatchAsync = windll.GetProcAddress(handle, 'cuMemDiscardBatchAsync') - {{endif}} - {{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} - global __cuMemDiscardAndPrefetchBatchAsync - __cuMemDiscardAndPrefetchBatchAsync = windll.GetProcAddress(handle, 'cuMemDiscardAndPrefetchBatchAsync') - {{endif}} - {{if 'cuStreamBeginCaptureToCig' in found_functions}} - global __cuStreamBeginCaptureToCig - __cuStreamBeginCaptureToCig = windll.GetProcAddress(handle, 'cuStreamBeginCaptureToCig') - {{endif}} - {{if 'cuStreamEndCaptureToCig' in found_functions}} - global __cuStreamEndCaptureToCig - __cuStreamEndCaptureToCig = windll.GetProcAddress(handle, 'cuStreamEndCaptureToCig') - {{endif}} - {{if 'cuStreamGetPriority' in found_functions}} - global __cuStreamGetPriority - __cuStreamGetPriority = windll.GetProcAddress(handle, 'cuStreamGetPriority') - {{endif}} - {{if 'cuStreamGetDevice' in found_functions}} - global __cuStreamGetDevice - __cuStreamGetDevice = windll.GetProcAddress(handle, 'cuStreamGetDevice') - {{endif}} - {{if 'cuStreamGetFlags' in found_functions}} - global __cuStreamGetFlags - __cuStreamGetFlags = windll.GetProcAddress(handle, 'cuStreamGetFlags') - {{endif}} - {{if 'cuStreamGetId' in found_functions}} - global __cuStreamGetId - __cuStreamGetId = windll.GetProcAddress(handle, 'cuStreamGetId') - {{endif}} - {{if 'cuStreamGetCtx' in found_functions}} - global __cuStreamGetCtx - __cuStreamGetCtx = windll.GetProcAddress(handle, 'cuStreamGetCtx') - {{endif}} - {{if 'cuStreamGetCtx_v2' in found_functions}} - global __cuStreamGetCtx_v2 - __cuStreamGetCtx_v2 = windll.GetProcAddress(handle, 'cuStreamGetCtx_v2') - {{endif}} - {{if 'cuStreamWaitEvent' in found_functions}} - global __cuStreamWaitEvent - __cuStreamWaitEvent = windll.GetProcAddress(handle, 'cuStreamWaitEvent') - {{endif}} - {{if 'cuStreamAddCallback' in found_functions}} - global __cuStreamAddCallback - __cuStreamAddCallback = windll.GetProcAddress(handle, 'cuStreamAddCallback') - {{endif}} - {{if 'cuStreamBeginCapture_v2' in found_functions}} - global __cuStreamBeginCapture_v2 - __cuStreamBeginCapture_v2 = windll.GetProcAddress(handle, 'cuStreamBeginCapture_v2') - {{endif}} - {{if 'cuStreamBeginCaptureToGraph' in found_functions}} - global __cuStreamBeginCaptureToGraph - __cuStreamBeginCaptureToGraph = windll.GetProcAddress(handle, 'cuStreamBeginCaptureToGraph') - {{endif}} - {{if 'cuStreamEndCapture' in found_functions}} - global __cuStreamEndCapture - __cuStreamEndCapture = windll.GetProcAddress(handle, 'cuStreamEndCapture') - {{endif}} - {{if 'cuStreamIsCapturing' in found_functions}} - global __cuStreamIsCapturing - __cuStreamIsCapturing = windll.GetProcAddress(handle, 'cuStreamIsCapturing') - {{endif}} - {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} - global __cuStreamGetCaptureInfo_v3 - __cuStreamGetCaptureInfo_v3 = windll.GetProcAddress(handle, 'cuStreamGetCaptureInfo_v3') - {{endif}} - {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} - global __cuStreamUpdateCaptureDependencies_v2 - __cuStreamUpdateCaptureDependencies_v2 = windll.GetProcAddress(handle, 'cuStreamUpdateCaptureDependencies_v2') - {{endif}} - {{if 'cuStreamAttachMemAsync' in found_functions}} - global __cuStreamAttachMemAsync - __cuStreamAttachMemAsync = windll.GetProcAddress(handle, 'cuStreamAttachMemAsync') - {{endif}} - {{if 'cuStreamQuery' in found_functions}} - global __cuStreamQuery - __cuStreamQuery = windll.GetProcAddress(handle, 'cuStreamQuery') - {{endif}} - {{if 'cuStreamSynchronize' in found_functions}} - global __cuStreamSynchronize - __cuStreamSynchronize = windll.GetProcAddress(handle, 'cuStreamSynchronize') - {{endif}} - {{if 'cuStreamCopyAttributes' in found_functions}} - global __cuStreamCopyAttributes - __cuStreamCopyAttributes = windll.GetProcAddress(handle, 'cuStreamCopyAttributes') - {{endif}} - {{if 'cuStreamGetAttribute' in found_functions}} - global __cuStreamGetAttribute - __cuStreamGetAttribute = windll.GetProcAddress(handle, 'cuStreamGetAttribute') - {{endif}} - {{if 'cuStreamSetAttribute' in found_functions}} - global __cuStreamSetAttribute - __cuStreamSetAttribute = windll.GetProcAddress(handle, 'cuStreamSetAttribute') - {{endif}} - {{if 'cuEventRecord' in found_functions}} - global __cuEventRecord - __cuEventRecord = windll.GetProcAddress(handle, 'cuEventRecord') - {{endif}} - {{if 'cuEventRecordWithFlags' in found_functions}} - global __cuEventRecordWithFlags - __cuEventRecordWithFlags = windll.GetProcAddress(handle, 'cuEventRecordWithFlags') - {{endif}} - {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} - global __cuSignalExternalSemaphoresAsync - __cuSignalExternalSemaphoresAsync = windll.GetProcAddress(handle, 'cuSignalExternalSemaphoresAsync') - {{endif}} - {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} - global __cuWaitExternalSemaphoresAsync - __cuWaitExternalSemaphoresAsync = windll.GetProcAddress(handle, 'cuWaitExternalSemaphoresAsync') - {{endif}} - {{if 'cuStreamWaitValue32_v2' in found_functions}} - global __cuStreamWaitValue32_v2 - __cuStreamWaitValue32_v2 = windll.GetProcAddress(handle, 'cuStreamWaitValue32_v2') - {{endif}} - {{if 'cuStreamWaitValue64_v2' in found_functions}} - global __cuStreamWaitValue64_v2 - __cuStreamWaitValue64_v2 = windll.GetProcAddress(handle, 'cuStreamWaitValue64_v2') - {{endif}} - {{if 'cuStreamWriteValue32_v2' in found_functions}} - global __cuStreamWriteValue32_v2 - __cuStreamWriteValue32_v2 = windll.GetProcAddress(handle, 'cuStreamWriteValue32_v2') - {{endif}} - {{if 'cuStreamWriteValue64_v2' in found_functions}} - global __cuStreamWriteValue64_v2 - __cuStreamWriteValue64_v2 = windll.GetProcAddress(handle, 'cuStreamWriteValue64_v2') - {{endif}} - {{if 'cuStreamBatchMemOp_v2' in found_functions}} - global __cuStreamBatchMemOp_v2 - __cuStreamBatchMemOp_v2 = windll.GetProcAddress(handle, 'cuStreamBatchMemOp_v2') - {{endif}} - {{if 'cuLaunchKernel' in found_functions}} - global __cuLaunchKernel - __cuLaunchKernel = windll.GetProcAddress(handle, 'cuLaunchKernel') - {{endif}} - {{if 'cuLaunchKernelEx' in found_functions}} - global __cuLaunchKernelEx - __cuLaunchKernelEx = windll.GetProcAddress(handle, 'cuLaunchKernelEx') - {{endif}} - {{if 'cuLaunchCooperativeKernel' in found_functions}} - global __cuLaunchCooperativeKernel - __cuLaunchCooperativeKernel = windll.GetProcAddress(handle, 'cuLaunchCooperativeKernel') - {{endif}} - {{if 'cuLaunchHostFunc' in found_functions}} - global __cuLaunchHostFunc - __cuLaunchHostFunc = windll.GetProcAddress(handle, 'cuLaunchHostFunc') - {{endif}} - {{if 'cuLaunchHostFunc_v2' in found_functions}} - global __cuLaunchHostFunc_v2 - __cuLaunchHostFunc_v2 = windll.GetProcAddress(handle, 'cuLaunchHostFunc_v2') - {{endif}} - {{if 'cuGraphInstantiateWithParams' in found_functions}} - global __cuGraphInstantiateWithParams - __cuGraphInstantiateWithParams = windll.GetProcAddress(handle, 'cuGraphInstantiateWithParams') - {{endif}} - {{if 'cuGraphUpload' in found_functions}} - global __cuGraphUpload - __cuGraphUpload = windll.GetProcAddress(handle, 'cuGraphUpload') - {{endif}} - {{if 'cuGraphLaunch' in found_functions}} - global __cuGraphLaunch - __cuGraphLaunch = windll.GetProcAddress(handle, 'cuGraphLaunch') - {{endif}} - {{if 'cuGraphicsMapResources' in found_functions}} - global __cuGraphicsMapResources - __cuGraphicsMapResources = windll.GetProcAddress(handle, 'cuGraphicsMapResources') - {{endif}} - {{if 'cuGraphicsUnmapResources' in found_functions}} - global __cuGraphicsUnmapResources - __cuGraphicsUnmapResources = windll.GetProcAddress(handle, 'cuGraphicsUnmapResources') - {{endif}} - {{if 'cuStreamGetDevResource' in found_functions}} - global __cuStreamGetDevResource - __cuStreamGetDevResource = windll.GetProcAddress(handle, 'cuStreamGetDevResource') - {{endif}} - # Get remaining functions - {{if 'cuGetErrorString' in found_functions}} - global __cuGetErrorString - __cuGetErrorString = windll.GetProcAddress(handle, 'cuGetErrorString') - {{endif}} - {{if 'cuGetErrorName' in found_functions}} - global __cuGetErrorName - __cuGetErrorName = windll.GetProcAddress(handle, 'cuGetErrorName') - {{endif}} - {{if 'cuInit' in found_functions}} - global __cuInit - __cuInit = windll.GetProcAddress(handle, 'cuInit') - {{endif}} - {{if 'cuDriverGetVersion' in found_functions}} - global __cuDriverGetVersion - __cuDriverGetVersion = windll.GetProcAddress(handle, 'cuDriverGetVersion') - {{endif}} - {{if 'cuDeviceGet' in found_functions}} - global __cuDeviceGet - __cuDeviceGet = windll.GetProcAddress(handle, 'cuDeviceGet') - {{endif}} - {{if 'cuDeviceGetCount' in found_functions}} - global __cuDeviceGetCount - __cuDeviceGetCount = windll.GetProcAddress(handle, 'cuDeviceGetCount') - {{endif}} - {{if 'cuDeviceGetName' in found_functions}} - global __cuDeviceGetName - __cuDeviceGetName = windll.GetProcAddress(handle, 'cuDeviceGetName') - {{endif}} - {{if 'cuDeviceGetUuid_v2' in found_functions}} - global __cuDeviceGetUuid_v2 - __cuDeviceGetUuid_v2 = windll.GetProcAddress(handle, 'cuDeviceGetUuid_v2') - {{endif}} - {{if 'cuDeviceGetLuid' in found_functions}} - global __cuDeviceGetLuid - __cuDeviceGetLuid = windll.GetProcAddress(handle, 'cuDeviceGetLuid') - {{endif}} - {{if 'cuDeviceTotalMem_v2' in found_functions}} - global __cuDeviceTotalMem_v2 - __cuDeviceTotalMem_v2 = windll.GetProcAddress(handle, 'cuDeviceTotalMem_v2') - {{endif}} - {{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}} - global __cuDeviceGetTexture1DLinearMaxWidth - __cuDeviceGetTexture1DLinearMaxWidth = windll.GetProcAddress(handle, 'cuDeviceGetTexture1DLinearMaxWidth') - {{endif}} - {{if 'cuDeviceGetAttribute' in found_functions}} - global __cuDeviceGetAttribute - __cuDeviceGetAttribute = windll.GetProcAddress(handle, 'cuDeviceGetAttribute') - {{endif}} - {{if 'cuDeviceGetHostAtomicCapabilities' in found_functions}} - global __cuDeviceGetHostAtomicCapabilities - __cuDeviceGetHostAtomicCapabilities = windll.GetProcAddress(handle, 'cuDeviceGetHostAtomicCapabilities') - {{endif}} - {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} - global __cuDeviceGetNvSciSyncAttributes - __cuDeviceGetNvSciSyncAttributes = windll.GetProcAddress(handle, 'cuDeviceGetNvSciSyncAttributes') - {{endif}} - {{if 'cuDeviceSetMemPool' in found_functions}} - global __cuDeviceSetMemPool - __cuDeviceSetMemPool = windll.GetProcAddress(handle, 'cuDeviceSetMemPool') - {{endif}} - {{if 'cuDeviceGetMemPool' in found_functions}} - global __cuDeviceGetMemPool - __cuDeviceGetMemPool = windll.GetProcAddress(handle, 'cuDeviceGetMemPool') - {{endif}} - {{if 'cuDeviceGetDefaultMemPool' in found_functions}} - global __cuDeviceGetDefaultMemPool - __cuDeviceGetDefaultMemPool = windll.GetProcAddress(handle, 'cuDeviceGetDefaultMemPool') - {{endif}} - {{if 'cuDeviceGetExecAffinitySupport' in found_functions}} - global __cuDeviceGetExecAffinitySupport - __cuDeviceGetExecAffinitySupport = windll.GetProcAddress(handle, 'cuDeviceGetExecAffinitySupport') - {{endif}} - {{if 'cuFlushGPUDirectRDMAWrites' in found_functions}} - global __cuFlushGPUDirectRDMAWrites - __cuFlushGPUDirectRDMAWrites = windll.GetProcAddress(handle, 'cuFlushGPUDirectRDMAWrites') - {{endif}} - {{if 'cuDeviceGetProperties' in found_functions}} - global __cuDeviceGetProperties - __cuDeviceGetProperties = windll.GetProcAddress(handle, 'cuDeviceGetProperties') - {{endif}} - {{if 'cuDeviceComputeCapability' in found_functions}} - global __cuDeviceComputeCapability - __cuDeviceComputeCapability = windll.GetProcAddress(handle, 'cuDeviceComputeCapability') - {{endif}} - {{if 'cuDevicePrimaryCtxRetain' in found_functions}} - global __cuDevicePrimaryCtxRetain - __cuDevicePrimaryCtxRetain = windll.GetProcAddress(handle, 'cuDevicePrimaryCtxRetain') - {{endif}} - {{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}} - global __cuDevicePrimaryCtxRelease_v2 - __cuDevicePrimaryCtxRelease_v2 = windll.GetProcAddress(handle, 'cuDevicePrimaryCtxRelease_v2') - {{endif}} - {{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}} - global __cuDevicePrimaryCtxSetFlags_v2 - __cuDevicePrimaryCtxSetFlags_v2 = windll.GetProcAddress(handle, 'cuDevicePrimaryCtxSetFlags_v2') - {{endif}} - {{if 'cuDevicePrimaryCtxGetState' in found_functions}} - global __cuDevicePrimaryCtxGetState - __cuDevicePrimaryCtxGetState = windll.GetProcAddress(handle, 'cuDevicePrimaryCtxGetState') - {{endif}} - {{if 'cuDevicePrimaryCtxReset_v2' in found_functions}} - global __cuDevicePrimaryCtxReset_v2 - __cuDevicePrimaryCtxReset_v2 = windll.GetProcAddress(handle, 'cuDevicePrimaryCtxReset_v2') - {{endif}} - {{if 'cuCtxCreate_v4' in found_functions}} - global __cuCtxCreate_v4 - __cuCtxCreate_v4 = windll.GetProcAddress(handle, 'cuCtxCreate_v4') - {{endif}} - {{if 'cuCtxDestroy_v2' in found_functions}} - global __cuCtxDestroy_v2 - __cuCtxDestroy_v2 = windll.GetProcAddress(handle, 'cuCtxDestroy_v2') - {{endif}} - {{if 'cuCtxPushCurrent_v2' in found_functions}} - global __cuCtxPushCurrent_v2 - __cuCtxPushCurrent_v2 = windll.GetProcAddress(handle, 'cuCtxPushCurrent_v2') - {{endif}} - {{if 'cuCtxPopCurrent_v2' in found_functions}} - global __cuCtxPopCurrent_v2 - __cuCtxPopCurrent_v2 = windll.GetProcAddress(handle, 'cuCtxPopCurrent_v2') - {{endif}} - {{if 'cuCtxSetCurrent' in found_functions}} - global __cuCtxSetCurrent - __cuCtxSetCurrent = windll.GetProcAddress(handle, 'cuCtxSetCurrent') - {{endif}} - {{if 'cuCtxGetCurrent' in found_functions}} - global __cuCtxGetCurrent - __cuCtxGetCurrent = windll.GetProcAddress(handle, 'cuCtxGetCurrent') - {{endif}} - {{if 'cuCtxGetDevice' in found_functions}} - global __cuCtxGetDevice - __cuCtxGetDevice = windll.GetProcAddress(handle, 'cuCtxGetDevice') - {{endif}} - {{if 'cuCtxGetDevice_v2' in found_functions}} - global __cuCtxGetDevice_v2 - __cuCtxGetDevice_v2 = windll.GetProcAddress(handle, 'cuCtxGetDevice_v2') - {{endif}} - {{if 'cuCtxGetFlags' in found_functions}} - global __cuCtxGetFlags - __cuCtxGetFlags = windll.GetProcAddress(handle, 'cuCtxGetFlags') - {{endif}} - {{if 'cuCtxSetFlags' in found_functions}} - global __cuCtxSetFlags - __cuCtxSetFlags = windll.GetProcAddress(handle, 'cuCtxSetFlags') - {{endif}} - {{if 'cuCtxGetId' in found_functions}} - global __cuCtxGetId - __cuCtxGetId = windll.GetProcAddress(handle, 'cuCtxGetId') - {{endif}} - {{if 'cuCtxSynchronize' in found_functions}} - global __cuCtxSynchronize - __cuCtxSynchronize = windll.GetProcAddress(handle, 'cuCtxSynchronize') - {{endif}} - {{if 'cuCtxSynchronize_v2' in found_functions}} - global __cuCtxSynchronize_v2 - __cuCtxSynchronize_v2 = windll.GetProcAddress(handle, 'cuCtxSynchronize_v2') - {{endif}} - {{if 'cuCtxSetLimit' in found_functions}} - global __cuCtxSetLimit - __cuCtxSetLimit = windll.GetProcAddress(handle, 'cuCtxSetLimit') - {{endif}} - {{if 'cuCtxGetLimit' in found_functions}} - global __cuCtxGetLimit - __cuCtxGetLimit = windll.GetProcAddress(handle, 'cuCtxGetLimit') - {{endif}} - {{if 'cuCtxGetCacheConfig' in found_functions}} - global __cuCtxGetCacheConfig - __cuCtxGetCacheConfig = windll.GetProcAddress(handle, 'cuCtxGetCacheConfig') - {{endif}} - {{if 'cuCtxSetCacheConfig' in found_functions}} - global __cuCtxSetCacheConfig - __cuCtxSetCacheConfig = windll.GetProcAddress(handle, 'cuCtxSetCacheConfig') - {{endif}} - {{if 'cuCtxGetApiVersion' in found_functions}} - global __cuCtxGetApiVersion - __cuCtxGetApiVersion = windll.GetProcAddress(handle, 'cuCtxGetApiVersion') - {{endif}} - {{if 'cuCtxGetStreamPriorityRange' in found_functions}} - global __cuCtxGetStreamPriorityRange - __cuCtxGetStreamPriorityRange = windll.GetProcAddress(handle, 'cuCtxGetStreamPriorityRange') - {{endif}} - {{if 'cuCtxResetPersistingL2Cache' in found_functions}} - global __cuCtxResetPersistingL2Cache - __cuCtxResetPersistingL2Cache = windll.GetProcAddress(handle, 'cuCtxResetPersistingL2Cache') - {{endif}} - {{if 'cuCtxGetExecAffinity' in found_functions}} - global __cuCtxGetExecAffinity - __cuCtxGetExecAffinity = windll.GetProcAddress(handle, 'cuCtxGetExecAffinity') - {{endif}} - {{if 'cuCtxRecordEvent' in found_functions}} - global __cuCtxRecordEvent - __cuCtxRecordEvent = windll.GetProcAddress(handle, 'cuCtxRecordEvent') - {{endif}} - {{if 'cuCtxWaitEvent' in found_functions}} - global __cuCtxWaitEvent - __cuCtxWaitEvent = windll.GetProcAddress(handle, 'cuCtxWaitEvent') - {{endif}} - {{if 'cuCtxAttach' in found_functions}} - global __cuCtxAttach - __cuCtxAttach = windll.GetProcAddress(handle, 'cuCtxAttach') - {{endif}} - {{if 'cuCtxDetach' in found_functions}} - global __cuCtxDetach - __cuCtxDetach = windll.GetProcAddress(handle, 'cuCtxDetach') - {{endif}} - {{if 'cuCtxGetSharedMemConfig' in found_functions}} - global __cuCtxGetSharedMemConfig - __cuCtxGetSharedMemConfig = windll.GetProcAddress(handle, 'cuCtxGetSharedMemConfig') - {{endif}} - {{if 'cuCtxSetSharedMemConfig' in found_functions}} - global __cuCtxSetSharedMemConfig - __cuCtxSetSharedMemConfig = windll.GetProcAddress(handle, 'cuCtxSetSharedMemConfig') - {{endif}} - {{if 'cuModuleLoad' in found_functions}} - global __cuModuleLoad - __cuModuleLoad = windll.GetProcAddress(handle, 'cuModuleLoad') - {{endif}} - {{if 'cuModuleLoadData' in found_functions}} - global __cuModuleLoadData - __cuModuleLoadData = windll.GetProcAddress(handle, 'cuModuleLoadData') - {{endif}} - {{if 'cuModuleLoadDataEx' in found_functions}} - global __cuModuleLoadDataEx - __cuModuleLoadDataEx = windll.GetProcAddress(handle, 'cuModuleLoadDataEx') - {{endif}} - {{if 'cuModuleLoadFatBinary' in found_functions}} - global __cuModuleLoadFatBinary - __cuModuleLoadFatBinary = windll.GetProcAddress(handle, 'cuModuleLoadFatBinary') - {{endif}} - {{if 'cuModuleUnload' in found_functions}} - global __cuModuleUnload - __cuModuleUnload = windll.GetProcAddress(handle, 'cuModuleUnload') - {{endif}} - {{if 'cuModuleGetLoadingMode' in found_functions}} - global __cuModuleGetLoadingMode - __cuModuleGetLoadingMode = windll.GetProcAddress(handle, 'cuModuleGetLoadingMode') - {{endif}} - {{if 'cuModuleGetFunction' in found_functions}} - global __cuModuleGetFunction - __cuModuleGetFunction = windll.GetProcAddress(handle, 'cuModuleGetFunction') - {{endif}} - {{if 'cuModuleGetFunctionCount' in found_functions}} - global __cuModuleGetFunctionCount - __cuModuleGetFunctionCount = windll.GetProcAddress(handle, 'cuModuleGetFunctionCount') - {{endif}} - {{if 'cuModuleEnumerateFunctions' in found_functions}} - global __cuModuleEnumerateFunctions - __cuModuleEnumerateFunctions = windll.GetProcAddress(handle, 'cuModuleEnumerateFunctions') - {{endif}} - {{if 'cuModuleGetGlobal_v2' in found_functions}} - global __cuModuleGetGlobal_v2 - __cuModuleGetGlobal_v2 = windll.GetProcAddress(handle, 'cuModuleGetGlobal_v2') - {{endif}} - {{if 'cuLinkCreate_v2' in found_functions}} - global __cuLinkCreate_v2 - __cuLinkCreate_v2 = windll.GetProcAddress(handle, 'cuLinkCreate_v2') - {{endif}} - {{if 'cuLinkAddData_v2' in found_functions}} - global __cuLinkAddData_v2 - __cuLinkAddData_v2 = windll.GetProcAddress(handle, 'cuLinkAddData_v2') - {{endif}} - {{if 'cuLinkAddFile_v2' in found_functions}} - global __cuLinkAddFile_v2 - __cuLinkAddFile_v2 = windll.GetProcAddress(handle, 'cuLinkAddFile_v2') - {{endif}} - {{if 'cuLinkComplete' in found_functions}} - global __cuLinkComplete - __cuLinkComplete = windll.GetProcAddress(handle, 'cuLinkComplete') - {{endif}} - {{if 'cuLinkDestroy' in found_functions}} - global __cuLinkDestroy - __cuLinkDestroy = windll.GetProcAddress(handle, 'cuLinkDestroy') - {{endif}} - {{if 'cuModuleGetTexRef' in found_functions}} - global __cuModuleGetTexRef - __cuModuleGetTexRef = windll.GetProcAddress(handle, 'cuModuleGetTexRef') - {{endif}} - {{if 'cuModuleGetSurfRef' in found_functions}} - global __cuModuleGetSurfRef - __cuModuleGetSurfRef = windll.GetProcAddress(handle, 'cuModuleGetSurfRef') - {{endif}} - {{if 'cuLibraryLoadData' in found_functions}} - global __cuLibraryLoadData - __cuLibraryLoadData = windll.GetProcAddress(handle, 'cuLibraryLoadData') - {{endif}} - {{if 'cuLibraryLoadFromFile' in found_functions}} - global __cuLibraryLoadFromFile - __cuLibraryLoadFromFile = windll.GetProcAddress(handle, 'cuLibraryLoadFromFile') - {{endif}} - {{if 'cuLibraryUnload' in found_functions}} - global __cuLibraryUnload - __cuLibraryUnload = windll.GetProcAddress(handle, 'cuLibraryUnload') - {{endif}} - {{if 'cuLibraryGetKernel' in found_functions}} - global __cuLibraryGetKernel - __cuLibraryGetKernel = windll.GetProcAddress(handle, 'cuLibraryGetKernel') - {{endif}} - {{if 'cuLibraryGetKernelCount' in found_functions}} - global __cuLibraryGetKernelCount - __cuLibraryGetKernelCount = windll.GetProcAddress(handle, 'cuLibraryGetKernelCount') - {{endif}} - {{if 'cuLibraryEnumerateKernels' in found_functions}} - global __cuLibraryEnumerateKernels - __cuLibraryEnumerateKernels = windll.GetProcAddress(handle, 'cuLibraryEnumerateKernels') - {{endif}} - {{if 'cuLibraryGetModule' in found_functions}} - global __cuLibraryGetModule - __cuLibraryGetModule = windll.GetProcAddress(handle, 'cuLibraryGetModule') - {{endif}} - {{if 'cuKernelGetFunction' in found_functions}} - global __cuKernelGetFunction - __cuKernelGetFunction = windll.GetProcAddress(handle, 'cuKernelGetFunction') - {{endif}} - {{if 'cuKernelGetLibrary' in found_functions}} - global __cuKernelGetLibrary - __cuKernelGetLibrary = windll.GetProcAddress(handle, 'cuKernelGetLibrary') - {{endif}} - {{if 'cuLibraryGetGlobal' in found_functions}} - global __cuLibraryGetGlobal - __cuLibraryGetGlobal = windll.GetProcAddress(handle, 'cuLibraryGetGlobal') - {{endif}} - {{if 'cuLibraryGetManaged' in found_functions}} - global __cuLibraryGetManaged - __cuLibraryGetManaged = windll.GetProcAddress(handle, 'cuLibraryGetManaged') - {{endif}} - {{if 'cuLibraryGetUnifiedFunction' in found_functions}} - global __cuLibraryGetUnifiedFunction - __cuLibraryGetUnifiedFunction = windll.GetProcAddress(handle, 'cuLibraryGetUnifiedFunction') - {{endif}} - {{if 'cuKernelGetAttribute' in found_functions}} - global __cuKernelGetAttribute - __cuKernelGetAttribute = windll.GetProcAddress(handle, 'cuKernelGetAttribute') - {{endif}} - {{if 'cuKernelSetAttribute' in found_functions}} - global __cuKernelSetAttribute - __cuKernelSetAttribute = windll.GetProcAddress(handle, 'cuKernelSetAttribute') - {{endif}} - {{if 'cuKernelSetCacheConfig' in found_functions}} - global __cuKernelSetCacheConfig - __cuKernelSetCacheConfig = windll.GetProcAddress(handle, 'cuKernelSetCacheConfig') - {{endif}} - {{if 'cuKernelGetName' in found_functions}} - global __cuKernelGetName - __cuKernelGetName = windll.GetProcAddress(handle, 'cuKernelGetName') - {{endif}} - {{if 'cuKernelGetParamInfo' in found_functions}} - global __cuKernelGetParamInfo - __cuKernelGetParamInfo = windll.GetProcAddress(handle, 'cuKernelGetParamInfo') - {{endif}} - {{if 'cuKernelGetParamCount' in found_functions}} - global __cuKernelGetParamCount - __cuKernelGetParamCount = windll.GetProcAddress(handle, 'cuKernelGetParamCount') - {{endif}} - {{if 'cuMemGetInfo_v2' in found_functions}} - global __cuMemGetInfo_v2 - __cuMemGetInfo_v2 = windll.GetProcAddress(handle, 'cuMemGetInfo_v2') - {{endif}} - {{if 'cuMemAlloc_v2' in found_functions}} - global __cuMemAlloc_v2 - __cuMemAlloc_v2 = windll.GetProcAddress(handle, 'cuMemAlloc_v2') - {{endif}} - {{if 'cuMemAllocPitch_v2' in found_functions}} - global __cuMemAllocPitch_v2 - __cuMemAllocPitch_v2 = windll.GetProcAddress(handle, 'cuMemAllocPitch_v2') - {{endif}} - {{if 'cuMemFree_v2' in found_functions}} - global __cuMemFree_v2 - __cuMemFree_v2 = windll.GetProcAddress(handle, 'cuMemFree_v2') - {{endif}} - {{if 'cuMemGetAddressRange_v2' in found_functions}} - global __cuMemGetAddressRange_v2 - __cuMemGetAddressRange_v2 = windll.GetProcAddress(handle, 'cuMemGetAddressRange_v2') - {{endif}} - {{if 'cuMemAllocHost_v2' in found_functions}} - global __cuMemAllocHost_v2 - __cuMemAllocHost_v2 = windll.GetProcAddress(handle, 'cuMemAllocHost_v2') - {{endif}} - {{if 'cuMemFreeHost' in found_functions}} - global __cuMemFreeHost - __cuMemFreeHost = windll.GetProcAddress(handle, 'cuMemFreeHost') - {{endif}} - {{if 'cuMemHostAlloc' in found_functions}} - global __cuMemHostAlloc - __cuMemHostAlloc = windll.GetProcAddress(handle, 'cuMemHostAlloc') - {{endif}} - {{if 'cuMemHostGetDevicePointer_v2' in found_functions}} - global __cuMemHostGetDevicePointer_v2 - __cuMemHostGetDevicePointer_v2 = windll.GetProcAddress(handle, 'cuMemHostGetDevicePointer_v2') - {{endif}} - {{if 'cuMemHostGetFlags' in found_functions}} - global __cuMemHostGetFlags - __cuMemHostGetFlags = windll.GetProcAddress(handle, 'cuMemHostGetFlags') - {{endif}} - {{if 'cuMemAllocManaged' in found_functions}} - global __cuMemAllocManaged - __cuMemAllocManaged = windll.GetProcAddress(handle, 'cuMemAllocManaged') - {{endif}} - {{if 'cuDeviceRegisterAsyncNotification' in found_functions}} - global __cuDeviceRegisterAsyncNotification - __cuDeviceRegisterAsyncNotification = windll.GetProcAddress(handle, 'cuDeviceRegisterAsyncNotification') - {{endif}} - {{if 'cuDeviceUnregisterAsyncNotification' in found_functions}} - global __cuDeviceUnregisterAsyncNotification - __cuDeviceUnregisterAsyncNotification = windll.GetProcAddress(handle, 'cuDeviceUnregisterAsyncNotification') - {{endif}} - {{if 'cuDeviceGetByPCIBusId' in found_functions}} - global __cuDeviceGetByPCIBusId - __cuDeviceGetByPCIBusId = windll.GetProcAddress(handle, 'cuDeviceGetByPCIBusId') - {{endif}} - {{if 'cuDeviceGetPCIBusId' in found_functions}} - global __cuDeviceGetPCIBusId - __cuDeviceGetPCIBusId = windll.GetProcAddress(handle, 'cuDeviceGetPCIBusId') - {{endif}} - {{if 'cuIpcGetEventHandle' in found_functions}} - global __cuIpcGetEventHandle - __cuIpcGetEventHandle = windll.GetProcAddress(handle, 'cuIpcGetEventHandle') - {{endif}} - {{if 'cuIpcOpenEventHandle' in found_functions}} - global __cuIpcOpenEventHandle - __cuIpcOpenEventHandle = windll.GetProcAddress(handle, 'cuIpcOpenEventHandle') - {{endif}} - {{if 'cuIpcGetMemHandle' in found_functions}} - global __cuIpcGetMemHandle - __cuIpcGetMemHandle = windll.GetProcAddress(handle, 'cuIpcGetMemHandle') - {{endif}} - {{if 'cuIpcOpenMemHandle_v2' in found_functions}} - global __cuIpcOpenMemHandle_v2 - __cuIpcOpenMemHandle_v2 = windll.GetProcAddress(handle, 'cuIpcOpenMemHandle_v2') - {{endif}} - {{if 'cuIpcCloseMemHandle' in found_functions}} - global __cuIpcCloseMemHandle - __cuIpcCloseMemHandle = windll.GetProcAddress(handle, 'cuIpcCloseMemHandle') - {{endif}} - {{if 'cuMemHostRegister_v2' in found_functions}} - global __cuMemHostRegister_v2 - __cuMemHostRegister_v2 = windll.GetProcAddress(handle, 'cuMemHostRegister_v2') - {{endif}} - {{if 'cuMemHostUnregister' in found_functions}} - global __cuMemHostUnregister - __cuMemHostUnregister = windll.GetProcAddress(handle, 'cuMemHostUnregister') - {{endif}} - {{if 'cuArrayCreate_v2' in found_functions}} - global __cuArrayCreate_v2 - __cuArrayCreate_v2 = windll.GetProcAddress(handle, 'cuArrayCreate_v2') - {{endif}} - {{if 'cuArrayGetDescriptor_v2' in found_functions}} - global __cuArrayGetDescriptor_v2 - __cuArrayGetDescriptor_v2 = windll.GetProcAddress(handle, 'cuArrayGetDescriptor_v2') - {{endif}} - {{if 'cuArrayGetSparseProperties' in found_functions}} - global __cuArrayGetSparseProperties - __cuArrayGetSparseProperties = windll.GetProcAddress(handle, 'cuArrayGetSparseProperties') - {{endif}} - {{if 'cuMipmappedArrayGetSparseProperties' in found_functions}} - global __cuMipmappedArrayGetSparseProperties - __cuMipmappedArrayGetSparseProperties = windll.GetProcAddress(handle, 'cuMipmappedArrayGetSparseProperties') - {{endif}} - {{if 'cuArrayGetMemoryRequirements' in found_functions}} - global __cuArrayGetMemoryRequirements - __cuArrayGetMemoryRequirements = windll.GetProcAddress(handle, 'cuArrayGetMemoryRequirements') - {{endif}} - {{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}} - global __cuMipmappedArrayGetMemoryRequirements - __cuMipmappedArrayGetMemoryRequirements = windll.GetProcAddress(handle, 'cuMipmappedArrayGetMemoryRequirements') - {{endif}} - {{if 'cuArrayGetPlane' in found_functions}} - global __cuArrayGetPlane - __cuArrayGetPlane = windll.GetProcAddress(handle, 'cuArrayGetPlane') - {{endif}} - {{if 'cuArrayDestroy' in found_functions}} - global __cuArrayDestroy - __cuArrayDestroy = windll.GetProcAddress(handle, 'cuArrayDestroy') - {{endif}} - {{if 'cuArray3DCreate_v2' in found_functions}} - global __cuArray3DCreate_v2 - __cuArray3DCreate_v2 = windll.GetProcAddress(handle, 'cuArray3DCreate_v2') - {{endif}} - {{if 'cuArray3DGetDescriptor_v2' in found_functions}} - global __cuArray3DGetDescriptor_v2 - __cuArray3DGetDescriptor_v2 = windll.GetProcAddress(handle, 'cuArray3DGetDescriptor_v2') - {{endif}} - {{if 'cuMipmappedArrayCreate' in found_functions}} - global __cuMipmappedArrayCreate - __cuMipmappedArrayCreate = windll.GetProcAddress(handle, 'cuMipmappedArrayCreate') - {{endif}} - {{if 'cuMipmappedArrayGetLevel' in found_functions}} - global __cuMipmappedArrayGetLevel - __cuMipmappedArrayGetLevel = windll.GetProcAddress(handle, 'cuMipmappedArrayGetLevel') - {{endif}} - {{if 'cuMipmappedArrayDestroy' in found_functions}} - global __cuMipmappedArrayDestroy - __cuMipmappedArrayDestroy = windll.GetProcAddress(handle, 'cuMipmappedArrayDestroy') - {{endif}} - {{if 'cuMemGetHandleForAddressRange' in found_functions}} - global __cuMemGetHandleForAddressRange - __cuMemGetHandleForAddressRange = windll.GetProcAddress(handle, 'cuMemGetHandleForAddressRange') - {{endif}} - {{if 'cuMemAddressReserve' in found_functions}} - global __cuMemAddressReserve - __cuMemAddressReserve = windll.GetProcAddress(handle, 'cuMemAddressReserve') - {{endif}} - {{if 'cuMemAddressFree' in found_functions}} - global __cuMemAddressFree - __cuMemAddressFree = windll.GetProcAddress(handle, 'cuMemAddressFree') - {{endif}} - {{if 'cuMemCreate' in found_functions}} - global __cuMemCreate - __cuMemCreate = windll.GetProcAddress(handle, 'cuMemCreate') - {{endif}} - {{if 'cuMemRelease' in found_functions}} - global __cuMemRelease - __cuMemRelease = windll.GetProcAddress(handle, 'cuMemRelease') - {{endif}} - {{if 'cuMemMap' in found_functions}} - global __cuMemMap - __cuMemMap = windll.GetProcAddress(handle, 'cuMemMap') - {{endif}} - {{if 'cuMemUnmap' in found_functions}} - global __cuMemUnmap - __cuMemUnmap = windll.GetProcAddress(handle, 'cuMemUnmap') - {{endif}} - {{if 'cuMemSetAccess' in found_functions}} - global __cuMemSetAccess - __cuMemSetAccess = windll.GetProcAddress(handle, 'cuMemSetAccess') - {{endif}} - {{if 'cuMemGetAccess' in found_functions}} - global __cuMemGetAccess - __cuMemGetAccess = windll.GetProcAddress(handle, 'cuMemGetAccess') - {{endif}} - {{if 'cuMemExportToShareableHandle' in found_functions}} - global __cuMemExportToShareableHandle - __cuMemExportToShareableHandle = windll.GetProcAddress(handle, 'cuMemExportToShareableHandle') - {{endif}} - {{if 'cuMemImportFromShareableHandle' in found_functions}} - global __cuMemImportFromShareableHandle - __cuMemImportFromShareableHandle = windll.GetProcAddress(handle, 'cuMemImportFromShareableHandle') - {{endif}} - {{if 'cuMemGetAllocationGranularity' in found_functions}} - global __cuMemGetAllocationGranularity - __cuMemGetAllocationGranularity = windll.GetProcAddress(handle, 'cuMemGetAllocationGranularity') - {{endif}} - {{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}} - global __cuMemGetAllocationPropertiesFromHandle - __cuMemGetAllocationPropertiesFromHandle = windll.GetProcAddress(handle, 'cuMemGetAllocationPropertiesFromHandle') - {{endif}} - {{if 'cuMemRetainAllocationHandle' in found_functions}} - global __cuMemRetainAllocationHandle - __cuMemRetainAllocationHandle = windll.GetProcAddress(handle, 'cuMemRetainAllocationHandle') - {{endif}} - {{if 'cuMemPoolTrimTo' in found_functions}} - global __cuMemPoolTrimTo - __cuMemPoolTrimTo = windll.GetProcAddress(handle, 'cuMemPoolTrimTo') - {{endif}} - {{if 'cuMemPoolSetAttribute' in found_functions}} - global __cuMemPoolSetAttribute - __cuMemPoolSetAttribute = windll.GetProcAddress(handle, 'cuMemPoolSetAttribute') - {{endif}} - {{if 'cuMemPoolGetAttribute' in found_functions}} - global __cuMemPoolGetAttribute - __cuMemPoolGetAttribute = windll.GetProcAddress(handle, 'cuMemPoolGetAttribute') - {{endif}} - {{if 'cuMemPoolSetAccess' in found_functions}} - global __cuMemPoolSetAccess - __cuMemPoolSetAccess = windll.GetProcAddress(handle, 'cuMemPoolSetAccess') - {{endif}} - {{if 'cuMemPoolGetAccess' in found_functions}} - global __cuMemPoolGetAccess - __cuMemPoolGetAccess = windll.GetProcAddress(handle, 'cuMemPoolGetAccess') - {{endif}} - {{if 'cuMemPoolCreate' in found_functions}} - global __cuMemPoolCreate - __cuMemPoolCreate = windll.GetProcAddress(handle, 'cuMemPoolCreate') - {{endif}} - {{if 'cuMemPoolDestroy' in found_functions}} - global __cuMemPoolDestroy - __cuMemPoolDestroy = windll.GetProcAddress(handle, 'cuMemPoolDestroy') - {{endif}} - {{if 'cuMemGetDefaultMemPool' in found_functions}} - global __cuMemGetDefaultMemPool - __cuMemGetDefaultMemPool = windll.GetProcAddress(handle, 'cuMemGetDefaultMemPool') - {{endif}} - {{if 'cuMemGetMemPool' in found_functions}} - global __cuMemGetMemPool - __cuMemGetMemPool = windll.GetProcAddress(handle, 'cuMemGetMemPool') - {{endif}} - {{if 'cuMemSetMemPool' in found_functions}} - global __cuMemSetMemPool - __cuMemSetMemPool = windll.GetProcAddress(handle, 'cuMemSetMemPool') - {{endif}} - {{if 'cuMemPoolExportToShareableHandle' in found_functions}} - global __cuMemPoolExportToShareableHandle - __cuMemPoolExportToShareableHandle = windll.GetProcAddress(handle, 'cuMemPoolExportToShareableHandle') - {{endif}} - {{if 'cuMemPoolImportFromShareableHandle' in found_functions}} - global __cuMemPoolImportFromShareableHandle - __cuMemPoolImportFromShareableHandle = windll.GetProcAddress(handle, 'cuMemPoolImportFromShareableHandle') - {{endif}} - {{if 'cuMemPoolExportPointer' in found_functions}} - global __cuMemPoolExportPointer - __cuMemPoolExportPointer = windll.GetProcAddress(handle, 'cuMemPoolExportPointer') - {{endif}} - {{if 'cuMemPoolImportPointer' in found_functions}} - global __cuMemPoolImportPointer - __cuMemPoolImportPointer = windll.GetProcAddress(handle, 'cuMemPoolImportPointer') - {{endif}} - {{if 'cuMulticastCreate' in found_functions}} - global __cuMulticastCreate - __cuMulticastCreate = windll.GetProcAddress(handle, 'cuMulticastCreate') - {{endif}} - {{if 'cuMulticastAddDevice' in found_functions}} - global __cuMulticastAddDevice - __cuMulticastAddDevice = windll.GetProcAddress(handle, 'cuMulticastAddDevice') - {{endif}} - {{if 'cuMulticastBindMem' in found_functions}} - global __cuMulticastBindMem - __cuMulticastBindMem = windll.GetProcAddress(handle, 'cuMulticastBindMem') - {{endif}} - {{if 'cuMulticastBindMem_v2' in found_functions}} - global __cuMulticastBindMem_v2 - __cuMulticastBindMem_v2 = windll.GetProcAddress(handle, 'cuMulticastBindMem_v2') - {{endif}} - {{if 'cuMulticastBindAddr' in found_functions}} - global __cuMulticastBindAddr - __cuMulticastBindAddr = windll.GetProcAddress(handle, 'cuMulticastBindAddr') - {{endif}} - {{if 'cuMulticastBindAddr_v2' in found_functions}} - global __cuMulticastBindAddr_v2 - __cuMulticastBindAddr_v2 = windll.GetProcAddress(handle, 'cuMulticastBindAddr_v2') - {{endif}} - {{if 'cuMulticastUnbind' in found_functions}} - global __cuMulticastUnbind - __cuMulticastUnbind = windll.GetProcAddress(handle, 'cuMulticastUnbind') - {{endif}} - {{if 'cuMulticastGetGranularity' in found_functions}} - global __cuMulticastGetGranularity - __cuMulticastGetGranularity = windll.GetProcAddress(handle, 'cuMulticastGetGranularity') - {{endif}} - {{if 'cuPointerGetAttribute' in found_functions}} - global __cuPointerGetAttribute - __cuPointerGetAttribute = windll.GetProcAddress(handle, 'cuPointerGetAttribute') - {{endif}} - {{if 'cuMemAdvise_v2' in found_functions}} - global __cuMemAdvise_v2 - __cuMemAdvise_v2 = windll.GetProcAddress(handle, 'cuMemAdvise_v2') - {{endif}} - {{if 'cuMemRangeGetAttribute' in found_functions}} - global __cuMemRangeGetAttribute - __cuMemRangeGetAttribute = windll.GetProcAddress(handle, 'cuMemRangeGetAttribute') - {{endif}} - {{if 'cuMemRangeGetAttributes' in found_functions}} - global __cuMemRangeGetAttributes - __cuMemRangeGetAttributes = windll.GetProcAddress(handle, 'cuMemRangeGetAttributes') - {{endif}} - {{if 'cuPointerSetAttribute' in found_functions}} - global __cuPointerSetAttribute - __cuPointerSetAttribute = windll.GetProcAddress(handle, 'cuPointerSetAttribute') - {{endif}} - {{if 'cuPointerGetAttributes' in found_functions}} - global __cuPointerGetAttributes - __cuPointerGetAttributes = windll.GetProcAddress(handle, 'cuPointerGetAttributes') - {{endif}} - {{if 'cuStreamCreate' in found_functions}} - global __cuStreamCreate - __cuStreamCreate = windll.GetProcAddress(handle, 'cuStreamCreate') - {{endif}} - {{if 'cuStreamCreateWithPriority' in found_functions}} - global __cuStreamCreateWithPriority - __cuStreamCreateWithPriority = windll.GetProcAddress(handle, 'cuStreamCreateWithPriority') - {{endif}} - {{if 'cuThreadExchangeStreamCaptureMode' in found_functions}} - global __cuThreadExchangeStreamCaptureMode - __cuThreadExchangeStreamCaptureMode = windll.GetProcAddress(handle, 'cuThreadExchangeStreamCaptureMode') - {{endif}} - {{if 'cuStreamDestroy_v2' in found_functions}} - global __cuStreamDestroy_v2 - __cuStreamDestroy_v2 = windll.GetProcAddress(handle, 'cuStreamDestroy_v2') - {{endif}} - {{if 'cuEventCreate' in found_functions}} - global __cuEventCreate - __cuEventCreate = windll.GetProcAddress(handle, 'cuEventCreate') - {{endif}} - {{if 'cuEventQuery' in found_functions}} - global __cuEventQuery - __cuEventQuery = windll.GetProcAddress(handle, 'cuEventQuery') - {{endif}} - {{if 'cuEventSynchronize' in found_functions}} - global __cuEventSynchronize - __cuEventSynchronize = windll.GetProcAddress(handle, 'cuEventSynchronize') - {{endif}} - {{if 'cuEventDestroy_v2' in found_functions}} - global __cuEventDestroy_v2 - __cuEventDestroy_v2 = windll.GetProcAddress(handle, 'cuEventDestroy_v2') - {{endif}} - {{if 'cuEventElapsedTime_v2' in found_functions}} - global __cuEventElapsedTime_v2 - __cuEventElapsedTime_v2 = windll.GetProcAddress(handle, 'cuEventElapsedTime_v2') - {{endif}} - {{if 'cuImportExternalMemory' in found_functions}} - global __cuImportExternalMemory - __cuImportExternalMemory = windll.GetProcAddress(handle, 'cuImportExternalMemory') - {{endif}} - {{if 'cuExternalMemoryGetMappedBuffer' in found_functions}} - global __cuExternalMemoryGetMappedBuffer - __cuExternalMemoryGetMappedBuffer = windll.GetProcAddress(handle, 'cuExternalMemoryGetMappedBuffer') - {{endif}} - {{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}} - global __cuExternalMemoryGetMappedMipmappedArray - __cuExternalMemoryGetMappedMipmappedArray = windll.GetProcAddress(handle, 'cuExternalMemoryGetMappedMipmappedArray') - {{endif}} - {{if 'cuDestroyExternalMemory' in found_functions}} - global __cuDestroyExternalMemory - __cuDestroyExternalMemory = windll.GetProcAddress(handle, 'cuDestroyExternalMemory') - {{endif}} - {{if 'cuImportExternalSemaphore' in found_functions}} - global __cuImportExternalSemaphore - __cuImportExternalSemaphore = windll.GetProcAddress(handle, 'cuImportExternalSemaphore') - {{endif}} - {{if 'cuDestroyExternalSemaphore' in found_functions}} - global __cuDestroyExternalSemaphore - __cuDestroyExternalSemaphore = windll.GetProcAddress(handle, 'cuDestroyExternalSemaphore') - {{endif}} - {{if 'cuFuncGetAttribute' in found_functions}} - global __cuFuncGetAttribute - __cuFuncGetAttribute = windll.GetProcAddress(handle, 'cuFuncGetAttribute') - {{endif}} - {{if 'cuFuncSetAttribute' in found_functions}} - global __cuFuncSetAttribute - __cuFuncSetAttribute = windll.GetProcAddress(handle, 'cuFuncSetAttribute') - {{endif}} - {{if 'cuFuncSetCacheConfig' in found_functions}} - global __cuFuncSetCacheConfig - __cuFuncSetCacheConfig = windll.GetProcAddress(handle, 'cuFuncSetCacheConfig') - {{endif}} - {{if 'cuFuncGetModule' in found_functions}} - global __cuFuncGetModule - __cuFuncGetModule = windll.GetProcAddress(handle, 'cuFuncGetModule') - {{endif}} - {{if 'cuFuncGetName' in found_functions}} - global __cuFuncGetName - __cuFuncGetName = windll.GetProcAddress(handle, 'cuFuncGetName') - {{endif}} - {{if 'cuFuncGetParamInfo' in found_functions}} - global __cuFuncGetParamInfo - __cuFuncGetParamInfo = windll.GetProcAddress(handle, 'cuFuncGetParamInfo') - {{endif}} - {{if 'cuFuncGetParamCount' in found_functions}} - global __cuFuncGetParamCount - __cuFuncGetParamCount = windll.GetProcAddress(handle, 'cuFuncGetParamCount') - {{endif}} - {{if 'cuFuncIsLoaded' in found_functions}} - global __cuFuncIsLoaded - __cuFuncIsLoaded = windll.GetProcAddress(handle, 'cuFuncIsLoaded') - {{endif}} - {{if 'cuFuncLoad' in found_functions}} - global __cuFuncLoad - __cuFuncLoad = windll.GetProcAddress(handle, 'cuFuncLoad') - {{endif}} - {{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}} - global __cuLaunchCooperativeKernelMultiDevice - __cuLaunchCooperativeKernelMultiDevice = windll.GetProcAddress(handle, 'cuLaunchCooperativeKernelMultiDevice') - {{endif}} - {{if 'cuFuncSetBlockShape' in found_functions}} - global __cuFuncSetBlockShape - __cuFuncSetBlockShape = windll.GetProcAddress(handle, 'cuFuncSetBlockShape') - {{endif}} - {{if 'cuFuncSetSharedSize' in found_functions}} - global __cuFuncSetSharedSize - __cuFuncSetSharedSize = windll.GetProcAddress(handle, 'cuFuncSetSharedSize') - {{endif}} - {{if 'cuParamSetSize' in found_functions}} - global __cuParamSetSize - __cuParamSetSize = windll.GetProcAddress(handle, 'cuParamSetSize') - {{endif}} - {{if 'cuParamSeti' in found_functions}} - global __cuParamSeti - __cuParamSeti = windll.GetProcAddress(handle, 'cuParamSeti') - {{endif}} - {{if 'cuParamSetf' in found_functions}} - global __cuParamSetf - __cuParamSetf = windll.GetProcAddress(handle, 'cuParamSetf') - {{endif}} - {{if 'cuParamSetv' in found_functions}} - global __cuParamSetv - __cuParamSetv = windll.GetProcAddress(handle, 'cuParamSetv') - {{endif}} - {{if 'cuLaunch' in found_functions}} - global __cuLaunch - __cuLaunch = windll.GetProcAddress(handle, 'cuLaunch') - {{endif}} - {{if 'cuLaunchGrid' in found_functions}} - global __cuLaunchGrid - __cuLaunchGrid = windll.GetProcAddress(handle, 'cuLaunchGrid') - {{endif}} - {{if 'cuLaunchGridAsync' in found_functions}} - global __cuLaunchGridAsync - __cuLaunchGridAsync = windll.GetProcAddress(handle, 'cuLaunchGridAsync') - {{endif}} - {{if 'cuParamSetTexRef' in found_functions}} - global __cuParamSetTexRef - __cuParamSetTexRef = windll.GetProcAddress(handle, 'cuParamSetTexRef') - {{endif}} - {{if 'cuFuncSetSharedMemConfig' in found_functions}} - global __cuFuncSetSharedMemConfig - __cuFuncSetSharedMemConfig = windll.GetProcAddress(handle, 'cuFuncSetSharedMemConfig') - {{endif}} - {{if 'cuGraphCreate' in found_functions}} - global __cuGraphCreate - __cuGraphCreate = windll.GetProcAddress(handle, 'cuGraphCreate') - {{endif}} - {{if 'cuGraphAddKernelNode_v2' in found_functions}} - global __cuGraphAddKernelNode_v2 - __cuGraphAddKernelNode_v2 = windll.GetProcAddress(handle, 'cuGraphAddKernelNode_v2') - {{endif}} - {{if 'cuGraphKernelNodeGetParams_v2' in found_functions}} - global __cuGraphKernelNodeGetParams_v2 - __cuGraphKernelNodeGetParams_v2 = windll.GetProcAddress(handle, 'cuGraphKernelNodeGetParams_v2') - {{endif}} - {{if 'cuGraphKernelNodeSetParams_v2' in found_functions}} - global __cuGraphKernelNodeSetParams_v2 - __cuGraphKernelNodeSetParams_v2 = windll.GetProcAddress(handle, 'cuGraphKernelNodeSetParams_v2') - {{endif}} - {{if 'cuGraphAddMemcpyNode' in found_functions}} - global __cuGraphAddMemcpyNode - __cuGraphAddMemcpyNode = windll.GetProcAddress(handle, 'cuGraphAddMemcpyNode') - {{endif}} - {{if 'cuGraphMemcpyNodeGetParams' in found_functions}} - global __cuGraphMemcpyNodeGetParams - __cuGraphMemcpyNodeGetParams = windll.GetProcAddress(handle, 'cuGraphMemcpyNodeGetParams') - {{endif}} - {{if 'cuGraphMemcpyNodeSetParams' in found_functions}} - global __cuGraphMemcpyNodeSetParams - __cuGraphMemcpyNodeSetParams = windll.GetProcAddress(handle, 'cuGraphMemcpyNodeSetParams') - {{endif}} - {{if 'cuGraphAddMemsetNode' in found_functions}} - global __cuGraphAddMemsetNode - __cuGraphAddMemsetNode = windll.GetProcAddress(handle, 'cuGraphAddMemsetNode') - {{endif}} - {{if 'cuGraphMemsetNodeGetParams' in found_functions}} - global __cuGraphMemsetNodeGetParams - __cuGraphMemsetNodeGetParams = windll.GetProcAddress(handle, 'cuGraphMemsetNodeGetParams') - {{endif}} - {{if 'cuGraphMemsetNodeSetParams' in found_functions}} - global __cuGraphMemsetNodeSetParams - __cuGraphMemsetNodeSetParams = windll.GetProcAddress(handle, 'cuGraphMemsetNodeSetParams') - {{endif}} - {{if 'cuGraphAddHostNode' in found_functions}} - global __cuGraphAddHostNode - __cuGraphAddHostNode = windll.GetProcAddress(handle, 'cuGraphAddHostNode') - {{endif}} - {{if 'cuGraphHostNodeGetParams' in found_functions}} - global __cuGraphHostNodeGetParams - __cuGraphHostNodeGetParams = windll.GetProcAddress(handle, 'cuGraphHostNodeGetParams') - {{endif}} - {{if 'cuGraphHostNodeSetParams' in found_functions}} - global __cuGraphHostNodeSetParams - __cuGraphHostNodeSetParams = windll.GetProcAddress(handle, 'cuGraphHostNodeSetParams') - {{endif}} - {{if 'cuGraphAddChildGraphNode' in found_functions}} - global __cuGraphAddChildGraphNode - __cuGraphAddChildGraphNode = windll.GetProcAddress(handle, 'cuGraphAddChildGraphNode') - {{endif}} - {{if 'cuGraphChildGraphNodeGetGraph' in found_functions}} - global __cuGraphChildGraphNodeGetGraph - __cuGraphChildGraphNodeGetGraph = windll.GetProcAddress(handle, 'cuGraphChildGraphNodeGetGraph') - {{endif}} - {{if 'cuGraphAddEmptyNode' in found_functions}} - global __cuGraphAddEmptyNode - __cuGraphAddEmptyNode = windll.GetProcAddress(handle, 'cuGraphAddEmptyNode') - {{endif}} - {{if 'cuGraphAddEventRecordNode' in found_functions}} - global __cuGraphAddEventRecordNode - __cuGraphAddEventRecordNode = windll.GetProcAddress(handle, 'cuGraphAddEventRecordNode') - {{endif}} - {{if 'cuGraphEventRecordNodeGetEvent' in found_functions}} - global __cuGraphEventRecordNodeGetEvent - __cuGraphEventRecordNodeGetEvent = windll.GetProcAddress(handle, 'cuGraphEventRecordNodeGetEvent') - {{endif}} - {{if 'cuGraphEventRecordNodeSetEvent' in found_functions}} - global __cuGraphEventRecordNodeSetEvent - __cuGraphEventRecordNodeSetEvent = windll.GetProcAddress(handle, 'cuGraphEventRecordNodeSetEvent') - {{endif}} - {{if 'cuGraphAddEventWaitNode' in found_functions}} - global __cuGraphAddEventWaitNode - __cuGraphAddEventWaitNode = windll.GetProcAddress(handle, 'cuGraphAddEventWaitNode') - {{endif}} - {{if 'cuGraphEventWaitNodeGetEvent' in found_functions}} - global __cuGraphEventWaitNodeGetEvent - __cuGraphEventWaitNodeGetEvent = windll.GetProcAddress(handle, 'cuGraphEventWaitNodeGetEvent') - {{endif}} - {{if 'cuGraphEventWaitNodeSetEvent' in found_functions}} - global __cuGraphEventWaitNodeSetEvent - __cuGraphEventWaitNodeSetEvent = windll.GetProcAddress(handle, 'cuGraphEventWaitNodeSetEvent') - {{endif}} - {{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}} - global __cuGraphAddExternalSemaphoresSignalNode - __cuGraphAddExternalSemaphoresSignalNode = windll.GetProcAddress(handle, 'cuGraphAddExternalSemaphoresSignalNode') - {{endif}} - {{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} - global __cuGraphExternalSemaphoresSignalNodeGetParams - __cuGraphExternalSemaphoresSignalNodeGetParams = windll.GetProcAddress(handle, 'cuGraphExternalSemaphoresSignalNodeGetParams') - {{endif}} - {{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} - global __cuGraphExternalSemaphoresSignalNodeSetParams - __cuGraphExternalSemaphoresSignalNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExternalSemaphoresSignalNodeSetParams') - {{endif}} - {{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}} - global __cuGraphAddExternalSemaphoresWaitNode - __cuGraphAddExternalSemaphoresWaitNode = windll.GetProcAddress(handle, 'cuGraphAddExternalSemaphoresWaitNode') - {{endif}} - {{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} - global __cuGraphExternalSemaphoresWaitNodeGetParams - __cuGraphExternalSemaphoresWaitNodeGetParams = windll.GetProcAddress(handle, 'cuGraphExternalSemaphoresWaitNodeGetParams') - {{endif}} - {{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} - global __cuGraphExternalSemaphoresWaitNodeSetParams - __cuGraphExternalSemaphoresWaitNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExternalSemaphoresWaitNodeSetParams') - {{endif}} - {{if 'cuGraphAddBatchMemOpNode' in found_functions}} - global __cuGraphAddBatchMemOpNode - __cuGraphAddBatchMemOpNode = windll.GetProcAddress(handle, 'cuGraphAddBatchMemOpNode') - {{endif}} - {{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}} - global __cuGraphBatchMemOpNodeGetParams - __cuGraphBatchMemOpNodeGetParams = windll.GetProcAddress(handle, 'cuGraphBatchMemOpNodeGetParams') - {{endif}} - {{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}} - global __cuGraphBatchMemOpNodeSetParams - __cuGraphBatchMemOpNodeSetParams = windll.GetProcAddress(handle, 'cuGraphBatchMemOpNodeSetParams') - {{endif}} - {{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}} - global __cuGraphExecBatchMemOpNodeSetParams - __cuGraphExecBatchMemOpNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecBatchMemOpNodeSetParams') - {{endif}} - {{if 'cuGraphAddMemAllocNode' in found_functions}} - global __cuGraphAddMemAllocNode - __cuGraphAddMemAllocNode = windll.GetProcAddress(handle, 'cuGraphAddMemAllocNode') - {{endif}} - {{if 'cuGraphMemAllocNodeGetParams' in found_functions}} - global __cuGraphMemAllocNodeGetParams - __cuGraphMemAllocNodeGetParams = windll.GetProcAddress(handle, 'cuGraphMemAllocNodeGetParams') - {{endif}} - {{if 'cuGraphAddMemFreeNode' in found_functions}} - global __cuGraphAddMemFreeNode - __cuGraphAddMemFreeNode = windll.GetProcAddress(handle, 'cuGraphAddMemFreeNode') - {{endif}} - {{if 'cuGraphMemFreeNodeGetParams' in found_functions}} - global __cuGraphMemFreeNodeGetParams - __cuGraphMemFreeNodeGetParams = windll.GetProcAddress(handle, 'cuGraphMemFreeNodeGetParams') - {{endif}} - {{if 'cuDeviceGraphMemTrim' in found_functions}} - global __cuDeviceGraphMemTrim - __cuDeviceGraphMemTrim = windll.GetProcAddress(handle, 'cuDeviceGraphMemTrim') - {{endif}} - {{if 'cuDeviceGetGraphMemAttribute' in found_functions}} - global __cuDeviceGetGraphMemAttribute - __cuDeviceGetGraphMemAttribute = windll.GetProcAddress(handle, 'cuDeviceGetGraphMemAttribute') - {{endif}} - {{if 'cuDeviceSetGraphMemAttribute' in found_functions}} - global __cuDeviceSetGraphMemAttribute - __cuDeviceSetGraphMemAttribute = windll.GetProcAddress(handle, 'cuDeviceSetGraphMemAttribute') - {{endif}} - {{if 'cuGraphClone' in found_functions}} - global __cuGraphClone - __cuGraphClone = windll.GetProcAddress(handle, 'cuGraphClone') - {{endif}} - {{if 'cuGraphNodeFindInClone' in found_functions}} - global __cuGraphNodeFindInClone - __cuGraphNodeFindInClone = windll.GetProcAddress(handle, 'cuGraphNodeFindInClone') - {{endif}} - {{if 'cuGraphNodeGetType' in found_functions}} - global __cuGraphNodeGetType - __cuGraphNodeGetType = windll.GetProcAddress(handle, 'cuGraphNodeGetType') - {{endif}} - {{if 'cuGraphNodeGetContainingGraph' in found_functions}} - global __cuGraphNodeGetContainingGraph - __cuGraphNodeGetContainingGraph = windll.GetProcAddress(handle, 'cuGraphNodeGetContainingGraph') - {{endif}} - {{if 'cuGraphNodeGetLocalId' in found_functions}} - global __cuGraphNodeGetLocalId - __cuGraphNodeGetLocalId = windll.GetProcAddress(handle, 'cuGraphNodeGetLocalId') - {{endif}} - {{if 'cuGraphNodeGetToolsId' in found_functions}} - global __cuGraphNodeGetToolsId - __cuGraphNodeGetToolsId = windll.GetProcAddress(handle, 'cuGraphNodeGetToolsId') - {{endif}} - {{if 'cuGraphGetId' in found_functions}} - global __cuGraphGetId - __cuGraphGetId = windll.GetProcAddress(handle, 'cuGraphGetId') - {{endif}} - {{if 'cuGraphExecGetId' in found_functions}} - global __cuGraphExecGetId - __cuGraphExecGetId = windll.GetProcAddress(handle, 'cuGraphExecGetId') - {{endif}} - {{if 'cuGraphGetNodes' in found_functions}} - global __cuGraphGetNodes - __cuGraphGetNodes = windll.GetProcAddress(handle, 'cuGraphGetNodes') - {{endif}} - {{if 'cuGraphGetRootNodes' in found_functions}} - global __cuGraphGetRootNodes - __cuGraphGetRootNodes = windll.GetProcAddress(handle, 'cuGraphGetRootNodes') - {{endif}} - {{if 'cuGraphGetEdges_v2' in found_functions}} - global __cuGraphGetEdges_v2 - __cuGraphGetEdges_v2 = windll.GetProcAddress(handle, 'cuGraphGetEdges_v2') - {{endif}} - {{if 'cuGraphNodeGetDependencies_v2' in found_functions}} - global __cuGraphNodeGetDependencies_v2 - __cuGraphNodeGetDependencies_v2 = windll.GetProcAddress(handle, 'cuGraphNodeGetDependencies_v2') - {{endif}} - {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} - global __cuGraphNodeGetDependentNodes_v2 - __cuGraphNodeGetDependentNodes_v2 = windll.GetProcAddress(handle, 'cuGraphNodeGetDependentNodes_v2') - {{endif}} - {{if 'cuGraphAddDependencies_v2' in found_functions}} - global __cuGraphAddDependencies_v2 - __cuGraphAddDependencies_v2 = windll.GetProcAddress(handle, 'cuGraphAddDependencies_v2') - {{endif}} - {{if 'cuGraphRemoveDependencies_v2' in found_functions}} - global __cuGraphRemoveDependencies_v2 - __cuGraphRemoveDependencies_v2 = windll.GetProcAddress(handle, 'cuGraphRemoveDependencies_v2') - {{endif}} - {{if 'cuGraphDestroyNode' in found_functions}} - global __cuGraphDestroyNode - __cuGraphDestroyNode = windll.GetProcAddress(handle, 'cuGraphDestroyNode') - {{endif}} - {{if 'cuGraphInstantiateWithFlags' in found_functions}} - global __cuGraphInstantiateWithFlags - __cuGraphInstantiateWithFlags = windll.GetProcAddress(handle, 'cuGraphInstantiateWithFlags') - {{endif}} - {{if 'cuGraphExecGetFlags' in found_functions}} - global __cuGraphExecGetFlags - __cuGraphExecGetFlags = windll.GetProcAddress(handle, 'cuGraphExecGetFlags') - {{endif}} - {{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}} - global __cuGraphExecKernelNodeSetParams_v2 - __cuGraphExecKernelNodeSetParams_v2 = windll.GetProcAddress(handle, 'cuGraphExecKernelNodeSetParams_v2') - {{endif}} - {{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}} - global __cuGraphExecMemcpyNodeSetParams - __cuGraphExecMemcpyNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecMemcpyNodeSetParams') - {{endif}} - {{if 'cuGraphExecMemsetNodeSetParams' in found_functions}} - global __cuGraphExecMemsetNodeSetParams - __cuGraphExecMemsetNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecMemsetNodeSetParams') - {{endif}} - {{if 'cuGraphExecHostNodeSetParams' in found_functions}} - global __cuGraphExecHostNodeSetParams - __cuGraphExecHostNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecHostNodeSetParams') - {{endif}} - {{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}} - global __cuGraphExecChildGraphNodeSetParams - __cuGraphExecChildGraphNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecChildGraphNodeSetParams') - {{endif}} - {{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}} - global __cuGraphExecEventRecordNodeSetEvent - __cuGraphExecEventRecordNodeSetEvent = windll.GetProcAddress(handle, 'cuGraphExecEventRecordNodeSetEvent') - {{endif}} - {{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}} - global __cuGraphExecEventWaitNodeSetEvent - __cuGraphExecEventWaitNodeSetEvent = windll.GetProcAddress(handle, 'cuGraphExecEventWaitNodeSetEvent') - {{endif}} - {{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} - global __cuGraphExecExternalSemaphoresSignalNodeSetParams - __cuGraphExecExternalSemaphoresSignalNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecExternalSemaphoresSignalNodeSetParams') - {{endif}} - {{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} - global __cuGraphExecExternalSemaphoresWaitNodeSetParams - __cuGraphExecExternalSemaphoresWaitNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecExternalSemaphoresWaitNodeSetParams') - {{endif}} - {{if 'cuGraphNodeSetEnabled' in found_functions}} - global __cuGraphNodeSetEnabled - __cuGraphNodeSetEnabled = windll.GetProcAddress(handle, 'cuGraphNodeSetEnabled') - {{endif}} - {{if 'cuGraphNodeGetEnabled' in found_functions}} - global __cuGraphNodeGetEnabled - __cuGraphNodeGetEnabled = windll.GetProcAddress(handle, 'cuGraphNodeGetEnabled') - {{endif}} - {{if 'cuGraphExecDestroy' in found_functions}} - global __cuGraphExecDestroy - __cuGraphExecDestroy = windll.GetProcAddress(handle, 'cuGraphExecDestroy') - {{endif}} - {{if 'cuGraphDestroy' in found_functions}} - global __cuGraphDestroy - __cuGraphDestroy = windll.GetProcAddress(handle, 'cuGraphDestroy') - {{endif}} - {{if 'cuGraphExecUpdate_v2' in found_functions}} - global __cuGraphExecUpdate_v2 - __cuGraphExecUpdate_v2 = windll.GetProcAddress(handle, 'cuGraphExecUpdate_v2') - {{endif}} - {{if 'cuGraphKernelNodeCopyAttributes' in found_functions}} - global __cuGraphKernelNodeCopyAttributes - __cuGraphKernelNodeCopyAttributes = windll.GetProcAddress(handle, 'cuGraphKernelNodeCopyAttributes') - {{endif}} - {{if 'cuGraphKernelNodeGetAttribute' in found_functions}} - global __cuGraphKernelNodeGetAttribute - __cuGraphKernelNodeGetAttribute = windll.GetProcAddress(handle, 'cuGraphKernelNodeGetAttribute') - {{endif}} - {{if 'cuGraphKernelNodeSetAttribute' in found_functions}} - global __cuGraphKernelNodeSetAttribute - __cuGraphKernelNodeSetAttribute = windll.GetProcAddress(handle, 'cuGraphKernelNodeSetAttribute') - {{endif}} - {{if 'cuGraphDebugDotPrint' in found_functions}} - global __cuGraphDebugDotPrint - __cuGraphDebugDotPrint = windll.GetProcAddress(handle, 'cuGraphDebugDotPrint') - {{endif}} - {{if 'cuUserObjectCreate' in found_functions}} - global __cuUserObjectCreate - __cuUserObjectCreate = windll.GetProcAddress(handle, 'cuUserObjectCreate') - {{endif}} - {{if 'cuUserObjectRetain' in found_functions}} - global __cuUserObjectRetain - __cuUserObjectRetain = windll.GetProcAddress(handle, 'cuUserObjectRetain') - {{endif}} - {{if 'cuUserObjectRelease' in found_functions}} - global __cuUserObjectRelease - __cuUserObjectRelease = windll.GetProcAddress(handle, 'cuUserObjectRelease') - {{endif}} - {{if 'cuGraphRetainUserObject' in found_functions}} - global __cuGraphRetainUserObject - __cuGraphRetainUserObject = windll.GetProcAddress(handle, 'cuGraphRetainUserObject') - {{endif}} - {{if 'cuGraphReleaseUserObject' in found_functions}} - global __cuGraphReleaseUserObject - __cuGraphReleaseUserObject = windll.GetProcAddress(handle, 'cuGraphReleaseUserObject') - {{endif}} - {{if 'cuGraphAddNode_v2' in found_functions}} - global __cuGraphAddNode_v2 - __cuGraphAddNode_v2 = windll.GetProcAddress(handle, 'cuGraphAddNode_v2') - {{endif}} - {{if 'cuGraphNodeSetParams' in found_functions}} - global __cuGraphNodeSetParams - __cuGraphNodeSetParams = windll.GetProcAddress(handle, 'cuGraphNodeSetParams') - {{endif}} - {{if 'cuGraphNodeGetParams' in found_functions}} - global __cuGraphNodeGetParams - __cuGraphNodeGetParams = windll.GetProcAddress(handle, 'cuGraphNodeGetParams') - {{endif}} - {{if 'cuGraphExecNodeSetParams' in found_functions}} - global __cuGraphExecNodeSetParams - __cuGraphExecNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecNodeSetParams') - {{endif}} - {{if 'cuGraphConditionalHandleCreate' in found_functions}} - global __cuGraphConditionalHandleCreate - __cuGraphConditionalHandleCreate = windll.GetProcAddress(handle, 'cuGraphConditionalHandleCreate') - {{endif}} - {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} - global __cuOccupancyMaxActiveBlocksPerMultiprocessor - __cuOccupancyMaxActiveBlocksPerMultiprocessor = windll.GetProcAddress(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessor') - {{endif}} - {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} - global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags - __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags = windll.GetProcAddress(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags') - {{endif}} - {{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}} - global __cuOccupancyMaxPotentialBlockSize - __cuOccupancyMaxPotentialBlockSize = windll.GetProcAddress(handle, 'cuOccupancyMaxPotentialBlockSize') - {{endif}} - {{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}} - global __cuOccupancyMaxPotentialBlockSizeWithFlags - __cuOccupancyMaxPotentialBlockSizeWithFlags = windll.GetProcAddress(handle, 'cuOccupancyMaxPotentialBlockSizeWithFlags') - {{endif}} - {{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}} - global __cuOccupancyAvailableDynamicSMemPerBlock - __cuOccupancyAvailableDynamicSMemPerBlock = windll.GetProcAddress(handle, 'cuOccupancyAvailableDynamicSMemPerBlock') - {{endif}} - {{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}} - global __cuOccupancyMaxPotentialClusterSize - __cuOccupancyMaxPotentialClusterSize = windll.GetProcAddress(handle, 'cuOccupancyMaxPotentialClusterSize') - {{endif}} - {{if 'cuOccupancyMaxActiveClusters' in found_functions}} - global __cuOccupancyMaxActiveClusters - __cuOccupancyMaxActiveClusters = windll.GetProcAddress(handle, 'cuOccupancyMaxActiveClusters') - {{endif}} - {{if 'cuTexRefSetArray' in found_functions}} - global __cuTexRefSetArray - __cuTexRefSetArray = windll.GetProcAddress(handle, 'cuTexRefSetArray') - {{endif}} - {{if 'cuTexRefSetMipmappedArray' in found_functions}} - global __cuTexRefSetMipmappedArray - __cuTexRefSetMipmappedArray = windll.GetProcAddress(handle, 'cuTexRefSetMipmappedArray') - {{endif}} - {{if 'cuTexRefSetAddress_v2' in found_functions}} - global __cuTexRefSetAddress_v2 - __cuTexRefSetAddress_v2 = windll.GetProcAddress(handle, 'cuTexRefSetAddress_v2') - {{endif}} - {{if 'cuTexRefSetAddress2D_v3' in found_functions}} - global __cuTexRefSetAddress2D_v3 - __cuTexRefSetAddress2D_v3 = windll.GetProcAddress(handle, 'cuTexRefSetAddress2D_v3') - {{endif}} - {{if 'cuTexRefSetFormat' in found_functions}} - global __cuTexRefSetFormat - __cuTexRefSetFormat = windll.GetProcAddress(handle, 'cuTexRefSetFormat') - {{endif}} - {{if 'cuTexRefSetAddressMode' in found_functions}} - global __cuTexRefSetAddressMode - __cuTexRefSetAddressMode = windll.GetProcAddress(handle, 'cuTexRefSetAddressMode') - {{endif}} - {{if 'cuTexRefSetFilterMode' in found_functions}} - global __cuTexRefSetFilterMode - __cuTexRefSetFilterMode = windll.GetProcAddress(handle, 'cuTexRefSetFilterMode') - {{endif}} - {{if 'cuTexRefSetMipmapFilterMode' in found_functions}} - global __cuTexRefSetMipmapFilterMode - __cuTexRefSetMipmapFilterMode = windll.GetProcAddress(handle, 'cuTexRefSetMipmapFilterMode') - {{endif}} - {{if 'cuTexRefSetMipmapLevelBias' in found_functions}} - global __cuTexRefSetMipmapLevelBias - __cuTexRefSetMipmapLevelBias = windll.GetProcAddress(handle, 'cuTexRefSetMipmapLevelBias') - {{endif}} - {{if 'cuTexRefSetMipmapLevelClamp' in found_functions}} - global __cuTexRefSetMipmapLevelClamp - __cuTexRefSetMipmapLevelClamp = windll.GetProcAddress(handle, 'cuTexRefSetMipmapLevelClamp') - {{endif}} - {{if 'cuTexRefSetMaxAnisotropy' in found_functions}} - global __cuTexRefSetMaxAnisotropy - __cuTexRefSetMaxAnisotropy = windll.GetProcAddress(handle, 'cuTexRefSetMaxAnisotropy') - {{endif}} - {{if 'cuTexRefSetBorderColor' in found_functions}} - global __cuTexRefSetBorderColor - __cuTexRefSetBorderColor = windll.GetProcAddress(handle, 'cuTexRefSetBorderColor') - {{endif}} - {{if 'cuTexRefSetFlags' in found_functions}} - global __cuTexRefSetFlags - __cuTexRefSetFlags = windll.GetProcAddress(handle, 'cuTexRefSetFlags') - {{endif}} - {{if 'cuTexRefGetAddress_v2' in found_functions}} - global __cuTexRefGetAddress_v2 - __cuTexRefGetAddress_v2 = windll.GetProcAddress(handle, 'cuTexRefGetAddress_v2') - {{endif}} - {{if 'cuTexRefGetArray' in found_functions}} - global __cuTexRefGetArray - __cuTexRefGetArray = windll.GetProcAddress(handle, 'cuTexRefGetArray') - {{endif}} - {{if 'cuTexRefGetMipmappedArray' in found_functions}} - global __cuTexRefGetMipmappedArray - __cuTexRefGetMipmappedArray = windll.GetProcAddress(handle, 'cuTexRefGetMipmappedArray') - {{endif}} - {{if 'cuTexRefGetAddressMode' in found_functions}} - global __cuTexRefGetAddressMode - __cuTexRefGetAddressMode = windll.GetProcAddress(handle, 'cuTexRefGetAddressMode') - {{endif}} - {{if 'cuTexRefGetFilterMode' in found_functions}} - global __cuTexRefGetFilterMode - __cuTexRefGetFilterMode = windll.GetProcAddress(handle, 'cuTexRefGetFilterMode') - {{endif}} - {{if 'cuTexRefGetFormat' in found_functions}} - global __cuTexRefGetFormat - __cuTexRefGetFormat = windll.GetProcAddress(handle, 'cuTexRefGetFormat') - {{endif}} - {{if 'cuTexRefGetMipmapFilterMode' in found_functions}} - global __cuTexRefGetMipmapFilterMode - __cuTexRefGetMipmapFilterMode = windll.GetProcAddress(handle, 'cuTexRefGetMipmapFilterMode') - {{endif}} - {{if 'cuTexRefGetMipmapLevelBias' in found_functions}} - global __cuTexRefGetMipmapLevelBias - __cuTexRefGetMipmapLevelBias = windll.GetProcAddress(handle, 'cuTexRefGetMipmapLevelBias') - {{endif}} - {{if 'cuTexRefGetMipmapLevelClamp' in found_functions}} - global __cuTexRefGetMipmapLevelClamp - __cuTexRefGetMipmapLevelClamp = windll.GetProcAddress(handle, 'cuTexRefGetMipmapLevelClamp') - {{endif}} - {{if 'cuTexRefGetMaxAnisotropy' in found_functions}} - global __cuTexRefGetMaxAnisotropy - __cuTexRefGetMaxAnisotropy = windll.GetProcAddress(handle, 'cuTexRefGetMaxAnisotropy') - {{endif}} - {{if 'cuTexRefGetBorderColor' in found_functions}} - global __cuTexRefGetBorderColor - __cuTexRefGetBorderColor = windll.GetProcAddress(handle, 'cuTexRefGetBorderColor') - {{endif}} - {{if 'cuTexRefGetFlags' in found_functions}} - global __cuTexRefGetFlags - __cuTexRefGetFlags = windll.GetProcAddress(handle, 'cuTexRefGetFlags') - {{endif}} - {{if 'cuTexRefCreate' in found_functions}} - global __cuTexRefCreate - __cuTexRefCreate = windll.GetProcAddress(handle, 'cuTexRefCreate') - {{endif}} - {{if 'cuTexRefDestroy' in found_functions}} - global __cuTexRefDestroy - __cuTexRefDestroy = windll.GetProcAddress(handle, 'cuTexRefDestroy') - {{endif}} - {{if 'cuSurfRefSetArray' in found_functions}} - global __cuSurfRefSetArray - __cuSurfRefSetArray = windll.GetProcAddress(handle, 'cuSurfRefSetArray') - {{endif}} - {{if 'cuSurfRefGetArray' in found_functions}} - global __cuSurfRefGetArray - __cuSurfRefGetArray = windll.GetProcAddress(handle, 'cuSurfRefGetArray') - {{endif}} - {{if 'cuTexObjectCreate' in found_functions}} - global __cuTexObjectCreate - __cuTexObjectCreate = windll.GetProcAddress(handle, 'cuTexObjectCreate') - {{endif}} - {{if 'cuTexObjectDestroy' in found_functions}} - global __cuTexObjectDestroy - __cuTexObjectDestroy = windll.GetProcAddress(handle, 'cuTexObjectDestroy') - {{endif}} - {{if 'cuTexObjectGetResourceDesc' in found_functions}} - global __cuTexObjectGetResourceDesc - __cuTexObjectGetResourceDesc = windll.GetProcAddress(handle, 'cuTexObjectGetResourceDesc') - {{endif}} - {{if 'cuTexObjectGetTextureDesc' in found_functions}} - global __cuTexObjectGetTextureDesc - __cuTexObjectGetTextureDesc = windll.GetProcAddress(handle, 'cuTexObjectGetTextureDesc') - {{endif}} - {{if 'cuTexObjectGetResourceViewDesc' in found_functions}} - global __cuTexObjectGetResourceViewDesc - __cuTexObjectGetResourceViewDesc = windll.GetProcAddress(handle, 'cuTexObjectGetResourceViewDesc') - {{endif}} - {{if 'cuSurfObjectCreate' in found_functions}} - global __cuSurfObjectCreate - __cuSurfObjectCreate = windll.GetProcAddress(handle, 'cuSurfObjectCreate') - {{endif}} - {{if 'cuSurfObjectDestroy' in found_functions}} - global __cuSurfObjectDestroy - __cuSurfObjectDestroy = windll.GetProcAddress(handle, 'cuSurfObjectDestroy') - {{endif}} - {{if 'cuSurfObjectGetResourceDesc' in found_functions}} - global __cuSurfObjectGetResourceDesc - __cuSurfObjectGetResourceDesc = windll.GetProcAddress(handle, 'cuSurfObjectGetResourceDesc') - {{endif}} - {{if 'cuTensorMapEncodeTiled' in found_functions}} - global __cuTensorMapEncodeTiled - __cuTensorMapEncodeTiled = windll.GetProcAddress(handle, 'cuTensorMapEncodeTiled') - {{endif}} - {{if 'cuTensorMapEncodeIm2col' in found_functions}} - global __cuTensorMapEncodeIm2col - __cuTensorMapEncodeIm2col = windll.GetProcAddress(handle, 'cuTensorMapEncodeIm2col') - {{endif}} - {{if 'cuTensorMapEncodeIm2colWide' in found_functions}} - global __cuTensorMapEncodeIm2colWide - __cuTensorMapEncodeIm2colWide = windll.GetProcAddress(handle, 'cuTensorMapEncodeIm2colWide') - {{endif}} - {{if 'cuTensorMapReplaceAddress' in found_functions}} - global __cuTensorMapReplaceAddress - __cuTensorMapReplaceAddress = windll.GetProcAddress(handle, 'cuTensorMapReplaceAddress') - {{endif}} - {{if 'cuDeviceCanAccessPeer' in found_functions}} - global __cuDeviceCanAccessPeer - __cuDeviceCanAccessPeer = windll.GetProcAddress(handle, 'cuDeviceCanAccessPeer') - {{endif}} - {{if 'cuCtxEnablePeerAccess' in found_functions}} - global __cuCtxEnablePeerAccess - __cuCtxEnablePeerAccess = windll.GetProcAddress(handle, 'cuCtxEnablePeerAccess') - {{endif}} - {{if 'cuCtxDisablePeerAccess' in found_functions}} - global __cuCtxDisablePeerAccess - __cuCtxDisablePeerAccess = windll.GetProcAddress(handle, 'cuCtxDisablePeerAccess') - {{endif}} - {{if 'cuDeviceGetP2PAttribute' in found_functions}} - global __cuDeviceGetP2PAttribute - __cuDeviceGetP2PAttribute = windll.GetProcAddress(handle, 'cuDeviceGetP2PAttribute') - {{endif}} - {{if 'cuDeviceGetP2PAtomicCapabilities' in found_functions}} - global __cuDeviceGetP2PAtomicCapabilities - __cuDeviceGetP2PAtomicCapabilities = windll.GetProcAddress(handle, 'cuDeviceGetP2PAtomicCapabilities') - {{endif}} - {{if 'cuGraphicsUnregisterResource' in found_functions}} - global __cuGraphicsUnregisterResource - __cuGraphicsUnregisterResource = windll.GetProcAddress(handle, 'cuGraphicsUnregisterResource') - {{endif}} - {{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}} - global __cuGraphicsSubResourceGetMappedArray - __cuGraphicsSubResourceGetMappedArray = windll.GetProcAddress(handle, 'cuGraphicsSubResourceGetMappedArray') - {{endif}} - {{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}} - global __cuGraphicsResourceGetMappedMipmappedArray - __cuGraphicsResourceGetMappedMipmappedArray = windll.GetProcAddress(handle, 'cuGraphicsResourceGetMappedMipmappedArray') - {{endif}} - {{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}} - global __cuGraphicsResourceGetMappedPointer_v2 - __cuGraphicsResourceGetMappedPointer_v2 = windll.GetProcAddress(handle, 'cuGraphicsResourceGetMappedPointer_v2') - {{endif}} - {{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}} - global __cuGraphicsResourceSetMapFlags_v2 - __cuGraphicsResourceSetMapFlags_v2 = windll.GetProcAddress(handle, 'cuGraphicsResourceSetMapFlags_v2') - {{endif}} - {{if 'cuGetProcAddress_v2' in found_functions}} - global __cuGetProcAddress_v2 - __cuGetProcAddress_v2 = windll.GetProcAddress(handle, 'cuGetProcAddress_v2') - {{endif}} - {{if 'cuCoredumpGetAttribute' in found_functions}} - global __cuCoredumpGetAttribute - __cuCoredumpGetAttribute = windll.GetProcAddress(handle, 'cuCoredumpGetAttribute') - {{endif}} - {{if 'cuCoredumpGetAttributeGlobal' in found_functions}} - global __cuCoredumpGetAttributeGlobal - __cuCoredumpGetAttributeGlobal = windll.GetProcAddress(handle, 'cuCoredumpGetAttributeGlobal') - {{endif}} - {{if 'cuCoredumpSetAttribute' in found_functions}} - global __cuCoredumpSetAttribute - __cuCoredumpSetAttribute = windll.GetProcAddress(handle, 'cuCoredumpSetAttribute') - {{endif}} - {{if 'cuCoredumpSetAttributeGlobal' in found_functions}} - global __cuCoredumpSetAttributeGlobal - __cuCoredumpSetAttributeGlobal = windll.GetProcAddress(handle, 'cuCoredumpSetAttributeGlobal') - {{endif}} - {{if 'cuCoredumpRegisterStartCallback' in found_functions}} - global __cuCoredumpRegisterStartCallback - __cuCoredumpRegisterStartCallback = windll.GetProcAddress(handle, 'cuCoredumpRegisterStartCallback') - {{endif}} - {{if 'cuCoredumpRegisterCompleteCallback' in found_functions}} - global __cuCoredumpRegisterCompleteCallback - __cuCoredumpRegisterCompleteCallback = windll.GetProcAddress(handle, 'cuCoredumpRegisterCompleteCallback') - {{endif}} - {{if 'cuCoredumpDeregisterStartCallback' in found_functions}} - global __cuCoredumpDeregisterStartCallback - __cuCoredumpDeregisterStartCallback = windll.GetProcAddress(handle, 'cuCoredumpDeregisterStartCallback') - {{endif}} - {{if 'cuCoredumpDeregisterCompleteCallback' in found_functions}} - global __cuCoredumpDeregisterCompleteCallback - __cuCoredumpDeregisterCompleteCallback = windll.GetProcAddress(handle, 'cuCoredumpDeregisterCompleteCallback') - {{endif}} - {{if 'cuGetExportTable' in found_functions}} - global __cuGetExportTable - __cuGetExportTable = windll.GetProcAddress(handle, 'cuGetExportTable') - {{endif}} - {{if 'cuGreenCtxCreate' in found_functions}} - global __cuGreenCtxCreate - __cuGreenCtxCreate = windll.GetProcAddress(handle, 'cuGreenCtxCreate') - {{endif}} - {{if 'cuGreenCtxDestroy' in found_functions}} - global __cuGreenCtxDestroy - __cuGreenCtxDestroy = windll.GetProcAddress(handle, 'cuGreenCtxDestroy') - {{endif}} - {{if 'cuCtxFromGreenCtx' in found_functions}} - global __cuCtxFromGreenCtx - __cuCtxFromGreenCtx = windll.GetProcAddress(handle, 'cuCtxFromGreenCtx') - {{endif}} - {{if 'cuDeviceGetDevResource' in found_functions}} - global __cuDeviceGetDevResource - __cuDeviceGetDevResource = windll.GetProcAddress(handle, 'cuDeviceGetDevResource') - {{endif}} - {{if 'cuCtxGetDevResource' in found_functions}} - global __cuCtxGetDevResource - __cuCtxGetDevResource = windll.GetProcAddress(handle, 'cuCtxGetDevResource') - {{endif}} - {{if 'cuGreenCtxGetDevResource' in found_functions}} - global __cuGreenCtxGetDevResource - __cuGreenCtxGetDevResource = windll.GetProcAddress(handle, 'cuGreenCtxGetDevResource') - {{endif}} - {{if 'cuDevSmResourceSplitByCount' in found_functions}} - global __cuDevSmResourceSplitByCount - __cuDevSmResourceSplitByCount = windll.GetProcAddress(handle, 'cuDevSmResourceSplitByCount') - {{endif}} - {{if 'cuDevSmResourceSplit' in found_functions}} - global __cuDevSmResourceSplit - __cuDevSmResourceSplit = windll.GetProcAddress(handle, 'cuDevSmResourceSplit') - {{endif}} - {{if 'cuDevResourceGenerateDesc' in found_functions}} - global __cuDevResourceGenerateDesc - __cuDevResourceGenerateDesc = windll.GetProcAddress(handle, 'cuDevResourceGenerateDesc') - {{endif}} - {{if 'cuGreenCtxRecordEvent' in found_functions}} - global __cuGreenCtxRecordEvent - __cuGreenCtxRecordEvent = windll.GetProcAddress(handle, 'cuGreenCtxRecordEvent') - {{endif}} - {{if 'cuGreenCtxWaitEvent' in found_functions}} - global __cuGreenCtxWaitEvent - __cuGreenCtxWaitEvent = windll.GetProcAddress(handle, 'cuGreenCtxWaitEvent') - {{endif}} - {{if 'cuStreamGetGreenCtx' in found_functions}} - global __cuStreamGetGreenCtx - __cuStreamGetGreenCtx = windll.GetProcAddress(handle, 'cuStreamGetGreenCtx') - {{endif}} - {{if 'cuGreenCtxStreamCreate' in found_functions}} - global __cuGreenCtxStreamCreate - __cuGreenCtxStreamCreate = windll.GetProcAddress(handle, 'cuGreenCtxStreamCreate') - {{endif}} - {{if 'cuGreenCtxGetId' in found_functions}} - global __cuGreenCtxGetId - __cuGreenCtxGetId = windll.GetProcAddress(handle, 'cuGreenCtxGetId') - {{endif}} - {{if 'cuLogsRegisterCallback' in found_functions}} - global __cuLogsRegisterCallback - __cuLogsRegisterCallback = windll.GetProcAddress(handle, 'cuLogsRegisterCallback') - {{endif}} - {{if 'cuLogsUnregisterCallback' in found_functions}} - global __cuLogsUnregisterCallback - __cuLogsUnregisterCallback = windll.GetProcAddress(handle, 'cuLogsUnregisterCallback') - {{endif}} - {{if 'cuLogsCurrent' in found_functions}} - global __cuLogsCurrent - __cuLogsCurrent = windll.GetProcAddress(handle, 'cuLogsCurrent') - {{endif}} - {{if 'cuLogsDumpToFile' in found_functions}} - global __cuLogsDumpToFile - __cuLogsDumpToFile = windll.GetProcAddress(handle, 'cuLogsDumpToFile') - {{endif}} - {{if 'cuLogsDumpToMemory' in found_functions}} - global __cuLogsDumpToMemory - __cuLogsDumpToMemory = windll.GetProcAddress(handle, 'cuLogsDumpToMemory') - {{endif}} - {{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}} - global __cuCheckpointProcessGetRestoreThreadId - __cuCheckpointProcessGetRestoreThreadId = windll.GetProcAddress(handle, 'cuCheckpointProcessGetRestoreThreadId') - {{endif}} - {{if 'cuCheckpointProcessGetState' in found_functions}} - global __cuCheckpointProcessGetState - __cuCheckpointProcessGetState = windll.GetProcAddress(handle, 'cuCheckpointProcessGetState') - {{endif}} - {{if 'cuCheckpointProcessLock' in found_functions}} - global __cuCheckpointProcessLock - __cuCheckpointProcessLock = windll.GetProcAddress(handle, 'cuCheckpointProcessLock') - {{endif}} - {{if 'cuCheckpointProcessCheckpoint' in found_functions}} - 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') - {{endif}} - {{if 'cuProfilerStart' in found_functions}} - global __cuProfilerStart - __cuProfilerStart = windll.GetProcAddress(handle, 'cuProfilerStart') - {{endif}} - {{if 'cuProfilerStop' in found_functions}} - global __cuProfilerStop - __cuProfilerStop = windll.GetProcAddress(handle, 'cuProfilerStop') - {{endif}} - {{if True}} - global __cuGraphicsEGLRegisterImage - __cuGraphicsEGLRegisterImage = windll.GetProcAddress(handle, 'cuGraphicsEGLRegisterImage') - {{endif}} - {{if True}} - global __cuEGLStreamConsumerConnect - __cuEGLStreamConsumerConnect = windll.GetProcAddress(handle, 'cuEGLStreamConsumerConnect') - {{endif}} - {{if True}} - global __cuEGLStreamConsumerConnectWithFlags - __cuEGLStreamConsumerConnectWithFlags = windll.GetProcAddress(handle, 'cuEGLStreamConsumerConnectWithFlags') - {{endif}} - {{if True}} - global __cuEGLStreamConsumerDisconnect - __cuEGLStreamConsumerDisconnect = windll.GetProcAddress(handle, 'cuEGLStreamConsumerDisconnect') - {{endif}} - {{if True}} - global __cuEGLStreamConsumerAcquireFrame - __cuEGLStreamConsumerAcquireFrame = windll.GetProcAddress(handle, 'cuEGLStreamConsumerAcquireFrame') - {{endif}} - {{if True}} - global __cuEGLStreamConsumerReleaseFrame - __cuEGLStreamConsumerReleaseFrame = windll.GetProcAddress(handle, 'cuEGLStreamConsumerReleaseFrame') - {{endif}} - {{if True}} - global __cuEGLStreamProducerConnect - __cuEGLStreamProducerConnect = windll.GetProcAddress(handle, 'cuEGLStreamProducerConnect') - {{endif}} - {{if True}} - global __cuEGLStreamProducerDisconnect - __cuEGLStreamProducerDisconnect = windll.GetProcAddress(handle, 'cuEGLStreamProducerDisconnect') - {{endif}} - {{if True}} - global __cuEGLStreamProducerPresentFrame - __cuEGLStreamProducerPresentFrame = windll.GetProcAddress(handle, 'cuEGLStreamProducerPresentFrame') - {{endif}} - {{if True}} - global __cuEGLStreamProducerReturnFrame - __cuEGLStreamProducerReturnFrame = windll.GetProcAddress(handle, 'cuEGLStreamProducerReturnFrame') - {{endif}} - {{if True}} - global __cuGraphicsResourceGetMappedEglFrame - __cuGraphicsResourceGetMappedEglFrame = windll.GetProcAddress(handle, 'cuGraphicsResourceGetMappedEglFrame') - {{endif}} - {{if True}} - global __cuEventCreateFromEGLSync - __cuEventCreateFromEGLSync = windll.GetProcAddress(handle, 'cuEventCreateFromEGLSync') - {{endif}} - {{if True}} - global __cuGraphicsGLRegisterBuffer - __cuGraphicsGLRegisterBuffer = windll.GetProcAddress(handle, 'cuGraphicsGLRegisterBuffer') - {{endif}} - {{if True}} - global __cuGraphicsGLRegisterImage - __cuGraphicsGLRegisterImage = windll.GetProcAddress(handle, 'cuGraphicsGLRegisterImage') - {{endif}} - {{if True}} - global __cuGLGetDevices_v2 - __cuGLGetDevices_v2 = windll.GetProcAddress(handle, 'cuGLGetDevices_v2') - {{endif}} - {{if True}} - global __cuVDPAUGetDevice - __cuVDPAUGetDevice = windll.GetProcAddress(handle, 'cuVDPAUGetDevice') - {{endif}} - {{if True}} - global __cuVDPAUCtxCreate_v2 - __cuVDPAUCtxCreate_v2 = windll.GetProcAddress(handle, 'cuVDPAUCtxCreate_v2') - {{endif}} - {{if True}} - global __cuGraphicsVDPAURegisterVideoSurface - __cuGraphicsVDPAURegisterVideoSurface = windll.GetProcAddress(handle, 'cuGraphicsVDPAURegisterVideoSurface') - {{endif}} - {{if True}} - global __cuGraphicsVDPAURegisterOutputSurface - __cuGraphicsVDPAURegisterOutputSurface = windll.GetProcAddress(handle, 'cuGraphicsVDPAURegisterOutputSurface') - {{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 'cuMemcpyWithAttributesAsync' in found_functions}} - global __cuMemcpyWithAttributesAsync - __cuMemcpyWithAttributesAsync = dlfcn.dlsym(handle, 'cuMemcpyWithAttributesAsync_ptsz') - {{endif}} - {{if 'cuMemcpy3DWithAttributesAsync' in found_functions}} - global __cuMemcpy3DWithAttributesAsync - __cuMemcpy3DWithAttributesAsync = dlfcn.dlsym(handle, 'cuMemcpy3DWithAttributesAsync_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 'cuStreamBeginCaptureToCig' in found_functions}} - global __cuStreamBeginCaptureToCig - __cuStreamBeginCaptureToCig = dlfcn.dlsym(handle, 'cuStreamBeginCaptureToCig_ptsz') - {{endif}} - {{if 'cuStreamEndCaptureToCig' in found_functions}} - global __cuStreamEndCaptureToCig - __cuStreamEndCaptureToCig = dlfcn.dlsym(handle, 'cuStreamEndCaptureToCig_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 'cuLaunchHostFunc_v2' in found_functions}} - global __cuLaunchHostFunc_v2 - __cuLaunchHostFunc_v2 = dlfcn.dlsym(handle, 'cuLaunchHostFunc_v2_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}} - {{if 'cuStreamGetDevResource' in found_functions}} - global __cuStreamGetDevResource - __cuStreamGetDevResource = dlfcn.dlsym(handle, 'cuStreamGetDevResource_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 'cuMemcpyWithAttributesAsync' in found_functions}} - global __cuMemcpyWithAttributesAsync - __cuMemcpyWithAttributesAsync = dlfcn.dlsym(handle, 'cuMemcpyWithAttributesAsync') - {{endif}} - {{if 'cuMemcpy3DWithAttributesAsync' in found_functions}} - global __cuMemcpy3DWithAttributesAsync - __cuMemcpy3DWithAttributesAsync = dlfcn.dlsym(handle, 'cuMemcpy3DWithAttributesAsync') - {{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 'cuStreamBeginCaptureToCig' in found_functions}} - global __cuStreamBeginCaptureToCig - __cuStreamBeginCaptureToCig = dlfcn.dlsym(handle, 'cuStreamBeginCaptureToCig') - {{endif}} - {{if 'cuStreamEndCaptureToCig' in found_functions}} - global __cuStreamEndCaptureToCig - __cuStreamEndCaptureToCig = dlfcn.dlsym(handle, 'cuStreamEndCaptureToCig') - {{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 'cuLaunchHostFunc_v2' in found_functions}} - global __cuLaunchHostFunc_v2 - __cuLaunchHostFunc_v2 = dlfcn.dlsym(handle, 'cuLaunchHostFunc_v2') - {{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}} - {{if 'cuStreamGetDevResource' in found_functions}} - global __cuStreamGetDevResource - __cuStreamGetDevResource = dlfcn.dlsym(handle, 'cuStreamGetDevResource') - {{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 'cuKernelGetParamCount' in found_functions}} - global __cuKernelGetParamCount - __cuKernelGetParamCount = dlfcn.dlsym(handle, 'cuKernelGetParamCount') - {{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 'cuMulticastBindMem_v2' in found_functions}} - global __cuMulticastBindMem_v2 - __cuMulticastBindMem_v2 = dlfcn.dlsym(handle, 'cuMulticastBindMem_v2') - {{endif}} - {{if 'cuMulticastBindAddr' in found_functions}} - global __cuMulticastBindAddr - __cuMulticastBindAddr = dlfcn.dlsym(handle, 'cuMulticastBindAddr') - {{endif}} - {{if 'cuMulticastBindAddr_v2' in found_functions}} - global __cuMulticastBindAddr_v2 - __cuMulticastBindAddr_v2 = dlfcn.dlsym(handle, 'cuMulticastBindAddr_v2') - {{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 'cuFuncGetParamCount' in found_functions}} - global __cuFuncGetParamCount - __cuFuncGetParamCount = dlfcn.dlsym(handle, 'cuFuncGetParamCount') - {{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 'cuGraphNodeGetContainingGraph' in found_functions}} - global __cuGraphNodeGetContainingGraph - __cuGraphNodeGetContainingGraph = dlfcn.dlsym(handle, 'cuGraphNodeGetContainingGraph') - {{endif}} - {{if 'cuGraphNodeGetLocalId' in found_functions}} - global __cuGraphNodeGetLocalId - __cuGraphNodeGetLocalId = dlfcn.dlsym(handle, 'cuGraphNodeGetLocalId') - {{endif}} - {{if 'cuGraphNodeGetToolsId' in found_functions}} - global __cuGraphNodeGetToolsId - __cuGraphNodeGetToolsId = dlfcn.dlsym(handle, 'cuGraphNodeGetToolsId') - {{endif}} - {{if 'cuGraphGetId' in found_functions}} - global __cuGraphGetId - __cuGraphGetId = dlfcn.dlsym(handle, 'cuGraphGetId') - {{endif}} - {{if 'cuGraphExecGetId' in found_functions}} - global __cuGraphExecGetId - __cuGraphExecGetId = dlfcn.dlsym(handle, 'cuGraphExecGetId') - {{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 'cuGraphNodeGetParams' in found_functions}} - global __cuGraphNodeGetParams - __cuGraphNodeGetParams = dlfcn.dlsym(handle, 'cuGraphNodeGetParams') - {{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 'cuCoredumpRegisterStartCallback' in found_functions}} - global __cuCoredumpRegisterStartCallback - __cuCoredumpRegisterStartCallback = dlfcn.dlsym(handle, 'cuCoredumpRegisterStartCallback') - {{endif}} - {{if 'cuCoredumpRegisterCompleteCallback' in found_functions}} - global __cuCoredumpRegisterCompleteCallback - __cuCoredumpRegisterCompleteCallback = dlfcn.dlsym(handle, 'cuCoredumpRegisterCompleteCallback') - {{endif}} - {{if 'cuCoredumpDeregisterStartCallback' in found_functions}} - global __cuCoredumpDeregisterStartCallback - __cuCoredumpDeregisterStartCallback = dlfcn.dlsym(handle, 'cuCoredumpDeregisterStartCallback') - {{endif}} - {{if 'cuCoredumpDeregisterCompleteCallback' in found_functions}} - global __cuCoredumpDeregisterCompleteCallback - __cuCoredumpDeregisterCompleteCallback = dlfcn.dlsym(handle, 'cuCoredumpDeregisterCompleteCallback') - {{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 'cuDevSmResourceSplit' in found_functions}} - global __cuDevSmResourceSplit - __cuDevSmResourceSplit = dlfcn.dlsym(handle, 'cuDevSmResourceSplit') - {{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 'cuCheckpointProcessRestore' in found_functions}} - global __cuCheckpointProcessRestore - __cuCheckpointProcessRestore = dlfcn.dlsym(handle, 'cuCheckpointProcessRestore') - {{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 - -# 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: - global __cuGetErrorString - cuPythonInit() - if __cuGetErrorString == NULL: - with gil: - raise RuntimeError('Function "cuGetErrorString" not found') - err = ( __cuGetErrorString)(error, pStr) - return err -{{endif}} - -{{if 'cuGetErrorName' in found_functions}} - -cdef CUresult _cuGetErrorName(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGetErrorName - cuPythonInit() - if __cuGetErrorName == NULL: - with gil: - raise RuntimeError('Function "cuGetErrorName" not found') - err = ( __cuGetErrorName)(error, pStr) - return err -{{endif}} - -{{if 'cuInit' in found_functions}} - -cdef CUresult _cuInit(unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuInit - cuPythonInit() - if __cuInit == NULL: - with gil: - raise RuntimeError('Function "cuInit" not found') - err = ( __cuInit)(Flags) - return err -{{endif}} - -{{if 'cuDriverGetVersion' in found_functions}} - -cdef CUresult _cuDriverGetVersion(int* driverVersion) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDriverGetVersion - cuPythonInit() - if __cuDriverGetVersion == NULL: - with gil: - raise RuntimeError('Function "cuDriverGetVersion" not found') - err = ( __cuDriverGetVersion)(driverVersion) - return err -{{endif}} - -{{if 'cuDeviceGet' in found_functions}} - -cdef CUresult _cuDeviceGet(CUdevice* device, int ordinal) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDeviceGet - cuPythonInit() - if __cuDeviceGet == NULL: - with gil: - raise RuntimeError('Function "cuDeviceGet" not found') - err = ( __cuDeviceGet)(device, ordinal) - return err -{{endif}} - -{{if 'cuDeviceGetCount' in found_functions}} - -cdef CUresult _cuDeviceGetCount(int* count) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDeviceGetCount - cuPythonInit() - if __cuDeviceGetCount == NULL: - with gil: - raise RuntimeError('Function "cuDeviceGetCount" not found') - err = ( __cuDeviceGetCount)(count) - return err -{{endif}} - -{{if 'cuDeviceGetName' in found_functions}} - -cdef CUresult _cuDeviceGetName(char* name, int length, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDeviceGetName - cuPythonInit() - if __cuDeviceGetName == NULL: - with gil: - raise RuntimeError('Function "cuDeviceGetName" not found') - err = ( __cuDeviceGetName)(name, length, dev) - return err -{{endif}} - -{{if 'cuDeviceGetUuid_v2' in found_functions}} - -cdef CUresult _cuDeviceGetUuid_v2(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDeviceGetUuid_v2 - cuPythonInit() - if __cuDeviceGetUuid_v2 == NULL: - with gil: - raise RuntimeError('Function "cuDeviceGetUuid_v2" not found') - err = ( __cuDeviceGetUuid_v2)(uuid, dev) - return err -{{endif}} - -{{if 'cuDeviceGetLuid' in found_functions}} - -cdef CUresult _cuDeviceGetLuid(char* luid, unsigned int* deviceNodeMask, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDeviceGetLuid - cuPythonInit() - if __cuDeviceGetLuid == NULL: - with gil: - raise RuntimeError('Function "cuDeviceGetLuid" not found') - err = ( __cuDeviceGetLuid)(luid, deviceNodeMask, dev) - return err -{{endif}} - -{{if 'cuDeviceTotalMem_v2' in found_functions}} - -cdef CUresult _cuDeviceTotalMem_v2(size_t* numbytes, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDeviceTotalMem_v2 - cuPythonInit() - if __cuDeviceTotalMem_v2 == NULL: - with gil: - raise RuntimeError('Function "cuDeviceTotalMem_v2" not found') - err = ( __cuDeviceTotalMem_v2)(numbytes, dev) - return err -{{endif}} - -{{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}} - -cdef CUresult _cuDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, CUarray_format pformat, unsigned numChannels, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDeviceGetTexture1DLinearMaxWidth - cuPythonInit() - if __cuDeviceGetTexture1DLinearMaxWidth == NULL: - with gil: - raise RuntimeError('Function "cuDeviceGetTexture1DLinearMaxWidth" not found') - err = ( __cuDeviceGetTexture1DLinearMaxWidth)(maxWidthInElements, pformat, numChannels, dev) - return err -{{endif}} - -{{if 'cuDeviceGetAttribute' in found_functions}} - -cdef CUresult _cuDeviceGetAttribute(int* pi, CUdevice_attribute attrib, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDeviceGetAttribute - cuPythonInit() - if __cuDeviceGetAttribute == NULL: - with gil: - raise RuntimeError('Function "cuDeviceGetAttribute" not found') - err = ( __cuDeviceGetAttribute)(pi, attrib, dev) - 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: - global __cuDeviceGetNvSciSyncAttributes - cuPythonInit() - if __cuDeviceGetNvSciSyncAttributes == NULL: - with gil: - raise RuntimeError('Function "cuDeviceGetNvSciSyncAttributes" not found') - err = ( __cuDeviceGetNvSciSyncAttributes)(nvSciSyncAttrList, dev, flags) - return err -{{endif}} - -{{if 'cuDeviceSetMemPool' in found_functions}} - -cdef CUresult _cuDeviceSetMemPool(CUdevice dev, CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDeviceSetMemPool - cuPythonInit() - if __cuDeviceSetMemPool == NULL: - with gil: - raise RuntimeError('Function "cuDeviceSetMemPool" not found') - err = ( __cuDeviceSetMemPool)(dev, pool) - return err -{{endif}} - -{{if 'cuDeviceGetMemPool' in found_functions}} - -cdef CUresult _cuDeviceGetMemPool(CUmemoryPool* pool, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDeviceGetMemPool - cuPythonInit() - if __cuDeviceGetMemPool == NULL: - with gil: - raise RuntimeError('Function "cuDeviceGetMemPool" not found') - err = ( __cuDeviceGetMemPool)(pool, dev) - return err -{{endif}} - -{{if 'cuDeviceGetDefaultMemPool' in found_functions}} - -cdef CUresult _cuDeviceGetDefaultMemPool(CUmemoryPool* pool_out, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDeviceGetDefaultMemPool - cuPythonInit() - if __cuDeviceGetDefaultMemPool == NULL: - with gil: - raise RuntimeError('Function "cuDeviceGetDefaultMemPool" not found') - err = ( __cuDeviceGetDefaultMemPool)(pool_out, dev) - return err -{{endif}} - -{{if 'cuDeviceGetExecAffinitySupport' in found_functions}} - -cdef CUresult _cuDeviceGetExecAffinitySupport(int* pi, CUexecAffinityType typename, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDeviceGetExecAffinitySupport - cuPythonInit() - if __cuDeviceGetExecAffinitySupport == NULL: - with gil: - raise RuntimeError('Function "cuDeviceGetExecAffinitySupport" not found') - err = ( __cuDeviceGetExecAffinitySupport)(pi, typename, dev) - return err -{{endif}} - -{{if 'cuFlushGPUDirectRDMAWrites' in found_functions}} - -cdef CUresult _cuFlushGPUDirectRDMAWrites(CUflushGPUDirectRDMAWritesTarget target, CUflushGPUDirectRDMAWritesScope scope) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuFlushGPUDirectRDMAWrites - cuPythonInit() - if __cuFlushGPUDirectRDMAWrites == NULL: - with gil: - raise RuntimeError('Function "cuFlushGPUDirectRDMAWrites" not found') - err = ( __cuFlushGPUDirectRDMAWrites)(target, scope) - return err -{{endif}} - -{{if 'cuDeviceGetProperties' in found_functions}} - -cdef CUresult _cuDeviceGetProperties(CUdevprop* prop, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDeviceGetProperties - cuPythonInit() - if __cuDeviceGetProperties == NULL: - with gil: - raise RuntimeError('Function "cuDeviceGetProperties" not found') - err = ( __cuDeviceGetProperties)(prop, dev) - return err -{{endif}} - -{{if 'cuDeviceComputeCapability' in found_functions}} - -cdef CUresult _cuDeviceComputeCapability(int* major, int* minor, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDeviceComputeCapability - cuPythonInit() - if __cuDeviceComputeCapability == NULL: - with gil: - raise RuntimeError('Function "cuDeviceComputeCapability" not found') - err = ( __cuDeviceComputeCapability)(major, minor, dev) - return err -{{endif}} - -{{if 'cuDevicePrimaryCtxRetain' in found_functions}} - -cdef CUresult _cuDevicePrimaryCtxRetain(CUcontext* pctx, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDevicePrimaryCtxRetain - cuPythonInit() - if __cuDevicePrimaryCtxRetain == NULL: - with gil: - raise RuntimeError('Function "cuDevicePrimaryCtxRetain" not found') - err = ( __cuDevicePrimaryCtxRetain)(pctx, dev) - return err -{{endif}} - -{{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}} - -cdef CUresult _cuDevicePrimaryCtxRelease_v2(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDevicePrimaryCtxRelease_v2 - cuPythonInit() - if __cuDevicePrimaryCtxRelease_v2 == NULL: - with gil: - raise RuntimeError('Function "cuDevicePrimaryCtxRelease_v2" not found') - err = ( __cuDevicePrimaryCtxRelease_v2)(dev) - return err -{{endif}} - -{{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}} - -cdef CUresult _cuDevicePrimaryCtxSetFlags_v2(CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDevicePrimaryCtxSetFlags_v2 - cuPythonInit() - if __cuDevicePrimaryCtxSetFlags_v2 == NULL: - with gil: - raise RuntimeError('Function "cuDevicePrimaryCtxSetFlags_v2" not found') - err = ( __cuDevicePrimaryCtxSetFlags_v2)(dev, flags) - return err -{{endif}} - -{{if 'cuDevicePrimaryCtxGetState' in found_functions}} - -cdef CUresult _cuDevicePrimaryCtxGetState(CUdevice dev, unsigned int* flags, int* active) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDevicePrimaryCtxGetState - cuPythonInit() - if __cuDevicePrimaryCtxGetState == NULL: - with gil: - raise RuntimeError('Function "cuDevicePrimaryCtxGetState" not found') - err = ( __cuDevicePrimaryCtxGetState)(dev, flags, active) - return err -{{endif}} - -{{if 'cuDevicePrimaryCtxReset_v2' in found_functions}} - -cdef CUresult _cuDevicePrimaryCtxReset_v2(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDevicePrimaryCtxReset_v2 - cuPythonInit() - if __cuDevicePrimaryCtxReset_v2 == NULL: - with gil: - raise RuntimeError('Function "cuDevicePrimaryCtxReset_v2" not found') - err = ( __cuDevicePrimaryCtxReset_v2)(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: - global __cuCtxCreate_v4 - cuPythonInit() - if __cuCtxCreate_v4 == NULL: - with gil: - raise RuntimeError('Function "cuCtxCreate_v4" not found') - err = ( __cuCtxCreate_v4)(pctx, ctxCreateParams, flags, dev) - return err -{{endif}} - -{{if 'cuCtxDestroy_v2' in found_functions}} - -cdef CUresult _cuCtxDestroy_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxDestroy_v2 - cuPythonInit() - if __cuCtxDestroy_v2 == NULL: - with gil: - raise RuntimeError('Function "cuCtxDestroy_v2" not found') - err = ( __cuCtxDestroy_v2)(ctx) - return err -{{endif}} - -{{if 'cuCtxPushCurrent_v2' in found_functions}} - -cdef CUresult _cuCtxPushCurrent_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxPushCurrent_v2 - cuPythonInit() - if __cuCtxPushCurrent_v2 == NULL: - with gil: - raise RuntimeError('Function "cuCtxPushCurrent_v2" not found') - err = ( __cuCtxPushCurrent_v2)(ctx) - return err -{{endif}} - -{{if 'cuCtxPopCurrent_v2' in found_functions}} - -cdef CUresult _cuCtxPopCurrent_v2(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxPopCurrent_v2 - cuPythonInit() - if __cuCtxPopCurrent_v2 == NULL: - with gil: - raise RuntimeError('Function "cuCtxPopCurrent_v2" not found') - err = ( __cuCtxPopCurrent_v2)(pctx) - return err -{{endif}} - -{{if 'cuCtxSetCurrent' in found_functions}} - -cdef CUresult _cuCtxSetCurrent(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxSetCurrent - cuPythonInit() - if __cuCtxSetCurrent == NULL: - with gil: - raise RuntimeError('Function "cuCtxSetCurrent" not found') - err = ( __cuCtxSetCurrent)(ctx) - return err -{{endif}} - -{{if 'cuCtxGetCurrent' in found_functions}} - -cdef CUresult _cuCtxGetCurrent(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxGetCurrent - cuPythonInit() - if __cuCtxGetCurrent == NULL: - with gil: - raise RuntimeError('Function "cuCtxGetCurrent" not found') - err = ( __cuCtxGetCurrent)(pctx) - return err -{{endif}} - -{{if 'cuCtxGetDevice' in found_functions}} - -cdef CUresult _cuCtxGetDevice(CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxGetDevice - cuPythonInit() - if __cuCtxGetDevice == NULL: - with gil: - raise RuntimeError('Function "cuCtxGetDevice" not found') - err = ( __cuCtxGetDevice)(device) - 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: - global __cuCtxGetFlags - cuPythonInit() - if __cuCtxGetFlags == NULL: - with gil: - raise RuntimeError('Function "cuCtxGetFlags" not found') - err = ( __cuCtxGetFlags)(flags) - return err -{{endif}} - -{{if 'cuCtxSetFlags' in found_functions}} - -cdef CUresult _cuCtxSetFlags(unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxSetFlags - cuPythonInit() - if __cuCtxSetFlags == NULL: - with gil: - raise RuntimeError('Function "cuCtxSetFlags" not found') - err = ( __cuCtxSetFlags)(flags) - return err -{{endif}} - -{{if 'cuCtxGetId' in found_functions}} - -cdef CUresult _cuCtxGetId(CUcontext ctx, unsigned long long* ctxId) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxGetId - cuPythonInit() - if __cuCtxGetId == NULL: - with gil: - raise RuntimeError('Function "cuCtxGetId" not found') - err = ( __cuCtxGetId)(ctx, ctxId) - return err -{{endif}} - -{{if 'cuCtxSynchronize' in found_functions}} - -cdef CUresult _cuCtxSynchronize() except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxSynchronize - cuPythonInit() - if __cuCtxSynchronize == NULL: - with gil: - raise RuntimeError('Function "cuCtxSynchronize" not found') - err = ( __cuCtxSynchronize)() - 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: - global __cuCtxSetLimit - cuPythonInit() - if __cuCtxSetLimit == NULL: - with gil: - raise RuntimeError('Function "cuCtxSetLimit" not found') - err = ( __cuCtxSetLimit)(limit, value) - return err -{{endif}} - -{{if 'cuCtxGetLimit' in found_functions}} - -cdef CUresult _cuCtxGetLimit(size_t* pvalue, CUlimit limit) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxGetLimit - cuPythonInit() - if __cuCtxGetLimit == NULL: - with gil: - raise RuntimeError('Function "cuCtxGetLimit" not found') - err = ( __cuCtxGetLimit)(pvalue, limit) - return err -{{endif}} - -{{if 'cuCtxGetCacheConfig' in found_functions}} - -cdef CUresult _cuCtxGetCacheConfig(CUfunc_cache* pconfig) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxGetCacheConfig - cuPythonInit() - if __cuCtxGetCacheConfig == NULL: - with gil: - raise RuntimeError('Function "cuCtxGetCacheConfig" not found') - err = ( __cuCtxGetCacheConfig)(pconfig) - return err -{{endif}} - -{{if 'cuCtxSetCacheConfig' in found_functions}} - -cdef CUresult _cuCtxSetCacheConfig(CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxSetCacheConfig - cuPythonInit() - if __cuCtxSetCacheConfig == NULL: - with gil: - raise RuntimeError('Function "cuCtxSetCacheConfig" not found') - err = ( __cuCtxSetCacheConfig)(config) - return err -{{endif}} - -{{if 'cuCtxGetApiVersion' in found_functions}} - -cdef CUresult _cuCtxGetApiVersion(CUcontext ctx, unsigned int* version) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxGetApiVersion - cuPythonInit() - if __cuCtxGetApiVersion == NULL: - with gil: - raise RuntimeError('Function "cuCtxGetApiVersion" not found') - err = ( __cuCtxGetApiVersion)(ctx, version) - return err -{{endif}} - -{{if 'cuCtxGetStreamPriorityRange' in found_functions}} - -cdef CUresult _cuCtxGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxGetStreamPriorityRange - cuPythonInit() - if __cuCtxGetStreamPriorityRange == NULL: - with gil: - raise RuntimeError('Function "cuCtxGetStreamPriorityRange" not found') - err = ( __cuCtxGetStreamPriorityRange)(leastPriority, greatestPriority) - return err -{{endif}} - -{{if 'cuCtxResetPersistingL2Cache' in found_functions}} - -cdef CUresult _cuCtxResetPersistingL2Cache() except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxResetPersistingL2Cache - cuPythonInit() - if __cuCtxResetPersistingL2Cache == NULL: - with gil: - raise RuntimeError('Function "cuCtxResetPersistingL2Cache" not found') - err = ( __cuCtxResetPersistingL2Cache)() - return err -{{endif}} - -{{if 'cuCtxGetExecAffinity' in found_functions}} - -cdef CUresult _cuCtxGetExecAffinity(CUexecAffinityParam* pExecAffinity, CUexecAffinityType typename) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxGetExecAffinity - cuPythonInit() - if __cuCtxGetExecAffinity == NULL: - with gil: - raise RuntimeError('Function "cuCtxGetExecAffinity" not found') - err = ( __cuCtxGetExecAffinity)(pExecAffinity, typename) - return err -{{endif}} - -{{if 'cuCtxRecordEvent' in found_functions}} - -cdef CUresult _cuCtxRecordEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxRecordEvent - cuPythonInit() - if __cuCtxRecordEvent == NULL: - with gil: - raise RuntimeError('Function "cuCtxRecordEvent" not found') - err = ( __cuCtxRecordEvent)(hCtx, hEvent) - return err -{{endif}} - -{{if 'cuCtxWaitEvent' in found_functions}} - -cdef CUresult _cuCtxWaitEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxWaitEvent - cuPythonInit() - if __cuCtxWaitEvent == NULL: - with gil: - raise RuntimeError('Function "cuCtxWaitEvent" not found') - err = ( __cuCtxWaitEvent)(hCtx, hEvent) - return err -{{endif}} - -{{if 'cuCtxAttach' in found_functions}} - -cdef CUresult _cuCtxAttach(CUcontext* pctx, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxAttach - cuPythonInit() - if __cuCtxAttach == NULL: - with gil: - raise RuntimeError('Function "cuCtxAttach" not found') - err = ( __cuCtxAttach)(pctx, flags) - return err -{{endif}} - -{{if 'cuCtxDetach' in found_functions}} - -cdef CUresult _cuCtxDetach(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxDetach - cuPythonInit() - if __cuCtxDetach == NULL: - with gil: - raise RuntimeError('Function "cuCtxDetach" not found') - err = ( __cuCtxDetach)(ctx) - return err -{{endif}} - -{{if 'cuCtxGetSharedMemConfig' in found_functions}} - -cdef CUresult _cuCtxGetSharedMemConfig(CUsharedconfig* pConfig) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxGetSharedMemConfig - cuPythonInit() - if __cuCtxGetSharedMemConfig == NULL: - with gil: - raise RuntimeError('Function "cuCtxGetSharedMemConfig" not found') - err = ( __cuCtxGetSharedMemConfig)(pConfig) - return err -{{endif}} - -{{if 'cuCtxSetSharedMemConfig' in found_functions}} - -cdef CUresult _cuCtxSetSharedMemConfig(CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxSetSharedMemConfig - cuPythonInit() - if __cuCtxSetSharedMemConfig == NULL: - with gil: - raise RuntimeError('Function "cuCtxSetSharedMemConfig" not found') - err = ( __cuCtxSetSharedMemConfig)(config) - return err -{{endif}} - -{{if 'cuModuleLoad' in found_functions}} - -cdef CUresult _cuModuleLoad(CUmodule* module, const char* fname) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuModuleLoad - cuPythonInit() - if __cuModuleLoad == NULL: - with gil: - raise RuntimeError('Function "cuModuleLoad" not found') - err = ( __cuModuleLoad)(module, fname) - return err -{{endif}} - -{{if 'cuModuleLoadData' in found_functions}} - -cdef CUresult _cuModuleLoadData(CUmodule* module, const void* image) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuModuleLoadData - cuPythonInit() - if __cuModuleLoadData == NULL: - with gil: - raise RuntimeError('Function "cuModuleLoadData" not found') - err = ( __cuModuleLoadData)(module, image) - return err -{{endif}} - -{{if 'cuModuleLoadDataEx' in found_functions}} - -cdef CUresult _cuModuleLoadDataEx(CUmodule* module, const void* image, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuModuleLoadDataEx - cuPythonInit() - if __cuModuleLoadDataEx == NULL: - with gil: - raise RuntimeError('Function "cuModuleLoadDataEx" not found') - err = ( __cuModuleLoadDataEx)(module, image, numOptions, options, optionValues) - return err -{{endif}} - -{{if 'cuModuleLoadFatBinary' in found_functions}} - -cdef CUresult _cuModuleLoadFatBinary(CUmodule* module, const void* fatCubin) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuModuleLoadFatBinary - cuPythonInit() - if __cuModuleLoadFatBinary == NULL: - with gil: - raise RuntimeError('Function "cuModuleLoadFatBinary" not found') - err = ( __cuModuleLoadFatBinary)(module, fatCubin) - return err -{{endif}} - -{{if 'cuModuleUnload' in found_functions}} - -cdef CUresult _cuModuleUnload(CUmodule hmod) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuModuleUnload - cuPythonInit() - if __cuModuleUnload == NULL: - with gil: - raise RuntimeError('Function "cuModuleUnload" not found') - err = ( __cuModuleUnload)(hmod) - return err -{{endif}} - -{{if 'cuModuleGetLoadingMode' in found_functions}} - -cdef CUresult _cuModuleGetLoadingMode(CUmoduleLoadingMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuModuleGetLoadingMode - cuPythonInit() - if __cuModuleGetLoadingMode == NULL: - with gil: - raise RuntimeError('Function "cuModuleGetLoadingMode" not found') - err = ( __cuModuleGetLoadingMode)(mode) - return err -{{endif}} - -{{if 'cuModuleGetFunction' in found_functions}} - -cdef CUresult _cuModuleGetFunction(CUfunction* hfunc, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuModuleGetFunction - cuPythonInit() - if __cuModuleGetFunction == NULL: - with gil: - raise RuntimeError('Function "cuModuleGetFunction" not found') - err = ( __cuModuleGetFunction)(hfunc, hmod, name) - return err -{{endif}} - -{{if 'cuModuleGetFunctionCount' in found_functions}} - -cdef CUresult _cuModuleGetFunctionCount(unsigned int* count, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuModuleGetFunctionCount - cuPythonInit() - if __cuModuleGetFunctionCount == NULL: - with gil: - raise RuntimeError('Function "cuModuleGetFunctionCount" not found') - err = ( __cuModuleGetFunctionCount)(count, mod) - return err -{{endif}} - -{{if 'cuModuleEnumerateFunctions' in found_functions}} - -cdef CUresult _cuModuleEnumerateFunctions(CUfunction* functions, unsigned int numFunctions, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuModuleEnumerateFunctions - cuPythonInit() - if __cuModuleEnumerateFunctions == NULL: - with gil: - raise RuntimeError('Function "cuModuleEnumerateFunctions" not found') - err = ( __cuModuleEnumerateFunctions)(functions, numFunctions, mod) - return err -{{endif}} - -{{if 'cuModuleGetGlobal_v2' in found_functions}} - -cdef CUresult _cuModuleGetGlobal_v2(CUdeviceptr* dptr, size_t* numbytes, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuModuleGetGlobal_v2 - cuPythonInit() - if __cuModuleGetGlobal_v2 == NULL: - with gil: - raise RuntimeError('Function "cuModuleGetGlobal_v2" not found') - err = ( __cuModuleGetGlobal_v2)(dptr, numbytes, hmod, name) - return err -{{endif}} - -{{if 'cuLinkCreate_v2' in found_functions}} - -cdef CUresult _cuLinkCreate_v2(unsigned int numOptions, CUjit_option* options, void** optionValues, CUlinkState* stateOut) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLinkCreate_v2 - cuPythonInit() - if __cuLinkCreate_v2 == NULL: - with gil: - raise RuntimeError('Function "cuLinkCreate_v2" not found') - err = ( __cuLinkCreate_v2)(numOptions, options, optionValues, stateOut) - return err -{{endif}} - -{{if 'cuLinkAddData_v2' in found_functions}} - -cdef CUresult _cuLinkAddData_v2(CUlinkState state, CUjitInputType typename, void* data, size_t size, const char* name, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLinkAddData_v2 - cuPythonInit() - if __cuLinkAddData_v2 == NULL: - with gil: - raise RuntimeError('Function "cuLinkAddData_v2" not found') - err = ( __cuLinkAddData_v2)(state, typename, data, size, name, numOptions, options, optionValues) - return err -{{endif}} - -{{if 'cuLinkAddFile_v2' in found_functions}} - -cdef CUresult _cuLinkAddFile_v2(CUlinkState state, CUjitInputType typename, const char* path, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLinkAddFile_v2 - cuPythonInit() - if __cuLinkAddFile_v2 == NULL: - with gil: - raise RuntimeError('Function "cuLinkAddFile_v2" not found') - err = ( __cuLinkAddFile_v2)(state, typename, path, numOptions, options, optionValues) - return err -{{endif}} - -{{if 'cuLinkComplete' in found_functions}} - -cdef CUresult _cuLinkComplete(CUlinkState state, void** cubinOut, size_t* sizeOut) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLinkComplete - cuPythonInit() - if __cuLinkComplete == NULL: - with gil: - raise RuntimeError('Function "cuLinkComplete" not found') - err = ( __cuLinkComplete)(state, cubinOut, sizeOut) - return err -{{endif}} - -{{if 'cuLinkDestroy' in found_functions}} - -cdef CUresult _cuLinkDestroy(CUlinkState state) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLinkDestroy - cuPythonInit() - if __cuLinkDestroy == NULL: - with gil: - raise RuntimeError('Function "cuLinkDestroy" not found') - err = ( __cuLinkDestroy)(state) - return err -{{endif}} - -{{if 'cuModuleGetTexRef' in found_functions}} - -cdef CUresult _cuModuleGetTexRef(CUtexref* pTexRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuModuleGetTexRef - cuPythonInit() - if __cuModuleGetTexRef == NULL: - with gil: - raise RuntimeError('Function "cuModuleGetTexRef" not found') - err = ( __cuModuleGetTexRef)(pTexRef, hmod, name) - return err -{{endif}} - -{{if 'cuModuleGetSurfRef' in found_functions}} - -cdef CUresult _cuModuleGetSurfRef(CUsurfref* pSurfRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuModuleGetSurfRef - cuPythonInit() - if __cuModuleGetSurfRef == NULL: - with gil: - raise RuntimeError('Function "cuModuleGetSurfRef" not found') - err = ( __cuModuleGetSurfRef)(pSurfRef, hmod, name) - return err -{{endif}} - -{{if 'cuLibraryLoadData' in found_functions}} - -cdef CUresult _cuLibraryLoadData(CUlibrary* library, const void* code, CUjit_option* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, CUlibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLibraryLoadData - cuPythonInit() - if __cuLibraryLoadData == NULL: - with gil: - raise RuntimeError('Function "cuLibraryLoadData" not found') - err = ( __cuLibraryLoadData)(library, code, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions) - return err -{{endif}} - -{{if 'cuLibraryLoadFromFile' in found_functions}} - -cdef CUresult _cuLibraryLoadFromFile(CUlibrary* library, const char* fileName, CUjit_option* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, CUlibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLibraryLoadFromFile - cuPythonInit() - if __cuLibraryLoadFromFile == NULL: - with gil: - raise RuntimeError('Function "cuLibraryLoadFromFile" not found') - err = ( __cuLibraryLoadFromFile)(library, fileName, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions) - return err -{{endif}} - -{{if 'cuLibraryUnload' in found_functions}} - -cdef CUresult _cuLibraryUnload(CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLibraryUnload - cuPythonInit() - if __cuLibraryUnload == NULL: - with gil: - raise RuntimeError('Function "cuLibraryUnload" not found') - err = ( __cuLibraryUnload)(library) - return err -{{endif}} - -{{if 'cuLibraryGetKernel' in found_functions}} - -cdef CUresult _cuLibraryGetKernel(CUkernel* pKernel, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLibraryGetKernel - cuPythonInit() - if __cuLibraryGetKernel == NULL: - with gil: - raise RuntimeError('Function "cuLibraryGetKernel" not found') - err = ( __cuLibraryGetKernel)(pKernel, library, name) - return err -{{endif}} - -{{if 'cuLibraryGetKernelCount' in found_functions}} - -cdef CUresult _cuLibraryGetKernelCount(unsigned int* count, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLibraryGetKernelCount - cuPythonInit() - if __cuLibraryGetKernelCount == NULL: - with gil: - raise RuntimeError('Function "cuLibraryGetKernelCount" not found') - err = ( __cuLibraryGetKernelCount)(count, lib) - return err -{{endif}} - -{{if 'cuLibraryEnumerateKernels' in found_functions}} - -cdef CUresult _cuLibraryEnumerateKernels(CUkernel* kernels, unsigned int numKernels, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLibraryEnumerateKernels - cuPythonInit() - if __cuLibraryEnumerateKernels == NULL: - with gil: - raise RuntimeError('Function "cuLibraryEnumerateKernels" not found') - err = ( __cuLibraryEnumerateKernels)(kernels, numKernels, lib) - return err -{{endif}} - -{{if 'cuLibraryGetModule' in found_functions}} - -cdef CUresult _cuLibraryGetModule(CUmodule* pMod, CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLibraryGetModule - cuPythonInit() - if __cuLibraryGetModule == NULL: - with gil: - raise RuntimeError('Function "cuLibraryGetModule" not found') - err = ( __cuLibraryGetModule)(pMod, library) - return err -{{endif}} - -{{if 'cuKernelGetFunction' in found_functions}} - -cdef CUresult _cuKernelGetFunction(CUfunction* pFunc, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuKernelGetFunction - cuPythonInit() - if __cuKernelGetFunction == NULL: - with gil: - raise RuntimeError('Function "cuKernelGetFunction" not found') - err = ( __cuKernelGetFunction)(pFunc, kernel) - return err -{{endif}} - -{{if 'cuKernelGetLibrary' in found_functions}} - -cdef CUresult _cuKernelGetLibrary(CUlibrary* pLib, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuKernelGetLibrary - cuPythonInit() - if __cuKernelGetLibrary == NULL: - with gil: - raise RuntimeError('Function "cuKernelGetLibrary" not found') - err = ( __cuKernelGetLibrary)(pLib, kernel) - return err -{{endif}} - -{{if 'cuLibraryGetGlobal' in found_functions}} - -cdef CUresult _cuLibraryGetGlobal(CUdeviceptr* dptr, size_t* numbytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLibraryGetGlobal - cuPythonInit() - if __cuLibraryGetGlobal == NULL: - with gil: - raise RuntimeError('Function "cuLibraryGetGlobal" not found') - err = ( __cuLibraryGetGlobal)(dptr, numbytes, library, name) - return err -{{endif}} - -{{if 'cuLibraryGetManaged' in found_functions}} - -cdef CUresult _cuLibraryGetManaged(CUdeviceptr* dptr, size_t* numbytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLibraryGetManaged - cuPythonInit() - if __cuLibraryGetManaged == NULL: - with gil: - raise RuntimeError('Function "cuLibraryGetManaged" not found') - err = ( __cuLibraryGetManaged)(dptr, numbytes, library, name) - return err -{{endif}} - -{{if 'cuLibraryGetUnifiedFunction' in found_functions}} - -cdef CUresult _cuLibraryGetUnifiedFunction(void** fptr, CUlibrary library, const char* symbol) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLibraryGetUnifiedFunction - cuPythonInit() - if __cuLibraryGetUnifiedFunction == NULL: - with gil: - raise RuntimeError('Function "cuLibraryGetUnifiedFunction" not found') - err = ( __cuLibraryGetUnifiedFunction)(fptr, library, symbol) - return err -{{endif}} - -{{if 'cuKernelGetAttribute' in found_functions}} - -cdef CUresult _cuKernelGetAttribute(int* pi, CUfunction_attribute attrib, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuKernelGetAttribute - cuPythonInit() - if __cuKernelGetAttribute == NULL: - with gil: - raise RuntimeError('Function "cuKernelGetAttribute" not found') - err = ( __cuKernelGetAttribute)(pi, attrib, kernel, dev) - return err -{{endif}} - -{{if 'cuKernelSetAttribute' in found_functions}} - -cdef CUresult _cuKernelSetAttribute(CUfunction_attribute attrib, int val, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuKernelSetAttribute - cuPythonInit() - if __cuKernelSetAttribute == NULL: - with gil: - raise RuntimeError('Function "cuKernelSetAttribute" not found') - err = ( __cuKernelSetAttribute)(attrib, val, kernel, dev) - return err -{{endif}} - -{{if 'cuKernelSetCacheConfig' in found_functions}} - -cdef CUresult _cuKernelSetCacheConfig(CUkernel kernel, CUfunc_cache config, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuKernelSetCacheConfig - cuPythonInit() - if __cuKernelSetCacheConfig == NULL: - with gil: - raise RuntimeError('Function "cuKernelSetCacheConfig" not found') - err = ( __cuKernelSetCacheConfig)(kernel, config, dev) - return err -{{endif}} - -{{if 'cuKernelGetName' in found_functions}} - -cdef CUresult _cuKernelGetName(const char** name, CUkernel hfunc) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuKernelGetName - cuPythonInit() - if __cuKernelGetName == NULL: - with gil: - raise RuntimeError('Function "cuKernelGetName" not found') - err = ( __cuKernelGetName)(name, hfunc) - return err -{{endif}} - -{{if 'cuKernelGetParamInfo' in found_functions}} - -cdef CUresult _cuKernelGetParamInfo(CUkernel kernel, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuKernelGetParamInfo - cuPythonInit() - if __cuKernelGetParamInfo == NULL: - with gil: - raise RuntimeError('Function "cuKernelGetParamInfo" not found') - err = ( __cuKernelGetParamInfo)(kernel, paramIndex, paramOffset, paramSize) - return err -{{endif}} - -{{if 'cuKernelGetParamCount' in found_functions}} - -cdef CUresult _cuKernelGetParamCount(CUkernel kernel, size_t* paramCount) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuKernelGetParamCount - cuPythonInit() - if __cuKernelGetParamCount == NULL: - with gil: - raise RuntimeError('Function "cuKernelGetParamCount" not found') - err = ( __cuKernelGetParamCount)(kernel, paramCount) - return err -{{endif}} - -{{if 'cuMemGetInfo_v2' in found_functions}} - -cdef CUresult _cuMemGetInfo_v2(size_t* free, size_t* total) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemGetInfo_v2 - cuPythonInit() - if __cuMemGetInfo_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemGetInfo_v2" not found') - err = ( __cuMemGetInfo_v2)(free, total) - return err -{{endif}} - -{{if 'cuMemAlloc_v2' in found_functions}} - -cdef CUresult _cuMemAlloc_v2(CUdeviceptr* dptr, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemAlloc_v2 - cuPythonInit() - if __cuMemAlloc_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemAlloc_v2" not found') - err = ( __cuMemAlloc_v2)(dptr, bytesize) - return err -{{endif}} - -{{if 'cuMemAllocPitch_v2' in found_functions}} - -cdef CUresult _cuMemAllocPitch_v2(CUdeviceptr* dptr, size_t* pPitch, size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemAllocPitch_v2 - cuPythonInit() - if __cuMemAllocPitch_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemAllocPitch_v2" not found') - err = ( __cuMemAllocPitch_v2)(dptr, pPitch, WidthInBytes, Height, ElementSizeBytes) - return err -{{endif}} - -{{if 'cuMemFree_v2' in found_functions}} - -cdef CUresult _cuMemFree_v2(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemFree_v2 - cuPythonInit() - if __cuMemFree_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemFree_v2" not found') - err = ( __cuMemFree_v2)(dptr) - return err -{{endif}} - -{{if 'cuMemGetAddressRange_v2' in found_functions}} - -cdef CUresult _cuMemGetAddressRange_v2(CUdeviceptr* pbase, size_t* psize, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemGetAddressRange_v2 - cuPythonInit() - if __cuMemGetAddressRange_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemGetAddressRange_v2" not found') - err = ( __cuMemGetAddressRange_v2)(pbase, psize, dptr) - return err -{{endif}} - -{{if 'cuMemAllocHost_v2' in found_functions}} - -cdef CUresult _cuMemAllocHost_v2(void** pp, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemAllocHost_v2 - cuPythonInit() - if __cuMemAllocHost_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemAllocHost_v2" not found') - err = ( __cuMemAllocHost_v2)(pp, bytesize) - return err -{{endif}} - -{{if 'cuMemFreeHost' in found_functions}} - -cdef CUresult _cuMemFreeHost(void* p) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemFreeHost - cuPythonInit() - if __cuMemFreeHost == NULL: - with gil: - raise RuntimeError('Function "cuMemFreeHost" not found') - err = ( __cuMemFreeHost)(p) - return err -{{endif}} - -{{if 'cuMemHostAlloc' in found_functions}} - -cdef CUresult _cuMemHostAlloc(void** pp, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemHostAlloc - cuPythonInit() - if __cuMemHostAlloc == NULL: - with gil: - raise RuntimeError('Function "cuMemHostAlloc" not found') - err = ( __cuMemHostAlloc)(pp, bytesize, Flags) - return err -{{endif}} - -{{if 'cuMemHostGetDevicePointer_v2' in found_functions}} - -cdef CUresult _cuMemHostGetDevicePointer_v2(CUdeviceptr* pdptr, void* p, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemHostGetDevicePointer_v2 - cuPythonInit() - if __cuMemHostGetDevicePointer_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemHostGetDevicePointer_v2" not found') - err = ( __cuMemHostGetDevicePointer_v2)(pdptr, p, Flags) - return err -{{endif}} - -{{if 'cuMemHostGetFlags' in found_functions}} - -cdef CUresult _cuMemHostGetFlags(unsigned int* pFlags, void* p) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemHostGetFlags - cuPythonInit() - if __cuMemHostGetFlags == NULL: - with gil: - raise RuntimeError('Function "cuMemHostGetFlags" not found') - err = ( __cuMemHostGetFlags)(pFlags, p) - return err -{{endif}} - -{{if 'cuMemAllocManaged' in found_functions}} - -cdef CUresult _cuMemAllocManaged(CUdeviceptr* dptr, size_t bytesize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemAllocManaged - cuPythonInit() - if __cuMemAllocManaged == NULL: - with gil: - raise RuntimeError('Function "cuMemAllocManaged" not found') - err = ( __cuMemAllocManaged)(dptr, bytesize, flags) - return err -{{endif}} - -{{if 'cuDeviceRegisterAsyncNotification' in found_functions}} - -cdef CUresult _cuDeviceRegisterAsyncNotification(CUdevice device, CUasyncCallback callbackFunc, void* userData, CUasyncCallbackHandle* callback) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDeviceRegisterAsyncNotification - cuPythonInit() - if __cuDeviceRegisterAsyncNotification == NULL: - with gil: - raise RuntimeError('Function "cuDeviceRegisterAsyncNotification" not found') - err = ( __cuDeviceRegisterAsyncNotification)(device, callbackFunc, userData, callback) - return err -{{endif}} - -{{if 'cuDeviceUnregisterAsyncNotification' in found_functions}} - -cdef CUresult _cuDeviceUnregisterAsyncNotification(CUdevice device, CUasyncCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDeviceUnregisterAsyncNotification - cuPythonInit() - if __cuDeviceUnregisterAsyncNotification == NULL: - with gil: - raise RuntimeError('Function "cuDeviceUnregisterAsyncNotification" not found') - err = ( __cuDeviceUnregisterAsyncNotification)(device, callback) - return err -{{endif}} - -{{if 'cuDeviceGetByPCIBusId' in found_functions}} - -cdef CUresult _cuDeviceGetByPCIBusId(CUdevice* dev, const char* pciBusId) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDeviceGetByPCIBusId - cuPythonInit() - if __cuDeviceGetByPCIBusId == NULL: - with gil: - raise RuntimeError('Function "cuDeviceGetByPCIBusId" not found') - err = ( __cuDeviceGetByPCIBusId)(dev, pciBusId) - return err -{{endif}} - -{{if 'cuDeviceGetPCIBusId' in found_functions}} - -cdef CUresult _cuDeviceGetPCIBusId(char* pciBusId, int length, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDeviceGetPCIBusId - cuPythonInit() - if __cuDeviceGetPCIBusId == NULL: - with gil: - raise RuntimeError('Function "cuDeviceGetPCIBusId" not found') - err = ( __cuDeviceGetPCIBusId)(pciBusId, length, dev) - return err -{{endif}} - -{{if 'cuIpcGetEventHandle' in found_functions}} - -cdef CUresult _cuIpcGetEventHandle(CUipcEventHandle* pHandle, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuIpcGetEventHandle - cuPythonInit() - if __cuIpcGetEventHandle == NULL: - with gil: - raise RuntimeError('Function "cuIpcGetEventHandle" not found') - err = ( __cuIpcGetEventHandle)(pHandle, event) - return err -{{endif}} - -{{if 'cuIpcOpenEventHandle' in found_functions}} - -cdef CUresult _cuIpcOpenEventHandle(CUevent* phEvent, CUipcEventHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuIpcOpenEventHandle - cuPythonInit() - if __cuIpcOpenEventHandle == NULL: - with gil: - raise RuntimeError('Function "cuIpcOpenEventHandle" not found') - err = ( __cuIpcOpenEventHandle)(phEvent, handle) - return err -{{endif}} - -{{if 'cuIpcGetMemHandle' in found_functions}} - -cdef CUresult _cuIpcGetMemHandle(CUipcMemHandle* pHandle, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuIpcGetMemHandle - cuPythonInit() - if __cuIpcGetMemHandle == NULL: - with gil: - raise RuntimeError('Function "cuIpcGetMemHandle" not found') - err = ( __cuIpcGetMemHandle)(pHandle, dptr) - return err -{{endif}} - -{{if 'cuIpcOpenMemHandle_v2' in found_functions}} - -cdef CUresult _cuIpcOpenMemHandle_v2(CUdeviceptr* pdptr, CUipcMemHandle handle, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuIpcOpenMemHandle_v2 - cuPythonInit() - if __cuIpcOpenMemHandle_v2 == NULL: - with gil: - raise RuntimeError('Function "cuIpcOpenMemHandle_v2" not found') - err = ( __cuIpcOpenMemHandle_v2)(pdptr, handle, Flags) - return err -{{endif}} - -{{if 'cuIpcCloseMemHandle' in found_functions}} - -cdef CUresult _cuIpcCloseMemHandle(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuIpcCloseMemHandle - cuPythonInit() - if __cuIpcCloseMemHandle == NULL: - with gil: - raise RuntimeError('Function "cuIpcCloseMemHandle" not found') - err = ( __cuIpcCloseMemHandle)(dptr) - return err -{{endif}} - -{{if 'cuMemHostRegister_v2' in found_functions}} - -cdef CUresult _cuMemHostRegister_v2(void* p, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemHostRegister_v2 - cuPythonInit() - if __cuMemHostRegister_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemHostRegister_v2" not found') - err = ( __cuMemHostRegister_v2)(p, bytesize, Flags) - return err -{{endif}} - -{{if 'cuMemHostUnregister' in found_functions}} - -cdef CUresult _cuMemHostUnregister(void* p) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemHostUnregister - cuPythonInit() - if __cuMemHostUnregister == NULL: - with gil: - raise RuntimeError('Function "cuMemHostUnregister" not found') - err = ( __cuMemHostUnregister)(p) - return err -{{endif}} - -{{if 'cuMemcpy' in found_functions}} - -cdef CUresult _cuMemcpy(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpy - cuPythonInit() - if __cuMemcpy == NULL: - with gil: - raise RuntimeError('Function "cuMemcpy" not found') - err = ( __cuMemcpy)(dst, src, ByteCount) - return err -{{endif}} - -{{if 'cuMemcpyPeer' in found_functions}} - -cdef CUresult _cuMemcpyPeer(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpyPeer - cuPythonInit() - if __cuMemcpyPeer == NULL: - with gil: - raise RuntimeError('Function "cuMemcpyPeer" not found') - err = ( __cuMemcpyPeer)(dstDevice, dstContext, srcDevice, srcContext, ByteCount) - return err -{{endif}} - -{{if 'cuMemcpyHtoD_v2' in found_functions}} - -cdef CUresult _cuMemcpyHtoD_v2(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpyHtoD_v2 - cuPythonInit() - if __cuMemcpyHtoD_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemcpyHtoD_v2" not found') - err = ( __cuMemcpyHtoD_v2)(dstDevice, srcHost, ByteCount) - return err -{{endif}} - -{{if 'cuMemcpyDtoH_v2' in found_functions}} - -cdef CUresult _cuMemcpyDtoH_v2(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpyDtoH_v2 - cuPythonInit() - if __cuMemcpyDtoH_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemcpyDtoH_v2" not found') - err = ( __cuMemcpyDtoH_v2)(dstHost, srcDevice, ByteCount) - return err -{{endif}} - -{{if 'cuMemcpyDtoD_v2' in found_functions}} - -cdef CUresult _cuMemcpyDtoD_v2(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpyDtoD_v2 - cuPythonInit() - if __cuMemcpyDtoD_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemcpyDtoD_v2" not found') - err = ( __cuMemcpyDtoD_v2)(dstDevice, srcDevice, ByteCount) - return err -{{endif}} - -{{if 'cuMemcpyDtoA_v2' in found_functions}} - -cdef CUresult _cuMemcpyDtoA_v2(CUarray dstArray, size_t dstOffset, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpyDtoA_v2 - cuPythonInit() - if __cuMemcpyDtoA_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemcpyDtoA_v2" not found') - err = ( __cuMemcpyDtoA_v2)(dstArray, dstOffset, srcDevice, ByteCount) - return err -{{endif}} - -{{if 'cuMemcpyAtoD_v2' in found_functions}} - -cdef CUresult _cuMemcpyAtoD_v2(CUdeviceptr dstDevice, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpyAtoD_v2 - cuPythonInit() - if __cuMemcpyAtoD_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemcpyAtoD_v2" not found') - err = ( __cuMemcpyAtoD_v2)(dstDevice, srcArray, srcOffset, ByteCount) - return err -{{endif}} - -{{if 'cuMemcpyHtoA_v2' in found_functions}} - -cdef CUresult _cuMemcpyHtoA_v2(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpyHtoA_v2 - cuPythonInit() - if __cuMemcpyHtoA_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemcpyHtoA_v2" not found') - err = ( __cuMemcpyHtoA_v2)(dstArray, dstOffset, srcHost, ByteCount) - return err -{{endif}} - -{{if 'cuMemcpyAtoH_v2' in found_functions}} - -cdef CUresult _cuMemcpyAtoH_v2(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpyAtoH_v2 - cuPythonInit() - if __cuMemcpyAtoH_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemcpyAtoH_v2" not found') - err = ( __cuMemcpyAtoH_v2)(dstHost, srcArray, srcOffset, ByteCount) - return err -{{endif}} - -{{if 'cuMemcpyAtoA_v2' in found_functions}} - -cdef CUresult _cuMemcpyAtoA_v2(CUarray dstArray, size_t dstOffset, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpyAtoA_v2 - cuPythonInit() - if __cuMemcpyAtoA_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemcpyAtoA_v2" not found') - err = ( __cuMemcpyAtoA_v2)(dstArray, dstOffset, srcArray, srcOffset, ByteCount) - return err -{{endif}} - -{{if 'cuMemcpy2D_v2' in found_functions}} - -cdef CUresult _cuMemcpy2D_v2(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpy2D_v2 - cuPythonInit() - if __cuMemcpy2D_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemcpy2D_v2" not found') - err = ( __cuMemcpy2D_v2)(pCopy) - return err -{{endif}} - -{{if 'cuMemcpy2DUnaligned_v2' in found_functions}} - -cdef CUresult _cuMemcpy2DUnaligned_v2(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpy2DUnaligned_v2 - cuPythonInit() - if __cuMemcpy2DUnaligned_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemcpy2DUnaligned_v2" not found') - err = ( __cuMemcpy2DUnaligned_v2)(pCopy) - return err -{{endif}} - -{{if 'cuMemcpy3D_v2' in found_functions}} - -cdef CUresult _cuMemcpy3D_v2(const CUDA_MEMCPY3D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpy3D_v2 - cuPythonInit() - if __cuMemcpy3D_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemcpy3D_v2" not found') - err = ( __cuMemcpy3D_v2)(pCopy) - return err -{{endif}} - -{{if 'cuMemcpy3DPeer' in found_functions}} - -cdef CUresult _cuMemcpy3DPeer(const CUDA_MEMCPY3D_PEER* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpy3DPeer - cuPythonInit() - if __cuMemcpy3DPeer == NULL: - with gil: - raise RuntimeError('Function "cuMemcpy3DPeer" not found') - err = ( __cuMemcpy3DPeer)(pCopy) - return err -{{endif}} - -{{if 'cuMemcpyAsync' in found_functions}} - -cdef CUresult _cuMemcpyAsync(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpyAsync - cuPythonInit() - if __cuMemcpyAsync == NULL: - with gil: - raise RuntimeError('Function "cuMemcpyAsync" not found') - err = ( __cuMemcpyAsync)(dst, src, ByteCount, hStream) - return err -{{endif}} - -{{if 'cuMemcpyPeerAsync' in found_functions}} - -cdef CUresult _cuMemcpyPeerAsync(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpyPeerAsync - cuPythonInit() - if __cuMemcpyPeerAsync == NULL: - with gil: - raise RuntimeError('Function "cuMemcpyPeerAsync" not found') - err = ( __cuMemcpyPeerAsync)(dstDevice, dstContext, srcDevice, srcContext, ByteCount, hStream) - return err -{{endif}} - -{{if 'cuMemcpyHtoDAsync_v2' in found_functions}} - -cdef CUresult _cuMemcpyHtoDAsync_v2(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpyHtoDAsync_v2 - cuPythonInit() - if __cuMemcpyHtoDAsync_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemcpyHtoDAsync_v2" not found') - err = ( __cuMemcpyHtoDAsync_v2)(dstDevice, srcHost, ByteCount, hStream) - return err -{{endif}} - -{{if 'cuMemcpyDtoHAsync_v2' in found_functions}} - -cdef CUresult _cuMemcpyDtoHAsync_v2(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpyDtoHAsync_v2 - cuPythonInit() - if __cuMemcpyDtoHAsync_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemcpyDtoHAsync_v2" not found') - err = ( __cuMemcpyDtoHAsync_v2)(dstHost, srcDevice, ByteCount, hStream) - return err -{{endif}} - -{{if 'cuMemcpyDtoDAsync_v2' in found_functions}} - -cdef CUresult _cuMemcpyDtoDAsync_v2(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpyDtoDAsync_v2 - cuPythonInit() - if __cuMemcpyDtoDAsync_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemcpyDtoDAsync_v2" not found') - err = ( __cuMemcpyDtoDAsync_v2)(dstDevice, srcDevice, ByteCount, hStream) - return err -{{endif}} - -{{if 'cuMemcpyHtoAAsync_v2' in found_functions}} - -cdef CUresult _cuMemcpyHtoAAsync_v2(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpyHtoAAsync_v2 - cuPythonInit() - if __cuMemcpyHtoAAsync_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemcpyHtoAAsync_v2" not found') - err = ( __cuMemcpyHtoAAsync_v2)(dstArray, dstOffset, srcHost, ByteCount, hStream) - return err -{{endif}} - -{{if 'cuMemcpyAtoHAsync_v2' in found_functions}} - -cdef CUresult _cuMemcpyAtoHAsync_v2(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpyAtoHAsync_v2 - cuPythonInit() - if __cuMemcpyAtoHAsync_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemcpyAtoHAsync_v2" not found') - err = ( __cuMemcpyAtoHAsync_v2)(dstHost, srcArray, srcOffset, ByteCount, hStream) - return err -{{endif}} - -{{if 'cuMemcpy2DAsync_v2' in found_functions}} - -cdef CUresult _cuMemcpy2DAsync_v2(const CUDA_MEMCPY2D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpy2DAsync_v2 - cuPythonInit() - if __cuMemcpy2DAsync_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemcpy2DAsync_v2" not found') - err = ( __cuMemcpy2DAsync_v2)(pCopy, hStream) - return err -{{endif}} - -{{if 'cuMemcpy3DAsync_v2' in found_functions}} - -cdef CUresult _cuMemcpy3DAsync_v2(const CUDA_MEMCPY3D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpy3DAsync_v2 - cuPythonInit() - if __cuMemcpy3DAsync_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemcpy3DAsync_v2" not found') - err = ( __cuMemcpy3DAsync_v2)(pCopy, hStream) - return err -{{endif}} - -{{if 'cuMemcpy3DPeerAsync' in found_functions}} - -cdef CUresult _cuMemcpy3DPeerAsync(const CUDA_MEMCPY3D_PEER* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpy3DPeerAsync - cuPythonInit() - if __cuMemcpy3DPeerAsync == NULL: - with gil: - raise RuntimeError('Function "cuMemcpy3DPeerAsync" not found') - err = ( __cuMemcpy3DPeerAsync)(pCopy, hStream) - return err -{{endif}} - -{{if 'cuMemcpyBatchAsync_v2' in found_functions}} - -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_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemcpyBatchAsync_v2" not found') - err = ( __cuMemcpyBatchAsync_v2)(dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, hStream) - return err -{{endif}} - -{{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} - -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_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemcpy3DBatchAsync_v2" not found') - err = ( __cuMemcpy3DBatchAsync_v2)(numOps, opList, flags, hStream) - return err -{{endif}} - -{{if 'cuMemcpyWithAttributesAsync' in found_functions}} - -cdef CUresult _cuMemcpyWithAttributesAsync(CUdeviceptr dst, CUdeviceptr src, size_t size, CUmemcpyAttributes* attr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpyWithAttributesAsync - cuPythonInit() - if __cuMemcpyWithAttributesAsync == NULL: - with gil: - raise RuntimeError('Function "cuMemcpyWithAttributesAsync" not found') - err = ( __cuMemcpyWithAttributesAsync)(dst, src, size, attr, hStream) - return err -{{endif}} - -{{if 'cuMemcpy3DWithAttributesAsync' in found_functions}} - -cdef CUresult _cuMemcpy3DWithAttributesAsync(CUDA_MEMCPY3D_BATCH_OP* op, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemcpy3DWithAttributesAsync - cuPythonInit() - if __cuMemcpy3DWithAttributesAsync == NULL: - with gil: - raise RuntimeError('Function "cuMemcpy3DWithAttributesAsync" not found') - err = ( __cuMemcpy3DWithAttributesAsync)(op, flags, hStream) - return err -{{endif}} - -{{if 'cuMemsetD8_v2' in found_functions}} - -cdef CUresult _cuMemsetD8_v2(CUdeviceptr dstDevice, unsigned char uc, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemsetD8_v2 - cuPythonInit() - if __cuMemsetD8_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemsetD8_v2" not found') - err = ( __cuMemsetD8_v2)(dstDevice, uc, N) - return err -{{endif}} - -{{if 'cuMemsetD16_v2' in found_functions}} - -cdef CUresult _cuMemsetD16_v2(CUdeviceptr dstDevice, unsigned short us, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemsetD16_v2 - cuPythonInit() - if __cuMemsetD16_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemsetD16_v2" not found') - err = ( __cuMemsetD16_v2)(dstDevice, us, N) - return err -{{endif}} - -{{if 'cuMemsetD32_v2' in found_functions}} - -cdef CUresult _cuMemsetD32_v2(CUdeviceptr dstDevice, unsigned int ui, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemsetD32_v2 - cuPythonInit() - if __cuMemsetD32_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemsetD32_v2" not found') - err = ( __cuMemsetD32_v2)(dstDevice, ui, N) - return err -{{endif}} - -{{if 'cuMemsetD2D8_v2' in found_functions}} - -cdef CUresult _cuMemsetD2D8_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemsetD2D8_v2 - cuPythonInit() - if __cuMemsetD2D8_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemsetD2D8_v2" not found') - err = ( __cuMemsetD2D8_v2)(dstDevice, dstPitch, uc, Width, Height) - return err -{{endif}} - -{{if 'cuMemsetD2D16_v2' in found_functions}} - -cdef CUresult _cuMemsetD2D16_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemsetD2D16_v2 - cuPythonInit() - if __cuMemsetD2D16_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemsetD2D16_v2" not found') - err = ( __cuMemsetD2D16_v2)(dstDevice, dstPitch, us, Width, Height) - return err -{{endif}} - -{{if 'cuMemsetD2D32_v2' in found_functions}} - -cdef CUresult _cuMemsetD2D32_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemsetD2D32_v2 - cuPythonInit() - if __cuMemsetD2D32_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemsetD2D32_v2" not found') - err = ( __cuMemsetD2D32_v2)(dstDevice, dstPitch, ui, Width, Height) - return err -{{endif}} - -{{if 'cuMemsetD8Async' in found_functions}} - -cdef CUresult _cuMemsetD8Async(CUdeviceptr dstDevice, unsigned char uc, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemsetD8Async - cuPythonInit() - if __cuMemsetD8Async == NULL: - with gil: - raise RuntimeError('Function "cuMemsetD8Async" not found') - err = ( __cuMemsetD8Async)(dstDevice, uc, N, hStream) - return err -{{endif}} - -{{if 'cuMemsetD16Async' in found_functions}} - -cdef CUresult _cuMemsetD16Async(CUdeviceptr dstDevice, unsigned short us, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemsetD16Async - cuPythonInit() - if __cuMemsetD16Async == NULL: - with gil: - raise RuntimeError('Function "cuMemsetD16Async" not found') - err = ( __cuMemsetD16Async)(dstDevice, us, N, hStream) - return err -{{endif}} - -{{if 'cuMemsetD32Async' in found_functions}} - -cdef CUresult _cuMemsetD32Async(CUdeviceptr dstDevice, unsigned int ui, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemsetD32Async - cuPythonInit() - if __cuMemsetD32Async == NULL: - with gil: - raise RuntimeError('Function "cuMemsetD32Async" not found') - err = ( __cuMemsetD32Async)(dstDevice, ui, N, hStream) - return err -{{endif}} - -{{if 'cuMemsetD2D8Async' in found_functions}} - -cdef CUresult _cuMemsetD2D8Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemsetD2D8Async - cuPythonInit() - if __cuMemsetD2D8Async == NULL: - with gil: - raise RuntimeError('Function "cuMemsetD2D8Async" not found') - err = ( __cuMemsetD2D8Async)(dstDevice, dstPitch, uc, Width, Height, hStream) - return err -{{endif}} - -{{if 'cuMemsetD2D16Async' in found_functions}} - -cdef CUresult _cuMemsetD2D16Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemsetD2D16Async - cuPythonInit() - if __cuMemsetD2D16Async == NULL: - with gil: - raise RuntimeError('Function "cuMemsetD2D16Async" not found') - err = ( __cuMemsetD2D16Async)(dstDevice, dstPitch, us, Width, Height, hStream) - return err -{{endif}} - -{{if 'cuMemsetD2D32Async' in found_functions}} - -cdef CUresult _cuMemsetD2D32Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemsetD2D32Async - cuPythonInit() - if __cuMemsetD2D32Async == NULL: - with gil: - raise RuntimeError('Function "cuMemsetD2D32Async" not found') - err = ( __cuMemsetD2D32Async)(dstDevice, dstPitch, ui, Width, Height, hStream) - return err -{{endif}} - -{{if 'cuArrayCreate_v2' in found_functions}} - -cdef CUresult _cuArrayCreate_v2(CUarray* pHandle, const CUDA_ARRAY_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuArrayCreate_v2 - cuPythonInit() - if __cuArrayCreate_v2 == NULL: - with gil: - raise RuntimeError('Function "cuArrayCreate_v2" not found') - err = ( __cuArrayCreate_v2)(pHandle, pAllocateArray) - return err -{{endif}} - -{{if 'cuArrayGetDescriptor_v2' in found_functions}} - -cdef CUresult _cuArrayGetDescriptor_v2(CUDA_ARRAY_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuArrayGetDescriptor_v2 - cuPythonInit() - if __cuArrayGetDescriptor_v2 == NULL: - with gil: - raise RuntimeError('Function "cuArrayGetDescriptor_v2" not found') - err = ( __cuArrayGetDescriptor_v2)(pArrayDescriptor, hArray) - return err -{{endif}} - -{{if 'cuArrayGetSparseProperties' in found_functions}} - -cdef CUresult _cuArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUarray array) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuArrayGetSparseProperties - cuPythonInit() - if __cuArrayGetSparseProperties == NULL: - with gil: - raise RuntimeError('Function "cuArrayGetSparseProperties" not found') - err = ( __cuArrayGetSparseProperties)(sparseProperties, array) - return err -{{endif}} - -{{if 'cuMipmappedArrayGetSparseProperties' in found_functions}} - -cdef CUresult _cuMipmappedArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUmipmappedArray mipmap) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMipmappedArrayGetSparseProperties - cuPythonInit() - if __cuMipmappedArrayGetSparseProperties == NULL: - with gil: - raise RuntimeError('Function "cuMipmappedArrayGetSparseProperties" not found') - err = ( __cuMipmappedArrayGetSparseProperties)(sparseProperties, mipmap) - return err -{{endif}} - -{{if 'cuArrayGetMemoryRequirements' in found_functions}} - -cdef CUresult _cuArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUarray array, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuArrayGetMemoryRequirements - cuPythonInit() - if __cuArrayGetMemoryRequirements == NULL: - with gil: - raise RuntimeError('Function "cuArrayGetMemoryRequirements" not found') - err = ( __cuArrayGetMemoryRequirements)(memoryRequirements, array, device) - return err -{{endif}} - -{{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}} - -cdef CUresult _cuMipmappedArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUmipmappedArray mipmap, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMipmappedArrayGetMemoryRequirements - cuPythonInit() - if __cuMipmappedArrayGetMemoryRequirements == NULL: - with gil: - raise RuntimeError('Function "cuMipmappedArrayGetMemoryRequirements" not found') - err = ( __cuMipmappedArrayGetMemoryRequirements)(memoryRequirements, mipmap, device) - return err -{{endif}} - -{{if 'cuArrayGetPlane' in found_functions}} - -cdef CUresult _cuArrayGetPlane(CUarray* pPlaneArray, CUarray hArray, unsigned int planeIdx) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuArrayGetPlane - cuPythonInit() - if __cuArrayGetPlane == NULL: - with gil: - raise RuntimeError('Function "cuArrayGetPlane" not found') - err = ( __cuArrayGetPlane)(pPlaneArray, hArray, planeIdx) - return err -{{endif}} - -{{if 'cuArrayDestroy' in found_functions}} - -cdef CUresult _cuArrayDestroy(CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuArrayDestroy - cuPythonInit() - if __cuArrayDestroy == NULL: - with gil: - raise RuntimeError('Function "cuArrayDestroy" not found') - err = ( __cuArrayDestroy)(hArray) - return err -{{endif}} - -{{if 'cuArray3DCreate_v2' in found_functions}} - -cdef CUresult _cuArray3DCreate_v2(CUarray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuArray3DCreate_v2 - cuPythonInit() - if __cuArray3DCreate_v2 == NULL: - with gil: - raise RuntimeError('Function "cuArray3DCreate_v2" not found') - err = ( __cuArray3DCreate_v2)(pHandle, pAllocateArray) - return err -{{endif}} - -{{if 'cuArray3DGetDescriptor_v2' in found_functions}} - -cdef CUresult _cuArray3DGetDescriptor_v2(CUDA_ARRAY3D_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuArray3DGetDescriptor_v2 - cuPythonInit() - if __cuArray3DGetDescriptor_v2 == NULL: - with gil: - raise RuntimeError('Function "cuArray3DGetDescriptor_v2" not found') - err = ( __cuArray3DGetDescriptor_v2)(pArrayDescriptor, hArray) - return err -{{endif}} - -{{if 'cuMipmappedArrayCreate' in found_functions}} - -cdef CUresult _cuMipmappedArrayCreate(CUmipmappedArray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pMipmappedArrayDesc, unsigned int numMipmapLevels) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMipmappedArrayCreate - cuPythonInit() - if __cuMipmappedArrayCreate == NULL: - with gil: - raise RuntimeError('Function "cuMipmappedArrayCreate" not found') - err = ( __cuMipmappedArrayCreate)(pHandle, pMipmappedArrayDesc, numMipmapLevels) - return err -{{endif}} - -{{if 'cuMipmappedArrayGetLevel' in found_functions}} - -cdef CUresult _cuMipmappedArrayGetLevel(CUarray* pLevelArray, CUmipmappedArray hMipmappedArray, unsigned int level) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMipmappedArrayGetLevel - cuPythonInit() - if __cuMipmappedArrayGetLevel == NULL: - with gil: - raise RuntimeError('Function "cuMipmappedArrayGetLevel" not found') - err = ( __cuMipmappedArrayGetLevel)(pLevelArray, hMipmappedArray, level) - return err -{{endif}} - -{{if 'cuMipmappedArrayDestroy' in found_functions}} - -cdef CUresult _cuMipmappedArrayDestroy(CUmipmappedArray hMipmappedArray) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMipmappedArrayDestroy - cuPythonInit() - if __cuMipmappedArrayDestroy == NULL: - with gil: - raise RuntimeError('Function "cuMipmappedArrayDestroy" not found') - err = ( __cuMipmappedArrayDestroy)(hMipmappedArray) - return err -{{endif}} - -{{if 'cuMemGetHandleForAddressRange' in found_functions}} - -cdef CUresult _cuMemGetHandleForAddressRange(void* handle, CUdeviceptr dptr, size_t size, CUmemRangeHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemGetHandleForAddressRange - cuPythonInit() - if __cuMemGetHandleForAddressRange == NULL: - with gil: - raise RuntimeError('Function "cuMemGetHandleForAddressRange" not found') - err = ( __cuMemGetHandleForAddressRange)(handle, dptr, size, handleType, flags) - return err -{{endif}} - -{{if 'cuMemBatchDecompressAsync' in found_functions}} - -cdef CUresult _cuMemBatchDecompressAsync(CUmemDecompressParams* paramsArray, size_t count, unsigned int flags, size_t* errorIndex, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemBatchDecompressAsync - cuPythonInit() - if __cuMemBatchDecompressAsync == NULL: - with gil: - raise RuntimeError('Function "cuMemBatchDecompressAsync" not found') - err = ( __cuMemBatchDecompressAsync)(paramsArray, count, flags, errorIndex, stream) - return err -{{endif}} - -{{if 'cuMemAddressReserve' in found_functions}} - -cdef CUresult _cuMemAddressReserve(CUdeviceptr* ptr, size_t size, size_t alignment, CUdeviceptr addr, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemAddressReserve - cuPythonInit() - if __cuMemAddressReserve == NULL: - with gil: - raise RuntimeError('Function "cuMemAddressReserve" not found') - err = ( __cuMemAddressReserve)(ptr, size, alignment, addr, flags) - return err -{{endif}} - -{{if 'cuMemAddressFree' in found_functions}} - -cdef CUresult _cuMemAddressFree(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemAddressFree - cuPythonInit() - if __cuMemAddressFree == NULL: - with gil: - raise RuntimeError('Function "cuMemAddressFree" not found') - err = ( __cuMemAddressFree)(ptr, size) - return err -{{endif}} - -{{if 'cuMemCreate' in found_functions}} - -cdef CUresult _cuMemCreate(CUmemGenericAllocationHandle* handle, size_t size, const CUmemAllocationProp* prop, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemCreate - cuPythonInit() - if __cuMemCreate == NULL: - with gil: - raise RuntimeError('Function "cuMemCreate" not found') - err = ( __cuMemCreate)(handle, size, prop, flags) - return err -{{endif}} - -{{if 'cuMemRelease' in found_functions}} - -cdef CUresult _cuMemRelease(CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemRelease - cuPythonInit() - if __cuMemRelease == NULL: - with gil: - raise RuntimeError('Function "cuMemRelease" not found') - err = ( __cuMemRelease)(handle) - return err -{{endif}} - -{{if 'cuMemMap' in found_functions}} - -cdef CUresult _cuMemMap(CUdeviceptr ptr, size_t size, size_t offset, CUmemGenericAllocationHandle handle, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemMap - cuPythonInit() - if __cuMemMap == NULL: - with gil: - raise RuntimeError('Function "cuMemMap" not found') - err = ( __cuMemMap)(ptr, size, offset, handle, flags) - return err -{{endif}} - -{{if 'cuMemMapArrayAsync' in found_functions}} - -cdef CUresult _cuMemMapArrayAsync(CUarrayMapInfo* mapInfoList, unsigned int count, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemMapArrayAsync - cuPythonInit() - if __cuMemMapArrayAsync == NULL: - with gil: - raise RuntimeError('Function "cuMemMapArrayAsync" not found') - err = ( __cuMemMapArrayAsync)(mapInfoList, count, hStream) - return err -{{endif}} - -{{if 'cuMemUnmap' in found_functions}} - -cdef CUresult _cuMemUnmap(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemUnmap - cuPythonInit() - if __cuMemUnmap == NULL: - with gil: - raise RuntimeError('Function "cuMemUnmap" not found') - err = ( __cuMemUnmap)(ptr, size) - return err -{{endif}} - -{{if 'cuMemSetAccess' in found_functions}} - -cdef CUresult _cuMemSetAccess(CUdeviceptr ptr, size_t size, const CUmemAccessDesc* desc, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemSetAccess - cuPythonInit() - if __cuMemSetAccess == NULL: - with gil: - raise RuntimeError('Function "cuMemSetAccess" not found') - err = ( __cuMemSetAccess)(ptr, size, desc, count) - return err -{{endif}} - -{{if 'cuMemGetAccess' in found_functions}} - -cdef CUresult _cuMemGetAccess(unsigned long long* flags, const CUmemLocation* location, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemGetAccess - cuPythonInit() - if __cuMemGetAccess == NULL: - with gil: - raise RuntimeError('Function "cuMemGetAccess" not found') - err = ( __cuMemGetAccess)(flags, location, ptr) - return err -{{endif}} - -{{if 'cuMemExportToShareableHandle' in found_functions}} - -cdef CUresult _cuMemExportToShareableHandle(void* shareableHandle, CUmemGenericAllocationHandle handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemExportToShareableHandle - cuPythonInit() - if __cuMemExportToShareableHandle == NULL: - with gil: - raise RuntimeError('Function "cuMemExportToShareableHandle" not found') - err = ( __cuMemExportToShareableHandle)(shareableHandle, handle, handleType, flags) - return err -{{endif}} - -{{if 'cuMemImportFromShareableHandle' in found_functions}} - -cdef CUresult _cuMemImportFromShareableHandle(CUmemGenericAllocationHandle* handle, void* osHandle, CUmemAllocationHandleType shHandleType) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemImportFromShareableHandle - cuPythonInit() - if __cuMemImportFromShareableHandle == NULL: - with gil: - raise RuntimeError('Function "cuMemImportFromShareableHandle" not found') - err = ( __cuMemImportFromShareableHandle)(handle, osHandle, shHandleType) - return err -{{endif}} - -{{if 'cuMemGetAllocationGranularity' in found_functions}} - -cdef CUresult _cuMemGetAllocationGranularity(size_t* granularity, const CUmemAllocationProp* prop, CUmemAllocationGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemGetAllocationGranularity - cuPythonInit() - if __cuMemGetAllocationGranularity == NULL: - with gil: - raise RuntimeError('Function "cuMemGetAllocationGranularity" not found') - err = ( __cuMemGetAllocationGranularity)(granularity, prop, option) - return err -{{endif}} - -{{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}} - -cdef CUresult _cuMemGetAllocationPropertiesFromHandle(CUmemAllocationProp* prop, CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemGetAllocationPropertiesFromHandle - cuPythonInit() - if __cuMemGetAllocationPropertiesFromHandle == NULL: - with gil: - raise RuntimeError('Function "cuMemGetAllocationPropertiesFromHandle" not found') - err = ( __cuMemGetAllocationPropertiesFromHandle)(prop, handle) - return err -{{endif}} - -{{if 'cuMemRetainAllocationHandle' in found_functions}} - -cdef CUresult _cuMemRetainAllocationHandle(CUmemGenericAllocationHandle* handle, void* addr) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemRetainAllocationHandle - cuPythonInit() - if __cuMemRetainAllocationHandle == NULL: - with gil: - raise RuntimeError('Function "cuMemRetainAllocationHandle" not found') - err = ( __cuMemRetainAllocationHandle)(handle, addr) - return err -{{endif}} - -{{if 'cuMemFreeAsync' in found_functions}} - -cdef CUresult _cuMemFreeAsync(CUdeviceptr dptr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemFreeAsync - cuPythonInit() - if __cuMemFreeAsync == NULL: - with gil: - raise RuntimeError('Function "cuMemFreeAsync" not found') - err = ( __cuMemFreeAsync)(dptr, hStream) - return err -{{endif}} - -{{if 'cuMemAllocAsync' in found_functions}} - -cdef CUresult _cuMemAllocAsync(CUdeviceptr* dptr, size_t bytesize, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemAllocAsync - cuPythonInit() - if __cuMemAllocAsync == NULL: - with gil: - raise RuntimeError('Function "cuMemAllocAsync" not found') - err = ( __cuMemAllocAsync)(dptr, bytesize, hStream) - return err -{{endif}} - -{{if 'cuMemPoolTrimTo' in found_functions}} - -cdef CUresult _cuMemPoolTrimTo(CUmemoryPool pool, size_t minBytesToKeep) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemPoolTrimTo - cuPythonInit() - if __cuMemPoolTrimTo == NULL: - with gil: - raise RuntimeError('Function "cuMemPoolTrimTo" not found') - err = ( __cuMemPoolTrimTo)(pool, minBytesToKeep) - return err -{{endif}} - -{{if 'cuMemPoolSetAttribute' in found_functions}} - -cdef CUresult _cuMemPoolSetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemPoolSetAttribute - cuPythonInit() - if __cuMemPoolSetAttribute == NULL: - with gil: - raise RuntimeError('Function "cuMemPoolSetAttribute" not found') - err = ( __cuMemPoolSetAttribute)(pool, attr, value) - return err -{{endif}} - -{{if 'cuMemPoolGetAttribute' in found_functions}} - -cdef CUresult _cuMemPoolGetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemPoolGetAttribute - cuPythonInit() - if __cuMemPoolGetAttribute == NULL: - with gil: - raise RuntimeError('Function "cuMemPoolGetAttribute" not found') - err = ( __cuMemPoolGetAttribute)(pool, attr, value) - return err -{{endif}} - -{{if 'cuMemPoolSetAccess' in found_functions}} - -cdef CUresult _cuMemPoolSetAccess(CUmemoryPool pool, const CUmemAccessDesc* map, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemPoolSetAccess - cuPythonInit() - if __cuMemPoolSetAccess == NULL: - with gil: - raise RuntimeError('Function "cuMemPoolSetAccess" not found') - err = ( __cuMemPoolSetAccess)(pool, map, count) - return err -{{endif}} - -{{if 'cuMemPoolGetAccess' in found_functions}} - -cdef CUresult _cuMemPoolGetAccess(CUmemAccess_flags* flags, CUmemoryPool memPool, CUmemLocation* location) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemPoolGetAccess - cuPythonInit() - if __cuMemPoolGetAccess == NULL: - with gil: - raise RuntimeError('Function "cuMemPoolGetAccess" not found') - err = ( __cuMemPoolGetAccess)(flags, memPool, location) - return err -{{endif}} - -{{if 'cuMemPoolCreate' in found_functions}} - -cdef CUresult _cuMemPoolCreate(CUmemoryPool* pool, const CUmemPoolProps* poolProps) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemPoolCreate - cuPythonInit() - if __cuMemPoolCreate == NULL: - with gil: - raise RuntimeError('Function "cuMemPoolCreate" not found') - err = ( __cuMemPoolCreate)(pool, poolProps) - return err -{{endif}} - -{{if 'cuMemPoolDestroy' in found_functions}} - -cdef CUresult _cuMemPoolDestroy(CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemPoolDestroy - cuPythonInit() - if __cuMemPoolDestroy == NULL: - with gil: - raise RuntimeError('Function "cuMemPoolDestroy" not found') - err = ( __cuMemPoolDestroy)(pool) - 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: - global __cuMemAllocFromPoolAsync - cuPythonInit() - if __cuMemAllocFromPoolAsync == NULL: - with gil: - raise RuntimeError('Function "cuMemAllocFromPoolAsync" not found') - err = ( __cuMemAllocFromPoolAsync)(dptr, bytesize, pool, hStream) - return err -{{endif}} - -{{if 'cuMemPoolExportToShareableHandle' in found_functions}} - -cdef CUresult _cuMemPoolExportToShareableHandle(void* handle_out, CUmemoryPool pool, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemPoolExportToShareableHandle - cuPythonInit() - if __cuMemPoolExportToShareableHandle == NULL: - with gil: - raise RuntimeError('Function "cuMemPoolExportToShareableHandle" not found') - err = ( __cuMemPoolExportToShareableHandle)(handle_out, pool, handleType, flags) - return err -{{endif}} - -{{if 'cuMemPoolImportFromShareableHandle' in found_functions}} - -cdef CUresult _cuMemPoolImportFromShareableHandle(CUmemoryPool* pool_out, void* handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemPoolImportFromShareableHandle - cuPythonInit() - if __cuMemPoolImportFromShareableHandle == NULL: - with gil: - raise RuntimeError('Function "cuMemPoolImportFromShareableHandle" not found') - err = ( __cuMemPoolImportFromShareableHandle)(pool_out, handle, handleType, flags) - return err -{{endif}} - -{{if 'cuMemPoolExportPointer' in found_functions}} - -cdef CUresult _cuMemPoolExportPointer(CUmemPoolPtrExportData* shareData_out, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemPoolExportPointer - cuPythonInit() - if __cuMemPoolExportPointer == NULL: - with gil: - raise RuntimeError('Function "cuMemPoolExportPointer" not found') - err = ( __cuMemPoolExportPointer)(shareData_out, ptr) - return err -{{endif}} - -{{if 'cuMemPoolImportPointer' in found_functions}} - -cdef CUresult _cuMemPoolImportPointer(CUdeviceptr* ptr_out, CUmemoryPool pool, CUmemPoolPtrExportData* shareData) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemPoolImportPointer - cuPythonInit() - if __cuMemPoolImportPointer == NULL: - with gil: - raise RuntimeError('Function "cuMemPoolImportPointer" not found') - err = ( __cuMemPoolImportPointer)(ptr_out, pool, shareData) - return err -{{endif}} - -{{if 'cuMulticastCreate' in found_functions}} - -cdef CUresult _cuMulticastCreate(CUmemGenericAllocationHandle* mcHandle, const CUmulticastObjectProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMulticastCreate - cuPythonInit() - if __cuMulticastCreate == NULL: - with gil: - raise RuntimeError('Function "cuMulticastCreate" not found') - err = ( __cuMulticastCreate)(mcHandle, prop) - return err -{{endif}} - -{{if 'cuMulticastAddDevice' in found_functions}} - -cdef CUresult _cuMulticastAddDevice(CUmemGenericAllocationHandle mcHandle, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMulticastAddDevice - cuPythonInit() - if __cuMulticastAddDevice == NULL: - with gil: - raise RuntimeError('Function "cuMulticastAddDevice" not found') - err = ( __cuMulticastAddDevice)(mcHandle, dev) - return err -{{endif}} - -{{if 'cuMulticastBindMem' in found_functions}} - -cdef CUresult _cuMulticastBindMem(CUmemGenericAllocationHandle mcHandle, size_t mcOffset, CUmemGenericAllocationHandle memHandle, size_t memOffset, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMulticastBindMem - cuPythonInit() - if __cuMulticastBindMem == NULL: - with gil: - raise RuntimeError('Function "cuMulticastBindMem" not found') - err = ( __cuMulticastBindMem)(mcHandle, mcOffset, memHandle, memOffset, size, flags) - return err -{{endif}} - -{{if 'cuMulticastBindMem_v2' in found_functions}} - -cdef CUresult _cuMulticastBindMem_v2(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, CUmemGenericAllocationHandle memHandle, size_t memOffset, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMulticastBindMem_v2 - cuPythonInit() - if __cuMulticastBindMem_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMulticastBindMem_v2" not found') - err = ( __cuMulticastBindMem_v2)(mcHandle, dev, mcOffset, memHandle, memOffset, size, flags) - return err -{{endif}} - -{{if 'cuMulticastBindAddr' in found_functions}} - -cdef CUresult _cuMulticastBindAddr(CUmemGenericAllocationHandle mcHandle, size_t mcOffset, CUdeviceptr memptr, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMulticastBindAddr - cuPythonInit() - if __cuMulticastBindAddr == NULL: - with gil: - raise RuntimeError('Function "cuMulticastBindAddr" not found') - err = ( __cuMulticastBindAddr)(mcHandle, mcOffset, memptr, size, flags) - return err -{{endif}} - -{{if 'cuMulticastBindAddr_v2' in found_functions}} - -cdef CUresult _cuMulticastBindAddr_v2(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, CUdeviceptr memptr, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMulticastBindAddr_v2 - cuPythonInit() - if __cuMulticastBindAddr_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMulticastBindAddr_v2" not found') - err = ( __cuMulticastBindAddr_v2)(mcHandle, dev, mcOffset, memptr, size, flags) - return err -{{endif}} - -{{if 'cuMulticastUnbind' in found_functions}} - -cdef CUresult _cuMulticastUnbind(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMulticastUnbind - cuPythonInit() - if __cuMulticastUnbind == NULL: - with gil: - raise RuntimeError('Function "cuMulticastUnbind" not found') - err = ( __cuMulticastUnbind)(mcHandle, dev, mcOffset, size) - return err -{{endif}} - -{{if 'cuMulticastGetGranularity' in found_functions}} - -cdef CUresult _cuMulticastGetGranularity(size_t* granularity, const CUmulticastObjectProp* prop, CUmulticastGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMulticastGetGranularity - cuPythonInit() - if __cuMulticastGetGranularity == NULL: - with gil: - raise RuntimeError('Function "cuMulticastGetGranularity" not found') - err = ( __cuMulticastGetGranularity)(granularity, prop, option) - return err -{{endif}} - -{{if 'cuPointerGetAttribute' in found_functions}} - -cdef CUresult _cuPointerGetAttribute(void* data, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuPointerGetAttribute - cuPythonInit() - if __cuPointerGetAttribute == NULL: - with gil: - raise RuntimeError('Function "cuPointerGetAttribute" not found') - err = ( __cuPointerGetAttribute)(data, attribute, ptr) - 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: - global __cuMemPrefetchAsync_v2 - cuPythonInit() - if __cuMemPrefetchAsync_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemPrefetchAsync_v2" not found') - err = ( __cuMemPrefetchAsync_v2)(devPtr, count, location, flags, hStream) - 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: - global __cuMemAdvise_v2 - cuPythonInit() - if __cuMemAdvise_v2 == NULL: - with gil: - raise RuntimeError('Function "cuMemAdvise_v2" not found') - err = ( __cuMemAdvise_v2)(devPtr, count, advice, location) - 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: - global __cuMemRangeGetAttribute - cuPythonInit() - if __cuMemRangeGetAttribute == NULL: - with gil: - raise RuntimeError('Function "cuMemRangeGetAttribute" not found') - err = ( __cuMemRangeGetAttribute)(data, dataSize, attribute, devPtr, count) - return err -{{endif}} - -{{if 'cuMemRangeGetAttributes' in found_functions}} - -cdef CUresult _cuMemRangeGetAttributes(void** data, size_t* dataSizes, CUmem_range_attribute* attributes, size_t numAttributes, CUdeviceptr devPtr, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuMemRangeGetAttributes - cuPythonInit() - if __cuMemRangeGetAttributes == NULL: - with gil: - raise RuntimeError('Function "cuMemRangeGetAttributes" not found') - err = ( __cuMemRangeGetAttributes)(data, dataSizes, attributes, numAttributes, devPtr, count) - return err -{{endif}} - -{{if 'cuPointerSetAttribute' in found_functions}} - -cdef CUresult _cuPointerSetAttribute(const void* value, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuPointerSetAttribute - cuPythonInit() - if __cuPointerSetAttribute == NULL: - with gil: - raise RuntimeError('Function "cuPointerSetAttribute" not found') - err = ( __cuPointerSetAttribute)(value, attribute, ptr) - return err -{{endif}} - -{{if 'cuPointerGetAttributes' in found_functions}} - -cdef CUresult _cuPointerGetAttributes(unsigned int numAttributes, CUpointer_attribute* attributes, void** data, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuPointerGetAttributes - cuPythonInit() - if __cuPointerGetAttributes == NULL: - with gil: - raise RuntimeError('Function "cuPointerGetAttributes" not found') - err = ( __cuPointerGetAttributes)(numAttributes, attributes, data, ptr) - return err -{{endif}} - -{{if 'cuStreamCreate' in found_functions}} - -cdef CUresult _cuStreamCreate(CUstream* phStream, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamCreate - cuPythonInit() - if __cuStreamCreate == NULL: - with gil: - raise RuntimeError('Function "cuStreamCreate" not found') - err = ( __cuStreamCreate)(phStream, Flags) - return err -{{endif}} - -{{if 'cuStreamCreateWithPriority' in found_functions}} - -cdef CUresult _cuStreamCreateWithPriority(CUstream* phStream, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamCreateWithPriority - cuPythonInit() - if __cuStreamCreateWithPriority == NULL: - with gil: - raise RuntimeError('Function "cuStreamCreateWithPriority" not found') - err = ( __cuStreamCreateWithPriority)(phStream, flags, priority) - return err -{{endif}} - -{{if 'cuStreamBeginCaptureToCig' in found_functions}} - -cdef CUresult _cuStreamBeginCaptureToCig(CUstream hStream, CUstreamCigCaptureParams* streamCigCaptureParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamBeginCaptureToCig - cuPythonInit() - if __cuStreamBeginCaptureToCig == NULL: - with gil: - raise RuntimeError('Function "cuStreamBeginCaptureToCig" not found') - err = ( __cuStreamBeginCaptureToCig)(hStream, streamCigCaptureParams) - return err -{{endif}} - -{{if 'cuStreamEndCaptureToCig' in found_functions}} - -cdef CUresult _cuStreamEndCaptureToCig(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamEndCaptureToCig - cuPythonInit() - if __cuStreamEndCaptureToCig == NULL: - with gil: - raise RuntimeError('Function "cuStreamEndCaptureToCig" not found') - err = ( __cuStreamEndCaptureToCig)(hStream) - return err -{{endif}} - -{{if 'cuStreamGetPriority' in found_functions}} - -cdef CUresult _cuStreamGetPriority(CUstream hStream, int* priority) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamGetPriority - cuPythonInit() - if __cuStreamGetPriority == NULL: - with gil: - raise RuntimeError('Function "cuStreamGetPriority" not found') - err = ( __cuStreamGetPriority)(hStream, priority) - return err -{{endif}} - -{{if 'cuStreamGetDevice' in found_functions}} - -cdef CUresult _cuStreamGetDevice(CUstream hStream, CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamGetDevice - cuPythonInit() - if __cuStreamGetDevice == NULL: - with gil: - raise RuntimeError('Function "cuStreamGetDevice" not found') - err = ( __cuStreamGetDevice)(hStream, device) - return err -{{endif}} - -{{if 'cuStreamGetFlags' in found_functions}} - -cdef CUresult _cuStreamGetFlags(CUstream hStream, unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamGetFlags - cuPythonInit() - if __cuStreamGetFlags == NULL: - with gil: - raise RuntimeError('Function "cuStreamGetFlags" not found') - err = ( __cuStreamGetFlags)(hStream, flags) - return err -{{endif}} - -{{if 'cuStreamGetId' in found_functions}} - -cdef CUresult _cuStreamGetId(CUstream hStream, unsigned long long* streamId) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamGetId - cuPythonInit() - if __cuStreamGetId == NULL: - with gil: - raise RuntimeError('Function "cuStreamGetId" not found') - err = ( __cuStreamGetId)(hStream, streamId) - return err -{{endif}} - -{{if 'cuStreamGetCtx' in found_functions}} - -cdef CUresult _cuStreamGetCtx(CUstream hStream, CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamGetCtx - cuPythonInit() - if __cuStreamGetCtx == NULL: - with gil: - raise RuntimeError('Function "cuStreamGetCtx" not found') - err = ( __cuStreamGetCtx)(hStream, pctx) - return err -{{endif}} - -{{if 'cuStreamGetCtx_v2' in found_functions}} - -cdef CUresult _cuStreamGetCtx_v2(CUstream hStream, CUcontext* pCtx, CUgreenCtx* pGreenCtx) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamGetCtx_v2 - cuPythonInit() - if __cuStreamGetCtx_v2 == NULL: - with gil: - raise RuntimeError('Function "cuStreamGetCtx_v2" not found') - err = ( __cuStreamGetCtx_v2)(hStream, pCtx, pGreenCtx) - return err -{{endif}} - -{{if 'cuStreamWaitEvent' in found_functions}} - -cdef CUresult _cuStreamWaitEvent(CUstream hStream, CUevent hEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamWaitEvent - cuPythonInit() - if __cuStreamWaitEvent == NULL: - with gil: - raise RuntimeError('Function "cuStreamWaitEvent" not found') - err = ( __cuStreamWaitEvent)(hStream, hEvent, Flags) - return err -{{endif}} - -{{if 'cuStreamAddCallback' in found_functions}} - -cdef CUresult _cuStreamAddCallback(CUstream hStream, CUstreamCallback callback, void* userData, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamAddCallback - cuPythonInit() - if __cuStreamAddCallback == NULL: - with gil: - raise RuntimeError('Function "cuStreamAddCallback" not found') - err = ( __cuStreamAddCallback)(hStream, callback, userData, flags) - return err -{{endif}} - -{{if 'cuStreamBeginCapture_v2' in found_functions}} - -cdef CUresult _cuStreamBeginCapture_v2(CUstream hStream, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamBeginCapture_v2 - cuPythonInit() - if __cuStreamBeginCapture_v2 == NULL: - with gil: - raise RuntimeError('Function "cuStreamBeginCapture_v2" not found') - err = ( __cuStreamBeginCapture_v2)(hStream, mode) - return err -{{endif}} - -{{if 'cuStreamBeginCaptureToGraph' in found_functions}} - -cdef CUresult _cuStreamBeginCaptureToGraph(CUstream hStream, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamBeginCaptureToGraph - cuPythonInit() - if __cuStreamBeginCaptureToGraph == NULL: - with gil: - raise RuntimeError('Function "cuStreamBeginCaptureToGraph" not found') - err = ( __cuStreamBeginCaptureToGraph)(hStream, hGraph, dependencies, dependencyData, numDependencies, mode) - return err -{{endif}} - -{{if 'cuThreadExchangeStreamCaptureMode' in found_functions}} - -cdef CUresult _cuThreadExchangeStreamCaptureMode(CUstreamCaptureMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuThreadExchangeStreamCaptureMode - cuPythonInit() - if __cuThreadExchangeStreamCaptureMode == NULL: - with gil: - raise RuntimeError('Function "cuThreadExchangeStreamCaptureMode" not found') - err = ( __cuThreadExchangeStreamCaptureMode)(mode) - return err -{{endif}} - -{{if 'cuStreamEndCapture' in found_functions}} - -cdef CUresult _cuStreamEndCapture(CUstream hStream, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamEndCapture - cuPythonInit() - if __cuStreamEndCapture == NULL: - with gil: - raise RuntimeError('Function "cuStreamEndCapture" not found') - err = ( __cuStreamEndCapture)(hStream, phGraph) - return err -{{endif}} - -{{if 'cuStreamIsCapturing' in found_functions}} - -cdef CUresult _cuStreamIsCapturing(CUstream hStream, CUstreamCaptureStatus* captureStatus) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamIsCapturing - cuPythonInit() - if __cuStreamIsCapturing == NULL: - with gil: - raise RuntimeError('Function "cuStreamIsCapturing" not found') - err = ( __cuStreamIsCapturing)(hStream, captureStatus) - 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: - global __cuStreamGetCaptureInfo_v3 - cuPythonInit() - if __cuStreamGetCaptureInfo_v3 == NULL: - with gil: - raise RuntimeError('Function "cuStreamGetCaptureInfo_v3" not found') - err = ( __cuStreamGetCaptureInfo_v3)(hStream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out) - 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: - global __cuStreamUpdateCaptureDependencies_v2 - cuPythonInit() - if __cuStreamUpdateCaptureDependencies_v2 == NULL: - with gil: - raise RuntimeError('Function "cuStreamUpdateCaptureDependencies_v2" not found') - err = ( __cuStreamUpdateCaptureDependencies_v2)(hStream, dependencies, dependencyData, numDependencies, flags) - return err -{{endif}} - -{{if 'cuStreamAttachMemAsync' in found_functions}} - -cdef CUresult _cuStreamAttachMemAsync(CUstream hStream, CUdeviceptr dptr, size_t length, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamAttachMemAsync - cuPythonInit() - if __cuStreamAttachMemAsync == NULL: - with gil: - raise RuntimeError('Function "cuStreamAttachMemAsync" not found') - err = ( __cuStreamAttachMemAsync)(hStream, dptr, length, flags) - return err -{{endif}} - -{{if 'cuStreamQuery' in found_functions}} - -cdef CUresult _cuStreamQuery(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamQuery - cuPythonInit() - if __cuStreamQuery == NULL: - with gil: - raise RuntimeError('Function "cuStreamQuery" not found') - err = ( __cuStreamQuery)(hStream) - return err -{{endif}} - -{{if 'cuStreamSynchronize' in found_functions}} - -cdef CUresult _cuStreamSynchronize(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamSynchronize - cuPythonInit() - if __cuStreamSynchronize == NULL: - with gil: - raise RuntimeError('Function "cuStreamSynchronize" not found') - err = ( __cuStreamSynchronize)(hStream) - return err -{{endif}} - -{{if 'cuStreamDestroy_v2' in found_functions}} - -cdef CUresult _cuStreamDestroy_v2(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamDestroy_v2 - cuPythonInit() - if __cuStreamDestroy_v2 == NULL: - with gil: - raise RuntimeError('Function "cuStreamDestroy_v2" not found') - err = ( __cuStreamDestroy_v2)(hStream) - return err -{{endif}} - -{{if 'cuStreamCopyAttributes' in found_functions}} - -cdef CUresult _cuStreamCopyAttributes(CUstream dst, CUstream src) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamCopyAttributes - cuPythonInit() - if __cuStreamCopyAttributes == NULL: - with gil: - raise RuntimeError('Function "cuStreamCopyAttributes" not found') - err = ( __cuStreamCopyAttributes)(dst, src) - return err -{{endif}} - -{{if 'cuStreamGetAttribute' in found_functions}} - -cdef CUresult _cuStreamGetAttribute(CUstream hStream, CUstreamAttrID attr, CUstreamAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamGetAttribute - cuPythonInit() - if __cuStreamGetAttribute == NULL: - with gil: - raise RuntimeError('Function "cuStreamGetAttribute" not found') - err = ( __cuStreamGetAttribute)(hStream, attr, value_out) - return err -{{endif}} - -{{if 'cuStreamSetAttribute' in found_functions}} - -cdef CUresult _cuStreamSetAttribute(CUstream hStream, CUstreamAttrID attr, const CUstreamAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamSetAttribute - cuPythonInit() - if __cuStreamSetAttribute == NULL: - with gil: - raise RuntimeError('Function "cuStreamSetAttribute" not found') - err = ( __cuStreamSetAttribute)(hStream, attr, value) - return err -{{endif}} - -{{if 'cuEventCreate' in found_functions}} - -cdef CUresult _cuEventCreate(CUevent* phEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuEventCreate - cuPythonInit() - if __cuEventCreate == NULL: - with gil: - raise RuntimeError('Function "cuEventCreate" not found') - err = ( __cuEventCreate)(phEvent, Flags) - return err -{{endif}} - -{{if 'cuEventRecord' in found_functions}} - -cdef CUresult _cuEventRecord(CUevent hEvent, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuEventRecord - cuPythonInit() - if __cuEventRecord == NULL: - with gil: - raise RuntimeError('Function "cuEventRecord" not found') - err = ( __cuEventRecord)(hEvent, hStream) - return err -{{endif}} - -{{if 'cuEventRecordWithFlags' in found_functions}} - -cdef CUresult _cuEventRecordWithFlags(CUevent hEvent, CUstream hStream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuEventRecordWithFlags - cuPythonInit() - if __cuEventRecordWithFlags == NULL: - with gil: - raise RuntimeError('Function "cuEventRecordWithFlags" not found') - err = ( __cuEventRecordWithFlags)(hEvent, hStream, flags) - return err -{{endif}} - -{{if 'cuEventQuery' in found_functions}} - -cdef CUresult _cuEventQuery(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuEventQuery - cuPythonInit() - if __cuEventQuery == NULL: - with gil: - raise RuntimeError('Function "cuEventQuery" not found') - err = ( __cuEventQuery)(hEvent) - return err -{{endif}} - -{{if 'cuEventSynchronize' in found_functions}} - -cdef CUresult _cuEventSynchronize(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuEventSynchronize - cuPythonInit() - if __cuEventSynchronize == NULL: - with gil: - raise RuntimeError('Function "cuEventSynchronize" not found') - err = ( __cuEventSynchronize)(hEvent) - return err -{{endif}} - -{{if 'cuEventDestroy_v2' in found_functions}} - -cdef CUresult _cuEventDestroy_v2(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuEventDestroy_v2 - cuPythonInit() - if __cuEventDestroy_v2 == NULL: - with gil: - raise RuntimeError('Function "cuEventDestroy_v2" not found') - err = ( __cuEventDestroy_v2)(hEvent) - 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: - global __cuEventElapsedTime_v2 - cuPythonInit() - if __cuEventElapsedTime_v2 == NULL: - with gil: - raise RuntimeError('Function "cuEventElapsedTime_v2" not found') - err = ( __cuEventElapsedTime_v2)(pMilliseconds, hStart, hEnd) - return err -{{endif}} - -{{if 'cuImportExternalMemory' in found_functions}} - -cdef CUresult _cuImportExternalMemory(CUexternalMemory* extMem_out, const CUDA_EXTERNAL_MEMORY_HANDLE_DESC* memHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuImportExternalMemory - cuPythonInit() - if __cuImportExternalMemory == NULL: - with gil: - raise RuntimeError('Function "cuImportExternalMemory" not found') - err = ( __cuImportExternalMemory)(extMem_out, memHandleDesc) - return err -{{endif}} - -{{if 'cuExternalMemoryGetMappedBuffer' in found_functions}} - -cdef CUresult _cuExternalMemoryGetMappedBuffer(CUdeviceptr* devPtr, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_BUFFER_DESC* bufferDesc) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuExternalMemoryGetMappedBuffer - cuPythonInit() - if __cuExternalMemoryGetMappedBuffer == NULL: - with gil: - raise RuntimeError('Function "cuExternalMemoryGetMappedBuffer" not found') - err = ( __cuExternalMemoryGetMappedBuffer)(devPtr, extMem, bufferDesc) - return err -{{endif}} - -{{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}} - -cdef CUresult _cuExternalMemoryGetMappedMipmappedArray(CUmipmappedArray* mipmap, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC* mipmapDesc) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuExternalMemoryGetMappedMipmappedArray - cuPythonInit() - if __cuExternalMemoryGetMappedMipmappedArray == NULL: - with gil: - raise RuntimeError('Function "cuExternalMemoryGetMappedMipmappedArray" not found') - err = ( __cuExternalMemoryGetMappedMipmappedArray)(mipmap, extMem, mipmapDesc) - return err -{{endif}} - -{{if 'cuDestroyExternalMemory' in found_functions}} - -cdef CUresult _cuDestroyExternalMemory(CUexternalMemory extMem) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDestroyExternalMemory - cuPythonInit() - if __cuDestroyExternalMemory == NULL: - with gil: - raise RuntimeError('Function "cuDestroyExternalMemory" not found') - err = ( __cuDestroyExternalMemory)(extMem) - return err -{{endif}} - -{{if 'cuImportExternalSemaphore' in found_functions}} - -cdef CUresult _cuImportExternalSemaphore(CUexternalSemaphore* extSem_out, const CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC* semHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuImportExternalSemaphore - cuPythonInit() - if __cuImportExternalSemaphore == NULL: - with gil: - raise RuntimeError('Function "cuImportExternalSemaphore" not found') - err = ( __cuImportExternalSemaphore)(extSem_out, semHandleDesc) - return err -{{endif}} - -{{if 'cuSignalExternalSemaphoresAsync' in found_functions}} - -cdef CUresult _cuSignalExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuSignalExternalSemaphoresAsync - cuPythonInit() - if __cuSignalExternalSemaphoresAsync == NULL: - with gil: - raise RuntimeError('Function "cuSignalExternalSemaphoresAsync" not found') - err = ( __cuSignalExternalSemaphoresAsync)(extSemArray, paramsArray, numExtSems, stream) - return err -{{endif}} - -{{if 'cuWaitExternalSemaphoresAsync' in found_functions}} - -cdef CUresult _cuWaitExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuWaitExternalSemaphoresAsync - cuPythonInit() - if __cuWaitExternalSemaphoresAsync == NULL: - with gil: - raise RuntimeError('Function "cuWaitExternalSemaphoresAsync" not found') - err = ( __cuWaitExternalSemaphoresAsync)(extSemArray, paramsArray, numExtSems, stream) - return err -{{endif}} - -{{if 'cuDestroyExternalSemaphore' in found_functions}} - -cdef CUresult _cuDestroyExternalSemaphore(CUexternalSemaphore extSem) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDestroyExternalSemaphore - cuPythonInit() - if __cuDestroyExternalSemaphore == NULL: - with gil: - raise RuntimeError('Function "cuDestroyExternalSemaphore" not found') - err = ( __cuDestroyExternalSemaphore)(extSem) - return err -{{endif}} - -{{if 'cuStreamWaitValue32_v2' in found_functions}} - -cdef CUresult _cuStreamWaitValue32_v2(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamWaitValue32_v2 - cuPythonInit() - if __cuStreamWaitValue32_v2 == NULL: - with gil: - raise RuntimeError('Function "cuStreamWaitValue32_v2" not found') - err = ( __cuStreamWaitValue32_v2)(stream, addr, value, flags) - return err -{{endif}} - -{{if 'cuStreamWaitValue64_v2' in found_functions}} - -cdef CUresult _cuStreamWaitValue64_v2(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamWaitValue64_v2 - cuPythonInit() - if __cuStreamWaitValue64_v2 == NULL: - with gil: - raise RuntimeError('Function "cuStreamWaitValue64_v2" not found') - err = ( __cuStreamWaitValue64_v2)(stream, addr, value, flags) - return err -{{endif}} - -{{if 'cuStreamWriteValue32_v2' in found_functions}} - -cdef CUresult _cuStreamWriteValue32_v2(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamWriteValue32_v2 - cuPythonInit() - if __cuStreamWriteValue32_v2 == NULL: - with gil: - raise RuntimeError('Function "cuStreamWriteValue32_v2" not found') - err = ( __cuStreamWriteValue32_v2)(stream, addr, value, flags) - return err -{{endif}} - -{{if 'cuStreamWriteValue64_v2' in found_functions}} - -cdef CUresult _cuStreamWriteValue64_v2(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamWriteValue64_v2 - cuPythonInit() - if __cuStreamWriteValue64_v2 == NULL: - with gil: - raise RuntimeError('Function "cuStreamWriteValue64_v2" not found') - err = ( __cuStreamWriteValue64_v2)(stream, addr, value, flags) - return err -{{endif}} - -{{if 'cuStreamBatchMemOp_v2' in found_functions}} - -cdef CUresult _cuStreamBatchMemOp_v2(CUstream stream, unsigned int count, CUstreamBatchMemOpParams* paramArray, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamBatchMemOp_v2 - cuPythonInit() - if __cuStreamBatchMemOp_v2 == NULL: - with gil: - raise RuntimeError('Function "cuStreamBatchMemOp_v2" not found') - err = ( __cuStreamBatchMemOp_v2)(stream, count, paramArray, flags) - return err -{{endif}} - -{{if 'cuFuncGetAttribute' in found_functions}} - -cdef CUresult _cuFuncGetAttribute(int* pi, CUfunction_attribute attrib, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuFuncGetAttribute - cuPythonInit() - if __cuFuncGetAttribute == NULL: - with gil: - raise RuntimeError('Function "cuFuncGetAttribute" not found') - err = ( __cuFuncGetAttribute)(pi, attrib, hfunc) - return err -{{endif}} - -{{if 'cuFuncSetAttribute' in found_functions}} - -cdef CUresult _cuFuncSetAttribute(CUfunction hfunc, CUfunction_attribute attrib, int value) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuFuncSetAttribute - cuPythonInit() - if __cuFuncSetAttribute == NULL: - with gil: - raise RuntimeError('Function "cuFuncSetAttribute" not found') - err = ( __cuFuncSetAttribute)(hfunc, attrib, value) - return err -{{endif}} - -{{if 'cuFuncSetCacheConfig' in found_functions}} - -cdef CUresult _cuFuncSetCacheConfig(CUfunction hfunc, CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuFuncSetCacheConfig - cuPythonInit() - if __cuFuncSetCacheConfig == NULL: - with gil: - raise RuntimeError('Function "cuFuncSetCacheConfig" not found') - err = ( __cuFuncSetCacheConfig)(hfunc, config) - return err -{{endif}} - -{{if 'cuFuncGetModule' in found_functions}} - -cdef CUresult _cuFuncGetModule(CUmodule* hmod, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuFuncGetModule - cuPythonInit() - if __cuFuncGetModule == NULL: - with gil: - raise RuntimeError('Function "cuFuncGetModule" not found') - err = ( __cuFuncGetModule)(hmod, hfunc) - return err -{{endif}} - -{{if 'cuFuncGetName' in found_functions}} - -cdef CUresult _cuFuncGetName(const char** name, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuFuncGetName - cuPythonInit() - if __cuFuncGetName == NULL: - with gil: - raise RuntimeError('Function "cuFuncGetName" not found') - err = ( __cuFuncGetName)(name, hfunc) - return err -{{endif}} - -{{if 'cuFuncGetParamInfo' in found_functions}} - -cdef CUresult _cuFuncGetParamInfo(CUfunction func, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuFuncGetParamInfo - cuPythonInit() - if __cuFuncGetParamInfo == NULL: - with gil: - raise RuntimeError('Function "cuFuncGetParamInfo" not found') - err = ( __cuFuncGetParamInfo)(func, paramIndex, paramOffset, paramSize) - return err -{{endif}} - -{{if 'cuFuncGetParamCount' in found_functions}} - -cdef CUresult _cuFuncGetParamCount(CUfunction func, size_t* paramCount) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuFuncGetParamCount - cuPythonInit() - if __cuFuncGetParamCount == NULL: - with gil: - raise RuntimeError('Function "cuFuncGetParamCount" not found') - err = ( __cuFuncGetParamCount)(func, paramCount) - return err -{{endif}} - -{{if 'cuFuncIsLoaded' in found_functions}} - -cdef CUresult _cuFuncIsLoaded(CUfunctionLoadingState* state, CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuFuncIsLoaded - cuPythonInit() - if __cuFuncIsLoaded == NULL: - with gil: - raise RuntimeError('Function "cuFuncIsLoaded" not found') - err = ( __cuFuncIsLoaded)(state, function) - return err -{{endif}} - -{{if 'cuFuncLoad' in found_functions}} - -cdef CUresult _cuFuncLoad(CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuFuncLoad - cuPythonInit() - if __cuFuncLoad == NULL: - with gil: - raise RuntimeError('Function "cuFuncLoad" not found') - err = ( __cuFuncLoad)(function) - return err -{{endif}} - -{{if 'cuLaunchKernel' in found_functions}} - -cdef CUresult _cuLaunchKernel(CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, CUstream hStream, void** kernelParams, void** extra) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLaunchKernel - cuPythonInit() - if __cuLaunchKernel == NULL: - with gil: - raise RuntimeError('Function "cuLaunchKernel" not found') - err = ( __cuLaunchKernel)(f, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, hStream, kernelParams, extra) - return err -{{endif}} - -{{if 'cuLaunchKernelEx' in found_functions}} - -cdef CUresult _cuLaunchKernelEx(const CUlaunchConfig* config, CUfunction f, void** kernelParams, void** extra) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLaunchKernelEx - cuPythonInit() - if __cuLaunchKernelEx == NULL: - with gil: - raise RuntimeError('Function "cuLaunchKernelEx" not found') - err = ( __cuLaunchKernelEx)(config, f, kernelParams, extra) - return err -{{endif}} - -{{if 'cuLaunchCooperativeKernel' in found_functions}} - -cdef CUresult _cuLaunchCooperativeKernel(CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, CUstream hStream, void** kernelParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLaunchCooperativeKernel - cuPythonInit() - if __cuLaunchCooperativeKernel == NULL: - with gil: - raise RuntimeError('Function "cuLaunchCooperativeKernel" not found') - err = ( __cuLaunchCooperativeKernel)(f, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, hStream, kernelParams) - return err -{{endif}} - -{{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}} - -cdef CUresult _cuLaunchCooperativeKernelMultiDevice(CUDA_LAUNCH_PARAMS* launchParamsList, unsigned int numDevices, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLaunchCooperativeKernelMultiDevice - cuPythonInit() - if __cuLaunchCooperativeKernelMultiDevice == NULL: - with gil: - raise RuntimeError('Function "cuLaunchCooperativeKernelMultiDevice" not found') - err = ( __cuLaunchCooperativeKernelMultiDevice)(launchParamsList, numDevices, flags) - return err -{{endif}} - -{{if 'cuLaunchHostFunc' in found_functions}} - -cdef CUresult _cuLaunchHostFunc(CUstream hStream, CUhostFn fn, void* userData) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLaunchHostFunc - cuPythonInit() - if __cuLaunchHostFunc == NULL: - with gil: - raise RuntimeError('Function "cuLaunchHostFunc" not found') - err = ( __cuLaunchHostFunc)(hStream, fn, userData) - return err -{{endif}} - -{{if 'cuLaunchHostFunc_v2' in found_functions}} - -cdef CUresult _cuLaunchHostFunc_v2(CUstream hStream, CUhostFn fn, void* userData, unsigned int syncMode) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLaunchHostFunc_v2 - cuPythonInit() - if __cuLaunchHostFunc_v2 == NULL: - with gil: - raise RuntimeError('Function "cuLaunchHostFunc_v2" not found') - err = ( __cuLaunchHostFunc_v2)(hStream, fn, userData, syncMode) - return err -{{endif}} - -{{if 'cuFuncSetBlockShape' in found_functions}} - -cdef CUresult _cuFuncSetBlockShape(CUfunction hfunc, int x, int y, int z) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuFuncSetBlockShape - cuPythonInit() - if __cuFuncSetBlockShape == NULL: - with gil: - raise RuntimeError('Function "cuFuncSetBlockShape" not found') - err = ( __cuFuncSetBlockShape)(hfunc, x, y, z) - return err -{{endif}} - -{{if 'cuFuncSetSharedSize' in found_functions}} - -cdef CUresult _cuFuncSetSharedSize(CUfunction hfunc, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuFuncSetSharedSize - cuPythonInit() - if __cuFuncSetSharedSize == NULL: - with gil: - raise RuntimeError('Function "cuFuncSetSharedSize" not found') - err = ( __cuFuncSetSharedSize)(hfunc, numbytes) - return err -{{endif}} - -{{if 'cuParamSetSize' in found_functions}} - -cdef CUresult _cuParamSetSize(CUfunction hfunc, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuParamSetSize - cuPythonInit() - if __cuParamSetSize == NULL: - with gil: - raise RuntimeError('Function "cuParamSetSize" not found') - err = ( __cuParamSetSize)(hfunc, numbytes) - return err -{{endif}} - -{{if 'cuParamSeti' in found_functions}} - -cdef CUresult _cuParamSeti(CUfunction hfunc, int offset, unsigned int value) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuParamSeti - cuPythonInit() - if __cuParamSeti == NULL: - with gil: - raise RuntimeError('Function "cuParamSeti" not found') - err = ( __cuParamSeti)(hfunc, offset, value) - return err -{{endif}} - -{{if 'cuParamSetf' in found_functions}} - -cdef CUresult _cuParamSetf(CUfunction hfunc, int offset, float value) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuParamSetf - cuPythonInit() - if __cuParamSetf == NULL: - with gil: - raise RuntimeError('Function "cuParamSetf" not found') - err = ( __cuParamSetf)(hfunc, offset, value) - return err -{{endif}} - -{{if 'cuParamSetv' in found_functions}} - -cdef CUresult _cuParamSetv(CUfunction hfunc, int offset, void* ptr, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuParamSetv - cuPythonInit() - if __cuParamSetv == NULL: - with gil: - raise RuntimeError('Function "cuParamSetv" not found') - err = ( __cuParamSetv)(hfunc, offset, ptr, numbytes) - return err -{{endif}} - -{{if 'cuLaunch' in found_functions}} - -cdef CUresult _cuLaunch(CUfunction f) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLaunch - cuPythonInit() - if __cuLaunch == NULL: - with gil: - raise RuntimeError('Function "cuLaunch" not found') - err = ( __cuLaunch)(f) - return err -{{endif}} - -{{if 'cuLaunchGrid' in found_functions}} - -cdef CUresult _cuLaunchGrid(CUfunction f, int grid_width, int grid_height) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLaunchGrid - cuPythonInit() - if __cuLaunchGrid == NULL: - with gil: - raise RuntimeError('Function "cuLaunchGrid" not found') - err = ( __cuLaunchGrid)(f, grid_width, grid_height) - return err -{{endif}} - -{{if 'cuLaunchGridAsync' in found_functions}} - -cdef CUresult _cuLaunchGridAsync(CUfunction f, int grid_width, int grid_height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLaunchGridAsync - cuPythonInit() - if __cuLaunchGridAsync == NULL: - with gil: - raise RuntimeError('Function "cuLaunchGridAsync" not found') - err = ( __cuLaunchGridAsync)(f, grid_width, grid_height, hStream) - return err -{{endif}} - -{{if 'cuParamSetTexRef' in found_functions}} - -cdef CUresult _cuParamSetTexRef(CUfunction hfunc, int texunit, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuParamSetTexRef - cuPythonInit() - if __cuParamSetTexRef == NULL: - with gil: - raise RuntimeError('Function "cuParamSetTexRef" not found') - err = ( __cuParamSetTexRef)(hfunc, texunit, hTexRef) - return err -{{endif}} - -{{if 'cuFuncSetSharedMemConfig' in found_functions}} - -cdef CUresult _cuFuncSetSharedMemConfig(CUfunction hfunc, CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuFuncSetSharedMemConfig - cuPythonInit() - if __cuFuncSetSharedMemConfig == NULL: - with gil: - raise RuntimeError('Function "cuFuncSetSharedMemConfig" not found') - err = ( __cuFuncSetSharedMemConfig)(hfunc, config) - return err -{{endif}} - -{{if 'cuGraphCreate' in found_functions}} - -cdef CUresult _cuGraphCreate(CUgraph* phGraph, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphCreate - cuPythonInit() - if __cuGraphCreate == NULL: - with gil: - raise RuntimeError('Function "cuGraphCreate" not found') - err = ( __cuGraphCreate)(phGraph, flags) - return err -{{endif}} - -{{if 'cuGraphAddKernelNode_v2' in found_functions}} - -cdef CUresult _cuGraphAddKernelNode_v2(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphAddKernelNode_v2 - cuPythonInit() - if __cuGraphAddKernelNode_v2 == NULL: - with gil: - raise RuntimeError('Function "cuGraphAddKernelNode_v2" not found') - err = ( __cuGraphAddKernelNode_v2)(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) - return err -{{endif}} - -{{if 'cuGraphKernelNodeGetParams_v2' in found_functions}} - -cdef CUresult _cuGraphKernelNodeGetParams_v2(CUgraphNode hNode, CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphKernelNodeGetParams_v2 - cuPythonInit() - if __cuGraphKernelNodeGetParams_v2 == NULL: - with gil: - raise RuntimeError('Function "cuGraphKernelNodeGetParams_v2" not found') - err = ( __cuGraphKernelNodeGetParams_v2)(hNode, nodeParams) - return err -{{endif}} - -{{if 'cuGraphKernelNodeSetParams_v2' in found_functions}} - -cdef CUresult _cuGraphKernelNodeSetParams_v2(CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphKernelNodeSetParams_v2 - cuPythonInit() - if __cuGraphKernelNodeSetParams_v2 == NULL: - with gil: - raise RuntimeError('Function "cuGraphKernelNodeSetParams_v2" not found') - err = ( __cuGraphKernelNodeSetParams_v2)(hNode, nodeParams) - return err -{{endif}} - -{{if 'cuGraphAddMemcpyNode' in found_functions}} - -cdef CUresult _cuGraphAddMemcpyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_MEMCPY3D* copyParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphAddMemcpyNode - cuPythonInit() - if __cuGraphAddMemcpyNode == NULL: - with gil: - raise RuntimeError('Function "cuGraphAddMemcpyNode" not found') - err = ( __cuGraphAddMemcpyNode)(phGraphNode, hGraph, dependencies, numDependencies, copyParams, ctx) - return err -{{endif}} - -{{if 'cuGraphMemcpyNodeGetParams' in found_functions}} - -cdef CUresult _cuGraphMemcpyNodeGetParams(CUgraphNode hNode, CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphMemcpyNodeGetParams - cuPythonInit() - if __cuGraphMemcpyNodeGetParams == NULL: - with gil: - raise RuntimeError('Function "cuGraphMemcpyNodeGetParams" not found') - err = ( __cuGraphMemcpyNodeGetParams)(hNode, nodeParams) - return err -{{endif}} - -{{if 'cuGraphMemcpyNodeSetParams' in found_functions}} - -cdef CUresult _cuGraphMemcpyNodeSetParams(CUgraphNode hNode, const CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphMemcpyNodeSetParams - cuPythonInit() - if __cuGraphMemcpyNodeSetParams == NULL: - with gil: - raise RuntimeError('Function "cuGraphMemcpyNodeSetParams" not found') - err = ( __cuGraphMemcpyNodeSetParams)(hNode, nodeParams) - return err -{{endif}} - -{{if 'cuGraphAddMemsetNode' in found_functions}} - -cdef CUresult _cuGraphAddMemsetNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_MEMSET_NODE_PARAMS* memsetParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphAddMemsetNode - cuPythonInit() - if __cuGraphAddMemsetNode == NULL: - with gil: - raise RuntimeError('Function "cuGraphAddMemsetNode" not found') - err = ( __cuGraphAddMemsetNode)(phGraphNode, hGraph, dependencies, numDependencies, memsetParams, ctx) - return err -{{endif}} - -{{if 'cuGraphMemsetNodeGetParams' in found_functions}} - -cdef CUresult _cuGraphMemsetNodeGetParams(CUgraphNode hNode, CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphMemsetNodeGetParams - cuPythonInit() - if __cuGraphMemsetNodeGetParams == NULL: - with gil: - raise RuntimeError('Function "cuGraphMemsetNodeGetParams" not found') - err = ( __cuGraphMemsetNodeGetParams)(hNode, nodeParams) - return err -{{endif}} - -{{if 'cuGraphMemsetNodeSetParams' in found_functions}} - -cdef CUresult _cuGraphMemsetNodeSetParams(CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphMemsetNodeSetParams - cuPythonInit() - if __cuGraphMemsetNodeSetParams == NULL: - with gil: - raise RuntimeError('Function "cuGraphMemsetNodeSetParams" not found') - err = ( __cuGraphMemsetNodeSetParams)(hNode, nodeParams) - return err -{{endif}} - -{{if 'cuGraphAddHostNode' in found_functions}} - -cdef CUresult _cuGraphAddHostNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphAddHostNode - cuPythonInit() - if __cuGraphAddHostNode == NULL: - with gil: - raise RuntimeError('Function "cuGraphAddHostNode" not found') - err = ( __cuGraphAddHostNode)(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) - return err -{{endif}} - -{{if 'cuGraphHostNodeGetParams' in found_functions}} - -cdef CUresult _cuGraphHostNodeGetParams(CUgraphNode hNode, CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphHostNodeGetParams - cuPythonInit() - if __cuGraphHostNodeGetParams == NULL: - with gil: - raise RuntimeError('Function "cuGraphHostNodeGetParams" not found') - err = ( __cuGraphHostNodeGetParams)(hNode, nodeParams) - return err -{{endif}} - -{{if 'cuGraphHostNodeSetParams' in found_functions}} - -cdef CUresult _cuGraphHostNodeSetParams(CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphHostNodeSetParams - cuPythonInit() - if __cuGraphHostNodeSetParams == NULL: - with gil: - raise RuntimeError('Function "cuGraphHostNodeSetParams" not found') - err = ( __cuGraphHostNodeSetParams)(hNode, nodeParams) - return err -{{endif}} - -{{if 'cuGraphAddChildGraphNode' in found_functions}} - -cdef CUresult _cuGraphAddChildGraphNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphAddChildGraphNode - cuPythonInit() - if __cuGraphAddChildGraphNode == NULL: - with gil: - raise RuntimeError('Function "cuGraphAddChildGraphNode" not found') - err = ( __cuGraphAddChildGraphNode)(phGraphNode, hGraph, dependencies, numDependencies, childGraph) - return err -{{endif}} - -{{if 'cuGraphChildGraphNodeGetGraph' in found_functions}} - -cdef CUresult _cuGraphChildGraphNodeGetGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphChildGraphNodeGetGraph - cuPythonInit() - if __cuGraphChildGraphNodeGetGraph == NULL: - with gil: - raise RuntimeError('Function "cuGraphChildGraphNodeGetGraph" not found') - err = ( __cuGraphChildGraphNodeGetGraph)(hNode, phGraph) - return err -{{endif}} - -{{if 'cuGraphAddEmptyNode' in found_functions}} - -cdef CUresult _cuGraphAddEmptyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphAddEmptyNode - cuPythonInit() - if __cuGraphAddEmptyNode == NULL: - with gil: - raise RuntimeError('Function "cuGraphAddEmptyNode" not found') - err = ( __cuGraphAddEmptyNode)(phGraphNode, hGraph, dependencies, numDependencies) - return err -{{endif}} - -{{if 'cuGraphAddEventRecordNode' in found_functions}} - -cdef CUresult _cuGraphAddEventRecordNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphAddEventRecordNode - cuPythonInit() - if __cuGraphAddEventRecordNode == NULL: - with gil: - raise RuntimeError('Function "cuGraphAddEventRecordNode" not found') - err = ( __cuGraphAddEventRecordNode)(phGraphNode, hGraph, dependencies, numDependencies, event) - return err -{{endif}} - -{{if 'cuGraphEventRecordNodeGetEvent' in found_functions}} - -cdef CUresult _cuGraphEventRecordNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphEventRecordNodeGetEvent - cuPythonInit() - if __cuGraphEventRecordNodeGetEvent == NULL: - with gil: - raise RuntimeError('Function "cuGraphEventRecordNodeGetEvent" not found') - err = ( __cuGraphEventRecordNodeGetEvent)(hNode, event_out) - return err -{{endif}} - -{{if 'cuGraphEventRecordNodeSetEvent' in found_functions}} - -cdef CUresult _cuGraphEventRecordNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphEventRecordNodeSetEvent - cuPythonInit() - if __cuGraphEventRecordNodeSetEvent == NULL: - with gil: - raise RuntimeError('Function "cuGraphEventRecordNodeSetEvent" not found') - err = ( __cuGraphEventRecordNodeSetEvent)(hNode, event) - return err -{{endif}} - -{{if 'cuGraphAddEventWaitNode' in found_functions}} - -cdef CUresult _cuGraphAddEventWaitNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphAddEventWaitNode - cuPythonInit() - if __cuGraphAddEventWaitNode == NULL: - with gil: - raise RuntimeError('Function "cuGraphAddEventWaitNode" not found') - err = ( __cuGraphAddEventWaitNode)(phGraphNode, hGraph, dependencies, numDependencies, event) - return err -{{endif}} - -{{if 'cuGraphEventWaitNodeGetEvent' in found_functions}} - -cdef CUresult _cuGraphEventWaitNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphEventWaitNodeGetEvent - cuPythonInit() - if __cuGraphEventWaitNodeGetEvent == NULL: - with gil: - raise RuntimeError('Function "cuGraphEventWaitNodeGetEvent" not found') - err = ( __cuGraphEventWaitNodeGetEvent)(hNode, event_out) - return err -{{endif}} - -{{if 'cuGraphEventWaitNodeSetEvent' in found_functions}} - -cdef CUresult _cuGraphEventWaitNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphEventWaitNodeSetEvent - cuPythonInit() - if __cuGraphEventWaitNodeSetEvent == NULL: - with gil: - raise RuntimeError('Function "cuGraphEventWaitNodeSetEvent" not found') - err = ( __cuGraphEventWaitNodeSetEvent)(hNode, event) - return err -{{endif}} - -{{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}} - -cdef CUresult _cuGraphAddExternalSemaphoresSignalNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphAddExternalSemaphoresSignalNode - cuPythonInit() - if __cuGraphAddExternalSemaphoresSignalNode == NULL: - with gil: - raise RuntimeError('Function "cuGraphAddExternalSemaphoresSignalNode" not found') - err = ( __cuGraphAddExternalSemaphoresSignalNode)(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) - return err -{{endif}} - -{{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} - -cdef CUresult _cuGraphExternalSemaphoresSignalNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphExternalSemaphoresSignalNodeGetParams - cuPythonInit() - if __cuGraphExternalSemaphoresSignalNodeGetParams == NULL: - with gil: - raise RuntimeError('Function "cuGraphExternalSemaphoresSignalNodeGetParams" not found') - err = ( __cuGraphExternalSemaphoresSignalNodeGetParams)(hNode, params_out) - return err -{{endif}} - -{{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} - -cdef CUresult _cuGraphExternalSemaphoresSignalNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphExternalSemaphoresSignalNodeSetParams - cuPythonInit() - if __cuGraphExternalSemaphoresSignalNodeSetParams == NULL: - with gil: - raise RuntimeError('Function "cuGraphExternalSemaphoresSignalNodeSetParams" not found') - err = ( __cuGraphExternalSemaphoresSignalNodeSetParams)(hNode, nodeParams) - return err -{{endif}} - -{{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}} - -cdef CUresult _cuGraphAddExternalSemaphoresWaitNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphAddExternalSemaphoresWaitNode - cuPythonInit() - if __cuGraphAddExternalSemaphoresWaitNode == NULL: - with gil: - raise RuntimeError('Function "cuGraphAddExternalSemaphoresWaitNode" not found') - err = ( __cuGraphAddExternalSemaphoresWaitNode)(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) - return err -{{endif}} - -{{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} - -cdef CUresult _cuGraphExternalSemaphoresWaitNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_WAIT_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphExternalSemaphoresWaitNodeGetParams - cuPythonInit() - if __cuGraphExternalSemaphoresWaitNodeGetParams == NULL: - with gil: - raise RuntimeError('Function "cuGraphExternalSemaphoresWaitNodeGetParams" not found') - err = ( __cuGraphExternalSemaphoresWaitNodeGetParams)(hNode, params_out) - return err -{{endif}} - -{{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} - -cdef CUresult _cuGraphExternalSemaphoresWaitNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphExternalSemaphoresWaitNodeSetParams - cuPythonInit() - if __cuGraphExternalSemaphoresWaitNodeSetParams == NULL: - with gil: - raise RuntimeError('Function "cuGraphExternalSemaphoresWaitNodeSetParams" not found') - err = ( __cuGraphExternalSemaphoresWaitNodeSetParams)(hNode, nodeParams) - return err -{{endif}} - -{{if 'cuGraphAddBatchMemOpNode' in found_functions}} - -cdef CUresult _cuGraphAddBatchMemOpNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphAddBatchMemOpNode - cuPythonInit() - if __cuGraphAddBatchMemOpNode == NULL: - with gil: - raise RuntimeError('Function "cuGraphAddBatchMemOpNode" not found') - err = ( __cuGraphAddBatchMemOpNode)(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) - return err -{{endif}} - -{{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}} - -cdef CUresult _cuGraphBatchMemOpNodeGetParams(CUgraphNode hNode, CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams_out) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphBatchMemOpNodeGetParams - cuPythonInit() - if __cuGraphBatchMemOpNodeGetParams == NULL: - with gil: - raise RuntimeError('Function "cuGraphBatchMemOpNodeGetParams" not found') - err = ( __cuGraphBatchMemOpNodeGetParams)(hNode, nodeParams_out) - return err -{{endif}} - -{{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}} - -cdef CUresult _cuGraphBatchMemOpNodeSetParams(CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphBatchMemOpNodeSetParams - cuPythonInit() - if __cuGraphBatchMemOpNodeSetParams == NULL: - with gil: - raise RuntimeError('Function "cuGraphBatchMemOpNodeSetParams" not found') - err = ( __cuGraphBatchMemOpNodeSetParams)(hNode, nodeParams) - return err -{{endif}} - -{{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}} - -cdef CUresult _cuGraphExecBatchMemOpNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphExecBatchMemOpNodeSetParams - cuPythonInit() - if __cuGraphExecBatchMemOpNodeSetParams == NULL: - with gil: - raise RuntimeError('Function "cuGraphExecBatchMemOpNodeSetParams" not found') - err = ( __cuGraphExecBatchMemOpNodeSetParams)(hGraphExec, hNode, nodeParams) - return err -{{endif}} - -{{if 'cuGraphAddMemAllocNode' in found_functions}} - -cdef CUresult _cuGraphAddMemAllocNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUDA_MEM_ALLOC_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphAddMemAllocNode - cuPythonInit() - if __cuGraphAddMemAllocNode == NULL: - with gil: - raise RuntimeError('Function "cuGraphAddMemAllocNode" not found') - err = ( __cuGraphAddMemAllocNode)(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) - return err -{{endif}} - -{{if 'cuGraphMemAllocNodeGetParams' in found_functions}} - -cdef CUresult _cuGraphMemAllocNodeGetParams(CUgraphNode hNode, CUDA_MEM_ALLOC_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphMemAllocNodeGetParams - cuPythonInit() - if __cuGraphMemAllocNodeGetParams == NULL: - with gil: - raise RuntimeError('Function "cuGraphMemAllocNodeGetParams" not found') - err = ( __cuGraphMemAllocNodeGetParams)(hNode, params_out) - return err -{{endif}} - -{{if 'cuGraphAddMemFreeNode' in found_functions}} - -cdef CUresult _cuGraphAddMemFreeNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphAddMemFreeNode - cuPythonInit() - if __cuGraphAddMemFreeNode == NULL: - with gil: - raise RuntimeError('Function "cuGraphAddMemFreeNode" not found') - err = ( __cuGraphAddMemFreeNode)(phGraphNode, hGraph, dependencies, numDependencies, dptr) - return err -{{endif}} - -{{if 'cuGraphMemFreeNodeGetParams' in found_functions}} - -cdef CUresult _cuGraphMemFreeNodeGetParams(CUgraphNode hNode, CUdeviceptr* dptr_out) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphMemFreeNodeGetParams - cuPythonInit() - if __cuGraphMemFreeNodeGetParams == NULL: - with gil: - raise RuntimeError('Function "cuGraphMemFreeNodeGetParams" not found') - err = ( __cuGraphMemFreeNodeGetParams)(hNode, dptr_out) - return err -{{endif}} - -{{if 'cuDeviceGraphMemTrim' in found_functions}} - -cdef CUresult _cuDeviceGraphMemTrim(CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDeviceGraphMemTrim - cuPythonInit() - if __cuDeviceGraphMemTrim == NULL: - with gil: - raise RuntimeError('Function "cuDeviceGraphMemTrim" not found') - err = ( __cuDeviceGraphMemTrim)(device) - return err -{{endif}} - -{{if 'cuDeviceGetGraphMemAttribute' in found_functions}} - -cdef CUresult _cuDeviceGetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDeviceGetGraphMemAttribute - cuPythonInit() - if __cuDeviceGetGraphMemAttribute == NULL: - with gil: - raise RuntimeError('Function "cuDeviceGetGraphMemAttribute" not found') - err = ( __cuDeviceGetGraphMemAttribute)(device, attr, value) - return err -{{endif}} - -{{if 'cuDeviceSetGraphMemAttribute' in found_functions}} - -cdef CUresult _cuDeviceSetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDeviceSetGraphMemAttribute - cuPythonInit() - if __cuDeviceSetGraphMemAttribute == NULL: - with gil: - raise RuntimeError('Function "cuDeviceSetGraphMemAttribute" not found') - err = ( __cuDeviceSetGraphMemAttribute)(device, attr, value) - return err -{{endif}} - -{{if 'cuGraphClone' in found_functions}} - -cdef CUresult _cuGraphClone(CUgraph* phGraphClone, CUgraph originalGraph) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphClone - cuPythonInit() - if __cuGraphClone == NULL: - with gil: - raise RuntimeError('Function "cuGraphClone" not found') - err = ( __cuGraphClone)(phGraphClone, originalGraph) - return err -{{endif}} - -{{if 'cuGraphNodeFindInClone' in found_functions}} - -cdef CUresult _cuGraphNodeFindInClone(CUgraphNode* phNode, CUgraphNode hOriginalNode, CUgraph hClonedGraph) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphNodeFindInClone - cuPythonInit() - if __cuGraphNodeFindInClone == NULL: - with gil: - raise RuntimeError('Function "cuGraphNodeFindInClone" not found') - err = ( __cuGraphNodeFindInClone)(phNode, hOriginalNode, hClonedGraph) - return err -{{endif}} - -{{if 'cuGraphNodeGetType' in found_functions}} - -cdef CUresult _cuGraphNodeGetType(CUgraphNode hNode, CUgraphNodeType* typename) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphNodeGetType - cuPythonInit() - if __cuGraphNodeGetType == NULL: - with gil: - raise RuntimeError('Function "cuGraphNodeGetType" not found') - err = ( __cuGraphNodeGetType)(hNode, typename) - return err -{{endif}} - -{{if 'cuGraphNodeGetContainingGraph' in found_functions}} - -cdef CUresult _cuGraphNodeGetContainingGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphNodeGetContainingGraph - cuPythonInit() - if __cuGraphNodeGetContainingGraph == NULL: - with gil: - raise RuntimeError('Function "cuGraphNodeGetContainingGraph" not found') - err = ( __cuGraphNodeGetContainingGraph)(hNode, phGraph) - return err -{{endif}} - -{{if 'cuGraphNodeGetLocalId' in found_functions}} - -cdef CUresult _cuGraphNodeGetLocalId(CUgraphNode hNode, unsigned int* nodeId) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphNodeGetLocalId - cuPythonInit() - if __cuGraphNodeGetLocalId == NULL: - with gil: - raise RuntimeError('Function "cuGraphNodeGetLocalId" not found') - err = ( __cuGraphNodeGetLocalId)(hNode, nodeId) - return err -{{endif}} - -{{if 'cuGraphNodeGetToolsId' in found_functions}} - -cdef CUresult _cuGraphNodeGetToolsId(CUgraphNode hNode, unsigned long long* toolsNodeId) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphNodeGetToolsId - cuPythonInit() - if __cuGraphNodeGetToolsId == NULL: - with gil: - raise RuntimeError('Function "cuGraphNodeGetToolsId" not found') - err = ( __cuGraphNodeGetToolsId)(hNode, toolsNodeId) - return err -{{endif}} - -{{if 'cuGraphGetId' in found_functions}} - -cdef CUresult _cuGraphGetId(CUgraph hGraph, unsigned int* graphId) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphGetId - cuPythonInit() - if __cuGraphGetId == NULL: - with gil: - raise RuntimeError('Function "cuGraphGetId" not found') - err = ( __cuGraphGetId)(hGraph, graphId) - return err -{{endif}} - -{{if 'cuGraphExecGetId' in found_functions}} - -cdef CUresult _cuGraphExecGetId(CUgraphExec hGraphExec, unsigned int* graphId) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphExecGetId - cuPythonInit() - if __cuGraphExecGetId == NULL: - with gil: - raise RuntimeError('Function "cuGraphExecGetId" not found') - err = ( __cuGraphExecGetId)(hGraphExec, graphId) - return err -{{endif}} - -{{if 'cuGraphGetNodes' in found_functions}} - -cdef CUresult _cuGraphGetNodes(CUgraph hGraph, CUgraphNode* nodes, size_t* numNodes) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphGetNodes - cuPythonInit() - if __cuGraphGetNodes == NULL: - with gil: - raise RuntimeError('Function "cuGraphGetNodes" not found') - err = ( __cuGraphGetNodes)(hGraph, nodes, numNodes) - return err -{{endif}} - -{{if 'cuGraphGetRootNodes' in found_functions}} - -cdef CUresult _cuGraphGetRootNodes(CUgraph hGraph, CUgraphNode* rootNodes, size_t* numRootNodes) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphGetRootNodes - cuPythonInit() - if __cuGraphGetRootNodes == NULL: - with gil: - raise RuntimeError('Function "cuGraphGetRootNodes" not found') - err = ( __cuGraphGetRootNodes)(hGraph, rootNodes, numRootNodes) - 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: - global __cuGraphGetEdges_v2 - cuPythonInit() - if __cuGraphGetEdges_v2 == NULL: - with gil: - raise RuntimeError('Function "cuGraphGetEdges_v2" not found') - err = ( __cuGraphGetEdges_v2)(hGraph, from_, to, edgeData, numEdges) - 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: - global __cuGraphNodeGetDependencies_v2 - cuPythonInit() - if __cuGraphNodeGetDependencies_v2 == NULL: - with gil: - raise RuntimeError('Function "cuGraphNodeGetDependencies_v2" not found') - err = ( __cuGraphNodeGetDependencies_v2)(hNode, dependencies, edgeData, numDependencies) - 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: - global __cuGraphNodeGetDependentNodes_v2 - cuPythonInit() - if __cuGraphNodeGetDependentNodes_v2 == NULL: - with gil: - raise RuntimeError('Function "cuGraphNodeGetDependentNodes_v2" not found') - err = ( __cuGraphNodeGetDependentNodes_v2)(hNode, dependentNodes, edgeData, numDependentNodes) - 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: - global __cuGraphAddDependencies_v2 - cuPythonInit() - if __cuGraphAddDependencies_v2 == NULL: - with gil: - raise RuntimeError('Function "cuGraphAddDependencies_v2" not found') - err = ( __cuGraphAddDependencies_v2)(hGraph, from_, to, edgeData, 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: - global __cuGraphRemoveDependencies_v2 - cuPythonInit() - if __cuGraphRemoveDependencies_v2 == NULL: - with gil: - raise RuntimeError('Function "cuGraphRemoveDependencies_v2" not found') - err = ( __cuGraphRemoveDependencies_v2)(hGraph, from_, to, edgeData, numDependencies) - return err -{{endif}} - -{{if 'cuGraphDestroyNode' in found_functions}} - -cdef CUresult _cuGraphDestroyNode(CUgraphNode hNode) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphDestroyNode - cuPythonInit() - if __cuGraphDestroyNode == NULL: - with gil: - raise RuntimeError('Function "cuGraphDestroyNode" not found') - err = ( __cuGraphDestroyNode)(hNode) - return err -{{endif}} - -{{if 'cuGraphInstantiateWithFlags' in found_functions}} - -cdef CUresult _cuGraphInstantiateWithFlags(CUgraphExec* phGraphExec, CUgraph hGraph, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphInstantiateWithFlags - cuPythonInit() - if __cuGraphInstantiateWithFlags == NULL: - with gil: - raise RuntimeError('Function "cuGraphInstantiateWithFlags" not found') - err = ( __cuGraphInstantiateWithFlags)(phGraphExec, hGraph, flags) - return err -{{endif}} - -{{if 'cuGraphInstantiateWithParams' in found_functions}} - -cdef CUresult _cuGraphInstantiateWithParams(CUgraphExec* phGraphExec, CUgraph hGraph, CUDA_GRAPH_INSTANTIATE_PARAMS* instantiateParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphInstantiateWithParams - cuPythonInit() - if __cuGraphInstantiateWithParams == NULL: - with gil: - raise RuntimeError('Function "cuGraphInstantiateWithParams" not found') - err = ( __cuGraphInstantiateWithParams)(phGraphExec, hGraph, instantiateParams) - return err -{{endif}} - -{{if 'cuGraphExecGetFlags' in found_functions}} - -cdef CUresult _cuGraphExecGetFlags(CUgraphExec hGraphExec, cuuint64_t* flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphExecGetFlags - cuPythonInit() - if __cuGraphExecGetFlags == NULL: - with gil: - raise RuntimeError('Function "cuGraphExecGetFlags" not found') - err = ( __cuGraphExecGetFlags)(hGraphExec, flags) - return err -{{endif}} - -{{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}} - -cdef CUresult _cuGraphExecKernelNodeSetParams_v2(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphExecKernelNodeSetParams_v2 - cuPythonInit() - if __cuGraphExecKernelNodeSetParams_v2 == NULL: - with gil: - raise RuntimeError('Function "cuGraphExecKernelNodeSetParams_v2" not found') - err = ( __cuGraphExecKernelNodeSetParams_v2)(hGraphExec, hNode, nodeParams) - return err -{{endif}} - -{{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}} - -cdef CUresult _cuGraphExecMemcpyNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMCPY3D* copyParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphExecMemcpyNodeSetParams - cuPythonInit() - if __cuGraphExecMemcpyNodeSetParams == NULL: - with gil: - raise RuntimeError('Function "cuGraphExecMemcpyNodeSetParams" not found') - err = ( __cuGraphExecMemcpyNodeSetParams)(hGraphExec, hNode, copyParams, ctx) - return err -{{endif}} - -{{if 'cuGraphExecMemsetNodeSetParams' in found_functions}} - -cdef CUresult _cuGraphExecMemsetNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* memsetParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphExecMemsetNodeSetParams - cuPythonInit() - if __cuGraphExecMemsetNodeSetParams == NULL: - with gil: - raise RuntimeError('Function "cuGraphExecMemsetNodeSetParams" not found') - err = ( __cuGraphExecMemsetNodeSetParams)(hGraphExec, hNode, memsetParams, ctx) - return err -{{endif}} - -{{if 'cuGraphExecHostNodeSetParams' in found_functions}} - -cdef CUresult _cuGraphExecHostNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphExecHostNodeSetParams - cuPythonInit() - if __cuGraphExecHostNodeSetParams == NULL: - with gil: - raise RuntimeError('Function "cuGraphExecHostNodeSetParams" not found') - err = ( __cuGraphExecHostNodeSetParams)(hGraphExec, hNode, nodeParams) - return err -{{endif}} - -{{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}} - -cdef CUresult _cuGraphExecChildGraphNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphExecChildGraphNodeSetParams - cuPythonInit() - if __cuGraphExecChildGraphNodeSetParams == NULL: - with gil: - raise RuntimeError('Function "cuGraphExecChildGraphNodeSetParams" not found') - err = ( __cuGraphExecChildGraphNodeSetParams)(hGraphExec, hNode, childGraph) - return err -{{endif}} - -{{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}} - -cdef CUresult _cuGraphExecEventRecordNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphExecEventRecordNodeSetEvent - cuPythonInit() - if __cuGraphExecEventRecordNodeSetEvent == NULL: - with gil: - raise RuntimeError('Function "cuGraphExecEventRecordNodeSetEvent" not found') - err = ( __cuGraphExecEventRecordNodeSetEvent)(hGraphExec, hNode, event) - return err -{{endif}} - -{{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}} - -cdef CUresult _cuGraphExecEventWaitNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphExecEventWaitNodeSetEvent - cuPythonInit() - if __cuGraphExecEventWaitNodeSetEvent == NULL: - with gil: - raise RuntimeError('Function "cuGraphExecEventWaitNodeSetEvent" not found') - err = ( __cuGraphExecEventWaitNodeSetEvent)(hGraphExec, hNode, event) - return err -{{endif}} - -{{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} - -cdef CUresult _cuGraphExecExternalSemaphoresSignalNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphExecExternalSemaphoresSignalNodeSetParams - cuPythonInit() - if __cuGraphExecExternalSemaphoresSignalNodeSetParams == NULL: - with gil: - raise RuntimeError('Function "cuGraphExecExternalSemaphoresSignalNodeSetParams" not found') - err = ( __cuGraphExecExternalSemaphoresSignalNodeSetParams)(hGraphExec, hNode, nodeParams) - return err -{{endif}} - -{{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} - -cdef CUresult _cuGraphExecExternalSemaphoresWaitNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphExecExternalSemaphoresWaitNodeSetParams - cuPythonInit() - if __cuGraphExecExternalSemaphoresWaitNodeSetParams == NULL: - with gil: - raise RuntimeError('Function "cuGraphExecExternalSemaphoresWaitNodeSetParams" not found') - err = ( __cuGraphExecExternalSemaphoresWaitNodeSetParams)(hGraphExec, hNode, nodeParams) - return err -{{endif}} - -{{if 'cuGraphNodeSetEnabled' in found_functions}} - -cdef CUresult _cuGraphNodeSetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphNodeSetEnabled - cuPythonInit() - if __cuGraphNodeSetEnabled == NULL: - with gil: - raise RuntimeError('Function "cuGraphNodeSetEnabled" not found') - err = ( __cuGraphNodeSetEnabled)(hGraphExec, hNode, isEnabled) - return err -{{endif}} - -{{if 'cuGraphNodeGetEnabled' in found_functions}} - -cdef CUresult _cuGraphNodeGetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int* isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphNodeGetEnabled - cuPythonInit() - if __cuGraphNodeGetEnabled == NULL: - with gil: - raise RuntimeError('Function "cuGraphNodeGetEnabled" not found') - err = ( __cuGraphNodeGetEnabled)(hGraphExec, hNode, isEnabled) - return err -{{endif}} - -{{if 'cuGraphUpload' in found_functions}} - -cdef CUresult _cuGraphUpload(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphUpload - cuPythonInit() - if __cuGraphUpload == NULL: - with gil: - raise RuntimeError('Function "cuGraphUpload" not found') - err = ( __cuGraphUpload)(hGraphExec, hStream) - return err -{{endif}} - -{{if 'cuGraphLaunch' in found_functions}} - -cdef CUresult _cuGraphLaunch(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphLaunch - cuPythonInit() - if __cuGraphLaunch == NULL: - with gil: - raise RuntimeError('Function "cuGraphLaunch" not found') - err = ( __cuGraphLaunch)(hGraphExec, hStream) - return err -{{endif}} - -{{if 'cuGraphExecDestroy' in found_functions}} - -cdef CUresult _cuGraphExecDestroy(CUgraphExec hGraphExec) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphExecDestroy - cuPythonInit() - if __cuGraphExecDestroy == NULL: - with gil: - raise RuntimeError('Function "cuGraphExecDestroy" not found') - err = ( __cuGraphExecDestroy)(hGraphExec) - return err -{{endif}} - -{{if 'cuGraphDestroy' in found_functions}} - -cdef CUresult _cuGraphDestroy(CUgraph hGraph) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphDestroy - cuPythonInit() - if __cuGraphDestroy == NULL: - with gil: - raise RuntimeError('Function "cuGraphDestroy" not found') - err = ( __cuGraphDestroy)(hGraph) - return err -{{endif}} - -{{if 'cuGraphExecUpdate_v2' in found_functions}} - -cdef CUresult _cuGraphExecUpdate_v2(CUgraphExec hGraphExec, CUgraph hGraph, CUgraphExecUpdateResultInfo* resultInfo) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphExecUpdate_v2 - cuPythonInit() - if __cuGraphExecUpdate_v2 == NULL: - with gil: - raise RuntimeError('Function "cuGraphExecUpdate_v2" not found') - err = ( __cuGraphExecUpdate_v2)(hGraphExec, hGraph, resultInfo) - return err -{{endif}} - -{{if 'cuGraphKernelNodeCopyAttributes' in found_functions}} - -cdef CUresult _cuGraphKernelNodeCopyAttributes(CUgraphNode dst, CUgraphNode src) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphKernelNodeCopyAttributes - cuPythonInit() - if __cuGraphKernelNodeCopyAttributes == NULL: - with gil: - raise RuntimeError('Function "cuGraphKernelNodeCopyAttributes" not found') - err = ( __cuGraphKernelNodeCopyAttributes)(dst, src) - return err -{{endif}} - -{{if 'cuGraphKernelNodeGetAttribute' in found_functions}} - -cdef CUresult _cuGraphKernelNodeGetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, CUkernelNodeAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphKernelNodeGetAttribute - cuPythonInit() - if __cuGraphKernelNodeGetAttribute == NULL: - with gil: - raise RuntimeError('Function "cuGraphKernelNodeGetAttribute" not found') - err = ( __cuGraphKernelNodeGetAttribute)(hNode, attr, value_out) - return err -{{endif}} - -{{if 'cuGraphKernelNodeSetAttribute' in found_functions}} - -cdef CUresult _cuGraphKernelNodeSetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, const CUkernelNodeAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphKernelNodeSetAttribute - cuPythonInit() - if __cuGraphKernelNodeSetAttribute == NULL: - with gil: - raise RuntimeError('Function "cuGraphKernelNodeSetAttribute" not found') - err = ( __cuGraphKernelNodeSetAttribute)(hNode, attr, value) - return err -{{endif}} - -{{if 'cuGraphDebugDotPrint' in found_functions}} - -cdef CUresult _cuGraphDebugDotPrint(CUgraph hGraph, const char* path, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphDebugDotPrint - cuPythonInit() - if __cuGraphDebugDotPrint == NULL: - with gil: - raise RuntimeError('Function "cuGraphDebugDotPrint" not found') - err = ( __cuGraphDebugDotPrint)(hGraph, path, flags) - return err -{{endif}} - -{{if 'cuUserObjectCreate' in found_functions}} - -cdef CUresult _cuUserObjectCreate(CUuserObject* object_out, void* ptr, CUhostFn destroy, unsigned int initialRefcount, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuUserObjectCreate - cuPythonInit() - if __cuUserObjectCreate == NULL: - with gil: - raise RuntimeError('Function "cuUserObjectCreate" not found') - err = ( __cuUserObjectCreate)(object_out, ptr, destroy, initialRefcount, flags) - return err -{{endif}} - -{{if 'cuUserObjectRetain' in found_functions}} - -cdef CUresult _cuUserObjectRetain(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuUserObjectRetain - cuPythonInit() - if __cuUserObjectRetain == NULL: - with gil: - raise RuntimeError('Function "cuUserObjectRetain" not found') - err = ( __cuUserObjectRetain)(object, count) - return err -{{endif}} - -{{if 'cuUserObjectRelease' in found_functions}} - -cdef CUresult _cuUserObjectRelease(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuUserObjectRelease - cuPythonInit() - if __cuUserObjectRelease == NULL: - with gil: - raise RuntimeError('Function "cuUserObjectRelease" not found') - err = ( __cuUserObjectRelease)(object, count) - return err -{{endif}} - -{{if 'cuGraphRetainUserObject' in found_functions}} - -cdef CUresult _cuGraphRetainUserObject(CUgraph graph, CUuserObject object, unsigned int count, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphRetainUserObject - cuPythonInit() - if __cuGraphRetainUserObject == NULL: - with gil: - raise RuntimeError('Function "cuGraphRetainUserObject" not found') - err = ( __cuGraphRetainUserObject)(graph, object, count, flags) - return err -{{endif}} - -{{if 'cuGraphReleaseUserObject' in found_functions}} - -cdef CUresult _cuGraphReleaseUserObject(CUgraph graph, CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphReleaseUserObject - cuPythonInit() - if __cuGraphReleaseUserObject == NULL: - with gil: - raise RuntimeError('Function "cuGraphReleaseUserObject" not found') - err = ( __cuGraphReleaseUserObject)(graph, object, count) - 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: - global __cuGraphAddNode_v2 - cuPythonInit() - if __cuGraphAddNode_v2 == NULL: - with gil: - raise RuntimeError('Function "cuGraphAddNode_v2" not found') - err = ( __cuGraphAddNode_v2)(phGraphNode, hGraph, dependencies, dependencyData, numDependencies, nodeParams) - return err -{{endif}} - -{{if 'cuGraphNodeSetParams' in found_functions}} - -cdef CUresult _cuGraphNodeSetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphNodeSetParams - cuPythonInit() - if __cuGraphNodeSetParams == NULL: - with gil: - raise RuntimeError('Function "cuGraphNodeSetParams" not found') - err = ( __cuGraphNodeSetParams)(hNode, nodeParams) - return err -{{endif}} - -{{if 'cuGraphNodeGetParams' in found_functions}} - -cdef CUresult _cuGraphNodeGetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphNodeGetParams - cuPythonInit() - if __cuGraphNodeGetParams == NULL: - with gil: - raise RuntimeError('Function "cuGraphNodeGetParams" not found') - err = ( __cuGraphNodeGetParams)(hNode, nodeParams) - return err -{{endif}} - -{{if 'cuGraphExecNodeSetParams' in found_functions}} - -cdef CUresult _cuGraphExecNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphExecNodeSetParams - cuPythonInit() - if __cuGraphExecNodeSetParams == NULL: - with gil: - raise RuntimeError('Function "cuGraphExecNodeSetParams" not found') - err = ( __cuGraphExecNodeSetParams)(hGraphExec, hNode, nodeParams) - return err -{{endif}} - -{{if 'cuGraphConditionalHandleCreate' in found_functions}} - -cdef CUresult _cuGraphConditionalHandleCreate(CUgraphConditionalHandle* pHandle_out, CUgraph hGraph, CUcontext ctx, unsigned int defaultLaunchValue, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphConditionalHandleCreate - cuPythonInit() - if __cuGraphConditionalHandleCreate == NULL: - with gil: - raise RuntimeError('Function "cuGraphConditionalHandleCreate" not found') - err = ( __cuGraphConditionalHandleCreate)(pHandle_out, hGraph, ctx, defaultLaunchValue, flags) - return err -{{endif}} - -{{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} - -cdef CUresult _cuOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuOccupancyMaxActiveBlocksPerMultiprocessor - cuPythonInit() - if __cuOccupancyMaxActiveBlocksPerMultiprocessor == NULL: - with gil: - raise RuntimeError('Function "cuOccupancyMaxActiveBlocksPerMultiprocessor" not found') - err = ( __cuOccupancyMaxActiveBlocksPerMultiprocessor)(numBlocks, func, blockSize, dynamicSMemSize) - return err -{{endif}} - -{{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} - -cdef CUresult _cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags - cuPythonInit() - if __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags == NULL: - with gil: - raise RuntimeError('Function "cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags" not found') - err = ( __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags)(numBlocks, func, blockSize, dynamicSMemSize, flags) - return err -{{endif}} - -{{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}} - -cdef CUresult _cuOccupancyMaxPotentialBlockSize(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuOccupancyMaxPotentialBlockSize - cuPythonInit() - if __cuOccupancyMaxPotentialBlockSize == NULL: - with gil: - raise RuntimeError('Function "cuOccupancyMaxPotentialBlockSize" not found') - err = ( __cuOccupancyMaxPotentialBlockSize)(minGridSize, blockSize, func, blockSizeToDynamicSMemSize, dynamicSMemSize, blockSizeLimit) - return err -{{endif}} - -{{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}} - -cdef CUresult _cuOccupancyMaxPotentialBlockSizeWithFlags(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuOccupancyMaxPotentialBlockSizeWithFlags - cuPythonInit() - if __cuOccupancyMaxPotentialBlockSizeWithFlags == NULL: - with gil: - raise RuntimeError('Function "cuOccupancyMaxPotentialBlockSizeWithFlags" not found') - err = ( __cuOccupancyMaxPotentialBlockSizeWithFlags)(minGridSize, blockSize, func, blockSizeToDynamicSMemSize, dynamicSMemSize, blockSizeLimit, flags) - return err -{{endif}} - -{{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}} - -cdef CUresult _cuOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, CUfunction func, int numBlocks, int blockSize) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuOccupancyAvailableDynamicSMemPerBlock - cuPythonInit() - if __cuOccupancyAvailableDynamicSMemPerBlock == NULL: - with gil: - raise RuntimeError('Function "cuOccupancyAvailableDynamicSMemPerBlock" not found') - err = ( __cuOccupancyAvailableDynamicSMemPerBlock)(dynamicSmemSize, func, numBlocks, blockSize) - return err -{{endif}} - -{{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}} - -cdef CUresult _cuOccupancyMaxPotentialClusterSize(int* clusterSize, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuOccupancyMaxPotentialClusterSize - cuPythonInit() - if __cuOccupancyMaxPotentialClusterSize == NULL: - with gil: - raise RuntimeError('Function "cuOccupancyMaxPotentialClusterSize" not found') - err = ( __cuOccupancyMaxPotentialClusterSize)(clusterSize, func, config) - return err -{{endif}} - -{{if 'cuOccupancyMaxActiveClusters' in found_functions}} - -cdef CUresult _cuOccupancyMaxActiveClusters(int* numClusters, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuOccupancyMaxActiveClusters - cuPythonInit() - if __cuOccupancyMaxActiveClusters == NULL: - with gil: - raise RuntimeError('Function "cuOccupancyMaxActiveClusters" not found') - err = ( __cuOccupancyMaxActiveClusters)(numClusters, func, config) - return err -{{endif}} - -{{if 'cuTexRefSetArray' in found_functions}} - -cdef CUresult _cuTexRefSetArray(CUtexref hTexRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefSetArray - cuPythonInit() - if __cuTexRefSetArray == NULL: - with gil: - raise RuntimeError('Function "cuTexRefSetArray" not found') - err = ( __cuTexRefSetArray)(hTexRef, hArray, Flags) - return err -{{endif}} - -{{if 'cuTexRefSetMipmappedArray' in found_functions}} - -cdef CUresult _cuTexRefSetMipmappedArray(CUtexref hTexRef, CUmipmappedArray hMipmappedArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefSetMipmappedArray - cuPythonInit() - if __cuTexRefSetMipmappedArray == NULL: - with gil: - raise RuntimeError('Function "cuTexRefSetMipmappedArray" not found') - err = ( __cuTexRefSetMipmappedArray)(hTexRef, hMipmappedArray, Flags) - return err -{{endif}} - -{{if 'cuTexRefSetAddress_v2' in found_functions}} - -cdef CUresult _cuTexRefSetAddress_v2(size_t* ByteOffset, CUtexref hTexRef, CUdeviceptr dptr, size_t numbytes) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefSetAddress_v2 - cuPythonInit() - if __cuTexRefSetAddress_v2 == NULL: - with gil: - raise RuntimeError('Function "cuTexRefSetAddress_v2" not found') - err = ( __cuTexRefSetAddress_v2)(ByteOffset, hTexRef, dptr, numbytes) - return err -{{endif}} - -{{if 'cuTexRefSetAddress2D_v3' in found_functions}} - -cdef CUresult _cuTexRefSetAddress2D_v3(CUtexref hTexRef, const CUDA_ARRAY_DESCRIPTOR* desc, CUdeviceptr dptr, size_t Pitch) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefSetAddress2D_v3 - cuPythonInit() - if __cuTexRefSetAddress2D_v3 == NULL: - with gil: - raise RuntimeError('Function "cuTexRefSetAddress2D_v3" not found') - err = ( __cuTexRefSetAddress2D_v3)(hTexRef, desc, dptr, Pitch) - return err -{{endif}} - -{{if 'cuTexRefSetFormat' in found_functions}} - -cdef CUresult _cuTexRefSetFormat(CUtexref hTexRef, CUarray_format fmt, int NumPackedComponents) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefSetFormat - cuPythonInit() - if __cuTexRefSetFormat == NULL: - with gil: - raise RuntimeError('Function "cuTexRefSetFormat" not found') - err = ( __cuTexRefSetFormat)(hTexRef, fmt, NumPackedComponents) - return err -{{endif}} - -{{if 'cuTexRefSetAddressMode' in found_functions}} - -cdef CUresult _cuTexRefSetAddressMode(CUtexref hTexRef, int dim, CUaddress_mode am) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefSetAddressMode - cuPythonInit() - if __cuTexRefSetAddressMode == NULL: - with gil: - raise RuntimeError('Function "cuTexRefSetAddressMode" not found') - err = ( __cuTexRefSetAddressMode)(hTexRef, dim, am) - return err -{{endif}} - -{{if 'cuTexRefSetFilterMode' in found_functions}} - -cdef CUresult _cuTexRefSetFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefSetFilterMode - cuPythonInit() - if __cuTexRefSetFilterMode == NULL: - with gil: - raise RuntimeError('Function "cuTexRefSetFilterMode" not found') - err = ( __cuTexRefSetFilterMode)(hTexRef, fm) - return err -{{endif}} - -{{if 'cuTexRefSetMipmapFilterMode' in found_functions}} - -cdef CUresult _cuTexRefSetMipmapFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefSetMipmapFilterMode - cuPythonInit() - if __cuTexRefSetMipmapFilterMode == NULL: - with gil: - raise RuntimeError('Function "cuTexRefSetMipmapFilterMode" not found') - err = ( __cuTexRefSetMipmapFilterMode)(hTexRef, fm) - return err -{{endif}} - -{{if 'cuTexRefSetMipmapLevelBias' in found_functions}} - -cdef CUresult _cuTexRefSetMipmapLevelBias(CUtexref hTexRef, float bias) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefSetMipmapLevelBias - cuPythonInit() - if __cuTexRefSetMipmapLevelBias == NULL: - with gil: - raise RuntimeError('Function "cuTexRefSetMipmapLevelBias" not found') - err = ( __cuTexRefSetMipmapLevelBias)(hTexRef, bias) - return err -{{endif}} - -{{if 'cuTexRefSetMipmapLevelClamp' in found_functions}} - -cdef CUresult _cuTexRefSetMipmapLevelClamp(CUtexref hTexRef, float minMipmapLevelClamp, float maxMipmapLevelClamp) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefSetMipmapLevelClamp - cuPythonInit() - if __cuTexRefSetMipmapLevelClamp == NULL: - with gil: - raise RuntimeError('Function "cuTexRefSetMipmapLevelClamp" not found') - err = ( __cuTexRefSetMipmapLevelClamp)(hTexRef, minMipmapLevelClamp, maxMipmapLevelClamp) - return err -{{endif}} - -{{if 'cuTexRefSetMaxAnisotropy' in found_functions}} - -cdef CUresult _cuTexRefSetMaxAnisotropy(CUtexref hTexRef, unsigned int maxAniso) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefSetMaxAnisotropy - cuPythonInit() - if __cuTexRefSetMaxAnisotropy == NULL: - with gil: - raise RuntimeError('Function "cuTexRefSetMaxAnisotropy" not found') - err = ( __cuTexRefSetMaxAnisotropy)(hTexRef, maxAniso) - return err -{{endif}} - -{{if 'cuTexRefSetBorderColor' in found_functions}} - -cdef CUresult _cuTexRefSetBorderColor(CUtexref hTexRef, float* pBorderColor) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefSetBorderColor - cuPythonInit() - if __cuTexRefSetBorderColor == NULL: - with gil: - raise RuntimeError('Function "cuTexRefSetBorderColor" not found') - err = ( __cuTexRefSetBorderColor)(hTexRef, pBorderColor) - return err -{{endif}} - -{{if 'cuTexRefSetFlags' in found_functions}} - -cdef CUresult _cuTexRefSetFlags(CUtexref hTexRef, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefSetFlags - cuPythonInit() - if __cuTexRefSetFlags == NULL: - with gil: - raise RuntimeError('Function "cuTexRefSetFlags" not found') - err = ( __cuTexRefSetFlags)(hTexRef, Flags) - return err -{{endif}} - -{{if 'cuTexRefGetAddress_v2' in found_functions}} - -cdef CUresult _cuTexRefGetAddress_v2(CUdeviceptr* pdptr, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefGetAddress_v2 - cuPythonInit() - if __cuTexRefGetAddress_v2 == NULL: - with gil: - raise RuntimeError('Function "cuTexRefGetAddress_v2" not found') - err = ( __cuTexRefGetAddress_v2)(pdptr, hTexRef) - return err -{{endif}} - -{{if 'cuTexRefGetArray' in found_functions}} - -cdef CUresult _cuTexRefGetArray(CUarray* phArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefGetArray - cuPythonInit() - if __cuTexRefGetArray == NULL: - with gil: - raise RuntimeError('Function "cuTexRefGetArray" not found') - err = ( __cuTexRefGetArray)(phArray, hTexRef) - return err -{{endif}} - -{{if 'cuTexRefGetMipmappedArray' in found_functions}} - -cdef CUresult _cuTexRefGetMipmappedArray(CUmipmappedArray* phMipmappedArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefGetMipmappedArray - cuPythonInit() - if __cuTexRefGetMipmappedArray == NULL: - with gil: - raise RuntimeError('Function "cuTexRefGetMipmappedArray" not found') - err = ( __cuTexRefGetMipmappedArray)(phMipmappedArray, hTexRef) - return err -{{endif}} - -{{if 'cuTexRefGetAddressMode' in found_functions}} - -cdef CUresult _cuTexRefGetAddressMode(CUaddress_mode* pam, CUtexref hTexRef, int dim) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefGetAddressMode - cuPythonInit() - if __cuTexRefGetAddressMode == NULL: - with gil: - raise RuntimeError('Function "cuTexRefGetAddressMode" not found') - err = ( __cuTexRefGetAddressMode)(pam, hTexRef, dim) - return err -{{endif}} - -{{if 'cuTexRefGetFilterMode' in found_functions}} - -cdef CUresult _cuTexRefGetFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefGetFilterMode - cuPythonInit() - if __cuTexRefGetFilterMode == NULL: - with gil: - raise RuntimeError('Function "cuTexRefGetFilterMode" not found') - err = ( __cuTexRefGetFilterMode)(pfm, hTexRef) - return err -{{endif}} - -{{if 'cuTexRefGetFormat' in found_functions}} - -cdef CUresult _cuTexRefGetFormat(CUarray_format* pFormat, int* pNumChannels, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefGetFormat - cuPythonInit() - if __cuTexRefGetFormat == NULL: - with gil: - raise RuntimeError('Function "cuTexRefGetFormat" not found') - err = ( __cuTexRefGetFormat)(pFormat, pNumChannels, hTexRef) - return err -{{endif}} - -{{if 'cuTexRefGetMipmapFilterMode' in found_functions}} - -cdef CUresult _cuTexRefGetMipmapFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefGetMipmapFilterMode - cuPythonInit() - if __cuTexRefGetMipmapFilterMode == NULL: - with gil: - raise RuntimeError('Function "cuTexRefGetMipmapFilterMode" not found') - err = ( __cuTexRefGetMipmapFilterMode)(pfm, hTexRef) - return err -{{endif}} - -{{if 'cuTexRefGetMipmapLevelBias' in found_functions}} - -cdef CUresult _cuTexRefGetMipmapLevelBias(float* pbias, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefGetMipmapLevelBias - cuPythonInit() - if __cuTexRefGetMipmapLevelBias == NULL: - with gil: - raise RuntimeError('Function "cuTexRefGetMipmapLevelBias" not found') - err = ( __cuTexRefGetMipmapLevelBias)(pbias, hTexRef) - return err -{{endif}} - -{{if 'cuTexRefGetMipmapLevelClamp' in found_functions}} - -cdef CUresult _cuTexRefGetMipmapLevelClamp(float* pminMipmapLevelClamp, float* pmaxMipmapLevelClamp, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefGetMipmapLevelClamp - cuPythonInit() - if __cuTexRefGetMipmapLevelClamp == NULL: - with gil: - raise RuntimeError('Function "cuTexRefGetMipmapLevelClamp" not found') - err = ( __cuTexRefGetMipmapLevelClamp)(pminMipmapLevelClamp, pmaxMipmapLevelClamp, hTexRef) - return err -{{endif}} - -{{if 'cuTexRefGetMaxAnisotropy' in found_functions}} - -cdef CUresult _cuTexRefGetMaxAnisotropy(int* pmaxAniso, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefGetMaxAnisotropy - cuPythonInit() - if __cuTexRefGetMaxAnisotropy == NULL: - with gil: - raise RuntimeError('Function "cuTexRefGetMaxAnisotropy" not found') - err = ( __cuTexRefGetMaxAnisotropy)(pmaxAniso, hTexRef) - return err -{{endif}} - -{{if 'cuTexRefGetBorderColor' in found_functions}} - -cdef CUresult _cuTexRefGetBorderColor(float* pBorderColor, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefGetBorderColor - cuPythonInit() - if __cuTexRefGetBorderColor == NULL: - with gil: - raise RuntimeError('Function "cuTexRefGetBorderColor" not found') - err = ( __cuTexRefGetBorderColor)(pBorderColor, hTexRef) - return err -{{endif}} - -{{if 'cuTexRefGetFlags' in found_functions}} - -cdef CUresult _cuTexRefGetFlags(unsigned int* pFlags, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefGetFlags - cuPythonInit() - if __cuTexRefGetFlags == NULL: - with gil: - raise RuntimeError('Function "cuTexRefGetFlags" not found') - err = ( __cuTexRefGetFlags)(pFlags, hTexRef) - return err -{{endif}} - -{{if 'cuTexRefCreate' in found_functions}} - -cdef CUresult _cuTexRefCreate(CUtexref* pTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefCreate - cuPythonInit() - if __cuTexRefCreate == NULL: - with gil: - raise RuntimeError('Function "cuTexRefCreate" not found') - err = ( __cuTexRefCreate)(pTexRef) - return err -{{endif}} - -{{if 'cuTexRefDestroy' in found_functions}} - -cdef CUresult _cuTexRefDestroy(CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexRefDestroy - cuPythonInit() - if __cuTexRefDestroy == NULL: - with gil: - raise RuntimeError('Function "cuTexRefDestroy" not found') - err = ( __cuTexRefDestroy)(hTexRef) - return err -{{endif}} - -{{if 'cuSurfRefSetArray' in found_functions}} - -cdef CUresult _cuSurfRefSetArray(CUsurfref hSurfRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuSurfRefSetArray - cuPythonInit() - if __cuSurfRefSetArray == NULL: - with gil: - raise RuntimeError('Function "cuSurfRefSetArray" not found') - err = ( __cuSurfRefSetArray)(hSurfRef, hArray, Flags) - return err -{{endif}} - -{{if 'cuSurfRefGetArray' in found_functions}} - -cdef CUresult _cuSurfRefGetArray(CUarray* phArray, CUsurfref hSurfRef) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuSurfRefGetArray - cuPythonInit() - if __cuSurfRefGetArray == NULL: - with gil: - raise RuntimeError('Function "cuSurfRefGetArray" not found') - err = ( __cuSurfRefGetArray)(phArray, hSurfRef) - return err -{{endif}} - -{{if 'cuTexObjectCreate' in found_functions}} - -cdef CUresult _cuTexObjectCreate(CUtexObject* pTexObject, const CUDA_RESOURCE_DESC* pResDesc, const CUDA_TEXTURE_DESC* pTexDesc, const CUDA_RESOURCE_VIEW_DESC* pResViewDesc) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexObjectCreate - cuPythonInit() - if __cuTexObjectCreate == NULL: - with gil: - raise RuntimeError('Function "cuTexObjectCreate" not found') - err = ( __cuTexObjectCreate)(pTexObject, pResDesc, pTexDesc, pResViewDesc) - return err -{{endif}} - -{{if 'cuTexObjectDestroy' in found_functions}} - -cdef CUresult _cuTexObjectDestroy(CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexObjectDestroy - cuPythonInit() - if __cuTexObjectDestroy == NULL: - with gil: - raise RuntimeError('Function "cuTexObjectDestroy" not found') - err = ( __cuTexObjectDestroy)(texObject) - return err -{{endif}} - -{{if 'cuTexObjectGetResourceDesc' in found_functions}} - -cdef CUresult _cuTexObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexObjectGetResourceDesc - cuPythonInit() - if __cuTexObjectGetResourceDesc == NULL: - with gil: - raise RuntimeError('Function "cuTexObjectGetResourceDesc" not found') - err = ( __cuTexObjectGetResourceDesc)(pResDesc, texObject) - return err -{{endif}} - -{{if 'cuTexObjectGetTextureDesc' in found_functions}} - -cdef CUresult _cuTexObjectGetTextureDesc(CUDA_TEXTURE_DESC* pTexDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexObjectGetTextureDesc - cuPythonInit() - if __cuTexObjectGetTextureDesc == NULL: - with gil: - raise RuntimeError('Function "cuTexObjectGetTextureDesc" not found') - err = ( __cuTexObjectGetTextureDesc)(pTexDesc, texObject) - return err -{{endif}} - -{{if 'cuTexObjectGetResourceViewDesc' in found_functions}} - -cdef CUresult _cuTexObjectGetResourceViewDesc(CUDA_RESOURCE_VIEW_DESC* pResViewDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTexObjectGetResourceViewDesc - cuPythonInit() - if __cuTexObjectGetResourceViewDesc == NULL: - with gil: - raise RuntimeError('Function "cuTexObjectGetResourceViewDesc" not found') - err = ( __cuTexObjectGetResourceViewDesc)(pResViewDesc, texObject) - return err -{{endif}} - -{{if 'cuSurfObjectCreate' in found_functions}} - -cdef CUresult _cuSurfObjectCreate(CUsurfObject* pSurfObject, const CUDA_RESOURCE_DESC* pResDesc) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuSurfObjectCreate - cuPythonInit() - if __cuSurfObjectCreate == NULL: - with gil: - raise RuntimeError('Function "cuSurfObjectCreate" not found') - err = ( __cuSurfObjectCreate)(pSurfObject, pResDesc) - return err -{{endif}} - -{{if 'cuSurfObjectDestroy' in found_functions}} - -cdef CUresult _cuSurfObjectDestroy(CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuSurfObjectDestroy - cuPythonInit() - if __cuSurfObjectDestroy == NULL: - with gil: - raise RuntimeError('Function "cuSurfObjectDestroy" not found') - err = ( __cuSurfObjectDestroy)(surfObject) - return err -{{endif}} - -{{if 'cuSurfObjectGetResourceDesc' in found_functions}} - -cdef CUresult _cuSurfObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuSurfObjectGetResourceDesc - cuPythonInit() - if __cuSurfObjectGetResourceDesc == NULL: - with gil: - raise RuntimeError('Function "cuSurfObjectGetResourceDesc" not found') - err = ( __cuSurfObjectGetResourceDesc)(pResDesc, surfObject) - return err -{{endif}} - -{{if 'cuTensorMapEncodeTiled' in found_functions}} - -cdef CUresult _cuTensorMapEncodeTiled(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, const cuuint32_t* boxDim, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTensorMapEncodeTiled - cuPythonInit() - if __cuTensorMapEncodeTiled == NULL: - with gil: - raise RuntimeError('Function "cuTensorMapEncodeTiled" not found') - err = ( __cuTensorMapEncodeTiled)(tensorMap, tensorDataType, tensorRank, globalAddress, globalDim, globalStrides, boxDim, elementStrides, interleave, swizzle, l2Promotion, oobFill) - return err -{{endif}} - -{{if 'cuTensorMapEncodeIm2col' in found_functions}} - -cdef CUresult _cuTensorMapEncodeIm2col(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, const int* pixelBoxLowerCorner, const int* pixelBoxUpperCorner, cuuint32_t channelsPerPixel, cuuint32_t pixelsPerColumn, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTensorMapEncodeIm2col - cuPythonInit() - if __cuTensorMapEncodeIm2col == NULL: - with gil: - raise RuntimeError('Function "cuTensorMapEncodeIm2col" not found') - err = ( __cuTensorMapEncodeIm2col)(tensorMap, tensorDataType, tensorRank, globalAddress, globalDim, globalStrides, pixelBoxLowerCorner, pixelBoxUpperCorner, channelsPerPixel, pixelsPerColumn, elementStrides, interleave, swizzle, l2Promotion, oobFill) - return err -{{endif}} - -{{if 'cuTensorMapEncodeIm2colWide' in found_functions}} - -cdef CUresult _cuTensorMapEncodeIm2colWide(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, int pixelBoxLowerCornerWidth, int pixelBoxUpperCornerWidth, cuuint32_t channelsPerPixel, cuuint32_t pixelsPerColumn, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapIm2ColWideMode mode, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTensorMapEncodeIm2colWide - cuPythonInit() - if __cuTensorMapEncodeIm2colWide == NULL: - with gil: - raise RuntimeError('Function "cuTensorMapEncodeIm2colWide" not found') - err = ( __cuTensorMapEncodeIm2colWide)(tensorMap, tensorDataType, tensorRank, globalAddress, globalDim, globalStrides, pixelBoxLowerCornerWidth, pixelBoxUpperCornerWidth, channelsPerPixel, pixelsPerColumn, elementStrides, interleave, mode, swizzle, l2Promotion, oobFill) - return err -{{endif}} - -{{if 'cuTensorMapReplaceAddress' in found_functions}} - -cdef CUresult _cuTensorMapReplaceAddress(CUtensorMap* tensorMap, void* globalAddress) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuTensorMapReplaceAddress - cuPythonInit() - if __cuTensorMapReplaceAddress == NULL: - with gil: - raise RuntimeError('Function "cuTensorMapReplaceAddress" not found') - err = ( __cuTensorMapReplaceAddress)(tensorMap, globalAddress) - return err -{{endif}} - -{{if 'cuDeviceCanAccessPeer' in found_functions}} - -cdef CUresult _cuDeviceCanAccessPeer(int* canAccessPeer, CUdevice dev, CUdevice peerDev) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDeviceCanAccessPeer - cuPythonInit() - if __cuDeviceCanAccessPeer == NULL: - with gil: - raise RuntimeError('Function "cuDeviceCanAccessPeer" not found') - err = ( __cuDeviceCanAccessPeer)(canAccessPeer, dev, peerDev) - return err -{{endif}} - -{{if 'cuCtxEnablePeerAccess' in found_functions}} - -cdef CUresult _cuCtxEnablePeerAccess(CUcontext peerContext, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxEnablePeerAccess - cuPythonInit() - if __cuCtxEnablePeerAccess == NULL: - with gil: - raise RuntimeError('Function "cuCtxEnablePeerAccess" not found') - err = ( __cuCtxEnablePeerAccess)(peerContext, Flags) - return err -{{endif}} - -{{if 'cuCtxDisablePeerAccess' in found_functions}} - -cdef CUresult _cuCtxDisablePeerAccess(CUcontext peerContext) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxDisablePeerAccess - cuPythonInit() - if __cuCtxDisablePeerAccess == NULL: - with gil: - raise RuntimeError('Function "cuCtxDisablePeerAccess" not found') - err = ( __cuCtxDisablePeerAccess)(peerContext) - return err -{{endif}} - -{{if 'cuDeviceGetP2PAttribute' in found_functions}} - -cdef CUresult _cuDeviceGetP2PAttribute(int* value, CUdevice_P2PAttribute attrib, CUdevice srcDevice, CUdevice dstDevice) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDeviceGetP2PAttribute - cuPythonInit() - if __cuDeviceGetP2PAttribute == NULL: - with gil: - raise RuntimeError('Function "cuDeviceGetP2PAttribute" not found') - err = ( __cuDeviceGetP2PAttribute)(value, attrib, srcDevice, dstDevice) - 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: - global __cuGraphicsUnregisterResource - cuPythonInit() - if __cuGraphicsUnregisterResource == NULL: - with gil: - raise RuntimeError('Function "cuGraphicsUnregisterResource" not found') - err = ( __cuGraphicsUnregisterResource)(resource) - return err -{{endif}} - -{{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}} - -cdef CUresult _cuGraphicsSubResourceGetMappedArray(CUarray* pArray, CUgraphicsResource resource, unsigned int arrayIndex, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphicsSubResourceGetMappedArray - cuPythonInit() - if __cuGraphicsSubResourceGetMappedArray == NULL: - with gil: - raise RuntimeError('Function "cuGraphicsSubResourceGetMappedArray" not found') - err = ( __cuGraphicsSubResourceGetMappedArray)(pArray, resource, arrayIndex, mipLevel) - return err -{{endif}} - -{{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}} - -cdef CUresult _cuGraphicsResourceGetMappedMipmappedArray(CUmipmappedArray* pMipmappedArray, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphicsResourceGetMappedMipmappedArray - cuPythonInit() - if __cuGraphicsResourceGetMappedMipmappedArray == NULL: - with gil: - raise RuntimeError('Function "cuGraphicsResourceGetMappedMipmappedArray" not found') - err = ( __cuGraphicsResourceGetMappedMipmappedArray)(pMipmappedArray, resource) - return err -{{endif}} - -{{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}} - -cdef CUresult _cuGraphicsResourceGetMappedPointer_v2(CUdeviceptr* pDevPtr, size_t* pSize, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphicsResourceGetMappedPointer_v2 - cuPythonInit() - if __cuGraphicsResourceGetMappedPointer_v2 == NULL: - with gil: - raise RuntimeError('Function "cuGraphicsResourceGetMappedPointer_v2" not found') - err = ( __cuGraphicsResourceGetMappedPointer_v2)(pDevPtr, pSize, resource) - return err -{{endif}} - -{{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}} - -cdef CUresult _cuGraphicsResourceSetMapFlags_v2(CUgraphicsResource resource, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphicsResourceSetMapFlags_v2 - cuPythonInit() - if __cuGraphicsResourceSetMapFlags_v2 == NULL: - with gil: - raise RuntimeError('Function "cuGraphicsResourceSetMapFlags_v2" not found') - err = ( __cuGraphicsResourceSetMapFlags_v2)(resource, flags) - return err -{{endif}} - -{{if 'cuGraphicsMapResources' in found_functions}} - -cdef CUresult _cuGraphicsMapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphicsMapResources - cuPythonInit() - if __cuGraphicsMapResources == NULL: - with gil: - raise RuntimeError('Function "cuGraphicsMapResources" not found') - err = ( __cuGraphicsMapResources)(count, resources, hStream) - return err -{{endif}} - -{{if 'cuGraphicsUnmapResources' in found_functions}} - -cdef CUresult _cuGraphicsUnmapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphicsUnmapResources - cuPythonInit() - if __cuGraphicsUnmapResources == NULL: - with gil: - raise RuntimeError('Function "cuGraphicsUnmapResources" not found') - err = ( __cuGraphicsUnmapResources)(count, resources, hStream) - return err -{{endif}} - -{{if 'cuGetProcAddress_v2' in found_functions}} - -cdef CUresult _cuGetProcAddress_v2(const char* symbol, void** pfn, int cudaVersion, cuuint64_t flags, CUdriverProcAddressQueryResult* symbolStatus) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGetProcAddress_v2 - cuPythonInit() - if __cuGetProcAddress_v2 == NULL: - with gil: - raise RuntimeError('Function "cuGetProcAddress_v2" not found') - err = ( __cuGetProcAddress_v2)(symbol, pfn, cudaVersion, flags, symbolStatus) - return err -{{endif}} - -{{if 'cuCoredumpGetAttribute' in found_functions}} - -cdef CUresult _cuCoredumpGetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCoredumpGetAttribute - cuPythonInit() - if __cuCoredumpGetAttribute == NULL: - with gil: - raise RuntimeError('Function "cuCoredumpGetAttribute" not found') - err = ( __cuCoredumpGetAttribute)(attrib, value, size) - return err -{{endif}} - -{{if 'cuCoredumpGetAttributeGlobal' in found_functions}} - -cdef CUresult _cuCoredumpGetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCoredumpGetAttributeGlobal - cuPythonInit() - if __cuCoredumpGetAttributeGlobal == NULL: - with gil: - raise RuntimeError('Function "cuCoredumpGetAttributeGlobal" not found') - err = ( __cuCoredumpGetAttributeGlobal)(attrib, value, size) - return err -{{endif}} - -{{if 'cuCoredumpSetAttribute' in found_functions}} - -cdef CUresult _cuCoredumpSetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCoredumpSetAttribute - cuPythonInit() - if __cuCoredumpSetAttribute == NULL: - with gil: - raise RuntimeError('Function "cuCoredumpSetAttribute" not found') - err = ( __cuCoredumpSetAttribute)(attrib, value, size) - return err -{{endif}} - -{{if 'cuCoredumpSetAttributeGlobal' in found_functions}} - -cdef CUresult _cuCoredumpSetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCoredumpSetAttributeGlobal - cuPythonInit() - if __cuCoredumpSetAttributeGlobal == NULL: - with gil: - raise RuntimeError('Function "cuCoredumpSetAttributeGlobal" not found') - err = ( __cuCoredumpSetAttributeGlobal)(attrib, value, size) - return err -{{endif}} - -{{if 'cuCoredumpRegisterStartCallback' in found_functions}} - -cdef CUresult _cuCoredumpRegisterStartCallback(CUcoredumpStatusCallback callback, void* userData, CUcoredumpCallbackHandle* callbackOut) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCoredumpRegisterStartCallback - cuPythonInit() - if __cuCoredumpRegisterStartCallback == NULL: - with gil: - raise RuntimeError('Function "cuCoredumpRegisterStartCallback" not found') - err = ( __cuCoredumpRegisterStartCallback)(callback, userData, callbackOut) - return err -{{endif}} - -{{if 'cuCoredumpRegisterCompleteCallback' in found_functions}} - -cdef CUresult _cuCoredumpRegisterCompleteCallback(CUcoredumpStatusCallback callback, void* userData, CUcoredumpCallbackHandle* callbackOut) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCoredumpRegisterCompleteCallback - cuPythonInit() - if __cuCoredumpRegisterCompleteCallback == NULL: - with gil: - raise RuntimeError('Function "cuCoredumpRegisterCompleteCallback" not found') - err = ( __cuCoredumpRegisterCompleteCallback)(callback, userData, callbackOut) - return err -{{endif}} - -{{if 'cuCoredumpDeregisterStartCallback' in found_functions}} - -cdef CUresult _cuCoredumpDeregisterStartCallback(CUcoredumpCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCoredumpDeregisterStartCallback - cuPythonInit() - if __cuCoredumpDeregisterStartCallback == NULL: - with gil: - raise RuntimeError('Function "cuCoredumpDeregisterStartCallback" not found') - err = ( __cuCoredumpDeregisterStartCallback)(callback) - return err -{{endif}} - -{{if 'cuCoredumpDeregisterCompleteCallback' in found_functions}} - -cdef CUresult _cuCoredumpDeregisterCompleteCallback(CUcoredumpCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCoredumpDeregisterCompleteCallback - cuPythonInit() - if __cuCoredumpDeregisterCompleteCallback == NULL: - with gil: - raise RuntimeError('Function "cuCoredumpDeregisterCompleteCallback" not found') - err = ( __cuCoredumpDeregisterCompleteCallback)(callback) - return err -{{endif}} - -{{if 'cuGetExportTable' in found_functions}} - -cdef CUresult _cuGetExportTable(const void** ppExportTable, const CUuuid* pExportTableId) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGetExportTable - cuPythonInit() - if __cuGetExportTable == NULL: - with gil: - raise RuntimeError('Function "cuGetExportTable" not found') - err = ( __cuGetExportTable)(ppExportTable, pExportTableId) - return err -{{endif}} - -{{if 'cuGreenCtxCreate' in found_functions}} - -cdef CUresult _cuGreenCtxCreate(CUgreenCtx* phCtx, CUdevResourceDesc desc, CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGreenCtxCreate - cuPythonInit() - if __cuGreenCtxCreate == NULL: - with gil: - raise RuntimeError('Function "cuGreenCtxCreate" not found') - err = ( __cuGreenCtxCreate)(phCtx, desc, dev, flags) - return err -{{endif}} - -{{if 'cuGreenCtxDestroy' in found_functions}} - -cdef CUresult _cuGreenCtxDestroy(CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGreenCtxDestroy - cuPythonInit() - if __cuGreenCtxDestroy == NULL: - with gil: - raise RuntimeError('Function "cuGreenCtxDestroy" not found') - err = ( __cuGreenCtxDestroy)(hCtx) - return err -{{endif}} - -{{if 'cuCtxFromGreenCtx' in found_functions}} - -cdef CUresult _cuCtxFromGreenCtx(CUcontext* pContext, CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxFromGreenCtx - cuPythonInit() - if __cuCtxFromGreenCtx == NULL: - with gil: - raise RuntimeError('Function "cuCtxFromGreenCtx" not found') - err = ( __cuCtxFromGreenCtx)(pContext, hCtx) - return err -{{endif}} - -{{if 'cuDeviceGetDevResource' in found_functions}} - -cdef CUresult _cuDeviceGetDevResource(CUdevice device, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDeviceGetDevResource - cuPythonInit() - if __cuDeviceGetDevResource == NULL: - with gil: - raise RuntimeError('Function "cuDeviceGetDevResource" not found') - err = ( __cuDeviceGetDevResource)(device, resource, typename) - return err -{{endif}} - -{{if 'cuCtxGetDevResource' in found_functions}} - -cdef CUresult _cuCtxGetDevResource(CUcontext hCtx, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCtxGetDevResource - cuPythonInit() - if __cuCtxGetDevResource == NULL: - with gil: - raise RuntimeError('Function "cuCtxGetDevResource" not found') - err = ( __cuCtxGetDevResource)(hCtx, resource, typename) - return err -{{endif}} - -{{if 'cuGreenCtxGetDevResource' in found_functions}} - -cdef CUresult _cuGreenCtxGetDevResource(CUgreenCtx hCtx, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGreenCtxGetDevResource - cuPythonInit() - if __cuGreenCtxGetDevResource == NULL: - with gil: - raise RuntimeError('Function "cuGreenCtxGetDevResource" not found') - err = ( __cuGreenCtxGetDevResource)(hCtx, resource, typename) - return err -{{endif}} - -{{if 'cuDevSmResourceSplitByCount' in found_functions}} - -cdef CUresult _cuDevSmResourceSplitByCount(CUdevResource* result, unsigned int* nbGroups, const CUdevResource* input, CUdevResource* remainder, unsigned int flags, unsigned int minCount) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDevSmResourceSplitByCount - cuPythonInit() - if __cuDevSmResourceSplitByCount == NULL: - with gil: - raise RuntimeError('Function "cuDevSmResourceSplitByCount" not found') - err = ( __cuDevSmResourceSplitByCount)(result, nbGroups, input, remainder, flags, minCount) - return err -{{endif}} - -{{if 'cuDevSmResourceSplit' in found_functions}} - -cdef CUresult _cuDevSmResourceSplit(CUdevResource* result, unsigned int nbGroups, const CUdevResource* input, CUdevResource* remainder, unsigned int flags, CU_DEV_SM_RESOURCE_GROUP_PARAMS* groupParams) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDevSmResourceSplit - cuPythonInit() - if __cuDevSmResourceSplit == NULL: - with gil: - raise RuntimeError('Function "cuDevSmResourceSplit" not found') - err = ( __cuDevSmResourceSplit)(result, nbGroups, input, remainder, flags, groupParams) - return err -{{endif}} - -{{if 'cuDevResourceGenerateDesc' in found_functions}} - -cdef CUresult _cuDevResourceGenerateDesc(CUdevResourceDesc* phDesc, CUdevResource* resources, unsigned int nbResources) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuDevResourceGenerateDesc - cuPythonInit() - if __cuDevResourceGenerateDesc == NULL: - with gil: - raise RuntimeError('Function "cuDevResourceGenerateDesc" not found') - err = ( __cuDevResourceGenerateDesc)(phDesc, resources, nbResources) - return err -{{endif}} - -{{if 'cuGreenCtxRecordEvent' in found_functions}} - -cdef CUresult _cuGreenCtxRecordEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGreenCtxRecordEvent - cuPythonInit() - if __cuGreenCtxRecordEvent == NULL: - with gil: - raise RuntimeError('Function "cuGreenCtxRecordEvent" not found') - err = ( __cuGreenCtxRecordEvent)(hCtx, hEvent) - return err -{{endif}} - -{{if 'cuGreenCtxWaitEvent' in found_functions}} - -cdef CUresult _cuGreenCtxWaitEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGreenCtxWaitEvent - cuPythonInit() - if __cuGreenCtxWaitEvent == NULL: - with gil: - raise RuntimeError('Function "cuGreenCtxWaitEvent" not found') - err = ( __cuGreenCtxWaitEvent)(hCtx, hEvent) - return err -{{endif}} - -{{if 'cuStreamGetGreenCtx' in found_functions}} - -cdef CUresult _cuStreamGetGreenCtx(CUstream hStream, CUgreenCtx* phCtx) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamGetGreenCtx - cuPythonInit() - if __cuStreamGetGreenCtx == NULL: - with gil: - raise RuntimeError('Function "cuStreamGetGreenCtx" not found') - err = ( __cuStreamGetGreenCtx)(hStream, phCtx) - return err -{{endif}} - -{{if 'cuGreenCtxStreamCreate' in found_functions}} - -cdef CUresult _cuGreenCtxStreamCreate(CUstream* phStream, CUgreenCtx greenCtx, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGreenCtxStreamCreate - cuPythonInit() - if __cuGreenCtxStreamCreate == NULL: - with gil: - raise RuntimeError('Function "cuGreenCtxStreamCreate" not found') - err = ( __cuGreenCtxStreamCreate)(phStream, greenCtx, flags, priority) - 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 'cuStreamGetDevResource' in found_functions}} - -cdef CUresult _cuStreamGetDevResource(CUstream hStream, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuStreamGetDevResource - cuPythonInit() - if __cuStreamGetDevResource == NULL: - with gil: - raise RuntimeError('Function "cuStreamGetDevResource" not found') - err = ( __cuStreamGetDevResource)(hStream, resource, typename) - return err -{{endif}} - -{{if 'cuLogsRegisterCallback' in found_functions}} - -cdef CUresult _cuLogsRegisterCallback(CUlogsCallback callbackFunc, void* userData, CUlogsCallbackHandle* callback_out) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLogsRegisterCallback - cuPythonInit() - if __cuLogsRegisterCallback == NULL: - with gil: - raise RuntimeError('Function "cuLogsRegisterCallback" not found') - err = ( __cuLogsRegisterCallback)(callbackFunc, userData, callback_out) - return err -{{endif}} - -{{if 'cuLogsUnregisterCallback' in found_functions}} - -cdef CUresult _cuLogsUnregisterCallback(CUlogsCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLogsUnregisterCallback - cuPythonInit() - if __cuLogsUnregisterCallback == NULL: - with gil: - raise RuntimeError('Function "cuLogsUnregisterCallback" not found') - err = ( __cuLogsUnregisterCallback)(callback) - return err -{{endif}} - -{{if 'cuLogsCurrent' in found_functions}} - -cdef CUresult _cuLogsCurrent(CUlogIterator* iterator_out, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLogsCurrent - cuPythonInit() - if __cuLogsCurrent == NULL: - with gil: - raise RuntimeError('Function "cuLogsCurrent" not found') - err = ( __cuLogsCurrent)(iterator_out, flags) - return err -{{endif}} - -{{if 'cuLogsDumpToFile' in found_functions}} - -cdef CUresult _cuLogsDumpToFile(CUlogIterator* iterator, const char* pathToFile, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLogsDumpToFile - cuPythonInit() - if __cuLogsDumpToFile == NULL: - with gil: - raise RuntimeError('Function "cuLogsDumpToFile" not found') - err = ( __cuLogsDumpToFile)(iterator, pathToFile, flags) - return err -{{endif}} - -{{if 'cuLogsDumpToMemory' in found_functions}} - -cdef CUresult _cuLogsDumpToMemory(CUlogIterator* iterator, char* buffer, size_t* size, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuLogsDumpToMemory - cuPythonInit() - if __cuLogsDumpToMemory == NULL: - with gil: - raise RuntimeError('Function "cuLogsDumpToMemory" not found') - err = ( __cuLogsDumpToMemory)(iterator, buffer, size, flags) - return err -{{endif}} - -{{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}} - -cdef CUresult _cuCheckpointProcessGetRestoreThreadId(int pid, int* tid) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCheckpointProcessGetRestoreThreadId - cuPythonInit() - if __cuCheckpointProcessGetRestoreThreadId == NULL: - with gil: - raise RuntimeError('Function "cuCheckpointProcessGetRestoreThreadId" not found') - err = ( __cuCheckpointProcessGetRestoreThreadId)(pid, tid) - return err -{{endif}} - -{{if 'cuCheckpointProcessGetState' in found_functions}} - -cdef CUresult _cuCheckpointProcessGetState(int pid, CUprocessState* state) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCheckpointProcessGetState - cuPythonInit() - if __cuCheckpointProcessGetState == NULL: - with gil: - raise RuntimeError('Function "cuCheckpointProcessGetState" not found') - err = ( __cuCheckpointProcessGetState)(pid, state) - return err -{{endif}} - -{{if 'cuCheckpointProcessLock' in found_functions}} - -cdef CUresult _cuCheckpointProcessLock(int pid, CUcheckpointLockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCheckpointProcessLock - cuPythonInit() - if __cuCheckpointProcessLock == NULL: - with gil: - raise RuntimeError('Function "cuCheckpointProcessLock" not found') - err = ( __cuCheckpointProcessLock)(pid, args) - return err -{{endif}} - -{{if 'cuCheckpointProcessCheckpoint' in found_functions}} - -cdef CUresult _cuCheckpointProcessCheckpoint(int pid, CUcheckpointCheckpointArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuCheckpointProcessCheckpoint - cuPythonInit() - if __cuCheckpointProcessCheckpoint == NULL: - with gil: - raise RuntimeError('Function "cuCheckpointProcessCheckpoint" not found') - err = ( __cuCheckpointProcessCheckpoint)(pid, args) - 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: - global __cuCheckpointProcessUnlock - cuPythonInit() - if __cuCheckpointProcessUnlock == NULL: - with gil: - raise RuntimeError('Function "cuCheckpointProcessUnlock" not found') - err = ( __cuCheckpointProcessUnlock)(pid, args) - return err -{{endif}} - -{{if 'cuProfilerStart' in found_functions}} - -cdef CUresult _cuProfilerStart() except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuProfilerStart - cuPythonInit() - if __cuProfilerStart == NULL: - with gil: - raise RuntimeError('Function "cuProfilerStart" not found') - err = ( __cuProfilerStart)() - return err -{{endif}} - -{{if 'cuProfilerStop' in found_functions}} - -cdef CUresult _cuProfilerStop() except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuProfilerStop - cuPythonInit() - if __cuProfilerStop == NULL: - with gil: - raise RuntimeError('Function "cuProfilerStop" not found') - err = ( __cuProfilerStop)() - return err -{{endif}} - -{{if True}} - -cdef CUresult _cuGraphicsEGLRegisterImage(CUgraphicsResource* pCudaResource, EGLImageKHR image, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphicsEGLRegisterImage - cuPythonInit() - if __cuGraphicsEGLRegisterImage == NULL: - with gil: - raise RuntimeError('Function "cuGraphicsEGLRegisterImage" not found') - err = ( __cuGraphicsEGLRegisterImage)(pCudaResource, image, flags) - return err -{{endif}} - -{{if True}} - -cdef CUresult _cuEGLStreamConsumerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuEGLStreamConsumerConnect - cuPythonInit() - if __cuEGLStreamConsumerConnect == NULL: - with gil: - raise RuntimeError('Function "cuEGLStreamConsumerConnect" not found') - err = ( __cuEGLStreamConsumerConnect)(conn, stream) - return err -{{endif}} - -{{if True}} - -cdef CUresult _cuEGLStreamConsumerConnectWithFlags(CUeglStreamConnection* conn, EGLStreamKHR stream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuEGLStreamConsumerConnectWithFlags - cuPythonInit() - if __cuEGLStreamConsumerConnectWithFlags == NULL: - with gil: - raise RuntimeError('Function "cuEGLStreamConsumerConnectWithFlags" not found') - err = ( __cuEGLStreamConsumerConnectWithFlags)(conn, stream, flags) - return err -{{endif}} - -{{if True}} - -cdef CUresult _cuEGLStreamConsumerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuEGLStreamConsumerDisconnect - cuPythonInit() - if __cuEGLStreamConsumerDisconnect == NULL: - with gil: - raise RuntimeError('Function "cuEGLStreamConsumerDisconnect" not found') - err = ( __cuEGLStreamConsumerDisconnect)(conn) - return err -{{endif}} - -{{if True}} - -cdef CUresult _cuEGLStreamConsumerAcquireFrame(CUeglStreamConnection* conn, CUgraphicsResource* pCudaResource, CUstream* pStream, unsigned int timeout) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuEGLStreamConsumerAcquireFrame - cuPythonInit() - if __cuEGLStreamConsumerAcquireFrame == NULL: - with gil: - raise RuntimeError('Function "cuEGLStreamConsumerAcquireFrame" not found') - err = ( __cuEGLStreamConsumerAcquireFrame)(conn, pCudaResource, pStream, timeout) - return err -{{endif}} - -{{if True}} - -cdef CUresult _cuEGLStreamConsumerReleaseFrame(CUeglStreamConnection* conn, CUgraphicsResource pCudaResource, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuEGLStreamConsumerReleaseFrame - cuPythonInit() - if __cuEGLStreamConsumerReleaseFrame == NULL: - with gil: - raise RuntimeError('Function "cuEGLStreamConsumerReleaseFrame" not found') - err = ( __cuEGLStreamConsumerReleaseFrame)(conn, pCudaResource, pStream) - return err -{{endif}} - -{{if True}} - -cdef CUresult _cuEGLStreamProducerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream, EGLint width, EGLint height) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuEGLStreamProducerConnect - cuPythonInit() - if __cuEGLStreamProducerConnect == NULL: - with gil: - raise RuntimeError('Function "cuEGLStreamProducerConnect" not found') - err = ( __cuEGLStreamProducerConnect)(conn, stream, width, height) - return err -{{endif}} - -{{if True}} - -cdef CUresult _cuEGLStreamProducerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuEGLStreamProducerDisconnect - cuPythonInit() - if __cuEGLStreamProducerDisconnect == NULL: - with gil: - raise RuntimeError('Function "cuEGLStreamProducerDisconnect" not found') - err = ( __cuEGLStreamProducerDisconnect)(conn) - return err -{{endif}} - -{{if True}} - -cdef CUresult _cuEGLStreamProducerPresentFrame(CUeglStreamConnection* conn, CUeglFrame eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuEGLStreamProducerPresentFrame - cuPythonInit() - if __cuEGLStreamProducerPresentFrame == NULL: - with gil: - raise RuntimeError('Function "cuEGLStreamProducerPresentFrame" not found') - err = ( __cuEGLStreamProducerPresentFrame)(conn, eglframe, pStream) - return err -{{endif}} - -{{if True}} - -cdef CUresult _cuEGLStreamProducerReturnFrame(CUeglStreamConnection* conn, CUeglFrame* eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuEGLStreamProducerReturnFrame - cuPythonInit() - if __cuEGLStreamProducerReturnFrame == NULL: - with gil: - raise RuntimeError('Function "cuEGLStreamProducerReturnFrame" not found') - err = ( __cuEGLStreamProducerReturnFrame)(conn, eglframe, pStream) - return err -{{endif}} - -{{if True}} - -cdef CUresult _cuGraphicsResourceGetMappedEglFrame(CUeglFrame* eglFrame, CUgraphicsResource resource, unsigned int index, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphicsResourceGetMappedEglFrame - cuPythonInit() - if __cuGraphicsResourceGetMappedEglFrame == NULL: - with gil: - raise RuntimeError('Function "cuGraphicsResourceGetMappedEglFrame" not found') - err = ( __cuGraphicsResourceGetMappedEglFrame)(eglFrame, resource, index, mipLevel) - return err -{{endif}} - -{{if True}} - -cdef CUresult _cuEventCreateFromEGLSync(CUevent* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuEventCreateFromEGLSync - cuPythonInit() - if __cuEventCreateFromEGLSync == NULL: - with gil: - raise RuntimeError('Function "cuEventCreateFromEGLSync" not found') - err = ( __cuEventCreateFromEGLSync)(phEvent, eglSync, flags) - return err -{{endif}} - -{{if True}} - -cdef CUresult _cuGraphicsGLRegisterBuffer(CUgraphicsResource* pCudaResource, GLuint buffer, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphicsGLRegisterBuffer - cuPythonInit() - if __cuGraphicsGLRegisterBuffer == NULL: - with gil: - raise RuntimeError('Function "cuGraphicsGLRegisterBuffer" not found') - err = ( __cuGraphicsGLRegisterBuffer)(pCudaResource, buffer, Flags) - return err -{{endif}} - -{{if True}} - -cdef CUresult _cuGraphicsGLRegisterImage(CUgraphicsResource* pCudaResource, GLuint image, GLenum target, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphicsGLRegisterImage - cuPythonInit() - if __cuGraphicsGLRegisterImage == NULL: - with gil: - raise RuntimeError('Function "cuGraphicsGLRegisterImage" not found') - err = ( __cuGraphicsGLRegisterImage)(pCudaResource, image, target, Flags) - return err -{{endif}} - -{{if True}} - -cdef CUresult _cuGLGetDevices_v2(unsigned int* pCudaDeviceCount, CUdevice* pCudaDevices, unsigned int cudaDeviceCount, CUGLDeviceList deviceList) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGLGetDevices_v2 - cuPythonInit() - if __cuGLGetDevices_v2 == NULL: - with gil: - raise RuntimeError('Function "cuGLGetDevices_v2" not found') - err = ( __cuGLGetDevices_v2)(pCudaDeviceCount, pCudaDevices, cudaDeviceCount, deviceList) - return err -{{endif}} - -{{if True}} - -cdef CUresult _cuVDPAUGetDevice(CUdevice* pDevice, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuVDPAUGetDevice - cuPythonInit() - if __cuVDPAUGetDevice == NULL: - with gil: - raise RuntimeError('Function "cuVDPAUGetDevice" not found') - err = ( __cuVDPAUGetDevice)(pDevice, vdpDevice, vdpGetProcAddress) - return err -{{endif}} - -{{if True}} - -cdef CUresult _cuVDPAUCtxCreate_v2(CUcontext* pCtx, unsigned int flags, CUdevice device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuVDPAUCtxCreate_v2 - cuPythonInit() - if __cuVDPAUCtxCreate_v2 == NULL: - with gil: - raise RuntimeError('Function "cuVDPAUCtxCreate_v2" not found') - err = ( __cuVDPAUCtxCreate_v2)(pCtx, flags, device, vdpDevice, vdpGetProcAddress) - return err -{{endif}} - -{{if True}} - -cdef CUresult _cuGraphicsVDPAURegisterVideoSurface(CUgraphicsResource* pCudaResource, VdpVideoSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphicsVDPAURegisterVideoSurface - cuPythonInit() - if __cuGraphicsVDPAURegisterVideoSurface == NULL: - with gil: - raise RuntimeError('Function "cuGraphicsVDPAURegisterVideoSurface" not found') - err = ( __cuGraphicsVDPAURegisterVideoSurface)(pCudaResource, vdpSurface, flags) - return err -{{endif}} - -{{if True}} - -cdef CUresult _cuGraphicsVDPAURegisterOutputSurface(CUgraphicsResource* pCudaResource, VdpOutputSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - global __cuGraphicsVDPAURegisterOutputSurface - cuPythonInit() - if __cuGraphicsVDPAURegisterOutputSurface == NULL: - with gil: - raise RuntimeError('Function "cuGraphicsVDPAURegisterOutputSurface" not found') - err = ( __cuGraphicsVDPAURegisterOutputSurface)(pCudaResource, vdpSurface, flags) - return err -{{endif}} - -cdef dict func_ptrs = None - -cpdef dict _inspect_function_pointers(): - global func_ptrs - if func_ptrs is not None: - return func_ptrs - - cuPythonInit() - cdef dict data = {} - - {{if 'cuGetErrorString' in found_functions}} - global __cuGetErrorString - data["__cuGetErrorString"] = __cuGetErrorString - {{else}} - data["__cuGetErrorString"] = 0 - {{endif}} - - {{if 'cuGetErrorName' in found_functions}} - global __cuGetErrorName - data["__cuGetErrorName"] = __cuGetErrorName - {{else}} - data["__cuGetErrorName"] = 0 - {{endif}} - - {{if 'cuInit' in found_functions}} - global __cuInit - data["__cuInit"] = __cuInit - {{else}} - data["__cuInit"] = 0 - {{endif}} - - {{if 'cuDriverGetVersion' in found_functions}} - global __cuDriverGetVersion - data["__cuDriverGetVersion"] = __cuDriverGetVersion - {{else}} - data["__cuDriverGetVersion"] = 0 - {{endif}} - - {{if 'cuDeviceGet' in found_functions}} - global __cuDeviceGet - data["__cuDeviceGet"] = __cuDeviceGet - {{else}} - data["__cuDeviceGet"] = 0 - {{endif}} - - {{if 'cuDeviceGetCount' in found_functions}} - global __cuDeviceGetCount - data["__cuDeviceGetCount"] = __cuDeviceGetCount - {{else}} - data["__cuDeviceGetCount"] = 0 - {{endif}} - - {{if 'cuDeviceGetName' in found_functions}} - global __cuDeviceGetName - data["__cuDeviceGetName"] = __cuDeviceGetName - {{else}} - data["__cuDeviceGetName"] = 0 - {{endif}} - - {{if 'cuDeviceGetUuid_v2' in found_functions}} - global __cuDeviceGetUuid_v2 - data["__cuDeviceGetUuid_v2"] = __cuDeviceGetUuid_v2 - {{else}} - data["__cuDeviceGetUuid_v2"] = 0 - {{endif}} - - {{if 'cuDeviceGetLuid' in found_functions}} - global __cuDeviceGetLuid - data["__cuDeviceGetLuid"] = __cuDeviceGetLuid - {{else}} - data["__cuDeviceGetLuid"] = 0 - {{endif}} - - {{if 'cuDeviceTotalMem_v2' in found_functions}} - global __cuDeviceTotalMem_v2 - data["__cuDeviceTotalMem_v2"] = __cuDeviceTotalMem_v2 - {{else}} - data["__cuDeviceTotalMem_v2"] = 0 - {{endif}} - - {{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}} - global __cuDeviceGetTexture1DLinearMaxWidth - data["__cuDeviceGetTexture1DLinearMaxWidth"] = __cuDeviceGetTexture1DLinearMaxWidth - {{else}} - data["__cuDeviceGetTexture1DLinearMaxWidth"] = 0 - {{endif}} - - {{if 'cuDeviceGetAttribute' in found_functions}} - global __cuDeviceGetAttribute - data["__cuDeviceGetAttribute"] = __cuDeviceGetAttribute - {{else}} - 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 - {{else}} - data["__cuDeviceGetNvSciSyncAttributes"] = 0 - {{endif}} - - {{if 'cuDeviceSetMemPool' in found_functions}} - global __cuDeviceSetMemPool - data["__cuDeviceSetMemPool"] = __cuDeviceSetMemPool - {{else}} - data["__cuDeviceSetMemPool"] = 0 - {{endif}} - - {{if 'cuDeviceGetMemPool' in found_functions}} - global __cuDeviceGetMemPool - data["__cuDeviceGetMemPool"] = __cuDeviceGetMemPool - {{else}} - data["__cuDeviceGetMemPool"] = 0 - {{endif}} - - {{if 'cuDeviceGetDefaultMemPool' in found_functions}} - global __cuDeviceGetDefaultMemPool - data["__cuDeviceGetDefaultMemPool"] = __cuDeviceGetDefaultMemPool - {{else}} - data["__cuDeviceGetDefaultMemPool"] = 0 - {{endif}} - - {{if 'cuDeviceGetExecAffinitySupport' in found_functions}} - global __cuDeviceGetExecAffinitySupport - data["__cuDeviceGetExecAffinitySupport"] = __cuDeviceGetExecAffinitySupport - {{else}} - data["__cuDeviceGetExecAffinitySupport"] = 0 - {{endif}} - - {{if 'cuFlushGPUDirectRDMAWrites' in found_functions}} - global __cuFlushGPUDirectRDMAWrites - data["__cuFlushGPUDirectRDMAWrites"] = __cuFlushGPUDirectRDMAWrites - {{else}} - data["__cuFlushGPUDirectRDMAWrites"] = 0 - {{endif}} - - {{if 'cuDeviceGetProperties' in found_functions}} - global __cuDeviceGetProperties - data["__cuDeviceGetProperties"] = __cuDeviceGetProperties - {{else}} - data["__cuDeviceGetProperties"] = 0 - {{endif}} - - {{if 'cuDeviceComputeCapability' in found_functions}} - global __cuDeviceComputeCapability - data["__cuDeviceComputeCapability"] = __cuDeviceComputeCapability - {{else}} - data["__cuDeviceComputeCapability"] = 0 - {{endif}} - - {{if 'cuDevicePrimaryCtxRetain' in found_functions}} - global __cuDevicePrimaryCtxRetain - data["__cuDevicePrimaryCtxRetain"] = __cuDevicePrimaryCtxRetain - {{else}} - data["__cuDevicePrimaryCtxRetain"] = 0 - {{endif}} - - {{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}} - global __cuDevicePrimaryCtxRelease_v2 - data["__cuDevicePrimaryCtxRelease_v2"] = __cuDevicePrimaryCtxRelease_v2 - {{else}} - data["__cuDevicePrimaryCtxRelease_v2"] = 0 - {{endif}} - - {{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}} - global __cuDevicePrimaryCtxSetFlags_v2 - data["__cuDevicePrimaryCtxSetFlags_v2"] = __cuDevicePrimaryCtxSetFlags_v2 - {{else}} - data["__cuDevicePrimaryCtxSetFlags_v2"] = 0 - {{endif}} - - {{if 'cuDevicePrimaryCtxGetState' in found_functions}} - global __cuDevicePrimaryCtxGetState - data["__cuDevicePrimaryCtxGetState"] = __cuDevicePrimaryCtxGetState - {{else}} - data["__cuDevicePrimaryCtxGetState"] = 0 - {{endif}} - - {{if 'cuDevicePrimaryCtxReset_v2' in found_functions}} - global __cuDevicePrimaryCtxReset_v2 - data["__cuDevicePrimaryCtxReset_v2"] = __cuDevicePrimaryCtxReset_v2 - {{else}} - data["__cuDevicePrimaryCtxReset_v2"] = 0 - {{endif}} - - {{if 'cuCtxCreate_v4' in found_functions}} - global __cuCtxCreate_v4 - data["__cuCtxCreate_v4"] = __cuCtxCreate_v4 - {{else}} - data["__cuCtxCreate_v4"] = 0 - {{endif}} - - {{if 'cuCtxDestroy_v2' in found_functions}} - global __cuCtxDestroy_v2 - data["__cuCtxDestroy_v2"] = __cuCtxDestroy_v2 - {{else}} - data["__cuCtxDestroy_v2"] = 0 - {{endif}} - - {{if 'cuCtxPushCurrent_v2' in found_functions}} - global __cuCtxPushCurrent_v2 - data["__cuCtxPushCurrent_v2"] = __cuCtxPushCurrent_v2 - {{else}} - data["__cuCtxPushCurrent_v2"] = 0 - {{endif}} - - {{if 'cuCtxPopCurrent_v2' in found_functions}} - global __cuCtxPopCurrent_v2 - data["__cuCtxPopCurrent_v2"] = __cuCtxPopCurrent_v2 - {{else}} - data["__cuCtxPopCurrent_v2"] = 0 - {{endif}} - - {{if 'cuCtxSetCurrent' in found_functions}} - global __cuCtxSetCurrent - data["__cuCtxSetCurrent"] = __cuCtxSetCurrent - {{else}} - data["__cuCtxSetCurrent"] = 0 - {{endif}} - - {{if 'cuCtxGetCurrent' in found_functions}} - global __cuCtxGetCurrent - data["__cuCtxGetCurrent"] = __cuCtxGetCurrent - {{else}} - data["__cuCtxGetCurrent"] = 0 - {{endif}} - - {{if 'cuCtxGetDevice' in found_functions}} - global __cuCtxGetDevice - data["__cuCtxGetDevice"] = __cuCtxGetDevice - {{else}} - 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 - {{else}} - data["__cuCtxGetFlags"] = 0 - {{endif}} - - {{if 'cuCtxSetFlags' in found_functions}} - global __cuCtxSetFlags - data["__cuCtxSetFlags"] = __cuCtxSetFlags - {{else}} - data["__cuCtxSetFlags"] = 0 - {{endif}} - - {{if 'cuCtxGetId' in found_functions}} - global __cuCtxGetId - data["__cuCtxGetId"] = __cuCtxGetId - {{else}} - data["__cuCtxGetId"] = 0 - {{endif}} - - {{if 'cuCtxSynchronize' in found_functions}} - global __cuCtxSynchronize - data["__cuCtxSynchronize"] = __cuCtxSynchronize - {{else}} - 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 - {{else}} - data["__cuCtxSetLimit"] = 0 - {{endif}} - - {{if 'cuCtxGetLimit' in found_functions}} - global __cuCtxGetLimit - data["__cuCtxGetLimit"] = __cuCtxGetLimit - {{else}} - data["__cuCtxGetLimit"] = 0 - {{endif}} - - {{if 'cuCtxGetCacheConfig' in found_functions}} - global __cuCtxGetCacheConfig - data["__cuCtxGetCacheConfig"] = __cuCtxGetCacheConfig - {{else}} - data["__cuCtxGetCacheConfig"] = 0 - {{endif}} - - {{if 'cuCtxSetCacheConfig' in found_functions}} - global __cuCtxSetCacheConfig - data["__cuCtxSetCacheConfig"] = __cuCtxSetCacheConfig - {{else}} - data["__cuCtxSetCacheConfig"] = 0 - {{endif}} - - {{if 'cuCtxGetApiVersion' in found_functions}} - global __cuCtxGetApiVersion - data["__cuCtxGetApiVersion"] = __cuCtxGetApiVersion - {{else}} - data["__cuCtxGetApiVersion"] = 0 - {{endif}} - - {{if 'cuCtxGetStreamPriorityRange' in found_functions}} - global __cuCtxGetStreamPriorityRange - data["__cuCtxGetStreamPriorityRange"] = __cuCtxGetStreamPriorityRange - {{else}} - data["__cuCtxGetStreamPriorityRange"] = 0 - {{endif}} - - {{if 'cuCtxResetPersistingL2Cache' in found_functions}} - global __cuCtxResetPersistingL2Cache - data["__cuCtxResetPersistingL2Cache"] = __cuCtxResetPersistingL2Cache - {{else}} - data["__cuCtxResetPersistingL2Cache"] = 0 - {{endif}} - - {{if 'cuCtxGetExecAffinity' in found_functions}} - global __cuCtxGetExecAffinity - data["__cuCtxGetExecAffinity"] = __cuCtxGetExecAffinity - {{else}} - data["__cuCtxGetExecAffinity"] = 0 - {{endif}} - - {{if 'cuCtxRecordEvent' in found_functions}} - global __cuCtxRecordEvent - data["__cuCtxRecordEvent"] = __cuCtxRecordEvent - {{else}} - data["__cuCtxRecordEvent"] = 0 - {{endif}} - - {{if 'cuCtxWaitEvent' in found_functions}} - global __cuCtxWaitEvent - data["__cuCtxWaitEvent"] = __cuCtxWaitEvent - {{else}} - data["__cuCtxWaitEvent"] = 0 - {{endif}} - - {{if 'cuCtxAttach' in found_functions}} - global __cuCtxAttach - data["__cuCtxAttach"] = __cuCtxAttach - {{else}} - data["__cuCtxAttach"] = 0 - {{endif}} - - {{if 'cuCtxDetach' in found_functions}} - global __cuCtxDetach - data["__cuCtxDetach"] = __cuCtxDetach - {{else}} - data["__cuCtxDetach"] = 0 - {{endif}} - - {{if 'cuCtxGetSharedMemConfig' in found_functions}} - global __cuCtxGetSharedMemConfig - data["__cuCtxGetSharedMemConfig"] = __cuCtxGetSharedMemConfig - {{else}} - data["__cuCtxGetSharedMemConfig"] = 0 - {{endif}} - - {{if 'cuCtxSetSharedMemConfig' in found_functions}} - global __cuCtxSetSharedMemConfig - data["__cuCtxSetSharedMemConfig"] = __cuCtxSetSharedMemConfig - {{else}} - data["__cuCtxSetSharedMemConfig"] = 0 - {{endif}} - - {{if 'cuModuleLoad' in found_functions}} - global __cuModuleLoad - data["__cuModuleLoad"] = __cuModuleLoad - {{else}} - data["__cuModuleLoad"] = 0 - {{endif}} - - {{if 'cuModuleLoadData' in found_functions}} - global __cuModuleLoadData - data["__cuModuleLoadData"] = __cuModuleLoadData - {{else}} - data["__cuModuleLoadData"] = 0 - {{endif}} - - {{if 'cuModuleLoadDataEx' in found_functions}} - global __cuModuleLoadDataEx - data["__cuModuleLoadDataEx"] = __cuModuleLoadDataEx - {{else}} - data["__cuModuleLoadDataEx"] = 0 - {{endif}} - - {{if 'cuModuleLoadFatBinary' in found_functions}} - global __cuModuleLoadFatBinary - data["__cuModuleLoadFatBinary"] = __cuModuleLoadFatBinary - {{else}} - data["__cuModuleLoadFatBinary"] = 0 - {{endif}} - - {{if 'cuModuleUnload' in found_functions}} - global __cuModuleUnload - data["__cuModuleUnload"] = __cuModuleUnload - {{else}} - data["__cuModuleUnload"] = 0 - {{endif}} - - {{if 'cuModuleGetLoadingMode' in found_functions}} - global __cuModuleGetLoadingMode - data["__cuModuleGetLoadingMode"] = __cuModuleGetLoadingMode - {{else}} - data["__cuModuleGetLoadingMode"] = 0 - {{endif}} - - {{if 'cuModuleGetFunction' in found_functions}} - global __cuModuleGetFunction - data["__cuModuleGetFunction"] = __cuModuleGetFunction - {{else}} - data["__cuModuleGetFunction"] = 0 - {{endif}} - - {{if 'cuModuleGetFunctionCount' in found_functions}} - global __cuModuleGetFunctionCount - data["__cuModuleGetFunctionCount"] = __cuModuleGetFunctionCount - {{else}} - data["__cuModuleGetFunctionCount"] = 0 - {{endif}} - - {{if 'cuModuleEnumerateFunctions' in found_functions}} - global __cuModuleEnumerateFunctions - data["__cuModuleEnumerateFunctions"] = __cuModuleEnumerateFunctions - {{else}} - data["__cuModuleEnumerateFunctions"] = 0 - {{endif}} - - {{if 'cuModuleGetGlobal_v2' in found_functions}} - global __cuModuleGetGlobal_v2 - data["__cuModuleGetGlobal_v2"] = __cuModuleGetGlobal_v2 - {{else}} - data["__cuModuleGetGlobal_v2"] = 0 - {{endif}} - - {{if 'cuLinkCreate_v2' in found_functions}} - global __cuLinkCreate_v2 - data["__cuLinkCreate_v2"] = __cuLinkCreate_v2 - {{else}} - data["__cuLinkCreate_v2"] = 0 - {{endif}} - - {{if 'cuLinkAddData_v2' in found_functions}} - global __cuLinkAddData_v2 - data["__cuLinkAddData_v2"] = __cuLinkAddData_v2 - {{else}} - data["__cuLinkAddData_v2"] = 0 - {{endif}} - - {{if 'cuLinkAddFile_v2' in found_functions}} - global __cuLinkAddFile_v2 - data["__cuLinkAddFile_v2"] = __cuLinkAddFile_v2 - {{else}} - data["__cuLinkAddFile_v2"] = 0 - {{endif}} - - {{if 'cuLinkComplete' in found_functions}} - global __cuLinkComplete - data["__cuLinkComplete"] = __cuLinkComplete - {{else}} - data["__cuLinkComplete"] = 0 - {{endif}} - - {{if 'cuLinkDestroy' in found_functions}} - global __cuLinkDestroy - data["__cuLinkDestroy"] = __cuLinkDestroy - {{else}} - data["__cuLinkDestroy"] = 0 - {{endif}} - - {{if 'cuModuleGetTexRef' in found_functions}} - global __cuModuleGetTexRef - data["__cuModuleGetTexRef"] = __cuModuleGetTexRef - {{else}} - data["__cuModuleGetTexRef"] = 0 - {{endif}} - - {{if 'cuModuleGetSurfRef' in found_functions}} - global __cuModuleGetSurfRef - data["__cuModuleGetSurfRef"] = __cuModuleGetSurfRef - {{else}} - data["__cuModuleGetSurfRef"] = 0 - {{endif}} - - {{if 'cuLibraryLoadData' in found_functions}} - global __cuLibraryLoadData - data["__cuLibraryLoadData"] = __cuLibraryLoadData - {{else}} - data["__cuLibraryLoadData"] = 0 - {{endif}} - - {{if 'cuLibraryLoadFromFile' in found_functions}} - global __cuLibraryLoadFromFile - data["__cuLibraryLoadFromFile"] = __cuLibraryLoadFromFile - {{else}} - data["__cuLibraryLoadFromFile"] = 0 - {{endif}} - - {{if 'cuLibraryUnload' in found_functions}} - global __cuLibraryUnload - data["__cuLibraryUnload"] = __cuLibraryUnload - {{else}} - data["__cuLibraryUnload"] = 0 - {{endif}} - - {{if 'cuLibraryGetKernel' in found_functions}} - global __cuLibraryGetKernel - data["__cuLibraryGetKernel"] = __cuLibraryGetKernel - {{else}} - data["__cuLibraryGetKernel"] = 0 - {{endif}} - - {{if 'cuLibraryGetKernelCount' in found_functions}} - global __cuLibraryGetKernelCount - data["__cuLibraryGetKernelCount"] = __cuLibraryGetKernelCount - {{else}} - data["__cuLibraryGetKernelCount"] = 0 - {{endif}} - - {{if 'cuLibraryEnumerateKernels' in found_functions}} - global __cuLibraryEnumerateKernels - data["__cuLibraryEnumerateKernels"] = __cuLibraryEnumerateKernels - {{else}} - data["__cuLibraryEnumerateKernels"] = 0 - {{endif}} - - {{if 'cuLibraryGetModule' in found_functions}} - global __cuLibraryGetModule - data["__cuLibraryGetModule"] = __cuLibraryGetModule - {{else}} - data["__cuLibraryGetModule"] = 0 - {{endif}} - - {{if 'cuKernelGetFunction' in found_functions}} - global __cuKernelGetFunction - data["__cuKernelGetFunction"] = __cuKernelGetFunction - {{else}} - data["__cuKernelGetFunction"] = 0 - {{endif}} - - {{if 'cuKernelGetLibrary' in found_functions}} - global __cuKernelGetLibrary - data["__cuKernelGetLibrary"] = __cuKernelGetLibrary - {{else}} - data["__cuKernelGetLibrary"] = 0 - {{endif}} - - {{if 'cuLibraryGetGlobal' in found_functions}} - global __cuLibraryGetGlobal - data["__cuLibraryGetGlobal"] = __cuLibraryGetGlobal - {{else}} - data["__cuLibraryGetGlobal"] = 0 - {{endif}} - - {{if 'cuLibraryGetManaged' in found_functions}} - global __cuLibraryGetManaged - data["__cuLibraryGetManaged"] = __cuLibraryGetManaged - {{else}} - data["__cuLibraryGetManaged"] = 0 - {{endif}} - - {{if 'cuLibraryGetUnifiedFunction' in found_functions}} - global __cuLibraryGetUnifiedFunction - data["__cuLibraryGetUnifiedFunction"] = __cuLibraryGetUnifiedFunction - {{else}} - data["__cuLibraryGetUnifiedFunction"] = 0 - {{endif}} - - {{if 'cuKernelGetAttribute' in found_functions}} - global __cuKernelGetAttribute - data["__cuKernelGetAttribute"] = __cuKernelGetAttribute - {{else}} - data["__cuKernelGetAttribute"] = 0 - {{endif}} - - {{if 'cuKernelSetAttribute' in found_functions}} - global __cuKernelSetAttribute - data["__cuKernelSetAttribute"] = __cuKernelSetAttribute - {{else}} - data["__cuKernelSetAttribute"] = 0 - {{endif}} - - {{if 'cuKernelSetCacheConfig' in found_functions}} - global __cuKernelSetCacheConfig - data["__cuKernelSetCacheConfig"] = __cuKernelSetCacheConfig - {{else}} - data["__cuKernelSetCacheConfig"] = 0 - {{endif}} - - {{if 'cuKernelGetName' in found_functions}} - global __cuKernelGetName - data["__cuKernelGetName"] = __cuKernelGetName - {{else}} - data["__cuKernelGetName"] = 0 - {{endif}} - - {{if 'cuKernelGetParamInfo' in found_functions}} - global __cuKernelGetParamInfo - data["__cuKernelGetParamInfo"] = __cuKernelGetParamInfo - {{else}} - data["__cuKernelGetParamInfo"] = 0 - {{endif}} - - {{if 'cuKernelGetParamCount' in found_functions}} - global __cuKernelGetParamCount - data["__cuKernelGetParamCount"] = __cuKernelGetParamCount - {{else}} - data["__cuKernelGetParamCount"] = 0 - {{endif}} - - {{if 'cuMemGetInfo_v2' in found_functions}} - global __cuMemGetInfo_v2 - data["__cuMemGetInfo_v2"] = __cuMemGetInfo_v2 - {{else}} - data["__cuMemGetInfo_v2"] = 0 - {{endif}} - - {{if 'cuMemAlloc_v2' in found_functions}} - global __cuMemAlloc_v2 - data["__cuMemAlloc_v2"] = __cuMemAlloc_v2 - {{else}} - data["__cuMemAlloc_v2"] = 0 - {{endif}} - - {{if 'cuMemAllocPitch_v2' in found_functions}} - global __cuMemAllocPitch_v2 - data["__cuMemAllocPitch_v2"] = __cuMemAllocPitch_v2 - {{else}} - data["__cuMemAllocPitch_v2"] = 0 - {{endif}} - - {{if 'cuMemFree_v2' in found_functions}} - global __cuMemFree_v2 - data["__cuMemFree_v2"] = __cuMemFree_v2 - {{else}} - data["__cuMemFree_v2"] = 0 - {{endif}} - - {{if 'cuMemGetAddressRange_v2' in found_functions}} - global __cuMemGetAddressRange_v2 - data["__cuMemGetAddressRange_v2"] = __cuMemGetAddressRange_v2 - {{else}} - data["__cuMemGetAddressRange_v2"] = 0 - {{endif}} - - {{if 'cuMemAllocHost_v2' in found_functions}} - global __cuMemAllocHost_v2 - data["__cuMemAllocHost_v2"] = __cuMemAllocHost_v2 - {{else}} - data["__cuMemAllocHost_v2"] = 0 - {{endif}} - - {{if 'cuMemFreeHost' in found_functions}} - global __cuMemFreeHost - data["__cuMemFreeHost"] = __cuMemFreeHost - {{else}} - data["__cuMemFreeHost"] = 0 - {{endif}} - - {{if 'cuMemHostAlloc' in found_functions}} - global __cuMemHostAlloc - data["__cuMemHostAlloc"] = __cuMemHostAlloc - {{else}} - data["__cuMemHostAlloc"] = 0 - {{endif}} - - {{if 'cuMemHostGetDevicePointer_v2' in found_functions}} - global __cuMemHostGetDevicePointer_v2 - data["__cuMemHostGetDevicePointer_v2"] = __cuMemHostGetDevicePointer_v2 - {{else}} - data["__cuMemHostGetDevicePointer_v2"] = 0 - {{endif}} - - {{if 'cuMemHostGetFlags' in found_functions}} - global __cuMemHostGetFlags - data["__cuMemHostGetFlags"] = __cuMemHostGetFlags - {{else}} - data["__cuMemHostGetFlags"] = 0 - {{endif}} - - {{if 'cuMemAllocManaged' in found_functions}} - global __cuMemAllocManaged - data["__cuMemAllocManaged"] = __cuMemAllocManaged - {{else}} - data["__cuMemAllocManaged"] = 0 - {{endif}} - - {{if 'cuDeviceRegisterAsyncNotification' in found_functions}} - global __cuDeviceRegisterAsyncNotification - data["__cuDeviceRegisterAsyncNotification"] = __cuDeviceRegisterAsyncNotification - {{else}} - data["__cuDeviceRegisterAsyncNotification"] = 0 - {{endif}} - - {{if 'cuDeviceUnregisterAsyncNotification' in found_functions}} - global __cuDeviceUnregisterAsyncNotification - data["__cuDeviceUnregisterAsyncNotification"] = __cuDeviceUnregisterAsyncNotification - {{else}} - data["__cuDeviceUnregisterAsyncNotification"] = 0 - {{endif}} - - {{if 'cuDeviceGetByPCIBusId' in found_functions}} - global __cuDeviceGetByPCIBusId - data["__cuDeviceGetByPCIBusId"] = __cuDeviceGetByPCIBusId - {{else}} - data["__cuDeviceGetByPCIBusId"] = 0 - {{endif}} - - {{if 'cuDeviceGetPCIBusId' in found_functions}} - global __cuDeviceGetPCIBusId - data["__cuDeviceGetPCIBusId"] = __cuDeviceGetPCIBusId - {{else}} - data["__cuDeviceGetPCIBusId"] = 0 - {{endif}} - - {{if 'cuIpcGetEventHandle' in found_functions}} - global __cuIpcGetEventHandle - data["__cuIpcGetEventHandle"] = __cuIpcGetEventHandle - {{else}} - data["__cuIpcGetEventHandle"] = 0 - {{endif}} - - {{if 'cuIpcOpenEventHandle' in found_functions}} - global __cuIpcOpenEventHandle - data["__cuIpcOpenEventHandle"] = __cuIpcOpenEventHandle - {{else}} - data["__cuIpcOpenEventHandle"] = 0 - {{endif}} - - {{if 'cuIpcGetMemHandle' in found_functions}} - global __cuIpcGetMemHandle - data["__cuIpcGetMemHandle"] = __cuIpcGetMemHandle - {{else}} - data["__cuIpcGetMemHandle"] = 0 - {{endif}} - - {{if 'cuIpcOpenMemHandle_v2' in found_functions}} - global __cuIpcOpenMemHandle_v2 - data["__cuIpcOpenMemHandle_v2"] = __cuIpcOpenMemHandle_v2 - {{else}} - data["__cuIpcOpenMemHandle_v2"] = 0 - {{endif}} - - {{if 'cuIpcCloseMemHandle' in found_functions}} - global __cuIpcCloseMemHandle - data["__cuIpcCloseMemHandle"] = __cuIpcCloseMemHandle - {{else}} - data["__cuIpcCloseMemHandle"] = 0 - {{endif}} - - {{if 'cuMemHostRegister_v2' in found_functions}} - global __cuMemHostRegister_v2 - data["__cuMemHostRegister_v2"] = __cuMemHostRegister_v2 - {{else}} - data["__cuMemHostRegister_v2"] = 0 - {{endif}} - - {{if 'cuMemHostUnregister' in found_functions}} - global __cuMemHostUnregister - data["__cuMemHostUnregister"] = __cuMemHostUnregister - {{else}} - data["__cuMemHostUnregister"] = 0 - {{endif}} - - {{if 'cuMemcpy' in found_functions}} - global __cuMemcpy - data["__cuMemcpy"] = __cuMemcpy - {{else}} - data["__cuMemcpy"] = 0 - {{endif}} - - {{if 'cuMemcpyPeer' in found_functions}} - global __cuMemcpyPeer - data["__cuMemcpyPeer"] = __cuMemcpyPeer - {{else}} - data["__cuMemcpyPeer"] = 0 - {{endif}} - - {{if 'cuMemcpyHtoD_v2' in found_functions}} - global __cuMemcpyHtoD_v2 - data["__cuMemcpyHtoD_v2"] = __cuMemcpyHtoD_v2 - {{else}} - data["__cuMemcpyHtoD_v2"] = 0 - {{endif}} - - {{if 'cuMemcpyDtoH_v2' in found_functions}} - global __cuMemcpyDtoH_v2 - data["__cuMemcpyDtoH_v2"] = __cuMemcpyDtoH_v2 - {{else}} - data["__cuMemcpyDtoH_v2"] = 0 - {{endif}} - - {{if 'cuMemcpyDtoD_v2' in found_functions}} - global __cuMemcpyDtoD_v2 - data["__cuMemcpyDtoD_v2"] = __cuMemcpyDtoD_v2 - {{else}} - data["__cuMemcpyDtoD_v2"] = 0 - {{endif}} - - {{if 'cuMemcpyDtoA_v2' in found_functions}} - global __cuMemcpyDtoA_v2 - data["__cuMemcpyDtoA_v2"] = __cuMemcpyDtoA_v2 - {{else}} - data["__cuMemcpyDtoA_v2"] = 0 - {{endif}} - - {{if 'cuMemcpyAtoD_v2' in found_functions}} - global __cuMemcpyAtoD_v2 - data["__cuMemcpyAtoD_v2"] = __cuMemcpyAtoD_v2 - {{else}} - data["__cuMemcpyAtoD_v2"] = 0 - {{endif}} - - {{if 'cuMemcpyHtoA_v2' in found_functions}} - global __cuMemcpyHtoA_v2 - data["__cuMemcpyHtoA_v2"] = __cuMemcpyHtoA_v2 - {{else}} - data["__cuMemcpyHtoA_v2"] = 0 - {{endif}} - - {{if 'cuMemcpyAtoH_v2' in found_functions}} - global __cuMemcpyAtoH_v2 - data["__cuMemcpyAtoH_v2"] = __cuMemcpyAtoH_v2 - {{else}} - data["__cuMemcpyAtoH_v2"] = 0 - {{endif}} - - {{if 'cuMemcpyAtoA_v2' in found_functions}} - global __cuMemcpyAtoA_v2 - data["__cuMemcpyAtoA_v2"] = __cuMemcpyAtoA_v2 - {{else}} - data["__cuMemcpyAtoA_v2"] = 0 - {{endif}} - - {{if 'cuMemcpy2D_v2' in found_functions}} - global __cuMemcpy2D_v2 - data["__cuMemcpy2D_v2"] = __cuMemcpy2D_v2 - {{else}} - data["__cuMemcpy2D_v2"] = 0 - {{endif}} - - {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} - global __cuMemcpy2DUnaligned_v2 - data["__cuMemcpy2DUnaligned_v2"] = __cuMemcpy2DUnaligned_v2 - {{else}} - data["__cuMemcpy2DUnaligned_v2"] = 0 - {{endif}} - - {{if 'cuMemcpy3D_v2' in found_functions}} - global __cuMemcpy3D_v2 - data["__cuMemcpy3D_v2"] = __cuMemcpy3D_v2 - {{else}} - data["__cuMemcpy3D_v2"] = 0 - {{endif}} - - {{if 'cuMemcpy3DPeer' in found_functions}} - global __cuMemcpy3DPeer - data["__cuMemcpy3DPeer"] = __cuMemcpy3DPeer - {{else}} - data["__cuMemcpy3DPeer"] = 0 - {{endif}} - - {{if 'cuMemcpyAsync' in found_functions}} - global __cuMemcpyAsync - data["__cuMemcpyAsync"] = __cuMemcpyAsync - {{else}} - data["__cuMemcpyAsync"] = 0 - {{endif}} - - {{if 'cuMemcpyPeerAsync' in found_functions}} - global __cuMemcpyPeerAsync - data["__cuMemcpyPeerAsync"] = __cuMemcpyPeerAsync - {{else}} - data["__cuMemcpyPeerAsync"] = 0 - {{endif}} - - {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} - global __cuMemcpyHtoDAsync_v2 - data["__cuMemcpyHtoDAsync_v2"] = __cuMemcpyHtoDAsync_v2 - {{else}} - data["__cuMemcpyHtoDAsync_v2"] = 0 - {{endif}} - - {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} - global __cuMemcpyDtoHAsync_v2 - data["__cuMemcpyDtoHAsync_v2"] = __cuMemcpyDtoHAsync_v2 - {{else}} - data["__cuMemcpyDtoHAsync_v2"] = 0 - {{endif}} - - {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} - global __cuMemcpyDtoDAsync_v2 - data["__cuMemcpyDtoDAsync_v2"] = __cuMemcpyDtoDAsync_v2 - {{else}} - data["__cuMemcpyDtoDAsync_v2"] = 0 - {{endif}} - - {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} - global __cuMemcpyHtoAAsync_v2 - data["__cuMemcpyHtoAAsync_v2"] = __cuMemcpyHtoAAsync_v2 - {{else}} - data["__cuMemcpyHtoAAsync_v2"] = 0 - {{endif}} - - {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} - global __cuMemcpyAtoHAsync_v2 - data["__cuMemcpyAtoHAsync_v2"] = __cuMemcpyAtoHAsync_v2 - {{else}} - data["__cuMemcpyAtoHAsync_v2"] = 0 - {{endif}} - - {{if 'cuMemcpy2DAsync_v2' in found_functions}} - global __cuMemcpy2DAsync_v2 - data["__cuMemcpy2DAsync_v2"] = __cuMemcpy2DAsync_v2 - {{else}} - data["__cuMemcpy2DAsync_v2"] = 0 - {{endif}} - - {{if 'cuMemcpy3DAsync_v2' in found_functions}} - global __cuMemcpy3DAsync_v2 - data["__cuMemcpy3DAsync_v2"] = __cuMemcpy3DAsync_v2 - {{else}} - data["__cuMemcpy3DAsync_v2"] = 0 - {{endif}} - - {{if 'cuMemcpy3DPeerAsync' in found_functions}} - global __cuMemcpy3DPeerAsync - data["__cuMemcpy3DPeerAsync"] = __cuMemcpy3DPeerAsync - {{else}} - data["__cuMemcpy3DPeerAsync"] = 0 - {{endif}} - - {{if 'cuMemcpyBatchAsync_v2' in found_functions}} - global __cuMemcpyBatchAsync_v2 - data["__cuMemcpyBatchAsync_v2"] = __cuMemcpyBatchAsync_v2 - {{else}} - data["__cuMemcpyBatchAsync_v2"] = 0 - {{endif}} - - {{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} - global __cuMemcpy3DBatchAsync_v2 - data["__cuMemcpy3DBatchAsync_v2"] = __cuMemcpy3DBatchAsync_v2 - {{else}} - data["__cuMemcpy3DBatchAsync_v2"] = 0 - {{endif}} - - {{if 'cuMemcpyWithAttributesAsync' in found_functions}} - global __cuMemcpyWithAttributesAsync - data["__cuMemcpyWithAttributesAsync"] = __cuMemcpyWithAttributesAsync - {{else}} - data["__cuMemcpyWithAttributesAsync"] = 0 - {{endif}} - - {{if 'cuMemcpy3DWithAttributesAsync' in found_functions}} - global __cuMemcpy3DWithAttributesAsync - data["__cuMemcpy3DWithAttributesAsync"] = __cuMemcpy3DWithAttributesAsync - {{else}} - data["__cuMemcpy3DWithAttributesAsync"] = 0 - {{endif}} - - {{if 'cuMemsetD8_v2' in found_functions}} - global __cuMemsetD8_v2 - data["__cuMemsetD8_v2"] = __cuMemsetD8_v2 - {{else}} - data["__cuMemsetD8_v2"] = 0 - {{endif}} - - {{if 'cuMemsetD16_v2' in found_functions}} - global __cuMemsetD16_v2 - data["__cuMemsetD16_v2"] = __cuMemsetD16_v2 - {{else}} - data["__cuMemsetD16_v2"] = 0 - {{endif}} - - {{if 'cuMemsetD32_v2' in found_functions}} - global __cuMemsetD32_v2 - data["__cuMemsetD32_v2"] = __cuMemsetD32_v2 - {{else}} - data["__cuMemsetD32_v2"] = 0 - {{endif}} - - {{if 'cuMemsetD2D8_v2' in found_functions}} - global __cuMemsetD2D8_v2 - data["__cuMemsetD2D8_v2"] = __cuMemsetD2D8_v2 - {{else}} - data["__cuMemsetD2D8_v2"] = 0 - {{endif}} - - {{if 'cuMemsetD2D16_v2' in found_functions}} - global __cuMemsetD2D16_v2 - data["__cuMemsetD2D16_v2"] = __cuMemsetD2D16_v2 - {{else}} - data["__cuMemsetD2D16_v2"] = 0 - {{endif}} - - {{if 'cuMemsetD2D32_v2' in found_functions}} - global __cuMemsetD2D32_v2 - data["__cuMemsetD2D32_v2"] = __cuMemsetD2D32_v2 - {{else}} - data["__cuMemsetD2D32_v2"] = 0 - {{endif}} - - {{if 'cuMemsetD8Async' in found_functions}} - global __cuMemsetD8Async - data["__cuMemsetD8Async"] = __cuMemsetD8Async - {{else}} - data["__cuMemsetD8Async"] = 0 - {{endif}} - - {{if 'cuMemsetD16Async' in found_functions}} - global __cuMemsetD16Async - data["__cuMemsetD16Async"] = __cuMemsetD16Async - {{else}} - data["__cuMemsetD16Async"] = 0 - {{endif}} - - {{if 'cuMemsetD32Async' in found_functions}} - global __cuMemsetD32Async - data["__cuMemsetD32Async"] = __cuMemsetD32Async - {{else}} - data["__cuMemsetD32Async"] = 0 - {{endif}} - - {{if 'cuMemsetD2D8Async' in found_functions}} - global __cuMemsetD2D8Async - data["__cuMemsetD2D8Async"] = __cuMemsetD2D8Async - {{else}} - data["__cuMemsetD2D8Async"] = 0 - {{endif}} - - {{if 'cuMemsetD2D16Async' in found_functions}} - global __cuMemsetD2D16Async - data["__cuMemsetD2D16Async"] = __cuMemsetD2D16Async - {{else}} - data["__cuMemsetD2D16Async"] = 0 - {{endif}} - - {{if 'cuMemsetD2D32Async' in found_functions}} - global __cuMemsetD2D32Async - data["__cuMemsetD2D32Async"] = __cuMemsetD2D32Async - {{else}} - data["__cuMemsetD2D32Async"] = 0 - {{endif}} - - {{if 'cuArrayCreate_v2' in found_functions}} - global __cuArrayCreate_v2 - data["__cuArrayCreate_v2"] = __cuArrayCreate_v2 - {{else}} - data["__cuArrayCreate_v2"] = 0 - {{endif}} - - {{if 'cuArrayGetDescriptor_v2' in found_functions}} - global __cuArrayGetDescriptor_v2 - data["__cuArrayGetDescriptor_v2"] = __cuArrayGetDescriptor_v2 - {{else}} - data["__cuArrayGetDescriptor_v2"] = 0 - {{endif}} - - {{if 'cuArrayGetSparseProperties' in found_functions}} - global __cuArrayGetSparseProperties - data["__cuArrayGetSparseProperties"] = __cuArrayGetSparseProperties - {{else}} - data["__cuArrayGetSparseProperties"] = 0 - {{endif}} - - {{if 'cuMipmappedArrayGetSparseProperties' in found_functions}} - global __cuMipmappedArrayGetSparseProperties - data["__cuMipmappedArrayGetSparseProperties"] = __cuMipmappedArrayGetSparseProperties - {{else}} - data["__cuMipmappedArrayGetSparseProperties"] = 0 - {{endif}} - - {{if 'cuArrayGetMemoryRequirements' in found_functions}} - global __cuArrayGetMemoryRequirements - data["__cuArrayGetMemoryRequirements"] = __cuArrayGetMemoryRequirements - {{else}} - data["__cuArrayGetMemoryRequirements"] = 0 - {{endif}} - - {{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}} - global __cuMipmappedArrayGetMemoryRequirements - data["__cuMipmappedArrayGetMemoryRequirements"] = __cuMipmappedArrayGetMemoryRequirements - {{else}} - data["__cuMipmappedArrayGetMemoryRequirements"] = 0 - {{endif}} - - {{if 'cuArrayGetPlane' in found_functions}} - global __cuArrayGetPlane - data["__cuArrayGetPlane"] = __cuArrayGetPlane - {{else}} - data["__cuArrayGetPlane"] = 0 - {{endif}} - - {{if 'cuArrayDestroy' in found_functions}} - global __cuArrayDestroy - data["__cuArrayDestroy"] = __cuArrayDestroy - {{else}} - data["__cuArrayDestroy"] = 0 - {{endif}} - - {{if 'cuArray3DCreate_v2' in found_functions}} - global __cuArray3DCreate_v2 - data["__cuArray3DCreate_v2"] = __cuArray3DCreate_v2 - {{else}} - data["__cuArray3DCreate_v2"] = 0 - {{endif}} - - {{if 'cuArray3DGetDescriptor_v2' in found_functions}} - global __cuArray3DGetDescriptor_v2 - data["__cuArray3DGetDescriptor_v2"] = __cuArray3DGetDescriptor_v2 - {{else}} - data["__cuArray3DGetDescriptor_v2"] = 0 - {{endif}} - - {{if 'cuMipmappedArrayCreate' in found_functions}} - global __cuMipmappedArrayCreate - data["__cuMipmappedArrayCreate"] = __cuMipmappedArrayCreate - {{else}} - data["__cuMipmappedArrayCreate"] = 0 - {{endif}} - - {{if 'cuMipmappedArrayGetLevel' in found_functions}} - global __cuMipmappedArrayGetLevel - data["__cuMipmappedArrayGetLevel"] = __cuMipmappedArrayGetLevel - {{else}} - data["__cuMipmappedArrayGetLevel"] = 0 - {{endif}} - - {{if 'cuMipmappedArrayDestroy' in found_functions}} - global __cuMipmappedArrayDestroy - data["__cuMipmappedArrayDestroy"] = __cuMipmappedArrayDestroy - {{else}} - data["__cuMipmappedArrayDestroy"] = 0 - {{endif}} - - {{if 'cuMemGetHandleForAddressRange' in found_functions}} - global __cuMemGetHandleForAddressRange - data["__cuMemGetHandleForAddressRange"] = __cuMemGetHandleForAddressRange - {{else}} - data["__cuMemGetHandleForAddressRange"] = 0 - {{endif}} - - {{if 'cuMemBatchDecompressAsync' in found_functions}} - global __cuMemBatchDecompressAsync - data["__cuMemBatchDecompressAsync"] = __cuMemBatchDecompressAsync - {{else}} - data["__cuMemBatchDecompressAsync"] = 0 - {{endif}} - - {{if 'cuMemAddressReserve' in found_functions}} - global __cuMemAddressReserve - data["__cuMemAddressReserve"] = __cuMemAddressReserve - {{else}} - data["__cuMemAddressReserve"] = 0 - {{endif}} - - {{if 'cuMemAddressFree' in found_functions}} - global __cuMemAddressFree - data["__cuMemAddressFree"] = __cuMemAddressFree - {{else}} - data["__cuMemAddressFree"] = 0 - {{endif}} - - {{if 'cuMemCreate' in found_functions}} - global __cuMemCreate - data["__cuMemCreate"] = __cuMemCreate - {{else}} - data["__cuMemCreate"] = 0 - {{endif}} - - {{if 'cuMemRelease' in found_functions}} - global __cuMemRelease - data["__cuMemRelease"] = __cuMemRelease - {{else}} - data["__cuMemRelease"] = 0 - {{endif}} - - {{if 'cuMemMap' in found_functions}} - global __cuMemMap - data["__cuMemMap"] = __cuMemMap - {{else}} - data["__cuMemMap"] = 0 - {{endif}} - - {{if 'cuMemMapArrayAsync' in found_functions}} - global __cuMemMapArrayAsync - data["__cuMemMapArrayAsync"] = __cuMemMapArrayAsync - {{else}} - data["__cuMemMapArrayAsync"] = 0 - {{endif}} - - {{if 'cuMemUnmap' in found_functions}} - global __cuMemUnmap - data["__cuMemUnmap"] = __cuMemUnmap - {{else}} - data["__cuMemUnmap"] = 0 - {{endif}} - - {{if 'cuMemSetAccess' in found_functions}} - global __cuMemSetAccess - data["__cuMemSetAccess"] = __cuMemSetAccess - {{else}} - data["__cuMemSetAccess"] = 0 - {{endif}} - - {{if 'cuMemGetAccess' in found_functions}} - global __cuMemGetAccess - data["__cuMemGetAccess"] = __cuMemGetAccess - {{else}} - data["__cuMemGetAccess"] = 0 - {{endif}} - - {{if 'cuMemExportToShareableHandle' in found_functions}} - global __cuMemExportToShareableHandle - data["__cuMemExportToShareableHandle"] = __cuMemExportToShareableHandle - {{else}} - data["__cuMemExportToShareableHandle"] = 0 - {{endif}} - - {{if 'cuMemImportFromShareableHandle' in found_functions}} - global __cuMemImportFromShareableHandle - data["__cuMemImportFromShareableHandle"] = __cuMemImportFromShareableHandle - {{else}} - data["__cuMemImportFromShareableHandle"] = 0 - {{endif}} - - {{if 'cuMemGetAllocationGranularity' in found_functions}} - global __cuMemGetAllocationGranularity - data["__cuMemGetAllocationGranularity"] = __cuMemGetAllocationGranularity - {{else}} - data["__cuMemGetAllocationGranularity"] = 0 - {{endif}} - - {{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}} - global __cuMemGetAllocationPropertiesFromHandle - data["__cuMemGetAllocationPropertiesFromHandle"] = __cuMemGetAllocationPropertiesFromHandle - {{else}} - data["__cuMemGetAllocationPropertiesFromHandle"] = 0 - {{endif}} - - {{if 'cuMemRetainAllocationHandle' in found_functions}} - global __cuMemRetainAllocationHandle - data["__cuMemRetainAllocationHandle"] = __cuMemRetainAllocationHandle - {{else}} - data["__cuMemRetainAllocationHandle"] = 0 - {{endif}} - - {{if 'cuMemFreeAsync' in found_functions}} - global __cuMemFreeAsync - data["__cuMemFreeAsync"] = __cuMemFreeAsync - {{else}} - data["__cuMemFreeAsync"] = 0 - {{endif}} - - {{if 'cuMemAllocAsync' in found_functions}} - global __cuMemAllocAsync - data["__cuMemAllocAsync"] = __cuMemAllocAsync - {{else}} - data["__cuMemAllocAsync"] = 0 - {{endif}} - - {{if 'cuMemPoolTrimTo' in found_functions}} - global __cuMemPoolTrimTo - data["__cuMemPoolTrimTo"] = __cuMemPoolTrimTo - {{else}} - data["__cuMemPoolTrimTo"] = 0 - {{endif}} - - {{if 'cuMemPoolSetAttribute' in found_functions}} - global __cuMemPoolSetAttribute - data["__cuMemPoolSetAttribute"] = __cuMemPoolSetAttribute - {{else}} - data["__cuMemPoolSetAttribute"] = 0 - {{endif}} - - {{if 'cuMemPoolGetAttribute' in found_functions}} - global __cuMemPoolGetAttribute - data["__cuMemPoolGetAttribute"] = __cuMemPoolGetAttribute - {{else}} - data["__cuMemPoolGetAttribute"] = 0 - {{endif}} - - {{if 'cuMemPoolSetAccess' in found_functions}} - global __cuMemPoolSetAccess - data["__cuMemPoolSetAccess"] = __cuMemPoolSetAccess - {{else}} - data["__cuMemPoolSetAccess"] = 0 - {{endif}} - - {{if 'cuMemPoolGetAccess' in found_functions}} - global __cuMemPoolGetAccess - data["__cuMemPoolGetAccess"] = __cuMemPoolGetAccess - {{else}} - data["__cuMemPoolGetAccess"] = 0 - {{endif}} - - {{if 'cuMemPoolCreate' in found_functions}} - global __cuMemPoolCreate - data["__cuMemPoolCreate"] = __cuMemPoolCreate - {{else}} - data["__cuMemPoolCreate"] = 0 - {{endif}} - - {{if 'cuMemPoolDestroy' in found_functions}} - global __cuMemPoolDestroy - data["__cuMemPoolDestroy"] = __cuMemPoolDestroy - {{else}} - 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 - {{else}} - data["__cuMemAllocFromPoolAsync"] = 0 - {{endif}} - - {{if 'cuMemPoolExportToShareableHandle' in found_functions}} - global __cuMemPoolExportToShareableHandle - data["__cuMemPoolExportToShareableHandle"] = __cuMemPoolExportToShareableHandle - {{else}} - data["__cuMemPoolExportToShareableHandle"] = 0 - {{endif}} - - {{if 'cuMemPoolImportFromShareableHandle' in found_functions}} - global __cuMemPoolImportFromShareableHandle - data["__cuMemPoolImportFromShareableHandle"] = __cuMemPoolImportFromShareableHandle - {{else}} - data["__cuMemPoolImportFromShareableHandle"] = 0 - {{endif}} - - {{if 'cuMemPoolExportPointer' in found_functions}} - global __cuMemPoolExportPointer - data["__cuMemPoolExportPointer"] = __cuMemPoolExportPointer - {{else}} - data["__cuMemPoolExportPointer"] = 0 - {{endif}} - - {{if 'cuMemPoolImportPointer' in found_functions}} - global __cuMemPoolImportPointer - data["__cuMemPoolImportPointer"] = __cuMemPoolImportPointer - {{else}} - data["__cuMemPoolImportPointer"] = 0 - {{endif}} - - {{if 'cuMulticastCreate' in found_functions}} - global __cuMulticastCreate - data["__cuMulticastCreate"] = __cuMulticastCreate - {{else}} - data["__cuMulticastCreate"] = 0 - {{endif}} - - {{if 'cuMulticastAddDevice' in found_functions}} - global __cuMulticastAddDevice - data["__cuMulticastAddDevice"] = __cuMulticastAddDevice - {{else}} - data["__cuMulticastAddDevice"] = 0 - {{endif}} - - {{if 'cuMulticastBindMem' in found_functions}} - global __cuMulticastBindMem - data["__cuMulticastBindMem"] = __cuMulticastBindMem - {{else}} - data["__cuMulticastBindMem"] = 0 - {{endif}} - - {{if 'cuMulticastBindMem_v2' in found_functions}} - global __cuMulticastBindMem_v2 - data["__cuMulticastBindMem_v2"] = __cuMulticastBindMem_v2 - {{else}} - data["__cuMulticastBindMem_v2"] = 0 - {{endif}} - - {{if 'cuMulticastBindAddr' in found_functions}} - global __cuMulticastBindAddr - data["__cuMulticastBindAddr"] = __cuMulticastBindAddr - {{else}} - data["__cuMulticastBindAddr"] = 0 - {{endif}} - - {{if 'cuMulticastBindAddr_v2' in found_functions}} - global __cuMulticastBindAddr_v2 - data["__cuMulticastBindAddr_v2"] = __cuMulticastBindAddr_v2 - {{else}} - data["__cuMulticastBindAddr_v2"] = 0 - {{endif}} - - {{if 'cuMulticastUnbind' in found_functions}} - global __cuMulticastUnbind - data["__cuMulticastUnbind"] = __cuMulticastUnbind - {{else}} - data["__cuMulticastUnbind"] = 0 - {{endif}} - - {{if 'cuMulticastGetGranularity' in found_functions}} - global __cuMulticastGetGranularity - data["__cuMulticastGetGranularity"] = __cuMulticastGetGranularity - {{else}} - data["__cuMulticastGetGranularity"] = 0 - {{endif}} - - {{if 'cuPointerGetAttribute' in found_functions}} - global __cuPointerGetAttribute - data["__cuPointerGetAttribute"] = __cuPointerGetAttribute - {{else}} - data["__cuPointerGetAttribute"] = 0 - {{endif}} - - {{if 'cuMemPrefetchAsync_v2' in found_functions}} - global __cuMemPrefetchAsync_v2 - data["__cuMemPrefetchAsync_v2"] = __cuMemPrefetchAsync_v2 - {{else}} - data["__cuMemPrefetchAsync_v2"] = 0 - {{endif}} - - {{if 'cuMemAdvise_v2' in found_functions}} - global __cuMemAdvise_v2 - data["__cuMemAdvise_v2"] = __cuMemAdvise_v2 - {{else}} - 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 - {{else}} - data["__cuMemRangeGetAttribute"] = 0 - {{endif}} - - {{if 'cuMemRangeGetAttributes' in found_functions}} - global __cuMemRangeGetAttributes - data["__cuMemRangeGetAttributes"] = __cuMemRangeGetAttributes - {{else}} - data["__cuMemRangeGetAttributes"] = 0 - {{endif}} - - {{if 'cuPointerSetAttribute' in found_functions}} - global __cuPointerSetAttribute - data["__cuPointerSetAttribute"] = __cuPointerSetAttribute - {{else}} - data["__cuPointerSetAttribute"] = 0 - {{endif}} - - {{if 'cuPointerGetAttributes' in found_functions}} - global __cuPointerGetAttributes - data["__cuPointerGetAttributes"] = __cuPointerGetAttributes - {{else}} - data["__cuPointerGetAttributes"] = 0 - {{endif}} - - {{if 'cuStreamCreate' in found_functions}} - global __cuStreamCreate - data["__cuStreamCreate"] = __cuStreamCreate - {{else}} - data["__cuStreamCreate"] = 0 - {{endif}} - - {{if 'cuStreamCreateWithPriority' in found_functions}} - global __cuStreamCreateWithPriority - data["__cuStreamCreateWithPriority"] = __cuStreamCreateWithPriority - {{else}} - data["__cuStreamCreateWithPriority"] = 0 - {{endif}} - - {{if 'cuStreamBeginCaptureToCig' in found_functions}} - global __cuStreamBeginCaptureToCig - data["__cuStreamBeginCaptureToCig"] = __cuStreamBeginCaptureToCig - {{else}} - data["__cuStreamBeginCaptureToCig"] = 0 - {{endif}} - - {{if 'cuStreamEndCaptureToCig' in found_functions}} - global __cuStreamEndCaptureToCig - data["__cuStreamEndCaptureToCig"] = __cuStreamEndCaptureToCig - {{else}} - data["__cuStreamEndCaptureToCig"] = 0 - {{endif}} - - {{if 'cuStreamGetPriority' in found_functions}} - global __cuStreamGetPriority - data["__cuStreamGetPriority"] = __cuStreamGetPriority - {{else}} - data["__cuStreamGetPriority"] = 0 - {{endif}} - - {{if 'cuStreamGetDevice' in found_functions}} - global __cuStreamGetDevice - data["__cuStreamGetDevice"] = __cuStreamGetDevice - {{else}} - data["__cuStreamGetDevice"] = 0 - {{endif}} - - {{if 'cuStreamGetFlags' in found_functions}} - global __cuStreamGetFlags - data["__cuStreamGetFlags"] = __cuStreamGetFlags - {{else}} - data["__cuStreamGetFlags"] = 0 - {{endif}} - - {{if 'cuStreamGetId' in found_functions}} - global __cuStreamGetId - data["__cuStreamGetId"] = __cuStreamGetId - {{else}} - data["__cuStreamGetId"] = 0 - {{endif}} - - {{if 'cuStreamGetCtx' in found_functions}} - global __cuStreamGetCtx - data["__cuStreamGetCtx"] = __cuStreamGetCtx - {{else}} - data["__cuStreamGetCtx"] = 0 - {{endif}} - - {{if 'cuStreamGetCtx_v2' in found_functions}} - global __cuStreamGetCtx_v2 - data["__cuStreamGetCtx_v2"] = __cuStreamGetCtx_v2 - {{else}} - data["__cuStreamGetCtx_v2"] = 0 - {{endif}} - - {{if 'cuStreamWaitEvent' in found_functions}} - global __cuStreamWaitEvent - data["__cuStreamWaitEvent"] = __cuStreamWaitEvent - {{else}} - data["__cuStreamWaitEvent"] = 0 - {{endif}} - - {{if 'cuStreamAddCallback' in found_functions}} - global __cuStreamAddCallback - data["__cuStreamAddCallback"] = __cuStreamAddCallback - {{else}} - data["__cuStreamAddCallback"] = 0 - {{endif}} - - {{if 'cuStreamBeginCapture_v2' in found_functions}} - global __cuStreamBeginCapture_v2 - data["__cuStreamBeginCapture_v2"] = __cuStreamBeginCapture_v2 - {{else}} - data["__cuStreamBeginCapture_v2"] = 0 - {{endif}} - - {{if 'cuStreamBeginCaptureToGraph' in found_functions}} - global __cuStreamBeginCaptureToGraph - data["__cuStreamBeginCaptureToGraph"] = __cuStreamBeginCaptureToGraph - {{else}} - data["__cuStreamBeginCaptureToGraph"] = 0 - {{endif}} - - {{if 'cuThreadExchangeStreamCaptureMode' in found_functions}} - global __cuThreadExchangeStreamCaptureMode - data["__cuThreadExchangeStreamCaptureMode"] = __cuThreadExchangeStreamCaptureMode - {{else}} - data["__cuThreadExchangeStreamCaptureMode"] = 0 - {{endif}} - - {{if 'cuStreamEndCapture' in found_functions}} - global __cuStreamEndCapture - data["__cuStreamEndCapture"] = __cuStreamEndCapture - {{else}} - data["__cuStreamEndCapture"] = 0 - {{endif}} - - {{if 'cuStreamIsCapturing' in found_functions}} - global __cuStreamIsCapturing - data["__cuStreamIsCapturing"] = __cuStreamIsCapturing - {{else}} - data["__cuStreamIsCapturing"] = 0 - {{endif}} - - {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} - global __cuStreamGetCaptureInfo_v3 - data["__cuStreamGetCaptureInfo_v3"] = __cuStreamGetCaptureInfo_v3 - {{else}} - data["__cuStreamGetCaptureInfo_v3"] = 0 - {{endif}} - - {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} - global __cuStreamUpdateCaptureDependencies_v2 - data["__cuStreamUpdateCaptureDependencies_v2"] = __cuStreamUpdateCaptureDependencies_v2 - {{else}} - data["__cuStreamUpdateCaptureDependencies_v2"] = 0 - {{endif}} - - {{if 'cuStreamAttachMemAsync' in found_functions}} - global __cuStreamAttachMemAsync - data["__cuStreamAttachMemAsync"] = __cuStreamAttachMemAsync - {{else}} - data["__cuStreamAttachMemAsync"] = 0 - {{endif}} - - {{if 'cuStreamQuery' in found_functions}} - global __cuStreamQuery - data["__cuStreamQuery"] = __cuStreamQuery - {{else}} - data["__cuStreamQuery"] = 0 - {{endif}} - - {{if 'cuStreamSynchronize' in found_functions}} - global __cuStreamSynchronize - data["__cuStreamSynchronize"] = __cuStreamSynchronize - {{else}} - data["__cuStreamSynchronize"] = 0 - {{endif}} - - {{if 'cuStreamDestroy_v2' in found_functions}} - global __cuStreamDestroy_v2 - data["__cuStreamDestroy_v2"] = __cuStreamDestroy_v2 - {{else}} - data["__cuStreamDestroy_v2"] = 0 - {{endif}} - - {{if 'cuStreamCopyAttributes' in found_functions}} - global __cuStreamCopyAttributes - data["__cuStreamCopyAttributes"] = __cuStreamCopyAttributes - {{else}} - data["__cuStreamCopyAttributes"] = 0 - {{endif}} - - {{if 'cuStreamGetAttribute' in found_functions}} - global __cuStreamGetAttribute - data["__cuStreamGetAttribute"] = __cuStreamGetAttribute - {{else}} - data["__cuStreamGetAttribute"] = 0 - {{endif}} - - {{if 'cuStreamSetAttribute' in found_functions}} - global __cuStreamSetAttribute - data["__cuStreamSetAttribute"] = __cuStreamSetAttribute - {{else}} - data["__cuStreamSetAttribute"] = 0 - {{endif}} - - {{if 'cuEventCreate' in found_functions}} - global __cuEventCreate - data["__cuEventCreate"] = __cuEventCreate - {{else}} - data["__cuEventCreate"] = 0 - {{endif}} - - {{if 'cuEventRecord' in found_functions}} - global __cuEventRecord - data["__cuEventRecord"] = __cuEventRecord - {{else}} - data["__cuEventRecord"] = 0 - {{endif}} - - {{if 'cuEventRecordWithFlags' in found_functions}} - global __cuEventRecordWithFlags - data["__cuEventRecordWithFlags"] = __cuEventRecordWithFlags - {{else}} - data["__cuEventRecordWithFlags"] = 0 - {{endif}} - - {{if 'cuEventQuery' in found_functions}} - global __cuEventQuery - data["__cuEventQuery"] = __cuEventQuery - {{else}} - data["__cuEventQuery"] = 0 - {{endif}} - - {{if 'cuEventSynchronize' in found_functions}} - global __cuEventSynchronize - data["__cuEventSynchronize"] = __cuEventSynchronize - {{else}} - data["__cuEventSynchronize"] = 0 - {{endif}} - - {{if 'cuEventDestroy_v2' in found_functions}} - global __cuEventDestroy_v2 - data["__cuEventDestroy_v2"] = __cuEventDestroy_v2 - {{else}} - data["__cuEventDestroy_v2"] = 0 - {{endif}} - - {{if 'cuEventElapsedTime_v2' in found_functions}} - global __cuEventElapsedTime_v2 - data["__cuEventElapsedTime_v2"] = __cuEventElapsedTime_v2 - {{else}} - data["__cuEventElapsedTime_v2"] = 0 - {{endif}} - - {{if 'cuImportExternalMemory' in found_functions}} - global __cuImportExternalMemory - data["__cuImportExternalMemory"] = __cuImportExternalMemory - {{else}} - data["__cuImportExternalMemory"] = 0 - {{endif}} - - {{if 'cuExternalMemoryGetMappedBuffer' in found_functions}} - global __cuExternalMemoryGetMappedBuffer - data["__cuExternalMemoryGetMappedBuffer"] = __cuExternalMemoryGetMappedBuffer - {{else}} - data["__cuExternalMemoryGetMappedBuffer"] = 0 - {{endif}} - - {{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}} - global __cuExternalMemoryGetMappedMipmappedArray - data["__cuExternalMemoryGetMappedMipmappedArray"] = __cuExternalMemoryGetMappedMipmappedArray - {{else}} - data["__cuExternalMemoryGetMappedMipmappedArray"] = 0 - {{endif}} - - {{if 'cuDestroyExternalMemory' in found_functions}} - global __cuDestroyExternalMemory - data["__cuDestroyExternalMemory"] = __cuDestroyExternalMemory - {{else}} - data["__cuDestroyExternalMemory"] = 0 - {{endif}} - - {{if 'cuImportExternalSemaphore' in found_functions}} - global __cuImportExternalSemaphore - data["__cuImportExternalSemaphore"] = __cuImportExternalSemaphore - {{else}} - data["__cuImportExternalSemaphore"] = 0 - {{endif}} - - {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} - global __cuSignalExternalSemaphoresAsync - data["__cuSignalExternalSemaphoresAsync"] = __cuSignalExternalSemaphoresAsync - {{else}} - data["__cuSignalExternalSemaphoresAsync"] = 0 - {{endif}} - - {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} - global __cuWaitExternalSemaphoresAsync - data["__cuWaitExternalSemaphoresAsync"] = __cuWaitExternalSemaphoresAsync - {{else}} - data["__cuWaitExternalSemaphoresAsync"] = 0 - {{endif}} - - {{if 'cuDestroyExternalSemaphore' in found_functions}} - global __cuDestroyExternalSemaphore - data["__cuDestroyExternalSemaphore"] = __cuDestroyExternalSemaphore - {{else}} - data["__cuDestroyExternalSemaphore"] = 0 - {{endif}} - - {{if 'cuStreamWaitValue32_v2' in found_functions}} - global __cuStreamWaitValue32_v2 - data["__cuStreamWaitValue32_v2"] = __cuStreamWaitValue32_v2 - {{else}} - data["__cuStreamWaitValue32_v2"] = 0 - {{endif}} - - {{if 'cuStreamWaitValue64_v2' in found_functions}} - global __cuStreamWaitValue64_v2 - data["__cuStreamWaitValue64_v2"] = __cuStreamWaitValue64_v2 - {{else}} - data["__cuStreamWaitValue64_v2"] = 0 - {{endif}} - - {{if 'cuStreamWriteValue32_v2' in found_functions}} - global __cuStreamWriteValue32_v2 - data["__cuStreamWriteValue32_v2"] = __cuStreamWriteValue32_v2 - {{else}} - data["__cuStreamWriteValue32_v2"] = 0 - {{endif}} - - {{if 'cuStreamWriteValue64_v2' in found_functions}} - global __cuStreamWriteValue64_v2 - data["__cuStreamWriteValue64_v2"] = __cuStreamWriteValue64_v2 - {{else}} - data["__cuStreamWriteValue64_v2"] = 0 - {{endif}} - - {{if 'cuStreamBatchMemOp_v2' in found_functions}} - global __cuStreamBatchMemOp_v2 - data["__cuStreamBatchMemOp_v2"] = __cuStreamBatchMemOp_v2 - {{else}} - data["__cuStreamBatchMemOp_v2"] = 0 - {{endif}} - - {{if 'cuFuncGetAttribute' in found_functions}} - global __cuFuncGetAttribute - data["__cuFuncGetAttribute"] = __cuFuncGetAttribute - {{else}} - data["__cuFuncGetAttribute"] = 0 - {{endif}} - - {{if 'cuFuncSetAttribute' in found_functions}} - global __cuFuncSetAttribute - data["__cuFuncSetAttribute"] = __cuFuncSetAttribute - {{else}} - data["__cuFuncSetAttribute"] = 0 - {{endif}} - - {{if 'cuFuncSetCacheConfig' in found_functions}} - global __cuFuncSetCacheConfig - data["__cuFuncSetCacheConfig"] = __cuFuncSetCacheConfig - {{else}} - data["__cuFuncSetCacheConfig"] = 0 - {{endif}} - - {{if 'cuFuncGetModule' in found_functions}} - global __cuFuncGetModule - data["__cuFuncGetModule"] = __cuFuncGetModule - {{else}} - data["__cuFuncGetModule"] = 0 - {{endif}} - - {{if 'cuFuncGetName' in found_functions}} - global __cuFuncGetName - data["__cuFuncGetName"] = __cuFuncGetName - {{else}} - data["__cuFuncGetName"] = 0 - {{endif}} - - {{if 'cuFuncGetParamInfo' in found_functions}} - global __cuFuncGetParamInfo - data["__cuFuncGetParamInfo"] = __cuFuncGetParamInfo - {{else}} - data["__cuFuncGetParamInfo"] = 0 - {{endif}} - - {{if 'cuFuncGetParamCount' in found_functions}} - global __cuFuncGetParamCount - data["__cuFuncGetParamCount"] = __cuFuncGetParamCount - {{else}} - data["__cuFuncGetParamCount"] = 0 - {{endif}} - - {{if 'cuFuncIsLoaded' in found_functions}} - global __cuFuncIsLoaded - data["__cuFuncIsLoaded"] = __cuFuncIsLoaded - {{else}} - data["__cuFuncIsLoaded"] = 0 - {{endif}} - - {{if 'cuFuncLoad' in found_functions}} - global __cuFuncLoad - data["__cuFuncLoad"] = __cuFuncLoad - {{else}} - data["__cuFuncLoad"] = 0 - {{endif}} - - {{if 'cuLaunchKernel' in found_functions}} - global __cuLaunchKernel - data["__cuLaunchKernel"] = __cuLaunchKernel - {{else}} - data["__cuLaunchKernel"] = 0 - {{endif}} - - {{if 'cuLaunchKernelEx' in found_functions}} - global __cuLaunchKernelEx - data["__cuLaunchKernelEx"] = __cuLaunchKernelEx - {{else}} - data["__cuLaunchKernelEx"] = 0 - {{endif}} - - {{if 'cuLaunchCooperativeKernel' in found_functions}} - global __cuLaunchCooperativeKernel - data["__cuLaunchCooperativeKernel"] = __cuLaunchCooperativeKernel - {{else}} - data["__cuLaunchCooperativeKernel"] = 0 - {{endif}} - - {{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}} - global __cuLaunchCooperativeKernelMultiDevice - data["__cuLaunchCooperativeKernelMultiDevice"] = __cuLaunchCooperativeKernelMultiDevice - {{else}} - data["__cuLaunchCooperativeKernelMultiDevice"] = 0 - {{endif}} - - {{if 'cuLaunchHostFunc' in found_functions}} - global __cuLaunchHostFunc - data["__cuLaunchHostFunc"] = __cuLaunchHostFunc - {{else}} - data["__cuLaunchHostFunc"] = 0 - {{endif}} - - {{if 'cuLaunchHostFunc_v2' in found_functions}} - global __cuLaunchHostFunc_v2 - data["__cuLaunchHostFunc_v2"] = __cuLaunchHostFunc_v2 - {{else}} - data["__cuLaunchHostFunc_v2"] = 0 - {{endif}} - - {{if 'cuFuncSetBlockShape' in found_functions}} - global __cuFuncSetBlockShape - data["__cuFuncSetBlockShape"] = __cuFuncSetBlockShape - {{else}} - data["__cuFuncSetBlockShape"] = 0 - {{endif}} - - {{if 'cuFuncSetSharedSize' in found_functions}} - global __cuFuncSetSharedSize - data["__cuFuncSetSharedSize"] = __cuFuncSetSharedSize - {{else}} - data["__cuFuncSetSharedSize"] = 0 - {{endif}} - - {{if 'cuParamSetSize' in found_functions}} - global __cuParamSetSize - data["__cuParamSetSize"] = __cuParamSetSize - {{else}} - data["__cuParamSetSize"] = 0 - {{endif}} - - {{if 'cuParamSeti' in found_functions}} - global __cuParamSeti - data["__cuParamSeti"] = __cuParamSeti - {{else}} - data["__cuParamSeti"] = 0 - {{endif}} - - {{if 'cuParamSetf' in found_functions}} - global __cuParamSetf - data["__cuParamSetf"] = __cuParamSetf - {{else}} - data["__cuParamSetf"] = 0 - {{endif}} - - {{if 'cuParamSetv' in found_functions}} - global __cuParamSetv - data["__cuParamSetv"] = __cuParamSetv - {{else}} - data["__cuParamSetv"] = 0 - {{endif}} - - {{if 'cuLaunch' in found_functions}} - global __cuLaunch - data["__cuLaunch"] = __cuLaunch - {{else}} - data["__cuLaunch"] = 0 - {{endif}} - - {{if 'cuLaunchGrid' in found_functions}} - global __cuLaunchGrid - data["__cuLaunchGrid"] = __cuLaunchGrid - {{else}} - data["__cuLaunchGrid"] = 0 - {{endif}} - - {{if 'cuLaunchGridAsync' in found_functions}} - global __cuLaunchGridAsync - data["__cuLaunchGridAsync"] = __cuLaunchGridAsync - {{else}} - data["__cuLaunchGridAsync"] = 0 - {{endif}} - - {{if 'cuParamSetTexRef' in found_functions}} - global __cuParamSetTexRef - data["__cuParamSetTexRef"] = __cuParamSetTexRef - {{else}} - data["__cuParamSetTexRef"] = 0 - {{endif}} - - {{if 'cuFuncSetSharedMemConfig' in found_functions}} - global __cuFuncSetSharedMemConfig - data["__cuFuncSetSharedMemConfig"] = __cuFuncSetSharedMemConfig - {{else}} - data["__cuFuncSetSharedMemConfig"] = 0 - {{endif}} - - {{if 'cuGraphCreate' in found_functions}} - global __cuGraphCreate - data["__cuGraphCreate"] = __cuGraphCreate - {{else}} - data["__cuGraphCreate"] = 0 - {{endif}} - - {{if 'cuGraphAddKernelNode_v2' in found_functions}} - global __cuGraphAddKernelNode_v2 - data["__cuGraphAddKernelNode_v2"] = __cuGraphAddKernelNode_v2 - {{else}} - data["__cuGraphAddKernelNode_v2"] = 0 - {{endif}} - - {{if 'cuGraphKernelNodeGetParams_v2' in found_functions}} - global __cuGraphKernelNodeGetParams_v2 - data["__cuGraphKernelNodeGetParams_v2"] = __cuGraphKernelNodeGetParams_v2 - {{else}} - data["__cuGraphKernelNodeGetParams_v2"] = 0 - {{endif}} - - {{if 'cuGraphKernelNodeSetParams_v2' in found_functions}} - global __cuGraphKernelNodeSetParams_v2 - data["__cuGraphKernelNodeSetParams_v2"] = __cuGraphKernelNodeSetParams_v2 - {{else}} - data["__cuGraphKernelNodeSetParams_v2"] = 0 - {{endif}} - - {{if 'cuGraphAddMemcpyNode' in found_functions}} - global __cuGraphAddMemcpyNode - data["__cuGraphAddMemcpyNode"] = __cuGraphAddMemcpyNode - {{else}} - data["__cuGraphAddMemcpyNode"] = 0 - {{endif}} - - {{if 'cuGraphMemcpyNodeGetParams' in found_functions}} - global __cuGraphMemcpyNodeGetParams - data["__cuGraphMemcpyNodeGetParams"] = __cuGraphMemcpyNodeGetParams - {{else}} - data["__cuGraphMemcpyNodeGetParams"] = 0 - {{endif}} - - {{if 'cuGraphMemcpyNodeSetParams' in found_functions}} - global __cuGraphMemcpyNodeSetParams - data["__cuGraphMemcpyNodeSetParams"] = __cuGraphMemcpyNodeSetParams - {{else}} - data["__cuGraphMemcpyNodeSetParams"] = 0 - {{endif}} - - {{if 'cuGraphAddMemsetNode' in found_functions}} - global __cuGraphAddMemsetNode - data["__cuGraphAddMemsetNode"] = __cuGraphAddMemsetNode - {{else}} - data["__cuGraphAddMemsetNode"] = 0 - {{endif}} - - {{if 'cuGraphMemsetNodeGetParams' in found_functions}} - global __cuGraphMemsetNodeGetParams - data["__cuGraphMemsetNodeGetParams"] = __cuGraphMemsetNodeGetParams - {{else}} - data["__cuGraphMemsetNodeGetParams"] = 0 - {{endif}} - - {{if 'cuGraphMemsetNodeSetParams' in found_functions}} - global __cuGraphMemsetNodeSetParams - data["__cuGraphMemsetNodeSetParams"] = __cuGraphMemsetNodeSetParams - {{else}} - data["__cuGraphMemsetNodeSetParams"] = 0 - {{endif}} - - {{if 'cuGraphAddHostNode' in found_functions}} - global __cuGraphAddHostNode - data["__cuGraphAddHostNode"] = __cuGraphAddHostNode - {{else}} - data["__cuGraphAddHostNode"] = 0 - {{endif}} - - {{if 'cuGraphHostNodeGetParams' in found_functions}} - global __cuGraphHostNodeGetParams - data["__cuGraphHostNodeGetParams"] = __cuGraphHostNodeGetParams - {{else}} - data["__cuGraphHostNodeGetParams"] = 0 - {{endif}} - - {{if 'cuGraphHostNodeSetParams' in found_functions}} - global __cuGraphHostNodeSetParams - data["__cuGraphHostNodeSetParams"] = __cuGraphHostNodeSetParams - {{else}} - data["__cuGraphHostNodeSetParams"] = 0 - {{endif}} - - {{if 'cuGraphAddChildGraphNode' in found_functions}} - global __cuGraphAddChildGraphNode - data["__cuGraphAddChildGraphNode"] = __cuGraphAddChildGraphNode - {{else}} - data["__cuGraphAddChildGraphNode"] = 0 - {{endif}} - - {{if 'cuGraphChildGraphNodeGetGraph' in found_functions}} - global __cuGraphChildGraphNodeGetGraph - data["__cuGraphChildGraphNodeGetGraph"] = __cuGraphChildGraphNodeGetGraph - {{else}} - data["__cuGraphChildGraphNodeGetGraph"] = 0 - {{endif}} - - {{if 'cuGraphAddEmptyNode' in found_functions}} - global __cuGraphAddEmptyNode - data["__cuGraphAddEmptyNode"] = __cuGraphAddEmptyNode - {{else}} - data["__cuGraphAddEmptyNode"] = 0 - {{endif}} - - {{if 'cuGraphAddEventRecordNode' in found_functions}} - global __cuGraphAddEventRecordNode - data["__cuGraphAddEventRecordNode"] = __cuGraphAddEventRecordNode - {{else}} - data["__cuGraphAddEventRecordNode"] = 0 - {{endif}} - - {{if 'cuGraphEventRecordNodeGetEvent' in found_functions}} - global __cuGraphEventRecordNodeGetEvent - data["__cuGraphEventRecordNodeGetEvent"] = __cuGraphEventRecordNodeGetEvent - {{else}} - data["__cuGraphEventRecordNodeGetEvent"] = 0 - {{endif}} - - {{if 'cuGraphEventRecordNodeSetEvent' in found_functions}} - global __cuGraphEventRecordNodeSetEvent - data["__cuGraphEventRecordNodeSetEvent"] = __cuGraphEventRecordNodeSetEvent - {{else}} - data["__cuGraphEventRecordNodeSetEvent"] = 0 - {{endif}} - - {{if 'cuGraphAddEventWaitNode' in found_functions}} - global __cuGraphAddEventWaitNode - data["__cuGraphAddEventWaitNode"] = __cuGraphAddEventWaitNode - {{else}} - data["__cuGraphAddEventWaitNode"] = 0 - {{endif}} - - {{if 'cuGraphEventWaitNodeGetEvent' in found_functions}} - global __cuGraphEventWaitNodeGetEvent - data["__cuGraphEventWaitNodeGetEvent"] = __cuGraphEventWaitNodeGetEvent - {{else}} - data["__cuGraphEventWaitNodeGetEvent"] = 0 - {{endif}} - - {{if 'cuGraphEventWaitNodeSetEvent' in found_functions}} - global __cuGraphEventWaitNodeSetEvent - data["__cuGraphEventWaitNodeSetEvent"] = __cuGraphEventWaitNodeSetEvent - {{else}} - data["__cuGraphEventWaitNodeSetEvent"] = 0 - {{endif}} - - {{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}} - global __cuGraphAddExternalSemaphoresSignalNode - data["__cuGraphAddExternalSemaphoresSignalNode"] = __cuGraphAddExternalSemaphoresSignalNode - {{else}} - data["__cuGraphAddExternalSemaphoresSignalNode"] = 0 - {{endif}} - - {{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} - global __cuGraphExternalSemaphoresSignalNodeGetParams - data["__cuGraphExternalSemaphoresSignalNodeGetParams"] = __cuGraphExternalSemaphoresSignalNodeGetParams - {{else}} - data["__cuGraphExternalSemaphoresSignalNodeGetParams"] = 0 - {{endif}} - - {{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} - global __cuGraphExternalSemaphoresSignalNodeSetParams - data["__cuGraphExternalSemaphoresSignalNodeSetParams"] = __cuGraphExternalSemaphoresSignalNodeSetParams - {{else}} - data["__cuGraphExternalSemaphoresSignalNodeSetParams"] = 0 - {{endif}} - - {{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}} - global __cuGraphAddExternalSemaphoresWaitNode - data["__cuGraphAddExternalSemaphoresWaitNode"] = __cuGraphAddExternalSemaphoresWaitNode - {{else}} - data["__cuGraphAddExternalSemaphoresWaitNode"] = 0 - {{endif}} - - {{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} - global __cuGraphExternalSemaphoresWaitNodeGetParams - data["__cuGraphExternalSemaphoresWaitNodeGetParams"] = __cuGraphExternalSemaphoresWaitNodeGetParams - {{else}} - data["__cuGraphExternalSemaphoresWaitNodeGetParams"] = 0 - {{endif}} - - {{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} - global __cuGraphExternalSemaphoresWaitNodeSetParams - data["__cuGraphExternalSemaphoresWaitNodeSetParams"] = __cuGraphExternalSemaphoresWaitNodeSetParams - {{else}} - data["__cuGraphExternalSemaphoresWaitNodeSetParams"] = 0 - {{endif}} - - {{if 'cuGraphAddBatchMemOpNode' in found_functions}} - global __cuGraphAddBatchMemOpNode - data["__cuGraphAddBatchMemOpNode"] = __cuGraphAddBatchMemOpNode - {{else}} - data["__cuGraphAddBatchMemOpNode"] = 0 - {{endif}} - - {{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}} - global __cuGraphBatchMemOpNodeGetParams - data["__cuGraphBatchMemOpNodeGetParams"] = __cuGraphBatchMemOpNodeGetParams - {{else}} - data["__cuGraphBatchMemOpNodeGetParams"] = 0 - {{endif}} - - {{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}} - global __cuGraphBatchMemOpNodeSetParams - data["__cuGraphBatchMemOpNodeSetParams"] = __cuGraphBatchMemOpNodeSetParams - {{else}} - data["__cuGraphBatchMemOpNodeSetParams"] = 0 - {{endif}} - - {{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}} - global __cuGraphExecBatchMemOpNodeSetParams - data["__cuGraphExecBatchMemOpNodeSetParams"] = __cuGraphExecBatchMemOpNodeSetParams - {{else}} - data["__cuGraphExecBatchMemOpNodeSetParams"] = 0 - {{endif}} - - {{if 'cuGraphAddMemAllocNode' in found_functions}} - global __cuGraphAddMemAllocNode - data["__cuGraphAddMemAllocNode"] = __cuGraphAddMemAllocNode - {{else}} - data["__cuGraphAddMemAllocNode"] = 0 - {{endif}} - - {{if 'cuGraphMemAllocNodeGetParams' in found_functions}} - global __cuGraphMemAllocNodeGetParams - data["__cuGraphMemAllocNodeGetParams"] = __cuGraphMemAllocNodeGetParams - {{else}} - data["__cuGraphMemAllocNodeGetParams"] = 0 - {{endif}} - - {{if 'cuGraphAddMemFreeNode' in found_functions}} - global __cuGraphAddMemFreeNode - data["__cuGraphAddMemFreeNode"] = __cuGraphAddMemFreeNode - {{else}} - data["__cuGraphAddMemFreeNode"] = 0 - {{endif}} - - {{if 'cuGraphMemFreeNodeGetParams' in found_functions}} - global __cuGraphMemFreeNodeGetParams - data["__cuGraphMemFreeNodeGetParams"] = __cuGraphMemFreeNodeGetParams - {{else}} - data["__cuGraphMemFreeNodeGetParams"] = 0 - {{endif}} - - {{if 'cuDeviceGraphMemTrim' in found_functions}} - global __cuDeviceGraphMemTrim - data["__cuDeviceGraphMemTrim"] = __cuDeviceGraphMemTrim - {{else}} - data["__cuDeviceGraphMemTrim"] = 0 - {{endif}} - - {{if 'cuDeviceGetGraphMemAttribute' in found_functions}} - global __cuDeviceGetGraphMemAttribute - data["__cuDeviceGetGraphMemAttribute"] = __cuDeviceGetGraphMemAttribute - {{else}} - data["__cuDeviceGetGraphMemAttribute"] = 0 - {{endif}} - - {{if 'cuDeviceSetGraphMemAttribute' in found_functions}} - global __cuDeviceSetGraphMemAttribute - data["__cuDeviceSetGraphMemAttribute"] = __cuDeviceSetGraphMemAttribute - {{else}} - data["__cuDeviceSetGraphMemAttribute"] = 0 - {{endif}} - - {{if 'cuGraphClone' in found_functions}} - global __cuGraphClone - data["__cuGraphClone"] = __cuGraphClone - {{else}} - data["__cuGraphClone"] = 0 - {{endif}} - - {{if 'cuGraphNodeFindInClone' in found_functions}} - global __cuGraphNodeFindInClone - data["__cuGraphNodeFindInClone"] = __cuGraphNodeFindInClone - {{else}} - data["__cuGraphNodeFindInClone"] = 0 - {{endif}} - - {{if 'cuGraphNodeGetType' in found_functions}} - global __cuGraphNodeGetType - data["__cuGraphNodeGetType"] = __cuGraphNodeGetType - {{else}} - data["__cuGraphNodeGetType"] = 0 - {{endif}} - - {{if 'cuGraphNodeGetContainingGraph' in found_functions}} - global __cuGraphNodeGetContainingGraph - data["__cuGraphNodeGetContainingGraph"] = __cuGraphNodeGetContainingGraph - {{else}} - data["__cuGraphNodeGetContainingGraph"] = 0 - {{endif}} - - {{if 'cuGraphNodeGetLocalId' in found_functions}} - global __cuGraphNodeGetLocalId - data["__cuGraphNodeGetLocalId"] = __cuGraphNodeGetLocalId - {{else}} - data["__cuGraphNodeGetLocalId"] = 0 - {{endif}} - - {{if 'cuGraphNodeGetToolsId' in found_functions}} - global __cuGraphNodeGetToolsId - data["__cuGraphNodeGetToolsId"] = __cuGraphNodeGetToolsId - {{else}} - data["__cuGraphNodeGetToolsId"] = 0 - {{endif}} - - {{if 'cuGraphGetId' in found_functions}} - global __cuGraphGetId - data["__cuGraphGetId"] = __cuGraphGetId - {{else}} - data["__cuGraphGetId"] = 0 - {{endif}} - - {{if 'cuGraphExecGetId' in found_functions}} - global __cuGraphExecGetId - data["__cuGraphExecGetId"] = __cuGraphExecGetId - {{else}} - data["__cuGraphExecGetId"] = 0 - {{endif}} - - {{if 'cuGraphGetNodes' in found_functions}} - global __cuGraphGetNodes - data["__cuGraphGetNodes"] = __cuGraphGetNodes - {{else}} - data["__cuGraphGetNodes"] = 0 - {{endif}} - - {{if 'cuGraphGetRootNodes' in found_functions}} - global __cuGraphGetRootNodes - data["__cuGraphGetRootNodes"] = __cuGraphGetRootNodes - {{else}} - data["__cuGraphGetRootNodes"] = 0 - {{endif}} - - {{if 'cuGraphGetEdges_v2' in found_functions}} - global __cuGraphGetEdges_v2 - data["__cuGraphGetEdges_v2"] = __cuGraphGetEdges_v2 - {{else}} - data["__cuGraphGetEdges_v2"] = 0 - {{endif}} - - {{if 'cuGraphNodeGetDependencies_v2' in found_functions}} - global __cuGraphNodeGetDependencies_v2 - data["__cuGraphNodeGetDependencies_v2"] = __cuGraphNodeGetDependencies_v2 - {{else}} - data["__cuGraphNodeGetDependencies_v2"] = 0 - {{endif}} - - {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} - global __cuGraphNodeGetDependentNodes_v2 - data["__cuGraphNodeGetDependentNodes_v2"] = __cuGraphNodeGetDependentNodes_v2 - {{else}} - data["__cuGraphNodeGetDependentNodes_v2"] = 0 - {{endif}} - - {{if 'cuGraphAddDependencies_v2' in found_functions}} - global __cuGraphAddDependencies_v2 - data["__cuGraphAddDependencies_v2"] = __cuGraphAddDependencies_v2 - {{else}} - data["__cuGraphAddDependencies_v2"] = 0 - {{endif}} - - {{if 'cuGraphRemoveDependencies_v2' in found_functions}} - global __cuGraphRemoveDependencies_v2 - data["__cuGraphRemoveDependencies_v2"] = __cuGraphRemoveDependencies_v2 - {{else}} - data["__cuGraphRemoveDependencies_v2"] = 0 - {{endif}} - - {{if 'cuGraphDestroyNode' in found_functions}} - global __cuGraphDestroyNode - data["__cuGraphDestroyNode"] = __cuGraphDestroyNode - {{else}} - data["__cuGraphDestroyNode"] = 0 - {{endif}} - - {{if 'cuGraphInstantiateWithFlags' in found_functions}} - global __cuGraphInstantiateWithFlags - data["__cuGraphInstantiateWithFlags"] = __cuGraphInstantiateWithFlags - {{else}} - data["__cuGraphInstantiateWithFlags"] = 0 - {{endif}} - - {{if 'cuGraphInstantiateWithParams' in found_functions}} - global __cuGraphInstantiateWithParams - data["__cuGraphInstantiateWithParams"] = __cuGraphInstantiateWithParams - {{else}} - data["__cuGraphInstantiateWithParams"] = 0 - {{endif}} - - {{if 'cuGraphExecGetFlags' in found_functions}} - global __cuGraphExecGetFlags - data["__cuGraphExecGetFlags"] = __cuGraphExecGetFlags - {{else}} - data["__cuGraphExecGetFlags"] = 0 - {{endif}} - - {{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}} - global __cuGraphExecKernelNodeSetParams_v2 - data["__cuGraphExecKernelNodeSetParams_v2"] = __cuGraphExecKernelNodeSetParams_v2 - {{else}} - data["__cuGraphExecKernelNodeSetParams_v2"] = 0 - {{endif}} - - {{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}} - global __cuGraphExecMemcpyNodeSetParams - data["__cuGraphExecMemcpyNodeSetParams"] = __cuGraphExecMemcpyNodeSetParams - {{else}} - data["__cuGraphExecMemcpyNodeSetParams"] = 0 - {{endif}} - - {{if 'cuGraphExecMemsetNodeSetParams' in found_functions}} - global __cuGraphExecMemsetNodeSetParams - data["__cuGraphExecMemsetNodeSetParams"] = __cuGraphExecMemsetNodeSetParams - {{else}} - data["__cuGraphExecMemsetNodeSetParams"] = 0 - {{endif}} - - {{if 'cuGraphExecHostNodeSetParams' in found_functions}} - global __cuGraphExecHostNodeSetParams - data["__cuGraphExecHostNodeSetParams"] = __cuGraphExecHostNodeSetParams - {{else}} - data["__cuGraphExecHostNodeSetParams"] = 0 - {{endif}} - - {{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}} - global __cuGraphExecChildGraphNodeSetParams - data["__cuGraphExecChildGraphNodeSetParams"] = __cuGraphExecChildGraphNodeSetParams - {{else}} - data["__cuGraphExecChildGraphNodeSetParams"] = 0 - {{endif}} - - {{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}} - global __cuGraphExecEventRecordNodeSetEvent - data["__cuGraphExecEventRecordNodeSetEvent"] = __cuGraphExecEventRecordNodeSetEvent - {{else}} - data["__cuGraphExecEventRecordNodeSetEvent"] = 0 - {{endif}} - - {{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}} - global __cuGraphExecEventWaitNodeSetEvent - data["__cuGraphExecEventWaitNodeSetEvent"] = __cuGraphExecEventWaitNodeSetEvent - {{else}} - data["__cuGraphExecEventWaitNodeSetEvent"] = 0 - {{endif}} - - {{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} - global __cuGraphExecExternalSemaphoresSignalNodeSetParams - data["__cuGraphExecExternalSemaphoresSignalNodeSetParams"] = __cuGraphExecExternalSemaphoresSignalNodeSetParams - {{else}} - data["__cuGraphExecExternalSemaphoresSignalNodeSetParams"] = 0 - {{endif}} - - {{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} - global __cuGraphExecExternalSemaphoresWaitNodeSetParams - data["__cuGraphExecExternalSemaphoresWaitNodeSetParams"] = __cuGraphExecExternalSemaphoresWaitNodeSetParams - {{else}} - data["__cuGraphExecExternalSemaphoresWaitNodeSetParams"] = 0 - {{endif}} - - {{if 'cuGraphNodeSetEnabled' in found_functions}} - global __cuGraphNodeSetEnabled - data["__cuGraphNodeSetEnabled"] = __cuGraphNodeSetEnabled - {{else}} - data["__cuGraphNodeSetEnabled"] = 0 - {{endif}} - - {{if 'cuGraphNodeGetEnabled' in found_functions}} - global __cuGraphNodeGetEnabled - data["__cuGraphNodeGetEnabled"] = __cuGraphNodeGetEnabled - {{else}} - data["__cuGraphNodeGetEnabled"] = 0 - {{endif}} - - {{if 'cuGraphUpload' in found_functions}} - global __cuGraphUpload - data["__cuGraphUpload"] = __cuGraphUpload - {{else}} - data["__cuGraphUpload"] = 0 - {{endif}} - - {{if 'cuGraphLaunch' in found_functions}} - global __cuGraphLaunch - data["__cuGraphLaunch"] = __cuGraphLaunch - {{else}} - data["__cuGraphLaunch"] = 0 - {{endif}} - - {{if 'cuGraphExecDestroy' in found_functions}} - global __cuGraphExecDestroy - data["__cuGraphExecDestroy"] = __cuGraphExecDestroy - {{else}} - data["__cuGraphExecDestroy"] = 0 - {{endif}} - - {{if 'cuGraphDestroy' in found_functions}} - global __cuGraphDestroy - data["__cuGraphDestroy"] = __cuGraphDestroy - {{else}} - data["__cuGraphDestroy"] = 0 - {{endif}} - - {{if 'cuGraphExecUpdate_v2' in found_functions}} - global __cuGraphExecUpdate_v2 - data["__cuGraphExecUpdate_v2"] = __cuGraphExecUpdate_v2 - {{else}} - data["__cuGraphExecUpdate_v2"] = 0 - {{endif}} - - {{if 'cuGraphKernelNodeCopyAttributes' in found_functions}} - global __cuGraphKernelNodeCopyAttributes - data["__cuGraphKernelNodeCopyAttributes"] = __cuGraphKernelNodeCopyAttributes - {{else}} - data["__cuGraphKernelNodeCopyAttributes"] = 0 - {{endif}} - - {{if 'cuGraphKernelNodeGetAttribute' in found_functions}} - global __cuGraphKernelNodeGetAttribute - data["__cuGraphKernelNodeGetAttribute"] = __cuGraphKernelNodeGetAttribute - {{else}} - data["__cuGraphKernelNodeGetAttribute"] = 0 - {{endif}} - - {{if 'cuGraphKernelNodeSetAttribute' in found_functions}} - global __cuGraphKernelNodeSetAttribute - data["__cuGraphKernelNodeSetAttribute"] = __cuGraphKernelNodeSetAttribute - {{else}} - data["__cuGraphKernelNodeSetAttribute"] = 0 - {{endif}} - - {{if 'cuGraphDebugDotPrint' in found_functions}} - global __cuGraphDebugDotPrint - data["__cuGraphDebugDotPrint"] = __cuGraphDebugDotPrint - {{else}} - data["__cuGraphDebugDotPrint"] = 0 - {{endif}} - - {{if 'cuUserObjectCreate' in found_functions}} - global __cuUserObjectCreate - data["__cuUserObjectCreate"] = __cuUserObjectCreate - {{else}} - data["__cuUserObjectCreate"] = 0 - {{endif}} - - {{if 'cuUserObjectRetain' in found_functions}} - global __cuUserObjectRetain - data["__cuUserObjectRetain"] = __cuUserObjectRetain - {{else}} - data["__cuUserObjectRetain"] = 0 - {{endif}} - - {{if 'cuUserObjectRelease' in found_functions}} - global __cuUserObjectRelease - data["__cuUserObjectRelease"] = __cuUserObjectRelease - {{else}} - data["__cuUserObjectRelease"] = 0 - {{endif}} - - {{if 'cuGraphRetainUserObject' in found_functions}} - global __cuGraphRetainUserObject - data["__cuGraphRetainUserObject"] = __cuGraphRetainUserObject - {{else}} - data["__cuGraphRetainUserObject"] = 0 - {{endif}} - - {{if 'cuGraphReleaseUserObject' in found_functions}} - global __cuGraphReleaseUserObject - data["__cuGraphReleaseUserObject"] = __cuGraphReleaseUserObject - {{else}} - data["__cuGraphReleaseUserObject"] = 0 - {{endif}} - - {{if 'cuGraphAddNode_v2' in found_functions}} - global __cuGraphAddNode_v2 - data["__cuGraphAddNode_v2"] = __cuGraphAddNode_v2 - {{else}} - data["__cuGraphAddNode_v2"] = 0 - {{endif}} - - {{if 'cuGraphNodeSetParams' in found_functions}} - global __cuGraphNodeSetParams - data["__cuGraphNodeSetParams"] = __cuGraphNodeSetParams - {{else}} - data["__cuGraphNodeSetParams"] = 0 - {{endif}} - - {{if 'cuGraphNodeGetParams' in found_functions}} - global __cuGraphNodeGetParams - data["__cuGraphNodeGetParams"] = __cuGraphNodeGetParams - {{else}} - data["__cuGraphNodeGetParams"] = 0 - {{endif}} - - {{if 'cuGraphExecNodeSetParams' in found_functions}} - global __cuGraphExecNodeSetParams - data["__cuGraphExecNodeSetParams"] = __cuGraphExecNodeSetParams - {{else}} - data["__cuGraphExecNodeSetParams"] = 0 - {{endif}} - - {{if 'cuGraphConditionalHandleCreate' in found_functions}} - global __cuGraphConditionalHandleCreate - data["__cuGraphConditionalHandleCreate"] = __cuGraphConditionalHandleCreate - {{else}} - data["__cuGraphConditionalHandleCreate"] = 0 - {{endif}} - - {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} - global __cuOccupancyMaxActiveBlocksPerMultiprocessor - data["__cuOccupancyMaxActiveBlocksPerMultiprocessor"] = __cuOccupancyMaxActiveBlocksPerMultiprocessor - {{else}} - data["__cuOccupancyMaxActiveBlocksPerMultiprocessor"] = 0 - {{endif}} - - {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} - global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags - data["__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags"] = __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags - {{else}} - data["__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags"] = 0 - {{endif}} - - {{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}} - global __cuOccupancyMaxPotentialBlockSize - data["__cuOccupancyMaxPotentialBlockSize"] = __cuOccupancyMaxPotentialBlockSize - {{else}} - data["__cuOccupancyMaxPotentialBlockSize"] = 0 - {{endif}} - - {{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}} - global __cuOccupancyMaxPotentialBlockSizeWithFlags - data["__cuOccupancyMaxPotentialBlockSizeWithFlags"] = __cuOccupancyMaxPotentialBlockSizeWithFlags - {{else}} - data["__cuOccupancyMaxPotentialBlockSizeWithFlags"] = 0 - {{endif}} - - {{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}} - global __cuOccupancyAvailableDynamicSMemPerBlock - data["__cuOccupancyAvailableDynamicSMemPerBlock"] = __cuOccupancyAvailableDynamicSMemPerBlock - {{else}} - data["__cuOccupancyAvailableDynamicSMemPerBlock"] = 0 - {{endif}} - - {{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}} - global __cuOccupancyMaxPotentialClusterSize - data["__cuOccupancyMaxPotentialClusterSize"] = __cuOccupancyMaxPotentialClusterSize - {{else}} - data["__cuOccupancyMaxPotentialClusterSize"] = 0 - {{endif}} - - {{if 'cuOccupancyMaxActiveClusters' in found_functions}} - global __cuOccupancyMaxActiveClusters - data["__cuOccupancyMaxActiveClusters"] = __cuOccupancyMaxActiveClusters - {{else}} - data["__cuOccupancyMaxActiveClusters"] = 0 - {{endif}} - - {{if 'cuTexRefSetArray' in found_functions}} - global __cuTexRefSetArray - data["__cuTexRefSetArray"] = __cuTexRefSetArray - {{else}} - data["__cuTexRefSetArray"] = 0 - {{endif}} - - {{if 'cuTexRefSetMipmappedArray' in found_functions}} - global __cuTexRefSetMipmappedArray - data["__cuTexRefSetMipmappedArray"] = __cuTexRefSetMipmappedArray - {{else}} - data["__cuTexRefSetMipmappedArray"] = 0 - {{endif}} - - {{if 'cuTexRefSetAddress_v2' in found_functions}} - global __cuTexRefSetAddress_v2 - data["__cuTexRefSetAddress_v2"] = __cuTexRefSetAddress_v2 - {{else}} - data["__cuTexRefSetAddress_v2"] = 0 - {{endif}} - - {{if 'cuTexRefSetAddress2D_v3' in found_functions}} - global __cuTexRefSetAddress2D_v3 - data["__cuTexRefSetAddress2D_v3"] = __cuTexRefSetAddress2D_v3 - {{else}} - data["__cuTexRefSetAddress2D_v3"] = 0 - {{endif}} - - {{if 'cuTexRefSetFormat' in found_functions}} - global __cuTexRefSetFormat - data["__cuTexRefSetFormat"] = __cuTexRefSetFormat - {{else}} - data["__cuTexRefSetFormat"] = 0 - {{endif}} - - {{if 'cuTexRefSetAddressMode' in found_functions}} - global __cuTexRefSetAddressMode - data["__cuTexRefSetAddressMode"] = __cuTexRefSetAddressMode - {{else}} - data["__cuTexRefSetAddressMode"] = 0 - {{endif}} - - {{if 'cuTexRefSetFilterMode' in found_functions}} - global __cuTexRefSetFilterMode - data["__cuTexRefSetFilterMode"] = __cuTexRefSetFilterMode - {{else}} - data["__cuTexRefSetFilterMode"] = 0 - {{endif}} - - {{if 'cuTexRefSetMipmapFilterMode' in found_functions}} - global __cuTexRefSetMipmapFilterMode - data["__cuTexRefSetMipmapFilterMode"] = __cuTexRefSetMipmapFilterMode - {{else}} - data["__cuTexRefSetMipmapFilterMode"] = 0 - {{endif}} - - {{if 'cuTexRefSetMipmapLevelBias' in found_functions}} - global __cuTexRefSetMipmapLevelBias - data["__cuTexRefSetMipmapLevelBias"] = __cuTexRefSetMipmapLevelBias - {{else}} - data["__cuTexRefSetMipmapLevelBias"] = 0 - {{endif}} - - {{if 'cuTexRefSetMipmapLevelClamp' in found_functions}} - global __cuTexRefSetMipmapLevelClamp - data["__cuTexRefSetMipmapLevelClamp"] = __cuTexRefSetMipmapLevelClamp - {{else}} - data["__cuTexRefSetMipmapLevelClamp"] = 0 - {{endif}} - - {{if 'cuTexRefSetMaxAnisotropy' in found_functions}} - global __cuTexRefSetMaxAnisotropy - data["__cuTexRefSetMaxAnisotropy"] = __cuTexRefSetMaxAnisotropy - {{else}} - data["__cuTexRefSetMaxAnisotropy"] = 0 - {{endif}} - - {{if 'cuTexRefSetBorderColor' in found_functions}} - global __cuTexRefSetBorderColor - data["__cuTexRefSetBorderColor"] = __cuTexRefSetBorderColor - {{else}} - data["__cuTexRefSetBorderColor"] = 0 - {{endif}} - - {{if 'cuTexRefSetFlags' in found_functions}} - global __cuTexRefSetFlags - data["__cuTexRefSetFlags"] = __cuTexRefSetFlags - {{else}} - data["__cuTexRefSetFlags"] = 0 - {{endif}} - - {{if 'cuTexRefGetAddress_v2' in found_functions}} - global __cuTexRefGetAddress_v2 - data["__cuTexRefGetAddress_v2"] = __cuTexRefGetAddress_v2 - {{else}} - data["__cuTexRefGetAddress_v2"] = 0 - {{endif}} - - {{if 'cuTexRefGetArray' in found_functions}} - global __cuTexRefGetArray - data["__cuTexRefGetArray"] = __cuTexRefGetArray - {{else}} - data["__cuTexRefGetArray"] = 0 - {{endif}} - - {{if 'cuTexRefGetMipmappedArray' in found_functions}} - global __cuTexRefGetMipmappedArray - data["__cuTexRefGetMipmappedArray"] = __cuTexRefGetMipmappedArray - {{else}} - data["__cuTexRefGetMipmappedArray"] = 0 - {{endif}} - - {{if 'cuTexRefGetAddressMode' in found_functions}} - global __cuTexRefGetAddressMode - data["__cuTexRefGetAddressMode"] = __cuTexRefGetAddressMode - {{else}} - data["__cuTexRefGetAddressMode"] = 0 - {{endif}} - - {{if 'cuTexRefGetFilterMode' in found_functions}} - global __cuTexRefGetFilterMode - data["__cuTexRefGetFilterMode"] = __cuTexRefGetFilterMode - {{else}} - data["__cuTexRefGetFilterMode"] = 0 - {{endif}} - - {{if 'cuTexRefGetFormat' in found_functions}} - global __cuTexRefGetFormat - data["__cuTexRefGetFormat"] = __cuTexRefGetFormat - {{else}} - data["__cuTexRefGetFormat"] = 0 - {{endif}} - - {{if 'cuTexRefGetMipmapFilterMode' in found_functions}} - global __cuTexRefGetMipmapFilterMode - data["__cuTexRefGetMipmapFilterMode"] = __cuTexRefGetMipmapFilterMode - {{else}} - data["__cuTexRefGetMipmapFilterMode"] = 0 - {{endif}} - - {{if 'cuTexRefGetMipmapLevelBias' in found_functions}} - global __cuTexRefGetMipmapLevelBias - data["__cuTexRefGetMipmapLevelBias"] = __cuTexRefGetMipmapLevelBias - {{else}} - data["__cuTexRefGetMipmapLevelBias"] = 0 - {{endif}} - - {{if 'cuTexRefGetMipmapLevelClamp' in found_functions}} - global __cuTexRefGetMipmapLevelClamp - data["__cuTexRefGetMipmapLevelClamp"] = __cuTexRefGetMipmapLevelClamp - {{else}} - data["__cuTexRefGetMipmapLevelClamp"] = 0 - {{endif}} - - {{if 'cuTexRefGetMaxAnisotropy' in found_functions}} - global __cuTexRefGetMaxAnisotropy - data["__cuTexRefGetMaxAnisotropy"] = __cuTexRefGetMaxAnisotropy - {{else}} - data["__cuTexRefGetMaxAnisotropy"] = 0 - {{endif}} - - {{if 'cuTexRefGetBorderColor' in found_functions}} - global __cuTexRefGetBorderColor - data["__cuTexRefGetBorderColor"] = __cuTexRefGetBorderColor - {{else}} - data["__cuTexRefGetBorderColor"] = 0 - {{endif}} - - {{if 'cuTexRefGetFlags' in found_functions}} - global __cuTexRefGetFlags - data["__cuTexRefGetFlags"] = __cuTexRefGetFlags - {{else}} - data["__cuTexRefGetFlags"] = 0 - {{endif}} - - {{if 'cuTexRefCreate' in found_functions}} - global __cuTexRefCreate - data["__cuTexRefCreate"] = __cuTexRefCreate - {{else}} - data["__cuTexRefCreate"] = 0 - {{endif}} - - {{if 'cuTexRefDestroy' in found_functions}} - global __cuTexRefDestroy - data["__cuTexRefDestroy"] = __cuTexRefDestroy - {{else}} - data["__cuTexRefDestroy"] = 0 - {{endif}} - - {{if 'cuSurfRefSetArray' in found_functions}} - global __cuSurfRefSetArray - data["__cuSurfRefSetArray"] = __cuSurfRefSetArray - {{else}} - data["__cuSurfRefSetArray"] = 0 - {{endif}} - - {{if 'cuSurfRefGetArray' in found_functions}} - global __cuSurfRefGetArray - data["__cuSurfRefGetArray"] = __cuSurfRefGetArray - {{else}} - data["__cuSurfRefGetArray"] = 0 - {{endif}} - - {{if 'cuTexObjectCreate' in found_functions}} - global __cuTexObjectCreate - data["__cuTexObjectCreate"] = __cuTexObjectCreate - {{else}} - data["__cuTexObjectCreate"] = 0 - {{endif}} - - {{if 'cuTexObjectDestroy' in found_functions}} - global __cuTexObjectDestroy - data["__cuTexObjectDestroy"] = __cuTexObjectDestroy - {{else}} - data["__cuTexObjectDestroy"] = 0 - {{endif}} - - {{if 'cuTexObjectGetResourceDesc' in found_functions}} - global __cuTexObjectGetResourceDesc - data["__cuTexObjectGetResourceDesc"] = __cuTexObjectGetResourceDesc - {{else}} - data["__cuTexObjectGetResourceDesc"] = 0 - {{endif}} - - {{if 'cuTexObjectGetTextureDesc' in found_functions}} - global __cuTexObjectGetTextureDesc - data["__cuTexObjectGetTextureDesc"] = __cuTexObjectGetTextureDesc - {{else}} - data["__cuTexObjectGetTextureDesc"] = 0 - {{endif}} - - {{if 'cuTexObjectGetResourceViewDesc' in found_functions}} - global __cuTexObjectGetResourceViewDesc - data["__cuTexObjectGetResourceViewDesc"] = __cuTexObjectGetResourceViewDesc - {{else}} - data["__cuTexObjectGetResourceViewDesc"] = 0 - {{endif}} - - {{if 'cuSurfObjectCreate' in found_functions}} - global __cuSurfObjectCreate - data["__cuSurfObjectCreate"] = __cuSurfObjectCreate - {{else}} - data["__cuSurfObjectCreate"] = 0 - {{endif}} - - {{if 'cuSurfObjectDestroy' in found_functions}} - global __cuSurfObjectDestroy - data["__cuSurfObjectDestroy"] = __cuSurfObjectDestroy - {{else}} - data["__cuSurfObjectDestroy"] = 0 - {{endif}} - - {{if 'cuSurfObjectGetResourceDesc' in found_functions}} - global __cuSurfObjectGetResourceDesc - data["__cuSurfObjectGetResourceDesc"] = __cuSurfObjectGetResourceDesc - {{else}} - data["__cuSurfObjectGetResourceDesc"] = 0 - {{endif}} - - {{if 'cuTensorMapEncodeTiled' in found_functions}} - global __cuTensorMapEncodeTiled - data["__cuTensorMapEncodeTiled"] = __cuTensorMapEncodeTiled - {{else}} - data["__cuTensorMapEncodeTiled"] = 0 - {{endif}} - - {{if 'cuTensorMapEncodeIm2col' in found_functions}} - global __cuTensorMapEncodeIm2col - data["__cuTensorMapEncodeIm2col"] = __cuTensorMapEncodeIm2col - {{else}} - data["__cuTensorMapEncodeIm2col"] = 0 - {{endif}} - - {{if 'cuTensorMapEncodeIm2colWide' in found_functions}} - global __cuTensorMapEncodeIm2colWide - data["__cuTensorMapEncodeIm2colWide"] = __cuTensorMapEncodeIm2colWide - {{else}} - data["__cuTensorMapEncodeIm2colWide"] = 0 - {{endif}} - - {{if 'cuTensorMapReplaceAddress' in found_functions}} - global __cuTensorMapReplaceAddress - data["__cuTensorMapReplaceAddress"] = __cuTensorMapReplaceAddress - {{else}} - data["__cuTensorMapReplaceAddress"] = 0 - {{endif}} - - {{if 'cuDeviceCanAccessPeer' in found_functions}} - global __cuDeviceCanAccessPeer - data["__cuDeviceCanAccessPeer"] = __cuDeviceCanAccessPeer - {{else}} - data["__cuDeviceCanAccessPeer"] = 0 - {{endif}} - - {{if 'cuCtxEnablePeerAccess' in found_functions}} - global __cuCtxEnablePeerAccess - data["__cuCtxEnablePeerAccess"] = __cuCtxEnablePeerAccess - {{else}} - data["__cuCtxEnablePeerAccess"] = 0 - {{endif}} - - {{if 'cuCtxDisablePeerAccess' in found_functions}} - global __cuCtxDisablePeerAccess - data["__cuCtxDisablePeerAccess"] = __cuCtxDisablePeerAccess - {{else}} - data["__cuCtxDisablePeerAccess"] = 0 - {{endif}} - - {{if 'cuDeviceGetP2PAttribute' in found_functions}} - global __cuDeviceGetP2PAttribute - data["__cuDeviceGetP2PAttribute"] = __cuDeviceGetP2PAttribute - {{else}} - 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 - {{else}} - data["__cuGraphicsUnregisterResource"] = 0 - {{endif}} - - {{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}} - global __cuGraphicsSubResourceGetMappedArray - data["__cuGraphicsSubResourceGetMappedArray"] = __cuGraphicsSubResourceGetMappedArray - {{else}} - data["__cuGraphicsSubResourceGetMappedArray"] = 0 - {{endif}} - - {{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}} - global __cuGraphicsResourceGetMappedMipmappedArray - data["__cuGraphicsResourceGetMappedMipmappedArray"] = __cuGraphicsResourceGetMappedMipmappedArray - {{else}} - data["__cuGraphicsResourceGetMappedMipmappedArray"] = 0 - {{endif}} - - {{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}} - global __cuGraphicsResourceGetMappedPointer_v2 - data["__cuGraphicsResourceGetMappedPointer_v2"] = __cuGraphicsResourceGetMappedPointer_v2 - {{else}} - data["__cuGraphicsResourceGetMappedPointer_v2"] = 0 - {{endif}} - - {{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}} - global __cuGraphicsResourceSetMapFlags_v2 - data["__cuGraphicsResourceSetMapFlags_v2"] = __cuGraphicsResourceSetMapFlags_v2 - {{else}} - data["__cuGraphicsResourceSetMapFlags_v2"] = 0 - {{endif}} - - {{if 'cuGraphicsMapResources' in found_functions}} - global __cuGraphicsMapResources - data["__cuGraphicsMapResources"] = __cuGraphicsMapResources - {{else}} - data["__cuGraphicsMapResources"] = 0 - {{endif}} - - {{if 'cuGraphicsUnmapResources' in found_functions}} - global __cuGraphicsUnmapResources - data["__cuGraphicsUnmapResources"] = __cuGraphicsUnmapResources - {{else}} - data["__cuGraphicsUnmapResources"] = 0 - {{endif}} - - {{if 'cuGetProcAddress_v2' in found_functions}} - global __cuGetProcAddress_v2 - data["__cuGetProcAddress_v2"] = __cuGetProcAddress_v2 - {{else}} - data["__cuGetProcAddress_v2"] = 0 - {{endif}} - - {{if 'cuCoredumpGetAttribute' in found_functions}} - global __cuCoredumpGetAttribute - data["__cuCoredumpGetAttribute"] = __cuCoredumpGetAttribute - {{else}} - data["__cuCoredumpGetAttribute"] = 0 - {{endif}} - - {{if 'cuCoredumpGetAttributeGlobal' in found_functions}} - global __cuCoredumpGetAttributeGlobal - data["__cuCoredumpGetAttributeGlobal"] = __cuCoredumpGetAttributeGlobal - {{else}} - data["__cuCoredumpGetAttributeGlobal"] = 0 - {{endif}} - - {{if 'cuCoredumpSetAttribute' in found_functions}} - global __cuCoredumpSetAttribute - data["__cuCoredumpSetAttribute"] = __cuCoredumpSetAttribute - {{else}} - data["__cuCoredumpSetAttribute"] = 0 - {{endif}} - - {{if 'cuCoredumpSetAttributeGlobal' in found_functions}} - global __cuCoredumpSetAttributeGlobal - data["__cuCoredumpSetAttributeGlobal"] = __cuCoredumpSetAttributeGlobal - {{else}} - data["__cuCoredumpSetAttributeGlobal"] = 0 - {{endif}} - - {{if 'cuCoredumpRegisterStartCallback' in found_functions}} - global __cuCoredumpRegisterStartCallback - data["__cuCoredumpRegisterStartCallback"] = __cuCoredumpRegisterStartCallback - {{else}} - data["__cuCoredumpRegisterStartCallback"] = 0 - {{endif}} - - {{if 'cuCoredumpRegisterCompleteCallback' in found_functions}} - global __cuCoredumpRegisterCompleteCallback - data["__cuCoredumpRegisterCompleteCallback"] = __cuCoredumpRegisterCompleteCallback - {{else}} - data["__cuCoredumpRegisterCompleteCallback"] = 0 - {{endif}} - - {{if 'cuCoredumpDeregisterStartCallback' in found_functions}} - global __cuCoredumpDeregisterStartCallback - data["__cuCoredumpDeregisterStartCallback"] = __cuCoredumpDeregisterStartCallback - {{else}} - data["__cuCoredumpDeregisterStartCallback"] = 0 - {{endif}} - - {{if 'cuCoredumpDeregisterCompleteCallback' in found_functions}} - global __cuCoredumpDeregisterCompleteCallback - data["__cuCoredumpDeregisterCompleteCallback"] = __cuCoredumpDeregisterCompleteCallback - {{else}} - data["__cuCoredumpDeregisterCompleteCallback"] = 0 - {{endif}} - - {{if 'cuGetExportTable' in found_functions}} - global __cuGetExportTable - data["__cuGetExportTable"] = __cuGetExportTable - {{else}} - data["__cuGetExportTable"] = 0 - {{endif}} - - {{if 'cuGreenCtxCreate' in found_functions}} - global __cuGreenCtxCreate - data["__cuGreenCtxCreate"] = __cuGreenCtxCreate - {{else}} - data["__cuGreenCtxCreate"] = 0 - {{endif}} - - {{if 'cuGreenCtxDestroy' in found_functions}} - global __cuGreenCtxDestroy - data["__cuGreenCtxDestroy"] = __cuGreenCtxDestroy - {{else}} - data["__cuGreenCtxDestroy"] = 0 - {{endif}} - - {{if 'cuCtxFromGreenCtx' in found_functions}} - global __cuCtxFromGreenCtx - data["__cuCtxFromGreenCtx"] = __cuCtxFromGreenCtx - {{else}} - data["__cuCtxFromGreenCtx"] = 0 - {{endif}} - - {{if 'cuDeviceGetDevResource' in found_functions}} - global __cuDeviceGetDevResource - data["__cuDeviceGetDevResource"] = __cuDeviceGetDevResource - {{else}} - data["__cuDeviceGetDevResource"] = 0 - {{endif}} - - {{if 'cuCtxGetDevResource' in found_functions}} - global __cuCtxGetDevResource - data["__cuCtxGetDevResource"] = __cuCtxGetDevResource - {{else}} - data["__cuCtxGetDevResource"] = 0 - {{endif}} - - {{if 'cuGreenCtxGetDevResource' in found_functions}} - global __cuGreenCtxGetDevResource - data["__cuGreenCtxGetDevResource"] = __cuGreenCtxGetDevResource - {{else}} - data["__cuGreenCtxGetDevResource"] = 0 - {{endif}} - - {{if 'cuDevSmResourceSplitByCount' in found_functions}} - global __cuDevSmResourceSplitByCount - data["__cuDevSmResourceSplitByCount"] = __cuDevSmResourceSplitByCount - {{else}} - data["__cuDevSmResourceSplitByCount"] = 0 - {{endif}} - - {{if 'cuDevSmResourceSplit' in found_functions}} - global __cuDevSmResourceSplit - data["__cuDevSmResourceSplit"] = __cuDevSmResourceSplit - {{else}} - data["__cuDevSmResourceSplit"] = 0 - {{endif}} - - {{if 'cuDevResourceGenerateDesc' in found_functions}} - global __cuDevResourceGenerateDesc - data["__cuDevResourceGenerateDesc"] = __cuDevResourceGenerateDesc - {{else}} - data["__cuDevResourceGenerateDesc"] = 0 - {{endif}} - - {{if 'cuGreenCtxRecordEvent' in found_functions}} - global __cuGreenCtxRecordEvent - data["__cuGreenCtxRecordEvent"] = __cuGreenCtxRecordEvent - {{else}} - data["__cuGreenCtxRecordEvent"] = 0 - {{endif}} - - {{if 'cuGreenCtxWaitEvent' in found_functions}} - global __cuGreenCtxWaitEvent - data["__cuGreenCtxWaitEvent"] = __cuGreenCtxWaitEvent - {{else}} - data["__cuGreenCtxWaitEvent"] = 0 - {{endif}} - - {{if 'cuStreamGetGreenCtx' in found_functions}} - global __cuStreamGetGreenCtx - data["__cuStreamGetGreenCtx"] = __cuStreamGetGreenCtx - {{else}} - data["__cuStreamGetGreenCtx"] = 0 - {{endif}} - - {{if 'cuGreenCtxStreamCreate' in found_functions}} - global __cuGreenCtxStreamCreate - data["__cuGreenCtxStreamCreate"] = __cuGreenCtxStreamCreate - {{else}} - data["__cuGreenCtxStreamCreate"] = 0 - {{endif}} - - {{if 'cuGreenCtxGetId' in found_functions}} - global __cuGreenCtxGetId - data["__cuGreenCtxGetId"] = __cuGreenCtxGetId - {{else}} - data["__cuGreenCtxGetId"] = 0 - {{endif}} - - {{if 'cuStreamGetDevResource' in found_functions}} - global __cuStreamGetDevResource - data["__cuStreamGetDevResource"] = __cuStreamGetDevResource - {{else}} - data["__cuStreamGetDevResource"] = 0 - {{endif}} - - {{if 'cuLogsRegisterCallback' in found_functions}} - global __cuLogsRegisterCallback - data["__cuLogsRegisterCallback"] = __cuLogsRegisterCallback - {{else}} - data["__cuLogsRegisterCallback"] = 0 - {{endif}} - - {{if 'cuLogsUnregisterCallback' in found_functions}} - global __cuLogsUnregisterCallback - data["__cuLogsUnregisterCallback"] = __cuLogsUnregisterCallback - {{else}} - data["__cuLogsUnregisterCallback"] = 0 - {{endif}} - - {{if 'cuLogsCurrent' in found_functions}} - global __cuLogsCurrent - data["__cuLogsCurrent"] = __cuLogsCurrent - {{else}} - data["__cuLogsCurrent"] = 0 - {{endif}} - - {{if 'cuLogsDumpToFile' in found_functions}} - global __cuLogsDumpToFile - data["__cuLogsDumpToFile"] = __cuLogsDumpToFile - {{else}} - data["__cuLogsDumpToFile"] = 0 - {{endif}} - - {{if 'cuLogsDumpToMemory' in found_functions}} - global __cuLogsDumpToMemory - data["__cuLogsDumpToMemory"] = __cuLogsDumpToMemory - {{else}} - data["__cuLogsDumpToMemory"] = 0 - {{endif}} - - {{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}} - global __cuCheckpointProcessGetRestoreThreadId - data["__cuCheckpointProcessGetRestoreThreadId"] = __cuCheckpointProcessGetRestoreThreadId - {{else}} - data["__cuCheckpointProcessGetRestoreThreadId"] = 0 - {{endif}} - - {{if 'cuCheckpointProcessGetState' in found_functions}} - global __cuCheckpointProcessGetState - data["__cuCheckpointProcessGetState"] = __cuCheckpointProcessGetState - {{else}} - data["__cuCheckpointProcessGetState"] = 0 - {{endif}} - - {{if 'cuCheckpointProcessLock' in found_functions}} - global __cuCheckpointProcessLock - data["__cuCheckpointProcessLock"] = __cuCheckpointProcessLock - {{else}} - data["__cuCheckpointProcessLock"] = 0 - {{endif}} - - {{if 'cuCheckpointProcessCheckpoint' in found_functions}} - global __cuCheckpointProcessCheckpoint - data["__cuCheckpointProcessCheckpoint"] = __cuCheckpointProcessCheckpoint - {{else}} - 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 - {{else}} - data["__cuCheckpointProcessUnlock"] = 0 - {{endif}} - - {{if 'cuProfilerStart' in found_functions}} - global __cuProfilerStart - data["__cuProfilerStart"] = __cuProfilerStart - {{else}} - data["__cuProfilerStart"] = 0 - {{endif}} - - {{if 'cuProfilerStop' in found_functions}} - global __cuProfilerStop - data["__cuProfilerStop"] = __cuProfilerStop - {{else}} - data["__cuProfilerStop"] = 0 - {{endif}} - - {{if True}} - global __cuGraphicsEGLRegisterImage - data["__cuGraphicsEGLRegisterImage"] = __cuGraphicsEGLRegisterImage - {{else}} - data["__cuGraphicsEGLRegisterImage"] = 0 - {{endif}} - - {{if True}} - global __cuEGLStreamConsumerConnect - data["__cuEGLStreamConsumerConnect"] = __cuEGLStreamConsumerConnect - {{else}} - data["__cuEGLStreamConsumerConnect"] = 0 - {{endif}} - - {{if True}} - global __cuEGLStreamConsumerConnectWithFlags - data["__cuEGLStreamConsumerConnectWithFlags"] = __cuEGLStreamConsumerConnectWithFlags - {{else}} - data["__cuEGLStreamConsumerConnectWithFlags"] = 0 - {{endif}} - - {{if True}} - global __cuEGLStreamConsumerDisconnect - data["__cuEGLStreamConsumerDisconnect"] = __cuEGLStreamConsumerDisconnect - {{else}} - data["__cuEGLStreamConsumerDisconnect"] = 0 - {{endif}} - - {{if True}} - global __cuEGLStreamConsumerAcquireFrame - data["__cuEGLStreamConsumerAcquireFrame"] = __cuEGLStreamConsumerAcquireFrame - {{else}} - data["__cuEGLStreamConsumerAcquireFrame"] = 0 - {{endif}} - - {{if True}} - global __cuEGLStreamConsumerReleaseFrame - data["__cuEGLStreamConsumerReleaseFrame"] = __cuEGLStreamConsumerReleaseFrame - {{else}} - data["__cuEGLStreamConsumerReleaseFrame"] = 0 - {{endif}} - - {{if True}} - global __cuEGLStreamProducerConnect - data["__cuEGLStreamProducerConnect"] = __cuEGLStreamProducerConnect - {{else}} - data["__cuEGLStreamProducerConnect"] = 0 - {{endif}} - - {{if True}} - global __cuEGLStreamProducerDisconnect - data["__cuEGLStreamProducerDisconnect"] = __cuEGLStreamProducerDisconnect - {{else}} - data["__cuEGLStreamProducerDisconnect"] = 0 - {{endif}} - - {{if True}} - global __cuEGLStreamProducerPresentFrame - data["__cuEGLStreamProducerPresentFrame"] = __cuEGLStreamProducerPresentFrame - {{else}} - data["__cuEGLStreamProducerPresentFrame"] = 0 - {{endif}} - - {{if True}} - global __cuEGLStreamProducerReturnFrame - data["__cuEGLStreamProducerReturnFrame"] = __cuEGLStreamProducerReturnFrame - {{else}} - data["__cuEGLStreamProducerReturnFrame"] = 0 - {{endif}} - - {{if True}} - global __cuGraphicsResourceGetMappedEglFrame - data["__cuGraphicsResourceGetMappedEglFrame"] = __cuGraphicsResourceGetMappedEglFrame - {{else}} - data["__cuGraphicsResourceGetMappedEglFrame"] = 0 - {{endif}} - - {{if True}} - global __cuEventCreateFromEGLSync - data["__cuEventCreateFromEGLSync"] = __cuEventCreateFromEGLSync - {{else}} - data["__cuEventCreateFromEGLSync"] = 0 - {{endif}} - - {{if True}} - global __cuGraphicsGLRegisterBuffer - data["__cuGraphicsGLRegisterBuffer"] = __cuGraphicsGLRegisterBuffer - {{else}} - data["__cuGraphicsGLRegisterBuffer"] = 0 - {{endif}} - - {{if True}} - global __cuGraphicsGLRegisterImage - data["__cuGraphicsGLRegisterImage"] = __cuGraphicsGLRegisterImage - {{else}} - data["__cuGraphicsGLRegisterImage"] = 0 - {{endif}} - - {{if True}} - global __cuGLGetDevices_v2 - data["__cuGLGetDevices_v2"] = __cuGLGetDevices_v2 - {{else}} - data["__cuGLGetDevices_v2"] = 0 - {{endif}} - - {{if True}} - global __cuVDPAUGetDevice - data["__cuVDPAUGetDevice"] = __cuVDPAUGetDevice - {{else}} - data["__cuVDPAUGetDevice"] = 0 - {{endif}} - - {{if True}} - global __cuVDPAUCtxCreate_v2 - data["__cuVDPAUCtxCreate_v2"] = __cuVDPAUCtxCreate_v2 - {{else}} - data["__cuVDPAUCtxCreate_v2"] = 0 - {{endif}} - - {{if True}} - global __cuGraphicsVDPAURegisterVideoSurface - data["__cuGraphicsVDPAURegisterVideoSurface"] = __cuGraphicsVDPAURegisterVideoSurface - {{else}} - data["__cuGraphicsVDPAURegisterVideoSurface"] = 0 - {{endif}} - - {{if True}} - global __cuGraphicsVDPAURegisterOutputSurface - data["__cuGraphicsVDPAURegisterOutputSurface"] = __cuGraphicsVDPAURegisterOutputSurface - {{else}} - data["__cuGraphicsVDPAURegisterOutputSurface"] = 0 - {{endif}} - - func_ptrs = data - return data - -cpdef _inspect_function_pointer(str name): - global func_ptrs - if func_ptrs is None: - func_ptrs = _inspect_function_pointers() - return func_ptrs[name] diff --git a/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in deleted file mode 100644 index 6e2a9773474..00000000000 --- a/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in +++ /dev/null @@ -1,789 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -# This code was automatically generated with version 13.2.0, generator version 8797618. Do not modify it directly. -{{if 'Windows' == platform.system()}} -import os -cimport cuda.bindings._lib.windll as windll -{{else}} -cimport cuda.bindings._lib.dlfcn as dlfcn -{{endif}} -from cuda.pathfinder import load_nvidia_dynamic_lib -from libc.stdint cimport intptr_t, uintptr_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}} -{{if 'nvrtcGetNumSupportedArchs' in found_functions}}cdef void *__nvrtcGetNumSupportedArchs = NULL{{endif}} -{{if 'nvrtcGetSupportedArchs' in found_functions}}cdef void *__nvrtcGetSupportedArchs = NULL{{endif}} -{{if 'nvrtcCreateProgram' in found_functions}}cdef void *__nvrtcCreateProgram = NULL{{endif}} -{{if 'nvrtcDestroyProgram' in found_functions}}cdef void *__nvrtcDestroyProgram = NULL{{endif}} -{{if 'nvrtcCompileProgram' in found_functions}}cdef void *__nvrtcCompileProgram = NULL{{endif}} -{{if 'nvrtcGetPTXSize' in found_functions}}cdef void *__nvrtcGetPTXSize = NULL{{endif}} -{{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 '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}} -{{if 'nvrtcGetOptiXIR' in found_functions}}cdef void *__nvrtcGetOptiXIR = NULL{{endif}} -{{if 'nvrtcGetProgramLogSize' in found_functions}}cdef void *__nvrtcGetProgramLogSize = NULL{{endif}} -{{if 'nvrtcGetProgramLog' in found_functions}}cdef void *__nvrtcGetProgramLog = NULL{{endif}} -{{if 'nvrtcAddNameExpression' in found_functions}}cdef void *__nvrtcAddNameExpression = NULL{{endif}} -{{if 'nvrtcGetLoweredName' in found_functions}}cdef void *__nvrtcGetLoweredName = NULL{{endif}} -{{if 'nvrtcGetPCHHeapSize' in found_functions}}cdef void *__nvrtcGetPCHHeapSize = NULL{{endif}} -{{if 'nvrtcSetPCHHeapSize' in found_functions}}cdef void *__nvrtcSetPCHHeapSize = NULL{{endif}} -{{if 'nvrtcGetPCHCreateStatus' in found_functions}}cdef void *__nvrtcGetPCHCreateStatus = NULL{{endif}} -{{if 'nvrtcGetPCHHeapSizeRequired' in found_functions}}cdef void *__nvrtcGetPCHHeapSizeRequired = NULL{{endif}} -{{if 'nvrtcSetFlowCallback' in found_functions}}cdef void *__nvrtcSetFlowCallback = NULL{{endif}} -{{if 'nvrtcGetTileIRSize' in found_functions}}cdef void *__nvrtcGetTileIRSize = NULL{{endif}} -{{if 'nvrtcGetTileIR' in found_functions}}cdef void *__nvrtcGetTileIR = NULL{{endif}} - -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 - - # Load function - {{if 'nvrtcGetErrorString' in found_functions}} - global __nvrtcGetErrorString - __nvrtcGetErrorString = windll.GetProcAddress(handle, 'nvrtcGetErrorString') - {{endif}} - {{if 'nvrtcVersion' in found_functions}} - global __nvrtcVersion - __nvrtcVersion = windll.GetProcAddress(handle, 'nvrtcVersion') - {{endif}} - {{if 'nvrtcGetNumSupportedArchs' in found_functions}} - global __nvrtcGetNumSupportedArchs - __nvrtcGetNumSupportedArchs = windll.GetProcAddress(handle, 'nvrtcGetNumSupportedArchs') - {{endif}} - {{if 'nvrtcGetSupportedArchs' in found_functions}} - global __nvrtcGetSupportedArchs - __nvrtcGetSupportedArchs = windll.GetProcAddress(handle, 'nvrtcGetSupportedArchs') - {{endif}} - {{if 'nvrtcCreateProgram' in found_functions}} - global __nvrtcCreateProgram - __nvrtcCreateProgram = windll.GetProcAddress(handle, 'nvrtcCreateProgram') - {{endif}} - {{if 'nvrtcDestroyProgram' in found_functions}} - global __nvrtcDestroyProgram - __nvrtcDestroyProgram = windll.GetProcAddress(handle, 'nvrtcDestroyProgram') - {{endif}} - {{if 'nvrtcCompileProgram' in found_functions}} - global __nvrtcCompileProgram - __nvrtcCompileProgram = windll.GetProcAddress(handle, 'nvrtcCompileProgram') - {{endif}} - {{if 'nvrtcGetPTXSize' in found_functions}} - global __nvrtcGetPTXSize - __nvrtcGetPTXSize = windll.GetProcAddress(handle, 'nvrtcGetPTXSize') - {{endif}} - {{if 'nvrtcGetPTX' in found_functions}} - global __nvrtcGetPTX - __nvrtcGetPTX = windll.GetProcAddress(handle, 'nvrtcGetPTX') - {{endif}} - {{if 'nvrtcGetCUBINSize' in found_functions}} - global __nvrtcGetCUBINSize - __nvrtcGetCUBINSize = windll.GetProcAddress(handle, 'nvrtcGetCUBINSize') - {{endif}} - {{if 'nvrtcGetCUBIN' in found_functions}} - global __nvrtcGetCUBIN - __nvrtcGetCUBIN = windll.GetProcAddress(handle, 'nvrtcGetCUBIN') - {{endif}} - {{if 'nvrtcGetLTOIRSize' in found_functions}} - global __nvrtcGetLTOIRSize - __nvrtcGetLTOIRSize = windll.GetProcAddress(handle, 'nvrtcGetLTOIRSize') - {{endif}} - {{if 'nvrtcGetLTOIR' in found_functions}} - global __nvrtcGetLTOIR - __nvrtcGetLTOIR = windll.GetProcAddress(handle, 'nvrtcGetLTOIR') - {{endif}} - {{if 'nvrtcGetOptiXIRSize' in found_functions}} - global __nvrtcGetOptiXIRSize - __nvrtcGetOptiXIRSize = windll.GetProcAddress(handle, 'nvrtcGetOptiXIRSize') - {{endif}} - {{if 'nvrtcGetOptiXIR' in found_functions}} - global __nvrtcGetOptiXIR - __nvrtcGetOptiXIR = windll.GetProcAddress(handle, 'nvrtcGetOptiXIR') - {{endif}} - {{if 'nvrtcGetProgramLogSize' in found_functions}} - global __nvrtcGetProgramLogSize - __nvrtcGetProgramLogSize = windll.GetProcAddress(handle, 'nvrtcGetProgramLogSize') - {{endif}} - {{if 'nvrtcGetProgramLog' in found_functions}} - global __nvrtcGetProgramLog - __nvrtcGetProgramLog = windll.GetProcAddress(handle, 'nvrtcGetProgramLog') - {{endif}} - {{if 'nvrtcAddNameExpression' in found_functions}} - global __nvrtcAddNameExpression - __nvrtcAddNameExpression = windll.GetProcAddress(handle, 'nvrtcAddNameExpression') - {{endif}} - {{if 'nvrtcGetLoweredName' in found_functions}} - global __nvrtcGetLoweredName - __nvrtcGetLoweredName = windll.GetProcAddress(handle, 'nvrtcGetLoweredName') - {{endif}} - {{if 'nvrtcGetPCHHeapSize' in found_functions}} - global __nvrtcGetPCHHeapSize - __nvrtcGetPCHHeapSize = windll.GetProcAddress(handle, 'nvrtcGetPCHHeapSize') - {{endif}} - {{if 'nvrtcSetPCHHeapSize' in found_functions}} - global __nvrtcSetPCHHeapSize - __nvrtcSetPCHHeapSize = windll.GetProcAddress(handle, 'nvrtcSetPCHHeapSize') - {{endif}} - {{if 'nvrtcGetPCHCreateStatus' in found_functions}} - global __nvrtcGetPCHCreateStatus - __nvrtcGetPCHCreateStatus = windll.GetProcAddress(handle, 'nvrtcGetPCHCreateStatus') - {{endif}} - {{if 'nvrtcGetPCHHeapSizeRequired' in found_functions}} - global __nvrtcGetPCHHeapSizeRequired - __nvrtcGetPCHHeapSizeRequired = windll.GetProcAddress(handle, 'nvrtcGetPCHHeapSizeRequired') - {{endif}} - {{if 'nvrtcSetFlowCallback' in found_functions}} - global __nvrtcSetFlowCallback - __nvrtcSetFlowCallback = windll.GetProcAddress(handle, 'nvrtcSetFlowCallback') - {{endif}} - {{if 'nvrtcGetTileIRSize' in found_functions}} - global __nvrtcGetTileIRSize - __nvrtcGetTileIRSize = windll.GetProcAddress(handle, 'nvrtcGetTileIRSize') - {{endif}} - {{if 'nvrtcGetTileIR' in found_functions}} - global __nvrtcGetTileIR - __nvrtcGetTileIR = windll.GetProcAddress(handle, 'nvrtcGetTileIR') - {{endif}} - - {{else}} - handle = (load_nvidia_dynamic_lib("nvrtc")._handle_uint) - - # 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}} - {{if 'nvrtcGetTileIRSize' in found_functions}} - global __nvrtcGetTileIRSize - __nvrtcGetTileIRSize = dlfcn.dlsym(handle, 'nvrtcGetTileIRSize') - {{endif}} - {{if 'nvrtcGetTileIR' in found_functions}} - global __nvrtcGetTileIR - __nvrtcGetTileIR = dlfcn.dlsym(handle, 'nvrtcGetTileIR') - {{endif}} - - {{endif}} - __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: - global __nvrtcGetErrorString - cuPythonInit() - if __nvrtcGetErrorString == NULL: - with gil: - raise RuntimeError('Function "nvrtcGetErrorString" not found') - err = ( __nvrtcGetErrorString)(result) - return err -{{endif}} - -{{if 'nvrtcVersion' in found_functions}} - -cdef nvrtcResult _nvrtcVersion(int* major, int* minor) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcVersion - cuPythonInit() - if __nvrtcVersion == NULL: - with gil: - raise RuntimeError('Function "nvrtcVersion" not found') - err = ( __nvrtcVersion)(major, minor) - return err -{{endif}} - -{{if 'nvrtcGetNumSupportedArchs' in found_functions}} - -cdef nvrtcResult _nvrtcGetNumSupportedArchs(int* numArchs) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcGetNumSupportedArchs - cuPythonInit() - if __nvrtcGetNumSupportedArchs == NULL: - with gil: - raise RuntimeError('Function "nvrtcGetNumSupportedArchs" not found') - err = ( __nvrtcGetNumSupportedArchs)(numArchs) - return err -{{endif}} - -{{if 'nvrtcGetSupportedArchs' in found_functions}} - -cdef nvrtcResult _nvrtcGetSupportedArchs(int* supportedArchs) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcGetSupportedArchs - cuPythonInit() - if __nvrtcGetSupportedArchs == NULL: - with gil: - raise RuntimeError('Function "nvrtcGetSupportedArchs" not found') - err = ( __nvrtcGetSupportedArchs)(supportedArchs) - return err -{{endif}} - -{{if 'nvrtcCreateProgram' in found_functions}} - -cdef nvrtcResult _nvrtcCreateProgram(nvrtcProgram* prog, const char* src, const char* name, int numHeaders, const char** headers, const char** includeNames) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcCreateProgram - cuPythonInit() - if __nvrtcCreateProgram == NULL: - with gil: - raise RuntimeError('Function "nvrtcCreateProgram" not found') - err = ( __nvrtcCreateProgram)(prog, src, name, numHeaders, headers, includeNames) - return err -{{endif}} - -{{if 'nvrtcDestroyProgram' in found_functions}} - -cdef nvrtcResult _nvrtcDestroyProgram(nvrtcProgram* prog) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcDestroyProgram - cuPythonInit() - if __nvrtcDestroyProgram == NULL: - with gil: - raise RuntimeError('Function "nvrtcDestroyProgram" not found') - err = ( __nvrtcDestroyProgram)(prog) - return err -{{endif}} - -{{if 'nvrtcCompileProgram' in found_functions}} - -cdef nvrtcResult _nvrtcCompileProgram(nvrtcProgram prog, int numOptions, const char** options) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcCompileProgram - cuPythonInit() - if __nvrtcCompileProgram == NULL: - with gil: - raise RuntimeError('Function "nvrtcCompileProgram" not found') - err = ( __nvrtcCompileProgram)(prog, numOptions, options) - return err -{{endif}} - -{{if 'nvrtcGetPTXSize' in found_functions}} - -cdef nvrtcResult _nvrtcGetPTXSize(nvrtcProgram prog, size_t* ptxSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcGetPTXSize - cuPythonInit() - if __nvrtcGetPTXSize == NULL: - with gil: - raise RuntimeError('Function "nvrtcGetPTXSize" not found') - err = ( __nvrtcGetPTXSize)(prog, ptxSizeRet) - return err -{{endif}} - -{{if 'nvrtcGetPTX' in found_functions}} - -cdef nvrtcResult _nvrtcGetPTX(nvrtcProgram prog, char* ptx) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcGetPTX - cuPythonInit() - if __nvrtcGetPTX == NULL: - with gil: - raise RuntimeError('Function "nvrtcGetPTX" not found') - err = ( __nvrtcGetPTX)(prog, ptx) - return err -{{endif}} - -{{if 'nvrtcGetCUBINSize' in found_functions}} - -cdef nvrtcResult _nvrtcGetCUBINSize(nvrtcProgram prog, size_t* cubinSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcGetCUBINSize - cuPythonInit() - if __nvrtcGetCUBINSize == NULL: - with gil: - raise RuntimeError('Function "nvrtcGetCUBINSize" not found') - err = ( __nvrtcGetCUBINSize)(prog, cubinSizeRet) - return err -{{endif}} - -{{if 'nvrtcGetCUBIN' in found_functions}} - -cdef nvrtcResult _nvrtcGetCUBIN(nvrtcProgram prog, char* cubin) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcGetCUBIN - cuPythonInit() - if __nvrtcGetCUBIN == NULL: - with gil: - raise RuntimeError('Function "nvrtcGetCUBIN" not found') - err = ( __nvrtcGetCUBIN)(prog, cubin) - return err -{{endif}} - -{{if 'nvrtcGetLTOIRSize' in found_functions}} - -cdef nvrtcResult _nvrtcGetLTOIRSize(nvrtcProgram prog, size_t* LTOIRSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcGetLTOIRSize - cuPythonInit() - if __nvrtcGetLTOIRSize == NULL: - with gil: - raise RuntimeError('Function "nvrtcGetLTOIRSize" not found') - err = ( __nvrtcGetLTOIRSize)(prog, LTOIRSizeRet) - return err -{{endif}} - -{{if 'nvrtcGetLTOIR' in found_functions}} - -cdef nvrtcResult _nvrtcGetLTOIR(nvrtcProgram prog, char* LTOIR) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcGetLTOIR - cuPythonInit() - if __nvrtcGetLTOIR == NULL: - with gil: - raise RuntimeError('Function "nvrtcGetLTOIR" not found') - err = ( __nvrtcGetLTOIR)(prog, LTOIR) - return err -{{endif}} - -{{if 'nvrtcGetOptiXIRSize' in found_functions}} - -cdef nvrtcResult _nvrtcGetOptiXIRSize(nvrtcProgram prog, size_t* optixirSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcGetOptiXIRSize - cuPythonInit() - if __nvrtcGetOptiXIRSize == NULL: - with gil: - raise RuntimeError('Function "nvrtcGetOptiXIRSize" not found') - err = ( __nvrtcGetOptiXIRSize)(prog, optixirSizeRet) - return err -{{endif}} - -{{if 'nvrtcGetOptiXIR' in found_functions}} - -cdef nvrtcResult _nvrtcGetOptiXIR(nvrtcProgram prog, char* optixir) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcGetOptiXIR - cuPythonInit() - if __nvrtcGetOptiXIR == NULL: - with gil: - raise RuntimeError('Function "nvrtcGetOptiXIR" not found') - err = ( __nvrtcGetOptiXIR)(prog, optixir) - return err -{{endif}} - -{{if 'nvrtcGetProgramLogSize' in found_functions}} - -cdef nvrtcResult _nvrtcGetProgramLogSize(nvrtcProgram prog, size_t* logSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcGetProgramLogSize - cuPythonInit() - if __nvrtcGetProgramLogSize == NULL: - with gil: - raise RuntimeError('Function "nvrtcGetProgramLogSize" not found') - err = ( __nvrtcGetProgramLogSize)(prog, logSizeRet) - return err -{{endif}} - -{{if 'nvrtcGetProgramLog' in found_functions}} - -cdef nvrtcResult _nvrtcGetProgramLog(nvrtcProgram prog, char* log) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcGetProgramLog - cuPythonInit() - if __nvrtcGetProgramLog == NULL: - with gil: - raise RuntimeError('Function "nvrtcGetProgramLog" not found') - err = ( __nvrtcGetProgramLog)(prog, log) - return err -{{endif}} - -{{if 'nvrtcAddNameExpression' in found_functions}} - -cdef nvrtcResult _nvrtcAddNameExpression(nvrtcProgram prog, const char* name_expression) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcAddNameExpression - cuPythonInit() - if __nvrtcAddNameExpression == NULL: - with gil: - raise RuntimeError('Function "nvrtcAddNameExpression" not found') - err = ( __nvrtcAddNameExpression)(prog, name_expression) - return err -{{endif}} - -{{if 'nvrtcGetLoweredName' in found_functions}} - -cdef nvrtcResult _nvrtcGetLoweredName(nvrtcProgram prog, const char* name_expression, const char** lowered_name) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcGetLoweredName - cuPythonInit() - if __nvrtcGetLoweredName == NULL: - with gil: - raise RuntimeError('Function "nvrtcGetLoweredName" not found') - err = ( __nvrtcGetLoweredName)(prog, name_expression, lowered_name) - return err -{{endif}} - -{{if 'nvrtcGetPCHHeapSize' in found_functions}} - -cdef nvrtcResult _nvrtcGetPCHHeapSize(size_t* ret) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcGetPCHHeapSize - cuPythonInit() - if __nvrtcGetPCHHeapSize == NULL: - with gil: - raise RuntimeError('Function "nvrtcGetPCHHeapSize" not found') - err = ( __nvrtcGetPCHHeapSize)(ret) - return err -{{endif}} - -{{if 'nvrtcSetPCHHeapSize' in found_functions}} - -cdef nvrtcResult _nvrtcSetPCHHeapSize(size_t size) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcSetPCHHeapSize - cuPythonInit() - if __nvrtcSetPCHHeapSize == NULL: - with gil: - raise RuntimeError('Function "nvrtcSetPCHHeapSize" not found') - err = ( __nvrtcSetPCHHeapSize)(size) - return err -{{endif}} - -{{if 'nvrtcGetPCHCreateStatus' in found_functions}} - -cdef nvrtcResult _nvrtcGetPCHCreateStatus(nvrtcProgram prog) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcGetPCHCreateStatus - cuPythonInit() - if __nvrtcGetPCHCreateStatus == NULL: - with gil: - raise RuntimeError('Function "nvrtcGetPCHCreateStatus" not found') - err = ( __nvrtcGetPCHCreateStatus)(prog) - return err -{{endif}} - -{{if 'nvrtcGetPCHHeapSizeRequired' in found_functions}} - -cdef nvrtcResult _nvrtcGetPCHHeapSizeRequired(nvrtcProgram prog, size_t* size) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcGetPCHHeapSizeRequired - cuPythonInit() - if __nvrtcGetPCHHeapSizeRequired == NULL: - with gil: - raise RuntimeError('Function "nvrtcGetPCHHeapSizeRequired" not found') - err = ( __nvrtcGetPCHHeapSizeRequired)(prog, size) - return err -{{endif}} - -{{if 'nvrtcSetFlowCallback' in found_functions}} - -cdef nvrtcResult _nvrtcSetFlowCallback(nvrtcProgram prog, void* callback, void* payload) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcSetFlowCallback - cuPythonInit() - if __nvrtcSetFlowCallback == NULL: - with gil: - raise RuntimeError('Function "nvrtcSetFlowCallback" not found') - err = ( __nvrtcSetFlowCallback)(prog, callback, payload) - return err -{{endif}} - -{{if 'nvrtcGetTileIRSize' in found_functions}} - -cdef nvrtcResult _nvrtcGetTileIRSize(nvrtcProgram prog, size_t* TileIRSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcGetTileIRSize - cuPythonInit() - if __nvrtcGetTileIRSize == NULL: - with gil: - raise RuntimeError('Function "nvrtcGetTileIRSize" not found') - err = ( __nvrtcGetTileIRSize)(prog, TileIRSizeRet) - return err -{{endif}} - -{{if 'nvrtcGetTileIR' in found_functions}} - -cdef nvrtcResult _nvrtcGetTileIR(nvrtcProgram prog, char* TileIR) except ?NVRTC_ERROR_INVALID_INPUT nogil: - global __nvrtcGetTileIR - cuPythonInit() - if __nvrtcGetTileIR == NULL: - with gil: - raise RuntimeError('Function "nvrtcGetTileIR" not found') - err = ( __nvrtcGetTileIR)(prog, TileIR) - return err -{{endif}} - -cdef dict func_ptrs = None - -cpdef dict _inspect_function_pointers(): - global func_ptrs - if func_ptrs is not None: - return func_ptrs - - cuPythonInit() - cdef dict data = {} - - {{if 'nvrtcGetErrorString' in found_functions}} - global __nvrtcGetErrorString - data["__nvrtcGetErrorString"] = __nvrtcGetErrorString - {{else}} - data["__nvrtcGetErrorString"] = 0 - {{endif}} - - {{if 'nvrtcVersion' in found_functions}} - global __nvrtcVersion - data["__nvrtcVersion"] = __nvrtcVersion - {{else}} - data["__nvrtcVersion"] = 0 - {{endif}} - - {{if 'nvrtcGetNumSupportedArchs' in found_functions}} - global __nvrtcGetNumSupportedArchs - data["__nvrtcGetNumSupportedArchs"] = __nvrtcGetNumSupportedArchs - {{else}} - data["__nvrtcGetNumSupportedArchs"] = 0 - {{endif}} - - {{if 'nvrtcGetSupportedArchs' in found_functions}} - global __nvrtcGetSupportedArchs - data["__nvrtcGetSupportedArchs"] = __nvrtcGetSupportedArchs - {{else}} - data["__nvrtcGetSupportedArchs"] = 0 - {{endif}} - - {{if 'nvrtcCreateProgram' in found_functions}} - global __nvrtcCreateProgram - data["__nvrtcCreateProgram"] = __nvrtcCreateProgram - {{else}} - data["__nvrtcCreateProgram"] = 0 - {{endif}} - - {{if 'nvrtcDestroyProgram' in found_functions}} - global __nvrtcDestroyProgram - data["__nvrtcDestroyProgram"] = __nvrtcDestroyProgram - {{else}} - data["__nvrtcDestroyProgram"] = 0 - {{endif}} - - {{if 'nvrtcCompileProgram' in found_functions}} - global __nvrtcCompileProgram - data["__nvrtcCompileProgram"] = __nvrtcCompileProgram - {{else}} - data["__nvrtcCompileProgram"] = 0 - {{endif}} - - {{if 'nvrtcGetPTXSize' in found_functions}} - global __nvrtcGetPTXSize - data["__nvrtcGetPTXSize"] = __nvrtcGetPTXSize - {{else}} - data["__nvrtcGetPTXSize"] = 0 - {{endif}} - - {{if 'nvrtcGetPTX' in found_functions}} - global __nvrtcGetPTX - data["__nvrtcGetPTX"] = __nvrtcGetPTX - {{else}} - data["__nvrtcGetPTX"] = 0 - {{endif}} - - {{if 'nvrtcGetCUBINSize' in found_functions}} - global __nvrtcGetCUBINSize - data["__nvrtcGetCUBINSize"] = __nvrtcGetCUBINSize - {{else}} - data["__nvrtcGetCUBINSize"] = 0 - {{endif}} - - {{if 'nvrtcGetCUBIN' in found_functions}} - global __nvrtcGetCUBIN - data["__nvrtcGetCUBIN"] = __nvrtcGetCUBIN - {{else}} - data["__nvrtcGetCUBIN"] = 0 - {{endif}} - - {{if 'nvrtcGetLTOIRSize' in found_functions}} - global __nvrtcGetLTOIRSize - data["__nvrtcGetLTOIRSize"] = __nvrtcGetLTOIRSize - {{else}} - data["__nvrtcGetLTOIRSize"] = 0 - {{endif}} - - {{if 'nvrtcGetLTOIR' in found_functions}} - global __nvrtcGetLTOIR - data["__nvrtcGetLTOIR"] = __nvrtcGetLTOIR - {{else}} - data["__nvrtcGetLTOIR"] = 0 - {{endif}} - - {{if 'nvrtcGetOptiXIRSize' in found_functions}} - global __nvrtcGetOptiXIRSize - data["__nvrtcGetOptiXIRSize"] = __nvrtcGetOptiXIRSize - {{else}} - data["__nvrtcGetOptiXIRSize"] = 0 - {{endif}} - - {{if 'nvrtcGetOptiXIR' in found_functions}} - global __nvrtcGetOptiXIR - data["__nvrtcGetOptiXIR"] = __nvrtcGetOptiXIR - {{else}} - data["__nvrtcGetOptiXIR"] = 0 - {{endif}} - - {{if 'nvrtcGetProgramLogSize' in found_functions}} - global __nvrtcGetProgramLogSize - data["__nvrtcGetProgramLogSize"] = __nvrtcGetProgramLogSize - {{else}} - data["__nvrtcGetProgramLogSize"] = 0 - {{endif}} - - {{if 'nvrtcGetProgramLog' in found_functions}} - global __nvrtcGetProgramLog - data["__nvrtcGetProgramLog"] = __nvrtcGetProgramLog - {{else}} - data["__nvrtcGetProgramLog"] = 0 - {{endif}} - - {{if 'nvrtcAddNameExpression' in found_functions}} - global __nvrtcAddNameExpression - data["__nvrtcAddNameExpression"] = __nvrtcAddNameExpression - {{else}} - data["__nvrtcAddNameExpression"] = 0 - {{endif}} - - {{if 'nvrtcGetLoweredName' in found_functions}} - global __nvrtcGetLoweredName - data["__nvrtcGetLoweredName"] = __nvrtcGetLoweredName - {{else}} - data["__nvrtcGetLoweredName"] = 0 - {{endif}} - - {{if 'nvrtcGetPCHHeapSize' in found_functions}} - global __nvrtcGetPCHHeapSize - data["__nvrtcGetPCHHeapSize"] = __nvrtcGetPCHHeapSize - {{else}} - data["__nvrtcGetPCHHeapSize"] = 0 - {{endif}} - - {{if 'nvrtcSetPCHHeapSize' in found_functions}} - global __nvrtcSetPCHHeapSize - data["__nvrtcSetPCHHeapSize"] = __nvrtcSetPCHHeapSize - {{else}} - data["__nvrtcSetPCHHeapSize"] = 0 - {{endif}} - - {{if 'nvrtcGetPCHCreateStatus' in found_functions}} - global __nvrtcGetPCHCreateStatus - data["__nvrtcGetPCHCreateStatus"] = __nvrtcGetPCHCreateStatus - {{else}} - data["__nvrtcGetPCHCreateStatus"] = 0 - {{endif}} - - {{if 'nvrtcGetPCHHeapSizeRequired' in found_functions}} - global __nvrtcGetPCHHeapSizeRequired - data["__nvrtcGetPCHHeapSizeRequired"] = __nvrtcGetPCHHeapSizeRequired - {{else}} - data["__nvrtcGetPCHHeapSizeRequired"] = 0 - {{endif}} - - {{if 'nvrtcSetFlowCallback' in found_functions}} - global __nvrtcSetFlowCallback - data["__nvrtcSetFlowCallback"] = __nvrtcSetFlowCallback - {{else}} - data["__nvrtcSetFlowCallback"] = 0 - {{endif}} - - {{if 'nvrtcGetTileIRSize' in found_functions}} - global __nvrtcGetTileIRSize - data["__nvrtcGetTileIRSize"] = __nvrtcGetTileIRSize - {{else}} - data["__nvrtcGetTileIRSize"] = 0 - {{endif}} - - {{if 'nvrtcGetTileIR' in found_functions}} - global __nvrtcGetTileIR - data["__nvrtcGetTileIR"] = __nvrtcGetTileIR - {{else}} - data["__nvrtcGetTileIR"] = 0 - {{endif}} - - func_ptrs = data - return data - -cpdef _inspect_function_pointer(str name): - global func_ptrs - if func_ptrs is None: - func_ptrs = _inspect_function_pointers() - return func_ptrs[name] diff --git a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in b/cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in index 6c04ecd8a02..5432ab70c8a 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in +++ b/cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in @@ -1,7 +1,8 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated with version 13.2.0, generator version 8797618. Do not modify it directly. +# This code was automatically generated with version 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a99a543be62e221f4b4b43249719b689c33ea030adef3dfa012b31efac555ece include "../cyruntime_types.pxi" include "../_lib/cyruntime/cyruntime.pxd" @@ -296,6 +297,11 @@ cdef cudaError_t _cudaStreamAttachMemAsync(cudaStream_t stream, void* devPtr, si cdef cudaError_t _cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} +{{if 'cudaStreamBeginRecaptureToGraph' in found_functions}} + +cdef cudaError_t _cudaStreamBeginRecaptureToGraph(cudaStream_t stream, cudaStreamCaptureMode mode, cudaGraph_t graph, cudaGraphRecaptureCallbackData* callbackData) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + {{if 'cudaStreamBeginCaptureToGraph' in found_functions}} cdef cudaError_t _cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil diff --git a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in index 1e59279d68f..58388d3dd92 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in +++ b/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in @@ -1,7 +1,8 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated with version 13.2.0, generator version 8797618. Do not modify it directly. +# This code was automatically generated with version 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=ccadd478eafb421b735d8fc0c44e1c03e873885646a81381f1d995bd573b5120 include "../cyruntime_functions.pxi" import os @@ -15,7 +16,7 @@ cdef int _cudaPythonInit() except -1 nogil: global __usePTDS with gil: - __usePTDS = os.getenv('CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM', default=False) + __usePTDS = bool(int(os.getenv('CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM', default=0))) __cudaPythonInit = True return __usePTDS @@ -548,6 +549,15 @@ cdef cudaError_t _cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureM return cudaStreamBeginCapture(stream, mode) {{endif}} +{{if 'cudaStreamBeginRecaptureToGraph' in found_functions}} + +cdef cudaError_t _cudaStreamBeginRecaptureToGraph(cudaStream_t stream, cudaStreamCaptureMode mode, cudaGraph_t graph, cudaGraphRecaptureCallbackData* callbackData) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaStreamBeginRecaptureToGraph(stream, mode, graph, callbackData) + return cudaStreamBeginRecaptureToGraph(stream, mode, graph, callbackData) +{{endif}} + {{if 'cudaStreamBeginCaptureToGraph' in found_functions}} cdef cudaError_t _cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil: diff --git a/cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pxd.in b/cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pxd.in index f941bbf46f3..d12c7be7141 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pxd.in +++ b/cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pxd.in @@ -1,7 +1,8 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated with version 13.2.0, generator version 8797618. Do not modify it directly. +# This code was automatically generated with version 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=005e8f266f43a90c73b382df384f4143abf0e82b26d8ad69cb8aa58fbafa13ef cdef extern from "": """ #define CUDA_API_PER_THREAD_DEFAULT_STREAM @@ -299,6 +300,11 @@ cdef cudaError_t _cudaStreamAttachMemAsync(cudaStream_t stream, void* devPtr, si cdef cudaError_t _cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} +{{if 'cudaStreamBeginRecaptureToGraph' in found_functions}} + +cdef cudaError_t _cudaStreamBeginRecaptureToGraph(cudaStream_t stream, cudaStreamCaptureMode mode, cudaGraph_t graph, cudaGraphRecaptureCallbackData* callbackData) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + {{if 'cudaStreamBeginCaptureToGraph' in found_functions}} cdef cudaError_t _cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil diff --git a/cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pyx.in index 273d985575a..c69f8a4fda2 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pyx.in +++ b/cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pyx.in @@ -1,7 +1,8 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated with version 13.2.0, generator version 8797618. Do not modify it directly. +# This code was automatically generated with version 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=1e1b93a907c72767d54e7b740e3e3a1b7b629b111af47d22c94b587b769bab9c cdef extern from "": """ #define CUDA_API_PER_THREAD_DEFAULT_STREAM @@ -359,6 +360,12 @@ cdef cudaError_t _cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureM return cudaStreamBeginCapture(stream, mode) {{endif}} +{{if 'cudaStreamBeginRecaptureToGraph' in found_functions}} + +cdef cudaError_t _cudaStreamBeginRecaptureToGraph(cudaStream_t stream, cudaStreamCaptureMode mode, cudaGraph_t graph, cudaGraphRecaptureCallbackData* callbackData) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaStreamBeginRecaptureToGraph(stream, mode, graph, callbackData) +{{endif}} + {{if 'cudaStreamBeginCaptureToGraph' in found_functions}} cdef cudaError_t _cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil: diff --git a/cuda_bindings/cuda/bindings/_bindings/loader.cpp b/cuda_bindings/cuda/bindings/_bindings/loader.cpp deleted file mode 100644 index a692eddc931..00000000000 --- a/cuda_bindings/cuda/bindings/_bindings/loader.cpp +++ /dev/null @@ -1,350 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -// SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -#include -#include -#include -#include "loader.h" - -#define DXCORE_MAX_PATH 260 - -#if defined(_WIN32) -#include "windows.h" -#define _getAddr GetProcAddress -#define _Handle HMODULE -static const size_t sysrootName64_length = (sizeof("System32") - 1); -static const char* sysrootName64 = "System32"; -static const size_t libcudaName64_length = (sizeof("\\nvcuda64.dll") - 1); -static const char* libcudaName64 = "\\nvcuda64.dll"; -static const size_t sysrootNameX86_length = (sizeof("SysWOW64") - 1); -static const char* sysrootNameX86 = "SysWOW64"; -static const size_t libcudaNameX86_length = (sizeof("\\nvcuda32.dll") - 1); -static const char* libcudaNameX86 = "\\nvcuda32.dll"; -static size_t sysrootName_length = NULL; -static const char* sysrootName = NULL; - -#else -#include -#include -#define _getAddr dlsym -#define _Handle void* -static const size_t libcudaNameLinux_length = (sizeof("/libcuda.so.1.1") - 1); -static const char* libcudaNameLinux = "/libcuda.so.1.1"; -#endif -static size_t libcudaName_length = 0; -static const char* libcudaName = NULL; - -struct dxcore_enumAdapters2; -struct dxcore_queryAdapterInfo; - -typedef int (*pfnDxcoreEnumAdapters2)(const dxcore_enumAdapters2 *pParams); -typedef int (*pfnDxcoreQueryAdapterInfo)(const dxcore_queryAdapterInfo *pParams); - -struct dxcore_lib { - _Handle hDxcoreLib; - pfnDxcoreEnumAdapters2 pDxcoreEnumAdapters2; - pfnDxcoreQueryAdapterInfo pDxcoreQueryAdapterInfo; -}; - -struct dxcore_luid -{ - unsigned int lowPart; - int highPart; -}; - -struct dxcore_adapterInfo -{ - unsigned int hAdapter; - struct dxcore_luid AdapterLuid; - unsigned int NumOfSources; - unsigned int bPresentMoveRegionsPreferred; -}; - -struct dxcore_enumAdapters2 -{ - unsigned int NumAdapters; - struct dxcore_adapterInfo *pAdapters; -}; - -enum dxcore_kmtqueryAdapterInfoType -{ - DXCORE_QUERYDRIVERVERSION = 13, - DXCORE_QUERYREGISTRY = 48, -}; - -enum dxcore_queryregistry_type { - DXCORE_QUERYREGISTRY_DRIVERSTOREPATH = 2, -}; - -enum dxcore_queryregistry_status { - DXCORE_QUERYREGISTRY_STATUS_SUCCESS = 0, - DXCORE_QUERYREGISTRY_STATUS_BUFFER_OVERFLOW = 1, - DXCORE_QUERYREGISTRY_STATUS_FAIL = 2, -}; - -struct dxcore_queryregistry_info { - enum dxcore_queryregistry_type QueryType; - unsigned int QueryFlags; - wchar_t ValueName[DXCORE_MAX_PATH]; - unsigned int ValueType; - unsigned int PhysicalAdapterIndex; - unsigned int OutputValueSize; - enum dxcore_queryregistry_status Status; - union { - unsigned long long OutputQword; - wchar_t Output; - }; -}; - -struct dxcore_queryAdapterInfo -{ - unsigned int hAdapter; - enum dxcore_kmtqueryAdapterInfoType Type; - void *pPrivateDriverData; - unsigned int PrivateDriverDataSize; -}; - -static int dxcore_query_adapter_info_helper(struct dxcore_lib* pLib, - unsigned int hAdapter, - enum dxcore_kmtqueryAdapterInfoType type, - void* pPrivateDriverDate, - unsigned int privateDriverDataSize) -{ - struct dxcore_queryAdapterInfo queryAdapterInfo = {}; - - queryAdapterInfo.hAdapter = hAdapter; - queryAdapterInfo.Type = type; - queryAdapterInfo.pPrivateDriverData = pPrivateDriverDate; - queryAdapterInfo.PrivateDriverDataSize = privateDriverDataSize; - - return pLib->pDxcoreQueryAdapterInfo(&queryAdapterInfo); -} - -static int dxcore_query_adapter_wddm_version(struct dxcore_lib* pLib, unsigned int hAdapter, unsigned int* version) -{ - return dxcore_query_adapter_info_helper(pLib, - hAdapter, - DXCORE_QUERYDRIVERVERSION, - (void*)version, - (unsigned int)sizeof(*version)); -} - -static int dxcore_query_adapter_driverstore_path(struct dxcore_lib* pLib, unsigned int hAdapter, char** ppDriverStorePath) -{ - struct dxcore_queryregistry_info params = {}; - struct dxcore_queryregistry_info* pValue = NULL; - wchar_t* pOutput; - size_t outputSizeInBytes; - size_t outputSize; - - // 1. Fetch output size - params.QueryType = DXCORE_QUERYREGISTRY_DRIVERSTOREPATH; - - if (dxcore_query_adapter_info_helper(pLib, - hAdapter, - DXCORE_QUERYREGISTRY, - (void*)¶ms, - (unsigned int)sizeof(struct dxcore_queryregistry_info))) - { - return (-1); - } - - if (params.OutputValueSize > DXCORE_MAX_PATH * sizeof(wchar_t)) { - return (-1); - } - - outputSizeInBytes = (size_t)params.OutputValueSize; - outputSize = outputSizeInBytes / sizeof(wchar_t); - - // 2. Retrieve output - pValue = (struct dxcore_queryregistry_info*)calloc(sizeof(struct dxcore_queryregistry_info) + outputSizeInBytes + sizeof(wchar_t), 1); - if (!pValue) { - return (-1); - } - - pValue->QueryType = DXCORE_QUERYREGISTRY_DRIVERSTOREPATH; - pValue->OutputValueSize = (unsigned int)outputSizeInBytes; - - if (dxcore_query_adapter_info_helper(pLib, - hAdapter, - DXCORE_QUERYREGISTRY, - (void*)pValue, - (unsigned int)(sizeof(struct dxcore_queryregistry_info) + outputSizeInBytes))) - { - free(pValue); - return (-1); - } - pOutput = (wchar_t*)(&pValue->Output); - - // Make sure no matter what happened the wchar_t string is null terminated - pOutput[outputSize] = L'\0'; - - // Convert the output into a regular c string - *ppDriverStorePath = (char*)calloc(outputSize + 1, sizeof(char)); - if (!*ppDriverStorePath) { - free(pValue); - return (-1); - } - wcstombs(*ppDriverStorePath, pOutput, outputSize); - - free(pValue); - - return 0; -} - -static char* replaceSystemPath(char* path) -{ - char *replacedPath = (char*)calloc(DXCORE_MAX_PATH + 1, sizeof(char)); - -#if defined(_WIN32) - wchar_t *systemPath = (wchar_t*)calloc(DXCORE_MAX_PATH + 1, sizeof(wchar_t)); - // Get system root path - if (GetSystemDirectoryW(systemPath, DXCORE_MAX_PATH) == 0) { - free(replacedPath); - free(systemPath); - return NULL; - } - wcstombs(replacedPath, systemPath, DXCORE_MAX_PATH); - free(systemPath); - - // Replace the /SystemRoot/ part of the registry-obtained path with - // the actual system root path from above - char* sysrootPath = strstr(path, sysrootName); - strncat(replacedPath, sysrootPath + sysrootName_length, DXCORE_MAX_PATH - strlen(replacedPath)); -#else - strncat(replacedPath, path, DXCORE_MAX_PATH); -#endif - - // Append nvcuda dll - if (libcudaName_length < DXCORE_MAX_PATH - strlen(replacedPath)) { - strncat(replacedPath, libcudaName, libcudaName_length); - } - else { - strncat(replacedPath, libcudaName, DXCORE_MAX_PATH - strlen(replacedPath)); - } - - return replacedPath; -} - -static int dxcore_check_adapter(struct dxcore_lib *pLib, char *libPath, struct dxcore_adapterInfo *pAdapterInfo) -{ - unsigned int wddmVersion = 0; - char* driverStorePath = NULL; - - if (dxcore_query_adapter_wddm_version(pLib, pAdapterInfo->hAdapter, &wddmVersion)) { - return 1; - } - - if (wddmVersion < 2500) { - return 1; - } - - if (dxcore_query_adapter_driverstore_path(pLib, pAdapterInfo->hAdapter, &driverStorePath)) { - return 1; - } - - // Replace with valid path - char* replacedPath = replaceSystemPath(driverStorePath); - if (!replacedPath) { - free(driverStorePath); - free(replacedPath); - return 1; - } - - // Does file exist? -#if defined(_WIN32) - if (GetFileAttributes(replacedPath) == INVALID_FILE_ATTRIBUTES) { - free(driverStorePath); - free(replacedPath); - return 1; - } -#else - if (access(replacedPath, F_OK) < 0) { - free(driverStorePath); - free(replacedPath); - return 1; - } -#endif - - memcpy(libPath, replacedPath, DXCORE_MAX_PATH); - free(driverStorePath); - free(replacedPath); - - return 0; -} - -static int dxcore_enum_adapters(struct dxcore_lib *pLib, char *libPath) -{ - struct dxcore_enumAdapters2 params = {0}; - unsigned int adapterIndex = 0; - - if (pLib->pDxcoreEnumAdapters2(¶ms)) { - return 1; - } - params.pAdapters = (dxcore_adapterInfo*)calloc(params.NumAdapters, sizeof(struct dxcore_adapterInfo)); - if (pLib->pDxcoreEnumAdapters2(¶ms)) { - free(params.pAdapters); - return 1; - } - - for (adapterIndex = 0; adapterIndex < params.NumAdapters; adapterIndex++) { - if (!dxcore_check_adapter(pLib, libPath, ¶ms.pAdapters[adapterIndex])) { - free(params.pAdapters); - return 0; - } - } - - free(params.pAdapters); - return 1; -} - -int getCUDALibraryPath(char *libPath, bool isBit64) -{ - struct dxcore_lib lib = {0}; - - if (!libPath) { - return 1; - } - - // Configure paths based on app's bit configuration -#if defined(_WIN32) - if (isBit64) { - sysrootName_length = sysrootName64_length; - sysrootName = sysrootName64; - libcudaName_length = libcudaName64_length; - libcudaName = libcudaName64; - } - else { - sysrootName_length = sysrootNameX86_length; - sysrootName = sysrootNameX86; - libcudaName_length = libcudaNameX86_length; - libcudaName = libcudaNameX86; - } -#else - libcudaName_length = libcudaNameLinux_length; - libcudaName = libcudaNameLinux; -#endif - -#if defined(_WIN32) - lib.hDxcoreLib = LoadLibraryExW(L"gdi32.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32); -#else - lib.hDxcoreLib = dlopen("libdxcore.so", RTLD_LAZY); -#endif - if (!lib.hDxcoreLib) { - return 1; - } - - lib.pDxcoreEnumAdapters2 = (pfnDxcoreEnumAdapters2)_getAddr(lib.hDxcoreLib, "D3DKMTEnumAdapters2"); - if (!lib.pDxcoreEnumAdapters2) { - return 1; - } - lib.pDxcoreQueryAdapterInfo = (pfnDxcoreQueryAdapterInfo)_getAddr(lib.hDxcoreLib, "D3DKMTQueryAdapterInfo"); - if (!lib.pDxcoreQueryAdapterInfo) { - return 1; - } - - if (dxcore_enum_adapters(&lib, libPath)) { - return 1; - } - return 0; -} diff --git a/cuda_bindings/cuda/bindings/_bindings/loader.h b/cuda_bindings/cuda/bindings/_bindings/loader.h deleted file mode 100644 index 2411037b032..00000000000 --- a/cuda_bindings/cuda/bindings/_bindings/loader.h +++ /dev/null @@ -1,9 +0,0 @@ -// 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. -int getCUDALibraryPath(char *libPath, bool isBit64); diff --git a/cuda_bindings/cuda/bindings/_bindings/loader.pxd b/cuda_bindings/cuda/bindings/_bindings/loader.pxd deleted file mode 100644 index 805b849cc66..00000000000 --- a/cuda_bindings/cuda/bindings/_bindings/loader.pxd +++ /dev/null @@ -1,5 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -cdef extern from "loader.h": - int getCUDALibraryPath(char *libPath, bint isBit64) diff --git a/cuda_bindings/cuda/bindings/_example_helpers/__init__.py b/cuda_bindings/cuda/bindings/_example_helpers/__init__.py new file mode 100644 index 00000000000..119d7e97689 --- /dev/null +++ b/cuda_bindings/cuda/bindings/_example_helpers/__init__.py @@ -0,0 +1,17 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from .common import KernelHelper, check_compute_capability_too_low, requirement_not_met +from .helper_cuda import check_cuda_errors, find_cuda_device, find_cuda_device_drv +from .helper_string import check_cmd_line_flag, get_cmd_line_argument_int + +__all__ = [ + "KernelHelper", + "check_cmd_line_flag", + "check_compute_capability_too_low", + "check_cuda_errors", + "find_cuda_device", + "find_cuda_device_drv", + "get_cmd_line_argument_int", + "requirement_not_met", +] diff --git a/cuda_bindings/examples/common/common.py b/cuda_bindings/cuda/bindings/_example_helpers/common.py similarity index 76% rename from cuda_bindings/examples/common/common.py rename to cuda_bindings/cuda/bindings/_example_helpers/common.py index 5b5151ef24b..8970944a31a 100644 --- a/cuda_bindings/examples/common/common.py +++ b/cuda_bindings/cuda/bindings/_example_helpers/common.py @@ -1,19 +1,27 @@ -# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +import os +import sys + import numpy as np -from common.helper_cuda import check_cuda_errors from cuda import pathfinder from cuda.bindings import driver as cuda from cuda.bindings import nvrtc from cuda.bindings import runtime as cudart +from .helper_cuda import check_cuda_errors + + +def requirement_not_met(message): + print(message, file=sys.stderr) # noqa: T201 + exitcode = os.environ.get("CUDA_BINDINGS_SKIP_EXAMPLE", "1") + return sys.exit(int(exitcode)) -def pytest_skipif_compute_capability_too_low(dev_id, required_cc_major_minor): - import pytest +def check_compute_capability_too_low(dev_id, required_cc_major_minor): cc_major = check_cuda_errors( cudart.cudaDeviceGetAttribute(cudart.cudaDeviceAttr.cudaDevAttrComputeCapabilityMajor, dev_id) ) @@ -22,7 +30,9 @@ def pytest_skipif_compute_capability_too_low(dev_id, required_cc_major_minor): ) 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}") + requirement_not_met( + f"CUDA device compute capability too low: {have_cc_major_minor=!r}, {required_cc_major_minor=!r}" + ) class KernelHelper: @@ -31,9 +41,7 @@ def __init__(self, code, dev_id): for libname in ("cudart", "cccl"): hdr_dir = pathfinder.find_nvidia_header_directory(libname) if hdr_dir is None: - import pytest - - pytest.skip(f'pathfinder.find_nvidia_header_directory("{libname}") returned None') + requirement_not_met(f'pathfinder.find_nvidia_header_directory("{libname}") returned None') include_dirs.append(hdr_dir) prog = check_cuda_errors(nvrtc.nvrtcCreateProgram(str.encode(code), b"sourceCode.cu", 0, None, None)) @@ -69,8 +77,8 @@ def __init__(self, code, dev_id): check_cuda_errors(nvrtc.nvrtcGetProgramLog(prog, log)) import sys - print(log.decode(), file=sys.stderr) - print(err, file=sys.stderr) + print(log.decode(), file=sys.stderr) # noqa: T201 + print(err, file=sys.stderr) # noqa: T201 sys.exit(1) if use_cubin: diff --git a/cuda_bindings/examples/common/helper_cuda.py b/cuda_bindings/cuda/bindings/_example_helpers/helper_cuda.py similarity index 86% rename from cuda_bindings/examples/common/helper_cuda.py rename to cuda_bindings/cuda/bindings/_example_helpers/helper_cuda.py index 9fbfe8c82f7..18fbecf59b9 100644 --- a/cuda_bindings/examples/common/helper_cuda.py +++ b/cuda_bindings/cuda/bindings/_example_helpers/helper_cuda.py @@ -1,12 +1,12 @@ -# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -from common.helper_string import check_cmd_line_flag, get_cmd_line_argument_int +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 from cuda.bindings import driver as cuda from cuda.bindings import nvrtc from cuda.bindings import runtime as cudart +from .helper_string import check_cmd_line_flag, get_cmd_line_argument_int + def _cuda_get_error_enum(error): if isinstance(error, cuda.CUresult): diff --git a/cuda_bindings/examples/common/helper_string.py b/cuda_bindings/cuda/bindings/_example_helpers/helper_string.py similarity index 69% rename from cuda_bindings/examples/common/helper_string.py rename to cuda_bindings/cuda/bindings/_example_helpers/helper_string.py index 47d9d36569f..ad15cecc9ca 100644 --- a/cuda_bindings/examples/common/helper_string.py +++ b/cuda_bindings/cuda/bindings/_example_helpers/helper_string.py @@ -1,5 +1,5 @@ -# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 import sys diff --git a/cuda_bindings/cuda/bindings/_internal/_fast_enum.py b/cuda_bindings/cuda/bindings/_internal/_fast_enum.py index 9c8e42cc938..cb3e6e900a3 100644 --- a/cuda_bindings/cuda/bindings/_internal/_fast_enum.py +++ b/cuda_bindings/cuda/bindings/_internal/_fast_enum.py @@ -1,10 +1,10 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - - -# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=5791f341ee9bb6573f42300fbed50cc52fc5e808c1d6bb9156e6aabb9db29b17 """ This is a replacement for the stdlib enum.IntEnum. diff --git a/cuda_bindings/cuda/bindings/_internal/cudla.pxd b/cuda_bindings/cuda/bindings/_internal/cudla.pxd new file mode 100644 index 00000000000..359cf8f486a --- /dev/null +++ b/cuda_bindings/cuda/bindings/_internal/cudla.pxd @@ -0,0 +1,26 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This code was automatically generated across versions from 1.5.0 to 13.3.0. Do not modify it directly. + +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=07f18bf6993a0d962a4e844aa9ea9a335534c669992d112dd12003b77015e5ba +from ..cycudla cimport * + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef cudlaStatus _cudlaGetVersion(uint64_t* const version) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus _cudlaDeviceGetCount(uint64_t* const pNumDevices) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus _cudlaCreateDevice(const uint64_t device, cudlaDevHandle* const devHandle, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus _cudlaMemRegister(const cudlaDevHandle devHandle, const uint64_t* const ptr, const size_t size, uint64_t** const devPtr, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus _cudlaModuleLoadFromMemory(const cudlaDevHandle devHandle, const uint8_t* const pModule, const size_t moduleSize, cudlaModule* const hModule, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus _cudlaModuleGetAttributes(const cudlaModule hModule, const cudlaModuleAttributeType attrType, cudlaModuleAttribute* const attribute) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus _cudlaModuleUnload(const cudlaModule hModule, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus _cudlaSubmitTask(const cudlaDevHandle devHandle, const cudlaTask* const ptrToTasks, const uint32_t numTasks, void* const stream, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus _cudlaDeviceGetAttribute(const cudlaDevHandle devHandle, const cudlaDevAttributeType attrib, cudlaDevAttribute* const pAttribute) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus _cudlaMemUnregister(const cudlaDevHandle devHandle, const uint64_t* const devPtr) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus _cudlaGetLastError(const cudlaDevHandle devHandle) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus _cudlaDestroyDevice(const cudlaDevHandle devHandle) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus _cudlaSetTaskTimeoutInMs(const cudlaDevHandle devHandle, const uint32_t timeout) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil diff --git a/cuda_bindings/cuda/bindings/_internal/cudla_linux.pyx b/cuda_bindings/cuda/bindings/_internal/cudla_linux.pyx new file mode 100644 index 00000000000..93ebdfa927d --- /dev/null +++ b/cuda_bindings/cuda/bindings/_internal/cudla_linux.pyx @@ -0,0 +1,386 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This code was automatically generated across versions from 1.5.0 to 13.3.0. Do not modify it directly. + +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=2b56e5f08b7806fe10648817d36d96ce420cb5a8329615fb283f71119128d090 +from libc.stdint cimport intptr_t, uintptr_t + +import threading +from .utils import FunctionNotFoundError, NotSupportedError + +from cuda.pathfinder import load_nvidia_dynamic_lib + + +############################################################################### +# Extern +############################################################################### + +# You must 'from .utils import NotSupportedError' before using this template + +cdef extern from "" nogil: + void* dlopen(const char*, int) + char* dlerror() + void* dlsym(void*, const char*) + int dlclose(void*) + + enum: + RTLD_LAZY + RTLD_NOW + RTLD_GLOBAL + RTLD_LOCAL + + 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('Did not find cuDriverGetVersion symbol in libcuda.so.1') + err = (cuDriverGetVersion)(&driver_ver) + if err != 0: + raise RuntimeError(f'cuDriverGetVersion returned error code {err}') + + return driver_ver + + + +############################################################################### +# Wrapper init +############################################################################### + +cdef object __symbol_lock = threading.Lock() +cdef bint __py_cudla_init = False + +cdef void* __cudlaGetVersion = NULL +cdef void* __cudlaDeviceGetCount = NULL +cdef void* __cudlaCreateDevice = NULL +cdef void* __cudlaMemRegister = NULL +cdef void* __cudlaModuleLoadFromMemory = NULL +cdef void* __cudlaModuleGetAttributes = NULL +cdef void* __cudlaModuleUnload = NULL +cdef void* __cudlaSubmitTask = NULL +cdef void* __cudlaDeviceGetAttribute = NULL +cdef void* __cudlaMemUnregister = NULL +cdef void* __cudlaGetLastError = NULL +cdef void* __cudlaDestroyDevice = NULL +cdef void* __cudlaSetTaskTimeoutInMs = NULL + + +cdef void* load_library() except* with gil: + cdef uintptr_t handle = load_nvidia_dynamic_lib("cudla")._handle_uint + return handle + + +cdef int _init_cudla() except -1 nogil: + global __py_cudla_init + cdef void* handle = NULL + + with gil, __symbol_lock: + # Recheck the flag after obtaining the locks + if __py_cudla_init: + return 0 + + # Load function + global __cudlaGetVersion + __cudlaGetVersion = dlsym(RTLD_DEFAULT, 'cudlaGetVersion') + if __cudlaGetVersion == NULL: + if handle == NULL: + handle = load_library() + __cudlaGetVersion = dlsym(handle, 'cudlaGetVersion') + + global __cudlaDeviceGetCount + __cudlaDeviceGetCount = dlsym(RTLD_DEFAULT, 'cudlaDeviceGetCount') + if __cudlaDeviceGetCount == NULL: + if handle == NULL: + handle = load_library() + __cudlaDeviceGetCount = dlsym(handle, 'cudlaDeviceGetCount') + + global __cudlaCreateDevice + __cudlaCreateDevice = dlsym(RTLD_DEFAULT, 'cudlaCreateDevice') + if __cudlaCreateDevice == NULL: + if handle == NULL: + handle = load_library() + __cudlaCreateDevice = dlsym(handle, 'cudlaCreateDevice') + + global __cudlaMemRegister + __cudlaMemRegister = dlsym(RTLD_DEFAULT, 'cudlaMemRegister') + if __cudlaMemRegister == NULL: + if handle == NULL: + handle = load_library() + __cudlaMemRegister = dlsym(handle, 'cudlaMemRegister') + + global __cudlaModuleLoadFromMemory + __cudlaModuleLoadFromMemory = dlsym(RTLD_DEFAULT, 'cudlaModuleLoadFromMemory') + if __cudlaModuleLoadFromMemory == NULL: + if handle == NULL: + handle = load_library() + __cudlaModuleLoadFromMemory = dlsym(handle, 'cudlaModuleLoadFromMemory') + + global __cudlaModuleGetAttributes + __cudlaModuleGetAttributes = dlsym(RTLD_DEFAULT, 'cudlaModuleGetAttributes') + if __cudlaModuleGetAttributes == NULL: + if handle == NULL: + handle = load_library() + __cudlaModuleGetAttributes = dlsym(handle, 'cudlaModuleGetAttributes') + + global __cudlaModuleUnload + __cudlaModuleUnload = dlsym(RTLD_DEFAULT, 'cudlaModuleUnload') + if __cudlaModuleUnload == NULL: + if handle == NULL: + handle = load_library() + __cudlaModuleUnload = dlsym(handle, 'cudlaModuleUnload') + + global __cudlaSubmitTask + __cudlaSubmitTask = dlsym(RTLD_DEFAULT, 'cudlaSubmitTask') + if __cudlaSubmitTask == NULL: + if handle == NULL: + handle = load_library() + __cudlaSubmitTask = dlsym(handle, 'cudlaSubmitTask') + + global __cudlaDeviceGetAttribute + __cudlaDeviceGetAttribute = dlsym(RTLD_DEFAULT, 'cudlaDeviceGetAttribute') + if __cudlaDeviceGetAttribute == NULL: + if handle == NULL: + handle = load_library() + __cudlaDeviceGetAttribute = dlsym(handle, 'cudlaDeviceGetAttribute') + + global __cudlaMemUnregister + __cudlaMemUnregister = dlsym(RTLD_DEFAULT, 'cudlaMemUnregister') + if __cudlaMemUnregister == NULL: + if handle == NULL: + handle = load_library() + __cudlaMemUnregister = dlsym(handle, 'cudlaMemUnregister') + + global __cudlaGetLastError + __cudlaGetLastError = dlsym(RTLD_DEFAULT, 'cudlaGetLastError') + if __cudlaGetLastError == NULL: + if handle == NULL: + handle = load_library() + __cudlaGetLastError = dlsym(handle, 'cudlaGetLastError') + + global __cudlaDestroyDevice + __cudlaDestroyDevice = dlsym(RTLD_DEFAULT, 'cudlaDestroyDevice') + if __cudlaDestroyDevice == NULL: + if handle == NULL: + handle = load_library() + __cudlaDestroyDevice = dlsym(handle, 'cudlaDestroyDevice') + + global __cudlaSetTaskTimeoutInMs + __cudlaSetTaskTimeoutInMs = dlsym(RTLD_DEFAULT, 'cudlaSetTaskTimeoutInMs') + if __cudlaSetTaskTimeoutInMs == NULL: + if handle == NULL: + handle = load_library() + __cudlaSetTaskTimeoutInMs = dlsym(handle, 'cudlaSetTaskTimeoutInMs') + + __py_cudla_init = True + return 0 + + +cdef inline int _check_or_init_cudla() except -1 nogil: + if __py_cudla_init: + return 0 + + return _init_cudla() + + +cdef dict func_ptrs = None + + +cpdef dict _inspect_function_pointers(): + global func_ptrs + if func_ptrs is not None: + return func_ptrs + + _check_or_init_cudla() + cdef dict data = {} + + global __cudlaGetVersion + data["__cudlaGetVersion"] = __cudlaGetVersion + + global __cudlaDeviceGetCount + data["__cudlaDeviceGetCount"] = __cudlaDeviceGetCount + + global __cudlaCreateDevice + data["__cudlaCreateDevice"] = __cudlaCreateDevice + + global __cudlaMemRegister + data["__cudlaMemRegister"] = __cudlaMemRegister + + global __cudlaModuleLoadFromMemory + data["__cudlaModuleLoadFromMemory"] = __cudlaModuleLoadFromMemory + + global __cudlaModuleGetAttributes + data["__cudlaModuleGetAttributes"] = __cudlaModuleGetAttributes + + global __cudlaModuleUnload + data["__cudlaModuleUnload"] = __cudlaModuleUnload + + global __cudlaSubmitTask + data["__cudlaSubmitTask"] = __cudlaSubmitTask + + global __cudlaDeviceGetAttribute + data["__cudlaDeviceGetAttribute"] = __cudlaDeviceGetAttribute + + global __cudlaMemUnregister + data["__cudlaMemUnregister"] = __cudlaMemUnregister + + global __cudlaGetLastError + data["__cudlaGetLastError"] = __cudlaGetLastError + + global __cudlaDestroyDevice + data["__cudlaDestroyDevice"] = __cudlaDestroyDevice + + global __cudlaSetTaskTimeoutInMs + data["__cudlaSetTaskTimeoutInMs"] = __cudlaSetTaskTimeoutInMs + + func_ptrs = data + return data + + +cpdef _inspect_function_pointer(str name): + global func_ptrs + if func_ptrs is None: + func_ptrs = _inspect_function_pointers() + return func_ptrs[name] + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef cudlaStatus _cudlaGetVersion(uint64_t* const version) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaGetVersion + _check_or_init_cudla() + if __cudlaGetVersion == NULL: + with gil: + raise FunctionNotFoundError("function cudlaGetVersion is not found") + return (__cudlaGetVersion)( + version) + + +cdef cudlaStatus _cudlaDeviceGetCount(uint64_t* const pNumDevices) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaDeviceGetCount + _check_or_init_cudla() + if __cudlaDeviceGetCount == NULL: + with gil: + raise FunctionNotFoundError("function cudlaDeviceGetCount is not found") + return (__cudlaDeviceGetCount)( + pNumDevices) + + +cdef cudlaStatus _cudlaCreateDevice(const uint64_t device, cudlaDevHandle* const devHandle, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaCreateDevice + _check_or_init_cudla() + if __cudlaCreateDevice == NULL: + with gil: + raise FunctionNotFoundError("function cudlaCreateDevice is not found") + return (__cudlaCreateDevice)( + device, devHandle, flags) + + +cdef cudlaStatus _cudlaMemRegister(const cudlaDevHandle devHandle, const uint64_t* const ptr, const size_t size, uint64_t** const devPtr, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaMemRegister + _check_or_init_cudla() + if __cudlaMemRegister == NULL: + with gil: + raise FunctionNotFoundError("function cudlaMemRegister is not found") + return (__cudlaMemRegister)( + devHandle, ptr, size, devPtr, flags) + + +cdef cudlaStatus _cudlaModuleLoadFromMemory(const cudlaDevHandle devHandle, const uint8_t* const pModule, const size_t moduleSize, cudlaModule* const hModule, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaModuleLoadFromMemory + _check_or_init_cudla() + if __cudlaModuleLoadFromMemory == NULL: + with gil: + raise FunctionNotFoundError("function cudlaModuleLoadFromMemory is not found") + return (__cudlaModuleLoadFromMemory)( + devHandle, pModule, moduleSize, hModule, flags) + + +cdef cudlaStatus _cudlaModuleGetAttributes(const cudlaModule hModule, const cudlaModuleAttributeType attrType, cudlaModuleAttribute* const attribute) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaModuleGetAttributes + _check_or_init_cudla() + if __cudlaModuleGetAttributes == NULL: + with gil: + raise FunctionNotFoundError("function cudlaModuleGetAttributes is not found") + return (__cudlaModuleGetAttributes)( + hModule, attrType, attribute) + + +cdef cudlaStatus _cudlaModuleUnload(const cudlaModule hModule, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaModuleUnload + _check_or_init_cudla() + if __cudlaModuleUnload == NULL: + with gil: + raise FunctionNotFoundError("function cudlaModuleUnload is not found") + return (__cudlaModuleUnload)( + hModule, flags) + + +cdef cudlaStatus _cudlaSubmitTask(const cudlaDevHandle devHandle, const cudlaTask* const ptrToTasks, const uint32_t numTasks, void* const stream, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaSubmitTask + _check_or_init_cudla() + if __cudlaSubmitTask == NULL: + with gil: + raise FunctionNotFoundError("function cudlaSubmitTask is not found") + return (__cudlaSubmitTask)( + devHandle, ptrToTasks, numTasks, stream, flags) + + +cdef cudlaStatus _cudlaDeviceGetAttribute(const cudlaDevHandle devHandle, const cudlaDevAttributeType attrib, cudlaDevAttribute* const pAttribute) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaDeviceGetAttribute + _check_or_init_cudla() + if __cudlaDeviceGetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cudlaDeviceGetAttribute is not found") + return (__cudlaDeviceGetAttribute)( + devHandle, attrib, pAttribute) + + +cdef cudlaStatus _cudlaMemUnregister(const cudlaDevHandle devHandle, const uint64_t* const devPtr) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaMemUnregister + _check_or_init_cudla() + if __cudlaMemUnregister == NULL: + with gil: + raise FunctionNotFoundError("function cudlaMemUnregister is not found") + return (__cudlaMemUnregister)( + devHandle, devPtr) + + +cdef cudlaStatus _cudlaGetLastError(const cudlaDevHandle devHandle) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaGetLastError + _check_or_init_cudla() + if __cudlaGetLastError == NULL: + with gil: + raise FunctionNotFoundError("function cudlaGetLastError is not found") + return (__cudlaGetLastError)( + devHandle) + + +cdef cudlaStatus _cudlaDestroyDevice(const cudlaDevHandle devHandle) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaDestroyDevice + _check_or_init_cudla() + if __cudlaDestroyDevice == NULL: + with gil: + raise FunctionNotFoundError("function cudlaDestroyDevice is not found") + return (__cudlaDestroyDevice)( + devHandle) + + +cdef cudlaStatus _cudlaSetTaskTimeoutInMs(const cudlaDevHandle devHandle, const uint32_t timeout) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaSetTaskTimeoutInMs + _check_or_init_cudla() + if __cudlaSetTaskTimeoutInMs == NULL: + with gil: + raise FunctionNotFoundError("function cudlaSetTaskTimeoutInMs is not found") + return (__cudlaSetTaskTimeoutInMs)( + devHandle, timeout) diff --git a/cuda_bindings/cuda/bindings/_internal/cudla_windows.pyx b/cuda_bindings/cuda/bindings/_internal/cudla_windows.pyx new file mode 100644 index 00000000000..9a5313639e4 --- /dev/null +++ b/cuda_bindings/cuda/bindings/_internal/cudla_windows.pyx @@ -0,0 +1,349 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This code was automatically generated across versions from 1.5.0 to 13.3.0. Do not modify it directly. + +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=43403925d332dc0474938eb5f6b5d58c648884b9f056c1b319a515281b36757e +from libc.stdint cimport intptr_t + +import threading +from .utils import FunctionNotFoundError, NotSupportedError + +from cuda.pathfinder import load_nvidia_dynamic_lib + +from libc.stddef cimport wchar_t +from libc.stdint cimport uintptr_t +from cpython cimport PyUnicode_AsWideCharString, PyMem_Free + +# You must 'from .utils import NotSupportedError' before using this template + +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('Did not find cuDriverGetVersion symbol in nvcuda.dll') + err = (cuDriverGetVersion)(&driver_ver) + if err != 0: + raise RuntimeError(f'cuDriverGetVersion returned error code {err}') + + return driver_ver + + + +############################################################################### +# Wrapper init +############################################################################### + +cdef object __symbol_lock = threading.Lock() +cdef bint __py_cudla_init = False + +cdef void* __cudlaGetVersion = NULL +cdef void* __cudlaDeviceGetCount = NULL +cdef void* __cudlaCreateDevice = NULL +cdef void* __cudlaMemRegister = NULL +cdef void* __cudlaModuleLoadFromMemory = NULL +cdef void* __cudlaModuleGetAttributes = NULL +cdef void* __cudlaModuleUnload = NULL +cdef void* __cudlaSubmitTask = NULL +cdef void* __cudlaDeviceGetAttribute = NULL +cdef void* __cudlaMemUnregister = NULL +cdef void* __cudlaGetLastError = NULL +cdef void* __cudlaDestroyDevice = NULL +cdef void* __cudlaSetTaskTimeoutInMs = NULL + + +cdef int _init_cudla() except -1 nogil: + global __py_cudla_init + + with gil, __symbol_lock: + # Recheck the flag after obtaining the locks + if __py_cudla_init: + return 0 + + # Load library + handle = load_nvidia_dynamic_lib("cudla")._handle_uint + + # Load function + global __cudlaGetVersion + __cudlaGetVersion = GetProcAddress(handle, 'cudlaGetVersion') + + global __cudlaDeviceGetCount + __cudlaDeviceGetCount = GetProcAddress(handle, 'cudlaDeviceGetCount') + + global __cudlaCreateDevice + __cudlaCreateDevice = GetProcAddress(handle, 'cudlaCreateDevice') + + global __cudlaMemRegister + __cudlaMemRegister = GetProcAddress(handle, 'cudlaMemRegister') + + global __cudlaModuleLoadFromMemory + __cudlaModuleLoadFromMemory = GetProcAddress(handle, 'cudlaModuleLoadFromMemory') + + global __cudlaModuleGetAttributes + __cudlaModuleGetAttributes = GetProcAddress(handle, 'cudlaModuleGetAttributes') + + global __cudlaModuleUnload + __cudlaModuleUnload = GetProcAddress(handle, 'cudlaModuleUnload') + + global __cudlaSubmitTask + __cudlaSubmitTask = GetProcAddress(handle, 'cudlaSubmitTask') + + global __cudlaDeviceGetAttribute + __cudlaDeviceGetAttribute = GetProcAddress(handle, 'cudlaDeviceGetAttribute') + + global __cudlaMemUnregister + __cudlaMemUnregister = GetProcAddress(handle, 'cudlaMemUnregister') + + global __cudlaGetLastError + __cudlaGetLastError = GetProcAddress(handle, 'cudlaGetLastError') + + global __cudlaDestroyDevice + __cudlaDestroyDevice = GetProcAddress(handle, 'cudlaDestroyDevice') + + global __cudlaSetTaskTimeoutInMs + __cudlaSetTaskTimeoutInMs = GetProcAddress(handle, 'cudlaSetTaskTimeoutInMs') + + __py_cudla_init = True + return 0 + + +cdef inline int _check_or_init_cudla() except -1 nogil: + if __py_cudla_init: + return 0 + + return _init_cudla() + + +cdef dict func_ptrs = None + + +cpdef dict _inspect_function_pointers(): + global func_ptrs + if func_ptrs is not None: + return func_ptrs + + _check_or_init_cudla() + cdef dict data = {} + + global __cudlaGetVersion + data["__cudlaGetVersion"] = __cudlaGetVersion + + global __cudlaDeviceGetCount + data["__cudlaDeviceGetCount"] = __cudlaDeviceGetCount + + global __cudlaCreateDevice + data["__cudlaCreateDevice"] = __cudlaCreateDevice + + global __cudlaMemRegister + data["__cudlaMemRegister"] = __cudlaMemRegister + + global __cudlaModuleLoadFromMemory + data["__cudlaModuleLoadFromMemory"] = __cudlaModuleLoadFromMemory + + global __cudlaModuleGetAttributes + data["__cudlaModuleGetAttributes"] = __cudlaModuleGetAttributes + + global __cudlaModuleUnload + data["__cudlaModuleUnload"] = __cudlaModuleUnload + + global __cudlaSubmitTask + data["__cudlaSubmitTask"] = __cudlaSubmitTask + + global __cudlaDeviceGetAttribute + data["__cudlaDeviceGetAttribute"] = __cudlaDeviceGetAttribute + + global __cudlaMemUnregister + data["__cudlaMemUnregister"] = __cudlaMemUnregister + + global __cudlaGetLastError + data["__cudlaGetLastError"] = __cudlaGetLastError + + global __cudlaDestroyDevice + data["__cudlaDestroyDevice"] = __cudlaDestroyDevice + + global __cudlaSetTaskTimeoutInMs + data["__cudlaSetTaskTimeoutInMs"] = __cudlaSetTaskTimeoutInMs + + func_ptrs = data + return data + + +cpdef _inspect_function_pointer(str name): + global func_ptrs + if func_ptrs is None: + func_ptrs = _inspect_function_pointers() + return func_ptrs[name] + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef cudlaStatus _cudlaGetVersion(uint64_t* const version) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaGetVersion + _check_or_init_cudla() + if __cudlaGetVersion == NULL: + with gil: + raise FunctionNotFoundError("function cudlaGetVersion is not found") + return (__cudlaGetVersion)( + version) + + +cdef cudlaStatus _cudlaDeviceGetCount(uint64_t* const pNumDevices) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaDeviceGetCount + _check_or_init_cudla() + if __cudlaDeviceGetCount == NULL: + with gil: + raise FunctionNotFoundError("function cudlaDeviceGetCount is not found") + return (__cudlaDeviceGetCount)( + pNumDevices) + + +cdef cudlaStatus _cudlaCreateDevice(const uint64_t device, cudlaDevHandle* const devHandle, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaCreateDevice + _check_or_init_cudla() + if __cudlaCreateDevice == NULL: + with gil: + raise FunctionNotFoundError("function cudlaCreateDevice is not found") + return (__cudlaCreateDevice)( + device, devHandle, flags) + + +cdef cudlaStatus _cudlaMemRegister(const cudlaDevHandle devHandle, const uint64_t* const ptr, const size_t size, uint64_t** const devPtr, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaMemRegister + _check_or_init_cudla() + if __cudlaMemRegister == NULL: + with gil: + raise FunctionNotFoundError("function cudlaMemRegister is not found") + return (__cudlaMemRegister)( + devHandle, ptr, size, devPtr, flags) + + +cdef cudlaStatus _cudlaModuleLoadFromMemory(const cudlaDevHandle devHandle, const uint8_t* const pModule, const size_t moduleSize, cudlaModule* const hModule, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaModuleLoadFromMemory + _check_or_init_cudla() + if __cudlaModuleLoadFromMemory == NULL: + with gil: + raise FunctionNotFoundError("function cudlaModuleLoadFromMemory is not found") + return (__cudlaModuleLoadFromMemory)( + devHandle, pModule, moduleSize, hModule, flags) + + +cdef cudlaStatus _cudlaModuleGetAttributes(const cudlaModule hModule, const cudlaModuleAttributeType attrType, cudlaModuleAttribute* const attribute) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaModuleGetAttributes + _check_or_init_cudla() + if __cudlaModuleGetAttributes == NULL: + with gil: + raise FunctionNotFoundError("function cudlaModuleGetAttributes is not found") + return (__cudlaModuleGetAttributes)( + hModule, attrType, attribute) + + +cdef cudlaStatus _cudlaModuleUnload(const cudlaModule hModule, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaModuleUnload + _check_or_init_cudla() + if __cudlaModuleUnload == NULL: + with gil: + raise FunctionNotFoundError("function cudlaModuleUnload is not found") + return (__cudlaModuleUnload)( + hModule, flags) + + +cdef cudlaStatus _cudlaSubmitTask(const cudlaDevHandle devHandle, const cudlaTask* const ptrToTasks, const uint32_t numTasks, void* const stream, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaSubmitTask + _check_or_init_cudla() + if __cudlaSubmitTask == NULL: + with gil: + raise FunctionNotFoundError("function cudlaSubmitTask is not found") + return (__cudlaSubmitTask)( + devHandle, ptrToTasks, numTasks, stream, flags) + + +cdef cudlaStatus _cudlaDeviceGetAttribute(const cudlaDevHandle devHandle, const cudlaDevAttributeType attrib, cudlaDevAttribute* const pAttribute) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaDeviceGetAttribute + _check_or_init_cudla() + if __cudlaDeviceGetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cudlaDeviceGetAttribute is not found") + return (__cudlaDeviceGetAttribute)( + devHandle, attrib, pAttribute) + + +cdef cudlaStatus _cudlaMemUnregister(const cudlaDevHandle devHandle, const uint64_t* const devPtr) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaMemUnregister + _check_or_init_cudla() + if __cudlaMemUnregister == NULL: + with gil: + raise FunctionNotFoundError("function cudlaMemUnregister is not found") + return (__cudlaMemUnregister)( + devHandle, devPtr) + + +cdef cudlaStatus _cudlaGetLastError(const cudlaDevHandle devHandle) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaGetLastError + _check_or_init_cudla() + if __cudlaGetLastError == NULL: + with gil: + raise FunctionNotFoundError("function cudlaGetLastError is not found") + return (__cudlaGetLastError)( + devHandle) + + +cdef cudlaStatus _cudlaDestroyDevice(const cudlaDevHandle devHandle) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaDestroyDevice + _check_or_init_cudla() + if __cudlaDestroyDevice == NULL: + with gil: + raise FunctionNotFoundError("function cudlaDestroyDevice is not found") + return (__cudlaDestroyDevice)( + devHandle) + + +cdef cudlaStatus _cudlaSetTaskTimeoutInMs(const cudlaDevHandle devHandle, const uint32_t timeout) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + global __cudlaSetTaskTimeoutInMs + _check_or_init_cudla() + if __cudlaSetTaskTimeoutInMs == NULL: + with gil: + raise FunctionNotFoundError("function cudlaSetTaskTimeoutInMs is not found") + return (__cudlaSetTaskTimeoutInMs)( + devHandle, timeout) diff --git a/cuda_bindings/cuda/bindings/_internal/cufile.pxd b/cuda_bindings/cuda/bindings/_internal/cufile.pxd index 1e0da8beb73..b8fe03b779d 100644 --- a/cuda_bindings/cuda/bindings/_internal/cufile.pxd +++ b/cuda_bindings/cuda/bindings/_internal/cufile.pxd @@ -1,9 +1,10 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.9.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b70fdd33eb00b70224c097fb28dd1031d82e8a2930356a4428c93e3bd1b52a86 from ..cycufile cimport * diff --git a/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx b/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx index 5231808058f..0917a2b368b 100644 --- a/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx @@ -1,9 +1,10 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.9.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b43946a1b7b010b7d9ee95ed67723e3dfc54b46a6dc68829e936ffad6ba852dc from libc.stdint cimport intptr_t, uintptr_t import threading diff --git a/cuda_bindings/cuda/bindings/_bindings/cydriver.pxd.in b/cuda_bindings/cuda/bindings/_internal/driver.pxd similarity index 67% rename from cuda_bindings/cuda/bindings/_bindings/cydriver.pxd.in rename to cuda_bindings/cuda/bindings/_internal/driver.pxd index 98298f6947a..d0d183d034c 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cydriver.pxd.in +++ b/cuda_bindings/cuda/bindings/_internal/driver.pxd @@ -1,2461 +1,531 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. -# This code was automatically generated with version 13.2.0, generator version 8797618. Do not modify it directly. -from cuda.bindings.cydriver cimport * +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a82b3f5dcb30b13294f6896a4d9d9f2f8d7be6b29c8f0a0c61677b1c622d4480 +from ..cydriver cimport * -{{if 'cuGetErrorString' in found_functions}} -cdef CUresult _cuGetErrorString(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGetErrorName' in found_functions}} +############################################################################### +# Wrapper functions +############################################################################### +cdef CUresult _cuGetErrorString(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult _cuGetErrorName(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuInit' in found_functions}} - cdef CUresult _cuInit(unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDriverGetVersion' in found_functions}} - cdef CUresult _cuDriverGetVersion(int* driverVersion) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGet' in found_functions}} - cdef CUresult _cuDeviceGet(CUdevice* device, int ordinal) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetCount' in found_functions}} - cdef CUresult _cuDeviceGetCount(int* count) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetName' in found_functions}} - -cdef CUresult _cuDeviceGetName(char* name, int length, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetUuid_v2' in found_functions}} - +cdef CUresult _cuDeviceGetName(char* name, int len, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult _cuDeviceGetUuid_v2(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetLuid' in found_functions}} - cdef CUresult _cuDeviceGetLuid(char* luid, unsigned int* deviceNodeMask, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceTotalMem_v2' in found_functions}} - -cdef CUresult _cuDeviceTotalMem_v2(size_t* numbytes, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}} - -cdef CUresult _cuDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, CUarray_format pformat, unsigned numChannels, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetAttribute' in found_functions}} - +cdef CUresult _cuDeviceTotalMem_v2(size_t* bytes, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, CUarray_format format, unsigned numChannels, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult _cuDeviceGetAttribute(int* pi, CUdevice_attribute attrib, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{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 -{{endif}} - -{{if 'cuDeviceSetMemPool' in found_functions}} - cdef CUresult _cuDeviceSetMemPool(CUdevice dev, CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetMemPool' in found_functions}} - cdef CUresult _cuDeviceGetMemPool(CUmemoryPool* pool, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetDefaultMemPool' in found_functions}} - cdef CUresult _cuDeviceGetDefaultMemPool(CUmemoryPool* pool_out, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetExecAffinitySupport' in found_functions}} - -cdef CUresult _cuDeviceGetExecAffinitySupport(int* pi, CUexecAffinityType typename, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFlushGPUDirectRDMAWrites' in found_functions}} - +cdef CUresult _cuDeviceGetExecAffinitySupport(int* pi, CUexecAffinityType type, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult _cuFlushGPUDirectRDMAWrites(CUflushGPUDirectRDMAWritesTarget target, CUflushGPUDirectRDMAWritesScope scope) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetProperties' in found_functions}} - cdef CUresult _cuDeviceGetProperties(CUdevprop* prop, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceComputeCapability' in found_functions}} - cdef CUresult _cuDeviceComputeCapability(int* major, int* minor, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDevicePrimaryCtxRetain' in found_functions}} - cdef CUresult _cuDevicePrimaryCtxRetain(CUcontext* pctx, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}} - cdef CUresult _cuDevicePrimaryCtxRelease_v2(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}} - cdef CUresult _cuDevicePrimaryCtxSetFlags_v2(CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDevicePrimaryCtxGetState' in found_functions}} - cdef CUresult _cuDevicePrimaryCtxGetState(CUdevice dev, unsigned int* flags, int* active) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDevicePrimaryCtxReset_v2' in found_functions}} - cdef CUresult _cuDevicePrimaryCtxReset_v2(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxCreate_v4' in found_functions}} - +cdef CUresult _cuCtxCreate_v2(CUcontext* pctx, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxCreate_v3(CUcontext* pctx, CUexecAffinityParam* paramsArray, int numParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult _cuCtxCreate_v4(CUcontext* pctx, CUctxCreateParams* ctxCreateParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxDestroy_v2' in found_functions}} - cdef CUresult _cuCtxDestroy_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxPushCurrent_v2' in found_functions}} - cdef CUresult _cuCtxPushCurrent_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxPopCurrent_v2' in found_functions}} - cdef CUresult _cuCtxPopCurrent_v2(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxSetCurrent' in found_functions}} - cdef CUresult _cuCtxSetCurrent(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxGetCurrent' in found_functions}} - cdef CUresult _cuCtxGetCurrent(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxGetDevice' in found_functions}} - 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 -{{endif}} - -{{if 'cuCtxSetFlags' in found_functions}} - cdef CUresult _cuCtxSetFlags(unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxGetId' in found_functions}} - cdef CUresult _cuCtxGetId(CUcontext ctx, unsigned long long* ctxId) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxSynchronize' in found_functions}} - 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 -{{endif}} - -{{if 'cuCtxGetLimit' in found_functions}} - cdef CUresult _cuCtxGetLimit(size_t* pvalue, CUlimit limit) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxGetCacheConfig' in found_functions}} - cdef CUresult _cuCtxGetCacheConfig(CUfunc_cache* pconfig) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxSetCacheConfig' in found_functions}} - cdef CUresult _cuCtxSetCacheConfig(CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxGetApiVersion' in found_functions}} - cdef CUresult _cuCtxGetApiVersion(CUcontext ctx, unsigned int* version) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxGetStreamPriorityRange' in found_functions}} - cdef CUresult _cuCtxGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxResetPersistingL2Cache' in found_functions}} - cdef CUresult _cuCtxResetPersistingL2Cache() except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxGetExecAffinity' in found_functions}} - -cdef CUresult _cuCtxGetExecAffinity(CUexecAffinityParam* pExecAffinity, CUexecAffinityType typename) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxRecordEvent' in found_functions}} - +cdef CUresult _cuCtxGetExecAffinity(CUexecAffinityParam* pExecAffinity, CUexecAffinityType type) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult _cuCtxRecordEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxWaitEvent' in found_functions}} - cdef CUresult _cuCtxWaitEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxAttach' in found_functions}} - cdef CUresult _cuCtxAttach(CUcontext* pctx, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxDetach' in found_functions}} - cdef CUresult _cuCtxDetach(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxGetSharedMemConfig' in found_functions}} - cdef CUresult _cuCtxGetSharedMemConfig(CUsharedconfig* pConfig) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxSetSharedMemConfig' in found_functions}} - cdef CUresult _cuCtxSetSharedMemConfig(CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuModuleLoad' in found_functions}} - cdef CUresult _cuModuleLoad(CUmodule* module, const char* fname) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuModuleLoadData' in found_functions}} - cdef CUresult _cuModuleLoadData(CUmodule* module, const void* image) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuModuleLoadDataEx' in found_functions}} - cdef CUresult _cuModuleLoadDataEx(CUmodule* module, const void* image, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuModuleLoadFatBinary' in found_functions}} - cdef CUresult _cuModuleLoadFatBinary(CUmodule* module, const void* fatCubin) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuModuleUnload' in found_functions}} - cdef CUresult _cuModuleUnload(CUmodule hmod) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuModuleGetLoadingMode' in found_functions}} - cdef CUresult _cuModuleGetLoadingMode(CUmoduleLoadingMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuModuleGetFunction' in found_functions}} - cdef CUresult _cuModuleGetFunction(CUfunction* hfunc, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuModuleGetFunctionCount' in found_functions}} - cdef CUresult _cuModuleGetFunctionCount(unsigned int* count, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuModuleEnumerateFunctions' in found_functions}} - cdef CUresult _cuModuleEnumerateFunctions(CUfunction* functions, unsigned int numFunctions, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuModuleGetGlobal_v2' in found_functions}} - -cdef CUresult _cuModuleGetGlobal_v2(CUdeviceptr* dptr, size_t* numbytes, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLinkCreate_v2' in found_functions}} - +cdef CUresult _cuModuleGetGlobal_v2(CUdeviceptr* dptr, size_t* bytes, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult _cuLinkCreate_v2(unsigned int numOptions, CUjit_option* options, void** optionValues, CUlinkState* stateOut) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLinkAddData_v2' in found_functions}} - -cdef CUresult _cuLinkAddData_v2(CUlinkState state, CUjitInputType typename, void* data, size_t size, const char* name, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLinkAddFile_v2' in found_functions}} - -cdef CUresult _cuLinkAddFile_v2(CUlinkState state, CUjitInputType typename, const char* path, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLinkComplete' in found_functions}} - +cdef CUresult _cuLinkAddData_v2(CUlinkState state, CUjitInputType type, void* data, size_t size, const char* name, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLinkAddFile_v2(CUlinkState state, CUjitInputType type, const char* path, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult _cuLinkComplete(CUlinkState state, void** cubinOut, size_t* sizeOut) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLinkDestroy' in found_functions}} - cdef CUresult _cuLinkDestroy(CUlinkState state) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuModuleGetTexRef' in found_functions}} - cdef CUresult _cuModuleGetTexRef(CUtexref* pTexRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuModuleGetSurfRef' in found_functions}} - cdef CUresult _cuModuleGetSurfRef(CUsurfref* pSurfRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLibraryLoadData' in found_functions}} - cdef CUresult _cuLibraryLoadData(CUlibrary* library, const void* code, CUjit_option* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, CUlibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLibraryLoadFromFile' in found_functions}} - cdef CUresult _cuLibraryLoadFromFile(CUlibrary* library, const char* fileName, CUjit_option* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, CUlibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLibraryUnload' in found_functions}} - cdef CUresult _cuLibraryUnload(CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLibraryGetKernel' in found_functions}} - cdef CUresult _cuLibraryGetKernel(CUkernel* pKernel, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLibraryGetKernelCount' in found_functions}} - cdef CUresult _cuLibraryGetKernelCount(unsigned int* count, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLibraryEnumerateKernels' in found_functions}} - cdef CUresult _cuLibraryEnumerateKernels(CUkernel* kernels, unsigned int numKernels, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLibraryGetModule' in found_functions}} - cdef CUresult _cuLibraryGetModule(CUmodule* pMod, CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuKernelGetFunction' in found_functions}} - cdef CUresult _cuKernelGetFunction(CUfunction* pFunc, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuKernelGetLibrary' in found_functions}} - cdef CUresult _cuKernelGetLibrary(CUlibrary* pLib, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLibraryGetGlobal' in found_functions}} - -cdef CUresult _cuLibraryGetGlobal(CUdeviceptr* dptr, size_t* numbytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLibraryGetManaged' in found_functions}} - -cdef CUresult _cuLibraryGetManaged(CUdeviceptr* dptr, size_t* numbytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLibraryGetUnifiedFunction' in found_functions}} - +cdef CUresult _cuLibraryGetGlobal(CUdeviceptr* dptr, size_t* bytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLibraryGetManaged(CUdeviceptr* dptr, size_t* bytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult _cuLibraryGetUnifiedFunction(void** fptr, CUlibrary library, const char* symbol) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuKernelGetAttribute' in found_functions}} - cdef CUresult _cuKernelGetAttribute(int* pi, CUfunction_attribute attrib, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuKernelSetAttribute' in found_functions}} - cdef CUresult _cuKernelSetAttribute(CUfunction_attribute attrib, int val, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuKernelSetCacheConfig' in found_functions}} - cdef CUresult _cuKernelSetCacheConfig(CUkernel kernel, CUfunc_cache config, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuKernelGetName' in found_functions}} - cdef CUresult _cuKernelGetName(const char** name, CUkernel hfunc) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuKernelGetParamInfo' in found_functions}} - cdef CUresult _cuKernelGetParamInfo(CUkernel kernel, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuKernelGetParamCount' in found_functions}} - -cdef CUresult _cuKernelGetParamCount(CUkernel kernel, size_t* paramCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemGetInfo_v2' in found_functions}} - cdef CUresult _cuMemGetInfo_v2(size_t* free, size_t* total) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemAlloc_v2' in found_functions}} - cdef CUresult _cuMemAlloc_v2(CUdeviceptr* dptr, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemAllocPitch_v2' in found_functions}} - cdef CUresult _cuMemAllocPitch_v2(CUdeviceptr* dptr, size_t* pPitch, size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemFree_v2' in found_functions}} - cdef CUresult _cuMemFree_v2(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemGetAddressRange_v2' in found_functions}} - cdef CUresult _cuMemGetAddressRange_v2(CUdeviceptr* pbase, size_t* psize, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemAllocHost_v2' in found_functions}} - cdef CUresult _cuMemAllocHost_v2(void** pp, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemFreeHost' in found_functions}} - cdef CUresult _cuMemFreeHost(void* p) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemHostAlloc' in found_functions}} - cdef CUresult _cuMemHostAlloc(void** pp, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemHostGetDevicePointer_v2' in found_functions}} - cdef CUresult _cuMemHostGetDevicePointer_v2(CUdeviceptr* pdptr, void* p, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemHostGetFlags' in found_functions}} - cdef CUresult _cuMemHostGetFlags(unsigned int* pFlags, void* p) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemAllocManaged' in found_functions}} - cdef CUresult _cuMemAllocManaged(CUdeviceptr* dptr, size_t bytesize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceRegisterAsyncNotification' in found_functions}} - cdef CUresult _cuDeviceRegisterAsyncNotification(CUdevice device, CUasyncCallback callbackFunc, void* userData, CUasyncCallbackHandle* callback) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceUnregisterAsyncNotification' in found_functions}} - cdef CUresult _cuDeviceUnregisterAsyncNotification(CUdevice device, CUasyncCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetByPCIBusId' in found_functions}} - cdef CUresult _cuDeviceGetByPCIBusId(CUdevice* dev, const char* pciBusId) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetPCIBusId' in found_functions}} - -cdef CUresult _cuDeviceGetPCIBusId(char* pciBusId, int length, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuIpcGetEventHandle' in found_functions}} - +cdef CUresult _cuDeviceGetPCIBusId(char* pciBusId, int len, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult _cuIpcGetEventHandle(CUipcEventHandle* pHandle, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuIpcOpenEventHandle' in found_functions}} - cdef CUresult _cuIpcOpenEventHandle(CUevent* phEvent, CUipcEventHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuIpcGetMemHandle' in found_functions}} - cdef CUresult _cuIpcGetMemHandle(CUipcMemHandle* pHandle, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuIpcOpenMemHandle_v2' in found_functions}} - cdef CUresult _cuIpcOpenMemHandle_v2(CUdeviceptr* pdptr, CUipcMemHandle handle, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuIpcCloseMemHandle' in found_functions}} - cdef CUresult _cuIpcCloseMemHandle(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemHostRegister_v2' in found_functions}} - cdef CUresult _cuMemHostRegister_v2(void* p, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemHostUnregister' in found_functions}} - cdef CUresult _cuMemHostUnregister(void* p) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpy' in found_functions}} - cdef CUresult _cuMemcpy(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyPeer' in found_functions}} - cdef CUresult _cuMemcpyPeer(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyHtoD_v2' in found_functions}} - cdef CUresult _cuMemcpyHtoD_v2(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyDtoH_v2' in found_functions}} - cdef CUresult _cuMemcpyDtoH_v2(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyDtoD_v2' in found_functions}} - cdef CUresult _cuMemcpyDtoD_v2(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyDtoA_v2' in found_functions}} - cdef CUresult _cuMemcpyDtoA_v2(CUarray dstArray, size_t dstOffset, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyAtoD_v2' in found_functions}} - cdef CUresult _cuMemcpyAtoD_v2(CUdeviceptr dstDevice, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyHtoA_v2' in found_functions}} - cdef CUresult _cuMemcpyHtoA_v2(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyAtoH_v2' in found_functions}} - cdef CUresult _cuMemcpyAtoH_v2(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyAtoA_v2' in found_functions}} - cdef CUresult _cuMemcpyAtoA_v2(CUarray dstArray, size_t dstOffset, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpy2D_v2' in found_functions}} - cdef CUresult _cuMemcpy2D_v2(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpy2DUnaligned_v2' in found_functions}} - cdef CUresult _cuMemcpy2DUnaligned_v2(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpy3D_v2' in found_functions}} - cdef CUresult _cuMemcpy3D_v2(const CUDA_MEMCPY3D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpy3DPeer' in found_functions}} - cdef CUresult _cuMemcpy3DPeer(const CUDA_MEMCPY3D_PEER* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyAsync' in found_functions}} - cdef CUresult _cuMemcpyAsync(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyPeerAsync' in found_functions}} - cdef CUresult _cuMemcpyPeerAsync(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyHtoDAsync_v2' in found_functions}} - cdef CUresult _cuMemcpyHtoDAsync_v2(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyDtoHAsync_v2' in found_functions}} - cdef CUresult _cuMemcpyDtoHAsync_v2(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyDtoDAsync_v2' in found_functions}} - cdef CUresult _cuMemcpyDtoDAsync_v2(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyHtoAAsync_v2' in found_functions}} - cdef CUresult _cuMemcpyHtoAAsync_v2(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyAtoHAsync_v2' in found_functions}} - cdef CUresult _cuMemcpyAtoHAsync_v2(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpy2DAsync_v2' in found_functions}} - cdef CUresult _cuMemcpy2DAsync_v2(const CUDA_MEMCPY2D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpy3DAsync_v2' in found_functions}} - cdef CUresult _cuMemcpy3DAsync_v2(const CUDA_MEMCPY3D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpy3DPeerAsync' in found_functions}} - cdef CUresult _cuMemcpy3DPeerAsync(const CUDA_MEMCPY3D_PEER* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyBatchAsync_v2' in found_functions}} - -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_v2' in found_functions}} - -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 'cuMemcpyWithAttributesAsync' in found_functions}} - -cdef CUresult _cuMemcpyWithAttributesAsync(CUdeviceptr dst, CUdeviceptr src, size_t size, CUmemcpyAttributes* attr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpy3DWithAttributesAsync' in found_functions}} - -cdef CUresult _cuMemcpy3DWithAttributesAsync(CUDA_MEMCPY3D_BATCH_OP* op, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemsetD8_v2' in found_functions}} - cdef CUresult _cuMemsetD8_v2(CUdeviceptr dstDevice, unsigned char uc, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemsetD16_v2' in found_functions}} - cdef CUresult _cuMemsetD16_v2(CUdeviceptr dstDevice, unsigned short us, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemsetD32_v2' in found_functions}} - cdef CUresult _cuMemsetD32_v2(CUdeviceptr dstDevice, unsigned int ui, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemsetD2D8_v2' in found_functions}} - cdef CUresult _cuMemsetD2D8_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemsetD2D16_v2' in found_functions}} - cdef CUresult _cuMemsetD2D16_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemsetD2D32_v2' in found_functions}} - cdef CUresult _cuMemsetD2D32_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemsetD8Async' in found_functions}} - cdef CUresult _cuMemsetD8Async(CUdeviceptr dstDevice, unsigned char uc, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemsetD16Async' in found_functions}} - cdef CUresult _cuMemsetD16Async(CUdeviceptr dstDevice, unsigned short us, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemsetD32Async' in found_functions}} - cdef CUresult _cuMemsetD32Async(CUdeviceptr dstDevice, unsigned int ui, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemsetD2D8Async' in found_functions}} - cdef CUresult _cuMemsetD2D8Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemsetD2D16Async' in found_functions}} - cdef CUresult _cuMemsetD2D16Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemsetD2D32Async' in found_functions}} - cdef CUresult _cuMemsetD2D32Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuArrayCreate_v2' in found_functions}} - cdef CUresult _cuArrayCreate_v2(CUarray* pHandle, const CUDA_ARRAY_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuArrayGetDescriptor_v2' in found_functions}} - cdef CUresult _cuArrayGetDescriptor_v2(CUDA_ARRAY_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuArrayGetSparseProperties' in found_functions}} - cdef CUresult _cuArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUarray array) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMipmappedArrayGetSparseProperties' in found_functions}} - cdef CUresult _cuMipmappedArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUmipmappedArray mipmap) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuArrayGetMemoryRequirements' in found_functions}} - cdef CUresult _cuArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUarray array, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}} - cdef CUresult _cuMipmappedArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUmipmappedArray mipmap, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuArrayGetPlane' in found_functions}} - cdef CUresult _cuArrayGetPlane(CUarray* pPlaneArray, CUarray hArray, unsigned int planeIdx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuArrayDestroy' in found_functions}} - cdef CUresult _cuArrayDestroy(CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuArray3DCreate_v2' in found_functions}} - cdef CUresult _cuArray3DCreate_v2(CUarray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuArray3DGetDescriptor_v2' in found_functions}} - cdef CUresult _cuArray3DGetDescriptor_v2(CUDA_ARRAY3D_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMipmappedArrayCreate' in found_functions}} - cdef CUresult _cuMipmappedArrayCreate(CUmipmappedArray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pMipmappedArrayDesc, unsigned int numMipmapLevels) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMipmappedArrayGetLevel' in found_functions}} - cdef CUresult _cuMipmappedArrayGetLevel(CUarray* pLevelArray, CUmipmappedArray hMipmappedArray, unsigned int level) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMipmappedArrayDestroy' in found_functions}} - cdef CUresult _cuMipmappedArrayDestroy(CUmipmappedArray hMipmappedArray) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemGetHandleForAddressRange' in found_functions}} - cdef CUresult _cuMemGetHandleForAddressRange(void* handle, CUdeviceptr dptr, size_t size, CUmemRangeHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemBatchDecompressAsync' in found_functions}} - cdef CUresult _cuMemBatchDecompressAsync(CUmemDecompressParams* paramsArray, size_t count, unsigned int flags, size_t* errorIndex, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemAddressReserve' in found_functions}} - cdef CUresult _cuMemAddressReserve(CUdeviceptr* ptr, size_t size, size_t alignment, CUdeviceptr addr, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemAddressFree' in found_functions}} - cdef CUresult _cuMemAddressFree(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemCreate' in found_functions}} - cdef CUresult _cuMemCreate(CUmemGenericAllocationHandle* handle, size_t size, const CUmemAllocationProp* prop, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemRelease' in found_functions}} - cdef CUresult _cuMemRelease(CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemMap' in found_functions}} - cdef CUresult _cuMemMap(CUdeviceptr ptr, size_t size, size_t offset, CUmemGenericAllocationHandle handle, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemMapArrayAsync' in found_functions}} - cdef CUresult _cuMemMapArrayAsync(CUarrayMapInfo* mapInfoList, unsigned int count, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemUnmap' in found_functions}} - cdef CUresult _cuMemUnmap(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemSetAccess' in found_functions}} - cdef CUresult _cuMemSetAccess(CUdeviceptr ptr, size_t size, const CUmemAccessDesc* desc, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemGetAccess' in found_functions}} - cdef CUresult _cuMemGetAccess(unsigned long long* flags, const CUmemLocation* location, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemExportToShareableHandle' in found_functions}} - cdef CUresult _cuMemExportToShareableHandle(void* shareableHandle, CUmemGenericAllocationHandle handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemImportFromShareableHandle' in found_functions}} - cdef CUresult _cuMemImportFromShareableHandle(CUmemGenericAllocationHandle* handle, void* osHandle, CUmemAllocationHandleType shHandleType) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemGetAllocationGranularity' in found_functions}} - cdef CUresult _cuMemGetAllocationGranularity(size_t* granularity, const CUmemAllocationProp* prop, CUmemAllocationGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}} - cdef CUresult _cuMemGetAllocationPropertiesFromHandle(CUmemAllocationProp* prop, CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemRetainAllocationHandle' in found_functions}} - cdef CUresult _cuMemRetainAllocationHandle(CUmemGenericAllocationHandle* handle, void* addr) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemFreeAsync' in found_functions}} - cdef CUresult _cuMemFreeAsync(CUdeviceptr dptr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemAllocAsync' in found_functions}} - cdef CUresult _cuMemAllocAsync(CUdeviceptr* dptr, size_t bytesize, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemPoolTrimTo' in found_functions}} - cdef CUresult _cuMemPoolTrimTo(CUmemoryPool pool, size_t minBytesToKeep) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemPoolSetAttribute' in found_functions}} - cdef CUresult _cuMemPoolSetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemPoolGetAttribute' in found_functions}} - cdef CUresult _cuMemPoolGetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemPoolSetAccess' in found_functions}} - cdef CUresult _cuMemPoolSetAccess(CUmemoryPool pool, const CUmemAccessDesc* map, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemPoolGetAccess' in found_functions}} - cdef CUresult _cuMemPoolGetAccess(CUmemAccess_flags* flags, CUmemoryPool memPool, CUmemLocation* location) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemPoolCreate' in found_functions}} - cdef CUresult _cuMemPoolCreate(CUmemoryPool* pool, const CUmemPoolProps* poolProps) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemPoolDestroy' in found_functions}} - 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 -{{endif}} - -{{if 'cuMemPoolExportToShareableHandle' in found_functions}} - cdef CUresult _cuMemPoolExportToShareableHandle(void* handle_out, CUmemoryPool pool, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemPoolImportFromShareableHandle' in found_functions}} - cdef CUresult _cuMemPoolImportFromShareableHandle(CUmemoryPool* pool_out, void* handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemPoolExportPointer' in found_functions}} - cdef CUresult _cuMemPoolExportPointer(CUmemPoolPtrExportData* shareData_out, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemPoolImportPointer' in found_functions}} - cdef CUresult _cuMemPoolImportPointer(CUdeviceptr* ptr_out, CUmemoryPool pool, CUmemPoolPtrExportData* shareData) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMulticastCreate' in found_functions}} - cdef CUresult _cuMulticastCreate(CUmemGenericAllocationHandle* mcHandle, const CUmulticastObjectProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMulticastAddDevice' in found_functions}} - cdef CUresult _cuMulticastAddDevice(CUmemGenericAllocationHandle mcHandle, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMulticastBindMem' in found_functions}} - cdef CUresult _cuMulticastBindMem(CUmemGenericAllocationHandle mcHandle, size_t mcOffset, CUmemGenericAllocationHandle memHandle, size_t memOffset, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMulticastBindMem_v2' in found_functions}} - -cdef CUresult _cuMulticastBindMem_v2(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, CUmemGenericAllocationHandle memHandle, size_t memOffset, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMulticastBindAddr' in found_functions}} - cdef CUresult _cuMulticastBindAddr(CUmemGenericAllocationHandle mcHandle, size_t mcOffset, CUdeviceptr memptr, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMulticastBindAddr_v2' in found_functions}} - -cdef CUresult _cuMulticastBindAddr_v2(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, CUdeviceptr memptr, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMulticastUnbind' in found_functions}} - cdef CUresult _cuMulticastUnbind(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMulticastGetGranularity' in found_functions}} - cdef CUresult _cuMulticastGetGranularity(size_t* granularity, const CUmulticastObjectProp* prop, CUmulticastGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuPointerGetAttribute' in found_functions}} - cdef CUresult _cuPointerGetAttribute(void* data, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil -{{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 -{{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 -{{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 -{{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 -{{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}} - cdef CUresult _cuMemRangeGetAttribute(void* data, size_t dataSize, CUmem_range_attribute attribute, CUdeviceptr devPtr, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemRangeGetAttributes' in found_functions}} - cdef CUresult _cuMemRangeGetAttributes(void** data, size_t* dataSizes, CUmem_range_attribute* attributes, size_t numAttributes, CUdeviceptr devPtr, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuPointerSetAttribute' in found_functions}} - cdef CUresult _cuPointerSetAttribute(const void* value, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuPointerGetAttributes' in found_functions}} - cdef CUresult _cuPointerGetAttributes(unsigned int numAttributes, CUpointer_attribute* attributes, void** data, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamCreate' in found_functions}} - cdef CUresult _cuStreamCreate(CUstream* phStream, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamCreateWithPriority' in found_functions}} - cdef CUresult _cuStreamCreateWithPriority(CUstream* phStream, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamBeginCaptureToCig' in found_functions}} - -cdef CUresult _cuStreamBeginCaptureToCig(CUstream hStream, CUstreamCigCaptureParams* streamCigCaptureParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamEndCaptureToCig' in found_functions}} - -cdef CUresult _cuStreamEndCaptureToCig(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamGetPriority' in found_functions}} - cdef CUresult _cuStreamGetPriority(CUstream hStream, int* priority) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamGetDevice' in found_functions}} - cdef CUresult _cuStreamGetDevice(CUstream hStream, CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamGetFlags' in found_functions}} - cdef CUresult _cuStreamGetFlags(CUstream hStream, unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamGetId' in found_functions}} - cdef CUresult _cuStreamGetId(CUstream hStream, unsigned long long* streamId) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamGetCtx' in found_functions}} - cdef CUresult _cuStreamGetCtx(CUstream hStream, CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamGetCtx_v2' in found_functions}} - cdef CUresult _cuStreamGetCtx_v2(CUstream hStream, CUcontext* pCtx, CUgreenCtx* pGreenCtx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamWaitEvent' in found_functions}} - cdef CUresult _cuStreamWaitEvent(CUstream hStream, CUevent hEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamAddCallback' in found_functions}} - cdef CUresult _cuStreamAddCallback(CUstream hStream, CUstreamCallback callback, void* userData, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamBeginCapture_v2' in found_functions}} - cdef CUresult _cuStreamBeginCapture_v2(CUstream hStream, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamBeginCaptureToGraph' in found_functions}} - cdef CUresult _cuStreamBeginCaptureToGraph(CUstream hStream, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuThreadExchangeStreamCaptureMode' in found_functions}} - cdef CUresult _cuThreadExchangeStreamCaptureMode(CUstreamCaptureMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamEndCapture' in found_functions}} - cdef CUresult _cuStreamEndCapture(CUstream hStream, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamIsCapturing' in found_functions}} - cdef CUresult _cuStreamIsCapturing(CUstream hStream, CUstreamCaptureStatus* captureStatus) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamGetCaptureInfo_v3' 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 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_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 -{{endif}} - -{{if 'cuStreamAttachMemAsync' in found_functions}} - cdef CUresult _cuStreamAttachMemAsync(CUstream hStream, CUdeviceptr dptr, size_t length, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamQuery' in found_functions}} - cdef CUresult _cuStreamQuery(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamSynchronize' in found_functions}} - cdef CUresult _cuStreamSynchronize(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamDestroy_v2' in found_functions}} - cdef CUresult _cuStreamDestroy_v2(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamCopyAttributes' in found_functions}} - cdef CUresult _cuStreamCopyAttributes(CUstream dst, CUstream src) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamGetAttribute' in found_functions}} - cdef CUresult _cuStreamGetAttribute(CUstream hStream, CUstreamAttrID attr, CUstreamAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamSetAttribute' in found_functions}} - cdef CUresult _cuStreamSetAttribute(CUstream hStream, CUstreamAttrID attr, const CUstreamAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuEventCreate' in found_functions}} - cdef CUresult _cuEventCreate(CUevent* phEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuEventRecord' in found_functions}} - cdef CUresult _cuEventRecord(CUevent hEvent, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuEventRecordWithFlags' in found_functions}} - cdef CUresult _cuEventRecordWithFlags(CUevent hEvent, CUstream hStream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuEventQuery' in found_functions}} - cdef CUresult _cuEventQuery(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuEventSynchronize' in found_functions}} - cdef CUresult _cuEventSynchronize(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuEventDestroy_v2' in found_functions}} - cdef CUresult _cuEventDestroy_v2(CUevent hEvent) 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 -{{endif}} - -{{if 'cuImportExternalMemory' in found_functions}} - cdef CUresult _cuImportExternalMemory(CUexternalMemory* extMem_out, const CUDA_EXTERNAL_MEMORY_HANDLE_DESC* memHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuExternalMemoryGetMappedBuffer' in found_functions}} - cdef CUresult _cuExternalMemoryGetMappedBuffer(CUdeviceptr* devPtr, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_BUFFER_DESC* bufferDesc) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}} - cdef CUresult _cuExternalMemoryGetMappedMipmappedArray(CUmipmappedArray* mipmap, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC* mipmapDesc) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDestroyExternalMemory' in found_functions}} - cdef CUresult _cuDestroyExternalMemory(CUexternalMemory extMem) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuImportExternalSemaphore' in found_functions}} - cdef CUresult _cuImportExternalSemaphore(CUexternalSemaphore* extSem_out, const CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC* semHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuSignalExternalSemaphoresAsync' in found_functions}} - cdef CUresult _cuSignalExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuWaitExternalSemaphoresAsync' in found_functions}} - cdef CUresult _cuWaitExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDestroyExternalSemaphore' in found_functions}} - cdef CUresult _cuDestroyExternalSemaphore(CUexternalSemaphore extSem) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamWaitValue32_v2' in found_functions}} - cdef CUresult _cuStreamWaitValue32_v2(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamWaitValue64_v2' in found_functions}} - cdef CUresult _cuStreamWaitValue64_v2(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamWriteValue32_v2' in found_functions}} - cdef CUresult _cuStreamWriteValue32_v2(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamWriteValue64_v2' in found_functions}} - cdef CUresult _cuStreamWriteValue64_v2(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamBatchMemOp_v2' in found_functions}} - cdef CUresult _cuStreamBatchMemOp_v2(CUstream stream, unsigned int count, CUstreamBatchMemOpParams* paramArray, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFuncGetAttribute' in found_functions}} - cdef CUresult _cuFuncGetAttribute(int* pi, CUfunction_attribute attrib, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFuncSetAttribute' in found_functions}} - cdef CUresult _cuFuncSetAttribute(CUfunction hfunc, CUfunction_attribute attrib, int value) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFuncSetCacheConfig' in found_functions}} - cdef CUresult _cuFuncSetCacheConfig(CUfunction hfunc, CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFuncGetModule' in found_functions}} - cdef CUresult _cuFuncGetModule(CUmodule* hmod, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFuncGetName' in found_functions}} - cdef CUresult _cuFuncGetName(const char** name, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFuncGetParamInfo' in found_functions}} - cdef CUresult _cuFuncGetParamInfo(CUfunction func, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFuncGetParamCount' in found_functions}} - -cdef CUresult _cuFuncGetParamCount(CUfunction func, size_t* paramCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFuncIsLoaded' in found_functions}} - cdef CUresult _cuFuncIsLoaded(CUfunctionLoadingState* state, CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFuncLoad' in found_functions}} - cdef CUresult _cuFuncLoad(CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLaunchKernel' in found_functions}} - cdef CUresult _cuLaunchKernel(CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, CUstream hStream, void** kernelParams, void** extra) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLaunchKernelEx' in found_functions}} - cdef CUresult _cuLaunchKernelEx(const CUlaunchConfig* config, CUfunction f, void** kernelParams, void** extra) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLaunchCooperativeKernel' in found_functions}} - cdef CUresult _cuLaunchCooperativeKernel(CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, CUstream hStream, void** kernelParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}} - cdef CUresult _cuLaunchCooperativeKernelMultiDevice(CUDA_LAUNCH_PARAMS* launchParamsList, unsigned int numDevices, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLaunchHostFunc' in found_functions}} - cdef CUresult _cuLaunchHostFunc(CUstream hStream, CUhostFn fn, void* userData) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLaunchHostFunc_v2' in found_functions}} - -cdef CUresult _cuLaunchHostFunc_v2(CUstream hStream, CUhostFn fn, void* userData, unsigned int syncMode) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFuncSetBlockShape' in found_functions}} - cdef CUresult _cuFuncSetBlockShape(CUfunction hfunc, int x, int y, int z) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFuncSetSharedSize' in found_functions}} - -cdef CUresult _cuFuncSetSharedSize(CUfunction hfunc, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuParamSetSize' in found_functions}} - +cdef CUresult _cuFuncSetSharedSize(CUfunction hfunc, unsigned int bytes) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult _cuParamSetSize(CUfunction hfunc, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuParamSeti' in found_functions}} - cdef CUresult _cuParamSeti(CUfunction hfunc, int offset, unsigned int value) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuParamSetf' in found_functions}} - cdef CUresult _cuParamSetf(CUfunction hfunc, int offset, float value) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuParamSetv' in found_functions}} - cdef CUresult _cuParamSetv(CUfunction hfunc, int offset, void* ptr, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLaunch' in found_functions}} - cdef CUresult _cuLaunch(CUfunction f) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLaunchGrid' in found_functions}} - cdef CUresult _cuLaunchGrid(CUfunction f, int grid_width, int grid_height) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLaunchGridAsync' in found_functions}} - cdef CUresult _cuLaunchGridAsync(CUfunction f, int grid_width, int grid_height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuParamSetTexRef' in found_functions}} - cdef CUresult _cuParamSetTexRef(CUfunction hfunc, int texunit, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFuncSetSharedMemConfig' in found_functions}} - cdef CUresult _cuFuncSetSharedMemConfig(CUfunction hfunc, CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphCreate' in found_functions}} - cdef CUresult _cuGraphCreate(CUgraph* phGraph, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddKernelNode_v2' in found_functions}} - cdef CUresult _cuGraphAddKernelNode_v2(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphKernelNodeGetParams_v2' in found_functions}} - cdef CUresult _cuGraphKernelNodeGetParams_v2(CUgraphNode hNode, CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphKernelNodeSetParams_v2' in found_functions}} - cdef CUresult _cuGraphKernelNodeSetParams_v2(CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddMemcpyNode' in found_functions}} - cdef CUresult _cuGraphAddMemcpyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_MEMCPY3D* copyParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphMemcpyNodeGetParams' in found_functions}} - cdef CUresult _cuGraphMemcpyNodeGetParams(CUgraphNode hNode, CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphMemcpyNodeSetParams' in found_functions}} - cdef CUresult _cuGraphMemcpyNodeSetParams(CUgraphNode hNode, const CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddMemsetNode' in found_functions}} - cdef CUresult _cuGraphAddMemsetNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_MEMSET_NODE_PARAMS* memsetParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphMemsetNodeGetParams' in found_functions}} - cdef CUresult _cuGraphMemsetNodeGetParams(CUgraphNode hNode, CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphMemsetNodeSetParams' in found_functions}} - cdef CUresult _cuGraphMemsetNodeSetParams(CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddHostNode' in found_functions}} - cdef CUresult _cuGraphAddHostNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphHostNodeGetParams' in found_functions}} - cdef CUresult _cuGraphHostNodeGetParams(CUgraphNode hNode, CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphHostNodeSetParams' in found_functions}} - cdef CUresult _cuGraphHostNodeSetParams(CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddChildGraphNode' in found_functions}} - cdef CUresult _cuGraphAddChildGraphNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphChildGraphNodeGetGraph' in found_functions}} - cdef CUresult _cuGraphChildGraphNodeGetGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddEmptyNode' in found_functions}} - cdef CUresult _cuGraphAddEmptyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddEventRecordNode' in found_functions}} - cdef CUresult _cuGraphAddEventRecordNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphEventRecordNodeGetEvent' in found_functions}} - cdef CUresult _cuGraphEventRecordNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphEventRecordNodeSetEvent' in found_functions}} - cdef CUresult _cuGraphEventRecordNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddEventWaitNode' in found_functions}} - cdef CUresult _cuGraphAddEventWaitNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphEventWaitNodeGetEvent' in found_functions}} - cdef CUresult _cuGraphEventWaitNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphEventWaitNodeSetEvent' in found_functions}} - cdef CUresult _cuGraphEventWaitNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}} - cdef CUresult _cuGraphAddExternalSemaphoresSignalNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} - cdef CUresult _cuGraphExternalSemaphoresSignalNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} - cdef CUresult _cuGraphExternalSemaphoresSignalNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}} - cdef CUresult _cuGraphAddExternalSemaphoresWaitNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} - cdef CUresult _cuGraphExternalSemaphoresWaitNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_WAIT_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} - cdef CUresult _cuGraphExternalSemaphoresWaitNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddBatchMemOpNode' in found_functions}} - cdef CUresult _cuGraphAddBatchMemOpNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}} - cdef CUresult _cuGraphBatchMemOpNodeGetParams(CUgraphNode hNode, CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams_out) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}} - cdef CUresult _cuGraphBatchMemOpNodeSetParams(CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}} - cdef CUresult _cuGraphExecBatchMemOpNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddMemAllocNode' in found_functions}} - cdef CUresult _cuGraphAddMemAllocNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUDA_MEM_ALLOC_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphMemAllocNodeGetParams' in found_functions}} - cdef CUresult _cuGraphMemAllocNodeGetParams(CUgraphNode hNode, CUDA_MEM_ALLOC_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddMemFreeNode' in found_functions}} - cdef CUresult _cuGraphAddMemFreeNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphMemFreeNodeGetParams' in found_functions}} - cdef CUresult _cuGraphMemFreeNodeGetParams(CUgraphNode hNode, CUdeviceptr* dptr_out) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGraphMemTrim' in found_functions}} - cdef CUresult _cuDeviceGraphMemTrim(CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetGraphMemAttribute' in found_functions}} - cdef CUresult _cuDeviceGetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceSetGraphMemAttribute' in found_functions}} - cdef CUresult _cuDeviceSetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphClone' in found_functions}} - cdef CUresult _cuGraphClone(CUgraph* phGraphClone, CUgraph originalGraph) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphNodeFindInClone' in found_functions}} - cdef CUresult _cuGraphNodeFindInClone(CUgraphNode* phNode, CUgraphNode hOriginalNode, CUgraph hClonedGraph) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphNodeGetType' in found_functions}} - -cdef CUresult _cuGraphNodeGetType(CUgraphNode hNode, CUgraphNodeType* typename) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphNodeGetContainingGraph' in found_functions}} - -cdef CUresult _cuGraphNodeGetContainingGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphNodeGetLocalId' in found_functions}} - -cdef CUresult _cuGraphNodeGetLocalId(CUgraphNode hNode, unsigned int* nodeId) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphNodeGetToolsId' in found_functions}} - -cdef CUresult _cuGraphNodeGetToolsId(CUgraphNode hNode, unsigned long long* toolsNodeId) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphGetId' in found_functions}} - -cdef CUresult _cuGraphGetId(CUgraph hGraph, unsigned int* graphId) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecGetId' in found_functions}} - -cdef CUresult _cuGraphExecGetId(CUgraphExec hGraphExec, unsigned int* graphId) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphGetNodes' in found_functions}} - +cdef CUresult _cuGraphNodeGetType(CUgraphNode hNode, CUgraphNodeType* type) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult _cuGraphGetNodes(CUgraph hGraph, CUgraphNode* nodes, size_t* numNodes) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphGetRootNodes' in found_functions}} - cdef CUresult _cuGraphGetRootNodes(CUgraph hGraph, CUgraphNode* rootNodes, size_t* numRootNodes) 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_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_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_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_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 -{{endif}} - -{{if 'cuGraphDestroyNode' in found_functions}} - cdef CUresult _cuGraphDestroyNode(CUgraphNode hNode) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphInstantiateWithFlags' in found_functions}} - cdef CUresult _cuGraphInstantiateWithFlags(CUgraphExec* phGraphExec, CUgraph hGraph, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphInstantiateWithParams' in found_functions}} - cdef CUresult _cuGraphInstantiateWithParams(CUgraphExec* phGraphExec, CUgraph hGraph, CUDA_GRAPH_INSTANTIATE_PARAMS* instantiateParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecGetFlags' in found_functions}} - cdef CUresult _cuGraphExecGetFlags(CUgraphExec hGraphExec, cuuint64_t* flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}} - cdef CUresult _cuGraphExecKernelNodeSetParams_v2(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}} - cdef CUresult _cuGraphExecMemcpyNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMCPY3D* copyParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecMemsetNodeSetParams' in found_functions}} - cdef CUresult _cuGraphExecMemsetNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* memsetParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecHostNodeSetParams' in found_functions}} - cdef CUresult _cuGraphExecHostNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}} - cdef CUresult _cuGraphExecChildGraphNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}} - cdef CUresult _cuGraphExecEventRecordNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}} - cdef CUresult _cuGraphExecEventWaitNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} - cdef CUresult _cuGraphExecExternalSemaphoresSignalNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} - cdef CUresult _cuGraphExecExternalSemaphoresWaitNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphNodeSetEnabled' in found_functions}} - cdef CUresult _cuGraphNodeSetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphNodeGetEnabled' in found_functions}} - cdef CUresult _cuGraphNodeGetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int* isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphUpload' in found_functions}} - cdef CUresult _cuGraphUpload(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphLaunch' in found_functions}} - cdef CUresult _cuGraphLaunch(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecDestroy' in found_functions}} - cdef CUresult _cuGraphExecDestroy(CUgraphExec hGraphExec) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphDestroy' in found_functions}} - cdef CUresult _cuGraphDestroy(CUgraph hGraph) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecUpdate_v2' in found_functions}} - cdef CUresult _cuGraphExecUpdate_v2(CUgraphExec hGraphExec, CUgraph hGraph, CUgraphExecUpdateResultInfo* resultInfo) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphKernelNodeCopyAttributes' in found_functions}} - cdef CUresult _cuGraphKernelNodeCopyAttributes(CUgraphNode dst, CUgraphNode src) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphKernelNodeGetAttribute' in found_functions}} - cdef CUresult _cuGraphKernelNodeGetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, CUkernelNodeAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphKernelNodeSetAttribute' in found_functions}} - cdef CUresult _cuGraphKernelNodeSetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, const CUkernelNodeAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphDebugDotPrint' in found_functions}} - cdef CUresult _cuGraphDebugDotPrint(CUgraph hGraph, const char* path, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuUserObjectCreate' in found_functions}} - cdef CUresult _cuUserObjectCreate(CUuserObject* object_out, void* ptr, CUhostFn destroy, unsigned int initialRefcount, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuUserObjectRetain' in found_functions}} - cdef CUresult _cuUserObjectRetain(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuUserObjectRelease' in found_functions}} - cdef CUresult _cuUserObjectRelease(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphRetainUserObject' in found_functions}} - cdef CUresult _cuGraphRetainUserObject(CUgraph graph, CUuserObject object, unsigned int count, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphReleaseUserObject' in found_functions}} - cdef CUresult _cuGraphReleaseUserObject(CUgraph graph, CUuserObject object, unsigned int count) 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 -{{endif}} - -{{if 'cuGraphNodeSetParams' in found_functions}} - cdef CUresult _cuGraphNodeSetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphNodeGetParams' in found_functions}} - -cdef CUresult _cuGraphNodeGetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecNodeSetParams' in found_functions}} - cdef CUresult _cuGraphExecNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphConditionalHandleCreate' in found_functions}} - cdef CUresult _cuGraphConditionalHandleCreate(CUgraphConditionalHandle* pHandle_out, CUgraph hGraph, CUcontext ctx, unsigned int defaultLaunchValue, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} - cdef CUresult _cuOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} - cdef CUresult _cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}} - cdef CUresult _cuOccupancyMaxPotentialBlockSize(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}} - cdef CUresult _cuOccupancyMaxPotentialBlockSizeWithFlags(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}} - cdef CUresult _cuOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, CUfunction func, int numBlocks, int blockSize) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}} - cdef CUresult _cuOccupancyMaxPotentialClusterSize(int* clusterSize, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuOccupancyMaxActiveClusters' in found_functions}} - cdef CUresult _cuOccupancyMaxActiveClusters(int* numClusters, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetArray' in found_functions}} - cdef CUresult _cuTexRefSetArray(CUtexref hTexRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetMipmappedArray' in found_functions}} - cdef CUresult _cuTexRefSetMipmappedArray(CUtexref hTexRef, CUmipmappedArray hMipmappedArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetAddress_v2' in found_functions}} - -cdef CUresult _cuTexRefSetAddress_v2(size_t* ByteOffset, CUtexref hTexRef, CUdeviceptr dptr, size_t numbytes) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetAddress2D_v3' in found_functions}} - +cdef CUresult _cuTexRefSetAddress_v2(size_t* ByteOffset, CUtexref hTexRef, CUdeviceptr dptr, size_t bytes) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult _cuTexRefSetAddress2D_v3(CUtexref hTexRef, const CUDA_ARRAY_DESCRIPTOR* desc, CUdeviceptr dptr, size_t Pitch) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetFormat' in found_functions}} - cdef CUresult _cuTexRefSetFormat(CUtexref hTexRef, CUarray_format fmt, int NumPackedComponents) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetAddressMode' in found_functions}} - cdef CUresult _cuTexRefSetAddressMode(CUtexref hTexRef, int dim, CUaddress_mode am) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetFilterMode' in found_functions}} - cdef CUresult _cuTexRefSetFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetMipmapFilterMode' in found_functions}} - cdef CUresult _cuTexRefSetMipmapFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetMipmapLevelBias' in found_functions}} - cdef CUresult _cuTexRefSetMipmapLevelBias(CUtexref hTexRef, float bias) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetMipmapLevelClamp' in found_functions}} - cdef CUresult _cuTexRefSetMipmapLevelClamp(CUtexref hTexRef, float minMipmapLevelClamp, float maxMipmapLevelClamp) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetMaxAnisotropy' in found_functions}} - cdef CUresult _cuTexRefSetMaxAnisotropy(CUtexref hTexRef, unsigned int maxAniso) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetBorderColor' in found_functions}} - cdef CUresult _cuTexRefSetBorderColor(CUtexref hTexRef, float* pBorderColor) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetFlags' in found_functions}} - cdef CUresult _cuTexRefSetFlags(CUtexref hTexRef, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefGetAddress_v2' in found_functions}} - cdef CUresult _cuTexRefGetAddress_v2(CUdeviceptr* pdptr, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefGetArray' in found_functions}} - cdef CUresult _cuTexRefGetArray(CUarray* phArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefGetMipmappedArray' in found_functions}} - cdef CUresult _cuTexRefGetMipmappedArray(CUmipmappedArray* phMipmappedArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefGetAddressMode' in found_functions}} - cdef CUresult _cuTexRefGetAddressMode(CUaddress_mode* pam, CUtexref hTexRef, int dim) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefGetFilterMode' in found_functions}} - cdef CUresult _cuTexRefGetFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefGetFormat' in found_functions}} - cdef CUresult _cuTexRefGetFormat(CUarray_format* pFormat, int* pNumChannels, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefGetMipmapFilterMode' in found_functions}} - cdef CUresult _cuTexRefGetMipmapFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefGetMipmapLevelBias' in found_functions}} - cdef CUresult _cuTexRefGetMipmapLevelBias(float* pbias, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefGetMipmapLevelClamp' in found_functions}} - cdef CUresult _cuTexRefGetMipmapLevelClamp(float* pminMipmapLevelClamp, float* pmaxMipmapLevelClamp, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefGetMaxAnisotropy' in found_functions}} - cdef CUresult _cuTexRefGetMaxAnisotropy(int* pmaxAniso, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefGetBorderColor' in found_functions}} - cdef CUresult _cuTexRefGetBorderColor(float* pBorderColor, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefGetFlags' in found_functions}} - cdef CUresult _cuTexRefGetFlags(unsigned int* pFlags, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefCreate' in found_functions}} - cdef CUresult _cuTexRefCreate(CUtexref* pTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefDestroy' in found_functions}} - cdef CUresult _cuTexRefDestroy(CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuSurfRefSetArray' in found_functions}} - cdef CUresult _cuSurfRefSetArray(CUsurfref hSurfRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuSurfRefGetArray' in found_functions}} - cdef CUresult _cuSurfRefGetArray(CUarray* phArray, CUsurfref hSurfRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexObjectCreate' in found_functions}} - cdef CUresult _cuTexObjectCreate(CUtexObject* pTexObject, const CUDA_RESOURCE_DESC* pResDesc, const CUDA_TEXTURE_DESC* pTexDesc, const CUDA_RESOURCE_VIEW_DESC* pResViewDesc) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexObjectDestroy' in found_functions}} - cdef CUresult _cuTexObjectDestroy(CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexObjectGetResourceDesc' in found_functions}} - cdef CUresult _cuTexObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexObjectGetTextureDesc' in found_functions}} - cdef CUresult _cuTexObjectGetTextureDesc(CUDA_TEXTURE_DESC* pTexDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexObjectGetResourceViewDesc' in found_functions}} - cdef CUresult _cuTexObjectGetResourceViewDesc(CUDA_RESOURCE_VIEW_DESC* pResViewDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuSurfObjectCreate' in found_functions}} - cdef CUresult _cuSurfObjectCreate(CUsurfObject* pSurfObject, const CUDA_RESOURCE_DESC* pResDesc) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuSurfObjectDestroy' in found_functions}} - cdef CUresult _cuSurfObjectDestroy(CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuSurfObjectGetResourceDesc' in found_functions}} - cdef CUresult _cuSurfObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTensorMapEncodeTiled' in found_functions}} - cdef CUresult _cuTensorMapEncodeTiled(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, const cuuint32_t* boxDim, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTensorMapEncodeIm2col' in found_functions}} - cdef CUresult _cuTensorMapEncodeIm2col(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, const int* pixelBoxLowerCorner, const int* pixelBoxUpperCorner, cuuint32_t channelsPerPixel, cuuint32_t pixelsPerColumn, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTensorMapEncodeIm2colWide' in found_functions}} - cdef CUresult _cuTensorMapEncodeIm2colWide(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, int pixelBoxLowerCornerWidth, int pixelBoxUpperCornerWidth, cuuint32_t channelsPerPixel, cuuint32_t pixelsPerColumn, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapIm2ColWideMode mode, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTensorMapReplaceAddress' in found_functions}} - cdef CUresult _cuTensorMapReplaceAddress(CUtensorMap* tensorMap, void* globalAddress) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceCanAccessPeer' in found_functions}} - cdef CUresult _cuDeviceCanAccessPeer(int* canAccessPeer, CUdevice dev, CUdevice peerDev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxEnablePeerAccess' in found_functions}} - cdef CUresult _cuCtxEnablePeerAccess(CUcontext peerContext, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxDisablePeerAccess' in found_functions}} - cdef CUresult _cuCtxDisablePeerAccess(CUcontext peerContext) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetP2PAttribute' in found_functions}} - 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 -{{endif}} - -{{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}} - cdef CUresult _cuGraphicsSubResourceGetMappedArray(CUarray* pArray, CUgraphicsResource resource, unsigned int arrayIndex, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}} - cdef CUresult _cuGraphicsResourceGetMappedMipmappedArray(CUmipmappedArray* pMipmappedArray, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}} - cdef CUresult _cuGraphicsResourceGetMappedPointer_v2(CUdeviceptr* pDevPtr, size_t* pSize, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}} - cdef CUresult _cuGraphicsResourceSetMapFlags_v2(CUgraphicsResource resource, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphicsMapResources' in found_functions}} - cdef CUresult _cuGraphicsMapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphicsUnmapResources' in found_functions}} - cdef CUresult _cuGraphicsUnmapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGetProcAddress_v2' in found_functions}} - cdef CUresult _cuGetProcAddress_v2(const char* symbol, void** pfn, int cudaVersion, cuuint64_t flags, CUdriverProcAddressQueryResult* symbolStatus) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCoredumpGetAttribute' in found_functions}} - cdef CUresult _cuCoredumpGetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCoredumpGetAttributeGlobal' in found_functions}} - cdef CUresult _cuCoredumpGetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCoredumpSetAttribute' in found_functions}} - cdef CUresult _cuCoredumpSetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCoredumpSetAttributeGlobal' in found_functions}} - cdef CUresult _cuCoredumpSetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCoredumpRegisterStartCallback' in found_functions}} - -cdef CUresult _cuCoredumpRegisterStartCallback(CUcoredumpStatusCallback callback, void* userData, CUcoredumpCallbackHandle* callbackOut) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCoredumpRegisterCompleteCallback' in found_functions}} - -cdef CUresult _cuCoredumpRegisterCompleteCallback(CUcoredumpStatusCallback callback, void* userData, CUcoredumpCallbackHandle* callbackOut) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCoredumpDeregisterStartCallback' in found_functions}} - -cdef CUresult _cuCoredumpDeregisterStartCallback(CUcoredumpCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCoredumpDeregisterCompleteCallback' in found_functions}} - -cdef CUresult _cuCoredumpDeregisterCompleteCallback(CUcoredumpCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGetExportTable' in found_functions}} - cdef CUresult _cuGetExportTable(const void** ppExportTable, const CUuuid* pExportTableId) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGreenCtxCreate' in found_functions}} - cdef CUresult _cuGreenCtxCreate(CUgreenCtx* phCtx, CUdevResourceDesc desc, CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGreenCtxDestroy' in found_functions}} - cdef CUresult _cuGreenCtxDestroy(CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxFromGreenCtx' in found_functions}} - cdef CUresult _cuCtxFromGreenCtx(CUcontext* pContext, CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetDevResource' in found_functions}} - -cdef CUresult _cuDeviceGetDevResource(CUdevice device, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxGetDevResource' in found_functions}} - -cdef CUresult _cuCtxGetDevResource(CUcontext hCtx, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGreenCtxGetDevResource' in found_functions}} - -cdef CUresult _cuGreenCtxGetDevResource(CUgreenCtx hCtx, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDevSmResourceSplitByCount' in found_functions}} - +cdef CUresult _cuDeviceGetDevResource(CUdevice device, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxGetDevResource(CUcontext hCtx, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGreenCtxGetDevResource(CUgreenCtx hCtx, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult _cuDevSmResourceSplitByCount(CUdevResource* result, unsigned int* nbGroups, const CUdevResource* input, CUdevResource* remainder, unsigned int flags, unsigned int minCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDevSmResourceSplit' in found_functions}} - -cdef CUresult _cuDevSmResourceSplit(CUdevResource* result, unsigned int nbGroups, const CUdevResource* input, CUdevResource* remainder, unsigned int flags, CU_DEV_SM_RESOURCE_GROUP_PARAMS* groupParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDevResourceGenerateDesc' in found_functions}} - cdef CUresult _cuDevResourceGenerateDesc(CUdevResourceDesc* phDesc, CUdevResource* resources, unsigned int nbResources) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGreenCtxRecordEvent' in found_functions}} - cdef CUresult _cuGreenCtxRecordEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGreenCtxWaitEvent' in found_functions}} - cdef CUresult _cuGreenCtxWaitEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamGetGreenCtx' in found_functions}} - cdef CUresult _cuStreamGetGreenCtx(CUstream hStream, CUgreenCtx* phCtx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGreenCtxStreamCreate' in found_functions}} - 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 'cuStreamGetDevResource' in found_functions}} - -cdef CUresult _cuStreamGetDevResource(CUstream hStream, CUdevResource* resource, CUdevResourceType typename) 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 -{{endif}} - -{{if 'cuLogsUnregisterCallback' in found_functions}} - cdef CUresult _cuLogsUnregisterCallback(CUlogsCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLogsCurrent' in found_functions}} - cdef CUresult _cuLogsCurrent(CUlogIterator* iterator_out, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLogsDumpToFile' in found_functions}} - cdef CUresult _cuLogsDumpToFile(CUlogIterator* iterator, const char* pathToFile, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLogsDumpToMemory' in found_functions}} - cdef CUresult _cuLogsDumpToMemory(CUlogIterator* iterator, char* buffer, size_t* size, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}} - cdef CUresult _cuCheckpointProcessGetRestoreThreadId(int pid, int* tid) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCheckpointProcessGetState' in found_functions}} - cdef CUresult _cuCheckpointProcessGetState(int pid, CUprocessState* state) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCheckpointProcessLock' in found_functions}} - cdef CUresult _cuCheckpointProcessLock(int pid, CUcheckpointLockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCheckpointProcessCheckpoint' in found_functions}} - 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 -{{endif}} - -{{if 'cuProfilerStart' in found_functions}} - -cdef CUresult _cuProfilerStart() except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuProfilerStop' in found_functions}} - -cdef CUresult _cuProfilerStop() except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult _cuGraphicsEGLRegisterImage(CUgraphicsResource* pCudaResource, EGLImageKHR image, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult _cuEGLStreamConsumerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult _cuEGLStreamConsumerConnectWithFlags(CUeglStreamConnection* conn, EGLStreamKHR stream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult _cuEGLStreamConsumerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult _cuEGLStreamConsumerAcquireFrame(CUeglStreamConnection* conn, CUgraphicsResource* pCudaResource, CUstream* pStream, unsigned int timeout) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult _cuEGLStreamConsumerReleaseFrame(CUeglStreamConnection* conn, CUgraphicsResource pCudaResource, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult _cuEGLStreamProducerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream, EGLint width, EGLint height) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult _cuEGLStreamProducerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult _cuEGLStreamProducerPresentFrame(CUeglStreamConnection* conn, CUeglFrame eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult _cuEGLStreamProducerReturnFrame(CUeglStreamConnection* conn, CUeglFrame* eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult _cuGraphicsResourceGetMappedEglFrame(CUeglFrame* eglFrame, CUgraphicsResource resource, unsigned int index, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult _cuEventCreateFromEGLSync(CUevent* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult _cuGraphicsGLRegisterBuffer(CUgraphicsResource* pCudaResource, GLuint buffer, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult _cuGraphicsGLRegisterImage(CUgraphicsResource* pCudaResource, GLuint image, GLenum target, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult _cuGLGetDevices_v2(unsigned int* pCudaDeviceCount, CUdevice* pCudaDevices, unsigned int cudaDeviceCount, CUGLDeviceList deviceList) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - +cdef CUresult _cuGLCtxCreate_v2(CUcontext* pCtx, unsigned int Flags, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGLInit() except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGLRegisterBufferObject(GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGLMapBufferObject_v2(CUdeviceptr* dptr, size_t* size, GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGLUnmapBufferObject(GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGLUnregisterBufferObject(GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGLSetBufferObjectMapFlags(GLuint buffer, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGLMapBufferObjectAsync_v2(CUdeviceptr* dptr, size_t* size, GLuint buffer, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGLUnmapBufferObjectAsync(GLuint buffer, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuProfilerInitialize(const char* configFile, const char* outputFile, CUoutput_mode outputMode) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuProfilerStart() except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuProfilerStop() except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult _cuVDPAUGetDevice(CUdevice* pDevice, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult _cuVDPAUCtxCreate_v2(CUcontext* pCtx, unsigned int flags, CUdevice device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult _cuGraphicsVDPAURegisterVideoSurface(CUgraphicsResource* pCudaResource, VdpVideoSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult _cuGraphicsVDPAURegisterOutputSurface(CUgraphicsResource* pCudaResource, VdpOutputSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - +cdef CUresult _cuDeviceGetHostAtomicCapabilities(unsigned int* capabilities, const CUatomicOperation* operations, unsigned int count, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxGetDevice_v2(CUdevice* device, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCtxSynchronize_v2(CUcontext ctx) 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 +cdef CUresult _cuMemcpy3DBatchAsync_v2(size_t numOps, CUDA_MEMCPY3D_BATCH_OP* opList, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemGetDefaultMemPool(CUmemoryPool* pool_out, CUmemLocation* location, CUmemAllocationType type) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemGetMemPool(CUmemoryPool* pool, CUmemLocation* location, CUmemAllocationType type) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemSetMemPool(CUmemLocation* location, CUmemAllocationType type, CUmemoryPool pool) 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 +cdef CUresult _cuMemDiscardBatchAsync(CUdeviceptr* dptrs, size_t* sizes, size_t count, unsigned long long flags, CUstream hStream) 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 +cdef CUresult _cuDeviceGetP2PAtomicCapabilities(unsigned int* capabilities, const CUatomicOperation* operations, unsigned int count, CUdevice srcDevice, CUdevice dstDevice) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGreenCtxGetId(CUgreenCtx greenCtx, unsigned long long* greenCtxId) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMulticastBindMem_v2(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, CUmemGenericAllocationHandle memHandle, size_t memOffset, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMulticastBindAddr_v2(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, CUdeviceptr memptr, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphNodeGetContainingGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphNodeGetLocalId(CUgraphNode hNode, unsigned int* nodeId) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphNodeGetToolsId(CUgraphNode hNode, unsigned long long* toolsNodeId) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphGetId(CUgraph hGraph, unsigned int* graphId) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphExecGetId(CUgraphExec hGraphExec, unsigned int* graphId) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDevSmResourceSplit(CUdevResource* result, unsigned int nbGroups, const CUdevResource* input, CUdevResource* remainder, unsigned int flags, CU_DEV_SM_RESOURCE_GROUP_PARAMS* groupParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamGetDevResource(CUstream hStream, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuKernelGetParamCount(CUkernel kernel, size_t* paramCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpyWithAttributesAsync(CUdeviceptr dst, CUdeviceptr src, size_t size, CUmemcpyAttributes* attr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemcpy3DWithAttributesAsync(CUDA_MEMCPY3D_BATCH_OP* op, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamBeginCaptureToCig(CUstream hStream, CUstreamCigCaptureParams* streamCigCaptureParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamEndCaptureToCig(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuFuncGetParamCount(CUfunction func, size_t* paramCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLaunchHostFunc_v2(CUstream hStream, CUhostFn fn, void* userData, unsigned int syncMode) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphNodeGetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCoredumpRegisterStartCallback(CUcoredumpStatusCallback callback, void* userData, CUcoredumpCallbackHandle* callbackOut) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCoredumpRegisterCompleteCallback(CUcoredumpStatusCallback callback, void* userData, CUcoredumpCallbackHandle* callbackOut) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCoredumpDeregisterStartCallback(CUcoredumpCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCoredumpDeregisterCompleteCallback(CUcoredumpCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLogicalEndpointIdReserve(CUlogicalEndpointId* baseLeId, cuuint32_t count) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLogicalEndpointIdRelease(CUlogicalEndpointId baseLeId, cuuint32_t count) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLogicalEndpointCreate(CUlogicalEndpointId leId, const CUlogicalEndpointProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLogicalEndpointAddDevice(CUlogicalEndpointId leId, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLogicalEndpointDestroy(CUlogicalEndpointId leId) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLogicalEndpointBindAddr(CUlogicalEndpointId leId, CUdevice dev, cuuint64_t offset, void* ptr, cuuint64_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLogicalEndpointBindMem(CUlogicalEndpointId leId, CUdevice dev, cuuint64_t offset, CUmemGenericAllocationHandle memHandle, cuuint64_t memOffset, cuuint64_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLogicalEndpointUnbind(CUlogicalEndpointId leId, CUdevice dev, cuuint64_t offset, cuuint64_t size) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLogicalEndpointExport(void* handle, CUlogicalEndpointId leId, CUlogicalEndpointIpcHandleType handleType) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLogicalEndpointImport(CUlogicalEndpointId leId, const void* handle, CUlogicalEndpointIpcHandleType handleType) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLogicalEndpointGetLimits(cuuint64_t* bindAlignment, cuuint64_t* maxSize, const CUlogicalEndpointProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuLogicalEndpointQuery(CUlogicalEndpointId leId, cuuint32_t count, int* queryStatus) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuStreamBeginRecaptureToGraph(CUstream hStream, CUstreamCaptureMode mode, CUgraph hGraph, CUgraphRecaptureCallback callbackFunc, void* userData) except ?CUDA_ERROR_NOT_FOUND nogil diff --git a/cuda_bindings/cuda/bindings/_internal/driver_linux.pyx b/cuda_bindings/cuda/bindings/_internal/driver_linux.pyx new file mode 100644 index 00000000000..59a0dbc0b32 --- /dev/null +++ b/cuda_bindings/cuda/bindings/_internal/driver_linux.pyx @@ -0,0 +1,8926 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. + +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=5707b0fec0518992a2e1a55400a030c3921e5443dc65094af083b8845b41b0e5 +from libc.stdint cimport intptr_t, uintptr_t + +import os +import threading +from .utils import FunctionNotFoundError, NotSupportedError + +from cuda.pathfinder import load_nvidia_dynamic_lib + + +############################################################################### +# Extern +############################################################################### + +# You must 'from .utils import NotSupportedError' before using this template + +cdef extern from "" nogil: + void* dlopen(const char*, int) + char* dlerror() + void* dlsym(void*, const char*) + int dlclose(void*) + + enum: + RTLD_LAZY + RTLD_NOW + RTLD_GLOBAL + RTLD_LOCAL + + 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('Did not find cuDriverGetVersion symbol in libcuda.so.1') + err = (cuDriverGetVersion)(&driver_ver) + if err != 0: + raise RuntimeError(f'cuDriverGetVersion returned error code {err}') + + return driver_ver + + + +############################################################################### +# Wrapper init +############################################################################### + +cdef object __symbol_lock = threading.Lock() +cdef bint __py_driver_init = False + +cdef void* __cuGetErrorString = NULL +cdef void* __cuGetErrorName = NULL +cdef void* __cuInit = NULL +cdef void* __cuDriverGetVersion = NULL +cdef void* __cuDeviceGet = NULL +cdef void* __cuDeviceGetCount = NULL +cdef void* __cuDeviceGetName = NULL +cdef void* __cuDeviceGetUuid_v2 = NULL +cdef void* __cuDeviceGetLuid = NULL +cdef void* __cuDeviceTotalMem_v2 = NULL +cdef void* __cuDeviceGetTexture1DLinearMaxWidth = NULL +cdef void* __cuDeviceGetAttribute = NULL +cdef void* __cuDeviceGetNvSciSyncAttributes = NULL +cdef void* __cuDeviceSetMemPool = NULL +cdef void* __cuDeviceGetMemPool = NULL +cdef void* __cuDeviceGetDefaultMemPool = NULL +cdef void* __cuDeviceGetExecAffinitySupport = NULL +cdef void* __cuFlushGPUDirectRDMAWrites = NULL +cdef void* __cuDeviceGetProperties = NULL +cdef void* __cuDeviceComputeCapability = NULL +cdef void* __cuDevicePrimaryCtxRetain = NULL +cdef void* __cuDevicePrimaryCtxRelease_v2 = NULL +cdef void* __cuDevicePrimaryCtxSetFlags_v2 = NULL +cdef void* __cuDevicePrimaryCtxGetState = NULL +cdef void* __cuDevicePrimaryCtxReset_v2 = NULL +cdef void* __cuCtxCreate_v2 = NULL +cdef void* __cuCtxCreate_v3 = NULL +cdef void* __cuCtxCreate_v4 = NULL +cdef void* __cuCtxDestroy_v2 = NULL +cdef void* __cuCtxPushCurrent_v2 = NULL +cdef void* __cuCtxPopCurrent_v2 = NULL +cdef void* __cuCtxSetCurrent = NULL +cdef void* __cuCtxGetCurrent = NULL +cdef void* __cuCtxGetDevice = NULL +cdef void* __cuCtxGetFlags = NULL +cdef void* __cuCtxSetFlags = NULL +cdef void* __cuCtxGetId = NULL +cdef void* __cuCtxSynchronize = NULL +cdef void* __cuCtxSetLimit = NULL +cdef void* __cuCtxGetLimit = NULL +cdef void* __cuCtxGetCacheConfig = NULL +cdef void* __cuCtxSetCacheConfig = NULL +cdef void* __cuCtxGetApiVersion = NULL +cdef void* __cuCtxGetStreamPriorityRange = NULL +cdef void* __cuCtxResetPersistingL2Cache = NULL +cdef void* __cuCtxGetExecAffinity = NULL +cdef void* __cuCtxRecordEvent = NULL +cdef void* __cuCtxWaitEvent = NULL +cdef void* __cuCtxAttach = NULL +cdef void* __cuCtxDetach = NULL +cdef void* __cuCtxGetSharedMemConfig = NULL +cdef void* __cuCtxSetSharedMemConfig = NULL +cdef void* __cuModuleLoad = NULL +cdef void* __cuModuleLoadData = NULL +cdef void* __cuModuleLoadDataEx = NULL +cdef void* __cuModuleLoadFatBinary = NULL +cdef void* __cuModuleUnload = NULL +cdef void* __cuModuleGetLoadingMode = NULL +cdef void* __cuModuleGetFunction = NULL +cdef void* __cuModuleGetFunctionCount = NULL +cdef void* __cuModuleEnumerateFunctions = NULL +cdef void* __cuModuleGetGlobal_v2 = NULL +cdef void* __cuLinkCreate_v2 = NULL +cdef void* __cuLinkAddData_v2 = NULL +cdef void* __cuLinkAddFile_v2 = NULL +cdef void* __cuLinkComplete = NULL +cdef void* __cuLinkDestroy = NULL +cdef void* __cuModuleGetTexRef = NULL +cdef void* __cuModuleGetSurfRef = NULL +cdef void* __cuLibraryLoadData = NULL +cdef void* __cuLibraryLoadFromFile = NULL +cdef void* __cuLibraryUnload = NULL +cdef void* __cuLibraryGetKernel = NULL +cdef void* __cuLibraryGetKernelCount = NULL +cdef void* __cuLibraryEnumerateKernels = NULL +cdef void* __cuLibraryGetModule = NULL +cdef void* __cuKernelGetFunction = NULL +cdef void* __cuKernelGetLibrary = NULL +cdef void* __cuLibraryGetGlobal = NULL +cdef void* __cuLibraryGetManaged = NULL +cdef void* __cuLibraryGetUnifiedFunction = NULL +cdef void* __cuKernelGetAttribute = NULL +cdef void* __cuKernelSetAttribute = NULL +cdef void* __cuKernelSetCacheConfig = NULL +cdef void* __cuKernelGetName = NULL +cdef void* __cuKernelGetParamInfo = NULL +cdef void* __cuMemGetInfo_v2 = NULL +cdef void* __cuMemAlloc_v2 = NULL +cdef void* __cuMemAllocPitch_v2 = NULL +cdef void* __cuMemFree_v2 = NULL +cdef void* __cuMemGetAddressRange_v2 = NULL +cdef void* __cuMemAllocHost_v2 = NULL +cdef void* __cuMemFreeHost = NULL +cdef void* __cuMemHostAlloc = NULL +cdef void* __cuMemHostGetDevicePointer_v2 = NULL +cdef void* __cuMemHostGetFlags = NULL +cdef void* __cuMemAllocManaged = NULL +cdef void* __cuDeviceRegisterAsyncNotification = NULL +cdef void* __cuDeviceUnregisterAsyncNotification = NULL +cdef void* __cuDeviceGetByPCIBusId = NULL +cdef void* __cuDeviceGetPCIBusId = NULL +cdef void* __cuIpcGetEventHandle = NULL +cdef void* __cuIpcOpenEventHandle = NULL +cdef void* __cuIpcGetMemHandle = NULL +cdef void* __cuIpcOpenMemHandle_v2 = NULL +cdef void* __cuIpcCloseMemHandle = NULL +cdef void* __cuMemHostRegister_v2 = NULL +cdef void* __cuMemHostUnregister = NULL +cdef void* __cuMemcpy = NULL +cdef void* __cuMemcpyPeer = NULL +cdef void* __cuMemcpyHtoD_v2 = NULL +cdef void* __cuMemcpyDtoH_v2 = NULL +cdef void* __cuMemcpyDtoD_v2 = NULL +cdef void* __cuMemcpyDtoA_v2 = NULL +cdef void* __cuMemcpyAtoD_v2 = NULL +cdef void* __cuMemcpyHtoA_v2 = NULL +cdef void* __cuMemcpyAtoH_v2 = NULL +cdef void* __cuMemcpyAtoA_v2 = NULL +cdef void* __cuMemcpy2D_v2 = NULL +cdef void* __cuMemcpy2DUnaligned_v2 = NULL +cdef void* __cuMemcpy3D_v2 = NULL +cdef void* __cuMemcpy3DPeer = NULL +cdef void* __cuMemcpyAsync = NULL +cdef void* __cuMemcpyPeerAsync = NULL +cdef void* __cuMemcpyHtoDAsync_v2 = NULL +cdef void* __cuMemcpyDtoHAsync_v2 = NULL +cdef void* __cuMemcpyDtoDAsync_v2 = NULL +cdef void* __cuMemcpyHtoAAsync_v2 = NULL +cdef void* __cuMemcpyAtoHAsync_v2 = NULL +cdef void* __cuMemcpy2DAsync_v2 = NULL +cdef void* __cuMemcpy3DAsync_v2 = NULL +cdef void* __cuMemcpy3DPeerAsync = NULL +cdef void* __cuMemsetD8_v2 = NULL +cdef void* __cuMemsetD16_v2 = NULL +cdef void* __cuMemsetD32_v2 = NULL +cdef void* __cuMemsetD2D8_v2 = NULL +cdef void* __cuMemsetD2D16_v2 = NULL +cdef void* __cuMemsetD2D32_v2 = NULL +cdef void* __cuMemsetD8Async = NULL +cdef void* __cuMemsetD16Async = NULL +cdef void* __cuMemsetD32Async = NULL +cdef void* __cuMemsetD2D8Async = NULL +cdef void* __cuMemsetD2D16Async = NULL +cdef void* __cuMemsetD2D32Async = NULL +cdef void* __cuArrayCreate_v2 = NULL +cdef void* __cuArrayGetDescriptor_v2 = NULL +cdef void* __cuArrayGetSparseProperties = NULL +cdef void* __cuMipmappedArrayGetSparseProperties = NULL +cdef void* __cuArrayGetMemoryRequirements = NULL +cdef void* __cuMipmappedArrayGetMemoryRequirements = NULL +cdef void* __cuArrayGetPlane = NULL +cdef void* __cuArrayDestroy = NULL +cdef void* __cuArray3DCreate_v2 = NULL +cdef void* __cuArray3DGetDescriptor_v2 = NULL +cdef void* __cuMipmappedArrayCreate = NULL +cdef void* __cuMipmappedArrayGetLevel = NULL +cdef void* __cuMipmappedArrayDestroy = NULL +cdef void* __cuMemGetHandleForAddressRange = NULL +cdef void* __cuMemBatchDecompressAsync = NULL +cdef void* __cuMemAddressReserve = NULL +cdef void* __cuMemAddressFree = NULL +cdef void* __cuMemCreate = NULL +cdef void* __cuMemRelease = NULL +cdef void* __cuMemMap = NULL +cdef void* __cuMemMapArrayAsync = NULL +cdef void* __cuMemUnmap = NULL +cdef void* __cuMemSetAccess = NULL +cdef void* __cuMemGetAccess = NULL +cdef void* __cuMemExportToShareableHandle = NULL +cdef void* __cuMemImportFromShareableHandle = NULL +cdef void* __cuMemGetAllocationGranularity = NULL +cdef void* __cuMemGetAllocationPropertiesFromHandle = NULL +cdef void* __cuMemRetainAllocationHandle = NULL +cdef void* __cuMemFreeAsync = NULL +cdef void* __cuMemAllocAsync = NULL +cdef void* __cuMemPoolTrimTo = NULL +cdef void* __cuMemPoolSetAttribute = NULL +cdef void* __cuMemPoolGetAttribute = NULL +cdef void* __cuMemPoolSetAccess = NULL +cdef void* __cuMemPoolGetAccess = NULL +cdef void* __cuMemPoolCreate = NULL +cdef void* __cuMemPoolDestroy = NULL +cdef void* __cuMemAllocFromPoolAsync = NULL +cdef void* __cuMemPoolExportToShareableHandle = NULL +cdef void* __cuMemPoolImportFromShareableHandle = NULL +cdef void* __cuMemPoolExportPointer = NULL +cdef void* __cuMemPoolImportPointer = NULL +cdef void* __cuMulticastCreate = NULL +cdef void* __cuMulticastAddDevice = NULL +cdef void* __cuMulticastBindMem = NULL +cdef void* __cuMulticastBindAddr = NULL +cdef void* __cuMulticastUnbind = NULL +cdef void* __cuMulticastGetGranularity = NULL +cdef void* __cuPointerGetAttribute = NULL +cdef void* __cuMemPrefetchAsync_v2 = NULL +cdef void* __cuMemAdvise_v2 = NULL +cdef void* __cuMemRangeGetAttribute = NULL +cdef void* __cuMemRangeGetAttributes = NULL +cdef void* __cuPointerSetAttribute = NULL +cdef void* __cuPointerGetAttributes = NULL +cdef void* __cuStreamCreate = NULL +cdef void* __cuStreamCreateWithPriority = NULL +cdef void* __cuStreamGetPriority = NULL +cdef void* __cuStreamGetDevice = NULL +cdef void* __cuStreamGetFlags = NULL +cdef void* __cuStreamGetId = NULL +cdef void* __cuStreamGetCtx = NULL +cdef void* __cuStreamGetCtx_v2 = NULL +cdef void* __cuStreamWaitEvent = NULL +cdef void* __cuStreamAddCallback = NULL +cdef void* __cuStreamBeginCapture_v2 = NULL +cdef void* __cuStreamBeginCaptureToGraph = NULL +cdef void* __cuThreadExchangeStreamCaptureMode = NULL +cdef void* __cuStreamEndCapture = NULL +cdef void* __cuStreamIsCapturing = NULL +cdef void* __cuStreamGetCaptureInfo_v2 = NULL +cdef void* __cuStreamGetCaptureInfo_v3 = NULL +cdef void* __cuStreamUpdateCaptureDependencies_v2 = NULL +cdef void* __cuStreamAttachMemAsync = NULL +cdef void* __cuStreamQuery = NULL +cdef void* __cuStreamSynchronize = NULL +cdef void* __cuStreamDestroy_v2 = NULL +cdef void* __cuStreamCopyAttributes = NULL +cdef void* __cuStreamGetAttribute = NULL +cdef void* __cuStreamSetAttribute = NULL +cdef void* __cuEventCreate = NULL +cdef void* __cuEventRecord = NULL +cdef void* __cuEventRecordWithFlags = NULL +cdef void* __cuEventQuery = NULL +cdef void* __cuEventSynchronize = NULL +cdef void* __cuEventDestroy_v2 = NULL +cdef void* __cuEventElapsedTime_v2 = NULL +cdef void* __cuImportExternalMemory = NULL +cdef void* __cuExternalMemoryGetMappedBuffer = NULL +cdef void* __cuExternalMemoryGetMappedMipmappedArray = NULL +cdef void* __cuDestroyExternalMemory = NULL +cdef void* __cuImportExternalSemaphore = NULL +cdef void* __cuSignalExternalSemaphoresAsync = NULL +cdef void* __cuWaitExternalSemaphoresAsync = NULL +cdef void* __cuDestroyExternalSemaphore = NULL +cdef void* __cuStreamWaitValue32_v2 = NULL +cdef void* __cuStreamWaitValue64_v2 = NULL +cdef void* __cuStreamWriteValue32_v2 = NULL +cdef void* __cuStreamWriteValue64_v2 = NULL +cdef void* __cuStreamBatchMemOp_v2 = NULL +cdef void* __cuFuncGetAttribute = NULL +cdef void* __cuFuncSetAttribute = NULL +cdef void* __cuFuncSetCacheConfig = NULL +cdef void* __cuFuncGetModule = NULL +cdef void* __cuFuncGetName = NULL +cdef void* __cuFuncGetParamInfo = NULL +cdef void* __cuFuncIsLoaded = NULL +cdef void* __cuFuncLoad = NULL +cdef void* __cuLaunchKernel = NULL +cdef void* __cuLaunchKernelEx = NULL +cdef void* __cuLaunchCooperativeKernel = NULL +cdef void* __cuLaunchCooperativeKernelMultiDevice = NULL +cdef void* __cuLaunchHostFunc = NULL +cdef void* __cuFuncSetBlockShape = NULL +cdef void* __cuFuncSetSharedSize = NULL +cdef void* __cuParamSetSize = NULL +cdef void* __cuParamSeti = NULL +cdef void* __cuParamSetf = NULL +cdef void* __cuParamSetv = NULL +cdef void* __cuLaunch = NULL +cdef void* __cuLaunchGrid = NULL +cdef void* __cuLaunchGridAsync = NULL +cdef void* __cuParamSetTexRef = NULL +cdef void* __cuFuncSetSharedMemConfig = NULL +cdef void* __cuGraphCreate = NULL +cdef void* __cuGraphAddKernelNode_v2 = NULL +cdef void* __cuGraphKernelNodeGetParams_v2 = NULL +cdef void* __cuGraphKernelNodeSetParams_v2 = NULL +cdef void* __cuGraphAddMemcpyNode = NULL +cdef void* __cuGraphMemcpyNodeGetParams = NULL +cdef void* __cuGraphMemcpyNodeSetParams = NULL +cdef void* __cuGraphAddMemsetNode = NULL +cdef void* __cuGraphMemsetNodeGetParams = NULL +cdef void* __cuGraphMemsetNodeSetParams = NULL +cdef void* __cuGraphAddHostNode = NULL +cdef void* __cuGraphHostNodeGetParams = NULL +cdef void* __cuGraphHostNodeSetParams = NULL +cdef void* __cuGraphAddChildGraphNode = NULL +cdef void* __cuGraphChildGraphNodeGetGraph = NULL +cdef void* __cuGraphAddEmptyNode = NULL +cdef void* __cuGraphAddEventRecordNode = NULL +cdef void* __cuGraphEventRecordNodeGetEvent = NULL +cdef void* __cuGraphEventRecordNodeSetEvent = NULL +cdef void* __cuGraphAddEventWaitNode = NULL +cdef void* __cuGraphEventWaitNodeGetEvent = NULL +cdef void* __cuGraphEventWaitNodeSetEvent = NULL +cdef void* __cuGraphAddExternalSemaphoresSignalNode = NULL +cdef void* __cuGraphExternalSemaphoresSignalNodeGetParams = NULL +cdef void* __cuGraphExternalSemaphoresSignalNodeSetParams = NULL +cdef void* __cuGraphAddExternalSemaphoresWaitNode = NULL +cdef void* __cuGraphExternalSemaphoresWaitNodeGetParams = NULL +cdef void* __cuGraphExternalSemaphoresWaitNodeSetParams = NULL +cdef void* __cuGraphAddBatchMemOpNode = NULL +cdef void* __cuGraphBatchMemOpNodeGetParams = NULL +cdef void* __cuGraphBatchMemOpNodeSetParams = NULL +cdef void* __cuGraphExecBatchMemOpNodeSetParams = NULL +cdef void* __cuGraphAddMemAllocNode = NULL +cdef void* __cuGraphMemAllocNodeGetParams = NULL +cdef void* __cuGraphAddMemFreeNode = NULL +cdef void* __cuGraphMemFreeNodeGetParams = NULL +cdef void* __cuDeviceGraphMemTrim = NULL +cdef void* __cuDeviceGetGraphMemAttribute = NULL +cdef void* __cuDeviceSetGraphMemAttribute = NULL +cdef void* __cuGraphClone = NULL +cdef void* __cuGraphNodeFindInClone = NULL +cdef void* __cuGraphNodeGetType = NULL +cdef void* __cuGraphGetNodes = NULL +cdef void* __cuGraphGetRootNodes = NULL +cdef void* __cuGraphGetEdges_v2 = NULL +cdef void* __cuGraphNodeGetDependencies_v2 = NULL +cdef void* __cuGraphNodeGetDependentNodes_v2 = NULL +cdef void* __cuGraphAddDependencies_v2 = NULL +cdef void* __cuGraphRemoveDependencies_v2 = NULL +cdef void* __cuGraphDestroyNode = NULL +cdef void* __cuGraphInstantiateWithFlags = NULL +cdef void* __cuGraphInstantiateWithParams = NULL +cdef void* __cuGraphExecGetFlags = NULL +cdef void* __cuGraphExecKernelNodeSetParams_v2 = NULL +cdef void* __cuGraphExecMemcpyNodeSetParams = NULL +cdef void* __cuGraphExecMemsetNodeSetParams = NULL +cdef void* __cuGraphExecHostNodeSetParams = NULL +cdef void* __cuGraphExecChildGraphNodeSetParams = NULL +cdef void* __cuGraphExecEventRecordNodeSetEvent = NULL +cdef void* __cuGraphExecEventWaitNodeSetEvent = NULL +cdef void* __cuGraphExecExternalSemaphoresSignalNodeSetParams = NULL +cdef void* __cuGraphExecExternalSemaphoresWaitNodeSetParams = NULL +cdef void* __cuGraphNodeSetEnabled = NULL +cdef void* __cuGraphNodeGetEnabled = NULL +cdef void* __cuGraphUpload = NULL +cdef void* __cuGraphLaunch = NULL +cdef void* __cuGraphExecDestroy = NULL +cdef void* __cuGraphDestroy = NULL +cdef void* __cuGraphExecUpdate_v2 = NULL +cdef void* __cuGraphKernelNodeCopyAttributes = NULL +cdef void* __cuGraphKernelNodeGetAttribute = NULL +cdef void* __cuGraphKernelNodeSetAttribute = NULL +cdef void* __cuGraphDebugDotPrint = NULL +cdef void* __cuUserObjectCreate = NULL +cdef void* __cuUserObjectRetain = NULL +cdef void* __cuUserObjectRelease = NULL +cdef void* __cuGraphRetainUserObject = NULL +cdef void* __cuGraphReleaseUserObject = NULL +cdef void* __cuGraphAddNode_v2 = NULL +cdef void* __cuGraphNodeSetParams = NULL +cdef void* __cuGraphExecNodeSetParams = NULL +cdef void* __cuGraphConditionalHandleCreate = NULL +cdef void* __cuOccupancyMaxActiveBlocksPerMultiprocessor = NULL +cdef void* __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags = NULL +cdef void* __cuOccupancyMaxPotentialBlockSize = NULL +cdef void* __cuOccupancyMaxPotentialBlockSizeWithFlags = NULL +cdef void* __cuOccupancyAvailableDynamicSMemPerBlock = NULL +cdef void* __cuOccupancyMaxPotentialClusterSize = NULL +cdef void* __cuOccupancyMaxActiveClusters = NULL +cdef void* __cuTexRefSetArray = NULL +cdef void* __cuTexRefSetMipmappedArray = NULL +cdef void* __cuTexRefSetAddress_v2 = NULL +cdef void* __cuTexRefSetAddress2D_v3 = NULL +cdef void* __cuTexRefSetFormat = NULL +cdef void* __cuTexRefSetAddressMode = NULL +cdef void* __cuTexRefSetFilterMode = NULL +cdef void* __cuTexRefSetMipmapFilterMode = NULL +cdef void* __cuTexRefSetMipmapLevelBias = NULL +cdef void* __cuTexRefSetMipmapLevelClamp = NULL +cdef void* __cuTexRefSetMaxAnisotropy = NULL +cdef void* __cuTexRefSetBorderColor = NULL +cdef void* __cuTexRefSetFlags = NULL +cdef void* __cuTexRefGetAddress_v2 = NULL +cdef void* __cuTexRefGetArray = NULL +cdef void* __cuTexRefGetMipmappedArray = NULL +cdef void* __cuTexRefGetAddressMode = NULL +cdef void* __cuTexRefGetFilterMode = NULL +cdef void* __cuTexRefGetFormat = NULL +cdef void* __cuTexRefGetMipmapFilterMode = NULL +cdef void* __cuTexRefGetMipmapLevelBias = NULL +cdef void* __cuTexRefGetMipmapLevelClamp = NULL +cdef void* __cuTexRefGetMaxAnisotropy = NULL +cdef void* __cuTexRefGetBorderColor = NULL +cdef void* __cuTexRefGetFlags = NULL +cdef void* __cuTexRefCreate = NULL +cdef void* __cuTexRefDestroy = NULL +cdef void* __cuSurfRefSetArray = NULL +cdef void* __cuSurfRefGetArray = NULL +cdef void* __cuTexObjectCreate = NULL +cdef void* __cuTexObjectDestroy = NULL +cdef void* __cuTexObjectGetResourceDesc = NULL +cdef void* __cuTexObjectGetTextureDesc = NULL +cdef void* __cuTexObjectGetResourceViewDesc = NULL +cdef void* __cuSurfObjectCreate = NULL +cdef void* __cuSurfObjectDestroy = NULL +cdef void* __cuSurfObjectGetResourceDesc = NULL +cdef void* __cuTensorMapEncodeTiled = NULL +cdef void* __cuTensorMapEncodeIm2col = NULL +cdef void* __cuTensorMapEncodeIm2colWide = NULL +cdef void* __cuTensorMapReplaceAddress = NULL +cdef void* __cuDeviceCanAccessPeer = NULL +cdef void* __cuCtxEnablePeerAccess = NULL +cdef void* __cuCtxDisablePeerAccess = NULL +cdef void* __cuDeviceGetP2PAttribute = NULL +cdef void* __cuGraphicsUnregisterResource = NULL +cdef void* __cuGraphicsSubResourceGetMappedArray = NULL +cdef void* __cuGraphicsResourceGetMappedMipmappedArray = NULL +cdef void* __cuGraphicsResourceGetMappedPointer_v2 = NULL +cdef void* __cuGraphicsResourceSetMapFlags_v2 = NULL +cdef void* __cuGraphicsMapResources = NULL +cdef void* __cuGraphicsUnmapResources = NULL +cdef void* __cuGetProcAddress_v2 = NULL +cdef void* __cuCoredumpGetAttribute = NULL +cdef void* __cuCoredumpGetAttributeGlobal = NULL +cdef void* __cuCoredumpSetAttribute = NULL +cdef void* __cuCoredumpSetAttributeGlobal = NULL +cdef void* __cuGetExportTable = NULL +cdef void* __cuGreenCtxCreate = NULL +cdef void* __cuGreenCtxDestroy = NULL +cdef void* __cuCtxFromGreenCtx = NULL +cdef void* __cuDeviceGetDevResource = NULL +cdef void* __cuCtxGetDevResource = NULL +cdef void* __cuGreenCtxGetDevResource = NULL +cdef void* __cuDevSmResourceSplitByCount = NULL +cdef void* __cuDevResourceGenerateDesc = NULL +cdef void* __cuGreenCtxRecordEvent = NULL +cdef void* __cuGreenCtxWaitEvent = NULL +cdef void* __cuStreamGetGreenCtx = NULL +cdef void* __cuGreenCtxStreamCreate = NULL +cdef void* __cuLogsRegisterCallback = NULL +cdef void* __cuLogsUnregisterCallback = NULL +cdef void* __cuLogsCurrent = NULL +cdef void* __cuLogsDumpToFile = NULL +cdef void* __cuLogsDumpToMemory = NULL +cdef void* __cuCheckpointProcessGetRestoreThreadId = NULL +cdef void* __cuCheckpointProcessGetState = NULL +cdef void* __cuCheckpointProcessLock = NULL +cdef void* __cuCheckpointProcessCheckpoint = NULL +cdef void* __cuCheckpointProcessRestore = NULL +cdef void* __cuCheckpointProcessUnlock = NULL +cdef void* __cuGraphicsEGLRegisterImage = NULL +cdef void* __cuEGLStreamConsumerConnect = NULL +cdef void* __cuEGLStreamConsumerConnectWithFlags = NULL +cdef void* __cuEGLStreamConsumerDisconnect = NULL +cdef void* __cuEGLStreamConsumerAcquireFrame = NULL +cdef void* __cuEGLStreamConsumerReleaseFrame = NULL +cdef void* __cuEGLStreamProducerConnect = NULL +cdef void* __cuEGLStreamProducerDisconnect = NULL +cdef void* __cuEGLStreamProducerPresentFrame = NULL +cdef void* __cuEGLStreamProducerReturnFrame = NULL +cdef void* __cuGraphicsResourceGetMappedEglFrame = NULL +cdef void* __cuEventCreateFromEGLSync = NULL +cdef void* __cuGraphicsGLRegisterBuffer = NULL +cdef void* __cuGraphicsGLRegisterImage = NULL +cdef void* __cuGLGetDevices_v2 = NULL +cdef void* __cuGLCtxCreate_v2 = NULL +cdef void* __cuGLInit = NULL +cdef void* __cuGLRegisterBufferObject = NULL +cdef void* __cuGLMapBufferObject_v2 = NULL +cdef void* __cuGLUnmapBufferObject = NULL +cdef void* __cuGLUnregisterBufferObject = NULL +cdef void* __cuGLSetBufferObjectMapFlags = NULL +cdef void* __cuGLMapBufferObjectAsync_v2 = NULL +cdef void* __cuGLUnmapBufferObjectAsync = NULL +cdef void* __cuProfilerInitialize = NULL +cdef void* __cuProfilerStart = NULL +cdef void* __cuProfilerStop = NULL +cdef void* __cuVDPAUGetDevice = NULL +cdef void* __cuVDPAUCtxCreate_v2 = NULL +cdef void* __cuGraphicsVDPAURegisterVideoSurface = NULL +cdef void* __cuGraphicsVDPAURegisterOutputSurface = NULL +cdef void* __cuDeviceGetHostAtomicCapabilities = NULL +cdef void* __cuCtxGetDevice_v2 = NULL +cdef void* __cuCtxSynchronize_v2 = NULL +cdef void* __cuMemcpyBatchAsync_v2 = NULL +cdef void* __cuMemcpy3DBatchAsync_v2 = NULL +cdef void* __cuMemGetDefaultMemPool = NULL +cdef void* __cuMemGetMemPool = NULL +cdef void* __cuMemSetMemPool = NULL +cdef void* __cuMemPrefetchBatchAsync = NULL +cdef void* __cuMemDiscardBatchAsync = NULL +cdef void* __cuMemDiscardAndPrefetchBatchAsync = NULL +cdef void* __cuDeviceGetP2PAtomicCapabilities = NULL +cdef void* __cuGreenCtxGetId = NULL +cdef void* __cuMulticastBindMem_v2 = NULL +cdef void* __cuMulticastBindAddr_v2 = NULL +cdef void* __cuGraphNodeGetContainingGraph = NULL +cdef void* __cuGraphNodeGetLocalId = NULL +cdef void* __cuGraphNodeGetToolsId = NULL +cdef void* __cuGraphGetId = NULL +cdef void* __cuGraphExecGetId = NULL +cdef void* __cuDevSmResourceSplit = NULL +cdef void* __cuStreamGetDevResource = NULL +cdef void* __cuKernelGetParamCount = NULL +cdef void* __cuMemcpyWithAttributesAsync = NULL +cdef void* __cuMemcpy3DWithAttributesAsync = NULL +cdef void* __cuStreamBeginCaptureToCig = NULL +cdef void* __cuStreamEndCaptureToCig = NULL +cdef void* __cuFuncGetParamCount = NULL +cdef void* __cuLaunchHostFunc_v2 = NULL +cdef void* __cuGraphNodeGetParams = NULL +cdef void* __cuCoredumpRegisterStartCallback = NULL +cdef void* __cuCoredumpRegisterCompleteCallback = NULL +cdef void* __cuCoredumpDeregisterStartCallback = NULL +cdef void* __cuCoredumpDeregisterCompleteCallback = NULL +cdef void* __cuLogicalEndpointIdReserve = NULL +cdef void* __cuLogicalEndpointIdRelease = NULL +cdef void* __cuLogicalEndpointCreate = NULL +cdef void* __cuLogicalEndpointAddDevice = NULL +cdef void* __cuLogicalEndpointDestroy = NULL +cdef void* __cuLogicalEndpointBindAddr = NULL +cdef void* __cuLogicalEndpointBindMem = NULL +cdef void* __cuLogicalEndpointUnbind = NULL +cdef void* __cuLogicalEndpointExport = NULL +cdef void* __cuLogicalEndpointImport = NULL +cdef void* __cuLogicalEndpointGetLimits = NULL +cdef void* __cuLogicalEndpointQuery = NULL +cdef void* __cuStreamBeginRecaptureToGraph = NULL + + + +cdef void* load_library() except* with gil: + cdef uintptr_t handle = load_nvidia_dynamic_lib("cuda")._handle_uint + return handle + + +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 _init_driver() except -1 nogil: + global __py_driver_init + + cdef void* handle = NULL + cdef int ptds_mode + + with gil, __symbol_lock: + # Recheck the flag after obtaining the locks + if __py_driver_init: + return 0 + + handle = load_library() + if handle == NULL: + raise RuntimeError('Failed to open cuda') + + # Get latest __cuGetProcAddress_v2 + global __cuGetProcAddress_v2 + __cuGetProcAddress_v2 = dlsym(handle, 'cuGetProcAddress_v2') + if __cuGetProcAddress_v2 == NULL: + raise RuntimeError("Failed to get __cuGetProcAddress_v2") + _F_cuGetProcAddress_v2 = <__cuGetProcAddress_v2_T>__cuGetProcAddress_v2 + + if bool(int(os.getenv('CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM', default=0))): + ptds_mode = CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM + else: + ptds_mode = CU_GET_PROC_ADDRESS_DEFAULT + + # Load function + global __cuGetErrorString + _F_cuGetProcAddress_v2('cuGetErrorString', &__cuGetErrorString, 6000, ptds_mode, NULL) + + global __cuGetErrorName + _F_cuGetProcAddress_v2('cuGetErrorName', &__cuGetErrorName, 6000, ptds_mode, NULL) + + global __cuInit + _F_cuGetProcAddress_v2('cuInit', &__cuInit, 2000, ptds_mode, NULL) + + global __cuDriverGetVersion + _F_cuGetProcAddress_v2('cuDriverGetVersion', &__cuDriverGetVersion, 2020, ptds_mode, NULL) + + global __cuDeviceGet + _F_cuGetProcAddress_v2('cuDeviceGet', &__cuDeviceGet, 2000, ptds_mode, NULL) + + global __cuDeviceGetCount + _F_cuGetProcAddress_v2('cuDeviceGetCount', &__cuDeviceGetCount, 2000, ptds_mode, NULL) + + global __cuDeviceGetName + _F_cuGetProcAddress_v2('cuDeviceGetName', &__cuDeviceGetName, 2000, ptds_mode, NULL) + + global __cuDeviceGetUuid_v2 + _F_cuGetProcAddress_v2('cuDeviceGetUuid', &__cuDeviceGetUuid_v2, 11040, ptds_mode, NULL) + + global __cuDeviceGetLuid + _F_cuGetProcAddress_v2('cuDeviceGetLuid', &__cuDeviceGetLuid, 10000, ptds_mode, NULL) + + global __cuDeviceTotalMem_v2 + _F_cuGetProcAddress_v2('cuDeviceTotalMem', &__cuDeviceTotalMem_v2, 3020, ptds_mode, NULL) + + global __cuDeviceGetTexture1DLinearMaxWidth + _F_cuGetProcAddress_v2('cuDeviceGetTexture1DLinearMaxWidth', &__cuDeviceGetTexture1DLinearMaxWidth, 11010, ptds_mode, NULL) + + global __cuDeviceGetAttribute + _F_cuGetProcAddress_v2('cuDeviceGetAttribute', &__cuDeviceGetAttribute, 2000, ptds_mode, NULL) + + global __cuDeviceGetNvSciSyncAttributes + _F_cuGetProcAddress_v2('cuDeviceGetNvSciSyncAttributes', &__cuDeviceGetNvSciSyncAttributes, 10020, ptds_mode, NULL) + + global __cuDeviceSetMemPool + _F_cuGetProcAddress_v2('cuDeviceSetMemPool', &__cuDeviceSetMemPool, 11020, ptds_mode, NULL) + + global __cuDeviceGetMemPool + _F_cuGetProcAddress_v2('cuDeviceGetMemPool', &__cuDeviceGetMemPool, 11020, ptds_mode, NULL) + + global __cuDeviceGetDefaultMemPool + _F_cuGetProcAddress_v2('cuDeviceGetDefaultMemPool', &__cuDeviceGetDefaultMemPool, 11020, ptds_mode, NULL) + + global __cuDeviceGetExecAffinitySupport + _F_cuGetProcAddress_v2('cuDeviceGetExecAffinitySupport', &__cuDeviceGetExecAffinitySupport, 11040, ptds_mode, NULL) + + global __cuFlushGPUDirectRDMAWrites + _F_cuGetProcAddress_v2('cuFlushGPUDirectRDMAWrites', &__cuFlushGPUDirectRDMAWrites, 11030, ptds_mode, NULL) + + global __cuDeviceGetProperties + _F_cuGetProcAddress_v2('cuDeviceGetProperties', &__cuDeviceGetProperties, 2000, ptds_mode, NULL) + + global __cuDeviceComputeCapability + _F_cuGetProcAddress_v2('cuDeviceComputeCapability', &__cuDeviceComputeCapability, 2000, ptds_mode, NULL) + + global __cuDevicePrimaryCtxRetain + _F_cuGetProcAddress_v2('cuDevicePrimaryCtxRetain', &__cuDevicePrimaryCtxRetain, 7000, ptds_mode, NULL) + + global __cuDevicePrimaryCtxRelease_v2 + _F_cuGetProcAddress_v2('cuDevicePrimaryCtxRelease', &__cuDevicePrimaryCtxRelease_v2, 11000, ptds_mode, NULL) + + global __cuDevicePrimaryCtxSetFlags_v2 + _F_cuGetProcAddress_v2('cuDevicePrimaryCtxSetFlags', &__cuDevicePrimaryCtxSetFlags_v2, 11000, ptds_mode, NULL) + + global __cuDevicePrimaryCtxGetState + _F_cuGetProcAddress_v2('cuDevicePrimaryCtxGetState', &__cuDevicePrimaryCtxGetState, 7000, ptds_mode, NULL) + + global __cuDevicePrimaryCtxReset_v2 + _F_cuGetProcAddress_v2('cuDevicePrimaryCtxReset', &__cuDevicePrimaryCtxReset_v2, 11000, ptds_mode, NULL) + + global __cuCtxCreate_v2 + _F_cuGetProcAddress_v2('cuCtxCreate', &__cuCtxCreate_v2, 3020, ptds_mode, NULL) + + global __cuCtxCreate_v3 + _F_cuGetProcAddress_v2('cuCtxCreate', &__cuCtxCreate_v3, 11040, ptds_mode, NULL) + + global __cuCtxCreate_v4 + _F_cuGetProcAddress_v2('cuCtxCreate', &__cuCtxCreate_v4, 12050, ptds_mode, NULL) + + global __cuCtxDestroy_v2 + _F_cuGetProcAddress_v2('cuCtxDestroy', &__cuCtxDestroy_v2, 4000, ptds_mode, NULL) + + global __cuCtxPushCurrent_v2 + _F_cuGetProcAddress_v2('cuCtxPushCurrent', &__cuCtxPushCurrent_v2, 4000, ptds_mode, NULL) + + global __cuCtxPopCurrent_v2 + _F_cuGetProcAddress_v2('cuCtxPopCurrent', &__cuCtxPopCurrent_v2, 4000, ptds_mode, NULL) + + global __cuCtxSetCurrent + _F_cuGetProcAddress_v2('cuCtxSetCurrent', &__cuCtxSetCurrent, 4000, ptds_mode, NULL) + + global __cuCtxGetCurrent + _F_cuGetProcAddress_v2('cuCtxGetCurrent', &__cuCtxGetCurrent, 4000, ptds_mode, NULL) + + global __cuCtxGetDevice + _F_cuGetProcAddress_v2('cuCtxGetDevice', &__cuCtxGetDevice, 2000, ptds_mode, NULL) + + global __cuCtxGetFlags + _F_cuGetProcAddress_v2('cuCtxGetFlags', &__cuCtxGetFlags, 7000, ptds_mode, NULL) + + global __cuCtxSetFlags + _F_cuGetProcAddress_v2('cuCtxSetFlags', &__cuCtxSetFlags, 12010, ptds_mode, NULL) + + global __cuCtxGetId + _F_cuGetProcAddress_v2('cuCtxGetId', &__cuCtxGetId, 12000, ptds_mode, NULL) + + global __cuCtxSynchronize + _F_cuGetProcAddress_v2('cuCtxSynchronize', &__cuCtxSynchronize, 2000, ptds_mode, NULL) + + global __cuCtxSetLimit + _F_cuGetProcAddress_v2('cuCtxSetLimit', &__cuCtxSetLimit, 3010, ptds_mode, NULL) + + global __cuCtxGetLimit + _F_cuGetProcAddress_v2('cuCtxGetLimit', &__cuCtxGetLimit, 3010, ptds_mode, NULL) + + global __cuCtxGetCacheConfig + _F_cuGetProcAddress_v2('cuCtxGetCacheConfig', &__cuCtxGetCacheConfig, 3020, ptds_mode, NULL) + + global __cuCtxSetCacheConfig + _F_cuGetProcAddress_v2('cuCtxSetCacheConfig', &__cuCtxSetCacheConfig, 3020, ptds_mode, NULL) + + global __cuCtxGetApiVersion + _F_cuGetProcAddress_v2('cuCtxGetApiVersion', &__cuCtxGetApiVersion, 3020, ptds_mode, NULL) + + global __cuCtxGetStreamPriorityRange + _F_cuGetProcAddress_v2('cuCtxGetStreamPriorityRange', &__cuCtxGetStreamPriorityRange, 5050, ptds_mode, NULL) + + global __cuCtxResetPersistingL2Cache + _F_cuGetProcAddress_v2('cuCtxResetPersistingL2Cache', &__cuCtxResetPersistingL2Cache, 11000, ptds_mode, NULL) + + global __cuCtxGetExecAffinity + _F_cuGetProcAddress_v2('cuCtxGetExecAffinity', &__cuCtxGetExecAffinity, 11040, ptds_mode, NULL) + + global __cuCtxRecordEvent + _F_cuGetProcAddress_v2('cuCtxRecordEvent', &__cuCtxRecordEvent, 12050, ptds_mode, NULL) + + global __cuCtxWaitEvent + _F_cuGetProcAddress_v2('cuCtxWaitEvent', &__cuCtxWaitEvent, 12050, ptds_mode, NULL) + + global __cuCtxAttach + _F_cuGetProcAddress_v2('cuCtxAttach', &__cuCtxAttach, 2000, ptds_mode, NULL) + + global __cuCtxDetach + _F_cuGetProcAddress_v2('cuCtxDetach', &__cuCtxDetach, 2000, ptds_mode, NULL) + + global __cuCtxGetSharedMemConfig + _F_cuGetProcAddress_v2('cuCtxGetSharedMemConfig', &__cuCtxGetSharedMemConfig, 4020, ptds_mode, NULL) + + global __cuCtxSetSharedMemConfig + _F_cuGetProcAddress_v2('cuCtxSetSharedMemConfig', &__cuCtxSetSharedMemConfig, 4020, ptds_mode, NULL) + + global __cuModuleLoad + _F_cuGetProcAddress_v2('cuModuleLoad', &__cuModuleLoad, 2000, ptds_mode, NULL) + + global __cuModuleLoadData + _F_cuGetProcAddress_v2('cuModuleLoadData', &__cuModuleLoadData, 2000, ptds_mode, NULL) + + global __cuModuleLoadDataEx + _F_cuGetProcAddress_v2('cuModuleLoadDataEx', &__cuModuleLoadDataEx, 2010, ptds_mode, NULL) + + global __cuModuleLoadFatBinary + _F_cuGetProcAddress_v2('cuModuleLoadFatBinary', &__cuModuleLoadFatBinary, 2000, ptds_mode, NULL) + + global __cuModuleUnload + _F_cuGetProcAddress_v2('cuModuleUnload', &__cuModuleUnload, 2000, ptds_mode, NULL) + + global __cuModuleGetLoadingMode + _F_cuGetProcAddress_v2('cuModuleGetLoadingMode', &__cuModuleGetLoadingMode, 11070, ptds_mode, NULL) + + global __cuModuleGetFunction + _F_cuGetProcAddress_v2('cuModuleGetFunction', &__cuModuleGetFunction, 2000, ptds_mode, NULL) + + global __cuModuleGetFunctionCount + _F_cuGetProcAddress_v2('cuModuleGetFunctionCount', &__cuModuleGetFunctionCount, 12040, ptds_mode, NULL) + + global __cuModuleEnumerateFunctions + _F_cuGetProcAddress_v2('cuModuleEnumerateFunctions', &__cuModuleEnumerateFunctions, 12040, ptds_mode, NULL) + + global __cuModuleGetGlobal_v2 + _F_cuGetProcAddress_v2('cuModuleGetGlobal', &__cuModuleGetGlobal_v2, 3020, ptds_mode, NULL) + + global __cuLinkCreate_v2 + _F_cuGetProcAddress_v2('cuLinkCreate', &__cuLinkCreate_v2, 6050, ptds_mode, NULL) + + global __cuLinkAddData_v2 + _F_cuGetProcAddress_v2('cuLinkAddData', &__cuLinkAddData_v2, 6050, ptds_mode, NULL) + + global __cuLinkAddFile_v2 + _F_cuGetProcAddress_v2('cuLinkAddFile', &__cuLinkAddFile_v2, 6050, ptds_mode, NULL) + + global __cuLinkComplete + _F_cuGetProcAddress_v2('cuLinkComplete', &__cuLinkComplete, 5050, ptds_mode, NULL) + + global __cuLinkDestroy + _F_cuGetProcAddress_v2('cuLinkDestroy', &__cuLinkDestroy, 5050, ptds_mode, NULL) + + global __cuModuleGetTexRef + _F_cuGetProcAddress_v2('cuModuleGetTexRef', &__cuModuleGetTexRef, 2000, ptds_mode, NULL) + + global __cuModuleGetSurfRef + _F_cuGetProcAddress_v2('cuModuleGetSurfRef', &__cuModuleGetSurfRef, 3000, ptds_mode, NULL) + + global __cuLibraryLoadData + _F_cuGetProcAddress_v2('cuLibraryLoadData', &__cuLibraryLoadData, 12000, ptds_mode, NULL) + + global __cuLibraryLoadFromFile + _F_cuGetProcAddress_v2('cuLibraryLoadFromFile', &__cuLibraryLoadFromFile, 12000, ptds_mode, NULL) + + global __cuLibraryUnload + _F_cuGetProcAddress_v2('cuLibraryUnload', &__cuLibraryUnload, 12000, ptds_mode, NULL) + + global __cuLibraryGetKernel + _F_cuGetProcAddress_v2('cuLibraryGetKernel', &__cuLibraryGetKernel, 12000, ptds_mode, NULL) + + global __cuLibraryGetKernelCount + _F_cuGetProcAddress_v2('cuLibraryGetKernelCount', &__cuLibraryGetKernelCount, 12040, ptds_mode, NULL) + + global __cuLibraryEnumerateKernels + _F_cuGetProcAddress_v2('cuLibraryEnumerateKernels', &__cuLibraryEnumerateKernels, 12040, ptds_mode, NULL) + + global __cuLibraryGetModule + _F_cuGetProcAddress_v2('cuLibraryGetModule', &__cuLibraryGetModule, 12000, ptds_mode, NULL) + + global __cuKernelGetFunction + _F_cuGetProcAddress_v2('cuKernelGetFunction', &__cuKernelGetFunction, 12000, ptds_mode, NULL) + + global __cuKernelGetLibrary + _F_cuGetProcAddress_v2('cuKernelGetLibrary', &__cuKernelGetLibrary, 12050, ptds_mode, NULL) + + global __cuLibraryGetGlobal + _F_cuGetProcAddress_v2('cuLibraryGetGlobal', &__cuLibraryGetGlobal, 12000, ptds_mode, NULL) + + global __cuLibraryGetManaged + _F_cuGetProcAddress_v2('cuLibraryGetManaged', &__cuLibraryGetManaged, 12000, ptds_mode, NULL) + + global __cuLibraryGetUnifiedFunction + _F_cuGetProcAddress_v2('cuLibraryGetUnifiedFunction', &__cuLibraryGetUnifiedFunction, 12000, ptds_mode, NULL) + + global __cuKernelGetAttribute + _F_cuGetProcAddress_v2('cuKernelGetAttribute', &__cuKernelGetAttribute, 12000, ptds_mode, NULL) + + global __cuKernelSetAttribute + _F_cuGetProcAddress_v2('cuKernelSetAttribute', &__cuKernelSetAttribute, 12000, ptds_mode, NULL) + + global __cuKernelSetCacheConfig + _F_cuGetProcAddress_v2('cuKernelSetCacheConfig', &__cuKernelSetCacheConfig, 12000, ptds_mode, NULL) + + global __cuKernelGetName + _F_cuGetProcAddress_v2('cuKernelGetName', &__cuKernelGetName, 12030, ptds_mode, NULL) + + global __cuKernelGetParamInfo + _F_cuGetProcAddress_v2('cuKernelGetParamInfo', &__cuKernelGetParamInfo, 12040, ptds_mode, NULL) + + global __cuMemGetInfo_v2 + _F_cuGetProcAddress_v2('cuMemGetInfo', &__cuMemGetInfo_v2, 3020, ptds_mode, NULL) + + global __cuMemAlloc_v2 + _F_cuGetProcAddress_v2('cuMemAlloc', &__cuMemAlloc_v2, 3020, ptds_mode, NULL) + + global __cuMemAllocPitch_v2 + _F_cuGetProcAddress_v2('cuMemAllocPitch', &__cuMemAllocPitch_v2, 3020, ptds_mode, NULL) + + global __cuMemFree_v2 + _F_cuGetProcAddress_v2('cuMemFree', &__cuMemFree_v2, 3020, ptds_mode, NULL) + + global __cuMemGetAddressRange_v2 + _F_cuGetProcAddress_v2('cuMemGetAddressRange', &__cuMemGetAddressRange_v2, 3020, ptds_mode, NULL) + + global __cuMemAllocHost_v2 + _F_cuGetProcAddress_v2('cuMemAllocHost', &__cuMemAllocHost_v2, 3020, ptds_mode, NULL) + + global __cuMemFreeHost + _F_cuGetProcAddress_v2('cuMemFreeHost', &__cuMemFreeHost, 2000, ptds_mode, NULL) + + global __cuMemHostAlloc + _F_cuGetProcAddress_v2('cuMemHostAlloc', &__cuMemHostAlloc, 2020, ptds_mode, NULL) + + global __cuMemHostGetDevicePointer_v2 + _F_cuGetProcAddress_v2('cuMemHostGetDevicePointer', &__cuMemHostGetDevicePointer_v2, 3020, ptds_mode, NULL) + + global __cuMemHostGetFlags + _F_cuGetProcAddress_v2('cuMemHostGetFlags', &__cuMemHostGetFlags, 2030, ptds_mode, NULL) + + global __cuMemAllocManaged + _F_cuGetProcAddress_v2('cuMemAllocManaged', &__cuMemAllocManaged, 6000, ptds_mode, NULL) + + global __cuDeviceRegisterAsyncNotification + _F_cuGetProcAddress_v2('cuDeviceRegisterAsyncNotification', &__cuDeviceRegisterAsyncNotification, 12040, ptds_mode, NULL) + + global __cuDeviceUnregisterAsyncNotification + _F_cuGetProcAddress_v2('cuDeviceUnregisterAsyncNotification', &__cuDeviceUnregisterAsyncNotification, 12040, ptds_mode, NULL) + + global __cuDeviceGetByPCIBusId + _F_cuGetProcAddress_v2('cuDeviceGetByPCIBusId', &__cuDeviceGetByPCIBusId, 4010, ptds_mode, NULL) + + global __cuDeviceGetPCIBusId + _F_cuGetProcAddress_v2('cuDeviceGetPCIBusId', &__cuDeviceGetPCIBusId, 4010, ptds_mode, NULL) + + global __cuIpcGetEventHandle + _F_cuGetProcAddress_v2('cuIpcGetEventHandle', &__cuIpcGetEventHandle, 4010, ptds_mode, NULL) + + global __cuIpcOpenEventHandle + _F_cuGetProcAddress_v2('cuIpcOpenEventHandle', &__cuIpcOpenEventHandle, 4010, ptds_mode, NULL) + + global __cuIpcGetMemHandle + _F_cuGetProcAddress_v2('cuIpcGetMemHandle', &__cuIpcGetMemHandle, 4010, ptds_mode, NULL) + + global __cuIpcOpenMemHandle_v2 + _F_cuGetProcAddress_v2('cuIpcOpenMemHandle', &__cuIpcOpenMemHandle_v2, 11000, ptds_mode, NULL) + + global __cuIpcCloseMemHandle + _F_cuGetProcAddress_v2('cuIpcCloseMemHandle', &__cuIpcCloseMemHandle, 4010, ptds_mode, NULL) + + global __cuMemHostRegister_v2 + _F_cuGetProcAddress_v2('cuMemHostRegister', &__cuMemHostRegister_v2, 6050, ptds_mode, NULL) + + global __cuMemHostUnregister + _F_cuGetProcAddress_v2('cuMemHostUnregister', &__cuMemHostUnregister, 4000, ptds_mode, NULL) + + global __cuMemcpy + _F_cuGetProcAddress_v2('cuMemcpy', &__cuMemcpy, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuMemcpyPeer + _F_cuGetProcAddress_v2('cuMemcpyPeer', &__cuMemcpyPeer, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuMemcpyHtoD_v2 + _F_cuGetProcAddress_v2('cuMemcpyHtoD', &__cuMemcpyHtoD_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyDtoH_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoH', &__cuMemcpyDtoH_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyDtoD_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoD', &__cuMemcpyDtoD_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyDtoA_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoA', &__cuMemcpyDtoA_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyAtoD_v2 + _F_cuGetProcAddress_v2('cuMemcpyAtoD', &__cuMemcpyAtoD_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyHtoA_v2 + _F_cuGetProcAddress_v2('cuMemcpyHtoA', &__cuMemcpyHtoA_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyAtoH_v2 + _F_cuGetProcAddress_v2('cuMemcpyAtoH', &__cuMemcpyAtoH_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyAtoA_v2 + _F_cuGetProcAddress_v2('cuMemcpyAtoA', &__cuMemcpyAtoA_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpy2D_v2 + _F_cuGetProcAddress_v2('cuMemcpy2D', &__cuMemcpy2D_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpy2DUnaligned_v2 + _F_cuGetProcAddress_v2('cuMemcpy2DUnaligned', &__cuMemcpy2DUnaligned_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpy3D_v2 + _F_cuGetProcAddress_v2('cuMemcpy3D', &__cuMemcpy3D_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpy3DPeer + _F_cuGetProcAddress_v2('cuMemcpy3DPeer', &__cuMemcpy3DPeer, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuMemcpyAsync + _F_cuGetProcAddress_v2('cuMemcpyAsync', &__cuMemcpyAsync, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuMemcpyPeerAsync + _F_cuGetProcAddress_v2('cuMemcpyPeerAsync', &__cuMemcpyPeerAsync, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuMemcpyHtoDAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyHtoDAsync', &__cuMemcpyHtoDAsync_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyDtoHAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoHAsync', &__cuMemcpyDtoHAsync_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyDtoDAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoDAsync', &__cuMemcpyDtoDAsync_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyHtoAAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyHtoAAsync', &__cuMemcpyHtoAAsync_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyAtoHAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyAtoHAsync', &__cuMemcpyAtoHAsync_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpy2DAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpy2DAsync', &__cuMemcpy2DAsync_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpy3DAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpy3DAsync', &__cuMemcpy3DAsync_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpy3DPeerAsync + _F_cuGetProcAddress_v2('cuMemcpy3DPeerAsync', &__cuMemcpy3DPeerAsync, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuMemsetD8_v2 + _F_cuGetProcAddress_v2('cuMemsetD8', &__cuMemsetD8_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD16_v2 + _F_cuGetProcAddress_v2('cuMemsetD16', &__cuMemsetD16_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD32_v2 + _F_cuGetProcAddress_v2('cuMemsetD32', &__cuMemsetD32_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD2D8_v2 + _F_cuGetProcAddress_v2('cuMemsetD2D8', &__cuMemsetD2D8_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD2D16_v2 + _F_cuGetProcAddress_v2('cuMemsetD2D16', &__cuMemsetD2D16_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD2D32_v2 + _F_cuGetProcAddress_v2('cuMemsetD2D32', &__cuMemsetD2D32_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD8Async + _F_cuGetProcAddress_v2('cuMemsetD8Async', &__cuMemsetD8Async, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD16Async + _F_cuGetProcAddress_v2('cuMemsetD16Async', &__cuMemsetD16Async, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD32Async + _F_cuGetProcAddress_v2('cuMemsetD32Async', &__cuMemsetD32Async, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD2D8Async + _F_cuGetProcAddress_v2('cuMemsetD2D8Async', &__cuMemsetD2D8Async, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD2D16Async + _F_cuGetProcAddress_v2('cuMemsetD2D16Async', &__cuMemsetD2D16Async, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD2D32Async + _F_cuGetProcAddress_v2('cuMemsetD2D32Async', &__cuMemsetD2D32Async, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuArrayCreate_v2 + _F_cuGetProcAddress_v2('cuArrayCreate', &__cuArrayCreate_v2, 3020, ptds_mode, NULL) + + global __cuArrayGetDescriptor_v2 + _F_cuGetProcAddress_v2('cuArrayGetDescriptor', &__cuArrayGetDescriptor_v2, 3020, ptds_mode, NULL) + + global __cuArrayGetSparseProperties + _F_cuGetProcAddress_v2('cuArrayGetSparseProperties', &__cuArrayGetSparseProperties, 11010, ptds_mode, NULL) + + global __cuMipmappedArrayGetSparseProperties + _F_cuGetProcAddress_v2('cuMipmappedArrayGetSparseProperties', &__cuMipmappedArrayGetSparseProperties, 11010, ptds_mode, NULL) + + global __cuArrayGetMemoryRequirements + _F_cuGetProcAddress_v2('cuArrayGetMemoryRequirements', &__cuArrayGetMemoryRequirements, 11060, ptds_mode, NULL) + + global __cuMipmappedArrayGetMemoryRequirements + _F_cuGetProcAddress_v2('cuMipmappedArrayGetMemoryRequirements', &__cuMipmappedArrayGetMemoryRequirements, 11060, ptds_mode, NULL) + + global __cuArrayGetPlane + _F_cuGetProcAddress_v2('cuArrayGetPlane', &__cuArrayGetPlane, 11020, ptds_mode, NULL) + + global __cuArrayDestroy + _F_cuGetProcAddress_v2('cuArrayDestroy', &__cuArrayDestroy, 2000, ptds_mode, NULL) + + global __cuArray3DCreate_v2 + _F_cuGetProcAddress_v2('cuArray3DCreate', &__cuArray3DCreate_v2, 3020, ptds_mode, NULL) + + global __cuArray3DGetDescriptor_v2 + _F_cuGetProcAddress_v2('cuArray3DGetDescriptor', &__cuArray3DGetDescriptor_v2, 3020, ptds_mode, NULL) + + global __cuMipmappedArrayCreate + _F_cuGetProcAddress_v2('cuMipmappedArrayCreate', &__cuMipmappedArrayCreate, 5000, ptds_mode, NULL) + + global __cuMipmappedArrayGetLevel + _F_cuGetProcAddress_v2('cuMipmappedArrayGetLevel', &__cuMipmappedArrayGetLevel, 5000, ptds_mode, NULL) + + global __cuMipmappedArrayDestroy + _F_cuGetProcAddress_v2('cuMipmappedArrayDestroy', &__cuMipmappedArrayDestroy, 5000, ptds_mode, NULL) + + global __cuMemGetHandleForAddressRange + _F_cuGetProcAddress_v2('cuMemGetHandleForAddressRange', &__cuMemGetHandleForAddressRange, 11070, ptds_mode, NULL) + + global __cuMemBatchDecompressAsync + _F_cuGetProcAddress_v2('cuMemBatchDecompressAsync', &__cuMemBatchDecompressAsync, 12060, ptds_mode, NULL) + + global __cuMemAddressReserve + _F_cuGetProcAddress_v2('cuMemAddressReserve', &__cuMemAddressReserve, 10020, ptds_mode, NULL) + + global __cuMemAddressFree + _F_cuGetProcAddress_v2('cuMemAddressFree', &__cuMemAddressFree, 10020, ptds_mode, NULL) + + global __cuMemCreate + _F_cuGetProcAddress_v2('cuMemCreate', &__cuMemCreate, 10020, ptds_mode, NULL) + + global __cuMemRelease + _F_cuGetProcAddress_v2('cuMemRelease', &__cuMemRelease, 10020, ptds_mode, NULL) + + global __cuMemMap + _F_cuGetProcAddress_v2('cuMemMap', &__cuMemMap, 10020, ptds_mode, NULL) + + global __cuMemMapArrayAsync + _F_cuGetProcAddress_v2('cuMemMapArrayAsync', &__cuMemMapArrayAsync, 11010, ptds_mode, NULL) + + global __cuMemUnmap + _F_cuGetProcAddress_v2('cuMemUnmap', &__cuMemUnmap, 10020, ptds_mode, NULL) + + global __cuMemSetAccess + _F_cuGetProcAddress_v2('cuMemSetAccess', &__cuMemSetAccess, 10020, ptds_mode, NULL) + + global __cuMemGetAccess + _F_cuGetProcAddress_v2('cuMemGetAccess', &__cuMemGetAccess, 10020, ptds_mode, NULL) + + global __cuMemExportToShareableHandle + _F_cuGetProcAddress_v2('cuMemExportToShareableHandle', &__cuMemExportToShareableHandle, 10020, ptds_mode, NULL) + + global __cuMemImportFromShareableHandle + _F_cuGetProcAddress_v2('cuMemImportFromShareableHandle', &__cuMemImportFromShareableHandle, 10020, ptds_mode, NULL) + + global __cuMemGetAllocationGranularity + _F_cuGetProcAddress_v2('cuMemGetAllocationGranularity', &__cuMemGetAllocationGranularity, 10020, ptds_mode, NULL) + + global __cuMemGetAllocationPropertiesFromHandle + _F_cuGetProcAddress_v2('cuMemGetAllocationPropertiesFromHandle', &__cuMemGetAllocationPropertiesFromHandle, 10020, ptds_mode, NULL) + + global __cuMemRetainAllocationHandle + _F_cuGetProcAddress_v2('cuMemRetainAllocationHandle', &__cuMemRetainAllocationHandle, 11000, ptds_mode, NULL) + + global __cuMemFreeAsync + _F_cuGetProcAddress_v2('cuMemFreeAsync', &__cuMemFreeAsync, 11020, ptds_mode, NULL) + + global __cuMemAllocAsync + _F_cuGetProcAddress_v2('cuMemAllocAsync', &__cuMemAllocAsync, 11020, ptds_mode, NULL) + + global __cuMemPoolTrimTo + _F_cuGetProcAddress_v2('cuMemPoolTrimTo', &__cuMemPoolTrimTo, 11020, ptds_mode, NULL) + + global __cuMemPoolSetAttribute + _F_cuGetProcAddress_v2('cuMemPoolSetAttribute', &__cuMemPoolSetAttribute, 11020, ptds_mode, NULL) + + global __cuMemPoolGetAttribute + _F_cuGetProcAddress_v2('cuMemPoolGetAttribute', &__cuMemPoolGetAttribute, 11020, ptds_mode, NULL) + + global __cuMemPoolSetAccess + _F_cuGetProcAddress_v2('cuMemPoolSetAccess', &__cuMemPoolSetAccess, 11020, ptds_mode, NULL) + + global __cuMemPoolGetAccess + _F_cuGetProcAddress_v2('cuMemPoolGetAccess', &__cuMemPoolGetAccess, 11020, ptds_mode, NULL) + + global __cuMemPoolCreate + _F_cuGetProcAddress_v2('cuMemPoolCreate', &__cuMemPoolCreate, 11020, ptds_mode, NULL) + + global __cuMemPoolDestroy + _F_cuGetProcAddress_v2('cuMemPoolDestroy', &__cuMemPoolDestroy, 11020, ptds_mode, NULL) + + global __cuMemAllocFromPoolAsync + _F_cuGetProcAddress_v2('cuMemAllocFromPoolAsync', &__cuMemAllocFromPoolAsync, 11020, ptds_mode, NULL) + + global __cuMemPoolExportToShareableHandle + _F_cuGetProcAddress_v2('cuMemPoolExportToShareableHandle', &__cuMemPoolExportToShareableHandle, 11020, ptds_mode, NULL) + + global __cuMemPoolImportFromShareableHandle + _F_cuGetProcAddress_v2('cuMemPoolImportFromShareableHandle', &__cuMemPoolImportFromShareableHandle, 11020, ptds_mode, NULL) + + global __cuMemPoolExportPointer + _F_cuGetProcAddress_v2('cuMemPoolExportPointer', &__cuMemPoolExportPointer, 11020, ptds_mode, NULL) + + global __cuMemPoolImportPointer + _F_cuGetProcAddress_v2('cuMemPoolImportPointer', &__cuMemPoolImportPointer, 11020, ptds_mode, NULL) + + global __cuMulticastCreate + _F_cuGetProcAddress_v2('cuMulticastCreate', &__cuMulticastCreate, 12010, ptds_mode, NULL) + + global __cuMulticastAddDevice + _F_cuGetProcAddress_v2('cuMulticastAddDevice', &__cuMulticastAddDevice, 12010, ptds_mode, NULL) + + global __cuMulticastBindMem + _F_cuGetProcAddress_v2('cuMulticastBindMem', &__cuMulticastBindMem, 12010, ptds_mode, NULL) + + global __cuMulticastBindAddr + _F_cuGetProcAddress_v2('cuMulticastBindAddr', &__cuMulticastBindAddr, 12010, ptds_mode, NULL) + + global __cuMulticastUnbind + _F_cuGetProcAddress_v2('cuMulticastUnbind', &__cuMulticastUnbind, 12010, ptds_mode, NULL) + + global __cuMulticastGetGranularity + _F_cuGetProcAddress_v2('cuMulticastGetGranularity', &__cuMulticastGetGranularity, 12010, ptds_mode, NULL) + + global __cuPointerGetAttribute + _F_cuGetProcAddress_v2('cuPointerGetAttribute', &__cuPointerGetAttribute, 4000, ptds_mode, NULL) + + global __cuMemPrefetchAsync_v2 + _F_cuGetProcAddress_v2('cuMemPrefetchAsync', &__cuMemPrefetchAsync_v2, 12020, ptds_mode, NULL) + + global __cuMemAdvise_v2 + _F_cuGetProcAddress_v2('cuMemAdvise', &__cuMemAdvise_v2, 12020, ptds_mode, NULL) + + global __cuMemRangeGetAttribute + _F_cuGetProcAddress_v2('cuMemRangeGetAttribute', &__cuMemRangeGetAttribute, 8000, ptds_mode, NULL) + + global __cuMemRangeGetAttributes + _F_cuGetProcAddress_v2('cuMemRangeGetAttributes', &__cuMemRangeGetAttributes, 8000, ptds_mode, NULL) + + global __cuPointerSetAttribute + _F_cuGetProcAddress_v2('cuPointerSetAttribute', &__cuPointerSetAttribute, 6000, ptds_mode, NULL) + + global __cuPointerGetAttributes + _F_cuGetProcAddress_v2('cuPointerGetAttributes', &__cuPointerGetAttributes, 7000, ptds_mode, NULL) + + global __cuStreamCreate + _F_cuGetProcAddress_v2('cuStreamCreate', &__cuStreamCreate, 2000, ptds_mode, NULL) + + global __cuStreamCreateWithPriority + _F_cuGetProcAddress_v2('cuStreamCreateWithPriority', &__cuStreamCreateWithPriority, 5050, ptds_mode, NULL) + + global __cuStreamGetPriority + _F_cuGetProcAddress_v2('cuStreamGetPriority', &__cuStreamGetPriority, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 5050, ptds_mode, NULL) + + global __cuStreamGetDevice + _F_cuGetProcAddress_v2('cuStreamGetDevice', &__cuStreamGetDevice, 12080, ptds_mode, NULL) + + global __cuStreamGetFlags + _F_cuGetProcAddress_v2('cuStreamGetFlags', &__cuStreamGetFlags, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 5050, ptds_mode, NULL) + + global __cuStreamGetId + _F_cuGetProcAddress_v2('cuStreamGetId', &__cuStreamGetId, 12000, ptds_mode, NULL) + + global __cuStreamGetCtx + _F_cuGetProcAddress_v2('cuStreamGetCtx', &__cuStreamGetCtx, 9020, ptds_mode, NULL) + + global __cuStreamGetCtx_v2 + _F_cuGetProcAddress_v2('cuStreamGetCtx', &__cuStreamGetCtx_v2, 12050, ptds_mode, NULL) + + global __cuStreamWaitEvent + _F_cuGetProcAddress_v2('cuStreamWaitEvent', &__cuStreamWaitEvent, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuStreamAddCallback + _F_cuGetProcAddress_v2('cuStreamAddCallback', &__cuStreamAddCallback, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 5000, ptds_mode, NULL) + + global __cuStreamBeginCapture_v2 + _F_cuGetProcAddress_v2('cuStreamBeginCapture', &__cuStreamBeginCapture_v2, 10010, ptds_mode, NULL) + + global __cuStreamBeginCaptureToGraph + _F_cuGetProcAddress_v2('cuStreamBeginCaptureToGraph', &__cuStreamBeginCaptureToGraph, 12030, ptds_mode, NULL) + + global __cuThreadExchangeStreamCaptureMode + _F_cuGetProcAddress_v2('cuThreadExchangeStreamCaptureMode', &__cuThreadExchangeStreamCaptureMode, 10010, ptds_mode, NULL) + + global __cuStreamEndCapture + _F_cuGetProcAddress_v2('cuStreamEndCapture', &__cuStreamEndCapture, 10000, ptds_mode, NULL) + + global __cuStreamIsCapturing + _F_cuGetProcAddress_v2('cuStreamIsCapturing', &__cuStreamIsCapturing, 10000, ptds_mode, NULL) + + global __cuStreamGetCaptureInfo_v2 + _F_cuGetProcAddress_v2('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v2, 11030, ptds_mode, NULL) + + global __cuStreamGetCaptureInfo_v3 + _F_cuGetProcAddress_v2('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v3, 12030, ptds_mode, NULL) + + global __cuStreamUpdateCaptureDependencies_v2 + _F_cuGetProcAddress_v2('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies_v2, 12030, ptds_mode, NULL) + + global __cuStreamAttachMemAsync + _F_cuGetProcAddress_v2('cuStreamAttachMemAsync', &__cuStreamAttachMemAsync, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 6000, ptds_mode, NULL) + + global __cuStreamQuery + _F_cuGetProcAddress_v2('cuStreamQuery', &__cuStreamQuery, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 2000, ptds_mode, NULL) + + global __cuStreamSynchronize + _F_cuGetProcAddress_v2('cuStreamSynchronize', &__cuStreamSynchronize, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 2000, ptds_mode, NULL) + + global __cuStreamDestroy_v2 + _F_cuGetProcAddress_v2('cuStreamDestroy', &__cuStreamDestroy_v2, 4000, ptds_mode, NULL) + + global __cuStreamCopyAttributes + _F_cuGetProcAddress_v2('cuStreamCopyAttributes', &__cuStreamCopyAttributes, 11000, ptds_mode, NULL) + + global __cuStreamGetAttribute + _F_cuGetProcAddress_v2('cuStreamGetAttribute', &__cuStreamGetAttribute, 11000, ptds_mode, NULL) + + global __cuStreamSetAttribute + _F_cuGetProcAddress_v2('cuStreamSetAttribute', &__cuStreamSetAttribute, 11000, ptds_mode, NULL) + + global __cuEventCreate + _F_cuGetProcAddress_v2('cuEventCreate', &__cuEventCreate, 2000, ptds_mode, NULL) + + global __cuEventRecord + _F_cuGetProcAddress_v2('cuEventRecord', &__cuEventRecord, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 2000, ptds_mode, NULL) + + global __cuEventRecordWithFlags + _F_cuGetProcAddress_v2('cuEventRecordWithFlags', &__cuEventRecordWithFlags, 11010, ptds_mode, NULL) + + global __cuEventQuery + _F_cuGetProcAddress_v2('cuEventQuery', &__cuEventQuery, 2000, ptds_mode, NULL) + + global __cuEventSynchronize + _F_cuGetProcAddress_v2('cuEventSynchronize', &__cuEventSynchronize, 2000, ptds_mode, NULL) + + global __cuEventDestroy_v2 + _F_cuGetProcAddress_v2('cuEventDestroy', &__cuEventDestroy_v2, 4000, ptds_mode, NULL) + + global __cuEventElapsedTime_v2 + _F_cuGetProcAddress_v2('cuEventElapsedTime', &__cuEventElapsedTime_v2, 12080, ptds_mode, NULL) + + global __cuImportExternalMemory + _F_cuGetProcAddress_v2('cuImportExternalMemory', &__cuImportExternalMemory, 10000, ptds_mode, NULL) + + global __cuExternalMemoryGetMappedBuffer + _F_cuGetProcAddress_v2('cuExternalMemoryGetMappedBuffer', &__cuExternalMemoryGetMappedBuffer, 10000, ptds_mode, NULL) + + global __cuExternalMemoryGetMappedMipmappedArray + _F_cuGetProcAddress_v2('cuExternalMemoryGetMappedMipmappedArray', &__cuExternalMemoryGetMappedMipmappedArray, 10000, ptds_mode, NULL) + + global __cuDestroyExternalMemory + _F_cuGetProcAddress_v2('cuDestroyExternalMemory', &__cuDestroyExternalMemory, 10000, ptds_mode, NULL) + + global __cuImportExternalSemaphore + _F_cuGetProcAddress_v2('cuImportExternalSemaphore', &__cuImportExternalSemaphore, 10000, ptds_mode, NULL) + + global __cuSignalExternalSemaphoresAsync + _F_cuGetProcAddress_v2('cuSignalExternalSemaphoresAsync', &__cuSignalExternalSemaphoresAsync, 10000, ptds_mode, NULL) + + global __cuWaitExternalSemaphoresAsync + _F_cuGetProcAddress_v2('cuWaitExternalSemaphoresAsync', &__cuWaitExternalSemaphoresAsync, 10000, ptds_mode, NULL) + + global __cuDestroyExternalSemaphore + _F_cuGetProcAddress_v2('cuDestroyExternalSemaphore', &__cuDestroyExternalSemaphore, 10000, ptds_mode, NULL) + + global __cuStreamWaitValue32_v2 + _F_cuGetProcAddress_v2('cuStreamWaitValue32', &__cuStreamWaitValue32_v2, 11070, ptds_mode, NULL) + + global __cuStreamWaitValue64_v2 + _F_cuGetProcAddress_v2('cuStreamWaitValue64', &__cuStreamWaitValue64_v2, 11070, ptds_mode, NULL) + + global __cuStreamWriteValue32_v2 + _F_cuGetProcAddress_v2('cuStreamWriteValue32', &__cuStreamWriteValue32_v2, 11070, ptds_mode, NULL) + + global __cuStreamWriteValue64_v2 + _F_cuGetProcAddress_v2('cuStreamWriteValue64', &__cuStreamWriteValue64_v2, 11070, ptds_mode, NULL) + + global __cuStreamBatchMemOp_v2 + _F_cuGetProcAddress_v2('cuStreamBatchMemOp', &__cuStreamBatchMemOp_v2, 11070, ptds_mode, NULL) + + global __cuFuncGetAttribute + _F_cuGetProcAddress_v2('cuFuncGetAttribute', &__cuFuncGetAttribute, 2020, ptds_mode, NULL) + + global __cuFuncSetAttribute + _F_cuGetProcAddress_v2('cuFuncSetAttribute', &__cuFuncSetAttribute, 9000, ptds_mode, NULL) + + global __cuFuncSetCacheConfig + _F_cuGetProcAddress_v2('cuFuncSetCacheConfig', &__cuFuncSetCacheConfig, 3000, ptds_mode, NULL) + + global __cuFuncGetModule + _F_cuGetProcAddress_v2('cuFuncGetModule', &__cuFuncGetModule, 11000, ptds_mode, NULL) + + global __cuFuncGetName + _F_cuGetProcAddress_v2('cuFuncGetName', &__cuFuncGetName, 12030, ptds_mode, NULL) + + global __cuFuncGetParamInfo + _F_cuGetProcAddress_v2('cuFuncGetParamInfo', &__cuFuncGetParamInfo, 12040, ptds_mode, NULL) + + global __cuFuncIsLoaded + _F_cuGetProcAddress_v2('cuFuncIsLoaded', &__cuFuncIsLoaded, 12040, ptds_mode, NULL) + + global __cuFuncLoad + _F_cuGetProcAddress_v2('cuFuncLoad', &__cuFuncLoad, 12040, ptds_mode, NULL) + + global __cuLaunchKernel + _F_cuGetProcAddress_v2('cuLaunchKernel', &__cuLaunchKernel, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuLaunchKernelEx + _F_cuGetProcAddress_v2('cuLaunchKernelEx', &__cuLaunchKernelEx, 11060, ptds_mode, NULL) + + global __cuLaunchCooperativeKernel + _F_cuGetProcAddress_v2('cuLaunchCooperativeKernel', &__cuLaunchCooperativeKernel, 9000, ptds_mode, NULL) + + global __cuLaunchCooperativeKernelMultiDevice + _F_cuGetProcAddress_v2('cuLaunchCooperativeKernelMultiDevice', &__cuLaunchCooperativeKernelMultiDevice, 9000, ptds_mode, NULL) + + global __cuLaunchHostFunc + _F_cuGetProcAddress_v2('cuLaunchHostFunc', &__cuLaunchHostFunc, 10000, ptds_mode, NULL) + + global __cuFuncSetBlockShape + _F_cuGetProcAddress_v2('cuFuncSetBlockShape', &__cuFuncSetBlockShape, 2000, ptds_mode, NULL) + + global __cuFuncSetSharedSize + _F_cuGetProcAddress_v2('cuFuncSetSharedSize', &__cuFuncSetSharedSize, 2000, ptds_mode, NULL) + + global __cuParamSetSize + _F_cuGetProcAddress_v2('cuParamSetSize', &__cuParamSetSize, 2000, ptds_mode, NULL) + + global __cuParamSeti + _F_cuGetProcAddress_v2('cuParamSeti', &__cuParamSeti, 2000, ptds_mode, NULL) + + global __cuParamSetf + _F_cuGetProcAddress_v2('cuParamSetf', &__cuParamSetf, 2000, ptds_mode, NULL) + + global __cuParamSetv + _F_cuGetProcAddress_v2('cuParamSetv', &__cuParamSetv, 2000, ptds_mode, NULL) + + global __cuLaunch + _F_cuGetProcAddress_v2('cuLaunch', &__cuLaunch, 2000, ptds_mode, NULL) + + global __cuLaunchGrid + _F_cuGetProcAddress_v2('cuLaunchGrid', &__cuLaunchGrid, 2000, ptds_mode, NULL) + + global __cuLaunchGridAsync + _F_cuGetProcAddress_v2('cuLaunchGridAsync', &__cuLaunchGridAsync, 2000, ptds_mode, NULL) + + global __cuParamSetTexRef + _F_cuGetProcAddress_v2('cuParamSetTexRef', &__cuParamSetTexRef, 2000, ptds_mode, NULL) + + global __cuFuncSetSharedMemConfig + _F_cuGetProcAddress_v2('cuFuncSetSharedMemConfig', &__cuFuncSetSharedMemConfig, 4020, ptds_mode, NULL) + + global __cuGraphCreate + _F_cuGetProcAddress_v2('cuGraphCreate', &__cuGraphCreate, 10000, ptds_mode, NULL) + + global __cuGraphAddKernelNode_v2 + _F_cuGetProcAddress_v2('cuGraphAddKernelNode', &__cuGraphAddKernelNode_v2, 12000, ptds_mode, NULL) + + global __cuGraphKernelNodeGetParams_v2 + _F_cuGetProcAddress_v2('cuGraphKernelNodeGetParams', &__cuGraphKernelNodeGetParams_v2, 12000, ptds_mode, NULL) + + global __cuGraphKernelNodeSetParams_v2 + _F_cuGetProcAddress_v2('cuGraphKernelNodeSetParams', &__cuGraphKernelNodeSetParams_v2, 12000, ptds_mode, NULL) + + global __cuGraphAddMemcpyNode + _F_cuGetProcAddress_v2('cuGraphAddMemcpyNode', &__cuGraphAddMemcpyNode, 10000, ptds_mode, NULL) + + global __cuGraphMemcpyNodeGetParams + _F_cuGetProcAddress_v2('cuGraphMemcpyNodeGetParams', &__cuGraphMemcpyNodeGetParams, 10000, ptds_mode, NULL) + + global __cuGraphMemcpyNodeSetParams + _F_cuGetProcAddress_v2('cuGraphMemcpyNodeSetParams', &__cuGraphMemcpyNodeSetParams, 10000, ptds_mode, NULL) + + global __cuGraphAddMemsetNode + _F_cuGetProcAddress_v2('cuGraphAddMemsetNode', &__cuGraphAddMemsetNode, 10000, ptds_mode, NULL) + + global __cuGraphMemsetNodeGetParams + _F_cuGetProcAddress_v2('cuGraphMemsetNodeGetParams', &__cuGraphMemsetNodeGetParams, 10000, ptds_mode, NULL) + + global __cuGraphMemsetNodeSetParams + _F_cuGetProcAddress_v2('cuGraphMemsetNodeSetParams', &__cuGraphMemsetNodeSetParams, 10000, ptds_mode, NULL) + + global __cuGraphAddHostNode + _F_cuGetProcAddress_v2('cuGraphAddHostNode', &__cuGraphAddHostNode, 10000, ptds_mode, NULL) + + global __cuGraphHostNodeGetParams + _F_cuGetProcAddress_v2('cuGraphHostNodeGetParams', &__cuGraphHostNodeGetParams, 10000, ptds_mode, NULL) + + global __cuGraphHostNodeSetParams + _F_cuGetProcAddress_v2('cuGraphHostNodeSetParams', &__cuGraphHostNodeSetParams, 10000, ptds_mode, NULL) + + global __cuGraphAddChildGraphNode + _F_cuGetProcAddress_v2('cuGraphAddChildGraphNode', &__cuGraphAddChildGraphNode, 10000, ptds_mode, NULL) + + global __cuGraphChildGraphNodeGetGraph + _F_cuGetProcAddress_v2('cuGraphChildGraphNodeGetGraph', &__cuGraphChildGraphNodeGetGraph, 10000, ptds_mode, NULL) + + global __cuGraphAddEmptyNode + _F_cuGetProcAddress_v2('cuGraphAddEmptyNode', &__cuGraphAddEmptyNode, 10000, ptds_mode, NULL) + + global __cuGraphAddEventRecordNode + _F_cuGetProcAddress_v2('cuGraphAddEventRecordNode', &__cuGraphAddEventRecordNode, 11010, ptds_mode, NULL) + + global __cuGraphEventRecordNodeGetEvent + _F_cuGetProcAddress_v2('cuGraphEventRecordNodeGetEvent', &__cuGraphEventRecordNodeGetEvent, 11010, ptds_mode, NULL) + + global __cuGraphEventRecordNodeSetEvent + _F_cuGetProcAddress_v2('cuGraphEventRecordNodeSetEvent', &__cuGraphEventRecordNodeSetEvent, 11010, ptds_mode, NULL) + + global __cuGraphAddEventWaitNode + _F_cuGetProcAddress_v2('cuGraphAddEventWaitNode', &__cuGraphAddEventWaitNode, 11010, ptds_mode, NULL) + + global __cuGraphEventWaitNodeGetEvent + _F_cuGetProcAddress_v2('cuGraphEventWaitNodeGetEvent', &__cuGraphEventWaitNodeGetEvent, 11010, ptds_mode, NULL) + + global __cuGraphEventWaitNodeSetEvent + _F_cuGetProcAddress_v2('cuGraphEventWaitNodeSetEvent', &__cuGraphEventWaitNodeSetEvent, 11010, ptds_mode, NULL) + + global __cuGraphAddExternalSemaphoresSignalNode + _F_cuGetProcAddress_v2('cuGraphAddExternalSemaphoresSignalNode', &__cuGraphAddExternalSemaphoresSignalNode, 11020, ptds_mode, NULL) + + global __cuGraphExternalSemaphoresSignalNodeGetParams + _F_cuGetProcAddress_v2('cuGraphExternalSemaphoresSignalNodeGetParams', &__cuGraphExternalSemaphoresSignalNodeGetParams, 11020, ptds_mode, NULL) + + global __cuGraphExternalSemaphoresSignalNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExternalSemaphoresSignalNodeSetParams', &__cuGraphExternalSemaphoresSignalNodeSetParams, 11020, ptds_mode, NULL) + + global __cuGraphAddExternalSemaphoresWaitNode + _F_cuGetProcAddress_v2('cuGraphAddExternalSemaphoresWaitNode', &__cuGraphAddExternalSemaphoresWaitNode, 11020, ptds_mode, NULL) + + global __cuGraphExternalSemaphoresWaitNodeGetParams + _F_cuGetProcAddress_v2('cuGraphExternalSemaphoresWaitNodeGetParams', &__cuGraphExternalSemaphoresWaitNodeGetParams, 11020, ptds_mode, NULL) + + global __cuGraphExternalSemaphoresWaitNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExternalSemaphoresWaitNodeSetParams', &__cuGraphExternalSemaphoresWaitNodeSetParams, 11020, ptds_mode, NULL) + + global __cuGraphAddBatchMemOpNode + _F_cuGetProcAddress_v2('cuGraphAddBatchMemOpNode', &__cuGraphAddBatchMemOpNode, 11070, ptds_mode, NULL) + + global __cuGraphBatchMemOpNodeGetParams + _F_cuGetProcAddress_v2('cuGraphBatchMemOpNodeGetParams', &__cuGraphBatchMemOpNodeGetParams, 11070, ptds_mode, NULL) + + global __cuGraphBatchMemOpNodeSetParams + _F_cuGetProcAddress_v2('cuGraphBatchMemOpNodeSetParams', &__cuGraphBatchMemOpNodeSetParams, 11070, ptds_mode, NULL) + + global __cuGraphExecBatchMemOpNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecBatchMemOpNodeSetParams', &__cuGraphExecBatchMemOpNodeSetParams, 11070, ptds_mode, NULL) + + global __cuGraphAddMemAllocNode + _F_cuGetProcAddress_v2('cuGraphAddMemAllocNode', &__cuGraphAddMemAllocNode, 11040, ptds_mode, NULL) + + global __cuGraphMemAllocNodeGetParams + _F_cuGetProcAddress_v2('cuGraphMemAllocNodeGetParams', &__cuGraphMemAllocNodeGetParams, 11040, ptds_mode, NULL) + + global __cuGraphAddMemFreeNode + _F_cuGetProcAddress_v2('cuGraphAddMemFreeNode', &__cuGraphAddMemFreeNode, 11040, ptds_mode, NULL) + + global __cuGraphMemFreeNodeGetParams + _F_cuGetProcAddress_v2('cuGraphMemFreeNodeGetParams', &__cuGraphMemFreeNodeGetParams, 11040, ptds_mode, NULL) + + global __cuDeviceGraphMemTrim + _F_cuGetProcAddress_v2('cuDeviceGraphMemTrim', &__cuDeviceGraphMemTrim, 11040, ptds_mode, NULL) + + global __cuDeviceGetGraphMemAttribute + _F_cuGetProcAddress_v2('cuDeviceGetGraphMemAttribute', &__cuDeviceGetGraphMemAttribute, 11040, ptds_mode, NULL) + + global __cuDeviceSetGraphMemAttribute + _F_cuGetProcAddress_v2('cuDeviceSetGraphMemAttribute', &__cuDeviceSetGraphMemAttribute, 11040, ptds_mode, NULL) + + global __cuGraphClone + _F_cuGetProcAddress_v2('cuGraphClone', &__cuGraphClone, 10000, ptds_mode, NULL) + + global __cuGraphNodeFindInClone + _F_cuGetProcAddress_v2('cuGraphNodeFindInClone', &__cuGraphNodeFindInClone, 10000, ptds_mode, NULL) + + global __cuGraphNodeGetType + _F_cuGetProcAddress_v2('cuGraphNodeGetType', &__cuGraphNodeGetType, 10000, ptds_mode, NULL) + + global __cuGraphGetNodes + _F_cuGetProcAddress_v2('cuGraphGetNodes', &__cuGraphGetNodes, 10000, ptds_mode, NULL) + + global __cuGraphGetRootNodes + _F_cuGetProcAddress_v2('cuGraphGetRootNodes', &__cuGraphGetRootNodes, 10000, ptds_mode, NULL) + + global __cuGraphGetEdges_v2 + _F_cuGetProcAddress_v2('cuGraphGetEdges', &__cuGraphGetEdges_v2, 12030, ptds_mode, NULL) + + global __cuGraphNodeGetDependencies_v2 + _F_cuGetProcAddress_v2('cuGraphNodeGetDependencies', &__cuGraphNodeGetDependencies_v2, 12030, ptds_mode, NULL) + + global __cuGraphNodeGetDependentNodes_v2 + _F_cuGetProcAddress_v2('cuGraphNodeGetDependentNodes', &__cuGraphNodeGetDependentNodes_v2, 12030, ptds_mode, NULL) + + global __cuGraphAddDependencies_v2 + _F_cuGetProcAddress_v2('cuGraphAddDependencies', &__cuGraphAddDependencies_v2, 12030, ptds_mode, NULL) + + global __cuGraphRemoveDependencies_v2 + _F_cuGetProcAddress_v2('cuGraphRemoveDependencies', &__cuGraphRemoveDependencies_v2, 12030, ptds_mode, NULL) + + global __cuGraphDestroyNode + _F_cuGetProcAddress_v2('cuGraphDestroyNode', &__cuGraphDestroyNode, 10000, ptds_mode, NULL) + + global __cuGraphInstantiateWithFlags + _F_cuGetProcAddress_v2('cuGraphInstantiateWithFlags', &__cuGraphInstantiateWithFlags, 11040, ptds_mode, NULL) + + global __cuGraphInstantiateWithParams + _F_cuGetProcAddress_v2('cuGraphInstantiateWithParams', &__cuGraphInstantiateWithParams, 12000, ptds_mode, NULL) + + global __cuGraphExecGetFlags + _F_cuGetProcAddress_v2('cuGraphExecGetFlags', &__cuGraphExecGetFlags, 12000, ptds_mode, NULL) + + global __cuGraphExecKernelNodeSetParams_v2 + _F_cuGetProcAddress_v2('cuGraphExecKernelNodeSetParams', &__cuGraphExecKernelNodeSetParams_v2, 12000, ptds_mode, NULL) + + global __cuGraphExecMemcpyNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecMemcpyNodeSetParams', &__cuGraphExecMemcpyNodeSetParams, 10020, ptds_mode, NULL) + + global __cuGraphExecMemsetNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecMemsetNodeSetParams', &__cuGraphExecMemsetNodeSetParams, 10020, ptds_mode, NULL) + + global __cuGraphExecHostNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecHostNodeSetParams', &__cuGraphExecHostNodeSetParams, 10020, ptds_mode, NULL) + + global __cuGraphExecChildGraphNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecChildGraphNodeSetParams', &__cuGraphExecChildGraphNodeSetParams, 11010, ptds_mode, NULL) + + global __cuGraphExecEventRecordNodeSetEvent + _F_cuGetProcAddress_v2('cuGraphExecEventRecordNodeSetEvent', &__cuGraphExecEventRecordNodeSetEvent, 11010, ptds_mode, NULL) + + global __cuGraphExecEventWaitNodeSetEvent + _F_cuGetProcAddress_v2('cuGraphExecEventWaitNodeSetEvent', &__cuGraphExecEventWaitNodeSetEvent, 11010, ptds_mode, NULL) + + global __cuGraphExecExternalSemaphoresSignalNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecExternalSemaphoresSignalNodeSetParams', &__cuGraphExecExternalSemaphoresSignalNodeSetParams, 11020, ptds_mode, NULL) + + global __cuGraphExecExternalSemaphoresWaitNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecExternalSemaphoresWaitNodeSetParams', &__cuGraphExecExternalSemaphoresWaitNodeSetParams, 11020, ptds_mode, NULL) + + global __cuGraphNodeSetEnabled + _F_cuGetProcAddress_v2('cuGraphNodeSetEnabled', &__cuGraphNodeSetEnabled, 11060, ptds_mode, NULL) + + global __cuGraphNodeGetEnabled + _F_cuGetProcAddress_v2('cuGraphNodeGetEnabled', &__cuGraphNodeGetEnabled, 11060, ptds_mode, NULL) + + global __cuGraphUpload + _F_cuGetProcAddress_v2('cuGraphUpload', &__cuGraphUpload, 11010, ptds_mode, NULL) + + global __cuGraphLaunch + _F_cuGetProcAddress_v2('cuGraphLaunch', &__cuGraphLaunch, 10000, ptds_mode, NULL) + + global __cuGraphExecDestroy + _F_cuGetProcAddress_v2('cuGraphExecDestroy', &__cuGraphExecDestroy, 10000, ptds_mode, NULL) + + global __cuGraphDestroy + _F_cuGetProcAddress_v2('cuGraphDestroy', &__cuGraphDestroy, 10000, ptds_mode, NULL) + + global __cuGraphExecUpdate_v2 + _F_cuGetProcAddress_v2('cuGraphExecUpdate', &__cuGraphExecUpdate_v2, 12000, ptds_mode, NULL) + + global __cuGraphKernelNodeCopyAttributes + _F_cuGetProcAddress_v2('cuGraphKernelNodeCopyAttributes', &__cuGraphKernelNodeCopyAttributes, 11000, ptds_mode, NULL) + + global __cuGraphKernelNodeGetAttribute + _F_cuGetProcAddress_v2('cuGraphKernelNodeGetAttribute', &__cuGraphKernelNodeGetAttribute, 11000, ptds_mode, NULL) + + global __cuGraphKernelNodeSetAttribute + _F_cuGetProcAddress_v2('cuGraphKernelNodeSetAttribute', &__cuGraphKernelNodeSetAttribute, 11000, ptds_mode, NULL) + + global __cuGraphDebugDotPrint + _F_cuGetProcAddress_v2('cuGraphDebugDotPrint', &__cuGraphDebugDotPrint, 11030, ptds_mode, NULL) + + global __cuUserObjectCreate + _F_cuGetProcAddress_v2('cuUserObjectCreate', &__cuUserObjectCreate, 11030, ptds_mode, NULL) + + global __cuUserObjectRetain + _F_cuGetProcAddress_v2('cuUserObjectRetain', &__cuUserObjectRetain, 11030, ptds_mode, NULL) + + global __cuUserObjectRelease + _F_cuGetProcAddress_v2('cuUserObjectRelease', &__cuUserObjectRelease, 11030, ptds_mode, NULL) + + global __cuGraphRetainUserObject + _F_cuGetProcAddress_v2('cuGraphRetainUserObject', &__cuGraphRetainUserObject, 11030, ptds_mode, NULL) + + global __cuGraphReleaseUserObject + _F_cuGetProcAddress_v2('cuGraphReleaseUserObject', &__cuGraphReleaseUserObject, 11030, ptds_mode, NULL) + + global __cuGraphAddNode_v2 + _F_cuGetProcAddress_v2('cuGraphAddNode', &__cuGraphAddNode_v2, 12030, ptds_mode, NULL) + + global __cuGraphNodeSetParams + _F_cuGetProcAddress_v2('cuGraphNodeSetParams', &__cuGraphNodeSetParams, 12020, ptds_mode, NULL) + + global __cuGraphExecNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecNodeSetParams', &__cuGraphExecNodeSetParams, 12020, ptds_mode, NULL) + + global __cuGraphConditionalHandleCreate + _F_cuGetProcAddress_v2('cuGraphConditionalHandleCreate', &__cuGraphConditionalHandleCreate, 12030, ptds_mode, NULL) + + global __cuOccupancyMaxActiveBlocksPerMultiprocessor + _F_cuGetProcAddress_v2('cuOccupancyMaxActiveBlocksPerMultiprocessor', &__cuOccupancyMaxActiveBlocksPerMultiprocessor, 6050, ptds_mode, NULL) + + global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags + _F_cuGetProcAddress_v2('cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags', &__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags, 7000, ptds_mode, NULL) + + global __cuOccupancyMaxPotentialBlockSize + _F_cuGetProcAddress_v2('cuOccupancyMaxPotentialBlockSize', &__cuOccupancyMaxPotentialBlockSize, 6050, ptds_mode, NULL) + + global __cuOccupancyMaxPotentialBlockSizeWithFlags + _F_cuGetProcAddress_v2('cuOccupancyMaxPotentialBlockSizeWithFlags', &__cuOccupancyMaxPotentialBlockSizeWithFlags, 7000, ptds_mode, NULL) + + global __cuOccupancyAvailableDynamicSMemPerBlock + _F_cuGetProcAddress_v2('cuOccupancyAvailableDynamicSMemPerBlock', &__cuOccupancyAvailableDynamicSMemPerBlock, 10020, ptds_mode, NULL) + + global __cuOccupancyMaxPotentialClusterSize + _F_cuGetProcAddress_v2('cuOccupancyMaxPotentialClusterSize', &__cuOccupancyMaxPotentialClusterSize, 11070, ptds_mode, NULL) + + global __cuOccupancyMaxActiveClusters + _F_cuGetProcAddress_v2('cuOccupancyMaxActiveClusters', &__cuOccupancyMaxActiveClusters, 11070, ptds_mode, NULL) + + global __cuTexRefSetArray + _F_cuGetProcAddress_v2('cuTexRefSetArray', &__cuTexRefSetArray, 2000, ptds_mode, NULL) + + global __cuTexRefSetMipmappedArray + _F_cuGetProcAddress_v2('cuTexRefSetMipmappedArray', &__cuTexRefSetMipmappedArray, 5000, ptds_mode, NULL) + + global __cuTexRefSetAddress_v2 + _F_cuGetProcAddress_v2('cuTexRefSetAddress', &__cuTexRefSetAddress_v2, 3020, ptds_mode, NULL) + + global __cuTexRefSetAddress2D_v3 + _F_cuGetProcAddress_v2('cuTexRefSetAddress2D', &__cuTexRefSetAddress2D_v3, 4010, ptds_mode, NULL) + + global __cuTexRefSetFormat + _F_cuGetProcAddress_v2('cuTexRefSetFormat', &__cuTexRefSetFormat, 2000, ptds_mode, NULL) + + global __cuTexRefSetAddressMode + _F_cuGetProcAddress_v2('cuTexRefSetAddressMode', &__cuTexRefSetAddressMode, 2000, ptds_mode, NULL) + + global __cuTexRefSetFilterMode + _F_cuGetProcAddress_v2('cuTexRefSetFilterMode', &__cuTexRefSetFilterMode, 2000, ptds_mode, NULL) + + global __cuTexRefSetMipmapFilterMode + _F_cuGetProcAddress_v2('cuTexRefSetMipmapFilterMode', &__cuTexRefSetMipmapFilterMode, 5000, ptds_mode, NULL) + + global __cuTexRefSetMipmapLevelBias + _F_cuGetProcAddress_v2('cuTexRefSetMipmapLevelBias', &__cuTexRefSetMipmapLevelBias, 5000, ptds_mode, NULL) + + global __cuTexRefSetMipmapLevelClamp + _F_cuGetProcAddress_v2('cuTexRefSetMipmapLevelClamp', &__cuTexRefSetMipmapLevelClamp, 5000, ptds_mode, NULL) + + global __cuTexRefSetMaxAnisotropy + _F_cuGetProcAddress_v2('cuTexRefSetMaxAnisotropy', &__cuTexRefSetMaxAnisotropy, 5000, ptds_mode, NULL) + + global __cuTexRefSetBorderColor + _F_cuGetProcAddress_v2('cuTexRefSetBorderColor', &__cuTexRefSetBorderColor, 8000, ptds_mode, NULL) + + global __cuTexRefSetFlags + _F_cuGetProcAddress_v2('cuTexRefSetFlags', &__cuTexRefSetFlags, 2000, ptds_mode, NULL) + + global __cuTexRefGetAddress_v2 + _F_cuGetProcAddress_v2('cuTexRefGetAddress', &__cuTexRefGetAddress_v2, 3020, ptds_mode, NULL) + + global __cuTexRefGetArray + _F_cuGetProcAddress_v2('cuTexRefGetArray', &__cuTexRefGetArray, 2000, ptds_mode, NULL) + + global __cuTexRefGetMipmappedArray + _F_cuGetProcAddress_v2('cuTexRefGetMipmappedArray', &__cuTexRefGetMipmappedArray, 5000, ptds_mode, NULL) + + global __cuTexRefGetAddressMode + _F_cuGetProcAddress_v2('cuTexRefGetAddressMode', &__cuTexRefGetAddressMode, 2000, ptds_mode, NULL) + + global __cuTexRefGetFilterMode + _F_cuGetProcAddress_v2('cuTexRefGetFilterMode', &__cuTexRefGetFilterMode, 2000, ptds_mode, NULL) + + global __cuTexRefGetFormat + _F_cuGetProcAddress_v2('cuTexRefGetFormat', &__cuTexRefGetFormat, 2000, ptds_mode, NULL) + + global __cuTexRefGetMipmapFilterMode + _F_cuGetProcAddress_v2('cuTexRefGetMipmapFilterMode', &__cuTexRefGetMipmapFilterMode, 5000, ptds_mode, NULL) + + global __cuTexRefGetMipmapLevelBias + _F_cuGetProcAddress_v2('cuTexRefGetMipmapLevelBias', &__cuTexRefGetMipmapLevelBias, 5000, ptds_mode, NULL) + + global __cuTexRefGetMipmapLevelClamp + _F_cuGetProcAddress_v2('cuTexRefGetMipmapLevelClamp', &__cuTexRefGetMipmapLevelClamp, 5000, ptds_mode, NULL) + + global __cuTexRefGetMaxAnisotropy + _F_cuGetProcAddress_v2('cuTexRefGetMaxAnisotropy', &__cuTexRefGetMaxAnisotropy, 5000, ptds_mode, NULL) + + global __cuTexRefGetBorderColor + _F_cuGetProcAddress_v2('cuTexRefGetBorderColor', &__cuTexRefGetBorderColor, 8000, ptds_mode, NULL) + + global __cuTexRefGetFlags + _F_cuGetProcAddress_v2('cuTexRefGetFlags', &__cuTexRefGetFlags, 2000, ptds_mode, NULL) + + global __cuTexRefCreate + _F_cuGetProcAddress_v2('cuTexRefCreate', &__cuTexRefCreate, 2000, ptds_mode, NULL) + + global __cuTexRefDestroy + _F_cuGetProcAddress_v2('cuTexRefDestroy', &__cuTexRefDestroy, 2000, ptds_mode, NULL) + + global __cuSurfRefSetArray + _F_cuGetProcAddress_v2('cuSurfRefSetArray', &__cuSurfRefSetArray, 3000, ptds_mode, NULL) + + global __cuSurfRefGetArray + _F_cuGetProcAddress_v2('cuSurfRefGetArray', &__cuSurfRefGetArray, 3000, ptds_mode, NULL) + + global __cuTexObjectCreate + _F_cuGetProcAddress_v2('cuTexObjectCreate', &__cuTexObjectCreate, 5000, ptds_mode, NULL) + + global __cuTexObjectDestroy + _F_cuGetProcAddress_v2('cuTexObjectDestroy', &__cuTexObjectDestroy, 5000, ptds_mode, NULL) + + global __cuTexObjectGetResourceDesc + _F_cuGetProcAddress_v2('cuTexObjectGetResourceDesc', &__cuTexObjectGetResourceDesc, 5000, ptds_mode, NULL) + + global __cuTexObjectGetTextureDesc + _F_cuGetProcAddress_v2('cuTexObjectGetTextureDesc', &__cuTexObjectGetTextureDesc, 5000, ptds_mode, NULL) + + global __cuTexObjectGetResourceViewDesc + _F_cuGetProcAddress_v2('cuTexObjectGetResourceViewDesc', &__cuTexObjectGetResourceViewDesc, 5000, ptds_mode, NULL) + + global __cuSurfObjectCreate + _F_cuGetProcAddress_v2('cuSurfObjectCreate', &__cuSurfObjectCreate, 5000, ptds_mode, NULL) + + global __cuSurfObjectDestroy + _F_cuGetProcAddress_v2('cuSurfObjectDestroy', &__cuSurfObjectDestroy, 5000, ptds_mode, NULL) + + global __cuSurfObjectGetResourceDesc + _F_cuGetProcAddress_v2('cuSurfObjectGetResourceDesc', &__cuSurfObjectGetResourceDesc, 5000, ptds_mode, NULL) + + global __cuTensorMapEncodeTiled + _F_cuGetProcAddress_v2('cuTensorMapEncodeTiled', &__cuTensorMapEncodeTiled, 12000, ptds_mode, NULL) + + global __cuTensorMapEncodeIm2col + _F_cuGetProcAddress_v2('cuTensorMapEncodeIm2col', &__cuTensorMapEncodeIm2col, 12000, ptds_mode, NULL) + + global __cuTensorMapEncodeIm2colWide + _F_cuGetProcAddress_v2('cuTensorMapEncodeIm2colWide', &__cuTensorMapEncodeIm2colWide, 12080, ptds_mode, NULL) + + global __cuTensorMapReplaceAddress + _F_cuGetProcAddress_v2('cuTensorMapReplaceAddress', &__cuTensorMapReplaceAddress, 12000, ptds_mode, NULL) + + global __cuDeviceCanAccessPeer + _F_cuGetProcAddress_v2('cuDeviceCanAccessPeer', &__cuDeviceCanAccessPeer, 4000, ptds_mode, NULL) + + global __cuCtxEnablePeerAccess + _F_cuGetProcAddress_v2('cuCtxEnablePeerAccess', &__cuCtxEnablePeerAccess, 4000, ptds_mode, NULL) + + global __cuCtxDisablePeerAccess + _F_cuGetProcAddress_v2('cuCtxDisablePeerAccess', &__cuCtxDisablePeerAccess, 4000, ptds_mode, NULL) + + global __cuDeviceGetP2PAttribute + _F_cuGetProcAddress_v2('cuDeviceGetP2PAttribute', &__cuDeviceGetP2PAttribute, 8000, ptds_mode, NULL) + + global __cuGraphicsUnregisterResource + _F_cuGetProcAddress_v2('cuGraphicsUnregisterResource', &__cuGraphicsUnregisterResource, 3000, ptds_mode, NULL) + + global __cuGraphicsSubResourceGetMappedArray + _F_cuGetProcAddress_v2('cuGraphicsSubResourceGetMappedArray', &__cuGraphicsSubResourceGetMappedArray, 3000, ptds_mode, NULL) + + global __cuGraphicsResourceGetMappedMipmappedArray + _F_cuGetProcAddress_v2('cuGraphicsResourceGetMappedMipmappedArray', &__cuGraphicsResourceGetMappedMipmappedArray, 5000, ptds_mode, NULL) + + global __cuGraphicsResourceGetMappedPointer_v2 + _F_cuGetProcAddress_v2('cuGraphicsResourceGetMappedPointer', &__cuGraphicsResourceGetMappedPointer_v2, 3020, ptds_mode, NULL) + + global __cuGraphicsResourceSetMapFlags_v2 + _F_cuGetProcAddress_v2('cuGraphicsResourceSetMapFlags', &__cuGraphicsResourceSetMapFlags_v2, 6050, ptds_mode, NULL) + + global __cuGraphicsMapResources + _F_cuGetProcAddress_v2('cuGraphicsMapResources', &__cuGraphicsMapResources, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3000, ptds_mode, NULL) + + global __cuGraphicsUnmapResources + _F_cuGetProcAddress_v2('cuGraphicsUnmapResources', &__cuGraphicsUnmapResources, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3000, ptds_mode, NULL) + + global __cuGetProcAddress_v2 + _F_cuGetProcAddress_v2('cuGetProcAddress', &__cuGetProcAddress_v2, 12000, ptds_mode, NULL) + + global __cuCoredumpGetAttribute + _F_cuGetProcAddress_v2('cuCoredumpGetAttribute', &__cuCoredumpGetAttribute, 12010, ptds_mode, NULL) + + global __cuCoredumpGetAttributeGlobal + _F_cuGetProcAddress_v2('cuCoredumpGetAttributeGlobal', &__cuCoredumpGetAttributeGlobal, 12010, ptds_mode, NULL) + + global __cuCoredumpSetAttribute + _F_cuGetProcAddress_v2('cuCoredumpSetAttribute', &__cuCoredumpSetAttribute, 12010, ptds_mode, NULL) + + global __cuCoredumpSetAttributeGlobal + _F_cuGetProcAddress_v2('cuCoredumpSetAttributeGlobal', &__cuCoredumpSetAttributeGlobal, 12010, ptds_mode, NULL) + + global __cuGetExportTable + _F_cuGetProcAddress_v2('cuGetExportTable', &__cuGetExportTable, 3000, ptds_mode, NULL) + + global __cuGreenCtxCreate + _F_cuGetProcAddress_v2('cuGreenCtxCreate', &__cuGreenCtxCreate, 12040, ptds_mode, NULL) + + global __cuGreenCtxDestroy + _F_cuGetProcAddress_v2('cuGreenCtxDestroy', &__cuGreenCtxDestroy, 12040, ptds_mode, NULL) + + global __cuCtxFromGreenCtx + _F_cuGetProcAddress_v2('cuCtxFromGreenCtx', &__cuCtxFromGreenCtx, 12040, ptds_mode, NULL) + + global __cuDeviceGetDevResource + _F_cuGetProcAddress_v2('cuDeviceGetDevResource', &__cuDeviceGetDevResource, 12040, ptds_mode, NULL) + + global __cuCtxGetDevResource + _F_cuGetProcAddress_v2('cuCtxGetDevResource', &__cuCtxGetDevResource, 12040, ptds_mode, NULL) + + global __cuGreenCtxGetDevResource + _F_cuGetProcAddress_v2('cuGreenCtxGetDevResource', &__cuGreenCtxGetDevResource, 12040, ptds_mode, NULL) + + global __cuDevSmResourceSplitByCount + _F_cuGetProcAddress_v2('cuDevSmResourceSplitByCount', &__cuDevSmResourceSplitByCount, 12040, ptds_mode, NULL) + + global __cuDevResourceGenerateDesc + _F_cuGetProcAddress_v2('cuDevResourceGenerateDesc', &__cuDevResourceGenerateDesc, 12040, ptds_mode, NULL) + + global __cuGreenCtxRecordEvent + _F_cuGetProcAddress_v2('cuGreenCtxRecordEvent', &__cuGreenCtxRecordEvent, 12040, ptds_mode, NULL) + + global __cuGreenCtxWaitEvent + _F_cuGetProcAddress_v2('cuGreenCtxWaitEvent', &__cuGreenCtxWaitEvent, 12040, ptds_mode, NULL) + + global __cuStreamGetGreenCtx + _F_cuGetProcAddress_v2('cuStreamGetGreenCtx', &__cuStreamGetGreenCtx, 12040, ptds_mode, NULL) + + global __cuGreenCtxStreamCreate + _F_cuGetProcAddress_v2('cuGreenCtxStreamCreate', &__cuGreenCtxStreamCreate, 12050, ptds_mode, NULL) + + global __cuLogsRegisterCallback + _F_cuGetProcAddress_v2('cuLogsRegisterCallback', &__cuLogsRegisterCallback, 12080, ptds_mode, NULL) + + global __cuLogsUnregisterCallback + _F_cuGetProcAddress_v2('cuLogsUnregisterCallback', &__cuLogsUnregisterCallback, 12080, ptds_mode, NULL) + + global __cuLogsCurrent + _F_cuGetProcAddress_v2('cuLogsCurrent', &__cuLogsCurrent, 12080, ptds_mode, NULL) + + global __cuLogsDumpToFile + _F_cuGetProcAddress_v2('cuLogsDumpToFile', &__cuLogsDumpToFile, 12080, ptds_mode, NULL) + + global __cuLogsDumpToMemory + _F_cuGetProcAddress_v2('cuLogsDumpToMemory', &__cuLogsDumpToMemory, 12080, ptds_mode, NULL) + + global __cuCheckpointProcessGetRestoreThreadId + _F_cuGetProcAddress_v2('cuCheckpointProcessGetRestoreThreadId', &__cuCheckpointProcessGetRestoreThreadId, 12080, ptds_mode, NULL) + + global __cuCheckpointProcessGetState + _F_cuGetProcAddress_v2('cuCheckpointProcessGetState', &__cuCheckpointProcessGetState, 12080, ptds_mode, NULL) + + global __cuCheckpointProcessLock + _F_cuGetProcAddress_v2('cuCheckpointProcessLock', &__cuCheckpointProcessLock, 12080, ptds_mode, NULL) + + global __cuCheckpointProcessCheckpoint + _F_cuGetProcAddress_v2('cuCheckpointProcessCheckpoint', &__cuCheckpointProcessCheckpoint, 12080, ptds_mode, NULL) + + global __cuCheckpointProcessRestore + _F_cuGetProcAddress_v2('cuCheckpointProcessRestore', &__cuCheckpointProcessRestore, 12080, ptds_mode, NULL) + + global __cuCheckpointProcessUnlock + _F_cuGetProcAddress_v2('cuCheckpointProcessUnlock', &__cuCheckpointProcessUnlock, 12080, ptds_mode, NULL) + + global __cuGraphicsEGLRegisterImage + _F_cuGetProcAddress_v2('cuGraphicsEGLRegisterImage', &__cuGraphicsEGLRegisterImage, 7000, ptds_mode, NULL) + + global __cuEGLStreamConsumerConnect + _F_cuGetProcAddress_v2('cuEGLStreamConsumerConnect', &__cuEGLStreamConsumerConnect, 7000, ptds_mode, NULL) + + global __cuEGLStreamConsumerConnectWithFlags + _F_cuGetProcAddress_v2('cuEGLStreamConsumerConnectWithFlags', &__cuEGLStreamConsumerConnectWithFlags, 8000, ptds_mode, NULL) + + global __cuEGLStreamConsumerDisconnect + _F_cuGetProcAddress_v2('cuEGLStreamConsumerDisconnect', &__cuEGLStreamConsumerDisconnect, 7000, ptds_mode, NULL) + + global __cuEGLStreamConsumerAcquireFrame + _F_cuGetProcAddress_v2('cuEGLStreamConsumerAcquireFrame', &__cuEGLStreamConsumerAcquireFrame, 7000, ptds_mode, NULL) + + global __cuEGLStreamConsumerReleaseFrame + _F_cuGetProcAddress_v2('cuEGLStreamConsumerReleaseFrame', &__cuEGLStreamConsumerReleaseFrame, 7000, ptds_mode, NULL) + + global __cuEGLStreamProducerConnect + _F_cuGetProcAddress_v2('cuEGLStreamProducerConnect', &__cuEGLStreamProducerConnect, 7000, ptds_mode, NULL) + + global __cuEGLStreamProducerDisconnect + _F_cuGetProcAddress_v2('cuEGLStreamProducerDisconnect', &__cuEGLStreamProducerDisconnect, 7000, ptds_mode, NULL) + + global __cuEGLStreamProducerPresentFrame + _F_cuGetProcAddress_v2('cuEGLStreamProducerPresentFrame', &__cuEGLStreamProducerPresentFrame, 7000, ptds_mode, NULL) + + global __cuEGLStreamProducerReturnFrame + _F_cuGetProcAddress_v2('cuEGLStreamProducerReturnFrame', &__cuEGLStreamProducerReturnFrame, 7000, ptds_mode, NULL) + + global __cuGraphicsResourceGetMappedEglFrame + _F_cuGetProcAddress_v2('cuGraphicsResourceGetMappedEglFrame', &__cuGraphicsResourceGetMappedEglFrame, 7000, ptds_mode, NULL) + + global __cuEventCreateFromEGLSync + _F_cuGetProcAddress_v2('cuEventCreateFromEGLSync', &__cuEventCreateFromEGLSync, 9000, ptds_mode, NULL) + + global __cuGraphicsGLRegisterBuffer + _F_cuGetProcAddress_v2('cuGraphicsGLRegisterBuffer', &__cuGraphicsGLRegisterBuffer, 3000, ptds_mode, NULL) + + global __cuGraphicsGLRegisterImage + _F_cuGetProcAddress_v2('cuGraphicsGLRegisterImage', &__cuGraphicsGLRegisterImage, 3000, ptds_mode, NULL) + + global __cuGLGetDevices_v2 + _F_cuGetProcAddress_v2('cuGLGetDevices', &__cuGLGetDevices_v2, 6050, ptds_mode, NULL) + + global __cuGLCtxCreate_v2 + _F_cuGetProcAddress_v2('cuGLCtxCreate', &__cuGLCtxCreate_v2, 3020, ptds_mode, NULL) + + global __cuGLInit + _F_cuGetProcAddress_v2('cuGLInit', &__cuGLInit, 2000, ptds_mode, NULL) + + global __cuGLRegisterBufferObject + _F_cuGetProcAddress_v2('cuGLRegisterBufferObject', &__cuGLRegisterBufferObject, 2000, ptds_mode, NULL) + + global __cuGLMapBufferObject_v2 + _F_cuGetProcAddress_v2('cuGLMapBufferObject', &__cuGLMapBufferObject_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuGLUnmapBufferObject + _F_cuGetProcAddress_v2('cuGLUnmapBufferObject', &__cuGLUnmapBufferObject, 2000, ptds_mode, NULL) + + global __cuGLUnregisterBufferObject + _F_cuGetProcAddress_v2('cuGLUnregisterBufferObject', &__cuGLUnregisterBufferObject, 2000, ptds_mode, NULL) + + global __cuGLSetBufferObjectMapFlags + _F_cuGetProcAddress_v2('cuGLSetBufferObjectMapFlags', &__cuGLSetBufferObjectMapFlags, 2030, ptds_mode, NULL) + + global __cuGLMapBufferObjectAsync_v2 + _F_cuGetProcAddress_v2('cuGLMapBufferObjectAsync', &__cuGLMapBufferObjectAsync_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuGLUnmapBufferObjectAsync + _F_cuGetProcAddress_v2('cuGLUnmapBufferObjectAsync', &__cuGLUnmapBufferObjectAsync, 2030, ptds_mode, NULL) + + global __cuProfilerInitialize + _F_cuGetProcAddress_v2('cuProfilerInitialize', &__cuProfilerInitialize, 4000, ptds_mode, NULL) + + global __cuProfilerStart + _F_cuGetProcAddress_v2('cuProfilerStart', &__cuProfilerStart, 4000, ptds_mode, NULL) + + global __cuProfilerStop + _F_cuGetProcAddress_v2('cuProfilerStop', &__cuProfilerStop, 4000, ptds_mode, NULL) + + global __cuVDPAUGetDevice + _F_cuGetProcAddress_v2('cuVDPAUGetDevice', &__cuVDPAUGetDevice, 3010, ptds_mode, NULL) + + global __cuVDPAUCtxCreate_v2 + _F_cuGetProcAddress_v2('cuVDPAUCtxCreate', &__cuVDPAUCtxCreate_v2, 3020, ptds_mode, NULL) + + global __cuGraphicsVDPAURegisterVideoSurface + _F_cuGetProcAddress_v2('cuGraphicsVDPAURegisterVideoSurface', &__cuGraphicsVDPAURegisterVideoSurface, 3010, ptds_mode, NULL) + + global __cuGraphicsVDPAURegisterOutputSurface + _F_cuGetProcAddress_v2('cuGraphicsVDPAURegisterOutputSurface', &__cuGraphicsVDPAURegisterOutputSurface, 3010, ptds_mode, NULL) + + global __cuDeviceGetHostAtomicCapabilities + _F_cuGetProcAddress_v2('cuDeviceGetHostAtomicCapabilities', &__cuDeviceGetHostAtomicCapabilities, 13000, ptds_mode, NULL) + + global __cuCtxGetDevice_v2 + _F_cuGetProcAddress_v2('cuCtxGetDevice', &__cuCtxGetDevice_v2, 13000, ptds_mode, NULL) + + global __cuCtxSynchronize_v2 + _F_cuGetProcAddress_v2('cuCtxSynchronize', &__cuCtxSynchronize_v2, 13000, ptds_mode, NULL) + + global __cuMemcpyBatchAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyBatchAsync', &__cuMemcpyBatchAsync_v2, 13000, ptds_mode, NULL) + + global __cuMemcpy3DBatchAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpy3DBatchAsync', &__cuMemcpy3DBatchAsync_v2, 13000, ptds_mode, NULL) + + global __cuMemGetDefaultMemPool + _F_cuGetProcAddress_v2('cuMemGetDefaultMemPool', &__cuMemGetDefaultMemPool, 13000, ptds_mode, NULL) + + global __cuMemGetMemPool + _F_cuGetProcAddress_v2('cuMemGetMemPool', &__cuMemGetMemPool, 13000, ptds_mode, NULL) + + global __cuMemSetMemPool + _F_cuGetProcAddress_v2('cuMemSetMemPool', &__cuMemSetMemPool, 13000, ptds_mode, NULL) + + global __cuMemPrefetchBatchAsync + _F_cuGetProcAddress_v2('cuMemPrefetchBatchAsync', &__cuMemPrefetchBatchAsync, 13000, ptds_mode, NULL) + + global __cuMemDiscardBatchAsync + _F_cuGetProcAddress_v2('cuMemDiscardBatchAsync', &__cuMemDiscardBatchAsync, 13000, ptds_mode, NULL) + + global __cuMemDiscardAndPrefetchBatchAsync + _F_cuGetProcAddress_v2('cuMemDiscardAndPrefetchBatchAsync', &__cuMemDiscardAndPrefetchBatchAsync, 13000, ptds_mode, NULL) + + global __cuDeviceGetP2PAtomicCapabilities + _F_cuGetProcAddress_v2('cuDeviceGetP2PAtomicCapabilities', &__cuDeviceGetP2PAtomicCapabilities, 13000, ptds_mode, NULL) + + global __cuGreenCtxGetId + _F_cuGetProcAddress_v2('cuGreenCtxGetId', &__cuGreenCtxGetId, 13000, ptds_mode, NULL) + + global __cuMulticastBindMem_v2 + _F_cuGetProcAddress_v2('cuMulticastBindMem', &__cuMulticastBindMem_v2, 13010, ptds_mode, NULL) + + global __cuMulticastBindAddr_v2 + _F_cuGetProcAddress_v2('cuMulticastBindAddr', &__cuMulticastBindAddr_v2, 13010, ptds_mode, NULL) + + global __cuGraphNodeGetContainingGraph + _F_cuGetProcAddress_v2('cuGraphNodeGetContainingGraph', &__cuGraphNodeGetContainingGraph, 13010, ptds_mode, NULL) + + global __cuGraphNodeGetLocalId + _F_cuGetProcAddress_v2('cuGraphNodeGetLocalId', &__cuGraphNodeGetLocalId, 13010, ptds_mode, NULL) + + global __cuGraphNodeGetToolsId + _F_cuGetProcAddress_v2('cuGraphNodeGetToolsId', &__cuGraphNodeGetToolsId, 13010, ptds_mode, NULL) + + global __cuGraphGetId + _F_cuGetProcAddress_v2('cuGraphGetId', &__cuGraphGetId, 13010, ptds_mode, NULL) + + global __cuGraphExecGetId + _F_cuGetProcAddress_v2('cuGraphExecGetId', &__cuGraphExecGetId, 13010, ptds_mode, NULL) + + global __cuDevSmResourceSplit + _F_cuGetProcAddress_v2('cuDevSmResourceSplit', &__cuDevSmResourceSplit, 13010, ptds_mode, NULL) + + global __cuStreamGetDevResource + _F_cuGetProcAddress_v2('cuStreamGetDevResource', &__cuStreamGetDevResource, 13010, ptds_mode, NULL) + + global __cuKernelGetParamCount + _F_cuGetProcAddress_v2('cuKernelGetParamCount', &__cuKernelGetParamCount, 13020, ptds_mode, NULL) + + global __cuMemcpyWithAttributesAsync + _F_cuGetProcAddress_v2('cuMemcpyWithAttributesAsync', &__cuMemcpyWithAttributesAsync, 13020, ptds_mode, NULL) + + global __cuMemcpy3DWithAttributesAsync + _F_cuGetProcAddress_v2('cuMemcpy3DWithAttributesAsync', &__cuMemcpy3DWithAttributesAsync, 13020, ptds_mode, NULL) + + global __cuStreamBeginCaptureToCig + _F_cuGetProcAddress_v2('cuStreamBeginCaptureToCig', &__cuStreamBeginCaptureToCig, 13020, ptds_mode, NULL) + + global __cuStreamEndCaptureToCig + _F_cuGetProcAddress_v2('cuStreamEndCaptureToCig', &__cuStreamEndCaptureToCig, 13020, ptds_mode, NULL) + + global __cuFuncGetParamCount + _F_cuGetProcAddress_v2('cuFuncGetParamCount', &__cuFuncGetParamCount, 13020, ptds_mode, NULL) + + global __cuLaunchHostFunc_v2 + _F_cuGetProcAddress_v2('cuLaunchHostFunc', &__cuLaunchHostFunc_v2, 13020, ptds_mode, NULL) + + global __cuGraphNodeGetParams + _F_cuGetProcAddress_v2('cuGraphNodeGetParams', &__cuGraphNodeGetParams, 13020, ptds_mode, NULL) + + global __cuCoredumpRegisterStartCallback + _F_cuGetProcAddress_v2('cuCoredumpRegisterStartCallback', &__cuCoredumpRegisterStartCallback, 13020, ptds_mode, NULL) + + global __cuCoredumpRegisterCompleteCallback + _F_cuGetProcAddress_v2('cuCoredumpRegisterCompleteCallback', &__cuCoredumpRegisterCompleteCallback, 13020, ptds_mode, NULL) + + global __cuCoredumpDeregisterStartCallback + _F_cuGetProcAddress_v2('cuCoredumpDeregisterStartCallback', &__cuCoredumpDeregisterStartCallback, 13020, ptds_mode, NULL) + + global __cuCoredumpDeregisterCompleteCallback + _F_cuGetProcAddress_v2('cuCoredumpDeregisterCompleteCallback', &__cuCoredumpDeregisterCompleteCallback, 13020, ptds_mode, NULL) + + global __cuLogicalEndpointIdReserve + _F_cuGetProcAddress_v2('cuLogicalEndpointIdReserve', &__cuLogicalEndpointIdReserve, 13030, ptds_mode, NULL) + + global __cuLogicalEndpointIdRelease + _F_cuGetProcAddress_v2('cuLogicalEndpointIdRelease', &__cuLogicalEndpointIdRelease, 13030, ptds_mode, NULL) + + global __cuLogicalEndpointCreate + _F_cuGetProcAddress_v2('cuLogicalEndpointCreate', &__cuLogicalEndpointCreate, 13030, ptds_mode, NULL) + + global __cuLogicalEndpointAddDevice + _F_cuGetProcAddress_v2('cuLogicalEndpointAddDevice', &__cuLogicalEndpointAddDevice, 13030, ptds_mode, NULL) + + global __cuLogicalEndpointDestroy + _F_cuGetProcAddress_v2('cuLogicalEndpointDestroy', &__cuLogicalEndpointDestroy, 13030, ptds_mode, NULL) + + global __cuLogicalEndpointBindAddr + _F_cuGetProcAddress_v2('cuLogicalEndpointBindAddr', &__cuLogicalEndpointBindAddr, 13030, ptds_mode, NULL) + + global __cuLogicalEndpointBindMem + _F_cuGetProcAddress_v2('cuLogicalEndpointBindMem', &__cuLogicalEndpointBindMem, 13030, ptds_mode, NULL) + + global __cuLogicalEndpointUnbind + _F_cuGetProcAddress_v2('cuLogicalEndpointUnbind', &__cuLogicalEndpointUnbind, 13030, ptds_mode, NULL) + + global __cuLogicalEndpointExport + _F_cuGetProcAddress_v2('cuLogicalEndpointExport', &__cuLogicalEndpointExport, 13030, ptds_mode, NULL) + + global __cuLogicalEndpointImport + _F_cuGetProcAddress_v2('cuLogicalEndpointImport', &__cuLogicalEndpointImport, 13030, ptds_mode, NULL) + + global __cuLogicalEndpointGetLimits + _F_cuGetProcAddress_v2('cuLogicalEndpointGetLimits', &__cuLogicalEndpointGetLimits, 13030, ptds_mode, NULL) + + global __cuLogicalEndpointQuery + _F_cuGetProcAddress_v2('cuLogicalEndpointQuery', &__cuLogicalEndpointQuery, 13030, ptds_mode, NULL) + + global __cuStreamBeginRecaptureToGraph + _F_cuGetProcAddress_v2('cuStreamBeginRecaptureToGraph', &__cuStreamBeginRecaptureToGraph, 13030, ptds_mode, NULL) + + __py_driver_init = True + return 0 + + +cdef inline int _check_or_init_driver() except -1 nogil: + if __py_driver_init: + return 0 + + return _init_driver() + +cdef dict func_ptrs = None + + +cpdef dict _inspect_function_pointers(): + global func_ptrs + if func_ptrs is not None: + return func_ptrs + + _check_or_init_driver() + cdef dict data = {} + + global __cuGetErrorString + data["__cuGetErrorString"] = __cuGetErrorString + + global __cuGetErrorName + data["__cuGetErrorName"] = __cuGetErrorName + + global __cuInit + data["__cuInit"] = __cuInit + + global __cuDriverGetVersion + data["__cuDriverGetVersion"] = __cuDriverGetVersion + + global __cuDeviceGet + data["__cuDeviceGet"] = __cuDeviceGet + + global __cuDeviceGetCount + data["__cuDeviceGetCount"] = __cuDeviceGetCount + + global __cuDeviceGetName + data["__cuDeviceGetName"] = __cuDeviceGetName + + global __cuDeviceGetUuid_v2 + data["__cuDeviceGetUuid_v2"] = __cuDeviceGetUuid_v2 + + global __cuDeviceGetLuid + data["__cuDeviceGetLuid"] = __cuDeviceGetLuid + + global __cuDeviceTotalMem_v2 + data["__cuDeviceTotalMem_v2"] = __cuDeviceTotalMem_v2 + + global __cuDeviceGetTexture1DLinearMaxWidth + data["__cuDeviceGetTexture1DLinearMaxWidth"] = __cuDeviceGetTexture1DLinearMaxWidth + + global __cuDeviceGetAttribute + data["__cuDeviceGetAttribute"] = __cuDeviceGetAttribute + + global __cuDeviceGetNvSciSyncAttributes + data["__cuDeviceGetNvSciSyncAttributes"] = __cuDeviceGetNvSciSyncAttributes + + global __cuDeviceSetMemPool + data["__cuDeviceSetMemPool"] = __cuDeviceSetMemPool + + global __cuDeviceGetMemPool + data["__cuDeviceGetMemPool"] = __cuDeviceGetMemPool + + global __cuDeviceGetDefaultMemPool + data["__cuDeviceGetDefaultMemPool"] = __cuDeviceGetDefaultMemPool + + global __cuDeviceGetExecAffinitySupport + data["__cuDeviceGetExecAffinitySupport"] = __cuDeviceGetExecAffinitySupport + + global __cuFlushGPUDirectRDMAWrites + data["__cuFlushGPUDirectRDMAWrites"] = __cuFlushGPUDirectRDMAWrites + + global __cuDeviceGetProperties + data["__cuDeviceGetProperties"] = __cuDeviceGetProperties + + global __cuDeviceComputeCapability + data["__cuDeviceComputeCapability"] = __cuDeviceComputeCapability + + global __cuDevicePrimaryCtxRetain + data["__cuDevicePrimaryCtxRetain"] = __cuDevicePrimaryCtxRetain + + global __cuDevicePrimaryCtxRelease_v2 + data["__cuDevicePrimaryCtxRelease_v2"] = __cuDevicePrimaryCtxRelease_v2 + + global __cuDevicePrimaryCtxSetFlags_v2 + data["__cuDevicePrimaryCtxSetFlags_v2"] = __cuDevicePrimaryCtxSetFlags_v2 + + global __cuDevicePrimaryCtxGetState + data["__cuDevicePrimaryCtxGetState"] = __cuDevicePrimaryCtxGetState + + global __cuDevicePrimaryCtxReset_v2 + data["__cuDevicePrimaryCtxReset_v2"] = __cuDevicePrimaryCtxReset_v2 + + global __cuCtxCreate_v2 + data["__cuCtxCreate_v2"] = __cuCtxCreate_v2 + + global __cuCtxCreate_v3 + data["__cuCtxCreate_v3"] = __cuCtxCreate_v3 + + global __cuCtxCreate_v4 + data["__cuCtxCreate_v4"] = __cuCtxCreate_v4 + + global __cuCtxDestroy_v2 + data["__cuCtxDestroy_v2"] = __cuCtxDestroy_v2 + + global __cuCtxPushCurrent_v2 + data["__cuCtxPushCurrent_v2"] = __cuCtxPushCurrent_v2 + + global __cuCtxPopCurrent_v2 + data["__cuCtxPopCurrent_v2"] = __cuCtxPopCurrent_v2 + + global __cuCtxSetCurrent + data["__cuCtxSetCurrent"] = __cuCtxSetCurrent + + global __cuCtxGetCurrent + data["__cuCtxGetCurrent"] = __cuCtxGetCurrent + + global __cuCtxGetDevice + data["__cuCtxGetDevice"] = __cuCtxGetDevice + + global __cuCtxGetFlags + data["__cuCtxGetFlags"] = __cuCtxGetFlags + + global __cuCtxSetFlags + data["__cuCtxSetFlags"] = __cuCtxSetFlags + + global __cuCtxGetId + data["__cuCtxGetId"] = __cuCtxGetId + + global __cuCtxSynchronize + data["__cuCtxSynchronize"] = __cuCtxSynchronize + + global __cuCtxSetLimit + data["__cuCtxSetLimit"] = __cuCtxSetLimit + + global __cuCtxGetLimit + data["__cuCtxGetLimit"] = __cuCtxGetLimit + + global __cuCtxGetCacheConfig + data["__cuCtxGetCacheConfig"] = __cuCtxGetCacheConfig + + global __cuCtxSetCacheConfig + data["__cuCtxSetCacheConfig"] = __cuCtxSetCacheConfig + + global __cuCtxGetApiVersion + data["__cuCtxGetApiVersion"] = __cuCtxGetApiVersion + + global __cuCtxGetStreamPriorityRange + data["__cuCtxGetStreamPriorityRange"] = __cuCtxGetStreamPriorityRange + + global __cuCtxResetPersistingL2Cache + data["__cuCtxResetPersistingL2Cache"] = __cuCtxResetPersistingL2Cache + + global __cuCtxGetExecAffinity + data["__cuCtxGetExecAffinity"] = __cuCtxGetExecAffinity + + global __cuCtxRecordEvent + data["__cuCtxRecordEvent"] = __cuCtxRecordEvent + + global __cuCtxWaitEvent + data["__cuCtxWaitEvent"] = __cuCtxWaitEvent + + global __cuCtxAttach + data["__cuCtxAttach"] = __cuCtxAttach + + global __cuCtxDetach + data["__cuCtxDetach"] = __cuCtxDetach + + global __cuCtxGetSharedMemConfig + data["__cuCtxGetSharedMemConfig"] = __cuCtxGetSharedMemConfig + + global __cuCtxSetSharedMemConfig + data["__cuCtxSetSharedMemConfig"] = __cuCtxSetSharedMemConfig + + global __cuModuleLoad + data["__cuModuleLoad"] = __cuModuleLoad + + global __cuModuleLoadData + data["__cuModuleLoadData"] = __cuModuleLoadData + + global __cuModuleLoadDataEx + data["__cuModuleLoadDataEx"] = __cuModuleLoadDataEx + + global __cuModuleLoadFatBinary + data["__cuModuleLoadFatBinary"] = __cuModuleLoadFatBinary + + global __cuModuleUnload + data["__cuModuleUnload"] = __cuModuleUnload + + global __cuModuleGetLoadingMode + data["__cuModuleGetLoadingMode"] = __cuModuleGetLoadingMode + + global __cuModuleGetFunction + data["__cuModuleGetFunction"] = __cuModuleGetFunction + + global __cuModuleGetFunctionCount + data["__cuModuleGetFunctionCount"] = __cuModuleGetFunctionCount + + global __cuModuleEnumerateFunctions + data["__cuModuleEnumerateFunctions"] = __cuModuleEnumerateFunctions + + global __cuModuleGetGlobal_v2 + data["__cuModuleGetGlobal_v2"] = __cuModuleGetGlobal_v2 + + global __cuLinkCreate_v2 + data["__cuLinkCreate_v2"] = __cuLinkCreate_v2 + + global __cuLinkAddData_v2 + data["__cuLinkAddData_v2"] = __cuLinkAddData_v2 + + global __cuLinkAddFile_v2 + data["__cuLinkAddFile_v2"] = __cuLinkAddFile_v2 + + global __cuLinkComplete + data["__cuLinkComplete"] = __cuLinkComplete + + global __cuLinkDestroy + data["__cuLinkDestroy"] = __cuLinkDestroy + + global __cuModuleGetTexRef + data["__cuModuleGetTexRef"] = __cuModuleGetTexRef + + global __cuModuleGetSurfRef + data["__cuModuleGetSurfRef"] = __cuModuleGetSurfRef + + global __cuLibraryLoadData + data["__cuLibraryLoadData"] = __cuLibraryLoadData + + global __cuLibraryLoadFromFile + data["__cuLibraryLoadFromFile"] = __cuLibraryLoadFromFile + + global __cuLibraryUnload + data["__cuLibraryUnload"] = __cuLibraryUnload + + global __cuLibraryGetKernel + data["__cuLibraryGetKernel"] = __cuLibraryGetKernel + + global __cuLibraryGetKernelCount + data["__cuLibraryGetKernelCount"] = __cuLibraryGetKernelCount + + global __cuLibraryEnumerateKernels + data["__cuLibraryEnumerateKernels"] = __cuLibraryEnumerateKernels + + global __cuLibraryGetModule + data["__cuLibraryGetModule"] = __cuLibraryGetModule + + global __cuKernelGetFunction + data["__cuKernelGetFunction"] = __cuKernelGetFunction + + global __cuKernelGetLibrary + data["__cuKernelGetLibrary"] = __cuKernelGetLibrary + + global __cuLibraryGetGlobal + data["__cuLibraryGetGlobal"] = __cuLibraryGetGlobal + + global __cuLibraryGetManaged + data["__cuLibraryGetManaged"] = __cuLibraryGetManaged + + global __cuLibraryGetUnifiedFunction + data["__cuLibraryGetUnifiedFunction"] = __cuLibraryGetUnifiedFunction + + global __cuKernelGetAttribute + data["__cuKernelGetAttribute"] = __cuKernelGetAttribute + + global __cuKernelSetAttribute + data["__cuKernelSetAttribute"] = __cuKernelSetAttribute + + global __cuKernelSetCacheConfig + data["__cuKernelSetCacheConfig"] = __cuKernelSetCacheConfig + + global __cuKernelGetName + data["__cuKernelGetName"] = __cuKernelGetName + + global __cuKernelGetParamInfo + data["__cuKernelGetParamInfo"] = __cuKernelGetParamInfo + + global __cuMemGetInfo_v2 + data["__cuMemGetInfo_v2"] = __cuMemGetInfo_v2 + + global __cuMemAlloc_v2 + data["__cuMemAlloc_v2"] = __cuMemAlloc_v2 + + global __cuMemAllocPitch_v2 + data["__cuMemAllocPitch_v2"] = __cuMemAllocPitch_v2 + + global __cuMemFree_v2 + data["__cuMemFree_v2"] = __cuMemFree_v2 + + global __cuMemGetAddressRange_v2 + data["__cuMemGetAddressRange_v2"] = __cuMemGetAddressRange_v2 + + global __cuMemAllocHost_v2 + data["__cuMemAllocHost_v2"] = __cuMemAllocHost_v2 + + global __cuMemFreeHost + data["__cuMemFreeHost"] = __cuMemFreeHost + + global __cuMemHostAlloc + data["__cuMemHostAlloc"] = __cuMemHostAlloc + + global __cuMemHostGetDevicePointer_v2 + data["__cuMemHostGetDevicePointer_v2"] = __cuMemHostGetDevicePointer_v2 + + global __cuMemHostGetFlags + data["__cuMemHostGetFlags"] = __cuMemHostGetFlags + + global __cuMemAllocManaged + data["__cuMemAllocManaged"] = __cuMemAllocManaged + + global __cuDeviceRegisterAsyncNotification + data["__cuDeviceRegisterAsyncNotification"] = __cuDeviceRegisterAsyncNotification + + global __cuDeviceUnregisterAsyncNotification + data["__cuDeviceUnregisterAsyncNotification"] = __cuDeviceUnregisterAsyncNotification + + global __cuDeviceGetByPCIBusId + data["__cuDeviceGetByPCIBusId"] = __cuDeviceGetByPCIBusId + + global __cuDeviceGetPCIBusId + data["__cuDeviceGetPCIBusId"] = __cuDeviceGetPCIBusId + + global __cuIpcGetEventHandle + data["__cuIpcGetEventHandle"] = __cuIpcGetEventHandle + + global __cuIpcOpenEventHandle + data["__cuIpcOpenEventHandle"] = __cuIpcOpenEventHandle + + global __cuIpcGetMemHandle + data["__cuIpcGetMemHandle"] = __cuIpcGetMemHandle + + global __cuIpcOpenMemHandle_v2 + data["__cuIpcOpenMemHandle_v2"] = __cuIpcOpenMemHandle_v2 + + global __cuIpcCloseMemHandle + data["__cuIpcCloseMemHandle"] = __cuIpcCloseMemHandle + + global __cuMemHostRegister_v2 + data["__cuMemHostRegister_v2"] = __cuMemHostRegister_v2 + + global __cuMemHostUnregister + data["__cuMemHostUnregister"] = __cuMemHostUnregister + + global __cuMemcpy + data["__cuMemcpy"] = __cuMemcpy + + global __cuMemcpyPeer + data["__cuMemcpyPeer"] = __cuMemcpyPeer + + global __cuMemcpyHtoD_v2 + data["__cuMemcpyHtoD_v2"] = __cuMemcpyHtoD_v2 + + global __cuMemcpyDtoH_v2 + data["__cuMemcpyDtoH_v2"] = __cuMemcpyDtoH_v2 + + global __cuMemcpyDtoD_v2 + data["__cuMemcpyDtoD_v2"] = __cuMemcpyDtoD_v2 + + global __cuMemcpyDtoA_v2 + data["__cuMemcpyDtoA_v2"] = __cuMemcpyDtoA_v2 + + global __cuMemcpyAtoD_v2 + data["__cuMemcpyAtoD_v2"] = __cuMemcpyAtoD_v2 + + global __cuMemcpyHtoA_v2 + data["__cuMemcpyHtoA_v2"] = __cuMemcpyHtoA_v2 + + global __cuMemcpyAtoH_v2 + data["__cuMemcpyAtoH_v2"] = __cuMemcpyAtoH_v2 + + global __cuMemcpyAtoA_v2 + data["__cuMemcpyAtoA_v2"] = __cuMemcpyAtoA_v2 + + global __cuMemcpy2D_v2 + data["__cuMemcpy2D_v2"] = __cuMemcpy2D_v2 + + global __cuMemcpy2DUnaligned_v2 + data["__cuMemcpy2DUnaligned_v2"] = __cuMemcpy2DUnaligned_v2 + + global __cuMemcpy3D_v2 + data["__cuMemcpy3D_v2"] = __cuMemcpy3D_v2 + + global __cuMemcpy3DPeer + data["__cuMemcpy3DPeer"] = __cuMemcpy3DPeer + + global __cuMemcpyAsync + data["__cuMemcpyAsync"] = __cuMemcpyAsync + + global __cuMemcpyPeerAsync + data["__cuMemcpyPeerAsync"] = __cuMemcpyPeerAsync + + global __cuMemcpyHtoDAsync_v2 + data["__cuMemcpyHtoDAsync_v2"] = __cuMemcpyHtoDAsync_v2 + + global __cuMemcpyDtoHAsync_v2 + data["__cuMemcpyDtoHAsync_v2"] = __cuMemcpyDtoHAsync_v2 + + global __cuMemcpyDtoDAsync_v2 + data["__cuMemcpyDtoDAsync_v2"] = __cuMemcpyDtoDAsync_v2 + + global __cuMemcpyHtoAAsync_v2 + data["__cuMemcpyHtoAAsync_v2"] = __cuMemcpyHtoAAsync_v2 + + global __cuMemcpyAtoHAsync_v2 + data["__cuMemcpyAtoHAsync_v2"] = __cuMemcpyAtoHAsync_v2 + + global __cuMemcpy2DAsync_v2 + data["__cuMemcpy2DAsync_v2"] = __cuMemcpy2DAsync_v2 + + global __cuMemcpy3DAsync_v2 + data["__cuMemcpy3DAsync_v2"] = __cuMemcpy3DAsync_v2 + + global __cuMemcpy3DPeerAsync + data["__cuMemcpy3DPeerAsync"] = __cuMemcpy3DPeerAsync + + global __cuMemsetD8_v2 + data["__cuMemsetD8_v2"] = __cuMemsetD8_v2 + + global __cuMemsetD16_v2 + data["__cuMemsetD16_v2"] = __cuMemsetD16_v2 + + global __cuMemsetD32_v2 + data["__cuMemsetD32_v2"] = __cuMemsetD32_v2 + + global __cuMemsetD2D8_v2 + data["__cuMemsetD2D8_v2"] = __cuMemsetD2D8_v2 + + global __cuMemsetD2D16_v2 + data["__cuMemsetD2D16_v2"] = __cuMemsetD2D16_v2 + + global __cuMemsetD2D32_v2 + data["__cuMemsetD2D32_v2"] = __cuMemsetD2D32_v2 + + global __cuMemsetD8Async + data["__cuMemsetD8Async"] = __cuMemsetD8Async + + global __cuMemsetD16Async + data["__cuMemsetD16Async"] = __cuMemsetD16Async + + global __cuMemsetD32Async + data["__cuMemsetD32Async"] = __cuMemsetD32Async + + global __cuMemsetD2D8Async + data["__cuMemsetD2D8Async"] = __cuMemsetD2D8Async + + global __cuMemsetD2D16Async + data["__cuMemsetD2D16Async"] = __cuMemsetD2D16Async + + global __cuMemsetD2D32Async + data["__cuMemsetD2D32Async"] = __cuMemsetD2D32Async + + global __cuArrayCreate_v2 + data["__cuArrayCreate_v2"] = __cuArrayCreate_v2 + + global __cuArrayGetDescriptor_v2 + data["__cuArrayGetDescriptor_v2"] = __cuArrayGetDescriptor_v2 + + global __cuArrayGetSparseProperties + data["__cuArrayGetSparseProperties"] = __cuArrayGetSparseProperties + + global __cuMipmappedArrayGetSparseProperties + data["__cuMipmappedArrayGetSparseProperties"] = __cuMipmappedArrayGetSparseProperties + + global __cuArrayGetMemoryRequirements + data["__cuArrayGetMemoryRequirements"] = __cuArrayGetMemoryRequirements + + global __cuMipmappedArrayGetMemoryRequirements + data["__cuMipmappedArrayGetMemoryRequirements"] = __cuMipmappedArrayGetMemoryRequirements + + global __cuArrayGetPlane + data["__cuArrayGetPlane"] = __cuArrayGetPlane + + global __cuArrayDestroy + data["__cuArrayDestroy"] = __cuArrayDestroy + + global __cuArray3DCreate_v2 + data["__cuArray3DCreate_v2"] = __cuArray3DCreate_v2 + + global __cuArray3DGetDescriptor_v2 + data["__cuArray3DGetDescriptor_v2"] = __cuArray3DGetDescriptor_v2 + + global __cuMipmappedArrayCreate + data["__cuMipmappedArrayCreate"] = __cuMipmappedArrayCreate + + global __cuMipmappedArrayGetLevel + data["__cuMipmappedArrayGetLevel"] = __cuMipmappedArrayGetLevel + + global __cuMipmappedArrayDestroy + data["__cuMipmappedArrayDestroy"] = __cuMipmappedArrayDestroy + + global __cuMemGetHandleForAddressRange + data["__cuMemGetHandleForAddressRange"] = __cuMemGetHandleForAddressRange + + global __cuMemBatchDecompressAsync + data["__cuMemBatchDecompressAsync"] = __cuMemBatchDecompressAsync + + global __cuMemAddressReserve + data["__cuMemAddressReserve"] = __cuMemAddressReserve + + global __cuMemAddressFree + data["__cuMemAddressFree"] = __cuMemAddressFree + + global __cuMemCreate + data["__cuMemCreate"] = __cuMemCreate + + global __cuMemRelease + data["__cuMemRelease"] = __cuMemRelease + + global __cuMemMap + data["__cuMemMap"] = __cuMemMap + + global __cuMemMapArrayAsync + data["__cuMemMapArrayAsync"] = __cuMemMapArrayAsync + + global __cuMemUnmap + data["__cuMemUnmap"] = __cuMemUnmap + + global __cuMemSetAccess + data["__cuMemSetAccess"] = __cuMemSetAccess + + global __cuMemGetAccess + data["__cuMemGetAccess"] = __cuMemGetAccess + + global __cuMemExportToShareableHandle + data["__cuMemExportToShareableHandle"] = __cuMemExportToShareableHandle + + global __cuMemImportFromShareableHandle + data["__cuMemImportFromShareableHandle"] = __cuMemImportFromShareableHandle + + global __cuMemGetAllocationGranularity + data["__cuMemGetAllocationGranularity"] = __cuMemGetAllocationGranularity + + global __cuMemGetAllocationPropertiesFromHandle + data["__cuMemGetAllocationPropertiesFromHandle"] = __cuMemGetAllocationPropertiesFromHandle + + global __cuMemRetainAllocationHandle + data["__cuMemRetainAllocationHandle"] = __cuMemRetainAllocationHandle + + global __cuMemFreeAsync + data["__cuMemFreeAsync"] = __cuMemFreeAsync + + global __cuMemAllocAsync + data["__cuMemAllocAsync"] = __cuMemAllocAsync + + global __cuMemPoolTrimTo + data["__cuMemPoolTrimTo"] = __cuMemPoolTrimTo + + global __cuMemPoolSetAttribute + data["__cuMemPoolSetAttribute"] = __cuMemPoolSetAttribute + + global __cuMemPoolGetAttribute + data["__cuMemPoolGetAttribute"] = __cuMemPoolGetAttribute + + global __cuMemPoolSetAccess + data["__cuMemPoolSetAccess"] = __cuMemPoolSetAccess + + global __cuMemPoolGetAccess + data["__cuMemPoolGetAccess"] = __cuMemPoolGetAccess + + global __cuMemPoolCreate + data["__cuMemPoolCreate"] = __cuMemPoolCreate + + global __cuMemPoolDestroy + data["__cuMemPoolDestroy"] = __cuMemPoolDestroy + + global __cuMemAllocFromPoolAsync + data["__cuMemAllocFromPoolAsync"] = __cuMemAllocFromPoolAsync + + global __cuMemPoolExportToShareableHandle + data["__cuMemPoolExportToShareableHandle"] = __cuMemPoolExportToShareableHandle + + global __cuMemPoolImportFromShareableHandle + data["__cuMemPoolImportFromShareableHandle"] = __cuMemPoolImportFromShareableHandle + + global __cuMemPoolExportPointer + data["__cuMemPoolExportPointer"] = __cuMemPoolExportPointer + + global __cuMemPoolImportPointer + data["__cuMemPoolImportPointer"] = __cuMemPoolImportPointer + + global __cuMulticastCreate + data["__cuMulticastCreate"] = __cuMulticastCreate + + global __cuMulticastAddDevice + data["__cuMulticastAddDevice"] = __cuMulticastAddDevice + + global __cuMulticastBindMem + data["__cuMulticastBindMem"] = __cuMulticastBindMem + + global __cuMulticastBindAddr + data["__cuMulticastBindAddr"] = __cuMulticastBindAddr + + global __cuMulticastUnbind + data["__cuMulticastUnbind"] = __cuMulticastUnbind + + global __cuMulticastGetGranularity + data["__cuMulticastGetGranularity"] = __cuMulticastGetGranularity + + global __cuPointerGetAttribute + data["__cuPointerGetAttribute"] = __cuPointerGetAttribute + + global __cuMemPrefetchAsync_v2 + data["__cuMemPrefetchAsync_v2"] = __cuMemPrefetchAsync_v2 + + global __cuMemAdvise_v2 + data["__cuMemAdvise_v2"] = __cuMemAdvise_v2 + + global __cuMemRangeGetAttribute + data["__cuMemRangeGetAttribute"] = __cuMemRangeGetAttribute + + global __cuMemRangeGetAttributes + data["__cuMemRangeGetAttributes"] = __cuMemRangeGetAttributes + + global __cuPointerSetAttribute + data["__cuPointerSetAttribute"] = __cuPointerSetAttribute + + global __cuPointerGetAttributes + data["__cuPointerGetAttributes"] = __cuPointerGetAttributes + + global __cuStreamCreate + data["__cuStreamCreate"] = __cuStreamCreate + + global __cuStreamCreateWithPriority + data["__cuStreamCreateWithPriority"] = __cuStreamCreateWithPriority + + global __cuStreamGetPriority + data["__cuStreamGetPriority"] = __cuStreamGetPriority + + global __cuStreamGetDevice + data["__cuStreamGetDevice"] = __cuStreamGetDevice + + global __cuStreamGetFlags + data["__cuStreamGetFlags"] = __cuStreamGetFlags + + global __cuStreamGetId + data["__cuStreamGetId"] = __cuStreamGetId + + global __cuStreamGetCtx + data["__cuStreamGetCtx"] = __cuStreamGetCtx + + global __cuStreamGetCtx_v2 + data["__cuStreamGetCtx_v2"] = __cuStreamGetCtx_v2 + + global __cuStreamWaitEvent + data["__cuStreamWaitEvent"] = __cuStreamWaitEvent + + global __cuStreamAddCallback + data["__cuStreamAddCallback"] = __cuStreamAddCallback + + global __cuStreamBeginCapture_v2 + data["__cuStreamBeginCapture_v2"] = __cuStreamBeginCapture_v2 + + global __cuStreamBeginCaptureToGraph + data["__cuStreamBeginCaptureToGraph"] = __cuStreamBeginCaptureToGraph + + global __cuThreadExchangeStreamCaptureMode + data["__cuThreadExchangeStreamCaptureMode"] = __cuThreadExchangeStreamCaptureMode + + global __cuStreamEndCapture + data["__cuStreamEndCapture"] = __cuStreamEndCapture + + global __cuStreamIsCapturing + data["__cuStreamIsCapturing"] = __cuStreamIsCapturing + + global __cuStreamGetCaptureInfo_v2 + data["__cuStreamGetCaptureInfo_v2"] = __cuStreamGetCaptureInfo_v2 + + global __cuStreamGetCaptureInfo_v3 + data["__cuStreamGetCaptureInfo_v3"] = __cuStreamGetCaptureInfo_v3 + + global __cuStreamUpdateCaptureDependencies_v2 + data["__cuStreamUpdateCaptureDependencies_v2"] = __cuStreamUpdateCaptureDependencies_v2 + + global __cuStreamAttachMemAsync + data["__cuStreamAttachMemAsync"] = __cuStreamAttachMemAsync + + global __cuStreamQuery + data["__cuStreamQuery"] = __cuStreamQuery + + global __cuStreamSynchronize + data["__cuStreamSynchronize"] = __cuStreamSynchronize + + global __cuStreamDestroy_v2 + data["__cuStreamDestroy_v2"] = __cuStreamDestroy_v2 + + global __cuStreamCopyAttributes + data["__cuStreamCopyAttributes"] = __cuStreamCopyAttributes + + global __cuStreamGetAttribute + data["__cuStreamGetAttribute"] = __cuStreamGetAttribute + + global __cuStreamSetAttribute + data["__cuStreamSetAttribute"] = __cuStreamSetAttribute + + global __cuEventCreate + data["__cuEventCreate"] = __cuEventCreate + + global __cuEventRecord + data["__cuEventRecord"] = __cuEventRecord + + global __cuEventRecordWithFlags + data["__cuEventRecordWithFlags"] = __cuEventRecordWithFlags + + global __cuEventQuery + data["__cuEventQuery"] = __cuEventQuery + + global __cuEventSynchronize + data["__cuEventSynchronize"] = __cuEventSynchronize + + global __cuEventDestroy_v2 + data["__cuEventDestroy_v2"] = __cuEventDestroy_v2 + + global __cuEventElapsedTime_v2 + data["__cuEventElapsedTime_v2"] = __cuEventElapsedTime_v2 + + global __cuImportExternalMemory + data["__cuImportExternalMemory"] = __cuImportExternalMemory + + global __cuExternalMemoryGetMappedBuffer + data["__cuExternalMemoryGetMappedBuffer"] = __cuExternalMemoryGetMappedBuffer + + global __cuExternalMemoryGetMappedMipmappedArray + data["__cuExternalMemoryGetMappedMipmappedArray"] = __cuExternalMemoryGetMappedMipmappedArray + + global __cuDestroyExternalMemory + data["__cuDestroyExternalMemory"] = __cuDestroyExternalMemory + + global __cuImportExternalSemaphore + data["__cuImportExternalSemaphore"] = __cuImportExternalSemaphore + + global __cuSignalExternalSemaphoresAsync + data["__cuSignalExternalSemaphoresAsync"] = __cuSignalExternalSemaphoresAsync + + global __cuWaitExternalSemaphoresAsync + data["__cuWaitExternalSemaphoresAsync"] = __cuWaitExternalSemaphoresAsync + + global __cuDestroyExternalSemaphore + data["__cuDestroyExternalSemaphore"] = __cuDestroyExternalSemaphore + + global __cuStreamWaitValue32_v2 + data["__cuStreamWaitValue32_v2"] = __cuStreamWaitValue32_v2 + + global __cuStreamWaitValue64_v2 + data["__cuStreamWaitValue64_v2"] = __cuStreamWaitValue64_v2 + + global __cuStreamWriteValue32_v2 + data["__cuStreamWriteValue32_v2"] = __cuStreamWriteValue32_v2 + + global __cuStreamWriteValue64_v2 + data["__cuStreamWriteValue64_v2"] = __cuStreamWriteValue64_v2 + + global __cuStreamBatchMemOp_v2 + data["__cuStreamBatchMemOp_v2"] = __cuStreamBatchMemOp_v2 + + global __cuFuncGetAttribute + data["__cuFuncGetAttribute"] = __cuFuncGetAttribute + + global __cuFuncSetAttribute + data["__cuFuncSetAttribute"] = __cuFuncSetAttribute + + global __cuFuncSetCacheConfig + data["__cuFuncSetCacheConfig"] = __cuFuncSetCacheConfig + + global __cuFuncGetModule + data["__cuFuncGetModule"] = __cuFuncGetModule + + global __cuFuncGetName + data["__cuFuncGetName"] = __cuFuncGetName + + global __cuFuncGetParamInfo + data["__cuFuncGetParamInfo"] = __cuFuncGetParamInfo + + global __cuFuncIsLoaded + data["__cuFuncIsLoaded"] = __cuFuncIsLoaded + + global __cuFuncLoad + data["__cuFuncLoad"] = __cuFuncLoad + + global __cuLaunchKernel + data["__cuLaunchKernel"] = __cuLaunchKernel + + global __cuLaunchKernelEx + data["__cuLaunchKernelEx"] = __cuLaunchKernelEx + + global __cuLaunchCooperativeKernel + data["__cuLaunchCooperativeKernel"] = __cuLaunchCooperativeKernel + + global __cuLaunchCooperativeKernelMultiDevice + data["__cuLaunchCooperativeKernelMultiDevice"] = __cuLaunchCooperativeKernelMultiDevice + + global __cuLaunchHostFunc + data["__cuLaunchHostFunc"] = __cuLaunchHostFunc + + global __cuFuncSetBlockShape + data["__cuFuncSetBlockShape"] = __cuFuncSetBlockShape + + global __cuFuncSetSharedSize + data["__cuFuncSetSharedSize"] = __cuFuncSetSharedSize + + global __cuParamSetSize + data["__cuParamSetSize"] = __cuParamSetSize + + global __cuParamSeti + data["__cuParamSeti"] = __cuParamSeti + + global __cuParamSetf + data["__cuParamSetf"] = __cuParamSetf + + global __cuParamSetv + data["__cuParamSetv"] = __cuParamSetv + + global __cuLaunch + data["__cuLaunch"] = __cuLaunch + + global __cuLaunchGrid + data["__cuLaunchGrid"] = __cuLaunchGrid + + global __cuLaunchGridAsync + data["__cuLaunchGridAsync"] = __cuLaunchGridAsync + + global __cuParamSetTexRef + data["__cuParamSetTexRef"] = __cuParamSetTexRef + + global __cuFuncSetSharedMemConfig + data["__cuFuncSetSharedMemConfig"] = __cuFuncSetSharedMemConfig + + global __cuGraphCreate + data["__cuGraphCreate"] = __cuGraphCreate + + global __cuGraphAddKernelNode_v2 + data["__cuGraphAddKernelNode_v2"] = __cuGraphAddKernelNode_v2 + + global __cuGraphKernelNodeGetParams_v2 + data["__cuGraphKernelNodeGetParams_v2"] = __cuGraphKernelNodeGetParams_v2 + + global __cuGraphKernelNodeSetParams_v2 + data["__cuGraphKernelNodeSetParams_v2"] = __cuGraphKernelNodeSetParams_v2 + + global __cuGraphAddMemcpyNode + data["__cuGraphAddMemcpyNode"] = __cuGraphAddMemcpyNode + + global __cuGraphMemcpyNodeGetParams + data["__cuGraphMemcpyNodeGetParams"] = __cuGraphMemcpyNodeGetParams + + global __cuGraphMemcpyNodeSetParams + data["__cuGraphMemcpyNodeSetParams"] = __cuGraphMemcpyNodeSetParams + + global __cuGraphAddMemsetNode + data["__cuGraphAddMemsetNode"] = __cuGraphAddMemsetNode + + global __cuGraphMemsetNodeGetParams + data["__cuGraphMemsetNodeGetParams"] = __cuGraphMemsetNodeGetParams + + global __cuGraphMemsetNodeSetParams + data["__cuGraphMemsetNodeSetParams"] = __cuGraphMemsetNodeSetParams + + global __cuGraphAddHostNode + data["__cuGraphAddHostNode"] = __cuGraphAddHostNode + + global __cuGraphHostNodeGetParams + data["__cuGraphHostNodeGetParams"] = __cuGraphHostNodeGetParams + + global __cuGraphHostNodeSetParams + data["__cuGraphHostNodeSetParams"] = __cuGraphHostNodeSetParams + + global __cuGraphAddChildGraphNode + data["__cuGraphAddChildGraphNode"] = __cuGraphAddChildGraphNode + + global __cuGraphChildGraphNodeGetGraph + data["__cuGraphChildGraphNodeGetGraph"] = __cuGraphChildGraphNodeGetGraph + + global __cuGraphAddEmptyNode + data["__cuGraphAddEmptyNode"] = __cuGraphAddEmptyNode + + global __cuGraphAddEventRecordNode + data["__cuGraphAddEventRecordNode"] = __cuGraphAddEventRecordNode + + global __cuGraphEventRecordNodeGetEvent + data["__cuGraphEventRecordNodeGetEvent"] = __cuGraphEventRecordNodeGetEvent + + global __cuGraphEventRecordNodeSetEvent + data["__cuGraphEventRecordNodeSetEvent"] = __cuGraphEventRecordNodeSetEvent + + global __cuGraphAddEventWaitNode + data["__cuGraphAddEventWaitNode"] = __cuGraphAddEventWaitNode + + global __cuGraphEventWaitNodeGetEvent + data["__cuGraphEventWaitNodeGetEvent"] = __cuGraphEventWaitNodeGetEvent + + global __cuGraphEventWaitNodeSetEvent + data["__cuGraphEventWaitNodeSetEvent"] = __cuGraphEventWaitNodeSetEvent + + global __cuGraphAddExternalSemaphoresSignalNode + data["__cuGraphAddExternalSemaphoresSignalNode"] = __cuGraphAddExternalSemaphoresSignalNode + + global __cuGraphExternalSemaphoresSignalNodeGetParams + data["__cuGraphExternalSemaphoresSignalNodeGetParams"] = __cuGraphExternalSemaphoresSignalNodeGetParams + + global __cuGraphExternalSemaphoresSignalNodeSetParams + data["__cuGraphExternalSemaphoresSignalNodeSetParams"] = __cuGraphExternalSemaphoresSignalNodeSetParams + + global __cuGraphAddExternalSemaphoresWaitNode + data["__cuGraphAddExternalSemaphoresWaitNode"] = __cuGraphAddExternalSemaphoresWaitNode + + global __cuGraphExternalSemaphoresWaitNodeGetParams + data["__cuGraphExternalSemaphoresWaitNodeGetParams"] = __cuGraphExternalSemaphoresWaitNodeGetParams + + global __cuGraphExternalSemaphoresWaitNodeSetParams + data["__cuGraphExternalSemaphoresWaitNodeSetParams"] = __cuGraphExternalSemaphoresWaitNodeSetParams + + global __cuGraphAddBatchMemOpNode + data["__cuGraphAddBatchMemOpNode"] = __cuGraphAddBatchMemOpNode + + global __cuGraphBatchMemOpNodeGetParams + data["__cuGraphBatchMemOpNodeGetParams"] = __cuGraphBatchMemOpNodeGetParams + + global __cuGraphBatchMemOpNodeSetParams + data["__cuGraphBatchMemOpNodeSetParams"] = __cuGraphBatchMemOpNodeSetParams + + global __cuGraphExecBatchMemOpNodeSetParams + data["__cuGraphExecBatchMemOpNodeSetParams"] = __cuGraphExecBatchMemOpNodeSetParams + + global __cuGraphAddMemAllocNode + data["__cuGraphAddMemAllocNode"] = __cuGraphAddMemAllocNode + + global __cuGraphMemAllocNodeGetParams + data["__cuGraphMemAllocNodeGetParams"] = __cuGraphMemAllocNodeGetParams + + global __cuGraphAddMemFreeNode + data["__cuGraphAddMemFreeNode"] = __cuGraphAddMemFreeNode + + global __cuGraphMemFreeNodeGetParams + data["__cuGraphMemFreeNodeGetParams"] = __cuGraphMemFreeNodeGetParams + + global __cuDeviceGraphMemTrim + data["__cuDeviceGraphMemTrim"] = __cuDeviceGraphMemTrim + + global __cuDeviceGetGraphMemAttribute + data["__cuDeviceGetGraphMemAttribute"] = __cuDeviceGetGraphMemAttribute + + global __cuDeviceSetGraphMemAttribute + data["__cuDeviceSetGraphMemAttribute"] = __cuDeviceSetGraphMemAttribute + + global __cuGraphClone + data["__cuGraphClone"] = __cuGraphClone + + global __cuGraphNodeFindInClone + data["__cuGraphNodeFindInClone"] = __cuGraphNodeFindInClone + + global __cuGraphNodeGetType + data["__cuGraphNodeGetType"] = __cuGraphNodeGetType + + global __cuGraphGetNodes + data["__cuGraphGetNodes"] = __cuGraphGetNodes + + global __cuGraphGetRootNodes + data["__cuGraphGetRootNodes"] = __cuGraphGetRootNodes + + global __cuGraphGetEdges_v2 + data["__cuGraphGetEdges_v2"] = __cuGraphGetEdges_v2 + + global __cuGraphNodeGetDependencies_v2 + data["__cuGraphNodeGetDependencies_v2"] = __cuGraphNodeGetDependencies_v2 + + global __cuGraphNodeGetDependentNodes_v2 + data["__cuGraphNodeGetDependentNodes_v2"] = __cuGraphNodeGetDependentNodes_v2 + + global __cuGraphAddDependencies_v2 + data["__cuGraphAddDependencies_v2"] = __cuGraphAddDependencies_v2 + + global __cuGraphRemoveDependencies_v2 + data["__cuGraphRemoveDependencies_v2"] = __cuGraphRemoveDependencies_v2 + + global __cuGraphDestroyNode + data["__cuGraphDestroyNode"] = __cuGraphDestroyNode + + global __cuGraphInstantiateWithFlags + data["__cuGraphInstantiateWithFlags"] = __cuGraphInstantiateWithFlags + + global __cuGraphInstantiateWithParams + data["__cuGraphInstantiateWithParams"] = __cuGraphInstantiateWithParams + + global __cuGraphExecGetFlags + data["__cuGraphExecGetFlags"] = __cuGraphExecGetFlags + + global __cuGraphExecKernelNodeSetParams_v2 + data["__cuGraphExecKernelNodeSetParams_v2"] = __cuGraphExecKernelNodeSetParams_v2 + + global __cuGraphExecMemcpyNodeSetParams + data["__cuGraphExecMemcpyNodeSetParams"] = __cuGraphExecMemcpyNodeSetParams + + global __cuGraphExecMemsetNodeSetParams + data["__cuGraphExecMemsetNodeSetParams"] = __cuGraphExecMemsetNodeSetParams + + global __cuGraphExecHostNodeSetParams + data["__cuGraphExecHostNodeSetParams"] = __cuGraphExecHostNodeSetParams + + global __cuGraphExecChildGraphNodeSetParams + data["__cuGraphExecChildGraphNodeSetParams"] = __cuGraphExecChildGraphNodeSetParams + + global __cuGraphExecEventRecordNodeSetEvent + data["__cuGraphExecEventRecordNodeSetEvent"] = __cuGraphExecEventRecordNodeSetEvent + + global __cuGraphExecEventWaitNodeSetEvent + data["__cuGraphExecEventWaitNodeSetEvent"] = __cuGraphExecEventWaitNodeSetEvent + + global __cuGraphExecExternalSemaphoresSignalNodeSetParams + data["__cuGraphExecExternalSemaphoresSignalNodeSetParams"] = __cuGraphExecExternalSemaphoresSignalNodeSetParams + + global __cuGraphExecExternalSemaphoresWaitNodeSetParams + data["__cuGraphExecExternalSemaphoresWaitNodeSetParams"] = __cuGraphExecExternalSemaphoresWaitNodeSetParams + + global __cuGraphNodeSetEnabled + data["__cuGraphNodeSetEnabled"] = __cuGraphNodeSetEnabled + + global __cuGraphNodeGetEnabled + data["__cuGraphNodeGetEnabled"] = __cuGraphNodeGetEnabled + + global __cuGraphUpload + data["__cuGraphUpload"] = __cuGraphUpload + + global __cuGraphLaunch + data["__cuGraphLaunch"] = __cuGraphLaunch + + global __cuGraphExecDestroy + data["__cuGraphExecDestroy"] = __cuGraphExecDestroy + + global __cuGraphDestroy + data["__cuGraphDestroy"] = __cuGraphDestroy + + global __cuGraphExecUpdate_v2 + data["__cuGraphExecUpdate_v2"] = __cuGraphExecUpdate_v2 + + global __cuGraphKernelNodeCopyAttributes + data["__cuGraphKernelNodeCopyAttributes"] = __cuGraphKernelNodeCopyAttributes + + global __cuGraphKernelNodeGetAttribute + data["__cuGraphKernelNodeGetAttribute"] = __cuGraphKernelNodeGetAttribute + + global __cuGraphKernelNodeSetAttribute + data["__cuGraphKernelNodeSetAttribute"] = __cuGraphKernelNodeSetAttribute + + global __cuGraphDebugDotPrint + data["__cuGraphDebugDotPrint"] = __cuGraphDebugDotPrint + + global __cuUserObjectCreate + data["__cuUserObjectCreate"] = __cuUserObjectCreate + + global __cuUserObjectRetain + data["__cuUserObjectRetain"] = __cuUserObjectRetain + + global __cuUserObjectRelease + data["__cuUserObjectRelease"] = __cuUserObjectRelease + + global __cuGraphRetainUserObject + data["__cuGraphRetainUserObject"] = __cuGraphRetainUserObject + + global __cuGraphReleaseUserObject + data["__cuGraphReleaseUserObject"] = __cuGraphReleaseUserObject + + global __cuGraphAddNode_v2 + data["__cuGraphAddNode_v2"] = __cuGraphAddNode_v2 + + global __cuGraphNodeSetParams + data["__cuGraphNodeSetParams"] = __cuGraphNodeSetParams + + global __cuGraphExecNodeSetParams + data["__cuGraphExecNodeSetParams"] = __cuGraphExecNodeSetParams + + global __cuGraphConditionalHandleCreate + data["__cuGraphConditionalHandleCreate"] = __cuGraphConditionalHandleCreate + + global __cuOccupancyMaxActiveBlocksPerMultiprocessor + data["__cuOccupancyMaxActiveBlocksPerMultiprocessor"] = __cuOccupancyMaxActiveBlocksPerMultiprocessor + + global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags + data["__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags"] = __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags + + global __cuOccupancyMaxPotentialBlockSize + data["__cuOccupancyMaxPotentialBlockSize"] = __cuOccupancyMaxPotentialBlockSize + + global __cuOccupancyMaxPotentialBlockSizeWithFlags + data["__cuOccupancyMaxPotentialBlockSizeWithFlags"] = __cuOccupancyMaxPotentialBlockSizeWithFlags + + global __cuOccupancyAvailableDynamicSMemPerBlock + data["__cuOccupancyAvailableDynamicSMemPerBlock"] = __cuOccupancyAvailableDynamicSMemPerBlock + + global __cuOccupancyMaxPotentialClusterSize + data["__cuOccupancyMaxPotentialClusterSize"] = __cuOccupancyMaxPotentialClusterSize + + global __cuOccupancyMaxActiveClusters + data["__cuOccupancyMaxActiveClusters"] = __cuOccupancyMaxActiveClusters + + global __cuTexRefSetArray + data["__cuTexRefSetArray"] = __cuTexRefSetArray + + global __cuTexRefSetMipmappedArray + data["__cuTexRefSetMipmappedArray"] = __cuTexRefSetMipmappedArray + + global __cuTexRefSetAddress_v2 + data["__cuTexRefSetAddress_v2"] = __cuTexRefSetAddress_v2 + + global __cuTexRefSetAddress2D_v3 + data["__cuTexRefSetAddress2D_v3"] = __cuTexRefSetAddress2D_v3 + + global __cuTexRefSetFormat + data["__cuTexRefSetFormat"] = __cuTexRefSetFormat + + global __cuTexRefSetAddressMode + data["__cuTexRefSetAddressMode"] = __cuTexRefSetAddressMode + + global __cuTexRefSetFilterMode + data["__cuTexRefSetFilterMode"] = __cuTexRefSetFilterMode + + global __cuTexRefSetMipmapFilterMode + data["__cuTexRefSetMipmapFilterMode"] = __cuTexRefSetMipmapFilterMode + + global __cuTexRefSetMipmapLevelBias + data["__cuTexRefSetMipmapLevelBias"] = __cuTexRefSetMipmapLevelBias + + global __cuTexRefSetMipmapLevelClamp + data["__cuTexRefSetMipmapLevelClamp"] = __cuTexRefSetMipmapLevelClamp + + global __cuTexRefSetMaxAnisotropy + data["__cuTexRefSetMaxAnisotropy"] = __cuTexRefSetMaxAnisotropy + + global __cuTexRefSetBorderColor + data["__cuTexRefSetBorderColor"] = __cuTexRefSetBorderColor + + global __cuTexRefSetFlags + data["__cuTexRefSetFlags"] = __cuTexRefSetFlags + + global __cuTexRefGetAddress_v2 + data["__cuTexRefGetAddress_v2"] = __cuTexRefGetAddress_v2 + + global __cuTexRefGetArray + data["__cuTexRefGetArray"] = __cuTexRefGetArray + + global __cuTexRefGetMipmappedArray + data["__cuTexRefGetMipmappedArray"] = __cuTexRefGetMipmappedArray + + global __cuTexRefGetAddressMode + data["__cuTexRefGetAddressMode"] = __cuTexRefGetAddressMode + + global __cuTexRefGetFilterMode + data["__cuTexRefGetFilterMode"] = __cuTexRefGetFilterMode + + global __cuTexRefGetFormat + data["__cuTexRefGetFormat"] = __cuTexRefGetFormat + + global __cuTexRefGetMipmapFilterMode + data["__cuTexRefGetMipmapFilterMode"] = __cuTexRefGetMipmapFilterMode + + global __cuTexRefGetMipmapLevelBias + data["__cuTexRefGetMipmapLevelBias"] = __cuTexRefGetMipmapLevelBias + + global __cuTexRefGetMipmapLevelClamp + data["__cuTexRefGetMipmapLevelClamp"] = __cuTexRefGetMipmapLevelClamp + + global __cuTexRefGetMaxAnisotropy + data["__cuTexRefGetMaxAnisotropy"] = __cuTexRefGetMaxAnisotropy + + global __cuTexRefGetBorderColor + data["__cuTexRefGetBorderColor"] = __cuTexRefGetBorderColor + + global __cuTexRefGetFlags + data["__cuTexRefGetFlags"] = __cuTexRefGetFlags + + global __cuTexRefCreate + data["__cuTexRefCreate"] = __cuTexRefCreate + + global __cuTexRefDestroy + data["__cuTexRefDestroy"] = __cuTexRefDestroy + + global __cuSurfRefSetArray + data["__cuSurfRefSetArray"] = __cuSurfRefSetArray + + global __cuSurfRefGetArray + data["__cuSurfRefGetArray"] = __cuSurfRefGetArray + + global __cuTexObjectCreate + data["__cuTexObjectCreate"] = __cuTexObjectCreate + + global __cuTexObjectDestroy + data["__cuTexObjectDestroy"] = __cuTexObjectDestroy + + global __cuTexObjectGetResourceDesc + data["__cuTexObjectGetResourceDesc"] = __cuTexObjectGetResourceDesc + + global __cuTexObjectGetTextureDesc + data["__cuTexObjectGetTextureDesc"] = __cuTexObjectGetTextureDesc + + global __cuTexObjectGetResourceViewDesc + data["__cuTexObjectGetResourceViewDesc"] = __cuTexObjectGetResourceViewDesc + + global __cuSurfObjectCreate + data["__cuSurfObjectCreate"] = __cuSurfObjectCreate + + global __cuSurfObjectDestroy + data["__cuSurfObjectDestroy"] = __cuSurfObjectDestroy + + global __cuSurfObjectGetResourceDesc + data["__cuSurfObjectGetResourceDesc"] = __cuSurfObjectGetResourceDesc + + global __cuTensorMapEncodeTiled + data["__cuTensorMapEncodeTiled"] = __cuTensorMapEncodeTiled + + global __cuTensorMapEncodeIm2col + data["__cuTensorMapEncodeIm2col"] = __cuTensorMapEncodeIm2col + + global __cuTensorMapEncodeIm2colWide + data["__cuTensorMapEncodeIm2colWide"] = __cuTensorMapEncodeIm2colWide + + global __cuTensorMapReplaceAddress + data["__cuTensorMapReplaceAddress"] = __cuTensorMapReplaceAddress + + global __cuDeviceCanAccessPeer + data["__cuDeviceCanAccessPeer"] = __cuDeviceCanAccessPeer + + global __cuCtxEnablePeerAccess + data["__cuCtxEnablePeerAccess"] = __cuCtxEnablePeerAccess + + global __cuCtxDisablePeerAccess + data["__cuCtxDisablePeerAccess"] = __cuCtxDisablePeerAccess + + global __cuDeviceGetP2PAttribute + data["__cuDeviceGetP2PAttribute"] = __cuDeviceGetP2PAttribute + + global __cuGraphicsUnregisterResource + data["__cuGraphicsUnregisterResource"] = __cuGraphicsUnregisterResource + + global __cuGraphicsSubResourceGetMappedArray + data["__cuGraphicsSubResourceGetMappedArray"] = __cuGraphicsSubResourceGetMappedArray + + global __cuGraphicsResourceGetMappedMipmappedArray + data["__cuGraphicsResourceGetMappedMipmappedArray"] = __cuGraphicsResourceGetMappedMipmappedArray + + global __cuGraphicsResourceGetMappedPointer_v2 + data["__cuGraphicsResourceGetMappedPointer_v2"] = __cuGraphicsResourceGetMappedPointer_v2 + + global __cuGraphicsResourceSetMapFlags_v2 + data["__cuGraphicsResourceSetMapFlags_v2"] = __cuGraphicsResourceSetMapFlags_v2 + + global __cuGraphicsMapResources + data["__cuGraphicsMapResources"] = __cuGraphicsMapResources + + global __cuGraphicsUnmapResources + data["__cuGraphicsUnmapResources"] = __cuGraphicsUnmapResources + + global __cuGetProcAddress_v2 + data["__cuGetProcAddress_v2"] = __cuGetProcAddress_v2 + + global __cuCoredumpGetAttribute + data["__cuCoredumpGetAttribute"] = __cuCoredumpGetAttribute + + global __cuCoredumpGetAttributeGlobal + data["__cuCoredumpGetAttributeGlobal"] = __cuCoredumpGetAttributeGlobal + + global __cuCoredumpSetAttribute + data["__cuCoredumpSetAttribute"] = __cuCoredumpSetAttribute + + global __cuCoredumpSetAttributeGlobal + data["__cuCoredumpSetAttributeGlobal"] = __cuCoredumpSetAttributeGlobal + + global __cuGetExportTable + data["__cuGetExportTable"] = __cuGetExportTable + + global __cuGreenCtxCreate + data["__cuGreenCtxCreate"] = __cuGreenCtxCreate + + global __cuGreenCtxDestroy + data["__cuGreenCtxDestroy"] = __cuGreenCtxDestroy + + global __cuCtxFromGreenCtx + data["__cuCtxFromGreenCtx"] = __cuCtxFromGreenCtx + + global __cuDeviceGetDevResource + data["__cuDeviceGetDevResource"] = __cuDeviceGetDevResource + + global __cuCtxGetDevResource + data["__cuCtxGetDevResource"] = __cuCtxGetDevResource + + global __cuGreenCtxGetDevResource + data["__cuGreenCtxGetDevResource"] = __cuGreenCtxGetDevResource + + global __cuDevSmResourceSplitByCount + data["__cuDevSmResourceSplitByCount"] = __cuDevSmResourceSplitByCount + + global __cuDevResourceGenerateDesc + data["__cuDevResourceGenerateDesc"] = __cuDevResourceGenerateDesc + + global __cuGreenCtxRecordEvent + data["__cuGreenCtxRecordEvent"] = __cuGreenCtxRecordEvent + + global __cuGreenCtxWaitEvent + data["__cuGreenCtxWaitEvent"] = __cuGreenCtxWaitEvent + + global __cuStreamGetGreenCtx + data["__cuStreamGetGreenCtx"] = __cuStreamGetGreenCtx + + global __cuGreenCtxStreamCreate + data["__cuGreenCtxStreamCreate"] = __cuGreenCtxStreamCreate + + global __cuLogsRegisterCallback + data["__cuLogsRegisterCallback"] = __cuLogsRegisterCallback + + global __cuLogsUnregisterCallback + data["__cuLogsUnregisterCallback"] = __cuLogsUnregisterCallback + + global __cuLogsCurrent + data["__cuLogsCurrent"] = __cuLogsCurrent + + global __cuLogsDumpToFile + data["__cuLogsDumpToFile"] = __cuLogsDumpToFile + + global __cuLogsDumpToMemory + data["__cuLogsDumpToMemory"] = __cuLogsDumpToMemory + + global __cuCheckpointProcessGetRestoreThreadId + data["__cuCheckpointProcessGetRestoreThreadId"] = __cuCheckpointProcessGetRestoreThreadId + + global __cuCheckpointProcessGetState + data["__cuCheckpointProcessGetState"] = __cuCheckpointProcessGetState + + global __cuCheckpointProcessLock + data["__cuCheckpointProcessLock"] = __cuCheckpointProcessLock + + global __cuCheckpointProcessCheckpoint + data["__cuCheckpointProcessCheckpoint"] = __cuCheckpointProcessCheckpoint + + global __cuCheckpointProcessRestore + data["__cuCheckpointProcessRestore"] = __cuCheckpointProcessRestore + + global __cuCheckpointProcessUnlock + data["__cuCheckpointProcessUnlock"] = __cuCheckpointProcessUnlock + + global __cuGraphicsEGLRegisterImage + data["__cuGraphicsEGLRegisterImage"] = __cuGraphicsEGLRegisterImage + + global __cuEGLStreamConsumerConnect + data["__cuEGLStreamConsumerConnect"] = __cuEGLStreamConsumerConnect + + global __cuEGLStreamConsumerConnectWithFlags + data["__cuEGLStreamConsumerConnectWithFlags"] = __cuEGLStreamConsumerConnectWithFlags + + global __cuEGLStreamConsumerDisconnect + data["__cuEGLStreamConsumerDisconnect"] = __cuEGLStreamConsumerDisconnect + + global __cuEGLStreamConsumerAcquireFrame + data["__cuEGLStreamConsumerAcquireFrame"] = __cuEGLStreamConsumerAcquireFrame + + global __cuEGLStreamConsumerReleaseFrame + data["__cuEGLStreamConsumerReleaseFrame"] = __cuEGLStreamConsumerReleaseFrame + + global __cuEGLStreamProducerConnect + data["__cuEGLStreamProducerConnect"] = __cuEGLStreamProducerConnect + + global __cuEGLStreamProducerDisconnect + data["__cuEGLStreamProducerDisconnect"] = __cuEGLStreamProducerDisconnect + + global __cuEGLStreamProducerPresentFrame + data["__cuEGLStreamProducerPresentFrame"] = __cuEGLStreamProducerPresentFrame + + global __cuEGLStreamProducerReturnFrame + data["__cuEGLStreamProducerReturnFrame"] = __cuEGLStreamProducerReturnFrame + + global __cuGraphicsResourceGetMappedEglFrame + data["__cuGraphicsResourceGetMappedEglFrame"] = __cuGraphicsResourceGetMappedEglFrame + + global __cuEventCreateFromEGLSync + data["__cuEventCreateFromEGLSync"] = __cuEventCreateFromEGLSync + + global __cuGraphicsGLRegisterBuffer + data["__cuGraphicsGLRegisterBuffer"] = __cuGraphicsGLRegisterBuffer + + global __cuGraphicsGLRegisterImage + data["__cuGraphicsGLRegisterImage"] = __cuGraphicsGLRegisterImage + + global __cuGLGetDevices_v2 + data["__cuGLGetDevices_v2"] = __cuGLGetDevices_v2 + + global __cuGLCtxCreate_v2 + data["__cuGLCtxCreate_v2"] = __cuGLCtxCreate_v2 + + global __cuGLInit + data["__cuGLInit"] = __cuGLInit + + global __cuGLRegisterBufferObject + data["__cuGLRegisterBufferObject"] = __cuGLRegisterBufferObject + + global __cuGLMapBufferObject_v2 + data["__cuGLMapBufferObject_v2"] = __cuGLMapBufferObject_v2 + + global __cuGLUnmapBufferObject + data["__cuGLUnmapBufferObject"] = __cuGLUnmapBufferObject + + global __cuGLUnregisterBufferObject + data["__cuGLUnregisterBufferObject"] = __cuGLUnregisterBufferObject + + global __cuGLSetBufferObjectMapFlags + data["__cuGLSetBufferObjectMapFlags"] = __cuGLSetBufferObjectMapFlags + + global __cuGLMapBufferObjectAsync_v2 + data["__cuGLMapBufferObjectAsync_v2"] = __cuGLMapBufferObjectAsync_v2 + + global __cuGLUnmapBufferObjectAsync + data["__cuGLUnmapBufferObjectAsync"] = __cuGLUnmapBufferObjectAsync + + global __cuProfilerInitialize + data["__cuProfilerInitialize"] = __cuProfilerInitialize + + global __cuProfilerStart + data["__cuProfilerStart"] = __cuProfilerStart + + global __cuProfilerStop + data["__cuProfilerStop"] = __cuProfilerStop + + global __cuVDPAUGetDevice + data["__cuVDPAUGetDevice"] = __cuVDPAUGetDevice + + global __cuVDPAUCtxCreate_v2 + data["__cuVDPAUCtxCreate_v2"] = __cuVDPAUCtxCreate_v2 + + global __cuGraphicsVDPAURegisterVideoSurface + data["__cuGraphicsVDPAURegisterVideoSurface"] = __cuGraphicsVDPAURegisterVideoSurface + + global __cuGraphicsVDPAURegisterOutputSurface + data["__cuGraphicsVDPAURegisterOutputSurface"] = __cuGraphicsVDPAURegisterOutputSurface + + global __cuDeviceGetHostAtomicCapabilities + data["__cuDeviceGetHostAtomicCapabilities"] = __cuDeviceGetHostAtomicCapabilities + + global __cuCtxGetDevice_v2 + data["__cuCtxGetDevice_v2"] = __cuCtxGetDevice_v2 + + global __cuCtxSynchronize_v2 + data["__cuCtxSynchronize_v2"] = __cuCtxSynchronize_v2 + + global __cuMemcpyBatchAsync_v2 + data["__cuMemcpyBatchAsync_v2"] = __cuMemcpyBatchAsync_v2 + + global __cuMemcpy3DBatchAsync_v2 + data["__cuMemcpy3DBatchAsync_v2"] = __cuMemcpy3DBatchAsync_v2 + + global __cuMemGetDefaultMemPool + data["__cuMemGetDefaultMemPool"] = __cuMemGetDefaultMemPool + + global __cuMemGetMemPool + data["__cuMemGetMemPool"] = __cuMemGetMemPool + + global __cuMemSetMemPool + data["__cuMemSetMemPool"] = __cuMemSetMemPool + + global __cuMemPrefetchBatchAsync + data["__cuMemPrefetchBatchAsync"] = __cuMemPrefetchBatchAsync + + global __cuMemDiscardBatchAsync + data["__cuMemDiscardBatchAsync"] = __cuMemDiscardBatchAsync + + global __cuMemDiscardAndPrefetchBatchAsync + data["__cuMemDiscardAndPrefetchBatchAsync"] = __cuMemDiscardAndPrefetchBatchAsync + + global __cuDeviceGetP2PAtomicCapabilities + data["__cuDeviceGetP2PAtomicCapabilities"] = __cuDeviceGetP2PAtomicCapabilities + + global __cuGreenCtxGetId + data["__cuGreenCtxGetId"] = __cuGreenCtxGetId + + global __cuMulticastBindMem_v2 + data["__cuMulticastBindMem_v2"] = __cuMulticastBindMem_v2 + + global __cuMulticastBindAddr_v2 + data["__cuMulticastBindAddr_v2"] = __cuMulticastBindAddr_v2 + + global __cuGraphNodeGetContainingGraph + data["__cuGraphNodeGetContainingGraph"] = __cuGraphNodeGetContainingGraph + + global __cuGraphNodeGetLocalId + data["__cuGraphNodeGetLocalId"] = __cuGraphNodeGetLocalId + + global __cuGraphNodeGetToolsId + data["__cuGraphNodeGetToolsId"] = __cuGraphNodeGetToolsId + + global __cuGraphGetId + data["__cuGraphGetId"] = __cuGraphGetId + + global __cuGraphExecGetId + data["__cuGraphExecGetId"] = __cuGraphExecGetId + + global __cuDevSmResourceSplit + data["__cuDevSmResourceSplit"] = __cuDevSmResourceSplit + + global __cuStreamGetDevResource + data["__cuStreamGetDevResource"] = __cuStreamGetDevResource + + global __cuKernelGetParamCount + data["__cuKernelGetParamCount"] = __cuKernelGetParamCount + + global __cuMemcpyWithAttributesAsync + data["__cuMemcpyWithAttributesAsync"] = __cuMemcpyWithAttributesAsync + + global __cuMemcpy3DWithAttributesAsync + data["__cuMemcpy3DWithAttributesAsync"] = __cuMemcpy3DWithAttributesAsync + + global __cuStreamBeginCaptureToCig + data["__cuStreamBeginCaptureToCig"] = __cuStreamBeginCaptureToCig + + global __cuStreamEndCaptureToCig + data["__cuStreamEndCaptureToCig"] = __cuStreamEndCaptureToCig + + global __cuFuncGetParamCount + data["__cuFuncGetParamCount"] = __cuFuncGetParamCount + + global __cuLaunchHostFunc_v2 + data["__cuLaunchHostFunc_v2"] = __cuLaunchHostFunc_v2 + + global __cuGraphNodeGetParams + data["__cuGraphNodeGetParams"] = __cuGraphNodeGetParams + + global __cuCoredumpRegisterStartCallback + data["__cuCoredumpRegisterStartCallback"] = __cuCoredumpRegisterStartCallback + + global __cuCoredumpRegisterCompleteCallback + data["__cuCoredumpRegisterCompleteCallback"] = __cuCoredumpRegisterCompleteCallback + + global __cuCoredumpDeregisterStartCallback + data["__cuCoredumpDeregisterStartCallback"] = __cuCoredumpDeregisterStartCallback + + global __cuCoredumpDeregisterCompleteCallback + data["__cuCoredumpDeregisterCompleteCallback"] = __cuCoredumpDeregisterCompleteCallback + + global __cuLogicalEndpointIdReserve + data["__cuLogicalEndpointIdReserve"] = __cuLogicalEndpointIdReserve + + global __cuLogicalEndpointIdRelease + data["__cuLogicalEndpointIdRelease"] = __cuLogicalEndpointIdRelease + + global __cuLogicalEndpointCreate + data["__cuLogicalEndpointCreate"] = __cuLogicalEndpointCreate + + global __cuLogicalEndpointAddDevice + data["__cuLogicalEndpointAddDevice"] = __cuLogicalEndpointAddDevice + + global __cuLogicalEndpointDestroy + data["__cuLogicalEndpointDestroy"] = __cuLogicalEndpointDestroy + + global __cuLogicalEndpointBindAddr + data["__cuLogicalEndpointBindAddr"] = __cuLogicalEndpointBindAddr + + global __cuLogicalEndpointBindMem + data["__cuLogicalEndpointBindMem"] = __cuLogicalEndpointBindMem + + global __cuLogicalEndpointUnbind + data["__cuLogicalEndpointUnbind"] = __cuLogicalEndpointUnbind + + global __cuLogicalEndpointExport + data["__cuLogicalEndpointExport"] = __cuLogicalEndpointExport + + global __cuLogicalEndpointImport + data["__cuLogicalEndpointImport"] = __cuLogicalEndpointImport + + global __cuLogicalEndpointGetLimits + data["__cuLogicalEndpointGetLimits"] = __cuLogicalEndpointGetLimits + + global __cuLogicalEndpointQuery + data["__cuLogicalEndpointQuery"] = __cuLogicalEndpointQuery + + global __cuStreamBeginRecaptureToGraph + data["__cuStreamBeginRecaptureToGraph"] = __cuStreamBeginRecaptureToGraph + + func_ptrs = data + return data + + +cpdef _inspect_function_pointer(str name): + global func_ptrs + if func_ptrs is None: + func_ptrs = _inspect_function_pointers() + return func_ptrs[name] + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef CUresult _cuGetErrorString(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGetErrorString + _check_or_init_driver() + if __cuGetErrorString == NULL: + with gil: + raise FunctionNotFoundError("function cuGetErrorString is not found") + return (__cuGetErrorString)( + error, pStr) + + +cdef CUresult _cuGetErrorName(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGetErrorName + _check_or_init_driver() + if __cuGetErrorName == NULL: + with gil: + raise FunctionNotFoundError("function cuGetErrorName is not found") + return (__cuGetErrorName)( + error, pStr) + + +cdef CUresult _cuInit(unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuInit + _check_or_init_driver() + if __cuInit == NULL: + with gil: + raise FunctionNotFoundError("function cuInit is not found") + return (__cuInit)( + Flags) + + +cdef CUresult _cuDriverGetVersion(int* driverVersion) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDriverGetVersion + _check_or_init_driver() + if __cuDriverGetVersion == NULL: + with gil: + raise FunctionNotFoundError("function cuDriverGetVersion is not found") + return (__cuDriverGetVersion)( + driverVersion) + + +cdef CUresult _cuDeviceGet(CUdevice* device, int ordinal) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGet + _check_or_init_driver() + if __cuDeviceGet == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGet is not found") + return (__cuDeviceGet)( + device, ordinal) + + +cdef CUresult _cuDeviceGetCount(int* count) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetCount + _check_or_init_driver() + if __cuDeviceGetCount == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetCount is not found") + return (__cuDeviceGetCount)( + count) + + +cdef CUresult _cuDeviceGetName(char* name, int len, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetName + _check_or_init_driver() + if __cuDeviceGetName == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetName is not found") + return (__cuDeviceGetName)( + name, len, dev) + + +cdef CUresult _cuDeviceGetUuid_v2(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetUuid_v2 + _check_or_init_driver() + if __cuDeviceGetUuid_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetUuid_v2 is not found") + return (__cuDeviceGetUuid_v2)( + uuid, dev) + + +cdef CUresult _cuDeviceGetLuid(char* luid, unsigned int* deviceNodeMask, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetLuid + _check_or_init_driver() + if __cuDeviceGetLuid == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetLuid is not found") + return (__cuDeviceGetLuid)( + luid, deviceNodeMask, dev) + + +cdef CUresult _cuDeviceTotalMem_v2(size_t* bytes, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceTotalMem_v2 + _check_or_init_driver() + if __cuDeviceTotalMem_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceTotalMem_v2 is not found") + return (__cuDeviceTotalMem_v2)( + bytes, dev) + + +cdef CUresult _cuDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, CUarray_format format, unsigned numChannels, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetTexture1DLinearMaxWidth + _check_or_init_driver() + if __cuDeviceGetTexture1DLinearMaxWidth == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetTexture1DLinearMaxWidth is not found") + return (__cuDeviceGetTexture1DLinearMaxWidth)( + maxWidthInElements, format, numChannels, dev) + + +cdef CUresult _cuDeviceGetAttribute(int* pi, CUdevice_attribute attrib, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetAttribute + _check_or_init_driver() + if __cuDeviceGetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetAttribute is not found") + return (__cuDeviceGetAttribute)( + pi, attrib, dev) + + +cdef CUresult _cuDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, CUdevice dev, int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetNvSciSyncAttributes + _check_or_init_driver() + if __cuDeviceGetNvSciSyncAttributes == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetNvSciSyncAttributes is not found") + return (__cuDeviceGetNvSciSyncAttributes)( + nvSciSyncAttrList, dev, flags) + + +cdef CUresult _cuDeviceSetMemPool(CUdevice dev, CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceSetMemPool + _check_or_init_driver() + if __cuDeviceSetMemPool == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceSetMemPool is not found") + return (__cuDeviceSetMemPool)( + dev, pool) + + +cdef CUresult _cuDeviceGetMemPool(CUmemoryPool* pool, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetMemPool + _check_or_init_driver() + if __cuDeviceGetMemPool == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetMemPool is not found") + return (__cuDeviceGetMemPool)( + pool, dev) + + +cdef CUresult _cuDeviceGetDefaultMemPool(CUmemoryPool* pool_out, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetDefaultMemPool + _check_or_init_driver() + if __cuDeviceGetDefaultMemPool == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetDefaultMemPool is not found") + return (__cuDeviceGetDefaultMemPool)( + pool_out, dev) + + +cdef CUresult _cuDeviceGetExecAffinitySupport(int* pi, CUexecAffinityType type, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetExecAffinitySupport + _check_or_init_driver() + if __cuDeviceGetExecAffinitySupport == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetExecAffinitySupport is not found") + return (__cuDeviceGetExecAffinitySupport)( + pi, type, dev) + + +cdef CUresult _cuFlushGPUDirectRDMAWrites(CUflushGPUDirectRDMAWritesTarget target, CUflushGPUDirectRDMAWritesScope scope) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFlushGPUDirectRDMAWrites + _check_or_init_driver() + if __cuFlushGPUDirectRDMAWrites == NULL: + with gil: + raise FunctionNotFoundError("function cuFlushGPUDirectRDMAWrites is not found") + return (__cuFlushGPUDirectRDMAWrites)( + target, scope) + + +cdef CUresult _cuDeviceGetProperties(CUdevprop* prop, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetProperties + _check_or_init_driver() + if __cuDeviceGetProperties == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetProperties is not found") + return (__cuDeviceGetProperties)( + prop, dev) + + +cdef CUresult _cuDeviceComputeCapability(int* major, int* minor, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceComputeCapability + _check_or_init_driver() + if __cuDeviceComputeCapability == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceComputeCapability is not found") + return (__cuDeviceComputeCapability)( + major, minor, dev) + + +cdef CUresult _cuDevicePrimaryCtxRetain(CUcontext* pctx, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDevicePrimaryCtxRetain + _check_or_init_driver() + if __cuDevicePrimaryCtxRetain == NULL: + with gil: + raise FunctionNotFoundError("function cuDevicePrimaryCtxRetain is not found") + return (__cuDevicePrimaryCtxRetain)( + pctx, dev) + + +cdef CUresult _cuDevicePrimaryCtxRelease_v2(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDevicePrimaryCtxRelease_v2 + _check_or_init_driver() + if __cuDevicePrimaryCtxRelease_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuDevicePrimaryCtxRelease_v2 is not found") + return (__cuDevicePrimaryCtxRelease_v2)( + dev) + + +cdef CUresult _cuDevicePrimaryCtxSetFlags_v2(CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDevicePrimaryCtxSetFlags_v2 + _check_or_init_driver() + if __cuDevicePrimaryCtxSetFlags_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuDevicePrimaryCtxSetFlags_v2 is not found") + return (__cuDevicePrimaryCtxSetFlags_v2)( + dev, flags) + + +cdef CUresult _cuDevicePrimaryCtxGetState(CUdevice dev, unsigned int* flags, int* active) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDevicePrimaryCtxGetState + _check_or_init_driver() + if __cuDevicePrimaryCtxGetState == NULL: + with gil: + raise FunctionNotFoundError("function cuDevicePrimaryCtxGetState is not found") + return (__cuDevicePrimaryCtxGetState)( + dev, flags, active) + + +cdef CUresult _cuDevicePrimaryCtxReset_v2(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDevicePrimaryCtxReset_v2 + _check_or_init_driver() + if __cuDevicePrimaryCtxReset_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuDevicePrimaryCtxReset_v2 is not found") + return (__cuDevicePrimaryCtxReset_v2)( + dev) + + +cdef CUresult _cuCtxCreate_v2(CUcontext* pctx, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxCreate_v2 + _check_or_init_driver() + if __cuCtxCreate_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxCreate_v2 is not found") + return (__cuCtxCreate_v2)( + pctx, flags, dev) + + +cdef CUresult _cuCtxCreate_v3(CUcontext* pctx, CUexecAffinityParam* paramsArray, int numParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxCreate_v3 + _check_or_init_driver() + if __cuCtxCreate_v3 == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxCreate_v3 is not found") + return (__cuCtxCreate_v3)( + pctx, paramsArray, numParams, flags, dev) + + +cdef CUresult _cuCtxCreate_v4(CUcontext* pctx, CUctxCreateParams* ctxCreateParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxCreate_v4 + _check_or_init_driver() + if __cuCtxCreate_v4 == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxCreate_v4 is not found") + return (__cuCtxCreate_v4)( + pctx, ctxCreateParams, flags, dev) + + +cdef CUresult _cuCtxDestroy_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxDestroy_v2 + _check_or_init_driver() + if __cuCtxDestroy_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxDestroy_v2 is not found") + return (__cuCtxDestroy_v2)( + ctx) + + +cdef CUresult _cuCtxPushCurrent_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxPushCurrent_v2 + _check_or_init_driver() + if __cuCtxPushCurrent_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxPushCurrent_v2 is not found") + return (__cuCtxPushCurrent_v2)( + ctx) + + +cdef CUresult _cuCtxPopCurrent_v2(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxPopCurrent_v2 + _check_or_init_driver() + if __cuCtxPopCurrent_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxPopCurrent_v2 is not found") + return (__cuCtxPopCurrent_v2)( + pctx) + + +cdef CUresult _cuCtxSetCurrent(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxSetCurrent + _check_or_init_driver() + if __cuCtxSetCurrent == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxSetCurrent is not found") + return (__cuCtxSetCurrent)( + ctx) + + +cdef CUresult _cuCtxGetCurrent(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxGetCurrent + _check_or_init_driver() + if __cuCtxGetCurrent == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxGetCurrent is not found") + return (__cuCtxGetCurrent)( + pctx) + + +cdef CUresult _cuCtxGetDevice(CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxGetDevice + _check_or_init_driver() + if __cuCtxGetDevice == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxGetDevice is not found") + return (__cuCtxGetDevice)( + device) + + +cdef CUresult _cuCtxGetFlags(unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxGetFlags + _check_or_init_driver() + if __cuCtxGetFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxGetFlags is not found") + return (__cuCtxGetFlags)( + flags) + + +cdef CUresult _cuCtxSetFlags(unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxSetFlags + _check_or_init_driver() + if __cuCtxSetFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxSetFlags is not found") + return (__cuCtxSetFlags)( + flags) + + +cdef CUresult _cuCtxGetId(CUcontext ctx, unsigned long long* ctxId) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxGetId + _check_or_init_driver() + if __cuCtxGetId == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxGetId is not found") + return (__cuCtxGetId)( + ctx, ctxId) + + +cdef CUresult _cuCtxSynchronize() except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxSynchronize + _check_or_init_driver() + if __cuCtxSynchronize == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxSynchronize is not found") + return (__cuCtxSynchronize)( + ) + + +cdef CUresult _cuCtxSetLimit(CUlimit limit, size_t value) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxSetLimit + _check_or_init_driver() + if __cuCtxSetLimit == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxSetLimit is not found") + return (__cuCtxSetLimit)( + limit, value) + + +cdef CUresult _cuCtxGetLimit(size_t* pvalue, CUlimit limit) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxGetLimit + _check_or_init_driver() + if __cuCtxGetLimit == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxGetLimit is not found") + return (__cuCtxGetLimit)( + pvalue, limit) + + +cdef CUresult _cuCtxGetCacheConfig(CUfunc_cache* pconfig) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxGetCacheConfig + _check_or_init_driver() + if __cuCtxGetCacheConfig == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxGetCacheConfig is not found") + return (__cuCtxGetCacheConfig)( + pconfig) + + +cdef CUresult _cuCtxSetCacheConfig(CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxSetCacheConfig + _check_or_init_driver() + if __cuCtxSetCacheConfig == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxSetCacheConfig is not found") + return (__cuCtxSetCacheConfig)( + config) + + +cdef CUresult _cuCtxGetApiVersion(CUcontext ctx, unsigned int* version) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxGetApiVersion + _check_or_init_driver() + if __cuCtxGetApiVersion == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxGetApiVersion is not found") + return (__cuCtxGetApiVersion)( + ctx, version) + + +cdef CUresult _cuCtxGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxGetStreamPriorityRange + _check_or_init_driver() + if __cuCtxGetStreamPriorityRange == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxGetStreamPriorityRange is not found") + return (__cuCtxGetStreamPriorityRange)( + leastPriority, greatestPriority) + + +cdef CUresult _cuCtxResetPersistingL2Cache() except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxResetPersistingL2Cache + _check_or_init_driver() + if __cuCtxResetPersistingL2Cache == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxResetPersistingL2Cache is not found") + return (__cuCtxResetPersistingL2Cache)( + ) + + +cdef CUresult _cuCtxGetExecAffinity(CUexecAffinityParam* pExecAffinity, CUexecAffinityType type) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxGetExecAffinity + _check_or_init_driver() + if __cuCtxGetExecAffinity == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxGetExecAffinity is not found") + return (__cuCtxGetExecAffinity)( + pExecAffinity, type) + + +cdef CUresult _cuCtxRecordEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxRecordEvent + _check_or_init_driver() + if __cuCtxRecordEvent == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxRecordEvent is not found") + return (__cuCtxRecordEvent)( + hCtx, hEvent) + + +cdef CUresult _cuCtxWaitEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxWaitEvent + _check_or_init_driver() + if __cuCtxWaitEvent == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxWaitEvent is not found") + return (__cuCtxWaitEvent)( + hCtx, hEvent) + + +cdef CUresult _cuCtxAttach(CUcontext* pctx, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxAttach + _check_or_init_driver() + if __cuCtxAttach == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxAttach is not found") + return (__cuCtxAttach)( + pctx, flags) + + +cdef CUresult _cuCtxDetach(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxDetach + _check_or_init_driver() + if __cuCtxDetach == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxDetach is not found") + return (__cuCtxDetach)( + ctx) + + +cdef CUresult _cuCtxGetSharedMemConfig(CUsharedconfig* pConfig) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxGetSharedMemConfig + _check_or_init_driver() + if __cuCtxGetSharedMemConfig == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxGetSharedMemConfig is not found") + return (__cuCtxGetSharedMemConfig)( + pConfig) + + +cdef CUresult _cuCtxSetSharedMemConfig(CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxSetSharedMemConfig + _check_or_init_driver() + if __cuCtxSetSharedMemConfig == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxSetSharedMemConfig is not found") + return (__cuCtxSetSharedMemConfig)( + config) + + +cdef CUresult _cuModuleLoad(CUmodule* module, const char* fname) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuModuleLoad + _check_or_init_driver() + if __cuModuleLoad == NULL: + with gil: + raise FunctionNotFoundError("function cuModuleLoad is not found") + return (__cuModuleLoad)( + module, fname) + + +cdef CUresult _cuModuleLoadData(CUmodule* module, const void* image) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuModuleLoadData + _check_or_init_driver() + if __cuModuleLoadData == NULL: + with gil: + raise FunctionNotFoundError("function cuModuleLoadData is not found") + return (__cuModuleLoadData)( + module, image) + + +cdef CUresult _cuModuleLoadDataEx(CUmodule* module, const void* image, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuModuleLoadDataEx + _check_or_init_driver() + if __cuModuleLoadDataEx == NULL: + with gil: + raise FunctionNotFoundError("function cuModuleLoadDataEx is not found") + return (__cuModuleLoadDataEx)( + module, image, numOptions, options, optionValues) + + +cdef CUresult _cuModuleLoadFatBinary(CUmodule* module, const void* fatCubin) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuModuleLoadFatBinary + _check_or_init_driver() + if __cuModuleLoadFatBinary == NULL: + with gil: + raise FunctionNotFoundError("function cuModuleLoadFatBinary is not found") + return (__cuModuleLoadFatBinary)( + module, fatCubin) + + +cdef CUresult _cuModuleUnload(CUmodule hmod) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuModuleUnload + _check_or_init_driver() + if __cuModuleUnload == NULL: + with gil: + raise FunctionNotFoundError("function cuModuleUnload is not found") + return (__cuModuleUnload)( + hmod) + + +cdef CUresult _cuModuleGetLoadingMode(CUmoduleLoadingMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuModuleGetLoadingMode + _check_or_init_driver() + if __cuModuleGetLoadingMode == NULL: + with gil: + raise FunctionNotFoundError("function cuModuleGetLoadingMode is not found") + return (__cuModuleGetLoadingMode)( + mode) + + +cdef CUresult _cuModuleGetFunction(CUfunction* hfunc, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuModuleGetFunction + _check_or_init_driver() + if __cuModuleGetFunction == NULL: + with gil: + raise FunctionNotFoundError("function cuModuleGetFunction is not found") + return (__cuModuleGetFunction)( + hfunc, hmod, name) + + +cdef CUresult _cuModuleGetFunctionCount(unsigned int* count, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuModuleGetFunctionCount + _check_or_init_driver() + if __cuModuleGetFunctionCount == NULL: + with gil: + raise FunctionNotFoundError("function cuModuleGetFunctionCount is not found") + return (__cuModuleGetFunctionCount)( + count, mod) + + +cdef CUresult _cuModuleEnumerateFunctions(CUfunction* functions, unsigned int numFunctions, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuModuleEnumerateFunctions + _check_or_init_driver() + if __cuModuleEnumerateFunctions == NULL: + with gil: + raise FunctionNotFoundError("function cuModuleEnumerateFunctions is not found") + return (__cuModuleEnumerateFunctions)( + functions, numFunctions, mod) + + +cdef CUresult _cuModuleGetGlobal_v2(CUdeviceptr* dptr, size_t* bytes, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuModuleGetGlobal_v2 + _check_or_init_driver() + if __cuModuleGetGlobal_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuModuleGetGlobal_v2 is not found") + return (__cuModuleGetGlobal_v2)( + dptr, bytes, hmod, name) + + +cdef CUresult _cuLinkCreate_v2(unsigned int numOptions, CUjit_option* options, void** optionValues, CUlinkState* stateOut) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLinkCreate_v2 + _check_or_init_driver() + if __cuLinkCreate_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuLinkCreate_v2 is not found") + return (__cuLinkCreate_v2)( + numOptions, options, optionValues, stateOut) + + +cdef CUresult _cuLinkAddData_v2(CUlinkState state, CUjitInputType type, void* data, size_t size, const char* name, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLinkAddData_v2 + _check_or_init_driver() + if __cuLinkAddData_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuLinkAddData_v2 is not found") + return (__cuLinkAddData_v2)( + state, type, data, size, name, numOptions, options, optionValues) + + +cdef CUresult _cuLinkAddFile_v2(CUlinkState state, CUjitInputType type, const char* path, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLinkAddFile_v2 + _check_or_init_driver() + if __cuLinkAddFile_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuLinkAddFile_v2 is not found") + return (__cuLinkAddFile_v2)( + state, type, path, numOptions, options, optionValues) + + +cdef CUresult _cuLinkComplete(CUlinkState state, void** cubinOut, size_t* sizeOut) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLinkComplete + _check_or_init_driver() + if __cuLinkComplete == NULL: + with gil: + raise FunctionNotFoundError("function cuLinkComplete is not found") + return (__cuLinkComplete)( + state, cubinOut, sizeOut) + + +cdef CUresult _cuLinkDestroy(CUlinkState state) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLinkDestroy + _check_or_init_driver() + if __cuLinkDestroy == NULL: + with gil: + raise FunctionNotFoundError("function cuLinkDestroy is not found") + return (__cuLinkDestroy)( + state) + + +cdef CUresult _cuModuleGetTexRef(CUtexref* pTexRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuModuleGetTexRef + _check_or_init_driver() + if __cuModuleGetTexRef == NULL: + with gil: + raise FunctionNotFoundError("function cuModuleGetTexRef is not found") + return (__cuModuleGetTexRef)( + pTexRef, hmod, name) + + +cdef CUresult _cuModuleGetSurfRef(CUsurfref* pSurfRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuModuleGetSurfRef + _check_or_init_driver() + if __cuModuleGetSurfRef == NULL: + with gil: + raise FunctionNotFoundError("function cuModuleGetSurfRef is not found") + return (__cuModuleGetSurfRef)( + pSurfRef, hmod, name) + + +cdef CUresult _cuLibraryLoadData(CUlibrary* library, const void* code, CUjit_option* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, CUlibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLibraryLoadData + _check_or_init_driver() + if __cuLibraryLoadData == NULL: + with gil: + raise FunctionNotFoundError("function cuLibraryLoadData is not found") + return (__cuLibraryLoadData)( + library, code, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions) + + +cdef CUresult _cuLibraryLoadFromFile(CUlibrary* library, const char* fileName, CUjit_option* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, CUlibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLibraryLoadFromFile + _check_or_init_driver() + if __cuLibraryLoadFromFile == NULL: + with gil: + raise FunctionNotFoundError("function cuLibraryLoadFromFile is not found") + return (__cuLibraryLoadFromFile)( + library, fileName, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions) + + +cdef CUresult _cuLibraryUnload(CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLibraryUnload + _check_or_init_driver() + if __cuLibraryUnload == NULL: + with gil: + raise FunctionNotFoundError("function cuLibraryUnload is not found") + return (__cuLibraryUnload)( + library) + + +cdef CUresult _cuLibraryGetKernel(CUkernel* pKernel, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLibraryGetKernel + _check_or_init_driver() + if __cuLibraryGetKernel == NULL: + with gil: + raise FunctionNotFoundError("function cuLibraryGetKernel is not found") + return (__cuLibraryGetKernel)( + pKernel, library, name) + + +cdef CUresult _cuLibraryGetKernelCount(unsigned int* count, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLibraryGetKernelCount + _check_or_init_driver() + if __cuLibraryGetKernelCount == NULL: + with gil: + raise FunctionNotFoundError("function cuLibraryGetKernelCount is not found") + return (__cuLibraryGetKernelCount)( + count, lib) + + +cdef CUresult _cuLibraryEnumerateKernels(CUkernel* kernels, unsigned int numKernels, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLibraryEnumerateKernels + _check_or_init_driver() + if __cuLibraryEnumerateKernels == NULL: + with gil: + raise FunctionNotFoundError("function cuLibraryEnumerateKernels is not found") + return (__cuLibraryEnumerateKernels)( + kernels, numKernels, lib) + + +cdef CUresult _cuLibraryGetModule(CUmodule* pMod, CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLibraryGetModule + _check_or_init_driver() + if __cuLibraryGetModule == NULL: + with gil: + raise FunctionNotFoundError("function cuLibraryGetModule is not found") + return (__cuLibraryGetModule)( + pMod, library) + + +cdef CUresult _cuKernelGetFunction(CUfunction* pFunc, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuKernelGetFunction + _check_or_init_driver() + if __cuKernelGetFunction == NULL: + with gil: + raise FunctionNotFoundError("function cuKernelGetFunction is not found") + return (__cuKernelGetFunction)( + pFunc, kernel) + + +cdef CUresult _cuKernelGetLibrary(CUlibrary* pLib, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuKernelGetLibrary + _check_or_init_driver() + if __cuKernelGetLibrary == NULL: + with gil: + raise FunctionNotFoundError("function cuKernelGetLibrary is not found") + return (__cuKernelGetLibrary)( + pLib, kernel) + + +cdef CUresult _cuLibraryGetGlobal(CUdeviceptr* dptr, size_t* bytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLibraryGetGlobal + _check_or_init_driver() + if __cuLibraryGetGlobal == NULL: + with gil: + raise FunctionNotFoundError("function cuLibraryGetGlobal is not found") + return (__cuLibraryGetGlobal)( + dptr, bytes, library, name) + + +cdef CUresult _cuLibraryGetManaged(CUdeviceptr* dptr, size_t* bytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLibraryGetManaged + _check_or_init_driver() + if __cuLibraryGetManaged == NULL: + with gil: + raise FunctionNotFoundError("function cuLibraryGetManaged is not found") + return (__cuLibraryGetManaged)( + dptr, bytes, library, name) + + +cdef CUresult _cuLibraryGetUnifiedFunction(void** fptr, CUlibrary library, const char* symbol) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLibraryGetUnifiedFunction + _check_or_init_driver() + if __cuLibraryGetUnifiedFunction == NULL: + with gil: + raise FunctionNotFoundError("function cuLibraryGetUnifiedFunction is not found") + return (__cuLibraryGetUnifiedFunction)( + fptr, library, symbol) + + +cdef CUresult _cuKernelGetAttribute(int* pi, CUfunction_attribute attrib, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuKernelGetAttribute + _check_or_init_driver() + if __cuKernelGetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuKernelGetAttribute is not found") + return (__cuKernelGetAttribute)( + pi, attrib, kernel, dev) + + +cdef CUresult _cuKernelSetAttribute(CUfunction_attribute attrib, int val, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuKernelSetAttribute + _check_or_init_driver() + if __cuKernelSetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuKernelSetAttribute is not found") + return (__cuKernelSetAttribute)( + attrib, val, kernel, dev) + + +cdef CUresult _cuKernelSetCacheConfig(CUkernel kernel, CUfunc_cache config, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuKernelSetCacheConfig + _check_or_init_driver() + if __cuKernelSetCacheConfig == NULL: + with gil: + raise FunctionNotFoundError("function cuKernelSetCacheConfig is not found") + return (__cuKernelSetCacheConfig)( + kernel, config, dev) + + +cdef CUresult _cuKernelGetName(const char** name, CUkernel hfunc) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuKernelGetName + _check_or_init_driver() + if __cuKernelGetName == NULL: + with gil: + raise FunctionNotFoundError("function cuKernelGetName is not found") + return (__cuKernelGetName)( + name, hfunc) + + +cdef CUresult _cuKernelGetParamInfo(CUkernel kernel, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuKernelGetParamInfo + _check_or_init_driver() + if __cuKernelGetParamInfo == NULL: + with gil: + raise FunctionNotFoundError("function cuKernelGetParamInfo is not found") + return (__cuKernelGetParamInfo)( + kernel, paramIndex, paramOffset, paramSize) + + +cdef CUresult _cuMemGetInfo_v2(size_t* free, size_t* total) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemGetInfo_v2 + _check_or_init_driver() + if __cuMemGetInfo_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemGetInfo_v2 is not found") + return (__cuMemGetInfo_v2)( + free, total) + + +cdef CUresult _cuMemAlloc_v2(CUdeviceptr* dptr, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemAlloc_v2 + _check_or_init_driver() + if __cuMemAlloc_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemAlloc_v2 is not found") + return (__cuMemAlloc_v2)( + dptr, bytesize) + + +cdef CUresult _cuMemAllocPitch_v2(CUdeviceptr* dptr, size_t* pPitch, size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemAllocPitch_v2 + _check_or_init_driver() + if __cuMemAllocPitch_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemAllocPitch_v2 is not found") + return (__cuMemAllocPitch_v2)( + dptr, pPitch, WidthInBytes, Height, ElementSizeBytes) + + +cdef CUresult _cuMemFree_v2(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemFree_v2 + _check_or_init_driver() + if __cuMemFree_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemFree_v2 is not found") + return (__cuMemFree_v2)( + dptr) + + +cdef CUresult _cuMemGetAddressRange_v2(CUdeviceptr* pbase, size_t* psize, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemGetAddressRange_v2 + _check_or_init_driver() + if __cuMemGetAddressRange_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemGetAddressRange_v2 is not found") + return (__cuMemGetAddressRange_v2)( + pbase, psize, dptr) + + +cdef CUresult _cuMemAllocHost_v2(void** pp, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemAllocHost_v2 + _check_or_init_driver() + if __cuMemAllocHost_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemAllocHost_v2 is not found") + return (__cuMemAllocHost_v2)( + pp, bytesize) + + +cdef CUresult _cuMemFreeHost(void* p) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemFreeHost + _check_or_init_driver() + if __cuMemFreeHost == NULL: + with gil: + raise FunctionNotFoundError("function cuMemFreeHost is not found") + return (__cuMemFreeHost)( + p) + + +cdef CUresult _cuMemHostAlloc(void** pp, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemHostAlloc + _check_or_init_driver() + if __cuMemHostAlloc == NULL: + with gil: + raise FunctionNotFoundError("function cuMemHostAlloc is not found") + return (__cuMemHostAlloc)( + pp, bytesize, Flags) + + +cdef CUresult _cuMemHostGetDevicePointer_v2(CUdeviceptr* pdptr, void* p, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemHostGetDevicePointer_v2 + _check_or_init_driver() + if __cuMemHostGetDevicePointer_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemHostGetDevicePointer_v2 is not found") + return (__cuMemHostGetDevicePointer_v2)( + pdptr, p, Flags) + + +cdef CUresult _cuMemHostGetFlags(unsigned int* pFlags, void* p) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemHostGetFlags + _check_or_init_driver() + if __cuMemHostGetFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuMemHostGetFlags is not found") + return (__cuMemHostGetFlags)( + pFlags, p) + + +cdef CUresult _cuMemAllocManaged(CUdeviceptr* dptr, size_t bytesize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemAllocManaged + _check_or_init_driver() + if __cuMemAllocManaged == NULL: + with gil: + raise FunctionNotFoundError("function cuMemAllocManaged is not found") + return (__cuMemAllocManaged)( + dptr, bytesize, flags) + + +cdef CUresult _cuDeviceRegisterAsyncNotification(CUdevice device, CUasyncCallback callbackFunc, void* userData, CUasyncCallbackHandle* callback) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceRegisterAsyncNotification + _check_or_init_driver() + if __cuDeviceRegisterAsyncNotification == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceRegisterAsyncNotification is not found") + return (__cuDeviceRegisterAsyncNotification)( + device, callbackFunc, userData, callback) + + +cdef CUresult _cuDeviceUnregisterAsyncNotification(CUdevice device, CUasyncCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceUnregisterAsyncNotification + _check_or_init_driver() + if __cuDeviceUnregisterAsyncNotification == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceUnregisterAsyncNotification is not found") + return (__cuDeviceUnregisterAsyncNotification)( + device, callback) + + +cdef CUresult _cuDeviceGetByPCIBusId(CUdevice* dev, const char* pciBusId) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetByPCIBusId + _check_or_init_driver() + if __cuDeviceGetByPCIBusId == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetByPCIBusId is not found") + return (__cuDeviceGetByPCIBusId)( + dev, pciBusId) + + +cdef CUresult _cuDeviceGetPCIBusId(char* pciBusId, int len, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetPCIBusId + _check_or_init_driver() + if __cuDeviceGetPCIBusId == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetPCIBusId is not found") + return (__cuDeviceGetPCIBusId)( + pciBusId, len, dev) + + +cdef CUresult _cuIpcGetEventHandle(CUipcEventHandle* pHandle, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuIpcGetEventHandle + _check_or_init_driver() + if __cuIpcGetEventHandle == NULL: + with gil: + raise FunctionNotFoundError("function cuIpcGetEventHandle is not found") + return (__cuIpcGetEventHandle)( + pHandle, event) + + +cdef CUresult _cuIpcOpenEventHandle(CUevent* phEvent, CUipcEventHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuIpcOpenEventHandle + _check_or_init_driver() + if __cuIpcOpenEventHandle == NULL: + with gil: + raise FunctionNotFoundError("function cuIpcOpenEventHandle is not found") + return (__cuIpcOpenEventHandle)( + phEvent, handle) + + +cdef CUresult _cuIpcGetMemHandle(CUipcMemHandle* pHandle, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuIpcGetMemHandle + _check_or_init_driver() + if __cuIpcGetMemHandle == NULL: + with gil: + raise FunctionNotFoundError("function cuIpcGetMemHandle is not found") + return (__cuIpcGetMemHandle)( + pHandle, dptr) + + +cdef CUresult _cuIpcOpenMemHandle_v2(CUdeviceptr* pdptr, CUipcMemHandle handle, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuIpcOpenMemHandle_v2 + _check_or_init_driver() + if __cuIpcOpenMemHandle_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuIpcOpenMemHandle_v2 is not found") + return (__cuIpcOpenMemHandle_v2)( + pdptr, handle, Flags) + + +cdef CUresult _cuIpcCloseMemHandle(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuIpcCloseMemHandle + _check_or_init_driver() + if __cuIpcCloseMemHandle == NULL: + with gil: + raise FunctionNotFoundError("function cuIpcCloseMemHandle is not found") + return (__cuIpcCloseMemHandle)( + dptr) + + +cdef CUresult _cuMemHostRegister_v2(void* p, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemHostRegister_v2 + _check_or_init_driver() + if __cuMemHostRegister_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemHostRegister_v2 is not found") + return (__cuMemHostRegister_v2)( + p, bytesize, Flags) + + +cdef CUresult _cuMemHostUnregister(void* p) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemHostUnregister + _check_or_init_driver() + if __cuMemHostUnregister == NULL: + with gil: + raise FunctionNotFoundError("function cuMemHostUnregister is not found") + return (__cuMemHostUnregister)( + p) + + +cdef CUresult _cuMemcpy(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpy + _check_or_init_driver() + if __cuMemcpy == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpy is not found") + return (__cuMemcpy)( + dst, src, ByteCount) + + +cdef CUresult _cuMemcpyPeer(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyPeer + _check_or_init_driver() + if __cuMemcpyPeer == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyPeer is not found") + return (__cuMemcpyPeer)( + dstDevice, dstContext, srcDevice, srcContext, ByteCount) + + +cdef CUresult _cuMemcpyHtoD_v2(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyHtoD_v2 + _check_or_init_driver() + if __cuMemcpyHtoD_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyHtoD_v2 is not found") + return (__cuMemcpyHtoD_v2)( + dstDevice, srcHost, ByteCount) + + +cdef CUresult _cuMemcpyDtoH_v2(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyDtoH_v2 + _check_or_init_driver() + if __cuMemcpyDtoH_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyDtoH_v2 is not found") + return (__cuMemcpyDtoH_v2)( + dstHost, srcDevice, ByteCount) + + +cdef CUresult _cuMemcpyDtoD_v2(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyDtoD_v2 + _check_or_init_driver() + if __cuMemcpyDtoD_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyDtoD_v2 is not found") + return (__cuMemcpyDtoD_v2)( + dstDevice, srcDevice, ByteCount) + + +cdef CUresult _cuMemcpyDtoA_v2(CUarray dstArray, size_t dstOffset, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyDtoA_v2 + _check_or_init_driver() + if __cuMemcpyDtoA_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyDtoA_v2 is not found") + return (__cuMemcpyDtoA_v2)( + dstArray, dstOffset, srcDevice, ByteCount) + + +cdef CUresult _cuMemcpyAtoD_v2(CUdeviceptr dstDevice, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyAtoD_v2 + _check_or_init_driver() + if __cuMemcpyAtoD_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyAtoD_v2 is not found") + return (__cuMemcpyAtoD_v2)( + dstDevice, srcArray, srcOffset, ByteCount) + + +cdef CUresult _cuMemcpyHtoA_v2(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyHtoA_v2 + _check_or_init_driver() + if __cuMemcpyHtoA_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyHtoA_v2 is not found") + return (__cuMemcpyHtoA_v2)( + dstArray, dstOffset, srcHost, ByteCount) + + +cdef CUresult _cuMemcpyAtoH_v2(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyAtoH_v2 + _check_or_init_driver() + if __cuMemcpyAtoH_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyAtoH_v2 is not found") + return (__cuMemcpyAtoH_v2)( + dstHost, srcArray, srcOffset, ByteCount) + + +cdef CUresult _cuMemcpyAtoA_v2(CUarray dstArray, size_t dstOffset, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyAtoA_v2 + _check_or_init_driver() + if __cuMemcpyAtoA_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyAtoA_v2 is not found") + return (__cuMemcpyAtoA_v2)( + dstArray, dstOffset, srcArray, srcOffset, ByteCount) + + +cdef CUresult _cuMemcpy2D_v2(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpy2D_v2 + _check_or_init_driver() + if __cuMemcpy2D_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpy2D_v2 is not found") + return (__cuMemcpy2D_v2)( + pCopy) + + +cdef CUresult _cuMemcpy2DUnaligned_v2(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpy2DUnaligned_v2 + _check_or_init_driver() + if __cuMemcpy2DUnaligned_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpy2DUnaligned_v2 is not found") + return (__cuMemcpy2DUnaligned_v2)( + pCopy) + + +cdef CUresult _cuMemcpy3D_v2(const CUDA_MEMCPY3D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpy3D_v2 + _check_or_init_driver() + if __cuMemcpy3D_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpy3D_v2 is not found") + return (__cuMemcpy3D_v2)( + pCopy) + + +cdef CUresult _cuMemcpy3DPeer(const CUDA_MEMCPY3D_PEER* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpy3DPeer + _check_or_init_driver() + if __cuMemcpy3DPeer == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpy3DPeer is not found") + return (__cuMemcpy3DPeer)( + pCopy) + + +cdef CUresult _cuMemcpyAsync(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyAsync + _check_or_init_driver() + if __cuMemcpyAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyAsync is not found") + return (__cuMemcpyAsync)( + dst, src, ByteCount, hStream) + + +cdef CUresult _cuMemcpyPeerAsync(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyPeerAsync + _check_or_init_driver() + if __cuMemcpyPeerAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyPeerAsync is not found") + return (__cuMemcpyPeerAsync)( + dstDevice, dstContext, srcDevice, srcContext, ByteCount, hStream) + + +cdef CUresult _cuMemcpyHtoDAsync_v2(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyHtoDAsync_v2 + _check_or_init_driver() + if __cuMemcpyHtoDAsync_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyHtoDAsync_v2 is not found") + return (__cuMemcpyHtoDAsync_v2)( + dstDevice, srcHost, ByteCount, hStream) + + +cdef CUresult _cuMemcpyDtoHAsync_v2(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyDtoHAsync_v2 + _check_or_init_driver() + if __cuMemcpyDtoHAsync_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyDtoHAsync_v2 is not found") + return (__cuMemcpyDtoHAsync_v2)( + dstHost, srcDevice, ByteCount, hStream) + + +cdef CUresult _cuMemcpyDtoDAsync_v2(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyDtoDAsync_v2 + _check_or_init_driver() + if __cuMemcpyDtoDAsync_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyDtoDAsync_v2 is not found") + return (__cuMemcpyDtoDAsync_v2)( + dstDevice, srcDevice, ByteCount, hStream) + + +cdef CUresult _cuMemcpyHtoAAsync_v2(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyHtoAAsync_v2 + _check_or_init_driver() + if __cuMemcpyHtoAAsync_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyHtoAAsync_v2 is not found") + return (__cuMemcpyHtoAAsync_v2)( + dstArray, dstOffset, srcHost, ByteCount, hStream) + + +cdef CUresult _cuMemcpyAtoHAsync_v2(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyAtoHAsync_v2 + _check_or_init_driver() + if __cuMemcpyAtoHAsync_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyAtoHAsync_v2 is not found") + return (__cuMemcpyAtoHAsync_v2)( + dstHost, srcArray, srcOffset, ByteCount, hStream) + + +cdef CUresult _cuMemcpy2DAsync_v2(const CUDA_MEMCPY2D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpy2DAsync_v2 + _check_or_init_driver() + if __cuMemcpy2DAsync_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpy2DAsync_v2 is not found") + return (__cuMemcpy2DAsync_v2)( + pCopy, hStream) + + +cdef CUresult _cuMemcpy3DAsync_v2(const CUDA_MEMCPY3D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpy3DAsync_v2 + _check_or_init_driver() + if __cuMemcpy3DAsync_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpy3DAsync_v2 is not found") + return (__cuMemcpy3DAsync_v2)( + pCopy, hStream) + + +cdef CUresult _cuMemcpy3DPeerAsync(const CUDA_MEMCPY3D_PEER* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpy3DPeerAsync + _check_or_init_driver() + if __cuMemcpy3DPeerAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpy3DPeerAsync is not found") + return (__cuMemcpy3DPeerAsync)( + pCopy, hStream) + + +cdef CUresult _cuMemsetD8_v2(CUdeviceptr dstDevice, unsigned char uc, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemsetD8_v2 + _check_or_init_driver() + if __cuMemsetD8_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemsetD8_v2 is not found") + return (__cuMemsetD8_v2)( + dstDevice, uc, N) + + +cdef CUresult _cuMemsetD16_v2(CUdeviceptr dstDevice, unsigned short us, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemsetD16_v2 + _check_or_init_driver() + if __cuMemsetD16_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemsetD16_v2 is not found") + return (__cuMemsetD16_v2)( + dstDevice, us, N) + + +cdef CUresult _cuMemsetD32_v2(CUdeviceptr dstDevice, unsigned int ui, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemsetD32_v2 + _check_or_init_driver() + if __cuMemsetD32_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemsetD32_v2 is not found") + return (__cuMemsetD32_v2)( + dstDevice, ui, N) + + +cdef CUresult _cuMemsetD2D8_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemsetD2D8_v2 + _check_or_init_driver() + if __cuMemsetD2D8_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemsetD2D8_v2 is not found") + return (__cuMemsetD2D8_v2)( + dstDevice, dstPitch, uc, Width, Height) + + +cdef CUresult _cuMemsetD2D16_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemsetD2D16_v2 + _check_or_init_driver() + if __cuMemsetD2D16_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemsetD2D16_v2 is not found") + return (__cuMemsetD2D16_v2)( + dstDevice, dstPitch, us, Width, Height) + + +cdef CUresult _cuMemsetD2D32_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemsetD2D32_v2 + _check_or_init_driver() + if __cuMemsetD2D32_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemsetD2D32_v2 is not found") + return (__cuMemsetD2D32_v2)( + dstDevice, dstPitch, ui, Width, Height) + + +cdef CUresult _cuMemsetD8Async(CUdeviceptr dstDevice, unsigned char uc, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemsetD8Async + _check_or_init_driver() + if __cuMemsetD8Async == NULL: + with gil: + raise FunctionNotFoundError("function cuMemsetD8Async is not found") + return (__cuMemsetD8Async)( + dstDevice, uc, N, hStream) + + +cdef CUresult _cuMemsetD16Async(CUdeviceptr dstDevice, unsigned short us, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemsetD16Async + _check_or_init_driver() + if __cuMemsetD16Async == NULL: + with gil: + raise FunctionNotFoundError("function cuMemsetD16Async is not found") + return (__cuMemsetD16Async)( + dstDevice, us, N, hStream) + + +cdef CUresult _cuMemsetD32Async(CUdeviceptr dstDevice, unsigned int ui, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemsetD32Async + _check_or_init_driver() + if __cuMemsetD32Async == NULL: + with gil: + raise FunctionNotFoundError("function cuMemsetD32Async is not found") + return (__cuMemsetD32Async)( + dstDevice, ui, N, hStream) + + +cdef CUresult _cuMemsetD2D8Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemsetD2D8Async + _check_or_init_driver() + if __cuMemsetD2D8Async == NULL: + with gil: + raise FunctionNotFoundError("function cuMemsetD2D8Async is not found") + return (__cuMemsetD2D8Async)( + dstDevice, dstPitch, uc, Width, Height, hStream) + + +cdef CUresult _cuMemsetD2D16Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemsetD2D16Async + _check_or_init_driver() + if __cuMemsetD2D16Async == NULL: + with gil: + raise FunctionNotFoundError("function cuMemsetD2D16Async is not found") + return (__cuMemsetD2D16Async)( + dstDevice, dstPitch, us, Width, Height, hStream) + + +cdef CUresult _cuMemsetD2D32Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemsetD2D32Async + _check_or_init_driver() + if __cuMemsetD2D32Async == NULL: + with gil: + raise FunctionNotFoundError("function cuMemsetD2D32Async is not found") + return (__cuMemsetD2D32Async)( + dstDevice, dstPitch, ui, Width, Height, hStream) + + +cdef CUresult _cuArrayCreate_v2(CUarray* pHandle, const CUDA_ARRAY_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuArrayCreate_v2 + _check_or_init_driver() + if __cuArrayCreate_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuArrayCreate_v2 is not found") + return (__cuArrayCreate_v2)( + pHandle, pAllocateArray) + + +cdef CUresult _cuArrayGetDescriptor_v2(CUDA_ARRAY_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuArrayGetDescriptor_v2 + _check_or_init_driver() + if __cuArrayGetDescriptor_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuArrayGetDescriptor_v2 is not found") + return (__cuArrayGetDescriptor_v2)( + pArrayDescriptor, hArray) + + +cdef CUresult _cuArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUarray array) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuArrayGetSparseProperties + _check_or_init_driver() + if __cuArrayGetSparseProperties == NULL: + with gil: + raise FunctionNotFoundError("function cuArrayGetSparseProperties is not found") + return (__cuArrayGetSparseProperties)( + sparseProperties, array) + + +cdef CUresult _cuMipmappedArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUmipmappedArray mipmap) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMipmappedArrayGetSparseProperties + _check_or_init_driver() + if __cuMipmappedArrayGetSparseProperties == NULL: + with gil: + raise FunctionNotFoundError("function cuMipmappedArrayGetSparseProperties is not found") + return (__cuMipmappedArrayGetSparseProperties)( + sparseProperties, mipmap) + + +cdef CUresult _cuArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUarray array, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuArrayGetMemoryRequirements + _check_or_init_driver() + if __cuArrayGetMemoryRequirements == NULL: + with gil: + raise FunctionNotFoundError("function cuArrayGetMemoryRequirements is not found") + return (__cuArrayGetMemoryRequirements)( + memoryRequirements, array, device) + + +cdef CUresult _cuMipmappedArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUmipmappedArray mipmap, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMipmappedArrayGetMemoryRequirements + _check_or_init_driver() + if __cuMipmappedArrayGetMemoryRequirements == NULL: + with gil: + raise FunctionNotFoundError("function cuMipmappedArrayGetMemoryRequirements is not found") + return (__cuMipmappedArrayGetMemoryRequirements)( + memoryRequirements, mipmap, device) + + +cdef CUresult _cuArrayGetPlane(CUarray* pPlaneArray, CUarray hArray, unsigned int planeIdx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuArrayGetPlane + _check_or_init_driver() + if __cuArrayGetPlane == NULL: + with gil: + raise FunctionNotFoundError("function cuArrayGetPlane is not found") + return (__cuArrayGetPlane)( + pPlaneArray, hArray, planeIdx) + + +cdef CUresult _cuArrayDestroy(CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuArrayDestroy + _check_or_init_driver() + if __cuArrayDestroy == NULL: + with gil: + raise FunctionNotFoundError("function cuArrayDestroy is not found") + return (__cuArrayDestroy)( + hArray) + + +cdef CUresult _cuArray3DCreate_v2(CUarray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuArray3DCreate_v2 + _check_or_init_driver() + if __cuArray3DCreate_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuArray3DCreate_v2 is not found") + return (__cuArray3DCreate_v2)( + pHandle, pAllocateArray) + + +cdef CUresult _cuArray3DGetDescriptor_v2(CUDA_ARRAY3D_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuArray3DGetDescriptor_v2 + _check_or_init_driver() + if __cuArray3DGetDescriptor_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuArray3DGetDescriptor_v2 is not found") + return (__cuArray3DGetDescriptor_v2)( + pArrayDescriptor, hArray) + + +cdef CUresult _cuMipmappedArrayCreate(CUmipmappedArray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pMipmappedArrayDesc, unsigned int numMipmapLevels) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMipmappedArrayCreate + _check_or_init_driver() + if __cuMipmappedArrayCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuMipmappedArrayCreate is not found") + return (__cuMipmappedArrayCreate)( + pHandle, pMipmappedArrayDesc, numMipmapLevels) + + +cdef CUresult _cuMipmappedArrayGetLevel(CUarray* pLevelArray, CUmipmappedArray hMipmappedArray, unsigned int level) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMipmappedArrayGetLevel + _check_or_init_driver() + if __cuMipmappedArrayGetLevel == NULL: + with gil: + raise FunctionNotFoundError("function cuMipmappedArrayGetLevel is not found") + return (__cuMipmappedArrayGetLevel)( + pLevelArray, hMipmappedArray, level) + + +cdef CUresult _cuMipmappedArrayDestroy(CUmipmappedArray hMipmappedArray) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMipmappedArrayDestroy + _check_or_init_driver() + if __cuMipmappedArrayDestroy == NULL: + with gil: + raise FunctionNotFoundError("function cuMipmappedArrayDestroy is not found") + return (__cuMipmappedArrayDestroy)( + hMipmappedArray) + + +cdef CUresult _cuMemGetHandleForAddressRange(void* handle, CUdeviceptr dptr, size_t size, CUmemRangeHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemGetHandleForAddressRange + _check_or_init_driver() + if __cuMemGetHandleForAddressRange == NULL: + with gil: + raise FunctionNotFoundError("function cuMemGetHandleForAddressRange is not found") + return (__cuMemGetHandleForAddressRange)( + handle, dptr, size, handleType, flags) + + +cdef CUresult _cuMemBatchDecompressAsync(CUmemDecompressParams* paramsArray, size_t count, unsigned int flags, size_t* errorIndex, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemBatchDecompressAsync + _check_or_init_driver() + if __cuMemBatchDecompressAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemBatchDecompressAsync is not found") + return (__cuMemBatchDecompressAsync)( + paramsArray, count, flags, errorIndex, stream) + + +cdef CUresult _cuMemAddressReserve(CUdeviceptr* ptr, size_t size, size_t alignment, CUdeviceptr addr, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemAddressReserve + _check_or_init_driver() + if __cuMemAddressReserve == NULL: + with gil: + raise FunctionNotFoundError("function cuMemAddressReserve is not found") + return (__cuMemAddressReserve)( + ptr, size, alignment, addr, flags) + + +cdef CUresult _cuMemAddressFree(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemAddressFree + _check_or_init_driver() + if __cuMemAddressFree == NULL: + with gil: + raise FunctionNotFoundError("function cuMemAddressFree is not found") + return (__cuMemAddressFree)( + ptr, size) + + +cdef CUresult _cuMemCreate(CUmemGenericAllocationHandle* handle, size_t size, const CUmemAllocationProp* prop, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemCreate + _check_or_init_driver() + if __cuMemCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuMemCreate is not found") + return (__cuMemCreate)( + handle, size, prop, flags) + + +cdef CUresult _cuMemRelease(CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemRelease + _check_or_init_driver() + if __cuMemRelease == NULL: + with gil: + raise FunctionNotFoundError("function cuMemRelease is not found") + return (__cuMemRelease)( + handle) + + +cdef CUresult _cuMemMap(CUdeviceptr ptr, size_t size, size_t offset, CUmemGenericAllocationHandle handle, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemMap + _check_or_init_driver() + if __cuMemMap == NULL: + with gil: + raise FunctionNotFoundError("function cuMemMap is not found") + return (__cuMemMap)( + ptr, size, offset, handle, flags) + + +cdef CUresult _cuMemMapArrayAsync(CUarrayMapInfo* mapInfoList, unsigned int count, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemMapArrayAsync + _check_or_init_driver() + if __cuMemMapArrayAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemMapArrayAsync is not found") + return (__cuMemMapArrayAsync)( + mapInfoList, count, hStream) + + +cdef CUresult _cuMemUnmap(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemUnmap + _check_or_init_driver() + if __cuMemUnmap == NULL: + with gil: + raise FunctionNotFoundError("function cuMemUnmap is not found") + return (__cuMemUnmap)( + ptr, size) + + +cdef CUresult _cuMemSetAccess(CUdeviceptr ptr, size_t size, const CUmemAccessDesc* desc, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemSetAccess + _check_or_init_driver() + if __cuMemSetAccess == NULL: + with gil: + raise FunctionNotFoundError("function cuMemSetAccess is not found") + return (__cuMemSetAccess)( + ptr, size, desc, count) + + +cdef CUresult _cuMemGetAccess(unsigned long long* flags, const CUmemLocation* location, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemGetAccess + _check_or_init_driver() + if __cuMemGetAccess == NULL: + with gil: + raise FunctionNotFoundError("function cuMemGetAccess is not found") + return (__cuMemGetAccess)( + flags, location, ptr) + + +cdef CUresult _cuMemExportToShareableHandle(void* shareableHandle, CUmemGenericAllocationHandle handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemExportToShareableHandle + _check_or_init_driver() + if __cuMemExportToShareableHandle == NULL: + with gil: + raise FunctionNotFoundError("function cuMemExportToShareableHandle is not found") + return (__cuMemExportToShareableHandle)( + shareableHandle, handle, handleType, flags) + + +cdef CUresult _cuMemImportFromShareableHandle(CUmemGenericAllocationHandle* handle, void* osHandle, CUmemAllocationHandleType shHandleType) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemImportFromShareableHandle + _check_or_init_driver() + if __cuMemImportFromShareableHandle == NULL: + with gil: + raise FunctionNotFoundError("function cuMemImportFromShareableHandle is not found") + return (__cuMemImportFromShareableHandle)( + handle, osHandle, shHandleType) + + +cdef CUresult _cuMemGetAllocationGranularity(size_t* granularity, const CUmemAllocationProp* prop, CUmemAllocationGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemGetAllocationGranularity + _check_or_init_driver() + if __cuMemGetAllocationGranularity == NULL: + with gil: + raise FunctionNotFoundError("function cuMemGetAllocationGranularity is not found") + return (__cuMemGetAllocationGranularity)( + granularity, prop, option) + + +cdef CUresult _cuMemGetAllocationPropertiesFromHandle(CUmemAllocationProp* prop, CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemGetAllocationPropertiesFromHandle + _check_or_init_driver() + if __cuMemGetAllocationPropertiesFromHandle == NULL: + with gil: + raise FunctionNotFoundError("function cuMemGetAllocationPropertiesFromHandle is not found") + return (__cuMemGetAllocationPropertiesFromHandle)( + prop, handle) + + +cdef CUresult _cuMemRetainAllocationHandle(CUmemGenericAllocationHandle* handle, void* addr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemRetainAllocationHandle + _check_or_init_driver() + if __cuMemRetainAllocationHandle == NULL: + with gil: + raise FunctionNotFoundError("function cuMemRetainAllocationHandle is not found") + return (__cuMemRetainAllocationHandle)( + handle, addr) + + +cdef CUresult _cuMemFreeAsync(CUdeviceptr dptr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemFreeAsync + _check_or_init_driver() + if __cuMemFreeAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemFreeAsync is not found") + return (__cuMemFreeAsync)( + dptr, hStream) + + +cdef CUresult _cuMemAllocAsync(CUdeviceptr* dptr, size_t bytesize, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemAllocAsync + _check_or_init_driver() + if __cuMemAllocAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemAllocAsync is not found") + return (__cuMemAllocAsync)( + dptr, bytesize, hStream) + + +cdef CUresult _cuMemPoolTrimTo(CUmemoryPool pool, size_t minBytesToKeep) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPoolTrimTo + _check_or_init_driver() + if __cuMemPoolTrimTo == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPoolTrimTo is not found") + return (__cuMemPoolTrimTo)( + pool, minBytesToKeep) + + +cdef CUresult _cuMemPoolSetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPoolSetAttribute + _check_or_init_driver() + if __cuMemPoolSetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPoolSetAttribute is not found") + return (__cuMemPoolSetAttribute)( + pool, attr, value) + + +cdef CUresult _cuMemPoolGetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPoolGetAttribute + _check_or_init_driver() + if __cuMemPoolGetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPoolGetAttribute is not found") + return (__cuMemPoolGetAttribute)( + pool, attr, value) + + +cdef CUresult _cuMemPoolSetAccess(CUmemoryPool pool, const CUmemAccessDesc* map, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPoolSetAccess + _check_or_init_driver() + if __cuMemPoolSetAccess == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPoolSetAccess is not found") + return (__cuMemPoolSetAccess)( + pool, map, count) + + +cdef CUresult _cuMemPoolGetAccess(CUmemAccess_flags* flags, CUmemoryPool memPool, CUmemLocation* location) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPoolGetAccess + _check_or_init_driver() + if __cuMemPoolGetAccess == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPoolGetAccess is not found") + return (__cuMemPoolGetAccess)( + flags, memPool, location) + + +cdef CUresult _cuMemPoolCreate(CUmemoryPool* pool, const CUmemPoolProps* poolProps) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPoolCreate + _check_or_init_driver() + if __cuMemPoolCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPoolCreate is not found") + return (__cuMemPoolCreate)( + pool, poolProps) + + +cdef CUresult _cuMemPoolDestroy(CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPoolDestroy + _check_or_init_driver() + if __cuMemPoolDestroy == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPoolDestroy is not found") + return (__cuMemPoolDestroy)( + pool) + + +cdef CUresult _cuMemAllocFromPoolAsync(CUdeviceptr* dptr, size_t bytesize, CUmemoryPool pool, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemAllocFromPoolAsync + _check_or_init_driver() + if __cuMemAllocFromPoolAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemAllocFromPoolAsync is not found") + return (__cuMemAllocFromPoolAsync)( + dptr, bytesize, pool, hStream) + + +cdef CUresult _cuMemPoolExportToShareableHandle(void* handle_out, CUmemoryPool pool, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPoolExportToShareableHandle + _check_or_init_driver() + if __cuMemPoolExportToShareableHandle == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPoolExportToShareableHandle is not found") + return (__cuMemPoolExportToShareableHandle)( + handle_out, pool, handleType, flags) + + +cdef CUresult _cuMemPoolImportFromShareableHandle(CUmemoryPool* pool_out, void* handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPoolImportFromShareableHandle + _check_or_init_driver() + if __cuMemPoolImportFromShareableHandle == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPoolImportFromShareableHandle is not found") + return (__cuMemPoolImportFromShareableHandle)( + pool_out, handle, handleType, flags) + + +cdef CUresult _cuMemPoolExportPointer(CUmemPoolPtrExportData* shareData_out, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPoolExportPointer + _check_or_init_driver() + if __cuMemPoolExportPointer == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPoolExportPointer is not found") + return (__cuMemPoolExportPointer)( + shareData_out, ptr) + + +cdef CUresult _cuMemPoolImportPointer(CUdeviceptr* ptr_out, CUmemoryPool pool, CUmemPoolPtrExportData* shareData) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPoolImportPointer + _check_or_init_driver() + if __cuMemPoolImportPointer == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPoolImportPointer is not found") + return (__cuMemPoolImportPointer)( + ptr_out, pool, shareData) + + +cdef CUresult _cuMulticastCreate(CUmemGenericAllocationHandle* mcHandle, const CUmulticastObjectProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMulticastCreate + _check_or_init_driver() + if __cuMulticastCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuMulticastCreate is not found") + return (__cuMulticastCreate)( + mcHandle, prop) + + +cdef CUresult _cuMulticastAddDevice(CUmemGenericAllocationHandle mcHandle, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMulticastAddDevice + _check_or_init_driver() + if __cuMulticastAddDevice == NULL: + with gil: + raise FunctionNotFoundError("function cuMulticastAddDevice is not found") + return (__cuMulticastAddDevice)( + mcHandle, dev) + + +cdef CUresult _cuMulticastBindMem(CUmemGenericAllocationHandle mcHandle, size_t mcOffset, CUmemGenericAllocationHandle memHandle, size_t memOffset, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMulticastBindMem + _check_or_init_driver() + if __cuMulticastBindMem == NULL: + with gil: + raise FunctionNotFoundError("function cuMulticastBindMem is not found") + return (__cuMulticastBindMem)( + mcHandle, mcOffset, memHandle, memOffset, size, flags) + + +cdef CUresult _cuMulticastBindAddr(CUmemGenericAllocationHandle mcHandle, size_t mcOffset, CUdeviceptr memptr, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMulticastBindAddr + _check_or_init_driver() + if __cuMulticastBindAddr == NULL: + with gil: + raise FunctionNotFoundError("function cuMulticastBindAddr is not found") + return (__cuMulticastBindAddr)( + mcHandle, mcOffset, memptr, size, flags) + + +cdef CUresult _cuMulticastUnbind(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMulticastUnbind + _check_or_init_driver() + if __cuMulticastUnbind == NULL: + with gil: + raise FunctionNotFoundError("function cuMulticastUnbind is not found") + return (__cuMulticastUnbind)( + mcHandle, dev, mcOffset, size) + + +cdef CUresult _cuMulticastGetGranularity(size_t* granularity, const CUmulticastObjectProp* prop, CUmulticastGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMulticastGetGranularity + _check_or_init_driver() + if __cuMulticastGetGranularity == NULL: + with gil: + raise FunctionNotFoundError("function cuMulticastGetGranularity is not found") + return (__cuMulticastGetGranularity)( + granularity, prop, option) + + +cdef CUresult _cuPointerGetAttribute(void* data, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuPointerGetAttribute + _check_or_init_driver() + if __cuPointerGetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuPointerGetAttribute is not found") + return (__cuPointerGetAttribute)( + data, attribute, ptr) + + +cdef CUresult _cuMemPrefetchAsync_v2(CUdeviceptr devPtr, size_t count, CUmemLocation location, unsigned int flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPrefetchAsync_v2 + _check_or_init_driver() + if __cuMemPrefetchAsync_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPrefetchAsync_v2 is not found") + return (__cuMemPrefetchAsync_v2)( + devPtr, count, location, flags, hStream) + + +cdef CUresult _cuMemAdvise_v2(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUmemLocation location) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemAdvise_v2 + _check_or_init_driver() + if __cuMemAdvise_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemAdvise_v2 is not found") + return (__cuMemAdvise_v2)( + devPtr, count, advice, location) + + +cdef CUresult _cuMemRangeGetAttribute(void* data, size_t dataSize, CUmem_range_attribute attribute, CUdeviceptr devPtr, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemRangeGetAttribute + _check_or_init_driver() + if __cuMemRangeGetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuMemRangeGetAttribute is not found") + return (__cuMemRangeGetAttribute)( + data, dataSize, attribute, devPtr, count) + + +cdef CUresult _cuMemRangeGetAttributes(void** data, size_t* dataSizes, CUmem_range_attribute* attributes, size_t numAttributes, CUdeviceptr devPtr, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemRangeGetAttributes + _check_or_init_driver() + if __cuMemRangeGetAttributes == NULL: + with gil: + raise FunctionNotFoundError("function cuMemRangeGetAttributes is not found") + return (__cuMemRangeGetAttributes)( + data, dataSizes, attributes, numAttributes, devPtr, count) + + +cdef CUresult _cuPointerSetAttribute(const void* value, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuPointerSetAttribute + _check_or_init_driver() + if __cuPointerSetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuPointerSetAttribute is not found") + return (__cuPointerSetAttribute)( + value, attribute, ptr) + + +cdef CUresult _cuPointerGetAttributes(unsigned int numAttributes, CUpointer_attribute* attributes, void** data, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuPointerGetAttributes + _check_or_init_driver() + if __cuPointerGetAttributes == NULL: + with gil: + raise FunctionNotFoundError("function cuPointerGetAttributes is not found") + return (__cuPointerGetAttributes)( + numAttributes, attributes, data, ptr) + + +cdef CUresult _cuStreamCreate(CUstream* phStream, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamCreate + _check_or_init_driver() + if __cuStreamCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamCreate is not found") + return (__cuStreamCreate)( + phStream, Flags) + + +cdef CUresult _cuStreamCreateWithPriority(CUstream* phStream, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamCreateWithPriority + _check_or_init_driver() + if __cuStreamCreateWithPriority == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamCreateWithPriority is not found") + return (__cuStreamCreateWithPriority)( + phStream, flags, priority) + + +cdef CUresult _cuStreamGetPriority(CUstream hStream, int* priority) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamGetPriority + _check_or_init_driver() + if __cuStreamGetPriority == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamGetPriority is not found") + return (__cuStreamGetPriority)( + hStream, priority) + + +cdef CUresult _cuStreamGetDevice(CUstream hStream, CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamGetDevice + _check_or_init_driver() + if __cuStreamGetDevice == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamGetDevice is not found") + return (__cuStreamGetDevice)( + hStream, device) + + +cdef CUresult _cuStreamGetFlags(CUstream hStream, unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamGetFlags + _check_or_init_driver() + if __cuStreamGetFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamGetFlags is not found") + return (__cuStreamGetFlags)( + hStream, flags) + + +cdef CUresult _cuStreamGetId(CUstream hStream, unsigned long long* streamId) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamGetId + _check_or_init_driver() + if __cuStreamGetId == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamGetId is not found") + return (__cuStreamGetId)( + hStream, streamId) + + +cdef CUresult _cuStreamGetCtx(CUstream hStream, CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamGetCtx + _check_or_init_driver() + if __cuStreamGetCtx == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamGetCtx is not found") + return (__cuStreamGetCtx)( + hStream, pctx) + + +cdef CUresult _cuStreamGetCtx_v2(CUstream hStream, CUcontext* pCtx, CUgreenCtx* pGreenCtx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamGetCtx_v2 + _check_or_init_driver() + if __cuStreamGetCtx_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamGetCtx_v2 is not found") + return (__cuStreamGetCtx_v2)( + hStream, pCtx, pGreenCtx) + + +cdef CUresult _cuStreamWaitEvent(CUstream hStream, CUevent hEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamWaitEvent + _check_or_init_driver() + if __cuStreamWaitEvent == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamWaitEvent is not found") + return (__cuStreamWaitEvent)( + hStream, hEvent, Flags) + + +cdef CUresult _cuStreamAddCallback(CUstream hStream, CUstreamCallback callback, void* userData, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamAddCallback + _check_or_init_driver() + if __cuStreamAddCallback == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamAddCallback is not found") + return (__cuStreamAddCallback)( + hStream, callback, userData, flags) + + +cdef CUresult _cuStreamBeginCapture_v2(CUstream hStream, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamBeginCapture_v2 + _check_or_init_driver() + if __cuStreamBeginCapture_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamBeginCapture_v2 is not found") + return (__cuStreamBeginCapture_v2)( + hStream, mode) + + +cdef CUresult _cuStreamBeginCaptureToGraph(CUstream hStream, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamBeginCaptureToGraph + _check_or_init_driver() + if __cuStreamBeginCaptureToGraph == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamBeginCaptureToGraph is not found") + return (__cuStreamBeginCaptureToGraph)( + hStream, hGraph, dependencies, dependencyData, numDependencies, mode) + + +cdef CUresult _cuThreadExchangeStreamCaptureMode(CUstreamCaptureMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuThreadExchangeStreamCaptureMode + _check_or_init_driver() + if __cuThreadExchangeStreamCaptureMode == NULL: + with gil: + raise FunctionNotFoundError("function cuThreadExchangeStreamCaptureMode is not found") + return (__cuThreadExchangeStreamCaptureMode)( + mode) + + +cdef CUresult _cuStreamEndCapture(CUstream hStream, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamEndCapture + _check_or_init_driver() + if __cuStreamEndCapture == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamEndCapture is not found") + return (__cuStreamEndCapture)( + hStream, phGraph) + + +cdef CUresult _cuStreamIsCapturing(CUstream hStream, CUstreamCaptureStatus* captureStatus) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamIsCapturing + _check_or_init_driver() + if __cuStreamIsCapturing == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamIsCapturing is not found") + return (__cuStreamIsCapturing)( + hStream, captureStatus) + + +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 + _check_or_init_driver() + if __cuStreamGetCaptureInfo_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamGetCaptureInfo_v2 is not found") + return (__cuStreamGetCaptureInfo_v2)( + hStream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out) + + +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: + global __cuStreamGetCaptureInfo_v3 + _check_or_init_driver() + if __cuStreamGetCaptureInfo_v3 == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamGetCaptureInfo_v3 is not found") + return (__cuStreamGetCaptureInfo_v3)( + hStream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out) + + +cdef CUresult _cuStreamUpdateCaptureDependencies_v2(CUstream hStream, CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamUpdateCaptureDependencies_v2 + _check_or_init_driver() + if __cuStreamUpdateCaptureDependencies_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamUpdateCaptureDependencies_v2 is not found") + return (__cuStreamUpdateCaptureDependencies_v2)( + hStream, dependencies, dependencyData, numDependencies, flags) + + +cdef CUresult _cuStreamAttachMemAsync(CUstream hStream, CUdeviceptr dptr, size_t length, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamAttachMemAsync + _check_or_init_driver() + if __cuStreamAttachMemAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamAttachMemAsync is not found") + return (__cuStreamAttachMemAsync)( + hStream, dptr, length, flags) + + +cdef CUresult _cuStreamQuery(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamQuery + _check_or_init_driver() + if __cuStreamQuery == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamQuery is not found") + return (__cuStreamQuery)( + hStream) + + +cdef CUresult _cuStreamSynchronize(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamSynchronize + _check_or_init_driver() + if __cuStreamSynchronize == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamSynchronize is not found") + return (__cuStreamSynchronize)( + hStream) + + +cdef CUresult _cuStreamDestroy_v2(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamDestroy_v2 + _check_or_init_driver() + if __cuStreamDestroy_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamDestroy_v2 is not found") + return (__cuStreamDestroy_v2)( + hStream) + + +cdef CUresult _cuStreamCopyAttributes(CUstream dst, CUstream src) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamCopyAttributes + _check_or_init_driver() + if __cuStreamCopyAttributes == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamCopyAttributes is not found") + return (__cuStreamCopyAttributes)( + dst, src) + + +cdef CUresult _cuStreamGetAttribute(CUstream hStream, CUstreamAttrID attr, CUstreamAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamGetAttribute + _check_or_init_driver() + if __cuStreamGetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamGetAttribute is not found") + return (__cuStreamGetAttribute)( + hStream, attr, value_out) + + +cdef CUresult _cuStreamSetAttribute(CUstream hStream, CUstreamAttrID attr, const CUstreamAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamSetAttribute + _check_or_init_driver() + if __cuStreamSetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamSetAttribute is not found") + return (__cuStreamSetAttribute)( + hStream, attr, value) + + +cdef CUresult _cuEventCreate(CUevent* phEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEventCreate + _check_or_init_driver() + if __cuEventCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuEventCreate is not found") + return (__cuEventCreate)( + phEvent, Flags) + + +cdef CUresult _cuEventRecord(CUevent hEvent, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEventRecord + _check_or_init_driver() + if __cuEventRecord == NULL: + with gil: + raise FunctionNotFoundError("function cuEventRecord is not found") + return (__cuEventRecord)( + hEvent, hStream) + + +cdef CUresult _cuEventRecordWithFlags(CUevent hEvent, CUstream hStream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEventRecordWithFlags + _check_or_init_driver() + if __cuEventRecordWithFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuEventRecordWithFlags is not found") + return (__cuEventRecordWithFlags)( + hEvent, hStream, flags) + + +cdef CUresult _cuEventQuery(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEventQuery + _check_or_init_driver() + if __cuEventQuery == NULL: + with gil: + raise FunctionNotFoundError("function cuEventQuery is not found") + return (__cuEventQuery)( + hEvent) + + +cdef CUresult _cuEventSynchronize(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEventSynchronize + _check_or_init_driver() + if __cuEventSynchronize == NULL: + with gil: + raise FunctionNotFoundError("function cuEventSynchronize is not found") + return (__cuEventSynchronize)( + hEvent) + + +cdef CUresult _cuEventDestroy_v2(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEventDestroy_v2 + _check_or_init_driver() + if __cuEventDestroy_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuEventDestroy_v2 is not found") + return (__cuEventDestroy_v2)( + hEvent) + + +cdef CUresult _cuEventElapsedTime_v2(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEventElapsedTime_v2 + _check_or_init_driver() + if __cuEventElapsedTime_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuEventElapsedTime_v2 is not found") + return (__cuEventElapsedTime_v2)( + pMilliseconds, hStart, hEnd) + + +cdef CUresult _cuImportExternalMemory(CUexternalMemory* extMem_out, const CUDA_EXTERNAL_MEMORY_HANDLE_DESC* memHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuImportExternalMemory + _check_or_init_driver() + if __cuImportExternalMemory == NULL: + with gil: + raise FunctionNotFoundError("function cuImportExternalMemory is not found") + return (__cuImportExternalMemory)( + extMem_out, memHandleDesc) + + +cdef CUresult _cuExternalMemoryGetMappedBuffer(CUdeviceptr* devPtr, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_BUFFER_DESC* bufferDesc) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuExternalMemoryGetMappedBuffer + _check_or_init_driver() + if __cuExternalMemoryGetMappedBuffer == NULL: + with gil: + raise FunctionNotFoundError("function cuExternalMemoryGetMappedBuffer is not found") + return (__cuExternalMemoryGetMappedBuffer)( + devPtr, extMem, bufferDesc) + + +cdef CUresult _cuExternalMemoryGetMappedMipmappedArray(CUmipmappedArray* mipmap, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC* mipmapDesc) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuExternalMemoryGetMappedMipmappedArray + _check_or_init_driver() + if __cuExternalMemoryGetMappedMipmappedArray == NULL: + with gil: + raise FunctionNotFoundError("function cuExternalMemoryGetMappedMipmappedArray is not found") + return (__cuExternalMemoryGetMappedMipmappedArray)( + mipmap, extMem, mipmapDesc) + + +cdef CUresult _cuDestroyExternalMemory(CUexternalMemory extMem) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDestroyExternalMemory + _check_or_init_driver() + if __cuDestroyExternalMemory == NULL: + with gil: + raise FunctionNotFoundError("function cuDestroyExternalMemory is not found") + return (__cuDestroyExternalMemory)( + extMem) + + +cdef CUresult _cuImportExternalSemaphore(CUexternalSemaphore* extSem_out, const CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC* semHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuImportExternalSemaphore + _check_or_init_driver() + if __cuImportExternalSemaphore == NULL: + with gil: + raise FunctionNotFoundError("function cuImportExternalSemaphore is not found") + return (__cuImportExternalSemaphore)( + extSem_out, semHandleDesc) + + +cdef CUresult _cuSignalExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuSignalExternalSemaphoresAsync + _check_or_init_driver() + if __cuSignalExternalSemaphoresAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuSignalExternalSemaphoresAsync is not found") + return (__cuSignalExternalSemaphoresAsync)( + extSemArray, paramsArray, numExtSems, stream) + + +cdef CUresult _cuWaitExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuWaitExternalSemaphoresAsync + _check_or_init_driver() + if __cuWaitExternalSemaphoresAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuWaitExternalSemaphoresAsync is not found") + return (__cuWaitExternalSemaphoresAsync)( + extSemArray, paramsArray, numExtSems, stream) + + +cdef CUresult _cuDestroyExternalSemaphore(CUexternalSemaphore extSem) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDestroyExternalSemaphore + _check_or_init_driver() + if __cuDestroyExternalSemaphore == NULL: + with gil: + raise FunctionNotFoundError("function cuDestroyExternalSemaphore is not found") + return (__cuDestroyExternalSemaphore)( + extSem) + + +cdef CUresult _cuStreamWaitValue32_v2(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamWaitValue32_v2 + _check_or_init_driver() + if __cuStreamWaitValue32_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamWaitValue32_v2 is not found") + return (__cuStreamWaitValue32_v2)( + stream, addr, value, flags) + + +cdef CUresult _cuStreamWaitValue64_v2(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamWaitValue64_v2 + _check_or_init_driver() + if __cuStreamWaitValue64_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamWaitValue64_v2 is not found") + return (__cuStreamWaitValue64_v2)( + stream, addr, value, flags) + + +cdef CUresult _cuStreamWriteValue32_v2(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamWriteValue32_v2 + _check_or_init_driver() + if __cuStreamWriteValue32_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamWriteValue32_v2 is not found") + return (__cuStreamWriteValue32_v2)( + stream, addr, value, flags) + + +cdef CUresult _cuStreamWriteValue64_v2(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamWriteValue64_v2 + _check_or_init_driver() + if __cuStreamWriteValue64_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamWriteValue64_v2 is not found") + return (__cuStreamWriteValue64_v2)( + stream, addr, value, flags) + + +cdef CUresult _cuStreamBatchMemOp_v2(CUstream stream, unsigned int count, CUstreamBatchMemOpParams* paramArray, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamBatchMemOp_v2 + _check_or_init_driver() + if __cuStreamBatchMemOp_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamBatchMemOp_v2 is not found") + return (__cuStreamBatchMemOp_v2)( + stream, count, paramArray, flags) + + +cdef CUresult _cuFuncGetAttribute(int* pi, CUfunction_attribute attrib, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFuncGetAttribute + _check_or_init_driver() + if __cuFuncGetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuFuncGetAttribute is not found") + return (__cuFuncGetAttribute)( + pi, attrib, hfunc) + + +cdef CUresult _cuFuncSetAttribute(CUfunction hfunc, CUfunction_attribute attrib, int value) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFuncSetAttribute + _check_or_init_driver() + if __cuFuncSetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuFuncSetAttribute is not found") + return (__cuFuncSetAttribute)( + hfunc, attrib, value) + + +cdef CUresult _cuFuncSetCacheConfig(CUfunction hfunc, CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFuncSetCacheConfig + _check_or_init_driver() + if __cuFuncSetCacheConfig == NULL: + with gil: + raise FunctionNotFoundError("function cuFuncSetCacheConfig is not found") + return (__cuFuncSetCacheConfig)( + hfunc, config) + + +cdef CUresult _cuFuncGetModule(CUmodule* hmod, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFuncGetModule + _check_or_init_driver() + if __cuFuncGetModule == NULL: + with gil: + raise FunctionNotFoundError("function cuFuncGetModule is not found") + return (__cuFuncGetModule)( + hmod, hfunc) + + +cdef CUresult _cuFuncGetName(const char** name, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFuncGetName + _check_or_init_driver() + if __cuFuncGetName == NULL: + with gil: + raise FunctionNotFoundError("function cuFuncGetName is not found") + return (__cuFuncGetName)( + name, hfunc) + + +cdef CUresult _cuFuncGetParamInfo(CUfunction func, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFuncGetParamInfo + _check_or_init_driver() + if __cuFuncGetParamInfo == NULL: + with gil: + raise FunctionNotFoundError("function cuFuncGetParamInfo is not found") + return (__cuFuncGetParamInfo)( + func, paramIndex, paramOffset, paramSize) + + +cdef CUresult _cuFuncIsLoaded(CUfunctionLoadingState* state, CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFuncIsLoaded + _check_or_init_driver() + if __cuFuncIsLoaded == NULL: + with gil: + raise FunctionNotFoundError("function cuFuncIsLoaded is not found") + return (__cuFuncIsLoaded)( + state, function) + + +cdef CUresult _cuFuncLoad(CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFuncLoad + _check_or_init_driver() + if __cuFuncLoad == NULL: + with gil: + raise FunctionNotFoundError("function cuFuncLoad is not found") + return (__cuFuncLoad)( + function) + + +cdef CUresult _cuLaunchKernel(CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, CUstream hStream, void** kernelParams, void** extra) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLaunchKernel + _check_or_init_driver() + if __cuLaunchKernel == NULL: + with gil: + raise FunctionNotFoundError("function cuLaunchKernel is not found") + return (__cuLaunchKernel)( + f, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, hStream, kernelParams, extra) + + +cdef CUresult _cuLaunchKernelEx(const CUlaunchConfig* config, CUfunction f, void** kernelParams, void** extra) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLaunchKernelEx + _check_or_init_driver() + if __cuLaunchKernelEx == NULL: + with gil: + raise FunctionNotFoundError("function cuLaunchKernelEx is not found") + return (__cuLaunchKernelEx)( + config, f, kernelParams, extra) + + +cdef CUresult _cuLaunchCooperativeKernel(CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, CUstream hStream, void** kernelParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLaunchCooperativeKernel + _check_or_init_driver() + if __cuLaunchCooperativeKernel == NULL: + with gil: + raise FunctionNotFoundError("function cuLaunchCooperativeKernel is not found") + return (__cuLaunchCooperativeKernel)( + f, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, hStream, kernelParams) + + +cdef CUresult _cuLaunchCooperativeKernelMultiDevice(CUDA_LAUNCH_PARAMS* launchParamsList, unsigned int numDevices, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLaunchCooperativeKernelMultiDevice + _check_or_init_driver() + if __cuLaunchCooperativeKernelMultiDevice == NULL: + with gil: + raise FunctionNotFoundError("function cuLaunchCooperativeKernelMultiDevice is not found") + return (__cuLaunchCooperativeKernelMultiDevice)( + launchParamsList, numDevices, flags) + + +cdef CUresult _cuLaunchHostFunc(CUstream hStream, CUhostFn fn, void* userData) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLaunchHostFunc + _check_or_init_driver() + if __cuLaunchHostFunc == NULL: + with gil: + raise FunctionNotFoundError("function cuLaunchHostFunc is not found") + return (__cuLaunchHostFunc)( + hStream, fn, userData) + + +cdef CUresult _cuFuncSetBlockShape(CUfunction hfunc, int x, int y, int z) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFuncSetBlockShape + _check_or_init_driver() + if __cuFuncSetBlockShape == NULL: + with gil: + raise FunctionNotFoundError("function cuFuncSetBlockShape is not found") + return (__cuFuncSetBlockShape)( + hfunc, x, y, z) + + +cdef CUresult _cuFuncSetSharedSize(CUfunction hfunc, unsigned int bytes) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFuncSetSharedSize + _check_or_init_driver() + if __cuFuncSetSharedSize == NULL: + with gil: + raise FunctionNotFoundError("function cuFuncSetSharedSize is not found") + return (__cuFuncSetSharedSize)( + hfunc, bytes) + + +cdef CUresult _cuParamSetSize(CUfunction hfunc, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuParamSetSize + _check_or_init_driver() + if __cuParamSetSize == NULL: + with gil: + raise FunctionNotFoundError("function cuParamSetSize is not found") + return (__cuParamSetSize)( + hfunc, numbytes) + + +cdef CUresult _cuParamSeti(CUfunction hfunc, int offset, unsigned int value) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuParamSeti + _check_or_init_driver() + if __cuParamSeti == NULL: + with gil: + raise FunctionNotFoundError("function cuParamSeti is not found") + return (__cuParamSeti)( + hfunc, offset, value) + + +cdef CUresult _cuParamSetf(CUfunction hfunc, int offset, float value) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuParamSetf + _check_or_init_driver() + if __cuParamSetf == NULL: + with gil: + raise FunctionNotFoundError("function cuParamSetf is not found") + return (__cuParamSetf)( + hfunc, offset, value) + + +cdef CUresult _cuParamSetv(CUfunction hfunc, int offset, void* ptr, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuParamSetv + _check_or_init_driver() + if __cuParamSetv == NULL: + with gil: + raise FunctionNotFoundError("function cuParamSetv is not found") + return (__cuParamSetv)( + hfunc, offset, ptr, numbytes) + + +cdef CUresult _cuLaunch(CUfunction f) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLaunch + _check_or_init_driver() + if __cuLaunch == NULL: + with gil: + raise FunctionNotFoundError("function cuLaunch is not found") + return (__cuLaunch)( + f) + + +cdef CUresult _cuLaunchGrid(CUfunction f, int grid_width, int grid_height) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLaunchGrid + _check_or_init_driver() + if __cuLaunchGrid == NULL: + with gil: + raise FunctionNotFoundError("function cuLaunchGrid is not found") + return (__cuLaunchGrid)( + f, grid_width, grid_height) + + +cdef CUresult _cuLaunchGridAsync(CUfunction f, int grid_width, int grid_height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLaunchGridAsync + _check_or_init_driver() + if __cuLaunchGridAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuLaunchGridAsync is not found") + return (__cuLaunchGridAsync)( + f, grid_width, grid_height, hStream) + + +cdef CUresult _cuParamSetTexRef(CUfunction hfunc, int texunit, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuParamSetTexRef + _check_or_init_driver() + if __cuParamSetTexRef == NULL: + with gil: + raise FunctionNotFoundError("function cuParamSetTexRef is not found") + return (__cuParamSetTexRef)( + hfunc, texunit, hTexRef) + + +cdef CUresult _cuFuncSetSharedMemConfig(CUfunction hfunc, CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFuncSetSharedMemConfig + _check_or_init_driver() + if __cuFuncSetSharedMemConfig == NULL: + with gil: + raise FunctionNotFoundError("function cuFuncSetSharedMemConfig is not found") + return (__cuFuncSetSharedMemConfig)( + hfunc, config) + + +cdef CUresult _cuGraphCreate(CUgraph* phGraph, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphCreate + _check_or_init_driver() + if __cuGraphCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphCreate is not found") + return (__cuGraphCreate)( + phGraph, flags) + + +cdef CUresult _cuGraphAddKernelNode_v2(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddKernelNode_v2 + _check_or_init_driver() + if __cuGraphAddKernelNode_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddKernelNode_v2 is not found") + return (__cuGraphAddKernelNode_v2)( + phGraphNode, hGraph, dependencies, numDependencies, nodeParams) + + +cdef CUresult _cuGraphKernelNodeGetParams_v2(CUgraphNode hNode, CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphKernelNodeGetParams_v2 + _check_or_init_driver() + if __cuGraphKernelNodeGetParams_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphKernelNodeGetParams_v2 is not found") + return (__cuGraphKernelNodeGetParams_v2)( + hNode, nodeParams) + + +cdef CUresult _cuGraphKernelNodeSetParams_v2(CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphKernelNodeSetParams_v2 + _check_or_init_driver() + if __cuGraphKernelNodeSetParams_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphKernelNodeSetParams_v2 is not found") + return (__cuGraphKernelNodeSetParams_v2)( + hNode, nodeParams) + + +cdef CUresult _cuGraphAddMemcpyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_MEMCPY3D* copyParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddMemcpyNode + _check_or_init_driver() + if __cuGraphAddMemcpyNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddMemcpyNode is not found") + return (__cuGraphAddMemcpyNode)( + phGraphNode, hGraph, dependencies, numDependencies, copyParams, ctx) + + +cdef CUresult _cuGraphMemcpyNodeGetParams(CUgraphNode hNode, CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphMemcpyNodeGetParams + _check_or_init_driver() + if __cuGraphMemcpyNodeGetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphMemcpyNodeGetParams is not found") + return (__cuGraphMemcpyNodeGetParams)( + hNode, nodeParams) + + +cdef CUresult _cuGraphMemcpyNodeSetParams(CUgraphNode hNode, const CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphMemcpyNodeSetParams + _check_or_init_driver() + if __cuGraphMemcpyNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphMemcpyNodeSetParams is not found") + return (__cuGraphMemcpyNodeSetParams)( + hNode, nodeParams) + + +cdef CUresult _cuGraphAddMemsetNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_MEMSET_NODE_PARAMS* memsetParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddMemsetNode + _check_or_init_driver() + if __cuGraphAddMemsetNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddMemsetNode is not found") + return (__cuGraphAddMemsetNode)( + phGraphNode, hGraph, dependencies, numDependencies, memsetParams, ctx) + + +cdef CUresult _cuGraphMemsetNodeGetParams(CUgraphNode hNode, CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphMemsetNodeGetParams + _check_or_init_driver() + if __cuGraphMemsetNodeGetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphMemsetNodeGetParams is not found") + return (__cuGraphMemsetNodeGetParams)( + hNode, nodeParams) + + +cdef CUresult _cuGraphMemsetNodeSetParams(CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphMemsetNodeSetParams + _check_or_init_driver() + if __cuGraphMemsetNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphMemsetNodeSetParams is not found") + return (__cuGraphMemsetNodeSetParams)( + hNode, nodeParams) + + +cdef CUresult _cuGraphAddHostNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddHostNode + _check_or_init_driver() + if __cuGraphAddHostNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddHostNode is not found") + return (__cuGraphAddHostNode)( + phGraphNode, hGraph, dependencies, numDependencies, nodeParams) + + +cdef CUresult _cuGraphHostNodeGetParams(CUgraphNode hNode, CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphHostNodeGetParams + _check_or_init_driver() + if __cuGraphHostNodeGetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphHostNodeGetParams is not found") + return (__cuGraphHostNodeGetParams)( + hNode, nodeParams) + + +cdef CUresult _cuGraphHostNodeSetParams(CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphHostNodeSetParams + _check_or_init_driver() + if __cuGraphHostNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphHostNodeSetParams is not found") + return (__cuGraphHostNodeSetParams)( + hNode, nodeParams) + + +cdef CUresult _cuGraphAddChildGraphNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddChildGraphNode + _check_or_init_driver() + if __cuGraphAddChildGraphNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddChildGraphNode is not found") + return (__cuGraphAddChildGraphNode)( + phGraphNode, hGraph, dependencies, numDependencies, childGraph) + + +cdef CUresult _cuGraphChildGraphNodeGetGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphChildGraphNodeGetGraph + _check_or_init_driver() + if __cuGraphChildGraphNodeGetGraph == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphChildGraphNodeGetGraph is not found") + return (__cuGraphChildGraphNodeGetGraph)( + hNode, phGraph) + + +cdef CUresult _cuGraphAddEmptyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddEmptyNode + _check_or_init_driver() + if __cuGraphAddEmptyNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddEmptyNode is not found") + return (__cuGraphAddEmptyNode)( + phGraphNode, hGraph, dependencies, numDependencies) + + +cdef CUresult _cuGraphAddEventRecordNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddEventRecordNode + _check_or_init_driver() + if __cuGraphAddEventRecordNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddEventRecordNode is not found") + return (__cuGraphAddEventRecordNode)( + phGraphNode, hGraph, dependencies, numDependencies, event) + + +cdef CUresult _cuGraphEventRecordNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphEventRecordNodeGetEvent + _check_or_init_driver() + if __cuGraphEventRecordNodeGetEvent == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphEventRecordNodeGetEvent is not found") + return (__cuGraphEventRecordNodeGetEvent)( + hNode, event_out) + + +cdef CUresult _cuGraphEventRecordNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphEventRecordNodeSetEvent + _check_or_init_driver() + if __cuGraphEventRecordNodeSetEvent == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphEventRecordNodeSetEvent is not found") + return (__cuGraphEventRecordNodeSetEvent)( + hNode, event) + + +cdef CUresult _cuGraphAddEventWaitNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddEventWaitNode + _check_or_init_driver() + if __cuGraphAddEventWaitNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddEventWaitNode is not found") + return (__cuGraphAddEventWaitNode)( + phGraphNode, hGraph, dependencies, numDependencies, event) + + +cdef CUresult _cuGraphEventWaitNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphEventWaitNodeGetEvent + _check_or_init_driver() + if __cuGraphEventWaitNodeGetEvent == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphEventWaitNodeGetEvent is not found") + return (__cuGraphEventWaitNodeGetEvent)( + hNode, event_out) + + +cdef CUresult _cuGraphEventWaitNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphEventWaitNodeSetEvent + _check_or_init_driver() + if __cuGraphEventWaitNodeSetEvent == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphEventWaitNodeSetEvent is not found") + return (__cuGraphEventWaitNodeSetEvent)( + hNode, event) + + +cdef CUresult _cuGraphAddExternalSemaphoresSignalNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddExternalSemaphoresSignalNode + _check_or_init_driver() + if __cuGraphAddExternalSemaphoresSignalNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddExternalSemaphoresSignalNode is not found") + return (__cuGraphAddExternalSemaphoresSignalNode)( + phGraphNode, hGraph, dependencies, numDependencies, nodeParams) + + +cdef CUresult _cuGraphExternalSemaphoresSignalNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExternalSemaphoresSignalNodeGetParams + _check_or_init_driver() + if __cuGraphExternalSemaphoresSignalNodeGetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExternalSemaphoresSignalNodeGetParams is not found") + return (__cuGraphExternalSemaphoresSignalNodeGetParams)( + hNode, params_out) + + +cdef CUresult _cuGraphExternalSemaphoresSignalNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExternalSemaphoresSignalNodeSetParams + _check_or_init_driver() + if __cuGraphExternalSemaphoresSignalNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExternalSemaphoresSignalNodeSetParams is not found") + return (__cuGraphExternalSemaphoresSignalNodeSetParams)( + hNode, nodeParams) + + +cdef CUresult _cuGraphAddExternalSemaphoresWaitNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddExternalSemaphoresWaitNode + _check_or_init_driver() + if __cuGraphAddExternalSemaphoresWaitNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddExternalSemaphoresWaitNode is not found") + return (__cuGraphAddExternalSemaphoresWaitNode)( + phGraphNode, hGraph, dependencies, numDependencies, nodeParams) + + +cdef CUresult _cuGraphExternalSemaphoresWaitNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_WAIT_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExternalSemaphoresWaitNodeGetParams + _check_or_init_driver() + if __cuGraphExternalSemaphoresWaitNodeGetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExternalSemaphoresWaitNodeGetParams is not found") + return (__cuGraphExternalSemaphoresWaitNodeGetParams)( + hNode, params_out) + + +cdef CUresult _cuGraphExternalSemaphoresWaitNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExternalSemaphoresWaitNodeSetParams + _check_or_init_driver() + if __cuGraphExternalSemaphoresWaitNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExternalSemaphoresWaitNodeSetParams is not found") + return (__cuGraphExternalSemaphoresWaitNodeSetParams)( + hNode, nodeParams) + + +cdef CUresult _cuGraphAddBatchMemOpNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddBatchMemOpNode + _check_or_init_driver() + if __cuGraphAddBatchMemOpNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddBatchMemOpNode is not found") + return (__cuGraphAddBatchMemOpNode)( + phGraphNode, hGraph, dependencies, numDependencies, nodeParams) + + +cdef CUresult _cuGraphBatchMemOpNodeGetParams(CUgraphNode hNode, CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams_out) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphBatchMemOpNodeGetParams + _check_or_init_driver() + if __cuGraphBatchMemOpNodeGetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphBatchMemOpNodeGetParams is not found") + return (__cuGraphBatchMemOpNodeGetParams)( + hNode, nodeParams_out) + + +cdef CUresult _cuGraphBatchMemOpNodeSetParams(CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphBatchMemOpNodeSetParams + _check_or_init_driver() + if __cuGraphBatchMemOpNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphBatchMemOpNodeSetParams is not found") + return (__cuGraphBatchMemOpNodeSetParams)( + hNode, nodeParams) + + +cdef CUresult _cuGraphExecBatchMemOpNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecBatchMemOpNodeSetParams + _check_or_init_driver() + if __cuGraphExecBatchMemOpNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecBatchMemOpNodeSetParams is not found") + return (__cuGraphExecBatchMemOpNodeSetParams)( + hGraphExec, hNode, nodeParams) + + +cdef CUresult _cuGraphAddMemAllocNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUDA_MEM_ALLOC_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddMemAllocNode + _check_or_init_driver() + if __cuGraphAddMemAllocNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddMemAllocNode is not found") + return (__cuGraphAddMemAllocNode)( + phGraphNode, hGraph, dependencies, numDependencies, nodeParams) + + +cdef CUresult _cuGraphMemAllocNodeGetParams(CUgraphNode hNode, CUDA_MEM_ALLOC_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphMemAllocNodeGetParams + _check_or_init_driver() + if __cuGraphMemAllocNodeGetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphMemAllocNodeGetParams is not found") + return (__cuGraphMemAllocNodeGetParams)( + hNode, params_out) + + +cdef CUresult _cuGraphAddMemFreeNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddMemFreeNode + _check_or_init_driver() + if __cuGraphAddMemFreeNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddMemFreeNode is not found") + return (__cuGraphAddMemFreeNode)( + phGraphNode, hGraph, dependencies, numDependencies, dptr) + + +cdef CUresult _cuGraphMemFreeNodeGetParams(CUgraphNode hNode, CUdeviceptr* dptr_out) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphMemFreeNodeGetParams + _check_or_init_driver() + if __cuGraphMemFreeNodeGetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphMemFreeNodeGetParams is not found") + return (__cuGraphMemFreeNodeGetParams)( + hNode, dptr_out) + + +cdef CUresult _cuDeviceGraphMemTrim(CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGraphMemTrim + _check_or_init_driver() + if __cuDeviceGraphMemTrim == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGraphMemTrim is not found") + return (__cuDeviceGraphMemTrim)( + device) + + +cdef CUresult _cuDeviceGetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetGraphMemAttribute + _check_or_init_driver() + if __cuDeviceGetGraphMemAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetGraphMemAttribute is not found") + return (__cuDeviceGetGraphMemAttribute)( + device, attr, value) + + +cdef CUresult _cuDeviceSetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceSetGraphMemAttribute + _check_or_init_driver() + if __cuDeviceSetGraphMemAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceSetGraphMemAttribute is not found") + return (__cuDeviceSetGraphMemAttribute)( + device, attr, value) + + +cdef CUresult _cuGraphClone(CUgraph* phGraphClone, CUgraph originalGraph) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphClone + _check_or_init_driver() + if __cuGraphClone == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphClone is not found") + return (__cuGraphClone)( + phGraphClone, originalGraph) + + +cdef CUresult _cuGraphNodeFindInClone(CUgraphNode* phNode, CUgraphNode hOriginalNode, CUgraph hClonedGraph) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeFindInClone + _check_or_init_driver() + if __cuGraphNodeFindInClone == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeFindInClone is not found") + return (__cuGraphNodeFindInClone)( + phNode, hOriginalNode, hClonedGraph) + + +cdef CUresult _cuGraphNodeGetType(CUgraphNode hNode, CUgraphNodeType* type) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeGetType + _check_or_init_driver() + if __cuGraphNodeGetType == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeGetType is not found") + return (__cuGraphNodeGetType)( + hNode, type) + + +cdef CUresult _cuGraphGetNodes(CUgraph hGraph, CUgraphNode* nodes, size_t* numNodes) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphGetNodes + _check_or_init_driver() + if __cuGraphGetNodes == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphGetNodes is not found") + return (__cuGraphGetNodes)( + hGraph, nodes, numNodes) + + +cdef CUresult _cuGraphGetRootNodes(CUgraph hGraph, CUgraphNode* rootNodes, size_t* numRootNodes) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphGetRootNodes + _check_or_init_driver() + if __cuGraphGetRootNodes == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphGetRootNodes is not found") + return (__cuGraphGetRootNodes)( + hGraph, rootNodes, numRootNodes) + + +cdef CUresult _cuGraphGetEdges_v2(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, CUgraphEdgeData* edgeData, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphGetEdges_v2 + _check_or_init_driver() + if __cuGraphGetEdges_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphGetEdges_v2 is not found") + return (__cuGraphGetEdges_v2)( + hGraph, from_, to, edgeData, numEdges) + + +cdef CUresult _cuGraphNodeGetDependencies_v2(CUgraphNode hNode, CUgraphNode* dependencies, CUgraphEdgeData* edgeData, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeGetDependencies_v2 + _check_or_init_driver() + if __cuGraphNodeGetDependencies_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeGetDependencies_v2 is not found") + return (__cuGraphNodeGetDependencies_v2)( + hNode, dependencies, edgeData, numDependencies) + + +cdef CUresult _cuGraphNodeGetDependentNodes_v2(CUgraphNode hNode, CUgraphNode* dependentNodes, CUgraphEdgeData* edgeData, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeGetDependentNodes_v2 + _check_or_init_driver() + if __cuGraphNodeGetDependentNodes_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeGetDependentNodes_v2 is not found") + return (__cuGraphNodeGetDependentNodes_v2)( + hNode, dependentNodes, edgeData, numDependentNodes) + + +cdef CUresult _cuGraphAddDependencies_v2(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddDependencies_v2 + _check_or_init_driver() + if __cuGraphAddDependencies_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddDependencies_v2 is not found") + return (__cuGraphAddDependencies_v2)( + hGraph, from_, to, edgeData, numDependencies) + + +cdef CUresult _cuGraphRemoveDependencies_v2(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphRemoveDependencies_v2 + _check_or_init_driver() + if __cuGraphRemoveDependencies_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphRemoveDependencies_v2 is not found") + return (__cuGraphRemoveDependencies_v2)( + hGraph, from_, to, edgeData, numDependencies) + + +cdef CUresult _cuGraphDestroyNode(CUgraphNode hNode) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphDestroyNode + _check_or_init_driver() + if __cuGraphDestroyNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphDestroyNode is not found") + return (__cuGraphDestroyNode)( + hNode) + + +cdef CUresult _cuGraphInstantiateWithFlags(CUgraphExec* phGraphExec, CUgraph hGraph, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphInstantiateWithFlags + _check_or_init_driver() + if __cuGraphInstantiateWithFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphInstantiateWithFlags is not found") + return (__cuGraphInstantiateWithFlags)( + phGraphExec, hGraph, flags) + + +cdef CUresult _cuGraphInstantiateWithParams(CUgraphExec* phGraphExec, CUgraph hGraph, CUDA_GRAPH_INSTANTIATE_PARAMS* instantiateParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphInstantiateWithParams + _check_or_init_driver() + if __cuGraphInstantiateWithParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphInstantiateWithParams is not found") + return (__cuGraphInstantiateWithParams)( + phGraphExec, hGraph, instantiateParams) + + +cdef CUresult _cuGraphExecGetFlags(CUgraphExec hGraphExec, cuuint64_t* flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecGetFlags + _check_or_init_driver() + if __cuGraphExecGetFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecGetFlags is not found") + return (__cuGraphExecGetFlags)( + hGraphExec, flags) + + +cdef CUresult _cuGraphExecKernelNodeSetParams_v2(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecKernelNodeSetParams_v2 + _check_or_init_driver() + if __cuGraphExecKernelNodeSetParams_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecKernelNodeSetParams_v2 is not found") + return (__cuGraphExecKernelNodeSetParams_v2)( + hGraphExec, hNode, nodeParams) + + +cdef CUresult _cuGraphExecMemcpyNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMCPY3D* copyParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecMemcpyNodeSetParams + _check_or_init_driver() + if __cuGraphExecMemcpyNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecMemcpyNodeSetParams is not found") + return (__cuGraphExecMemcpyNodeSetParams)( + hGraphExec, hNode, copyParams, ctx) + + +cdef CUresult _cuGraphExecMemsetNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* memsetParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecMemsetNodeSetParams + _check_or_init_driver() + if __cuGraphExecMemsetNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecMemsetNodeSetParams is not found") + return (__cuGraphExecMemsetNodeSetParams)( + hGraphExec, hNode, memsetParams, ctx) + + +cdef CUresult _cuGraphExecHostNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecHostNodeSetParams + _check_or_init_driver() + if __cuGraphExecHostNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecHostNodeSetParams is not found") + return (__cuGraphExecHostNodeSetParams)( + hGraphExec, hNode, nodeParams) + + +cdef CUresult _cuGraphExecChildGraphNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecChildGraphNodeSetParams + _check_or_init_driver() + if __cuGraphExecChildGraphNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecChildGraphNodeSetParams is not found") + return (__cuGraphExecChildGraphNodeSetParams)( + hGraphExec, hNode, childGraph) + + +cdef CUresult _cuGraphExecEventRecordNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecEventRecordNodeSetEvent + _check_or_init_driver() + if __cuGraphExecEventRecordNodeSetEvent == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecEventRecordNodeSetEvent is not found") + return (__cuGraphExecEventRecordNodeSetEvent)( + hGraphExec, hNode, event) + + +cdef CUresult _cuGraphExecEventWaitNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecEventWaitNodeSetEvent + _check_or_init_driver() + if __cuGraphExecEventWaitNodeSetEvent == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecEventWaitNodeSetEvent is not found") + return (__cuGraphExecEventWaitNodeSetEvent)( + hGraphExec, hNode, event) + + +cdef CUresult _cuGraphExecExternalSemaphoresSignalNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecExternalSemaphoresSignalNodeSetParams + _check_or_init_driver() + if __cuGraphExecExternalSemaphoresSignalNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecExternalSemaphoresSignalNodeSetParams is not found") + return (__cuGraphExecExternalSemaphoresSignalNodeSetParams)( + hGraphExec, hNode, nodeParams) + + +cdef CUresult _cuGraphExecExternalSemaphoresWaitNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecExternalSemaphoresWaitNodeSetParams + _check_or_init_driver() + if __cuGraphExecExternalSemaphoresWaitNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecExternalSemaphoresWaitNodeSetParams is not found") + return (__cuGraphExecExternalSemaphoresWaitNodeSetParams)( + hGraphExec, hNode, nodeParams) + + +cdef CUresult _cuGraphNodeSetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeSetEnabled + _check_or_init_driver() + if __cuGraphNodeSetEnabled == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeSetEnabled is not found") + return (__cuGraphNodeSetEnabled)( + hGraphExec, hNode, isEnabled) + + +cdef CUresult _cuGraphNodeGetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int* isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeGetEnabled + _check_or_init_driver() + if __cuGraphNodeGetEnabled == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeGetEnabled is not found") + return (__cuGraphNodeGetEnabled)( + hGraphExec, hNode, isEnabled) + + +cdef CUresult _cuGraphUpload(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphUpload + _check_or_init_driver() + if __cuGraphUpload == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphUpload is not found") + return (__cuGraphUpload)( + hGraphExec, hStream) + + +cdef CUresult _cuGraphLaunch(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphLaunch + _check_or_init_driver() + if __cuGraphLaunch == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphLaunch is not found") + return (__cuGraphLaunch)( + hGraphExec, hStream) + + +cdef CUresult _cuGraphExecDestroy(CUgraphExec hGraphExec) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecDestroy + _check_or_init_driver() + if __cuGraphExecDestroy == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecDestroy is not found") + return (__cuGraphExecDestroy)( + hGraphExec) + + +cdef CUresult _cuGraphDestroy(CUgraph hGraph) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphDestroy + _check_or_init_driver() + if __cuGraphDestroy == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphDestroy is not found") + return (__cuGraphDestroy)( + hGraph) + + +cdef CUresult _cuGraphExecUpdate_v2(CUgraphExec hGraphExec, CUgraph hGraph, CUgraphExecUpdateResultInfo* resultInfo) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecUpdate_v2 + _check_or_init_driver() + if __cuGraphExecUpdate_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecUpdate_v2 is not found") + return (__cuGraphExecUpdate_v2)( + hGraphExec, hGraph, resultInfo) + + +cdef CUresult _cuGraphKernelNodeCopyAttributes(CUgraphNode dst, CUgraphNode src) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphKernelNodeCopyAttributes + _check_or_init_driver() + if __cuGraphKernelNodeCopyAttributes == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphKernelNodeCopyAttributes is not found") + return (__cuGraphKernelNodeCopyAttributes)( + dst, src) + + +cdef CUresult _cuGraphKernelNodeGetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, CUkernelNodeAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphKernelNodeGetAttribute + _check_or_init_driver() + if __cuGraphKernelNodeGetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphKernelNodeGetAttribute is not found") + return (__cuGraphKernelNodeGetAttribute)( + hNode, attr, value_out) + + +cdef CUresult _cuGraphKernelNodeSetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, const CUkernelNodeAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphKernelNodeSetAttribute + _check_or_init_driver() + if __cuGraphKernelNodeSetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphKernelNodeSetAttribute is not found") + return (__cuGraphKernelNodeSetAttribute)( + hNode, attr, value) + + +cdef CUresult _cuGraphDebugDotPrint(CUgraph hGraph, const char* path, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphDebugDotPrint + _check_or_init_driver() + if __cuGraphDebugDotPrint == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphDebugDotPrint is not found") + return (__cuGraphDebugDotPrint)( + hGraph, path, flags) + + +cdef CUresult _cuUserObjectCreate(CUuserObject* object_out, void* ptr, CUhostFn destroy, unsigned int initialRefcount, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuUserObjectCreate + _check_or_init_driver() + if __cuUserObjectCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuUserObjectCreate is not found") + return (__cuUserObjectCreate)( + object_out, ptr, destroy, initialRefcount, flags) + + +cdef CUresult _cuUserObjectRetain(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuUserObjectRetain + _check_or_init_driver() + if __cuUserObjectRetain == NULL: + with gil: + raise FunctionNotFoundError("function cuUserObjectRetain is not found") + return (__cuUserObjectRetain)( + object, count) + + +cdef CUresult _cuUserObjectRelease(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuUserObjectRelease + _check_or_init_driver() + if __cuUserObjectRelease == NULL: + with gil: + raise FunctionNotFoundError("function cuUserObjectRelease is not found") + return (__cuUserObjectRelease)( + object, count) + + +cdef CUresult _cuGraphRetainUserObject(CUgraph graph, CUuserObject object, unsigned int count, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphRetainUserObject + _check_or_init_driver() + if __cuGraphRetainUserObject == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphRetainUserObject is not found") + return (__cuGraphRetainUserObject)( + graph, object, count, flags) + + +cdef CUresult _cuGraphReleaseUserObject(CUgraph graph, CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphReleaseUserObject + _check_or_init_driver() + if __cuGraphReleaseUserObject == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphReleaseUserObject is not found") + return (__cuGraphReleaseUserObject)( + graph, object, count) + + +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: + global __cuGraphAddNode_v2 + _check_or_init_driver() + if __cuGraphAddNode_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddNode_v2 is not found") + return (__cuGraphAddNode_v2)( + phGraphNode, hGraph, dependencies, dependencyData, numDependencies, nodeParams) + + +cdef CUresult _cuGraphNodeSetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeSetParams + _check_or_init_driver() + if __cuGraphNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeSetParams is not found") + return (__cuGraphNodeSetParams)( + hNode, nodeParams) + + +cdef CUresult _cuGraphExecNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecNodeSetParams + _check_or_init_driver() + if __cuGraphExecNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecNodeSetParams is not found") + return (__cuGraphExecNodeSetParams)( + hGraphExec, hNode, nodeParams) + + +cdef CUresult _cuGraphConditionalHandleCreate(CUgraphConditionalHandle* pHandle_out, CUgraph hGraph, CUcontext ctx, unsigned int defaultLaunchValue, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphConditionalHandleCreate + _check_or_init_driver() + if __cuGraphConditionalHandleCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphConditionalHandleCreate is not found") + return (__cuGraphConditionalHandleCreate)( + pHandle_out, hGraph, ctx, defaultLaunchValue, flags) + + +cdef CUresult _cuOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuOccupancyMaxActiveBlocksPerMultiprocessor + _check_or_init_driver() + if __cuOccupancyMaxActiveBlocksPerMultiprocessor == NULL: + with gil: + raise FunctionNotFoundError("function cuOccupancyMaxActiveBlocksPerMultiprocessor is not found") + return (__cuOccupancyMaxActiveBlocksPerMultiprocessor)( + numBlocks, func, blockSize, dynamicSMemSize) + + +cdef CUresult _cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags + _check_or_init_driver() + if __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags is not found") + return (__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags)( + numBlocks, func, blockSize, dynamicSMemSize, flags) + + +cdef CUresult _cuOccupancyMaxPotentialBlockSize(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuOccupancyMaxPotentialBlockSize + _check_or_init_driver() + if __cuOccupancyMaxPotentialBlockSize == NULL: + with gil: + raise FunctionNotFoundError("function cuOccupancyMaxPotentialBlockSize is not found") + return (__cuOccupancyMaxPotentialBlockSize)( + minGridSize, blockSize, func, blockSizeToDynamicSMemSize, dynamicSMemSize, blockSizeLimit) + + +cdef CUresult _cuOccupancyMaxPotentialBlockSizeWithFlags(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuOccupancyMaxPotentialBlockSizeWithFlags + _check_or_init_driver() + if __cuOccupancyMaxPotentialBlockSizeWithFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuOccupancyMaxPotentialBlockSizeWithFlags is not found") + return (__cuOccupancyMaxPotentialBlockSizeWithFlags)( + minGridSize, blockSize, func, blockSizeToDynamicSMemSize, dynamicSMemSize, blockSizeLimit, flags) + + +cdef CUresult _cuOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, CUfunction func, int numBlocks, int blockSize) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuOccupancyAvailableDynamicSMemPerBlock + _check_or_init_driver() + if __cuOccupancyAvailableDynamicSMemPerBlock == NULL: + with gil: + raise FunctionNotFoundError("function cuOccupancyAvailableDynamicSMemPerBlock is not found") + return (__cuOccupancyAvailableDynamicSMemPerBlock)( + dynamicSmemSize, func, numBlocks, blockSize) + + +cdef CUresult _cuOccupancyMaxPotentialClusterSize(int* clusterSize, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuOccupancyMaxPotentialClusterSize + _check_or_init_driver() + if __cuOccupancyMaxPotentialClusterSize == NULL: + with gil: + raise FunctionNotFoundError("function cuOccupancyMaxPotentialClusterSize is not found") + return (__cuOccupancyMaxPotentialClusterSize)( + clusterSize, func, config) + + +cdef CUresult _cuOccupancyMaxActiveClusters(int* numClusters, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuOccupancyMaxActiveClusters + _check_or_init_driver() + if __cuOccupancyMaxActiveClusters == NULL: + with gil: + raise FunctionNotFoundError("function cuOccupancyMaxActiveClusters is not found") + return (__cuOccupancyMaxActiveClusters)( + numClusters, func, config) + + +cdef CUresult _cuTexRefSetArray(CUtexref hTexRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetArray + _check_or_init_driver() + if __cuTexRefSetArray == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetArray is not found") + return (__cuTexRefSetArray)( + hTexRef, hArray, Flags) + + +cdef CUresult _cuTexRefSetMipmappedArray(CUtexref hTexRef, CUmipmappedArray hMipmappedArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetMipmappedArray + _check_or_init_driver() + if __cuTexRefSetMipmappedArray == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetMipmappedArray is not found") + return (__cuTexRefSetMipmappedArray)( + hTexRef, hMipmappedArray, Flags) + + +cdef CUresult _cuTexRefSetAddress_v2(size_t* ByteOffset, CUtexref hTexRef, CUdeviceptr dptr, size_t bytes) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetAddress_v2 + _check_or_init_driver() + if __cuTexRefSetAddress_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetAddress_v2 is not found") + return (__cuTexRefSetAddress_v2)( + ByteOffset, hTexRef, dptr, bytes) + + +cdef CUresult _cuTexRefSetAddress2D_v3(CUtexref hTexRef, const CUDA_ARRAY_DESCRIPTOR* desc, CUdeviceptr dptr, size_t Pitch) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetAddress2D_v3 + _check_or_init_driver() + if __cuTexRefSetAddress2D_v3 == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetAddress2D_v3 is not found") + return (__cuTexRefSetAddress2D_v3)( + hTexRef, desc, dptr, Pitch) + + +cdef CUresult _cuTexRefSetFormat(CUtexref hTexRef, CUarray_format fmt, int NumPackedComponents) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetFormat + _check_or_init_driver() + if __cuTexRefSetFormat == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetFormat is not found") + return (__cuTexRefSetFormat)( + hTexRef, fmt, NumPackedComponents) + + +cdef CUresult _cuTexRefSetAddressMode(CUtexref hTexRef, int dim, CUaddress_mode am) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetAddressMode + _check_or_init_driver() + if __cuTexRefSetAddressMode == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetAddressMode is not found") + return (__cuTexRefSetAddressMode)( + hTexRef, dim, am) + + +cdef CUresult _cuTexRefSetFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetFilterMode + _check_or_init_driver() + if __cuTexRefSetFilterMode == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetFilterMode is not found") + return (__cuTexRefSetFilterMode)( + hTexRef, fm) + + +cdef CUresult _cuTexRefSetMipmapFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetMipmapFilterMode + _check_or_init_driver() + if __cuTexRefSetMipmapFilterMode == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetMipmapFilterMode is not found") + return (__cuTexRefSetMipmapFilterMode)( + hTexRef, fm) + + +cdef CUresult _cuTexRefSetMipmapLevelBias(CUtexref hTexRef, float bias) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetMipmapLevelBias + _check_or_init_driver() + if __cuTexRefSetMipmapLevelBias == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetMipmapLevelBias is not found") + return (__cuTexRefSetMipmapLevelBias)( + hTexRef, bias) + + +cdef CUresult _cuTexRefSetMipmapLevelClamp(CUtexref hTexRef, float minMipmapLevelClamp, float maxMipmapLevelClamp) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetMipmapLevelClamp + _check_or_init_driver() + if __cuTexRefSetMipmapLevelClamp == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetMipmapLevelClamp is not found") + return (__cuTexRefSetMipmapLevelClamp)( + hTexRef, minMipmapLevelClamp, maxMipmapLevelClamp) + + +cdef CUresult _cuTexRefSetMaxAnisotropy(CUtexref hTexRef, unsigned int maxAniso) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetMaxAnisotropy + _check_or_init_driver() + if __cuTexRefSetMaxAnisotropy == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetMaxAnisotropy is not found") + return (__cuTexRefSetMaxAnisotropy)( + hTexRef, maxAniso) + + +cdef CUresult _cuTexRefSetBorderColor(CUtexref hTexRef, float* pBorderColor) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetBorderColor + _check_or_init_driver() + if __cuTexRefSetBorderColor == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetBorderColor is not found") + return (__cuTexRefSetBorderColor)( + hTexRef, pBorderColor) + + +cdef CUresult _cuTexRefSetFlags(CUtexref hTexRef, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetFlags + _check_or_init_driver() + if __cuTexRefSetFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetFlags is not found") + return (__cuTexRefSetFlags)( + hTexRef, Flags) + + +cdef CUresult _cuTexRefGetAddress_v2(CUdeviceptr* pdptr, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefGetAddress_v2 + _check_or_init_driver() + if __cuTexRefGetAddress_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefGetAddress_v2 is not found") + return (__cuTexRefGetAddress_v2)( + pdptr, hTexRef) + + +cdef CUresult _cuTexRefGetArray(CUarray* phArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefGetArray + _check_or_init_driver() + if __cuTexRefGetArray == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefGetArray is not found") + return (__cuTexRefGetArray)( + phArray, hTexRef) + + +cdef CUresult _cuTexRefGetMipmappedArray(CUmipmappedArray* phMipmappedArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefGetMipmappedArray + _check_or_init_driver() + if __cuTexRefGetMipmappedArray == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefGetMipmappedArray is not found") + return (__cuTexRefGetMipmappedArray)( + phMipmappedArray, hTexRef) + + +cdef CUresult _cuTexRefGetAddressMode(CUaddress_mode* pam, CUtexref hTexRef, int dim) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefGetAddressMode + _check_or_init_driver() + if __cuTexRefGetAddressMode == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefGetAddressMode is not found") + return (__cuTexRefGetAddressMode)( + pam, hTexRef, dim) + + +cdef CUresult _cuTexRefGetFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefGetFilterMode + _check_or_init_driver() + if __cuTexRefGetFilterMode == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefGetFilterMode is not found") + return (__cuTexRefGetFilterMode)( + pfm, hTexRef) + + +cdef CUresult _cuTexRefGetFormat(CUarray_format* pFormat, int* pNumChannels, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefGetFormat + _check_or_init_driver() + if __cuTexRefGetFormat == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefGetFormat is not found") + return (__cuTexRefGetFormat)( + pFormat, pNumChannels, hTexRef) + + +cdef CUresult _cuTexRefGetMipmapFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefGetMipmapFilterMode + _check_or_init_driver() + if __cuTexRefGetMipmapFilterMode == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefGetMipmapFilterMode is not found") + return (__cuTexRefGetMipmapFilterMode)( + pfm, hTexRef) + + +cdef CUresult _cuTexRefGetMipmapLevelBias(float* pbias, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefGetMipmapLevelBias + _check_or_init_driver() + if __cuTexRefGetMipmapLevelBias == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefGetMipmapLevelBias is not found") + return (__cuTexRefGetMipmapLevelBias)( + pbias, hTexRef) + + +cdef CUresult _cuTexRefGetMipmapLevelClamp(float* pminMipmapLevelClamp, float* pmaxMipmapLevelClamp, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefGetMipmapLevelClamp + _check_or_init_driver() + if __cuTexRefGetMipmapLevelClamp == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefGetMipmapLevelClamp is not found") + return (__cuTexRefGetMipmapLevelClamp)( + pminMipmapLevelClamp, pmaxMipmapLevelClamp, hTexRef) + + +cdef CUresult _cuTexRefGetMaxAnisotropy(int* pmaxAniso, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefGetMaxAnisotropy + _check_or_init_driver() + if __cuTexRefGetMaxAnisotropy == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefGetMaxAnisotropy is not found") + return (__cuTexRefGetMaxAnisotropy)( + pmaxAniso, hTexRef) + + +cdef CUresult _cuTexRefGetBorderColor(float* pBorderColor, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefGetBorderColor + _check_or_init_driver() + if __cuTexRefGetBorderColor == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefGetBorderColor is not found") + return (__cuTexRefGetBorderColor)( + pBorderColor, hTexRef) + + +cdef CUresult _cuTexRefGetFlags(unsigned int* pFlags, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefGetFlags + _check_or_init_driver() + if __cuTexRefGetFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefGetFlags is not found") + return (__cuTexRefGetFlags)( + pFlags, hTexRef) + + +cdef CUresult _cuTexRefCreate(CUtexref* pTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefCreate + _check_or_init_driver() + if __cuTexRefCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefCreate is not found") + return (__cuTexRefCreate)( + pTexRef) + + +cdef CUresult _cuTexRefDestroy(CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefDestroy + _check_or_init_driver() + if __cuTexRefDestroy == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefDestroy is not found") + return (__cuTexRefDestroy)( + hTexRef) + + +cdef CUresult _cuSurfRefSetArray(CUsurfref hSurfRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuSurfRefSetArray + _check_or_init_driver() + if __cuSurfRefSetArray == NULL: + with gil: + raise FunctionNotFoundError("function cuSurfRefSetArray is not found") + return (__cuSurfRefSetArray)( + hSurfRef, hArray, Flags) + + +cdef CUresult _cuSurfRefGetArray(CUarray* phArray, CUsurfref hSurfRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuSurfRefGetArray + _check_or_init_driver() + if __cuSurfRefGetArray == NULL: + with gil: + raise FunctionNotFoundError("function cuSurfRefGetArray is not found") + return (__cuSurfRefGetArray)( + phArray, hSurfRef) + + +cdef CUresult _cuTexObjectCreate(CUtexObject* pTexObject, const CUDA_RESOURCE_DESC* pResDesc, const CUDA_TEXTURE_DESC* pTexDesc, const CUDA_RESOURCE_VIEW_DESC* pResViewDesc) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexObjectCreate + _check_or_init_driver() + if __cuTexObjectCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuTexObjectCreate is not found") + return (__cuTexObjectCreate)( + pTexObject, pResDesc, pTexDesc, pResViewDesc) + + +cdef CUresult _cuTexObjectDestroy(CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexObjectDestroy + _check_or_init_driver() + if __cuTexObjectDestroy == NULL: + with gil: + raise FunctionNotFoundError("function cuTexObjectDestroy is not found") + return (__cuTexObjectDestroy)( + texObject) + + +cdef CUresult _cuTexObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexObjectGetResourceDesc + _check_or_init_driver() + if __cuTexObjectGetResourceDesc == NULL: + with gil: + raise FunctionNotFoundError("function cuTexObjectGetResourceDesc is not found") + return (__cuTexObjectGetResourceDesc)( + pResDesc, texObject) + + +cdef CUresult _cuTexObjectGetTextureDesc(CUDA_TEXTURE_DESC* pTexDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexObjectGetTextureDesc + _check_or_init_driver() + if __cuTexObjectGetTextureDesc == NULL: + with gil: + raise FunctionNotFoundError("function cuTexObjectGetTextureDesc is not found") + return (__cuTexObjectGetTextureDesc)( + pTexDesc, texObject) + + +cdef CUresult _cuTexObjectGetResourceViewDesc(CUDA_RESOURCE_VIEW_DESC* pResViewDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexObjectGetResourceViewDesc + _check_or_init_driver() + if __cuTexObjectGetResourceViewDesc == NULL: + with gil: + raise FunctionNotFoundError("function cuTexObjectGetResourceViewDesc is not found") + return (__cuTexObjectGetResourceViewDesc)( + pResViewDesc, texObject) + + +cdef CUresult _cuSurfObjectCreate(CUsurfObject* pSurfObject, const CUDA_RESOURCE_DESC* pResDesc) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuSurfObjectCreate + _check_or_init_driver() + if __cuSurfObjectCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuSurfObjectCreate is not found") + return (__cuSurfObjectCreate)( + pSurfObject, pResDesc) + + +cdef CUresult _cuSurfObjectDestroy(CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuSurfObjectDestroy + _check_or_init_driver() + if __cuSurfObjectDestroy == NULL: + with gil: + raise FunctionNotFoundError("function cuSurfObjectDestroy is not found") + return (__cuSurfObjectDestroy)( + surfObject) + + +cdef CUresult _cuSurfObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuSurfObjectGetResourceDesc + _check_or_init_driver() + if __cuSurfObjectGetResourceDesc == NULL: + with gil: + raise FunctionNotFoundError("function cuSurfObjectGetResourceDesc is not found") + return (__cuSurfObjectGetResourceDesc)( + pResDesc, surfObject) + + +cdef CUresult _cuTensorMapEncodeTiled(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, const cuuint32_t* boxDim, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTensorMapEncodeTiled + _check_or_init_driver() + if __cuTensorMapEncodeTiled == NULL: + with gil: + raise FunctionNotFoundError("function cuTensorMapEncodeTiled is not found") + return (__cuTensorMapEncodeTiled)( + tensorMap, tensorDataType, tensorRank, globalAddress, globalDim, globalStrides, boxDim, elementStrides, interleave, swizzle, l2Promotion, oobFill) + + +cdef CUresult _cuTensorMapEncodeIm2col(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, const int* pixelBoxLowerCorner, const int* pixelBoxUpperCorner, cuuint32_t channelsPerPixel, cuuint32_t pixelsPerColumn, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTensorMapEncodeIm2col + _check_or_init_driver() + if __cuTensorMapEncodeIm2col == NULL: + with gil: + raise FunctionNotFoundError("function cuTensorMapEncodeIm2col is not found") + return (__cuTensorMapEncodeIm2col)( + tensorMap, tensorDataType, tensorRank, globalAddress, globalDim, globalStrides, pixelBoxLowerCorner, pixelBoxUpperCorner, channelsPerPixel, pixelsPerColumn, elementStrides, interleave, swizzle, l2Promotion, oobFill) + + +cdef CUresult _cuTensorMapEncodeIm2colWide(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, int pixelBoxLowerCornerWidth, int pixelBoxUpperCornerWidth, cuuint32_t channelsPerPixel, cuuint32_t pixelsPerColumn, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapIm2ColWideMode mode, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTensorMapEncodeIm2colWide + _check_or_init_driver() + if __cuTensorMapEncodeIm2colWide == NULL: + with gil: + raise FunctionNotFoundError("function cuTensorMapEncodeIm2colWide is not found") + return (__cuTensorMapEncodeIm2colWide)( + tensorMap, tensorDataType, tensorRank, globalAddress, globalDim, globalStrides, pixelBoxLowerCornerWidth, pixelBoxUpperCornerWidth, channelsPerPixel, pixelsPerColumn, elementStrides, interleave, mode, swizzle, l2Promotion, oobFill) + + +cdef CUresult _cuTensorMapReplaceAddress(CUtensorMap* tensorMap, void* globalAddress) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTensorMapReplaceAddress + _check_or_init_driver() + if __cuTensorMapReplaceAddress == NULL: + with gil: + raise FunctionNotFoundError("function cuTensorMapReplaceAddress is not found") + return (__cuTensorMapReplaceAddress)( + tensorMap, globalAddress) + + +cdef CUresult _cuDeviceCanAccessPeer(int* canAccessPeer, CUdevice dev, CUdevice peerDev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceCanAccessPeer + _check_or_init_driver() + if __cuDeviceCanAccessPeer == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceCanAccessPeer is not found") + return (__cuDeviceCanAccessPeer)( + canAccessPeer, dev, peerDev) + + +cdef CUresult _cuCtxEnablePeerAccess(CUcontext peerContext, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxEnablePeerAccess + _check_or_init_driver() + if __cuCtxEnablePeerAccess == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxEnablePeerAccess is not found") + return (__cuCtxEnablePeerAccess)( + peerContext, Flags) + + +cdef CUresult _cuCtxDisablePeerAccess(CUcontext peerContext) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxDisablePeerAccess + _check_or_init_driver() + if __cuCtxDisablePeerAccess == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxDisablePeerAccess is not found") + return (__cuCtxDisablePeerAccess)( + peerContext) + + +cdef CUresult _cuDeviceGetP2PAttribute(int* value, CUdevice_P2PAttribute attrib, CUdevice srcDevice, CUdevice dstDevice) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetP2PAttribute + _check_or_init_driver() + if __cuDeviceGetP2PAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetP2PAttribute is not found") + return (__cuDeviceGetP2PAttribute)( + value, attrib, srcDevice, dstDevice) + + +cdef CUresult _cuGraphicsUnregisterResource(CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsUnregisterResource + _check_or_init_driver() + if __cuGraphicsUnregisterResource == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsUnregisterResource is not found") + return (__cuGraphicsUnregisterResource)( + resource) + + +cdef CUresult _cuGraphicsSubResourceGetMappedArray(CUarray* pArray, CUgraphicsResource resource, unsigned int arrayIndex, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsSubResourceGetMappedArray + _check_or_init_driver() + if __cuGraphicsSubResourceGetMappedArray == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsSubResourceGetMappedArray is not found") + return (__cuGraphicsSubResourceGetMappedArray)( + pArray, resource, arrayIndex, mipLevel) + + +cdef CUresult _cuGraphicsResourceGetMappedMipmappedArray(CUmipmappedArray* pMipmappedArray, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsResourceGetMappedMipmappedArray + _check_or_init_driver() + if __cuGraphicsResourceGetMappedMipmappedArray == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsResourceGetMappedMipmappedArray is not found") + return (__cuGraphicsResourceGetMappedMipmappedArray)( + pMipmappedArray, resource) + + +cdef CUresult _cuGraphicsResourceGetMappedPointer_v2(CUdeviceptr* pDevPtr, size_t* pSize, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsResourceGetMappedPointer_v2 + _check_or_init_driver() + if __cuGraphicsResourceGetMappedPointer_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsResourceGetMappedPointer_v2 is not found") + return (__cuGraphicsResourceGetMappedPointer_v2)( + pDevPtr, pSize, resource) + + +cdef CUresult _cuGraphicsResourceSetMapFlags_v2(CUgraphicsResource resource, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsResourceSetMapFlags_v2 + _check_or_init_driver() + if __cuGraphicsResourceSetMapFlags_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsResourceSetMapFlags_v2 is not found") + return (__cuGraphicsResourceSetMapFlags_v2)( + resource, flags) + + +cdef CUresult _cuGraphicsMapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsMapResources + _check_or_init_driver() + if __cuGraphicsMapResources == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsMapResources is not found") + return (__cuGraphicsMapResources)( + count, resources, hStream) + + +cdef CUresult _cuGraphicsUnmapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsUnmapResources + _check_or_init_driver() + if __cuGraphicsUnmapResources == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsUnmapResources is not found") + return (__cuGraphicsUnmapResources)( + count, resources, hStream) + + +cdef CUresult _cuGetProcAddress_v2(const char* symbol, void** pfn, int cudaVersion, cuuint64_t flags, CUdriverProcAddressQueryResult* symbolStatus) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGetProcAddress_v2 + _check_or_init_driver() + if __cuGetProcAddress_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGetProcAddress_v2 is not found") + return (__cuGetProcAddress_v2)( + symbol, pfn, cudaVersion, flags, symbolStatus) + + +cdef CUresult _cuCoredumpGetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCoredumpGetAttribute + _check_or_init_driver() + if __cuCoredumpGetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuCoredumpGetAttribute is not found") + return (__cuCoredumpGetAttribute)( + attrib, value, size) + + +cdef CUresult _cuCoredumpGetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCoredumpGetAttributeGlobal + _check_or_init_driver() + if __cuCoredumpGetAttributeGlobal == NULL: + with gil: + raise FunctionNotFoundError("function cuCoredumpGetAttributeGlobal is not found") + return (__cuCoredumpGetAttributeGlobal)( + attrib, value, size) + + +cdef CUresult _cuCoredumpSetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCoredumpSetAttribute + _check_or_init_driver() + if __cuCoredumpSetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuCoredumpSetAttribute is not found") + return (__cuCoredumpSetAttribute)( + attrib, value, size) + + +cdef CUresult _cuCoredumpSetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCoredumpSetAttributeGlobal + _check_or_init_driver() + if __cuCoredumpSetAttributeGlobal == NULL: + with gil: + raise FunctionNotFoundError("function cuCoredumpSetAttributeGlobal is not found") + return (__cuCoredumpSetAttributeGlobal)( + attrib, value, size) + + +cdef CUresult _cuGetExportTable(const void** ppExportTable, const CUuuid* pExportTableId) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGetExportTable + _check_or_init_driver() + if __cuGetExportTable == NULL: + with gil: + raise FunctionNotFoundError("function cuGetExportTable is not found") + return (__cuGetExportTable)( + ppExportTable, pExportTableId) + + +cdef CUresult _cuGreenCtxCreate(CUgreenCtx* phCtx, CUdevResourceDesc desc, CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGreenCtxCreate + _check_or_init_driver() + if __cuGreenCtxCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuGreenCtxCreate is not found") + return (__cuGreenCtxCreate)( + phCtx, desc, dev, flags) + + +cdef CUresult _cuGreenCtxDestroy(CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGreenCtxDestroy + _check_or_init_driver() + if __cuGreenCtxDestroy == NULL: + with gil: + raise FunctionNotFoundError("function cuGreenCtxDestroy is not found") + return (__cuGreenCtxDestroy)( + hCtx) + + +cdef CUresult _cuCtxFromGreenCtx(CUcontext* pContext, CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxFromGreenCtx + _check_or_init_driver() + if __cuCtxFromGreenCtx == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxFromGreenCtx is not found") + return (__cuCtxFromGreenCtx)( + pContext, hCtx) + + +cdef CUresult _cuDeviceGetDevResource(CUdevice device, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetDevResource + _check_or_init_driver() + if __cuDeviceGetDevResource == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetDevResource is not found") + return (__cuDeviceGetDevResource)( + device, resource, type) + + +cdef CUresult _cuCtxGetDevResource(CUcontext hCtx, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxGetDevResource + _check_or_init_driver() + if __cuCtxGetDevResource == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxGetDevResource is not found") + return (__cuCtxGetDevResource)( + hCtx, resource, type) + + +cdef CUresult _cuGreenCtxGetDevResource(CUgreenCtx hCtx, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGreenCtxGetDevResource + _check_or_init_driver() + if __cuGreenCtxGetDevResource == NULL: + with gil: + raise FunctionNotFoundError("function cuGreenCtxGetDevResource is not found") + return (__cuGreenCtxGetDevResource)( + hCtx, resource, type) + + +cdef CUresult _cuDevSmResourceSplitByCount(CUdevResource* result, unsigned int* nbGroups, const CUdevResource* input, CUdevResource* remainder, unsigned int flags, unsigned int minCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDevSmResourceSplitByCount + _check_or_init_driver() + if __cuDevSmResourceSplitByCount == NULL: + with gil: + raise FunctionNotFoundError("function cuDevSmResourceSplitByCount is not found") + return (__cuDevSmResourceSplitByCount)( + result, nbGroups, input, remainder, flags, minCount) + + +cdef CUresult _cuDevResourceGenerateDesc(CUdevResourceDesc* phDesc, CUdevResource* resources, unsigned int nbResources) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDevResourceGenerateDesc + _check_or_init_driver() + if __cuDevResourceGenerateDesc == NULL: + with gil: + raise FunctionNotFoundError("function cuDevResourceGenerateDesc is not found") + return (__cuDevResourceGenerateDesc)( + phDesc, resources, nbResources) + + +cdef CUresult _cuGreenCtxRecordEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGreenCtxRecordEvent + _check_or_init_driver() + if __cuGreenCtxRecordEvent == NULL: + with gil: + raise FunctionNotFoundError("function cuGreenCtxRecordEvent is not found") + return (__cuGreenCtxRecordEvent)( + hCtx, hEvent) + + +cdef CUresult _cuGreenCtxWaitEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGreenCtxWaitEvent + _check_or_init_driver() + if __cuGreenCtxWaitEvent == NULL: + with gil: + raise FunctionNotFoundError("function cuGreenCtxWaitEvent is not found") + return (__cuGreenCtxWaitEvent)( + hCtx, hEvent) + + +cdef CUresult _cuStreamGetGreenCtx(CUstream hStream, CUgreenCtx* phCtx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamGetGreenCtx + _check_or_init_driver() + if __cuStreamGetGreenCtx == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamGetGreenCtx is not found") + return (__cuStreamGetGreenCtx)( + hStream, phCtx) + + +cdef CUresult _cuGreenCtxStreamCreate(CUstream* phStream, CUgreenCtx greenCtx, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGreenCtxStreamCreate + _check_or_init_driver() + if __cuGreenCtxStreamCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuGreenCtxStreamCreate is not found") + return (__cuGreenCtxStreamCreate)( + phStream, greenCtx, flags, priority) + + +cdef CUresult _cuLogsRegisterCallback(CUlogsCallback callbackFunc, void* userData, CUlogsCallbackHandle* callback_out) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogsRegisterCallback + _check_or_init_driver() + if __cuLogsRegisterCallback == NULL: + with gil: + raise FunctionNotFoundError("function cuLogsRegisterCallback is not found") + return (__cuLogsRegisterCallback)( + callbackFunc, userData, callback_out) + + +cdef CUresult _cuLogsUnregisterCallback(CUlogsCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogsUnregisterCallback + _check_or_init_driver() + if __cuLogsUnregisterCallback == NULL: + with gil: + raise FunctionNotFoundError("function cuLogsUnregisterCallback is not found") + return (__cuLogsUnregisterCallback)( + callback) + + +cdef CUresult _cuLogsCurrent(CUlogIterator* iterator_out, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogsCurrent + _check_or_init_driver() + if __cuLogsCurrent == NULL: + with gil: + raise FunctionNotFoundError("function cuLogsCurrent is not found") + return (__cuLogsCurrent)( + iterator_out, flags) + + +cdef CUresult _cuLogsDumpToFile(CUlogIterator* iterator, const char* pathToFile, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogsDumpToFile + _check_or_init_driver() + if __cuLogsDumpToFile == NULL: + with gil: + raise FunctionNotFoundError("function cuLogsDumpToFile is not found") + return (__cuLogsDumpToFile)( + iterator, pathToFile, flags) + + +cdef CUresult _cuLogsDumpToMemory(CUlogIterator* iterator, char* buffer, size_t* size, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogsDumpToMemory + _check_or_init_driver() + if __cuLogsDumpToMemory == NULL: + with gil: + raise FunctionNotFoundError("function cuLogsDumpToMemory is not found") + return (__cuLogsDumpToMemory)( + iterator, buffer, size, flags) + + +cdef CUresult _cuCheckpointProcessGetRestoreThreadId(int pid, int* tid) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCheckpointProcessGetRestoreThreadId + _check_or_init_driver() + if __cuCheckpointProcessGetRestoreThreadId == NULL: + with gil: + raise FunctionNotFoundError("function cuCheckpointProcessGetRestoreThreadId is not found") + return (__cuCheckpointProcessGetRestoreThreadId)( + pid, tid) + + +cdef CUresult _cuCheckpointProcessGetState(int pid, CUprocessState* state) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCheckpointProcessGetState + _check_or_init_driver() + if __cuCheckpointProcessGetState == NULL: + with gil: + raise FunctionNotFoundError("function cuCheckpointProcessGetState is not found") + return (__cuCheckpointProcessGetState)( + pid, state) + + +cdef CUresult _cuCheckpointProcessLock(int pid, CUcheckpointLockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCheckpointProcessLock + _check_or_init_driver() + if __cuCheckpointProcessLock == NULL: + with gil: + raise FunctionNotFoundError("function cuCheckpointProcessLock is not found") + return (__cuCheckpointProcessLock)( + pid, args) + + +cdef CUresult _cuCheckpointProcessCheckpoint(int pid, CUcheckpointCheckpointArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCheckpointProcessCheckpoint + _check_or_init_driver() + if __cuCheckpointProcessCheckpoint == NULL: + with gil: + raise FunctionNotFoundError("function cuCheckpointProcessCheckpoint is not found") + return (__cuCheckpointProcessCheckpoint)( + pid, args) + + +cdef CUresult _cuCheckpointProcessRestore(int pid, CUcheckpointRestoreArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCheckpointProcessRestore + _check_or_init_driver() + if __cuCheckpointProcessRestore == NULL: + with gil: + raise FunctionNotFoundError("function cuCheckpointProcessRestore is not found") + return (__cuCheckpointProcessRestore)( + pid, args) + + +cdef CUresult _cuCheckpointProcessUnlock(int pid, CUcheckpointUnlockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCheckpointProcessUnlock + _check_or_init_driver() + if __cuCheckpointProcessUnlock == NULL: + with gil: + raise FunctionNotFoundError("function cuCheckpointProcessUnlock is not found") + return (__cuCheckpointProcessUnlock)( + pid, args) + + +cdef CUresult _cuGraphicsEGLRegisterImage(CUgraphicsResource* pCudaResource, EGLImageKHR image, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsEGLRegisterImage + _check_or_init_driver() + if __cuGraphicsEGLRegisterImage == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsEGLRegisterImage is not found") + return (__cuGraphicsEGLRegisterImage)( + pCudaResource, image, flags) + + +cdef CUresult _cuEGLStreamConsumerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEGLStreamConsumerConnect + _check_or_init_driver() + if __cuEGLStreamConsumerConnect == NULL: + with gil: + raise FunctionNotFoundError("function cuEGLStreamConsumerConnect is not found") + return (__cuEGLStreamConsumerConnect)( + conn, stream) + + +cdef CUresult _cuEGLStreamConsumerConnectWithFlags(CUeglStreamConnection* conn, EGLStreamKHR stream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEGLStreamConsumerConnectWithFlags + _check_or_init_driver() + if __cuEGLStreamConsumerConnectWithFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuEGLStreamConsumerConnectWithFlags is not found") + return (__cuEGLStreamConsumerConnectWithFlags)( + conn, stream, flags) + + +cdef CUresult _cuEGLStreamConsumerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEGLStreamConsumerDisconnect + _check_or_init_driver() + if __cuEGLStreamConsumerDisconnect == NULL: + with gil: + raise FunctionNotFoundError("function cuEGLStreamConsumerDisconnect is not found") + return (__cuEGLStreamConsumerDisconnect)( + conn) + + +cdef CUresult _cuEGLStreamConsumerAcquireFrame(CUeglStreamConnection* conn, CUgraphicsResource* pCudaResource, CUstream* pStream, unsigned int timeout) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEGLStreamConsumerAcquireFrame + _check_or_init_driver() + if __cuEGLStreamConsumerAcquireFrame == NULL: + with gil: + raise FunctionNotFoundError("function cuEGLStreamConsumerAcquireFrame is not found") + return (__cuEGLStreamConsumerAcquireFrame)( + conn, pCudaResource, pStream, timeout) + + +cdef CUresult _cuEGLStreamConsumerReleaseFrame(CUeglStreamConnection* conn, CUgraphicsResource pCudaResource, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEGLStreamConsumerReleaseFrame + _check_or_init_driver() + if __cuEGLStreamConsumerReleaseFrame == NULL: + with gil: + raise FunctionNotFoundError("function cuEGLStreamConsumerReleaseFrame is not found") + return (__cuEGLStreamConsumerReleaseFrame)( + conn, pCudaResource, pStream) + + +cdef CUresult _cuEGLStreamProducerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream, EGLint width, EGLint height) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEGLStreamProducerConnect + _check_or_init_driver() + if __cuEGLStreamProducerConnect == NULL: + with gil: + raise FunctionNotFoundError("function cuEGLStreamProducerConnect is not found") + return (__cuEGLStreamProducerConnect)( + conn, stream, width, height) + + +cdef CUresult _cuEGLStreamProducerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEGLStreamProducerDisconnect + _check_or_init_driver() + if __cuEGLStreamProducerDisconnect == NULL: + with gil: + raise FunctionNotFoundError("function cuEGLStreamProducerDisconnect is not found") + return (__cuEGLStreamProducerDisconnect)( + conn) + + +cdef CUresult _cuEGLStreamProducerPresentFrame(CUeglStreamConnection* conn, CUeglFrame eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEGLStreamProducerPresentFrame + _check_or_init_driver() + if __cuEGLStreamProducerPresentFrame == NULL: + with gil: + raise FunctionNotFoundError("function cuEGLStreamProducerPresentFrame is not found") + return (__cuEGLStreamProducerPresentFrame)( + conn, eglframe, pStream) + + +cdef CUresult _cuEGLStreamProducerReturnFrame(CUeglStreamConnection* conn, CUeglFrame* eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEGLStreamProducerReturnFrame + _check_or_init_driver() + if __cuEGLStreamProducerReturnFrame == NULL: + with gil: + raise FunctionNotFoundError("function cuEGLStreamProducerReturnFrame is not found") + return (__cuEGLStreamProducerReturnFrame)( + conn, eglframe, pStream) + + +cdef CUresult _cuGraphicsResourceGetMappedEglFrame(CUeglFrame* eglFrame, CUgraphicsResource resource, unsigned int index, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsResourceGetMappedEglFrame + _check_or_init_driver() + if __cuGraphicsResourceGetMappedEglFrame == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsResourceGetMappedEglFrame is not found") + return (__cuGraphicsResourceGetMappedEglFrame)( + eglFrame, resource, index, mipLevel) + + +cdef CUresult _cuEventCreateFromEGLSync(CUevent* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEventCreateFromEGLSync + _check_or_init_driver() + if __cuEventCreateFromEGLSync == NULL: + with gil: + raise FunctionNotFoundError("function cuEventCreateFromEGLSync is not found") + return (__cuEventCreateFromEGLSync)( + phEvent, eglSync, flags) + + +cdef CUresult _cuGraphicsGLRegisterBuffer(CUgraphicsResource* pCudaResource, GLuint buffer, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsGLRegisterBuffer + _check_or_init_driver() + if __cuGraphicsGLRegisterBuffer == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsGLRegisterBuffer is not found") + return (__cuGraphicsGLRegisterBuffer)( + pCudaResource, buffer, Flags) + + +cdef CUresult _cuGraphicsGLRegisterImage(CUgraphicsResource* pCudaResource, GLuint image, GLenum target, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsGLRegisterImage + _check_or_init_driver() + if __cuGraphicsGLRegisterImage == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsGLRegisterImage is not found") + return (__cuGraphicsGLRegisterImage)( + pCudaResource, image, target, Flags) + + +cdef CUresult _cuGLGetDevices_v2(unsigned int* pCudaDeviceCount, CUdevice* pCudaDevices, unsigned int cudaDeviceCount, CUGLDeviceList deviceList) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGLGetDevices_v2 + _check_or_init_driver() + if __cuGLGetDevices_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGLGetDevices_v2 is not found") + return (__cuGLGetDevices_v2)( + pCudaDeviceCount, pCudaDevices, cudaDeviceCount, deviceList) + + +cdef CUresult _cuGLCtxCreate_v2(CUcontext* pCtx, unsigned int Flags, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGLCtxCreate_v2 + _check_or_init_driver() + if __cuGLCtxCreate_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGLCtxCreate_v2 is not found") + return (__cuGLCtxCreate_v2)( + pCtx, Flags, device) + + +cdef CUresult _cuGLInit() except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGLInit + _check_or_init_driver() + if __cuGLInit == NULL: + with gil: + raise FunctionNotFoundError("function cuGLInit is not found") + return (__cuGLInit)( + ) + + +cdef CUresult _cuGLRegisterBufferObject(GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGLRegisterBufferObject + _check_or_init_driver() + if __cuGLRegisterBufferObject == NULL: + with gil: + raise FunctionNotFoundError("function cuGLRegisterBufferObject is not found") + return (__cuGLRegisterBufferObject)( + buffer) + + +cdef CUresult _cuGLMapBufferObject_v2(CUdeviceptr* dptr, size_t* size, GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGLMapBufferObject_v2 + _check_or_init_driver() + if __cuGLMapBufferObject_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGLMapBufferObject_v2 is not found") + return (__cuGLMapBufferObject_v2)( + dptr, size, buffer) + + +cdef CUresult _cuGLUnmapBufferObject(GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGLUnmapBufferObject + _check_or_init_driver() + if __cuGLUnmapBufferObject == NULL: + with gil: + raise FunctionNotFoundError("function cuGLUnmapBufferObject is not found") + return (__cuGLUnmapBufferObject)( + buffer) + + +cdef CUresult _cuGLUnregisterBufferObject(GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGLUnregisterBufferObject + _check_or_init_driver() + if __cuGLUnregisterBufferObject == NULL: + with gil: + raise FunctionNotFoundError("function cuGLUnregisterBufferObject is not found") + return (__cuGLUnregisterBufferObject)( + buffer) + + +cdef CUresult _cuGLSetBufferObjectMapFlags(GLuint buffer, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGLSetBufferObjectMapFlags + _check_or_init_driver() + if __cuGLSetBufferObjectMapFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuGLSetBufferObjectMapFlags is not found") + return (__cuGLSetBufferObjectMapFlags)( + buffer, Flags) + + +cdef CUresult _cuGLMapBufferObjectAsync_v2(CUdeviceptr* dptr, size_t* size, GLuint buffer, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGLMapBufferObjectAsync_v2 + _check_or_init_driver() + if __cuGLMapBufferObjectAsync_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGLMapBufferObjectAsync_v2 is not found") + return (__cuGLMapBufferObjectAsync_v2)( + dptr, size, buffer, hStream) + + +cdef CUresult _cuGLUnmapBufferObjectAsync(GLuint buffer, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGLUnmapBufferObjectAsync + _check_or_init_driver() + if __cuGLUnmapBufferObjectAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuGLUnmapBufferObjectAsync is not found") + return (__cuGLUnmapBufferObjectAsync)( + buffer, hStream) + + +cdef CUresult _cuProfilerInitialize(const char* configFile, const char* outputFile, CUoutput_mode outputMode) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuProfilerInitialize + _check_or_init_driver() + if __cuProfilerInitialize == NULL: + with gil: + raise FunctionNotFoundError("function cuProfilerInitialize is not found") + return (__cuProfilerInitialize)( + configFile, outputFile, outputMode) + + +cdef CUresult _cuProfilerStart() except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuProfilerStart + _check_or_init_driver() + if __cuProfilerStart == NULL: + with gil: + raise FunctionNotFoundError("function cuProfilerStart is not found") + return (__cuProfilerStart)( + ) + + +cdef CUresult _cuProfilerStop() except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuProfilerStop + _check_or_init_driver() + if __cuProfilerStop == NULL: + with gil: + raise FunctionNotFoundError("function cuProfilerStop is not found") + return (__cuProfilerStop)( + ) + + +cdef CUresult _cuVDPAUGetDevice(CUdevice* pDevice, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuVDPAUGetDevice + _check_or_init_driver() + if __cuVDPAUGetDevice == NULL: + with gil: + raise FunctionNotFoundError("function cuVDPAUGetDevice is not found") + return (__cuVDPAUGetDevice)( + pDevice, vdpDevice, vdpGetProcAddress) + + +cdef CUresult _cuVDPAUCtxCreate_v2(CUcontext* pCtx, unsigned int flags, CUdevice device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuVDPAUCtxCreate_v2 + _check_or_init_driver() + if __cuVDPAUCtxCreate_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuVDPAUCtxCreate_v2 is not found") + return (__cuVDPAUCtxCreate_v2)( + pCtx, flags, device, vdpDevice, vdpGetProcAddress) + + +cdef CUresult _cuGraphicsVDPAURegisterVideoSurface(CUgraphicsResource* pCudaResource, VdpVideoSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsVDPAURegisterVideoSurface + _check_or_init_driver() + if __cuGraphicsVDPAURegisterVideoSurface == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsVDPAURegisterVideoSurface is not found") + return (__cuGraphicsVDPAURegisterVideoSurface)( + pCudaResource, vdpSurface, flags) + + +cdef CUresult _cuGraphicsVDPAURegisterOutputSurface(CUgraphicsResource* pCudaResource, VdpOutputSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsVDPAURegisterOutputSurface + _check_or_init_driver() + if __cuGraphicsVDPAURegisterOutputSurface == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsVDPAURegisterOutputSurface is not found") + return (__cuGraphicsVDPAURegisterOutputSurface)( + pCudaResource, vdpSurface, flags) + + +cdef CUresult _cuDeviceGetHostAtomicCapabilities(unsigned int* capabilities, const CUatomicOperation* operations, unsigned int count, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetHostAtomicCapabilities + _check_or_init_driver() + if __cuDeviceGetHostAtomicCapabilities == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetHostAtomicCapabilities is not found") + return (__cuDeviceGetHostAtomicCapabilities)( + capabilities, operations, count, dev) + + +cdef CUresult _cuCtxGetDevice_v2(CUdevice* device, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxGetDevice_v2 + _check_or_init_driver() + if __cuCtxGetDevice_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxGetDevice_v2 is not found") + return (__cuCtxGetDevice_v2)( + device, ctx) + + +cdef CUresult _cuCtxSynchronize_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxSynchronize_v2 + _check_or_init_driver() + if __cuCtxSynchronize_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxSynchronize_v2 is not found") + return (__cuCtxSynchronize_v2)( + ctx) + + +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 + _check_or_init_driver() + if __cuMemcpyBatchAsync_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyBatchAsync_v2 is not found") + return (__cuMemcpyBatchAsync_v2)( + dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, hStream) + + +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 + _check_or_init_driver() + if __cuMemcpy3DBatchAsync_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpy3DBatchAsync_v2 is not found") + return (__cuMemcpy3DBatchAsync_v2)( + numOps, opList, flags, hStream) + + +cdef CUresult _cuMemGetDefaultMemPool(CUmemoryPool* pool_out, CUmemLocation* location, CUmemAllocationType type) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemGetDefaultMemPool + _check_or_init_driver() + if __cuMemGetDefaultMemPool == NULL: + with gil: + raise FunctionNotFoundError("function cuMemGetDefaultMemPool is not found") + return (__cuMemGetDefaultMemPool)( + pool_out, location, type) + + +cdef CUresult _cuMemGetMemPool(CUmemoryPool* pool, CUmemLocation* location, CUmemAllocationType type) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemGetMemPool + _check_or_init_driver() + if __cuMemGetMemPool == NULL: + with gil: + raise FunctionNotFoundError("function cuMemGetMemPool is not found") + return (__cuMemGetMemPool)( + pool, location, type) + + +cdef CUresult _cuMemSetMemPool(CUmemLocation* location, CUmemAllocationType type, CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemSetMemPool + _check_or_init_driver() + if __cuMemSetMemPool == NULL: + with gil: + raise FunctionNotFoundError("function cuMemSetMemPool is not found") + return (__cuMemSetMemPool)( + location, type, pool) + + +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 + _check_or_init_driver() + if __cuMemPrefetchBatchAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPrefetchBatchAsync is not found") + return (__cuMemPrefetchBatchAsync)( + dptrs, sizes, count, prefetchLocs, prefetchLocIdxs, numPrefetchLocs, flags, hStream) + + +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 + _check_or_init_driver() + if __cuMemDiscardBatchAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemDiscardBatchAsync is not found") + return (__cuMemDiscardBatchAsync)( + dptrs, sizes, count, flags, hStream) + + +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 + _check_or_init_driver() + if __cuMemDiscardAndPrefetchBatchAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemDiscardAndPrefetchBatchAsync is not found") + return (__cuMemDiscardAndPrefetchBatchAsync)( + dptrs, sizes, count, prefetchLocs, prefetchLocIdxs, numPrefetchLocs, flags, hStream) + + +cdef CUresult _cuDeviceGetP2PAtomicCapabilities(unsigned int* capabilities, const CUatomicOperation* operations, unsigned int count, CUdevice srcDevice, CUdevice dstDevice) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetP2PAtomicCapabilities + _check_or_init_driver() + if __cuDeviceGetP2PAtomicCapabilities == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetP2PAtomicCapabilities is not found") + return (__cuDeviceGetP2PAtomicCapabilities)( + capabilities, operations, count, srcDevice, dstDevice) + + +cdef CUresult _cuGreenCtxGetId(CUgreenCtx greenCtx, unsigned long long* greenCtxId) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGreenCtxGetId + _check_or_init_driver() + if __cuGreenCtxGetId == NULL: + with gil: + raise FunctionNotFoundError("function cuGreenCtxGetId is not found") + return (__cuGreenCtxGetId)( + greenCtx, greenCtxId) + + +cdef CUresult _cuMulticastBindMem_v2(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, CUmemGenericAllocationHandle memHandle, size_t memOffset, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMulticastBindMem_v2 + _check_or_init_driver() + if __cuMulticastBindMem_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMulticastBindMem_v2 is not found") + return (__cuMulticastBindMem_v2)( + mcHandle, dev, mcOffset, memHandle, memOffset, size, flags) + + +cdef CUresult _cuMulticastBindAddr_v2(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, CUdeviceptr memptr, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMulticastBindAddr_v2 + _check_or_init_driver() + if __cuMulticastBindAddr_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMulticastBindAddr_v2 is not found") + return (__cuMulticastBindAddr_v2)( + mcHandle, dev, mcOffset, memptr, size, flags) + + +cdef CUresult _cuGraphNodeGetContainingGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeGetContainingGraph + _check_or_init_driver() + if __cuGraphNodeGetContainingGraph == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeGetContainingGraph is not found") + return (__cuGraphNodeGetContainingGraph)( + hNode, phGraph) + + +cdef CUresult _cuGraphNodeGetLocalId(CUgraphNode hNode, unsigned int* nodeId) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeGetLocalId + _check_or_init_driver() + if __cuGraphNodeGetLocalId == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeGetLocalId is not found") + return (__cuGraphNodeGetLocalId)( + hNode, nodeId) + + +cdef CUresult _cuGraphNodeGetToolsId(CUgraphNode hNode, unsigned long long* toolsNodeId) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeGetToolsId + _check_or_init_driver() + if __cuGraphNodeGetToolsId == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeGetToolsId is not found") + return (__cuGraphNodeGetToolsId)( + hNode, toolsNodeId) + + +cdef CUresult _cuGraphGetId(CUgraph hGraph, unsigned int* graphId) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphGetId + _check_or_init_driver() + if __cuGraphGetId == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphGetId is not found") + return (__cuGraphGetId)( + hGraph, graphId) + + +cdef CUresult _cuGraphExecGetId(CUgraphExec hGraphExec, unsigned int* graphId) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecGetId + _check_or_init_driver() + if __cuGraphExecGetId == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecGetId is not found") + return (__cuGraphExecGetId)( + hGraphExec, graphId) + + +cdef CUresult _cuDevSmResourceSplit(CUdevResource* result, unsigned int nbGroups, const CUdevResource* input, CUdevResource* remainder, unsigned int flags, CU_DEV_SM_RESOURCE_GROUP_PARAMS* groupParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDevSmResourceSplit + _check_or_init_driver() + if __cuDevSmResourceSplit == NULL: + with gil: + raise FunctionNotFoundError("function cuDevSmResourceSplit is not found") + return (__cuDevSmResourceSplit)( + result, nbGroups, input, remainder, flags, groupParams) + + +cdef CUresult _cuStreamGetDevResource(CUstream hStream, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamGetDevResource + _check_or_init_driver() + if __cuStreamGetDevResource == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamGetDevResource is not found") + return (__cuStreamGetDevResource)( + hStream, resource, type) + + +cdef CUresult _cuKernelGetParamCount(CUkernel kernel, size_t* paramCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuKernelGetParamCount + _check_or_init_driver() + if __cuKernelGetParamCount == NULL: + with gil: + raise FunctionNotFoundError("function cuKernelGetParamCount is not found") + return (__cuKernelGetParamCount)( + kernel, paramCount) + + +cdef CUresult _cuMemcpyWithAttributesAsync(CUdeviceptr dst, CUdeviceptr src, size_t size, CUmemcpyAttributes* attr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyWithAttributesAsync + _check_or_init_driver() + if __cuMemcpyWithAttributesAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyWithAttributesAsync is not found") + return (__cuMemcpyWithAttributesAsync)( + dst, src, size, attr, hStream) + + +cdef CUresult _cuMemcpy3DWithAttributesAsync(CUDA_MEMCPY3D_BATCH_OP* op, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpy3DWithAttributesAsync + _check_or_init_driver() + if __cuMemcpy3DWithAttributesAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpy3DWithAttributesAsync is not found") + return (__cuMemcpy3DWithAttributesAsync)( + op, flags, hStream) + + +cdef CUresult _cuStreamBeginCaptureToCig(CUstream hStream, CUstreamCigCaptureParams* streamCigCaptureParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamBeginCaptureToCig + _check_or_init_driver() + if __cuStreamBeginCaptureToCig == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamBeginCaptureToCig is not found") + return (__cuStreamBeginCaptureToCig)( + hStream, streamCigCaptureParams) + + +cdef CUresult _cuStreamEndCaptureToCig(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamEndCaptureToCig + _check_or_init_driver() + if __cuStreamEndCaptureToCig == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamEndCaptureToCig is not found") + return (__cuStreamEndCaptureToCig)( + hStream) + + +cdef CUresult _cuFuncGetParamCount(CUfunction func, size_t* paramCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFuncGetParamCount + _check_or_init_driver() + if __cuFuncGetParamCount == NULL: + with gil: + raise FunctionNotFoundError("function cuFuncGetParamCount is not found") + return (__cuFuncGetParamCount)( + func, paramCount) + + +cdef CUresult _cuLaunchHostFunc_v2(CUstream hStream, CUhostFn fn, void* userData, unsigned int syncMode) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLaunchHostFunc_v2 + _check_or_init_driver() + if __cuLaunchHostFunc_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuLaunchHostFunc_v2 is not found") + return (__cuLaunchHostFunc_v2)( + hStream, fn, userData, syncMode) + + +cdef CUresult _cuGraphNodeGetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeGetParams + _check_or_init_driver() + if __cuGraphNodeGetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeGetParams is not found") + return (__cuGraphNodeGetParams)( + hNode, nodeParams) + + +cdef CUresult _cuCoredumpRegisterStartCallback(CUcoredumpStatusCallback callback, void* userData, CUcoredumpCallbackHandle* callbackOut) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCoredumpRegisterStartCallback + _check_or_init_driver() + if __cuCoredumpRegisterStartCallback == NULL: + with gil: + raise FunctionNotFoundError("function cuCoredumpRegisterStartCallback is not found") + return (__cuCoredumpRegisterStartCallback)( + callback, userData, callbackOut) + + +cdef CUresult _cuCoredumpRegisterCompleteCallback(CUcoredumpStatusCallback callback, void* userData, CUcoredumpCallbackHandle* callbackOut) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCoredumpRegisterCompleteCallback + _check_or_init_driver() + if __cuCoredumpRegisterCompleteCallback == NULL: + with gil: + raise FunctionNotFoundError("function cuCoredumpRegisterCompleteCallback is not found") + return (__cuCoredumpRegisterCompleteCallback)( + callback, userData, callbackOut) + + +cdef CUresult _cuCoredumpDeregisterStartCallback(CUcoredumpCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCoredumpDeregisterStartCallback + _check_or_init_driver() + if __cuCoredumpDeregisterStartCallback == NULL: + with gil: + raise FunctionNotFoundError("function cuCoredumpDeregisterStartCallback is not found") + return (__cuCoredumpDeregisterStartCallback)( + callback) + + +cdef CUresult _cuCoredumpDeregisterCompleteCallback(CUcoredumpCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCoredumpDeregisterCompleteCallback + _check_or_init_driver() + if __cuCoredumpDeregisterCompleteCallback == NULL: + with gil: + raise FunctionNotFoundError("function cuCoredumpDeregisterCompleteCallback is not found") + return (__cuCoredumpDeregisterCompleteCallback)( + callback) + + +cdef CUresult _cuLogicalEndpointIdReserve(CUlogicalEndpointId* baseLeId, cuuint32_t count) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogicalEndpointIdReserve + _check_or_init_driver() + if __cuLogicalEndpointIdReserve == NULL: + with gil: + raise FunctionNotFoundError("function cuLogicalEndpointIdReserve is not found") + return (__cuLogicalEndpointIdReserve)( + baseLeId, count) + + +cdef CUresult _cuLogicalEndpointIdRelease(CUlogicalEndpointId baseLeId, cuuint32_t count) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogicalEndpointIdRelease + _check_or_init_driver() + if __cuLogicalEndpointIdRelease == NULL: + with gil: + raise FunctionNotFoundError("function cuLogicalEndpointIdRelease is not found") + return (__cuLogicalEndpointIdRelease)( + baseLeId, count) + + +cdef CUresult _cuLogicalEndpointCreate(CUlogicalEndpointId leId, const CUlogicalEndpointProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogicalEndpointCreate + _check_or_init_driver() + if __cuLogicalEndpointCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuLogicalEndpointCreate is not found") + return (__cuLogicalEndpointCreate)( + leId, prop) + + +cdef CUresult _cuLogicalEndpointAddDevice(CUlogicalEndpointId leId, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogicalEndpointAddDevice + _check_or_init_driver() + if __cuLogicalEndpointAddDevice == NULL: + with gil: + raise FunctionNotFoundError("function cuLogicalEndpointAddDevice is not found") + return (__cuLogicalEndpointAddDevice)( + leId, dev) + + +cdef CUresult _cuLogicalEndpointDestroy(CUlogicalEndpointId leId) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogicalEndpointDestroy + _check_or_init_driver() + if __cuLogicalEndpointDestroy == NULL: + with gil: + raise FunctionNotFoundError("function cuLogicalEndpointDestroy is not found") + return (__cuLogicalEndpointDestroy)( + leId) + + +cdef CUresult _cuLogicalEndpointBindAddr(CUlogicalEndpointId leId, CUdevice dev, cuuint64_t offset, void* ptr, cuuint64_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogicalEndpointBindAddr + _check_or_init_driver() + if __cuLogicalEndpointBindAddr == NULL: + with gil: + raise FunctionNotFoundError("function cuLogicalEndpointBindAddr is not found") + return (__cuLogicalEndpointBindAddr)( + leId, dev, offset, ptr, size, flags) + + +cdef CUresult _cuLogicalEndpointBindMem(CUlogicalEndpointId leId, CUdevice dev, cuuint64_t offset, CUmemGenericAllocationHandle memHandle, cuuint64_t memOffset, cuuint64_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogicalEndpointBindMem + _check_or_init_driver() + if __cuLogicalEndpointBindMem == NULL: + with gil: + raise FunctionNotFoundError("function cuLogicalEndpointBindMem is not found") + return (__cuLogicalEndpointBindMem)( + leId, dev, offset, memHandle, memOffset, size, flags) + + +cdef CUresult _cuLogicalEndpointUnbind(CUlogicalEndpointId leId, CUdevice dev, cuuint64_t offset, cuuint64_t size) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogicalEndpointUnbind + _check_or_init_driver() + if __cuLogicalEndpointUnbind == NULL: + with gil: + raise FunctionNotFoundError("function cuLogicalEndpointUnbind is not found") + return (__cuLogicalEndpointUnbind)( + leId, dev, offset, size) + + +cdef CUresult _cuLogicalEndpointExport(void* handle, CUlogicalEndpointId leId, CUlogicalEndpointIpcHandleType handleType) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogicalEndpointExport + _check_or_init_driver() + if __cuLogicalEndpointExport == NULL: + with gil: + raise FunctionNotFoundError("function cuLogicalEndpointExport is not found") + return (__cuLogicalEndpointExport)( + handle, leId, handleType) + + +cdef CUresult _cuLogicalEndpointImport(CUlogicalEndpointId leId, const void* handle, CUlogicalEndpointIpcHandleType handleType) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogicalEndpointImport + _check_or_init_driver() + if __cuLogicalEndpointImport == NULL: + with gil: + raise FunctionNotFoundError("function cuLogicalEndpointImport is not found") + return (__cuLogicalEndpointImport)( + leId, handle, handleType) + + +cdef CUresult _cuLogicalEndpointGetLimits(cuuint64_t* bindAlignment, cuuint64_t* maxSize, const CUlogicalEndpointProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogicalEndpointGetLimits + _check_or_init_driver() + if __cuLogicalEndpointGetLimits == NULL: + with gil: + raise FunctionNotFoundError("function cuLogicalEndpointGetLimits is not found") + return (__cuLogicalEndpointGetLimits)( + bindAlignment, maxSize, prop) + + +cdef CUresult _cuLogicalEndpointQuery(CUlogicalEndpointId leId, cuuint32_t count, int* queryStatus) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogicalEndpointQuery + _check_or_init_driver() + if __cuLogicalEndpointQuery == NULL: + with gil: + raise FunctionNotFoundError("function cuLogicalEndpointQuery is not found") + return (__cuLogicalEndpointQuery)( + leId, count, queryStatus) + + +cdef CUresult _cuStreamBeginRecaptureToGraph(CUstream hStream, CUstreamCaptureMode mode, CUgraph hGraph, CUgraphRecaptureCallback callbackFunc, void* userData) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamBeginRecaptureToGraph + _check_or_init_driver() + if __cuStreamBeginRecaptureToGraph == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamBeginRecaptureToGraph is not found") + return (__cuStreamBeginRecaptureToGraph)( + hStream, mode, hGraph, callbackFunc, userData) diff --git a/cuda_bindings/cuda/bindings/_internal/driver_windows.pyx b/cuda_bindings/cuda/bindings/_internal/driver_windows.pyx new file mode 100644 index 00000000000..96c7545dd11 --- /dev/null +++ b/cuda_bindings/cuda/bindings/_internal/driver_windows.pyx @@ -0,0 +1,8944 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. + +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=51232c67845ad8bb70e4d63f8f48ed1246b27d371b929f229fa09c27b23235c8 +from libc.stdint cimport intptr_t + +import os +import threading +from .utils import FunctionNotFoundError, NotSupportedError + +from cuda.pathfinder import load_nvidia_dynamic_lib + +from libc.stddef cimport wchar_t +from libc.stdint cimport uintptr_t +from cpython cimport PyUnicode_AsWideCharString, PyMem_Free + +# You must 'from .utils import NotSupportedError' before using this template + +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('Did not find cuDriverGetVersion symbol in nvcuda.dll') + err = (cuDriverGetVersion)(&driver_ver) + if err != 0: + raise RuntimeError(f'cuDriverGetVersion returned error code {err}') + + return driver_ver + + + +############################################################################### +# Wrapper init +############################################################################### + +cdef object __symbol_lock = threading.Lock() +cdef bint __py_driver_init = False + +cdef void* __cuGetErrorString = NULL +cdef void* __cuGetErrorName = NULL +cdef void* __cuInit = NULL +cdef void* __cuDriverGetVersion = NULL +cdef void* __cuDeviceGet = NULL +cdef void* __cuDeviceGetCount = NULL +cdef void* __cuDeviceGetName = NULL +cdef void* __cuDeviceGetUuid_v2 = NULL +cdef void* __cuDeviceGetLuid = NULL +cdef void* __cuDeviceTotalMem_v2 = NULL +cdef void* __cuDeviceGetTexture1DLinearMaxWidth = NULL +cdef void* __cuDeviceGetAttribute = NULL +cdef void* __cuDeviceGetNvSciSyncAttributes = NULL +cdef void* __cuDeviceSetMemPool = NULL +cdef void* __cuDeviceGetMemPool = NULL +cdef void* __cuDeviceGetDefaultMemPool = NULL +cdef void* __cuDeviceGetExecAffinitySupport = NULL +cdef void* __cuFlushGPUDirectRDMAWrites = NULL +cdef void* __cuDeviceGetProperties = NULL +cdef void* __cuDeviceComputeCapability = NULL +cdef void* __cuDevicePrimaryCtxRetain = NULL +cdef void* __cuDevicePrimaryCtxRelease_v2 = NULL +cdef void* __cuDevicePrimaryCtxSetFlags_v2 = NULL +cdef void* __cuDevicePrimaryCtxGetState = NULL +cdef void* __cuDevicePrimaryCtxReset_v2 = NULL +cdef void* __cuCtxCreate_v2 = NULL +cdef void* __cuCtxCreate_v3 = NULL +cdef void* __cuCtxCreate_v4 = NULL +cdef void* __cuCtxDestroy_v2 = NULL +cdef void* __cuCtxPushCurrent_v2 = NULL +cdef void* __cuCtxPopCurrent_v2 = NULL +cdef void* __cuCtxSetCurrent = NULL +cdef void* __cuCtxGetCurrent = NULL +cdef void* __cuCtxGetDevice = NULL +cdef void* __cuCtxGetFlags = NULL +cdef void* __cuCtxSetFlags = NULL +cdef void* __cuCtxGetId = NULL +cdef void* __cuCtxSynchronize = NULL +cdef void* __cuCtxSetLimit = NULL +cdef void* __cuCtxGetLimit = NULL +cdef void* __cuCtxGetCacheConfig = NULL +cdef void* __cuCtxSetCacheConfig = NULL +cdef void* __cuCtxGetApiVersion = NULL +cdef void* __cuCtxGetStreamPriorityRange = NULL +cdef void* __cuCtxResetPersistingL2Cache = NULL +cdef void* __cuCtxGetExecAffinity = NULL +cdef void* __cuCtxRecordEvent = NULL +cdef void* __cuCtxWaitEvent = NULL +cdef void* __cuCtxAttach = NULL +cdef void* __cuCtxDetach = NULL +cdef void* __cuCtxGetSharedMemConfig = NULL +cdef void* __cuCtxSetSharedMemConfig = NULL +cdef void* __cuModuleLoad = NULL +cdef void* __cuModuleLoadData = NULL +cdef void* __cuModuleLoadDataEx = NULL +cdef void* __cuModuleLoadFatBinary = NULL +cdef void* __cuModuleUnload = NULL +cdef void* __cuModuleGetLoadingMode = NULL +cdef void* __cuModuleGetFunction = NULL +cdef void* __cuModuleGetFunctionCount = NULL +cdef void* __cuModuleEnumerateFunctions = NULL +cdef void* __cuModuleGetGlobal_v2 = NULL +cdef void* __cuLinkCreate_v2 = NULL +cdef void* __cuLinkAddData_v2 = NULL +cdef void* __cuLinkAddFile_v2 = NULL +cdef void* __cuLinkComplete = NULL +cdef void* __cuLinkDestroy = NULL +cdef void* __cuModuleGetTexRef = NULL +cdef void* __cuModuleGetSurfRef = NULL +cdef void* __cuLibraryLoadData = NULL +cdef void* __cuLibraryLoadFromFile = NULL +cdef void* __cuLibraryUnload = NULL +cdef void* __cuLibraryGetKernel = NULL +cdef void* __cuLibraryGetKernelCount = NULL +cdef void* __cuLibraryEnumerateKernels = NULL +cdef void* __cuLibraryGetModule = NULL +cdef void* __cuKernelGetFunction = NULL +cdef void* __cuKernelGetLibrary = NULL +cdef void* __cuLibraryGetGlobal = NULL +cdef void* __cuLibraryGetManaged = NULL +cdef void* __cuLibraryGetUnifiedFunction = NULL +cdef void* __cuKernelGetAttribute = NULL +cdef void* __cuKernelSetAttribute = NULL +cdef void* __cuKernelSetCacheConfig = NULL +cdef void* __cuKernelGetName = NULL +cdef void* __cuKernelGetParamInfo = NULL +cdef void* __cuMemGetInfo_v2 = NULL +cdef void* __cuMemAlloc_v2 = NULL +cdef void* __cuMemAllocPitch_v2 = NULL +cdef void* __cuMemFree_v2 = NULL +cdef void* __cuMemGetAddressRange_v2 = NULL +cdef void* __cuMemAllocHost_v2 = NULL +cdef void* __cuMemFreeHost = NULL +cdef void* __cuMemHostAlloc = NULL +cdef void* __cuMemHostGetDevicePointer_v2 = NULL +cdef void* __cuMemHostGetFlags = NULL +cdef void* __cuMemAllocManaged = NULL +cdef void* __cuDeviceRegisterAsyncNotification = NULL +cdef void* __cuDeviceUnregisterAsyncNotification = NULL +cdef void* __cuDeviceGetByPCIBusId = NULL +cdef void* __cuDeviceGetPCIBusId = NULL +cdef void* __cuIpcGetEventHandle = NULL +cdef void* __cuIpcOpenEventHandle = NULL +cdef void* __cuIpcGetMemHandle = NULL +cdef void* __cuIpcOpenMemHandle_v2 = NULL +cdef void* __cuIpcCloseMemHandle = NULL +cdef void* __cuMemHostRegister_v2 = NULL +cdef void* __cuMemHostUnregister = NULL +cdef void* __cuMemcpy = NULL +cdef void* __cuMemcpyPeer = NULL +cdef void* __cuMemcpyHtoD_v2 = NULL +cdef void* __cuMemcpyDtoH_v2 = NULL +cdef void* __cuMemcpyDtoD_v2 = NULL +cdef void* __cuMemcpyDtoA_v2 = NULL +cdef void* __cuMemcpyAtoD_v2 = NULL +cdef void* __cuMemcpyHtoA_v2 = NULL +cdef void* __cuMemcpyAtoH_v2 = NULL +cdef void* __cuMemcpyAtoA_v2 = NULL +cdef void* __cuMemcpy2D_v2 = NULL +cdef void* __cuMemcpy2DUnaligned_v2 = NULL +cdef void* __cuMemcpy3D_v2 = NULL +cdef void* __cuMemcpy3DPeer = NULL +cdef void* __cuMemcpyAsync = NULL +cdef void* __cuMemcpyPeerAsync = NULL +cdef void* __cuMemcpyHtoDAsync_v2 = NULL +cdef void* __cuMemcpyDtoHAsync_v2 = NULL +cdef void* __cuMemcpyDtoDAsync_v2 = NULL +cdef void* __cuMemcpyHtoAAsync_v2 = NULL +cdef void* __cuMemcpyAtoHAsync_v2 = NULL +cdef void* __cuMemcpy2DAsync_v2 = NULL +cdef void* __cuMemcpy3DAsync_v2 = NULL +cdef void* __cuMemcpy3DPeerAsync = NULL +cdef void* __cuMemsetD8_v2 = NULL +cdef void* __cuMemsetD16_v2 = NULL +cdef void* __cuMemsetD32_v2 = NULL +cdef void* __cuMemsetD2D8_v2 = NULL +cdef void* __cuMemsetD2D16_v2 = NULL +cdef void* __cuMemsetD2D32_v2 = NULL +cdef void* __cuMemsetD8Async = NULL +cdef void* __cuMemsetD16Async = NULL +cdef void* __cuMemsetD32Async = NULL +cdef void* __cuMemsetD2D8Async = NULL +cdef void* __cuMemsetD2D16Async = NULL +cdef void* __cuMemsetD2D32Async = NULL +cdef void* __cuArrayCreate_v2 = NULL +cdef void* __cuArrayGetDescriptor_v2 = NULL +cdef void* __cuArrayGetSparseProperties = NULL +cdef void* __cuMipmappedArrayGetSparseProperties = NULL +cdef void* __cuArrayGetMemoryRequirements = NULL +cdef void* __cuMipmappedArrayGetMemoryRequirements = NULL +cdef void* __cuArrayGetPlane = NULL +cdef void* __cuArrayDestroy = NULL +cdef void* __cuArray3DCreate_v2 = NULL +cdef void* __cuArray3DGetDescriptor_v2 = NULL +cdef void* __cuMipmappedArrayCreate = NULL +cdef void* __cuMipmappedArrayGetLevel = NULL +cdef void* __cuMipmappedArrayDestroy = NULL +cdef void* __cuMemGetHandleForAddressRange = NULL +cdef void* __cuMemBatchDecompressAsync = NULL +cdef void* __cuMemAddressReserve = NULL +cdef void* __cuMemAddressFree = NULL +cdef void* __cuMemCreate = NULL +cdef void* __cuMemRelease = NULL +cdef void* __cuMemMap = NULL +cdef void* __cuMemMapArrayAsync = NULL +cdef void* __cuMemUnmap = NULL +cdef void* __cuMemSetAccess = NULL +cdef void* __cuMemGetAccess = NULL +cdef void* __cuMemExportToShareableHandle = NULL +cdef void* __cuMemImportFromShareableHandle = NULL +cdef void* __cuMemGetAllocationGranularity = NULL +cdef void* __cuMemGetAllocationPropertiesFromHandle = NULL +cdef void* __cuMemRetainAllocationHandle = NULL +cdef void* __cuMemFreeAsync = NULL +cdef void* __cuMemAllocAsync = NULL +cdef void* __cuMemPoolTrimTo = NULL +cdef void* __cuMemPoolSetAttribute = NULL +cdef void* __cuMemPoolGetAttribute = NULL +cdef void* __cuMemPoolSetAccess = NULL +cdef void* __cuMemPoolGetAccess = NULL +cdef void* __cuMemPoolCreate = NULL +cdef void* __cuMemPoolDestroy = NULL +cdef void* __cuMemAllocFromPoolAsync = NULL +cdef void* __cuMemPoolExportToShareableHandle = NULL +cdef void* __cuMemPoolImportFromShareableHandle = NULL +cdef void* __cuMemPoolExportPointer = NULL +cdef void* __cuMemPoolImportPointer = NULL +cdef void* __cuMulticastCreate = NULL +cdef void* __cuMulticastAddDevice = NULL +cdef void* __cuMulticastBindMem = NULL +cdef void* __cuMulticastBindAddr = NULL +cdef void* __cuMulticastUnbind = NULL +cdef void* __cuMulticastGetGranularity = NULL +cdef void* __cuPointerGetAttribute = NULL +cdef void* __cuMemPrefetchAsync_v2 = NULL +cdef void* __cuMemAdvise_v2 = NULL +cdef void* __cuMemRangeGetAttribute = NULL +cdef void* __cuMemRangeGetAttributes = NULL +cdef void* __cuPointerSetAttribute = NULL +cdef void* __cuPointerGetAttributes = NULL +cdef void* __cuStreamCreate = NULL +cdef void* __cuStreamCreateWithPriority = NULL +cdef void* __cuStreamGetPriority = NULL +cdef void* __cuStreamGetDevice = NULL +cdef void* __cuStreamGetFlags = NULL +cdef void* __cuStreamGetId = NULL +cdef void* __cuStreamGetCtx = NULL +cdef void* __cuStreamGetCtx_v2 = NULL +cdef void* __cuStreamWaitEvent = NULL +cdef void* __cuStreamAddCallback = NULL +cdef void* __cuStreamBeginCapture_v2 = NULL +cdef void* __cuStreamBeginCaptureToGraph = NULL +cdef void* __cuThreadExchangeStreamCaptureMode = NULL +cdef void* __cuStreamEndCapture = NULL +cdef void* __cuStreamIsCapturing = NULL +cdef void* __cuStreamGetCaptureInfo_v2 = NULL +cdef void* __cuStreamGetCaptureInfo_v3 = NULL +cdef void* __cuStreamUpdateCaptureDependencies_v2 = NULL +cdef void* __cuStreamAttachMemAsync = NULL +cdef void* __cuStreamQuery = NULL +cdef void* __cuStreamSynchronize = NULL +cdef void* __cuStreamDestroy_v2 = NULL +cdef void* __cuStreamCopyAttributes = NULL +cdef void* __cuStreamGetAttribute = NULL +cdef void* __cuStreamSetAttribute = NULL +cdef void* __cuEventCreate = NULL +cdef void* __cuEventRecord = NULL +cdef void* __cuEventRecordWithFlags = NULL +cdef void* __cuEventQuery = NULL +cdef void* __cuEventSynchronize = NULL +cdef void* __cuEventDestroy_v2 = NULL +cdef void* __cuEventElapsedTime_v2 = NULL +cdef void* __cuImportExternalMemory = NULL +cdef void* __cuExternalMemoryGetMappedBuffer = NULL +cdef void* __cuExternalMemoryGetMappedMipmappedArray = NULL +cdef void* __cuDestroyExternalMemory = NULL +cdef void* __cuImportExternalSemaphore = NULL +cdef void* __cuSignalExternalSemaphoresAsync = NULL +cdef void* __cuWaitExternalSemaphoresAsync = NULL +cdef void* __cuDestroyExternalSemaphore = NULL +cdef void* __cuStreamWaitValue32_v2 = NULL +cdef void* __cuStreamWaitValue64_v2 = NULL +cdef void* __cuStreamWriteValue32_v2 = NULL +cdef void* __cuStreamWriteValue64_v2 = NULL +cdef void* __cuStreamBatchMemOp_v2 = NULL +cdef void* __cuFuncGetAttribute = NULL +cdef void* __cuFuncSetAttribute = NULL +cdef void* __cuFuncSetCacheConfig = NULL +cdef void* __cuFuncGetModule = NULL +cdef void* __cuFuncGetName = NULL +cdef void* __cuFuncGetParamInfo = NULL +cdef void* __cuFuncIsLoaded = NULL +cdef void* __cuFuncLoad = NULL +cdef void* __cuLaunchKernel = NULL +cdef void* __cuLaunchKernelEx = NULL +cdef void* __cuLaunchCooperativeKernel = NULL +cdef void* __cuLaunchCooperativeKernelMultiDevice = NULL +cdef void* __cuLaunchHostFunc = NULL +cdef void* __cuFuncSetBlockShape = NULL +cdef void* __cuFuncSetSharedSize = NULL +cdef void* __cuParamSetSize = NULL +cdef void* __cuParamSeti = NULL +cdef void* __cuParamSetf = NULL +cdef void* __cuParamSetv = NULL +cdef void* __cuLaunch = NULL +cdef void* __cuLaunchGrid = NULL +cdef void* __cuLaunchGridAsync = NULL +cdef void* __cuParamSetTexRef = NULL +cdef void* __cuFuncSetSharedMemConfig = NULL +cdef void* __cuGraphCreate = NULL +cdef void* __cuGraphAddKernelNode_v2 = NULL +cdef void* __cuGraphKernelNodeGetParams_v2 = NULL +cdef void* __cuGraphKernelNodeSetParams_v2 = NULL +cdef void* __cuGraphAddMemcpyNode = NULL +cdef void* __cuGraphMemcpyNodeGetParams = NULL +cdef void* __cuGraphMemcpyNodeSetParams = NULL +cdef void* __cuGraphAddMemsetNode = NULL +cdef void* __cuGraphMemsetNodeGetParams = NULL +cdef void* __cuGraphMemsetNodeSetParams = NULL +cdef void* __cuGraphAddHostNode = NULL +cdef void* __cuGraphHostNodeGetParams = NULL +cdef void* __cuGraphHostNodeSetParams = NULL +cdef void* __cuGraphAddChildGraphNode = NULL +cdef void* __cuGraphChildGraphNodeGetGraph = NULL +cdef void* __cuGraphAddEmptyNode = NULL +cdef void* __cuGraphAddEventRecordNode = NULL +cdef void* __cuGraphEventRecordNodeGetEvent = NULL +cdef void* __cuGraphEventRecordNodeSetEvent = NULL +cdef void* __cuGraphAddEventWaitNode = NULL +cdef void* __cuGraphEventWaitNodeGetEvent = NULL +cdef void* __cuGraphEventWaitNodeSetEvent = NULL +cdef void* __cuGraphAddExternalSemaphoresSignalNode = NULL +cdef void* __cuGraphExternalSemaphoresSignalNodeGetParams = NULL +cdef void* __cuGraphExternalSemaphoresSignalNodeSetParams = NULL +cdef void* __cuGraphAddExternalSemaphoresWaitNode = NULL +cdef void* __cuGraphExternalSemaphoresWaitNodeGetParams = NULL +cdef void* __cuGraphExternalSemaphoresWaitNodeSetParams = NULL +cdef void* __cuGraphAddBatchMemOpNode = NULL +cdef void* __cuGraphBatchMemOpNodeGetParams = NULL +cdef void* __cuGraphBatchMemOpNodeSetParams = NULL +cdef void* __cuGraphExecBatchMemOpNodeSetParams = NULL +cdef void* __cuGraphAddMemAllocNode = NULL +cdef void* __cuGraphMemAllocNodeGetParams = NULL +cdef void* __cuGraphAddMemFreeNode = NULL +cdef void* __cuGraphMemFreeNodeGetParams = NULL +cdef void* __cuDeviceGraphMemTrim = NULL +cdef void* __cuDeviceGetGraphMemAttribute = NULL +cdef void* __cuDeviceSetGraphMemAttribute = NULL +cdef void* __cuGraphClone = NULL +cdef void* __cuGraphNodeFindInClone = NULL +cdef void* __cuGraphNodeGetType = NULL +cdef void* __cuGraphGetNodes = NULL +cdef void* __cuGraphGetRootNodes = NULL +cdef void* __cuGraphGetEdges_v2 = NULL +cdef void* __cuGraphNodeGetDependencies_v2 = NULL +cdef void* __cuGraphNodeGetDependentNodes_v2 = NULL +cdef void* __cuGraphAddDependencies_v2 = NULL +cdef void* __cuGraphRemoveDependencies_v2 = NULL +cdef void* __cuGraphDestroyNode = NULL +cdef void* __cuGraphInstantiateWithFlags = NULL +cdef void* __cuGraphInstantiateWithParams = NULL +cdef void* __cuGraphExecGetFlags = NULL +cdef void* __cuGraphExecKernelNodeSetParams_v2 = NULL +cdef void* __cuGraphExecMemcpyNodeSetParams = NULL +cdef void* __cuGraphExecMemsetNodeSetParams = NULL +cdef void* __cuGraphExecHostNodeSetParams = NULL +cdef void* __cuGraphExecChildGraphNodeSetParams = NULL +cdef void* __cuGraphExecEventRecordNodeSetEvent = NULL +cdef void* __cuGraphExecEventWaitNodeSetEvent = NULL +cdef void* __cuGraphExecExternalSemaphoresSignalNodeSetParams = NULL +cdef void* __cuGraphExecExternalSemaphoresWaitNodeSetParams = NULL +cdef void* __cuGraphNodeSetEnabled = NULL +cdef void* __cuGraphNodeGetEnabled = NULL +cdef void* __cuGraphUpload = NULL +cdef void* __cuGraphLaunch = NULL +cdef void* __cuGraphExecDestroy = NULL +cdef void* __cuGraphDestroy = NULL +cdef void* __cuGraphExecUpdate_v2 = NULL +cdef void* __cuGraphKernelNodeCopyAttributes = NULL +cdef void* __cuGraphKernelNodeGetAttribute = NULL +cdef void* __cuGraphKernelNodeSetAttribute = NULL +cdef void* __cuGraphDebugDotPrint = NULL +cdef void* __cuUserObjectCreate = NULL +cdef void* __cuUserObjectRetain = NULL +cdef void* __cuUserObjectRelease = NULL +cdef void* __cuGraphRetainUserObject = NULL +cdef void* __cuGraphReleaseUserObject = NULL +cdef void* __cuGraphAddNode_v2 = NULL +cdef void* __cuGraphNodeSetParams = NULL +cdef void* __cuGraphExecNodeSetParams = NULL +cdef void* __cuGraphConditionalHandleCreate = NULL +cdef void* __cuOccupancyMaxActiveBlocksPerMultiprocessor = NULL +cdef void* __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags = NULL +cdef void* __cuOccupancyMaxPotentialBlockSize = NULL +cdef void* __cuOccupancyMaxPotentialBlockSizeWithFlags = NULL +cdef void* __cuOccupancyAvailableDynamicSMemPerBlock = NULL +cdef void* __cuOccupancyMaxPotentialClusterSize = NULL +cdef void* __cuOccupancyMaxActiveClusters = NULL +cdef void* __cuTexRefSetArray = NULL +cdef void* __cuTexRefSetMipmappedArray = NULL +cdef void* __cuTexRefSetAddress_v2 = NULL +cdef void* __cuTexRefSetAddress2D_v3 = NULL +cdef void* __cuTexRefSetFormat = NULL +cdef void* __cuTexRefSetAddressMode = NULL +cdef void* __cuTexRefSetFilterMode = NULL +cdef void* __cuTexRefSetMipmapFilterMode = NULL +cdef void* __cuTexRefSetMipmapLevelBias = NULL +cdef void* __cuTexRefSetMipmapLevelClamp = NULL +cdef void* __cuTexRefSetMaxAnisotropy = NULL +cdef void* __cuTexRefSetBorderColor = NULL +cdef void* __cuTexRefSetFlags = NULL +cdef void* __cuTexRefGetAddress_v2 = NULL +cdef void* __cuTexRefGetArray = NULL +cdef void* __cuTexRefGetMipmappedArray = NULL +cdef void* __cuTexRefGetAddressMode = NULL +cdef void* __cuTexRefGetFilterMode = NULL +cdef void* __cuTexRefGetFormat = NULL +cdef void* __cuTexRefGetMipmapFilterMode = NULL +cdef void* __cuTexRefGetMipmapLevelBias = NULL +cdef void* __cuTexRefGetMipmapLevelClamp = NULL +cdef void* __cuTexRefGetMaxAnisotropy = NULL +cdef void* __cuTexRefGetBorderColor = NULL +cdef void* __cuTexRefGetFlags = NULL +cdef void* __cuTexRefCreate = NULL +cdef void* __cuTexRefDestroy = NULL +cdef void* __cuSurfRefSetArray = NULL +cdef void* __cuSurfRefGetArray = NULL +cdef void* __cuTexObjectCreate = NULL +cdef void* __cuTexObjectDestroy = NULL +cdef void* __cuTexObjectGetResourceDesc = NULL +cdef void* __cuTexObjectGetTextureDesc = NULL +cdef void* __cuTexObjectGetResourceViewDesc = NULL +cdef void* __cuSurfObjectCreate = NULL +cdef void* __cuSurfObjectDestroy = NULL +cdef void* __cuSurfObjectGetResourceDesc = NULL +cdef void* __cuTensorMapEncodeTiled = NULL +cdef void* __cuTensorMapEncodeIm2col = NULL +cdef void* __cuTensorMapEncodeIm2colWide = NULL +cdef void* __cuTensorMapReplaceAddress = NULL +cdef void* __cuDeviceCanAccessPeer = NULL +cdef void* __cuCtxEnablePeerAccess = NULL +cdef void* __cuCtxDisablePeerAccess = NULL +cdef void* __cuDeviceGetP2PAttribute = NULL +cdef void* __cuGraphicsUnregisterResource = NULL +cdef void* __cuGraphicsSubResourceGetMappedArray = NULL +cdef void* __cuGraphicsResourceGetMappedMipmappedArray = NULL +cdef void* __cuGraphicsResourceGetMappedPointer_v2 = NULL +cdef void* __cuGraphicsResourceSetMapFlags_v2 = NULL +cdef void* __cuGraphicsMapResources = NULL +cdef void* __cuGraphicsUnmapResources = NULL +cdef void* __cuGetProcAddress_v2 = NULL +cdef void* __cuCoredumpGetAttribute = NULL +cdef void* __cuCoredumpGetAttributeGlobal = NULL +cdef void* __cuCoredumpSetAttribute = NULL +cdef void* __cuCoredumpSetAttributeGlobal = NULL +cdef void* __cuGetExportTable = NULL +cdef void* __cuGreenCtxCreate = NULL +cdef void* __cuGreenCtxDestroy = NULL +cdef void* __cuCtxFromGreenCtx = NULL +cdef void* __cuDeviceGetDevResource = NULL +cdef void* __cuCtxGetDevResource = NULL +cdef void* __cuGreenCtxGetDevResource = NULL +cdef void* __cuDevSmResourceSplitByCount = NULL +cdef void* __cuDevResourceGenerateDesc = NULL +cdef void* __cuGreenCtxRecordEvent = NULL +cdef void* __cuGreenCtxWaitEvent = NULL +cdef void* __cuStreamGetGreenCtx = NULL +cdef void* __cuGreenCtxStreamCreate = NULL +cdef void* __cuLogsRegisterCallback = NULL +cdef void* __cuLogsUnregisterCallback = NULL +cdef void* __cuLogsCurrent = NULL +cdef void* __cuLogsDumpToFile = NULL +cdef void* __cuLogsDumpToMemory = NULL +cdef void* __cuCheckpointProcessGetRestoreThreadId = NULL +cdef void* __cuCheckpointProcessGetState = NULL +cdef void* __cuCheckpointProcessLock = NULL +cdef void* __cuCheckpointProcessCheckpoint = NULL +cdef void* __cuCheckpointProcessRestore = NULL +cdef void* __cuCheckpointProcessUnlock = NULL +cdef void* __cuGraphicsEGLRegisterImage = NULL +cdef void* __cuEGLStreamConsumerConnect = NULL +cdef void* __cuEGLStreamConsumerConnectWithFlags = NULL +cdef void* __cuEGLStreamConsumerDisconnect = NULL +cdef void* __cuEGLStreamConsumerAcquireFrame = NULL +cdef void* __cuEGLStreamConsumerReleaseFrame = NULL +cdef void* __cuEGLStreamProducerConnect = NULL +cdef void* __cuEGLStreamProducerDisconnect = NULL +cdef void* __cuEGLStreamProducerPresentFrame = NULL +cdef void* __cuEGLStreamProducerReturnFrame = NULL +cdef void* __cuGraphicsResourceGetMappedEglFrame = NULL +cdef void* __cuEventCreateFromEGLSync = NULL +cdef void* __cuGraphicsGLRegisterBuffer = NULL +cdef void* __cuGraphicsGLRegisterImage = NULL +cdef void* __cuGLGetDevices_v2 = NULL +cdef void* __cuGLCtxCreate_v2 = NULL +cdef void* __cuGLInit = NULL +cdef void* __cuGLRegisterBufferObject = NULL +cdef void* __cuGLMapBufferObject_v2 = NULL +cdef void* __cuGLUnmapBufferObject = NULL +cdef void* __cuGLUnregisterBufferObject = NULL +cdef void* __cuGLSetBufferObjectMapFlags = NULL +cdef void* __cuGLMapBufferObjectAsync_v2 = NULL +cdef void* __cuGLUnmapBufferObjectAsync = NULL +cdef void* __cuProfilerInitialize = NULL +cdef void* __cuProfilerStart = NULL +cdef void* __cuProfilerStop = NULL +cdef void* __cuVDPAUGetDevice = NULL +cdef void* __cuVDPAUCtxCreate_v2 = NULL +cdef void* __cuGraphicsVDPAURegisterVideoSurface = NULL +cdef void* __cuGraphicsVDPAURegisterOutputSurface = NULL +cdef void* __cuDeviceGetHostAtomicCapabilities = NULL +cdef void* __cuCtxGetDevice_v2 = NULL +cdef void* __cuCtxSynchronize_v2 = NULL +cdef void* __cuMemcpyBatchAsync_v2 = NULL +cdef void* __cuMemcpy3DBatchAsync_v2 = NULL +cdef void* __cuMemGetDefaultMemPool = NULL +cdef void* __cuMemGetMemPool = NULL +cdef void* __cuMemSetMemPool = NULL +cdef void* __cuMemPrefetchBatchAsync = NULL +cdef void* __cuMemDiscardBatchAsync = NULL +cdef void* __cuMemDiscardAndPrefetchBatchAsync = NULL +cdef void* __cuDeviceGetP2PAtomicCapabilities = NULL +cdef void* __cuGreenCtxGetId = NULL +cdef void* __cuMulticastBindMem_v2 = NULL +cdef void* __cuMulticastBindAddr_v2 = NULL +cdef void* __cuGraphNodeGetContainingGraph = NULL +cdef void* __cuGraphNodeGetLocalId = NULL +cdef void* __cuGraphNodeGetToolsId = NULL +cdef void* __cuGraphGetId = NULL +cdef void* __cuGraphExecGetId = NULL +cdef void* __cuDevSmResourceSplit = NULL +cdef void* __cuStreamGetDevResource = NULL +cdef void* __cuKernelGetParamCount = NULL +cdef void* __cuMemcpyWithAttributesAsync = NULL +cdef void* __cuMemcpy3DWithAttributesAsync = NULL +cdef void* __cuStreamBeginCaptureToCig = NULL +cdef void* __cuStreamEndCaptureToCig = NULL +cdef void* __cuFuncGetParamCount = NULL +cdef void* __cuLaunchHostFunc_v2 = NULL +cdef void* __cuGraphNodeGetParams = NULL +cdef void* __cuCoredumpRegisterStartCallback = NULL +cdef void* __cuCoredumpRegisterCompleteCallback = NULL +cdef void* __cuCoredumpDeregisterStartCallback = NULL +cdef void* __cuCoredumpDeregisterCompleteCallback = NULL +cdef void* __cuLogicalEndpointIdReserve = NULL +cdef void* __cuLogicalEndpointIdRelease = NULL +cdef void* __cuLogicalEndpointCreate = NULL +cdef void* __cuLogicalEndpointAddDevice = NULL +cdef void* __cuLogicalEndpointDestroy = NULL +cdef void* __cuLogicalEndpointBindAddr = NULL +cdef void* __cuLogicalEndpointBindMem = NULL +cdef void* __cuLogicalEndpointUnbind = NULL +cdef void* __cuLogicalEndpointExport = NULL +cdef void* __cuLogicalEndpointImport = NULL +cdef void* __cuLogicalEndpointGetLimits = NULL +cdef void* __cuLogicalEndpointQuery = NULL +cdef void* __cuStreamBeginRecaptureToGraph = NULL + + +cdef uintptr_t load_library() except* with gil: + cdef uintptr_t handle = load_nvidia_dynamic_lib("cuda")._handle_uint + return handle + + +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 _init_driver() except -1 nogil: + global __py_driver_init + + cdef uintptr_t handle = 0 + cdef int ptds_mode + + with gil, __symbol_lock: + # Recheck the flag after obtaining the locks + if __py_driver_init: + return 0 + + # Load library + handle = load_library() + if handle == 0: + raise RuntimeError('Failed to open cuda') + + # Get latest __cuGetProcAddress_v2 + global __cuGetProcAddress_v2 + __cuGetProcAddress_v2 = GetProcAddress(handle, 'cuGetProcAddress_v2') + if __cuGetProcAddress_v2 == NULL: + raise RuntimeError("Failed to get __cuGetProcAddress_v2") + _F_cuGetProcAddress_v2 = <__cuGetProcAddress_v2_T>__cuGetProcAddress_v2 + + if bool(int(os.getenv('CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM', default=0))): + ptds_mode = CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM + else: + ptds_mode = CU_GET_PROC_ADDRESS_DEFAULT + + # Load function + global __cuGetErrorString + _F_cuGetProcAddress_v2('cuGetErrorString', &__cuGetErrorString, 6000, ptds_mode, NULL) + + global __cuGetErrorName + _F_cuGetProcAddress_v2('cuGetErrorName', &__cuGetErrorName, 6000, ptds_mode, NULL) + + global __cuInit + _F_cuGetProcAddress_v2('cuInit', &__cuInit, 2000, ptds_mode, NULL) + + global __cuDriverGetVersion + _F_cuGetProcAddress_v2('cuDriverGetVersion', &__cuDriverGetVersion, 2020, ptds_mode, NULL) + + global __cuDeviceGet + _F_cuGetProcAddress_v2('cuDeviceGet', &__cuDeviceGet, 2000, ptds_mode, NULL) + + global __cuDeviceGetCount + _F_cuGetProcAddress_v2('cuDeviceGetCount', &__cuDeviceGetCount, 2000, ptds_mode, NULL) + + global __cuDeviceGetName + _F_cuGetProcAddress_v2('cuDeviceGetName', &__cuDeviceGetName, 2000, ptds_mode, NULL) + + global __cuDeviceGetUuid_v2 + _F_cuGetProcAddress_v2('cuDeviceGetUuid', &__cuDeviceGetUuid_v2, 11040, ptds_mode, NULL) + + global __cuDeviceGetLuid + _F_cuGetProcAddress_v2('cuDeviceGetLuid', &__cuDeviceGetLuid, 10000, ptds_mode, NULL) + + global __cuDeviceTotalMem_v2 + _F_cuGetProcAddress_v2('cuDeviceTotalMem', &__cuDeviceTotalMem_v2, 3020, ptds_mode, NULL) + + global __cuDeviceGetTexture1DLinearMaxWidth + _F_cuGetProcAddress_v2('cuDeviceGetTexture1DLinearMaxWidth', &__cuDeviceGetTexture1DLinearMaxWidth, 11010, ptds_mode, NULL) + + global __cuDeviceGetAttribute + _F_cuGetProcAddress_v2('cuDeviceGetAttribute', &__cuDeviceGetAttribute, 2000, ptds_mode, NULL) + + global __cuDeviceGetNvSciSyncAttributes + _F_cuGetProcAddress_v2('cuDeviceGetNvSciSyncAttributes', &__cuDeviceGetNvSciSyncAttributes, 10020, ptds_mode, NULL) + + global __cuDeviceSetMemPool + _F_cuGetProcAddress_v2('cuDeviceSetMemPool', &__cuDeviceSetMemPool, 11020, ptds_mode, NULL) + + global __cuDeviceGetMemPool + _F_cuGetProcAddress_v2('cuDeviceGetMemPool', &__cuDeviceGetMemPool, 11020, ptds_mode, NULL) + + global __cuDeviceGetDefaultMemPool + _F_cuGetProcAddress_v2('cuDeviceGetDefaultMemPool', &__cuDeviceGetDefaultMemPool, 11020, ptds_mode, NULL) + + global __cuDeviceGetExecAffinitySupport + _F_cuGetProcAddress_v2('cuDeviceGetExecAffinitySupport', &__cuDeviceGetExecAffinitySupport, 11040, ptds_mode, NULL) + + global __cuFlushGPUDirectRDMAWrites + _F_cuGetProcAddress_v2('cuFlushGPUDirectRDMAWrites', &__cuFlushGPUDirectRDMAWrites, 11030, ptds_mode, NULL) + + global __cuDeviceGetProperties + _F_cuGetProcAddress_v2('cuDeviceGetProperties', &__cuDeviceGetProperties, 2000, ptds_mode, NULL) + + global __cuDeviceComputeCapability + _F_cuGetProcAddress_v2('cuDeviceComputeCapability', &__cuDeviceComputeCapability, 2000, ptds_mode, NULL) + + global __cuDevicePrimaryCtxRetain + _F_cuGetProcAddress_v2('cuDevicePrimaryCtxRetain', &__cuDevicePrimaryCtxRetain, 7000, ptds_mode, NULL) + + global __cuDevicePrimaryCtxRelease_v2 + _F_cuGetProcAddress_v2('cuDevicePrimaryCtxRelease', &__cuDevicePrimaryCtxRelease_v2, 11000, ptds_mode, NULL) + + global __cuDevicePrimaryCtxSetFlags_v2 + _F_cuGetProcAddress_v2('cuDevicePrimaryCtxSetFlags', &__cuDevicePrimaryCtxSetFlags_v2, 11000, ptds_mode, NULL) + + global __cuDevicePrimaryCtxGetState + _F_cuGetProcAddress_v2('cuDevicePrimaryCtxGetState', &__cuDevicePrimaryCtxGetState, 7000, ptds_mode, NULL) + + global __cuDevicePrimaryCtxReset_v2 + _F_cuGetProcAddress_v2('cuDevicePrimaryCtxReset', &__cuDevicePrimaryCtxReset_v2, 11000, ptds_mode, NULL) + + global __cuCtxCreate_v2 + _F_cuGetProcAddress_v2('cuCtxCreate', &__cuCtxCreate_v2, 3020, ptds_mode, NULL) + + global __cuCtxCreate_v3 + _F_cuGetProcAddress_v2('cuCtxCreate', &__cuCtxCreate_v3, 11040, ptds_mode, NULL) + + global __cuCtxCreate_v4 + _F_cuGetProcAddress_v2('cuCtxCreate', &__cuCtxCreate_v4, 12050, ptds_mode, NULL) + + global __cuCtxDestroy_v2 + _F_cuGetProcAddress_v2('cuCtxDestroy', &__cuCtxDestroy_v2, 4000, ptds_mode, NULL) + + global __cuCtxPushCurrent_v2 + _F_cuGetProcAddress_v2('cuCtxPushCurrent', &__cuCtxPushCurrent_v2, 4000, ptds_mode, NULL) + + global __cuCtxPopCurrent_v2 + _F_cuGetProcAddress_v2('cuCtxPopCurrent', &__cuCtxPopCurrent_v2, 4000, ptds_mode, NULL) + + global __cuCtxSetCurrent + _F_cuGetProcAddress_v2('cuCtxSetCurrent', &__cuCtxSetCurrent, 4000, ptds_mode, NULL) + + global __cuCtxGetCurrent + _F_cuGetProcAddress_v2('cuCtxGetCurrent', &__cuCtxGetCurrent, 4000, ptds_mode, NULL) + + global __cuCtxGetDevice + _F_cuGetProcAddress_v2('cuCtxGetDevice', &__cuCtxGetDevice, 2000, ptds_mode, NULL) + + global __cuCtxGetFlags + _F_cuGetProcAddress_v2('cuCtxGetFlags', &__cuCtxGetFlags, 7000, ptds_mode, NULL) + + global __cuCtxSetFlags + _F_cuGetProcAddress_v2('cuCtxSetFlags', &__cuCtxSetFlags, 12010, ptds_mode, NULL) + + global __cuCtxGetId + _F_cuGetProcAddress_v2('cuCtxGetId', &__cuCtxGetId, 12000, ptds_mode, NULL) + + global __cuCtxSynchronize + _F_cuGetProcAddress_v2('cuCtxSynchronize', &__cuCtxSynchronize, 2000, ptds_mode, NULL) + + global __cuCtxSetLimit + _F_cuGetProcAddress_v2('cuCtxSetLimit', &__cuCtxSetLimit, 3010, ptds_mode, NULL) + + global __cuCtxGetLimit + _F_cuGetProcAddress_v2('cuCtxGetLimit', &__cuCtxGetLimit, 3010, ptds_mode, NULL) + + global __cuCtxGetCacheConfig + _F_cuGetProcAddress_v2('cuCtxGetCacheConfig', &__cuCtxGetCacheConfig, 3020, ptds_mode, NULL) + + global __cuCtxSetCacheConfig + _F_cuGetProcAddress_v2('cuCtxSetCacheConfig', &__cuCtxSetCacheConfig, 3020, ptds_mode, NULL) + + global __cuCtxGetApiVersion + _F_cuGetProcAddress_v2('cuCtxGetApiVersion', &__cuCtxGetApiVersion, 3020, ptds_mode, NULL) + + global __cuCtxGetStreamPriorityRange + _F_cuGetProcAddress_v2('cuCtxGetStreamPriorityRange', &__cuCtxGetStreamPriorityRange, 5050, ptds_mode, NULL) + + global __cuCtxResetPersistingL2Cache + _F_cuGetProcAddress_v2('cuCtxResetPersistingL2Cache', &__cuCtxResetPersistingL2Cache, 11000, ptds_mode, NULL) + + global __cuCtxGetExecAffinity + _F_cuGetProcAddress_v2('cuCtxGetExecAffinity', &__cuCtxGetExecAffinity, 11040, ptds_mode, NULL) + + global __cuCtxRecordEvent + _F_cuGetProcAddress_v2('cuCtxRecordEvent', &__cuCtxRecordEvent, 12050, ptds_mode, NULL) + + global __cuCtxWaitEvent + _F_cuGetProcAddress_v2('cuCtxWaitEvent', &__cuCtxWaitEvent, 12050, ptds_mode, NULL) + + global __cuCtxAttach + _F_cuGetProcAddress_v2('cuCtxAttach', &__cuCtxAttach, 2000, ptds_mode, NULL) + + global __cuCtxDetach + _F_cuGetProcAddress_v2('cuCtxDetach', &__cuCtxDetach, 2000, ptds_mode, NULL) + + global __cuCtxGetSharedMemConfig + _F_cuGetProcAddress_v2('cuCtxGetSharedMemConfig', &__cuCtxGetSharedMemConfig, 4020, ptds_mode, NULL) + + global __cuCtxSetSharedMemConfig + _F_cuGetProcAddress_v2('cuCtxSetSharedMemConfig', &__cuCtxSetSharedMemConfig, 4020, ptds_mode, NULL) + + global __cuModuleLoad + _F_cuGetProcAddress_v2('cuModuleLoad', &__cuModuleLoad, 2000, ptds_mode, NULL) + + global __cuModuleLoadData + _F_cuGetProcAddress_v2('cuModuleLoadData', &__cuModuleLoadData, 2000, ptds_mode, NULL) + + global __cuModuleLoadDataEx + _F_cuGetProcAddress_v2('cuModuleLoadDataEx', &__cuModuleLoadDataEx, 2010, ptds_mode, NULL) + + global __cuModuleLoadFatBinary + _F_cuGetProcAddress_v2('cuModuleLoadFatBinary', &__cuModuleLoadFatBinary, 2000, ptds_mode, NULL) + + global __cuModuleUnload + _F_cuGetProcAddress_v2('cuModuleUnload', &__cuModuleUnload, 2000, ptds_mode, NULL) + + global __cuModuleGetLoadingMode + _F_cuGetProcAddress_v2('cuModuleGetLoadingMode', &__cuModuleGetLoadingMode, 11070, ptds_mode, NULL) + + global __cuModuleGetFunction + _F_cuGetProcAddress_v2('cuModuleGetFunction', &__cuModuleGetFunction, 2000, ptds_mode, NULL) + + global __cuModuleGetFunctionCount + _F_cuGetProcAddress_v2('cuModuleGetFunctionCount', &__cuModuleGetFunctionCount, 12040, ptds_mode, NULL) + + global __cuModuleEnumerateFunctions + _F_cuGetProcAddress_v2('cuModuleEnumerateFunctions', &__cuModuleEnumerateFunctions, 12040, ptds_mode, NULL) + + global __cuModuleGetGlobal_v2 + _F_cuGetProcAddress_v2('cuModuleGetGlobal', &__cuModuleGetGlobal_v2, 3020, ptds_mode, NULL) + + global __cuLinkCreate_v2 + _F_cuGetProcAddress_v2('cuLinkCreate', &__cuLinkCreate_v2, 6050, ptds_mode, NULL) + + global __cuLinkAddData_v2 + _F_cuGetProcAddress_v2('cuLinkAddData', &__cuLinkAddData_v2, 6050, ptds_mode, NULL) + + global __cuLinkAddFile_v2 + _F_cuGetProcAddress_v2('cuLinkAddFile', &__cuLinkAddFile_v2, 6050, ptds_mode, NULL) + + global __cuLinkComplete + _F_cuGetProcAddress_v2('cuLinkComplete', &__cuLinkComplete, 5050, ptds_mode, NULL) + + global __cuLinkDestroy + _F_cuGetProcAddress_v2('cuLinkDestroy', &__cuLinkDestroy, 5050, ptds_mode, NULL) + + global __cuModuleGetTexRef + _F_cuGetProcAddress_v2('cuModuleGetTexRef', &__cuModuleGetTexRef, 2000, ptds_mode, NULL) + + global __cuModuleGetSurfRef + _F_cuGetProcAddress_v2('cuModuleGetSurfRef', &__cuModuleGetSurfRef, 3000, ptds_mode, NULL) + + global __cuLibraryLoadData + _F_cuGetProcAddress_v2('cuLibraryLoadData', &__cuLibraryLoadData, 12000, ptds_mode, NULL) + + global __cuLibraryLoadFromFile + _F_cuGetProcAddress_v2('cuLibraryLoadFromFile', &__cuLibraryLoadFromFile, 12000, ptds_mode, NULL) + + global __cuLibraryUnload + _F_cuGetProcAddress_v2('cuLibraryUnload', &__cuLibraryUnload, 12000, ptds_mode, NULL) + + global __cuLibraryGetKernel + _F_cuGetProcAddress_v2('cuLibraryGetKernel', &__cuLibraryGetKernel, 12000, ptds_mode, NULL) + + global __cuLibraryGetKernelCount + _F_cuGetProcAddress_v2('cuLibraryGetKernelCount', &__cuLibraryGetKernelCount, 12040, ptds_mode, NULL) + + global __cuLibraryEnumerateKernels + _F_cuGetProcAddress_v2('cuLibraryEnumerateKernels', &__cuLibraryEnumerateKernels, 12040, ptds_mode, NULL) + + global __cuLibraryGetModule + _F_cuGetProcAddress_v2('cuLibraryGetModule', &__cuLibraryGetModule, 12000, ptds_mode, NULL) + + global __cuKernelGetFunction + _F_cuGetProcAddress_v2('cuKernelGetFunction', &__cuKernelGetFunction, 12000, ptds_mode, NULL) + + global __cuKernelGetLibrary + _F_cuGetProcAddress_v2('cuKernelGetLibrary', &__cuKernelGetLibrary, 12050, ptds_mode, NULL) + + global __cuLibraryGetGlobal + _F_cuGetProcAddress_v2('cuLibraryGetGlobal', &__cuLibraryGetGlobal, 12000, ptds_mode, NULL) + + global __cuLibraryGetManaged + _F_cuGetProcAddress_v2('cuLibraryGetManaged', &__cuLibraryGetManaged, 12000, ptds_mode, NULL) + + global __cuLibraryGetUnifiedFunction + _F_cuGetProcAddress_v2('cuLibraryGetUnifiedFunction', &__cuLibraryGetUnifiedFunction, 12000, ptds_mode, NULL) + + global __cuKernelGetAttribute + _F_cuGetProcAddress_v2('cuKernelGetAttribute', &__cuKernelGetAttribute, 12000, ptds_mode, NULL) + + global __cuKernelSetAttribute + _F_cuGetProcAddress_v2('cuKernelSetAttribute', &__cuKernelSetAttribute, 12000, ptds_mode, NULL) + + global __cuKernelSetCacheConfig + _F_cuGetProcAddress_v2('cuKernelSetCacheConfig', &__cuKernelSetCacheConfig, 12000, ptds_mode, NULL) + + global __cuKernelGetName + _F_cuGetProcAddress_v2('cuKernelGetName', &__cuKernelGetName, 12030, ptds_mode, NULL) + + global __cuKernelGetParamInfo + _F_cuGetProcAddress_v2('cuKernelGetParamInfo', &__cuKernelGetParamInfo, 12040, ptds_mode, NULL) + + global __cuMemGetInfo_v2 + _F_cuGetProcAddress_v2('cuMemGetInfo', &__cuMemGetInfo_v2, 3020, ptds_mode, NULL) + + global __cuMemAlloc_v2 + _F_cuGetProcAddress_v2('cuMemAlloc', &__cuMemAlloc_v2, 3020, ptds_mode, NULL) + + global __cuMemAllocPitch_v2 + _F_cuGetProcAddress_v2('cuMemAllocPitch', &__cuMemAllocPitch_v2, 3020, ptds_mode, NULL) + + global __cuMemFree_v2 + _F_cuGetProcAddress_v2('cuMemFree', &__cuMemFree_v2, 3020, ptds_mode, NULL) + + global __cuMemGetAddressRange_v2 + _F_cuGetProcAddress_v2('cuMemGetAddressRange', &__cuMemGetAddressRange_v2, 3020, ptds_mode, NULL) + + global __cuMemAllocHost_v2 + _F_cuGetProcAddress_v2('cuMemAllocHost', &__cuMemAllocHost_v2, 3020, ptds_mode, NULL) + + global __cuMemFreeHost + _F_cuGetProcAddress_v2('cuMemFreeHost', &__cuMemFreeHost, 2000, ptds_mode, NULL) + + global __cuMemHostAlloc + _F_cuGetProcAddress_v2('cuMemHostAlloc', &__cuMemHostAlloc, 2020, ptds_mode, NULL) + + global __cuMemHostGetDevicePointer_v2 + _F_cuGetProcAddress_v2('cuMemHostGetDevicePointer', &__cuMemHostGetDevicePointer_v2, 3020, ptds_mode, NULL) + + global __cuMemHostGetFlags + _F_cuGetProcAddress_v2('cuMemHostGetFlags', &__cuMemHostGetFlags, 2030, ptds_mode, NULL) + + global __cuMemAllocManaged + _F_cuGetProcAddress_v2('cuMemAllocManaged', &__cuMemAllocManaged, 6000, ptds_mode, NULL) + + global __cuDeviceRegisterAsyncNotification + _F_cuGetProcAddress_v2('cuDeviceRegisterAsyncNotification', &__cuDeviceRegisterAsyncNotification, 12040, ptds_mode, NULL) + + global __cuDeviceUnregisterAsyncNotification + _F_cuGetProcAddress_v2('cuDeviceUnregisterAsyncNotification', &__cuDeviceUnregisterAsyncNotification, 12040, ptds_mode, NULL) + + global __cuDeviceGetByPCIBusId + _F_cuGetProcAddress_v2('cuDeviceGetByPCIBusId', &__cuDeviceGetByPCIBusId, 4010, ptds_mode, NULL) + + global __cuDeviceGetPCIBusId + _F_cuGetProcAddress_v2('cuDeviceGetPCIBusId', &__cuDeviceGetPCIBusId, 4010, ptds_mode, NULL) + + global __cuIpcGetEventHandle + _F_cuGetProcAddress_v2('cuIpcGetEventHandle', &__cuIpcGetEventHandle, 4010, ptds_mode, NULL) + + global __cuIpcOpenEventHandle + _F_cuGetProcAddress_v2('cuIpcOpenEventHandle', &__cuIpcOpenEventHandle, 4010, ptds_mode, NULL) + + global __cuIpcGetMemHandle + _F_cuGetProcAddress_v2('cuIpcGetMemHandle', &__cuIpcGetMemHandle, 4010, ptds_mode, NULL) + + global __cuIpcOpenMemHandle_v2 + _F_cuGetProcAddress_v2('cuIpcOpenMemHandle', &__cuIpcOpenMemHandle_v2, 11000, ptds_mode, NULL) + + global __cuIpcCloseMemHandle + _F_cuGetProcAddress_v2('cuIpcCloseMemHandle', &__cuIpcCloseMemHandle, 4010, ptds_mode, NULL) + + global __cuMemHostRegister_v2 + _F_cuGetProcAddress_v2('cuMemHostRegister', &__cuMemHostRegister_v2, 6050, ptds_mode, NULL) + + global __cuMemHostUnregister + _F_cuGetProcAddress_v2('cuMemHostUnregister', &__cuMemHostUnregister, 4000, ptds_mode, NULL) + + global __cuMemcpy + _F_cuGetProcAddress_v2('cuMemcpy', &__cuMemcpy, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuMemcpyPeer + _F_cuGetProcAddress_v2('cuMemcpyPeer', &__cuMemcpyPeer, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuMemcpyHtoD_v2 + _F_cuGetProcAddress_v2('cuMemcpyHtoD', &__cuMemcpyHtoD_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyDtoH_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoH', &__cuMemcpyDtoH_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyDtoD_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoD', &__cuMemcpyDtoD_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyDtoA_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoA', &__cuMemcpyDtoA_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyAtoD_v2 + _F_cuGetProcAddress_v2('cuMemcpyAtoD', &__cuMemcpyAtoD_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyHtoA_v2 + _F_cuGetProcAddress_v2('cuMemcpyHtoA', &__cuMemcpyHtoA_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyAtoH_v2 + _F_cuGetProcAddress_v2('cuMemcpyAtoH', &__cuMemcpyAtoH_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyAtoA_v2 + _F_cuGetProcAddress_v2('cuMemcpyAtoA', &__cuMemcpyAtoA_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpy2D_v2 + _F_cuGetProcAddress_v2('cuMemcpy2D', &__cuMemcpy2D_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpy2DUnaligned_v2 + _F_cuGetProcAddress_v2('cuMemcpy2DUnaligned', &__cuMemcpy2DUnaligned_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpy3D_v2 + _F_cuGetProcAddress_v2('cuMemcpy3D', &__cuMemcpy3D_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpy3DPeer + _F_cuGetProcAddress_v2('cuMemcpy3DPeer', &__cuMemcpy3DPeer, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuMemcpyAsync + _F_cuGetProcAddress_v2('cuMemcpyAsync', &__cuMemcpyAsync, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuMemcpyPeerAsync + _F_cuGetProcAddress_v2('cuMemcpyPeerAsync', &__cuMemcpyPeerAsync, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuMemcpyHtoDAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyHtoDAsync', &__cuMemcpyHtoDAsync_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyDtoHAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoHAsync', &__cuMemcpyDtoHAsync_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyDtoDAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoDAsync', &__cuMemcpyDtoDAsync_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyHtoAAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyHtoAAsync', &__cuMemcpyHtoAAsync_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpyAtoHAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyAtoHAsync', &__cuMemcpyAtoHAsync_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpy2DAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpy2DAsync', &__cuMemcpy2DAsync_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpy3DAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpy3DAsync', &__cuMemcpy3DAsync_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemcpy3DPeerAsync + _F_cuGetProcAddress_v2('cuMemcpy3DPeerAsync', &__cuMemcpy3DPeerAsync, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuMemsetD8_v2 + _F_cuGetProcAddress_v2('cuMemsetD8', &__cuMemsetD8_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD16_v2 + _F_cuGetProcAddress_v2('cuMemsetD16', &__cuMemsetD16_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD32_v2 + _F_cuGetProcAddress_v2('cuMemsetD32', &__cuMemsetD32_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD2D8_v2 + _F_cuGetProcAddress_v2('cuMemsetD2D8', &__cuMemsetD2D8_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD2D16_v2 + _F_cuGetProcAddress_v2('cuMemsetD2D16', &__cuMemsetD2D16_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD2D32_v2 + _F_cuGetProcAddress_v2('cuMemsetD2D32', &__cuMemsetD2D32_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD8Async + _F_cuGetProcAddress_v2('cuMemsetD8Async', &__cuMemsetD8Async, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD16Async + _F_cuGetProcAddress_v2('cuMemsetD16Async', &__cuMemsetD16Async, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD32Async + _F_cuGetProcAddress_v2('cuMemsetD32Async', &__cuMemsetD32Async, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD2D8Async + _F_cuGetProcAddress_v2('cuMemsetD2D8Async', &__cuMemsetD2D8Async, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD2D16Async + _F_cuGetProcAddress_v2('cuMemsetD2D16Async', &__cuMemsetD2D16Async, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuMemsetD2D32Async + _F_cuGetProcAddress_v2('cuMemsetD2D32Async', &__cuMemsetD2D32Async, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuArrayCreate_v2 + _F_cuGetProcAddress_v2('cuArrayCreate', &__cuArrayCreate_v2, 3020, ptds_mode, NULL) + + global __cuArrayGetDescriptor_v2 + _F_cuGetProcAddress_v2('cuArrayGetDescriptor', &__cuArrayGetDescriptor_v2, 3020, ptds_mode, NULL) + + global __cuArrayGetSparseProperties + _F_cuGetProcAddress_v2('cuArrayGetSparseProperties', &__cuArrayGetSparseProperties, 11010, ptds_mode, NULL) + + global __cuMipmappedArrayGetSparseProperties + _F_cuGetProcAddress_v2('cuMipmappedArrayGetSparseProperties', &__cuMipmappedArrayGetSparseProperties, 11010, ptds_mode, NULL) + + global __cuArrayGetMemoryRequirements + _F_cuGetProcAddress_v2('cuArrayGetMemoryRequirements', &__cuArrayGetMemoryRequirements, 11060, ptds_mode, NULL) + + global __cuMipmappedArrayGetMemoryRequirements + _F_cuGetProcAddress_v2('cuMipmappedArrayGetMemoryRequirements', &__cuMipmappedArrayGetMemoryRequirements, 11060, ptds_mode, NULL) + + global __cuArrayGetPlane + _F_cuGetProcAddress_v2('cuArrayGetPlane', &__cuArrayGetPlane, 11020, ptds_mode, NULL) + + global __cuArrayDestroy + _F_cuGetProcAddress_v2('cuArrayDestroy', &__cuArrayDestroy, 2000, ptds_mode, NULL) + + global __cuArray3DCreate_v2 + _F_cuGetProcAddress_v2('cuArray3DCreate', &__cuArray3DCreate_v2, 3020, ptds_mode, NULL) + + global __cuArray3DGetDescriptor_v2 + _F_cuGetProcAddress_v2('cuArray3DGetDescriptor', &__cuArray3DGetDescriptor_v2, 3020, ptds_mode, NULL) + + global __cuMipmappedArrayCreate + _F_cuGetProcAddress_v2('cuMipmappedArrayCreate', &__cuMipmappedArrayCreate, 5000, ptds_mode, NULL) + + global __cuMipmappedArrayGetLevel + _F_cuGetProcAddress_v2('cuMipmappedArrayGetLevel', &__cuMipmappedArrayGetLevel, 5000, ptds_mode, NULL) + + global __cuMipmappedArrayDestroy + _F_cuGetProcAddress_v2('cuMipmappedArrayDestroy', &__cuMipmappedArrayDestroy, 5000, ptds_mode, NULL) + + global __cuMemGetHandleForAddressRange + _F_cuGetProcAddress_v2('cuMemGetHandleForAddressRange', &__cuMemGetHandleForAddressRange, 11070, ptds_mode, NULL) + + global __cuMemBatchDecompressAsync + _F_cuGetProcAddress_v2('cuMemBatchDecompressAsync', &__cuMemBatchDecompressAsync, 12060, ptds_mode, NULL) + + global __cuMemAddressReserve + _F_cuGetProcAddress_v2('cuMemAddressReserve', &__cuMemAddressReserve, 10020, ptds_mode, NULL) + + global __cuMemAddressFree + _F_cuGetProcAddress_v2('cuMemAddressFree', &__cuMemAddressFree, 10020, ptds_mode, NULL) + + global __cuMemCreate + _F_cuGetProcAddress_v2('cuMemCreate', &__cuMemCreate, 10020, ptds_mode, NULL) + + global __cuMemRelease + _F_cuGetProcAddress_v2('cuMemRelease', &__cuMemRelease, 10020, ptds_mode, NULL) + + global __cuMemMap + _F_cuGetProcAddress_v2('cuMemMap', &__cuMemMap, 10020, ptds_mode, NULL) + + global __cuMemMapArrayAsync + _F_cuGetProcAddress_v2('cuMemMapArrayAsync', &__cuMemMapArrayAsync, 11010, ptds_mode, NULL) + + global __cuMemUnmap + _F_cuGetProcAddress_v2('cuMemUnmap', &__cuMemUnmap, 10020, ptds_mode, NULL) + + global __cuMemSetAccess + _F_cuGetProcAddress_v2('cuMemSetAccess', &__cuMemSetAccess, 10020, ptds_mode, NULL) + + global __cuMemGetAccess + _F_cuGetProcAddress_v2('cuMemGetAccess', &__cuMemGetAccess, 10020, ptds_mode, NULL) + + global __cuMemExportToShareableHandle + _F_cuGetProcAddress_v2('cuMemExportToShareableHandle', &__cuMemExportToShareableHandle, 10020, ptds_mode, NULL) + + global __cuMemImportFromShareableHandle + _F_cuGetProcAddress_v2('cuMemImportFromShareableHandle', &__cuMemImportFromShareableHandle, 10020, ptds_mode, NULL) + + global __cuMemGetAllocationGranularity + _F_cuGetProcAddress_v2('cuMemGetAllocationGranularity', &__cuMemGetAllocationGranularity, 10020, ptds_mode, NULL) + + global __cuMemGetAllocationPropertiesFromHandle + _F_cuGetProcAddress_v2('cuMemGetAllocationPropertiesFromHandle', &__cuMemGetAllocationPropertiesFromHandle, 10020, ptds_mode, NULL) + + global __cuMemRetainAllocationHandle + _F_cuGetProcAddress_v2('cuMemRetainAllocationHandle', &__cuMemRetainAllocationHandle, 11000, ptds_mode, NULL) + + global __cuMemFreeAsync + _F_cuGetProcAddress_v2('cuMemFreeAsync', &__cuMemFreeAsync, 11020, ptds_mode, NULL) + + global __cuMemAllocAsync + _F_cuGetProcAddress_v2('cuMemAllocAsync', &__cuMemAllocAsync, 11020, ptds_mode, NULL) + + global __cuMemPoolTrimTo + _F_cuGetProcAddress_v2('cuMemPoolTrimTo', &__cuMemPoolTrimTo, 11020, ptds_mode, NULL) + + global __cuMemPoolSetAttribute + _F_cuGetProcAddress_v2('cuMemPoolSetAttribute', &__cuMemPoolSetAttribute, 11020, ptds_mode, NULL) + + global __cuMemPoolGetAttribute + _F_cuGetProcAddress_v2('cuMemPoolGetAttribute', &__cuMemPoolGetAttribute, 11020, ptds_mode, NULL) + + global __cuMemPoolSetAccess + _F_cuGetProcAddress_v2('cuMemPoolSetAccess', &__cuMemPoolSetAccess, 11020, ptds_mode, NULL) + + global __cuMemPoolGetAccess + _F_cuGetProcAddress_v2('cuMemPoolGetAccess', &__cuMemPoolGetAccess, 11020, ptds_mode, NULL) + + global __cuMemPoolCreate + _F_cuGetProcAddress_v2('cuMemPoolCreate', &__cuMemPoolCreate, 11020, ptds_mode, NULL) + + global __cuMemPoolDestroy + _F_cuGetProcAddress_v2('cuMemPoolDestroy', &__cuMemPoolDestroy, 11020, ptds_mode, NULL) + + global __cuMemAllocFromPoolAsync + _F_cuGetProcAddress_v2('cuMemAllocFromPoolAsync', &__cuMemAllocFromPoolAsync, 11020, ptds_mode, NULL) + + global __cuMemPoolExportToShareableHandle + _F_cuGetProcAddress_v2('cuMemPoolExportToShareableHandle', &__cuMemPoolExportToShareableHandle, 11020, ptds_mode, NULL) + + global __cuMemPoolImportFromShareableHandle + _F_cuGetProcAddress_v2('cuMemPoolImportFromShareableHandle', &__cuMemPoolImportFromShareableHandle, 11020, ptds_mode, NULL) + + global __cuMemPoolExportPointer + _F_cuGetProcAddress_v2('cuMemPoolExportPointer', &__cuMemPoolExportPointer, 11020, ptds_mode, NULL) + + global __cuMemPoolImportPointer + _F_cuGetProcAddress_v2('cuMemPoolImportPointer', &__cuMemPoolImportPointer, 11020, ptds_mode, NULL) + + global __cuMulticastCreate + _F_cuGetProcAddress_v2('cuMulticastCreate', &__cuMulticastCreate, 12010, ptds_mode, NULL) + + global __cuMulticastAddDevice + _F_cuGetProcAddress_v2('cuMulticastAddDevice', &__cuMulticastAddDevice, 12010, ptds_mode, NULL) + + global __cuMulticastBindMem + _F_cuGetProcAddress_v2('cuMulticastBindMem', &__cuMulticastBindMem, 12010, ptds_mode, NULL) + + global __cuMulticastBindAddr + _F_cuGetProcAddress_v2('cuMulticastBindAddr', &__cuMulticastBindAddr, 12010, ptds_mode, NULL) + + global __cuMulticastUnbind + _F_cuGetProcAddress_v2('cuMulticastUnbind', &__cuMulticastUnbind, 12010, ptds_mode, NULL) + + global __cuMulticastGetGranularity + _F_cuGetProcAddress_v2('cuMulticastGetGranularity', &__cuMulticastGetGranularity, 12010, ptds_mode, NULL) + + global __cuPointerGetAttribute + _F_cuGetProcAddress_v2('cuPointerGetAttribute', &__cuPointerGetAttribute, 4000, ptds_mode, NULL) + + global __cuMemPrefetchAsync_v2 + _F_cuGetProcAddress_v2('cuMemPrefetchAsync', &__cuMemPrefetchAsync_v2, 12020, ptds_mode, NULL) + + global __cuMemAdvise_v2 + _F_cuGetProcAddress_v2('cuMemAdvise', &__cuMemAdvise_v2, 12020, ptds_mode, NULL) + + global __cuMemRangeGetAttribute + _F_cuGetProcAddress_v2('cuMemRangeGetAttribute', &__cuMemRangeGetAttribute, 8000, ptds_mode, NULL) + + global __cuMemRangeGetAttributes + _F_cuGetProcAddress_v2('cuMemRangeGetAttributes', &__cuMemRangeGetAttributes, 8000, ptds_mode, NULL) + + global __cuPointerSetAttribute + _F_cuGetProcAddress_v2('cuPointerSetAttribute', &__cuPointerSetAttribute, 6000, ptds_mode, NULL) + + global __cuPointerGetAttributes + _F_cuGetProcAddress_v2('cuPointerGetAttributes', &__cuPointerGetAttributes, 7000, ptds_mode, NULL) + + global __cuStreamCreate + _F_cuGetProcAddress_v2('cuStreamCreate', &__cuStreamCreate, 2000, ptds_mode, NULL) + + global __cuStreamCreateWithPriority + _F_cuGetProcAddress_v2('cuStreamCreateWithPriority', &__cuStreamCreateWithPriority, 5050, ptds_mode, NULL) + + global __cuStreamGetPriority + _F_cuGetProcAddress_v2('cuStreamGetPriority', &__cuStreamGetPriority, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 5050, ptds_mode, NULL) + + global __cuStreamGetDevice + _F_cuGetProcAddress_v2('cuStreamGetDevice', &__cuStreamGetDevice, 12080, ptds_mode, NULL) + + global __cuStreamGetFlags + _F_cuGetProcAddress_v2('cuStreamGetFlags', &__cuStreamGetFlags, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 5050, ptds_mode, NULL) + + global __cuStreamGetId + _F_cuGetProcAddress_v2('cuStreamGetId', &__cuStreamGetId, 12000, ptds_mode, NULL) + + global __cuStreamGetCtx + _F_cuGetProcAddress_v2('cuStreamGetCtx', &__cuStreamGetCtx, 9020, ptds_mode, NULL) + + global __cuStreamGetCtx_v2 + _F_cuGetProcAddress_v2('cuStreamGetCtx', &__cuStreamGetCtx_v2, 12050, ptds_mode, NULL) + + global __cuStreamWaitEvent + _F_cuGetProcAddress_v2('cuStreamWaitEvent', &__cuStreamWaitEvent, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuStreamAddCallback + _F_cuGetProcAddress_v2('cuStreamAddCallback', &__cuStreamAddCallback, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 5000, ptds_mode, NULL) + + global __cuStreamBeginCapture_v2 + _F_cuGetProcAddress_v2('cuStreamBeginCapture', &__cuStreamBeginCapture_v2, 10010, ptds_mode, NULL) + + global __cuStreamBeginCaptureToGraph + _F_cuGetProcAddress_v2('cuStreamBeginCaptureToGraph', &__cuStreamBeginCaptureToGraph, 12030, ptds_mode, NULL) + + global __cuThreadExchangeStreamCaptureMode + _F_cuGetProcAddress_v2('cuThreadExchangeStreamCaptureMode', &__cuThreadExchangeStreamCaptureMode, 10010, ptds_mode, NULL) + + global __cuStreamEndCapture + _F_cuGetProcAddress_v2('cuStreamEndCapture', &__cuStreamEndCapture, 10000, ptds_mode, NULL) + + global __cuStreamIsCapturing + _F_cuGetProcAddress_v2('cuStreamIsCapturing', &__cuStreamIsCapturing, 10000, ptds_mode, NULL) + + global __cuStreamGetCaptureInfo_v2 + _F_cuGetProcAddress_v2('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v2, 11030, ptds_mode, NULL) + + global __cuStreamGetCaptureInfo_v3 + _F_cuGetProcAddress_v2('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v3, 12030, ptds_mode, NULL) + + global __cuStreamUpdateCaptureDependencies_v2 + _F_cuGetProcAddress_v2('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies_v2, 12030, ptds_mode, NULL) + + global __cuStreamAttachMemAsync + _F_cuGetProcAddress_v2('cuStreamAttachMemAsync', &__cuStreamAttachMemAsync, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 6000, ptds_mode, NULL) + + global __cuStreamQuery + _F_cuGetProcAddress_v2('cuStreamQuery', &__cuStreamQuery, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 2000, ptds_mode, NULL) + + global __cuStreamSynchronize + _F_cuGetProcAddress_v2('cuStreamSynchronize', &__cuStreamSynchronize, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 2000, ptds_mode, NULL) + + global __cuStreamDestroy_v2 + _F_cuGetProcAddress_v2('cuStreamDestroy', &__cuStreamDestroy_v2, 4000, ptds_mode, NULL) + + global __cuStreamCopyAttributes + _F_cuGetProcAddress_v2('cuStreamCopyAttributes', &__cuStreamCopyAttributes, 11000, ptds_mode, NULL) + + global __cuStreamGetAttribute + _F_cuGetProcAddress_v2('cuStreamGetAttribute', &__cuStreamGetAttribute, 11000, ptds_mode, NULL) + + global __cuStreamSetAttribute + _F_cuGetProcAddress_v2('cuStreamSetAttribute', &__cuStreamSetAttribute, 11000, ptds_mode, NULL) + + global __cuEventCreate + _F_cuGetProcAddress_v2('cuEventCreate', &__cuEventCreate, 2000, ptds_mode, NULL) + + global __cuEventRecord + _F_cuGetProcAddress_v2('cuEventRecord', &__cuEventRecord, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 2000, ptds_mode, NULL) + + global __cuEventRecordWithFlags + _F_cuGetProcAddress_v2('cuEventRecordWithFlags', &__cuEventRecordWithFlags, 11010, ptds_mode, NULL) + + global __cuEventQuery + _F_cuGetProcAddress_v2('cuEventQuery', &__cuEventQuery, 2000, ptds_mode, NULL) + + global __cuEventSynchronize + _F_cuGetProcAddress_v2('cuEventSynchronize', &__cuEventSynchronize, 2000, ptds_mode, NULL) + + global __cuEventDestroy_v2 + _F_cuGetProcAddress_v2('cuEventDestroy', &__cuEventDestroy_v2, 4000, ptds_mode, NULL) + + global __cuEventElapsedTime_v2 + _F_cuGetProcAddress_v2('cuEventElapsedTime', &__cuEventElapsedTime_v2, 12080, ptds_mode, NULL) + + global __cuImportExternalMemory + _F_cuGetProcAddress_v2('cuImportExternalMemory', &__cuImportExternalMemory, 10000, ptds_mode, NULL) + + global __cuExternalMemoryGetMappedBuffer + _F_cuGetProcAddress_v2('cuExternalMemoryGetMappedBuffer', &__cuExternalMemoryGetMappedBuffer, 10000, ptds_mode, NULL) + + global __cuExternalMemoryGetMappedMipmappedArray + _F_cuGetProcAddress_v2('cuExternalMemoryGetMappedMipmappedArray', &__cuExternalMemoryGetMappedMipmappedArray, 10000, ptds_mode, NULL) + + global __cuDestroyExternalMemory + _F_cuGetProcAddress_v2('cuDestroyExternalMemory', &__cuDestroyExternalMemory, 10000, ptds_mode, NULL) + + global __cuImportExternalSemaphore + _F_cuGetProcAddress_v2('cuImportExternalSemaphore', &__cuImportExternalSemaphore, 10000, ptds_mode, NULL) + + global __cuSignalExternalSemaphoresAsync + _F_cuGetProcAddress_v2('cuSignalExternalSemaphoresAsync', &__cuSignalExternalSemaphoresAsync, 10000, ptds_mode, NULL) + + global __cuWaitExternalSemaphoresAsync + _F_cuGetProcAddress_v2('cuWaitExternalSemaphoresAsync', &__cuWaitExternalSemaphoresAsync, 10000, ptds_mode, NULL) + + global __cuDestroyExternalSemaphore + _F_cuGetProcAddress_v2('cuDestroyExternalSemaphore', &__cuDestroyExternalSemaphore, 10000, ptds_mode, NULL) + + global __cuStreamWaitValue32_v2 + _F_cuGetProcAddress_v2('cuStreamWaitValue32', &__cuStreamWaitValue32_v2, 11070, ptds_mode, NULL) + + global __cuStreamWaitValue64_v2 + _F_cuGetProcAddress_v2('cuStreamWaitValue64', &__cuStreamWaitValue64_v2, 11070, ptds_mode, NULL) + + global __cuStreamWriteValue32_v2 + _F_cuGetProcAddress_v2('cuStreamWriteValue32', &__cuStreamWriteValue32_v2, 11070, ptds_mode, NULL) + + global __cuStreamWriteValue64_v2 + _F_cuGetProcAddress_v2('cuStreamWriteValue64', &__cuStreamWriteValue64_v2, 11070, ptds_mode, NULL) + + global __cuStreamBatchMemOp_v2 + _F_cuGetProcAddress_v2('cuStreamBatchMemOp', &__cuStreamBatchMemOp_v2, 11070, ptds_mode, NULL) + + global __cuFuncGetAttribute + _F_cuGetProcAddress_v2('cuFuncGetAttribute', &__cuFuncGetAttribute, 2020, ptds_mode, NULL) + + global __cuFuncSetAttribute + _F_cuGetProcAddress_v2('cuFuncSetAttribute', &__cuFuncSetAttribute, 9000, ptds_mode, NULL) + + global __cuFuncSetCacheConfig + _F_cuGetProcAddress_v2('cuFuncSetCacheConfig', &__cuFuncSetCacheConfig, 3000, ptds_mode, NULL) + + global __cuFuncGetModule + _F_cuGetProcAddress_v2('cuFuncGetModule', &__cuFuncGetModule, 11000, ptds_mode, NULL) + + global __cuFuncGetName + _F_cuGetProcAddress_v2('cuFuncGetName', &__cuFuncGetName, 12030, ptds_mode, NULL) + + global __cuFuncGetParamInfo + _F_cuGetProcAddress_v2('cuFuncGetParamInfo', &__cuFuncGetParamInfo, 12040, ptds_mode, NULL) + + global __cuFuncIsLoaded + _F_cuGetProcAddress_v2('cuFuncIsLoaded', &__cuFuncIsLoaded, 12040, ptds_mode, NULL) + + global __cuFuncLoad + _F_cuGetProcAddress_v2('cuFuncLoad', &__cuFuncLoad, 12040, ptds_mode, NULL) + + global __cuLaunchKernel + _F_cuGetProcAddress_v2('cuLaunchKernel', &__cuLaunchKernel, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 4000, ptds_mode, NULL) + + global __cuLaunchKernelEx + _F_cuGetProcAddress_v2('cuLaunchKernelEx', &__cuLaunchKernelEx, 11060, ptds_mode, NULL) + + global __cuLaunchCooperativeKernel + _F_cuGetProcAddress_v2('cuLaunchCooperativeKernel', &__cuLaunchCooperativeKernel, 9000, ptds_mode, NULL) + + global __cuLaunchCooperativeKernelMultiDevice + _F_cuGetProcAddress_v2('cuLaunchCooperativeKernelMultiDevice', &__cuLaunchCooperativeKernelMultiDevice, 9000, ptds_mode, NULL) + + global __cuLaunchHostFunc + _F_cuGetProcAddress_v2('cuLaunchHostFunc', &__cuLaunchHostFunc, 10000, ptds_mode, NULL) + + global __cuFuncSetBlockShape + _F_cuGetProcAddress_v2('cuFuncSetBlockShape', &__cuFuncSetBlockShape, 2000, ptds_mode, NULL) + + global __cuFuncSetSharedSize + _F_cuGetProcAddress_v2('cuFuncSetSharedSize', &__cuFuncSetSharedSize, 2000, ptds_mode, NULL) + + global __cuParamSetSize + _F_cuGetProcAddress_v2('cuParamSetSize', &__cuParamSetSize, 2000, ptds_mode, NULL) + + global __cuParamSeti + _F_cuGetProcAddress_v2('cuParamSeti', &__cuParamSeti, 2000, ptds_mode, NULL) + + global __cuParamSetf + _F_cuGetProcAddress_v2('cuParamSetf', &__cuParamSetf, 2000, ptds_mode, NULL) + + global __cuParamSetv + _F_cuGetProcAddress_v2('cuParamSetv', &__cuParamSetv, 2000, ptds_mode, NULL) + + global __cuLaunch + _F_cuGetProcAddress_v2('cuLaunch', &__cuLaunch, 2000, ptds_mode, NULL) + + global __cuLaunchGrid + _F_cuGetProcAddress_v2('cuLaunchGrid', &__cuLaunchGrid, 2000, ptds_mode, NULL) + + global __cuLaunchGridAsync + _F_cuGetProcAddress_v2('cuLaunchGridAsync', &__cuLaunchGridAsync, 2000, ptds_mode, NULL) + + global __cuParamSetTexRef + _F_cuGetProcAddress_v2('cuParamSetTexRef', &__cuParamSetTexRef, 2000, ptds_mode, NULL) + + global __cuFuncSetSharedMemConfig + _F_cuGetProcAddress_v2('cuFuncSetSharedMemConfig', &__cuFuncSetSharedMemConfig, 4020, ptds_mode, NULL) + + global __cuGraphCreate + _F_cuGetProcAddress_v2('cuGraphCreate', &__cuGraphCreate, 10000, ptds_mode, NULL) + + global __cuGraphAddKernelNode_v2 + _F_cuGetProcAddress_v2('cuGraphAddKernelNode', &__cuGraphAddKernelNode_v2, 12000, ptds_mode, NULL) + + global __cuGraphKernelNodeGetParams_v2 + _F_cuGetProcAddress_v2('cuGraphKernelNodeGetParams', &__cuGraphKernelNodeGetParams_v2, 12000, ptds_mode, NULL) + + global __cuGraphKernelNodeSetParams_v2 + _F_cuGetProcAddress_v2('cuGraphKernelNodeSetParams', &__cuGraphKernelNodeSetParams_v2, 12000, ptds_mode, NULL) + + global __cuGraphAddMemcpyNode + _F_cuGetProcAddress_v2('cuGraphAddMemcpyNode', &__cuGraphAddMemcpyNode, 10000, ptds_mode, NULL) + + global __cuGraphMemcpyNodeGetParams + _F_cuGetProcAddress_v2('cuGraphMemcpyNodeGetParams', &__cuGraphMemcpyNodeGetParams, 10000, ptds_mode, NULL) + + global __cuGraphMemcpyNodeSetParams + _F_cuGetProcAddress_v2('cuGraphMemcpyNodeSetParams', &__cuGraphMemcpyNodeSetParams, 10000, ptds_mode, NULL) + + global __cuGraphAddMemsetNode + _F_cuGetProcAddress_v2('cuGraphAddMemsetNode', &__cuGraphAddMemsetNode, 10000, ptds_mode, NULL) + + global __cuGraphMemsetNodeGetParams + _F_cuGetProcAddress_v2('cuGraphMemsetNodeGetParams', &__cuGraphMemsetNodeGetParams, 10000, ptds_mode, NULL) + + global __cuGraphMemsetNodeSetParams + _F_cuGetProcAddress_v2('cuGraphMemsetNodeSetParams', &__cuGraphMemsetNodeSetParams, 10000, ptds_mode, NULL) + + global __cuGraphAddHostNode + _F_cuGetProcAddress_v2('cuGraphAddHostNode', &__cuGraphAddHostNode, 10000, ptds_mode, NULL) + + global __cuGraphHostNodeGetParams + _F_cuGetProcAddress_v2('cuGraphHostNodeGetParams', &__cuGraphHostNodeGetParams, 10000, ptds_mode, NULL) + + global __cuGraphHostNodeSetParams + _F_cuGetProcAddress_v2('cuGraphHostNodeSetParams', &__cuGraphHostNodeSetParams, 10000, ptds_mode, NULL) + + global __cuGraphAddChildGraphNode + _F_cuGetProcAddress_v2('cuGraphAddChildGraphNode', &__cuGraphAddChildGraphNode, 10000, ptds_mode, NULL) + + global __cuGraphChildGraphNodeGetGraph + _F_cuGetProcAddress_v2('cuGraphChildGraphNodeGetGraph', &__cuGraphChildGraphNodeGetGraph, 10000, ptds_mode, NULL) + + global __cuGraphAddEmptyNode + _F_cuGetProcAddress_v2('cuGraphAddEmptyNode', &__cuGraphAddEmptyNode, 10000, ptds_mode, NULL) + + global __cuGraphAddEventRecordNode + _F_cuGetProcAddress_v2('cuGraphAddEventRecordNode', &__cuGraphAddEventRecordNode, 11010, ptds_mode, NULL) + + global __cuGraphEventRecordNodeGetEvent + _F_cuGetProcAddress_v2('cuGraphEventRecordNodeGetEvent', &__cuGraphEventRecordNodeGetEvent, 11010, ptds_mode, NULL) + + global __cuGraphEventRecordNodeSetEvent + _F_cuGetProcAddress_v2('cuGraphEventRecordNodeSetEvent', &__cuGraphEventRecordNodeSetEvent, 11010, ptds_mode, NULL) + + global __cuGraphAddEventWaitNode + _F_cuGetProcAddress_v2('cuGraphAddEventWaitNode', &__cuGraphAddEventWaitNode, 11010, ptds_mode, NULL) + + global __cuGraphEventWaitNodeGetEvent + _F_cuGetProcAddress_v2('cuGraphEventWaitNodeGetEvent', &__cuGraphEventWaitNodeGetEvent, 11010, ptds_mode, NULL) + + global __cuGraphEventWaitNodeSetEvent + _F_cuGetProcAddress_v2('cuGraphEventWaitNodeSetEvent', &__cuGraphEventWaitNodeSetEvent, 11010, ptds_mode, NULL) + + global __cuGraphAddExternalSemaphoresSignalNode + _F_cuGetProcAddress_v2('cuGraphAddExternalSemaphoresSignalNode', &__cuGraphAddExternalSemaphoresSignalNode, 11020, ptds_mode, NULL) + + global __cuGraphExternalSemaphoresSignalNodeGetParams + _F_cuGetProcAddress_v2('cuGraphExternalSemaphoresSignalNodeGetParams', &__cuGraphExternalSemaphoresSignalNodeGetParams, 11020, ptds_mode, NULL) + + global __cuGraphExternalSemaphoresSignalNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExternalSemaphoresSignalNodeSetParams', &__cuGraphExternalSemaphoresSignalNodeSetParams, 11020, ptds_mode, NULL) + + global __cuGraphAddExternalSemaphoresWaitNode + _F_cuGetProcAddress_v2('cuGraphAddExternalSemaphoresWaitNode', &__cuGraphAddExternalSemaphoresWaitNode, 11020, ptds_mode, NULL) + + global __cuGraphExternalSemaphoresWaitNodeGetParams + _F_cuGetProcAddress_v2('cuGraphExternalSemaphoresWaitNodeGetParams', &__cuGraphExternalSemaphoresWaitNodeGetParams, 11020, ptds_mode, NULL) + + global __cuGraphExternalSemaphoresWaitNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExternalSemaphoresWaitNodeSetParams', &__cuGraphExternalSemaphoresWaitNodeSetParams, 11020, ptds_mode, NULL) + + global __cuGraphAddBatchMemOpNode + _F_cuGetProcAddress_v2('cuGraphAddBatchMemOpNode', &__cuGraphAddBatchMemOpNode, 11070, ptds_mode, NULL) + + global __cuGraphBatchMemOpNodeGetParams + _F_cuGetProcAddress_v2('cuGraphBatchMemOpNodeGetParams', &__cuGraphBatchMemOpNodeGetParams, 11070, ptds_mode, NULL) + + global __cuGraphBatchMemOpNodeSetParams + _F_cuGetProcAddress_v2('cuGraphBatchMemOpNodeSetParams', &__cuGraphBatchMemOpNodeSetParams, 11070, ptds_mode, NULL) + + global __cuGraphExecBatchMemOpNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecBatchMemOpNodeSetParams', &__cuGraphExecBatchMemOpNodeSetParams, 11070, ptds_mode, NULL) + + global __cuGraphAddMemAllocNode + _F_cuGetProcAddress_v2('cuGraphAddMemAllocNode', &__cuGraphAddMemAllocNode, 11040, ptds_mode, NULL) + + global __cuGraphMemAllocNodeGetParams + _F_cuGetProcAddress_v2('cuGraphMemAllocNodeGetParams', &__cuGraphMemAllocNodeGetParams, 11040, ptds_mode, NULL) + + global __cuGraphAddMemFreeNode + _F_cuGetProcAddress_v2('cuGraphAddMemFreeNode', &__cuGraphAddMemFreeNode, 11040, ptds_mode, NULL) + + global __cuGraphMemFreeNodeGetParams + _F_cuGetProcAddress_v2('cuGraphMemFreeNodeGetParams', &__cuGraphMemFreeNodeGetParams, 11040, ptds_mode, NULL) + + global __cuDeviceGraphMemTrim + _F_cuGetProcAddress_v2('cuDeviceGraphMemTrim', &__cuDeviceGraphMemTrim, 11040, ptds_mode, NULL) + + global __cuDeviceGetGraphMemAttribute + _F_cuGetProcAddress_v2('cuDeviceGetGraphMemAttribute', &__cuDeviceGetGraphMemAttribute, 11040, ptds_mode, NULL) + + global __cuDeviceSetGraphMemAttribute + _F_cuGetProcAddress_v2('cuDeviceSetGraphMemAttribute', &__cuDeviceSetGraphMemAttribute, 11040, ptds_mode, NULL) + + global __cuGraphClone + _F_cuGetProcAddress_v2('cuGraphClone', &__cuGraphClone, 10000, ptds_mode, NULL) + + global __cuGraphNodeFindInClone + _F_cuGetProcAddress_v2('cuGraphNodeFindInClone', &__cuGraphNodeFindInClone, 10000, ptds_mode, NULL) + + global __cuGraphNodeGetType + _F_cuGetProcAddress_v2('cuGraphNodeGetType', &__cuGraphNodeGetType, 10000, ptds_mode, NULL) + + global __cuGraphGetNodes + _F_cuGetProcAddress_v2('cuGraphGetNodes', &__cuGraphGetNodes, 10000, ptds_mode, NULL) + + global __cuGraphGetRootNodes + _F_cuGetProcAddress_v2('cuGraphGetRootNodes', &__cuGraphGetRootNodes, 10000, ptds_mode, NULL) + + global __cuGraphGetEdges_v2 + _F_cuGetProcAddress_v2('cuGraphGetEdges', &__cuGraphGetEdges_v2, 12030, ptds_mode, NULL) + + global __cuGraphNodeGetDependencies_v2 + _F_cuGetProcAddress_v2('cuGraphNodeGetDependencies', &__cuGraphNodeGetDependencies_v2, 12030, ptds_mode, NULL) + + global __cuGraphNodeGetDependentNodes_v2 + _F_cuGetProcAddress_v2('cuGraphNodeGetDependentNodes', &__cuGraphNodeGetDependentNodes_v2, 12030, ptds_mode, NULL) + + global __cuGraphAddDependencies_v2 + _F_cuGetProcAddress_v2('cuGraphAddDependencies', &__cuGraphAddDependencies_v2, 12030, ptds_mode, NULL) + + global __cuGraphRemoveDependencies_v2 + _F_cuGetProcAddress_v2('cuGraphRemoveDependencies', &__cuGraphRemoveDependencies_v2, 12030, ptds_mode, NULL) + + global __cuGraphDestroyNode + _F_cuGetProcAddress_v2('cuGraphDestroyNode', &__cuGraphDestroyNode, 10000, ptds_mode, NULL) + + global __cuGraphInstantiateWithFlags + _F_cuGetProcAddress_v2('cuGraphInstantiateWithFlags', &__cuGraphInstantiateWithFlags, 11040, ptds_mode, NULL) + + global __cuGraphInstantiateWithParams + _F_cuGetProcAddress_v2('cuGraphInstantiateWithParams', &__cuGraphInstantiateWithParams, 12000, ptds_mode, NULL) + + global __cuGraphExecGetFlags + _F_cuGetProcAddress_v2('cuGraphExecGetFlags', &__cuGraphExecGetFlags, 12000, ptds_mode, NULL) + + global __cuGraphExecKernelNodeSetParams_v2 + _F_cuGetProcAddress_v2('cuGraphExecKernelNodeSetParams', &__cuGraphExecKernelNodeSetParams_v2, 12000, ptds_mode, NULL) + + global __cuGraphExecMemcpyNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecMemcpyNodeSetParams', &__cuGraphExecMemcpyNodeSetParams, 10020, ptds_mode, NULL) + + global __cuGraphExecMemsetNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecMemsetNodeSetParams', &__cuGraphExecMemsetNodeSetParams, 10020, ptds_mode, NULL) + + global __cuGraphExecHostNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecHostNodeSetParams', &__cuGraphExecHostNodeSetParams, 10020, ptds_mode, NULL) + + global __cuGraphExecChildGraphNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecChildGraphNodeSetParams', &__cuGraphExecChildGraphNodeSetParams, 11010, ptds_mode, NULL) + + global __cuGraphExecEventRecordNodeSetEvent + _F_cuGetProcAddress_v2('cuGraphExecEventRecordNodeSetEvent', &__cuGraphExecEventRecordNodeSetEvent, 11010, ptds_mode, NULL) + + global __cuGraphExecEventWaitNodeSetEvent + _F_cuGetProcAddress_v2('cuGraphExecEventWaitNodeSetEvent', &__cuGraphExecEventWaitNodeSetEvent, 11010, ptds_mode, NULL) + + global __cuGraphExecExternalSemaphoresSignalNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecExternalSemaphoresSignalNodeSetParams', &__cuGraphExecExternalSemaphoresSignalNodeSetParams, 11020, ptds_mode, NULL) + + global __cuGraphExecExternalSemaphoresWaitNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecExternalSemaphoresWaitNodeSetParams', &__cuGraphExecExternalSemaphoresWaitNodeSetParams, 11020, ptds_mode, NULL) + + global __cuGraphNodeSetEnabled + _F_cuGetProcAddress_v2('cuGraphNodeSetEnabled', &__cuGraphNodeSetEnabled, 11060, ptds_mode, NULL) + + global __cuGraphNodeGetEnabled + _F_cuGetProcAddress_v2('cuGraphNodeGetEnabled', &__cuGraphNodeGetEnabled, 11060, ptds_mode, NULL) + + global __cuGraphUpload + _F_cuGetProcAddress_v2('cuGraphUpload', &__cuGraphUpload, 11010, ptds_mode, NULL) + + global __cuGraphLaunch + _F_cuGetProcAddress_v2('cuGraphLaunch', &__cuGraphLaunch, 10000, ptds_mode, NULL) + + global __cuGraphExecDestroy + _F_cuGetProcAddress_v2('cuGraphExecDestroy', &__cuGraphExecDestroy, 10000, ptds_mode, NULL) + + global __cuGraphDestroy + _F_cuGetProcAddress_v2('cuGraphDestroy', &__cuGraphDestroy, 10000, ptds_mode, NULL) + + global __cuGraphExecUpdate_v2 + _F_cuGetProcAddress_v2('cuGraphExecUpdate', &__cuGraphExecUpdate_v2, 12000, ptds_mode, NULL) + + global __cuGraphKernelNodeCopyAttributes + _F_cuGetProcAddress_v2('cuGraphKernelNodeCopyAttributes', &__cuGraphKernelNodeCopyAttributes, 11000, ptds_mode, NULL) + + global __cuGraphKernelNodeGetAttribute + _F_cuGetProcAddress_v2('cuGraphKernelNodeGetAttribute', &__cuGraphKernelNodeGetAttribute, 11000, ptds_mode, NULL) + + global __cuGraphKernelNodeSetAttribute + _F_cuGetProcAddress_v2('cuGraphKernelNodeSetAttribute', &__cuGraphKernelNodeSetAttribute, 11000, ptds_mode, NULL) + + global __cuGraphDebugDotPrint + _F_cuGetProcAddress_v2('cuGraphDebugDotPrint', &__cuGraphDebugDotPrint, 11030, ptds_mode, NULL) + + global __cuUserObjectCreate + _F_cuGetProcAddress_v2('cuUserObjectCreate', &__cuUserObjectCreate, 11030, ptds_mode, NULL) + + global __cuUserObjectRetain + _F_cuGetProcAddress_v2('cuUserObjectRetain', &__cuUserObjectRetain, 11030, ptds_mode, NULL) + + global __cuUserObjectRelease + _F_cuGetProcAddress_v2('cuUserObjectRelease', &__cuUserObjectRelease, 11030, ptds_mode, NULL) + + global __cuGraphRetainUserObject + _F_cuGetProcAddress_v2('cuGraphRetainUserObject', &__cuGraphRetainUserObject, 11030, ptds_mode, NULL) + + global __cuGraphReleaseUserObject + _F_cuGetProcAddress_v2('cuGraphReleaseUserObject', &__cuGraphReleaseUserObject, 11030, ptds_mode, NULL) + + global __cuGraphAddNode_v2 + _F_cuGetProcAddress_v2('cuGraphAddNode', &__cuGraphAddNode_v2, 12030, ptds_mode, NULL) + + global __cuGraphNodeSetParams + _F_cuGetProcAddress_v2('cuGraphNodeSetParams', &__cuGraphNodeSetParams, 12020, ptds_mode, NULL) + + global __cuGraphExecNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecNodeSetParams', &__cuGraphExecNodeSetParams, 12020, ptds_mode, NULL) + + global __cuGraphConditionalHandleCreate + _F_cuGetProcAddress_v2('cuGraphConditionalHandleCreate', &__cuGraphConditionalHandleCreate, 12030, ptds_mode, NULL) + + global __cuOccupancyMaxActiveBlocksPerMultiprocessor + _F_cuGetProcAddress_v2('cuOccupancyMaxActiveBlocksPerMultiprocessor', &__cuOccupancyMaxActiveBlocksPerMultiprocessor, 6050, ptds_mode, NULL) + + global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags + _F_cuGetProcAddress_v2('cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags', &__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags, 7000, ptds_mode, NULL) + + global __cuOccupancyMaxPotentialBlockSize + _F_cuGetProcAddress_v2('cuOccupancyMaxPotentialBlockSize', &__cuOccupancyMaxPotentialBlockSize, 6050, ptds_mode, NULL) + + global __cuOccupancyMaxPotentialBlockSizeWithFlags + _F_cuGetProcAddress_v2('cuOccupancyMaxPotentialBlockSizeWithFlags', &__cuOccupancyMaxPotentialBlockSizeWithFlags, 7000, ptds_mode, NULL) + + global __cuOccupancyAvailableDynamicSMemPerBlock + _F_cuGetProcAddress_v2('cuOccupancyAvailableDynamicSMemPerBlock', &__cuOccupancyAvailableDynamicSMemPerBlock, 10020, ptds_mode, NULL) + + global __cuOccupancyMaxPotentialClusterSize + _F_cuGetProcAddress_v2('cuOccupancyMaxPotentialClusterSize', &__cuOccupancyMaxPotentialClusterSize, 11070, ptds_mode, NULL) + + global __cuOccupancyMaxActiveClusters + _F_cuGetProcAddress_v2('cuOccupancyMaxActiveClusters', &__cuOccupancyMaxActiveClusters, 11070, ptds_mode, NULL) + + global __cuTexRefSetArray + _F_cuGetProcAddress_v2('cuTexRefSetArray', &__cuTexRefSetArray, 2000, ptds_mode, NULL) + + global __cuTexRefSetMipmappedArray + _F_cuGetProcAddress_v2('cuTexRefSetMipmappedArray', &__cuTexRefSetMipmappedArray, 5000, ptds_mode, NULL) + + global __cuTexRefSetAddress_v2 + _F_cuGetProcAddress_v2('cuTexRefSetAddress', &__cuTexRefSetAddress_v2, 3020, ptds_mode, NULL) + + global __cuTexRefSetAddress2D_v3 + _F_cuGetProcAddress_v2('cuTexRefSetAddress2D', &__cuTexRefSetAddress2D_v3, 4010, ptds_mode, NULL) + + global __cuTexRefSetFormat + _F_cuGetProcAddress_v2('cuTexRefSetFormat', &__cuTexRefSetFormat, 2000, ptds_mode, NULL) + + global __cuTexRefSetAddressMode + _F_cuGetProcAddress_v2('cuTexRefSetAddressMode', &__cuTexRefSetAddressMode, 2000, ptds_mode, NULL) + + global __cuTexRefSetFilterMode + _F_cuGetProcAddress_v2('cuTexRefSetFilterMode', &__cuTexRefSetFilterMode, 2000, ptds_mode, NULL) + + global __cuTexRefSetMipmapFilterMode + _F_cuGetProcAddress_v2('cuTexRefSetMipmapFilterMode', &__cuTexRefSetMipmapFilterMode, 5000, ptds_mode, NULL) + + global __cuTexRefSetMipmapLevelBias + _F_cuGetProcAddress_v2('cuTexRefSetMipmapLevelBias', &__cuTexRefSetMipmapLevelBias, 5000, ptds_mode, NULL) + + global __cuTexRefSetMipmapLevelClamp + _F_cuGetProcAddress_v2('cuTexRefSetMipmapLevelClamp', &__cuTexRefSetMipmapLevelClamp, 5000, ptds_mode, NULL) + + global __cuTexRefSetMaxAnisotropy + _F_cuGetProcAddress_v2('cuTexRefSetMaxAnisotropy', &__cuTexRefSetMaxAnisotropy, 5000, ptds_mode, NULL) + + global __cuTexRefSetBorderColor + _F_cuGetProcAddress_v2('cuTexRefSetBorderColor', &__cuTexRefSetBorderColor, 8000, ptds_mode, NULL) + + global __cuTexRefSetFlags + _F_cuGetProcAddress_v2('cuTexRefSetFlags', &__cuTexRefSetFlags, 2000, ptds_mode, NULL) + + global __cuTexRefGetAddress_v2 + _F_cuGetProcAddress_v2('cuTexRefGetAddress', &__cuTexRefGetAddress_v2, 3020, ptds_mode, NULL) + + global __cuTexRefGetArray + _F_cuGetProcAddress_v2('cuTexRefGetArray', &__cuTexRefGetArray, 2000, ptds_mode, NULL) + + global __cuTexRefGetMipmappedArray + _F_cuGetProcAddress_v2('cuTexRefGetMipmappedArray', &__cuTexRefGetMipmappedArray, 5000, ptds_mode, NULL) + + global __cuTexRefGetAddressMode + _F_cuGetProcAddress_v2('cuTexRefGetAddressMode', &__cuTexRefGetAddressMode, 2000, ptds_mode, NULL) + + global __cuTexRefGetFilterMode + _F_cuGetProcAddress_v2('cuTexRefGetFilterMode', &__cuTexRefGetFilterMode, 2000, ptds_mode, NULL) + + global __cuTexRefGetFormat + _F_cuGetProcAddress_v2('cuTexRefGetFormat', &__cuTexRefGetFormat, 2000, ptds_mode, NULL) + + global __cuTexRefGetMipmapFilterMode + _F_cuGetProcAddress_v2('cuTexRefGetMipmapFilterMode', &__cuTexRefGetMipmapFilterMode, 5000, ptds_mode, NULL) + + global __cuTexRefGetMipmapLevelBias + _F_cuGetProcAddress_v2('cuTexRefGetMipmapLevelBias', &__cuTexRefGetMipmapLevelBias, 5000, ptds_mode, NULL) + + global __cuTexRefGetMipmapLevelClamp + _F_cuGetProcAddress_v2('cuTexRefGetMipmapLevelClamp', &__cuTexRefGetMipmapLevelClamp, 5000, ptds_mode, NULL) + + global __cuTexRefGetMaxAnisotropy + _F_cuGetProcAddress_v2('cuTexRefGetMaxAnisotropy', &__cuTexRefGetMaxAnisotropy, 5000, ptds_mode, NULL) + + global __cuTexRefGetBorderColor + _F_cuGetProcAddress_v2('cuTexRefGetBorderColor', &__cuTexRefGetBorderColor, 8000, ptds_mode, NULL) + + global __cuTexRefGetFlags + _F_cuGetProcAddress_v2('cuTexRefGetFlags', &__cuTexRefGetFlags, 2000, ptds_mode, NULL) + + global __cuTexRefCreate + _F_cuGetProcAddress_v2('cuTexRefCreate', &__cuTexRefCreate, 2000, ptds_mode, NULL) + + global __cuTexRefDestroy + _F_cuGetProcAddress_v2('cuTexRefDestroy', &__cuTexRefDestroy, 2000, ptds_mode, NULL) + + global __cuSurfRefSetArray + _F_cuGetProcAddress_v2('cuSurfRefSetArray', &__cuSurfRefSetArray, 3000, ptds_mode, NULL) + + global __cuSurfRefGetArray + _F_cuGetProcAddress_v2('cuSurfRefGetArray', &__cuSurfRefGetArray, 3000, ptds_mode, NULL) + + global __cuTexObjectCreate + _F_cuGetProcAddress_v2('cuTexObjectCreate', &__cuTexObjectCreate, 5000, ptds_mode, NULL) + + global __cuTexObjectDestroy + _F_cuGetProcAddress_v2('cuTexObjectDestroy', &__cuTexObjectDestroy, 5000, ptds_mode, NULL) + + global __cuTexObjectGetResourceDesc + _F_cuGetProcAddress_v2('cuTexObjectGetResourceDesc', &__cuTexObjectGetResourceDesc, 5000, ptds_mode, NULL) + + global __cuTexObjectGetTextureDesc + _F_cuGetProcAddress_v2('cuTexObjectGetTextureDesc', &__cuTexObjectGetTextureDesc, 5000, ptds_mode, NULL) + + global __cuTexObjectGetResourceViewDesc + _F_cuGetProcAddress_v2('cuTexObjectGetResourceViewDesc', &__cuTexObjectGetResourceViewDesc, 5000, ptds_mode, NULL) + + global __cuSurfObjectCreate + _F_cuGetProcAddress_v2('cuSurfObjectCreate', &__cuSurfObjectCreate, 5000, ptds_mode, NULL) + + global __cuSurfObjectDestroy + _F_cuGetProcAddress_v2('cuSurfObjectDestroy', &__cuSurfObjectDestroy, 5000, ptds_mode, NULL) + + global __cuSurfObjectGetResourceDesc + _F_cuGetProcAddress_v2('cuSurfObjectGetResourceDesc', &__cuSurfObjectGetResourceDesc, 5000, ptds_mode, NULL) + + global __cuTensorMapEncodeTiled + _F_cuGetProcAddress_v2('cuTensorMapEncodeTiled', &__cuTensorMapEncodeTiled, 12000, ptds_mode, NULL) + + global __cuTensorMapEncodeIm2col + _F_cuGetProcAddress_v2('cuTensorMapEncodeIm2col', &__cuTensorMapEncodeIm2col, 12000, ptds_mode, NULL) + + global __cuTensorMapEncodeIm2colWide + _F_cuGetProcAddress_v2('cuTensorMapEncodeIm2colWide', &__cuTensorMapEncodeIm2colWide, 12080, ptds_mode, NULL) + + global __cuTensorMapReplaceAddress + _F_cuGetProcAddress_v2('cuTensorMapReplaceAddress', &__cuTensorMapReplaceAddress, 12000, ptds_mode, NULL) + + global __cuDeviceCanAccessPeer + _F_cuGetProcAddress_v2('cuDeviceCanAccessPeer', &__cuDeviceCanAccessPeer, 4000, ptds_mode, NULL) + + global __cuCtxEnablePeerAccess + _F_cuGetProcAddress_v2('cuCtxEnablePeerAccess', &__cuCtxEnablePeerAccess, 4000, ptds_mode, NULL) + + global __cuCtxDisablePeerAccess + _F_cuGetProcAddress_v2('cuCtxDisablePeerAccess', &__cuCtxDisablePeerAccess, 4000, ptds_mode, NULL) + + global __cuDeviceGetP2PAttribute + _F_cuGetProcAddress_v2('cuDeviceGetP2PAttribute', &__cuDeviceGetP2PAttribute, 8000, ptds_mode, NULL) + + global __cuGraphicsUnregisterResource + _F_cuGetProcAddress_v2('cuGraphicsUnregisterResource', &__cuGraphicsUnregisterResource, 3000, ptds_mode, NULL) + + global __cuGraphicsSubResourceGetMappedArray + _F_cuGetProcAddress_v2('cuGraphicsSubResourceGetMappedArray', &__cuGraphicsSubResourceGetMappedArray, 3000, ptds_mode, NULL) + + global __cuGraphicsResourceGetMappedMipmappedArray + _F_cuGetProcAddress_v2('cuGraphicsResourceGetMappedMipmappedArray', &__cuGraphicsResourceGetMappedMipmappedArray, 5000, ptds_mode, NULL) + + global __cuGraphicsResourceGetMappedPointer_v2 + _F_cuGetProcAddress_v2('cuGraphicsResourceGetMappedPointer', &__cuGraphicsResourceGetMappedPointer_v2, 3020, ptds_mode, NULL) + + global __cuGraphicsResourceSetMapFlags_v2 + _F_cuGetProcAddress_v2('cuGraphicsResourceSetMapFlags', &__cuGraphicsResourceSetMapFlags_v2, 6050, ptds_mode, NULL) + + global __cuGraphicsMapResources + _F_cuGetProcAddress_v2('cuGraphicsMapResources', &__cuGraphicsMapResources, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3000, ptds_mode, NULL) + + global __cuGraphicsUnmapResources + _F_cuGetProcAddress_v2('cuGraphicsUnmapResources', &__cuGraphicsUnmapResources, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3000, ptds_mode, NULL) + + global __cuGetProcAddress_v2 + _F_cuGetProcAddress_v2('cuGetProcAddress', &__cuGetProcAddress_v2, 12000, ptds_mode, NULL) + + global __cuCoredumpGetAttribute + _F_cuGetProcAddress_v2('cuCoredumpGetAttribute', &__cuCoredumpGetAttribute, 12010, ptds_mode, NULL) + + global __cuCoredumpGetAttributeGlobal + _F_cuGetProcAddress_v2('cuCoredumpGetAttributeGlobal', &__cuCoredumpGetAttributeGlobal, 12010, ptds_mode, NULL) + + global __cuCoredumpSetAttribute + _F_cuGetProcAddress_v2('cuCoredumpSetAttribute', &__cuCoredumpSetAttribute, 12010, ptds_mode, NULL) + + global __cuCoredumpSetAttributeGlobal + _F_cuGetProcAddress_v2('cuCoredumpSetAttributeGlobal', &__cuCoredumpSetAttributeGlobal, 12010, ptds_mode, NULL) + + global __cuGetExportTable + _F_cuGetProcAddress_v2('cuGetExportTable', &__cuGetExportTable, 3000, ptds_mode, NULL) + + global __cuGreenCtxCreate + _F_cuGetProcAddress_v2('cuGreenCtxCreate', &__cuGreenCtxCreate, 12040, ptds_mode, NULL) + + global __cuGreenCtxDestroy + _F_cuGetProcAddress_v2('cuGreenCtxDestroy', &__cuGreenCtxDestroy, 12040, ptds_mode, NULL) + + global __cuCtxFromGreenCtx + _F_cuGetProcAddress_v2('cuCtxFromGreenCtx', &__cuCtxFromGreenCtx, 12040, ptds_mode, NULL) + + global __cuDeviceGetDevResource + _F_cuGetProcAddress_v2('cuDeviceGetDevResource', &__cuDeviceGetDevResource, 12040, ptds_mode, NULL) + + global __cuCtxGetDevResource + _F_cuGetProcAddress_v2('cuCtxGetDevResource', &__cuCtxGetDevResource, 12040, ptds_mode, NULL) + + global __cuGreenCtxGetDevResource + _F_cuGetProcAddress_v2('cuGreenCtxGetDevResource', &__cuGreenCtxGetDevResource, 12040, ptds_mode, NULL) + + global __cuDevSmResourceSplitByCount + _F_cuGetProcAddress_v2('cuDevSmResourceSplitByCount', &__cuDevSmResourceSplitByCount, 12040, ptds_mode, NULL) + + global __cuDevResourceGenerateDesc + _F_cuGetProcAddress_v2('cuDevResourceGenerateDesc', &__cuDevResourceGenerateDesc, 12040, ptds_mode, NULL) + + global __cuGreenCtxRecordEvent + _F_cuGetProcAddress_v2('cuGreenCtxRecordEvent', &__cuGreenCtxRecordEvent, 12040, ptds_mode, NULL) + + global __cuGreenCtxWaitEvent + _F_cuGetProcAddress_v2('cuGreenCtxWaitEvent', &__cuGreenCtxWaitEvent, 12040, ptds_mode, NULL) + + global __cuStreamGetGreenCtx + _F_cuGetProcAddress_v2('cuStreamGetGreenCtx', &__cuStreamGetGreenCtx, 12040, ptds_mode, NULL) + + global __cuGreenCtxStreamCreate + _F_cuGetProcAddress_v2('cuGreenCtxStreamCreate', &__cuGreenCtxStreamCreate, 12050, ptds_mode, NULL) + + global __cuLogsRegisterCallback + _F_cuGetProcAddress_v2('cuLogsRegisterCallback', &__cuLogsRegisterCallback, 12080, ptds_mode, NULL) + + global __cuLogsUnregisterCallback + _F_cuGetProcAddress_v2('cuLogsUnregisterCallback', &__cuLogsUnregisterCallback, 12080, ptds_mode, NULL) + + global __cuLogsCurrent + _F_cuGetProcAddress_v2('cuLogsCurrent', &__cuLogsCurrent, 12080, ptds_mode, NULL) + + global __cuLogsDumpToFile + _F_cuGetProcAddress_v2('cuLogsDumpToFile', &__cuLogsDumpToFile, 12080, ptds_mode, NULL) + + global __cuLogsDumpToMemory + _F_cuGetProcAddress_v2('cuLogsDumpToMemory', &__cuLogsDumpToMemory, 12080, ptds_mode, NULL) + + global __cuCheckpointProcessGetRestoreThreadId + _F_cuGetProcAddress_v2('cuCheckpointProcessGetRestoreThreadId', &__cuCheckpointProcessGetRestoreThreadId, 12080, ptds_mode, NULL) + + global __cuCheckpointProcessGetState + _F_cuGetProcAddress_v2('cuCheckpointProcessGetState', &__cuCheckpointProcessGetState, 12080, ptds_mode, NULL) + + global __cuCheckpointProcessLock + _F_cuGetProcAddress_v2('cuCheckpointProcessLock', &__cuCheckpointProcessLock, 12080, ptds_mode, NULL) + + global __cuCheckpointProcessCheckpoint + _F_cuGetProcAddress_v2('cuCheckpointProcessCheckpoint', &__cuCheckpointProcessCheckpoint, 12080, ptds_mode, NULL) + + global __cuCheckpointProcessRestore + _F_cuGetProcAddress_v2('cuCheckpointProcessRestore', &__cuCheckpointProcessRestore, 12080, ptds_mode, NULL) + + global __cuCheckpointProcessUnlock + _F_cuGetProcAddress_v2('cuCheckpointProcessUnlock', &__cuCheckpointProcessUnlock, 12080, ptds_mode, NULL) + + global __cuGraphicsEGLRegisterImage + _F_cuGetProcAddress_v2('cuGraphicsEGLRegisterImage', &__cuGraphicsEGLRegisterImage, 7000, ptds_mode, NULL) + + global __cuEGLStreamConsumerConnect + _F_cuGetProcAddress_v2('cuEGLStreamConsumerConnect', &__cuEGLStreamConsumerConnect, 7000, ptds_mode, NULL) + + global __cuEGLStreamConsumerConnectWithFlags + _F_cuGetProcAddress_v2('cuEGLStreamConsumerConnectWithFlags', &__cuEGLStreamConsumerConnectWithFlags, 8000, ptds_mode, NULL) + + global __cuEGLStreamConsumerDisconnect + _F_cuGetProcAddress_v2('cuEGLStreamConsumerDisconnect', &__cuEGLStreamConsumerDisconnect, 7000, ptds_mode, NULL) + + global __cuEGLStreamConsumerAcquireFrame + _F_cuGetProcAddress_v2('cuEGLStreamConsumerAcquireFrame', &__cuEGLStreamConsumerAcquireFrame, 7000, ptds_mode, NULL) + + global __cuEGLStreamConsumerReleaseFrame + _F_cuGetProcAddress_v2('cuEGLStreamConsumerReleaseFrame', &__cuEGLStreamConsumerReleaseFrame, 7000, ptds_mode, NULL) + + global __cuEGLStreamProducerConnect + _F_cuGetProcAddress_v2('cuEGLStreamProducerConnect', &__cuEGLStreamProducerConnect, 7000, ptds_mode, NULL) + + global __cuEGLStreamProducerDisconnect + _F_cuGetProcAddress_v2('cuEGLStreamProducerDisconnect', &__cuEGLStreamProducerDisconnect, 7000, ptds_mode, NULL) + + global __cuEGLStreamProducerPresentFrame + _F_cuGetProcAddress_v2('cuEGLStreamProducerPresentFrame', &__cuEGLStreamProducerPresentFrame, 7000, ptds_mode, NULL) + + global __cuEGLStreamProducerReturnFrame + _F_cuGetProcAddress_v2('cuEGLStreamProducerReturnFrame', &__cuEGLStreamProducerReturnFrame, 7000, ptds_mode, NULL) + + global __cuGraphicsResourceGetMappedEglFrame + _F_cuGetProcAddress_v2('cuGraphicsResourceGetMappedEglFrame', &__cuGraphicsResourceGetMappedEglFrame, 7000, ptds_mode, NULL) + + global __cuEventCreateFromEGLSync + _F_cuGetProcAddress_v2('cuEventCreateFromEGLSync', &__cuEventCreateFromEGLSync, 9000, ptds_mode, NULL) + + global __cuGraphicsGLRegisterBuffer + _F_cuGetProcAddress_v2('cuGraphicsGLRegisterBuffer', &__cuGraphicsGLRegisterBuffer, 3000, ptds_mode, NULL) + + global __cuGraphicsGLRegisterImage + _F_cuGetProcAddress_v2('cuGraphicsGLRegisterImage', &__cuGraphicsGLRegisterImage, 3000, ptds_mode, NULL) + + global __cuGLGetDevices_v2 + _F_cuGetProcAddress_v2('cuGLGetDevices', &__cuGLGetDevices_v2, 6050, ptds_mode, NULL) + + global __cuGLCtxCreate_v2 + _F_cuGetProcAddress_v2('cuGLCtxCreate', &__cuGLCtxCreate_v2, 3020, ptds_mode, NULL) + + global __cuGLInit + _F_cuGetProcAddress_v2('cuGLInit', &__cuGLInit, 2000, ptds_mode, NULL) + + global __cuGLRegisterBufferObject + _F_cuGetProcAddress_v2('cuGLRegisterBufferObject', &__cuGLRegisterBufferObject, 2000, ptds_mode, NULL) + + global __cuGLMapBufferObject_v2 + _F_cuGetProcAddress_v2('cuGLMapBufferObject', &__cuGLMapBufferObject_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuGLUnmapBufferObject + _F_cuGetProcAddress_v2('cuGLUnmapBufferObject', &__cuGLUnmapBufferObject, 2000, ptds_mode, NULL) + + global __cuGLUnregisterBufferObject + _F_cuGetProcAddress_v2('cuGLUnregisterBufferObject', &__cuGLUnregisterBufferObject, 2000, ptds_mode, NULL) + + global __cuGLSetBufferObjectMapFlags + _F_cuGetProcAddress_v2('cuGLSetBufferObjectMapFlags', &__cuGLSetBufferObjectMapFlags, 2030, ptds_mode, NULL) + + global __cuGLMapBufferObjectAsync_v2 + _F_cuGetProcAddress_v2('cuGLMapBufferObjectAsync', &__cuGLMapBufferObjectAsync_v2, 7000 if ptds_mode == CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM else 3020, ptds_mode, NULL) + + global __cuGLUnmapBufferObjectAsync + _F_cuGetProcAddress_v2('cuGLUnmapBufferObjectAsync', &__cuGLUnmapBufferObjectAsync, 2030, ptds_mode, NULL) + + global __cuProfilerInitialize + _F_cuGetProcAddress_v2('cuProfilerInitialize', &__cuProfilerInitialize, 4000, ptds_mode, NULL) + + global __cuProfilerStart + _F_cuGetProcAddress_v2('cuProfilerStart', &__cuProfilerStart, 4000, ptds_mode, NULL) + + global __cuProfilerStop + _F_cuGetProcAddress_v2('cuProfilerStop', &__cuProfilerStop, 4000, ptds_mode, NULL) + + global __cuVDPAUGetDevice + _F_cuGetProcAddress_v2('cuVDPAUGetDevice', &__cuVDPAUGetDevice, 3010, ptds_mode, NULL) + + global __cuVDPAUCtxCreate_v2 + _F_cuGetProcAddress_v2('cuVDPAUCtxCreate', &__cuVDPAUCtxCreate_v2, 3020, ptds_mode, NULL) + + global __cuGraphicsVDPAURegisterVideoSurface + _F_cuGetProcAddress_v2('cuGraphicsVDPAURegisterVideoSurface', &__cuGraphicsVDPAURegisterVideoSurface, 3010, ptds_mode, NULL) + + global __cuGraphicsVDPAURegisterOutputSurface + _F_cuGetProcAddress_v2('cuGraphicsVDPAURegisterOutputSurface', &__cuGraphicsVDPAURegisterOutputSurface, 3010, ptds_mode, NULL) + + global __cuDeviceGetHostAtomicCapabilities + _F_cuGetProcAddress_v2('cuDeviceGetHostAtomicCapabilities', &__cuDeviceGetHostAtomicCapabilities, 13000, ptds_mode, NULL) + + global __cuCtxGetDevice_v2 + _F_cuGetProcAddress_v2('cuCtxGetDevice', &__cuCtxGetDevice_v2, 13000, ptds_mode, NULL) + + global __cuCtxSynchronize_v2 + _F_cuGetProcAddress_v2('cuCtxSynchronize', &__cuCtxSynchronize_v2, 13000, ptds_mode, NULL) + + global __cuMemcpyBatchAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyBatchAsync', &__cuMemcpyBatchAsync_v2, 13000, ptds_mode, NULL) + + global __cuMemcpy3DBatchAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpy3DBatchAsync', &__cuMemcpy3DBatchAsync_v2, 13000, ptds_mode, NULL) + + global __cuMemGetDefaultMemPool + _F_cuGetProcAddress_v2('cuMemGetDefaultMemPool', &__cuMemGetDefaultMemPool, 13000, ptds_mode, NULL) + + global __cuMemGetMemPool + _F_cuGetProcAddress_v2('cuMemGetMemPool', &__cuMemGetMemPool, 13000, ptds_mode, NULL) + + global __cuMemSetMemPool + _F_cuGetProcAddress_v2('cuMemSetMemPool', &__cuMemSetMemPool, 13000, ptds_mode, NULL) + + global __cuMemPrefetchBatchAsync + _F_cuGetProcAddress_v2('cuMemPrefetchBatchAsync', &__cuMemPrefetchBatchAsync, 13000, ptds_mode, NULL) + + global __cuMemDiscardBatchAsync + _F_cuGetProcAddress_v2('cuMemDiscardBatchAsync', &__cuMemDiscardBatchAsync, 13000, ptds_mode, NULL) + + global __cuMemDiscardAndPrefetchBatchAsync + _F_cuGetProcAddress_v2('cuMemDiscardAndPrefetchBatchAsync', &__cuMemDiscardAndPrefetchBatchAsync, 13000, ptds_mode, NULL) + + global __cuDeviceGetP2PAtomicCapabilities + _F_cuGetProcAddress_v2('cuDeviceGetP2PAtomicCapabilities', &__cuDeviceGetP2PAtomicCapabilities, 13000, ptds_mode, NULL) + + global __cuGreenCtxGetId + _F_cuGetProcAddress_v2('cuGreenCtxGetId', &__cuGreenCtxGetId, 13000, ptds_mode, NULL) + + global __cuMulticastBindMem_v2 + _F_cuGetProcAddress_v2('cuMulticastBindMem', &__cuMulticastBindMem_v2, 13010, ptds_mode, NULL) + + global __cuMulticastBindAddr_v2 + _F_cuGetProcAddress_v2('cuMulticastBindAddr', &__cuMulticastBindAddr_v2, 13010, ptds_mode, NULL) + + global __cuGraphNodeGetContainingGraph + _F_cuGetProcAddress_v2('cuGraphNodeGetContainingGraph', &__cuGraphNodeGetContainingGraph, 13010, ptds_mode, NULL) + + global __cuGraphNodeGetLocalId + _F_cuGetProcAddress_v2('cuGraphNodeGetLocalId', &__cuGraphNodeGetLocalId, 13010, ptds_mode, NULL) + + global __cuGraphNodeGetToolsId + _F_cuGetProcAddress_v2('cuGraphNodeGetToolsId', &__cuGraphNodeGetToolsId, 13010, ptds_mode, NULL) + + global __cuGraphGetId + _F_cuGetProcAddress_v2('cuGraphGetId', &__cuGraphGetId, 13010, ptds_mode, NULL) + + global __cuGraphExecGetId + _F_cuGetProcAddress_v2('cuGraphExecGetId', &__cuGraphExecGetId, 13010, ptds_mode, NULL) + + global __cuDevSmResourceSplit + _F_cuGetProcAddress_v2('cuDevSmResourceSplit', &__cuDevSmResourceSplit, 13010, ptds_mode, NULL) + + global __cuStreamGetDevResource + _F_cuGetProcAddress_v2('cuStreamGetDevResource', &__cuStreamGetDevResource, 13010, ptds_mode, NULL) + + global __cuKernelGetParamCount + _F_cuGetProcAddress_v2('cuKernelGetParamCount', &__cuKernelGetParamCount, 13020, ptds_mode, NULL) + + global __cuMemcpyWithAttributesAsync + _F_cuGetProcAddress_v2('cuMemcpyWithAttributesAsync', &__cuMemcpyWithAttributesAsync, 13020, ptds_mode, NULL) + + global __cuMemcpy3DWithAttributesAsync + _F_cuGetProcAddress_v2('cuMemcpy3DWithAttributesAsync', &__cuMemcpy3DWithAttributesAsync, 13020, ptds_mode, NULL) + + global __cuStreamBeginCaptureToCig + _F_cuGetProcAddress_v2('cuStreamBeginCaptureToCig', &__cuStreamBeginCaptureToCig, 13020, ptds_mode, NULL) + + global __cuStreamEndCaptureToCig + _F_cuGetProcAddress_v2('cuStreamEndCaptureToCig', &__cuStreamEndCaptureToCig, 13020, ptds_mode, NULL) + + global __cuFuncGetParamCount + _F_cuGetProcAddress_v2('cuFuncGetParamCount', &__cuFuncGetParamCount, 13020, ptds_mode, NULL) + + global __cuLaunchHostFunc_v2 + _F_cuGetProcAddress_v2('cuLaunchHostFunc', &__cuLaunchHostFunc_v2, 13020, ptds_mode, NULL) + + global __cuGraphNodeGetParams + _F_cuGetProcAddress_v2('cuGraphNodeGetParams', &__cuGraphNodeGetParams, 13020, ptds_mode, NULL) + + global __cuCoredumpRegisterStartCallback + _F_cuGetProcAddress_v2('cuCoredumpRegisterStartCallback', &__cuCoredumpRegisterStartCallback, 13020, ptds_mode, NULL) + + global __cuCoredumpRegisterCompleteCallback + _F_cuGetProcAddress_v2('cuCoredumpRegisterCompleteCallback', &__cuCoredumpRegisterCompleteCallback, 13020, ptds_mode, NULL) + + global __cuCoredumpDeregisterStartCallback + _F_cuGetProcAddress_v2('cuCoredumpDeregisterStartCallback', &__cuCoredumpDeregisterStartCallback, 13020, ptds_mode, NULL) + + global __cuCoredumpDeregisterCompleteCallback + _F_cuGetProcAddress_v2('cuCoredumpDeregisterCompleteCallback', &__cuCoredumpDeregisterCompleteCallback, 13020, ptds_mode, NULL) + + global __cuLogicalEndpointIdReserve + _F_cuGetProcAddress_v2('cuLogicalEndpointIdReserve', &__cuLogicalEndpointIdReserve, 13030, ptds_mode, NULL) + + global __cuLogicalEndpointIdRelease + _F_cuGetProcAddress_v2('cuLogicalEndpointIdRelease', &__cuLogicalEndpointIdRelease, 13030, ptds_mode, NULL) + + global __cuLogicalEndpointCreate + _F_cuGetProcAddress_v2('cuLogicalEndpointCreate', &__cuLogicalEndpointCreate, 13030, ptds_mode, NULL) + + global __cuLogicalEndpointAddDevice + _F_cuGetProcAddress_v2('cuLogicalEndpointAddDevice', &__cuLogicalEndpointAddDevice, 13030, ptds_mode, NULL) + + global __cuLogicalEndpointDestroy + _F_cuGetProcAddress_v2('cuLogicalEndpointDestroy', &__cuLogicalEndpointDestroy, 13030, ptds_mode, NULL) + + global __cuLogicalEndpointBindAddr + _F_cuGetProcAddress_v2('cuLogicalEndpointBindAddr', &__cuLogicalEndpointBindAddr, 13030, ptds_mode, NULL) + + global __cuLogicalEndpointBindMem + _F_cuGetProcAddress_v2('cuLogicalEndpointBindMem', &__cuLogicalEndpointBindMem, 13030, ptds_mode, NULL) + + global __cuLogicalEndpointUnbind + _F_cuGetProcAddress_v2('cuLogicalEndpointUnbind', &__cuLogicalEndpointUnbind, 13030, ptds_mode, NULL) + + global __cuLogicalEndpointExport + _F_cuGetProcAddress_v2('cuLogicalEndpointExport', &__cuLogicalEndpointExport, 13030, ptds_mode, NULL) + + global __cuLogicalEndpointImport + _F_cuGetProcAddress_v2('cuLogicalEndpointImport', &__cuLogicalEndpointImport, 13030, ptds_mode, NULL) + + global __cuLogicalEndpointGetLimits + _F_cuGetProcAddress_v2('cuLogicalEndpointGetLimits', &__cuLogicalEndpointGetLimits, 13030, ptds_mode, NULL) + + global __cuLogicalEndpointQuery + _F_cuGetProcAddress_v2('cuLogicalEndpointQuery', &__cuLogicalEndpointQuery, 13030, ptds_mode, NULL) + + global __cuStreamBeginRecaptureToGraph + _F_cuGetProcAddress_v2('cuStreamBeginRecaptureToGraph', &__cuStreamBeginRecaptureToGraph, 13030, ptds_mode, NULL) + + __py_driver_init = True + return 0 + + +cdef inline int _check_or_init_driver() except -1 nogil: + if __py_driver_init: + return 0 + + return _init_driver() + +cdef dict func_ptrs = None + + +cpdef dict _inspect_function_pointers(): + global func_ptrs + if func_ptrs is not None: + return func_ptrs + + _check_or_init_driver() + cdef dict data = {} + + global __cuGetErrorString + data["__cuGetErrorString"] = __cuGetErrorString + + global __cuGetErrorName + data["__cuGetErrorName"] = __cuGetErrorName + + global __cuInit + data["__cuInit"] = __cuInit + + global __cuDriverGetVersion + data["__cuDriverGetVersion"] = __cuDriverGetVersion + + global __cuDeviceGet + data["__cuDeviceGet"] = __cuDeviceGet + + global __cuDeviceGetCount + data["__cuDeviceGetCount"] = __cuDeviceGetCount + + global __cuDeviceGetName + data["__cuDeviceGetName"] = __cuDeviceGetName + + global __cuDeviceGetUuid_v2 + data["__cuDeviceGetUuid_v2"] = __cuDeviceGetUuid_v2 + + global __cuDeviceGetLuid + data["__cuDeviceGetLuid"] = __cuDeviceGetLuid + + global __cuDeviceTotalMem_v2 + data["__cuDeviceTotalMem_v2"] = __cuDeviceTotalMem_v2 + + global __cuDeviceGetTexture1DLinearMaxWidth + data["__cuDeviceGetTexture1DLinearMaxWidth"] = __cuDeviceGetTexture1DLinearMaxWidth + + global __cuDeviceGetAttribute + data["__cuDeviceGetAttribute"] = __cuDeviceGetAttribute + + global __cuDeviceGetNvSciSyncAttributes + data["__cuDeviceGetNvSciSyncAttributes"] = __cuDeviceGetNvSciSyncAttributes + + global __cuDeviceSetMemPool + data["__cuDeviceSetMemPool"] = __cuDeviceSetMemPool + + global __cuDeviceGetMemPool + data["__cuDeviceGetMemPool"] = __cuDeviceGetMemPool + + global __cuDeviceGetDefaultMemPool + data["__cuDeviceGetDefaultMemPool"] = __cuDeviceGetDefaultMemPool + + global __cuDeviceGetExecAffinitySupport + data["__cuDeviceGetExecAffinitySupport"] = __cuDeviceGetExecAffinitySupport + + global __cuFlushGPUDirectRDMAWrites + data["__cuFlushGPUDirectRDMAWrites"] = __cuFlushGPUDirectRDMAWrites + + global __cuDeviceGetProperties + data["__cuDeviceGetProperties"] = __cuDeviceGetProperties + + global __cuDeviceComputeCapability + data["__cuDeviceComputeCapability"] = __cuDeviceComputeCapability + + global __cuDevicePrimaryCtxRetain + data["__cuDevicePrimaryCtxRetain"] = __cuDevicePrimaryCtxRetain + + global __cuDevicePrimaryCtxRelease_v2 + data["__cuDevicePrimaryCtxRelease_v2"] = __cuDevicePrimaryCtxRelease_v2 + + global __cuDevicePrimaryCtxSetFlags_v2 + data["__cuDevicePrimaryCtxSetFlags_v2"] = __cuDevicePrimaryCtxSetFlags_v2 + + global __cuDevicePrimaryCtxGetState + data["__cuDevicePrimaryCtxGetState"] = __cuDevicePrimaryCtxGetState + + global __cuDevicePrimaryCtxReset_v2 + data["__cuDevicePrimaryCtxReset_v2"] = __cuDevicePrimaryCtxReset_v2 + + global __cuCtxCreate_v2 + data["__cuCtxCreate_v2"] = __cuCtxCreate_v2 + + global __cuCtxCreate_v3 + data["__cuCtxCreate_v3"] = __cuCtxCreate_v3 + + global __cuCtxCreate_v4 + data["__cuCtxCreate_v4"] = __cuCtxCreate_v4 + + global __cuCtxDestroy_v2 + data["__cuCtxDestroy_v2"] = __cuCtxDestroy_v2 + + global __cuCtxPushCurrent_v2 + data["__cuCtxPushCurrent_v2"] = __cuCtxPushCurrent_v2 + + global __cuCtxPopCurrent_v2 + data["__cuCtxPopCurrent_v2"] = __cuCtxPopCurrent_v2 + + global __cuCtxSetCurrent + data["__cuCtxSetCurrent"] = __cuCtxSetCurrent + + global __cuCtxGetCurrent + data["__cuCtxGetCurrent"] = __cuCtxGetCurrent + + global __cuCtxGetDevice + data["__cuCtxGetDevice"] = __cuCtxGetDevice + + global __cuCtxGetFlags + data["__cuCtxGetFlags"] = __cuCtxGetFlags + + global __cuCtxSetFlags + data["__cuCtxSetFlags"] = __cuCtxSetFlags + + global __cuCtxGetId + data["__cuCtxGetId"] = __cuCtxGetId + + global __cuCtxSynchronize + data["__cuCtxSynchronize"] = __cuCtxSynchronize + + global __cuCtxSetLimit + data["__cuCtxSetLimit"] = __cuCtxSetLimit + + global __cuCtxGetLimit + data["__cuCtxGetLimit"] = __cuCtxGetLimit + + global __cuCtxGetCacheConfig + data["__cuCtxGetCacheConfig"] = __cuCtxGetCacheConfig + + global __cuCtxSetCacheConfig + data["__cuCtxSetCacheConfig"] = __cuCtxSetCacheConfig + + global __cuCtxGetApiVersion + data["__cuCtxGetApiVersion"] = __cuCtxGetApiVersion + + global __cuCtxGetStreamPriorityRange + data["__cuCtxGetStreamPriorityRange"] = __cuCtxGetStreamPriorityRange + + global __cuCtxResetPersistingL2Cache + data["__cuCtxResetPersistingL2Cache"] = __cuCtxResetPersistingL2Cache + + global __cuCtxGetExecAffinity + data["__cuCtxGetExecAffinity"] = __cuCtxGetExecAffinity + + global __cuCtxRecordEvent + data["__cuCtxRecordEvent"] = __cuCtxRecordEvent + + global __cuCtxWaitEvent + data["__cuCtxWaitEvent"] = __cuCtxWaitEvent + + global __cuCtxAttach + data["__cuCtxAttach"] = __cuCtxAttach + + global __cuCtxDetach + data["__cuCtxDetach"] = __cuCtxDetach + + global __cuCtxGetSharedMemConfig + data["__cuCtxGetSharedMemConfig"] = __cuCtxGetSharedMemConfig + + global __cuCtxSetSharedMemConfig + data["__cuCtxSetSharedMemConfig"] = __cuCtxSetSharedMemConfig + + global __cuModuleLoad + data["__cuModuleLoad"] = __cuModuleLoad + + global __cuModuleLoadData + data["__cuModuleLoadData"] = __cuModuleLoadData + + global __cuModuleLoadDataEx + data["__cuModuleLoadDataEx"] = __cuModuleLoadDataEx + + global __cuModuleLoadFatBinary + data["__cuModuleLoadFatBinary"] = __cuModuleLoadFatBinary + + global __cuModuleUnload + data["__cuModuleUnload"] = __cuModuleUnload + + global __cuModuleGetLoadingMode + data["__cuModuleGetLoadingMode"] = __cuModuleGetLoadingMode + + global __cuModuleGetFunction + data["__cuModuleGetFunction"] = __cuModuleGetFunction + + global __cuModuleGetFunctionCount + data["__cuModuleGetFunctionCount"] = __cuModuleGetFunctionCount + + global __cuModuleEnumerateFunctions + data["__cuModuleEnumerateFunctions"] = __cuModuleEnumerateFunctions + + global __cuModuleGetGlobal_v2 + data["__cuModuleGetGlobal_v2"] = __cuModuleGetGlobal_v2 + + global __cuLinkCreate_v2 + data["__cuLinkCreate_v2"] = __cuLinkCreate_v2 + + global __cuLinkAddData_v2 + data["__cuLinkAddData_v2"] = __cuLinkAddData_v2 + + global __cuLinkAddFile_v2 + data["__cuLinkAddFile_v2"] = __cuLinkAddFile_v2 + + global __cuLinkComplete + data["__cuLinkComplete"] = __cuLinkComplete + + global __cuLinkDestroy + data["__cuLinkDestroy"] = __cuLinkDestroy + + global __cuModuleGetTexRef + data["__cuModuleGetTexRef"] = __cuModuleGetTexRef + + global __cuModuleGetSurfRef + data["__cuModuleGetSurfRef"] = __cuModuleGetSurfRef + + global __cuLibraryLoadData + data["__cuLibraryLoadData"] = __cuLibraryLoadData + + global __cuLibraryLoadFromFile + data["__cuLibraryLoadFromFile"] = __cuLibraryLoadFromFile + + global __cuLibraryUnload + data["__cuLibraryUnload"] = __cuLibraryUnload + + global __cuLibraryGetKernel + data["__cuLibraryGetKernel"] = __cuLibraryGetKernel + + global __cuLibraryGetKernelCount + data["__cuLibraryGetKernelCount"] = __cuLibraryGetKernelCount + + global __cuLibraryEnumerateKernels + data["__cuLibraryEnumerateKernels"] = __cuLibraryEnumerateKernels + + global __cuLibraryGetModule + data["__cuLibraryGetModule"] = __cuLibraryGetModule + + global __cuKernelGetFunction + data["__cuKernelGetFunction"] = __cuKernelGetFunction + + global __cuKernelGetLibrary + data["__cuKernelGetLibrary"] = __cuKernelGetLibrary + + global __cuLibraryGetGlobal + data["__cuLibraryGetGlobal"] = __cuLibraryGetGlobal + + global __cuLibraryGetManaged + data["__cuLibraryGetManaged"] = __cuLibraryGetManaged + + global __cuLibraryGetUnifiedFunction + data["__cuLibraryGetUnifiedFunction"] = __cuLibraryGetUnifiedFunction + + global __cuKernelGetAttribute + data["__cuKernelGetAttribute"] = __cuKernelGetAttribute + + global __cuKernelSetAttribute + data["__cuKernelSetAttribute"] = __cuKernelSetAttribute + + global __cuKernelSetCacheConfig + data["__cuKernelSetCacheConfig"] = __cuKernelSetCacheConfig + + global __cuKernelGetName + data["__cuKernelGetName"] = __cuKernelGetName + + global __cuKernelGetParamInfo + data["__cuKernelGetParamInfo"] = __cuKernelGetParamInfo + + global __cuMemGetInfo_v2 + data["__cuMemGetInfo_v2"] = __cuMemGetInfo_v2 + + global __cuMemAlloc_v2 + data["__cuMemAlloc_v2"] = __cuMemAlloc_v2 + + global __cuMemAllocPitch_v2 + data["__cuMemAllocPitch_v2"] = __cuMemAllocPitch_v2 + + global __cuMemFree_v2 + data["__cuMemFree_v2"] = __cuMemFree_v2 + + global __cuMemGetAddressRange_v2 + data["__cuMemGetAddressRange_v2"] = __cuMemGetAddressRange_v2 + + global __cuMemAllocHost_v2 + data["__cuMemAllocHost_v2"] = __cuMemAllocHost_v2 + + global __cuMemFreeHost + data["__cuMemFreeHost"] = __cuMemFreeHost + + global __cuMemHostAlloc + data["__cuMemHostAlloc"] = __cuMemHostAlloc + + global __cuMemHostGetDevicePointer_v2 + data["__cuMemHostGetDevicePointer_v2"] = __cuMemHostGetDevicePointer_v2 + + global __cuMemHostGetFlags + data["__cuMemHostGetFlags"] = __cuMemHostGetFlags + + global __cuMemAllocManaged + data["__cuMemAllocManaged"] = __cuMemAllocManaged + + global __cuDeviceRegisterAsyncNotification + data["__cuDeviceRegisterAsyncNotification"] = __cuDeviceRegisterAsyncNotification + + global __cuDeviceUnregisterAsyncNotification + data["__cuDeviceUnregisterAsyncNotification"] = __cuDeviceUnregisterAsyncNotification + + global __cuDeviceGetByPCIBusId + data["__cuDeviceGetByPCIBusId"] = __cuDeviceGetByPCIBusId + + global __cuDeviceGetPCIBusId + data["__cuDeviceGetPCIBusId"] = __cuDeviceGetPCIBusId + + global __cuIpcGetEventHandle + data["__cuIpcGetEventHandle"] = __cuIpcGetEventHandle + + global __cuIpcOpenEventHandle + data["__cuIpcOpenEventHandle"] = __cuIpcOpenEventHandle + + global __cuIpcGetMemHandle + data["__cuIpcGetMemHandle"] = __cuIpcGetMemHandle + + global __cuIpcOpenMemHandle_v2 + data["__cuIpcOpenMemHandle_v2"] = __cuIpcOpenMemHandle_v2 + + global __cuIpcCloseMemHandle + data["__cuIpcCloseMemHandle"] = __cuIpcCloseMemHandle + + global __cuMemHostRegister_v2 + data["__cuMemHostRegister_v2"] = __cuMemHostRegister_v2 + + global __cuMemHostUnregister + data["__cuMemHostUnregister"] = __cuMemHostUnregister + + global __cuMemcpy + data["__cuMemcpy"] = __cuMemcpy + + global __cuMemcpyPeer + data["__cuMemcpyPeer"] = __cuMemcpyPeer + + global __cuMemcpyHtoD_v2 + data["__cuMemcpyHtoD_v2"] = __cuMemcpyHtoD_v2 + + global __cuMemcpyDtoH_v2 + data["__cuMemcpyDtoH_v2"] = __cuMemcpyDtoH_v2 + + global __cuMemcpyDtoD_v2 + data["__cuMemcpyDtoD_v2"] = __cuMemcpyDtoD_v2 + + global __cuMemcpyDtoA_v2 + data["__cuMemcpyDtoA_v2"] = __cuMemcpyDtoA_v2 + + global __cuMemcpyAtoD_v2 + data["__cuMemcpyAtoD_v2"] = __cuMemcpyAtoD_v2 + + global __cuMemcpyHtoA_v2 + data["__cuMemcpyHtoA_v2"] = __cuMemcpyHtoA_v2 + + global __cuMemcpyAtoH_v2 + data["__cuMemcpyAtoH_v2"] = __cuMemcpyAtoH_v2 + + global __cuMemcpyAtoA_v2 + data["__cuMemcpyAtoA_v2"] = __cuMemcpyAtoA_v2 + + global __cuMemcpy2D_v2 + data["__cuMemcpy2D_v2"] = __cuMemcpy2D_v2 + + global __cuMemcpy2DUnaligned_v2 + data["__cuMemcpy2DUnaligned_v2"] = __cuMemcpy2DUnaligned_v2 + + global __cuMemcpy3D_v2 + data["__cuMemcpy3D_v2"] = __cuMemcpy3D_v2 + + global __cuMemcpy3DPeer + data["__cuMemcpy3DPeer"] = __cuMemcpy3DPeer + + global __cuMemcpyAsync + data["__cuMemcpyAsync"] = __cuMemcpyAsync + + global __cuMemcpyPeerAsync + data["__cuMemcpyPeerAsync"] = __cuMemcpyPeerAsync + + global __cuMemcpyHtoDAsync_v2 + data["__cuMemcpyHtoDAsync_v2"] = __cuMemcpyHtoDAsync_v2 + + global __cuMemcpyDtoHAsync_v2 + data["__cuMemcpyDtoHAsync_v2"] = __cuMemcpyDtoHAsync_v2 + + global __cuMemcpyDtoDAsync_v2 + data["__cuMemcpyDtoDAsync_v2"] = __cuMemcpyDtoDAsync_v2 + + global __cuMemcpyHtoAAsync_v2 + data["__cuMemcpyHtoAAsync_v2"] = __cuMemcpyHtoAAsync_v2 + + global __cuMemcpyAtoHAsync_v2 + data["__cuMemcpyAtoHAsync_v2"] = __cuMemcpyAtoHAsync_v2 + + global __cuMemcpy2DAsync_v2 + data["__cuMemcpy2DAsync_v2"] = __cuMemcpy2DAsync_v2 + + global __cuMemcpy3DAsync_v2 + data["__cuMemcpy3DAsync_v2"] = __cuMemcpy3DAsync_v2 + + global __cuMemcpy3DPeerAsync + data["__cuMemcpy3DPeerAsync"] = __cuMemcpy3DPeerAsync + + global __cuMemsetD8_v2 + data["__cuMemsetD8_v2"] = __cuMemsetD8_v2 + + global __cuMemsetD16_v2 + data["__cuMemsetD16_v2"] = __cuMemsetD16_v2 + + global __cuMemsetD32_v2 + data["__cuMemsetD32_v2"] = __cuMemsetD32_v2 + + global __cuMemsetD2D8_v2 + data["__cuMemsetD2D8_v2"] = __cuMemsetD2D8_v2 + + global __cuMemsetD2D16_v2 + data["__cuMemsetD2D16_v2"] = __cuMemsetD2D16_v2 + + global __cuMemsetD2D32_v2 + data["__cuMemsetD2D32_v2"] = __cuMemsetD2D32_v2 + + global __cuMemsetD8Async + data["__cuMemsetD8Async"] = __cuMemsetD8Async + + global __cuMemsetD16Async + data["__cuMemsetD16Async"] = __cuMemsetD16Async + + global __cuMemsetD32Async + data["__cuMemsetD32Async"] = __cuMemsetD32Async + + global __cuMemsetD2D8Async + data["__cuMemsetD2D8Async"] = __cuMemsetD2D8Async + + global __cuMemsetD2D16Async + data["__cuMemsetD2D16Async"] = __cuMemsetD2D16Async + + global __cuMemsetD2D32Async + data["__cuMemsetD2D32Async"] = __cuMemsetD2D32Async + + global __cuArrayCreate_v2 + data["__cuArrayCreate_v2"] = __cuArrayCreate_v2 + + global __cuArrayGetDescriptor_v2 + data["__cuArrayGetDescriptor_v2"] = __cuArrayGetDescriptor_v2 + + global __cuArrayGetSparseProperties + data["__cuArrayGetSparseProperties"] = __cuArrayGetSparseProperties + + global __cuMipmappedArrayGetSparseProperties + data["__cuMipmappedArrayGetSparseProperties"] = __cuMipmappedArrayGetSparseProperties + + global __cuArrayGetMemoryRequirements + data["__cuArrayGetMemoryRequirements"] = __cuArrayGetMemoryRequirements + + global __cuMipmappedArrayGetMemoryRequirements + data["__cuMipmappedArrayGetMemoryRequirements"] = __cuMipmappedArrayGetMemoryRequirements + + global __cuArrayGetPlane + data["__cuArrayGetPlane"] = __cuArrayGetPlane + + global __cuArrayDestroy + data["__cuArrayDestroy"] = __cuArrayDestroy + + global __cuArray3DCreate_v2 + data["__cuArray3DCreate_v2"] = __cuArray3DCreate_v2 + + global __cuArray3DGetDescriptor_v2 + data["__cuArray3DGetDescriptor_v2"] = __cuArray3DGetDescriptor_v2 + + global __cuMipmappedArrayCreate + data["__cuMipmappedArrayCreate"] = __cuMipmappedArrayCreate + + global __cuMipmappedArrayGetLevel + data["__cuMipmappedArrayGetLevel"] = __cuMipmappedArrayGetLevel + + global __cuMipmappedArrayDestroy + data["__cuMipmappedArrayDestroy"] = __cuMipmappedArrayDestroy + + global __cuMemGetHandleForAddressRange + data["__cuMemGetHandleForAddressRange"] = __cuMemGetHandleForAddressRange + + global __cuMemBatchDecompressAsync + data["__cuMemBatchDecompressAsync"] = __cuMemBatchDecompressAsync + + global __cuMemAddressReserve + data["__cuMemAddressReserve"] = __cuMemAddressReserve + + global __cuMemAddressFree + data["__cuMemAddressFree"] = __cuMemAddressFree + + global __cuMemCreate + data["__cuMemCreate"] = __cuMemCreate + + global __cuMemRelease + data["__cuMemRelease"] = __cuMemRelease + + global __cuMemMap + data["__cuMemMap"] = __cuMemMap + + global __cuMemMapArrayAsync + data["__cuMemMapArrayAsync"] = __cuMemMapArrayAsync + + global __cuMemUnmap + data["__cuMemUnmap"] = __cuMemUnmap + + global __cuMemSetAccess + data["__cuMemSetAccess"] = __cuMemSetAccess + + global __cuMemGetAccess + data["__cuMemGetAccess"] = __cuMemGetAccess + + global __cuMemExportToShareableHandle + data["__cuMemExportToShareableHandle"] = __cuMemExportToShareableHandle + + global __cuMemImportFromShareableHandle + data["__cuMemImportFromShareableHandle"] = __cuMemImportFromShareableHandle + + global __cuMemGetAllocationGranularity + data["__cuMemGetAllocationGranularity"] = __cuMemGetAllocationGranularity + + global __cuMemGetAllocationPropertiesFromHandle + data["__cuMemGetAllocationPropertiesFromHandle"] = __cuMemGetAllocationPropertiesFromHandle + + global __cuMemRetainAllocationHandle + data["__cuMemRetainAllocationHandle"] = __cuMemRetainAllocationHandle + + global __cuMemFreeAsync + data["__cuMemFreeAsync"] = __cuMemFreeAsync + + global __cuMemAllocAsync + data["__cuMemAllocAsync"] = __cuMemAllocAsync + + global __cuMemPoolTrimTo + data["__cuMemPoolTrimTo"] = __cuMemPoolTrimTo + + global __cuMemPoolSetAttribute + data["__cuMemPoolSetAttribute"] = __cuMemPoolSetAttribute + + global __cuMemPoolGetAttribute + data["__cuMemPoolGetAttribute"] = __cuMemPoolGetAttribute + + global __cuMemPoolSetAccess + data["__cuMemPoolSetAccess"] = __cuMemPoolSetAccess + + global __cuMemPoolGetAccess + data["__cuMemPoolGetAccess"] = __cuMemPoolGetAccess + + global __cuMemPoolCreate + data["__cuMemPoolCreate"] = __cuMemPoolCreate + + global __cuMemPoolDestroy + data["__cuMemPoolDestroy"] = __cuMemPoolDestroy + + global __cuMemAllocFromPoolAsync + data["__cuMemAllocFromPoolAsync"] = __cuMemAllocFromPoolAsync + + global __cuMemPoolExportToShareableHandle + data["__cuMemPoolExportToShareableHandle"] = __cuMemPoolExportToShareableHandle + + global __cuMemPoolImportFromShareableHandle + data["__cuMemPoolImportFromShareableHandle"] = __cuMemPoolImportFromShareableHandle + + global __cuMemPoolExportPointer + data["__cuMemPoolExportPointer"] = __cuMemPoolExportPointer + + global __cuMemPoolImportPointer + data["__cuMemPoolImportPointer"] = __cuMemPoolImportPointer + + global __cuMulticastCreate + data["__cuMulticastCreate"] = __cuMulticastCreate + + global __cuMulticastAddDevice + data["__cuMulticastAddDevice"] = __cuMulticastAddDevice + + global __cuMulticastBindMem + data["__cuMulticastBindMem"] = __cuMulticastBindMem + + global __cuMulticastBindAddr + data["__cuMulticastBindAddr"] = __cuMulticastBindAddr + + global __cuMulticastUnbind + data["__cuMulticastUnbind"] = __cuMulticastUnbind + + global __cuMulticastGetGranularity + data["__cuMulticastGetGranularity"] = __cuMulticastGetGranularity + + global __cuPointerGetAttribute + data["__cuPointerGetAttribute"] = __cuPointerGetAttribute + + global __cuMemPrefetchAsync_v2 + data["__cuMemPrefetchAsync_v2"] = __cuMemPrefetchAsync_v2 + + global __cuMemAdvise_v2 + data["__cuMemAdvise_v2"] = __cuMemAdvise_v2 + + global __cuMemRangeGetAttribute + data["__cuMemRangeGetAttribute"] = __cuMemRangeGetAttribute + + global __cuMemRangeGetAttributes + data["__cuMemRangeGetAttributes"] = __cuMemRangeGetAttributes + + global __cuPointerSetAttribute + data["__cuPointerSetAttribute"] = __cuPointerSetAttribute + + global __cuPointerGetAttributes + data["__cuPointerGetAttributes"] = __cuPointerGetAttributes + + global __cuStreamCreate + data["__cuStreamCreate"] = __cuStreamCreate + + global __cuStreamCreateWithPriority + data["__cuStreamCreateWithPriority"] = __cuStreamCreateWithPriority + + global __cuStreamGetPriority + data["__cuStreamGetPriority"] = __cuStreamGetPriority + + global __cuStreamGetDevice + data["__cuStreamGetDevice"] = __cuStreamGetDevice + + global __cuStreamGetFlags + data["__cuStreamGetFlags"] = __cuStreamGetFlags + + global __cuStreamGetId + data["__cuStreamGetId"] = __cuStreamGetId + + global __cuStreamGetCtx + data["__cuStreamGetCtx"] = __cuStreamGetCtx + + global __cuStreamGetCtx_v2 + data["__cuStreamGetCtx_v2"] = __cuStreamGetCtx_v2 + + global __cuStreamWaitEvent + data["__cuStreamWaitEvent"] = __cuStreamWaitEvent + + global __cuStreamAddCallback + data["__cuStreamAddCallback"] = __cuStreamAddCallback + + global __cuStreamBeginCapture_v2 + data["__cuStreamBeginCapture_v2"] = __cuStreamBeginCapture_v2 + + global __cuStreamBeginCaptureToGraph + data["__cuStreamBeginCaptureToGraph"] = __cuStreamBeginCaptureToGraph + + global __cuThreadExchangeStreamCaptureMode + data["__cuThreadExchangeStreamCaptureMode"] = __cuThreadExchangeStreamCaptureMode + + global __cuStreamEndCapture + data["__cuStreamEndCapture"] = __cuStreamEndCapture + + global __cuStreamIsCapturing + data["__cuStreamIsCapturing"] = __cuStreamIsCapturing + + global __cuStreamGetCaptureInfo_v2 + data["__cuStreamGetCaptureInfo_v2"] = __cuStreamGetCaptureInfo_v2 + + global __cuStreamGetCaptureInfo_v3 + data["__cuStreamGetCaptureInfo_v3"] = __cuStreamGetCaptureInfo_v3 + + global __cuStreamUpdateCaptureDependencies_v2 + data["__cuStreamUpdateCaptureDependencies_v2"] = __cuStreamUpdateCaptureDependencies_v2 + + global __cuStreamAttachMemAsync + data["__cuStreamAttachMemAsync"] = __cuStreamAttachMemAsync + + global __cuStreamQuery + data["__cuStreamQuery"] = __cuStreamQuery + + global __cuStreamSynchronize + data["__cuStreamSynchronize"] = __cuStreamSynchronize + + global __cuStreamDestroy_v2 + data["__cuStreamDestroy_v2"] = __cuStreamDestroy_v2 + + global __cuStreamCopyAttributes + data["__cuStreamCopyAttributes"] = __cuStreamCopyAttributes + + global __cuStreamGetAttribute + data["__cuStreamGetAttribute"] = __cuStreamGetAttribute + + global __cuStreamSetAttribute + data["__cuStreamSetAttribute"] = __cuStreamSetAttribute + + global __cuEventCreate + data["__cuEventCreate"] = __cuEventCreate + + global __cuEventRecord + data["__cuEventRecord"] = __cuEventRecord + + global __cuEventRecordWithFlags + data["__cuEventRecordWithFlags"] = __cuEventRecordWithFlags + + global __cuEventQuery + data["__cuEventQuery"] = __cuEventQuery + + global __cuEventSynchronize + data["__cuEventSynchronize"] = __cuEventSynchronize + + global __cuEventDestroy_v2 + data["__cuEventDestroy_v2"] = __cuEventDestroy_v2 + + global __cuEventElapsedTime_v2 + data["__cuEventElapsedTime_v2"] = __cuEventElapsedTime_v2 + + global __cuImportExternalMemory + data["__cuImportExternalMemory"] = __cuImportExternalMemory + + global __cuExternalMemoryGetMappedBuffer + data["__cuExternalMemoryGetMappedBuffer"] = __cuExternalMemoryGetMappedBuffer + + global __cuExternalMemoryGetMappedMipmappedArray + data["__cuExternalMemoryGetMappedMipmappedArray"] = __cuExternalMemoryGetMappedMipmappedArray + + global __cuDestroyExternalMemory + data["__cuDestroyExternalMemory"] = __cuDestroyExternalMemory + + global __cuImportExternalSemaphore + data["__cuImportExternalSemaphore"] = __cuImportExternalSemaphore + + global __cuSignalExternalSemaphoresAsync + data["__cuSignalExternalSemaphoresAsync"] = __cuSignalExternalSemaphoresAsync + + global __cuWaitExternalSemaphoresAsync + data["__cuWaitExternalSemaphoresAsync"] = __cuWaitExternalSemaphoresAsync + + global __cuDestroyExternalSemaphore + data["__cuDestroyExternalSemaphore"] = __cuDestroyExternalSemaphore + + global __cuStreamWaitValue32_v2 + data["__cuStreamWaitValue32_v2"] = __cuStreamWaitValue32_v2 + + global __cuStreamWaitValue64_v2 + data["__cuStreamWaitValue64_v2"] = __cuStreamWaitValue64_v2 + + global __cuStreamWriteValue32_v2 + data["__cuStreamWriteValue32_v2"] = __cuStreamWriteValue32_v2 + + global __cuStreamWriteValue64_v2 + data["__cuStreamWriteValue64_v2"] = __cuStreamWriteValue64_v2 + + global __cuStreamBatchMemOp_v2 + data["__cuStreamBatchMemOp_v2"] = __cuStreamBatchMemOp_v2 + + global __cuFuncGetAttribute + data["__cuFuncGetAttribute"] = __cuFuncGetAttribute + + global __cuFuncSetAttribute + data["__cuFuncSetAttribute"] = __cuFuncSetAttribute + + global __cuFuncSetCacheConfig + data["__cuFuncSetCacheConfig"] = __cuFuncSetCacheConfig + + global __cuFuncGetModule + data["__cuFuncGetModule"] = __cuFuncGetModule + + global __cuFuncGetName + data["__cuFuncGetName"] = __cuFuncGetName + + global __cuFuncGetParamInfo + data["__cuFuncGetParamInfo"] = __cuFuncGetParamInfo + + global __cuFuncIsLoaded + data["__cuFuncIsLoaded"] = __cuFuncIsLoaded + + global __cuFuncLoad + data["__cuFuncLoad"] = __cuFuncLoad + + global __cuLaunchKernel + data["__cuLaunchKernel"] = __cuLaunchKernel + + global __cuLaunchKernelEx + data["__cuLaunchKernelEx"] = __cuLaunchKernelEx + + global __cuLaunchCooperativeKernel + data["__cuLaunchCooperativeKernel"] = __cuLaunchCooperativeKernel + + global __cuLaunchCooperativeKernelMultiDevice + data["__cuLaunchCooperativeKernelMultiDevice"] = __cuLaunchCooperativeKernelMultiDevice + + global __cuLaunchHostFunc + data["__cuLaunchHostFunc"] = __cuLaunchHostFunc + + global __cuFuncSetBlockShape + data["__cuFuncSetBlockShape"] = __cuFuncSetBlockShape + + global __cuFuncSetSharedSize + data["__cuFuncSetSharedSize"] = __cuFuncSetSharedSize + + global __cuParamSetSize + data["__cuParamSetSize"] = __cuParamSetSize + + global __cuParamSeti + data["__cuParamSeti"] = __cuParamSeti + + global __cuParamSetf + data["__cuParamSetf"] = __cuParamSetf + + global __cuParamSetv + data["__cuParamSetv"] = __cuParamSetv + + global __cuLaunch + data["__cuLaunch"] = __cuLaunch + + global __cuLaunchGrid + data["__cuLaunchGrid"] = __cuLaunchGrid + + global __cuLaunchGridAsync + data["__cuLaunchGridAsync"] = __cuLaunchGridAsync + + global __cuParamSetTexRef + data["__cuParamSetTexRef"] = __cuParamSetTexRef + + global __cuFuncSetSharedMemConfig + data["__cuFuncSetSharedMemConfig"] = __cuFuncSetSharedMemConfig + + global __cuGraphCreate + data["__cuGraphCreate"] = __cuGraphCreate + + global __cuGraphAddKernelNode_v2 + data["__cuGraphAddKernelNode_v2"] = __cuGraphAddKernelNode_v2 + + global __cuGraphKernelNodeGetParams_v2 + data["__cuGraphKernelNodeGetParams_v2"] = __cuGraphKernelNodeGetParams_v2 + + global __cuGraphKernelNodeSetParams_v2 + data["__cuGraphKernelNodeSetParams_v2"] = __cuGraphKernelNodeSetParams_v2 + + global __cuGraphAddMemcpyNode + data["__cuGraphAddMemcpyNode"] = __cuGraphAddMemcpyNode + + global __cuGraphMemcpyNodeGetParams + data["__cuGraphMemcpyNodeGetParams"] = __cuGraphMemcpyNodeGetParams + + global __cuGraphMemcpyNodeSetParams + data["__cuGraphMemcpyNodeSetParams"] = __cuGraphMemcpyNodeSetParams + + global __cuGraphAddMemsetNode + data["__cuGraphAddMemsetNode"] = __cuGraphAddMemsetNode + + global __cuGraphMemsetNodeGetParams + data["__cuGraphMemsetNodeGetParams"] = __cuGraphMemsetNodeGetParams + + global __cuGraphMemsetNodeSetParams + data["__cuGraphMemsetNodeSetParams"] = __cuGraphMemsetNodeSetParams + + global __cuGraphAddHostNode + data["__cuGraphAddHostNode"] = __cuGraphAddHostNode + + global __cuGraphHostNodeGetParams + data["__cuGraphHostNodeGetParams"] = __cuGraphHostNodeGetParams + + global __cuGraphHostNodeSetParams + data["__cuGraphHostNodeSetParams"] = __cuGraphHostNodeSetParams + + global __cuGraphAddChildGraphNode + data["__cuGraphAddChildGraphNode"] = __cuGraphAddChildGraphNode + + global __cuGraphChildGraphNodeGetGraph + data["__cuGraphChildGraphNodeGetGraph"] = __cuGraphChildGraphNodeGetGraph + + global __cuGraphAddEmptyNode + data["__cuGraphAddEmptyNode"] = __cuGraphAddEmptyNode + + global __cuGraphAddEventRecordNode + data["__cuGraphAddEventRecordNode"] = __cuGraphAddEventRecordNode + + global __cuGraphEventRecordNodeGetEvent + data["__cuGraphEventRecordNodeGetEvent"] = __cuGraphEventRecordNodeGetEvent + + global __cuGraphEventRecordNodeSetEvent + data["__cuGraphEventRecordNodeSetEvent"] = __cuGraphEventRecordNodeSetEvent + + global __cuGraphAddEventWaitNode + data["__cuGraphAddEventWaitNode"] = __cuGraphAddEventWaitNode + + global __cuGraphEventWaitNodeGetEvent + data["__cuGraphEventWaitNodeGetEvent"] = __cuGraphEventWaitNodeGetEvent + + global __cuGraphEventWaitNodeSetEvent + data["__cuGraphEventWaitNodeSetEvent"] = __cuGraphEventWaitNodeSetEvent + + global __cuGraphAddExternalSemaphoresSignalNode + data["__cuGraphAddExternalSemaphoresSignalNode"] = __cuGraphAddExternalSemaphoresSignalNode + + global __cuGraphExternalSemaphoresSignalNodeGetParams + data["__cuGraphExternalSemaphoresSignalNodeGetParams"] = __cuGraphExternalSemaphoresSignalNodeGetParams + + global __cuGraphExternalSemaphoresSignalNodeSetParams + data["__cuGraphExternalSemaphoresSignalNodeSetParams"] = __cuGraphExternalSemaphoresSignalNodeSetParams + + global __cuGraphAddExternalSemaphoresWaitNode + data["__cuGraphAddExternalSemaphoresWaitNode"] = __cuGraphAddExternalSemaphoresWaitNode + + global __cuGraphExternalSemaphoresWaitNodeGetParams + data["__cuGraphExternalSemaphoresWaitNodeGetParams"] = __cuGraphExternalSemaphoresWaitNodeGetParams + + global __cuGraphExternalSemaphoresWaitNodeSetParams + data["__cuGraphExternalSemaphoresWaitNodeSetParams"] = __cuGraphExternalSemaphoresWaitNodeSetParams + + global __cuGraphAddBatchMemOpNode + data["__cuGraphAddBatchMemOpNode"] = __cuGraphAddBatchMemOpNode + + global __cuGraphBatchMemOpNodeGetParams + data["__cuGraphBatchMemOpNodeGetParams"] = __cuGraphBatchMemOpNodeGetParams + + global __cuGraphBatchMemOpNodeSetParams + data["__cuGraphBatchMemOpNodeSetParams"] = __cuGraphBatchMemOpNodeSetParams + + global __cuGraphExecBatchMemOpNodeSetParams + data["__cuGraphExecBatchMemOpNodeSetParams"] = __cuGraphExecBatchMemOpNodeSetParams + + global __cuGraphAddMemAllocNode + data["__cuGraphAddMemAllocNode"] = __cuGraphAddMemAllocNode + + global __cuGraphMemAllocNodeGetParams + data["__cuGraphMemAllocNodeGetParams"] = __cuGraphMemAllocNodeGetParams + + global __cuGraphAddMemFreeNode + data["__cuGraphAddMemFreeNode"] = __cuGraphAddMemFreeNode + + global __cuGraphMemFreeNodeGetParams + data["__cuGraphMemFreeNodeGetParams"] = __cuGraphMemFreeNodeGetParams + + global __cuDeviceGraphMemTrim + data["__cuDeviceGraphMemTrim"] = __cuDeviceGraphMemTrim + + global __cuDeviceGetGraphMemAttribute + data["__cuDeviceGetGraphMemAttribute"] = __cuDeviceGetGraphMemAttribute + + global __cuDeviceSetGraphMemAttribute + data["__cuDeviceSetGraphMemAttribute"] = __cuDeviceSetGraphMemAttribute + + global __cuGraphClone + data["__cuGraphClone"] = __cuGraphClone + + global __cuGraphNodeFindInClone + data["__cuGraphNodeFindInClone"] = __cuGraphNodeFindInClone + + global __cuGraphNodeGetType + data["__cuGraphNodeGetType"] = __cuGraphNodeGetType + + global __cuGraphGetNodes + data["__cuGraphGetNodes"] = __cuGraphGetNodes + + global __cuGraphGetRootNodes + data["__cuGraphGetRootNodes"] = __cuGraphGetRootNodes + + global __cuGraphGetEdges_v2 + data["__cuGraphGetEdges_v2"] = __cuGraphGetEdges_v2 + + global __cuGraphNodeGetDependencies_v2 + data["__cuGraphNodeGetDependencies_v2"] = __cuGraphNodeGetDependencies_v2 + + global __cuGraphNodeGetDependentNodes_v2 + data["__cuGraphNodeGetDependentNodes_v2"] = __cuGraphNodeGetDependentNodes_v2 + + global __cuGraphAddDependencies_v2 + data["__cuGraphAddDependencies_v2"] = __cuGraphAddDependencies_v2 + + global __cuGraphRemoveDependencies_v2 + data["__cuGraphRemoveDependencies_v2"] = __cuGraphRemoveDependencies_v2 + + global __cuGraphDestroyNode + data["__cuGraphDestroyNode"] = __cuGraphDestroyNode + + global __cuGraphInstantiateWithFlags + data["__cuGraphInstantiateWithFlags"] = __cuGraphInstantiateWithFlags + + global __cuGraphInstantiateWithParams + data["__cuGraphInstantiateWithParams"] = __cuGraphInstantiateWithParams + + global __cuGraphExecGetFlags + data["__cuGraphExecGetFlags"] = __cuGraphExecGetFlags + + global __cuGraphExecKernelNodeSetParams_v2 + data["__cuGraphExecKernelNodeSetParams_v2"] = __cuGraphExecKernelNodeSetParams_v2 + + global __cuGraphExecMemcpyNodeSetParams + data["__cuGraphExecMemcpyNodeSetParams"] = __cuGraphExecMemcpyNodeSetParams + + global __cuGraphExecMemsetNodeSetParams + data["__cuGraphExecMemsetNodeSetParams"] = __cuGraphExecMemsetNodeSetParams + + global __cuGraphExecHostNodeSetParams + data["__cuGraphExecHostNodeSetParams"] = __cuGraphExecHostNodeSetParams + + global __cuGraphExecChildGraphNodeSetParams + data["__cuGraphExecChildGraphNodeSetParams"] = __cuGraphExecChildGraphNodeSetParams + + global __cuGraphExecEventRecordNodeSetEvent + data["__cuGraphExecEventRecordNodeSetEvent"] = __cuGraphExecEventRecordNodeSetEvent + + global __cuGraphExecEventWaitNodeSetEvent + data["__cuGraphExecEventWaitNodeSetEvent"] = __cuGraphExecEventWaitNodeSetEvent + + global __cuGraphExecExternalSemaphoresSignalNodeSetParams + data["__cuGraphExecExternalSemaphoresSignalNodeSetParams"] = __cuGraphExecExternalSemaphoresSignalNodeSetParams + + global __cuGraphExecExternalSemaphoresWaitNodeSetParams + data["__cuGraphExecExternalSemaphoresWaitNodeSetParams"] = __cuGraphExecExternalSemaphoresWaitNodeSetParams + + global __cuGraphNodeSetEnabled + data["__cuGraphNodeSetEnabled"] = __cuGraphNodeSetEnabled + + global __cuGraphNodeGetEnabled + data["__cuGraphNodeGetEnabled"] = __cuGraphNodeGetEnabled + + global __cuGraphUpload + data["__cuGraphUpload"] = __cuGraphUpload + + global __cuGraphLaunch + data["__cuGraphLaunch"] = __cuGraphLaunch + + global __cuGraphExecDestroy + data["__cuGraphExecDestroy"] = __cuGraphExecDestroy + + global __cuGraphDestroy + data["__cuGraphDestroy"] = __cuGraphDestroy + + global __cuGraphExecUpdate_v2 + data["__cuGraphExecUpdate_v2"] = __cuGraphExecUpdate_v2 + + global __cuGraphKernelNodeCopyAttributes + data["__cuGraphKernelNodeCopyAttributes"] = __cuGraphKernelNodeCopyAttributes + + global __cuGraphKernelNodeGetAttribute + data["__cuGraphKernelNodeGetAttribute"] = __cuGraphKernelNodeGetAttribute + + global __cuGraphKernelNodeSetAttribute + data["__cuGraphKernelNodeSetAttribute"] = __cuGraphKernelNodeSetAttribute + + global __cuGraphDebugDotPrint + data["__cuGraphDebugDotPrint"] = __cuGraphDebugDotPrint + + global __cuUserObjectCreate + data["__cuUserObjectCreate"] = __cuUserObjectCreate + + global __cuUserObjectRetain + data["__cuUserObjectRetain"] = __cuUserObjectRetain + + global __cuUserObjectRelease + data["__cuUserObjectRelease"] = __cuUserObjectRelease + + global __cuGraphRetainUserObject + data["__cuGraphRetainUserObject"] = __cuGraphRetainUserObject + + global __cuGraphReleaseUserObject + data["__cuGraphReleaseUserObject"] = __cuGraphReleaseUserObject + + global __cuGraphAddNode_v2 + data["__cuGraphAddNode_v2"] = __cuGraphAddNode_v2 + + global __cuGraphNodeSetParams + data["__cuGraphNodeSetParams"] = __cuGraphNodeSetParams + + global __cuGraphExecNodeSetParams + data["__cuGraphExecNodeSetParams"] = __cuGraphExecNodeSetParams + + global __cuGraphConditionalHandleCreate + data["__cuGraphConditionalHandleCreate"] = __cuGraphConditionalHandleCreate + + global __cuOccupancyMaxActiveBlocksPerMultiprocessor + data["__cuOccupancyMaxActiveBlocksPerMultiprocessor"] = __cuOccupancyMaxActiveBlocksPerMultiprocessor + + global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags + data["__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags"] = __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags + + global __cuOccupancyMaxPotentialBlockSize + data["__cuOccupancyMaxPotentialBlockSize"] = __cuOccupancyMaxPotentialBlockSize + + global __cuOccupancyMaxPotentialBlockSizeWithFlags + data["__cuOccupancyMaxPotentialBlockSizeWithFlags"] = __cuOccupancyMaxPotentialBlockSizeWithFlags + + global __cuOccupancyAvailableDynamicSMemPerBlock + data["__cuOccupancyAvailableDynamicSMemPerBlock"] = __cuOccupancyAvailableDynamicSMemPerBlock + + global __cuOccupancyMaxPotentialClusterSize + data["__cuOccupancyMaxPotentialClusterSize"] = __cuOccupancyMaxPotentialClusterSize + + global __cuOccupancyMaxActiveClusters + data["__cuOccupancyMaxActiveClusters"] = __cuOccupancyMaxActiveClusters + + global __cuTexRefSetArray + data["__cuTexRefSetArray"] = __cuTexRefSetArray + + global __cuTexRefSetMipmappedArray + data["__cuTexRefSetMipmappedArray"] = __cuTexRefSetMipmappedArray + + global __cuTexRefSetAddress_v2 + data["__cuTexRefSetAddress_v2"] = __cuTexRefSetAddress_v2 + + global __cuTexRefSetAddress2D_v3 + data["__cuTexRefSetAddress2D_v3"] = __cuTexRefSetAddress2D_v3 + + global __cuTexRefSetFormat + data["__cuTexRefSetFormat"] = __cuTexRefSetFormat + + global __cuTexRefSetAddressMode + data["__cuTexRefSetAddressMode"] = __cuTexRefSetAddressMode + + global __cuTexRefSetFilterMode + data["__cuTexRefSetFilterMode"] = __cuTexRefSetFilterMode + + global __cuTexRefSetMipmapFilterMode + data["__cuTexRefSetMipmapFilterMode"] = __cuTexRefSetMipmapFilterMode + + global __cuTexRefSetMipmapLevelBias + data["__cuTexRefSetMipmapLevelBias"] = __cuTexRefSetMipmapLevelBias + + global __cuTexRefSetMipmapLevelClamp + data["__cuTexRefSetMipmapLevelClamp"] = __cuTexRefSetMipmapLevelClamp + + global __cuTexRefSetMaxAnisotropy + data["__cuTexRefSetMaxAnisotropy"] = __cuTexRefSetMaxAnisotropy + + global __cuTexRefSetBorderColor + data["__cuTexRefSetBorderColor"] = __cuTexRefSetBorderColor + + global __cuTexRefSetFlags + data["__cuTexRefSetFlags"] = __cuTexRefSetFlags + + global __cuTexRefGetAddress_v2 + data["__cuTexRefGetAddress_v2"] = __cuTexRefGetAddress_v2 + + global __cuTexRefGetArray + data["__cuTexRefGetArray"] = __cuTexRefGetArray + + global __cuTexRefGetMipmappedArray + data["__cuTexRefGetMipmappedArray"] = __cuTexRefGetMipmappedArray + + global __cuTexRefGetAddressMode + data["__cuTexRefGetAddressMode"] = __cuTexRefGetAddressMode + + global __cuTexRefGetFilterMode + data["__cuTexRefGetFilterMode"] = __cuTexRefGetFilterMode + + global __cuTexRefGetFormat + data["__cuTexRefGetFormat"] = __cuTexRefGetFormat + + global __cuTexRefGetMipmapFilterMode + data["__cuTexRefGetMipmapFilterMode"] = __cuTexRefGetMipmapFilterMode + + global __cuTexRefGetMipmapLevelBias + data["__cuTexRefGetMipmapLevelBias"] = __cuTexRefGetMipmapLevelBias + + global __cuTexRefGetMipmapLevelClamp + data["__cuTexRefGetMipmapLevelClamp"] = __cuTexRefGetMipmapLevelClamp + + global __cuTexRefGetMaxAnisotropy + data["__cuTexRefGetMaxAnisotropy"] = __cuTexRefGetMaxAnisotropy + + global __cuTexRefGetBorderColor + data["__cuTexRefGetBorderColor"] = __cuTexRefGetBorderColor + + global __cuTexRefGetFlags + data["__cuTexRefGetFlags"] = __cuTexRefGetFlags + + global __cuTexRefCreate + data["__cuTexRefCreate"] = __cuTexRefCreate + + global __cuTexRefDestroy + data["__cuTexRefDestroy"] = __cuTexRefDestroy + + global __cuSurfRefSetArray + data["__cuSurfRefSetArray"] = __cuSurfRefSetArray + + global __cuSurfRefGetArray + data["__cuSurfRefGetArray"] = __cuSurfRefGetArray + + global __cuTexObjectCreate + data["__cuTexObjectCreate"] = __cuTexObjectCreate + + global __cuTexObjectDestroy + data["__cuTexObjectDestroy"] = __cuTexObjectDestroy + + global __cuTexObjectGetResourceDesc + data["__cuTexObjectGetResourceDesc"] = __cuTexObjectGetResourceDesc + + global __cuTexObjectGetTextureDesc + data["__cuTexObjectGetTextureDesc"] = __cuTexObjectGetTextureDesc + + global __cuTexObjectGetResourceViewDesc + data["__cuTexObjectGetResourceViewDesc"] = __cuTexObjectGetResourceViewDesc + + global __cuSurfObjectCreate + data["__cuSurfObjectCreate"] = __cuSurfObjectCreate + + global __cuSurfObjectDestroy + data["__cuSurfObjectDestroy"] = __cuSurfObjectDestroy + + global __cuSurfObjectGetResourceDesc + data["__cuSurfObjectGetResourceDesc"] = __cuSurfObjectGetResourceDesc + + global __cuTensorMapEncodeTiled + data["__cuTensorMapEncodeTiled"] = __cuTensorMapEncodeTiled + + global __cuTensorMapEncodeIm2col + data["__cuTensorMapEncodeIm2col"] = __cuTensorMapEncodeIm2col + + global __cuTensorMapEncodeIm2colWide + data["__cuTensorMapEncodeIm2colWide"] = __cuTensorMapEncodeIm2colWide + + global __cuTensorMapReplaceAddress + data["__cuTensorMapReplaceAddress"] = __cuTensorMapReplaceAddress + + global __cuDeviceCanAccessPeer + data["__cuDeviceCanAccessPeer"] = __cuDeviceCanAccessPeer + + global __cuCtxEnablePeerAccess + data["__cuCtxEnablePeerAccess"] = __cuCtxEnablePeerAccess + + global __cuCtxDisablePeerAccess + data["__cuCtxDisablePeerAccess"] = __cuCtxDisablePeerAccess + + global __cuDeviceGetP2PAttribute + data["__cuDeviceGetP2PAttribute"] = __cuDeviceGetP2PAttribute + + global __cuGraphicsUnregisterResource + data["__cuGraphicsUnregisterResource"] = __cuGraphicsUnregisterResource + + global __cuGraphicsSubResourceGetMappedArray + data["__cuGraphicsSubResourceGetMappedArray"] = __cuGraphicsSubResourceGetMappedArray + + global __cuGraphicsResourceGetMappedMipmappedArray + data["__cuGraphicsResourceGetMappedMipmappedArray"] = __cuGraphicsResourceGetMappedMipmappedArray + + global __cuGraphicsResourceGetMappedPointer_v2 + data["__cuGraphicsResourceGetMappedPointer_v2"] = __cuGraphicsResourceGetMappedPointer_v2 + + global __cuGraphicsResourceSetMapFlags_v2 + data["__cuGraphicsResourceSetMapFlags_v2"] = __cuGraphicsResourceSetMapFlags_v2 + + global __cuGraphicsMapResources + data["__cuGraphicsMapResources"] = __cuGraphicsMapResources + + global __cuGraphicsUnmapResources + data["__cuGraphicsUnmapResources"] = __cuGraphicsUnmapResources + + global __cuGetProcAddress_v2 + data["__cuGetProcAddress_v2"] = __cuGetProcAddress_v2 + + global __cuCoredumpGetAttribute + data["__cuCoredumpGetAttribute"] = __cuCoredumpGetAttribute + + global __cuCoredumpGetAttributeGlobal + data["__cuCoredumpGetAttributeGlobal"] = __cuCoredumpGetAttributeGlobal + + global __cuCoredumpSetAttribute + data["__cuCoredumpSetAttribute"] = __cuCoredumpSetAttribute + + global __cuCoredumpSetAttributeGlobal + data["__cuCoredumpSetAttributeGlobal"] = __cuCoredumpSetAttributeGlobal + + global __cuGetExportTable + data["__cuGetExportTable"] = __cuGetExportTable + + global __cuGreenCtxCreate + data["__cuGreenCtxCreate"] = __cuGreenCtxCreate + + global __cuGreenCtxDestroy + data["__cuGreenCtxDestroy"] = __cuGreenCtxDestroy + + global __cuCtxFromGreenCtx + data["__cuCtxFromGreenCtx"] = __cuCtxFromGreenCtx + + global __cuDeviceGetDevResource + data["__cuDeviceGetDevResource"] = __cuDeviceGetDevResource + + global __cuCtxGetDevResource + data["__cuCtxGetDevResource"] = __cuCtxGetDevResource + + global __cuGreenCtxGetDevResource + data["__cuGreenCtxGetDevResource"] = __cuGreenCtxGetDevResource + + global __cuDevSmResourceSplitByCount + data["__cuDevSmResourceSplitByCount"] = __cuDevSmResourceSplitByCount + + global __cuDevResourceGenerateDesc + data["__cuDevResourceGenerateDesc"] = __cuDevResourceGenerateDesc + + global __cuGreenCtxRecordEvent + data["__cuGreenCtxRecordEvent"] = __cuGreenCtxRecordEvent + + global __cuGreenCtxWaitEvent + data["__cuGreenCtxWaitEvent"] = __cuGreenCtxWaitEvent + + global __cuStreamGetGreenCtx + data["__cuStreamGetGreenCtx"] = __cuStreamGetGreenCtx + + global __cuGreenCtxStreamCreate + data["__cuGreenCtxStreamCreate"] = __cuGreenCtxStreamCreate + + global __cuLogsRegisterCallback + data["__cuLogsRegisterCallback"] = __cuLogsRegisterCallback + + global __cuLogsUnregisterCallback + data["__cuLogsUnregisterCallback"] = __cuLogsUnregisterCallback + + global __cuLogsCurrent + data["__cuLogsCurrent"] = __cuLogsCurrent + + global __cuLogsDumpToFile + data["__cuLogsDumpToFile"] = __cuLogsDumpToFile + + global __cuLogsDumpToMemory + data["__cuLogsDumpToMemory"] = __cuLogsDumpToMemory + + global __cuCheckpointProcessGetRestoreThreadId + data["__cuCheckpointProcessGetRestoreThreadId"] = __cuCheckpointProcessGetRestoreThreadId + + global __cuCheckpointProcessGetState + data["__cuCheckpointProcessGetState"] = __cuCheckpointProcessGetState + + global __cuCheckpointProcessLock + data["__cuCheckpointProcessLock"] = __cuCheckpointProcessLock + + global __cuCheckpointProcessCheckpoint + data["__cuCheckpointProcessCheckpoint"] = __cuCheckpointProcessCheckpoint + + global __cuCheckpointProcessRestore + data["__cuCheckpointProcessRestore"] = __cuCheckpointProcessRestore + + global __cuCheckpointProcessUnlock + data["__cuCheckpointProcessUnlock"] = __cuCheckpointProcessUnlock + + global __cuGraphicsEGLRegisterImage + data["__cuGraphicsEGLRegisterImage"] = __cuGraphicsEGLRegisterImage + + global __cuEGLStreamConsumerConnect + data["__cuEGLStreamConsumerConnect"] = __cuEGLStreamConsumerConnect + + global __cuEGLStreamConsumerConnectWithFlags + data["__cuEGLStreamConsumerConnectWithFlags"] = __cuEGLStreamConsumerConnectWithFlags + + global __cuEGLStreamConsumerDisconnect + data["__cuEGLStreamConsumerDisconnect"] = __cuEGLStreamConsumerDisconnect + + global __cuEGLStreamConsumerAcquireFrame + data["__cuEGLStreamConsumerAcquireFrame"] = __cuEGLStreamConsumerAcquireFrame + + global __cuEGLStreamConsumerReleaseFrame + data["__cuEGLStreamConsumerReleaseFrame"] = __cuEGLStreamConsumerReleaseFrame + + global __cuEGLStreamProducerConnect + data["__cuEGLStreamProducerConnect"] = __cuEGLStreamProducerConnect + + global __cuEGLStreamProducerDisconnect + data["__cuEGLStreamProducerDisconnect"] = __cuEGLStreamProducerDisconnect + + global __cuEGLStreamProducerPresentFrame + data["__cuEGLStreamProducerPresentFrame"] = __cuEGLStreamProducerPresentFrame + + global __cuEGLStreamProducerReturnFrame + data["__cuEGLStreamProducerReturnFrame"] = __cuEGLStreamProducerReturnFrame + + global __cuGraphicsResourceGetMappedEglFrame + data["__cuGraphicsResourceGetMappedEglFrame"] = __cuGraphicsResourceGetMappedEglFrame + + global __cuEventCreateFromEGLSync + data["__cuEventCreateFromEGLSync"] = __cuEventCreateFromEGLSync + + global __cuGraphicsGLRegisterBuffer + data["__cuGraphicsGLRegisterBuffer"] = __cuGraphicsGLRegisterBuffer + + global __cuGraphicsGLRegisterImage + data["__cuGraphicsGLRegisterImage"] = __cuGraphicsGLRegisterImage + + global __cuGLGetDevices_v2 + data["__cuGLGetDevices_v2"] = __cuGLGetDevices_v2 + + global __cuGLCtxCreate_v2 + data["__cuGLCtxCreate_v2"] = __cuGLCtxCreate_v2 + + global __cuGLInit + data["__cuGLInit"] = __cuGLInit + + global __cuGLRegisterBufferObject + data["__cuGLRegisterBufferObject"] = __cuGLRegisterBufferObject + + global __cuGLMapBufferObject_v2 + data["__cuGLMapBufferObject_v2"] = __cuGLMapBufferObject_v2 + + global __cuGLUnmapBufferObject + data["__cuGLUnmapBufferObject"] = __cuGLUnmapBufferObject + + global __cuGLUnregisterBufferObject + data["__cuGLUnregisterBufferObject"] = __cuGLUnregisterBufferObject + + global __cuGLSetBufferObjectMapFlags + data["__cuGLSetBufferObjectMapFlags"] = __cuGLSetBufferObjectMapFlags + + global __cuGLMapBufferObjectAsync_v2 + data["__cuGLMapBufferObjectAsync_v2"] = __cuGLMapBufferObjectAsync_v2 + + global __cuGLUnmapBufferObjectAsync + data["__cuGLUnmapBufferObjectAsync"] = __cuGLUnmapBufferObjectAsync + + global __cuProfilerInitialize + data["__cuProfilerInitialize"] = __cuProfilerInitialize + + global __cuProfilerStart + data["__cuProfilerStart"] = __cuProfilerStart + + global __cuProfilerStop + data["__cuProfilerStop"] = __cuProfilerStop + + global __cuVDPAUGetDevice + data["__cuVDPAUGetDevice"] = __cuVDPAUGetDevice + + global __cuVDPAUCtxCreate_v2 + data["__cuVDPAUCtxCreate_v2"] = __cuVDPAUCtxCreate_v2 + + global __cuGraphicsVDPAURegisterVideoSurface + data["__cuGraphicsVDPAURegisterVideoSurface"] = __cuGraphicsVDPAURegisterVideoSurface + + global __cuGraphicsVDPAURegisterOutputSurface + data["__cuGraphicsVDPAURegisterOutputSurface"] = __cuGraphicsVDPAURegisterOutputSurface + + global __cuDeviceGetHostAtomicCapabilities + data["__cuDeviceGetHostAtomicCapabilities"] = __cuDeviceGetHostAtomicCapabilities + + global __cuCtxGetDevice_v2 + data["__cuCtxGetDevice_v2"] = __cuCtxGetDevice_v2 + + global __cuCtxSynchronize_v2 + data["__cuCtxSynchronize_v2"] = __cuCtxSynchronize_v2 + + global __cuMemcpyBatchAsync_v2 + data["__cuMemcpyBatchAsync_v2"] = __cuMemcpyBatchAsync_v2 + + global __cuMemcpy3DBatchAsync_v2 + data["__cuMemcpy3DBatchAsync_v2"] = __cuMemcpy3DBatchAsync_v2 + + global __cuMemGetDefaultMemPool + data["__cuMemGetDefaultMemPool"] = __cuMemGetDefaultMemPool + + global __cuMemGetMemPool + data["__cuMemGetMemPool"] = __cuMemGetMemPool + + global __cuMemSetMemPool + data["__cuMemSetMemPool"] = __cuMemSetMemPool + + global __cuMemPrefetchBatchAsync + data["__cuMemPrefetchBatchAsync"] = __cuMemPrefetchBatchAsync + + global __cuMemDiscardBatchAsync + data["__cuMemDiscardBatchAsync"] = __cuMemDiscardBatchAsync + + global __cuMemDiscardAndPrefetchBatchAsync + data["__cuMemDiscardAndPrefetchBatchAsync"] = __cuMemDiscardAndPrefetchBatchAsync + + global __cuDeviceGetP2PAtomicCapabilities + data["__cuDeviceGetP2PAtomicCapabilities"] = __cuDeviceGetP2PAtomicCapabilities + + global __cuGreenCtxGetId + data["__cuGreenCtxGetId"] = __cuGreenCtxGetId + + global __cuMulticastBindMem_v2 + data["__cuMulticastBindMem_v2"] = __cuMulticastBindMem_v2 + + global __cuMulticastBindAddr_v2 + data["__cuMulticastBindAddr_v2"] = __cuMulticastBindAddr_v2 + + global __cuGraphNodeGetContainingGraph + data["__cuGraphNodeGetContainingGraph"] = __cuGraphNodeGetContainingGraph + + global __cuGraphNodeGetLocalId + data["__cuGraphNodeGetLocalId"] = __cuGraphNodeGetLocalId + + global __cuGraphNodeGetToolsId + data["__cuGraphNodeGetToolsId"] = __cuGraphNodeGetToolsId + + global __cuGraphGetId + data["__cuGraphGetId"] = __cuGraphGetId + + global __cuGraphExecGetId + data["__cuGraphExecGetId"] = __cuGraphExecGetId + + global __cuDevSmResourceSplit + data["__cuDevSmResourceSplit"] = __cuDevSmResourceSplit + + global __cuStreamGetDevResource + data["__cuStreamGetDevResource"] = __cuStreamGetDevResource + + global __cuKernelGetParamCount + data["__cuKernelGetParamCount"] = __cuKernelGetParamCount + + global __cuMemcpyWithAttributesAsync + data["__cuMemcpyWithAttributesAsync"] = __cuMemcpyWithAttributesAsync + + global __cuMemcpy3DWithAttributesAsync + data["__cuMemcpy3DWithAttributesAsync"] = __cuMemcpy3DWithAttributesAsync + + global __cuStreamBeginCaptureToCig + data["__cuStreamBeginCaptureToCig"] = __cuStreamBeginCaptureToCig + + global __cuStreamEndCaptureToCig + data["__cuStreamEndCaptureToCig"] = __cuStreamEndCaptureToCig + + global __cuFuncGetParamCount + data["__cuFuncGetParamCount"] = __cuFuncGetParamCount + + global __cuLaunchHostFunc_v2 + data["__cuLaunchHostFunc_v2"] = __cuLaunchHostFunc_v2 + + global __cuGraphNodeGetParams + data["__cuGraphNodeGetParams"] = __cuGraphNodeGetParams + + global __cuCoredumpRegisterStartCallback + data["__cuCoredumpRegisterStartCallback"] = __cuCoredumpRegisterStartCallback + + global __cuCoredumpRegisterCompleteCallback + data["__cuCoredumpRegisterCompleteCallback"] = __cuCoredumpRegisterCompleteCallback + + global __cuCoredumpDeregisterStartCallback + data["__cuCoredumpDeregisterStartCallback"] = __cuCoredumpDeregisterStartCallback + + global __cuCoredumpDeregisterCompleteCallback + data["__cuCoredumpDeregisterCompleteCallback"] = __cuCoredumpDeregisterCompleteCallback + + global __cuLogicalEndpointIdReserve + data["__cuLogicalEndpointIdReserve"] = __cuLogicalEndpointIdReserve + + global __cuLogicalEndpointIdRelease + data["__cuLogicalEndpointIdRelease"] = __cuLogicalEndpointIdRelease + + global __cuLogicalEndpointCreate + data["__cuLogicalEndpointCreate"] = __cuLogicalEndpointCreate + + global __cuLogicalEndpointAddDevice + data["__cuLogicalEndpointAddDevice"] = __cuLogicalEndpointAddDevice + + global __cuLogicalEndpointDestroy + data["__cuLogicalEndpointDestroy"] = __cuLogicalEndpointDestroy + + global __cuLogicalEndpointBindAddr + data["__cuLogicalEndpointBindAddr"] = __cuLogicalEndpointBindAddr + + global __cuLogicalEndpointBindMem + data["__cuLogicalEndpointBindMem"] = __cuLogicalEndpointBindMem + + global __cuLogicalEndpointUnbind + data["__cuLogicalEndpointUnbind"] = __cuLogicalEndpointUnbind + + global __cuLogicalEndpointExport + data["__cuLogicalEndpointExport"] = __cuLogicalEndpointExport + + global __cuLogicalEndpointImport + data["__cuLogicalEndpointImport"] = __cuLogicalEndpointImport + + global __cuLogicalEndpointGetLimits + data["__cuLogicalEndpointGetLimits"] = __cuLogicalEndpointGetLimits + + global __cuLogicalEndpointQuery + data["__cuLogicalEndpointQuery"] = __cuLogicalEndpointQuery + + global __cuStreamBeginRecaptureToGraph + data["__cuStreamBeginRecaptureToGraph"] = __cuStreamBeginRecaptureToGraph + + func_ptrs = data + return data + + +cpdef _inspect_function_pointer(str name): + global func_ptrs + if func_ptrs is None: + func_ptrs = _inspect_function_pointers() + return func_ptrs[name] + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef CUresult _cuGetErrorString(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGetErrorString + _check_or_init_driver() + if __cuGetErrorString == NULL: + with gil: + raise FunctionNotFoundError("function cuGetErrorString is not found") + return (__cuGetErrorString)( + error, pStr) + + +cdef CUresult _cuGetErrorName(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGetErrorName + _check_or_init_driver() + if __cuGetErrorName == NULL: + with gil: + raise FunctionNotFoundError("function cuGetErrorName is not found") + return (__cuGetErrorName)( + error, pStr) + + +cdef CUresult _cuInit(unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuInit + _check_or_init_driver() + if __cuInit == NULL: + with gil: + raise FunctionNotFoundError("function cuInit is not found") + return (__cuInit)( + Flags) + + +cdef CUresult _cuDriverGetVersion(int* driverVersion) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDriverGetVersion + _check_or_init_driver() + if __cuDriverGetVersion == NULL: + with gil: + raise FunctionNotFoundError("function cuDriverGetVersion is not found") + return (__cuDriverGetVersion)( + driverVersion) + + +cdef CUresult _cuDeviceGet(CUdevice* device, int ordinal) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGet + _check_or_init_driver() + if __cuDeviceGet == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGet is not found") + return (__cuDeviceGet)( + device, ordinal) + + +cdef CUresult _cuDeviceGetCount(int* count) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetCount + _check_or_init_driver() + if __cuDeviceGetCount == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetCount is not found") + return (__cuDeviceGetCount)( + count) + + +cdef CUresult _cuDeviceGetName(char* name, int len, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetName + _check_or_init_driver() + if __cuDeviceGetName == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetName is not found") + return (__cuDeviceGetName)( + name, len, dev) + + +cdef CUresult _cuDeviceGetUuid_v2(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetUuid_v2 + _check_or_init_driver() + if __cuDeviceGetUuid_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetUuid_v2 is not found") + return (__cuDeviceGetUuid_v2)( + uuid, dev) + + +cdef CUresult _cuDeviceGetLuid(char* luid, unsigned int* deviceNodeMask, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetLuid + _check_or_init_driver() + if __cuDeviceGetLuid == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetLuid is not found") + return (__cuDeviceGetLuid)( + luid, deviceNodeMask, dev) + + +cdef CUresult _cuDeviceTotalMem_v2(size_t* bytes, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceTotalMem_v2 + _check_or_init_driver() + if __cuDeviceTotalMem_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceTotalMem_v2 is not found") + return (__cuDeviceTotalMem_v2)( + bytes, dev) + + +cdef CUresult _cuDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, CUarray_format format, unsigned numChannels, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetTexture1DLinearMaxWidth + _check_or_init_driver() + if __cuDeviceGetTexture1DLinearMaxWidth == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetTexture1DLinearMaxWidth is not found") + return (__cuDeviceGetTexture1DLinearMaxWidth)( + maxWidthInElements, format, numChannels, dev) + + +cdef CUresult _cuDeviceGetAttribute(int* pi, CUdevice_attribute attrib, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetAttribute + _check_or_init_driver() + if __cuDeviceGetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetAttribute is not found") + return (__cuDeviceGetAttribute)( + pi, attrib, dev) + + +cdef CUresult _cuDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, CUdevice dev, int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetNvSciSyncAttributes + _check_or_init_driver() + if __cuDeviceGetNvSciSyncAttributes == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetNvSciSyncAttributes is not found") + return (__cuDeviceGetNvSciSyncAttributes)( + nvSciSyncAttrList, dev, flags) + + +cdef CUresult _cuDeviceSetMemPool(CUdevice dev, CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceSetMemPool + _check_or_init_driver() + if __cuDeviceSetMemPool == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceSetMemPool is not found") + return (__cuDeviceSetMemPool)( + dev, pool) + + +cdef CUresult _cuDeviceGetMemPool(CUmemoryPool* pool, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetMemPool + _check_or_init_driver() + if __cuDeviceGetMemPool == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetMemPool is not found") + return (__cuDeviceGetMemPool)( + pool, dev) + + +cdef CUresult _cuDeviceGetDefaultMemPool(CUmemoryPool* pool_out, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetDefaultMemPool + _check_or_init_driver() + if __cuDeviceGetDefaultMemPool == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetDefaultMemPool is not found") + return (__cuDeviceGetDefaultMemPool)( + pool_out, dev) + + +cdef CUresult _cuDeviceGetExecAffinitySupport(int* pi, CUexecAffinityType type, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetExecAffinitySupport + _check_or_init_driver() + if __cuDeviceGetExecAffinitySupport == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetExecAffinitySupport is not found") + return (__cuDeviceGetExecAffinitySupport)( + pi, type, dev) + + +cdef CUresult _cuFlushGPUDirectRDMAWrites(CUflushGPUDirectRDMAWritesTarget target, CUflushGPUDirectRDMAWritesScope scope) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFlushGPUDirectRDMAWrites + _check_or_init_driver() + if __cuFlushGPUDirectRDMAWrites == NULL: + with gil: + raise FunctionNotFoundError("function cuFlushGPUDirectRDMAWrites is not found") + return (__cuFlushGPUDirectRDMAWrites)( + target, scope) + + +cdef CUresult _cuDeviceGetProperties(CUdevprop* prop, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetProperties + _check_or_init_driver() + if __cuDeviceGetProperties == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetProperties is not found") + return (__cuDeviceGetProperties)( + prop, dev) + + +cdef CUresult _cuDeviceComputeCapability(int* major, int* minor, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceComputeCapability + _check_or_init_driver() + if __cuDeviceComputeCapability == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceComputeCapability is not found") + return (__cuDeviceComputeCapability)( + major, minor, dev) + + +cdef CUresult _cuDevicePrimaryCtxRetain(CUcontext* pctx, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDevicePrimaryCtxRetain + _check_or_init_driver() + if __cuDevicePrimaryCtxRetain == NULL: + with gil: + raise FunctionNotFoundError("function cuDevicePrimaryCtxRetain is not found") + return (__cuDevicePrimaryCtxRetain)( + pctx, dev) + + +cdef CUresult _cuDevicePrimaryCtxRelease_v2(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDevicePrimaryCtxRelease_v2 + _check_or_init_driver() + if __cuDevicePrimaryCtxRelease_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuDevicePrimaryCtxRelease_v2 is not found") + return (__cuDevicePrimaryCtxRelease_v2)( + dev) + + +cdef CUresult _cuDevicePrimaryCtxSetFlags_v2(CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDevicePrimaryCtxSetFlags_v2 + _check_or_init_driver() + if __cuDevicePrimaryCtxSetFlags_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuDevicePrimaryCtxSetFlags_v2 is not found") + return (__cuDevicePrimaryCtxSetFlags_v2)( + dev, flags) + + +cdef CUresult _cuDevicePrimaryCtxGetState(CUdevice dev, unsigned int* flags, int* active) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDevicePrimaryCtxGetState + _check_or_init_driver() + if __cuDevicePrimaryCtxGetState == NULL: + with gil: + raise FunctionNotFoundError("function cuDevicePrimaryCtxGetState is not found") + return (__cuDevicePrimaryCtxGetState)( + dev, flags, active) + + +cdef CUresult _cuDevicePrimaryCtxReset_v2(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDevicePrimaryCtxReset_v2 + _check_or_init_driver() + if __cuDevicePrimaryCtxReset_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuDevicePrimaryCtxReset_v2 is not found") + return (__cuDevicePrimaryCtxReset_v2)( + dev) + + +cdef CUresult _cuCtxCreate_v2(CUcontext* pctx, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxCreate_v2 + _check_or_init_driver() + if __cuCtxCreate_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxCreate_v2 is not found") + return (__cuCtxCreate_v2)( + pctx, flags, dev) + + +cdef CUresult _cuCtxCreate_v3(CUcontext* pctx, CUexecAffinityParam* paramsArray, int numParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxCreate_v3 + _check_or_init_driver() + if __cuCtxCreate_v3 == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxCreate_v3 is not found") + return (__cuCtxCreate_v3)( + pctx, paramsArray, numParams, flags, dev) + + +cdef CUresult _cuCtxCreate_v4(CUcontext* pctx, CUctxCreateParams* ctxCreateParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxCreate_v4 + _check_or_init_driver() + if __cuCtxCreate_v4 == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxCreate_v4 is not found") + return (__cuCtxCreate_v4)( + pctx, ctxCreateParams, flags, dev) + + +cdef CUresult _cuCtxDestroy_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxDestroy_v2 + _check_or_init_driver() + if __cuCtxDestroy_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxDestroy_v2 is not found") + return (__cuCtxDestroy_v2)( + ctx) + + +cdef CUresult _cuCtxPushCurrent_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxPushCurrent_v2 + _check_or_init_driver() + if __cuCtxPushCurrent_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxPushCurrent_v2 is not found") + return (__cuCtxPushCurrent_v2)( + ctx) + + +cdef CUresult _cuCtxPopCurrent_v2(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxPopCurrent_v2 + _check_or_init_driver() + if __cuCtxPopCurrent_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxPopCurrent_v2 is not found") + return (__cuCtxPopCurrent_v2)( + pctx) + + +cdef CUresult _cuCtxSetCurrent(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxSetCurrent + _check_or_init_driver() + if __cuCtxSetCurrent == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxSetCurrent is not found") + return (__cuCtxSetCurrent)( + ctx) + + +cdef CUresult _cuCtxGetCurrent(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxGetCurrent + _check_or_init_driver() + if __cuCtxGetCurrent == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxGetCurrent is not found") + return (__cuCtxGetCurrent)( + pctx) + + +cdef CUresult _cuCtxGetDevice(CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxGetDevice + _check_or_init_driver() + if __cuCtxGetDevice == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxGetDevice is not found") + return (__cuCtxGetDevice)( + device) + + +cdef CUresult _cuCtxGetFlags(unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxGetFlags + _check_or_init_driver() + if __cuCtxGetFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxGetFlags is not found") + return (__cuCtxGetFlags)( + flags) + + +cdef CUresult _cuCtxSetFlags(unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxSetFlags + _check_or_init_driver() + if __cuCtxSetFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxSetFlags is not found") + return (__cuCtxSetFlags)( + flags) + + +cdef CUresult _cuCtxGetId(CUcontext ctx, unsigned long long* ctxId) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxGetId + _check_or_init_driver() + if __cuCtxGetId == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxGetId is not found") + return (__cuCtxGetId)( + ctx, ctxId) + + +cdef CUresult _cuCtxSynchronize() except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxSynchronize + _check_or_init_driver() + if __cuCtxSynchronize == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxSynchronize is not found") + return (__cuCtxSynchronize)( + ) + + +cdef CUresult _cuCtxSetLimit(CUlimit limit, size_t value) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxSetLimit + _check_or_init_driver() + if __cuCtxSetLimit == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxSetLimit is not found") + return (__cuCtxSetLimit)( + limit, value) + + +cdef CUresult _cuCtxGetLimit(size_t* pvalue, CUlimit limit) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxGetLimit + _check_or_init_driver() + if __cuCtxGetLimit == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxGetLimit is not found") + return (__cuCtxGetLimit)( + pvalue, limit) + + +cdef CUresult _cuCtxGetCacheConfig(CUfunc_cache* pconfig) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxGetCacheConfig + _check_or_init_driver() + if __cuCtxGetCacheConfig == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxGetCacheConfig is not found") + return (__cuCtxGetCacheConfig)( + pconfig) + + +cdef CUresult _cuCtxSetCacheConfig(CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxSetCacheConfig + _check_or_init_driver() + if __cuCtxSetCacheConfig == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxSetCacheConfig is not found") + return (__cuCtxSetCacheConfig)( + config) + + +cdef CUresult _cuCtxGetApiVersion(CUcontext ctx, unsigned int* version) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxGetApiVersion + _check_or_init_driver() + if __cuCtxGetApiVersion == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxGetApiVersion is not found") + return (__cuCtxGetApiVersion)( + ctx, version) + + +cdef CUresult _cuCtxGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxGetStreamPriorityRange + _check_or_init_driver() + if __cuCtxGetStreamPriorityRange == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxGetStreamPriorityRange is not found") + return (__cuCtxGetStreamPriorityRange)( + leastPriority, greatestPriority) + + +cdef CUresult _cuCtxResetPersistingL2Cache() except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxResetPersistingL2Cache + _check_or_init_driver() + if __cuCtxResetPersistingL2Cache == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxResetPersistingL2Cache is not found") + return (__cuCtxResetPersistingL2Cache)( + ) + + +cdef CUresult _cuCtxGetExecAffinity(CUexecAffinityParam* pExecAffinity, CUexecAffinityType type) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxGetExecAffinity + _check_or_init_driver() + if __cuCtxGetExecAffinity == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxGetExecAffinity is not found") + return (__cuCtxGetExecAffinity)( + pExecAffinity, type) + + +cdef CUresult _cuCtxRecordEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxRecordEvent + _check_or_init_driver() + if __cuCtxRecordEvent == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxRecordEvent is not found") + return (__cuCtxRecordEvent)( + hCtx, hEvent) + + +cdef CUresult _cuCtxWaitEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxWaitEvent + _check_or_init_driver() + if __cuCtxWaitEvent == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxWaitEvent is not found") + return (__cuCtxWaitEvent)( + hCtx, hEvent) + + +cdef CUresult _cuCtxAttach(CUcontext* pctx, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxAttach + _check_or_init_driver() + if __cuCtxAttach == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxAttach is not found") + return (__cuCtxAttach)( + pctx, flags) + + +cdef CUresult _cuCtxDetach(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxDetach + _check_or_init_driver() + if __cuCtxDetach == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxDetach is not found") + return (__cuCtxDetach)( + ctx) + + +cdef CUresult _cuCtxGetSharedMemConfig(CUsharedconfig* pConfig) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxGetSharedMemConfig + _check_or_init_driver() + if __cuCtxGetSharedMemConfig == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxGetSharedMemConfig is not found") + return (__cuCtxGetSharedMemConfig)( + pConfig) + + +cdef CUresult _cuCtxSetSharedMemConfig(CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxSetSharedMemConfig + _check_or_init_driver() + if __cuCtxSetSharedMemConfig == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxSetSharedMemConfig is not found") + return (__cuCtxSetSharedMemConfig)( + config) + + +cdef CUresult _cuModuleLoad(CUmodule* module, const char* fname) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuModuleLoad + _check_or_init_driver() + if __cuModuleLoad == NULL: + with gil: + raise FunctionNotFoundError("function cuModuleLoad is not found") + return (__cuModuleLoad)( + module, fname) + + +cdef CUresult _cuModuleLoadData(CUmodule* module, const void* image) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuModuleLoadData + _check_or_init_driver() + if __cuModuleLoadData == NULL: + with gil: + raise FunctionNotFoundError("function cuModuleLoadData is not found") + return (__cuModuleLoadData)( + module, image) + + +cdef CUresult _cuModuleLoadDataEx(CUmodule* module, const void* image, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuModuleLoadDataEx + _check_or_init_driver() + if __cuModuleLoadDataEx == NULL: + with gil: + raise FunctionNotFoundError("function cuModuleLoadDataEx is not found") + return (__cuModuleLoadDataEx)( + module, image, numOptions, options, optionValues) + + +cdef CUresult _cuModuleLoadFatBinary(CUmodule* module, const void* fatCubin) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuModuleLoadFatBinary + _check_or_init_driver() + if __cuModuleLoadFatBinary == NULL: + with gil: + raise FunctionNotFoundError("function cuModuleLoadFatBinary is not found") + return (__cuModuleLoadFatBinary)( + module, fatCubin) + + +cdef CUresult _cuModuleUnload(CUmodule hmod) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuModuleUnload + _check_or_init_driver() + if __cuModuleUnload == NULL: + with gil: + raise FunctionNotFoundError("function cuModuleUnload is not found") + return (__cuModuleUnload)( + hmod) + + +cdef CUresult _cuModuleGetLoadingMode(CUmoduleLoadingMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuModuleGetLoadingMode + _check_or_init_driver() + if __cuModuleGetLoadingMode == NULL: + with gil: + raise FunctionNotFoundError("function cuModuleGetLoadingMode is not found") + return (__cuModuleGetLoadingMode)( + mode) + + +cdef CUresult _cuModuleGetFunction(CUfunction* hfunc, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuModuleGetFunction + _check_or_init_driver() + if __cuModuleGetFunction == NULL: + with gil: + raise FunctionNotFoundError("function cuModuleGetFunction is not found") + return (__cuModuleGetFunction)( + hfunc, hmod, name) + + +cdef CUresult _cuModuleGetFunctionCount(unsigned int* count, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuModuleGetFunctionCount + _check_or_init_driver() + if __cuModuleGetFunctionCount == NULL: + with gil: + raise FunctionNotFoundError("function cuModuleGetFunctionCount is not found") + return (__cuModuleGetFunctionCount)( + count, mod) + + +cdef CUresult _cuModuleEnumerateFunctions(CUfunction* functions, unsigned int numFunctions, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuModuleEnumerateFunctions + _check_or_init_driver() + if __cuModuleEnumerateFunctions == NULL: + with gil: + raise FunctionNotFoundError("function cuModuleEnumerateFunctions is not found") + return (__cuModuleEnumerateFunctions)( + functions, numFunctions, mod) + + +cdef CUresult _cuModuleGetGlobal_v2(CUdeviceptr* dptr, size_t* bytes, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuModuleGetGlobal_v2 + _check_or_init_driver() + if __cuModuleGetGlobal_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuModuleGetGlobal_v2 is not found") + return (__cuModuleGetGlobal_v2)( + dptr, bytes, hmod, name) + + +cdef CUresult _cuLinkCreate_v2(unsigned int numOptions, CUjit_option* options, void** optionValues, CUlinkState* stateOut) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLinkCreate_v2 + _check_or_init_driver() + if __cuLinkCreate_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuLinkCreate_v2 is not found") + return (__cuLinkCreate_v2)( + numOptions, options, optionValues, stateOut) + + +cdef CUresult _cuLinkAddData_v2(CUlinkState state, CUjitInputType type, void* data, size_t size, const char* name, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLinkAddData_v2 + _check_or_init_driver() + if __cuLinkAddData_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuLinkAddData_v2 is not found") + return (__cuLinkAddData_v2)( + state, type, data, size, name, numOptions, options, optionValues) + + +cdef CUresult _cuLinkAddFile_v2(CUlinkState state, CUjitInputType type, const char* path, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLinkAddFile_v2 + _check_or_init_driver() + if __cuLinkAddFile_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuLinkAddFile_v2 is not found") + return (__cuLinkAddFile_v2)( + state, type, path, numOptions, options, optionValues) + + +cdef CUresult _cuLinkComplete(CUlinkState state, void** cubinOut, size_t* sizeOut) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLinkComplete + _check_or_init_driver() + if __cuLinkComplete == NULL: + with gil: + raise FunctionNotFoundError("function cuLinkComplete is not found") + return (__cuLinkComplete)( + state, cubinOut, sizeOut) + + +cdef CUresult _cuLinkDestroy(CUlinkState state) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLinkDestroy + _check_or_init_driver() + if __cuLinkDestroy == NULL: + with gil: + raise FunctionNotFoundError("function cuLinkDestroy is not found") + return (__cuLinkDestroy)( + state) + + +cdef CUresult _cuModuleGetTexRef(CUtexref* pTexRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuModuleGetTexRef + _check_or_init_driver() + if __cuModuleGetTexRef == NULL: + with gil: + raise FunctionNotFoundError("function cuModuleGetTexRef is not found") + return (__cuModuleGetTexRef)( + pTexRef, hmod, name) + + +cdef CUresult _cuModuleGetSurfRef(CUsurfref* pSurfRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuModuleGetSurfRef + _check_or_init_driver() + if __cuModuleGetSurfRef == NULL: + with gil: + raise FunctionNotFoundError("function cuModuleGetSurfRef is not found") + return (__cuModuleGetSurfRef)( + pSurfRef, hmod, name) + + +cdef CUresult _cuLibraryLoadData(CUlibrary* library, const void* code, CUjit_option* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, CUlibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLibraryLoadData + _check_or_init_driver() + if __cuLibraryLoadData == NULL: + with gil: + raise FunctionNotFoundError("function cuLibraryLoadData is not found") + return (__cuLibraryLoadData)( + library, code, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions) + + +cdef CUresult _cuLibraryLoadFromFile(CUlibrary* library, const char* fileName, CUjit_option* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, CUlibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLibraryLoadFromFile + _check_or_init_driver() + if __cuLibraryLoadFromFile == NULL: + with gil: + raise FunctionNotFoundError("function cuLibraryLoadFromFile is not found") + return (__cuLibraryLoadFromFile)( + library, fileName, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions) + + +cdef CUresult _cuLibraryUnload(CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLibraryUnload + _check_or_init_driver() + if __cuLibraryUnload == NULL: + with gil: + raise FunctionNotFoundError("function cuLibraryUnload is not found") + return (__cuLibraryUnload)( + library) + + +cdef CUresult _cuLibraryGetKernel(CUkernel* pKernel, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLibraryGetKernel + _check_or_init_driver() + if __cuLibraryGetKernel == NULL: + with gil: + raise FunctionNotFoundError("function cuLibraryGetKernel is not found") + return (__cuLibraryGetKernel)( + pKernel, library, name) + + +cdef CUresult _cuLibraryGetKernelCount(unsigned int* count, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLibraryGetKernelCount + _check_or_init_driver() + if __cuLibraryGetKernelCount == NULL: + with gil: + raise FunctionNotFoundError("function cuLibraryGetKernelCount is not found") + return (__cuLibraryGetKernelCount)( + count, lib) + + +cdef CUresult _cuLibraryEnumerateKernels(CUkernel* kernels, unsigned int numKernels, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLibraryEnumerateKernels + _check_or_init_driver() + if __cuLibraryEnumerateKernels == NULL: + with gil: + raise FunctionNotFoundError("function cuLibraryEnumerateKernels is not found") + return (__cuLibraryEnumerateKernels)( + kernels, numKernels, lib) + + +cdef CUresult _cuLibraryGetModule(CUmodule* pMod, CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLibraryGetModule + _check_or_init_driver() + if __cuLibraryGetModule == NULL: + with gil: + raise FunctionNotFoundError("function cuLibraryGetModule is not found") + return (__cuLibraryGetModule)( + pMod, library) + + +cdef CUresult _cuKernelGetFunction(CUfunction* pFunc, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuKernelGetFunction + _check_or_init_driver() + if __cuKernelGetFunction == NULL: + with gil: + raise FunctionNotFoundError("function cuKernelGetFunction is not found") + return (__cuKernelGetFunction)( + pFunc, kernel) + + +cdef CUresult _cuKernelGetLibrary(CUlibrary* pLib, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuKernelGetLibrary + _check_or_init_driver() + if __cuKernelGetLibrary == NULL: + with gil: + raise FunctionNotFoundError("function cuKernelGetLibrary is not found") + return (__cuKernelGetLibrary)( + pLib, kernel) + + +cdef CUresult _cuLibraryGetGlobal(CUdeviceptr* dptr, size_t* bytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLibraryGetGlobal + _check_or_init_driver() + if __cuLibraryGetGlobal == NULL: + with gil: + raise FunctionNotFoundError("function cuLibraryGetGlobal is not found") + return (__cuLibraryGetGlobal)( + dptr, bytes, library, name) + + +cdef CUresult _cuLibraryGetManaged(CUdeviceptr* dptr, size_t* bytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLibraryGetManaged + _check_or_init_driver() + if __cuLibraryGetManaged == NULL: + with gil: + raise FunctionNotFoundError("function cuLibraryGetManaged is not found") + return (__cuLibraryGetManaged)( + dptr, bytes, library, name) + + +cdef CUresult _cuLibraryGetUnifiedFunction(void** fptr, CUlibrary library, const char* symbol) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLibraryGetUnifiedFunction + _check_or_init_driver() + if __cuLibraryGetUnifiedFunction == NULL: + with gil: + raise FunctionNotFoundError("function cuLibraryGetUnifiedFunction is not found") + return (__cuLibraryGetUnifiedFunction)( + fptr, library, symbol) + + +cdef CUresult _cuKernelGetAttribute(int* pi, CUfunction_attribute attrib, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuKernelGetAttribute + _check_or_init_driver() + if __cuKernelGetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuKernelGetAttribute is not found") + return (__cuKernelGetAttribute)( + pi, attrib, kernel, dev) + + +cdef CUresult _cuKernelSetAttribute(CUfunction_attribute attrib, int val, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuKernelSetAttribute + _check_or_init_driver() + if __cuKernelSetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuKernelSetAttribute is not found") + return (__cuKernelSetAttribute)( + attrib, val, kernel, dev) + + +cdef CUresult _cuKernelSetCacheConfig(CUkernel kernel, CUfunc_cache config, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuKernelSetCacheConfig + _check_or_init_driver() + if __cuKernelSetCacheConfig == NULL: + with gil: + raise FunctionNotFoundError("function cuKernelSetCacheConfig is not found") + return (__cuKernelSetCacheConfig)( + kernel, config, dev) + + +cdef CUresult _cuKernelGetName(const char** name, CUkernel hfunc) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuKernelGetName + _check_or_init_driver() + if __cuKernelGetName == NULL: + with gil: + raise FunctionNotFoundError("function cuKernelGetName is not found") + return (__cuKernelGetName)( + name, hfunc) + + +cdef CUresult _cuKernelGetParamInfo(CUkernel kernel, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuKernelGetParamInfo + _check_or_init_driver() + if __cuKernelGetParamInfo == NULL: + with gil: + raise FunctionNotFoundError("function cuKernelGetParamInfo is not found") + return (__cuKernelGetParamInfo)( + kernel, paramIndex, paramOffset, paramSize) + + +cdef CUresult _cuMemGetInfo_v2(size_t* free, size_t* total) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemGetInfo_v2 + _check_or_init_driver() + if __cuMemGetInfo_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemGetInfo_v2 is not found") + return (__cuMemGetInfo_v2)( + free, total) + + +cdef CUresult _cuMemAlloc_v2(CUdeviceptr* dptr, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemAlloc_v2 + _check_or_init_driver() + if __cuMemAlloc_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemAlloc_v2 is not found") + return (__cuMemAlloc_v2)( + dptr, bytesize) + + +cdef CUresult _cuMemAllocPitch_v2(CUdeviceptr* dptr, size_t* pPitch, size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemAllocPitch_v2 + _check_or_init_driver() + if __cuMemAllocPitch_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemAllocPitch_v2 is not found") + return (__cuMemAllocPitch_v2)( + dptr, pPitch, WidthInBytes, Height, ElementSizeBytes) + + +cdef CUresult _cuMemFree_v2(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemFree_v2 + _check_or_init_driver() + if __cuMemFree_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemFree_v2 is not found") + return (__cuMemFree_v2)( + dptr) + + +cdef CUresult _cuMemGetAddressRange_v2(CUdeviceptr* pbase, size_t* psize, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemGetAddressRange_v2 + _check_or_init_driver() + if __cuMemGetAddressRange_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemGetAddressRange_v2 is not found") + return (__cuMemGetAddressRange_v2)( + pbase, psize, dptr) + + +cdef CUresult _cuMemAllocHost_v2(void** pp, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemAllocHost_v2 + _check_or_init_driver() + if __cuMemAllocHost_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemAllocHost_v2 is not found") + return (__cuMemAllocHost_v2)( + pp, bytesize) + + +cdef CUresult _cuMemFreeHost(void* p) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemFreeHost + _check_or_init_driver() + if __cuMemFreeHost == NULL: + with gil: + raise FunctionNotFoundError("function cuMemFreeHost is not found") + return (__cuMemFreeHost)( + p) + + +cdef CUresult _cuMemHostAlloc(void** pp, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemHostAlloc + _check_or_init_driver() + if __cuMemHostAlloc == NULL: + with gil: + raise FunctionNotFoundError("function cuMemHostAlloc is not found") + return (__cuMemHostAlloc)( + pp, bytesize, Flags) + + +cdef CUresult _cuMemHostGetDevicePointer_v2(CUdeviceptr* pdptr, void* p, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemHostGetDevicePointer_v2 + _check_or_init_driver() + if __cuMemHostGetDevicePointer_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemHostGetDevicePointer_v2 is not found") + return (__cuMemHostGetDevicePointer_v2)( + pdptr, p, Flags) + + +cdef CUresult _cuMemHostGetFlags(unsigned int* pFlags, void* p) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemHostGetFlags + _check_or_init_driver() + if __cuMemHostGetFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuMemHostGetFlags is not found") + return (__cuMemHostGetFlags)( + pFlags, p) + + +cdef CUresult _cuMemAllocManaged(CUdeviceptr* dptr, size_t bytesize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemAllocManaged + _check_or_init_driver() + if __cuMemAllocManaged == NULL: + with gil: + raise FunctionNotFoundError("function cuMemAllocManaged is not found") + return (__cuMemAllocManaged)( + dptr, bytesize, flags) + + +cdef CUresult _cuDeviceRegisterAsyncNotification(CUdevice device, CUasyncCallback callbackFunc, void* userData, CUasyncCallbackHandle* callback) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceRegisterAsyncNotification + _check_or_init_driver() + if __cuDeviceRegisterAsyncNotification == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceRegisterAsyncNotification is not found") + return (__cuDeviceRegisterAsyncNotification)( + device, callbackFunc, userData, callback) + + +cdef CUresult _cuDeviceUnregisterAsyncNotification(CUdevice device, CUasyncCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceUnregisterAsyncNotification + _check_or_init_driver() + if __cuDeviceUnregisterAsyncNotification == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceUnregisterAsyncNotification is not found") + return (__cuDeviceUnregisterAsyncNotification)( + device, callback) + + +cdef CUresult _cuDeviceGetByPCIBusId(CUdevice* dev, const char* pciBusId) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetByPCIBusId + _check_or_init_driver() + if __cuDeviceGetByPCIBusId == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetByPCIBusId is not found") + return (__cuDeviceGetByPCIBusId)( + dev, pciBusId) + + +cdef CUresult _cuDeviceGetPCIBusId(char* pciBusId, int len, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetPCIBusId + _check_or_init_driver() + if __cuDeviceGetPCIBusId == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetPCIBusId is not found") + return (__cuDeviceGetPCIBusId)( + pciBusId, len, dev) + + +cdef CUresult _cuIpcGetEventHandle(CUipcEventHandle* pHandle, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuIpcGetEventHandle + _check_or_init_driver() + if __cuIpcGetEventHandle == NULL: + with gil: + raise FunctionNotFoundError("function cuIpcGetEventHandle is not found") + return (__cuIpcGetEventHandle)( + pHandle, event) + + +cdef CUresult _cuIpcOpenEventHandle(CUevent* phEvent, CUipcEventHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuIpcOpenEventHandle + _check_or_init_driver() + if __cuIpcOpenEventHandle == NULL: + with gil: + raise FunctionNotFoundError("function cuIpcOpenEventHandle is not found") + return (__cuIpcOpenEventHandle)( + phEvent, handle) + + +cdef CUresult _cuIpcGetMemHandle(CUipcMemHandle* pHandle, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuIpcGetMemHandle + _check_or_init_driver() + if __cuIpcGetMemHandle == NULL: + with gil: + raise FunctionNotFoundError("function cuIpcGetMemHandle is not found") + return (__cuIpcGetMemHandle)( + pHandle, dptr) + + +cdef CUresult _cuIpcOpenMemHandle_v2(CUdeviceptr* pdptr, CUipcMemHandle handle, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuIpcOpenMemHandle_v2 + _check_or_init_driver() + if __cuIpcOpenMemHandle_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuIpcOpenMemHandle_v2 is not found") + return (__cuIpcOpenMemHandle_v2)( + pdptr, handle, Flags) + + +cdef CUresult _cuIpcCloseMemHandle(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuIpcCloseMemHandle + _check_or_init_driver() + if __cuIpcCloseMemHandle == NULL: + with gil: + raise FunctionNotFoundError("function cuIpcCloseMemHandle is not found") + return (__cuIpcCloseMemHandle)( + dptr) + + +cdef CUresult _cuMemHostRegister_v2(void* p, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemHostRegister_v2 + _check_or_init_driver() + if __cuMemHostRegister_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemHostRegister_v2 is not found") + return (__cuMemHostRegister_v2)( + p, bytesize, Flags) + + +cdef CUresult _cuMemHostUnregister(void* p) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemHostUnregister + _check_or_init_driver() + if __cuMemHostUnregister == NULL: + with gil: + raise FunctionNotFoundError("function cuMemHostUnregister is not found") + return (__cuMemHostUnregister)( + p) + + +cdef CUresult _cuMemcpy(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpy + _check_or_init_driver() + if __cuMemcpy == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpy is not found") + return (__cuMemcpy)( + dst, src, ByteCount) + + +cdef CUresult _cuMemcpyPeer(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyPeer + _check_or_init_driver() + if __cuMemcpyPeer == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyPeer is not found") + return (__cuMemcpyPeer)( + dstDevice, dstContext, srcDevice, srcContext, ByteCount) + + +cdef CUresult _cuMemcpyHtoD_v2(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyHtoD_v2 + _check_or_init_driver() + if __cuMemcpyHtoD_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyHtoD_v2 is not found") + return (__cuMemcpyHtoD_v2)( + dstDevice, srcHost, ByteCount) + + +cdef CUresult _cuMemcpyDtoH_v2(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyDtoH_v2 + _check_or_init_driver() + if __cuMemcpyDtoH_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyDtoH_v2 is not found") + return (__cuMemcpyDtoH_v2)( + dstHost, srcDevice, ByteCount) + + +cdef CUresult _cuMemcpyDtoD_v2(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyDtoD_v2 + _check_or_init_driver() + if __cuMemcpyDtoD_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyDtoD_v2 is not found") + return (__cuMemcpyDtoD_v2)( + dstDevice, srcDevice, ByteCount) + + +cdef CUresult _cuMemcpyDtoA_v2(CUarray dstArray, size_t dstOffset, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyDtoA_v2 + _check_or_init_driver() + if __cuMemcpyDtoA_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyDtoA_v2 is not found") + return (__cuMemcpyDtoA_v2)( + dstArray, dstOffset, srcDevice, ByteCount) + + +cdef CUresult _cuMemcpyAtoD_v2(CUdeviceptr dstDevice, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyAtoD_v2 + _check_or_init_driver() + if __cuMemcpyAtoD_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyAtoD_v2 is not found") + return (__cuMemcpyAtoD_v2)( + dstDevice, srcArray, srcOffset, ByteCount) + + +cdef CUresult _cuMemcpyHtoA_v2(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyHtoA_v2 + _check_or_init_driver() + if __cuMemcpyHtoA_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyHtoA_v2 is not found") + return (__cuMemcpyHtoA_v2)( + dstArray, dstOffset, srcHost, ByteCount) + + +cdef CUresult _cuMemcpyAtoH_v2(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyAtoH_v2 + _check_or_init_driver() + if __cuMemcpyAtoH_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyAtoH_v2 is not found") + return (__cuMemcpyAtoH_v2)( + dstHost, srcArray, srcOffset, ByteCount) + + +cdef CUresult _cuMemcpyAtoA_v2(CUarray dstArray, size_t dstOffset, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyAtoA_v2 + _check_or_init_driver() + if __cuMemcpyAtoA_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyAtoA_v2 is not found") + return (__cuMemcpyAtoA_v2)( + dstArray, dstOffset, srcArray, srcOffset, ByteCount) + + +cdef CUresult _cuMemcpy2D_v2(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpy2D_v2 + _check_or_init_driver() + if __cuMemcpy2D_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpy2D_v2 is not found") + return (__cuMemcpy2D_v2)( + pCopy) + + +cdef CUresult _cuMemcpy2DUnaligned_v2(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpy2DUnaligned_v2 + _check_or_init_driver() + if __cuMemcpy2DUnaligned_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpy2DUnaligned_v2 is not found") + return (__cuMemcpy2DUnaligned_v2)( + pCopy) + + +cdef CUresult _cuMemcpy3D_v2(const CUDA_MEMCPY3D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpy3D_v2 + _check_or_init_driver() + if __cuMemcpy3D_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpy3D_v2 is not found") + return (__cuMemcpy3D_v2)( + pCopy) + + +cdef CUresult _cuMemcpy3DPeer(const CUDA_MEMCPY3D_PEER* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpy3DPeer + _check_or_init_driver() + if __cuMemcpy3DPeer == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpy3DPeer is not found") + return (__cuMemcpy3DPeer)( + pCopy) + + +cdef CUresult _cuMemcpyAsync(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyAsync + _check_or_init_driver() + if __cuMemcpyAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyAsync is not found") + return (__cuMemcpyAsync)( + dst, src, ByteCount, hStream) + + +cdef CUresult _cuMemcpyPeerAsync(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyPeerAsync + _check_or_init_driver() + if __cuMemcpyPeerAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyPeerAsync is not found") + return (__cuMemcpyPeerAsync)( + dstDevice, dstContext, srcDevice, srcContext, ByteCount, hStream) + + +cdef CUresult _cuMemcpyHtoDAsync_v2(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyHtoDAsync_v2 + _check_or_init_driver() + if __cuMemcpyHtoDAsync_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyHtoDAsync_v2 is not found") + return (__cuMemcpyHtoDAsync_v2)( + dstDevice, srcHost, ByteCount, hStream) + + +cdef CUresult _cuMemcpyDtoHAsync_v2(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyDtoHAsync_v2 + _check_or_init_driver() + if __cuMemcpyDtoHAsync_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyDtoHAsync_v2 is not found") + return (__cuMemcpyDtoHAsync_v2)( + dstHost, srcDevice, ByteCount, hStream) + + +cdef CUresult _cuMemcpyDtoDAsync_v2(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyDtoDAsync_v2 + _check_or_init_driver() + if __cuMemcpyDtoDAsync_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyDtoDAsync_v2 is not found") + return (__cuMemcpyDtoDAsync_v2)( + dstDevice, srcDevice, ByteCount, hStream) + + +cdef CUresult _cuMemcpyHtoAAsync_v2(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyHtoAAsync_v2 + _check_or_init_driver() + if __cuMemcpyHtoAAsync_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyHtoAAsync_v2 is not found") + return (__cuMemcpyHtoAAsync_v2)( + dstArray, dstOffset, srcHost, ByteCount, hStream) + + +cdef CUresult _cuMemcpyAtoHAsync_v2(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyAtoHAsync_v2 + _check_or_init_driver() + if __cuMemcpyAtoHAsync_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyAtoHAsync_v2 is not found") + return (__cuMemcpyAtoHAsync_v2)( + dstHost, srcArray, srcOffset, ByteCount, hStream) + + +cdef CUresult _cuMemcpy2DAsync_v2(const CUDA_MEMCPY2D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpy2DAsync_v2 + _check_or_init_driver() + if __cuMemcpy2DAsync_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpy2DAsync_v2 is not found") + return (__cuMemcpy2DAsync_v2)( + pCopy, hStream) + + +cdef CUresult _cuMemcpy3DAsync_v2(const CUDA_MEMCPY3D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpy3DAsync_v2 + _check_or_init_driver() + if __cuMemcpy3DAsync_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpy3DAsync_v2 is not found") + return (__cuMemcpy3DAsync_v2)( + pCopy, hStream) + + +cdef CUresult _cuMemcpy3DPeerAsync(const CUDA_MEMCPY3D_PEER* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpy3DPeerAsync + _check_or_init_driver() + if __cuMemcpy3DPeerAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpy3DPeerAsync is not found") + return (__cuMemcpy3DPeerAsync)( + pCopy, hStream) + + +cdef CUresult _cuMemsetD8_v2(CUdeviceptr dstDevice, unsigned char uc, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemsetD8_v2 + _check_or_init_driver() + if __cuMemsetD8_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemsetD8_v2 is not found") + return (__cuMemsetD8_v2)( + dstDevice, uc, N) + + +cdef CUresult _cuMemsetD16_v2(CUdeviceptr dstDevice, unsigned short us, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemsetD16_v2 + _check_or_init_driver() + if __cuMemsetD16_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemsetD16_v2 is not found") + return (__cuMemsetD16_v2)( + dstDevice, us, N) + + +cdef CUresult _cuMemsetD32_v2(CUdeviceptr dstDevice, unsigned int ui, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemsetD32_v2 + _check_or_init_driver() + if __cuMemsetD32_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemsetD32_v2 is not found") + return (__cuMemsetD32_v2)( + dstDevice, ui, N) + + +cdef CUresult _cuMemsetD2D8_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemsetD2D8_v2 + _check_or_init_driver() + if __cuMemsetD2D8_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemsetD2D8_v2 is not found") + return (__cuMemsetD2D8_v2)( + dstDevice, dstPitch, uc, Width, Height) + + +cdef CUresult _cuMemsetD2D16_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemsetD2D16_v2 + _check_or_init_driver() + if __cuMemsetD2D16_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemsetD2D16_v2 is not found") + return (__cuMemsetD2D16_v2)( + dstDevice, dstPitch, us, Width, Height) + + +cdef CUresult _cuMemsetD2D32_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemsetD2D32_v2 + _check_or_init_driver() + if __cuMemsetD2D32_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemsetD2D32_v2 is not found") + return (__cuMemsetD2D32_v2)( + dstDevice, dstPitch, ui, Width, Height) + + +cdef CUresult _cuMemsetD8Async(CUdeviceptr dstDevice, unsigned char uc, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemsetD8Async + _check_or_init_driver() + if __cuMemsetD8Async == NULL: + with gil: + raise FunctionNotFoundError("function cuMemsetD8Async is not found") + return (__cuMemsetD8Async)( + dstDevice, uc, N, hStream) + + +cdef CUresult _cuMemsetD16Async(CUdeviceptr dstDevice, unsigned short us, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemsetD16Async + _check_or_init_driver() + if __cuMemsetD16Async == NULL: + with gil: + raise FunctionNotFoundError("function cuMemsetD16Async is not found") + return (__cuMemsetD16Async)( + dstDevice, us, N, hStream) + + +cdef CUresult _cuMemsetD32Async(CUdeviceptr dstDevice, unsigned int ui, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemsetD32Async + _check_or_init_driver() + if __cuMemsetD32Async == NULL: + with gil: + raise FunctionNotFoundError("function cuMemsetD32Async is not found") + return (__cuMemsetD32Async)( + dstDevice, ui, N, hStream) + + +cdef CUresult _cuMemsetD2D8Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemsetD2D8Async + _check_or_init_driver() + if __cuMemsetD2D8Async == NULL: + with gil: + raise FunctionNotFoundError("function cuMemsetD2D8Async is not found") + return (__cuMemsetD2D8Async)( + dstDevice, dstPitch, uc, Width, Height, hStream) + + +cdef CUresult _cuMemsetD2D16Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemsetD2D16Async + _check_or_init_driver() + if __cuMemsetD2D16Async == NULL: + with gil: + raise FunctionNotFoundError("function cuMemsetD2D16Async is not found") + return (__cuMemsetD2D16Async)( + dstDevice, dstPitch, us, Width, Height, hStream) + + +cdef CUresult _cuMemsetD2D32Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemsetD2D32Async + _check_or_init_driver() + if __cuMemsetD2D32Async == NULL: + with gil: + raise FunctionNotFoundError("function cuMemsetD2D32Async is not found") + return (__cuMemsetD2D32Async)( + dstDevice, dstPitch, ui, Width, Height, hStream) + + +cdef CUresult _cuArrayCreate_v2(CUarray* pHandle, const CUDA_ARRAY_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuArrayCreate_v2 + _check_or_init_driver() + if __cuArrayCreate_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuArrayCreate_v2 is not found") + return (__cuArrayCreate_v2)( + pHandle, pAllocateArray) + + +cdef CUresult _cuArrayGetDescriptor_v2(CUDA_ARRAY_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuArrayGetDescriptor_v2 + _check_or_init_driver() + if __cuArrayGetDescriptor_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuArrayGetDescriptor_v2 is not found") + return (__cuArrayGetDescriptor_v2)( + pArrayDescriptor, hArray) + + +cdef CUresult _cuArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUarray array) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuArrayGetSparseProperties + _check_or_init_driver() + if __cuArrayGetSparseProperties == NULL: + with gil: + raise FunctionNotFoundError("function cuArrayGetSparseProperties is not found") + return (__cuArrayGetSparseProperties)( + sparseProperties, array) + + +cdef CUresult _cuMipmappedArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUmipmappedArray mipmap) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMipmappedArrayGetSparseProperties + _check_or_init_driver() + if __cuMipmappedArrayGetSparseProperties == NULL: + with gil: + raise FunctionNotFoundError("function cuMipmappedArrayGetSparseProperties is not found") + return (__cuMipmappedArrayGetSparseProperties)( + sparseProperties, mipmap) + + +cdef CUresult _cuArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUarray array, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuArrayGetMemoryRequirements + _check_or_init_driver() + if __cuArrayGetMemoryRequirements == NULL: + with gil: + raise FunctionNotFoundError("function cuArrayGetMemoryRequirements is not found") + return (__cuArrayGetMemoryRequirements)( + memoryRequirements, array, device) + + +cdef CUresult _cuMipmappedArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUmipmappedArray mipmap, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMipmappedArrayGetMemoryRequirements + _check_or_init_driver() + if __cuMipmappedArrayGetMemoryRequirements == NULL: + with gil: + raise FunctionNotFoundError("function cuMipmappedArrayGetMemoryRequirements is not found") + return (__cuMipmappedArrayGetMemoryRequirements)( + memoryRequirements, mipmap, device) + + +cdef CUresult _cuArrayGetPlane(CUarray* pPlaneArray, CUarray hArray, unsigned int planeIdx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuArrayGetPlane + _check_or_init_driver() + if __cuArrayGetPlane == NULL: + with gil: + raise FunctionNotFoundError("function cuArrayGetPlane is not found") + return (__cuArrayGetPlane)( + pPlaneArray, hArray, planeIdx) + + +cdef CUresult _cuArrayDestroy(CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuArrayDestroy + _check_or_init_driver() + if __cuArrayDestroy == NULL: + with gil: + raise FunctionNotFoundError("function cuArrayDestroy is not found") + return (__cuArrayDestroy)( + hArray) + + +cdef CUresult _cuArray3DCreate_v2(CUarray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuArray3DCreate_v2 + _check_or_init_driver() + if __cuArray3DCreate_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuArray3DCreate_v2 is not found") + return (__cuArray3DCreate_v2)( + pHandle, pAllocateArray) + + +cdef CUresult _cuArray3DGetDescriptor_v2(CUDA_ARRAY3D_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuArray3DGetDescriptor_v2 + _check_or_init_driver() + if __cuArray3DGetDescriptor_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuArray3DGetDescriptor_v2 is not found") + return (__cuArray3DGetDescriptor_v2)( + pArrayDescriptor, hArray) + + +cdef CUresult _cuMipmappedArrayCreate(CUmipmappedArray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pMipmappedArrayDesc, unsigned int numMipmapLevels) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMipmappedArrayCreate + _check_or_init_driver() + if __cuMipmappedArrayCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuMipmappedArrayCreate is not found") + return (__cuMipmappedArrayCreate)( + pHandle, pMipmappedArrayDesc, numMipmapLevels) + + +cdef CUresult _cuMipmappedArrayGetLevel(CUarray* pLevelArray, CUmipmappedArray hMipmappedArray, unsigned int level) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMipmappedArrayGetLevel + _check_or_init_driver() + if __cuMipmappedArrayGetLevel == NULL: + with gil: + raise FunctionNotFoundError("function cuMipmappedArrayGetLevel is not found") + return (__cuMipmappedArrayGetLevel)( + pLevelArray, hMipmappedArray, level) + + +cdef CUresult _cuMipmappedArrayDestroy(CUmipmappedArray hMipmappedArray) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMipmappedArrayDestroy + _check_or_init_driver() + if __cuMipmappedArrayDestroy == NULL: + with gil: + raise FunctionNotFoundError("function cuMipmappedArrayDestroy is not found") + return (__cuMipmappedArrayDestroy)( + hMipmappedArray) + + +cdef CUresult _cuMemGetHandleForAddressRange(void* handle, CUdeviceptr dptr, size_t size, CUmemRangeHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemGetHandleForAddressRange + _check_or_init_driver() + if __cuMemGetHandleForAddressRange == NULL: + with gil: + raise FunctionNotFoundError("function cuMemGetHandleForAddressRange is not found") + return (__cuMemGetHandleForAddressRange)( + handle, dptr, size, handleType, flags) + + +cdef CUresult _cuMemBatchDecompressAsync(CUmemDecompressParams* paramsArray, size_t count, unsigned int flags, size_t* errorIndex, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemBatchDecompressAsync + _check_or_init_driver() + if __cuMemBatchDecompressAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemBatchDecompressAsync is not found") + return (__cuMemBatchDecompressAsync)( + paramsArray, count, flags, errorIndex, stream) + + +cdef CUresult _cuMemAddressReserve(CUdeviceptr* ptr, size_t size, size_t alignment, CUdeviceptr addr, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemAddressReserve + _check_or_init_driver() + if __cuMemAddressReserve == NULL: + with gil: + raise FunctionNotFoundError("function cuMemAddressReserve is not found") + return (__cuMemAddressReserve)( + ptr, size, alignment, addr, flags) + + +cdef CUresult _cuMemAddressFree(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemAddressFree + _check_or_init_driver() + if __cuMemAddressFree == NULL: + with gil: + raise FunctionNotFoundError("function cuMemAddressFree is not found") + return (__cuMemAddressFree)( + ptr, size) + + +cdef CUresult _cuMemCreate(CUmemGenericAllocationHandle* handle, size_t size, const CUmemAllocationProp* prop, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemCreate + _check_or_init_driver() + if __cuMemCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuMemCreate is not found") + return (__cuMemCreate)( + handle, size, prop, flags) + + +cdef CUresult _cuMemRelease(CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemRelease + _check_or_init_driver() + if __cuMemRelease == NULL: + with gil: + raise FunctionNotFoundError("function cuMemRelease is not found") + return (__cuMemRelease)( + handle) + + +cdef CUresult _cuMemMap(CUdeviceptr ptr, size_t size, size_t offset, CUmemGenericAllocationHandle handle, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemMap + _check_or_init_driver() + if __cuMemMap == NULL: + with gil: + raise FunctionNotFoundError("function cuMemMap is not found") + return (__cuMemMap)( + ptr, size, offset, handle, flags) + + +cdef CUresult _cuMemMapArrayAsync(CUarrayMapInfo* mapInfoList, unsigned int count, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemMapArrayAsync + _check_or_init_driver() + if __cuMemMapArrayAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemMapArrayAsync is not found") + return (__cuMemMapArrayAsync)( + mapInfoList, count, hStream) + + +cdef CUresult _cuMemUnmap(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemUnmap + _check_or_init_driver() + if __cuMemUnmap == NULL: + with gil: + raise FunctionNotFoundError("function cuMemUnmap is not found") + return (__cuMemUnmap)( + ptr, size) + + +cdef CUresult _cuMemSetAccess(CUdeviceptr ptr, size_t size, const CUmemAccessDesc* desc, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemSetAccess + _check_or_init_driver() + if __cuMemSetAccess == NULL: + with gil: + raise FunctionNotFoundError("function cuMemSetAccess is not found") + return (__cuMemSetAccess)( + ptr, size, desc, count) + + +cdef CUresult _cuMemGetAccess(unsigned long long* flags, const CUmemLocation* location, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemGetAccess + _check_or_init_driver() + if __cuMemGetAccess == NULL: + with gil: + raise FunctionNotFoundError("function cuMemGetAccess is not found") + return (__cuMemGetAccess)( + flags, location, ptr) + + +cdef CUresult _cuMemExportToShareableHandle(void* shareableHandle, CUmemGenericAllocationHandle handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemExportToShareableHandle + _check_or_init_driver() + if __cuMemExportToShareableHandle == NULL: + with gil: + raise FunctionNotFoundError("function cuMemExportToShareableHandle is not found") + return (__cuMemExportToShareableHandle)( + shareableHandle, handle, handleType, flags) + + +cdef CUresult _cuMemImportFromShareableHandle(CUmemGenericAllocationHandle* handle, void* osHandle, CUmemAllocationHandleType shHandleType) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemImportFromShareableHandle + _check_or_init_driver() + if __cuMemImportFromShareableHandle == NULL: + with gil: + raise FunctionNotFoundError("function cuMemImportFromShareableHandle is not found") + return (__cuMemImportFromShareableHandle)( + handle, osHandle, shHandleType) + + +cdef CUresult _cuMemGetAllocationGranularity(size_t* granularity, const CUmemAllocationProp* prop, CUmemAllocationGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemGetAllocationGranularity + _check_or_init_driver() + if __cuMemGetAllocationGranularity == NULL: + with gil: + raise FunctionNotFoundError("function cuMemGetAllocationGranularity is not found") + return (__cuMemGetAllocationGranularity)( + granularity, prop, option) + + +cdef CUresult _cuMemGetAllocationPropertiesFromHandle(CUmemAllocationProp* prop, CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemGetAllocationPropertiesFromHandle + _check_or_init_driver() + if __cuMemGetAllocationPropertiesFromHandle == NULL: + with gil: + raise FunctionNotFoundError("function cuMemGetAllocationPropertiesFromHandle is not found") + return (__cuMemGetAllocationPropertiesFromHandle)( + prop, handle) + + +cdef CUresult _cuMemRetainAllocationHandle(CUmemGenericAllocationHandle* handle, void* addr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemRetainAllocationHandle + _check_or_init_driver() + if __cuMemRetainAllocationHandle == NULL: + with gil: + raise FunctionNotFoundError("function cuMemRetainAllocationHandle is not found") + return (__cuMemRetainAllocationHandle)( + handle, addr) + + +cdef CUresult _cuMemFreeAsync(CUdeviceptr dptr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemFreeAsync + _check_or_init_driver() + if __cuMemFreeAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemFreeAsync is not found") + return (__cuMemFreeAsync)( + dptr, hStream) + + +cdef CUresult _cuMemAllocAsync(CUdeviceptr* dptr, size_t bytesize, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemAllocAsync + _check_or_init_driver() + if __cuMemAllocAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemAllocAsync is not found") + return (__cuMemAllocAsync)( + dptr, bytesize, hStream) + + +cdef CUresult _cuMemPoolTrimTo(CUmemoryPool pool, size_t minBytesToKeep) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPoolTrimTo + _check_or_init_driver() + if __cuMemPoolTrimTo == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPoolTrimTo is not found") + return (__cuMemPoolTrimTo)( + pool, minBytesToKeep) + + +cdef CUresult _cuMemPoolSetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPoolSetAttribute + _check_or_init_driver() + if __cuMemPoolSetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPoolSetAttribute is not found") + return (__cuMemPoolSetAttribute)( + pool, attr, value) + + +cdef CUresult _cuMemPoolGetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPoolGetAttribute + _check_or_init_driver() + if __cuMemPoolGetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPoolGetAttribute is not found") + return (__cuMemPoolGetAttribute)( + pool, attr, value) + + +cdef CUresult _cuMemPoolSetAccess(CUmemoryPool pool, const CUmemAccessDesc* map, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPoolSetAccess + _check_or_init_driver() + if __cuMemPoolSetAccess == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPoolSetAccess is not found") + return (__cuMemPoolSetAccess)( + pool, map, count) + + +cdef CUresult _cuMemPoolGetAccess(CUmemAccess_flags* flags, CUmemoryPool memPool, CUmemLocation* location) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPoolGetAccess + _check_or_init_driver() + if __cuMemPoolGetAccess == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPoolGetAccess is not found") + return (__cuMemPoolGetAccess)( + flags, memPool, location) + + +cdef CUresult _cuMemPoolCreate(CUmemoryPool* pool, const CUmemPoolProps* poolProps) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPoolCreate + _check_or_init_driver() + if __cuMemPoolCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPoolCreate is not found") + return (__cuMemPoolCreate)( + pool, poolProps) + + +cdef CUresult _cuMemPoolDestroy(CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPoolDestroy + _check_or_init_driver() + if __cuMemPoolDestroy == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPoolDestroy is not found") + return (__cuMemPoolDestroy)( + pool) + + +cdef CUresult _cuMemAllocFromPoolAsync(CUdeviceptr* dptr, size_t bytesize, CUmemoryPool pool, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemAllocFromPoolAsync + _check_or_init_driver() + if __cuMemAllocFromPoolAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemAllocFromPoolAsync is not found") + return (__cuMemAllocFromPoolAsync)( + dptr, bytesize, pool, hStream) + + +cdef CUresult _cuMemPoolExportToShareableHandle(void* handle_out, CUmemoryPool pool, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPoolExportToShareableHandle + _check_or_init_driver() + if __cuMemPoolExportToShareableHandle == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPoolExportToShareableHandle is not found") + return (__cuMemPoolExportToShareableHandle)( + handle_out, pool, handleType, flags) + + +cdef CUresult _cuMemPoolImportFromShareableHandle(CUmemoryPool* pool_out, void* handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPoolImportFromShareableHandle + _check_or_init_driver() + if __cuMemPoolImportFromShareableHandle == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPoolImportFromShareableHandle is not found") + return (__cuMemPoolImportFromShareableHandle)( + pool_out, handle, handleType, flags) + + +cdef CUresult _cuMemPoolExportPointer(CUmemPoolPtrExportData* shareData_out, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPoolExportPointer + _check_or_init_driver() + if __cuMemPoolExportPointer == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPoolExportPointer is not found") + return (__cuMemPoolExportPointer)( + shareData_out, ptr) + + +cdef CUresult _cuMemPoolImportPointer(CUdeviceptr* ptr_out, CUmemoryPool pool, CUmemPoolPtrExportData* shareData) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPoolImportPointer + _check_or_init_driver() + if __cuMemPoolImportPointer == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPoolImportPointer is not found") + return (__cuMemPoolImportPointer)( + ptr_out, pool, shareData) + + +cdef CUresult _cuMulticastCreate(CUmemGenericAllocationHandle* mcHandle, const CUmulticastObjectProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMulticastCreate + _check_or_init_driver() + if __cuMulticastCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuMulticastCreate is not found") + return (__cuMulticastCreate)( + mcHandle, prop) + + +cdef CUresult _cuMulticastAddDevice(CUmemGenericAllocationHandle mcHandle, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMulticastAddDevice + _check_or_init_driver() + if __cuMulticastAddDevice == NULL: + with gil: + raise FunctionNotFoundError("function cuMulticastAddDevice is not found") + return (__cuMulticastAddDevice)( + mcHandle, dev) + + +cdef CUresult _cuMulticastBindMem(CUmemGenericAllocationHandle mcHandle, size_t mcOffset, CUmemGenericAllocationHandle memHandle, size_t memOffset, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMulticastBindMem + _check_or_init_driver() + if __cuMulticastBindMem == NULL: + with gil: + raise FunctionNotFoundError("function cuMulticastBindMem is not found") + return (__cuMulticastBindMem)( + mcHandle, mcOffset, memHandle, memOffset, size, flags) + + +cdef CUresult _cuMulticastBindAddr(CUmemGenericAllocationHandle mcHandle, size_t mcOffset, CUdeviceptr memptr, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMulticastBindAddr + _check_or_init_driver() + if __cuMulticastBindAddr == NULL: + with gil: + raise FunctionNotFoundError("function cuMulticastBindAddr is not found") + return (__cuMulticastBindAddr)( + mcHandle, mcOffset, memptr, size, flags) + + +cdef CUresult _cuMulticastUnbind(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMulticastUnbind + _check_or_init_driver() + if __cuMulticastUnbind == NULL: + with gil: + raise FunctionNotFoundError("function cuMulticastUnbind is not found") + return (__cuMulticastUnbind)( + mcHandle, dev, mcOffset, size) + + +cdef CUresult _cuMulticastGetGranularity(size_t* granularity, const CUmulticastObjectProp* prop, CUmulticastGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMulticastGetGranularity + _check_or_init_driver() + if __cuMulticastGetGranularity == NULL: + with gil: + raise FunctionNotFoundError("function cuMulticastGetGranularity is not found") + return (__cuMulticastGetGranularity)( + granularity, prop, option) + + +cdef CUresult _cuPointerGetAttribute(void* data, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuPointerGetAttribute + _check_or_init_driver() + if __cuPointerGetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuPointerGetAttribute is not found") + return (__cuPointerGetAttribute)( + data, attribute, ptr) + + +cdef CUresult _cuMemPrefetchAsync_v2(CUdeviceptr devPtr, size_t count, CUmemLocation location, unsigned int flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemPrefetchAsync_v2 + _check_or_init_driver() + if __cuMemPrefetchAsync_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPrefetchAsync_v2 is not found") + return (__cuMemPrefetchAsync_v2)( + devPtr, count, location, flags, hStream) + + +cdef CUresult _cuMemAdvise_v2(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUmemLocation location) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemAdvise_v2 + _check_or_init_driver() + if __cuMemAdvise_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemAdvise_v2 is not found") + return (__cuMemAdvise_v2)( + devPtr, count, advice, location) + + +cdef CUresult _cuMemRangeGetAttribute(void* data, size_t dataSize, CUmem_range_attribute attribute, CUdeviceptr devPtr, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemRangeGetAttribute + _check_or_init_driver() + if __cuMemRangeGetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuMemRangeGetAttribute is not found") + return (__cuMemRangeGetAttribute)( + data, dataSize, attribute, devPtr, count) + + +cdef CUresult _cuMemRangeGetAttributes(void** data, size_t* dataSizes, CUmem_range_attribute* attributes, size_t numAttributes, CUdeviceptr devPtr, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemRangeGetAttributes + _check_or_init_driver() + if __cuMemRangeGetAttributes == NULL: + with gil: + raise FunctionNotFoundError("function cuMemRangeGetAttributes is not found") + return (__cuMemRangeGetAttributes)( + data, dataSizes, attributes, numAttributes, devPtr, count) + + +cdef CUresult _cuPointerSetAttribute(const void* value, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuPointerSetAttribute + _check_or_init_driver() + if __cuPointerSetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuPointerSetAttribute is not found") + return (__cuPointerSetAttribute)( + value, attribute, ptr) + + +cdef CUresult _cuPointerGetAttributes(unsigned int numAttributes, CUpointer_attribute* attributes, void** data, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuPointerGetAttributes + _check_or_init_driver() + if __cuPointerGetAttributes == NULL: + with gil: + raise FunctionNotFoundError("function cuPointerGetAttributes is not found") + return (__cuPointerGetAttributes)( + numAttributes, attributes, data, ptr) + + +cdef CUresult _cuStreamCreate(CUstream* phStream, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamCreate + _check_or_init_driver() + if __cuStreamCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamCreate is not found") + return (__cuStreamCreate)( + phStream, Flags) + + +cdef CUresult _cuStreamCreateWithPriority(CUstream* phStream, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamCreateWithPriority + _check_or_init_driver() + if __cuStreamCreateWithPriority == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamCreateWithPriority is not found") + return (__cuStreamCreateWithPriority)( + phStream, flags, priority) + + +cdef CUresult _cuStreamGetPriority(CUstream hStream, int* priority) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamGetPriority + _check_or_init_driver() + if __cuStreamGetPriority == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamGetPriority is not found") + return (__cuStreamGetPriority)( + hStream, priority) + + +cdef CUresult _cuStreamGetDevice(CUstream hStream, CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamGetDevice + _check_or_init_driver() + if __cuStreamGetDevice == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamGetDevice is not found") + return (__cuStreamGetDevice)( + hStream, device) + + +cdef CUresult _cuStreamGetFlags(CUstream hStream, unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamGetFlags + _check_or_init_driver() + if __cuStreamGetFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamGetFlags is not found") + return (__cuStreamGetFlags)( + hStream, flags) + + +cdef CUresult _cuStreamGetId(CUstream hStream, unsigned long long* streamId) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamGetId + _check_or_init_driver() + if __cuStreamGetId == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamGetId is not found") + return (__cuStreamGetId)( + hStream, streamId) + + +cdef CUresult _cuStreamGetCtx(CUstream hStream, CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamGetCtx + _check_or_init_driver() + if __cuStreamGetCtx == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamGetCtx is not found") + return (__cuStreamGetCtx)( + hStream, pctx) + + +cdef CUresult _cuStreamGetCtx_v2(CUstream hStream, CUcontext* pCtx, CUgreenCtx* pGreenCtx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamGetCtx_v2 + _check_or_init_driver() + if __cuStreamGetCtx_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamGetCtx_v2 is not found") + return (__cuStreamGetCtx_v2)( + hStream, pCtx, pGreenCtx) + + +cdef CUresult _cuStreamWaitEvent(CUstream hStream, CUevent hEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamWaitEvent + _check_or_init_driver() + if __cuStreamWaitEvent == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamWaitEvent is not found") + return (__cuStreamWaitEvent)( + hStream, hEvent, Flags) + + +cdef CUresult _cuStreamAddCallback(CUstream hStream, CUstreamCallback callback, void* userData, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamAddCallback + _check_or_init_driver() + if __cuStreamAddCallback == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamAddCallback is not found") + return (__cuStreamAddCallback)( + hStream, callback, userData, flags) + + +cdef CUresult _cuStreamBeginCapture_v2(CUstream hStream, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamBeginCapture_v2 + _check_or_init_driver() + if __cuStreamBeginCapture_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamBeginCapture_v2 is not found") + return (__cuStreamBeginCapture_v2)( + hStream, mode) + + +cdef CUresult _cuStreamBeginCaptureToGraph(CUstream hStream, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamBeginCaptureToGraph + _check_or_init_driver() + if __cuStreamBeginCaptureToGraph == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamBeginCaptureToGraph is not found") + return (__cuStreamBeginCaptureToGraph)( + hStream, hGraph, dependencies, dependencyData, numDependencies, mode) + + +cdef CUresult _cuThreadExchangeStreamCaptureMode(CUstreamCaptureMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuThreadExchangeStreamCaptureMode + _check_or_init_driver() + if __cuThreadExchangeStreamCaptureMode == NULL: + with gil: + raise FunctionNotFoundError("function cuThreadExchangeStreamCaptureMode is not found") + return (__cuThreadExchangeStreamCaptureMode)( + mode) + + +cdef CUresult _cuStreamEndCapture(CUstream hStream, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamEndCapture + _check_or_init_driver() + if __cuStreamEndCapture == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamEndCapture is not found") + return (__cuStreamEndCapture)( + hStream, phGraph) + + +cdef CUresult _cuStreamIsCapturing(CUstream hStream, CUstreamCaptureStatus* captureStatus) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamIsCapturing + _check_or_init_driver() + if __cuStreamIsCapturing == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamIsCapturing is not found") + return (__cuStreamIsCapturing)( + hStream, captureStatus) + + +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 + _check_or_init_driver() + if __cuStreamGetCaptureInfo_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamGetCaptureInfo_v2 is not found") + return (__cuStreamGetCaptureInfo_v2)( + hStream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out) + + +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: + global __cuStreamGetCaptureInfo_v3 + _check_or_init_driver() + if __cuStreamGetCaptureInfo_v3 == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamGetCaptureInfo_v3 is not found") + return (__cuStreamGetCaptureInfo_v3)( + hStream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out) + + +cdef CUresult _cuStreamUpdateCaptureDependencies_v2(CUstream hStream, CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamUpdateCaptureDependencies_v2 + _check_or_init_driver() + if __cuStreamUpdateCaptureDependencies_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamUpdateCaptureDependencies_v2 is not found") + return (__cuStreamUpdateCaptureDependencies_v2)( + hStream, dependencies, dependencyData, numDependencies, flags) + + +cdef CUresult _cuStreamAttachMemAsync(CUstream hStream, CUdeviceptr dptr, size_t length, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamAttachMemAsync + _check_or_init_driver() + if __cuStreamAttachMemAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamAttachMemAsync is not found") + return (__cuStreamAttachMemAsync)( + hStream, dptr, length, flags) + + +cdef CUresult _cuStreamQuery(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamQuery + _check_or_init_driver() + if __cuStreamQuery == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamQuery is not found") + return (__cuStreamQuery)( + hStream) + + +cdef CUresult _cuStreamSynchronize(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamSynchronize + _check_or_init_driver() + if __cuStreamSynchronize == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamSynchronize is not found") + return (__cuStreamSynchronize)( + hStream) + + +cdef CUresult _cuStreamDestroy_v2(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamDestroy_v2 + _check_or_init_driver() + if __cuStreamDestroy_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamDestroy_v2 is not found") + return (__cuStreamDestroy_v2)( + hStream) + + +cdef CUresult _cuStreamCopyAttributes(CUstream dst, CUstream src) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamCopyAttributes + _check_or_init_driver() + if __cuStreamCopyAttributes == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamCopyAttributes is not found") + return (__cuStreamCopyAttributes)( + dst, src) + + +cdef CUresult _cuStreamGetAttribute(CUstream hStream, CUstreamAttrID attr, CUstreamAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamGetAttribute + _check_or_init_driver() + if __cuStreamGetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamGetAttribute is not found") + return (__cuStreamGetAttribute)( + hStream, attr, value_out) + + +cdef CUresult _cuStreamSetAttribute(CUstream hStream, CUstreamAttrID attr, const CUstreamAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamSetAttribute + _check_or_init_driver() + if __cuStreamSetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamSetAttribute is not found") + return (__cuStreamSetAttribute)( + hStream, attr, value) + + +cdef CUresult _cuEventCreate(CUevent* phEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEventCreate + _check_or_init_driver() + if __cuEventCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuEventCreate is not found") + return (__cuEventCreate)( + phEvent, Flags) + + +cdef CUresult _cuEventRecord(CUevent hEvent, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEventRecord + _check_or_init_driver() + if __cuEventRecord == NULL: + with gil: + raise FunctionNotFoundError("function cuEventRecord is not found") + return (__cuEventRecord)( + hEvent, hStream) + + +cdef CUresult _cuEventRecordWithFlags(CUevent hEvent, CUstream hStream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEventRecordWithFlags + _check_or_init_driver() + if __cuEventRecordWithFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuEventRecordWithFlags is not found") + return (__cuEventRecordWithFlags)( + hEvent, hStream, flags) + + +cdef CUresult _cuEventQuery(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEventQuery + _check_or_init_driver() + if __cuEventQuery == NULL: + with gil: + raise FunctionNotFoundError("function cuEventQuery is not found") + return (__cuEventQuery)( + hEvent) + + +cdef CUresult _cuEventSynchronize(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEventSynchronize + _check_or_init_driver() + if __cuEventSynchronize == NULL: + with gil: + raise FunctionNotFoundError("function cuEventSynchronize is not found") + return (__cuEventSynchronize)( + hEvent) + + +cdef CUresult _cuEventDestroy_v2(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEventDestroy_v2 + _check_or_init_driver() + if __cuEventDestroy_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuEventDestroy_v2 is not found") + return (__cuEventDestroy_v2)( + hEvent) + + +cdef CUresult _cuEventElapsedTime_v2(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEventElapsedTime_v2 + _check_or_init_driver() + if __cuEventElapsedTime_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuEventElapsedTime_v2 is not found") + return (__cuEventElapsedTime_v2)( + pMilliseconds, hStart, hEnd) + + +cdef CUresult _cuImportExternalMemory(CUexternalMemory* extMem_out, const CUDA_EXTERNAL_MEMORY_HANDLE_DESC* memHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuImportExternalMemory + _check_or_init_driver() + if __cuImportExternalMemory == NULL: + with gil: + raise FunctionNotFoundError("function cuImportExternalMemory is not found") + return (__cuImportExternalMemory)( + extMem_out, memHandleDesc) + + +cdef CUresult _cuExternalMemoryGetMappedBuffer(CUdeviceptr* devPtr, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_BUFFER_DESC* bufferDesc) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuExternalMemoryGetMappedBuffer + _check_or_init_driver() + if __cuExternalMemoryGetMappedBuffer == NULL: + with gil: + raise FunctionNotFoundError("function cuExternalMemoryGetMappedBuffer is not found") + return (__cuExternalMemoryGetMappedBuffer)( + devPtr, extMem, bufferDesc) + + +cdef CUresult _cuExternalMemoryGetMappedMipmappedArray(CUmipmappedArray* mipmap, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC* mipmapDesc) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuExternalMemoryGetMappedMipmappedArray + _check_or_init_driver() + if __cuExternalMemoryGetMappedMipmappedArray == NULL: + with gil: + raise FunctionNotFoundError("function cuExternalMemoryGetMappedMipmappedArray is not found") + return (__cuExternalMemoryGetMappedMipmappedArray)( + mipmap, extMem, mipmapDesc) + + +cdef CUresult _cuDestroyExternalMemory(CUexternalMemory extMem) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDestroyExternalMemory + _check_or_init_driver() + if __cuDestroyExternalMemory == NULL: + with gil: + raise FunctionNotFoundError("function cuDestroyExternalMemory is not found") + return (__cuDestroyExternalMemory)( + extMem) + + +cdef CUresult _cuImportExternalSemaphore(CUexternalSemaphore* extSem_out, const CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC* semHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuImportExternalSemaphore + _check_or_init_driver() + if __cuImportExternalSemaphore == NULL: + with gil: + raise FunctionNotFoundError("function cuImportExternalSemaphore is not found") + return (__cuImportExternalSemaphore)( + extSem_out, semHandleDesc) + + +cdef CUresult _cuSignalExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuSignalExternalSemaphoresAsync + _check_or_init_driver() + if __cuSignalExternalSemaphoresAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuSignalExternalSemaphoresAsync is not found") + return (__cuSignalExternalSemaphoresAsync)( + extSemArray, paramsArray, numExtSems, stream) + + +cdef CUresult _cuWaitExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuWaitExternalSemaphoresAsync + _check_or_init_driver() + if __cuWaitExternalSemaphoresAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuWaitExternalSemaphoresAsync is not found") + return (__cuWaitExternalSemaphoresAsync)( + extSemArray, paramsArray, numExtSems, stream) + + +cdef CUresult _cuDestroyExternalSemaphore(CUexternalSemaphore extSem) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDestroyExternalSemaphore + _check_or_init_driver() + if __cuDestroyExternalSemaphore == NULL: + with gil: + raise FunctionNotFoundError("function cuDestroyExternalSemaphore is not found") + return (__cuDestroyExternalSemaphore)( + extSem) + + +cdef CUresult _cuStreamWaitValue32_v2(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamWaitValue32_v2 + _check_or_init_driver() + if __cuStreamWaitValue32_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamWaitValue32_v2 is not found") + return (__cuStreamWaitValue32_v2)( + stream, addr, value, flags) + + +cdef CUresult _cuStreamWaitValue64_v2(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamWaitValue64_v2 + _check_or_init_driver() + if __cuStreamWaitValue64_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamWaitValue64_v2 is not found") + return (__cuStreamWaitValue64_v2)( + stream, addr, value, flags) + + +cdef CUresult _cuStreamWriteValue32_v2(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamWriteValue32_v2 + _check_or_init_driver() + if __cuStreamWriteValue32_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamWriteValue32_v2 is not found") + return (__cuStreamWriteValue32_v2)( + stream, addr, value, flags) + + +cdef CUresult _cuStreamWriteValue64_v2(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamWriteValue64_v2 + _check_or_init_driver() + if __cuStreamWriteValue64_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamWriteValue64_v2 is not found") + return (__cuStreamWriteValue64_v2)( + stream, addr, value, flags) + + +cdef CUresult _cuStreamBatchMemOp_v2(CUstream stream, unsigned int count, CUstreamBatchMemOpParams* paramArray, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamBatchMemOp_v2 + _check_or_init_driver() + if __cuStreamBatchMemOp_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamBatchMemOp_v2 is not found") + return (__cuStreamBatchMemOp_v2)( + stream, count, paramArray, flags) + + +cdef CUresult _cuFuncGetAttribute(int* pi, CUfunction_attribute attrib, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFuncGetAttribute + _check_or_init_driver() + if __cuFuncGetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuFuncGetAttribute is not found") + return (__cuFuncGetAttribute)( + pi, attrib, hfunc) + + +cdef CUresult _cuFuncSetAttribute(CUfunction hfunc, CUfunction_attribute attrib, int value) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFuncSetAttribute + _check_or_init_driver() + if __cuFuncSetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuFuncSetAttribute is not found") + return (__cuFuncSetAttribute)( + hfunc, attrib, value) + + +cdef CUresult _cuFuncSetCacheConfig(CUfunction hfunc, CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFuncSetCacheConfig + _check_or_init_driver() + if __cuFuncSetCacheConfig == NULL: + with gil: + raise FunctionNotFoundError("function cuFuncSetCacheConfig is not found") + return (__cuFuncSetCacheConfig)( + hfunc, config) + + +cdef CUresult _cuFuncGetModule(CUmodule* hmod, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFuncGetModule + _check_or_init_driver() + if __cuFuncGetModule == NULL: + with gil: + raise FunctionNotFoundError("function cuFuncGetModule is not found") + return (__cuFuncGetModule)( + hmod, hfunc) + + +cdef CUresult _cuFuncGetName(const char** name, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFuncGetName + _check_or_init_driver() + if __cuFuncGetName == NULL: + with gil: + raise FunctionNotFoundError("function cuFuncGetName is not found") + return (__cuFuncGetName)( + name, hfunc) + + +cdef CUresult _cuFuncGetParamInfo(CUfunction func, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFuncGetParamInfo + _check_or_init_driver() + if __cuFuncGetParamInfo == NULL: + with gil: + raise FunctionNotFoundError("function cuFuncGetParamInfo is not found") + return (__cuFuncGetParamInfo)( + func, paramIndex, paramOffset, paramSize) + + +cdef CUresult _cuFuncIsLoaded(CUfunctionLoadingState* state, CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFuncIsLoaded + _check_or_init_driver() + if __cuFuncIsLoaded == NULL: + with gil: + raise FunctionNotFoundError("function cuFuncIsLoaded is not found") + return (__cuFuncIsLoaded)( + state, function) + + +cdef CUresult _cuFuncLoad(CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFuncLoad + _check_or_init_driver() + if __cuFuncLoad == NULL: + with gil: + raise FunctionNotFoundError("function cuFuncLoad is not found") + return (__cuFuncLoad)( + function) + + +cdef CUresult _cuLaunchKernel(CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, CUstream hStream, void** kernelParams, void** extra) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLaunchKernel + _check_or_init_driver() + if __cuLaunchKernel == NULL: + with gil: + raise FunctionNotFoundError("function cuLaunchKernel is not found") + return (__cuLaunchKernel)( + f, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, hStream, kernelParams, extra) + + +cdef CUresult _cuLaunchKernelEx(const CUlaunchConfig* config, CUfunction f, void** kernelParams, void** extra) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLaunchKernelEx + _check_or_init_driver() + if __cuLaunchKernelEx == NULL: + with gil: + raise FunctionNotFoundError("function cuLaunchKernelEx is not found") + return (__cuLaunchKernelEx)( + config, f, kernelParams, extra) + + +cdef CUresult _cuLaunchCooperativeKernel(CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, CUstream hStream, void** kernelParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLaunchCooperativeKernel + _check_or_init_driver() + if __cuLaunchCooperativeKernel == NULL: + with gil: + raise FunctionNotFoundError("function cuLaunchCooperativeKernel is not found") + return (__cuLaunchCooperativeKernel)( + f, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, hStream, kernelParams) + + +cdef CUresult _cuLaunchCooperativeKernelMultiDevice(CUDA_LAUNCH_PARAMS* launchParamsList, unsigned int numDevices, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLaunchCooperativeKernelMultiDevice + _check_or_init_driver() + if __cuLaunchCooperativeKernelMultiDevice == NULL: + with gil: + raise FunctionNotFoundError("function cuLaunchCooperativeKernelMultiDevice is not found") + return (__cuLaunchCooperativeKernelMultiDevice)( + launchParamsList, numDevices, flags) + + +cdef CUresult _cuLaunchHostFunc(CUstream hStream, CUhostFn fn, void* userData) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLaunchHostFunc + _check_or_init_driver() + if __cuLaunchHostFunc == NULL: + with gil: + raise FunctionNotFoundError("function cuLaunchHostFunc is not found") + return (__cuLaunchHostFunc)( + hStream, fn, userData) + + +cdef CUresult _cuFuncSetBlockShape(CUfunction hfunc, int x, int y, int z) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFuncSetBlockShape + _check_or_init_driver() + if __cuFuncSetBlockShape == NULL: + with gil: + raise FunctionNotFoundError("function cuFuncSetBlockShape is not found") + return (__cuFuncSetBlockShape)( + hfunc, x, y, z) + + +cdef CUresult _cuFuncSetSharedSize(CUfunction hfunc, unsigned int bytes) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFuncSetSharedSize + _check_or_init_driver() + if __cuFuncSetSharedSize == NULL: + with gil: + raise FunctionNotFoundError("function cuFuncSetSharedSize is not found") + return (__cuFuncSetSharedSize)( + hfunc, bytes) + + +cdef CUresult _cuParamSetSize(CUfunction hfunc, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuParamSetSize + _check_or_init_driver() + if __cuParamSetSize == NULL: + with gil: + raise FunctionNotFoundError("function cuParamSetSize is not found") + return (__cuParamSetSize)( + hfunc, numbytes) + + +cdef CUresult _cuParamSeti(CUfunction hfunc, int offset, unsigned int value) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuParamSeti + _check_or_init_driver() + if __cuParamSeti == NULL: + with gil: + raise FunctionNotFoundError("function cuParamSeti is not found") + return (__cuParamSeti)( + hfunc, offset, value) + + +cdef CUresult _cuParamSetf(CUfunction hfunc, int offset, float value) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuParamSetf + _check_or_init_driver() + if __cuParamSetf == NULL: + with gil: + raise FunctionNotFoundError("function cuParamSetf is not found") + return (__cuParamSetf)( + hfunc, offset, value) + + +cdef CUresult _cuParamSetv(CUfunction hfunc, int offset, void* ptr, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuParamSetv + _check_or_init_driver() + if __cuParamSetv == NULL: + with gil: + raise FunctionNotFoundError("function cuParamSetv is not found") + return (__cuParamSetv)( + hfunc, offset, ptr, numbytes) + + +cdef CUresult _cuLaunch(CUfunction f) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLaunch + _check_or_init_driver() + if __cuLaunch == NULL: + with gil: + raise FunctionNotFoundError("function cuLaunch is not found") + return (__cuLaunch)( + f) + + +cdef CUresult _cuLaunchGrid(CUfunction f, int grid_width, int grid_height) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLaunchGrid + _check_or_init_driver() + if __cuLaunchGrid == NULL: + with gil: + raise FunctionNotFoundError("function cuLaunchGrid is not found") + return (__cuLaunchGrid)( + f, grid_width, grid_height) + + +cdef CUresult _cuLaunchGridAsync(CUfunction f, int grid_width, int grid_height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLaunchGridAsync + _check_or_init_driver() + if __cuLaunchGridAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuLaunchGridAsync is not found") + return (__cuLaunchGridAsync)( + f, grid_width, grid_height, hStream) + + +cdef CUresult _cuParamSetTexRef(CUfunction hfunc, int texunit, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuParamSetTexRef + _check_or_init_driver() + if __cuParamSetTexRef == NULL: + with gil: + raise FunctionNotFoundError("function cuParamSetTexRef is not found") + return (__cuParamSetTexRef)( + hfunc, texunit, hTexRef) + + +cdef CUresult _cuFuncSetSharedMemConfig(CUfunction hfunc, CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFuncSetSharedMemConfig + _check_or_init_driver() + if __cuFuncSetSharedMemConfig == NULL: + with gil: + raise FunctionNotFoundError("function cuFuncSetSharedMemConfig is not found") + return (__cuFuncSetSharedMemConfig)( + hfunc, config) + + +cdef CUresult _cuGraphCreate(CUgraph* phGraph, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphCreate + _check_or_init_driver() + if __cuGraphCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphCreate is not found") + return (__cuGraphCreate)( + phGraph, flags) + + +cdef CUresult _cuGraphAddKernelNode_v2(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddKernelNode_v2 + _check_or_init_driver() + if __cuGraphAddKernelNode_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddKernelNode_v2 is not found") + return (__cuGraphAddKernelNode_v2)( + phGraphNode, hGraph, dependencies, numDependencies, nodeParams) + + +cdef CUresult _cuGraphKernelNodeGetParams_v2(CUgraphNode hNode, CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphKernelNodeGetParams_v2 + _check_or_init_driver() + if __cuGraphKernelNodeGetParams_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphKernelNodeGetParams_v2 is not found") + return (__cuGraphKernelNodeGetParams_v2)( + hNode, nodeParams) + + +cdef CUresult _cuGraphKernelNodeSetParams_v2(CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphKernelNodeSetParams_v2 + _check_or_init_driver() + if __cuGraphKernelNodeSetParams_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphKernelNodeSetParams_v2 is not found") + return (__cuGraphKernelNodeSetParams_v2)( + hNode, nodeParams) + + +cdef CUresult _cuGraphAddMemcpyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_MEMCPY3D* copyParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddMemcpyNode + _check_or_init_driver() + if __cuGraphAddMemcpyNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddMemcpyNode is not found") + return (__cuGraphAddMemcpyNode)( + phGraphNode, hGraph, dependencies, numDependencies, copyParams, ctx) + + +cdef CUresult _cuGraphMemcpyNodeGetParams(CUgraphNode hNode, CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphMemcpyNodeGetParams + _check_or_init_driver() + if __cuGraphMemcpyNodeGetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphMemcpyNodeGetParams is not found") + return (__cuGraphMemcpyNodeGetParams)( + hNode, nodeParams) + + +cdef CUresult _cuGraphMemcpyNodeSetParams(CUgraphNode hNode, const CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphMemcpyNodeSetParams + _check_or_init_driver() + if __cuGraphMemcpyNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphMemcpyNodeSetParams is not found") + return (__cuGraphMemcpyNodeSetParams)( + hNode, nodeParams) + + +cdef CUresult _cuGraphAddMemsetNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_MEMSET_NODE_PARAMS* memsetParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddMemsetNode + _check_or_init_driver() + if __cuGraphAddMemsetNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddMemsetNode is not found") + return (__cuGraphAddMemsetNode)( + phGraphNode, hGraph, dependencies, numDependencies, memsetParams, ctx) + + +cdef CUresult _cuGraphMemsetNodeGetParams(CUgraphNode hNode, CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphMemsetNodeGetParams + _check_or_init_driver() + if __cuGraphMemsetNodeGetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphMemsetNodeGetParams is not found") + return (__cuGraphMemsetNodeGetParams)( + hNode, nodeParams) + + +cdef CUresult _cuGraphMemsetNodeSetParams(CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphMemsetNodeSetParams + _check_or_init_driver() + if __cuGraphMemsetNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphMemsetNodeSetParams is not found") + return (__cuGraphMemsetNodeSetParams)( + hNode, nodeParams) + + +cdef CUresult _cuGraphAddHostNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddHostNode + _check_or_init_driver() + if __cuGraphAddHostNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddHostNode is not found") + return (__cuGraphAddHostNode)( + phGraphNode, hGraph, dependencies, numDependencies, nodeParams) + + +cdef CUresult _cuGraphHostNodeGetParams(CUgraphNode hNode, CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphHostNodeGetParams + _check_or_init_driver() + if __cuGraphHostNodeGetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphHostNodeGetParams is not found") + return (__cuGraphHostNodeGetParams)( + hNode, nodeParams) + + +cdef CUresult _cuGraphHostNodeSetParams(CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphHostNodeSetParams + _check_or_init_driver() + if __cuGraphHostNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphHostNodeSetParams is not found") + return (__cuGraphHostNodeSetParams)( + hNode, nodeParams) + + +cdef CUresult _cuGraphAddChildGraphNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddChildGraphNode + _check_or_init_driver() + if __cuGraphAddChildGraphNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddChildGraphNode is not found") + return (__cuGraphAddChildGraphNode)( + phGraphNode, hGraph, dependencies, numDependencies, childGraph) + + +cdef CUresult _cuGraphChildGraphNodeGetGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphChildGraphNodeGetGraph + _check_or_init_driver() + if __cuGraphChildGraphNodeGetGraph == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphChildGraphNodeGetGraph is not found") + return (__cuGraphChildGraphNodeGetGraph)( + hNode, phGraph) + + +cdef CUresult _cuGraphAddEmptyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddEmptyNode + _check_or_init_driver() + if __cuGraphAddEmptyNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddEmptyNode is not found") + return (__cuGraphAddEmptyNode)( + phGraphNode, hGraph, dependencies, numDependencies) + + +cdef CUresult _cuGraphAddEventRecordNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddEventRecordNode + _check_or_init_driver() + if __cuGraphAddEventRecordNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddEventRecordNode is not found") + return (__cuGraphAddEventRecordNode)( + phGraphNode, hGraph, dependencies, numDependencies, event) + + +cdef CUresult _cuGraphEventRecordNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphEventRecordNodeGetEvent + _check_or_init_driver() + if __cuGraphEventRecordNodeGetEvent == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphEventRecordNodeGetEvent is not found") + return (__cuGraphEventRecordNodeGetEvent)( + hNode, event_out) + + +cdef CUresult _cuGraphEventRecordNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphEventRecordNodeSetEvent + _check_or_init_driver() + if __cuGraphEventRecordNodeSetEvent == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphEventRecordNodeSetEvent is not found") + return (__cuGraphEventRecordNodeSetEvent)( + hNode, event) + + +cdef CUresult _cuGraphAddEventWaitNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddEventWaitNode + _check_or_init_driver() + if __cuGraphAddEventWaitNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddEventWaitNode is not found") + return (__cuGraphAddEventWaitNode)( + phGraphNode, hGraph, dependencies, numDependencies, event) + + +cdef CUresult _cuGraphEventWaitNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphEventWaitNodeGetEvent + _check_or_init_driver() + if __cuGraphEventWaitNodeGetEvent == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphEventWaitNodeGetEvent is not found") + return (__cuGraphEventWaitNodeGetEvent)( + hNode, event_out) + + +cdef CUresult _cuGraphEventWaitNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphEventWaitNodeSetEvent + _check_or_init_driver() + if __cuGraphEventWaitNodeSetEvent == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphEventWaitNodeSetEvent is not found") + return (__cuGraphEventWaitNodeSetEvent)( + hNode, event) + + +cdef CUresult _cuGraphAddExternalSemaphoresSignalNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddExternalSemaphoresSignalNode + _check_or_init_driver() + if __cuGraphAddExternalSemaphoresSignalNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddExternalSemaphoresSignalNode is not found") + return (__cuGraphAddExternalSemaphoresSignalNode)( + phGraphNode, hGraph, dependencies, numDependencies, nodeParams) + + +cdef CUresult _cuGraphExternalSemaphoresSignalNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExternalSemaphoresSignalNodeGetParams + _check_or_init_driver() + if __cuGraphExternalSemaphoresSignalNodeGetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExternalSemaphoresSignalNodeGetParams is not found") + return (__cuGraphExternalSemaphoresSignalNodeGetParams)( + hNode, params_out) + + +cdef CUresult _cuGraphExternalSemaphoresSignalNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExternalSemaphoresSignalNodeSetParams + _check_or_init_driver() + if __cuGraphExternalSemaphoresSignalNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExternalSemaphoresSignalNodeSetParams is not found") + return (__cuGraphExternalSemaphoresSignalNodeSetParams)( + hNode, nodeParams) + + +cdef CUresult _cuGraphAddExternalSemaphoresWaitNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddExternalSemaphoresWaitNode + _check_or_init_driver() + if __cuGraphAddExternalSemaphoresWaitNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddExternalSemaphoresWaitNode is not found") + return (__cuGraphAddExternalSemaphoresWaitNode)( + phGraphNode, hGraph, dependencies, numDependencies, nodeParams) + + +cdef CUresult _cuGraphExternalSemaphoresWaitNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_WAIT_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExternalSemaphoresWaitNodeGetParams + _check_or_init_driver() + if __cuGraphExternalSemaphoresWaitNodeGetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExternalSemaphoresWaitNodeGetParams is not found") + return (__cuGraphExternalSemaphoresWaitNodeGetParams)( + hNode, params_out) + + +cdef CUresult _cuGraphExternalSemaphoresWaitNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExternalSemaphoresWaitNodeSetParams + _check_or_init_driver() + if __cuGraphExternalSemaphoresWaitNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExternalSemaphoresWaitNodeSetParams is not found") + return (__cuGraphExternalSemaphoresWaitNodeSetParams)( + hNode, nodeParams) + + +cdef CUresult _cuGraphAddBatchMemOpNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddBatchMemOpNode + _check_or_init_driver() + if __cuGraphAddBatchMemOpNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddBatchMemOpNode is not found") + return (__cuGraphAddBatchMemOpNode)( + phGraphNode, hGraph, dependencies, numDependencies, nodeParams) + + +cdef CUresult _cuGraphBatchMemOpNodeGetParams(CUgraphNode hNode, CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams_out) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphBatchMemOpNodeGetParams + _check_or_init_driver() + if __cuGraphBatchMemOpNodeGetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphBatchMemOpNodeGetParams is not found") + return (__cuGraphBatchMemOpNodeGetParams)( + hNode, nodeParams_out) + + +cdef CUresult _cuGraphBatchMemOpNodeSetParams(CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphBatchMemOpNodeSetParams + _check_or_init_driver() + if __cuGraphBatchMemOpNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphBatchMemOpNodeSetParams is not found") + return (__cuGraphBatchMemOpNodeSetParams)( + hNode, nodeParams) + + +cdef CUresult _cuGraphExecBatchMemOpNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecBatchMemOpNodeSetParams + _check_or_init_driver() + if __cuGraphExecBatchMemOpNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecBatchMemOpNodeSetParams is not found") + return (__cuGraphExecBatchMemOpNodeSetParams)( + hGraphExec, hNode, nodeParams) + + +cdef CUresult _cuGraphAddMemAllocNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUDA_MEM_ALLOC_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddMemAllocNode + _check_or_init_driver() + if __cuGraphAddMemAllocNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddMemAllocNode is not found") + return (__cuGraphAddMemAllocNode)( + phGraphNode, hGraph, dependencies, numDependencies, nodeParams) + + +cdef CUresult _cuGraphMemAllocNodeGetParams(CUgraphNode hNode, CUDA_MEM_ALLOC_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphMemAllocNodeGetParams + _check_or_init_driver() + if __cuGraphMemAllocNodeGetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphMemAllocNodeGetParams is not found") + return (__cuGraphMemAllocNodeGetParams)( + hNode, params_out) + + +cdef CUresult _cuGraphAddMemFreeNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddMemFreeNode + _check_or_init_driver() + if __cuGraphAddMemFreeNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddMemFreeNode is not found") + return (__cuGraphAddMemFreeNode)( + phGraphNode, hGraph, dependencies, numDependencies, dptr) + + +cdef CUresult _cuGraphMemFreeNodeGetParams(CUgraphNode hNode, CUdeviceptr* dptr_out) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphMemFreeNodeGetParams + _check_or_init_driver() + if __cuGraphMemFreeNodeGetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphMemFreeNodeGetParams is not found") + return (__cuGraphMemFreeNodeGetParams)( + hNode, dptr_out) + + +cdef CUresult _cuDeviceGraphMemTrim(CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGraphMemTrim + _check_or_init_driver() + if __cuDeviceGraphMemTrim == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGraphMemTrim is not found") + return (__cuDeviceGraphMemTrim)( + device) + + +cdef CUresult _cuDeviceGetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetGraphMemAttribute + _check_or_init_driver() + if __cuDeviceGetGraphMemAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetGraphMemAttribute is not found") + return (__cuDeviceGetGraphMemAttribute)( + device, attr, value) + + +cdef CUresult _cuDeviceSetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceSetGraphMemAttribute + _check_or_init_driver() + if __cuDeviceSetGraphMemAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceSetGraphMemAttribute is not found") + return (__cuDeviceSetGraphMemAttribute)( + device, attr, value) + + +cdef CUresult _cuGraphClone(CUgraph* phGraphClone, CUgraph originalGraph) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphClone + _check_or_init_driver() + if __cuGraphClone == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphClone is not found") + return (__cuGraphClone)( + phGraphClone, originalGraph) + + +cdef CUresult _cuGraphNodeFindInClone(CUgraphNode* phNode, CUgraphNode hOriginalNode, CUgraph hClonedGraph) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeFindInClone + _check_or_init_driver() + if __cuGraphNodeFindInClone == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeFindInClone is not found") + return (__cuGraphNodeFindInClone)( + phNode, hOriginalNode, hClonedGraph) + + +cdef CUresult _cuGraphNodeGetType(CUgraphNode hNode, CUgraphNodeType* type) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeGetType + _check_or_init_driver() + if __cuGraphNodeGetType == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeGetType is not found") + return (__cuGraphNodeGetType)( + hNode, type) + + +cdef CUresult _cuGraphGetNodes(CUgraph hGraph, CUgraphNode* nodes, size_t* numNodes) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphGetNodes + _check_or_init_driver() + if __cuGraphGetNodes == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphGetNodes is not found") + return (__cuGraphGetNodes)( + hGraph, nodes, numNodes) + + +cdef CUresult _cuGraphGetRootNodes(CUgraph hGraph, CUgraphNode* rootNodes, size_t* numRootNodes) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphGetRootNodes + _check_or_init_driver() + if __cuGraphGetRootNodes == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphGetRootNodes is not found") + return (__cuGraphGetRootNodes)( + hGraph, rootNodes, numRootNodes) + + +cdef CUresult _cuGraphGetEdges_v2(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, CUgraphEdgeData* edgeData, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphGetEdges_v2 + _check_or_init_driver() + if __cuGraphGetEdges_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphGetEdges_v2 is not found") + return (__cuGraphGetEdges_v2)( + hGraph, from_, to, edgeData, numEdges) + + +cdef CUresult _cuGraphNodeGetDependencies_v2(CUgraphNode hNode, CUgraphNode* dependencies, CUgraphEdgeData* edgeData, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeGetDependencies_v2 + _check_or_init_driver() + if __cuGraphNodeGetDependencies_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeGetDependencies_v2 is not found") + return (__cuGraphNodeGetDependencies_v2)( + hNode, dependencies, edgeData, numDependencies) + + +cdef CUresult _cuGraphNodeGetDependentNodes_v2(CUgraphNode hNode, CUgraphNode* dependentNodes, CUgraphEdgeData* edgeData, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeGetDependentNodes_v2 + _check_or_init_driver() + if __cuGraphNodeGetDependentNodes_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeGetDependentNodes_v2 is not found") + return (__cuGraphNodeGetDependentNodes_v2)( + hNode, dependentNodes, edgeData, numDependentNodes) + + +cdef CUresult _cuGraphAddDependencies_v2(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddDependencies_v2 + _check_or_init_driver() + if __cuGraphAddDependencies_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddDependencies_v2 is not found") + return (__cuGraphAddDependencies_v2)( + hGraph, from_, to, edgeData, numDependencies) + + +cdef CUresult _cuGraphRemoveDependencies_v2(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphRemoveDependencies_v2 + _check_or_init_driver() + if __cuGraphRemoveDependencies_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphRemoveDependencies_v2 is not found") + return (__cuGraphRemoveDependencies_v2)( + hGraph, from_, to, edgeData, numDependencies) + + +cdef CUresult _cuGraphDestroyNode(CUgraphNode hNode) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphDestroyNode + _check_or_init_driver() + if __cuGraphDestroyNode == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphDestroyNode is not found") + return (__cuGraphDestroyNode)( + hNode) + + +cdef CUresult _cuGraphInstantiateWithFlags(CUgraphExec* phGraphExec, CUgraph hGraph, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphInstantiateWithFlags + _check_or_init_driver() + if __cuGraphInstantiateWithFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphInstantiateWithFlags is not found") + return (__cuGraphInstantiateWithFlags)( + phGraphExec, hGraph, flags) + + +cdef CUresult _cuGraphInstantiateWithParams(CUgraphExec* phGraphExec, CUgraph hGraph, CUDA_GRAPH_INSTANTIATE_PARAMS* instantiateParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphInstantiateWithParams + _check_or_init_driver() + if __cuGraphInstantiateWithParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphInstantiateWithParams is not found") + return (__cuGraphInstantiateWithParams)( + phGraphExec, hGraph, instantiateParams) + + +cdef CUresult _cuGraphExecGetFlags(CUgraphExec hGraphExec, cuuint64_t* flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecGetFlags + _check_or_init_driver() + if __cuGraphExecGetFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecGetFlags is not found") + return (__cuGraphExecGetFlags)( + hGraphExec, flags) + + +cdef CUresult _cuGraphExecKernelNodeSetParams_v2(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecKernelNodeSetParams_v2 + _check_or_init_driver() + if __cuGraphExecKernelNodeSetParams_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecKernelNodeSetParams_v2 is not found") + return (__cuGraphExecKernelNodeSetParams_v2)( + hGraphExec, hNode, nodeParams) + + +cdef CUresult _cuGraphExecMemcpyNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMCPY3D* copyParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecMemcpyNodeSetParams + _check_or_init_driver() + if __cuGraphExecMemcpyNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecMemcpyNodeSetParams is not found") + return (__cuGraphExecMemcpyNodeSetParams)( + hGraphExec, hNode, copyParams, ctx) + + +cdef CUresult _cuGraphExecMemsetNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* memsetParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecMemsetNodeSetParams + _check_or_init_driver() + if __cuGraphExecMemsetNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecMemsetNodeSetParams is not found") + return (__cuGraphExecMemsetNodeSetParams)( + hGraphExec, hNode, memsetParams, ctx) + + +cdef CUresult _cuGraphExecHostNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecHostNodeSetParams + _check_or_init_driver() + if __cuGraphExecHostNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecHostNodeSetParams is not found") + return (__cuGraphExecHostNodeSetParams)( + hGraphExec, hNode, nodeParams) + + +cdef CUresult _cuGraphExecChildGraphNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecChildGraphNodeSetParams + _check_or_init_driver() + if __cuGraphExecChildGraphNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecChildGraphNodeSetParams is not found") + return (__cuGraphExecChildGraphNodeSetParams)( + hGraphExec, hNode, childGraph) + + +cdef CUresult _cuGraphExecEventRecordNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecEventRecordNodeSetEvent + _check_or_init_driver() + if __cuGraphExecEventRecordNodeSetEvent == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecEventRecordNodeSetEvent is not found") + return (__cuGraphExecEventRecordNodeSetEvent)( + hGraphExec, hNode, event) + + +cdef CUresult _cuGraphExecEventWaitNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecEventWaitNodeSetEvent + _check_or_init_driver() + if __cuGraphExecEventWaitNodeSetEvent == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecEventWaitNodeSetEvent is not found") + return (__cuGraphExecEventWaitNodeSetEvent)( + hGraphExec, hNode, event) + + +cdef CUresult _cuGraphExecExternalSemaphoresSignalNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecExternalSemaphoresSignalNodeSetParams + _check_or_init_driver() + if __cuGraphExecExternalSemaphoresSignalNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecExternalSemaphoresSignalNodeSetParams is not found") + return (__cuGraphExecExternalSemaphoresSignalNodeSetParams)( + hGraphExec, hNode, nodeParams) + + +cdef CUresult _cuGraphExecExternalSemaphoresWaitNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecExternalSemaphoresWaitNodeSetParams + _check_or_init_driver() + if __cuGraphExecExternalSemaphoresWaitNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecExternalSemaphoresWaitNodeSetParams is not found") + return (__cuGraphExecExternalSemaphoresWaitNodeSetParams)( + hGraphExec, hNode, nodeParams) + + +cdef CUresult _cuGraphNodeSetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeSetEnabled + _check_or_init_driver() + if __cuGraphNodeSetEnabled == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeSetEnabled is not found") + return (__cuGraphNodeSetEnabled)( + hGraphExec, hNode, isEnabled) + + +cdef CUresult _cuGraphNodeGetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int* isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeGetEnabled + _check_or_init_driver() + if __cuGraphNodeGetEnabled == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeGetEnabled is not found") + return (__cuGraphNodeGetEnabled)( + hGraphExec, hNode, isEnabled) + + +cdef CUresult _cuGraphUpload(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphUpload + _check_or_init_driver() + if __cuGraphUpload == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphUpload is not found") + return (__cuGraphUpload)( + hGraphExec, hStream) + + +cdef CUresult _cuGraphLaunch(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphLaunch + _check_or_init_driver() + if __cuGraphLaunch == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphLaunch is not found") + return (__cuGraphLaunch)( + hGraphExec, hStream) + + +cdef CUresult _cuGraphExecDestroy(CUgraphExec hGraphExec) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecDestroy + _check_or_init_driver() + if __cuGraphExecDestroy == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecDestroy is not found") + return (__cuGraphExecDestroy)( + hGraphExec) + + +cdef CUresult _cuGraphDestroy(CUgraph hGraph) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphDestroy + _check_or_init_driver() + if __cuGraphDestroy == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphDestroy is not found") + return (__cuGraphDestroy)( + hGraph) + + +cdef CUresult _cuGraphExecUpdate_v2(CUgraphExec hGraphExec, CUgraph hGraph, CUgraphExecUpdateResultInfo* resultInfo) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecUpdate_v2 + _check_or_init_driver() + if __cuGraphExecUpdate_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecUpdate_v2 is not found") + return (__cuGraphExecUpdate_v2)( + hGraphExec, hGraph, resultInfo) + + +cdef CUresult _cuGraphKernelNodeCopyAttributes(CUgraphNode dst, CUgraphNode src) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphKernelNodeCopyAttributes + _check_or_init_driver() + if __cuGraphKernelNodeCopyAttributes == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphKernelNodeCopyAttributes is not found") + return (__cuGraphKernelNodeCopyAttributes)( + dst, src) + + +cdef CUresult _cuGraphKernelNodeGetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, CUkernelNodeAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphKernelNodeGetAttribute + _check_or_init_driver() + if __cuGraphKernelNodeGetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphKernelNodeGetAttribute is not found") + return (__cuGraphKernelNodeGetAttribute)( + hNode, attr, value_out) + + +cdef CUresult _cuGraphKernelNodeSetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, const CUkernelNodeAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphKernelNodeSetAttribute + _check_or_init_driver() + if __cuGraphKernelNodeSetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphKernelNodeSetAttribute is not found") + return (__cuGraphKernelNodeSetAttribute)( + hNode, attr, value) + + +cdef CUresult _cuGraphDebugDotPrint(CUgraph hGraph, const char* path, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphDebugDotPrint + _check_or_init_driver() + if __cuGraphDebugDotPrint == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphDebugDotPrint is not found") + return (__cuGraphDebugDotPrint)( + hGraph, path, flags) + + +cdef CUresult _cuUserObjectCreate(CUuserObject* object_out, void* ptr, CUhostFn destroy, unsigned int initialRefcount, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuUserObjectCreate + _check_or_init_driver() + if __cuUserObjectCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuUserObjectCreate is not found") + return (__cuUserObjectCreate)( + object_out, ptr, destroy, initialRefcount, flags) + + +cdef CUresult _cuUserObjectRetain(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuUserObjectRetain + _check_or_init_driver() + if __cuUserObjectRetain == NULL: + with gil: + raise FunctionNotFoundError("function cuUserObjectRetain is not found") + return (__cuUserObjectRetain)( + object, count) + + +cdef CUresult _cuUserObjectRelease(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuUserObjectRelease + _check_or_init_driver() + if __cuUserObjectRelease == NULL: + with gil: + raise FunctionNotFoundError("function cuUserObjectRelease is not found") + return (__cuUserObjectRelease)( + object, count) + + +cdef CUresult _cuGraphRetainUserObject(CUgraph graph, CUuserObject object, unsigned int count, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphRetainUserObject + _check_or_init_driver() + if __cuGraphRetainUserObject == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphRetainUserObject is not found") + return (__cuGraphRetainUserObject)( + graph, object, count, flags) + + +cdef CUresult _cuGraphReleaseUserObject(CUgraph graph, CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphReleaseUserObject + _check_or_init_driver() + if __cuGraphReleaseUserObject == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphReleaseUserObject is not found") + return (__cuGraphReleaseUserObject)( + graph, object, count) + + +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: + global __cuGraphAddNode_v2 + _check_or_init_driver() + if __cuGraphAddNode_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddNode_v2 is not found") + return (__cuGraphAddNode_v2)( + phGraphNode, hGraph, dependencies, dependencyData, numDependencies, nodeParams) + + +cdef CUresult _cuGraphNodeSetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeSetParams + _check_or_init_driver() + if __cuGraphNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeSetParams is not found") + return (__cuGraphNodeSetParams)( + hNode, nodeParams) + + +cdef CUresult _cuGraphExecNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecNodeSetParams + _check_or_init_driver() + if __cuGraphExecNodeSetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecNodeSetParams is not found") + return (__cuGraphExecNodeSetParams)( + hGraphExec, hNode, nodeParams) + + +cdef CUresult _cuGraphConditionalHandleCreate(CUgraphConditionalHandle* pHandle_out, CUgraph hGraph, CUcontext ctx, unsigned int defaultLaunchValue, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphConditionalHandleCreate + _check_or_init_driver() + if __cuGraphConditionalHandleCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphConditionalHandleCreate is not found") + return (__cuGraphConditionalHandleCreate)( + pHandle_out, hGraph, ctx, defaultLaunchValue, flags) + + +cdef CUresult _cuOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuOccupancyMaxActiveBlocksPerMultiprocessor + _check_or_init_driver() + if __cuOccupancyMaxActiveBlocksPerMultiprocessor == NULL: + with gil: + raise FunctionNotFoundError("function cuOccupancyMaxActiveBlocksPerMultiprocessor is not found") + return (__cuOccupancyMaxActiveBlocksPerMultiprocessor)( + numBlocks, func, blockSize, dynamicSMemSize) + + +cdef CUresult _cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags + _check_or_init_driver() + if __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags is not found") + return (__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags)( + numBlocks, func, blockSize, dynamicSMemSize, flags) + + +cdef CUresult _cuOccupancyMaxPotentialBlockSize(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuOccupancyMaxPotentialBlockSize + _check_or_init_driver() + if __cuOccupancyMaxPotentialBlockSize == NULL: + with gil: + raise FunctionNotFoundError("function cuOccupancyMaxPotentialBlockSize is not found") + return (__cuOccupancyMaxPotentialBlockSize)( + minGridSize, blockSize, func, blockSizeToDynamicSMemSize, dynamicSMemSize, blockSizeLimit) + + +cdef CUresult _cuOccupancyMaxPotentialBlockSizeWithFlags(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuOccupancyMaxPotentialBlockSizeWithFlags + _check_or_init_driver() + if __cuOccupancyMaxPotentialBlockSizeWithFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuOccupancyMaxPotentialBlockSizeWithFlags is not found") + return (__cuOccupancyMaxPotentialBlockSizeWithFlags)( + minGridSize, blockSize, func, blockSizeToDynamicSMemSize, dynamicSMemSize, blockSizeLimit, flags) + + +cdef CUresult _cuOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, CUfunction func, int numBlocks, int blockSize) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuOccupancyAvailableDynamicSMemPerBlock + _check_or_init_driver() + if __cuOccupancyAvailableDynamicSMemPerBlock == NULL: + with gil: + raise FunctionNotFoundError("function cuOccupancyAvailableDynamicSMemPerBlock is not found") + return (__cuOccupancyAvailableDynamicSMemPerBlock)( + dynamicSmemSize, func, numBlocks, blockSize) + + +cdef CUresult _cuOccupancyMaxPotentialClusterSize(int* clusterSize, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuOccupancyMaxPotentialClusterSize + _check_or_init_driver() + if __cuOccupancyMaxPotentialClusterSize == NULL: + with gil: + raise FunctionNotFoundError("function cuOccupancyMaxPotentialClusterSize is not found") + return (__cuOccupancyMaxPotentialClusterSize)( + clusterSize, func, config) + + +cdef CUresult _cuOccupancyMaxActiveClusters(int* numClusters, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuOccupancyMaxActiveClusters + _check_or_init_driver() + if __cuOccupancyMaxActiveClusters == NULL: + with gil: + raise FunctionNotFoundError("function cuOccupancyMaxActiveClusters is not found") + return (__cuOccupancyMaxActiveClusters)( + numClusters, func, config) + + +cdef CUresult _cuTexRefSetArray(CUtexref hTexRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetArray + _check_or_init_driver() + if __cuTexRefSetArray == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetArray is not found") + return (__cuTexRefSetArray)( + hTexRef, hArray, Flags) + + +cdef CUresult _cuTexRefSetMipmappedArray(CUtexref hTexRef, CUmipmappedArray hMipmappedArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetMipmappedArray + _check_or_init_driver() + if __cuTexRefSetMipmappedArray == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetMipmappedArray is not found") + return (__cuTexRefSetMipmappedArray)( + hTexRef, hMipmappedArray, Flags) + + +cdef CUresult _cuTexRefSetAddress_v2(size_t* ByteOffset, CUtexref hTexRef, CUdeviceptr dptr, size_t bytes) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetAddress_v2 + _check_or_init_driver() + if __cuTexRefSetAddress_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetAddress_v2 is not found") + return (__cuTexRefSetAddress_v2)( + ByteOffset, hTexRef, dptr, bytes) + + +cdef CUresult _cuTexRefSetAddress2D_v3(CUtexref hTexRef, const CUDA_ARRAY_DESCRIPTOR* desc, CUdeviceptr dptr, size_t Pitch) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetAddress2D_v3 + _check_or_init_driver() + if __cuTexRefSetAddress2D_v3 == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetAddress2D_v3 is not found") + return (__cuTexRefSetAddress2D_v3)( + hTexRef, desc, dptr, Pitch) + + +cdef CUresult _cuTexRefSetFormat(CUtexref hTexRef, CUarray_format fmt, int NumPackedComponents) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetFormat + _check_or_init_driver() + if __cuTexRefSetFormat == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetFormat is not found") + return (__cuTexRefSetFormat)( + hTexRef, fmt, NumPackedComponents) + + +cdef CUresult _cuTexRefSetAddressMode(CUtexref hTexRef, int dim, CUaddress_mode am) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetAddressMode + _check_or_init_driver() + if __cuTexRefSetAddressMode == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetAddressMode is not found") + return (__cuTexRefSetAddressMode)( + hTexRef, dim, am) + + +cdef CUresult _cuTexRefSetFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetFilterMode + _check_or_init_driver() + if __cuTexRefSetFilterMode == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetFilterMode is not found") + return (__cuTexRefSetFilterMode)( + hTexRef, fm) + + +cdef CUresult _cuTexRefSetMipmapFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetMipmapFilterMode + _check_or_init_driver() + if __cuTexRefSetMipmapFilterMode == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetMipmapFilterMode is not found") + return (__cuTexRefSetMipmapFilterMode)( + hTexRef, fm) + + +cdef CUresult _cuTexRefSetMipmapLevelBias(CUtexref hTexRef, float bias) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetMipmapLevelBias + _check_or_init_driver() + if __cuTexRefSetMipmapLevelBias == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetMipmapLevelBias is not found") + return (__cuTexRefSetMipmapLevelBias)( + hTexRef, bias) + + +cdef CUresult _cuTexRefSetMipmapLevelClamp(CUtexref hTexRef, float minMipmapLevelClamp, float maxMipmapLevelClamp) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetMipmapLevelClamp + _check_or_init_driver() + if __cuTexRefSetMipmapLevelClamp == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetMipmapLevelClamp is not found") + return (__cuTexRefSetMipmapLevelClamp)( + hTexRef, minMipmapLevelClamp, maxMipmapLevelClamp) + + +cdef CUresult _cuTexRefSetMaxAnisotropy(CUtexref hTexRef, unsigned int maxAniso) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetMaxAnisotropy + _check_or_init_driver() + if __cuTexRefSetMaxAnisotropy == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetMaxAnisotropy is not found") + return (__cuTexRefSetMaxAnisotropy)( + hTexRef, maxAniso) + + +cdef CUresult _cuTexRefSetBorderColor(CUtexref hTexRef, float* pBorderColor) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetBorderColor + _check_or_init_driver() + if __cuTexRefSetBorderColor == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetBorderColor is not found") + return (__cuTexRefSetBorderColor)( + hTexRef, pBorderColor) + + +cdef CUresult _cuTexRefSetFlags(CUtexref hTexRef, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefSetFlags + _check_or_init_driver() + if __cuTexRefSetFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefSetFlags is not found") + return (__cuTexRefSetFlags)( + hTexRef, Flags) + + +cdef CUresult _cuTexRefGetAddress_v2(CUdeviceptr* pdptr, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefGetAddress_v2 + _check_or_init_driver() + if __cuTexRefGetAddress_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefGetAddress_v2 is not found") + return (__cuTexRefGetAddress_v2)( + pdptr, hTexRef) + + +cdef CUresult _cuTexRefGetArray(CUarray* phArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefGetArray + _check_or_init_driver() + if __cuTexRefGetArray == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefGetArray is not found") + return (__cuTexRefGetArray)( + phArray, hTexRef) + + +cdef CUresult _cuTexRefGetMipmappedArray(CUmipmappedArray* phMipmappedArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefGetMipmappedArray + _check_or_init_driver() + if __cuTexRefGetMipmappedArray == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefGetMipmappedArray is not found") + return (__cuTexRefGetMipmappedArray)( + phMipmappedArray, hTexRef) + + +cdef CUresult _cuTexRefGetAddressMode(CUaddress_mode* pam, CUtexref hTexRef, int dim) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefGetAddressMode + _check_or_init_driver() + if __cuTexRefGetAddressMode == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefGetAddressMode is not found") + return (__cuTexRefGetAddressMode)( + pam, hTexRef, dim) + + +cdef CUresult _cuTexRefGetFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefGetFilterMode + _check_or_init_driver() + if __cuTexRefGetFilterMode == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefGetFilterMode is not found") + return (__cuTexRefGetFilterMode)( + pfm, hTexRef) + + +cdef CUresult _cuTexRefGetFormat(CUarray_format* pFormat, int* pNumChannels, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefGetFormat + _check_or_init_driver() + if __cuTexRefGetFormat == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefGetFormat is not found") + return (__cuTexRefGetFormat)( + pFormat, pNumChannels, hTexRef) + + +cdef CUresult _cuTexRefGetMipmapFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefGetMipmapFilterMode + _check_or_init_driver() + if __cuTexRefGetMipmapFilterMode == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefGetMipmapFilterMode is not found") + return (__cuTexRefGetMipmapFilterMode)( + pfm, hTexRef) + + +cdef CUresult _cuTexRefGetMipmapLevelBias(float* pbias, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefGetMipmapLevelBias + _check_or_init_driver() + if __cuTexRefGetMipmapLevelBias == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefGetMipmapLevelBias is not found") + return (__cuTexRefGetMipmapLevelBias)( + pbias, hTexRef) + + +cdef CUresult _cuTexRefGetMipmapLevelClamp(float* pminMipmapLevelClamp, float* pmaxMipmapLevelClamp, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefGetMipmapLevelClamp + _check_or_init_driver() + if __cuTexRefGetMipmapLevelClamp == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefGetMipmapLevelClamp is not found") + return (__cuTexRefGetMipmapLevelClamp)( + pminMipmapLevelClamp, pmaxMipmapLevelClamp, hTexRef) + + +cdef CUresult _cuTexRefGetMaxAnisotropy(int* pmaxAniso, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefGetMaxAnisotropy + _check_or_init_driver() + if __cuTexRefGetMaxAnisotropy == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefGetMaxAnisotropy is not found") + return (__cuTexRefGetMaxAnisotropy)( + pmaxAniso, hTexRef) + + +cdef CUresult _cuTexRefGetBorderColor(float* pBorderColor, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefGetBorderColor + _check_or_init_driver() + if __cuTexRefGetBorderColor == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefGetBorderColor is not found") + return (__cuTexRefGetBorderColor)( + pBorderColor, hTexRef) + + +cdef CUresult _cuTexRefGetFlags(unsigned int* pFlags, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefGetFlags + _check_or_init_driver() + if __cuTexRefGetFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefGetFlags is not found") + return (__cuTexRefGetFlags)( + pFlags, hTexRef) + + +cdef CUresult _cuTexRefCreate(CUtexref* pTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefCreate + _check_or_init_driver() + if __cuTexRefCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefCreate is not found") + return (__cuTexRefCreate)( + pTexRef) + + +cdef CUresult _cuTexRefDestroy(CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexRefDestroy + _check_or_init_driver() + if __cuTexRefDestroy == NULL: + with gil: + raise FunctionNotFoundError("function cuTexRefDestroy is not found") + return (__cuTexRefDestroy)( + hTexRef) + + +cdef CUresult _cuSurfRefSetArray(CUsurfref hSurfRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuSurfRefSetArray + _check_or_init_driver() + if __cuSurfRefSetArray == NULL: + with gil: + raise FunctionNotFoundError("function cuSurfRefSetArray is not found") + return (__cuSurfRefSetArray)( + hSurfRef, hArray, Flags) + + +cdef CUresult _cuSurfRefGetArray(CUarray* phArray, CUsurfref hSurfRef) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuSurfRefGetArray + _check_or_init_driver() + if __cuSurfRefGetArray == NULL: + with gil: + raise FunctionNotFoundError("function cuSurfRefGetArray is not found") + return (__cuSurfRefGetArray)( + phArray, hSurfRef) + + +cdef CUresult _cuTexObjectCreate(CUtexObject* pTexObject, const CUDA_RESOURCE_DESC* pResDesc, const CUDA_TEXTURE_DESC* pTexDesc, const CUDA_RESOURCE_VIEW_DESC* pResViewDesc) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexObjectCreate + _check_or_init_driver() + if __cuTexObjectCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuTexObjectCreate is not found") + return (__cuTexObjectCreate)( + pTexObject, pResDesc, pTexDesc, pResViewDesc) + + +cdef CUresult _cuTexObjectDestroy(CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexObjectDestroy + _check_or_init_driver() + if __cuTexObjectDestroy == NULL: + with gil: + raise FunctionNotFoundError("function cuTexObjectDestroy is not found") + return (__cuTexObjectDestroy)( + texObject) + + +cdef CUresult _cuTexObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexObjectGetResourceDesc + _check_or_init_driver() + if __cuTexObjectGetResourceDesc == NULL: + with gil: + raise FunctionNotFoundError("function cuTexObjectGetResourceDesc is not found") + return (__cuTexObjectGetResourceDesc)( + pResDesc, texObject) + + +cdef CUresult _cuTexObjectGetTextureDesc(CUDA_TEXTURE_DESC* pTexDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexObjectGetTextureDesc + _check_or_init_driver() + if __cuTexObjectGetTextureDesc == NULL: + with gil: + raise FunctionNotFoundError("function cuTexObjectGetTextureDesc is not found") + return (__cuTexObjectGetTextureDesc)( + pTexDesc, texObject) + + +cdef CUresult _cuTexObjectGetResourceViewDesc(CUDA_RESOURCE_VIEW_DESC* pResViewDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTexObjectGetResourceViewDesc + _check_or_init_driver() + if __cuTexObjectGetResourceViewDesc == NULL: + with gil: + raise FunctionNotFoundError("function cuTexObjectGetResourceViewDesc is not found") + return (__cuTexObjectGetResourceViewDesc)( + pResViewDesc, texObject) + + +cdef CUresult _cuSurfObjectCreate(CUsurfObject* pSurfObject, const CUDA_RESOURCE_DESC* pResDesc) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuSurfObjectCreate + _check_or_init_driver() + if __cuSurfObjectCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuSurfObjectCreate is not found") + return (__cuSurfObjectCreate)( + pSurfObject, pResDesc) + + +cdef CUresult _cuSurfObjectDestroy(CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuSurfObjectDestroy + _check_or_init_driver() + if __cuSurfObjectDestroy == NULL: + with gil: + raise FunctionNotFoundError("function cuSurfObjectDestroy is not found") + return (__cuSurfObjectDestroy)( + surfObject) + + +cdef CUresult _cuSurfObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuSurfObjectGetResourceDesc + _check_or_init_driver() + if __cuSurfObjectGetResourceDesc == NULL: + with gil: + raise FunctionNotFoundError("function cuSurfObjectGetResourceDesc is not found") + return (__cuSurfObjectGetResourceDesc)( + pResDesc, surfObject) + + +cdef CUresult _cuTensorMapEncodeTiled(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, const cuuint32_t* boxDim, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTensorMapEncodeTiled + _check_or_init_driver() + if __cuTensorMapEncodeTiled == NULL: + with gil: + raise FunctionNotFoundError("function cuTensorMapEncodeTiled is not found") + return (__cuTensorMapEncodeTiled)( + tensorMap, tensorDataType, tensorRank, globalAddress, globalDim, globalStrides, boxDim, elementStrides, interleave, swizzle, l2Promotion, oobFill) + + +cdef CUresult _cuTensorMapEncodeIm2col(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, const int* pixelBoxLowerCorner, const int* pixelBoxUpperCorner, cuuint32_t channelsPerPixel, cuuint32_t pixelsPerColumn, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTensorMapEncodeIm2col + _check_or_init_driver() + if __cuTensorMapEncodeIm2col == NULL: + with gil: + raise FunctionNotFoundError("function cuTensorMapEncodeIm2col is not found") + return (__cuTensorMapEncodeIm2col)( + tensorMap, tensorDataType, tensorRank, globalAddress, globalDim, globalStrides, pixelBoxLowerCorner, pixelBoxUpperCorner, channelsPerPixel, pixelsPerColumn, elementStrides, interleave, swizzle, l2Promotion, oobFill) + + +cdef CUresult _cuTensorMapEncodeIm2colWide(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, int pixelBoxLowerCornerWidth, int pixelBoxUpperCornerWidth, cuuint32_t channelsPerPixel, cuuint32_t pixelsPerColumn, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapIm2ColWideMode mode, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTensorMapEncodeIm2colWide + _check_or_init_driver() + if __cuTensorMapEncodeIm2colWide == NULL: + with gil: + raise FunctionNotFoundError("function cuTensorMapEncodeIm2colWide is not found") + return (__cuTensorMapEncodeIm2colWide)( + tensorMap, tensorDataType, tensorRank, globalAddress, globalDim, globalStrides, pixelBoxLowerCornerWidth, pixelBoxUpperCornerWidth, channelsPerPixel, pixelsPerColumn, elementStrides, interleave, mode, swizzle, l2Promotion, oobFill) + + +cdef CUresult _cuTensorMapReplaceAddress(CUtensorMap* tensorMap, void* globalAddress) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTensorMapReplaceAddress + _check_or_init_driver() + if __cuTensorMapReplaceAddress == NULL: + with gil: + raise FunctionNotFoundError("function cuTensorMapReplaceAddress is not found") + return (__cuTensorMapReplaceAddress)( + tensorMap, globalAddress) + + +cdef CUresult _cuDeviceCanAccessPeer(int* canAccessPeer, CUdevice dev, CUdevice peerDev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceCanAccessPeer + _check_or_init_driver() + if __cuDeviceCanAccessPeer == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceCanAccessPeer is not found") + return (__cuDeviceCanAccessPeer)( + canAccessPeer, dev, peerDev) + + +cdef CUresult _cuCtxEnablePeerAccess(CUcontext peerContext, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxEnablePeerAccess + _check_or_init_driver() + if __cuCtxEnablePeerAccess == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxEnablePeerAccess is not found") + return (__cuCtxEnablePeerAccess)( + peerContext, Flags) + + +cdef CUresult _cuCtxDisablePeerAccess(CUcontext peerContext) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxDisablePeerAccess + _check_or_init_driver() + if __cuCtxDisablePeerAccess == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxDisablePeerAccess is not found") + return (__cuCtxDisablePeerAccess)( + peerContext) + + +cdef CUresult _cuDeviceGetP2PAttribute(int* value, CUdevice_P2PAttribute attrib, CUdevice srcDevice, CUdevice dstDevice) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetP2PAttribute + _check_or_init_driver() + if __cuDeviceGetP2PAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetP2PAttribute is not found") + return (__cuDeviceGetP2PAttribute)( + value, attrib, srcDevice, dstDevice) + + +cdef CUresult _cuGraphicsUnregisterResource(CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsUnregisterResource + _check_or_init_driver() + if __cuGraphicsUnregisterResource == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsUnregisterResource is not found") + return (__cuGraphicsUnregisterResource)( + resource) + + +cdef CUresult _cuGraphicsSubResourceGetMappedArray(CUarray* pArray, CUgraphicsResource resource, unsigned int arrayIndex, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsSubResourceGetMappedArray + _check_or_init_driver() + if __cuGraphicsSubResourceGetMappedArray == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsSubResourceGetMappedArray is not found") + return (__cuGraphicsSubResourceGetMappedArray)( + pArray, resource, arrayIndex, mipLevel) + + +cdef CUresult _cuGraphicsResourceGetMappedMipmappedArray(CUmipmappedArray* pMipmappedArray, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsResourceGetMappedMipmappedArray + _check_or_init_driver() + if __cuGraphicsResourceGetMappedMipmappedArray == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsResourceGetMappedMipmappedArray is not found") + return (__cuGraphicsResourceGetMappedMipmappedArray)( + pMipmappedArray, resource) + + +cdef CUresult _cuGraphicsResourceGetMappedPointer_v2(CUdeviceptr* pDevPtr, size_t* pSize, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsResourceGetMappedPointer_v2 + _check_or_init_driver() + if __cuGraphicsResourceGetMappedPointer_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsResourceGetMappedPointer_v2 is not found") + return (__cuGraphicsResourceGetMappedPointer_v2)( + pDevPtr, pSize, resource) + + +cdef CUresult _cuGraphicsResourceSetMapFlags_v2(CUgraphicsResource resource, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsResourceSetMapFlags_v2 + _check_or_init_driver() + if __cuGraphicsResourceSetMapFlags_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsResourceSetMapFlags_v2 is not found") + return (__cuGraphicsResourceSetMapFlags_v2)( + resource, flags) + + +cdef CUresult _cuGraphicsMapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsMapResources + _check_or_init_driver() + if __cuGraphicsMapResources == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsMapResources is not found") + return (__cuGraphicsMapResources)( + count, resources, hStream) + + +cdef CUresult _cuGraphicsUnmapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsUnmapResources + _check_or_init_driver() + if __cuGraphicsUnmapResources == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsUnmapResources is not found") + return (__cuGraphicsUnmapResources)( + count, resources, hStream) + + +cdef CUresult _cuGetProcAddress_v2(const char* symbol, void** pfn, int cudaVersion, cuuint64_t flags, CUdriverProcAddressQueryResult* symbolStatus) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGetProcAddress_v2 + _check_or_init_driver() + if __cuGetProcAddress_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGetProcAddress_v2 is not found") + return (__cuGetProcAddress_v2)( + symbol, pfn, cudaVersion, flags, symbolStatus) + + +cdef CUresult _cuCoredumpGetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCoredumpGetAttribute + _check_or_init_driver() + if __cuCoredumpGetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuCoredumpGetAttribute is not found") + return (__cuCoredumpGetAttribute)( + attrib, value, size) + + +cdef CUresult _cuCoredumpGetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCoredumpGetAttributeGlobal + _check_or_init_driver() + if __cuCoredumpGetAttributeGlobal == NULL: + with gil: + raise FunctionNotFoundError("function cuCoredumpGetAttributeGlobal is not found") + return (__cuCoredumpGetAttributeGlobal)( + attrib, value, size) + + +cdef CUresult _cuCoredumpSetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCoredumpSetAttribute + _check_or_init_driver() + if __cuCoredumpSetAttribute == NULL: + with gil: + raise FunctionNotFoundError("function cuCoredumpSetAttribute is not found") + return (__cuCoredumpSetAttribute)( + attrib, value, size) + + +cdef CUresult _cuCoredumpSetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCoredumpSetAttributeGlobal + _check_or_init_driver() + if __cuCoredumpSetAttributeGlobal == NULL: + with gil: + raise FunctionNotFoundError("function cuCoredumpSetAttributeGlobal is not found") + return (__cuCoredumpSetAttributeGlobal)( + attrib, value, size) + + +cdef CUresult _cuGetExportTable(const void** ppExportTable, const CUuuid* pExportTableId) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGetExportTable + _check_or_init_driver() + if __cuGetExportTable == NULL: + with gil: + raise FunctionNotFoundError("function cuGetExportTable is not found") + return (__cuGetExportTable)( + ppExportTable, pExportTableId) + + +cdef CUresult _cuGreenCtxCreate(CUgreenCtx* phCtx, CUdevResourceDesc desc, CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGreenCtxCreate + _check_or_init_driver() + if __cuGreenCtxCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuGreenCtxCreate is not found") + return (__cuGreenCtxCreate)( + phCtx, desc, dev, flags) + + +cdef CUresult _cuGreenCtxDestroy(CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGreenCtxDestroy + _check_or_init_driver() + if __cuGreenCtxDestroy == NULL: + with gil: + raise FunctionNotFoundError("function cuGreenCtxDestroy is not found") + return (__cuGreenCtxDestroy)( + hCtx) + + +cdef CUresult _cuCtxFromGreenCtx(CUcontext* pContext, CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxFromGreenCtx + _check_or_init_driver() + if __cuCtxFromGreenCtx == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxFromGreenCtx is not found") + return (__cuCtxFromGreenCtx)( + pContext, hCtx) + + +cdef CUresult _cuDeviceGetDevResource(CUdevice device, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetDevResource + _check_or_init_driver() + if __cuDeviceGetDevResource == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetDevResource is not found") + return (__cuDeviceGetDevResource)( + device, resource, type) + + +cdef CUresult _cuCtxGetDevResource(CUcontext hCtx, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxGetDevResource + _check_or_init_driver() + if __cuCtxGetDevResource == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxGetDevResource is not found") + return (__cuCtxGetDevResource)( + hCtx, resource, type) + + +cdef CUresult _cuGreenCtxGetDevResource(CUgreenCtx hCtx, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGreenCtxGetDevResource + _check_or_init_driver() + if __cuGreenCtxGetDevResource == NULL: + with gil: + raise FunctionNotFoundError("function cuGreenCtxGetDevResource is not found") + return (__cuGreenCtxGetDevResource)( + hCtx, resource, type) + + +cdef CUresult _cuDevSmResourceSplitByCount(CUdevResource* result, unsigned int* nbGroups, const CUdevResource* input, CUdevResource* remainder, unsigned int flags, unsigned int minCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDevSmResourceSplitByCount + _check_or_init_driver() + if __cuDevSmResourceSplitByCount == NULL: + with gil: + raise FunctionNotFoundError("function cuDevSmResourceSplitByCount is not found") + return (__cuDevSmResourceSplitByCount)( + result, nbGroups, input, remainder, flags, minCount) + + +cdef CUresult _cuDevResourceGenerateDesc(CUdevResourceDesc* phDesc, CUdevResource* resources, unsigned int nbResources) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDevResourceGenerateDesc + _check_or_init_driver() + if __cuDevResourceGenerateDesc == NULL: + with gil: + raise FunctionNotFoundError("function cuDevResourceGenerateDesc is not found") + return (__cuDevResourceGenerateDesc)( + phDesc, resources, nbResources) + + +cdef CUresult _cuGreenCtxRecordEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGreenCtxRecordEvent + _check_or_init_driver() + if __cuGreenCtxRecordEvent == NULL: + with gil: + raise FunctionNotFoundError("function cuGreenCtxRecordEvent is not found") + return (__cuGreenCtxRecordEvent)( + hCtx, hEvent) + + +cdef CUresult _cuGreenCtxWaitEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGreenCtxWaitEvent + _check_or_init_driver() + if __cuGreenCtxWaitEvent == NULL: + with gil: + raise FunctionNotFoundError("function cuGreenCtxWaitEvent is not found") + return (__cuGreenCtxWaitEvent)( + hCtx, hEvent) + + +cdef CUresult _cuStreamGetGreenCtx(CUstream hStream, CUgreenCtx* phCtx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamGetGreenCtx + _check_or_init_driver() + if __cuStreamGetGreenCtx == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamGetGreenCtx is not found") + return (__cuStreamGetGreenCtx)( + hStream, phCtx) + + +cdef CUresult _cuGreenCtxStreamCreate(CUstream* phStream, CUgreenCtx greenCtx, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGreenCtxStreamCreate + _check_or_init_driver() + if __cuGreenCtxStreamCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuGreenCtxStreamCreate is not found") + return (__cuGreenCtxStreamCreate)( + phStream, greenCtx, flags, priority) + + +cdef CUresult _cuLogsRegisterCallback(CUlogsCallback callbackFunc, void* userData, CUlogsCallbackHandle* callback_out) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogsRegisterCallback + _check_or_init_driver() + if __cuLogsRegisterCallback == NULL: + with gil: + raise FunctionNotFoundError("function cuLogsRegisterCallback is not found") + return (__cuLogsRegisterCallback)( + callbackFunc, userData, callback_out) + + +cdef CUresult _cuLogsUnregisterCallback(CUlogsCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogsUnregisterCallback + _check_or_init_driver() + if __cuLogsUnregisterCallback == NULL: + with gil: + raise FunctionNotFoundError("function cuLogsUnregisterCallback is not found") + return (__cuLogsUnregisterCallback)( + callback) + + +cdef CUresult _cuLogsCurrent(CUlogIterator* iterator_out, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogsCurrent + _check_or_init_driver() + if __cuLogsCurrent == NULL: + with gil: + raise FunctionNotFoundError("function cuLogsCurrent is not found") + return (__cuLogsCurrent)( + iterator_out, flags) + + +cdef CUresult _cuLogsDumpToFile(CUlogIterator* iterator, const char* pathToFile, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogsDumpToFile + _check_or_init_driver() + if __cuLogsDumpToFile == NULL: + with gil: + raise FunctionNotFoundError("function cuLogsDumpToFile is not found") + return (__cuLogsDumpToFile)( + iterator, pathToFile, flags) + + +cdef CUresult _cuLogsDumpToMemory(CUlogIterator* iterator, char* buffer, size_t* size, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogsDumpToMemory + _check_or_init_driver() + if __cuLogsDumpToMemory == NULL: + with gil: + raise FunctionNotFoundError("function cuLogsDumpToMemory is not found") + return (__cuLogsDumpToMemory)( + iterator, buffer, size, flags) + + +cdef CUresult _cuCheckpointProcessGetRestoreThreadId(int pid, int* tid) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCheckpointProcessGetRestoreThreadId + _check_or_init_driver() + if __cuCheckpointProcessGetRestoreThreadId == NULL: + with gil: + raise FunctionNotFoundError("function cuCheckpointProcessGetRestoreThreadId is not found") + return (__cuCheckpointProcessGetRestoreThreadId)( + pid, tid) + + +cdef CUresult _cuCheckpointProcessGetState(int pid, CUprocessState* state) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCheckpointProcessGetState + _check_or_init_driver() + if __cuCheckpointProcessGetState == NULL: + with gil: + raise FunctionNotFoundError("function cuCheckpointProcessGetState is not found") + return (__cuCheckpointProcessGetState)( + pid, state) + + +cdef CUresult _cuCheckpointProcessLock(int pid, CUcheckpointLockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCheckpointProcessLock + _check_or_init_driver() + if __cuCheckpointProcessLock == NULL: + with gil: + raise FunctionNotFoundError("function cuCheckpointProcessLock is not found") + return (__cuCheckpointProcessLock)( + pid, args) + + +cdef CUresult _cuCheckpointProcessCheckpoint(int pid, CUcheckpointCheckpointArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCheckpointProcessCheckpoint + _check_or_init_driver() + if __cuCheckpointProcessCheckpoint == NULL: + with gil: + raise FunctionNotFoundError("function cuCheckpointProcessCheckpoint is not found") + return (__cuCheckpointProcessCheckpoint)( + pid, args) + + +cdef CUresult _cuCheckpointProcessRestore(int pid, CUcheckpointRestoreArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCheckpointProcessRestore + _check_or_init_driver() + if __cuCheckpointProcessRestore == NULL: + with gil: + raise FunctionNotFoundError("function cuCheckpointProcessRestore is not found") + return (__cuCheckpointProcessRestore)( + pid, args) + + +cdef CUresult _cuCheckpointProcessUnlock(int pid, CUcheckpointUnlockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCheckpointProcessUnlock + _check_or_init_driver() + if __cuCheckpointProcessUnlock == NULL: + with gil: + raise FunctionNotFoundError("function cuCheckpointProcessUnlock is not found") + return (__cuCheckpointProcessUnlock)( + pid, args) + + +cdef CUresult _cuGraphicsEGLRegisterImage(CUgraphicsResource* pCudaResource, EGLImageKHR image, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsEGLRegisterImage + _check_or_init_driver() + if __cuGraphicsEGLRegisterImage == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsEGLRegisterImage is not found") + return (__cuGraphicsEGLRegisterImage)( + pCudaResource, image, flags) + + +cdef CUresult _cuEGLStreamConsumerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEGLStreamConsumerConnect + _check_or_init_driver() + if __cuEGLStreamConsumerConnect == NULL: + with gil: + raise FunctionNotFoundError("function cuEGLStreamConsumerConnect is not found") + return (__cuEGLStreamConsumerConnect)( + conn, stream) + + +cdef CUresult _cuEGLStreamConsumerConnectWithFlags(CUeglStreamConnection* conn, EGLStreamKHR stream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEGLStreamConsumerConnectWithFlags + _check_or_init_driver() + if __cuEGLStreamConsumerConnectWithFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuEGLStreamConsumerConnectWithFlags is not found") + return (__cuEGLStreamConsumerConnectWithFlags)( + conn, stream, flags) + + +cdef CUresult _cuEGLStreamConsumerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEGLStreamConsumerDisconnect + _check_or_init_driver() + if __cuEGLStreamConsumerDisconnect == NULL: + with gil: + raise FunctionNotFoundError("function cuEGLStreamConsumerDisconnect is not found") + return (__cuEGLStreamConsumerDisconnect)( + conn) + + +cdef CUresult _cuEGLStreamConsumerAcquireFrame(CUeglStreamConnection* conn, CUgraphicsResource* pCudaResource, CUstream* pStream, unsigned int timeout) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEGLStreamConsumerAcquireFrame + _check_or_init_driver() + if __cuEGLStreamConsumerAcquireFrame == NULL: + with gil: + raise FunctionNotFoundError("function cuEGLStreamConsumerAcquireFrame is not found") + return (__cuEGLStreamConsumerAcquireFrame)( + conn, pCudaResource, pStream, timeout) + + +cdef CUresult _cuEGLStreamConsumerReleaseFrame(CUeglStreamConnection* conn, CUgraphicsResource pCudaResource, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEGLStreamConsumerReleaseFrame + _check_or_init_driver() + if __cuEGLStreamConsumerReleaseFrame == NULL: + with gil: + raise FunctionNotFoundError("function cuEGLStreamConsumerReleaseFrame is not found") + return (__cuEGLStreamConsumerReleaseFrame)( + conn, pCudaResource, pStream) + + +cdef CUresult _cuEGLStreamProducerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream, EGLint width, EGLint height) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEGLStreamProducerConnect + _check_or_init_driver() + if __cuEGLStreamProducerConnect == NULL: + with gil: + raise FunctionNotFoundError("function cuEGLStreamProducerConnect is not found") + return (__cuEGLStreamProducerConnect)( + conn, stream, width, height) + + +cdef CUresult _cuEGLStreamProducerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEGLStreamProducerDisconnect + _check_or_init_driver() + if __cuEGLStreamProducerDisconnect == NULL: + with gil: + raise FunctionNotFoundError("function cuEGLStreamProducerDisconnect is not found") + return (__cuEGLStreamProducerDisconnect)( + conn) + + +cdef CUresult _cuEGLStreamProducerPresentFrame(CUeglStreamConnection* conn, CUeglFrame eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEGLStreamProducerPresentFrame + _check_or_init_driver() + if __cuEGLStreamProducerPresentFrame == NULL: + with gil: + raise FunctionNotFoundError("function cuEGLStreamProducerPresentFrame is not found") + return (__cuEGLStreamProducerPresentFrame)( + conn, eglframe, pStream) + + +cdef CUresult _cuEGLStreamProducerReturnFrame(CUeglStreamConnection* conn, CUeglFrame* eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEGLStreamProducerReturnFrame + _check_or_init_driver() + if __cuEGLStreamProducerReturnFrame == NULL: + with gil: + raise FunctionNotFoundError("function cuEGLStreamProducerReturnFrame is not found") + return (__cuEGLStreamProducerReturnFrame)( + conn, eglframe, pStream) + + +cdef CUresult _cuGraphicsResourceGetMappedEglFrame(CUeglFrame* eglFrame, CUgraphicsResource resource, unsigned int index, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsResourceGetMappedEglFrame + _check_or_init_driver() + if __cuGraphicsResourceGetMappedEglFrame == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsResourceGetMappedEglFrame is not found") + return (__cuGraphicsResourceGetMappedEglFrame)( + eglFrame, resource, index, mipLevel) + + +cdef CUresult _cuEventCreateFromEGLSync(CUevent* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuEventCreateFromEGLSync + _check_or_init_driver() + if __cuEventCreateFromEGLSync == NULL: + with gil: + raise FunctionNotFoundError("function cuEventCreateFromEGLSync is not found") + return (__cuEventCreateFromEGLSync)( + phEvent, eglSync, flags) + + +cdef CUresult _cuGraphicsGLRegisterBuffer(CUgraphicsResource* pCudaResource, GLuint buffer, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsGLRegisterBuffer + _check_or_init_driver() + if __cuGraphicsGLRegisterBuffer == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsGLRegisterBuffer is not found") + return (__cuGraphicsGLRegisterBuffer)( + pCudaResource, buffer, Flags) + + +cdef CUresult _cuGraphicsGLRegisterImage(CUgraphicsResource* pCudaResource, GLuint image, GLenum target, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsGLRegisterImage + _check_or_init_driver() + if __cuGraphicsGLRegisterImage == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsGLRegisterImage is not found") + return (__cuGraphicsGLRegisterImage)( + pCudaResource, image, target, Flags) + + +cdef CUresult _cuGLGetDevices_v2(unsigned int* pCudaDeviceCount, CUdevice* pCudaDevices, unsigned int cudaDeviceCount, CUGLDeviceList deviceList) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGLGetDevices_v2 + _check_or_init_driver() + if __cuGLGetDevices_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGLGetDevices_v2 is not found") + return (__cuGLGetDevices_v2)( + pCudaDeviceCount, pCudaDevices, cudaDeviceCount, deviceList) + + +cdef CUresult _cuGLCtxCreate_v2(CUcontext* pCtx, unsigned int Flags, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGLCtxCreate_v2 + _check_or_init_driver() + if __cuGLCtxCreate_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGLCtxCreate_v2 is not found") + return (__cuGLCtxCreate_v2)( + pCtx, Flags, device) + + +cdef CUresult _cuGLInit() except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGLInit + _check_or_init_driver() + if __cuGLInit == NULL: + with gil: + raise FunctionNotFoundError("function cuGLInit is not found") + return (__cuGLInit)( + ) + + +cdef CUresult _cuGLRegisterBufferObject(GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGLRegisterBufferObject + _check_or_init_driver() + if __cuGLRegisterBufferObject == NULL: + with gil: + raise FunctionNotFoundError("function cuGLRegisterBufferObject is not found") + return (__cuGLRegisterBufferObject)( + buffer) + + +cdef CUresult _cuGLMapBufferObject_v2(CUdeviceptr* dptr, size_t* size, GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGLMapBufferObject_v2 + _check_or_init_driver() + if __cuGLMapBufferObject_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGLMapBufferObject_v2 is not found") + return (__cuGLMapBufferObject_v2)( + dptr, size, buffer) + + +cdef CUresult _cuGLUnmapBufferObject(GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGLUnmapBufferObject + _check_or_init_driver() + if __cuGLUnmapBufferObject == NULL: + with gil: + raise FunctionNotFoundError("function cuGLUnmapBufferObject is not found") + return (__cuGLUnmapBufferObject)( + buffer) + + +cdef CUresult _cuGLUnregisterBufferObject(GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGLUnregisterBufferObject + _check_or_init_driver() + if __cuGLUnregisterBufferObject == NULL: + with gil: + raise FunctionNotFoundError("function cuGLUnregisterBufferObject is not found") + return (__cuGLUnregisterBufferObject)( + buffer) + + +cdef CUresult _cuGLSetBufferObjectMapFlags(GLuint buffer, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGLSetBufferObjectMapFlags + _check_or_init_driver() + if __cuGLSetBufferObjectMapFlags == NULL: + with gil: + raise FunctionNotFoundError("function cuGLSetBufferObjectMapFlags is not found") + return (__cuGLSetBufferObjectMapFlags)( + buffer, Flags) + + +cdef CUresult _cuGLMapBufferObjectAsync_v2(CUdeviceptr* dptr, size_t* size, GLuint buffer, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGLMapBufferObjectAsync_v2 + _check_or_init_driver() + if __cuGLMapBufferObjectAsync_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGLMapBufferObjectAsync_v2 is not found") + return (__cuGLMapBufferObjectAsync_v2)( + dptr, size, buffer, hStream) + + +cdef CUresult _cuGLUnmapBufferObjectAsync(GLuint buffer, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGLUnmapBufferObjectAsync + _check_or_init_driver() + if __cuGLUnmapBufferObjectAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuGLUnmapBufferObjectAsync is not found") + return (__cuGLUnmapBufferObjectAsync)( + buffer, hStream) + + +cdef CUresult _cuProfilerInitialize(const char* configFile, const char* outputFile, CUoutput_mode outputMode) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuProfilerInitialize + _check_or_init_driver() + if __cuProfilerInitialize == NULL: + with gil: + raise FunctionNotFoundError("function cuProfilerInitialize is not found") + return (__cuProfilerInitialize)( + configFile, outputFile, outputMode) + + +cdef CUresult _cuProfilerStart() except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuProfilerStart + _check_or_init_driver() + if __cuProfilerStart == NULL: + with gil: + raise FunctionNotFoundError("function cuProfilerStart is not found") + return (__cuProfilerStart)( + ) + + +cdef CUresult _cuProfilerStop() except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuProfilerStop + _check_or_init_driver() + if __cuProfilerStop == NULL: + with gil: + raise FunctionNotFoundError("function cuProfilerStop is not found") + return (__cuProfilerStop)( + ) + + +cdef CUresult _cuVDPAUGetDevice(CUdevice* pDevice, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuVDPAUGetDevice + _check_or_init_driver() + if __cuVDPAUGetDevice == NULL: + with gil: + raise FunctionNotFoundError("function cuVDPAUGetDevice is not found") + return (__cuVDPAUGetDevice)( + pDevice, vdpDevice, vdpGetProcAddress) + + +cdef CUresult _cuVDPAUCtxCreate_v2(CUcontext* pCtx, unsigned int flags, CUdevice device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuVDPAUCtxCreate_v2 + _check_or_init_driver() + if __cuVDPAUCtxCreate_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuVDPAUCtxCreate_v2 is not found") + return (__cuVDPAUCtxCreate_v2)( + pCtx, flags, device, vdpDevice, vdpGetProcAddress) + + +cdef CUresult _cuGraphicsVDPAURegisterVideoSurface(CUgraphicsResource* pCudaResource, VdpVideoSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsVDPAURegisterVideoSurface + _check_or_init_driver() + if __cuGraphicsVDPAURegisterVideoSurface == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsVDPAURegisterVideoSurface is not found") + return (__cuGraphicsVDPAURegisterVideoSurface)( + pCudaResource, vdpSurface, flags) + + +cdef CUresult _cuGraphicsVDPAURegisterOutputSurface(CUgraphicsResource* pCudaResource, VdpOutputSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphicsVDPAURegisterOutputSurface + _check_or_init_driver() + if __cuGraphicsVDPAURegisterOutputSurface == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphicsVDPAURegisterOutputSurface is not found") + return (__cuGraphicsVDPAURegisterOutputSurface)( + pCudaResource, vdpSurface, flags) + + +cdef CUresult _cuDeviceGetHostAtomicCapabilities(unsigned int* capabilities, const CUatomicOperation* operations, unsigned int count, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetHostAtomicCapabilities + _check_or_init_driver() + if __cuDeviceGetHostAtomicCapabilities == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetHostAtomicCapabilities is not found") + return (__cuDeviceGetHostAtomicCapabilities)( + capabilities, operations, count, dev) + + +cdef CUresult _cuCtxGetDevice_v2(CUdevice* device, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxGetDevice_v2 + _check_or_init_driver() + if __cuCtxGetDevice_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxGetDevice_v2 is not found") + return (__cuCtxGetDevice_v2)( + device, ctx) + + +cdef CUresult _cuCtxSynchronize_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCtxSynchronize_v2 + _check_or_init_driver() + if __cuCtxSynchronize_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuCtxSynchronize_v2 is not found") + return (__cuCtxSynchronize_v2)( + ctx) + + +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 + _check_or_init_driver() + if __cuMemcpyBatchAsync_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyBatchAsync_v2 is not found") + return (__cuMemcpyBatchAsync_v2)( + dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, hStream) + + +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 + _check_or_init_driver() + if __cuMemcpy3DBatchAsync_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpy3DBatchAsync_v2 is not found") + return (__cuMemcpy3DBatchAsync_v2)( + numOps, opList, flags, hStream) + + +cdef CUresult _cuMemGetDefaultMemPool(CUmemoryPool* pool_out, CUmemLocation* location, CUmemAllocationType type) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemGetDefaultMemPool + _check_or_init_driver() + if __cuMemGetDefaultMemPool == NULL: + with gil: + raise FunctionNotFoundError("function cuMemGetDefaultMemPool is not found") + return (__cuMemGetDefaultMemPool)( + pool_out, location, type) + + +cdef CUresult _cuMemGetMemPool(CUmemoryPool* pool, CUmemLocation* location, CUmemAllocationType type) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemGetMemPool + _check_or_init_driver() + if __cuMemGetMemPool == NULL: + with gil: + raise FunctionNotFoundError("function cuMemGetMemPool is not found") + return (__cuMemGetMemPool)( + pool, location, type) + + +cdef CUresult _cuMemSetMemPool(CUmemLocation* location, CUmemAllocationType type, CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemSetMemPool + _check_or_init_driver() + if __cuMemSetMemPool == NULL: + with gil: + raise FunctionNotFoundError("function cuMemSetMemPool is not found") + return (__cuMemSetMemPool)( + location, type, pool) + + +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 + _check_or_init_driver() + if __cuMemPrefetchBatchAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemPrefetchBatchAsync is not found") + return (__cuMemPrefetchBatchAsync)( + dptrs, sizes, count, prefetchLocs, prefetchLocIdxs, numPrefetchLocs, flags, hStream) + + +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 + _check_or_init_driver() + if __cuMemDiscardBatchAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemDiscardBatchAsync is not found") + return (__cuMemDiscardBatchAsync)( + dptrs, sizes, count, flags, hStream) + + +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 + _check_or_init_driver() + if __cuMemDiscardAndPrefetchBatchAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemDiscardAndPrefetchBatchAsync is not found") + return (__cuMemDiscardAndPrefetchBatchAsync)( + dptrs, sizes, count, prefetchLocs, prefetchLocIdxs, numPrefetchLocs, flags, hStream) + + +cdef CUresult _cuDeviceGetP2PAtomicCapabilities(unsigned int* capabilities, const CUatomicOperation* operations, unsigned int count, CUdevice srcDevice, CUdevice dstDevice) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetP2PAtomicCapabilities + _check_or_init_driver() + if __cuDeviceGetP2PAtomicCapabilities == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetP2PAtomicCapabilities is not found") + return (__cuDeviceGetP2PAtomicCapabilities)( + capabilities, operations, count, srcDevice, dstDevice) + + +cdef CUresult _cuGreenCtxGetId(CUgreenCtx greenCtx, unsigned long long* greenCtxId) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGreenCtxGetId + _check_or_init_driver() + if __cuGreenCtxGetId == NULL: + with gil: + raise FunctionNotFoundError("function cuGreenCtxGetId is not found") + return (__cuGreenCtxGetId)( + greenCtx, greenCtxId) + + +cdef CUresult _cuMulticastBindMem_v2(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, CUmemGenericAllocationHandle memHandle, size_t memOffset, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMulticastBindMem_v2 + _check_or_init_driver() + if __cuMulticastBindMem_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMulticastBindMem_v2 is not found") + return (__cuMulticastBindMem_v2)( + mcHandle, dev, mcOffset, memHandle, memOffset, size, flags) + + +cdef CUresult _cuMulticastBindAddr_v2(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, CUdeviceptr memptr, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMulticastBindAddr_v2 + _check_or_init_driver() + if __cuMulticastBindAddr_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuMulticastBindAddr_v2 is not found") + return (__cuMulticastBindAddr_v2)( + mcHandle, dev, mcOffset, memptr, size, flags) + + +cdef CUresult _cuGraphNodeGetContainingGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeGetContainingGraph + _check_or_init_driver() + if __cuGraphNodeGetContainingGraph == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeGetContainingGraph is not found") + return (__cuGraphNodeGetContainingGraph)( + hNode, phGraph) + + +cdef CUresult _cuGraphNodeGetLocalId(CUgraphNode hNode, unsigned int* nodeId) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeGetLocalId + _check_or_init_driver() + if __cuGraphNodeGetLocalId == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeGetLocalId is not found") + return (__cuGraphNodeGetLocalId)( + hNode, nodeId) + + +cdef CUresult _cuGraphNodeGetToolsId(CUgraphNode hNode, unsigned long long* toolsNodeId) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeGetToolsId + _check_or_init_driver() + if __cuGraphNodeGetToolsId == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeGetToolsId is not found") + return (__cuGraphNodeGetToolsId)( + hNode, toolsNodeId) + + +cdef CUresult _cuGraphGetId(CUgraph hGraph, unsigned int* graphId) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphGetId + _check_or_init_driver() + if __cuGraphGetId == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphGetId is not found") + return (__cuGraphGetId)( + hGraph, graphId) + + +cdef CUresult _cuGraphExecGetId(CUgraphExec hGraphExec, unsigned int* graphId) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphExecGetId + _check_or_init_driver() + if __cuGraphExecGetId == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphExecGetId is not found") + return (__cuGraphExecGetId)( + hGraphExec, graphId) + + +cdef CUresult _cuDevSmResourceSplit(CUdevResource* result, unsigned int nbGroups, const CUdevResource* input, CUdevResource* remainder, unsigned int flags, CU_DEV_SM_RESOURCE_GROUP_PARAMS* groupParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDevSmResourceSplit + _check_or_init_driver() + if __cuDevSmResourceSplit == NULL: + with gil: + raise FunctionNotFoundError("function cuDevSmResourceSplit is not found") + return (__cuDevSmResourceSplit)( + result, nbGroups, input, remainder, flags, groupParams) + + +cdef CUresult _cuStreamGetDevResource(CUstream hStream, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamGetDevResource + _check_or_init_driver() + if __cuStreamGetDevResource == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamGetDevResource is not found") + return (__cuStreamGetDevResource)( + hStream, resource, type) + + +cdef CUresult _cuKernelGetParamCount(CUkernel kernel, size_t* paramCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuKernelGetParamCount + _check_or_init_driver() + if __cuKernelGetParamCount == NULL: + with gil: + raise FunctionNotFoundError("function cuKernelGetParamCount is not found") + return (__cuKernelGetParamCount)( + kernel, paramCount) + + +cdef CUresult _cuMemcpyWithAttributesAsync(CUdeviceptr dst, CUdeviceptr src, size_t size, CUmemcpyAttributes* attr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpyWithAttributesAsync + _check_or_init_driver() + if __cuMemcpyWithAttributesAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpyWithAttributesAsync is not found") + return (__cuMemcpyWithAttributesAsync)( + dst, src, size, attr, hStream) + + +cdef CUresult _cuMemcpy3DWithAttributesAsync(CUDA_MEMCPY3D_BATCH_OP* op, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemcpy3DWithAttributesAsync + _check_or_init_driver() + if __cuMemcpy3DWithAttributesAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuMemcpy3DWithAttributesAsync is not found") + return (__cuMemcpy3DWithAttributesAsync)( + op, flags, hStream) + + +cdef CUresult _cuStreamBeginCaptureToCig(CUstream hStream, CUstreamCigCaptureParams* streamCigCaptureParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamBeginCaptureToCig + _check_or_init_driver() + if __cuStreamBeginCaptureToCig == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamBeginCaptureToCig is not found") + return (__cuStreamBeginCaptureToCig)( + hStream, streamCigCaptureParams) + + +cdef CUresult _cuStreamEndCaptureToCig(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamEndCaptureToCig + _check_or_init_driver() + if __cuStreamEndCaptureToCig == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamEndCaptureToCig is not found") + return (__cuStreamEndCaptureToCig)( + hStream) + + +cdef CUresult _cuFuncGetParamCount(CUfunction func, size_t* paramCount) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFuncGetParamCount + _check_or_init_driver() + if __cuFuncGetParamCount == NULL: + with gil: + raise FunctionNotFoundError("function cuFuncGetParamCount is not found") + return (__cuFuncGetParamCount)( + func, paramCount) + + +cdef CUresult _cuLaunchHostFunc_v2(CUstream hStream, CUhostFn fn, void* userData, unsigned int syncMode) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLaunchHostFunc_v2 + _check_or_init_driver() + if __cuLaunchHostFunc_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuLaunchHostFunc_v2 is not found") + return (__cuLaunchHostFunc_v2)( + hStream, fn, userData, syncMode) + + +cdef CUresult _cuGraphNodeGetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeGetParams + _check_or_init_driver() + if __cuGraphNodeGetParams == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeGetParams is not found") + return (__cuGraphNodeGetParams)( + hNode, nodeParams) + + +cdef CUresult _cuCoredumpRegisterStartCallback(CUcoredumpStatusCallback callback, void* userData, CUcoredumpCallbackHandle* callbackOut) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCoredumpRegisterStartCallback + _check_or_init_driver() + if __cuCoredumpRegisterStartCallback == NULL: + with gil: + raise FunctionNotFoundError("function cuCoredumpRegisterStartCallback is not found") + return (__cuCoredumpRegisterStartCallback)( + callback, userData, callbackOut) + + +cdef CUresult _cuCoredumpRegisterCompleteCallback(CUcoredumpStatusCallback callback, void* userData, CUcoredumpCallbackHandle* callbackOut) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCoredumpRegisterCompleteCallback + _check_or_init_driver() + if __cuCoredumpRegisterCompleteCallback == NULL: + with gil: + raise FunctionNotFoundError("function cuCoredumpRegisterCompleteCallback is not found") + return (__cuCoredumpRegisterCompleteCallback)( + callback, userData, callbackOut) + + +cdef CUresult _cuCoredumpDeregisterStartCallback(CUcoredumpCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCoredumpDeregisterStartCallback + _check_or_init_driver() + if __cuCoredumpDeregisterStartCallback == NULL: + with gil: + raise FunctionNotFoundError("function cuCoredumpDeregisterStartCallback is not found") + return (__cuCoredumpDeregisterStartCallback)( + callback) + + +cdef CUresult _cuCoredumpDeregisterCompleteCallback(CUcoredumpCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCoredumpDeregisterCompleteCallback + _check_or_init_driver() + if __cuCoredumpDeregisterCompleteCallback == NULL: + with gil: + raise FunctionNotFoundError("function cuCoredumpDeregisterCompleteCallback is not found") + return (__cuCoredumpDeregisterCompleteCallback)( + callback) + + +cdef CUresult _cuLogicalEndpointIdReserve(CUlogicalEndpointId* baseLeId, cuuint32_t count) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogicalEndpointIdReserve + _check_or_init_driver() + if __cuLogicalEndpointIdReserve == NULL: + with gil: + raise FunctionNotFoundError("function cuLogicalEndpointIdReserve is not found") + return (__cuLogicalEndpointIdReserve)( + baseLeId, count) + + +cdef CUresult _cuLogicalEndpointIdRelease(CUlogicalEndpointId baseLeId, cuuint32_t count) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogicalEndpointIdRelease + _check_or_init_driver() + if __cuLogicalEndpointIdRelease == NULL: + with gil: + raise FunctionNotFoundError("function cuLogicalEndpointIdRelease is not found") + return (__cuLogicalEndpointIdRelease)( + baseLeId, count) + + +cdef CUresult _cuLogicalEndpointCreate(CUlogicalEndpointId leId, const CUlogicalEndpointProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogicalEndpointCreate + _check_or_init_driver() + if __cuLogicalEndpointCreate == NULL: + with gil: + raise FunctionNotFoundError("function cuLogicalEndpointCreate is not found") + return (__cuLogicalEndpointCreate)( + leId, prop) + + +cdef CUresult _cuLogicalEndpointAddDevice(CUlogicalEndpointId leId, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogicalEndpointAddDevice + _check_or_init_driver() + if __cuLogicalEndpointAddDevice == NULL: + with gil: + raise FunctionNotFoundError("function cuLogicalEndpointAddDevice is not found") + return (__cuLogicalEndpointAddDevice)( + leId, dev) + + +cdef CUresult _cuLogicalEndpointDestroy(CUlogicalEndpointId leId) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogicalEndpointDestroy + _check_or_init_driver() + if __cuLogicalEndpointDestroy == NULL: + with gil: + raise FunctionNotFoundError("function cuLogicalEndpointDestroy is not found") + return (__cuLogicalEndpointDestroy)( + leId) + + +cdef CUresult _cuLogicalEndpointBindAddr(CUlogicalEndpointId leId, CUdevice dev, cuuint64_t offset, void* ptr, cuuint64_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogicalEndpointBindAddr + _check_or_init_driver() + if __cuLogicalEndpointBindAddr == NULL: + with gil: + raise FunctionNotFoundError("function cuLogicalEndpointBindAddr is not found") + return (__cuLogicalEndpointBindAddr)( + leId, dev, offset, ptr, size, flags) + + +cdef CUresult _cuLogicalEndpointBindMem(CUlogicalEndpointId leId, CUdevice dev, cuuint64_t offset, CUmemGenericAllocationHandle memHandle, cuuint64_t memOffset, cuuint64_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogicalEndpointBindMem + _check_or_init_driver() + if __cuLogicalEndpointBindMem == NULL: + with gil: + raise FunctionNotFoundError("function cuLogicalEndpointBindMem is not found") + return (__cuLogicalEndpointBindMem)( + leId, dev, offset, memHandle, memOffset, size, flags) + + +cdef CUresult _cuLogicalEndpointUnbind(CUlogicalEndpointId leId, CUdevice dev, cuuint64_t offset, cuuint64_t size) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogicalEndpointUnbind + _check_or_init_driver() + if __cuLogicalEndpointUnbind == NULL: + with gil: + raise FunctionNotFoundError("function cuLogicalEndpointUnbind is not found") + return (__cuLogicalEndpointUnbind)( + leId, dev, offset, size) + + +cdef CUresult _cuLogicalEndpointExport(void* handle, CUlogicalEndpointId leId, CUlogicalEndpointIpcHandleType handleType) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogicalEndpointExport + _check_or_init_driver() + if __cuLogicalEndpointExport == NULL: + with gil: + raise FunctionNotFoundError("function cuLogicalEndpointExport is not found") + return (__cuLogicalEndpointExport)( + handle, leId, handleType) + + +cdef CUresult _cuLogicalEndpointImport(CUlogicalEndpointId leId, const void* handle, CUlogicalEndpointIpcHandleType handleType) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogicalEndpointImport + _check_or_init_driver() + if __cuLogicalEndpointImport == NULL: + with gil: + raise FunctionNotFoundError("function cuLogicalEndpointImport is not found") + return (__cuLogicalEndpointImport)( + leId, handle, handleType) + + +cdef CUresult _cuLogicalEndpointGetLimits(cuuint64_t* bindAlignment, cuuint64_t* maxSize, const CUlogicalEndpointProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogicalEndpointGetLimits + _check_or_init_driver() + if __cuLogicalEndpointGetLimits == NULL: + with gil: + raise FunctionNotFoundError("function cuLogicalEndpointGetLimits is not found") + return (__cuLogicalEndpointGetLimits)( + bindAlignment, maxSize, prop) + + +cdef CUresult _cuLogicalEndpointQuery(CUlogicalEndpointId leId, cuuint32_t count, int* queryStatus) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuLogicalEndpointQuery + _check_or_init_driver() + if __cuLogicalEndpointQuery == NULL: + with gil: + raise FunctionNotFoundError("function cuLogicalEndpointQuery is not found") + return (__cuLogicalEndpointQuery)( + leId, count, queryStatus) + + +cdef CUresult _cuStreamBeginRecaptureToGraph(CUstream hStream, CUstreamCaptureMode mode, CUgraph hGraph, CUgraphRecaptureCallback callbackFunc, void* userData) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuStreamBeginRecaptureToGraph + _check_or_init_driver() + if __cuStreamBeginRecaptureToGraph == NULL: + with gil: + raise FunctionNotFoundError("function cuStreamBeginRecaptureToGraph is not found") + return (__cuStreamBeginRecaptureToGraph)( + hStream, mode, hGraph, callbackFunc, userData) diff --git a/cuda_bindings/cuda/bindings/_internal/nvfatbin.pxd b/cuda_bindings/cuda/bindings/_internal/nvfatbin.pxd index 15617f8ad54..b712a3087b8 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvfatbin.pxd +++ b/cuda_bindings/cuda/bindings/_internal/nvfatbin.pxd @@ -1,9 +1,10 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.4.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.4.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b52d99b7f07615d6c5ecb869a5c632e6e9cb4d0cb4f6cb1e43977d29ecd9995c from ..cynvfatbin cimport * @@ -20,5 +21,6 @@ cdef nvFatbinResult _nvFatbinAddLTOIR(nvFatbinHandle handle, const void* code, s cdef nvFatbinResult _nvFatbinSize(nvFatbinHandle handle, size_t* size) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil cdef nvFatbinResult _nvFatbinGet(nvFatbinHandle handle, void* buffer) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil cdef nvFatbinResult _nvFatbinVersion(unsigned int* major, unsigned int* minor) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult _nvFatbinAddIndex(nvFatbinHandle handle, const void* code, size_t size, const char* identifier) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil cdef nvFatbinResult _nvFatbinAddReloc(nvFatbinHandle handle, const void* code, size_t size) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil cdef nvFatbinResult _nvFatbinAddTileIR(nvFatbinHandle handle, const void* code, size_t size, const char* identifier, const char* optionsCmdLine) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil diff --git a/cuda_bindings/cuda/bindings/_internal/nvfatbin_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvfatbin_linux.pyx index f5a9bbd2180..e30e9ee145d 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvfatbin_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvfatbin_linux.pyx @@ -1,9 +1,10 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.4.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.4.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=821fd26991431cd8e528f964b5035e1deafcddf44d2971a267d9ed11d80d5199 from libc.stdint cimport intptr_t, uintptr_t import threading @@ -68,6 +69,7 @@ cdef void* __nvFatbinAddLTOIR = NULL cdef void* __nvFatbinSize = NULL cdef void* __nvFatbinGet = NULL cdef void* __nvFatbinVersion = NULL +cdef void* __nvFatbinAddIndex = NULL cdef void* __nvFatbinAddReloc = NULL cdef void* __nvFatbinAddTileIR = NULL @@ -151,6 +153,13 @@ cdef int _init_nvfatbin() except -1 nogil: handle = load_library() __nvFatbinVersion = dlsym(handle, 'nvFatbinVersion') + global __nvFatbinAddIndex + __nvFatbinAddIndex = dlsym(RTLD_DEFAULT, 'nvFatbinAddIndex') + if __nvFatbinAddIndex == NULL: + if handle == NULL: + handle = load_library() + __nvFatbinAddIndex = dlsym(handle, 'nvFatbinAddIndex') + global __nvFatbinAddReloc __nvFatbinAddReloc = dlsym(RTLD_DEFAULT, 'nvFatbinAddReloc') if __nvFatbinAddReloc == NULL: @@ -213,6 +222,9 @@ cpdef dict _inspect_function_pointers(): global __nvFatbinVersion data["__nvFatbinVersion"] = __nvFatbinVersion + global __nvFatbinAddIndex + data["__nvFatbinAddIndex"] = __nvFatbinAddIndex + global __nvFatbinAddReloc data["__nvFatbinAddReloc"] = __nvFatbinAddReloc @@ -324,6 +336,16 @@ cdef nvFatbinResult _nvFatbinVersion(unsigned int* major, unsigned int* minor) e major, minor) +cdef nvFatbinResult _nvFatbinAddIndex(nvFatbinHandle handle, const void* code, size_t size, const char* identifier) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvFatbinAddIndex + _check_or_init_nvfatbin() + if __nvFatbinAddIndex == NULL: + with gil: + raise FunctionNotFoundError("function nvFatbinAddIndex is not found") + return (__nvFatbinAddIndex)( + handle, code, size, identifier) + + cdef nvFatbinResult _nvFatbinAddReloc(nvFatbinHandle handle, const void* code, size_t size) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: global __nvFatbinAddReloc _check_or_init_nvfatbin() diff --git a/cuda_bindings/cuda/bindings/_internal/nvfatbin_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvfatbin_windows.pyx index add15de5617..b82882cfd76 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvfatbin_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvfatbin_windows.pyx @@ -1,9 +1,10 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.4.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.4.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=2052c33a9bbfdef36b362c4eedc1284ce8fa2fc905a53ac9c366218ca99f5913 from libc.stdint cimport intptr_t import threading @@ -86,6 +87,7 @@ cdef void* __nvFatbinAddLTOIR = NULL cdef void* __nvFatbinSize = NULL cdef void* __nvFatbinGet = NULL cdef void* __nvFatbinVersion = NULL +cdef void* __nvFatbinAddIndex = NULL cdef void* __nvFatbinAddReloc = NULL cdef void* __nvFatbinAddTileIR = NULL @@ -129,6 +131,9 @@ cdef int _init_nvfatbin() except -1 nogil: global __nvFatbinVersion __nvFatbinVersion = GetProcAddress(handle, 'nvFatbinVersion') + global __nvFatbinAddIndex + __nvFatbinAddIndex = GetProcAddress(handle, 'nvFatbinAddIndex') + global __nvFatbinAddReloc __nvFatbinAddReloc = GetProcAddress(handle, 'nvFatbinAddReloc') @@ -184,6 +189,9 @@ cpdef dict _inspect_function_pointers(): global __nvFatbinVersion data["__nvFatbinVersion"] = __nvFatbinVersion + global __nvFatbinAddIndex + data["__nvFatbinAddIndex"] = __nvFatbinAddIndex + global __nvFatbinAddReloc data["__nvFatbinAddReloc"] = __nvFatbinAddReloc @@ -295,6 +303,16 @@ cdef nvFatbinResult _nvFatbinVersion(unsigned int* major, unsigned int* minor) e major, minor) +cdef nvFatbinResult _nvFatbinAddIndex(nvFatbinHandle handle, const void* code, size_t size, const char* identifier) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvFatbinAddIndex + _check_or_init_nvfatbin() + if __nvFatbinAddIndex == NULL: + with gil: + raise FunctionNotFoundError("function nvFatbinAddIndex is not found") + return (__nvFatbinAddIndex)( + handle, code, size, identifier) + + cdef nvFatbinResult _nvFatbinAddReloc(nvFatbinHandle handle, const void* code, size_t size) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: global __nvFatbinAddReloc _check_or_init_nvfatbin() diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd b/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd index 6fd75c86822..edfe717e649 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd @@ -1,9 +1,10 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=fd32577c0d6b922ff30c56dc4f3dcbed2251c393098c27d972ccc8688564fa50 from ..cynvjitlink cimport * @@ -25,3 +26,5 @@ cdef nvJitLinkResult _nvJitLinkGetErrorLog(nvJitLinkHandle handle, char* log) ex cdef nvJitLinkResult _nvJitLinkGetInfoLogSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil cdef nvJitLinkResult _nvJitLinkGetInfoLog(nvJitLinkHandle handle, char* log) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil cdef nvJitLinkResult _nvJitLinkVersion(unsigned int* major, unsigned int* minor) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult _nvJitLinkGetLinkedLTOIRSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult _nvJitLinkGetLinkedLTOIR(nvJitLinkHandle handle, void* ltoir) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx index d676aac3727..33cea546ee4 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx @@ -1,9 +1,10 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f6e8c32c0afa43fe218ae5c6f43f402bb85ab1e9898ad6270872c3e546eb4913 from libc.stdint cimport intptr_t, uintptr_t import threading @@ -73,6 +74,8 @@ cdef void* __nvJitLinkGetErrorLog = NULL cdef void* __nvJitLinkGetInfoLogSize = NULL cdef void* __nvJitLinkGetInfoLog = NULL cdef void* __nvJitLinkVersion = NULL +cdef void* __nvJitLinkGetLinkedLTOIRSize = NULL +cdef void* __nvJitLinkGetLinkedLTOIR = NULL cdef void* load_library() except* with gil: @@ -189,6 +192,20 @@ cdef int _init_nvjitlink() except -1 nogil: handle = load_library() __nvJitLinkVersion = dlsym(handle, 'nvJitLinkVersion') + global __nvJitLinkGetLinkedLTOIRSize + __nvJitLinkGetLinkedLTOIRSize = dlsym(RTLD_DEFAULT, 'nvJitLinkGetLinkedLTOIRSize') + if __nvJitLinkGetLinkedLTOIRSize == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkGetLinkedLTOIRSize = dlsym(handle, 'nvJitLinkGetLinkedLTOIRSize') + + global __nvJitLinkGetLinkedLTOIR + __nvJitLinkGetLinkedLTOIR = dlsym(RTLD_DEFAULT, 'nvJitLinkGetLinkedLTOIR') + if __nvJitLinkGetLinkedLTOIR == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkGetLinkedLTOIR = dlsym(handle, 'nvJitLinkGetLinkedLTOIR') + __py_nvjitlink_init = True return 0 @@ -252,6 +269,12 @@ cpdef dict _inspect_function_pointers(): global __nvJitLinkVersion data["__nvJitLinkVersion"] = __nvJitLinkVersion + global __nvJitLinkGetLinkedLTOIRSize + data["__nvJitLinkGetLinkedLTOIRSize"] = __nvJitLinkGetLinkedLTOIRSize + + global __nvJitLinkGetLinkedLTOIR + data["__nvJitLinkGetLinkedLTOIR"] = __nvJitLinkGetLinkedLTOIR + func_ptrs = data return data @@ -405,3 +428,23 @@ cdef nvJitLinkResult _nvJitLinkVersion(unsigned int* major, unsigned int* minor) raise FunctionNotFoundError("function nvJitLinkVersion is not found") return (__nvJitLinkVersion)( major, minor) + + +cdef nvJitLinkResult _nvJitLinkGetLinkedLTOIRSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkGetLinkedLTOIRSize + _check_or_init_nvjitlink() + if __nvJitLinkGetLinkedLTOIRSize == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkGetLinkedLTOIRSize is not found") + return (__nvJitLinkGetLinkedLTOIRSize)( + handle, size) + + +cdef nvJitLinkResult _nvJitLinkGetLinkedLTOIR(nvJitLinkHandle handle, void* ltoir) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkGetLinkedLTOIR + _check_or_init_nvjitlink() + if __nvJitLinkGetLinkedLTOIR == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkGetLinkedLTOIR is not found") + return (__nvJitLinkGetLinkedLTOIR)( + handle, ltoir) diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx index 4ee6859bdbd..1385f2df077 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx @@ -1,9 +1,10 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=9043dd9e45a69e2bd6c7984832fca8cc1ccd7c66b605b384e4cff18b0c713027 from libc.stdint cimport intptr_t import threading @@ -91,6 +92,8 @@ cdef void* __nvJitLinkGetErrorLog = NULL cdef void* __nvJitLinkGetInfoLogSize = NULL cdef void* __nvJitLinkGetInfoLog = NULL cdef void* __nvJitLinkVersion = NULL +cdef void* __nvJitLinkGetLinkedLTOIRSize = NULL +cdef void* __nvJitLinkGetLinkedLTOIR = NULL cdef int _init_nvjitlink() except -1 nogil: @@ -147,6 +150,12 @@ cdef int _init_nvjitlink() except -1 nogil: global __nvJitLinkVersion __nvJitLinkVersion = GetProcAddress(handle, 'nvJitLinkVersion') + global __nvJitLinkGetLinkedLTOIRSize + __nvJitLinkGetLinkedLTOIRSize = GetProcAddress(handle, 'nvJitLinkGetLinkedLTOIRSize') + + global __nvJitLinkGetLinkedLTOIR + __nvJitLinkGetLinkedLTOIR = GetProcAddress(handle, 'nvJitLinkGetLinkedLTOIR') + __py_nvjitlink_init = True return 0 @@ -211,6 +220,12 @@ cpdef dict _inspect_function_pointers(): global __nvJitLinkVersion data["__nvJitLinkVersion"] = __nvJitLinkVersion + global __nvJitLinkGetLinkedLTOIRSize + data["__nvJitLinkGetLinkedLTOIRSize"] = __nvJitLinkGetLinkedLTOIRSize + + global __nvJitLinkGetLinkedLTOIR + data["__nvJitLinkGetLinkedLTOIR"] = __nvJitLinkGetLinkedLTOIR + func_ptrs = data return data @@ -364,3 +379,23 @@ cdef nvJitLinkResult _nvJitLinkVersion(unsigned int* major, unsigned int* minor) raise FunctionNotFoundError("function nvJitLinkVersion is not found") return (__nvJitLinkVersion)( major, minor) + + +cdef nvJitLinkResult _nvJitLinkGetLinkedLTOIRSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkGetLinkedLTOIRSize + _check_or_init_nvjitlink() + if __nvJitLinkGetLinkedLTOIRSize == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkGetLinkedLTOIRSize is not found") + return (__nvJitLinkGetLinkedLTOIRSize)( + handle, size) + + +cdef nvJitLinkResult _nvJitLinkGetLinkedLTOIR(nvJitLinkHandle handle, void* ltoir) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvJitLinkGetLinkedLTOIR + _check_or_init_nvjitlink() + if __nvJitLinkGetLinkedLTOIR == NULL: + with gil: + raise FunctionNotFoundError("function nvJitLinkGetLinkedLTOIR is not found") + return (__nvJitLinkGetLinkedLTOIR)( + handle, ltoir) diff --git a/cuda_bindings/cuda/bindings/_internal/nvml.pxd b/cuda_bindings/cuda/bindings/_internal/nvml.pxd index 40805378a89..eea80739f07 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvml.pxd +++ b/cuda_bindings/cuda/bindings/_internal/nvml.pxd @@ -1,9 +1,10 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.9.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=ed4c433854399c2e4f1adc3ffcfc37901e1be29c5aa50728498c87225edf92b1 from ..cynvml cimport * @@ -139,6 +140,7 @@ cdef nvmlReturn_t _nvmlDeviceGetDriverModel_v2(nvmlDevice_t device, nvmlDriverMo cdef nvmlReturn_t _nvmlDeviceGetVbiosVersion(nvmlDevice_t device, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t _nvmlDeviceGetBridgeChipInfo(nvmlDevice_t device, nvmlBridgeChipHierarchy_t* bridgeHierarchy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t _nvmlDeviceGetComputeRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGraphicsRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t _nvmlDeviceGetMPSComputeRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t _nvmlDeviceGetRunningProcessDetailList(nvmlDevice_t device, nvmlProcessDetailList_t* plist) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t _nvmlDeviceOnSameBoard(nvmlDevice_t device1, nvmlDevice_t device2, int* onSameBoard) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil @@ -354,3 +356,10 @@ cdef nvmlReturn_t _nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts(nvmlDevice_t cdef nvmlReturn_t _nvmlDeviceGetUnrepairableMemoryFlag_v1(nvmlDevice_t device, nvmlUnrepairableMemoryStatus_v1_t* unrepairableMemoryStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t _nvmlDeviceReadPRMCounters_v1(nvmlDevice_t device, nvmlPRMCounterList_v1_t* counterList) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t _nvmlDeviceSetRusdSettings_v1(nvmlDevice_t device, nvmlRusdSettings_v1_t* settings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceVgpuForceGspUnload(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerStateInfo_v2_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerStateInfo_v2_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerLog_v2(nvmlDevice_t device, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuSchedulerLog_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceSetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil diff --git a/cuda_bindings/cuda/bindings/_internal/nvml_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvml_linux.pyx index 28f09194236..05e7ede4929 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvml_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvml_linux.pyx @@ -1,9 +1,10 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.9.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=bdb56d8618b22dfcdcb3da879bbe276c3caf7c07aae6e5aa2b76de817f4baa39 from libc.stdint cimport intptr_t, uintptr_t import threading @@ -188,6 +189,7 @@ cdef void* __nvmlDeviceGetDriverModel_v2 = NULL cdef void* __nvmlDeviceGetVbiosVersion = NULL cdef void* __nvmlDeviceGetBridgeChipInfo = NULL cdef void* __nvmlDeviceGetComputeRunningProcesses_v3 = NULL +cdef void* __nvmlDeviceGetGraphicsRunningProcesses_v3 = NULL cdef void* __nvmlDeviceGetMPSComputeRunningProcesses_v3 = NULL cdef void* __nvmlDeviceGetRunningProcessDetailList = NULL cdef void* __nvmlDeviceOnSameBoard = NULL @@ -403,6 +405,13 @@ cdef void* __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts = NULL cdef void* __nvmlDeviceGetUnrepairableMemoryFlag_v1 = NULL cdef void* __nvmlDeviceReadPRMCounters_v1 = NULL cdef void* __nvmlDeviceSetRusdSettings_v1 = NULL +cdef void* __nvmlDeviceVgpuForceGspUnload = NULL +cdef void* __nvmlDeviceGetVgpuSchedulerState_v2 = NULL +cdef void* __nvmlGpuInstanceGetVgpuSchedulerState_v2 = NULL +cdef void* __nvmlDeviceGetVgpuSchedulerLog_v2 = NULL +cdef void* __nvmlGpuInstanceGetVgpuSchedulerLog_v2 = NULL +cdef void* __nvmlDeviceSetVgpuSchedulerState_v2 = NULL +cdef void* __nvmlGpuInstanceSetVgpuSchedulerState_v2 = NULL cdef void* load_library() except* with gil: @@ -1316,6 +1325,13 @@ cdef int _init_nvml() except -1 nogil: handle = load_library() __nvmlDeviceGetComputeRunningProcesses_v3 = dlsym(handle, 'nvmlDeviceGetComputeRunningProcesses_v3') + global __nvmlDeviceGetGraphicsRunningProcesses_v3 + __nvmlDeviceGetGraphicsRunningProcesses_v3 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetGraphicsRunningProcesses_v3') + if __nvmlDeviceGetGraphicsRunningProcesses_v3 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetGraphicsRunningProcesses_v3 = dlsym(handle, 'nvmlDeviceGetGraphicsRunningProcesses_v3') + global __nvmlDeviceGetMPSComputeRunningProcesses_v3 __nvmlDeviceGetMPSComputeRunningProcesses_v3 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMPSComputeRunningProcesses_v3') if __nvmlDeviceGetMPSComputeRunningProcesses_v3 == NULL: @@ -2821,6 +2837,55 @@ cdef int _init_nvml() except -1 nogil: handle = load_library() __nvmlDeviceSetRusdSettings_v1 = dlsym(handle, 'nvmlDeviceSetRusdSettings_v1') + global __nvmlDeviceVgpuForceGspUnload + __nvmlDeviceVgpuForceGspUnload = dlsym(RTLD_DEFAULT, 'nvmlDeviceVgpuForceGspUnload') + if __nvmlDeviceVgpuForceGspUnload == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceVgpuForceGspUnload = dlsym(handle, 'nvmlDeviceVgpuForceGspUnload') + + global __nvmlDeviceGetVgpuSchedulerState_v2 + __nvmlDeviceGetVgpuSchedulerState_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetVgpuSchedulerState_v2') + if __nvmlDeviceGetVgpuSchedulerState_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetVgpuSchedulerState_v2 = dlsym(handle, 'nvmlDeviceGetVgpuSchedulerState_v2') + + global __nvmlGpuInstanceGetVgpuSchedulerState_v2 + __nvmlGpuInstanceGetVgpuSchedulerState_v2 = dlsym(RTLD_DEFAULT, 'nvmlGpuInstanceGetVgpuSchedulerState_v2') + if __nvmlGpuInstanceGetVgpuSchedulerState_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceGetVgpuSchedulerState_v2 = dlsym(handle, 'nvmlGpuInstanceGetVgpuSchedulerState_v2') + + global __nvmlDeviceGetVgpuSchedulerLog_v2 + __nvmlDeviceGetVgpuSchedulerLog_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetVgpuSchedulerLog_v2') + if __nvmlDeviceGetVgpuSchedulerLog_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetVgpuSchedulerLog_v2 = dlsym(handle, 'nvmlDeviceGetVgpuSchedulerLog_v2') + + global __nvmlGpuInstanceGetVgpuSchedulerLog_v2 + __nvmlGpuInstanceGetVgpuSchedulerLog_v2 = dlsym(RTLD_DEFAULT, 'nvmlGpuInstanceGetVgpuSchedulerLog_v2') + if __nvmlGpuInstanceGetVgpuSchedulerLog_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceGetVgpuSchedulerLog_v2 = dlsym(handle, 'nvmlGpuInstanceGetVgpuSchedulerLog_v2') + + global __nvmlDeviceSetVgpuSchedulerState_v2 + __nvmlDeviceSetVgpuSchedulerState_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetVgpuSchedulerState_v2') + if __nvmlDeviceSetVgpuSchedulerState_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetVgpuSchedulerState_v2 = dlsym(handle, 'nvmlDeviceSetVgpuSchedulerState_v2') + + global __nvmlGpuInstanceSetVgpuSchedulerState_v2 + __nvmlGpuInstanceSetVgpuSchedulerState_v2 = dlsym(RTLD_DEFAULT, 'nvmlGpuInstanceSetVgpuSchedulerState_v2') + if __nvmlGpuInstanceSetVgpuSchedulerState_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceSetVgpuSchedulerState_v2 = dlsym(handle, 'nvmlGpuInstanceSetVgpuSchedulerState_v2') + __py_nvml_init = True return 0 @@ -3227,6 +3292,9 @@ cpdef dict _inspect_function_pointers(): global __nvmlDeviceGetComputeRunningProcesses_v3 data["__nvmlDeviceGetComputeRunningProcesses_v3"] = __nvmlDeviceGetComputeRunningProcesses_v3 + global __nvmlDeviceGetGraphicsRunningProcesses_v3 + data["__nvmlDeviceGetGraphicsRunningProcesses_v3"] = __nvmlDeviceGetGraphicsRunningProcesses_v3 + global __nvmlDeviceGetMPSComputeRunningProcesses_v3 data["__nvmlDeviceGetMPSComputeRunningProcesses_v3"] = __nvmlDeviceGetMPSComputeRunningProcesses_v3 @@ -3872,6 +3940,27 @@ cpdef dict _inspect_function_pointers(): global __nvmlDeviceSetRusdSettings_v1 data["__nvmlDeviceSetRusdSettings_v1"] = __nvmlDeviceSetRusdSettings_v1 + global __nvmlDeviceVgpuForceGspUnload + data["__nvmlDeviceVgpuForceGspUnload"] = __nvmlDeviceVgpuForceGspUnload + + global __nvmlDeviceGetVgpuSchedulerState_v2 + data["__nvmlDeviceGetVgpuSchedulerState_v2"] = __nvmlDeviceGetVgpuSchedulerState_v2 + + global __nvmlGpuInstanceGetVgpuSchedulerState_v2 + data["__nvmlGpuInstanceGetVgpuSchedulerState_v2"] = __nvmlGpuInstanceGetVgpuSchedulerState_v2 + + global __nvmlDeviceGetVgpuSchedulerLog_v2 + data["__nvmlDeviceGetVgpuSchedulerLog_v2"] = __nvmlDeviceGetVgpuSchedulerLog_v2 + + global __nvmlGpuInstanceGetVgpuSchedulerLog_v2 + data["__nvmlGpuInstanceGetVgpuSchedulerLog_v2"] = __nvmlGpuInstanceGetVgpuSchedulerLog_v2 + + global __nvmlDeviceSetVgpuSchedulerState_v2 + data["__nvmlDeviceSetVgpuSchedulerState_v2"] = __nvmlDeviceSetVgpuSchedulerState_v2 + + global __nvmlGpuInstanceSetVgpuSchedulerState_v2 + data["__nvmlGpuInstanceSetVgpuSchedulerState_v2"] = __nvmlGpuInstanceSetVgpuSchedulerState_v2 + func_ptrs = data return data @@ -5167,6 +5256,16 @@ cdef nvmlReturn_t _nvmlDeviceGetComputeRunningProcesses_v3(nvmlDevice_t device, device, infoCount, infos) +cdef nvmlReturn_t _nvmlDeviceGetGraphicsRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGraphicsRunningProcesses_v3 + _check_or_init_nvml() + if __nvmlDeviceGetGraphicsRunningProcesses_v3 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGraphicsRunningProcesses_v3 is not found") + return (__nvmlDeviceGetGraphicsRunningProcesses_v3)( + device, infoCount, infos) + + cdef nvmlReturn_t _nvmlDeviceGetMPSComputeRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: global __nvmlDeviceGetMPSComputeRunningProcesses_v3 _check_or_init_nvml() @@ -7315,3 +7414,73 @@ cdef nvmlReturn_t _nvmlDeviceSetRusdSettings_v1(nvmlDevice_t device, nvmlRusdSet raise FunctionNotFoundError("function nvmlDeviceSetRusdSettings_v1 is not found") return (__nvmlDeviceSetRusdSettings_v1)( device, settings) + + +cdef nvmlReturn_t _nvmlDeviceVgpuForceGspUnload(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceVgpuForceGspUnload + _check_or_init_nvml() + if __nvmlDeviceVgpuForceGspUnload == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceVgpuForceGspUnload is not found") + return (__nvmlDeviceVgpuForceGspUnload)( + device) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerStateInfo_v2_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuSchedulerState_v2 + _check_or_init_nvml() + if __nvmlDeviceGetVgpuSchedulerState_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuSchedulerState_v2 is not found") + return (__nvmlDeviceGetVgpuSchedulerState_v2)( + device, pSchedulerStateInfo) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerStateInfo_v2_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetVgpuSchedulerState_v2 + _check_or_init_nvml() + if __nvmlGpuInstanceGetVgpuSchedulerState_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetVgpuSchedulerState_v2 is not found") + return (__nvmlGpuInstanceGetVgpuSchedulerState_v2)( + gpuInstance, pSchedulerStateInfo) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerLog_v2(nvmlDevice_t device, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuSchedulerLog_v2 + _check_or_init_nvml() + if __nvmlDeviceGetVgpuSchedulerLog_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuSchedulerLog_v2 is not found") + return (__nvmlDeviceGetVgpuSchedulerLog_v2)( + device, pSchedulerLogInfo) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuSchedulerLog_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetVgpuSchedulerLog_v2 + _check_or_init_nvml() + if __nvmlGpuInstanceGetVgpuSchedulerLog_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetVgpuSchedulerLog_v2 is not found") + return (__nvmlGpuInstanceGetVgpuSchedulerLog_v2)( + gpuInstance, pSchedulerLogInfo) + + +cdef nvmlReturn_t _nvmlDeviceSetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetVgpuSchedulerState_v2 + _check_or_init_nvml() + if __nvmlDeviceSetVgpuSchedulerState_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetVgpuSchedulerState_v2 is not found") + return (__nvmlDeviceSetVgpuSchedulerState_v2)( + device, pSchedulerState) + + +cdef nvmlReturn_t _nvmlGpuInstanceSetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceSetVgpuSchedulerState_v2 + _check_or_init_nvml() + if __nvmlGpuInstanceSetVgpuSchedulerState_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceSetVgpuSchedulerState_v2 is not found") + return (__nvmlGpuInstanceSetVgpuSchedulerState_v2)( + gpuInstance, pSchedulerState) diff --git a/cuda_bindings/cuda/bindings/_internal/nvml_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvml_windows.pyx index afbd0a8860d..6de3a0e8671 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvml_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvml_windows.pyx @@ -1,9 +1,10 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.9.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=56d9b790c493aea94da4c2c52e78dea025da7c698edc614c374767038d40869c from libc.stdint cimport intptr_t import os @@ -207,6 +208,7 @@ cdef void* __nvmlDeviceGetDriverModel_v2 = NULL cdef void* __nvmlDeviceGetVbiosVersion = NULL cdef void* __nvmlDeviceGetBridgeChipInfo = NULL cdef void* __nvmlDeviceGetComputeRunningProcesses_v3 = NULL +cdef void* __nvmlDeviceGetGraphicsRunningProcesses_v3 = NULL cdef void* __nvmlDeviceGetMPSComputeRunningProcesses_v3 = NULL cdef void* __nvmlDeviceGetRunningProcessDetailList = NULL cdef void* __nvmlDeviceOnSameBoard = NULL @@ -422,6 +424,13 @@ cdef void* __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts = NULL cdef void* __nvmlDeviceGetUnrepairableMemoryFlag_v1 = NULL cdef void* __nvmlDeviceReadPRMCounters_v1 = NULL cdef void* __nvmlDeviceSetRusdSettings_v1 = NULL +cdef void* __nvmlDeviceVgpuForceGspUnload = NULL +cdef void* __nvmlDeviceGetVgpuSchedulerState_v2 = NULL +cdef void* __nvmlGpuInstanceGetVgpuSchedulerState_v2 = NULL +cdef void* __nvmlDeviceGetVgpuSchedulerLog_v2 = NULL +cdef void* __nvmlGpuInstanceGetVgpuSchedulerLog_v2 = NULL +cdef void* __nvmlDeviceSetVgpuSchedulerState_v2 = NULL +cdef void* __nvmlGpuInstanceSetVgpuSchedulerState_v2 = NULL cdef uintptr_t load_library() except* with gil: @@ -822,6 +831,9 @@ cdef int _init_nvml() except -1 nogil: global __nvmlDeviceGetComputeRunningProcesses_v3 __nvmlDeviceGetComputeRunningProcesses_v3 = GetProcAddress(handle, 'nvmlDeviceGetComputeRunningProcesses_v3') + global __nvmlDeviceGetGraphicsRunningProcesses_v3 + __nvmlDeviceGetGraphicsRunningProcesses_v3 = GetProcAddress(handle, 'nvmlDeviceGetGraphicsRunningProcesses_v3') + global __nvmlDeviceGetMPSComputeRunningProcesses_v3 __nvmlDeviceGetMPSComputeRunningProcesses_v3 = GetProcAddress(handle, 'nvmlDeviceGetMPSComputeRunningProcesses_v3') @@ -1467,6 +1479,27 @@ cdef int _init_nvml() except -1 nogil: global __nvmlDeviceSetRusdSettings_v1 __nvmlDeviceSetRusdSettings_v1 = GetProcAddress(handle, 'nvmlDeviceSetRusdSettings_v1') + global __nvmlDeviceVgpuForceGspUnload + __nvmlDeviceVgpuForceGspUnload = GetProcAddress(handle, 'nvmlDeviceVgpuForceGspUnload') + + global __nvmlDeviceGetVgpuSchedulerState_v2 + __nvmlDeviceGetVgpuSchedulerState_v2 = GetProcAddress(handle, 'nvmlDeviceGetVgpuSchedulerState_v2') + + global __nvmlGpuInstanceGetVgpuSchedulerState_v2 + __nvmlGpuInstanceGetVgpuSchedulerState_v2 = GetProcAddress(handle, 'nvmlGpuInstanceGetVgpuSchedulerState_v2') + + global __nvmlDeviceGetVgpuSchedulerLog_v2 + __nvmlDeviceGetVgpuSchedulerLog_v2 = GetProcAddress(handle, 'nvmlDeviceGetVgpuSchedulerLog_v2') + + global __nvmlGpuInstanceGetVgpuSchedulerLog_v2 + __nvmlGpuInstanceGetVgpuSchedulerLog_v2 = GetProcAddress(handle, 'nvmlGpuInstanceGetVgpuSchedulerLog_v2') + + global __nvmlDeviceSetVgpuSchedulerState_v2 + __nvmlDeviceSetVgpuSchedulerState_v2 = GetProcAddress(handle, 'nvmlDeviceSetVgpuSchedulerState_v2') + + global __nvmlGpuInstanceSetVgpuSchedulerState_v2 + __nvmlGpuInstanceSetVgpuSchedulerState_v2 = GetProcAddress(handle, 'nvmlGpuInstanceSetVgpuSchedulerState_v2') + __py_nvml_init = True return 0 @@ -1873,6 +1906,9 @@ cpdef dict _inspect_function_pointers(): global __nvmlDeviceGetComputeRunningProcesses_v3 data["__nvmlDeviceGetComputeRunningProcesses_v3"] = __nvmlDeviceGetComputeRunningProcesses_v3 + global __nvmlDeviceGetGraphicsRunningProcesses_v3 + data["__nvmlDeviceGetGraphicsRunningProcesses_v3"] = __nvmlDeviceGetGraphicsRunningProcesses_v3 + global __nvmlDeviceGetMPSComputeRunningProcesses_v3 data["__nvmlDeviceGetMPSComputeRunningProcesses_v3"] = __nvmlDeviceGetMPSComputeRunningProcesses_v3 @@ -2518,6 +2554,27 @@ cpdef dict _inspect_function_pointers(): global __nvmlDeviceSetRusdSettings_v1 data["__nvmlDeviceSetRusdSettings_v1"] = __nvmlDeviceSetRusdSettings_v1 + global __nvmlDeviceVgpuForceGspUnload + data["__nvmlDeviceVgpuForceGspUnload"] = __nvmlDeviceVgpuForceGspUnload + + global __nvmlDeviceGetVgpuSchedulerState_v2 + data["__nvmlDeviceGetVgpuSchedulerState_v2"] = __nvmlDeviceGetVgpuSchedulerState_v2 + + global __nvmlGpuInstanceGetVgpuSchedulerState_v2 + data["__nvmlGpuInstanceGetVgpuSchedulerState_v2"] = __nvmlGpuInstanceGetVgpuSchedulerState_v2 + + global __nvmlDeviceGetVgpuSchedulerLog_v2 + data["__nvmlDeviceGetVgpuSchedulerLog_v2"] = __nvmlDeviceGetVgpuSchedulerLog_v2 + + global __nvmlGpuInstanceGetVgpuSchedulerLog_v2 + data["__nvmlGpuInstanceGetVgpuSchedulerLog_v2"] = __nvmlGpuInstanceGetVgpuSchedulerLog_v2 + + global __nvmlDeviceSetVgpuSchedulerState_v2 + data["__nvmlDeviceSetVgpuSchedulerState_v2"] = __nvmlDeviceSetVgpuSchedulerState_v2 + + global __nvmlGpuInstanceSetVgpuSchedulerState_v2 + data["__nvmlGpuInstanceSetVgpuSchedulerState_v2"] = __nvmlGpuInstanceSetVgpuSchedulerState_v2 + func_ptrs = data return data @@ -3813,6 +3870,16 @@ cdef nvmlReturn_t _nvmlDeviceGetComputeRunningProcesses_v3(nvmlDevice_t device, device, infoCount, infos) +cdef nvmlReturn_t _nvmlDeviceGetGraphicsRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGraphicsRunningProcesses_v3 + _check_or_init_nvml() + if __nvmlDeviceGetGraphicsRunningProcesses_v3 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGraphicsRunningProcesses_v3 is not found") + return (__nvmlDeviceGetGraphicsRunningProcesses_v3)( + device, infoCount, infos) + + cdef nvmlReturn_t _nvmlDeviceGetMPSComputeRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: global __nvmlDeviceGetMPSComputeRunningProcesses_v3 _check_or_init_nvml() @@ -5961,3 +6028,73 @@ cdef nvmlReturn_t _nvmlDeviceSetRusdSettings_v1(nvmlDevice_t device, nvmlRusdSet raise FunctionNotFoundError("function nvmlDeviceSetRusdSettings_v1 is not found") return (__nvmlDeviceSetRusdSettings_v1)( device, settings) + + +cdef nvmlReturn_t _nvmlDeviceVgpuForceGspUnload(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceVgpuForceGspUnload + _check_or_init_nvml() + if __nvmlDeviceVgpuForceGspUnload == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceVgpuForceGspUnload is not found") + return (__nvmlDeviceVgpuForceGspUnload)( + device) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerStateInfo_v2_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuSchedulerState_v2 + _check_or_init_nvml() + if __nvmlDeviceGetVgpuSchedulerState_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuSchedulerState_v2 is not found") + return (__nvmlDeviceGetVgpuSchedulerState_v2)( + device, pSchedulerStateInfo) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerStateInfo_v2_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetVgpuSchedulerState_v2 + _check_or_init_nvml() + if __nvmlGpuInstanceGetVgpuSchedulerState_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetVgpuSchedulerState_v2 is not found") + return (__nvmlGpuInstanceGetVgpuSchedulerState_v2)( + gpuInstance, pSchedulerStateInfo) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerLog_v2(nvmlDevice_t device, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuSchedulerLog_v2 + _check_or_init_nvml() + if __nvmlDeviceGetVgpuSchedulerLog_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuSchedulerLog_v2 is not found") + return (__nvmlDeviceGetVgpuSchedulerLog_v2)( + device, pSchedulerLogInfo) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuSchedulerLog_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetVgpuSchedulerLog_v2 + _check_or_init_nvml() + if __nvmlGpuInstanceGetVgpuSchedulerLog_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetVgpuSchedulerLog_v2 is not found") + return (__nvmlGpuInstanceGetVgpuSchedulerLog_v2)( + gpuInstance, pSchedulerLogInfo) + + +cdef nvmlReturn_t _nvmlDeviceSetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetVgpuSchedulerState_v2 + _check_or_init_nvml() + if __nvmlDeviceSetVgpuSchedulerState_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetVgpuSchedulerState_v2 is not found") + return (__nvmlDeviceSetVgpuSchedulerState_v2)( + device, pSchedulerState) + + +cdef nvmlReturn_t _nvmlGpuInstanceSetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceSetVgpuSchedulerState_v2 + _check_or_init_nvml() + if __nvmlGpuInstanceSetVgpuSchedulerState_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceSetVgpuSchedulerState_v2 is not found") + return (__nvmlGpuInstanceSetVgpuSchedulerState_v2)( + gpuInstance, pSchedulerState) diff --git a/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pxd.in b/cuda_bindings/cuda/bindings/_internal/nvrtc.pxd similarity index 60% rename from cuda_bindings/cuda/bindings/_bindings/cynvrtc.pxd.in rename to cuda_bindings/cuda/bindings/_internal/nvrtc.pxd index ebe43bd9227..020f113c03b 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pxd.in +++ b/cuda_bindings/cuda/bindings/_internal/nvrtc.pxd @@ -1,136 +1,43 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. -# This code was automatically generated with version 13.2.0, generator version 8797618. Do not modify it directly. -from cuda.bindings.cynvrtc cimport * +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=ff79428bd0afac112d0a9f6131f9ed097b8d0ebc4574444a0e4a41e7f6e260d0 +from ..cynvrtc cimport * -{{if 'nvrtcGetErrorString' in found_functions}} -cdef const char* _nvrtcGetErrorString(nvrtcResult result) except ?NULL nogil -{{endif}} - -{{if 'nvrtcVersion' in found_functions}} +############################################################################### +# Wrapper functions +############################################################################### +cdef const char* _nvrtcGetErrorString(nvrtcResult result) except?NULL nogil cdef nvrtcResult _nvrtcVersion(int* major, int* minor) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetNumSupportedArchs' in found_functions}} - cdef nvrtcResult _nvrtcGetNumSupportedArchs(int* numArchs) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetSupportedArchs' in found_functions}} - cdef nvrtcResult _nvrtcGetSupportedArchs(int* supportedArchs) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcCreateProgram' in found_functions}} - cdef nvrtcResult _nvrtcCreateProgram(nvrtcProgram* prog, const char* src, const char* name, int numHeaders, const char** headers, const char** includeNames) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcDestroyProgram' in found_functions}} - cdef nvrtcResult _nvrtcDestroyProgram(nvrtcProgram* prog) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcCompileProgram' in found_functions}} - cdef nvrtcResult _nvrtcCompileProgram(nvrtcProgram prog, int numOptions, const char** options) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetPTXSize' in found_functions}} - cdef nvrtcResult _nvrtcGetPTXSize(nvrtcProgram prog, size_t* ptxSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetPTX' in found_functions}} - cdef nvrtcResult _nvrtcGetPTX(nvrtcProgram prog, char* ptx) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetCUBINSize' in found_functions}} - cdef nvrtcResult _nvrtcGetCUBINSize(nvrtcProgram prog, size_t* cubinSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetCUBIN' in found_functions}} - cdef nvrtcResult _nvrtcGetCUBIN(nvrtcProgram prog, char* cubin) 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 -{{endif}} - -{{if 'nvrtcGetLTOIR' in found_functions}} - cdef nvrtcResult _nvrtcGetLTOIR(nvrtcProgram prog, char* LTOIR) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetOptiXIRSize' in found_functions}} - cdef nvrtcResult _nvrtcGetOptiXIRSize(nvrtcProgram prog, size_t* optixirSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetOptiXIR' in found_functions}} - cdef nvrtcResult _nvrtcGetOptiXIR(nvrtcProgram prog, char* optixir) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetProgramLogSize' in found_functions}} - cdef nvrtcResult _nvrtcGetProgramLogSize(nvrtcProgram prog, size_t* logSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetProgramLog' in found_functions}} - cdef nvrtcResult _nvrtcGetProgramLog(nvrtcProgram prog, char* log) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcAddNameExpression' in found_functions}} - cdef nvrtcResult _nvrtcAddNameExpression(nvrtcProgram prog, const char* name_expression) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetLoweredName' in found_functions}} - cdef nvrtcResult _nvrtcGetLoweredName(nvrtcProgram prog, const char* name_expression, const char** lowered_name) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetPCHHeapSize' in found_functions}} - cdef nvrtcResult _nvrtcGetPCHHeapSize(size_t* ret) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcSetPCHHeapSize' in found_functions}} - cdef nvrtcResult _nvrtcSetPCHHeapSize(size_t size) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetPCHCreateStatus' in found_functions}} - cdef nvrtcResult _nvrtcGetPCHCreateStatus(nvrtcProgram prog) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetPCHHeapSizeRequired' in found_functions}} - cdef nvrtcResult _nvrtcGetPCHHeapSizeRequired(nvrtcProgram prog, size_t* size) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcSetFlowCallback' in found_functions}} - -cdef nvrtcResult _nvrtcSetFlowCallback(nvrtcProgram prog, void* callback, void* payload) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetTileIRSize' in found_functions}} - +cdef nvrtcResult _nvrtcSetFlowCallback(nvrtcProgram prog, void * callback, void* payload) except ?NVRTC_ERROR_INVALID_INPUT nogil cdef nvrtcResult _nvrtcGetTileIRSize(nvrtcProgram prog, size_t* TileIRSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetTileIR' in found_functions}} - cdef nvrtcResult _nvrtcGetTileIR(nvrtcProgram prog, char* TileIR) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - +cdef nvrtcResult _nvrtcInstallBundledHeaders(const char* installPath, unsigned int flags, const char** errorLog) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult _nvrtcGetBundledHeadersInfo(nvrtcBundledHeadersInfo* info, const char** errorLog) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult _nvrtcRemoveBundledHeaders(const char* installPath, const char** errorLog) except ?NVRTC_ERROR_INVALID_INPUT nogil diff --git a/cuda_bindings/cuda/bindings/_internal/nvrtc_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvrtc_linux.pyx new file mode 100644 index 00000000000..43efa40e4d8 --- /dev/null +++ b/cuda_bindings/cuda/bindings/_internal/nvrtc_linux.pyx @@ -0,0 +1,723 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. + +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=6e54cb56384256b65cc962fbb478f7fac87523f222a141785b66881d8f554c64 +from libc.stdint cimport intptr_t, uintptr_t + +import threading +from .utils import FunctionNotFoundError, NotSupportedError + +from cuda.pathfinder import load_nvidia_dynamic_lib + + +############################################################################### +# Extern +############################################################################### + +# You must 'from .utils import NotSupportedError' before using this template + +cdef extern from "" nogil: + void* dlopen(const char*, int) + char* dlerror() + void* dlsym(void*, const char*) + int dlclose(void*) + + enum: + RTLD_LAZY + RTLD_NOW + RTLD_GLOBAL + RTLD_LOCAL + + 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('Did not find cuDriverGetVersion symbol in libcuda.so.1') + err = (cuDriverGetVersion)(&driver_ver) + if err != 0: + raise RuntimeError(f'cuDriverGetVersion returned error code {err}') + + return driver_ver + + + +############################################################################### +# Wrapper init +############################################################################### + +cdef object __symbol_lock = threading.Lock() +cdef bint __py_nvrtc_init = False + +cdef void* __nvrtcGetErrorString = NULL +cdef void* __nvrtcVersion = NULL +cdef void* __nvrtcGetNumSupportedArchs = NULL +cdef void* __nvrtcGetSupportedArchs = NULL +cdef void* __nvrtcCreateProgram = NULL +cdef void* __nvrtcDestroyProgram = NULL +cdef void* __nvrtcCompileProgram = NULL +cdef void* __nvrtcGetPTXSize = NULL +cdef void* __nvrtcGetPTX = NULL +cdef void* __nvrtcGetCUBINSize = NULL +cdef void* __nvrtcGetCUBIN = NULL +cdef void* __nvrtcGetLTOIRSize = NULL +cdef void* __nvrtcGetLTOIR = NULL +cdef void* __nvrtcGetOptiXIRSize = NULL +cdef void* __nvrtcGetOptiXIR = NULL +cdef void* __nvrtcGetProgramLogSize = NULL +cdef void* __nvrtcGetProgramLog = NULL +cdef void* __nvrtcAddNameExpression = NULL +cdef void* __nvrtcGetLoweredName = NULL +cdef void* __nvrtcGetPCHHeapSize = NULL +cdef void* __nvrtcSetPCHHeapSize = NULL +cdef void* __nvrtcGetPCHCreateStatus = NULL +cdef void* __nvrtcGetPCHHeapSizeRequired = NULL +cdef void* __nvrtcSetFlowCallback = NULL +cdef void* __nvrtcGetTileIRSize = NULL +cdef void* __nvrtcGetTileIR = NULL +cdef void* __nvrtcInstallBundledHeaders = NULL +cdef void* __nvrtcGetBundledHeadersInfo = NULL +cdef void* __nvrtcRemoveBundledHeaders = NULL + + +cdef void* load_library() except* with gil: + cdef uintptr_t handle = load_nvidia_dynamic_lib("nvrtc")._handle_uint + return handle + + +cdef int _init_nvrtc() except -1 nogil: + global __py_nvrtc_init + + cdef void* handle = NULL + + with gil, __symbol_lock: + # Recheck the flag after obtaining the locks + if __py_nvrtc_init: + return 0 + + # Load function + global __nvrtcGetErrorString + __nvrtcGetErrorString = dlsym(RTLD_DEFAULT, 'nvrtcGetErrorString') + if __nvrtcGetErrorString == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetErrorString = dlsym(handle, 'nvrtcGetErrorString') + + global __nvrtcVersion + __nvrtcVersion = dlsym(RTLD_DEFAULT, 'nvrtcVersion') + if __nvrtcVersion == NULL: + if handle == NULL: + handle = load_library() + __nvrtcVersion = dlsym(handle, 'nvrtcVersion') + + global __nvrtcGetNumSupportedArchs + __nvrtcGetNumSupportedArchs = dlsym(RTLD_DEFAULT, 'nvrtcGetNumSupportedArchs') + if __nvrtcGetNumSupportedArchs == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetNumSupportedArchs = dlsym(handle, 'nvrtcGetNumSupportedArchs') + + global __nvrtcGetSupportedArchs + __nvrtcGetSupportedArchs = dlsym(RTLD_DEFAULT, 'nvrtcGetSupportedArchs') + if __nvrtcGetSupportedArchs == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetSupportedArchs = dlsym(handle, 'nvrtcGetSupportedArchs') + + global __nvrtcCreateProgram + __nvrtcCreateProgram = dlsym(RTLD_DEFAULT, 'nvrtcCreateProgram') + if __nvrtcCreateProgram == NULL: + if handle == NULL: + handle = load_library() + __nvrtcCreateProgram = dlsym(handle, 'nvrtcCreateProgram') + + global __nvrtcDestroyProgram + __nvrtcDestroyProgram = dlsym(RTLD_DEFAULT, 'nvrtcDestroyProgram') + if __nvrtcDestroyProgram == NULL: + if handle == NULL: + handle = load_library() + __nvrtcDestroyProgram = dlsym(handle, 'nvrtcDestroyProgram') + + global __nvrtcCompileProgram + __nvrtcCompileProgram = dlsym(RTLD_DEFAULT, 'nvrtcCompileProgram') + if __nvrtcCompileProgram == NULL: + if handle == NULL: + handle = load_library() + __nvrtcCompileProgram = dlsym(handle, 'nvrtcCompileProgram') + + global __nvrtcGetPTXSize + __nvrtcGetPTXSize = dlsym(RTLD_DEFAULT, 'nvrtcGetPTXSize') + if __nvrtcGetPTXSize == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetPTXSize = dlsym(handle, 'nvrtcGetPTXSize') + + global __nvrtcGetPTX + __nvrtcGetPTX = dlsym(RTLD_DEFAULT, 'nvrtcGetPTX') + if __nvrtcGetPTX == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetPTX = dlsym(handle, 'nvrtcGetPTX') + + global __nvrtcGetCUBINSize + __nvrtcGetCUBINSize = dlsym(RTLD_DEFAULT, 'nvrtcGetCUBINSize') + if __nvrtcGetCUBINSize == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetCUBINSize = dlsym(handle, 'nvrtcGetCUBINSize') + + global __nvrtcGetCUBIN + __nvrtcGetCUBIN = dlsym(RTLD_DEFAULT, 'nvrtcGetCUBIN') + if __nvrtcGetCUBIN == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetCUBIN = dlsym(handle, 'nvrtcGetCUBIN') + + global __nvrtcGetLTOIRSize + __nvrtcGetLTOIRSize = dlsym(RTLD_DEFAULT, 'nvrtcGetLTOIRSize') + if __nvrtcGetLTOIRSize == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetLTOIRSize = dlsym(handle, 'nvrtcGetLTOIRSize') + + global __nvrtcGetLTOIR + __nvrtcGetLTOIR = dlsym(RTLD_DEFAULT, 'nvrtcGetLTOIR') + if __nvrtcGetLTOIR == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetLTOIR = dlsym(handle, 'nvrtcGetLTOIR') + + global __nvrtcGetOptiXIRSize + __nvrtcGetOptiXIRSize = dlsym(RTLD_DEFAULT, 'nvrtcGetOptiXIRSize') + if __nvrtcGetOptiXIRSize == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetOptiXIRSize = dlsym(handle, 'nvrtcGetOptiXIRSize') + + global __nvrtcGetOptiXIR + __nvrtcGetOptiXIR = dlsym(RTLD_DEFAULT, 'nvrtcGetOptiXIR') + if __nvrtcGetOptiXIR == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetOptiXIR = dlsym(handle, 'nvrtcGetOptiXIR') + + global __nvrtcGetProgramLogSize + __nvrtcGetProgramLogSize = dlsym(RTLD_DEFAULT, 'nvrtcGetProgramLogSize') + if __nvrtcGetProgramLogSize == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetProgramLogSize = dlsym(handle, 'nvrtcGetProgramLogSize') + + global __nvrtcGetProgramLog + __nvrtcGetProgramLog = dlsym(RTLD_DEFAULT, 'nvrtcGetProgramLog') + if __nvrtcGetProgramLog == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetProgramLog = dlsym(handle, 'nvrtcGetProgramLog') + + global __nvrtcAddNameExpression + __nvrtcAddNameExpression = dlsym(RTLD_DEFAULT, 'nvrtcAddNameExpression') + if __nvrtcAddNameExpression == NULL: + if handle == NULL: + handle = load_library() + __nvrtcAddNameExpression = dlsym(handle, 'nvrtcAddNameExpression') + + global __nvrtcGetLoweredName + __nvrtcGetLoweredName = dlsym(RTLD_DEFAULT, 'nvrtcGetLoweredName') + if __nvrtcGetLoweredName == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetLoweredName = dlsym(handle, 'nvrtcGetLoweredName') + + global __nvrtcGetPCHHeapSize + __nvrtcGetPCHHeapSize = dlsym(RTLD_DEFAULT, 'nvrtcGetPCHHeapSize') + if __nvrtcGetPCHHeapSize == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetPCHHeapSize = dlsym(handle, 'nvrtcGetPCHHeapSize') + + global __nvrtcSetPCHHeapSize + __nvrtcSetPCHHeapSize = dlsym(RTLD_DEFAULT, 'nvrtcSetPCHHeapSize') + if __nvrtcSetPCHHeapSize == NULL: + if handle == NULL: + handle = load_library() + __nvrtcSetPCHHeapSize = dlsym(handle, 'nvrtcSetPCHHeapSize') + + global __nvrtcGetPCHCreateStatus + __nvrtcGetPCHCreateStatus = dlsym(RTLD_DEFAULT, 'nvrtcGetPCHCreateStatus') + if __nvrtcGetPCHCreateStatus == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetPCHCreateStatus = dlsym(handle, 'nvrtcGetPCHCreateStatus') + + global __nvrtcGetPCHHeapSizeRequired + __nvrtcGetPCHHeapSizeRequired = dlsym(RTLD_DEFAULT, 'nvrtcGetPCHHeapSizeRequired') + if __nvrtcGetPCHHeapSizeRequired == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetPCHHeapSizeRequired = dlsym(handle, 'nvrtcGetPCHHeapSizeRequired') + + global __nvrtcSetFlowCallback + __nvrtcSetFlowCallback = dlsym(RTLD_DEFAULT, 'nvrtcSetFlowCallback') + if __nvrtcSetFlowCallback == NULL: + if handle == NULL: + handle = load_library() + __nvrtcSetFlowCallback = dlsym(handle, 'nvrtcSetFlowCallback') + + global __nvrtcGetTileIRSize + __nvrtcGetTileIRSize = dlsym(RTLD_DEFAULT, 'nvrtcGetTileIRSize') + if __nvrtcGetTileIRSize == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetTileIRSize = dlsym(handle, 'nvrtcGetTileIRSize') + + global __nvrtcGetTileIR + __nvrtcGetTileIR = dlsym(RTLD_DEFAULT, 'nvrtcGetTileIR') + if __nvrtcGetTileIR == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetTileIR = dlsym(handle, 'nvrtcGetTileIR') + + global __nvrtcInstallBundledHeaders + __nvrtcInstallBundledHeaders = dlsym(RTLD_DEFAULT, 'nvrtcInstallBundledHeaders') + if __nvrtcInstallBundledHeaders == NULL: + if handle == NULL: + handle = load_library() + __nvrtcInstallBundledHeaders = dlsym(handle, 'nvrtcInstallBundledHeaders') + + global __nvrtcGetBundledHeadersInfo + __nvrtcGetBundledHeadersInfo = dlsym(RTLD_DEFAULT, 'nvrtcGetBundledHeadersInfo') + if __nvrtcGetBundledHeadersInfo == NULL: + if handle == NULL: + handle = load_library() + __nvrtcGetBundledHeadersInfo = dlsym(handle, 'nvrtcGetBundledHeadersInfo') + + global __nvrtcRemoveBundledHeaders + __nvrtcRemoveBundledHeaders = dlsym(RTLD_DEFAULT, 'nvrtcRemoveBundledHeaders') + if __nvrtcRemoveBundledHeaders == NULL: + if handle == NULL: + handle = load_library() + __nvrtcRemoveBundledHeaders = dlsym(handle, 'nvrtcRemoveBundledHeaders') + + __py_nvrtc_init = True + return 0 + + +cdef inline int _check_or_init_nvrtc() except -1 nogil: + if __py_nvrtc_init: + return 0 + + return _init_nvrtc() + +cdef dict func_ptrs = None + + +cpdef dict _inspect_function_pointers(): + global func_ptrs + if func_ptrs is not None: + return func_ptrs + + _check_or_init_nvrtc() + cdef dict data = {} + + global __nvrtcGetErrorString + data["__nvrtcGetErrorString"] = __nvrtcGetErrorString + + global __nvrtcVersion + data["__nvrtcVersion"] = __nvrtcVersion + + global __nvrtcGetNumSupportedArchs + data["__nvrtcGetNumSupportedArchs"] = __nvrtcGetNumSupportedArchs + + global __nvrtcGetSupportedArchs + data["__nvrtcGetSupportedArchs"] = __nvrtcGetSupportedArchs + + global __nvrtcCreateProgram + data["__nvrtcCreateProgram"] = __nvrtcCreateProgram + + global __nvrtcDestroyProgram + data["__nvrtcDestroyProgram"] = __nvrtcDestroyProgram + + global __nvrtcCompileProgram + data["__nvrtcCompileProgram"] = __nvrtcCompileProgram + + global __nvrtcGetPTXSize + data["__nvrtcGetPTXSize"] = __nvrtcGetPTXSize + + global __nvrtcGetPTX + data["__nvrtcGetPTX"] = __nvrtcGetPTX + + global __nvrtcGetCUBINSize + data["__nvrtcGetCUBINSize"] = __nvrtcGetCUBINSize + + global __nvrtcGetCUBIN + data["__nvrtcGetCUBIN"] = __nvrtcGetCUBIN + + global __nvrtcGetLTOIRSize + data["__nvrtcGetLTOIRSize"] = __nvrtcGetLTOIRSize + + global __nvrtcGetLTOIR + data["__nvrtcGetLTOIR"] = __nvrtcGetLTOIR + + global __nvrtcGetOptiXIRSize + data["__nvrtcGetOptiXIRSize"] = __nvrtcGetOptiXIRSize + + global __nvrtcGetOptiXIR + data["__nvrtcGetOptiXIR"] = __nvrtcGetOptiXIR + + global __nvrtcGetProgramLogSize + data["__nvrtcGetProgramLogSize"] = __nvrtcGetProgramLogSize + + global __nvrtcGetProgramLog + data["__nvrtcGetProgramLog"] = __nvrtcGetProgramLog + + global __nvrtcAddNameExpression + data["__nvrtcAddNameExpression"] = __nvrtcAddNameExpression + + global __nvrtcGetLoweredName + data["__nvrtcGetLoweredName"] = __nvrtcGetLoweredName + + global __nvrtcGetPCHHeapSize + data["__nvrtcGetPCHHeapSize"] = __nvrtcGetPCHHeapSize + + global __nvrtcSetPCHHeapSize + data["__nvrtcSetPCHHeapSize"] = __nvrtcSetPCHHeapSize + + global __nvrtcGetPCHCreateStatus + data["__nvrtcGetPCHCreateStatus"] = __nvrtcGetPCHCreateStatus + + global __nvrtcGetPCHHeapSizeRequired + data["__nvrtcGetPCHHeapSizeRequired"] = __nvrtcGetPCHHeapSizeRequired + + global __nvrtcSetFlowCallback + data["__nvrtcSetFlowCallback"] = __nvrtcSetFlowCallback + + global __nvrtcGetTileIRSize + data["__nvrtcGetTileIRSize"] = __nvrtcGetTileIRSize + + global __nvrtcGetTileIR + data["__nvrtcGetTileIR"] = __nvrtcGetTileIR + + global __nvrtcInstallBundledHeaders + data["__nvrtcInstallBundledHeaders"] = __nvrtcInstallBundledHeaders + + global __nvrtcGetBundledHeadersInfo + data["__nvrtcGetBundledHeadersInfo"] = __nvrtcGetBundledHeadersInfo + + global __nvrtcRemoveBundledHeaders + data["__nvrtcRemoveBundledHeaders"] = __nvrtcRemoveBundledHeaders + + func_ptrs = data + return data + + +cpdef _inspect_function_pointer(str name): + global func_ptrs + if func_ptrs is None: + func_ptrs = _inspect_function_pointers() + return func_ptrs[name] + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef const char* _nvrtcGetErrorString(nvrtcResult result) except?NULL nogil: + global __nvrtcGetErrorString + _check_or_init_nvrtc() + if __nvrtcGetErrorString == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetErrorString is not found") + return (__nvrtcGetErrorString)( + result) + + +cdef nvrtcResult _nvrtcVersion(int* major, int* minor) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcVersion + _check_or_init_nvrtc() + if __nvrtcVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcVersion is not found") + return (__nvrtcVersion)( + major, minor) + + +cdef nvrtcResult _nvrtcGetNumSupportedArchs(int* numArchs) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetNumSupportedArchs + _check_or_init_nvrtc() + if __nvrtcGetNumSupportedArchs == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetNumSupportedArchs is not found") + return (__nvrtcGetNumSupportedArchs)( + numArchs) + + +cdef nvrtcResult _nvrtcGetSupportedArchs(int* supportedArchs) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetSupportedArchs + _check_or_init_nvrtc() + if __nvrtcGetSupportedArchs == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetSupportedArchs is not found") + return (__nvrtcGetSupportedArchs)( + supportedArchs) + + +cdef nvrtcResult _nvrtcCreateProgram(nvrtcProgram* prog, const char* src, const char* name, int numHeaders, const char** headers, const char** includeNames) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcCreateProgram + _check_or_init_nvrtc() + if __nvrtcCreateProgram == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcCreateProgram is not found") + return (__nvrtcCreateProgram)( + prog, src, name, numHeaders, headers, includeNames) + + +cdef nvrtcResult _nvrtcDestroyProgram(nvrtcProgram* prog) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcDestroyProgram + _check_or_init_nvrtc() + if __nvrtcDestroyProgram == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcDestroyProgram is not found") + return (__nvrtcDestroyProgram)( + prog) + + +cdef nvrtcResult _nvrtcCompileProgram(nvrtcProgram prog, int numOptions, const char** options) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcCompileProgram + _check_or_init_nvrtc() + if __nvrtcCompileProgram == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcCompileProgram is not found") + return (__nvrtcCompileProgram)( + prog, numOptions, options) + + +cdef nvrtcResult _nvrtcGetPTXSize(nvrtcProgram prog, size_t* ptxSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetPTXSize + _check_or_init_nvrtc() + if __nvrtcGetPTXSize == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetPTXSize is not found") + return (__nvrtcGetPTXSize)( + prog, ptxSizeRet) + + +cdef nvrtcResult _nvrtcGetPTX(nvrtcProgram prog, char* ptx) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetPTX + _check_or_init_nvrtc() + if __nvrtcGetPTX == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetPTX is not found") + return (__nvrtcGetPTX)( + prog, ptx) + + +cdef nvrtcResult _nvrtcGetCUBINSize(nvrtcProgram prog, size_t* cubinSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetCUBINSize + _check_or_init_nvrtc() + if __nvrtcGetCUBINSize == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetCUBINSize is not found") + return (__nvrtcGetCUBINSize)( + prog, cubinSizeRet) + + +cdef nvrtcResult _nvrtcGetCUBIN(nvrtcProgram prog, char* cubin) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetCUBIN + _check_or_init_nvrtc() + if __nvrtcGetCUBIN == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetCUBIN is not found") + return (__nvrtcGetCUBIN)( + prog, cubin) + + +cdef nvrtcResult _nvrtcGetLTOIRSize(nvrtcProgram prog, size_t* LTOIRSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetLTOIRSize + _check_or_init_nvrtc() + if __nvrtcGetLTOIRSize == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetLTOIRSize is not found") + return (__nvrtcGetLTOIRSize)( + prog, LTOIRSizeRet) + + +cdef nvrtcResult _nvrtcGetLTOIR(nvrtcProgram prog, char* LTOIR) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetLTOIR + _check_or_init_nvrtc() + if __nvrtcGetLTOIR == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetLTOIR is not found") + return (__nvrtcGetLTOIR)( + prog, LTOIR) + + +cdef nvrtcResult _nvrtcGetOptiXIRSize(nvrtcProgram prog, size_t* optixirSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetOptiXIRSize + _check_or_init_nvrtc() + if __nvrtcGetOptiXIRSize == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetOptiXIRSize is not found") + return (__nvrtcGetOptiXIRSize)( + prog, optixirSizeRet) + + +cdef nvrtcResult _nvrtcGetOptiXIR(nvrtcProgram prog, char* optixir) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetOptiXIR + _check_or_init_nvrtc() + if __nvrtcGetOptiXIR == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetOptiXIR is not found") + return (__nvrtcGetOptiXIR)( + prog, optixir) + + +cdef nvrtcResult _nvrtcGetProgramLogSize(nvrtcProgram prog, size_t* logSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetProgramLogSize + _check_or_init_nvrtc() + if __nvrtcGetProgramLogSize == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetProgramLogSize is not found") + return (__nvrtcGetProgramLogSize)( + prog, logSizeRet) + + +cdef nvrtcResult _nvrtcGetProgramLog(nvrtcProgram prog, char* log) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetProgramLog + _check_or_init_nvrtc() + if __nvrtcGetProgramLog == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetProgramLog is not found") + return (__nvrtcGetProgramLog)( + prog, log) + + +cdef nvrtcResult _nvrtcAddNameExpression(nvrtcProgram prog, const char* name_expression) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcAddNameExpression + _check_or_init_nvrtc() + if __nvrtcAddNameExpression == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcAddNameExpression is not found") + return (__nvrtcAddNameExpression)( + prog, name_expression) + + +cdef nvrtcResult _nvrtcGetLoweredName(nvrtcProgram prog, const char* name_expression, const char** lowered_name) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetLoweredName + _check_or_init_nvrtc() + if __nvrtcGetLoweredName == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetLoweredName is not found") + return (__nvrtcGetLoweredName)( + prog, name_expression, lowered_name) + + +cdef nvrtcResult _nvrtcGetPCHHeapSize(size_t* ret) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetPCHHeapSize + _check_or_init_nvrtc() + if __nvrtcGetPCHHeapSize == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetPCHHeapSize is not found") + return (__nvrtcGetPCHHeapSize)( + ret) + + +cdef nvrtcResult _nvrtcSetPCHHeapSize(size_t size) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcSetPCHHeapSize + _check_or_init_nvrtc() + if __nvrtcSetPCHHeapSize == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcSetPCHHeapSize is not found") + return (__nvrtcSetPCHHeapSize)( + size) + + +cdef nvrtcResult _nvrtcGetPCHCreateStatus(nvrtcProgram prog) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetPCHCreateStatus + _check_or_init_nvrtc() + if __nvrtcGetPCHCreateStatus == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetPCHCreateStatus is not found") + return (__nvrtcGetPCHCreateStatus)( + prog) + + +cdef nvrtcResult _nvrtcGetPCHHeapSizeRequired(nvrtcProgram prog, size_t* size) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetPCHHeapSizeRequired + _check_or_init_nvrtc() + if __nvrtcGetPCHHeapSizeRequired == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetPCHHeapSizeRequired is not found") + return (__nvrtcGetPCHHeapSizeRequired)( + prog, size) + + +cdef nvrtcResult _nvrtcSetFlowCallback(nvrtcProgram prog, void * callback, void* payload) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcSetFlowCallback + _check_or_init_nvrtc() + if __nvrtcSetFlowCallback == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcSetFlowCallback is not found") + return (__nvrtcSetFlowCallback)( + prog, callback, payload) + + +cdef nvrtcResult _nvrtcGetTileIRSize(nvrtcProgram prog, size_t* TileIRSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetTileIRSize + _check_or_init_nvrtc() + if __nvrtcGetTileIRSize == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetTileIRSize is not found") + return (__nvrtcGetTileIRSize)( + prog, TileIRSizeRet) + + +cdef nvrtcResult _nvrtcGetTileIR(nvrtcProgram prog, char* TileIR) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetTileIR + _check_or_init_nvrtc() + if __nvrtcGetTileIR == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetTileIR is not found") + return (__nvrtcGetTileIR)( + prog, TileIR) + + +cdef nvrtcResult _nvrtcInstallBundledHeaders(const char* installPath, unsigned int flags, const char** errorLog) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcInstallBundledHeaders + _check_or_init_nvrtc() + if __nvrtcInstallBundledHeaders == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcInstallBundledHeaders is not found") + return (__nvrtcInstallBundledHeaders)( + installPath, flags, errorLog) + + +cdef nvrtcResult _nvrtcGetBundledHeadersInfo(nvrtcBundledHeadersInfo* info, const char** errorLog) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetBundledHeadersInfo + _check_or_init_nvrtc() + if __nvrtcGetBundledHeadersInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetBundledHeadersInfo is not found") + return (__nvrtcGetBundledHeadersInfo)( + info, errorLog) + + +cdef nvrtcResult _nvrtcRemoveBundledHeaders(const char* installPath, const char** errorLog) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcRemoveBundledHeaders + _check_or_init_nvrtc() + if __nvrtcRemoveBundledHeaders == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcRemoveBundledHeaders is not found") + return (__nvrtcRemoveBundledHeaders)( + installPath, errorLog) diff --git a/cuda_bindings/cuda/bindings/_internal/nvrtc_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvrtc_windows.pyx new file mode 100644 index 00000000000..2aef3b145d4 --- /dev/null +++ b/cuda_bindings/cuda/bindings/_internal/nvrtc_windows.pyx @@ -0,0 +1,621 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. + +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=7e496ceaaaf75ed29455bb670e3b3af9ab7d4ba1ea155a129088c04aab9b3c16 +from libc.stdint cimport intptr_t + +import threading +from .utils import FunctionNotFoundError, NotSupportedError + +from cuda.pathfinder import load_nvidia_dynamic_lib + +from libc.stddef cimport wchar_t +from libc.stdint cimport uintptr_t +from cpython cimport PyUnicode_AsWideCharString, PyMem_Free + +# You must 'from .utils import NotSupportedError' before using this template + +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('Did not find cuDriverGetVersion symbol in nvcuda.dll') + err = (cuDriverGetVersion)(&driver_ver) + if err != 0: + raise RuntimeError(f'cuDriverGetVersion returned error code {err}') + + return driver_ver + + + +############################################################################### +# Wrapper init +############################################################################### + +cdef object __symbol_lock = threading.Lock() +cdef bint __py_nvrtc_init = False + +cdef void* __nvrtcGetErrorString = NULL +cdef void* __nvrtcVersion = NULL +cdef void* __nvrtcGetNumSupportedArchs = NULL +cdef void* __nvrtcGetSupportedArchs = NULL +cdef void* __nvrtcCreateProgram = NULL +cdef void* __nvrtcDestroyProgram = NULL +cdef void* __nvrtcCompileProgram = NULL +cdef void* __nvrtcGetPTXSize = NULL +cdef void* __nvrtcGetPTX = NULL +cdef void* __nvrtcGetCUBINSize = NULL +cdef void* __nvrtcGetCUBIN = NULL +cdef void* __nvrtcGetLTOIRSize = NULL +cdef void* __nvrtcGetLTOIR = NULL +cdef void* __nvrtcGetOptiXIRSize = NULL +cdef void* __nvrtcGetOptiXIR = NULL +cdef void* __nvrtcGetProgramLogSize = NULL +cdef void* __nvrtcGetProgramLog = NULL +cdef void* __nvrtcAddNameExpression = NULL +cdef void* __nvrtcGetLoweredName = NULL +cdef void* __nvrtcGetPCHHeapSize = NULL +cdef void* __nvrtcSetPCHHeapSize = NULL +cdef void* __nvrtcGetPCHCreateStatus = NULL +cdef void* __nvrtcGetPCHHeapSizeRequired = NULL +cdef void* __nvrtcSetFlowCallback = NULL +cdef void* __nvrtcGetTileIRSize = NULL +cdef void* __nvrtcGetTileIR = NULL +cdef void* __nvrtcInstallBundledHeaders = NULL +cdef void* __nvrtcGetBundledHeadersInfo = NULL +cdef void* __nvrtcRemoveBundledHeaders = NULL + + +cdef int _init_nvrtc() except -1 nogil: + global __py_nvrtc_init + + with gil, __symbol_lock: + # Recheck the flag after obtaining the locks + if __py_nvrtc_init: + return 0 + + # Load library + handle = load_nvidia_dynamic_lib("nvrtc")._handle_uint + + # Load function + global __nvrtcGetErrorString + __nvrtcGetErrorString = GetProcAddress(handle, 'nvrtcGetErrorString') + + global __nvrtcVersion + __nvrtcVersion = GetProcAddress(handle, 'nvrtcVersion') + + global __nvrtcGetNumSupportedArchs + __nvrtcGetNumSupportedArchs = GetProcAddress(handle, 'nvrtcGetNumSupportedArchs') + + global __nvrtcGetSupportedArchs + __nvrtcGetSupportedArchs = GetProcAddress(handle, 'nvrtcGetSupportedArchs') + + global __nvrtcCreateProgram + __nvrtcCreateProgram = GetProcAddress(handle, 'nvrtcCreateProgram') + + global __nvrtcDestroyProgram + __nvrtcDestroyProgram = GetProcAddress(handle, 'nvrtcDestroyProgram') + + global __nvrtcCompileProgram + __nvrtcCompileProgram = GetProcAddress(handle, 'nvrtcCompileProgram') + + global __nvrtcGetPTXSize + __nvrtcGetPTXSize = GetProcAddress(handle, 'nvrtcGetPTXSize') + + global __nvrtcGetPTX + __nvrtcGetPTX = GetProcAddress(handle, 'nvrtcGetPTX') + + global __nvrtcGetCUBINSize + __nvrtcGetCUBINSize = GetProcAddress(handle, 'nvrtcGetCUBINSize') + + global __nvrtcGetCUBIN + __nvrtcGetCUBIN = GetProcAddress(handle, 'nvrtcGetCUBIN') + + global __nvrtcGetLTOIRSize + __nvrtcGetLTOIRSize = GetProcAddress(handle, 'nvrtcGetLTOIRSize') + + global __nvrtcGetLTOIR + __nvrtcGetLTOIR = GetProcAddress(handle, 'nvrtcGetLTOIR') + + global __nvrtcGetOptiXIRSize + __nvrtcGetOptiXIRSize = GetProcAddress(handle, 'nvrtcGetOptiXIRSize') + + global __nvrtcGetOptiXIR + __nvrtcGetOptiXIR = GetProcAddress(handle, 'nvrtcGetOptiXIR') + + global __nvrtcGetProgramLogSize + __nvrtcGetProgramLogSize = GetProcAddress(handle, 'nvrtcGetProgramLogSize') + + global __nvrtcGetProgramLog + __nvrtcGetProgramLog = GetProcAddress(handle, 'nvrtcGetProgramLog') + + global __nvrtcAddNameExpression + __nvrtcAddNameExpression = GetProcAddress(handle, 'nvrtcAddNameExpression') + + global __nvrtcGetLoweredName + __nvrtcGetLoweredName = GetProcAddress(handle, 'nvrtcGetLoweredName') + + global __nvrtcGetPCHHeapSize + __nvrtcGetPCHHeapSize = GetProcAddress(handle, 'nvrtcGetPCHHeapSize') + + global __nvrtcSetPCHHeapSize + __nvrtcSetPCHHeapSize = GetProcAddress(handle, 'nvrtcSetPCHHeapSize') + + global __nvrtcGetPCHCreateStatus + __nvrtcGetPCHCreateStatus = GetProcAddress(handle, 'nvrtcGetPCHCreateStatus') + + global __nvrtcGetPCHHeapSizeRequired + __nvrtcGetPCHHeapSizeRequired = GetProcAddress(handle, 'nvrtcGetPCHHeapSizeRequired') + + global __nvrtcSetFlowCallback + __nvrtcSetFlowCallback = GetProcAddress(handle, 'nvrtcSetFlowCallback') + + global __nvrtcGetTileIRSize + __nvrtcGetTileIRSize = GetProcAddress(handle, 'nvrtcGetTileIRSize') + + global __nvrtcGetTileIR + __nvrtcGetTileIR = GetProcAddress(handle, 'nvrtcGetTileIR') + + global __nvrtcInstallBundledHeaders + __nvrtcInstallBundledHeaders = GetProcAddress(handle, 'nvrtcInstallBundledHeaders') + + global __nvrtcGetBundledHeadersInfo + __nvrtcGetBundledHeadersInfo = GetProcAddress(handle, 'nvrtcGetBundledHeadersInfo') + + global __nvrtcRemoveBundledHeaders + __nvrtcRemoveBundledHeaders = GetProcAddress(handle, 'nvrtcRemoveBundledHeaders') + + __py_nvrtc_init = True + return 0 + + +cdef inline int _check_or_init_nvrtc() except -1 nogil: + if __py_nvrtc_init: + return 0 + + return _init_nvrtc() + +cdef dict func_ptrs = None + + +cpdef dict _inspect_function_pointers(): + global func_ptrs + if func_ptrs is not None: + return func_ptrs + + _check_or_init_nvrtc() + cdef dict data = {} + + global __nvrtcGetErrorString + data["__nvrtcGetErrorString"] = __nvrtcGetErrorString + + global __nvrtcVersion + data["__nvrtcVersion"] = __nvrtcVersion + + global __nvrtcGetNumSupportedArchs + data["__nvrtcGetNumSupportedArchs"] = __nvrtcGetNumSupportedArchs + + global __nvrtcGetSupportedArchs + data["__nvrtcGetSupportedArchs"] = __nvrtcGetSupportedArchs + + global __nvrtcCreateProgram + data["__nvrtcCreateProgram"] = __nvrtcCreateProgram + + global __nvrtcDestroyProgram + data["__nvrtcDestroyProgram"] = __nvrtcDestroyProgram + + global __nvrtcCompileProgram + data["__nvrtcCompileProgram"] = __nvrtcCompileProgram + + global __nvrtcGetPTXSize + data["__nvrtcGetPTXSize"] = __nvrtcGetPTXSize + + global __nvrtcGetPTX + data["__nvrtcGetPTX"] = __nvrtcGetPTX + + global __nvrtcGetCUBINSize + data["__nvrtcGetCUBINSize"] = __nvrtcGetCUBINSize + + global __nvrtcGetCUBIN + data["__nvrtcGetCUBIN"] = __nvrtcGetCUBIN + + global __nvrtcGetLTOIRSize + data["__nvrtcGetLTOIRSize"] = __nvrtcGetLTOIRSize + + global __nvrtcGetLTOIR + data["__nvrtcGetLTOIR"] = __nvrtcGetLTOIR + + global __nvrtcGetOptiXIRSize + data["__nvrtcGetOptiXIRSize"] = __nvrtcGetOptiXIRSize + + global __nvrtcGetOptiXIR + data["__nvrtcGetOptiXIR"] = __nvrtcGetOptiXIR + + global __nvrtcGetProgramLogSize + data["__nvrtcGetProgramLogSize"] = __nvrtcGetProgramLogSize + + global __nvrtcGetProgramLog + data["__nvrtcGetProgramLog"] = __nvrtcGetProgramLog + + global __nvrtcAddNameExpression + data["__nvrtcAddNameExpression"] = __nvrtcAddNameExpression + + global __nvrtcGetLoweredName + data["__nvrtcGetLoweredName"] = __nvrtcGetLoweredName + + global __nvrtcGetPCHHeapSize + data["__nvrtcGetPCHHeapSize"] = __nvrtcGetPCHHeapSize + + global __nvrtcSetPCHHeapSize + data["__nvrtcSetPCHHeapSize"] = __nvrtcSetPCHHeapSize + + global __nvrtcGetPCHCreateStatus + data["__nvrtcGetPCHCreateStatus"] = __nvrtcGetPCHCreateStatus + + global __nvrtcGetPCHHeapSizeRequired + data["__nvrtcGetPCHHeapSizeRequired"] = __nvrtcGetPCHHeapSizeRequired + + global __nvrtcSetFlowCallback + data["__nvrtcSetFlowCallback"] = __nvrtcSetFlowCallback + + global __nvrtcGetTileIRSize + data["__nvrtcGetTileIRSize"] = __nvrtcGetTileIRSize + + global __nvrtcGetTileIR + data["__nvrtcGetTileIR"] = __nvrtcGetTileIR + + global __nvrtcInstallBundledHeaders + data["__nvrtcInstallBundledHeaders"] = __nvrtcInstallBundledHeaders + + global __nvrtcGetBundledHeadersInfo + data["__nvrtcGetBundledHeadersInfo"] = __nvrtcGetBundledHeadersInfo + + global __nvrtcRemoveBundledHeaders + data["__nvrtcRemoveBundledHeaders"] = __nvrtcRemoveBundledHeaders + + func_ptrs = data + return data + + +cpdef _inspect_function_pointer(str name): + global func_ptrs + if func_ptrs is None: + func_ptrs = _inspect_function_pointers() + return func_ptrs[name] + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef const char* _nvrtcGetErrorString(nvrtcResult result) except?NULL nogil: + global __nvrtcGetErrorString + _check_or_init_nvrtc() + if __nvrtcGetErrorString == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetErrorString is not found") + return (__nvrtcGetErrorString)( + result) + + +cdef nvrtcResult _nvrtcVersion(int* major, int* minor) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcVersion + _check_or_init_nvrtc() + if __nvrtcVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcVersion is not found") + return (__nvrtcVersion)( + major, minor) + + +cdef nvrtcResult _nvrtcGetNumSupportedArchs(int* numArchs) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetNumSupportedArchs + _check_or_init_nvrtc() + if __nvrtcGetNumSupportedArchs == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetNumSupportedArchs is not found") + return (__nvrtcGetNumSupportedArchs)( + numArchs) + + +cdef nvrtcResult _nvrtcGetSupportedArchs(int* supportedArchs) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetSupportedArchs + _check_or_init_nvrtc() + if __nvrtcGetSupportedArchs == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetSupportedArchs is not found") + return (__nvrtcGetSupportedArchs)( + supportedArchs) + + +cdef nvrtcResult _nvrtcCreateProgram(nvrtcProgram* prog, const char* src, const char* name, int numHeaders, const char** headers, const char** includeNames) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcCreateProgram + _check_or_init_nvrtc() + if __nvrtcCreateProgram == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcCreateProgram is not found") + return (__nvrtcCreateProgram)( + prog, src, name, numHeaders, headers, includeNames) + + +cdef nvrtcResult _nvrtcDestroyProgram(nvrtcProgram* prog) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcDestroyProgram + _check_or_init_nvrtc() + if __nvrtcDestroyProgram == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcDestroyProgram is not found") + return (__nvrtcDestroyProgram)( + prog) + + +cdef nvrtcResult _nvrtcCompileProgram(nvrtcProgram prog, int numOptions, const char** options) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcCompileProgram + _check_or_init_nvrtc() + if __nvrtcCompileProgram == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcCompileProgram is not found") + return (__nvrtcCompileProgram)( + prog, numOptions, options) + + +cdef nvrtcResult _nvrtcGetPTXSize(nvrtcProgram prog, size_t* ptxSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetPTXSize + _check_or_init_nvrtc() + if __nvrtcGetPTXSize == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetPTXSize is not found") + return (__nvrtcGetPTXSize)( + prog, ptxSizeRet) + + +cdef nvrtcResult _nvrtcGetPTX(nvrtcProgram prog, char* ptx) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetPTX + _check_or_init_nvrtc() + if __nvrtcGetPTX == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetPTX is not found") + return (__nvrtcGetPTX)( + prog, ptx) + + +cdef nvrtcResult _nvrtcGetCUBINSize(nvrtcProgram prog, size_t* cubinSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetCUBINSize + _check_or_init_nvrtc() + if __nvrtcGetCUBINSize == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetCUBINSize is not found") + return (__nvrtcGetCUBINSize)( + prog, cubinSizeRet) + + +cdef nvrtcResult _nvrtcGetCUBIN(nvrtcProgram prog, char* cubin) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetCUBIN + _check_or_init_nvrtc() + if __nvrtcGetCUBIN == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetCUBIN is not found") + return (__nvrtcGetCUBIN)( + prog, cubin) + + +cdef nvrtcResult _nvrtcGetLTOIRSize(nvrtcProgram prog, size_t* LTOIRSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetLTOIRSize + _check_or_init_nvrtc() + if __nvrtcGetLTOIRSize == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetLTOIRSize is not found") + return (__nvrtcGetLTOIRSize)( + prog, LTOIRSizeRet) + + +cdef nvrtcResult _nvrtcGetLTOIR(nvrtcProgram prog, char* LTOIR) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetLTOIR + _check_or_init_nvrtc() + if __nvrtcGetLTOIR == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetLTOIR is not found") + return (__nvrtcGetLTOIR)( + prog, LTOIR) + + +cdef nvrtcResult _nvrtcGetOptiXIRSize(nvrtcProgram prog, size_t* optixirSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetOptiXIRSize + _check_or_init_nvrtc() + if __nvrtcGetOptiXIRSize == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetOptiXIRSize is not found") + return (__nvrtcGetOptiXIRSize)( + prog, optixirSizeRet) + + +cdef nvrtcResult _nvrtcGetOptiXIR(nvrtcProgram prog, char* optixir) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetOptiXIR + _check_or_init_nvrtc() + if __nvrtcGetOptiXIR == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetOptiXIR is not found") + return (__nvrtcGetOptiXIR)( + prog, optixir) + + +cdef nvrtcResult _nvrtcGetProgramLogSize(nvrtcProgram prog, size_t* logSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetProgramLogSize + _check_or_init_nvrtc() + if __nvrtcGetProgramLogSize == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetProgramLogSize is not found") + return (__nvrtcGetProgramLogSize)( + prog, logSizeRet) + + +cdef nvrtcResult _nvrtcGetProgramLog(nvrtcProgram prog, char* log) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetProgramLog + _check_or_init_nvrtc() + if __nvrtcGetProgramLog == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetProgramLog is not found") + return (__nvrtcGetProgramLog)( + prog, log) + + +cdef nvrtcResult _nvrtcAddNameExpression(nvrtcProgram prog, const char* name_expression) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcAddNameExpression + _check_or_init_nvrtc() + if __nvrtcAddNameExpression == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcAddNameExpression is not found") + return (__nvrtcAddNameExpression)( + prog, name_expression) + + +cdef nvrtcResult _nvrtcGetLoweredName(nvrtcProgram prog, const char* name_expression, const char** lowered_name) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetLoweredName + _check_or_init_nvrtc() + if __nvrtcGetLoweredName == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetLoweredName is not found") + return (__nvrtcGetLoweredName)( + prog, name_expression, lowered_name) + + +cdef nvrtcResult _nvrtcGetPCHHeapSize(size_t* ret) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetPCHHeapSize + _check_or_init_nvrtc() + if __nvrtcGetPCHHeapSize == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetPCHHeapSize is not found") + return (__nvrtcGetPCHHeapSize)( + ret) + + +cdef nvrtcResult _nvrtcSetPCHHeapSize(size_t size) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcSetPCHHeapSize + _check_or_init_nvrtc() + if __nvrtcSetPCHHeapSize == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcSetPCHHeapSize is not found") + return (__nvrtcSetPCHHeapSize)( + size) + + +cdef nvrtcResult _nvrtcGetPCHCreateStatus(nvrtcProgram prog) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetPCHCreateStatus + _check_or_init_nvrtc() + if __nvrtcGetPCHCreateStatus == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetPCHCreateStatus is not found") + return (__nvrtcGetPCHCreateStatus)( + prog) + + +cdef nvrtcResult _nvrtcGetPCHHeapSizeRequired(nvrtcProgram prog, size_t* size) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetPCHHeapSizeRequired + _check_or_init_nvrtc() + if __nvrtcGetPCHHeapSizeRequired == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetPCHHeapSizeRequired is not found") + return (__nvrtcGetPCHHeapSizeRequired)( + prog, size) + + +cdef nvrtcResult _nvrtcSetFlowCallback(nvrtcProgram prog, void * callback, void* payload) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcSetFlowCallback + _check_or_init_nvrtc() + if __nvrtcSetFlowCallback == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcSetFlowCallback is not found") + return (__nvrtcSetFlowCallback)( + prog, callback, payload) + + +cdef nvrtcResult _nvrtcGetTileIRSize(nvrtcProgram prog, size_t* TileIRSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetTileIRSize + _check_or_init_nvrtc() + if __nvrtcGetTileIRSize == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetTileIRSize is not found") + return (__nvrtcGetTileIRSize)( + prog, TileIRSizeRet) + + +cdef nvrtcResult _nvrtcGetTileIR(nvrtcProgram prog, char* TileIR) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetTileIR + _check_or_init_nvrtc() + if __nvrtcGetTileIR == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetTileIR is not found") + return (__nvrtcGetTileIR)( + prog, TileIR) + + +cdef nvrtcResult _nvrtcInstallBundledHeaders(const char* installPath, unsigned int flags, const char** errorLog) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcInstallBundledHeaders + _check_or_init_nvrtc() + if __nvrtcInstallBundledHeaders == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcInstallBundledHeaders is not found") + return (__nvrtcInstallBundledHeaders)( + installPath, flags, errorLog) + + +cdef nvrtcResult _nvrtcGetBundledHeadersInfo(nvrtcBundledHeadersInfo* info, const char** errorLog) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcGetBundledHeadersInfo + _check_or_init_nvrtc() + if __nvrtcGetBundledHeadersInfo == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcGetBundledHeadersInfo is not found") + return (__nvrtcGetBundledHeadersInfo)( + info, errorLog) + + +cdef nvrtcResult _nvrtcRemoveBundledHeaders(const char* installPath, const char** errorLog) except ?NVRTC_ERROR_INVALID_INPUT nogil: + global __nvrtcRemoveBundledHeaders + _check_or_init_nvrtc() + if __nvrtcRemoveBundledHeaders == NULL: + with gil: + raise FunctionNotFoundError("function nvrtcRemoveBundledHeaders is not found") + return (__nvrtcRemoveBundledHeaders)( + installPath, errorLog) diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm.pxd b/cuda_bindings/cuda/bindings/_internal/nvvm.pxd index 23427edd9b6..e4ac3cf1258 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm.pxd +++ b/cuda_bindings/cuda/bindings/_internal/nvvm.pxd @@ -1,9 +1,10 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a27b041eb470b98bf5b1a0a92ace9467c5f3921d47ee10557a4f00ff1e4ac411 from ..cynvvm cimport * @@ -24,3 +25,4 @@ cdef nvvmResult _nvvmGetCompiledResultSize(nvvmProgram prog, size_t* bufferSizeR cdef nvvmResult _nvvmGetCompiledResult(nvvmProgram prog, char* buffer) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil cdef nvvmResult _nvvmGetProgramLogSize(nvvmProgram prog, size_t* bufferSizeRet) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil cdef nvvmResult _nvvmGetProgramLog(nvvmProgram prog, char* buffer) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult _nvvmLLVMVersion(const char* arch, int* major) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx index 8a84834a9ac..d4cd73399a4 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx @@ -1,9 +1,10 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=3c31adc68b8220439ea196a56ea63cf670aff0f85c0a67c8f554e1af4d07f456 from libc.stdint cimport intptr_t, uintptr_t import threading @@ -72,6 +73,7 @@ cdef void* __nvvmGetCompiledResultSize = NULL cdef void* __nvvmGetCompiledResult = NULL cdef void* __nvvmGetProgramLogSize = NULL cdef void* __nvvmGetProgramLog = NULL +cdef void* __nvvmLLVMVersion = NULL cdef void* load_library() except* with gil: @@ -181,6 +183,13 @@ cdef int _init_nvvm() except -1 nogil: handle = load_library() __nvvmGetProgramLog = dlsym(handle, 'nvvmGetProgramLog') + global __nvvmLLVMVersion + __nvvmLLVMVersion = dlsym(RTLD_DEFAULT, 'nvvmLLVMVersion') + if __nvvmLLVMVersion == NULL: + if handle == NULL: + handle = load_library() + __nvvmLLVMVersion = dlsym(handle, 'nvvmLLVMVersion') + __py_nvvm_init = True return 0 @@ -242,6 +251,9 @@ cpdef dict _inspect_function_pointers(): global __nvvmGetProgramLog data["__nvvmGetProgramLog"] = __nvvmGetProgramLog + global __nvvmLLVMVersion + data["__nvvmLLVMVersion"] = __nvvmLLVMVersion + func_ptrs = data return data @@ -385,3 +397,13 @@ cdef nvvmResult _nvvmGetProgramLog(nvvmProgram prog, char* buffer) except?_NVVMR raise FunctionNotFoundError("function nvvmGetProgramLog is not found") return (__nvvmGetProgramLog)( prog, buffer) + + +cdef nvvmResult _nvvmLLVMVersion(const char* arch, int* major) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmLLVMVersion + _check_or_init_nvvm() + if __nvvmLLVMVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvvmLLVMVersion is not found") + return (__nvvmLLVMVersion)( + arch, major) diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx index e029521b2f9..25b9d1cc674 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx @@ -1,9 +1,10 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=49ccc5908d39ebb526fee704591480550b5f780c05f14366531360e3ec2ac17a from libc.stdint cimport intptr_t import threading @@ -90,6 +91,7 @@ cdef void* __nvvmGetCompiledResultSize = NULL cdef void* __nvvmGetCompiledResult = NULL cdef void* __nvvmGetProgramLogSize = NULL cdef void* __nvvmGetProgramLog = NULL +cdef void* __nvvmLLVMVersion = NULL cdef int _init_nvvm() except -1 nogil: @@ -143,6 +145,9 @@ cdef int _init_nvvm() except -1 nogil: global __nvvmGetProgramLog __nvvmGetProgramLog = GetProcAddress(handle, 'nvvmGetProgramLog') + global __nvvmLLVMVersion + __nvvmLLVMVersion = GetProcAddress(handle, 'nvvmLLVMVersion') + __py_nvvm_init = True return 0 @@ -204,6 +209,9 @@ cpdef dict _inspect_function_pointers(): global __nvvmGetProgramLog data["__nvvmGetProgramLog"] = __nvvmGetProgramLog + global __nvvmLLVMVersion + data["__nvvmLLVMVersion"] = __nvvmLLVMVersion + func_ptrs = data return data @@ -347,3 +355,13 @@ cdef nvvmResult _nvvmGetProgramLog(nvvmProgram prog, char* buffer) except?_NVVMR raise FunctionNotFoundError("function nvvmGetProgramLog is not found") return (__nvvmGetProgramLog)( prog, buffer) + + +cdef nvvmResult _nvvmLLVMVersion(const char* arch, int* major) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + global __nvvmLLVMVersion + _check_or_init_nvvm() + if __nvvmLLVMVersion == NULL: + with gil: + raise FunctionNotFoundError("function nvvmLLVMVersion is not found") + return (__nvvmLLVMVersion)( + arch, major) diff --git a/cuda_bindings/cuda/bindings/_internal/utils.pxd b/cuda_bindings/cuda/bindings/_internal/utils.pxd index 50484727b7a..f4a76de327e 100644 --- a/cuda_bindings/cuda/bindings/_internal/utils.pxd +++ b/cuda_bindings/cuda/bindings/_internal/utils.pxd @@ -1,6 +1,6 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 from libc.stdint cimport int32_t, int64_t, intptr_t from libcpp.vector cimport vector diff --git a/cuda_bindings/cuda/bindings/_internal/utils.pyx b/cuda_bindings/cuda/bindings/_internal/utils.pyx index a56ef35357b..a5931f1f080 100644 --- a/cuda_bindings/cuda/bindings/_internal/utils.pyx +++ b/cuda_bindings/cuda/bindings/_internal/utils.pyx @@ -1,6 +1,6 @@ # SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 cimport cpython from libc.stdint cimport intptr_t @@ -120,7 +120,14 @@ cdef int get_nested_resource_ptr(nested_resource[ResT] &in_out_ptr, object obj, nested_ptr.reset(nested_vec, True) for i, obj_i in enumerate(obj): if ResT is char: - obj_i_bytes = ((obj_i)).encode() + obj_i_type = type(obj_i) + if obj_i_type is str: + obj_i_bytes = obj_i.encode("utf-8") + elif obj_i_type is bytes: + obj_i_bytes = obj_i + else: + raise TypeError( + f"Expected str or bytes, got {obj_i_type.__name__}") str_len = (len(obj_i_bytes)) + 1 # including null termination deref(nested_res_vec)[i].resize(str_len) obj_i_ptr = (obj_i_bytes) diff --git a/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd b/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd index 48f87f29caf..482f91ca595 100644 --- a/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd +++ b/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd @@ -1,8 +1,8 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 cimport cuda.bindings.cyruntime as cyruntime -cimport cuda.bindings._bindings.cydriver as _cydriver +cimport cuda.bindings._internal.driver 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 diff --git a/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxi b/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxi index c18bd1ca2ea..5a7e5e42bd4 100644 --- a/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxi +++ b/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxi @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 # 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 @@ -13,7 +13,7 @@ # 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._internal.driver as cydriver cdef cudaError_t _cudaEGLStreamProducerPresentFrame(cyruntime.cudaEglStreamConnection* conn, cyruntime.cudaEglFrame eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: cdef cudaError_t err = cudaSuccess @@ -25,7 +25,7 @@ cdef cudaError_t _cudaEGLStreamProducerPresentFrame(cyruntime.cudaEglStreamConne err = getDriverEglFrame(&cueglFrame, eglframe) if err != cudaSuccess: return err - err = cydriver._cuEGLStreamProducerPresentFrame(conn, cueglFrame, pStream) + err = cydriver._cuEGLStreamProducerPresentFrame(conn, cueglFrame, pStream) return err cdef cudaError_t _cudaEGLStreamProducerReturnFrame(cyruntime.cudaEglStreamConnection* conn, cyruntime.cudaEglFrame* eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: @@ -38,7 +38,7 @@ cdef cudaError_t _cudaEGLStreamProducerReturnFrame(cyruntime.cudaEglStreamConnec err = cudaErrorInvalidResourceHandle return err cdef cydriver.CUeglFrame cueglFrame - err = cydriver._cuEGLStreamProducerReturnFrame(conn, &cueglFrame, pStream) + err = cydriver._cuEGLStreamProducerReturnFrame(conn, &cueglFrame, pStream) if err != cudaSuccess: return err err = getRuntimeEglFrame(eglframe, cueglFrame) diff --git a/cuda_bindings/cuda/bindings/_lib/dlfcn.pxd b/cuda_bindings/cuda/bindings/_lib/dlfcn.pxd index 2ae95814396..23fbe256484 100644 --- a/cuda_bindings/cuda/bindings/_lib/dlfcn.pxd +++ b/cuda_bindings/cuda/bindings/_lib/dlfcn.pxd @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 cdef extern from "" nogil: void *dlopen(const char *, int) diff --git a/cuda_bindings/cuda/bindings/_lib/param_packer.h b/cuda_bindings/cuda/bindings/_lib/param_packer.h index 96c56b4fe4e..160ef5f7c92 100644 --- a/cuda_bindings/cuda/bindings/_lib/param_packer.h +++ b/cuda_bindings/cuda/bindings/_lib/param_packer.h @@ -1,11 +1,5 @@ -// 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. +// SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 #include diff --git a/cuda_bindings/cuda/bindings/_lib/param_packer.pxd b/cuda_bindings/cuda/bindings/_lib/param_packer.pxd index ad7fd95668f..1c0ad690be4 100644 --- a/cuda_bindings/cuda/bindings/_lib/param_packer.pxd +++ b/cuda_bindings/cuda/bindings/_lib/param_packer.pxd @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 # Include "param_packer.h" so its contents get compiled into every # Cython extension module that depends on param_packer.pxd. diff --git a/cuda_bindings/cuda/bindings/_lib/utils.pxd.in b/cuda_bindings/cuda/bindings/_lib/utils.pxd similarity index 83% rename from cuda_bindings/cuda/bindings/_lib/utils.pxd.in rename to cuda_bindings/cuda/bindings/_lib/utils.pxd index 353a07a09c4..24b0ae8de93 100644 --- a/cuda_bindings/cuda/bindings/_lib/utils.pxd.in +++ b/cuda_bindings/cuda/bindings/_lib/utils.pxd @@ -1,5 +1,5 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 cimport cuda.bindings.driver as driver cimport cuda.bindings.cydriver as cydriver @@ -19,7 +19,7 @@ cdef struct _HelperInputVoidPtrStruct: Py_buffer _pybuffer cdef class _HelperInputVoidPtr: - cdef _HelperInputVoidPtrStruct _helper + cdef _HelperInputVoidPtrStruct _helper cdef void* _cptr cdef void * _helper_input_void_ptr(ptr, _HelperInputVoidPtrStruct *buffer) @@ -28,7 +28,7 @@ cdef inline void * _helper_input_void_ptr_free(_HelperInputVoidPtrStruct *helper if helper[0]._pybuffer.buf != NULL: PyBuffer_Release(&helper[0]._pybuffer) -{{if 'CUmemPool_attribute_enum' in found_types}} + cdef class _HelperCUmemPool_attribute: cdef void* _cptr @@ -38,8 +38,8 @@ cdef class _HelperCUmemPool_attribute: # Return values cdef int _int_val cdef driver.cuuint64_t _cuuint64_t_val -{{endif}} -{{if 'CUmem_range_attribute_enum' in found_types}} + + cdef class _HelperCUmem_range_attribute: cdef void* _cptr @@ -49,8 +49,8 @@ cdef class _HelperCUmem_range_attribute: # Return values cdef int _int_val # 32 bit integer cdef int* _int_val_list # 32 bit integer array -{{endif}} -{{if 'CUpointer_attribute_enum' in found_types}} + + cdef class _HelperCUpointer_attribute: cdef void* _cptr @@ -68,8 +68,8 @@ cdef class _HelperCUpointer_attribute: cdef unsigned long long _ull cdef size_t _size cdef driver.CUmemoryPool _mempool -{{endif}} -{{if 'CUgraphMem_attribute_enum' in found_types}} + + cdef class _HelperCUgraphMem_attribute: cdef void* _cptr @@ -78,8 +78,8 @@ cdef class _HelperCUgraphMem_attribute: # Return values cdef driver.cuuint64_t _cuuint64_t_val -{{endif}} -{{if 'CUjit_option_enum' in found_types}} + + cdef class _HelperCUjit_option: cdef void* _cptr @@ -95,8 +95,8 @@ cdef class _HelperCUjit_option: cdef cydriver.CUjit_cacheMode_enum _cacheMode cdef vector[char*] _charstarstar # list of names cdef _InputVoidPtrPtrHelper _voidstarstar # list of addresses -{{endif}} -{{if 'cudaJitOption' in found_types}} + + cdef class _HelperCudaJitOption: cdef void* _cptr @@ -109,8 +109,8 @@ cdef class _HelperCudaJitOption: cdef cyruntime.cudaJit_Fallback _fallback cdef int _int cdef cyruntime.cudaJit_CacheMode _cacheMode -{{endif}} -{{if 'CUlibraryOption_enum' in found_types}} + + cdef class _HelperCUlibraryOption: cdef void* _cptr @@ -118,8 +118,8 @@ cdef class _HelperCUlibraryOption: # Return values cdef unsigned int _uint -{{endif}} -{{if 'cudaLibraryOption' in found_types}} + + cdef class _HelperCudaLibraryOption: cdef void* _cptr @@ -127,8 +127,8 @@ cdef class _HelperCudaLibraryOption: # Return values cdef unsigned int _uint -{{endif}} -{{if 'CUmemAllocationHandleType_enum' in found_types}} + + cdef class _HelperCUmemAllocationHandleType: cdef void* _cptr @@ -138,16 +138,24 @@ cdef class _HelperCUmemAllocationHandleType: cdef int _int cdef void* _handle cdef unsigned int _d3dkmt_handle - {{if 'CUmemFabricHandle' in found_types}} + cdef driver.CUmemFabricHandle _mem_fabric_handle - {{endif}} -{{endif}} + + +cdef class _HelperCUlogicalEndpointIpcHandleType: + cdef void* _cptr + cdef cydriver.CUlogicalEndpointIpcHandleType_enum _type + + # Return values + cdef int _int + cdef driver.CUlogicalEndpointFabricHandle _fabric_handle + cdef class _InputVoidPtrPtrHelper: cdef object _references cdef void** _cptr -{{if 'CUcoredumpSettings_enum' in found_types}} + cdef class _HelperCUcoredumpSettings: cdef void* _cptr @@ -158,4 +166,3 @@ cdef class _HelperCUcoredumpSettings: # Return values cdef bint _bool cdef char* _charstar -{{endif}} diff --git a/cuda_bindings/cuda/bindings/_lib/utils.pxi b/cuda_bindings/cuda/bindings/_lib/utils.pxi new file mode 100644 index 00000000000..2dd4d5c1a27 --- /dev/null +++ b/cuda_bindings/cuda/bindings/_lib/utils.pxi @@ -0,0 +1,703 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from cpython.buffer cimport PyObject_CheckBuffer, PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, PyBUF_ANY_CONTIGUOUS +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 cuda.bindings._internal._fast_enum import FastEnum as _FastEnum +import ctypes as _ctypes +cimport cuda.bindings.cydriver as cydriver +cimport cuda.bindings._lib.param_packer as param_packer + +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: + 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 + } + + 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 + self._malloc_list_created = False + if kernelParams is None: + self._ckernelParams = NULL + elif isinstance(kernelParams, (int)): + # Easy run, user gave us an already configured void** address + self._ckernelParams = kernelParams + elif PyObject_CheckBuffer(kernelParams): + # Easy run, get address from Python Buffer Protocol + err_buffer = PyObject_GetBuffer(kernelParams, &self._pybuffer, PyBUF_SIMPLE | PyBUF_ANY_CONTIGUOUS) + if err_buffer == -1: + 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)): + # 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._malloc_list_created = True + + idx = 0 + data_idx = 0 + for value, ctype in zip(kernelParams[0], kernelParams[1]): + if ctype is None: + # 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, (_FastEnum)): + 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: + 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): + 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)) + memcpy(self._ckernelParams[idx], addr, size) + else: + size = _ctypes.sizeof(ctype) + addr = (_ctypes.addressof(value)) + memcpy(self._ckernelParams[idx], addr, size) + data_idx += size + elif ctype == _ctypes.c_void_p: + # special cases for 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 + 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))) + else: + 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") + + def __dealloc__(self): + if self._pyobj_acquired is True: + PyBuffer_Release(&self._pybuffer) + if self._malloc_list_created is True: + free(self._ckernelParams) + free(self._ckernelParamsData) + + @property + def ckernelParams(self): + return self._ckernelParams + +cdef class _HelperInputVoidPtr: + def __cinit__(self, ptr): + self._cptr = _helper_input_void_ptr(ptr, &self._helper) + + def __dealloc__(self): + _helper_input_void_ptr_free(&self._helper) + + @property + def cptr(self): + return self._cptr + + +cdef void * _helper_input_void_ptr(ptr, _HelperInputVoidPtrStruct *helper): + helper[0]._pybuffer.buf = NULL + try: + return ptr + except: + if ptr is None: + return NULL + elif PyObject_CheckBuffer(ptr): + # Easy run, get address from Python Buffer Protocol + err_buffer = PyObject_GetBuffer(ptr, &helper[0]._pybuffer, PyBUF_SIMPLE | PyBUF_ANY_CONTIGUOUS) + if err_buffer == -1: + raise RuntimeError("Failed to retrieve buffer through Buffer Protocol") + return (helper[0]._pybuffer.buf) + else: + raise TypeError("Provided argument is of type {} but expected Type {}, {} or object with Buffer Protocol".format(type(ptr), type(None), type(int))) + + + + +cdef class _HelperCUmemPool_attribute: + def __cinit__(self, attr, init_value, is_getter=False): + self._is_getter = is_getter + self._attr = attr.value + if self._attr in (cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES, + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC, + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES,): + self._int_val = init_value + self._cptr = &self._int_val + elif self._attr in (cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD, + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT, + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH, + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_USED_MEM_CURRENT, + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_USED_MEM_HIGH,): + if self._is_getter: + self._cuuint64_t_val = _driver["cuuint64_t"]() + self._cptr = self._cuuint64_t_val.getPtr() + else: + self._cptr = init_value.getPtr() + else: + raise TypeError('Unsupported attribute: {}'.format(attr.name)) + + def __dealloc__(self): + pass + + @property + def cptr(self): + return self._cptr + + def pyObj(self): + assert(self._is_getter == True) + if self._attr in (cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES, + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC, + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES,): + return self._int_val + elif self._attr in (cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD, + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT, + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH, + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_USED_MEM_CURRENT, + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_USED_MEM_HIGH,): + return self._cuuint64_t_val + else: + raise TypeError('Unsupported attribute value: {}'.format(self._attr)) + + + +cdef class _HelperCUmem_range_attribute: + def __cinit__(self, attr, data_size): + self._data_size = data_size + self._attr = attr.value + if self._attr in (cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY, + cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION, + cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION,): + self._cptr = &self._int_val + elif self._attr in (cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY,): + self._cptr = _callocWrapper(1, self._data_size) + self._int_val_list = self._cptr + else: + raise TypeError('Unsupported attribute: {}'.format(attr.name)) + + def __dealloc__(self): + if self._attr in (cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY,): + free(self._cptr) + + @property + def cptr(self): + return self._cptr + + def pyObj(self): + if self._attr in (cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY, + cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION, + cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION,): + return self._int_val + elif self._attr in (cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY,): + return [self._int_val_list[idx] for idx in range(int(self._data_size/4))] + else: + raise TypeError('Unsupported attribute value: {}'.format(self._attr)) + + + +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 (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_CONTEXT,): + if self._is_getter: + self._ctx = _driver["CUcontext"]() + self._cptr = self._ctx.getPtr() + else: + self._cptr = init_value.getPtr() + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMORY_TYPE, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_ACCESS_FLAGS,): + self._uint = init_value + self._cptr = &self._uint + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL,): + self._int = init_value + self._cptr = &self._int + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_POINTER, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_RANGE_START_ADDR,): + if self._is_getter: + self._devptr = _driver["CUdeviceptr"]() + self._cptr = self._devptr.getPtr() + else: + self._cptr = init_value.getPtr() + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_HOST_POINTER,): + self._void = init_value + self._cptr = &self._void + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_P2P_TOKENS,): + if self._is_getter: + self._token = _driver["CUDA_POINTER_ATTRIBUTE_P2P_TOKENS"]() + self._cptr = self._token.getPtr() + else: + self._cptr = init_value.getPtr() + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_SYNC_MEMOPS, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_MANAGED, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MAPPED,): + self._bool = init_value + self._cptr = &self._bool + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_BUFFER_ID,): + self._ull = init_value + self._cptr = &self._ull + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_RANGE_SIZE,): + self._size = init_value + self._cptr = &self._size + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE,): + if self._is_getter: + self._mempool = _driver["CUmemoryPool"]() + self._cptr = self._mempool.getPtr() + else: + self._cptr = init_value.getPtr() + else: + raise TypeError('Unsupported attribute: {}'.format(attr.name)) + + def __dealloc__(self): + pass + + @property + def cptr(self): + return self._cptr + + def pyObj(self): + assert(self._is_getter == True) + if self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_CONTEXT,): + return self._ctx + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMORY_TYPE, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_ACCESS_FLAGS,): + return self._uint + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_POINTER, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_RANGE_START_ADDR,): + return self._devptr + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_HOST_POINTER,): + return self._void + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_P2P_TOKENS,): + return self._token + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_SYNC_MEMOPS, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_MANAGED, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE, + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MAPPED,): + return self._bool + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_BUFFER_ID,): + return self._ull + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_RANGE_SIZE,): + return self._size + elif self._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE,): + return self._mempool + else: + raise TypeError('Unsupported attribute value: {}'.format(self._attr)) + + + +cdef class _HelperCUgraphMem_attribute: + def __cinit__(self, attr, init_value, is_getter=False): + self._is_getter = is_getter + self._attr = attr.value + if self._attr in (cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT, + cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_USED_MEM_HIGH, + cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT, + cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH,): + if self._is_getter: + self._cuuint64_t_val = _driver["cuuint64_t"]() + self._cptr = self._cuuint64_t_val.getPtr() + else: + self._cptr = init_value.getPtr() + else: + raise TypeError('Unsupported attribute: {}'.format(attr.name)) + + def __dealloc__(self): + pass + + @property + def cptr(self): + return self._cptr + + def pyObj(self): + assert(self._is_getter == True) + if self._attr in (cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT, + cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_USED_MEM_HIGH, + cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT, + cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH,): + return self._cuuint64_t_val + else: + raise TypeError('Unsupported attribute value: {}'.format(self._attr)) + + + +cdef class _HelperCUjit_option: + def __cinit__(self, attr, init_value): + self._attr = attr.value + if self._attr in (cydriver.CUjit_option_enum.CU_JIT_MAX_REGISTERS, + cydriver.CUjit_option_enum.CU_JIT_THREADS_PER_BLOCK, + cydriver.CUjit_option_enum.CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES, + cydriver.CUjit_option_enum.CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES, + cydriver.CUjit_option_enum.CU_JIT_OPTIMIZATION_LEVEL, + cydriver.CUjit_option_enum.CU_JIT_GLOBAL_SYMBOL_COUNT, + cydriver.CUjit_option_enum.CU_JIT_TARGET_FROM_CUCONTEXT, + cydriver.CUjit_option_enum.CU_JIT_REFERENCED_KERNEL_COUNT, + cydriver.CUjit_option_enum.CU_JIT_REFERENCED_VARIABLE_COUNT, + cydriver.CUjit_option_enum.CU_JIT_MIN_CTA_PER_SM, + cydriver.CUjit_option_enum.CU_JIT_SPLIT_COMPILE,): + self._uint = init_value + self._cptr = self._uint + elif self._attr in (cydriver.CUjit_option_enum.CU_JIT_WALL_TIME,): + self._float = init_value + self._cptr = self._float + elif self._attr in (cydriver.CUjit_option_enum.CU_JIT_INFO_LOG_BUFFER, + cydriver.CUjit_option_enum.CU_JIT_ERROR_LOG_BUFFER): + self._charstar = init_value + self._cptr = self._charstar + elif self._attr in (cydriver.CUjit_option_enum.CU_JIT_TARGET,): + self._target = init_value.value + self._cptr = self._target + elif self._attr in (cydriver.CUjit_option_enum.CU_JIT_FALLBACK_STRATEGY,): + self._fallback = init_value.value + self._cptr = self._fallback + elif self._attr in (cydriver.CUjit_option_enum.CU_JIT_GENERATE_DEBUG_INFO, + cydriver.CUjit_option_enum.CU_JIT_LOG_VERBOSE, + cydriver.CUjit_option_enum.CU_JIT_GENERATE_LINE_INFO, + cydriver.CUjit_option_enum.CU_JIT_LTO, + cydriver.CUjit_option_enum.CU_JIT_FTZ, + cydriver.CUjit_option_enum.CU_JIT_PREC_DIV, + cydriver.CUjit_option_enum.CU_JIT_PREC_SQRT, + cydriver.CUjit_option_enum.CU_JIT_FMA, + cydriver.CUjit_option_enum.CU_JIT_OPTIMIZE_UNUSED_DEVICE_VARIABLES,): + self._int = init_value + self._cptr = self._int + elif self._attr in (cydriver.CUjit_option_enum.CU_JIT_CACHE_MODE,): + self._cacheMode = init_value.value + self._cptr = self._cacheMode + elif self._attr in (cydriver.CUjit_option_enum.CU_JIT_GLOBAL_SYMBOL_NAMES, + cydriver.CUjit_option_enum.CU_JIT_REFERENCED_KERNEL_NAMES, + cydriver.CUjit_option_enum.CU_JIT_REFERENCED_VARIABLE_NAMES,): + self._charstarstar = init_value + self._cptr = &self._charstarstar[0] + elif self._attr in (cydriver.CUjit_option_enum.CU_JIT_GLOBAL_SYMBOL_ADDRESSES,): + 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)) + + def __dealloc__(self): + pass + + @property + def cptr(self): + return self._cptr + + + + +cdef class _HelperCudaJitOption: + def __cinit__(self, attr, init_value): + self._attr = attr.value + if self._attr in (cyruntime.cudaJitOption.cudaJitMaxRegisters, + cyruntime.cudaJitOption.cudaJitThreadsPerBlock, + cyruntime.cudaJitOption.cudaJitInfoLogBufferSizeBytes, + cyruntime.cudaJitOption.cudaJitErrorLogBufferSizeBytes, + cyruntime.cudaJitOption.cudaJitOptimizationLevel, + cyruntime.cudaJitOption.cudaJitMinCtaPerSm,): + self._uint = init_value + self._cptr = self._uint + elif self._attr in (cyruntime.cudaJitOption.cudaJitWallTime,): + self._float = init_value + self._cptr = self._float + elif self._attr in (cyruntime.cudaJitOption.cudaJitInfoLogBuffer, + cyruntime.cudaJitOption.cudaJitErrorLogBuffer): + self._charstar = init_value + self._cptr = self._charstar + elif self._attr in (cyruntime.cudaJitOption.cudaJitFallbackStrategy,): + self._fallback = init_value.value + self._cptr = self._fallback + elif self._attr in (cyruntime.cudaJitOption.cudaJitGenerateDebugInfo, + cyruntime.cudaJitOption.cudaJitLogVerbose, + cyruntime.cudaJitOption.cudaJitGenerateLineInfo, + cyruntime.cudaJitOption.cudaJitPositionIndependentCode, + cyruntime.cudaJitOption.cudaJitMaxThreadsPerBlock, + cyruntime.cudaJitOption.cudaJitOverrideDirectiveValues,): + self._int = init_value + self._cptr = self._int + elif self._attr in (cyruntime.cudaJitOption.cudaJitCacheMode,): + self._cacheMode = init_value.value + self._cptr = self._cacheMode + else: + raise TypeError('Unsupported attribute: {}'.format(attr.name)) + + def __dealloc__(self): + pass + + @property + def cptr(self): + return self._cptr + + + + +cdef class _HelperCUlibraryOption: + def __cinit__(self, attr, init_value): + self._attr = attr.value + if False: + pass + + elif self._attr in (cydriver.CUlibraryOption_enum.CU_LIBRARY_HOST_UNIVERSAL_FUNCTION_AND_DATA_TABLE,): + self._cptr = init_value.getPtr() + + + elif self._attr in (cydriver.CUlibraryOption_enum.CU_LIBRARY_BINARY_IS_PRESERVED,): + self._uint = init_value + self._cptr = self._uint + + else: + raise TypeError('Unsupported attribute: {}'.format(attr.name)) + + def __dealloc__(self): + pass + + @property + def cptr(self): + return self._cptr + + + + +cdef class _HelperCudaLibraryOption: + def __cinit__(self, attr, init_value): + self._attr = attr.value + if False: + pass + + elif self._attr in (cyruntime.cudaLibraryOption.cudaLibraryHostUniversalFunctionAndDataTable,): + self._cptr = init_value.getPtr() + + + elif self._attr in (cyruntime.cudaLibraryOption.cudaLibraryBinaryIsPreserved,): + self._uint = init_value + self._cptr = self._uint + + else: + raise TypeError('Unsupported attribute: {}'.format(attr.name)) + + def __dealloc__(self): + pass + + @property + def cptr(self): + return self._cptr + + + + +cdef class _HelperCUmemAllocationHandleType: + def __cinit__(self, attr): + self._type = attr.value + if False: + pass + + elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_NONE,): + self._cptr = &self._int + + + elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR,): + self._cptr = &self._int + + + elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_WIN32,): + self._cptr = &self._handle + + + elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_WIN32_KMT,): + self._cptr = &self._d3dkmt_handle + + + elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_FABRIC,): + self._mem_fabric_handle = _driver["CUmemFabricHandle"]() + self._cptr = self._mem_fabric_handle.getPtr() + + else: + raise TypeError('Unsupported attribute: {}'.format(attr.name)) + + def __dealloc__(self): + pass + + @property + def cptr(self): + return self._cptr + + def pyObj(self): + if False: + pass + + elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_NONE,): + return self._int + + + elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR,): + return self._int + + + elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_WIN32,): + return self._handle + + + elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_WIN32_KMT,): + return self._d3dkmt_handle + + + elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_FABRIC,): + return self._mem_fabric_handle + + else: + raise TypeError('Unsupported attribute: {}'.format(self._type)) + + + +cdef class _HelperCUlogicalEndpointIpcHandleType: + def __cinit__(self, attr): + self._type = attr.value + if False: + pass + + elif self._type in (cydriver.CUlogicalEndpointIpcHandleType_enum.CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_NONE,): + self._cptr = &self._int + + + elif self._type in (cydriver.CUlogicalEndpointIpcHandleType_enum.CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_FABRIC,): + self._fabric_handle = _driver["CUlogicalEndpointFabricHandle"]() + self._cptr = self._fabric_handle.getPtr() + + else: + raise TypeError('Unsupported attribute: {}'.format(attr.name)) + + def __dealloc__(self): + pass + + @property + def cptr(self): + return self._cptr + + def pyObj(self): + if False: + pass + + elif self._type in (cydriver.CUlogicalEndpointIpcHandleType_enum.CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_NONE,): + return self._int + + + elif self._type in (cydriver.CUlogicalEndpointIpcHandleType_enum.CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_FABRIC,): + return self._fabric_handle + + else: + raise TypeError('Unsupported attribute: {}'.format(self._type)) + + +cdef class _InputVoidPtrPtrHelper: + def __cinit__(self, lst): + # Hold onto references to the original buffers so they + # won't be free'd behind our back + self._references = lst + self._cptr = _callocWrapper(len(lst), sizeof(void*)) + for idx in range(len(lst)): + self._cptr[idx] = lst[idx].cptr + + def __dealloc__(self): + free(self._cptr) + + @property + def cptr(self): + return self._cptr + + + +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 (cydriver.CUcoredumpSettings_enum.CU_COREDUMP_FILE, + cydriver.CUcoredumpSettings_enum.CU_COREDUMP_PIPE,): + if self._is_getter: + self._charstar = _callocWrapper(1024, 1) + self._cptr = self._charstar + self._size = 1024 + else: + self._charstar = init_value + self._cptr = self._charstar + self._size = len(init_value) + elif self._attrib in (cydriver.CUcoredumpSettings_enum.CU_COREDUMP_ENABLE_ON_EXCEPTION, + cydriver.CUcoredumpSettings_enum.CU_COREDUMP_TRIGGER_HOST, + cydriver.CUcoredumpSettings_enum.CU_COREDUMP_LIGHTWEIGHT, + cydriver.CUcoredumpSettings_enum.CU_COREDUMP_ENABLE_USER_TRIGGER,): + if self._is_getter == False: + self._bool = init_value + + self._cptr = &self._bool + self._size = 1 + else: + raise TypeError('Unsupported attribute: {}'.format(attr.name)) + + def __dealloc__(self): + pass + + @property + def cptr(self): + return self._cptr + + def size(self): + return self._size + + def pyObj(self): + assert(self._is_getter == True) + if self._attrib in (cydriver.CUcoredumpSettings_enum.CU_COREDUMP_FILE, + cydriver.CUcoredumpSettings_enum.CU_COREDUMP_PIPE,): + return self._charstar + elif self._attrib in (cydriver.CUcoredumpSettings_enum.CU_COREDUMP_ENABLE_ON_EXCEPTION, + cydriver.CUcoredumpSettings_enum.CU_COREDUMP_TRIGGER_HOST, + cydriver.CUcoredumpSettings_enum.CU_COREDUMP_LIGHTWEIGHT, + cydriver.CUcoredumpSettings_enum.CU_COREDUMP_ENABLE_USER_TRIGGER,): + return self._bool + else: + raise TypeError('Unsupported attribute value: {}'.format(self._attrib)) diff --git a/cuda_bindings/cuda/bindings/_lib/utils.pxi.in b/cuda_bindings/cuda/bindings/_lib/utils.pxi.in deleted file mode 100644 index c88ec497215..00000000000 --- a/cuda_bindings/cuda/bindings/_lib/utils.pxi.in +++ /dev/null @@ -1,664 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -from cpython.buffer cimport PyObject_CheckBuffer, PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, PyBUF_ANY_CONTIGUOUS -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 cuda.bindings._internal._fast_enum import FastEnum as _FastEnum -import ctypes as _ctypes -cimport cuda.bindings.cydriver as cydriver -cimport cuda.bindings._lib.param_packer as param_packer - -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: - 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 - } - - 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 - self._malloc_list_created = False - if kernelParams is None: - self._ckernelParams = NULL - elif isinstance(kernelParams, (int)): - # Easy run, user gave us an already configured void** address - self._ckernelParams = kernelParams - elif PyObject_CheckBuffer(kernelParams): - # Easy run, get address from Python Buffer Protocol - err_buffer = PyObject_GetBuffer(kernelParams, &self._pybuffer, PyBUF_SIMPLE | PyBUF_ANY_CONTIGUOUS) - if err_buffer == -1: - 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)): - # 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._malloc_list_created = True - - idx = 0 - data_idx = 0 - for value, ctype in zip(kernelParams[0], kernelParams[1]): - if ctype is None: - # 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, (_FastEnum)): - 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: - 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): - 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)) - memcpy(self._ckernelParams[idx], addr, size) - else: - size = _ctypes.sizeof(ctype) - addr = (_ctypes.addressof(value)) - memcpy(self._ckernelParams[idx], addr, size) - data_idx += size - elif ctype == _ctypes.c_void_p: - # special cases for 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 - 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))) - else: - 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") - - def __dealloc__(self): - if self._pyobj_acquired is True: - PyBuffer_Release(&self._pybuffer) - if self._malloc_list_created is True: - free(self._ckernelParams) - free(self._ckernelParamsData) - - @property - def ckernelParams(self): - return self._ckernelParams - -cdef class _HelperInputVoidPtr: - def __cinit__(self, ptr): - self._cptr = _helper_input_void_ptr(ptr, &self._helper) - - def __dealloc__(self): - _helper_input_void_ptr_free(&self._helper) - - @property - def cptr(self): - return self._cptr - - -cdef void * _helper_input_void_ptr(ptr, _HelperInputVoidPtrStruct *helper): - helper[0]._pybuffer.buf = NULL - try: - return ptr - except: - if ptr is None: - return NULL - elif PyObject_CheckBuffer(ptr): - # Easy run, get address from Python Buffer Protocol - err_buffer = PyObject_GetBuffer(ptr, &helper[0]._pybuffer, PyBUF_SIMPLE | PyBUF_ANY_CONTIGUOUS) - if err_buffer == -1: - raise RuntimeError("Failed to retrieve buffer through Buffer Protocol") - return (helper[0]._pybuffer.buf) - else: - raise TypeError("Provided argument is of type {} but expected Type {}, {} or object with Buffer Protocol".format(type(ptr), type(None), type(int))) - - -{{if 'CUmemPool_attribute_enum' in found_types}} - -cdef class _HelperCUmemPool_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_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES'}}cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES,{{endif}} - {{if 'CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC'}}cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC,{{endif}} - {{if 'CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES'}}cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES,{{endif}}): - self._int_val = init_value - self._cptr = &self._int_val - elif self._attr in ({{if 'CU_MEMPOOL_ATTR_RELEASE_THRESHOLD'}}cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD,{{endif}} - {{if 'CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT'}}cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT,{{endif}} - {{if 'CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH'}}cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH,{{endif}} - {{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._cptr = self._cuuint64_t_val.getPtr() - else: - self._cptr = init_value.getPtr() - else: - raise TypeError('Unsupported attribute: {}'.format(attr.name)) - - def __dealloc__(self): - pass - - @property - def cptr(self): - return self._cptr - - def pyObj(self): - assert(self._is_getter == True) - if self._attr in ({{if 'CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES'}}cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES,{{endif}} - {{if 'CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC'}}cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC,{{endif}} - {{if 'CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES'}}cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES,{{endif}}): - return self._int_val - elif self._attr in ({{if 'CU_MEMPOOL_ATTR_RELEASE_THRESHOLD'}}cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD,{{endif}} - {{if 'CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT'}}cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT,{{endif}} - {{if 'CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH'}}cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH,{{endif}} - {{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}}): - return self._cuuint64_t_val - else: - raise TypeError('Unsupported attribute value: {}'.format(self._attr)) -{{endif}} -{{if 'CUmem_range_attribute_enum' in found_types}} - -cdef class _HelperCUmem_range_attribute: - def __cinit__(self, attr, data_size): - self._data_size = data_size - self._attr = attr.value - if self._attr in ({{if 'CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY'}}cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY,{{endif}} - {{if 'CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION'}}cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION,{{endif}} - {{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._int_val_list = self._cptr - else: - raise TypeError('Unsupported attribute: {}'.format(attr.name)) - - def __dealloc__(self): - if self._attr in ({{if 'CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY'}}cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY,{{endif}}): - free(self._cptr) - - @property - def cptr(self): - return self._cptr - - def pyObj(self): - if self._attr in ({{if 'CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY'}}cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY,{{endif}} - {{if 'CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION'}}cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION,{{endif}} - {{if 'CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION'}}cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION,{{endif}}): - return 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}}): - return [self._int_val_list[idx] for idx in range(int(self._data_size/4))] - else: - raise TypeError('Unsupported attribute value: {}'.format(self._attr)) -{{endif}} -{{if 'CUpointer_attribute_enum' in found_types}} - -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._cptr = self._ctx.getPtr() - else: - self._cptr = init_value.getPtr() - elif self._attr in ({{if 'CU_POINTER_ATTRIBUTE_MEMORY_TYPE'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMORY_TYPE,{{endif}} - {{if 'CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES,{{endif}} - {{if 'CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE,{{endif}} - {{if 'CU_POINTER_ATTRIBUTE_ACCESS_FLAGS'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_ACCESS_FLAGS,{{endif}}): - self._uint = init_value - self._cptr = &self._uint - elif self._attr in ({{if 'CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL,{{endif}}): - self._int = init_value - self._cptr = &self._int - 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._cptr = self._devptr.getPtr() - else: - self._cptr = init_value.getPtr() - elif self._attr in ({{if 'CU_POINTER_ATTRIBUTE_HOST_POINTER'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_HOST_POINTER,{{endif}}): - self._void = init_value - 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._cptr = self._token.getPtr() - else: - self._cptr = init_value.getPtr() - elif self._attr in ({{if 'CU_POINTER_ATTRIBUTE_SYNC_MEMOPS'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_SYNC_MEMOPS,{{endif}} - {{if 'CU_POINTER_ATTRIBUTE_IS_MANAGED'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_MANAGED,{{endif}} - {{if 'CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE,{{endif}} - {{if 'CU_POINTER_ATTRIBUTE_MAPPED'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MAPPED,{{endif}}): - self._bool = init_value - self._cptr = &self._bool - elif self._attr in ({{if 'CU_POINTER_ATTRIBUTE_BUFFER_ID'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_BUFFER_ID,{{endif}}): - self._ull = init_value - self._cptr = &self._ull - elif self._attr in ({{if 'CU_POINTER_ATTRIBUTE_RANGE_SIZE'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_RANGE_SIZE,{{endif}}): - self._size = init_value - 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._cptr = self._mempool.getPtr() - else: - self._cptr = init_value.getPtr() - else: - raise TypeError('Unsupported attribute: {}'.format(attr.name)) - - def __dealloc__(self): - pass - - @property - def cptr(self): - return self._cptr - - def pyObj(self): - assert(self._is_getter == True) - if self._attr in ({{if 'CU_POINTER_ATTRIBUTE_CONTEXT'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_CONTEXT,{{endif}}): - return self._ctx - elif self._attr in ({{if 'CU_POINTER_ATTRIBUTE_MEMORY_TYPE'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMORY_TYPE,{{endif}} - {{if 'CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL,{{endif}} - {{if 'CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES,{{endif}} - {{if 'CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE,{{endif}} - {{if 'CU_POINTER_ATTRIBUTE_ACCESS_FLAGS'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_ACCESS_FLAGS,{{endif}}): - return self._uint - 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}}): - return self._devptr - elif self._attr in ({{if 'CU_POINTER_ATTRIBUTE_HOST_POINTER'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_HOST_POINTER,{{endif}}): - return self._void - elif self._attr in ({{if 'CU_POINTER_ATTRIBUTE_P2P_TOKENS'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_P2P_TOKENS,{{endif}}): - return self._token - elif self._attr in ({{if 'CU_POINTER_ATTRIBUTE_SYNC_MEMOPS'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_SYNC_MEMOPS,{{endif}} - {{if 'CU_POINTER_ATTRIBUTE_IS_MANAGED'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_MANAGED,{{endif}} - {{if 'CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE,{{endif}} - {{if 'CU_POINTER_ATTRIBUTE_MAPPED'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MAPPED,{{endif}}): - return self._bool - elif self._attr in ({{if 'CU_POINTER_ATTRIBUTE_BUFFER_ID'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_BUFFER_ID,{{endif}}): - return self._ull - elif self._attr in ({{if 'CU_POINTER_ATTRIBUTE_RANGE_SIZE'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_RANGE_SIZE,{{endif}}): - return self._size - elif self._attr in ({{if 'CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE,{{endif}}): - return self._mempool - else: - raise TypeError('Unsupported attribute value: {}'.format(self._attr)) -{{endif}} -{{if 'CUgraphMem_attribute_enum' in found_types}} - -cdef class _HelperCUgraphMem_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_GRAPH_MEM_ATTR_USED_MEM_CURRENT' in found_values}}cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT,{{endif}} - {{if 'CU_GRAPH_MEM_ATTR_USED_MEM_HIGH' in found_values}}cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_USED_MEM_HIGH,{{endif}} - {{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._cptr = self._cuuint64_t_val.getPtr() - else: - self._cptr = init_value.getPtr() - else: - raise TypeError('Unsupported attribute: {}'.format(attr.name)) - - def __dealloc__(self): - pass - - @property - def cptr(self): - return self._cptr - - def pyObj(self): - assert(self._is_getter == True) - if self._attr in ({{if 'CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT' in found_values}}cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT,{{endif}} - {{if 'CU_GRAPH_MEM_ATTR_USED_MEM_HIGH' in found_values}}cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_USED_MEM_HIGH,{{endif}} - {{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}}): - return self._cuuint64_t_val - else: - raise TypeError('Unsupported attribute value: {}'.format(self._attr)) -{{endif}} -{{if 'CUjit_option_enum' in found_types}} - -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}} - {{if 'CU_JIT_THREADS_PER_BLOCK' in found_values}}cydriver.CUjit_option_enum.CU_JIT_THREADS_PER_BLOCK,{{endif}} - {{if 'CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES' in found_values}}cydriver.CUjit_option_enum.CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES,{{endif}} - {{if 'CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES' in found_values}}cydriver.CUjit_option_enum.CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES,{{endif}} - {{if 'CU_JIT_OPTIMIZATION_LEVEL' in found_values}}cydriver.CUjit_option_enum.CU_JIT_OPTIMIZATION_LEVEL,{{endif}} - {{if 'CU_JIT_GLOBAL_SYMBOL_COUNT' in found_values}}cydriver.CUjit_option_enum.CU_JIT_GLOBAL_SYMBOL_COUNT,{{endif}} - {{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_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}}): - self._float = init_value - self._cptr = self._float - elif self._attr in ({{if 'CU_JIT_INFO_LOG_BUFFER' in found_values}}cydriver.CUjit_option_enum.CU_JIT_INFO_LOG_BUFFER,{{endif}} - {{if 'CU_JIT_ERROR_LOG_BUFFER' in found_values}}cydriver.CUjit_option_enum.CU_JIT_ERROR_LOG_BUFFER{{endif}}): - self._charstar = init_value - self._cptr = self._charstar - elif self._attr in ({{if 'CU_JIT_TARGET' in found_values}}cydriver.CUjit_option_enum.CU_JIT_TARGET,{{endif}}): - self._target = init_value.value - self._cptr = self._target - elif self._attr in ({{if 'CU_JIT_FALLBACK_STRATEGY' in found_values}}cydriver.CUjit_option_enum.CU_JIT_FALLBACK_STRATEGY,{{endif}}): - self._fallback = init_value.value - self._cptr = self._fallback - elif self._attr in ({{if 'CU_JIT_GENERATE_DEBUG_INFO' in found_values}}cydriver.CUjit_option_enum.CU_JIT_GENERATE_DEBUG_INFO,{{endif}} - {{if 'CU_JIT_LOG_VERBOSE' in found_values}}cydriver.CUjit_option_enum.CU_JIT_LOG_VERBOSE,{{endif}} - {{if 'CU_JIT_GENERATE_LINE_INFO' in found_values}}cydriver.CUjit_option_enum.CU_JIT_GENERATE_LINE_INFO,{{endif}} - {{if 'CU_JIT_LTO' in found_values}}cydriver.CUjit_option_enum.CU_JIT_LTO,{{endif}} - {{if 'CU_JIT_FTZ' in found_values}}cydriver.CUjit_option_enum.CU_JIT_FTZ,{{endif}} - {{if 'CU_JIT_PREC_DIV' in found_values}}cydriver.CUjit_option_enum.CU_JIT_PREC_DIV,{{endif}} - {{if 'CU_JIT_PREC_SQRT' in found_values}}cydriver.CUjit_option_enum.CU_JIT_PREC_SQRT,{{endif}} - {{if 'CU_JIT_FMA' in found_values}}cydriver.CUjit_option_enum.CU_JIT_FMA,{{endif}} - {{if 'CU_JIT_OPTIMIZE_UNUSED_DEVICE_VARIABLES' in found_values}}cydriver.CUjit_option_enum.CU_JIT_OPTIMIZE_UNUSED_DEVICE_VARIABLES,{{endif}}): - self._int = init_value - self._cptr = self._int - elif self._attr in ({{if 'CU_JIT_CACHE_MODE' in found_values}}cydriver.CUjit_option_enum.CU_JIT_CACHE_MODE,{{endif}}): - self._cacheMode = init_value.value - self._cptr = self._cacheMode - elif self._attr in ({{if 'CU_JIT_GLOBAL_SYMBOL_NAMES' in found_values}}cydriver.CUjit_option_enum.CU_JIT_GLOBAL_SYMBOL_NAMES,{{endif}} - {{if 'CU_JIT_REFERENCED_KERNEL_NAMES' in found_values}}cydriver.CUjit_option_enum.CU_JIT_REFERENCED_KERNEL_NAMES,{{endif}} - {{if 'CU_JIT_REFERENCED_VARIABLE_NAMES' in found_values}}cydriver.CUjit_option_enum.CU_JIT_REFERENCED_VARIABLE_NAMES,{{endif}}): - 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) - self._cptr = self._voidstarstar.cptr - else: - raise TypeError('Unsupported attribute: {}'.format(attr.name)) - - def __dealloc__(self): - pass - - @property - def cptr(self): - return self._cptr -{{endif}} - -{{if 'cudaJitOption' in found_types}} - -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}} - {{if 'cudaJitThreadsPerBlock' in found_values}}cyruntime.cudaJitOption.cudaJitThreadsPerBlock,{{endif}} - {{if 'cudaJitInfoLogBufferSizeBytes' in found_values}}cyruntime.cudaJitOption.cudaJitInfoLogBufferSizeBytes,{{endif}} - {{if 'cudaJitErrorLogBufferSizeBytes' in found_values}}cyruntime.cudaJitOption.cudaJitErrorLogBufferSizeBytes,{{endif}} - {{if 'cudaJitOptimizationLevel' in found_values}}cyruntime.cudaJitOption.cudaJitOptimizationLevel,{{endif}} - {{if 'cudaJitMinCtaPerSm' in found_values}}cyruntime.cudaJitOption.cudaJitMinCtaPerSm,{{endif}}): - self._uint = init_value - self._cptr = self._uint - elif self._attr in ({{if 'cudaJitWallTime' in found_values}}cyruntime.cudaJitOption.cudaJitWallTime,{{endif}}): - self._float = init_value - self._cptr = self._float - elif self._attr in ({{if 'cudaJitInfoLogBuffer' in found_values}}cyruntime.cudaJitOption.cudaJitInfoLogBuffer,{{endif}} - {{if 'cudaJitErrorLogBuffer' in found_values}}cyruntime.cudaJitOption.cudaJitErrorLogBuffer{{endif}}): - self._charstar = init_value - self._cptr = self._charstar - elif self._attr in ({{if 'cudaJitFallbackStrategy' in found_values}}cyruntime.cudaJitOption.cudaJitFallbackStrategy,{{endif}}): - self._fallback = init_value.value - self._cptr = self._fallback - elif self._attr in ({{if 'cudaJitGenerateDebugInfo' in found_values}}cyruntime.cudaJitOption.cudaJitGenerateDebugInfo,{{endif}} - {{if 'cudaJitLogVerbose' in found_values}}cyruntime.cudaJitOption.cudaJitLogVerbose,{{endif}} - {{if 'cudaJitGenerateLineInfo' in found_values}}cyruntime.cudaJitOption.cudaJitGenerateLineInfo,{{endif}} - {{if 'cudaJitPositionIndependentCode' in found_values}}cyruntime.cudaJitOption.cudaJitPositionIndependentCode,{{endif}} - {{if 'cudaJitMaxThreadsPerBlock' in found_values}}cyruntime.cudaJitOption.cudaJitMaxThreadsPerBlock,{{endif}} - {{if 'cudaJitOverrideDirectiveValues' in found_values}}cyruntime.cudaJitOption.cudaJitOverrideDirectiveValues,{{endif}}): - self._int = init_value - self._cptr = self._int - elif self._attr in ({{if 'cudaJitCacheMode' in found_values}}cyruntime.cudaJitOption.cudaJitCacheMode,{{endif}}): - self._cacheMode = init_value.value - self._cptr = self._cacheMode - else: - raise TypeError('Unsupported attribute: {}'.format(attr.name)) - - def __dealloc__(self): - pass - - @property - def cptr(self): - return self._cptr -{{endif}} - -{{if 'CUlibraryOption_enum' in found_types}} - -cdef class _HelperCUlibraryOption: - def __cinit__(self, attr, init_value): - self._attr = attr.value - if False: - pass - {{if 'CU_LIBRARY_HOST_UNIVERSAL_FUNCTION_AND_DATA_TABLE' in found_values}} - elif self._attr in (cydriver.CUlibraryOption_enum.CU_LIBRARY_HOST_UNIVERSAL_FUNCTION_AND_DATA_TABLE,): - self._cptr = init_value.getPtr() - {{endif}} - {{if 'CU_LIBRARY_BINARY_IS_PRESERVED' in found_values}} - elif self._attr in (cydriver.CUlibraryOption_enum.CU_LIBRARY_BINARY_IS_PRESERVED,): - self._uint = init_value - self._cptr = self._uint - {{endif}} - else: - raise TypeError('Unsupported attribute: {}'.format(attr.name)) - - def __dealloc__(self): - pass - - @property - def cptr(self): - return self._cptr -{{endif}} - -{{if 'cudaLibraryOption' in found_types}} - -cdef class _HelperCudaLibraryOption: - def __cinit__(self, attr, init_value): - self._attr = attr.value - if False: - pass - {{if 'cudaLibraryHostUniversalFunctionAndDataTable' in found_values}} - elif self._attr in (cyruntime.cudaLibraryOption.cudaLibraryHostUniversalFunctionAndDataTable,): - self._cptr = init_value.getPtr() - {{endif}} - {{if 'cudaLibraryBinaryIsPreserved' in found_values}} - elif self._attr in (cyruntime.cudaLibraryOption.cudaLibraryBinaryIsPreserved,): - self._uint = init_value - self._cptr = self._uint - {{endif}} - else: - raise TypeError('Unsupported attribute: {}'.format(attr.name)) - - def __dealloc__(self): - pass - - @property - def cptr(self): - return self._cptr -{{endif}} - -{{if 'CUmemAllocationHandleType_enum' in found_types}} - -cdef class _HelperCUmemAllocationHandleType: - def __cinit__(self, attr): - self._type = attr.value - if False: - pass - {{if 'CU_MEM_HANDLE_TYPE_NONE' in found_values}} - elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_NONE,): - self._cptr = &self._int - {{endif}} - {{if 'CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR' in found_values}} - elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR,): - self._cptr = &self._int - {{endif}} - {{if 'CU_MEM_HANDLE_TYPE_WIN32' in found_values}} - elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_WIN32,): - self._cptr = &self._handle - {{endif}} - {{if 'CU_MEM_HANDLE_TYPE_WIN32_KMT' in found_values}} - elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_WIN32_KMT,): - self._cptr = &self._d3dkmt_handle - {{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._cptr = self._mem_fabric_handle.getPtr() - {{endif}} - else: - raise TypeError('Unsupported attribute: {}'.format(attr.name)) - - def __dealloc__(self): - pass - - @property - def cptr(self): - return self._cptr - - def pyObj(self): - if False: - pass - {{if 'CU_MEM_HANDLE_TYPE_NONE' in found_values}} - elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_NONE,): - return self._int - {{endif}} - {{if 'CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR' in found_values}} - elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR,): - return self._int - {{endif}} - {{if 'CU_MEM_HANDLE_TYPE_WIN32' in found_values}} - elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_WIN32,): - return self._handle - {{endif}} - {{if 'CU_MEM_HANDLE_TYPE_WIN32_KMT' in found_values}} - elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_WIN32_KMT,): - return self._d3dkmt_handle - {{endif}} - {{if 'CU_MEM_HANDLE_TYPE_FABRIC' in found_values}} - elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_FABRIC,): - return self._mem_fabric_handle - {{endif}} - else: - raise TypeError('Unsupported attribute: {}'.format(self._type)) -{{endif}} - -cdef class _InputVoidPtrPtrHelper: - def __cinit__(self, lst): - # Hold onto references to the original buffers so they - # won't be free'd behind our back - self._references = lst - self._cptr = _callocWrapper(len(lst), sizeof(void*)) - for idx in range(len(lst)): - self._cptr[idx] = lst[idx].cptr - - def __dealloc__(self): - free(self._cptr) - - @property - def cptr(self): - return self._cptr - -{{if 'CUcoredumpSettings_enum' in found_types}} - -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._cptr = self._charstar - self._size = 1024 - else: - self._charstar = init_value - self._cptr = self._charstar - self._size = len(init_value) - elif self._attrib in ({{if 'CU_COREDUMP_ENABLE_ON_EXCEPTION' in found_values}}cydriver.CUcoredumpSettings_enum.CU_COREDUMP_ENABLE_ON_EXCEPTION,{{endif}} - {{if 'CU_COREDUMP_TRIGGER_HOST' in found_values}}cydriver.CUcoredumpSettings_enum.CU_COREDUMP_TRIGGER_HOST,{{endif}} - {{if 'CU_COREDUMP_LIGHTWEIGHT' in found_values}}cydriver.CUcoredumpSettings_enum.CU_COREDUMP_LIGHTWEIGHT,{{endif}} - {{if 'CU_COREDUMP_ENABLE_USER_TRIGGER' in found_values}}cydriver.CUcoredumpSettings_enum.CU_COREDUMP_ENABLE_USER_TRIGGER,{{endif}}): - if self._is_getter == False: - self._bool = init_value - - self._cptr = &self._bool - self._size = 1 - else: - raise TypeError('Unsupported attribute: {}'.format(attr.name)) - - def __dealloc__(self): - pass - - @property - def cptr(self): - return self._cptr - - def size(self): - return self._size - - def pyObj(self): - assert(self._is_getter == True) - 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}}): - return self._charstar - elif self._attrib in ({{if 'CU_COREDUMP_ENABLE_ON_EXCEPTION' in found_values}}cydriver.CUcoredumpSettings_enum.CU_COREDUMP_ENABLE_ON_EXCEPTION,{{endif}} - {{if 'CU_COREDUMP_TRIGGER_HOST' in found_values}}cydriver.CUcoredumpSettings_enum.CU_COREDUMP_TRIGGER_HOST,{{endif}} - {{if 'CU_COREDUMP_LIGHTWEIGHT' in found_values}}cydriver.CUcoredumpSettings_enum.CU_COREDUMP_LIGHTWEIGHT,{{endif}} - {{if 'CU_COREDUMP_ENABLE_USER_TRIGGER' in found_values}}cydriver.CUcoredumpSettings_enum.CU_COREDUMP_ENABLE_USER_TRIGGER,{{endif}}): - return self._bool - else: - raise TypeError('Unsupported attribute value: {}'.format(self._attrib)) -{{endif}} diff --git a/cuda_bindings/cuda/bindings/_lib/windll.pxd b/cuda_bindings/cuda/bindings/_lib/windll.pxd index 7b190f35959..294a1a9fd90 100644 --- a/cuda_bindings/cuda/bindings/_lib/windll.pxd +++ b/cuda_bindings/cuda/bindings/_lib/windll.pxd @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 from libc.stddef cimport wchar_t from libc.stdint cimport uintptr_t diff --git a/cuda_bindings/cuda/bindings/_test_helpers/__init__.py b/cuda_bindings/cuda/bindings/_test_helpers/__init__.py index c6b171f9cd3..2cfab242d2a 100644 --- a/cuda_bindings/cuda/bindings/_test_helpers/__init__.py +++ b/cuda_bindings/cuda/bindings/_test_helpers/__init__.py @@ -1,5 +1,5 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # This package contains test helper utilities that may also be useful for other libraries outside of `cuda.bindings`, diff --git a/cuda_bindings/cuda/bindings/_test_helpers/arch_check.py b/cuda_bindings/cuda/bindings/_test_helpers/arch_check.py index 9b1e5e23a72..3ab48be6e02 100644 --- a/cuda_bindings/cuda/bindings/_test_helpers/arch_check.py +++ b/cuda_bindings/cuda/bindings/_test_helpers/arch_check.py @@ -1,5 +1,5 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 from contextlib import contextmanager @@ -8,6 +8,7 @@ import pytest from cuda.bindings import nvml +from cuda.bindings._internal.utils import FunctionNotFoundError as NvmlSymbolNotFoundError @cache @@ -49,9 +50,10 @@ def unsupported_before(device: int, expected_device_arch: nvml.DeviceArch | str try: yield - except nvml.NotSupportedError: - # The API call raised NotSupportedError, so we skip the test, but - # don't fail it + except (nvml.NotSupportedError, nvml.FunctionNotFoundError, NvmlSymbolNotFoundError): + # The API call raised NotSupportedError, NVML status FunctionNotFoundError, + # or NvmlSymbolNotFoundError (symbol absent from the loaded NVML DLL), so we + # skip the test but don't fail it pytest.skip( f"Unsupported call for device architecture {nvml.DeviceArch(device_arch).name} " f"on device '{nvml.device_get_name(device)}'" diff --git a/cuda_bindings/cuda/bindings/_test_helpers/mempool.py b/cuda_bindings/cuda/bindings/_test_helpers/mempool.py new file mode 100644 index 00000000000..e2a61e48c53 --- /dev/null +++ b/cuda_bindings/cuda/bindings/_test_helpers/mempool.py @@ -0,0 +1,57 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import sys + +import pytest + +from cuda.bindings import driver, runtime + + +# Keep in sync with the fallback in cuda_core/tests/conftest.py. The cuda_core +# copy is intentionally simpler because it only handles cuda_core CUDAError +# exceptions when this helper is absent from older published bindings. +def is_windows_mcdm_device(device=0): + if sys.platform != "win32": + return False + import cuda.bindings.nvml as nvml + + device_id = int(getattr(device, "device_id", device)) + (err,) = driver.cuInit(0) + if err != driver.CUresult.CUDA_SUCCESS: + return False + err, pci_bus_id = driver.cuDeviceGetPCIBusId(13, device_id) + if err != driver.CUresult.CUDA_SUCCESS: + return False + pci_bus_id = pci_bus_id.split(b"\x00", 1)[0].decode("ascii") + nvml.init_v2() + try: + handle = nvml.device_get_handle_by_pci_bus_id_v2(pci_bus_id) + current, _ = nvml.device_get_driver_model_v2(handle) + return current == nvml.DriverModel.DRIVER_MCDM + finally: + nvml.shutdown() + + +def xfail_if_mempool_oom(err_or_exc, api_name=None, device=0): + if api_name is not None and not isinstance(api_name, str): + device = api_name + api_name = None + + is_oom = err_or_exc in ( + driver.CUresult.CUDA_ERROR_OUT_OF_MEMORY, + runtime.cudaError_t.cudaErrorMemoryAllocation, + ) or "CUDA_ERROR_OUT_OF_MEMORY" in str(err_or_exc) + + if not is_oom: + return + try: + is_windows_mcdm = is_windows_mcdm_device(device) + except Exception: + # If MCDM detection fails, leave the primary test failure visible. + return + if not is_windows_mcdm: + return + + api_context = f"{api_name} " if api_name else "" + pytest.xfail(f"{api_context}could not reserve VA for mempool operations on Windows MCDM") diff --git a/cuda_bindings/cuda/bindings/_test_helpers/pep723.py b/cuda_bindings/cuda/bindings/_test_helpers/pep723.py new file mode 100644 index 00000000000..5ae21e622d3 --- /dev/null +++ b/cuda_bindings/cuda/bindings/_test_helpers/pep723.py @@ -0,0 +1,46 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + + +import importlib.metadata +import os +import re + +import pytest + + +def has_package_requirements_or_skip(example): + example_name = os.path.basename(example) + + with open(example, encoding="utf-8") as f: + content = f.read() + + # The canonical regex as defined in PEP 723 + pep723 = re.search(r"(?m)^# /// (?P[a-zA-Z0-9-]+)$\s(?P(^#(| .*)$\s)+)^# ///$", content) + if not pep723: + raise ValueError(f"PEP 723 metadata not found in {example_name}") + + metadata = {} + for line in pep723.group("content").splitlines(): + line = line.lstrip("# ").rstrip() + if not line: + continue + key, value = line.split("=", 1) + key = key.strip() + value = value.strip() + metadata[key] = value + + if "dependencies" not in metadata: + raise ValueError(f"PEP 723 dependencies not found in {example_name}") + + missing_dependencies = [] + dependencies = eval(metadata["dependencies"]) # noqa: S307 + for dependency in dependencies: + name = re.match("[a-zA-Z0-9_-]+", dependency) + try: + importlib.metadata.distribution(name.group(0)) + except importlib.metadata.PackageNotFoundError: + missing_dependencies.append(name.string) + + if missing_dependencies: + pytest.skip(f"Skipping {example} due to missing package requirement: {', '.join(missing_dependencies)}") diff --git a/cuda_bindings/cuda/bindings/cudla.pxd b/cuda_bindings/cuda/bindings/cudla.pxd new file mode 100644 index 00000000000..cb58d685a24 --- /dev/null +++ b/cuda_bindings/cuda/bindings/cudla.pxd @@ -0,0 +1,53 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This code was automatically generated across versions from 1.5.0 to 13.3.0. Do not modify it directly. + +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=e64a78a1b3e010d167373d7c9635ff4637dfd1a6a38ffafb671dcde4e12aaaad +from libc.stdint cimport intptr_t + +from .cycudla cimport * + + + + +############################################################################### +# Types +############################################################################### + +ctypedef cudlaDevHandle DevHandle +ctypedef cudlaModule Module + + +############################################################################### +# Enum +############################################################################### + +ctypedef cudlaStatus _Status +ctypedef cudlaMode _Mode +ctypedef cudlaModuleAttributeType _ModuleAttributeType +ctypedef cudlaFenceType _FenceType +ctypedef cudlaModuleLoadFlags _ModuleLoadFlags +ctypedef cudlaSubmissionFlags _SubmissionFlags +ctypedef cudlaAccessPermissionFlags _AccessPermissionFlags +ctypedef cudlaDevAttributeType _DevAttributeType + + +############################################################################### +# Functions +############################################################################### + +cpdef uint64_t get_version() except? -1 +cpdef uint64_t device_get_count() except? -1 +cpdef intptr_t create_device(uint64_t device, uint32_t flags) except * +cpdef intptr_t mem_register(intptr_t dev_handle, intptr_t ptr, size_t size, uint32_t flags) except * +cpdef intptr_t module_load_from_memory(intptr_t dev_handle, p_module, size_t module_size, uint32_t flags) except * +cpdef module_unload(intptr_t h_module, uint32_t flags) +cpdef submit_task(intptr_t dev_handle, intptr_t ptr_to_tasks, uint32_t num_tasks, intptr_t stream, uint32_t flags) +cpdef object device_get_attribute(intptr_t dev_handle, int attrib) except * +cpdef mem_unregister(intptr_t dev_handle, intptr_t dev_ptr) +cpdef int get_last_error(intptr_t dev_handle) except? 0 +cpdef destroy_device(intptr_t dev_handle) +cpdef set_task_timeout_in_ms(intptr_t dev_handle, uint32_t timeout) + +cpdef module_get_attributes(intptr_t h_module, int attr_type) except * diff --git a/cuda_bindings/cuda/bindings/cudla.pyx b/cuda_bindings/cuda/bindings/cudla.pyx new file mode 100644 index 00000000000..ce92c2deef9 --- /dev/null +++ b/cuda_bindings/cuda/bindings/cudla.pyx @@ -0,0 +1,1837 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=6e7ac86c22e602c08df8250f3b50c135945378aa8ae4ddb4e10174fd979c4aa5 + +# <<<< PREAMBLE CONTENT >>>> + +cimport cpython as _cyb_cpython +cimport cpython.buffer as _cyb_cpython_buffer +from cython cimport view as _cyb_view +from libc.stdlib cimport ( + calloc as _cyb_calloc, + free as _cyb_free, + malloc as _cyb_malloc, +) +from libc.string cimport ( + memcmp as _cyb_memcmp, + memcpy as _cyb_memcpy, +) +from enum import IntEnum as _cyb_IntEnum +import numpy as _numpy + +cdef _cyb___getbuffer(object self, _cyb_cpython.Py_buffer *buffer, void *ptr, int size, bint readonly): + buffer.buf = ptr + buffer.format = 'b' + buffer.internal = NULL + buffer.itemsize = 1 + buffer.len = size + buffer.ndim = 1 + buffer.obj = self + buffer.readonly = readonly + buffer.shape = &buffer.len + buffer.strides = &buffer.itemsize + buffer.suboffsets = NULL + +cdef _cyb_from_buffer(buffer, size, lowpp_type): + cdef _cyb_cpython.Py_buffer view + if _cyb_cpython.PyObject_GetBuffer(buffer, &view, _cyb_cpython_buffer.PyBUF_SIMPLE) != 0: + raise TypeError("buffer argument does not support the buffer protocol") + try: + if view.itemsize != 1: + raise ValueError("buffer itemsize must be 1 byte") + if view.len != size: + raise ValueError(f"buffer length must be {size} bytes") + return lowpp_type.from_ptr(view.buf, not view.readonly, buffer) + finally: + _cyb_cpython.PyBuffer_Release(&view) + +cdef _cyb_from_data(data, dtype_name, expected_dtype, lowpp_type): + # _numpy.recarray is a subclass of _numpy.ndarray, so implicitly handled here. + if isinstance(data, lowpp_type): + return data + if not isinstance(data, _numpy.ndarray): + raise TypeError("data argument must be a NumPy ndarray") + if data.size != 1: + raise ValueError("data array must have a size of 1") + if data.dtype != expected_dtype: + raise ValueError(f"data array must be of dtype {dtype_name}") + return lowpp_type.from_ptr(data.ctypes.data, not data.flags.writeable, data) + +# <<<< END OF PREAMBLE CONTENT >>>> + + +# This code was automatically generated across versions from 1.5.0 to 13.3.0. Do not modify it directly. + +cimport cython # NOQA +from libc.stdint cimport intptr_t, uintptr_t +from libc.stdlib cimport malloc, free + +from ._internal.utils cimport get_buffer_pointer + + + + +############################################################################### +# POD +############################################################################### + +cdef _get_external_memory_handle_desc_dtype_offsets(): + cdef cudlaExternalMemoryHandleDesc_t pod + return _numpy.dtype({ + 'names': ['ext_buf_object', 'size_'], + 'formats': [_numpy.intp, _numpy.uint64], + 'offsets': [ + (&(pod.extBufObject)) - (&pod), + (&(pod.size)) - (&pod), + ], + 'itemsize': sizeof(cudlaExternalMemoryHandleDesc_t), + }) + +external_memory_handle_desc_dtype = _get_external_memory_handle_desc_dtype_offsets() + +cdef class ExternalMemoryHandleDesc: + """Empty-initialize an instance of `cudlaExternalMemoryHandleDesc_t`. + + + .. seealso:: `cudlaExternalMemoryHandleDesc_t` + """ + cdef: + cudlaExternalMemoryHandleDesc_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(cudlaExternalMemoryHandleDesc_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ExternalMemoryHandleDesc") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef cudlaExternalMemoryHandleDesc_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.ExternalMemoryHandleDesc object at {hex(id(self))}>" + + @property + def ptr(self): + """Get the pointer address to the data as Python :class:`int`.""" + return (self._ptr) + + cdef intptr_t _get_ptr(self): + return (self._ptr) + + def __int__(self): + return (self._ptr) + + def __eq__(self, other): + cdef ExternalMemoryHandleDesc other_ + if not isinstance(other, ExternalMemoryHandleDesc): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(cudlaExternalMemoryHandleDesc_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(cudlaExternalMemoryHandleDesc_t), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + if key == 0 and isinstance(val, _numpy.ndarray): + self._ptr = _cyb_malloc(sizeof(cudlaExternalMemoryHandleDesc_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ExternalMemoryHandleDesc") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(cudlaExternalMemoryHandleDesc_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def ext_buf_object(self): + """int: """ + return (self._ptr[0].extBufObject) + + @ext_buf_object.setter + def ext_buf_object(self, val): + if self._readonly: + raise ValueError("This ExternalMemoryHandleDesc instance is read-only") + self._ptr[0].extBufObject = val + + @property + def size_(self): + """int: """ + return self._ptr[0].size + + @size_.setter + def size_(self, val): + if self._readonly: + raise ValueError("This ExternalMemoryHandleDesc instance is read-only") + self._ptr[0].size = val + + @staticmethod + def from_buffer(buffer): + """Create an ExternalMemoryHandleDesc instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(cudlaExternalMemoryHandleDesc_t), ExternalMemoryHandleDesc) + + @staticmethod + def from_data(data): + """Create an ExternalMemoryHandleDesc instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `external_memory_handle_desc_dtype` holding the data. + """ + return _cyb_from_data(data, "external_memory_handle_desc_dtype", external_memory_handle_desc_dtype, ExternalMemoryHandleDesc) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an ExternalMemoryHandleDesc instance wrapping the given pointer. + + Args: + ptr (intptr_t): pointer address as Python :class:`int` to the data. + owner (object): The Python object that owns the pointer. If not provided, data will be copied. + readonly (bool): whether the data is read-only (to the user). default is `False`. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef ExternalMemoryHandleDesc obj = ExternalMemoryHandleDesc.__new__(ExternalMemoryHandleDesc) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(cudlaExternalMemoryHandleDesc_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating ExternalMemoryHandleDesc") + _cyb_memcpy((obj._ptr), ptr, sizeof(cudlaExternalMemoryHandleDesc_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_external_semaphore_handle_desc_dtype_offsets(): + cdef cudlaExternalSemaphoreHandleDesc_t pod + return _numpy.dtype({ + 'names': ['ext_sync_object'], + 'formats': [_numpy.intp], + 'offsets': [ + (&(pod.extSyncObject)) - (&pod), + ], + 'itemsize': sizeof(cudlaExternalSemaphoreHandleDesc_t), + }) + +external_semaphore_handle_desc_dtype = _get_external_semaphore_handle_desc_dtype_offsets() + +cdef class ExternalSemaphoreHandleDesc: + """Empty-initialize an instance of `cudlaExternalSemaphoreHandleDesc_t`. + + + .. seealso:: `cudlaExternalSemaphoreHandleDesc_t` + """ + cdef: + cudlaExternalSemaphoreHandleDesc_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(cudlaExternalSemaphoreHandleDesc_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ExternalSemaphoreHandleDesc") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef cudlaExternalSemaphoreHandleDesc_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.ExternalSemaphoreHandleDesc object at {hex(id(self))}>" + + @property + def ptr(self): + """Get the pointer address to the data as Python :class:`int`.""" + return (self._ptr) + + cdef intptr_t _get_ptr(self): + return (self._ptr) + + def __int__(self): + return (self._ptr) + + def __eq__(self, other): + cdef ExternalSemaphoreHandleDesc other_ + if not isinstance(other, ExternalSemaphoreHandleDesc): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(cudlaExternalSemaphoreHandleDesc_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(cudlaExternalSemaphoreHandleDesc_t), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + if key == 0 and isinstance(val, _numpy.ndarray): + self._ptr = _cyb_malloc(sizeof(cudlaExternalSemaphoreHandleDesc_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ExternalSemaphoreHandleDesc") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(cudlaExternalSemaphoreHandleDesc_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def ext_sync_object(self): + """int: """ + return (self._ptr[0].extSyncObject) + + @ext_sync_object.setter + def ext_sync_object(self, val): + if self._readonly: + raise ValueError("This ExternalSemaphoreHandleDesc instance is read-only") + self._ptr[0].extSyncObject = val + + @staticmethod + def from_buffer(buffer): + """Create an ExternalSemaphoreHandleDesc instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(cudlaExternalSemaphoreHandleDesc_t), ExternalSemaphoreHandleDesc) + + @staticmethod + def from_data(data): + """Create an ExternalSemaphoreHandleDesc instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `external_semaphore_handle_desc_dtype` holding the data. + """ + return _cyb_from_data(data, "external_semaphore_handle_desc_dtype", external_semaphore_handle_desc_dtype, ExternalSemaphoreHandleDesc) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an ExternalSemaphoreHandleDesc instance wrapping the given pointer. + + Args: + ptr (intptr_t): pointer address as Python :class:`int` to the data. + owner (object): The Python object that owns the pointer. If not provided, data will be copied. + readonly (bool): whether the data is read-only (to the user). default is `False`. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef ExternalSemaphoreHandleDesc obj = ExternalSemaphoreHandleDesc.__new__(ExternalSemaphoreHandleDesc) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(cudlaExternalSemaphoreHandleDesc_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating ExternalSemaphoreHandleDesc") + _cyb_memcpy((obj._ptr), ptr, sizeof(cudlaExternalSemaphoreHandleDesc_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_module_tensor_descriptor_dtype_offsets(): + cdef cudlaModuleTensorDescriptor pod + return _numpy.dtype({ + 'names': ['name', 'size_', 'n', 'c', 'h', 'w', 'data_format', 'data_type', 'data_category', 'pixel_format', 'pixel_mapping', 'stride'], + 'formats': [(_numpy.int8, 81), _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8, (_numpy.uint32, 8)], + 'offsets': [ + (&(pod.name)) - (&pod), + (&(pod.size)) - (&pod), + (&(pod.n)) - (&pod), + (&(pod.c)) - (&pod), + (&(pod.h)) - (&pod), + (&(pod.w)) - (&pod), + (&(pod.dataFormat)) - (&pod), + (&(pod.dataType)) - (&pod), + (&(pod.dataCategory)) - (&pod), + (&(pod.pixelFormat)) - (&pod), + (&(pod.pixelMapping)) - (&pod), + (&(pod.stride)) - (&pod), + ], + 'itemsize': sizeof(cudlaModuleTensorDescriptor), + }) + +module_tensor_descriptor_dtype = _get_module_tensor_descriptor_dtype_offsets() + +cdef class ModuleTensorDescriptor: + """Empty-initialize an instance of `cudlaModuleTensorDescriptor`. + + + .. seealso:: `cudlaModuleTensorDescriptor` + """ + cdef: + cudlaModuleTensorDescriptor *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(cudlaModuleTensorDescriptor)) + if self._ptr == NULL: + raise MemoryError("Error allocating ModuleTensorDescriptor") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef cudlaModuleTensorDescriptor *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.ModuleTensorDescriptor object at {hex(id(self))}>" + + @property + def ptr(self): + """Get the pointer address to the data as Python :class:`int`.""" + return (self._ptr) + + cdef intptr_t _get_ptr(self): + return (self._ptr) + + def __int__(self): + return (self._ptr) + + def __eq__(self, other): + cdef ModuleTensorDescriptor other_ + if not isinstance(other, ModuleTensorDescriptor): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(cudlaModuleTensorDescriptor)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(cudlaModuleTensorDescriptor), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + if key == 0 and isinstance(val, _numpy.ndarray): + self._ptr = _cyb_malloc(sizeof(cudlaModuleTensorDescriptor)) + if self._ptr == NULL: + raise MemoryError("Error allocating ModuleTensorDescriptor") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(cudlaModuleTensorDescriptor)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def name(self): + """~_numpy.int8: (array of length 81).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].name) + + @name.setter + def name(self, val): + if self._readonly: + raise ValueError("This ModuleTensorDescriptor instance is read-only") + cdef bytes buf = val.encode() + if len(buf) >= 81: + raise ValueError("String too long for field name, max length is 80") + cdef char *ptr = buf + _cyb_memcpy((self._ptr[0].name), ptr, 81) + + @property + def size_(self): + """int: """ + return self._ptr[0].size + + @size_.setter + def size_(self, val): + if self._readonly: + raise ValueError("This ModuleTensorDescriptor instance is read-only") + self._ptr[0].size = val + + @property + def n(self): + """int: """ + return self._ptr[0].n + + @n.setter + def n(self, val): + if self._readonly: + raise ValueError("This ModuleTensorDescriptor instance is read-only") + self._ptr[0].n = val + + @property + def c(self): + """int: """ + return self._ptr[0].c + + @c.setter + def c(self, val): + if self._readonly: + raise ValueError("This ModuleTensorDescriptor instance is read-only") + self._ptr[0].c = val + + @property + def h(self): + """int: """ + return self._ptr[0].h + + @h.setter + def h(self, val): + if self._readonly: + raise ValueError("This ModuleTensorDescriptor instance is read-only") + self._ptr[0].h = val + + @property + def w(self): + """int: """ + return self._ptr[0].w + + @w.setter + def w(self, val): + if self._readonly: + raise ValueError("This ModuleTensorDescriptor instance is read-only") + self._ptr[0].w = val + + @property + def data_format(self): + """int: """ + return self._ptr[0].dataFormat + + @data_format.setter + def data_format(self, val): + if self._readonly: + raise ValueError("This ModuleTensorDescriptor instance is read-only") + self._ptr[0].dataFormat = val + + @property + def data_type(self): + """int: """ + return self._ptr[0].dataType + + @data_type.setter + def data_type(self, val): + if self._readonly: + raise ValueError("This ModuleTensorDescriptor instance is read-only") + self._ptr[0].dataType = val + + @property + def data_category(self): + """int: """ + return self._ptr[0].dataCategory + + @data_category.setter + def data_category(self, val): + if self._readonly: + raise ValueError("This ModuleTensorDescriptor instance is read-only") + self._ptr[0].dataCategory = val + + @property + def pixel_format(self): + """int: """ + return self._ptr[0].pixelFormat + + @pixel_format.setter + def pixel_format(self, val): + if self._readonly: + raise ValueError("This ModuleTensorDescriptor instance is read-only") + self._ptr[0].pixelFormat = val + + @property + def pixel_mapping(self): + """int: """ + return self._ptr[0].pixelMapping + + @pixel_mapping.setter + def pixel_mapping(self, val): + if self._readonly: + raise ValueError("This ModuleTensorDescriptor instance is read-only") + self._ptr[0].pixelMapping = val + + @property + def stride(self): + """~_numpy.uint32: (array of length 8).""" + cdef _cyb_view.array arr = _cyb_view.array(shape=(8,), itemsize=sizeof(uint32_t), format="I", mode="c", allocate_buffer=False) + arr.data = (&(self._ptr[0].stride)) + return _numpy.asarray(arr) + + @stride.setter + def stride(self, val): + if self._readonly: + raise ValueError("This ModuleTensorDescriptor instance is read-only") + if len(val) != 8: + raise ValueError(f"Expected length { 8 } for field stride, got {len(val)}") + cdef _cyb_view.array arr = _cyb_view.array(shape=(8,), itemsize=sizeof(uint32_t), format="I", mode="c") + arr[:] = _numpy.asarray(val, dtype=_numpy.uint32) + _cyb_memcpy((&(self._ptr[0].stride)), (arr.data), sizeof(uint32_t) * len(val)) + + @staticmethod + def from_buffer(buffer): + """Create an ModuleTensorDescriptor instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(cudlaModuleTensorDescriptor), ModuleTensorDescriptor) + + @staticmethod + def from_data(data): + """Create an ModuleTensorDescriptor instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `module_tensor_descriptor_dtype` holding the data. + """ + return _cyb_from_data(data, "module_tensor_descriptor_dtype", module_tensor_descriptor_dtype, ModuleTensorDescriptor) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an ModuleTensorDescriptor instance wrapping the given pointer. + + Args: + ptr (intptr_t): pointer address as Python :class:`int` to the data. + owner (object): The Python object that owns the pointer. If not provided, data will be copied. + readonly (bool): whether the data is read-only (to the user). default is `False`. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef ModuleTensorDescriptor obj = ModuleTensorDescriptor.__new__(ModuleTensorDescriptor) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(cudlaModuleTensorDescriptor)) + if obj._ptr == NULL: + raise MemoryError("Error allocating ModuleTensorDescriptor") + _cyb_memcpy((obj._ptr), ptr, sizeof(cudlaModuleTensorDescriptor)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_fence_dtype_offsets(): + cdef CudlaFence pod + return _numpy.dtype({ + 'names': ['fence', 'type'], + 'formats': [_numpy.intp, _numpy.int32], + 'offsets': [ + (&(pod.fence)) - (&pod), + (&(pod.type)) - (&pod), + ], + 'itemsize': sizeof(CudlaFence), + }) + +fence_dtype = _get_fence_dtype_offsets() + +cdef class Fence: + """Empty-initialize an instance of `CudlaFence`. + + + .. seealso:: `CudlaFence` + """ + cdef: + CudlaFence *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(CudlaFence)) + if self._ptr == NULL: + raise MemoryError("Error allocating Fence") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef CudlaFence *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.Fence object at {hex(id(self))}>" + + @property + def ptr(self): + """Get the pointer address to the data as Python :class:`int`.""" + return (self._ptr) + + cdef intptr_t _get_ptr(self): + return (self._ptr) + + def __int__(self): + return (self._ptr) + + def __eq__(self, other): + cdef Fence other_ + if not isinstance(other, Fence): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(CudlaFence)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(CudlaFence), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + if key == 0 and isinstance(val, _numpy.ndarray): + self._ptr = _cyb_malloc(sizeof(CudlaFence)) + if self._ptr == NULL: + raise MemoryError("Error allocating Fence") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(CudlaFence)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def fence(self): + """int: """ + return (self._ptr[0].fence) + + @fence.setter + def fence(self, val): + if self._readonly: + raise ValueError("This Fence instance is read-only") + self._ptr[0].fence = val + + @property + def type(self): + """int: """ + return (self._ptr[0].type) + + @type.setter + def type(self, val): + if self._readonly: + raise ValueError("This Fence instance is read-only") + self._ptr[0].type = val + + @staticmethod + def from_buffer(buffer): + """Create an Fence instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(CudlaFence), Fence) + + @staticmethod + def from_data(data): + """Create an Fence instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `fence_dtype` holding the data. + """ + return _cyb_from_data(data, "fence_dtype", fence_dtype, Fence) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an Fence instance wrapping the given pointer. + + Args: + ptr (intptr_t): pointer address as Python :class:`int` to the data. + owner (object): The Python object that owns the pointer. If not provided, data will be copied. + readonly (bool): whether the data is read-only (to the user). default is `False`. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef Fence obj = Fence.__new__(Fence) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(CudlaFence)) + if obj._ptr == NULL: + raise MemoryError("Error allocating Fence") + _cyb_memcpy((obj._ptr), ptr, sizeof(CudlaFence)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +dev_attribute_dtype = _numpy.dtype(( + _numpy.dtype((_numpy.void, sizeof(cudlaDevAttribute))), + { + "unified_addressing_supported": (_numpy.uint8, 0), + "device_version": (_numpy.uint32, 0), + } + )) + +cdef class DevAttribute: + """Empty-initialize an instance of `cudlaDevAttribute`. + + + .. seealso:: `cudlaDevAttribute` + """ + cdef: + cudlaDevAttribute *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(cudlaDevAttribute)) + if self._ptr == NULL: + raise MemoryError("Error allocating DevAttribute") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef cudlaDevAttribute *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.DevAttribute object at {hex(id(self))}>" + + @property + def ptr(self): + """Get the pointer address to the data as Python :class:`int`.""" + return (self._ptr) + + cdef intptr_t _get_ptr(self): + return (self._ptr) + + def __int__(self): + return (self._ptr) + + def __eq__(self, other): + cdef DevAttribute other_ + if not isinstance(other, DevAttribute): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(cudlaDevAttribute)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(cudlaDevAttribute), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + if key == 0 and isinstance(val, _numpy.ndarray): + self._ptr = _cyb_malloc(sizeof(cudlaDevAttribute)) + if self._ptr == NULL: + raise MemoryError("Error allocating DevAttribute") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(cudlaDevAttribute)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def unified_addressing_supported(self): + """int: """ + return self._ptr[0].unifiedAddressingSupported + + @unified_addressing_supported.setter + def unified_addressing_supported(self, val): + if self._readonly: + raise ValueError("This DevAttribute instance is read-only") + self._ptr[0].unifiedAddressingSupported = val + + @property + def device_version(self): + """int: """ + return self._ptr[0].deviceVersion + + @device_version.setter + def device_version(self, val): + if self._readonly: + raise ValueError("This DevAttribute instance is read-only") + self._ptr[0].deviceVersion = val + + @staticmethod + def from_buffer(buffer): + """Create an DevAttribute instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(cudlaDevAttribute), DevAttribute) + + @staticmethod + def from_data(data): + """Create an DevAttribute instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `dev_attribute_dtype` holding the data. + """ + return _cyb_from_data(data, "dev_attribute_dtype", dev_attribute_dtype, DevAttribute) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an DevAttribute instance wrapping the given pointer. + + Args: + ptr (intptr_t): pointer address as Python :class:`int` to the data. + owner (object): The Python object that owns the pointer. If not provided, data will be copied. + readonly (bool): whether the data is read-only (to the user). default is `False`. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef DevAttribute obj = DevAttribute.__new__(DevAttribute) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(cudlaDevAttribute)) + if obj._ptr == NULL: + raise MemoryError("Error allocating DevAttribute") + _cyb_memcpy((obj._ptr), ptr, sizeof(cudlaDevAttribute)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +module_attribute_dtype = _numpy.dtype(( + _numpy.dtype((_numpy.void, sizeof(cudlaModuleAttribute))), + { + "num_input_tensors": (_numpy.uint32, 0), + "num_output_tensors": (_numpy.uint32, 0), + "input_tensor_desc": (_numpy.intp, 0), + "output_tensor_desc": (_numpy.intp, 0), + } + )) + +cdef class ModuleAttribute: + """Empty-initialize an instance of `cudlaModuleAttribute`. + + + .. seealso:: `cudlaModuleAttribute` + """ + cdef: + cudlaModuleAttribute *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(cudlaModuleAttribute)) + if self._ptr == NULL: + raise MemoryError("Error allocating ModuleAttribute") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef cudlaModuleAttribute *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.ModuleAttribute object at {hex(id(self))}>" + + @property + def ptr(self): + """Get the pointer address to the data as Python :class:`int`.""" + return (self._ptr) + + cdef intptr_t _get_ptr(self): + return (self._ptr) + + def __int__(self): + return (self._ptr) + + def __eq__(self, other): + cdef ModuleAttribute other_ + if not isinstance(other, ModuleAttribute): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(cudlaModuleAttribute)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(cudlaModuleAttribute), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + if key == 0 and isinstance(val, _numpy.ndarray): + self._ptr = _cyb_malloc(sizeof(cudlaModuleAttribute)) + if self._ptr == NULL: + raise MemoryError("Error allocating ModuleAttribute") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(cudlaModuleAttribute)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def num_input_tensors(self): + """int: """ + return self._ptr[0].numInputTensors + + @num_input_tensors.setter + def num_input_tensors(self, val): + if self._readonly: + raise ValueError("This ModuleAttribute instance is read-only") + self._ptr[0].numInputTensors = val + + @property + def num_output_tensors(self): + """int: """ + return self._ptr[0].numOutputTensors + + @num_output_tensors.setter + def num_output_tensors(self, val): + if self._readonly: + raise ValueError("This ModuleAttribute instance is read-only") + self._ptr[0].numOutputTensors = val + + @property + def input_tensor_desc(self): + """int: """ + return (self._ptr[0].inputTensorDesc) + + @input_tensor_desc.setter + def input_tensor_desc(self, val): + if self._readonly: + raise ValueError("This ModuleAttribute instance is read-only") + self._ptr[0].inputTensorDesc = val + + @property + def output_tensor_desc(self): + """int: """ + return (self._ptr[0].outputTensorDesc) + + @output_tensor_desc.setter + def output_tensor_desc(self, val): + if self._readonly: + raise ValueError("This ModuleAttribute instance is read-only") + self._ptr[0].outputTensorDesc = val + + @staticmethod + def from_buffer(buffer): + """Create an ModuleAttribute instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(cudlaModuleAttribute), ModuleAttribute) + + @staticmethod + def from_data(data): + """Create an ModuleAttribute instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `module_attribute_dtype` holding the data. + """ + return _cyb_from_data(data, "module_attribute_dtype", module_attribute_dtype, ModuleAttribute) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an ModuleAttribute instance wrapping the given pointer. + + Args: + ptr (intptr_t): pointer address as Python :class:`int` to the data. + owner (object): The Python object that owns the pointer. If not provided, data will be copied. + readonly (bool): whether the data is read-only (to the user). default is `False`. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef ModuleAttribute obj = ModuleAttribute.__new__(ModuleAttribute) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(cudlaModuleAttribute)) + if obj._ptr == NULL: + raise MemoryError("Error allocating ModuleAttribute") + _cyb_memcpy((obj._ptr), ptr, sizeof(cudlaModuleAttribute)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_wait_events_dtype_offsets(): + cdef cudlaWaitEvents pod + return _numpy.dtype({ + 'names': ['pre_fences', 'num_events'], + 'formats': [_numpy.intp, _numpy.uint32], + 'offsets': [ + (&(pod.preFences)) - (&pod), + (&(pod.numEvents)) - (&pod), + ], + 'itemsize': sizeof(cudlaWaitEvents), + }) + +wait_events_dtype = _get_wait_events_dtype_offsets() + +cdef class WaitEvents: + """Empty-initialize an instance of `cudlaWaitEvents`. + + + .. seealso:: `cudlaWaitEvents` + """ + cdef: + cudlaWaitEvents *_ptr + object _owner + bint _owned + bint _readonly + dict _refs + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(cudlaWaitEvents)) + if self._ptr == NULL: + raise MemoryError("Error allocating WaitEvents") + self._owner = None + self._owned = True + self._readonly = False + self._refs = {} + + def __dealloc__(self): + cdef cudlaWaitEvents *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.WaitEvents object at {hex(id(self))}>" + + @property + def ptr(self): + """Get the pointer address to the data as Python :class:`int`.""" + return (self._ptr) + + cdef intptr_t _get_ptr(self): + return (self._ptr) + + def __int__(self): + return (self._ptr) + + def __eq__(self, other): + cdef WaitEvents other_ + if not isinstance(other, WaitEvents): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(cudlaWaitEvents)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(cudlaWaitEvents), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + if key == 0 and isinstance(val, _numpy.ndarray): + self._ptr = _cyb_malloc(sizeof(cudlaWaitEvents)) + if self._ptr == NULL: + raise MemoryError("Error allocating WaitEvents") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(cudlaWaitEvents)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def pre_fences(self): + """int: """ + if self._ptr[0].preFences == NULL or self._ptr[0].numEvents == 0: + return [] + return Fence.from_ptr((self._ptr[0].preFences), self._ptr[0].numEvents) + + @pre_fences.setter + def pre_fences(self, val): + if self._readonly: + raise ValueError("This WaitEvents instance is read-only") + cdef Fence arr = val + self._ptr[0].preFences = (arr._get_ptr()) + self._ptr[0].numEvents = len(arr) + self._refs["pre_fences"] = arr + + @staticmethod + def from_buffer(buffer): + """Create an WaitEvents instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(cudlaWaitEvents), WaitEvents) + + @staticmethod + def from_data(data): + """Create an WaitEvents instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `wait_events_dtype` holding the data. + """ + return _cyb_from_data(data, "wait_events_dtype", wait_events_dtype, WaitEvents) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an WaitEvents instance wrapping the given pointer. + + Args: + ptr (intptr_t): pointer address as Python :class:`int` to the data. + owner (object): The Python object that owns the pointer. If not provided, data will be copied. + readonly (bool): whether the data is read-only (to the user). default is `False`. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef WaitEvents obj = WaitEvents.__new__(WaitEvents) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(cudlaWaitEvents)) + if obj._ptr == NULL: + raise MemoryError("Error allocating WaitEvents") + _cyb_memcpy((obj._ptr), ptr, sizeof(cudlaWaitEvents)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + obj._refs = {} + return obj + + +cdef _get_signal_events_dtype_offsets(): + cdef cudlaSignalEvents pod + return _numpy.dtype({ + 'names': ['dev_ptrs', 'eof_fences', 'num_events'], + 'formats': [_numpy.intp, _numpy.intp, _numpy.uint32], + 'offsets': [ + (&(pod.devPtrs)) - (&pod), + (&(pod.eofFences)) - (&pod), + (&(pod.numEvents)) - (&pod), + ], + 'itemsize': sizeof(cudlaSignalEvents), + }) + +signal_events_dtype = _get_signal_events_dtype_offsets() + +cdef class SignalEvents: + """Empty-initialize an instance of `cudlaSignalEvents`. + + + .. seealso:: `cudlaSignalEvents` + """ + cdef: + cudlaSignalEvents *_ptr + object _owner + bint _owned + bint _readonly + dict _refs + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(cudlaSignalEvents)) + if self._ptr == NULL: + raise MemoryError("Error allocating SignalEvents") + self._owner = None + self._owned = True + self._readonly = False + self._refs = {} + + def __dealloc__(self): + cdef cudlaSignalEvents *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.SignalEvents object at {hex(id(self))}>" + + @property + def ptr(self): + """Get the pointer address to the data as Python :class:`int`.""" + return (self._ptr) + + cdef intptr_t _get_ptr(self): + return (self._ptr) + + def __int__(self): + return (self._ptr) + + def __eq__(self, other): + cdef SignalEvents other_ + if not isinstance(other, SignalEvents): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(cudlaSignalEvents)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(cudlaSignalEvents), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + if key == 0 and isinstance(val, _numpy.ndarray): + self._ptr = _cyb_malloc(sizeof(cudlaSignalEvents)) + if self._ptr == NULL: + raise MemoryError("Error allocating SignalEvents") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(cudlaSignalEvents)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def dev_ptrs(self): + """int: """ + if self._ptr[0].devPtrs == NULL or self._ptr[0].numEvents == 0: + return _cyb_view.array(shape=(1,), itemsize=sizeof(intptr_t), format="q", mode="c")[:0] + cdef _cyb_view.array arr = _cyb_view.array(shape=(self._ptr[0].numEvents,), itemsize=sizeof(intptr_t), format="q", mode="c", allocate_buffer=False) + arr.data = (self._ptr[0].devPtrs) + return arr + + @dev_ptrs.setter + def dev_ptrs(self, val): + if self._readonly: + raise ValueError("This SignalEvents instance is read-only") + cdef Py_ssize_t _n = len(val) + self._ptr[0].numEvents = _n + if _n == 0: + return + cdef _cyb_view.array arr = _cyb_view.array(shape=(_n,), itemsize=sizeof(intptr_t), format="q", mode="c") + cdef intptr_t[:] mv = arr + cdef Py_ssize_t i + for i in range(_n): + mv[i] = val[i] + self._ptr[0].devPtrs = (arr.data) + self._refs["dev_ptrs"] = arr + + @property + def eof_fences(self): + """int: """ + if self._ptr[0].eofFences == NULL or self._ptr[0].numEvents == 0: + return [] + return Fence.from_ptr((self._ptr[0].eofFences), self._ptr[0].numEvents) + + @eof_fences.setter + def eof_fences(self, val): + if self._readonly: + raise ValueError("This SignalEvents instance is read-only") + cdef Fence arr = val + self._ptr[0].eofFences = (arr._get_ptr()) + self._ptr[0].numEvents = len(arr) + self._refs["eof_fences"] = arr + + @staticmethod + def from_buffer(buffer): + """Create an SignalEvents instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(cudlaSignalEvents), SignalEvents) + + @staticmethod + def from_data(data): + """Create an SignalEvents instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `signal_events_dtype` holding the data. + """ + return _cyb_from_data(data, "signal_events_dtype", signal_events_dtype, SignalEvents) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an SignalEvents instance wrapping the given pointer. + + Args: + ptr (intptr_t): pointer address as Python :class:`int` to the data. + owner (object): The Python object that owns the pointer. If not provided, data will be copied. + readonly (bool): whether the data is read-only (to the user). default is `False`. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef SignalEvents obj = SignalEvents.__new__(SignalEvents) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(cudlaSignalEvents)) + if obj._ptr == NULL: + raise MemoryError("Error allocating SignalEvents") + _cyb_memcpy((obj._ptr), ptr, sizeof(cudlaSignalEvents)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + obj._refs = {} + return obj + + +cdef _get_task_dtype_offsets(): + cdef cudlaTask pod + return _numpy.dtype({ + 'names': ['module_handle', 'output_tensor', 'num_output_tensors', 'num_input_tensors', 'input_tensor', 'wait_events', 'signal_events'], + 'formats': [_numpy.intp, _numpy.intp, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.intp, _numpy.intp], + 'offsets': [ + (&(pod.moduleHandle)) - (&pod), + (&(pod.outputTensor)) - (&pod), + (&(pod.numOutputTensors)) - (&pod), + (&(pod.numInputTensors)) - (&pod), + (&(pod.inputTensor)) - (&pod), + (&(pod.waitEvents)) - (&pod), + (&(pod.signalEvents)) - (&pod), + ], + 'itemsize': sizeof(cudlaTask), + }) + +task_dtype = _get_task_dtype_offsets() + +cdef class Task: + """Empty-initialize an instance of `cudlaTask`. + + + .. seealso:: `cudlaTask` + """ + cdef: + cudlaTask *_ptr + object _owner + bint _owned + bint _readonly + dict _refs + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(cudlaTask)) + if self._ptr == NULL: + raise MemoryError("Error allocating Task") + self._owner = None + self._owned = True + self._readonly = False + self._refs = {} + + def __dealloc__(self): + cdef cudlaTask *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.Task object at {hex(id(self))}>" + + @property + def ptr(self): + """Get the pointer address to the data as Python :class:`int`.""" + return (self._ptr) + + cdef intptr_t _get_ptr(self): + return (self._ptr) + + def __int__(self): + return (self._ptr) + + def __eq__(self, other): + cdef Task other_ + if not isinstance(other, Task): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(cudlaTask)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(cudlaTask), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + if key == 0 and isinstance(val, _numpy.ndarray): + self._ptr = _cyb_malloc(sizeof(cudlaTask)) + if self._ptr == NULL: + raise MemoryError("Error allocating Task") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(cudlaTask)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def module_handle(self): + """int: """ + return (self._ptr[0].moduleHandle) + + @module_handle.setter + def module_handle(self, val): + if self._readonly: + raise ValueError("This Task instance is read-only") + self._ptr[0].moduleHandle = val + + @property + def output_tensor(self): + """int: """ + if self._ptr[0].outputTensor == NULL or self._ptr[0].numOutputTensors == 0: + return _cyb_view.array(shape=(1,), itemsize=sizeof(intptr_t), format="q", mode="c")[:0] + cdef _cyb_view.array arr = _cyb_view.array(shape=(self._ptr[0].numOutputTensors,), itemsize=sizeof(intptr_t), format="q", mode="c", allocate_buffer=False) + arr.data = (self._ptr[0].outputTensor) + return arr + + @output_tensor.setter + def output_tensor(self, val): + if self._readonly: + raise ValueError("This Task instance is read-only") + cdef Py_ssize_t _n = len(val) + self._ptr[0].numOutputTensors = _n + if _n == 0: + return + cdef _cyb_view.array arr = _cyb_view.array(shape=(_n,), itemsize=sizeof(intptr_t), format="q", mode="c") + cdef intptr_t[:] mv = arr + cdef Py_ssize_t i + for i in range(_n): + mv[i] = val[i] + self._ptr[0].outputTensor = (arr.data) + self._refs["output_tensor"] = arr + + @property + def input_tensor(self): + """int: """ + if self._ptr[0].inputTensor == NULL or self._ptr[0].numInputTensors == 0: + return _cyb_view.array(shape=(1,), itemsize=sizeof(intptr_t), format="q", mode="c")[:0] + cdef _cyb_view.array arr = _cyb_view.array(shape=(self._ptr[0].numInputTensors,), itemsize=sizeof(intptr_t), format="q", mode="c", allocate_buffer=False) + arr.data = (self._ptr[0].inputTensor) + return arr + + @input_tensor.setter + def input_tensor(self, val): + if self._readonly: + raise ValueError("This Task instance is read-only") + cdef Py_ssize_t _n = len(val) + self._ptr[0].numInputTensors = _n + if _n == 0: + return + cdef _cyb_view.array arr = _cyb_view.array(shape=(_n,), itemsize=sizeof(intptr_t), format="q", mode="c") + cdef intptr_t[:] mv = arr + cdef Py_ssize_t i + for i in range(_n): + mv[i] = val[i] + self._ptr[0].inputTensor = (arr.data) + self._refs["input_tensor"] = arr + + @property + def wait_events(self): + """int: """ + return (self._ptr[0].waitEvents) + + @wait_events.setter + def wait_events(self, val): + if self._readonly: + raise ValueError("This Task instance is read-only") + self._ptr[0].waitEvents = val + + @property + def signal_events(self): + """int: """ + return (self._ptr[0].signalEvents) + + @signal_events.setter + def signal_events(self, val): + if self._readonly: + raise ValueError("This Task instance is read-only") + self._ptr[0].signalEvents = val + + @staticmethod + def from_buffer(buffer): + """Create an Task instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(cudlaTask), Task) + + @staticmethod + def from_data(data): + """Create an Task instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `task_dtype` holding the data. + """ + return _cyb_from_data(data, "task_dtype", task_dtype, Task) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an Task instance wrapping the given pointer. + + Args: + ptr (intptr_t): pointer address as Python :class:`int` to the data. + owner (object): The Python object that owns the pointer. If not provided, data will be copied. + readonly (bool): whether the data is read-only (to the user). default is `False`. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef Task obj = Task.__new__(Task) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(cudlaTask)) + if obj._ptr == NULL: + raise MemoryError("Error allocating Task") + _cyb_memcpy((obj._ptr), ptr, sizeof(cudlaTask)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + obj._refs = {} + return obj + + +############################################################################### +# Enum +############################################################################### + +class Status(_cyb_IntEnum): + """ + See `cudlaStatus`. + """ + Success = cudlaSuccess + ErrorInvalidParam = cudlaErrorInvalidParam + ErrorOutOfResources = cudlaErrorOutOfResources + ErrorCreationFailed = cudlaErrorCreationFailed + ErrorInvalidAddress = cudlaErrorInvalidAddress + ErrorOs = cudlaErrorOs + ErrorCuda = cudlaErrorCuda + ErrorUmd = cudlaErrorUmd + ErrorInvalidDevice = cudlaErrorInvalidDevice + ErrorInvalidAttribute = cudlaErrorInvalidAttribute + ErrorIncompatibleDlaSWVersion = cudlaErrorIncompatibleDlaSWVersion + ErrorMemoryRegistered = cudlaErrorMemoryRegistered + ErrorInvalidModule = cudlaErrorInvalidModule + ErrorUnsupportedOperation = cudlaErrorUnsupportedOperation + ErrorNvSci = cudlaErrorNvSci + ErrorDriverNotFound = cudlaErrorDriverNotFound + ErrorDlaErrInvalidInput = cudlaErrorDlaErrInvalidInput + ErrorDlaErrInvalidPreAction = cudlaErrorDlaErrInvalidPreAction + ErrorDlaErrNoMem = cudlaErrorDlaErrNoMem + ErrorDlaErrProcessorBusy = cudlaErrorDlaErrProcessorBusy + ErrorDlaErrTaskStatusMismatch = cudlaErrorDlaErrTaskStatusMismatch + ErrorDlaErrEngineTimeout = cudlaErrorDlaErrEngineTimeout + ErrorDlaErrDataMismatch = cudlaErrorDlaErrDataMismatch + ErrorUnknown = cudlaErrorUnknown + +class Mode(_cyb_IntEnum): + """ + See `cudlaMode`. + """ + CUDA_DLA = CUDLA_CUDA_DLA + STANDALONE = CUDLA_STANDALONE + +class ModuleAttributeType(_cyb_IntEnum): + """ + See `cudlaModuleAttributeType`. + """ + NUM_INPUT_TENSORS = CUDLA_NUM_INPUT_TENSORS + NUM_OUTPUT_TENSORS = CUDLA_NUM_OUTPUT_TENSORS + INPUT_TENSOR_DESCRIPTORS = CUDLA_INPUT_TENSOR_DESCRIPTORS + OUTPUT_TENSOR_DESCRIPTORS = CUDLA_OUTPUT_TENSOR_DESCRIPTORS + NUM_OUTPUT_TASK_STATISTICS = CUDLA_NUM_OUTPUT_TASK_STATISTICS + OUTPUT_TASK_STATISTICS_DESCRIPTORS = CUDLA_OUTPUT_TASK_STATISTICS_DESCRIPTORS + +class FenceType(_cyb_IntEnum): + """ + See `cudlaFenceType`. + """ + NVSCISYNC_FENCE = CUDLA_NVSCISYNC_FENCE + NVSCISYNC_FENCE_SOF = CUDLA_NVSCISYNC_FENCE_SOF + +class ModuleLoadFlags(_cyb_IntEnum): + """ + See `cudlaModuleLoadFlags`. + """ + MODULE_DEFAULT = CUDLA_MODULE_DEFAULT + MODULE_ENABLE_FAULT_DIAGNOSTICS = CUDLA_MODULE_ENABLE_FAULT_DIAGNOSTICS + +class SubmissionFlags(_cyb_IntEnum): + """ + See `cudlaSubmissionFlags`. + """ + SUBMIT_NOOP = CUDLA_SUBMIT_NOOP + SUBMIT_SKIP_LOCK_ACQUIRE = CUDLA_SUBMIT_SKIP_LOCK_ACQUIRE + SUBMIT_DIAGNOSTICS_TASK = CUDLA_SUBMIT_DIAGNOSTICS_TASK + +class AccessPermissionFlags(_cyb_IntEnum): + """ + See `cudlaAccessPermissionFlags`. + """ + READ_WRITE_PERM = CUDLA_READ_WRITE_PERM + READ_ONLY_PERM = CUDLA_READ_ONLY_PERM + TASK_STATISTICS = CUDLA_TASK_STATISTICS + +class DevAttributeType(_cyb_IntEnum): + """ + See `cudlaDevAttributeType`. + """ + UNIFIED_ADDRESSING = CUDLA_UNIFIED_ADDRESSING + DEVICE_VERSION = CUDLA_DEVICE_VERSION + + +############################################################################### +# Error handling +############################################################################### + +class CudlaError(Exception): + + def __init__(self, status): + self.status = status + s = Status(status) + cdef str err = f"{s.name} ({s.value})" + super(CudlaError, self).__init__(err) + + def __reduce__(self): + return (type(self), (self.status,)) + + +@cython.profile(False) +cpdef inline check_status(int status): + if status != 0: + raise CudlaError(status) + + +############################################################################### +# Wrapper functions +############################################################################### + +cpdef uint64_t get_version() except? -1: + cdef uint64_t version + with nogil: + __status__ = cudlaGetVersion(&version) + check_status(__status__) + return version + + +cpdef uint64_t device_get_count() except? -1: + cdef uint64_t p_num_devices + with nogil: + __status__ = cudlaDeviceGetCount(&p_num_devices) + check_status(__status__) + return p_num_devices + + +cpdef intptr_t create_device(uint64_t device, uint32_t flags) except *: + cdef DevHandle dev_handle + if flags == CUDLA_STANDALONE: + raise CudlaError(cudlaErrorUnsupportedOperation) + with nogil: + __status__ = cudlaCreateDevice(device, &dev_handle, flags) + check_status(__status__) + return dev_handle + + +cpdef intptr_t mem_register(intptr_t dev_handle, intptr_t ptr, size_t size, uint32_t flags) except *: + cdef uint64_t* dev_ptr + with nogil: + __status__ = cudlaMemRegister(dev_handle, ptr, size, &dev_ptr, flags) + check_status(__status__) + return dev_ptr + + +cpdef intptr_t module_load_from_memory(intptr_t dev_handle, p_module, size_t module_size, uint32_t flags) except *: + cdef void* _p_module_ = get_buffer_pointer(p_module, module_size, readonly=True) + cdef Module h_module + with nogil: + __status__ = cudlaModuleLoadFromMemory(dev_handle, _p_module_, module_size, &h_module, flags) + check_status(__status__) + return h_module + + +cpdef module_unload(intptr_t h_module, uint32_t flags): + with nogil: + __status__ = cudlaModuleUnload(h_module, flags) + check_status(__status__) + + +cpdef submit_task(intptr_t dev_handle, intptr_t ptr_to_tasks, uint32_t num_tasks, intptr_t stream, uint32_t flags): + with nogil: + __status__ = cudlaSubmitTask(dev_handle, ptr_to_tasks, num_tasks, stream, flags) + check_status(__status__) + + +cpdef object device_get_attribute(intptr_t dev_handle, int attrib) except *: + cdef DevAttribute p_attribute_py = DevAttribute() + cdef cudlaDevAttribute *p_attribute = (p_attribute_py._get_ptr()) + with nogil: + __status__ = cudlaDeviceGetAttribute(dev_handle, attrib, p_attribute) + check_status(__status__) + return p_attribute_py + + +cpdef mem_unregister(intptr_t dev_handle, intptr_t dev_ptr): + with nogil: + __status__ = cudlaMemUnregister(dev_handle, dev_ptr) + check_status(__status__) + + +cpdef int get_last_error(intptr_t dev_handle) except? 0: + return cudlaGetLastError(dev_handle) + + +cpdef destroy_device(intptr_t dev_handle): + with nogil: + __status__ = cudlaDestroyDevice(dev_handle) + check_status(__status__) + + +cpdef set_task_timeout_in_ms(intptr_t dev_handle, uint32_t timeout): + with nogil: + __status__ = cudlaSetTaskTimeoutInMs(dev_handle, timeout) + check_status(__status__) + + +cpdef module_get_attributes(intptr_t h_module, int attr_type) except *: + """Query module attributes, interpreting the cudlaModuleAttribute union + based on the requested attribute type. + + For count attributes (NUM_INPUT_TENSORS, NUM_OUTPUT_TENSORS, + NUM_OUTPUT_TASK_STATISTICS), returns an int. + + For descriptor attributes (INPUT_TENSOR_DESCRIPTORS, + OUTPUT_TENSOR_DESCRIPTORS, OUTPUT_TASK_STATISTICS_DESCRIPTORS), + returns a list of ModuleTensorDescriptor objects. + """ + cdef int _attr_type = attr_type + cdef cudlaModuleAttribute count_attr + cdef cudlaModuleAttribute num_attr + cdef cudlaModuleAttribute desc_attr + cdef uint32_t count + cdef cudlaModuleTensorDescriptor* desc_buf + cdef uint32_t i + cdef int num_attr_type + + if _attr_type == CUDLA_NUM_INPUT_TENSORS or _attr_type == CUDLA_NUM_OUTPUT_TENSORS or _attr_type == CUDLA_NUM_OUTPUT_TASK_STATISTICS: + with nogil: + __status__ = cudlaModuleGetAttributes(h_module, _attr_type, &count_attr) + check_status(__status__) + return (count_attr.numInputTensors) + elif _attr_type == CUDLA_INPUT_TENSOR_DESCRIPTORS or _attr_type == CUDLA_OUTPUT_TENSOR_DESCRIPTORS or _attr_type == CUDLA_OUTPUT_TASK_STATISTICS_DESCRIPTORS: + if _attr_type == CUDLA_INPUT_TENSOR_DESCRIPTORS: + num_attr_type = CUDLA_NUM_INPUT_TENSORS + elif _attr_type == CUDLA_OUTPUT_TENSOR_DESCRIPTORS: + num_attr_type = CUDLA_NUM_OUTPUT_TENSORS + else: + num_attr_type = CUDLA_NUM_OUTPUT_TASK_STATISTICS + with nogil: + __status__ = cudlaModuleGetAttributes(h_module, num_attr_type, &num_attr) + check_status(__status__) + count = num_attr.numInputTensors + desc_buf = malloc(count * sizeof(cudlaModuleTensorDescriptor)) + if desc_buf == NULL: + raise MemoryError("Failed to allocate descriptor buffer") + try: + desc_attr.inputTensorDesc = desc_buf + with nogil: + __status__ = cudlaModuleGetAttributes(h_module, _attr_type, &desc_attr) + check_status(__status__) + result = [] + for i in range(count): + result.append(ModuleTensorDescriptor.from_ptr(&desc_buf[i], readonly=True)) + return result + finally: + free(desc_buf) + else: + raise ValueError(f"Unknown attribute type: {attr_type}") +del _cyb_IntEnum diff --git a/cuda_bindings/cuda/bindings/cufile.pxd b/cuda_bindings/cuda/bindings/cufile.pxd index 77475e13370..2bd8c7489ca 100644 --- a/cuda_bindings/cuda/bindings/cufile.pxd +++ b/cuda_bindings/cuda/bindings/cufile.pxd @@ -1,9 +1,10 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.9.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=232df43b5a8960f10286c172abc71222a3822087a1f6134e12d9341f3b53886c from libc.stdint cimport intptr_t from .cycufile cimport * @@ -80,6 +81,6 @@ cpdef stats_reset() cpdef get_stats_l1(intptr_t stats) cpdef get_stats_l2(intptr_t stats) cpdef get_stats_l3(intptr_t stats) -cpdef size_t get_bar_size_in_kb(int gpu_ind_ex) except? 0 +cpdef size_t get_bar_size_in_kb(int gpu_index) except? 0 cpdef set_parameter_posix_pool_slab_array(intptr_t size_values, intptr_t count_values, int len) cpdef get_parameter_posix_pool_slab_array(intptr_t size_values, intptr_t count_values, int len) diff --git a/cuda_bindings/cuda/bindings/cufile.pyx b/cuda_bindings/cuda/bindings/cufile.pyx index f73ad21c0ad..b3b875d2018 100644 --- a/cuda_bindings/cuda/bindings/cufile.pyx +++ b/cuda_bindings/cuda/bindings/cufile.pyx @@ -1,29 +1,55 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. - -cimport cython # NOQA -from libc cimport errno -from ._internal.utils cimport (get_buffer_pointer, get_nested_resource_ptr, - nested_resource) -from cuda.bindings._internal._fast_enum import FastEnum as _FastEnum - -import cython - -from cuda.bindings.driver import CUresult as pyCUresult - -from libc.stdlib cimport calloc, free, malloc -from cython cimport view -cimport cpython.buffer -cimport cpython.memoryview -cimport cpython -from libc.string cimport memcmp, memcpy +# This code was automatically generated across versions from 12.9.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=359f9b42f4f97b9a74570e1f7d20eb6f5faae2df194a6161f4d5a9512c3ffbe3 + +# <<<< PREAMBLE CONTENT >>>> + +cimport cpython as _cyb_cpython +cimport cpython.buffer as _cyb_cpython_buffer +cimport cpython.memoryview as _cyb_cpython_memoryview +from cython cimport view as _cyb_view +from libc.stdlib cimport ( + calloc as _cyb_calloc, + free as _cyb_free, + malloc as _cyb_malloc, +) +from libc.string cimport ( + memcmp as _cyb_memcmp, + memcpy as _cyb_memcpy, +) +from cuda.bindings._internal._fast_enum import FastEnum as _cyb_FastEnum import numpy as _numpy +cdef _cyb___getbuffer(object self, _cyb_cpython.Py_buffer *buffer, void *ptr, int size, bint readonly): + buffer.buf = ptr + buffer.format = 'b' + buffer.internal = NULL + buffer.itemsize = 1 + buffer.len = size + buffer.ndim = 1 + buffer.obj = self + buffer.readonly = readonly + buffer.shape = &buffer.len + buffer.strides = &buffer.itemsize + buffer.suboffsets = NULL -cdef __from_data(data, dtype_name, expected_dtype, lowpp_type): +cdef _cyb_from_buffer(buffer, size, lowpp_type): + cdef _cyb_cpython.Py_buffer view + if _cyb_cpython.PyObject_GetBuffer(buffer, &view, _cyb_cpython_buffer.PyBUF_SIMPLE) != 0: + raise TypeError("buffer argument does not support the buffer protocol") + try: + if view.itemsize != 1: + raise ValueError("buffer itemsize must be 1 byte") + if view.len != size: + raise ValueError(f"buffer length must be {size} bytes") + return lowpp_type.from_ptr(view.buf, not view.readonly, buffer) + finally: + _cyb_cpython.PyBuffer_Release(&view) + +cdef _cyb_from_data(data, dtype_name, expected_dtype, lowpp_type): # _numpy.recarray is a subclass of _numpy.ndarray, so implicitly handled here. if isinstance(data, lowpp_type): return data @@ -35,33 +61,17 @@ cdef __from_data(data, dtype_name, expected_dtype, lowpp_type): raise ValueError(f"data array must be of dtype {dtype_name}") return lowpp_type.from_ptr(data.ctypes.data, not data.flags.writeable, data) +# <<<< END OF PREAMBLE CONTENT >>>> -cdef __from_buffer(buffer, size, lowpp_type): - cdef Py_buffer view - if cpython.PyObject_GetBuffer(buffer, &view, cpython.PyBUF_SIMPLE) != 0: - raise TypeError("buffer argument does not support the buffer protocol") - try: - if view.itemsize != 1: - raise ValueError("buffer itemsize must be 1 byte") - if view.len != size: - raise ValueError(f"buffer length must be {size} bytes") - return lowpp_type.from_ptr(view.buf, not view.readonly, buffer) - finally: - cpython.PyBuffer_Release(&view) +cimport cython # NOQA +from libc cimport errno +from ._internal.utils cimport (get_buffer_pointer, get_nested_resource_ptr, + nested_resource) + +import cython -cdef __getbuffer(object self, cpython.Py_buffer *buffer, void *ptr, int size, bint readonly): - buffer.buf = ptr - buffer.format = 'b' - buffer.internal = NULL - buffer.itemsize = 1 - buffer.len = size - buffer.ndim = 1 - buffer.obj = self - buffer.readonly = readonly - buffer.shape = &buffer.len - buffer.strides = &buffer.itemsize - buffer.suboffsets = NULL +from cuda.bindings.driver import CUresult as pyCUresult ############################################################################### # POD @@ -75,21 +85,20 @@ _py_anon_pod1_dtype = _numpy.dtype(( } )) - cdef class _py_anon_pod1: - """Empty-initialize an instance of `_anon_pod1`. + """Empty-initialize an instance of `cuda_bindings_cufile__anon_pod1`. - .. seealso:: `_anon_pod1` + .. seealso:: `cuda_bindings_cufile__anon_pod1` """ cdef: - _anon_pod1 *_ptr + cuda_bindings_cufile__anon_pod1 *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = <_anon_pod1 *>calloc(1, sizeof((NULL).handle)) + self._ptr = _cyb_calloc(1, sizeof((NULL).handle)) if self._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod1") self._owner = None @@ -97,11 +106,11 @@ cdef class _py_anon_pod1: self._readonly = False def __dealloc__(self): - cdef _anon_pod1 *ptr + cdef cuda_bindings_cufile__anon_pod1 *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}._py_anon_pod1 object at {hex(id(self))}>" @@ -122,20 +131,20 @@ cdef class _py_anon_pod1: if not isinstance(other, _py_anon_pod1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof((NULL).handle)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof((NULL).handle)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof((NULL).handle), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof((NULL).handle), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = <_anon_pod1 *>malloc(sizeof((NULL).handle)) + self._ptr = _cyb_malloc(sizeof((NULL).handle)) if self._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod1") - memcpy(self._ptr, val.ctypes.data, sizeof((NULL).handle)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof((NULL).handle)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -167,7 +176,7 @@ cdef class _py_anon_pod1: @staticmethod def from_buffer(buffer): """Create an _py_anon_pod1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof((NULL).handle), _py_anon_pod1) + return _cyb_from_buffer(buffer, sizeof((NULL).handle), _py_anon_pod1) @staticmethod def from_data(data): @@ -176,7 +185,7 @@ cdef class _py_anon_pod1: Args: data (_numpy.ndarray): a single-element array of dtype `_py_anon_pod1_dtype` holding the data. """ - return __from_data(data, "_py_anon_pod1_dtype", _py_anon_pod1_dtype, _py_anon_pod1) + return _cyb_from_data(data, "_py_anon_pod1_dtype", _py_anon_pod1_dtype, _py_anon_pod1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -191,14 +200,14 @@ cdef class _py_anon_pod1: raise ValueError("ptr must not be null (0)") cdef _py_anon_pod1 obj = _py_anon_pod1.__new__(_py_anon_pod1) if owner is None: - obj._ptr = <_anon_pod1 *>malloc(sizeof((NULL).handle)) + obj._ptr = _cyb_malloc(sizeof((NULL).handle)) if obj._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod1") - memcpy((obj._ptr), ptr, sizeof((NULL).handle)) + _cyb_memcpy((obj._ptr), ptr, sizeof((NULL).handle)) obj._owner = None obj._owned = True else: - obj._ptr = <_anon_pod1 *>ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly @@ -206,7 +215,7 @@ cdef class _py_anon_pod1: cdef _get__py_anon_pod3_dtype_offsets(): - cdef _anon_pod3 pod = _anon_pod3() + cdef cuda_bindings_cufile__anon_pod3 pod return _numpy.dtype({ 'names': ['dev_ptr_base', 'file_offset', 'dev_ptr_offset', 'size_'], 'formats': [_numpy.intp, _numpy.int64, _numpy.int64, _numpy.uint64], @@ -222,19 +231,19 @@ cdef _get__py_anon_pod3_dtype_offsets(): _py_anon_pod3_dtype = _get__py_anon_pod3_dtype_offsets() cdef class _py_anon_pod3: - """Empty-initialize an instance of `_anon_pod3`. + """Empty-initialize an instance of `cuda_bindings_cufile__anon_pod3`. - .. seealso:: `_anon_pod3` + .. seealso:: `cuda_bindings_cufile__anon_pod3` """ cdef: - _anon_pod3 *_ptr + cuda_bindings_cufile__anon_pod3 *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = <_anon_pod3 *>calloc(1, sizeof((NULL).u.batch)) + self._ptr = _cyb_calloc(1, sizeof((NULL).u.batch)) if self._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod3") self._owner = None @@ -242,11 +251,11 @@ cdef class _py_anon_pod3: self._readonly = False def __dealloc__(self): - cdef _anon_pod3 *ptr + cdef cuda_bindings_cufile__anon_pod3 *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}._py_anon_pod3 object at {hex(id(self))}>" @@ -267,20 +276,20 @@ cdef class _py_anon_pod3: if not isinstance(other, _py_anon_pod3): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof((NULL).u.batch)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof((NULL).u.batch)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof((NULL).u.batch), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof((NULL).u.batch), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = <_anon_pod3 *>malloc(sizeof((NULL).u.batch)) + self._ptr = _cyb_malloc(sizeof((NULL).u.batch)) if self._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod3") - memcpy(self._ptr, val.ctypes.data, sizeof((NULL).u.batch)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof((NULL).u.batch)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -334,7 +343,7 @@ cdef class _py_anon_pod3: @staticmethod def from_buffer(buffer): """Create an _py_anon_pod3 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof((NULL).u.batch), _py_anon_pod3) + return _cyb_from_buffer(buffer, sizeof((NULL).u.batch), _py_anon_pod3) @staticmethod def from_data(data): @@ -343,7 +352,7 @@ cdef class _py_anon_pod3: Args: data (_numpy.ndarray): a single-element array of dtype `_py_anon_pod3_dtype` holding the data. """ - return __from_data(data, "_py_anon_pod3_dtype", _py_anon_pod3_dtype, _py_anon_pod3) + return _cyb_from_data(data, "_py_anon_pod3_dtype", _py_anon_pod3_dtype, _py_anon_pod3) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -358,14 +367,14 @@ cdef class _py_anon_pod3: raise ValueError("ptr must not be null (0)") cdef _py_anon_pod3 obj = _py_anon_pod3.__new__(_py_anon_pod3) if owner is None: - obj._ptr = <_anon_pod3 *>malloc(sizeof((NULL).u.batch)) + obj._ptr = _cyb_malloc(sizeof((NULL).u.batch)) if obj._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod3") - memcpy((obj._ptr), ptr, sizeof((NULL).u.batch)) + _cyb_memcpy((obj._ptr), ptr, sizeof((NULL).u.batch)) obj._owner = None obj._owned = True else: - obj._ptr = <_anon_pod3 *>ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly @@ -373,7 +382,7 @@ cdef class _py_anon_pod3: cdef _get_io_events_dtype_offsets(): - cdef CUfileIOEvents_t pod = CUfileIOEvents_t() + cdef CUfileIOEvents_t pod return _numpy.dtype({ 'names': ['cookie', 'status', 'ret'], 'formats': [_numpy.intp, _numpy.int32, _numpy.uint64], @@ -389,21 +398,17 @@ io_events_dtype = _get_io_events_dtype_offsets() cdef class IOEvents: """Empty-initialize an array of `CUfileIOEvents_t`. - The resulting object is of length `size` and of dtype `io_events_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `CUfileIOEvents_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=io_events_dtype) self._data = arr.view(_numpy.recarray) @@ -440,10 +445,10 @@ cdef class IOEvents: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def cookie(self): @@ -532,8 +537,8 @@ cdef class IOEvents: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef IOEvents obj = IOEvents.__new__(IOEvents) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(CUfileIOEvents_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=io_events_dtype) obj._data = data.view(_numpy.recarray) @@ -542,7 +547,7 @@ cdef class IOEvents: cdef _get_op_counter_dtype_offsets(): - cdef CUfileOpCounter_t pod = CUfileOpCounter_t() + cdef CUfileOpCounter_t pod return _numpy.dtype({ 'names': ['ok', 'err'], 'formats': [_numpy.uint64, _numpy.uint64], @@ -568,7 +573,7 @@ cdef class OpCounter: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(CUfileOpCounter_t)) + self._ptr = _cyb_calloc(1, sizeof(CUfileOpCounter_t)) if self._ptr == NULL: raise MemoryError("Error allocating OpCounter") self._owner = None @@ -580,7 +585,7 @@ cdef class OpCounter: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.OpCounter object at {hex(id(self))}>" @@ -601,20 +606,20 @@ cdef class OpCounter: if not isinstance(other, OpCounter): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(CUfileOpCounter_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(CUfileOpCounter_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(CUfileOpCounter_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(CUfileOpCounter_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(CUfileOpCounter_t)) + self._ptr = _cyb_malloc(sizeof(CUfileOpCounter_t)) if self._ptr == NULL: raise MemoryError("Error allocating OpCounter") - memcpy(self._ptr, val.ctypes.data, sizeof(CUfileOpCounter_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(CUfileOpCounter_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -646,7 +651,7 @@ cdef class OpCounter: @staticmethod def from_buffer(buffer): """Create an OpCounter instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(CUfileOpCounter_t), OpCounter) + return _cyb_from_buffer(buffer, sizeof(CUfileOpCounter_t), OpCounter) @staticmethod def from_data(data): @@ -655,7 +660,7 @@ cdef class OpCounter: Args: data (_numpy.ndarray): a single-element array of dtype `op_counter_dtype` holding the data. """ - return __from_data(data, "op_counter_dtype", op_counter_dtype, OpCounter) + return _cyb_from_data(data, "op_counter_dtype", op_counter_dtype, OpCounter) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -670,10 +675,10 @@ cdef class OpCounter: raise ValueError("ptr must not be null (0)") cdef OpCounter obj = OpCounter.__new__(OpCounter) if owner is None: - obj._ptr = malloc(sizeof(CUfileOpCounter_t)) + obj._ptr = _cyb_malloc(sizeof(CUfileOpCounter_t)) if obj._ptr == NULL: raise MemoryError("Error allocating OpCounter") - memcpy((obj._ptr), ptr, sizeof(CUfileOpCounter_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(CUfileOpCounter_t)) obj._owner = None obj._owned = True else: @@ -685,7 +690,7 @@ cdef class OpCounter: cdef _get_per_gpu_stats_dtype_offsets(): - cdef CUfilePerGpuStats_t pod = CUfilePerGpuStats_t() + cdef CUfilePerGpuStats_t pod return _numpy.dtype({ 'names': ['uuid', 'read_bytes', 'read_bw_bytes_per_sec', 'read_utilization', 'read_duration_us', 'n_total_reads', 'n_p2p_reads', 'n_nvfs_reads', 'n_posix_reads', 'n_unaligned_reads', 'n_dr_reads', 'n_sparse_regions', 'n_inline_regions', 'n_reads_err', 'writes_bytes', 'write_bw_bytes_per_sec', 'write_utilization', 'write_duration_us', 'n_total_writes', 'n_p2p_writes', 'n_nvfs_writes', 'n_posix_writes', 'n_unaligned_writes', 'n_dr_writes', 'n_writes_err', 'n_mmap', 'n_mmap_ok', 'n_mmap_err', 'n_mmap_free', 'reg_bytes'], 'formats': [(_numpy.int8, 16), _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64], @@ -728,21 +733,17 @@ per_gpu_stats_dtype = _get_per_gpu_stats_dtype_offsets() cdef class PerGpuStats: """Empty-initialize an array of `CUfilePerGpuStats_t`. - The resulting object is of length `size` and of dtype `per_gpu_stats_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `CUfilePerGpuStats_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=per_gpu_stats_dtype) self._data = arr.view(_numpy.recarray) @@ -779,10 +780,10 @@ cdef class PerGpuStats: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def uuid(self): @@ -1166,8 +1167,8 @@ cdef class PerGpuStats: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef PerGpuStats obj = PerGpuStats.__new__(PerGpuStats) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(CUfilePerGpuStats_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=per_gpu_stats_dtype) obj._data = data.view(_numpy.recarray) @@ -1176,7 +1177,7 @@ cdef class PerGpuStats: cdef _get_descr_dtype_offsets(): - cdef CUfileDescr_t pod = CUfileDescr_t() + cdef CUfileDescr_t pod return _numpy.dtype({ 'names': ['type', 'handle', 'fs_ops'], 'formats': [_numpy.int32, _py_anon_pod1_dtype, _numpy.intp], @@ -1192,21 +1193,17 @@ descr_dtype = _get_descr_dtype_offsets() cdef class Descr: """Empty-initialize an array of `CUfileDescr_t`. - The resulting object is of length `size` and of dtype `descr_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `CUfileDescr_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=descr_dtype) self._data = arr.view(_numpy.recarray) @@ -1243,10 +1240,10 @@ cdef class Descr: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def type(self): @@ -1333,8 +1330,8 @@ cdef class Descr: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef Descr obj = Descr.__new__(Descr) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(CUfileDescr_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=descr_dtype) obj._data = data.view(_numpy.recarray) @@ -1349,21 +1346,20 @@ _py_anon_pod2_dtype = _numpy.dtype(( } )) - cdef class _py_anon_pod2: - """Empty-initialize an instance of `_anon_pod2`. + """Empty-initialize an instance of `cuda_bindings_cufile__anon_pod2`. - .. seealso:: `_anon_pod2` + .. seealso:: `cuda_bindings_cufile__anon_pod2` """ cdef: - _anon_pod2 *_ptr + cuda_bindings_cufile__anon_pod2 *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = <_anon_pod2 *>calloc(1, sizeof((NULL).u)) + self._ptr = _cyb_calloc(1, sizeof((NULL).u)) if self._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod2") self._owner = None @@ -1371,11 +1367,11 @@ cdef class _py_anon_pod2: self._readonly = False def __dealloc__(self): - cdef _anon_pod2 *ptr + cdef cuda_bindings_cufile__anon_pod2 *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}._py_anon_pod2 object at {hex(id(self))}>" @@ -1396,20 +1392,20 @@ cdef class _py_anon_pod2: if not isinstance(other, _py_anon_pod2): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof((NULL).u)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof((NULL).u)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof((NULL).u), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof((NULL).u), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = <_anon_pod2 *>malloc(sizeof((NULL).u)) + self._ptr = _cyb_malloc(sizeof((NULL).u)) if self._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod2") - memcpy(self._ptr, val.ctypes.data, sizeof((NULL).u)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof((NULL).u)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -1426,12 +1422,12 @@ cdef class _py_anon_pod2: if self._readonly: raise ValueError("This _py_anon_pod2 instance is read-only") cdef _py_anon_pod3 val_ = val - memcpy(&(self._ptr[0].batch), (val_._get_ptr()), sizeof(_anon_pod3) * 1) + _cyb_memcpy(&(self._ptr[0].batch), (val_._get_ptr()), sizeof(cuda_bindings_cufile__anon_pod3) * 1) @staticmethod def from_buffer(buffer): """Create an _py_anon_pod2 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof((NULL).u), _py_anon_pod2) + return _cyb_from_buffer(buffer, sizeof((NULL).u), _py_anon_pod2) @staticmethod def from_data(data): @@ -1440,7 +1436,7 @@ cdef class _py_anon_pod2: Args: data (_numpy.ndarray): a single-element array of dtype `_py_anon_pod2_dtype` holding the data. """ - return __from_data(data, "_py_anon_pod2_dtype", _py_anon_pod2_dtype, _py_anon_pod2) + return _cyb_from_data(data, "_py_anon_pod2_dtype", _py_anon_pod2_dtype, _py_anon_pod2) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -1455,14 +1451,14 @@ cdef class _py_anon_pod2: raise ValueError("ptr must not be null (0)") cdef _py_anon_pod2 obj = _py_anon_pod2.__new__(_py_anon_pod2) if owner is None: - obj._ptr = <_anon_pod2 *>malloc(sizeof((NULL).u)) + obj._ptr = _cyb_malloc(sizeof((NULL).u)) if obj._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod2") - memcpy((obj._ptr), ptr, sizeof((NULL).u)) + _cyb_memcpy((obj._ptr), ptr, sizeof((NULL).u)) obj._owner = None obj._owned = True else: - obj._ptr = <_anon_pod2 *>ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly @@ -1470,7 +1466,7 @@ cdef class _py_anon_pod2: cdef _get_stats_level1_dtype_offsets(): - cdef CUfileStatsLevel1_t pod = CUfileStatsLevel1_t() + cdef CUfileStatsLevel1_t pod return _numpy.dtype({ 'names': ['read_ops', 'write_ops', 'hdl_register_ops', 'hdl_deregister_ops', 'buf_register_ops', 'buf_deregister_ops', 'read_bytes', 'write_bytes', 'read_bw_bytes_per_sec', 'write_bw_bytes_per_sec', 'read_lat_avg_us', 'write_lat_avg_us', 'read_ops_per_sec', 'write_ops_per_sec', 'read_lat_sum_us', 'write_lat_sum_us', 'batch_submit_ops', 'batch_complete_ops', 'batch_setup_ops', 'batch_cancel_ops', 'batch_destroy_ops', 'batch_enqueued_ops', 'batch_posix_enqueued_ops', 'batch_processed_ops', 'batch_posix_processed_ops', 'batch_nvfs_submit_ops', 'batch_p2p_submit_ops', 'batch_aio_submit_ops', 'batch_iouring_submit_ops', 'batch_mixed_io_submit_ops', 'batch_total_submit_ops', 'batch_read_bytes', 'batch_write_bytes', 'batch_read_bw_bytes', 'batch_write_bw_bytes', 'batch_submit_lat_avg_us', 'batch_completion_lat_avg_us', 'batch_submit_ops_per_sec', 'batch_complete_ops_per_sec', 'batch_submit_lat_sum_us', 'batch_completion_lat_sum_us', 'last_batch_read_bytes', 'last_batch_write_bytes'], 'formats': [op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64], @@ -1537,7 +1533,7 @@ cdef class StatsLevel1: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(CUfileStatsLevel1_t)) + self._ptr = _cyb_calloc(1, sizeof(CUfileStatsLevel1_t)) if self._ptr == NULL: raise MemoryError("Error allocating StatsLevel1") self._owner = None @@ -1549,7 +1545,7 @@ cdef class StatsLevel1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.StatsLevel1 object at {hex(id(self))}>" @@ -1570,20 +1566,20 @@ cdef class StatsLevel1: if not isinstance(other, StatsLevel1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(CUfileStatsLevel1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(CUfileStatsLevel1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(CUfileStatsLevel1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(CUfileStatsLevel1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(CUfileStatsLevel1_t)) + self._ptr = _cyb_malloc(sizeof(CUfileStatsLevel1_t)) if self._ptr == NULL: raise MemoryError("Error allocating StatsLevel1") - memcpy(self._ptr, val.ctypes.data, sizeof(CUfileStatsLevel1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(CUfileStatsLevel1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -1600,7 +1596,7 @@ cdef class StatsLevel1: if self._readonly: raise ValueError("This StatsLevel1 instance is read-only") cdef OpCounter val_ = val - memcpy(&(self._ptr[0].read_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) + _cyb_memcpy(&(self._ptr[0].read_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) @property def write_ops(self): @@ -1612,7 +1608,7 @@ cdef class StatsLevel1: if self._readonly: raise ValueError("This StatsLevel1 instance is read-only") cdef OpCounter val_ = val - memcpy(&(self._ptr[0].write_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) + _cyb_memcpy(&(self._ptr[0].write_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) @property def hdl_register_ops(self): @@ -1624,7 +1620,7 @@ cdef class StatsLevel1: if self._readonly: raise ValueError("This StatsLevel1 instance is read-only") cdef OpCounter val_ = val - memcpy(&(self._ptr[0].hdl_register_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) + _cyb_memcpy(&(self._ptr[0].hdl_register_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) @property def hdl_deregister_ops(self): @@ -1636,7 +1632,7 @@ cdef class StatsLevel1: if self._readonly: raise ValueError("This StatsLevel1 instance is read-only") cdef OpCounter val_ = val - memcpy(&(self._ptr[0].hdl_deregister_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) + _cyb_memcpy(&(self._ptr[0].hdl_deregister_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) @property def buf_register_ops(self): @@ -1648,7 +1644,7 @@ cdef class StatsLevel1: if self._readonly: raise ValueError("This StatsLevel1 instance is read-only") cdef OpCounter val_ = val - memcpy(&(self._ptr[0].buf_register_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) + _cyb_memcpy(&(self._ptr[0].buf_register_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) @property def buf_deregister_ops(self): @@ -1660,7 +1656,7 @@ cdef class StatsLevel1: if self._readonly: raise ValueError("This StatsLevel1 instance is read-only") cdef OpCounter val_ = val - memcpy(&(self._ptr[0].buf_deregister_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) + _cyb_memcpy(&(self._ptr[0].buf_deregister_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) @property def batch_submit_ops(self): @@ -1672,7 +1668,7 @@ cdef class StatsLevel1: if self._readonly: raise ValueError("This StatsLevel1 instance is read-only") cdef OpCounter val_ = val - memcpy(&(self._ptr[0].batch_submit_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) + _cyb_memcpy(&(self._ptr[0].batch_submit_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) @property def batch_complete_ops(self): @@ -1684,7 +1680,7 @@ cdef class StatsLevel1: if self._readonly: raise ValueError("This StatsLevel1 instance is read-only") cdef OpCounter val_ = val - memcpy(&(self._ptr[0].batch_complete_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) + _cyb_memcpy(&(self._ptr[0].batch_complete_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) @property def batch_setup_ops(self): @@ -1696,7 +1692,7 @@ cdef class StatsLevel1: if self._readonly: raise ValueError("This StatsLevel1 instance is read-only") cdef OpCounter val_ = val - memcpy(&(self._ptr[0].batch_setup_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) + _cyb_memcpy(&(self._ptr[0].batch_setup_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) @property def batch_cancel_ops(self): @@ -1708,7 +1704,7 @@ cdef class StatsLevel1: if self._readonly: raise ValueError("This StatsLevel1 instance is read-only") cdef OpCounter val_ = val - memcpy(&(self._ptr[0].batch_cancel_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) + _cyb_memcpy(&(self._ptr[0].batch_cancel_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) @property def batch_destroy_ops(self): @@ -1720,7 +1716,7 @@ cdef class StatsLevel1: if self._readonly: raise ValueError("This StatsLevel1 instance is read-only") cdef OpCounter val_ = val - memcpy(&(self._ptr[0].batch_destroy_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) + _cyb_memcpy(&(self._ptr[0].batch_destroy_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) @property def batch_enqueued_ops(self): @@ -1732,7 +1728,7 @@ cdef class StatsLevel1: if self._readonly: raise ValueError("This StatsLevel1 instance is read-only") cdef OpCounter val_ = val - memcpy(&(self._ptr[0].batch_enqueued_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) + _cyb_memcpy(&(self._ptr[0].batch_enqueued_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) @property def batch_posix_enqueued_ops(self): @@ -1744,7 +1740,7 @@ cdef class StatsLevel1: if self._readonly: raise ValueError("This StatsLevel1 instance is read-only") cdef OpCounter val_ = val - memcpy(&(self._ptr[0].batch_posix_enqueued_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) + _cyb_memcpy(&(self._ptr[0].batch_posix_enqueued_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) @property def batch_processed_ops(self): @@ -1756,7 +1752,7 @@ cdef class StatsLevel1: if self._readonly: raise ValueError("This StatsLevel1 instance is read-only") cdef OpCounter val_ = val - memcpy(&(self._ptr[0].batch_processed_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) + _cyb_memcpy(&(self._ptr[0].batch_processed_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) @property def batch_posix_processed_ops(self): @@ -1768,7 +1764,7 @@ cdef class StatsLevel1: if self._readonly: raise ValueError("This StatsLevel1 instance is read-only") cdef OpCounter val_ = val - memcpy(&(self._ptr[0].batch_posix_processed_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) + _cyb_memcpy(&(self._ptr[0].batch_posix_processed_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) @property def batch_nvfs_submit_ops(self): @@ -1780,7 +1776,7 @@ cdef class StatsLevel1: if self._readonly: raise ValueError("This StatsLevel1 instance is read-only") cdef OpCounter val_ = val - memcpy(&(self._ptr[0].batch_nvfs_submit_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) + _cyb_memcpy(&(self._ptr[0].batch_nvfs_submit_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) @property def batch_p2p_submit_ops(self): @@ -1792,7 +1788,7 @@ cdef class StatsLevel1: if self._readonly: raise ValueError("This StatsLevel1 instance is read-only") cdef OpCounter val_ = val - memcpy(&(self._ptr[0].batch_p2p_submit_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) + _cyb_memcpy(&(self._ptr[0].batch_p2p_submit_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) @property def batch_aio_submit_ops(self): @@ -1804,7 +1800,7 @@ cdef class StatsLevel1: if self._readonly: raise ValueError("This StatsLevel1 instance is read-only") cdef OpCounter val_ = val - memcpy(&(self._ptr[0].batch_aio_submit_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) + _cyb_memcpy(&(self._ptr[0].batch_aio_submit_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) @property def batch_iouring_submit_ops(self): @@ -1816,7 +1812,7 @@ cdef class StatsLevel1: if self._readonly: raise ValueError("This StatsLevel1 instance is read-only") cdef OpCounter val_ = val - memcpy(&(self._ptr[0].batch_iouring_submit_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) + _cyb_memcpy(&(self._ptr[0].batch_iouring_submit_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) @property def batch_mixed_io_submit_ops(self): @@ -1828,7 +1824,7 @@ cdef class StatsLevel1: if self._readonly: raise ValueError("This StatsLevel1 instance is read-only") cdef OpCounter val_ = val - memcpy(&(self._ptr[0].batch_mixed_io_submit_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) + _cyb_memcpy(&(self._ptr[0].batch_mixed_io_submit_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) @property def batch_total_submit_ops(self): @@ -1840,7 +1836,7 @@ cdef class StatsLevel1: if self._readonly: raise ValueError("This StatsLevel1 instance is read-only") cdef OpCounter val_ = val - memcpy(&(self._ptr[0].batch_total_submit_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) + _cyb_memcpy(&(self._ptr[0].batch_total_submit_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) @property def read_bytes(self): @@ -2087,7 +2083,7 @@ cdef class StatsLevel1: @staticmethod def from_buffer(buffer): """Create an StatsLevel1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(CUfileStatsLevel1_t), StatsLevel1) + return _cyb_from_buffer(buffer, sizeof(CUfileStatsLevel1_t), StatsLevel1) @staticmethod def from_data(data): @@ -2096,7 +2092,7 @@ cdef class StatsLevel1: Args: data (_numpy.ndarray): a single-element array of dtype `stats_level1_dtype` holding the data. """ - return __from_data(data, "stats_level1_dtype", stats_level1_dtype, StatsLevel1) + return _cyb_from_data(data, "stats_level1_dtype", stats_level1_dtype, StatsLevel1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -2111,10 +2107,10 @@ cdef class StatsLevel1: raise ValueError("ptr must not be null (0)") cdef StatsLevel1 obj = StatsLevel1.__new__(StatsLevel1) if owner is None: - obj._ptr = malloc(sizeof(CUfileStatsLevel1_t)) + obj._ptr = _cyb_malloc(sizeof(CUfileStatsLevel1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating StatsLevel1") - memcpy((obj._ptr), ptr, sizeof(CUfileStatsLevel1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(CUfileStatsLevel1_t)) obj._owner = None obj._owned = True else: @@ -2126,7 +2122,7 @@ cdef class StatsLevel1: cdef _get_io_params_dtype_offsets(): - cdef CUfileIOParams_t pod = CUfileIOParams_t() + cdef CUfileIOParams_t pod return _numpy.dtype({ 'names': ['mode', 'u', 'fh', 'opcode', 'cookie'], 'formats': [_numpy.int32, _py_anon_pod2_dtype, _numpy.intp, _numpy.int32, _numpy.intp], @@ -2144,21 +2140,17 @@ io_params_dtype = _get_io_params_dtype_offsets() cdef class IOParams: """Empty-initialize an array of `CUfileIOParams_t`. - The resulting object is of length `size` and of dtype `io_params_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `CUfileIOParams_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=io_params_dtype) self._data = arr.view(_numpy.recarray) @@ -2195,10 +2187,10 @@ cdef class IOParams: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def mode(self): @@ -2307,8 +2299,8 @@ cdef class IOParams: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef IOParams obj = IOParams.__new__(IOParams) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(CUfileIOParams_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=io_params_dtype) obj._data = data.view(_numpy.recarray) @@ -2317,7 +2309,7 @@ cdef class IOParams: cdef _get_stats_level2_dtype_offsets(): - cdef CUfileStatsLevel2_t pod = CUfileStatsLevel2_t() + cdef CUfileStatsLevel2_t pod return _numpy.dtype({ 'names': ['basic', 'read_size_kb_hist', 'write_size_kb_hist'], 'formats': [stats_level1_dtype, (_numpy.uint64, 32), (_numpy.uint64, 32)], @@ -2344,7 +2336,7 @@ cdef class StatsLevel2: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(CUfileStatsLevel2_t)) + self._ptr = _cyb_calloc(1, sizeof(CUfileStatsLevel2_t)) if self._ptr == NULL: raise MemoryError("Error allocating StatsLevel2") self._owner = None @@ -2356,7 +2348,7 @@ cdef class StatsLevel2: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.StatsLevel2 object at {hex(id(self))}>" @@ -2377,20 +2369,20 @@ cdef class StatsLevel2: if not isinstance(other, StatsLevel2): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(CUfileStatsLevel2_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(CUfileStatsLevel2_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(CUfileStatsLevel2_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(CUfileStatsLevel2_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(CUfileStatsLevel2_t)) + self._ptr = _cyb_malloc(sizeof(CUfileStatsLevel2_t)) if self._ptr == NULL: raise MemoryError("Error allocating StatsLevel2") - memcpy(self._ptr, val.ctypes.data, sizeof(CUfileStatsLevel2_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(CUfileStatsLevel2_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -2407,12 +2399,12 @@ cdef class StatsLevel2: if self._readonly: raise ValueError("This StatsLevel2 instance is read-only") cdef StatsLevel1 val_ = val - memcpy(&(self._ptr[0].basic), (val_._get_ptr()), sizeof(CUfileStatsLevel1_t) * 1) + _cyb_memcpy(&(self._ptr[0].basic), (val_._get_ptr()), sizeof(CUfileStatsLevel1_t) * 1) @property def read_size_kb_hist(self): """~_numpy.uint64: (array of length 32).""" - cdef view.array arr = view.array(shape=(32,), itemsize=sizeof(uint64_t), format="Q", mode="c", allocate_buffer=False) + cdef _cyb_view.array arr = _cyb_view.array(shape=(32,), itemsize=sizeof(uint64_t), format="Q", mode="c", allocate_buffer=False) arr.data = (&(self._ptr[0].read_size_kb_hist)) return _numpy.asarray(arr) @@ -2422,14 +2414,14 @@ cdef class StatsLevel2: raise ValueError("This StatsLevel2 instance is read-only") if len(val) != 32: raise ValueError(f"Expected length { 32 } for field read_size_kb_hist, got {len(val)}") - cdef view.array arr = view.array(shape=(32,), itemsize=sizeof(uint64_t), format="Q", mode="c") + cdef _cyb_view.array arr = _cyb_view.array(shape=(32,), itemsize=sizeof(uint64_t), format="Q", mode="c") arr[:] = _numpy.asarray(val, dtype=_numpy.uint64) - memcpy((&(self._ptr[0].read_size_kb_hist)), (arr.data), sizeof(uint64_t) * len(val)) + _cyb_memcpy((&(self._ptr[0].read_size_kb_hist)), (arr.data), sizeof(uint64_t) * len(val)) @property def write_size_kb_hist(self): """~_numpy.uint64: (array of length 32).""" - cdef view.array arr = view.array(shape=(32,), itemsize=sizeof(uint64_t), format="Q", mode="c", allocate_buffer=False) + cdef _cyb_view.array arr = _cyb_view.array(shape=(32,), itemsize=sizeof(uint64_t), format="Q", mode="c", allocate_buffer=False) arr.data = (&(self._ptr[0].write_size_kb_hist)) return _numpy.asarray(arr) @@ -2439,14 +2431,14 @@ cdef class StatsLevel2: raise ValueError("This StatsLevel2 instance is read-only") if len(val) != 32: raise ValueError(f"Expected length { 32 } for field write_size_kb_hist, got {len(val)}") - cdef view.array arr = view.array(shape=(32,), itemsize=sizeof(uint64_t), format="Q", mode="c") + cdef _cyb_view.array arr = _cyb_view.array(shape=(32,), itemsize=sizeof(uint64_t), format="Q", mode="c") arr[:] = _numpy.asarray(val, dtype=_numpy.uint64) - memcpy((&(self._ptr[0].write_size_kb_hist)), (arr.data), sizeof(uint64_t) * len(val)) + _cyb_memcpy((&(self._ptr[0].write_size_kb_hist)), (arr.data), sizeof(uint64_t) * len(val)) @staticmethod def from_buffer(buffer): """Create an StatsLevel2 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(CUfileStatsLevel2_t), StatsLevel2) + return _cyb_from_buffer(buffer, sizeof(CUfileStatsLevel2_t), StatsLevel2) @staticmethod def from_data(data): @@ -2455,7 +2447,7 @@ cdef class StatsLevel2: Args: data (_numpy.ndarray): a single-element array of dtype `stats_level2_dtype` holding the data. """ - return __from_data(data, "stats_level2_dtype", stats_level2_dtype, StatsLevel2) + return _cyb_from_data(data, "stats_level2_dtype", stats_level2_dtype, StatsLevel2) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -2470,10 +2462,10 @@ cdef class StatsLevel2: raise ValueError("ptr must not be null (0)") cdef StatsLevel2 obj = StatsLevel2.__new__(StatsLevel2) if owner is None: - obj._ptr = malloc(sizeof(CUfileStatsLevel2_t)) + obj._ptr = _cyb_malloc(sizeof(CUfileStatsLevel2_t)) if obj._ptr == NULL: raise MemoryError("Error allocating StatsLevel2") - memcpy((obj._ptr), ptr, sizeof(CUfileStatsLevel2_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(CUfileStatsLevel2_t)) obj._owner = None obj._owned = True else: @@ -2485,7 +2477,7 @@ cdef class StatsLevel2: cdef _get_stats_level3_dtype_offsets(): - cdef CUfileStatsLevel3_t pod = CUfileStatsLevel3_t() + cdef CUfileStatsLevel3_t pod return _numpy.dtype({ 'names': ['detailed', 'num_gpus', 'per_gpu_stats'], 'formats': [stats_level2_dtype, _numpy.uint32, (per_gpu_stats_dtype, 16)], @@ -2512,7 +2504,7 @@ cdef class StatsLevel3: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(CUfileStatsLevel3_t)) + self._ptr = _cyb_calloc(1, sizeof(CUfileStatsLevel3_t)) if self._ptr == NULL: raise MemoryError("Error allocating StatsLevel3") self._owner = None @@ -2524,7 +2516,7 @@ cdef class StatsLevel3: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.StatsLevel3 object at {hex(id(self))}>" @@ -2545,20 +2537,20 @@ cdef class StatsLevel3: if not isinstance(other, StatsLevel3): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(CUfileStatsLevel3_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(CUfileStatsLevel3_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(CUfileStatsLevel3_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(CUfileStatsLevel3_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(CUfileStatsLevel3_t)) + self._ptr = _cyb_malloc(sizeof(CUfileStatsLevel3_t)) if self._ptr == NULL: raise MemoryError("Error allocating StatsLevel3") - memcpy(self._ptr, val.ctypes.data, sizeof(CUfileStatsLevel3_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(CUfileStatsLevel3_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -2575,7 +2567,7 @@ cdef class StatsLevel3: if self._readonly: raise ValueError("This StatsLevel3 instance is read-only") cdef StatsLevel2 val_ = val - memcpy(&(self._ptr[0].detailed), (val_._get_ptr()), sizeof(CUfileStatsLevel2_t) * 1) + _cyb_memcpy(&(self._ptr[0].detailed), (val_._get_ptr()), sizeof(CUfileStatsLevel2_t) * 1) @property def per_gpu_stats(self): @@ -2589,7 +2581,7 @@ cdef class StatsLevel3: cdef PerGpuStats val_ = val if len(val) != 16: raise ValueError(f"Expected length { 16 } for field per_gpu_stats, got {len(val)}") - memcpy(&(self._ptr[0].per_gpu_stats), (val_._get_ptr()), sizeof(CUfilePerGpuStats_t) * 16) + _cyb_memcpy(&(self._ptr[0].per_gpu_stats), (val_._get_ptr()), sizeof(CUfilePerGpuStats_t) * 16) @property def num_gpus(self): @@ -2605,7 +2597,7 @@ cdef class StatsLevel3: @staticmethod def from_buffer(buffer): """Create an StatsLevel3 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(CUfileStatsLevel3_t), StatsLevel3) + return _cyb_from_buffer(buffer, sizeof(CUfileStatsLevel3_t), StatsLevel3) @staticmethod def from_data(data): @@ -2614,7 +2606,7 @@ cdef class StatsLevel3: Args: data (_numpy.ndarray): a single-element array of dtype `stats_level3_dtype` holding the data. """ - return __from_data(data, "stats_level3_dtype", stats_level3_dtype, StatsLevel3) + return _cyb_from_data(data, "stats_level3_dtype", stats_level3_dtype, StatsLevel3) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -2629,10 +2621,10 @@ cdef class StatsLevel3: raise ValueError("ptr must not be null (0)") cdef StatsLevel3 obj = StatsLevel3.__new__(StatsLevel3) if owner is None: - obj._ptr = malloc(sizeof(CUfileStatsLevel3_t)) + obj._ptr = _cyb_malloc(sizeof(CUfileStatsLevel3_t)) if obj._ptr == NULL: raise MemoryError("Error allocating StatsLevel3") - memcpy((obj._ptr), ptr, sizeof(CUfileStatsLevel3_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(CUfileStatsLevel3_t)) obj._owner = None obj._owned = True else: @@ -2643,12 +2635,11 @@ cdef class StatsLevel3: return obj - ############################################################################### # Enum ############################################################################### -class OpError(_FastEnum): +class OpError(_cyb_FastEnum): """ See `CUfileOpError`. """ @@ -2702,7 +2693,7 @@ class OpError(_FastEnum): BATCH_NOCOMPAT_ERROR = CU_FILE_BATCH_NOCOMPAT_ERROR IO_MAX_ERROR = CU_FILE_IO_MAX_ERROR -class DriverStatusFlags(_FastEnum): +class DriverStatusFlags(_cyb_FastEnum): """ See `CUfileDriverStatusFlags_t`. """ @@ -2721,7 +2712,7 @@ class DriverStatusFlags(_FastEnum): VIRTIOFS_SUPPORTED = (CU_FILE_VIRTIOFS_SUPPORTED, 'Support for VirtioFS') MAX_TARGET_TYPES = (CU_FILE_MAX_TARGET_TYPES, 'Maximum FS supported') -class DriverControlFlags(_FastEnum): +class DriverControlFlags(_cyb_FastEnum): """ See `CUfileDriverControlFlags_t`. """ @@ -2730,7 +2721,7 @@ class DriverControlFlags(_FastEnum): POSIX_IO_MODE = (CU_FILE_POSIX_IO_MODE, 'Vanilla posix io mode. properties.posix_io_mode') FALLBACK_IO_MODE = (CU_FILE_FALLBACK_IO_MODE, 'Fallback io mode. properties.gds_fallback_io') -class FeatureFlags(_FastEnum): +class FeatureFlags(_cyb_FastEnum): """ See `CUfileFeatureFlags_t`. """ @@ -2740,7 +2731,7 @@ class FeatureFlags(_FastEnum): PARALLEL_IO_SUPPORTED = (CU_FILE_PARALLEL_IO_SUPPORTED, 'Supported') P2P_SUPPORTED = (CU_FILE_P2P_SUPPORTED, 'Support for PCI P2PDMA') -class FileHandleType(_FastEnum): +class FileHandleType(_cyb_FastEnum): """ See `CUfileFileHandleType`. """ @@ -2748,14 +2739,14 @@ class FileHandleType(_FastEnum): OPAQUE_WIN32 = (CU_FILE_HANDLE_TYPE_OPAQUE_WIN32, 'Windows based handle (unsupported)') USERSPACE_FS = CU_FILE_HANDLE_TYPE_USERSPACE_FS -class Opcode(_FastEnum): +class Opcode(_cyb_FastEnum): """ See `CUfileOpcode_t`. """ READ = CUFILE_READ WRITE = CUFILE_WRITE -class Status(_FastEnum): +class Status(_cyb_FastEnum): """ See `CUfileStatus_t`. """ @@ -2767,13 +2758,13 @@ class Status(_FastEnum): TIMEOUT = CUFILE_TIMEOUT FAILED = CUFILE_FAILED -class BatchMode(_FastEnum): +class BatchMode(_cyb_FastEnum): """ See `CUfileBatchMode_t`. """ BATCH = CUFILE_BATCH -class SizeTConfigParameter(_FastEnum): +class SizeTConfigParameter(_cyb_FastEnum): """ See `CUFileSizeTConfigParameter_t`. """ @@ -2790,7 +2781,7 @@ class SizeTConfigParameter(_FastEnum): POLLTHRESHOLD_SIZE_KB = CUFILE_PARAM_POLLTHRESHOLD_SIZE_KB PROPERTIES_BATCH_IO_TIMEOUT_MS = CUFILE_PARAM_PROPERTIES_BATCH_IO_TIMEOUT_MS -class BoolConfigParameter(_FastEnum): +class BoolConfigParameter(_cyb_FastEnum): """ See `CUFileBoolConfigParameter_t`. """ @@ -2807,7 +2798,7 @@ class BoolConfigParameter(_FastEnum): SKIP_TOPOLOGY_DETECTION = CUFILE_PARAM_SKIP_TOPOLOGY_DETECTION STREAM_MEMOPS_BYPASS = CUFILE_PARAM_STREAM_MEMOPS_BYPASS -class StringConfigParameter(_FastEnum): +class StringConfigParameter(_cyb_FastEnum): """ See `CUFileStringConfigParameter_t`. """ @@ -2815,7 +2806,7 @@ class StringConfigParameter(_FastEnum): ENV_LOGFILE_PATH = CUFILE_PARAM_ENV_LOGFILE_PATH LOG_DIR = CUFILE_PARAM_LOG_DIR -class ArrayConfigParameter(_FastEnum): +class ArrayConfigParameter(_cyb_FastEnum): """ See `CUFileArrayConfigParameter_t`. """ @@ -2824,7 +2815,7 @@ class ArrayConfigParameter(_FastEnum): GPU_BOUNCE_BUFFER_SLAB_SIZE_KB = CUFILE_PARAM_GPU_BOUNCE_BUFFER_SLAB_SIZE_KB GPU_BOUNCE_BUFFER_SLAB_COUNT = CUFILE_PARAM_GPU_BOUNCE_BUFFER_SLAB_COUNT -class P2PFlags(_FastEnum): +class P2PFlags(_cyb_FastEnum): """ See `CUfileP2PFlags_t`. """ @@ -3112,7 +3103,7 @@ cpdef str get_parameter_string(int param, int len): with nogil: __status__ = cuFileGetParameterString(<_StringConfigParameter>param, desc_str, len) check_status(__status__) - return cpython.PyUnicode_FromString(desc_str) + return _cyb_cpython.PyUnicode_FromString(desc_str) cpdef set_parameter_size_t(int param, size_t value): @@ -3217,7 +3208,7 @@ cpdef get_stats_l1(intptr_t stats): """Get Level 1 cuFile statistics. Args: - stats (intptr_t): Pointer to CUfileStatsLevel1_t structure to be filled. + stats (intptr_t): Pointer to ``CUfileStatsLevel1_t`` structure to be filled. .. seealso:: `cuFileGetStatsL1` """ @@ -3230,7 +3221,7 @@ cpdef get_stats_l2(intptr_t stats): """Get Level 2 cuFile statistics. Args: - stats (intptr_t): Pointer to CUfileStatsLevel2_t structure to be filled. + stats (intptr_t): Pointer to ``CUfileStatsLevel2_t`` structure to be filled. .. seealso:: `cuFileGetStatsL2` """ @@ -3243,7 +3234,7 @@ cpdef get_stats_l3(intptr_t stats): """Get Level 3 cuFile statistics. Args: - stats (intptr_t): Pointer to CUfileStatsLevel3_t structure to be filled. + stats (intptr_t): Pointer to ``CUfileStatsLevel3_t`` structure to be filled. .. seealso:: `cuFileGetStatsL3` """ @@ -3252,10 +3243,10 @@ cpdef get_stats_l3(intptr_t stats): check_status(__status__) -cpdef size_t get_bar_size_in_kb(int gpu_ind_ex) except? 0: +cpdef size_t get_bar_size_in_kb(int gpu_index) except? 0: cdef size_t bar_size with nogil: - __status__ = cuFileGetBARSizeInKB(gpu_ind_ex, &bar_size) + __status__ = cuFileGetBARSizeInKB(gpu_index, &bar_size) check_status(__status__) return bar_size @@ -3350,3 +3341,4 @@ cpdef write(intptr_t fh, intptr_t buf_ptr_base, size_t size, off_t file_offset, status = cuFileWrite(fh, buf_ptr_base, size, file_offset, buf_ptr_offset) check_status(status) return status +del _cyb_FastEnum diff --git a/cuda_bindings/cuda/bindings/cycudla.pxd b/cuda_bindings/cuda/bindings/cycudla.pxd new file mode 100644 index 00000000000..6eee248e7d5 --- /dev/null +++ b/cuda_bindings/cuda/bindings/cycudla.pxd @@ -0,0 +1,161 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This code was automatically generated across versions from 1.5.0 to 13.3.0. Do not modify it directly. +# This layer exposes the C header to Cython as-is. + +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=c4dacd5de0bc9a6ac0cc92dabed1728cc6133d0448924ea6db4f9c740ff089b6 +from libc.stdint cimport int8_t, int16_t, int32_t, int64_t +from libc.stdint cimport uint8_t, uint16_t, uint32_t, uint64_t +from libc.stdint cimport intptr_t, uintptr_t +from libc.stddef cimport size_t + + + + +############################################################################### +# Types (structs, enums, ...) +############################################################################### + +# enums +ctypedef enum cudlaStatus "cudlaStatus": + cudlaSuccess "cudlaSuccess" = 0 + cudlaErrorInvalidParam "cudlaErrorInvalidParam" = 1 + cudlaErrorOutOfResources "cudlaErrorOutOfResources" = 2 + cudlaErrorCreationFailed "cudlaErrorCreationFailed" = 3 + cudlaErrorInvalidAddress "cudlaErrorInvalidAddress" = 4 + cudlaErrorOs "cudlaErrorOs" = 5 + cudlaErrorCuda "cudlaErrorCuda" = 6 + cudlaErrorUmd "cudlaErrorUmd" = 7 + cudlaErrorInvalidDevice "cudlaErrorInvalidDevice" = 8 + cudlaErrorInvalidAttribute "cudlaErrorInvalidAttribute" = 9 + cudlaErrorIncompatibleDlaSWVersion "cudlaErrorIncompatibleDlaSWVersion" = 10 + cudlaErrorMemoryRegistered "cudlaErrorMemoryRegistered" = 11 + cudlaErrorInvalidModule "cudlaErrorInvalidModule" = 12 + cudlaErrorUnsupportedOperation "cudlaErrorUnsupportedOperation" = 13 + cudlaErrorNvSci "cudlaErrorNvSci" = 14 + cudlaErrorDriverNotFound "cudlaErrorDriverNotFound" = 15 + cudlaErrorDlaErrInvalidInput "cudlaErrorDlaErrInvalidInput" = 0x40000001 + cudlaErrorDlaErrInvalidPreAction "cudlaErrorDlaErrInvalidPreAction" = 0x40000002 + cudlaErrorDlaErrNoMem "cudlaErrorDlaErrNoMem" = 0x40000003 + cudlaErrorDlaErrProcessorBusy "cudlaErrorDlaErrProcessorBusy" = 0x40000004 + cudlaErrorDlaErrTaskStatusMismatch "cudlaErrorDlaErrTaskStatusMismatch" = 0x40000005 + cudlaErrorDlaErrEngineTimeout "cudlaErrorDlaErrEngineTimeout" = 0x40000006 + cudlaErrorDlaErrDataMismatch "cudlaErrorDlaErrDataMismatch" = 0x40000007 + cudlaErrorUnknown "cudlaErrorUnknown" = 0x7fffffff + _CUDLASTATUS_INTERNAL_LOADING_ERROR "_CUDLASTATUS_INTERNAL_LOADING_ERROR" = -42 + +ctypedef enum cudlaMode "cudlaMode": + CUDLA_CUDA_DLA "CUDLA_CUDA_DLA" = 0 + CUDLA_STANDALONE "CUDLA_STANDALONE" = 1 + +ctypedef enum cudlaModuleAttributeType "cudlaModuleAttributeType": + CUDLA_NUM_INPUT_TENSORS "CUDLA_NUM_INPUT_TENSORS" = 0 + CUDLA_NUM_OUTPUT_TENSORS "CUDLA_NUM_OUTPUT_TENSORS" = 1 + CUDLA_INPUT_TENSOR_DESCRIPTORS "CUDLA_INPUT_TENSOR_DESCRIPTORS" = 2 + CUDLA_OUTPUT_TENSOR_DESCRIPTORS "CUDLA_OUTPUT_TENSOR_DESCRIPTORS" = 3 + CUDLA_NUM_OUTPUT_TASK_STATISTICS "CUDLA_NUM_OUTPUT_TASK_STATISTICS" = 4 + CUDLA_OUTPUT_TASK_STATISTICS_DESCRIPTORS "CUDLA_OUTPUT_TASK_STATISTICS_DESCRIPTORS" = 5 + +ctypedef enum cudlaFenceType "cudlaFenceType": + CUDLA_NVSCISYNC_FENCE "CUDLA_NVSCISYNC_FENCE" = 1 + CUDLA_NVSCISYNC_FENCE_SOF "CUDLA_NVSCISYNC_FENCE_SOF" = 2 + +ctypedef enum cudlaModuleLoadFlags "cudlaModuleLoadFlags": + CUDLA_MODULE_DEFAULT "CUDLA_MODULE_DEFAULT" = 0 + CUDLA_MODULE_ENABLE_FAULT_DIAGNOSTICS "CUDLA_MODULE_ENABLE_FAULT_DIAGNOSTICS" = 1 + +ctypedef enum cudlaSubmissionFlags "cudlaSubmissionFlags": + CUDLA_SUBMIT_NOOP "CUDLA_SUBMIT_NOOP" = 1 + CUDLA_SUBMIT_SKIP_LOCK_ACQUIRE "CUDLA_SUBMIT_SKIP_LOCK_ACQUIRE" = (1 << 1) + CUDLA_SUBMIT_DIAGNOSTICS_TASK "CUDLA_SUBMIT_DIAGNOSTICS_TASK" = (1 << 2) + +ctypedef enum cudlaAccessPermissionFlags "cudlaAccessPermissionFlags": + CUDLA_READ_WRITE_PERM "CUDLA_READ_WRITE_PERM" = 0 + CUDLA_READ_ONLY_PERM "CUDLA_READ_ONLY_PERM" = 1 + CUDLA_TASK_STATISTICS "CUDLA_TASK_STATISTICS" = (1 << 1) + +ctypedef enum cudlaDevAttributeType "cudlaDevAttributeType": + CUDLA_UNIFIED_ADDRESSING "CUDLA_UNIFIED_ADDRESSING" = 0 + CUDLA_DEVICE_VERSION "CUDLA_DEVICE_VERSION" = 1 + +# types +ctypedef void* cudlaDevHandle 'cudlaDevHandle' + +ctypedef void* cudlaModule 'cudlaModule' + +ctypedef struct cudlaExternalMemoryHandleDesc_t 'cudlaExternalMemoryHandleDesc_t': + void* extBufObject + unsigned long long size + +ctypedef struct cudlaExternalSemaphoreHandleDesc_t 'cudlaExternalSemaphoreHandleDesc_t': + void* extSyncObject + +ctypedef struct cudlaModuleTensorDescriptor 'cudlaModuleTensorDescriptor': + char name[(80U + 1)] + uint64_t size + uint64_t n + uint64_t c + uint64_t h + uint64_t w + uint8_t dataFormat + uint8_t dataType + uint8_t dataCategory + uint8_t pixelFormat + uint8_t pixelMapping + uint32_t stride[8U] + +ctypedef struct CudlaFence 'CudlaFence': + void* fence + cudlaFenceType type + +ctypedef union cudlaDevAttribute 'cudlaDevAttribute': + uint8_t unifiedAddressingSupported + uint32_t deviceVersion + +ctypedef union cudlaModuleAttribute 'cudlaModuleAttribute': + uint32_t numInputTensors + uint32_t numOutputTensors + cudlaModuleTensorDescriptor* inputTensorDesc + cudlaModuleTensorDescriptor* outputTensorDesc + +ctypedef struct cudlaWaitEvents 'cudlaWaitEvents': + CudlaFence* preFences + uint32_t numEvents + +ctypedef struct cudlaSignalEvents 'cudlaSignalEvents': + uint64_t** devPtrs + CudlaFence* eofFences + uint32_t numEvents + +ctypedef struct cudlaTask 'cudlaTask': + cudlaModule moduleHandle + uint64_t** outputTensor + uint32_t numOutputTensors + uint32_t numInputTensors + uint64_t** inputTensor + cudlaWaitEvents* waitEvents + cudlaSignalEvents* signalEvents + +# Typedef aliases for struct types (struct has _t, typedef doesn't) +ctypedef cudlaExternalMemoryHandleDesc_t cudlaExternalMemoryHandleDesc 'cudlaExternalMemoryHandleDesc' +ctypedef cudlaExternalSemaphoreHandleDesc_t cudlaExternalSemaphoreHandleDesc 'cudlaExternalSemaphoreHandleDesc' + + +############################################################################### +# Functions +############################################################################### + +cdef cudlaStatus cudlaGetVersion(uint64_t* const version) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus cudlaDeviceGetCount(uint64_t* const pNumDevices) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus cudlaCreateDevice(const uint64_t device, cudlaDevHandle* const devHandle, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus cudlaMemRegister(const cudlaDevHandle devHandle, const uint64_t* const ptr, const size_t size, uint64_t** const devPtr, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus cudlaModuleLoadFromMemory(const cudlaDevHandle devHandle, const uint8_t* const pModule, const size_t moduleSize, cudlaModule* const hModule, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus cudlaModuleGetAttributes(const cudlaModule hModule, const cudlaModuleAttributeType attrType, cudlaModuleAttribute* const attribute) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus cudlaModuleUnload(const cudlaModule hModule, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus cudlaSubmitTask(const cudlaDevHandle devHandle, const cudlaTask* const ptrToTasks, const uint32_t numTasks, void* const stream, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus cudlaDeviceGetAttribute(const cudlaDevHandle devHandle, const cudlaDevAttributeType attrib, cudlaDevAttribute* const pAttribute) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus cudlaMemUnregister(const cudlaDevHandle devHandle, const uint64_t* const devPtr) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus cudlaGetLastError(const cudlaDevHandle devHandle) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus cudlaDestroyDevice(const cudlaDevHandle devHandle) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil +cdef cudlaStatus cudlaSetTaskTimeoutInMs(const cudlaDevHandle devHandle, const uint32_t timeout) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil diff --git a/cuda_bindings/cuda/bindings/cycudla.pyx b/cuda_bindings/cuda/bindings/cycudla.pyx new file mode 100644 index 00000000000..42a7bd651c6 --- /dev/null +++ b/cuda_bindings/cuda/bindings/cycudla.pyx @@ -0,0 +1,65 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This code was automatically generated across versions from 1.5.0 to 13.3.0. Do not modify it directly. + +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b134ed8cb83eb5a5c6ff30be817e64d09d421d7257761e58fbc06b131690a392 +from ._internal cimport cudla as _cudla + + + + +############################################################################### +# Wrapper functions +############################################################################### + +cdef cudlaStatus cudlaGetVersion(uint64_t* const version) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + return _cudla._cudlaGetVersion(version) + + +cdef cudlaStatus cudlaDeviceGetCount(uint64_t* const pNumDevices) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + return _cudla._cudlaDeviceGetCount(pNumDevices) + + +cdef cudlaStatus cudlaCreateDevice(const uint64_t device, cudlaDevHandle* const devHandle, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + return _cudla._cudlaCreateDevice(device, devHandle, flags) + + +cdef cudlaStatus cudlaMemRegister(const cudlaDevHandle devHandle, const uint64_t* const ptr, const size_t size, uint64_t** const devPtr, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + return _cudla._cudlaMemRegister(devHandle, ptr, size, devPtr, flags) + + +cdef cudlaStatus cudlaModuleLoadFromMemory(const cudlaDevHandle devHandle, const uint8_t* const pModule, const size_t moduleSize, cudlaModule* const hModule, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + return _cudla._cudlaModuleLoadFromMemory(devHandle, pModule, moduleSize, hModule, flags) + + +cdef cudlaStatus cudlaModuleGetAttributes(const cudlaModule hModule, const cudlaModuleAttributeType attrType, cudlaModuleAttribute* const attribute) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + return _cudla._cudlaModuleGetAttributes(hModule, attrType, attribute) + + +cdef cudlaStatus cudlaModuleUnload(const cudlaModule hModule, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + return _cudla._cudlaModuleUnload(hModule, flags) + + +cdef cudlaStatus cudlaSubmitTask(const cudlaDevHandle devHandle, const cudlaTask* const ptrToTasks, const uint32_t numTasks, void* const stream, const uint32_t flags) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + return _cudla._cudlaSubmitTask(devHandle, ptrToTasks, numTasks, stream, flags) + + +cdef cudlaStatus cudlaDeviceGetAttribute(const cudlaDevHandle devHandle, const cudlaDevAttributeType attrib, cudlaDevAttribute* const pAttribute) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + return _cudla._cudlaDeviceGetAttribute(devHandle, attrib, pAttribute) + + +cdef cudlaStatus cudlaMemUnregister(const cudlaDevHandle devHandle, const uint64_t* const devPtr) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + return _cudla._cudlaMemUnregister(devHandle, devPtr) + + +cdef cudlaStatus cudlaGetLastError(const cudlaDevHandle devHandle) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + return _cudla._cudlaGetLastError(devHandle) + + +cdef cudlaStatus cudlaDestroyDevice(const cudlaDevHandle devHandle) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + return _cudla._cudlaDestroyDevice(devHandle) + + +cdef cudlaStatus cudlaSetTaskTimeoutInMs(const cudlaDevHandle devHandle, const uint32_t timeout) except?_CUDLASTATUS_INTERNAL_LOADING_ERROR nogil: + return _cudla._cudlaSetTaskTimeoutInMs(devHandle, timeout) diff --git a/cuda_bindings/cuda/bindings/cycufile.pxd b/cuda_bindings/cuda/bindings/cycufile.pxd index b18a301a97f..b5a0c9cb884 100644 --- a/cuda_bindings/cuda/bindings/cycufile.pxd +++ b/cuda_bindings/cuda/bindings/cycufile.pxd @@ -1,9 +1,10 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.9.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f840820f160e36eebe6e052b5a5d3a35b55704060301ee2ab7d5cd7a7d580418 from libc.stdint cimport uint32_t, uint64_t from libc.time cimport time_t from libcpp cimport bool as cpp_bool @@ -33,7 +34,7 @@ cdef extern from "": # enums -cdef extern from '': +cdef extern from 'cufile.h': ctypedef enum CUfileOpError: CU_FILE_SUCCESS CU_FILE_DRIVER_NOT_INITIALIZED @@ -85,7 +86,7 @@ cdef extern from '': CU_FILE_BATCH_NOCOMPAT_ERROR CU_FILE_IO_MAX_ERROR -cdef extern from '': +cdef extern from 'cufile.h': ctypedef enum CUfileDriverStatusFlags_t: CU_FILE_LUSTRE_SUPPORTED CU_FILE_WEKAFS_SUPPORTED @@ -102,14 +103,14 @@ cdef extern from '': CU_FILE_VIRTIOFS_SUPPORTED CU_FILE_MAX_TARGET_TYPES -cdef extern from '': +cdef extern from 'cufile.h': ctypedef enum CUfileDriverControlFlags_t: CU_FILE_USE_POLL_MODE CU_FILE_ALLOW_COMPAT_MODE CU_FILE_POSIX_IO_MODE CU_FILE_FALLBACK_IO_MODE -cdef extern from '': +cdef extern from 'cufile.h': ctypedef enum CUfileFeatureFlags_t: CU_FILE_DYN_ROUTING_SUPPORTED CU_FILE_BATCH_IO_SUPPORTED @@ -117,18 +118,18 @@ cdef extern from '': CU_FILE_PARALLEL_IO_SUPPORTED CU_FILE_P2P_SUPPORTED -cdef extern from '': +cdef extern from 'cufile.h': ctypedef enum CUfileFileHandleType: CU_FILE_HANDLE_TYPE_OPAQUE_FD CU_FILE_HANDLE_TYPE_OPAQUE_WIN32 CU_FILE_HANDLE_TYPE_USERSPACE_FS -cdef extern from '': +cdef extern from 'cufile.h': ctypedef enum CUfileOpcode_t: CUFILE_READ CUFILE_WRITE -cdef extern from '': +cdef extern from 'cufile.h': ctypedef enum CUfileStatus_t: CUFILE_WAITING CUFILE_PENDING @@ -138,11 +139,11 @@ cdef extern from '': CUFILE_TIMEOUT CUFILE_FAILED -cdef extern from '': +cdef extern from 'cufile.h': ctypedef enum CUfileBatchMode_t: CUFILE_BATCH -cdef extern from '': +cdef extern from 'cufile.h': ctypedef enum CUFileSizeTConfigParameter_t: CUFILE_PARAM_PROFILE_STATS CUFILE_PARAM_EXECUTION_MAX_IO_QUEUE_DEPTH @@ -157,7 +158,7 @@ cdef extern from '': CUFILE_PARAM_POLLTHRESHOLD_SIZE_KB CUFILE_PARAM_PROPERTIES_BATCH_IO_TIMEOUT_MS -cdef extern from '': +cdef extern from 'cufile.h': ctypedef enum CUFileBoolConfigParameter_t: CUFILE_PARAM_PROPERTIES_USE_POLL_MODE CUFILE_PARAM_PROPERTIES_ALLOW_COMPAT_MODE @@ -172,40 +173,43 @@ cdef extern from '': CUFILE_PARAM_SKIP_TOPOLOGY_DETECTION CUFILE_PARAM_STREAM_MEMOPS_BYPASS -cdef extern from '': +cdef extern from 'cufile.h': ctypedef enum CUFileStringConfigParameter_t: CUFILE_PARAM_LOGGING_LEVEL CUFILE_PARAM_ENV_LOGFILE_PATH CUFILE_PARAM_LOG_DIR -cdef extern from '': +cdef extern from 'cufile.h': ctypedef enum CUFileArrayConfigParameter_t: CUFILE_PARAM_POSIX_POOL_SLAB_SIZE_KB CUFILE_PARAM_POSIX_POOL_SLAB_COUNT CUFILE_PARAM_GPU_BOUNCE_BUFFER_SLAB_SIZE_KB CUFILE_PARAM_GPU_BOUNCE_BUFFER_SLAB_COUNT -cdef extern from '': +cdef extern from 'cufile.h': ctypedef enum CUfileP2PFlags_t: CUFILE_P2PDMA CUFILE_NVFS CUFILE_DMABUF CUFILE_C2C CUFILE_NVIDIA_PEERMEM +cdef enum: _CUFILEERROR_T_INTERNAL_LOADING_ERROR = -42 # types -cdef extern from '': +cdef extern from 'cufile.h': ctypedef void* CUfileHandle_t 'CUfileHandle_t' -cdef extern from '': + +cdef extern from 'cufile.h': ctypedef void* CUfileBatchHandle_t 'CUfileBatchHandle_t' -cdef extern from '': + +cdef extern from 'cufile.h': ctypedef struct CUfileError_t 'CUfileError_t': CUfileOpError err CUresult cu_err -cdef struct _anon_pod0 '_anon_pod0': +cdef struct cuda_bindings_cufile__anon_pod0: unsigned int major_version unsigned int minor_version size_t poll_thresh_size @@ -213,13 +217,13 @@ cdef struct _anon_pod0 '_anon_pod0': unsigned int dstatusflags unsigned int dcontrolflags -cdef extern from '': +cdef extern from 'cufile.h': ctypedef struct cufileRDMAInfo_t 'cufileRDMAInfo_t': int version int desc_len char* desc_str -cdef extern from '': +cdef extern from 'cufile.h': ctypedef struct CUfileFSOps_t 'CUfileFSOps_t': char* (*fs_type)(const void*) int (*getRDMADeviceList)(const void*, sockaddr_t**) @@ -227,28 +231,28 @@ cdef extern from '': ssize_t (*read)(const void*, char*, size_t, loff_t, const cufileRDMAInfo_t*) ssize_t (*write)(const void*, const char*, size_t, loff_t, const cufileRDMAInfo_t*) -cdef union _anon_pod1 '_anon_pod1': +cdef union cuda_bindings_cufile__anon_pod1: int fd void* handle -cdef struct _anon_pod3 '_anon_pod3': +cdef struct cuda_bindings_cufile__anon_pod3: void* devPtr_base off_t file_offset off_t devPtr_offset size_t size -cdef extern from '': +cdef extern from 'cufile.h': ctypedef struct CUfileIOEvents_t 'CUfileIOEvents_t': void* cookie CUfileStatus_t status size_t ret -cdef extern from '': +cdef extern from 'cufile.h': ctypedef struct CUfileOpCounter_t 'CUfileOpCounter_t': uint64_t ok uint64_t err -cdef extern from '': +cdef extern from 'cufile.h': ctypedef struct CUfilePerGpuStats_t 'CUfilePerGpuStats_t': char uuid[16] uint64_t read_bytes @@ -281,9 +285,9 @@ cdef extern from '': uint64_t n_mmap_free uint64_t reg_bytes -cdef extern from '': +cdef extern from 'cufile.h': ctypedef struct CUfileDrvProps_t 'CUfileDrvProps_t': - _anon_pod0 nvfs + cuda_bindings_cufile__anon_pod0 nvfs unsigned int fflags unsigned int max_device_cache_size unsigned int per_buffer_cache_size @@ -291,16 +295,16 @@ cdef extern from '': unsigned int max_batch_io_size unsigned int max_batch_io_timeout_msecs -cdef extern from '': +cdef extern from 'cufile.h': ctypedef struct CUfileDescr_t 'CUfileDescr_t': CUfileFileHandleType type - _anon_pod1 handle + cuda_bindings_cufile__anon_pod1 handle CUfileFSOps_t* fs_ops -cdef union _anon_pod2 '_anon_pod2': - _anon_pod3 batch +cdef union cuda_bindings_cufile__anon_pod2: + cuda_bindings_cufile__anon_pod3 batch -cdef extern from '': +cdef extern from 'cufile.h': ctypedef struct CUfileStatsLevel1_t 'CUfileStatsLevel1_t': CUfileOpCounter_t read_ops CUfileOpCounter_t write_ops @@ -346,28 +350,27 @@ cdef extern from '': uint64_t last_batch_read_bytes uint64_t last_batch_write_bytes -cdef extern from '': +cdef extern from 'cufile.h': ctypedef struct CUfileIOParams_t 'CUfileIOParams_t': CUfileBatchMode_t mode - _anon_pod2 u + cuda_bindings_cufile__anon_pod2 u CUfileHandle_t fh CUfileOpcode_t opcode void* cookie -cdef extern from '': +cdef extern from 'cufile.h': ctypedef struct CUfileStatsLevel2_t 'CUfileStatsLevel2_t': CUfileStatsLevel1_t basic uint64_t read_size_kb_hist[32] uint64_t write_size_kb_hist[32] -cdef extern from '': +cdef extern from 'cufile.h': ctypedef struct CUfileStatsLevel3_t 'CUfileStatsLevel3_t': CUfileStatsLevel2_t detailed uint32_t num_gpus CUfilePerGpuStats_t per_gpu_stats[16] - cdef extern from *: """ // This is the missing piece we need to supply to help Cython & C++ compilers. diff --git a/cuda_bindings/cuda/bindings/cycufile.pyx b/cuda_bindings/cuda/bindings/cycufile.pyx index 48a7b9eb3c8..e457aa2c63b 100644 --- a/cuda_bindings/cuda/bindings/cycufile.pyx +++ b/cuda_bindings/cuda/bindings/cycufile.pyx @@ -1,9 +1,10 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.9.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=74f1f9c9443af66fdadbfeeb01e5c15c2d8f1b9b0b20eafa2a279583bcf7df00 from ._internal cimport cufile as _cufile import cython diff --git a/cuda_bindings/cuda/bindings/cydriver.pxd.in b/cuda_bindings/cuda/bindings/cydriver.pxd similarity index 52% rename from cuda_bindings/cuda/bindings/cydriver.pxd.in rename to cuda_bindings/cuda/bindings/cydriver.pxd index 43e09ccd533..090ac5417ef 100644 --- a/cuda_bindings/cuda/bindings/cydriver.pxd.in +++ b/cuda_bindings/cuda/bindings/cydriver.pxd @@ -1,941 +1,2238 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -# This code was automatically generated with version 13.2.0, generator version 8797618. Do not modify it directly. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=be542bd43838a355344b0cdedcf3496368dd3cf0ebdfeda22b5963f384f4d06d from libc.stdint cimport uint32_t, uint64_t -cdef extern from "cuda.h": - ctypedef uint32_t cuuint32_t +# Overridden types from _extras.h - ctypedef uint64_t cuuint64_t +# GL +ctypedef unsigned int GLenum +ctypedef unsigned int GLuint - ctypedef unsigned long long CUdeviceptr_v2 +# EGL +ctypedef void *EGLImageKHR +ctypedef void *EGLStreamKHR +ctypedef unsigned int EGLint +ctypedef void *EGLSyncKHR - ctypedef CUdeviceptr_v2 CUdeviceptr +# VDPAU +ctypedef uint32_t VdpDevice +ctypedef unsigned long long VdpGetProcAddress +ctypedef uint32_t VdpVideoSurface +ctypedef uint32_t VdpOutputSurface - ctypedef int CUdevice_v1 - ctypedef CUdevice_v1 CUdevice +# ENUMS +cdef extern from 'cuda.h': + ctypedef enum CUipcMem_flags_enum: + CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS + ctypedef CUipcMem_flags_enum CUipcMem_flags - cdef struct CUctx_st: - pass - ctypedef CUctx_st* CUcontext +cdef extern from 'cuda.h': + ctypedef enum CUmemAttach_flags_enum: + CU_MEM_ATTACH_GLOBAL + CU_MEM_ATTACH_HOST + CU_MEM_ATTACH_SINGLE + ctypedef CUmemAttach_flags_enum CUmemAttach_flags - cdef struct CUmod_st: - pass - ctypedef CUmod_st* CUmodule +cdef extern from 'cuda.h': + ctypedef enum CUctx_flags_enum: + CU_CTX_SCHED_AUTO + CU_CTX_SCHED_SPIN + CU_CTX_SCHED_YIELD + CU_CTX_SCHED_BLOCKING_SYNC + CU_CTX_BLOCKING_SYNC + CU_CTX_SCHED_MASK + CU_CTX_MAP_HOST + CU_CTX_LMEM_RESIZE_TO_MAX + CU_CTX_COREDUMP_ENABLE + CU_CTX_USER_COREDUMP_ENABLE + CU_CTX_SYNC_MEMOPS + CU_CTX_FLAGS_MASK + ctypedef CUctx_flags_enum CUctx_flags - cdef struct CUfunc_st: - pass - ctypedef CUfunc_st* CUfunction +cdef extern from 'cuda.h': + ctypedef enum CUevent_sched_flags_enum: + CU_EVENT_SCHED_AUTO + CU_EVENT_SCHED_SPIN + CU_EVENT_SCHED_YIELD + CU_EVENT_SCHED_BLOCKING_SYNC + ctypedef CUevent_sched_flags_enum CUevent_sched_flags - cdef struct CUlib_st: - pass - ctypedef CUlib_st* CUlibrary +cdef extern from 'cuda.h': + ctypedef enum cl_event_flags_enum: + NVCL_EVENT_SCHED_AUTO + NVCL_EVENT_SCHED_SPIN + NVCL_EVENT_SCHED_YIELD + NVCL_EVENT_SCHED_BLOCKING_SYNC + ctypedef cl_event_flags_enum cl_event_flags - cdef struct CUkern_st: - pass - ctypedef CUkern_st* CUkernel +cdef extern from 'cuda.h': + ctypedef enum cl_context_flags_enum: + NVCL_CTX_SCHED_AUTO + NVCL_CTX_SCHED_SPIN + NVCL_CTX_SCHED_YIELD + NVCL_CTX_SCHED_BLOCKING_SYNC + ctypedef cl_context_flags_enum cl_context_flags - cdef struct CUarray_st: - pass - ctypedef CUarray_st* CUarray +cdef extern from 'cuda.h': + ctypedef enum CUstream_flags_enum: + CU_STREAM_DEFAULT + CU_STREAM_NON_BLOCKING + ctypedef CUstream_flags_enum CUstream_flags - cdef struct CUmipmappedArray_st: - pass - ctypedef CUmipmappedArray_st* CUmipmappedArray +cdef extern from 'cuda.h': + ctypedef enum CUevent_flags_enum: + CU_EVENT_DEFAULT + CU_EVENT_BLOCKING_SYNC + CU_EVENT_DISABLE_TIMING + CU_EVENT_INTERPROCESS + ctypedef CUevent_flags_enum CUevent_flags - cdef struct CUtexref_st: - pass - ctypedef CUtexref_st* CUtexref +cdef extern from 'cuda.h': + ctypedef enum CUevent_record_flags_enum: + CU_EVENT_RECORD_DEFAULT + CU_EVENT_RECORD_EXTERNAL + ctypedef CUevent_record_flags_enum CUevent_record_flags - cdef struct CUsurfref_st: - pass - ctypedef CUsurfref_st* CUsurfref +cdef extern from 'cuda.h': + ctypedef enum CUevent_wait_flags_enum: + CU_EVENT_WAIT_DEFAULT + CU_EVENT_WAIT_EXTERNAL + ctypedef CUevent_wait_flags_enum CUevent_wait_flags - cdef struct CUevent_st: - pass - ctypedef CUevent_st* CUevent +cdef extern from 'cuda.h': + ctypedef enum CUstreamWaitValue_flags_enum: + CU_STREAM_WAIT_VALUE_GEQ + CU_STREAM_WAIT_VALUE_EQ + CU_STREAM_WAIT_VALUE_AND + CU_STREAM_WAIT_VALUE_NOR + CU_STREAM_WAIT_VALUE_FLUSH + ctypedef CUstreamWaitValue_flags_enum CUstreamWaitValue_flags - cdef struct CUstream_st: - pass - ctypedef CUstream_st* CUstream +cdef extern from 'cuda.h': + ctypedef enum CUstreamWriteValue_flags_enum: + CU_STREAM_WRITE_VALUE_DEFAULT + CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER + ctypedef CUstreamWriteValue_flags_enum CUstreamWriteValue_flags - cdef struct CUgraphicsResource_st: - pass - ctypedef CUgraphicsResource_st* CUgraphicsResource +cdef extern from 'cuda.h': + ctypedef enum CUstreamBatchMemOpType_enum: + CU_STREAM_MEM_OP_WAIT_VALUE_32 + CU_STREAM_MEM_OP_WRITE_VALUE_32 + CU_STREAM_MEM_OP_WAIT_VALUE_64 + CU_STREAM_MEM_OP_WRITE_VALUE_64 + CU_STREAM_MEM_OP_BARRIER + CU_STREAM_MEM_OP_ATOMIC_REDUCTION + CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES + ctypedef CUstreamBatchMemOpType_enum CUstreamBatchMemOpType - ctypedef unsigned long long CUtexObject_v1 +cdef extern from 'cuda.h': + ctypedef enum CUstreamMemoryBarrier_flags_enum: + CU_STREAM_MEMORY_BARRIER_TYPE_SYS + CU_STREAM_MEMORY_BARRIER_TYPE_GPU + ctypedef CUstreamMemoryBarrier_flags_enum CUstreamMemoryBarrier_flags - ctypedef CUtexObject_v1 CUtexObject +cdef extern from 'cuda.h': + ctypedef enum CUoccupancy_flags_enum: + CU_OCCUPANCY_DEFAULT + CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE + ctypedef CUoccupancy_flags_enum CUoccupancy_flags - ctypedef unsigned long long CUsurfObject_v1 +cdef extern from 'cuda.h': + ctypedef enum CUstreamUpdateCaptureDependencies_flags_enum: + CU_STREAM_ADD_CAPTURE_DEPENDENCIES + CU_STREAM_SET_CAPTURE_DEPENDENCIES + ctypedef CUstreamUpdateCaptureDependencies_flags_enum CUstreamUpdateCaptureDependencies_flags - ctypedef CUsurfObject_v1 CUsurfObject +cdef extern from 'cuda.h': + ctypedef enum CUasyncNotificationType_enum: + CU_ASYNC_NOTIFICATION_TYPE_OVER_BUDGET + ctypedef CUasyncNotificationType_enum CUasyncNotificationType - cdef struct CUextMemory_st: - pass - ctypedef CUextMemory_st* CUexternalMemory +cdef extern from 'cuda.h': + ctypedef enum CUarray_format_enum: + CU_AD_FORMAT_UNSIGNED_INT8 + CU_AD_FORMAT_UNSIGNED_INT16 + CU_AD_FORMAT_UNSIGNED_INT32 + CU_AD_FORMAT_SIGNED_INT8 + CU_AD_FORMAT_SIGNED_INT16 + CU_AD_FORMAT_SIGNED_INT32 + CU_AD_FORMAT_HALF + CU_AD_FORMAT_FLOAT + CU_AD_FORMAT_NV12 + CU_AD_FORMAT_UNORM_INT8X1 + CU_AD_FORMAT_UNORM_INT8X2 + CU_AD_FORMAT_UNORM_INT8X4 + CU_AD_FORMAT_UNORM_INT16X1 + CU_AD_FORMAT_UNORM_INT16X2 + CU_AD_FORMAT_UNORM_INT16X4 + CU_AD_FORMAT_SNORM_INT8X1 + CU_AD_FORMAT_SNORM_INT8X2 + CU_AD_FORMAT_SNORM_INT8X4 + CU_AD_FORMAT_SNORM_INT16X1 + CU_AD_FORMAT_SNORM_INT16X2 + CU_AD_FORMAT_SNORM_INT16X4 + CU_AD_FORMAT_BC1_UNORM + CU_AD_FORMAT_BC1_UNORM_SRGB + CU_AD_FORMAT_BC2_UNORM + CU_AD_FORMAT_BC2_UNORM_SRGB + CU_AD_FORMAT_BC3_UNORM + CU_AD_FORMAT_BC3_UNORM_SRGB + CU_AD_FORMAT_BC4_UNORM + CU_AD_FORMAT_BC4_SNORM + CU_AD_FORMAT_BC5_UNORM + CU_AD_FORMAT_BC5_SNORM + CU_AD_FORMAT_BC6H_UF16 + CU_AD_FORMAT_BC6H_SF16 + CU_AD_FORMAT_BC7_UNORM + CU_AD_FORMAT_BC7_UNORM_SRGB + CU_AD_FORMAT_P010 + CU_AD_FORMAT_P016 + CU_AD_FORMAT_NV16 + CU_AD_FORMAT_P210 + CU_AD_FORMAT_P216 + CU_AD_FORMAT_YUY2 + CU_AD_FORMAT_Y210 + CU_AD_FORMAT_Y216 + CU_AD_FORMAT_AYUV + CU_AD_FORMAT_Y410 + CU_AD_FORMAT_Y416 + CU_AD_FORMAT_Y444_PLANAR8 + CU_AD_FORMAT_Y444_PLANAR10 + CU_AD_FORMAT_YUV444_8bit_SemiPlanar + CU_AD_FORMAT_YUV444_16bit_SemiPlanar + CU_AD_FORMAT_UNORM_INT_101010_2 + CU_AD_FORMAT_UINT8_PACKED_422 + CU_AD_FORMAT_UINT8_PACKED_444 + CU_AD_FORMAT_UINT8_SEMIPLANAR_420 + CU_AD_FORMAT_UINT16_SEMIPLANAR_420 + CU_AD_FORMAT_UINT8_SEMIPLANAR_422 + CU_AD_FORMAT_UINT16_SEMIPLANAR_422 + CU_AD_FORMAT_UINT8_SEMIPLANAR_444 + CU_AD_FORMAT_UINT16_SEMIPLANAR_444 + CU_AD_FORMAT_UINT8_PLANAR_420 + CU_AD_FORMAT_UINT16_PLANAR_420 + CU_AD_FORMAT_UINT8_PLANAR_422 + CU_AD_FORMAT_UINT16_PLANAR_422 + CU_AD_FORMAT_UINT8_PLANAR_444 + CU_AD_FORMAT_UINT16_PLANAR_444 + CU_AD_FORMAT_MAX + ctypedef CUarray_format_enum CUarray_format - cdef struct CUextSemaphore_st: - pass - ctypedef CUextSemaphore_st* CUexternalSemaphore +cdef extern from 'cuda.h': + ctypedef enum CUaddress_mode_enum: + CU_TR_ADDRESS_MODE_WRAP + CU_TR_ADDRESS_MODE_CLAMP + CU_TR_ADDRESS_MODE_MIRROR + CU_TR_ADDRESS_MODE_BORDER + ctypedef CUaddress_mode_enum CUaddress_mode - cdef struct CUgraph_st: - pass - ctypedef CUgraph_st* CUgraph +cdef extern from 'cuda.h': + ctypedef enum CUfilter_mode_enum: + CU_TR_FILTER_MODE_POINT + CU_TR_FILTER_MODE_LINEAR + ctypedef CUfilter_mode_enum CUfilter_mode - cdef struct CUgraphNode_st: - pass - ctypedef CUgraphNode_st* CUgraphNode +cdef extern from 'cuda.h': + ctypedef enum CUdevice_attribute_enum: + CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK + CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X + CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y + CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z + CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X + CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y + CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z + CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK + CU_DEVICE_ATTRIBUTE_SHARED_MEMORY_PER_BLOCK + CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY + CU_DEVICE_ATTRIBUTE_WARP_SIZE + CU_DEVICE_ATTRIBUTE_MAX_PITCH + CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK + CU_DEVICE_ATTRIBUTE_REGISTERS_PER_BLOCK + CU_DEVICE_ATTRIBUTE_CLOCK_RATE + CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT + CU_DEVICE_ATTRIBUTE_GPU_OVERLAP + CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT + CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT + CU_DEVICE_ATTRIBUTE_INTEGRATED + CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY + CU_DEVICE_ATTRIBUTE_COMPUTE_MODE + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_WIDTH + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_HEIGHT + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES + CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT + CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS + CU_DEVICE_ATTRIBUTE_ECC_ENABLED + CU_DEVICE_ATTRIBUTE_PCI_BUS_ID + CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID + CU_DEVICE_ATTRIBUTE_TCC_DRIVER + CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE + CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH + CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE + CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR + CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT + CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS + CU_DEVICE_ATTRIBUTE_CAN_TEX2D_GATHER + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE + CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID + CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT + CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR + CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH + CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED + CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED + CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED + CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR + CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR + CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY + CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD + CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID + CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED + CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO + CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS + CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS + CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED + CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM + CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_MEM_OPS_V1 + CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS_V1 + CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR_V1 + CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH + CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH + CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN + CU_DEVICE_ATTRIBUTE_CAN_FLUSH_REMOTE_WRITES + CU_DEVICE_ATTRIBUTE_HOST_REGISTER_SUPPORTED + CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES + CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST + CU_DEVICE_ATTRIBUTE_VIRTUAL_ADDRESS_MANAGEMENT_SUPPORTED + CU_DEVICE_ATTRIBUTE_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED + CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR_SUPPORTED + CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_HANDLE_SUPPORTED + CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_KMT_HANDLE_SUPPORTED + CU_DEVICE_ATTRIBUTE_MAX_BLOCKS_PER_MULTIPROCESSOR + CU_DEVICE_ATTRIBUTE_GENERIC_COMPRESSION_SUPPORTED + CU_DEVICE_ATTRIBUTE_MAX_PERSISTING_L2_CACHE_SIZE + CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE + CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_CUDA_VMM_SUPPORTED + CU_DEVICE_ATTRIBUTE_RESERVED_SHARED_MEMORY_PER_BLOCK + CU_DEVICE_ATTRIBUTE_SPARSE_CUDA_ARRAY_SUPPORTED + CU_DEVICE_ATTRIBUTE_READ_ONLY_HOST_REGISTER_SUPPORTED + CU_DEVICE_ATTRIBUTE_TIMELINE_SEMAPHORE_INTEROP_SUPPORTED + CU_DEVICE_ATTRIBUTE_MEMORY_POOLS_SUPPORTED + CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_SUPPORTED + CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_FLUSH_WRITES_OPTIONS + CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WRITES_ORDERING + CU_DEVICE_ATTRIBUTE_MEMPOOL_SUPPORTED_HANDLE_TYPES + CU_DEVICE_ATTRIBUTE_CLUSTER_LAUNCH + CU_DEVICE_ATTRIBUTE_DEFERRED_MAPPING_CUDA_ARRAY_SUPPORTED + CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS + CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR + CU_DEVICE_ATTRIBUTE_DMA_BUF_SUPPORTED + CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED + CU_DEVICE_ATTRIBUTE_MEM_SYNC_DOMAIN_COUNT + CU_DEVICE_ATTRIBUTE_TENSOR_MAP_ACCESS_SUPPORTED + CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_FABRIC_SUPPORTED + CU_DEVICE_ATTRIBUTE_UNIFIED_FUNCTION_POINTERS + CU_DEVICE_ATTRIBUTE_NUMA_CONFIG + CU_DEVICE_ATTRIBUTE_NUMA_ID + CU_DEVICE_ATTRIBUTE_MULTICAST_SUPPORTED + CU_DEVICE_ATTRIBUTE_MPS_ENABLED + CU_DEVICE_ATTRIBUTE_HOST_NUMA_ID + CU_DEVICE_ATTRIBUTE_D3D12_CIG_SUPPORTED + CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_ALGORITHM_MASK + CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_MAXIMUM_LENGTH + CU_DEVICE_ATTRIBUTE_VULKAN_CIG_SUPPORTED + CU_DEVICE_ATTRIBUTE_GPU_PCI_DEVICE_ID + CU_DEVICE_ATTRIBUTE_GPU_PCI_SUBSYSTEM_ID + CU_DEVICE_ATTRIBUTE_HOST_NUMA_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED + CU_DEVICE_ATTRIBUTE_HOST_NUMA_MEMORY_POOLS_SUPPORTED + CU_DEVICE_ATTRIBUTE_HOST_NUMA_MULTINODE_IPC_SUPPORTED + CU_DEVICE_ATTRIBUTE_HOST_MEMORY_POOLS_SUPPORTED + CU_DEVICE_ATTRIBUTE_HOST_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED + CU_DEVICE_ATTRIBUTE_HOST_ALLOC_DMA_BUF_SUPPORTED + CU_DEVICE_ATTRIBUTE_ONLY_PARTIAL_HOST_NATIVE_ATOMIC_SUPPORTED + CU_DEVICE_ATTRIBUTE_ATOMIC_REDUCTION_SUPPORTED + CU_DEVICE_ATTRIBUTE_D3D12_CIG_STREAMS_SUPPORTED + CU_DEVICE_ATTRIBUTE_DMA_BUF_MMAP_SUPPORTED + CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_UNICAST_SUPPORTED + CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_MULTICAST_SUPPORTED + CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_COUNTED_OPS_SUPPORTED + CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_UNICAST_ACCESS_ON_OWNER_DEVICE_SUPPORTED + CU_DEVICE_ATTRIBUTE_MAX + ctypedef CUdevice_attribute_enum CUdevice_attribute - cdef struct CUgraphExec_st: - pass - ctypedef CUgraphExec_st* CUgraphExec +cdef extern from 'cuda.h': + ctypedef enum CUpointer_attribute_enum: + CU_POINTER_ATTRIBUTE_CONTEXT + CU_POINTER_ATTRIBUTE_MEMORY_TYPE + CU_POINTER_ATTRIBUTE_DEVICE_POINTER + CU_POINTER_ATTRIBUTE_HOST_POINTER + CU_POINTER_ATTRIBUTE_P2P_TOKENS + CU_POINTER_ATTRIBUTE_SYNC_MEMOPS + CU_POINTER_ATTRIBUTE_BUFFER_ID + CU_POINTER_ATTRIBUTE_IS_MANAGED + CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL + CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE + CU_POINTER_ATTRIBUTE_RANGE_START_ADDR + CU_POINTER_ATTRIBUTE_RANGE_SIZE + CU_POINTER_ATTRIBUTE_MAPPED + CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES + CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE + CU_POINTER_ATTRIBUTE_ACCESS_FLAGS + CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE + CU_POINTER_ATTRIBUTE_MAPPING_SIZE + CU_POINTER_ATTRIBUTE_MAPPING_BASE_ADDR + CU_POINTER_ATTRIBUTE_MEMORY_BLOCK_ID + CU_POINTER_ATTRIBUTE_IS_HW_DECOMPRESS_CAPABLE + ctypedef CUpointer_attribute_enum CUpointer_attribute - cdef struct CUmemPoolHandle_st: - pass - ctypedef CUmemPoolHandle_st* CUmemoryPool +cdef extern from 'cuda.h': + ctypedef enum CUfunction_attribute_enum: + CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK + CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES + CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES + CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES + CU_FUNC_ATTRIBUTE_NUM_REGS + CU_FUNC_ATTRIBUTE_PTX_VERSION + CU_FUNC_ATTRIBUTE_BINARY_VERSION + CU_FUNC_ATTRIBUTE_CACHE_MODE_CA + CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES + CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT + CU_FUNC_ATTRIBUTE_CLUSTER_SIZE_MUST_BE_SET + CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH + CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT + CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH + CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED + CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE + CU_FUNC_ATTRIBUTE_DEVICE_NODE_UPDATE_SUPPORTED + CU_FUNC_ATTRIBUTE_MAX + ctypedef CUfunction_attribute_enum CUfunction_attribute - cdef struct CUuserObject_st: - pass - ctypedef CUuserObject_st* CUuserObject +cdef extern from 'cuda.h': + ctypedef enum CUfunc_cache_enum: + CU_FUNC_CACHE_PREFER_NONE + CU_FUNC_CACHE_PREFER_SHARED + CU_FUNC_CACHE_PREFER_L1 + CU_FUNC_CACHE_PREFER_EQUAL + ctypedef CUfunc_cache_enum CUfunc_cache - ctypedef cuuint64_t CUgraphConditionalHandle +cdef extern from 'cuda.h': + ctypedef enum CUsharedconfig_enum: + CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE + CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE + CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE + ctypedef CUsharedconfig_enum CUsharedconfig - cdef struct CUgraphDeviceUpdatableNode_st: - pass - ctypedef CUgraphDeviceUpdatableNode_st* CUgraphDeviceNode +cdef extern from 'cuda.h': + ctypedef enum CUshared_carveout_enum: + CU_SHAREDMEM_CARVEOUT_DEFAULT + CU_SHAREDMEM_CARVEOUT_MAX_SHARED + CU_SHAREDMEM_CARVEOUT_MAX_L1 + ctypedef CUshared_carveout_enum CUshared_carveout - cdef struct CUasyncCallbackEntry_st: - pass - ctypedef CUasyncCallbackEntry_st* CUasyncCallbackHandle +cdef extern from 'cuda.h': + ctypedef enum CUmemorytype_enum: + CU_MEMORYTYPE_HOST + CU_MEMORYTYPE_DEVICE + CU_MEMORYTYPE_ARRAY + CU_MEMORYTYPE_UNIFIED + ctypedef CUmemorytype_enum CUmemorytype - cdef struct CUgreenCtx_st: - pass - ctypedef CUgreenCtx_st* CUgreenCtx +cdef extern from 'cuda.h': + ctypedef enum CUcomputemode_enum: + CU_COMPUTEMODE_DEFAULT + CU_COMPUTEMODE_PROHIBITED + CU_COMPUTEMODE_EXCLUSIVE_PROCESS + ctypedef CUcomputemode_enum CUcomputemode - cdef struct CUuuid_st: - char bytes[16] +cdef extern from 'cuda.h': + ctypedef enum CUmem_advise_enum: + CU_MEM_ADVISE_SET_READ_MOSTLY + CU_MEM_ADVISE_UNSET_READ_MOSTLY + CU_MEM_ADVISE_SET_PREFERRED_LOCATION + CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION + CU_MEM_ADVISE_SET_ACCESSED_BY + CU_MEM_ADVISE_UNSET_ACCESSED_BY + ctypedef CUmem_advise_enum CUmem_advise - ctypedef CUuuid_st CUuuid +cdef extern from 'cuda.h': + ctypedef enum CUmem_range_attribute_enum: + CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY + CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION + CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY + CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION + CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_TYPE + CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_ID + CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_TYPE + CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_ID + ctypedef CUmem_range_attribute_enum CUmem_range_attribute - cdef struct CUmemFabricHandle_st: - unsigned char data[64] +cdef extern from 'cuda.h': + ctypedef enum CUjit_option_enum: + CU_JIT_MAX_REGISTERS + CU_JIT_THREADS_PER_BLOCK + CU_JIT_WALL_TIME + CU_JIT_INFO_LOG_BUFFER + CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES + CU_JIT_ERROR_LOG_BUFFER + CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES + CU_JIT_OPTIMIZATION_LEVEL + CU_JIT_TARGET_FROM_CUCONTEXT + CU_JIT_TARGET + CU_JIT_FALLBACK_STRATEGY + CU_JIT_GENERATE_DEBUG_INFO + CU_JIT_LOG_VERBOSE + CU_JIT_GENERATE_LINE_INFO + CU_JIT_CACHE_MODE + CU_JIT_NEW_SM3X_OPT + CU_JIT_FAST_COMPILE + CU_JIT_GLOBAL_SYMBOL_NAMES + CU_JIT_GLOBAL_SYMBOL_ADDRESSES + CU_JIT_GLOBAL_SYMBOL_COUNT + CU_JIT_LTO + CU_JIT_FTZ + CU_JIT_PREC_DIV + CU_JIT_PREC_SQRT + CU_JIT_FMA + CU_JIT_REFERENCED_KERNEL_NAMES + CU_JIT_REFERENCED_KERNEL_COUNT + CU_JIT_REFERENCED_VARIABLE_NAMES + CU_JIT_REFERENCED_VARIABLE_COUNT + CU_JIT_OPTIMIZE_UNUSED_DEVICE_VARIABLES + CU_JIT_POSITION_INDEPENDENT_CODE + CU_JIT_MIN_CTA_PER_SM + CU_JIT_MAX_THREADS_PER_BLOCK + CU_JIT_OVERRIDE_DIRECTIVE_VALUES + CU_JIT_SPLIT_COMPILE + CU_JIT_BINARY_LOADER_THREAD_COUNT + CU_JIT_NUM_OPTIONS + ctypedef CUjit_option_enum CUjit_option - ctypedef CUmemFabricHandle_st CUmemFabricHandle_v1 +cdef extern from 'cuda.h': + ctypedef enum CUjit_target_enum: + CU_TARGET_COMPUTE_30 + CU_TARGET_COMPUTE_32 + CU_TARGET_COMPUTE_35 + CU_TARGET_COMPUTE_37 + CU_TARGET_COMPUTE_50 + CU_TARGET_COMPUTE_52 + CU_TARGET_COMPUTE_53 + CU_TARGET_COMPUTE_60 + CU_TARGET_COMPUTE_61 + CU_TARGET_COMPUTE_62 + CU_TARGET_COMPUTE_70 + CU_TARGET_COMPUTE_72 + CU_TARGET_COMPUTE_75 + CU_TARGET_COMPUTE_80 + CU_TARGET_COMPUTE_86 + CU_TARGET_COMPUTE_87 + CU_TARGET_COMPUTE_89 + CU_TARGET_COMPUTE_90 + CU_TARGET_COMPUTE_100 + CU_TARGET_COMPUTE_110 + CU_TARGET_COMPUTE_103 + CU_TARGET_COMPUTE_120 + CU_TARGET_COMPUTE_121 + CU_TARGET_COMPUTE_90A + CU_TARGET_COMPUTE_100A + CU_TARGET_COMPUTE_110A + CU_TARGET_COMPUTE_103A + CU_TARGET_COMPUTE_120A + CU_TARGET_COMPUTE_121A + CU_TARGET_COMPUTE_100F + CU_TARGET_COMPUTE_110F + CU_TARGET_COMPUTE_103F + CU_TARGET_COMPUTE_120F + CU_TARGET_COMPUTE_121F + CU_TARGET_COMPUTE_101 + CU_TARGET_COMPUTE_101A + CU_TARGET_COMPUTE_101F + ctypedef CUjit_target_enum CUjit_target - ctypedef CUmemFabricHandle_v1 CUmemFabricHandle +cdef extern from 'cuda.h': + ctypedef enum CUjit_fallback_enum: + CU_PREFER_PTX + CU_PREFER_BINARY + ctypedef CUjit_fallback_enum CUjit_fallback - cdef struct CUipcEventHandle_st: - char reserved[64] +cdef extern from 'cuda.h': + ctypedef enum CUjit_cacheMode_enum: + CU_JIT_CACHE_OPTION_NONE + CU_JIT_CACHE_OPTION_CG + CU_JIT_CACHE_OPTION_CA + ctypedef CUjit_cacheMode_enum CUjit_cacheMode - ctypedef CUipcEventHandle_st CUipcEventHandle_v1 +cdef extern from 'cuda.h': + ctypedef enum CUjitInputType_enum: + CU_JIT_INPUT_CUBIN + CU_JIT_INPUT_PTX + CU_JIT_INPUT_FATBINARY + CU_JIT_INPUT_OBJECT + CU_JIT_INPUT_LIBRARY + CU_JIT_INPUT_NVVM + CU_JIT_NUM_INPUT_TYPES + ctypedef CUjitInputType_enum CUjitInputType - ctypedef CUipcEventHandle_v1 CUipcEventHandle +cdef extern from 'cuda.h': + ctypedef enum CUgraphicsRegisterFlags_enum: + CU_GRAPHICS_REGISTER_FLAGS_NONE + CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY + CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD + CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST + CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER + ctypedef CUgraphicsRegisterFlags_enum CUgraphicsRegisterFlags - cdef struct CUipcMemHandle_st: - char reserved[64] +cdef extern from 'cuda.h': + ctypedef enum CUgraphicsMapResourceFlags_enum: + CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE + CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY + CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD + ctypedef CUgraphicsMapResourceFlags_enum CUgraphicsMapResourceFlags - ctypedef CUipcMemHandle_st CUipcMemHandle_v1 +cdef extern from 'cuda.h': + ctypedef enum CUarray_cubemap_face_enum: + CU_CUBEMAP_FACE_POSITIVE_X + CU_CUBEMAP_FACE_NEGATIVE_X + CU_CUBEMAP_FACE_POSITIVE_Y + CU_CUBEMAP_FACE_NEGATIVE_Y + CU_CUBEMAP_FACE_POSITIVE_Z + CU_CUBEMAP_FACE_NEGATIVE_Z + ctypedef CUarray_cubemap_face_enum CUarray_cubemap_face - ctypedef CUipcMemHandle_v1 CUipcMemHandle +cdef extern from 'cuda.h': + ctypedef enum CUlimit_enum: + CU_LIMIT_STACK_SIZE + CU_LIMIT_PRINTF_FIFO_SIZE + CU_LIMIT_MALLOC_HEAP_SIZE + CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH + CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT + CU_LIMIT_MAX_L2_FETCH_GRANULARITY + CU_LIMIT_PERSISTING_L2_CACHE_SIZE + CU_LIMIT_SHMEM_SIZE + CU_LIMIT_CIG_ENABLED + CU_LIMIT_CIG_SHMEM_FALLBACK_ENABLED + CU_LIMIT_MAX + ctypedef CUlimit_enum CUlimit - cdef enum CUipcMem_flags_enum: - CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS = 1 +cdef extern from 'cuda.h': + ctypedef enum CUresourcetype_enum: + CU_RESOURCE_TYPE_ARRAY + CU_RESOURCE_TYPE_MIPMAPPED_ARRAY + CU_RESOURCE_TYPE_LINEAR + CU_RESOURCE_TYPE_PITCH2D + ctypedef CUresourcetype_enum CUresourcetype - ctypedef CUipcMem_flags_enum CUipcMem_flags +cdef extern from 'cuda.h': + ctypedef enum CUaccessProperty_enum: + CU_ACCESS_PROPERTY_NORMAL + CU_ACCESS_PROPERTY_STREAMING + CU_ACCESS_PROPERTY_PERSISTING + ctypedef CUaccessProperty_enum CUaccessProperty - cdef enum CUmemAttach_flags_enum: - CU_MEM_ATTACH_GLOBAL = 1 - CU_MEM_ATTACH_HOST = 2 - CU_MEM_ATTACH_SINGLE = 4 +cdef extern from 'cuda.h': + ctypedef enum CUgraphConditionalNodeType_enum: + CU_GRAPH_COND_TYPE_IF + CU_GRAPH_COND_TYPE_WHILE + CU_GRAPH_COND_TYPE_SWITCH + ctypedef CUgraphConditionalNodeType_enum CUgraphConditionalNodeType - ctypedef CUmemAttach_flags_enum CUmemAttach_flags +cdef extern from 'cuda.h': + ctypedef enum CUgraphNodeType_enum: + CU_GRAPH_NODE_TYPE_KERNEL + CU_GRAPH_NODE_TYPE_MEMCPY + CU_GRAPH_NODE_TYPE_MEMSET + CU_GRAPH_NODE_TYPE_HOST + CU_GRAPH_NODE_TYPE_GRAPH + CU_GRAPH_NODE_TYPE_EMPTY + CU_GRAPH_NODE_TYPE_WAIT_EVENT + CU_GRAPH_NODE_TYPE_EVENT_RECORD + CU_GRAPH_NODE_TYPE_EXT_SEMAS_SIGNAL + CU_GRAPH_NODE_TYPE_EXT_SEMAS_WAIT + CU_GRAPH_NODE_TYPE_MEM_ALLOC + CU_GRAPH_NODE_TYPE_MEM_FREE + CU_GRAPH_NODE_TYPE_BATCH_MEM_OP + CU_GRAPH_NODE_TYPE_CONDITIONAL + CU_GRAPH_NODE_TYPE_RESERVED_16 + ctypedef CUgraphNodeType_enum CUgraphNodeType - cdef enum CUctx_flags_enum: - CU_CTX_SCHED_AUTO = 0 - CU_CTX_SCHED_SPIN = 1 - CU_CTX_SCHED_YIELD = 2 - CU_CTX_SCHED_BLOCKING_SYNC = 4 - CU_CTX_BLOCKING_SYNC = 4 - CU_CTX_SCHED_MASK = 7 - CU_CTX_MAP_HOST = 8 - CU_CTX_LMEM_RESIZE_TO_MAX = 16 - CU_CTX_COREDUMP_ENABLE = 32 - CU_CTX_USER_COREDUMP_ENABLE = 64 - CU_CTX_SYNC_MEMOPS = 128 - CU_CTX_FLAGS_MASK = 255 +cdef extern from 'cuda.h': + ctypedef enum CUgraphDependencyType_enum: + CU_GRAPH_DEPENDENCY_TYPE_DEFAULT + CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC + ctypedef CUgraphDependencyType_enum CUgraphDependencyType - ctypedef CUctx_flags_enum CUctx_flags +cdef extern from 'cuda.h': + ctypedef enum CUgraphInstantiateResult_enum: + CUDA_GRAPH_INSTANTIATE_SUCCESS + CUDA_GRAPH_INSTANTIATE_ERROR + CUDA_GRAPH_INSTANTIATE_INVALID_STRUCTURE + CUDA_GRAPH_INSTANTIATE_NODE_OPERATION_NOT_SUPPORTED + CUDA_GRAPH_INSTANTIATE_MULTIPLE_CTXS_NOT_SUPPORTED + CUDA_GRAPH_INSTANTIATE_CONDITIONAL_HANDLE_UNUSED + ctypedef CUgraphInstantiateResult_enum CUgraphInstantiateResult - cdef enum CUevent_sched_flags_enum: - CU_EVENT_SCHED_AUTO = 0 - CU_EVENT_SCHED_SPIN = 1 - CU_EVENT_SCHED_YIELD = 2 - CU_EVENT_SCHED_BLOCKING_SYNC = 4 +cdef extern from 'cuda.h': + ctypedef enum CUsynchronizationPolicy_enum: + CU_SYNC_POLICY_AUTO + CU_SYNC_POLICY_SPIN + CU_SYNC_POLICY_YIELD + CU_SYNC_POLICY_BLOCKING_SYNC + ctypedef CUsynchronizationPolicy_enum CUsynchronizationPolicy - ctypedef CUevent_sched_flags_enum CUevent_sched_flags +cdef extern from 'cuda.h': + ctypedef enum CUclusterSchedulingPolicy_enum: + CU_CLUSTER_SCHEDULING_POLICY_DEFAULT + CU_CLUSTER_SCHEDULING_POLICY_SPREAD + CU_CLUSTER_SCHEDULING_POLICY_LOAD_BALANCING + ctypedef CUclusterSchedulingPolicy_enum CUclusterSchedulingPolicy - cdef enum cl_event_flags_enum: - NVCL_EVENT_SCHED_AUTO = 0 - NVCL_EVENT_SCHED_SPIN = 1 - NVCL_EVENT_SCHED_YIELD = 2 - NVCL_EVENT_SCHED_BLOCKING_SYNC = 4 +cdef extern from 'cuda.h': + ctypedef enum CUlaunchMemSyncDomain_enum: + CU_LAUNCH_MEM_SYNC_DOMAIN_DEFAULT + CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE + ctypedef CUlaunchMemSyncDomain_enum CUlaunchMemSyncDomain - ctypedef cl_event_flags_enum cl_event_flags +cdef extern from 'cuda.h': + ctypedef enum CUlaunchAttributeID_enum: + CU_LAUNCH_ATTRIBUTE_IGNORE + CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW + CU_LAUNCH_ATTRIBUTE_COOPERATIVE + CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY + CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION + CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE + CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION + CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT + CU_LAUNCH_ATTRIBUTE_PRIORITY + CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP + CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN + CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION + CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT + CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE + CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT + CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING + CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE + CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE + ctypedef CUlaunchAttributeID_enum CUlaunchAttributeID - cdef enum cl_context_flags_enum: - NVCL_CTX_SCHED_AUTO = 0 - NVCL_CTX_SCHED_SPIN = 1 - NVCL_CTX_SCHED_YIELD = 2 - NVCL_CTX_SCHED_BLOCKING_SYNC = 4 +cdef extern from 'cuda.h': + ctypedef enum CUstreamCaptureStatus_enum: + CU_STREAM_CAPTURE_STATUS_NONE + CU_STREAM_CAPTURE_STATUS_ACTIVE + CU_STREAM_CAPTURE_STATUS_INVALIDATED + ctypedef CUstreamCaptureStatus_enum CUstreamCaptureStatus - ctypedef cl_context_flags_enum cl_context_flags +cdef extern from 'cuda.h': + ctypedef enum CUstreamCaptureMode_enum: + CU_STREAM_CAPTURE_MODE_GLOBAL + CU_STREAM_CAPTURE_MODE_THREAD_LOCAL + CU_STREAM_CAPTURE_MODE_RELAXED + ctypedef CUstreamCaptureMode_enum CUstreamCaptureMode - cdef enum CUhostTaskSyncMode_enum: - CU_HOST_TASK_BLOCKING = 0 - CU_HOST_TASK_SPINWAIT = 1 +cdef extern from 'cuda.h': + ctypedef enum CUdriverProcAddress_flags_enum: + CU_GET_PROC_ADDRESS_DEFAULT + CU_GET_PROC_ADDRESS_LEGACY_STREAM + CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM + ctypedef CUdriverProcAddress_flags_enum CUdriverProcAddress_flags - ctypedef CUhostTaskSyncMode_enum CUhostTaskSyncMode +cdef extern from 'cuda.h': + ctypedef enum CUdriverProcAddressQueryResult_enum: + CU_GET_PROC_ADDRESS_SUCCESS + CU_GET_PROC_ADDRESS_SYMBOL_NOT_FOUND + CU_GET_PROC_ADDRESS_VERSION_NOT_SUFFICIENT + ctypedef CUdriverProcAddressQueryResult_enum CUdriverProcAddressQueryResult - cdef enum CUstream_flags_enum: - CU_STREAM_DEFAULT = 0 - CU_STREAM_NON_BLOCKING = 1 +cdef extern from 'cuda.h': + ctypedef enum CUexecAffinityType_enum: + CU_EXEC_AFFINITY_TYPE_SM_COUNT + CU_EXEC_AFFINITY_TYPE_MAX + ctypedef CUexecAffinityType_enum CUexecAffinityType - ctypedef CUstream_flags_enum CUstream_flags +cdef extern from 'cuda.h': + ctypedef enum CUcigDataType_enum: + CIG_DATA_TYPE_D3D12_COMMAND_QUEUE + CIG_DATA_TYPE_NV_BLOB + ctypedef CUcigDataType_enum CUcigDataType - cdef enum CUevent_flags_enum: - CU_EVENT_DEFAULT = 0 - CU_EVENT_BLOCKING_SYNC = 1 - CU_EVENT_DISABLE_TIMING = 2 - CU_EVENT_INTERPROCESS = 4 +cdef extern from 'cuda.h': + ctypedef enum CUlibraryOption_enum: + CU_LIBRARY_HOST_UNIVERSAL_FUNCTION_AND_DATA_TABLE + CU_LIBRARY_BINARY_IS_PRESERVED + CU_LIBRARY_NUM_OPTIONS + ctypedef CUlibraryOption_enum CUlibraryOption - ctypedef CUevent_flags_enum CUevent_flags +cdef extern from 'cuda.h': + ctypedef enum cudaError_enum: + CUDA_SUCCESS + CUDA_ERROR_INVALID_VALUE + CUDA_ERROR_OUT_OF_MEMORY + CUDA_ERROR_NOT_INITIALIZED + CUDA_ERROR_DEINITIALIZED + CUDA_ERROR_PROFILER_DISABLED + CUDA_ERROR_PROFILER_NOT_INITIALIZED + CUDA_ERROR_PROFILER_ALREADY_STARTED + CUDA_ERROR_PROFILER_ALREADY_STOPPED + CUDA_ERROR_STUB_LIBRARY + CUDA_ERROR_CALL_REQUIRES_NEWER_DRIVER + CUDA_ERROR_DEVICE_UNAVAILABLE + CUDA_ERROR_NO_DEVICE + CUDA_ERROR_INVALID_DEVICE + CUDA_ERROR_DEVICE_NOT_LICENSED + CUDA_ERROR_INVALID_IMAGE + CUDA_ERROR_INVALID_CONTEXT + CUDA_ERROR_CONTEXT_ALREADY_CURRENT + CUDA_ERROR_MAP_FAILED + CUDA_ERROR_UNMAP_FAILED + CUDA_ERROR_ARRAY_IS_MAPPED + CUDA_ERROR_ALREADY_MAPPED + CUDA_ERROR_NO_BINARY_FOR_GPU + CUDA_ERROR_ALREADY_ACQUIRED + CUDA_ERROR_NOT_MAPPED + CUDA_ERROR_NOT_MAPPED_AS_ARRAY + CUDA_ERROR_NOT_MAPPED_AS_POINTER + CUDA_ERROR_ECC_UNCORRECTABLE + CUDA_ERROR_UNSUPPORTED_LIMIT + CUDA_ERROR_CONTEXT_ALREADY_IN_USE + CUDA_ERROR_PEER_ACCESS_UNSUPPORTED + CUDA_ERROR_INVALID_PTX + CUDA_ERROR_INVALID_GRAPHICS_CONTEXT + CUDA_ERROR_NVLINK_UNCORRECTABLE + CUDA_ERROR_JIT_COMPILER_NOT_FOUND + CUDA_ERROR_UNSUPPORTED_PTX_VERSION + CUDA_ERROR_JIT_COMPILATION_DISABLED + CUDA_ERROR_UNSUPPORTED_EXEC_AFFINITY + CUDA_ERROR_UNSUPPORTED_DEVSIDE_SYNC + CUDA_ERROR_CONTAINED + CUDA_ERROR_INVALID_SOURCE + CUDA_ERROR_FILE_NOT_FOUND + CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND + CUDA_ERROR_SHARED_OBJECT_INIT_FAILED + CUDA_ERROR_OPERATING_SYSTEM + CUDA_ERROR_INVALID_HANDLE + CUDA_ERROR_ILLEGAL_STATE + CUDA_ERROR_LOSSY_QUERY + CUDA_ERROR_NOT_FOUND + CUDA_ERROR_NOT_READY + CUDA_ERROR_ILLEGAL_ADDRESS + CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES + CUDA_ERROR_LAUNCH_TIMEOUT + CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING + CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED + CUDA_ERROR_PEER_ACCESS_NOT_ENABLED + CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE + CUDA_ERROR_CONTEXT_IS_DESTROYED + CUDA_ERROR_ASSERT + CUDA_ERROR_TOO_MANY_PEERS + CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED + CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED + CUDA_ERROR_HARDWARE_STACK_ERROR + CUDA_ERROR_ILLEGAL_INSTRUCTION + CUDA_ERROR_MISALIGNED_ADDRESS + CUDA_ERROR_INVALID_ADDRESS_SPACE + CUDA_ERROR_INVALID_PC + CUDA_ERROR_LAUNCH_FAILED + CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE + CUDA_ERROR_TENSOR_MEMORY_LEAK + CUDA_ERROR_NOT_PERMITTED + CUDA_ERROR_NOT_SUPPORTED + CUDA_ERROR_SYSTEM_NOT_READY + CUDA_ERROR_SYSTEM_DRIVER_MISMATCH + CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE + CUDA_ERROR_MPS_CONNECTION_FAILED + CUDA_ERROR_MPS_RPC_FAILURE + CUDA_ERROR_MPS_SERVER_NOT_READY + CUDA_ERROR_MPS_MAX_CLIENTS_REACHED + CUDA_ERROR_MPS_MAX_CONNECTIONS_REACHED + CUDA_ERROR_MPS_CLIENT_TERMINATED + CUDA_ERROR_CDP_NOT_SUPPORTED + CUDA_ERROR_CDP_VERSION_MISMATCH + CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED + CUDA_ERROR_STREAM_CAPTURE_INVALIDATED + CUDA_ERROR_STREAM_CAPTURE_MERGE + CUDA_ERROR_STREAM_CAPTURE_UNMATCHED + CUDA_ERROR_STREAM_CAPTURE_UNJOINED + CUDA_ERROR_STREAM_CAPTURE_ISOLATION + CUDA_ERROR_STREAM_CAPTURE_IMPLICIT + CUDA_ERROR_CAPTURED_EVENT + CUDA_ERROR_STREAM_CAPTURE_WRONG_THREAD + CUDA_ERROR_TIMEOUT + CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE + CUDA_ERROR_EXTERNAL_DEVICE + CUDA_ERROR_INVALID_CLUSTER_SIZE + CUDA_ERROR_FUNCTION_NOT_LOADED + CUDA_ERROR_INVALID_RESOURCE_TYPE + CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION + CUDA_ERROR_KEY_ROTATION + CUDA_ERROR_STREAM_DETACHED + CUDA_ERROR_GRAPH_RECAPTURE_FAILURE + CUDA_ERROR_UNKNOWN + ctypedef cudaError_enum CUresult - cdef enum CUevent_record_flags_enum: - CU_EVENT_RECORD_DEFAULT = 0 - CU_EVENT_RECORD_EXTERNAL = 1 +cdef extern from 'cuda.h': + ctypedef enum CUdevice_P2PAttribute_enum: + CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK + CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED + CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED + CU_DEVICE_P2P_ATTRIBUTE_ACCESS_ACCESS_SUPPORTED + CU_DEVICE_P2P_ATTRIBUTE_CUDA_ARRAY_ACCESS_SUPPORTED + CU_DEVICE_P2P_ATTRIBUTE_ONLY_PARTIAL_NATIVE_ATOMIC_SUPPORTED + ctypedef CUdevice_P2PAttribute_enum CUdevice_P2PAttribute - ctypedef CUevent_record_flags_enum CUevent_record_flags +cdef extern from 'cuda.h': + ctypedef enum CUresourceViewFormat_enum: + CU_RES_VIEW_FORMAT_NONE + CU_RES_VIEW_FORMAT_UINT_1X8 + CU_RES_VIEW_FORMAT_UINT_2X8 + CU_RES_VIEW_FORMAT_UINT_4X8 + CU_RES_VIEW_FORMAT_SINT_1X8 + CU_RES_VIEW_FORMAT_SINT_2X8 + CU_RES_VIEW_FORMAT_SINT_4X8 + CU_RES_VIEW_FORMAT_UINT_1X16 + CU_RES_VIEW_FORMAT_UINT_2X16 + CU_RES_VIEW_FORMAT_UINT_4X16 + CU_RES_VIEW_FORMAT_SINT_1X16 + CU_RES_VIEW_FORMAT_SINT_2X16 + CU_RES_VIEW_FORMAT_SINT_4X16 + CU_RES_VIEW_FORMAT_UINT_1X32 + CU_RES_VIEW_FORMAT_UINT_2X32 + CU_RES_VIEW_FORMAT_UINT_4X32 + CU_RES_VIEW_FORMAT_SINT_1X32 + CU_RES_VIEW_FORMAT_SINT_2X32 + CU_RES_VIEW_FORMAT_SINT_4X32 + CU_RES_VIEW_FORMAT_FLOAT_1X16 + CU_RES_VIEW_FORMAT_FLOAT_2X16 + CU_RES_VIEW_FORMAT_FLOAT_4X16 + CU_RES_VIEW_FORMAT_FLOAT_1X32 + CU_RES_VIEW_FORMAT_FLOAT_2X32 + CU_RES_VIEW_FORMAT_FLOAT_4X32 + CU_RES_VIEW_FORMAT_UNSIGNED_BC1 + CU_RES_VIEW_FORMAT_UNSIGNED_BC2 + CU_RES_VIEW_FORMAT_UNSIGNED_BC3 + CU_RES_VIEW_FORMAT_UNSIGNED_BC4 + CU_RES_VIEW_FORMAT_SIGNED_BC4 + CU_RES_VIEW_FORMAT_UNSIGNED_BC5 + CU_RES_VIEW_FORMAT_SIGNED_BC5 + CU_RES_VIEW_FORMAT_UNSIGNED_BC6H + CU_RES_VIEW_FORMAT_SIGNED_BC6H + CU_RES_VIEW_FORMAT_UNSIGNED_BC7 + ctypedef CUresourceViewFormat_enum CUresourceViewFormat - cdef enum CUevent_wait_flags_enum: - CU_EVENT_WAIT_DEFAULT = 0 - CU_EVENT_WAIT_EXTERNAL = 1 +cdef extern from 'cuda.h': + ctypedef enum CUtensorMapDataType_enum: + CU_TENSOR_MAP_DATA_TYPE_UINT8 + CU_TENSOR_MAP_DATA_TYPE_UINT16 + CU_TENSOR_MAP_DATA_TYPE_UINT32 + CU_TENSOR_MAP_DATA_TYPE_INT32 + CU_TENSOR_MAP_DATA_TYPE_UINT64 + CU_TENSOR_MAP_DATA_TYPE_INT64 + CU_TENSOR_MAP_DATA_TYPE_FLOAT16 + CU_TENSOR_MAP_DATA_TYPE_FLOAT32 + CU_TENSOR_MAP_DATA_TYPE_FLOAT64 + CU_TENSOR_MAP_DATA_TYPE_BFLOAT16 + CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ + CU_TENSOR_MAP_DATA_TYPE_TFLOAT32 + CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ + CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B + CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B + CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B + ctypedef CUtensorMapDataType_enum CUtensorMapDataType - ctypedef CUevent_wait_flags_enum CUevent_wait_flags +cdef extern from 'cuda.h': + ctypedef enum CUtensorMapInterleave_enum: + CU_TENSOR_MAP_INTERLEAVE_NONE + CU_TENSOR_MAP_INTERLEAVE_16B + CU_TENSOR_MAP_INTERLEAVE_32B + ctypedef CUtensorMapInterleave_enum CUtensorMapInterleave - 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 +cdef extern from 'cuda.h': + ctypedef enum CUtensorMapSwizzle_enum: + CU_TENSOR_MAP_SWIZZLE_NONE + CU_TENSOR_MAP_SWIZZLE_32B + CU_TENSOR_MAP_SWIZZLE_64B + CU_TENSOR_MAP_SWIZZLE_128B + CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B + CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B_FLIP_8B + CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B + ctypedef CUtensorMapSwizzle_enum CUtensorMapSwizzle - ctypedef CUatomicOperation_enum CUatomicOperation +cdef extern from 'cuda.h': + ctypedef enum CUtensorMapL2promotion_enum: + CU_TENSOR_MAP_L2_PROMOTION_NONE + CU_TENSOR_MAP_L2_PROMOTION_L2_64B + CU_TENSOR_MAP_L2_PROMOTION_L2_128B + CU_TENSOR_MAP_L2_PROMOTION_L2_256B + ctypedef CUtensorMapL2promotion_enum CUtensorMapL2promotion - 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 +cdef extern from 'cuda.h': + ctypedef enum CUtensorMapFloatOOBfill_enum: + CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE + CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA + ctypedef CUtensorMapFloatOOBfill_enum CUtensorMapFloatOOBfill - ctypedef CUatomicOperationCapability_enum CUatomicOperationCapability +cdef extern from 'cuda.h': + ctypedef enum CUtensorMapIm2ColWideMode_enum: + CU_TENSOR_MAP_IM2COL_WIDE_MODE_W + CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128 + ctypedef CUtensorMapIm2ColWideMode_enum CUtensorMapIm2ColWideMode - cdef enum CUstreamWaitValue_flags_enum: - CU_STREAM_WAIT_VALUE_GEQ = 0 - CU_STREAM_WAIT_VALUE_EQ = 1 - CU_STREAM_WAIT_VALUE_AND = 2 - CU_STREAM_WAIT_VALUE_NOR = 3 - CU_STREAM_WAIT_VALUE_FLUSH = 1073741824 +cdef extern from 'cuda.h': + ctypedef enum CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum: + CU_POINTER_ATTRIBUTE_ACCESS_FLAG_NONE + CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READ + CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READWRITE + ctypedef CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS - ctypedef CUstreamWaitValue_flags_enum CUstreamWaitValue_flags +cdef extern from 'cuda.h': + ctypedef enum CUexternalMemoryHandleType_enum: + CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD + CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32 + CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT + CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP + CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE + CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE + CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT + CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF + CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD + ctypedef CUexternalMemoryHandleType_enum CUexternalMemoryHandleType - cdef enum CUstreamWriteValue_flags_enum: - CU_STREAM_WRITE_VALUE_DEFAULT = 0 - CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER = 1 +cdef extern from 'cuda.h': + ctypedef enum CUexternalSemaphoreHandleType_enum: + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32 + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32 + ctypedef CUexternalSemaphoreHandleType_enum CUexternalSemaphoreHandleType - ctypedef CUstreamWriteValue_flags_enum CUstreamWriteValue_flags +cdef extern from 'cuda.h': + ctypedef enum CUmemAllocationHandleType_enum: + CU_MEM_HANDLE_TYPE_NONE + CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR + CU_MEM_HANDLE_TYPE_WIN32 + CU_MEM_HANDLE_TYPE_WIN32_KMT + CU_MEM_HANDLE_TYPE_FABRIC + CU_MEM_HANDLE_TYPE_MAX + ctypedef CUmemAllocationHandleType_enum CUmemAllocationHandleType - cdef enum CUstreamBatchMemOpType_enum: - CU_STREAM_MEM_OP_WAIT_VALUE_32 = 1 - CU_STREAM_MEM_OP_WRITE_VALUE_32 = 2 - CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES = 3 - CU_STREAM_MEM_OP_WAIT_VALUE_64 = 4 - CU_STREAM_MEM_OP_WRITE_VALUE_64 = 5 - CU_STREAM_MEM_OP_BARRIER = 6 - CU_STREAM_MEM_OP_ATOMIC_REDUCTION = 8 +cdef extern from 'cuda.h': + ctypedef enum CUmemAccess_flags_enum: + CU_MEM_ACCESS_FLAGS_PROT_NONE + CU_MEM_ACCESS_FLAGS_PROT_READ + CU_MEM_ACCESS_FLAGS_PROT_READWRITE + CU_MEM_ACCESS_FLAGS_PROT_MAX + ctypedef CUmemAccess_flags_enum CUmemAccess_flags - ctypedef CUstreamBatchMemOpType_enum CUstreamBatchMemOpType +cdef extern from 'cuda.h': + ctypedef enum CUmemLocationType_enum: + CU_MEM_LOCATION_TYPE_INVALID + CU_MEM_LOCATION_TYPE_NONE + CU_MEM_LOCATION_TYPE_DEVICE + CU_MEM_LOCATION_TYPE_HOST + CU_MEM_LOCATION_TYPE_HOST_NUMA + CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT + CU_MEM_LOCATION_TYPE_INVISIBLE + CU_MEM_LOCATION_TYPE_MAX + ctypedef CUmemLocationType_enum CUmemLocationType - cdef enum CUstreamMemoryBarrier_flags_enum: - CU_STREAM_MEMORY_BARRIER_TYPE_SYS = 0 - CU_STREAM_MEMORY_BARRIER_TYPE_GPU = 1 +cdef extern from 'cuda.h': + ctypedef enum CUmemAllocationType_enum: + CU_MEM_ALLOCATION_TYPE_INVALID + CU_MEM_ALLOCATION_TYPE_PINNED + CU_MEM_ALLOCATION_TYPE_MANAGED + CU_MEM_ALLOCATION_TYPE_MAX + ctypedef CUmemAllocationType_enum CUmemAllocationType - ctypedef CUstreamMemoryBarrier_flags_enum CUstreamMemoryBarrier_flags +cdef extern from 'cuda.h': + ctypedef enum CUmemAllocationGranularity_flags_enum: + CU_MEM_ALLOC_GRANULARITY_MINIMUM + CU_MEM_ALLOC_GRANULARITY_RECOMMENDED + ctypedef CUmemAllocationGranularity_flags_enum CUmemAllocationGranularity_flags - cdef enum CUstreamAtomicReductionOpType_enum: - CU_STREAM_ATOMIC_REDUCTION_OP_ADD = 0 - CU_STREAM_ATOMIC_REDUCTION_OP_AND = 5 - CU_STREAM_ATOMIC_REDUCTION_OP_OR = 6 +cdef extern from 'cuda.h': + ctypedef enum CUmemRangeHandleType_enum: + CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD + CU_MEM_RANGE_HANDLE_TYPE_MAX + ctypedef CUmemRangeHandleType_enum CUmemRangeHandleType - ctypedef CUstreamAtomicReductionOpType_enum CUstreamAtomicReductionOpType +cdef extern from 'cuda.h': + ctypedef enum CUmemRangeFlags_enum: + CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE + ctypedef CUmemRangeFlags_enum CUmemRangeFlags - cdef enum CUstreamAtomicReductionDataType_enum: - CU_STREAM_ATOMIC_REDUCTION_UNSIGNED_32 = 14 - CU_STREAM_ATOMIC_REDUCTION_UNSIGNED_64 = 22 +cdef extern from 'cuda.h': + ctypedef enum CUarraySparseSubresourceType_enum: + CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL + CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL + ctypedef CUarraySparseSubresourceType_enum CUarraySparseSubresourceType - ctypedef CUstreamAtomicReductionDataType_enum CUstreamAtomicReductionDataType +cdef extern from 'cuda.h': + ctypedef enum CUmemOperationType_enum: + CU_MEM_OPERATION_TYPE_MAP + CU_MEM_OPERATION_TYPE_UNMAP + ctypedef CUmemOperationType_enum CUmemOperationType - cdef struct CUstreamMemOpWaitValueParams_st: - CUstreamBatchMemOpType operation - CUdeviceptr address - cuuint32_t value - cuuint64_t value64 - unsigned int flags - CUdeviceptr alias +cdef extern from 'cuda.h': + ctypedef enum CUmemHandleType_enum: + CU_MEM_HANDLE_TYPE_GENERIC + ctypedef CUmemHandleType_enum CUmemHandleType - cdef struct CUstreamMemOpWriteValueParams_st: - CUstreamBatchMemOpType operation - CUdeviceptr address - cuuint32_t value - cuuint64_t value64 - unsigned int flags - CUdeviceptr alias +cdef extern from 'cuda.h': + ctypedef enum CUmemAllocationCompType_enum: + CU_MEM_ALLOCATION_COMP_NONE + CU_MEM_ALLOCATION_COMP_GENERIC + ctypedef CUmemAllocationCompType_enum CUmemAllocationCompType - cdef struct CUstreamMemOpFlushRemoteWritesParams_st: - CUstreamBatchMemOpType operation - unsigned int flags +cdef extern from 'cuda.h': + ctypedef enum CUmulticastGranularity_flags_enum: + CU_MULTICAST_GRANULARITY_MINIMUM + CU_MULTICAST_GRANULARITY_RECOMMENDED + ctypedef CUmulticastGranularity_flags_enum CUmulticastGranularity_flags - cdef struct CUstreamMemOpMemoryBarrierParams_st: - CUstreamBatchMemOpType operation - unsigned int flags +cdef extern from 'cuda.h': + ctypedef enum CUgraphExecUpdateResult_enum: + CU_GRAPH_EXEC_UPDATE_SUCCESS + CU_GRAPH_EXEC_UPDATE_ERROR + CU_GRAPH_EXEC_UPDATE_ERROR_TOPOLOGY_CHANGED + CU_GRAPH_EXEC_UPDATE_ERROR_NODE_TYPE_CHANGED + CU_GRAPH_EXEC_UPDATE_ERROR_FUNCTION_CHANGED + CU_GRAPH_EXEC_UPDATE_ERROR_PARAMETERS_CHANGED + CU_GRAPH_EXEC_UPDATE_ERROR_NOT_SUPPORTED + CU_GRAPH_EXEC_UPDATE_ERROR_UNSUPPORTED_FUNCTION_CHANGE + CU_GRAPH_EXEC_UPDATE_ERROR_ATTRIBUTES_CHANGED + ctypedef CUgraphExecUpdateResult_enum CUgraphExecUpdateResult - cdef struct CUstreamMemOpAtomicReductionParams_st: - CUstreamBatchMemOpType operation - unsigned int flags - CUstreamAtomicReductionOpType reductionOp - CUstreamAtomicReductionDataType dataType - CUdeviceptr address - cuuint64_t value - CUdeviceptr alias +cdef extern from 'cuda.h': + ctypedef enum CUmemPool_attribute_enum: + CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES + CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC + CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES + CU_MEMPOOL_ATTR_RELEASE_THRESHOLD + CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT + CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH + CU_MEMPOOL_ATTR_USED_MEM_CURRENT + CU_MEMPOOL_ATTR_USED_MEM_HIGH + CU_MEMPOOL_ATTR_ALLOCATION_TYPE + CU_MEMPOOL_ATTR_EXPORT_HANDLE_TYPES + CU_MEMPOOL_ATTR_LOCATION_ID + CU_MEMPOOL_ATTR_LOCATION_TYPE + CU_MEMPOOL_ATTR_MAX_POOL_SIZE + CU_MEMPOOL_ATTR_HW_DECOMPRESS_ENABLED + ctypedef CUmemPool_attribute_enum CUmemPool_attribute - cdef union CUstreamBatchMemOpParams_union: - CUstreamBatchMemOpType operation - CUstreamMemOpWaitValueParams_st waitValue - CUstreamMemOpWriteValueParams_st writeValue - CUstreamMemOpFlushRemoteWritesParams_st flushRemoteWrites - CUstreamMemOpMemoryBarrierParams_st memoryBarrier - CUstreamMemOpAtomicReductionParams_st atomicReduction - cuuint64_t pad[6] +cdef extern from 'cuda.h': + ctypedef enum CUmemcpyFlags_enum: + CU_MEMCPY_FLAG_DEFAULT + CU_MEMCPY_FLAG_PREFER_OVERLAP_WITH_COMPUTE + ctypedef CUmemcpyFlags_enum CUmemcpyFlags - ctypedef CUstreamBatchMemOpParams_union CUstreamBatchMemOpParams_v1 +cdef extern from 'cuda.h': + ctypedef enum CUmemcpySrcAccessOrder_enum: + CU_MEMCPY_SRC_ACCESS_ORDER_INVALID + CU_MEMCPY_SRC_ACCESS_ORDER_STREAM + CU_MEMCPY_SRC_ACCESS_ORDER_DURING_API_CALL + CU_MEMCPY_SRC_ACCESS_ORDER_ANY + CU_MEMCPY_SRC_ACCESS_ORDER_MAX + ctypedef CUmemcpySrcAccessOrder_enum CUmemcpySrcAccessOrder - ctypedef CUstreamBatchMemOpParams_v1 CUstreamBatchMemOpParams +cdef extern from 'cuda.h': + ctypedef enum CUmemcpy3DOperandType_enum: + CU_MEMCPY_OPERAND_TYPE_POINTER + CU_MEMCPY_OPERAND_TYPE_ARRAY + CU_MEMCPY_OPERAND_TYPE_MAX + ctypedef CUmemcpy3DOperandType_enum CUmemcpy3DOperandType - cdef struct CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st: - CUcontext ctx - unsigned int count - CUstreamBatchMemOpParams* paramArray - unsigned int flags +cdef extern from 'cuda.h': + ctypedef enum CUgraphMem_attribute_enum: + CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT + CU_GRAPH_MEM_ATTR_USED_MEM_HIGH + CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT + CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH + ctypedef CUgraphMem_attribute_enum CUgraphMem_attribute - ctypedef CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st CUDA_BATCH_MEM_OP_NODE_PARAMS_v1 +cdef extern from 'cuda.h': + ctypedef enum CUgraphChildGraphNodeOwnership_enum: + CU_GRAPH_CHILD_GRAPH_OWNERSHIP_CLONE + CU_GRAPH_CHILD_GRAPH_OWNERSHIP_MOVE + CU_GRAPH_CHILD_GRAPH_OWNERSHIP_INVALID + ctypedef CUgraphChildGraphNodeOwnership_enum CUgraphChildGraphNodeOwnership - ctypedef CUDA_BATCH_MEM_OP_NODE_PARAMS_v1 CUDA_BATCH_MEM_OP_NODE_PARAMS +cdef extern from 'cuda.h': + ctypedef enum CUflushGPUDirectRDMAWritesOptions_enum: + CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_HOST + CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_MEMOPS + ctypedef CUflushGPUDirectRDMAWritesOptions_enum CUflushGPUDirectRDMAWritesOptions - cdef struct CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st: - CUcontext ctx - unsigned int count - CUstreamBatchMemOpParams* paramArray - unsigned int flags +cdef extern from 'cuda.h': + ctypedef enum CUGPUDirectRDMAWritesOrdering_enum: + CU_GPU_DIRECT_RDMA_WRITES_ORDERING_NONE + CU_GPU_DIRECT_RDMA_WRITES_ORDERING_OWNER + CU_GPU_DIRECT_RDMA_WRITES_ORDERING_ALL_DEVICES + ctypedef CUGPUDirectRDMAWritesOrdering_enum CUGPUDirectRDMAWritesOrdering - ctypedef CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st CUDA_BATCH_MEM_OP_NODE_PARAMS_v2 +cdef extern from 'cuda.h': + ctypedef enum CUflushGPUDirectRDMAWritesScope_enum: + CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_OWNER + CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_ALL_DEVICES + ctypedef CUflushGPUDirectRDMAWritesScope_enum CUflushGPUDirectRDMAWritesScope - cdef enum CUoccupancy_flags_enum: - CU_OCCUPANCY_DEFAULT = 0 - CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE = 1 +cdef extern from 'cuda.h': + ctypedef enum CUflushGPUDirectRDMAWritesTarget_enum: + CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TARGET_CURRENT_CTX + ctypedef CUflushGPUDirectRDMAWritesTarget_enum CUflushGPUDirectRDMAWritesTarget - ctypedef CUoccupancy_flags_enum CUoccupancy_flags +cdef extern from 'cuda.h': + ctypedef enum CUgraphDebugDot_flags_enum: + CU_GRAPH_DEBUG_DOT_FLAGS_VERBOSE + CU_GRAPH_DEBUG_DOT_FLAGS_RUNTIME_TYPES + CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_PARAMS + CU_GRAPH_DEBUG_DOT_FLAGS_MEMCPY_NODE_PARAMS + CU_GRAPH_DEBUG_DOT_FLAGS_MEMSET_NODE_PARAMS + CU_GRAPH_DEBUG_DOT_FLAGS_HOST_NODE_PARAMS + CU_GRAPH_DEBUG_DOT_FLAGS_EVENT_NODE_PARAMS + CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_SIGNAL_NODE_PARAMS + CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_WAIT_NODE_PARAMS + CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_ATTRIBUTES + CU_GRAPH_DEBUG_DOT_FLAGS_HANDLES + CU_GRAPH_DEBUG_DOT_FLAGS_MEM_ALLOC_NODE_PARAMS + CU_GRAPH_DEBUG_DOT_FLAGS_MEM_FREE_NODE_PARAMS + CU_GRAPH_DEBUG_DOT_FLAGS_BATCH_MEM_OP_NODE_PARAMS + CU_GRAPH_DEBUG_DOT_FLAGS_EXTRA_TOPO_INFO + CU_GRAPH_DEBUG_DOT_FLAGS_CONDITIONAL_NODE_PARAMS + ctypedef CUgraphDebugDot_flags_enum CUgraphDebugDot_flags - cdef enum CUstreamUpdateCaptureDependencies_flags_enum: - CU_STREAM_ADD_CAPTURE_DEPENDENCIES = 0 - CU_STREAM_SET_CAPTURE_DEPENDENCIES = 1 +cdef extern from 'cuda.h': + ctypedef enum CUuserObject_flags_enum: + CU_USER_OBJECT_NO_DESTRUCTOR_SYNC + ctypedef CUuserObject_flags_enum CUuserObject_flags - ctypedef CUstreamUpdateCaptureDependencies_flags_enum CUstreamUpdateCaptureDependencies_flags +cdef extern from 'cuda.h': + ctypedef enum CUuserObjectRetain_flags_enum: + CU_GRAPH_USER_OBJECT_MOVE + ctypedef CUuserObjectRetain_flags_enum CUuserObjectRetain_flags - cdef enum CUasyncNotificationType_enum: - CU_ASYNC_NOTIFICATION_TYPE_OVER_BUDGET = 1 +cdef extern from 'cuda.h': + ctypedef enum CUgraphInstantiate_flags_enum: + CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH + CUDA_GRAPH_INSTANTIATE_FLAG_UPLOAD + CUDA_GRAPH_INSTANTIATE_FLAG_DEVICE_LAUNCH + CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY + ctypedef CUgraphInstantiate_flags_enum CUgraphInstantiate_flags - ctypedef CUasyncNotificationType_enum CUasyncNotificationType +cdef extern from 'cuda.h': + ctypedef enum CUdeviceNumaConfig_enum: + CU_DEVICE_NUMA_CONFIG_NONE + CU_DEVICE_NUMA_CONFIG_NUMA_NODE + ctypedef CUdeviceNumaConfig_enum CUdeviceNumaConfig - cdef struct anon_struct0: - unsigned long long bytesOverBudget +cdef extern from 'cuda.h': + ctypedef enum CUprocessState_enum: + CU_PROCESS_STATE_RUNNING + CU_PROCESS_STATE_LOCKED + CU_PROCESS_STATE_CHECKPOINTED + CU_PROCESS_STATE_FAILED + ctypedef CUprocessState_enum CUprocessState - cdef union anon_union2: - anon_struct0 overBudget +cdef extern from 'cuda.h': + ctypedef enum CUmoduleLoadingMode_enum: + CU_MODULE_EAGER_LOADING + CU_MODULE_LAZY_LOADING + ctypedef CUmoduleLoadingMode_enum CUmoduleLoadingMode - cdef struct CUasyncNotificationInfo_st: - CUasyncNotificationType type - anon_union2 info +cdef extern from 'cuda.h': + ctypedef enum CUmemDecompressAlgorithm_enum: + CU_MEM_DECOMPRESS_UNSUPPORTED + CU_MEM_DECOMPRESS_ALGORITHM_DEFLATE + CU_MEM_DECOMPRESS_ALGORITHM_SNAPPY + CU_MEM_DECOMPRESS_ALGORITHM_LZ4 + ctypedef CUmemDecompressAlgorithm_enum CUmemDecompressAlgorithm - ctypedef CUasyncNotificationInfo_st CUasyncNotificationInfo +cdef extern from 'cuda.h': + ctypedef enum CUfunctionLoadingState_enum: + CU_FUNCTION_LOADING_STATE_UNLOADED + CU_FUNCTION_LOADING_STATE_LOADED + CU_FUNCTION_LOADING_STATE_MAX + ctypedef CUfunctionLoadingState_enum CUfunctionLoadingState - ctypedef void (*CUasyncCallback)(CUasyncNotificationInfo* info, void* userData, CUasyncCallbackHandle callback) - - cdef enum CUarray_format_enum: - CU_AD_FORMAT_UNSIGNED_INT8 = 1 - CU_AD_FORMAT_UNSIGNED_INT16 = 2 - CU_AD_FORMAT_UNSIGNED_INT32 = 3 - CU_AD_FORMAT_SIGNED_INT8 = 8 - CU_AD_FORMAT_SIGNED_INT16 = 9 - CU_AD_FORMAT_SIGNED_INT32 = 10 - CU_AD_FORMAT_HALF = 16 - CU_AD_FORMAT_FLOAT = 32 - CU_AD_FORMAT_UNORM_INT_101010_2 = 80 - CU_AD_FORMAT_UINT8_PACKED_422 = 81 - CU_AD_FORMAT_UINT8_PACKED_444 = 82 - CU_AD_FORMAT_UINT8_SEMIPLANAR_420 = 83 - CU_AD_FORMAT_UINT16_SEMIPLANAR_420 = 84 - CU_AD_FORMAT_UINT8_SEMIPLANAR_422 = 85 - CU_AD_FORMAT_UINT16_SEMIPLANAR_422 = 86 - CU_AD_FORMAT_UINT8_SEMIPLANAR_444 = 87 - CU_AD_FORMAT_UINT16_SEMIPLANAR_444 = 88 - CU_AD_FORMAT_UINT8_PLANAR_420 = 89 - CU_AD_FORMAT_UINT16_PLANAR_420 = 90 - CU_AD_FORMAT_UINT8_PLANAR_422 = 91 - CU_AD_FORMAT_UINT16_PLANAR_422 = 92 - CU_AD_FORMAT_UINT8_PLANAR_444 = 93 - CU_AD_FORMAT_UINT16_PLANAR_444 = 94 - CU_AD_FORMAT_BC1_UNORM = 145 - CU_AD_FORMAT_BC1_UNORM_SRGB = 146 - CU_AD_FORMAT_BC2_UNORM = 147 - CU_AD_FORMAT_BC2_UNORM_SRGB = 148 - CU_AD_FORMAT_BC3_UNORM = 149 - CU_AD_FORMAT_BC3_UNORM_SRGB = 150 - CU_AD_FORMAT_BC4_UNORM = 151 - CU_AD_FORMAT_BC4_SNORM = 152 - CU_AD_FORMAT_BC5_UNORM = 153 - CU_AD_FORMAT_BC5_SNORM = 154 - CU_AD_FORMAT_BC6H_UF16 = 155 - CU_AD_FORMAT_BC6H_SF16 = 156 - CU_AD_FORMAT_BC7_UNORM = 157 - CU_AD_FORMAT_BC7_UNORM_SRGB = 158 - CU_AD_FORMAT_P010 = 159 - CU_AD_FORMAT_P016 = 161 - CU_AD_FORMAT_NV16 = 162 - CU_AD_FORMAT_P210 = 163 - CU_AD_FORMAT_P216 = 164 - CU_AD_FORMAT_YUY2 = 165 - CU_AD_FORMAT_Y210 = 166 - CU_AD_FORMAT_Y216 = 167 - CU_AD_FORMAT_AYUV = 168 - CU_AD_FORMAT_Y410 = 169 - CU_AD_FORMAT_NV12 = 176 - CU_AD_FORMAT_Y416 = 177 - CU_AD_FORMAT_Y444_PLANAR8 = 178 - CU_AD_FORMAT_Y444_PLANAR10 = 179 - CU_AD_FORMAT_YUV444_8bit_SemiPlanar = 180 - CU_AD_FORMAT_YUV444_16bit_SemiPlanar = 181 - CU_AD_FORMAT_UNORM_INT8X1 = 192 - CU_AD_FORMAT_UNORM_INT8X2 = 193 - CU_AD_FORMAT_UNORM_INT8X4 = 194 - CU_AD_FORMAT_UNORM_INT16X1 = 195 - CU_AD_FORMAT_UNORM_INT16X2 = 196 - CU_AD_FORMAT_UNORM_INT16X4 = 197 - CU_AD_FORMAT_SNORM_INT8X1 = 198 - CU_AD_FORMAT_SNORM_INT8X2 = 199 - CU_AD_FORMAT_SNORM_INT8X4 = 200 - CU_AD_FORMAT_SNORM_INT16X1 = 201 - CU_AD_FORMAT_SNORM_INT16X2 = 202 - CU_AD_FORMAT_SNORM_INT16X4 = 203 - CU_AD_FORMAT_MAX = 2147483647 +cdef extern from 'cuda.h': + ctypedef enum CUcoredumpSettings_enum: + CU_COREDUMP_ENABLE_ON_EXCEPTION + CU_COREDUMP_TRIGGER_HOST + CU_COREDUMP_LIGHTWEIGHT + CU_COREDUMP_ENABLE_USER_TRIGGER + CU_COREDUMP_FILE + CU_COREDUMP_PIPE + CU_COREDUMP_GENERATION_FLAGS + CU_COREDUMP_MAX + ctypedef CUcoredumpSettings_enum CUcoredumpSettings - ctypedef CUarray_format_enum CUarray_format +cdef extern from 'cuda.h': + ctypedef enum CUCoredumpGenerationFlags: + CU_COREDUMP_DEFAULT_FLAGS + CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES + CU_COREDUMP_SKIP_GLOBAL_MEMORY + CU_COREDUMP_SKIP_SHARED_MEMORY + CU_COREDUMP_SKIP_LOCAL_MEMORY + CU_COREDUMP_SKIP_ABORT + CU_COREDUMP_SKIP_CONSTBANK_MEMORY + CU_COREDUMP_GZIP_COMPRESS + CU_COREDUMP_FAULTED_CONTEXTS_ONLY + CU_COREDUMP_NO_ERRBAR_AT_EXIT + CU_COREDUMP_LOG_ONLY + CU_COREDUMP_LIGHTWEIGHT_FLAGS + +cdef extern from 'cuda.h': + ctypedef enum CUgreenCtxCreate_flags: + CU_GREEN_CTX_NONE + CU_GREEN_CTX_DEFAULT_STREAM - cdef enum CUaddress_mode_enum: - CU_TR_ADDRESS_MODE_WRAP = 0 - CU_TR_ADDRESS_MODE_CLAMP = 1 - CU_TR_ADDRESS_MODE_MIRROR = 2 - CU_TR_ADDRESS_MODE_BORDER = 3 +cdef extern from 'cuda.h': + ctypedef enum CUdevResourceType: + CU_DEV_RESOURCE_TYPE_INVALID + CU_DEV_RESOURCE_TYPE_SM + CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG + CU_DEV_RESOURCE_TYPE_WORKQUEUE + +cdef extern from 'cuda.h': + ctypedef enum CUlogLevel_enum: + CU_LOG_LEVEL_ERROR + CU_LOG_LEVEL_WARNING + ctypedef CUlogLevel_enum CUlogLevel - ctypedef CUaddress_mode_enum CUaddress_mode +ctypedef enum CUeglFrameType_enum "CUeglFrameType_enum": + CU_EGL_FRAME_TYPE_ARRAY "CU_EGL_FRAME_TYPE_ARRAY" = 0 + CU_EGL_FRAME_TYPE_PITCH "CU_EGL_FRAME_TYPE_PITCH" = 1 +ctypedef CUeglFrameType_enum CUeglFrameType "CUeglFrameType" + +ctypedef enum CUeglResourceLocationFlags_enum "CUeglResourceLocationFlags_enum": + CU_EGL_RESOURCE_LOCATION_SYSMEM "CU_EGL_RESOURCE_LOCATION_SYSMEM" = 0x00 + CU_EGL_RESOURCE_LOCATION_VIDMEM "CU_EGL_RESOURCE_LOCATION_VIDMEM" = 0x01 +ctypedef CUeglResourceLocationFlags_enum CUeglResourceLocationFlags "CUeglResourceLocationFlags" + +ctypedef enum CUeglColorFormat_enum "CUeglColorFormat_enum": + CU_EGL_COLOR_FORMAT_YUV420_PLANAR "CU_EGL_COLOR_FORMAT_YUV420_PLANAR" = 0x00 + CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR "CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR" = 0x01 + CU_EGL_COLOR_FORMAT_YUV422_PLANAR "CU_EGL_COLOR_FORMAT_YUV422_PLANAR" = 0x02 + CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR "CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR" = 0x03 + CU_EGL_COLOR_FORMAT_RGB "CU_EGL_COLOR_FORMAT_RGB" = 0x04 + CU_EGL_COLOR_FORMAT_BGR "CU_EGL_COLOR_FORMAT_BGR" = 0x05 + CU_EGL_COLOR_FORMAT_ARGB "CU_EGL_COLOR_FORMAT_ARGB" = 0x06 + CU_EGL_COLOR_FORMAT_RGBA "CU_EGL_COLOR_FORMAT_RGBA" = 0x07 + CU_EGL_COLOR_FORMAT_L "CU_EGL_COLOR_FORMAT_L" = 0x08 + CU_EGL_COLOR_FORMAT_R "CU_EGL_COLOR_FORMAT_R" = 0x09 + CU_EGL_COLOR_FORMAT_YUV444_PLANAR "CU_EGL_COLOR_FORMAT_YUV444_PLANAR" = 0x0A + CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR "CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR" = 0x0B + CU_EGL_COLOR_FORMAT_YUYV_422 "CU_EGL_COLOR_FORMAT_YUYV_422" = 0x0C + CU_EGL_COLOR_FORMAT_UYVY_422 "CU_EGL_COLOR_FORMAT_UYVY_422" = 0x0D + CU_EGL_COLOR_FORMAT_ABGR "CU_EGL_COLOR_FORMAT_ABGR" = 0x0E + CU_EGL_COLOR_FORMAT_BGRA "CU_EGL_COLOR_FORMAT_BGRA" = 0x0F + CU_EGL_COLOR_FORMAT_A "CU_EGL_COLOR_FORMAT_A" = 0x10 + CU_EGL_COLOR_FORMAT_RG "CU_EGL_COLOR_FORMAT_RG" = 0x11 + CU_EGL_COLOR_FORMAT_AYUV "CU_EGL_COLOR_FORMAT_AYUV" = 0x12 + CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR "CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR" = 0x13 + CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR "CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR" = 0x14 + CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR "CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR" = 0x15 + CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR "CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR" = 0x16 + CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR "CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR" = 0x17 + CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR "CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR" = 0x18 + CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR "CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR" = 0x19 + CU_EGL_COLOR_FORMAT_VYUY_ER "CU_EGL_COLOR_FORMAT_VYUY_ER" = 0x1A + CU_EGL_COLOR_FORMAT_UYVY_ER "CU_EGL_COLOR_FORMAT_UYVY_ER" = 0x1B + CU_EGL_COLOR_FORMAT_YUYV_ER "CU_EGL_COLOR_FORMAT_YUYV_ER" = 0x1C + CU_EGL_COLOR_FORMAT_YVYU_ER "CU_EGL_COLOR_FORMAT_YVYU_ER" = 0x1D + CU_EGL_COLOR_FORMAT_YUV_ER "CU_EGL_COLOR_FORMAT_YUV_ER" = 0x1E + CU_EGL_COLOR_FORMAT_YUVA_ER "CU_EGL_COLOR_FORMAT_YUVA_ER" = 0x1F + CU_EGL_COLOR_FORMAT_AYUV_ER "CU_EGL_COLOR_FORMAT_AYUV_ER" = 0x20 + CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER "CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER" = 0x21 + CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER "CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER" = 0x22 + CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER "CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER" = 0x23 + CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER "CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER" = 0x24 + CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER "CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER" = 0x25 + CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER "CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER" = 0x26 + CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER "CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER" = 0x27 + CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER "CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER" = 0x28 + CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER "CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER" = 0x29 + CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER "CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER" = 0x2A + CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER "CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER" = 0x2B + CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER "CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER" = 0x2C + CU_EGL_COLOR_FORMAT_BAYER_RGGB "CU_EGL_COLOR_FORMAT_BAYER_RGGB" = 0x2D + CU_EGL_COLOR_FORMAT_BAYER_BGGR "CU_EGL_COLOR_FORMAT_BAYER_BGGR" = 0x2E + CU_EGL_COLOR_FORMAT_BAYER_GRBG "CU_EGL_COLOR_FORMAT_BAYER_GRBG" = 0x2F + CU_EGL_COLOR_FORMAT_BAYER_GBRG "CU_EGL_COLOR_FORMAT_BAYER_GBRG" = 0x30 + CU_EGL_COLOR_FORMAT_BAYER10_RGGB "CU_EGL_COLOR_FORMAT_BAYER10_RGGB" = 0x31 + CU_EGL_COLOR_FORMAT_BAYER10_BGGR "CU_EGL_COLOR_FORMAT_BAYER10_BGGR" = 0x32 + CU_EGL_COLOR_FORMAT_BAYER10_GRBG "CU_EGL_COLOR_FORMAT_BAYER10_GRBG" = 0x33 + CU_EGL_COLOR_FORMAT_BAYER10_GBRG "CU_EGL_COLOR_FORMAT_BAYER10_GBRG" = 0x34 + CU_EGL_COLOR_FORMAT_BAYER12_RGGB "CU_EGL_COLOR_FORMAT_BAYER12_RGGB" = 0x35 + CU_EGL_COLOR_FORMAT_BAYER12_BGGR "CU_EGL_COLOR_FORMAT_BAYER12_BGGR" = 0x36 + CU_EGL_COLOR_FORMAT_BAYER12_GRBG "CU_EGL_COLOR_FORMAT_BAYER12_GRBG" = 0x37 + CU_EGL_COLOR_FORMAT_BAYER12_GBRG "CU_EGL_COLOR_FORMAT_BAYER12_GBRG" = 0x38 + CU_EGL_COLOR_FORMAT_BAYER14_RGGB "CU_EGL_COLOR_FORMAT_BAYER14_RGGB" = 0x39 + CU_EGL_COLOR_FORMAT_BAYER14_BGGR "CU_EGL_COLOR_FORMAT_BAYER14_BGGR" = 0x3A + CU_EGL_COLOR_FORMAT_BAYER14_GRBG "CU_EGL_COLOR_FORMAT_BAYER14_GRBG" = 0x3B + CU_EGL_COLOR_FORMAT_BAYER14_GBRG "CU_EGL_COLOR_FORMAT_BAYER14_GBRG" = 0x3C + CU_EGL_COLOR_FORMAT_BAYER20_RGGB "CU_EGL_COLOR_FORMAT_BAYER20_RGGB" = 0x3D + CU_EGL_COLOR_FORMAT_BAYER20_BGGR "CU_EGL_COLOR_FORMAT_BAYER20_BGGR" = 0x3E + CU_EGL_COLOR_FORMAT_BAYER20_GRBG "CU_EGL_COLOR_FORMAT_BAYER20_GRBG" = 0x3F + CU_EGL_COLOR_FORMAT_BAYER20_GBRG "CU_EGL_COLOR_FORMAT_BAYER20_GBRG" = 0x40 + CU_EGL_COLOR_FORMAT_YVU444_PLANAR "CU_EGL_COLOR_FORMAT_YVU444_PLANAR" = 0x41 + CU_EGL_COLOR_FORMAT_YVU422_PLANAR "CU_EGL_COLOR_FORMAT_YVU422_PLANAR" = 0x42 + CU_EGL_COLOR_FORMAT_YVU420_PLANAR "CU_EGL_COLOR_FORMAT_YVU420_PLANAR" = 0x43 + CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB "CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB" = 0x44 + CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR "CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR" = 0x45 + CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG "CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG" = 0x46 + CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG "CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG" = 0x47 + CU_EGL_COLOR_FORMAT_BAYER_BCCR "CU_EGL_COLOR_FORMAT_BAYER_BCCR" = 0x48 + CU_EGL_COLOR_FORMAT_BAYER_RCCB "CU_EGL_COLOR_FORMAT_BAYER_RCCB" = 0x49 + CU_EGL_COLOR_FORMAT_BAYER_CRBC "CU_EGL_COLOR_FORMAT_BAYER_CRBC" = 0x4A + CU_EGL_COLOR_FORMAT_BAYER_CBRC "CU_EGL_COLOR_FORMAT_BAYER_CBRC" = 0x4B + CU_EGL_COLOR_FORMAT_BAYER10_CCCC "CU_EGL_COLOR_FORMAT_BAYER10_CCCC" = 0x4C + CU_EGL_COLOR_FORMAT_BAYER12_BCCR "CU_EGL_COLOR_FORMAT_BAYER12_BCCR" = 0x4D + CU_EGL_COLOR_FORMAT_BAYER12_RCCB "CU_EGL_COLOR_FORMAT_BAYER12_RCCB" = 0x4E + CU_EGL_COLOR_FORMAT_BAYER12_CRBC "CU_EGL_COLOR_FORMAT_BAYER12_CRBC" = 0x4F + CU_EGL_COLOR_FORMAT_BAYER12_CBRC "CU_EGL_COLOR_FORMAT_BAYER12_CBRC" = 0x50 + CU_EGL_COLOR_FORMAT_BAYER12_CCCC "CU_EGL_COLOR_FORMAT_BAYER12_CCCC" = 0x51 + CU_EGL_COLOR_FORMAT_Y "CU_EGL_COLOR_FORMAT_Y" = 0x52 + CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020 "CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020" = 0x53 + CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020 "CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020" = 0x54 + CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020 "CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020" = 0x55 + CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020 "CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020" = 0x56 + CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709 "CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709" = 0x57 + CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709 "CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709" = 0x58 + CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709 "CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709" = 0x59 + CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709 "CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709" = 0x5A + CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 "CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709" = 0x5B + CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 "CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020" = 0x5C + CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 "CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020" = 0x5D + CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR "CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR" = 0x5E + CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709 "CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709" = 0x5F + CU_EGL_COLOR_FORMAT_Y_ER "CU_EGL_COLOR_FORMAT_Y_ER" = 0x60 + CU_EGL_COLOR_FORMAT_Y_709_ER "CU_EGL_COLOR_FORMAT_Y_709_ER" = 0x61 + CU_EGL_COLOR_FORMAT_Y10_ER "CU_EGL_COLOR_FORMAT_Y10_ER" = 0x62 + CU_EGL_COLOR_FORMAT_Y10_709_ER "CU_EGL_COLOR_FORMAT_Y10_709_ER" = 0x63 + CU_EGL_COLOR_FORMAT_Y12_ER "CU_EGL_COLOR_FORMAT_Y12_ER" = 0x64 + CU_EGL_COLOR_FORMAT_Y12_709_ER "CU_EGL_COLOR_FORMAT_Y12_709_ER" = 0x65 + CU_EGL_COLOR_FORMAT_YUVA "CU_EGL_COLOR_FORMAT_YUVA" = 0x66 + CU_EGL_COLOR_FORMAT_YUV "CU_EGL_COLOR_FORMAT_YUV" = 0x67 + CU_EGL_COLOR_FORMAT_YVYU "CU_EGL_COLOR_FORMAT_YVYU" = 0x68 + CU_EGL_COLOR_FORMAT_VYUY "CU_EGL_COLOR_FORMAT_VYUY" = 0x69 + CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER "CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER" = 0x6A + CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER "CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER" = 0x6B + CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER "CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER" = 0x6C + CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER "CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER" = 0x6D + CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER "CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER" = 0x6E + CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER "CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER" = 0x6F + CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER "CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER" = 0x70 + CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER "CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER" = 0x71 + CU_EGL_COLOR_FORMAT_UYVY_709 "CU_EGL_COLOR_FORMAT_UYVY_709" = 0x72 + CU_EGL_COLOR_FORMAT_UYVY_709_ER "CU_EGL_COLOR_FORMAT_UYVY_709_ER" = 0x73 + CU_EGL_COLOR_FORMAT_UYVY_2020 "CU_EGL_COLOR_FORMAT_UYVY_2020" = 0x74 + CU_EGL_COLOR_FORMAT_MAX "CU_EGL_COLOR_FORMAT_MAX" +ctypedef CUeglColorFormat_enum CUeglColorFormat "CUeglColorFormat" + +ctypedef enum CUGLmap_flags_enum "CUGLmap_flags_enum": + CU_GL_MAP_RESOURCE_FLAGS_NONE "CU_GL_MAP_RESOURCE_FLAGS_NONE" = 0x00 + CU_GL_MAP_RESOURCE_FLAGS_READ_ONLY "CU_GL_MAP_RESOURCE_FLAGS_READ_ONLY" = 0x01 + CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD "CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD" = 0x02 +ctypedef CUGLmap_flags_enum CUGLmap_flags "CUGLmap_flags" + +ctypedef enum CUoutput_mode_enum "CUoutput_mode_enum": + CU_OUT_KEY_VALUE_PAIR "CU_OUT_KEY_VALUE_PAIR" = 0x00 + CU_OUT_CSV "CU_OUT_CSV" = 0x01 +ctypedef CUoutput_mode_enum CUoutput_mode "CUoutput_mode" + +cdef extern from 'cuda.h': + ctypedef enum CUatomicOperation_enum: + CU_ATOMIC_OPERATION_INTEGER_ADD + CU_ATOMIC_OPERATION_INTEGER_MIN + CU_ATOMIC_OPERATION_INTEGER_MAX + CU_ATOMIC_OPERATION_INTEGER_INCREMENT + CU_ATOMIC_OPERATION_INTEGER_DECREMENT + CU_ATOMIC_OPERATION_AND + CU_ATOMIC_OPERATION_OR + CU_ATOMIC_OPERATION_XOR + CU_ATOMIC_OPERATION_EXCHANGE + CU_ATOMIC_OPERATION_CAS + CU_ATOMIC_OPERATION_FLOAT_ADD + CU_ATOMIC_OPERATION_FLOAT_MIN + CU_ATOMIC_OPERATION_FLOAT_MAX + CU_ATOMIC_OPERATION_MAX + ctypedef CUatomicOperation_enum CUatomicOperation - cdef enum CUfilter_mode_enum: - CU_TR_FILTER_MODE_POINT = 0 - CU_TR_FILTER_MODE_LINEAR = 1 +cdef extern from 'cuda.h': + ctypedef enum CUatomicOperationCapability_enum: + CU_ATOMIC_CAPABILITY_SIGNED + CU_ATOMIC_CAPABILITY_UNSIGNED + CU_ATOMIC_CAPABILITY_REDUCTION + CU_ATOMIC_CAPABILITY_SCALAR_32 + CU_ATOMIC_CAPABILITY_SCALAR_64 + CU_ATOMIC_CAPABILITY_SCALAR_128 + CU_ATOMIC_CAPABILITY_VECTOR_32x4 + ctypedef CUatomicOperationCapability_enum CUatomicOperationCapability - ctypedef CUfilter_mode_enum CUfilter_mode +cdef extern from 'cuda.h': + ctypedef enum CUstreamAtomicReductionOpType_enum: + CU_STREAM_ATOMIC_REDUCTION_OP_OR + CU_STREAM_ATOMIC_REDUCTION_OP_AND + CU_STREAM_ATOMIC_REDUCTION_OP_ADD + ctypedef CUstreamAtomicReductionOpType_enum CUstreamAtomicReductionOpType - cdef enum CUdevice_attribute_enum: - CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 1 - CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X = 2 - CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y = 3 - CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z = 4 - CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X = 5 - CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y = 6 - CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z = 7 - CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK = 8 - CU_DEVICE_ATTRIBUTE_SHARED_MEMORY_PER_BLOCK = 8 - CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY = 9 - CU_DEVICE_ATTRIBUTE_WARP_SIZE = 10 - CU_DEVICE_ATTRIBUTE_MAX_PITCH = 11 - CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK = 12 - CU_DEVICE_ATTRIBUTE_REGISTERS_PER_BLOCK = 12 - CU_DEVICE_ATTRIBUTE_CLOCK_RATE = 13 - CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT = 14 - CU_DEVICE_ATTRIBUTE_GPU_OVERLAP = 15 - CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT = 16 - CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT = 17 - CU_DEVICE_ATTRIBUTE_INTEGRATED = 18 - CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY = 19 - CU_DEVICE_ATTRIBUTE_COMPUTE_MODE = 20 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH = 21 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH = 22 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT = 23 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH = 24 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT = 25 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH = 26 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH = 27 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_WIDTH = 27 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT = 28 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_HEIGHT = 28 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS = 29 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES = 29 - CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT = 30 - CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS = 31 - CU_DEVICE_ATTRIBUTE_ECC_ENABLED = 32 - CU_DEVICE_ATTRIBUTE_PCI_BUS_ID = 33 - CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID = 34 - CU_DEVICE_ATTRIBUTE_TCC_DRIVER = 35 - CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE = 36 - CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH = 37 - CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE = 38 - CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR = 39 - CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT = 40 - CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING = 41 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH = 42 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS = 43 - CU_DEVICE_ATTRIBUTE_CAN_TEX2D_GATHER = 44 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH = 45 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT = 46 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE = 47 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE = 48 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE = 49 - CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID = 50 - CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT = 51 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH = 52 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH = 53 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS = 54 - CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH = 55 - CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH = 56 - CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT = 57 - CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH = 58 - CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT = 59 - CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH = 60 - CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH = 61 - CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS = 62 - CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH = 63 - CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT = 64 - CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS = 65 - CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH = 66 - CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH = 67 - CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS = 68 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH = 69 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH = 70 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT = 71 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH = 72 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH = 73 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT = 74 - CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR = 75 - CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR = 76 - CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH = 77 - CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED = 78 - CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED = 79 - CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED = 80 - CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR = 81 - CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR = 82 - CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY = 83 - CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD = 84 - CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID = 85 - CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED = 86 - CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO = 87 - CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS = 88 - CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS = 89 - CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED = 90 - CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM = 91 - CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_MEM_OPS_V1 = 92 - CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS_V1 = 93 - CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR_V1 = 94 - CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH = 95 - CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH = 96 - CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN = 97 - CU_DEVICE_ATTRIBUTE_CAN_FLUSH_REMOTE_WRITES = 98 - CU_DEVICE_ATTRIBUTE_HOST_REGISTER_SUPPORTED = 99 - CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES = 100 - CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST = 101 - CU_DEVICE_ATTRIBUTE_VIRTUAL_ADDRESS_MANAGEMENT_SUPPORTED = 102 - CU_DEVICE_ATTRIBUTE_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED = 102 - CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR_SUPPORTED = 103 - CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_HANDLE_SUPPORTED = 104 - CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_KMT_HANDLE_SUPPORTED = 105 - CU_DEVICE_ATTRIBUTE_MAX_BLOCKS_PER_MULTIPROCESSOR = 106 - CU_DEVICE_ATTRIBUTE_GENERIC_COMPRESSION_SUPPORTED = 107 - CU_DEVICE_ATTRIBUTE_MAX_PERSISTING_L2_CACHE_SIZE = 108 - CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE = 109 - CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_CUDA_VMM_SUPPORTED = 110 - CU_DEVICE_ATTRIBUTE_RESERVED_SHARED_MEMORY_PER_BLOCK = 111 - CU_DEVICE_ATTRIBUTE_SPARSE_CUDA_ARRAY_SUPPORTED = 112 - CU_DEVICE_ATTRIBUTE_READ_ONLY_HOST_REGISTER_SUPPORTED = 113 - CU_DEVICE_ATTRIBUTE_TIMELINE_SEMAPHORE_INTEROP_SUPPORTED = 114 - CU_DEVICE_ATTRIBUTE_MEMORY_POOLS_SUPPORTED = 115 - CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_SUPPORTED = 116 - CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_FLUSH_WRITES_OPTIONS = 117 - CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WRITES_ORDERING = 118 - CU_DEVICE_ATTRIBUTE_MEMPOOL_SUPPORTED_HANDLE_TYPES = 119 - CU_DEVICE_ATTRIBUTE_CLUSTER_LAUNCH = 120 - CU_DEVICE_ATTRIBUTE_DEFERRED_MAPPING_CUDA_ARRAY_SUPPORTED = 121 - CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS = 122 - CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR = 123 - CU_DEVICE_ATTRIBUTE_DMA_BUF_SUPPORTED = 124 - CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED = 125 - CU_DEVICE_ATTRIBUTE_MEM_SYNC_DOMAIN_COUNT = 126 - CU_DEVICE_ATTRIBUTE_TENSOR_MAP_ACCESS_SUPPORTED = 127 - CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_FABRIC_SUPPORTED = 128 - CU_DEVICE_ATTRIBUTE_UNIFIED_FUNCTION_POINTERS = 129 - CU_DEVICE_ATTRIBUTE_NUMA_CONFIG = 130 - CU_DEVICE_ATTRIBUTE_NUMA_ID = 131 - CU_DEVICE_ATTRIBUTE_MULTICAST_SUPPORTED = 132 - CU_DEVICE_ATTRIBUTE_MPS_ENABLED = 133 - CU_DEVICE_ATTRIBUTE_HOST_NUMA_ID = 134 - CU_DEVICE_ATTRIBUTE_D3D12_CIG_SUPPORTED = 135 - CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_ALGORITHM_MASK = 136 - CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_MAXIMUM_LENGTH = 137 - CU_DEVICE_ATTRIBUTE_VULKAN_CIG_SUPPORTED = 138 - CU_DEVICE_ATTRIBUTE_GPU_PCI_DEVICE_ID = 139 - CU_DEVICE_ATTRIBUTE_GPU_PCI_SUBSYSTEM_ID = 140 - 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_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_ATOMIC_REDUCTION_SUPPORTED = 148 - CU_DEVICE_ATTRIBUTE_MAX = 149 +cdef extern from 'cuda.h': + ctypedef enum CUstreamAtomicReductionDataType_enum: + CU_STREAM_ATOMIC_REDUCTION_UNSIGNED_32 + CU_STREAM_ATOMIC_REDUCTION_UNSIGNED_64 + ctypedef CUstreamAtomicReductionDataType_enum CUstreamAtomicReductionDataType - ctypedef CUdevice_attribute_enum CUdevice_attribute +cdef extern from 'cuda.h': + ctypedef enum CUdevSmResourceGroup_flags: + CU_DEV_SM_RESOURCE_GROUP_DEFAULT + CU_DEV_SM_RESOURCE_GROUP_BACKFILL - cdef struct CUdevprop_st: - int maxThreadsPerBlock - int maxThreadsDim[3] - int maxGridSize[3] - int sharedMemPerBlock - int totalConstantMemory - int SIMDWidth - int memPitch - int regsPerBlock - int clockRate - int textureAlign +cdef extern from 'cuda.h': + ctypedef enum CUdevSmResourceSplitByCount_flags: + CU_DEV_SM_RESOURCE_SPLIT_IGNORE_SM_COSCHEDULING + CU_DEV_SM_RESOURCE_SPLIT_MAX_POTENTIAL_CLUSTER_SIZE - ctypedef CUdevprop_st CUdevprop_v1 +cdef extern from 'cuda.h': + ctypedef enum CUdevWorkqueueConfigScope: + CU_WORKQUEUE_SCOPE_DEVICE_CTX + CU_WORKQUEUE_SCOPE_GREEN_CTX_BALANCED - ctypedef CUdevprop_v1 CUdevprop - - cdef enum CUpointer_attribute_enum: - CU_POINTER_ATTRIBUTE_CONTEXT = 1 - CU_POINTER_ATTRIBUTE_MEMORY_TYPE = 2 - CU_POINTER_ATTRIBUTE_DEVICE_POINTER = 3 - CU_POINTER_ATTRIBUTE_HOST_POINTER = 4 - CU_POINTER_ATTRIBUTE_P2P_TOKENS = 5 - CU_POINTER_ATTRIBUTE_SYNC_MEMOPS = 6 - CU_POINTER_ATTRIBUTE_BUFFER_ID = 7 - CU_POINTER_ATTRIBUTE_IS_MANAGED = 8 - CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL = 9 - CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE = 10 - CU_POINTER_ATTRIBUTE_RANGE_START_ADDR = 11 - CU_POINTER_ATTRIBUTE_RANGE_SIZE = 12 - CU_POINTER_ATTRIBUTE_MAPPED = 13 - CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES = 14 - CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE = 15 - CU_POINTER_ATTRIBUTE_ACCESS_FLAGS = 16 - CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE = 17 - CU_POINTER_ATTRIBUTE_MAPPING_SIZE = 18 - CU_POINTER_ATTRIBUTE_MAPPING_BASE_ADDR = 19 - CU_POINTER_ATTRIBUTE_MEMORY_BLOCK_ID = 20 - CU_POINTER_ATTRIBUTE_IS_HW_DECOMPRESS_CAPABLE = 21 +cdef extern from 'cuda.h': + ctypedef enum CUhostTaskSyncMode_enum: + CU_HOST_TASK_BLOCKING + CU_HOST_TASK_SPINWAIT + ctypedef CUhostTaskSyncMode_enum CUhostTaskSyncMode - ctypedef CUpointer_attribute_enum CUpointer_attribute +cdef extern from 'cuda.h': + ctypedef enum CUlaunchAttributePortableClusterMode_enum: + CU_LAUNCH_PORTABLE_CLUSTER_MODE_DEFAULT + CU_LAUNCH_PORTABLE_CLUSTER_MODE_REQUIRE_PORTABLE + CU_LAUNCH_PORTABLE_CLUSTER_MODE_ALLOW_NON_PORTABLE + ctypedef CUlaunchAttributePortableClusterMode_enum CUlaunchAttributePortableClusterMode - cdef enum CUfunction_attribute_enum: - CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 0 - CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES = 1 - CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES = 2 - CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES = 3 - CU_FUNC_ATTRIBUTE_NUM_REGS = 4 - CU_FUNC_ATTRIBUTE_PTX_VERSION = 5 - CU_FUNC_ATTRIBUTE_BINARY_VERSION = 6 - CU_FUNC_ATTRIBUTE_CACHE_MODE_CA = 7 - CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES = 8 - CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT = 9 - CU_FUNC_ATTRIBUTE_CLUSTER_SIZE_MUST_BE_SET = 10 - CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH = 11 - CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT = 12 - CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH = 13 - CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED = 14 - CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE = 15 - CU_FUNC_ATTRIBUTE_MAX = 16 +cdef extern from 'cuda.h': + ctypedef enum CUsharedMemoryMode_enum: + CU_SHARED_MEMORY_MODE_DEFAULT + CU_SHARED_MEMORY_MODE_REQUIRE_PORTABLE + CU_SHARED_MEMORY_MODE_ALLOW_NON_PORTABLE + ctypedef CUsharedMemoryMode_enum CUsharedMemoryMode - ctypedef CUfunction_attribute_enum CUfunction_attribute +cdef extern from 'cuda.h': + ctypedef enum CUstreamCigDataType_enum: + STREAM_CIG_DATA_TYPE_D3D12_COMMAND_LIST + ctypedef CUstreamCigDataType_enum CUstreamCigDataType - cdef enum CUfunc_cache_enum: - CU_FUNC_CACHE_PREFER_NONE = 0 - CU_FUNC_CACHE_PREFER_SHARED = 1 - CU_FUNC_CACHE_PREFER_L1 = 2 - CU_FUNC_CACHE_PREFER_EQUAL = 3 +cdef extern from 'cuda.h': + ctypedef enum CUlogicalEndpointIpcHandleType_enum: + CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_NONE + CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_FABRIC + ctypedef CUlogicalEndpointIpcHandleType_enum CUlogicalEndpointIpcHandleType - ctypedef CUfunc_cache_enum CUfunc_cache +cdef extern from 'cuda.h': + ctypedef enum CUlogicalEndpointType_enum: + CU_LOGICAL_ENDPOINT_TYPE_INVALID + CU_LOGICAL_ENDPOINT_TYPE_UNICAST + CU_LOGICAL_ENDPOINT_TYPE_MULTICAST + ctypedef CUlogicalEndpointType_enum CUlogicalEndpointType - cdef enum CUsharedconfig_enum: - CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE = 0 - CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE = 1 - CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE = 2 +cdef extern from 'cuda.h': + ctypedef enum CUlogicalEndpointFlag_enum: + CU_LOGICAL_ENDPOINT_FLAG_NONE + CU_LOGICAL_ENDPOINT_FLAG_COUNTED_OPS + ctypedef CUlogicalEndpointFlag_enum CUlogicalEndpointFlag - ctypedef CUsharedconfig_enum CUsharedconfig +cdef extern from 'cuda.h': + ctypedef enum CUgraphRecaptureStatus_enum: + CU_GRAPH_RECAPTURE_ELIGIBLE_FOR_UPDATE + CU_GRAPH_RECAPTURE_INELIGIBLE_FOR_UPDATE + CU_GRAPH_RECAPTURE_ERROR + ctypedef CUgraphRecaptureStatus_enum CUgraphRecaptureStatus +cdef enum: _CURESULT_INTERNAL_LOADING_ERROR = CUresult.CUDA_ERROR_NOT_FOUND +cdef enum: CUDA_VERSION = 13030 - cdef enum CUshared_carveout_enum: - CU_SHAREDMEM_CARVEOUT_DEFAULT = -1 - CU_SHAREDMEM_CARVEOUT_MAX_L1 = 0 - CU_SHAREDMEM_CARVEOUT_MAX_SHARED = 100 - ctypedef CUshared_carveout_enum CUshared_carveout +# TYPES +cdef extern from 'cuda.h': + ctypedef uint32_t cuuint32_t 'cuuint32_t' - cdef enum CUmemorytype_enum: - CU_MEMORYTYPE_HOST = 1 - CU_MEMORYTYPE_DEVICE = 2 - CU_MEMORYTYPE_ARRAY = 3 - CU_MEMORYTYPE_UNIFIED = 4 - ctypedef CUmemorytype_enum CUmemorytype +cdef extern from 'cuda.h': + ctypedef uint64_t cuuint64_t 'cuuint64_t' - cdef enum CUcomputemode_enum: - CU_COMPUTEMODE_DEFAULT = 0 - CU_COMPUTEMODE_PROHIBITED = 2 - CU_COMPUTEMODE_EXCLUSIVE_PROCESS = 3 - ctypedef CUcomputemode_enum CUcomputemode +cdef extern from 'cuda.h': + ctypedef unsigned long long CUdeviceptr_v2 'CUdeviceptr_v2' - cdef enum CUmem_advise_enum: - CU_MEM_ADVISE_SET_READ_MOSTLY = 1 - CU_MEM_ADVISE_UNSET_READ_MOSTLY = 2 - CU_MEM_ADVISE_SET_PREFERRED_LOCATION = 3 - CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION = 4 - CU_MEM_ADVISE_SET_ACCESSED_BY = 5 - CU_MEM_ADVISE_UNSET_ACCESSED_BY = 6 - ctypedef CUmem_advise_enum CUmem_advise +cdef extern from 'cuda.h': + ctypedef int CUdevice_v1 'CUdevice_v1' - cdef enum CUmem_range_attribute_enum: - CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY = 1 - CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION = 2 - CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY = 3 - CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION = 4 - CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_TYPE = 5 - CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_ID = 6 - CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_TYPE = 7 - CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_ID = 8 - ctypedef CUmem_range_attribute_enum CUmem_range_attribute +cdef extern from 'cuda.h': + ctypedef unsigned long long CUtexObject_v1 'CUtexObject_v1' - cdef enum CUjit_option_enum: - CU_JIT_MAX_REGISTERS = 0 - CU_JIT_THREADS_PER_BLOCK = 1 - CU_JIT_WALL_TIME = 2 - CU_JIT_INFO_LOG_BUFFER = 3 - CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES = 4 - CU_JIT_ERROR_LOG_BUFFER = 5 - CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES = 6 - CU_JIT_OPTIMIZATION_LEVEL = 7 - CU_JIT_TARGET_FROM_CUCONTEXT = 8 - CU_JIT_TARGET = 9 - CU_JIT_FALLBACK_STRATEGY = 10 - CU_JIT_GENERATE_DEBUG_INFO = 11 - CU_JIT_LOG_VERBOSE = 12 - CU_JIT_GENERATE_LINE_INFO = 13 - CU_JIT_CACHE_MODE = 14 - CU_JIT_NEW_SM3X_OPT = 15 - CU_JIT_FAST_COMPILE = 16 - CU_JIT_GLOBAL_SYMBOL_NAMES = 17 - CU_JIT_GLOBAL_SYMBOL_ADDRESSES = 18 - CU_JIT_GLOBAL_SYMBOL_COUNT = 19 - CU_JIT_LTO = 20 - CU_JIT_FTZ = 21 - CU_JIT_PREC_DIV = 22 - CU_JIT_PREC_SQRT = 23 - CU_JIT_FMA = 24 - CU_JIT_REFERENCED_KERNEL_NAMES = 25 - CU_JIT_REFERENCED_KERNEL_COUNT = 26 - CU_JIT_REFERENCED_VARIABLE_NAMES = 27 - CU_JIT_REFERENCED_VARIABLE_COUNT = 28 - CU_JIT_OPTIMIZE_UNUSED_DEVICE_VARIABLES = 29 - CU_JIT_POSITION_INDEPENDENT_CODE = 30 - CU_JIT_MIN_CTA_PER_SM = 31 - CU_JIT_MAX_THREADS_PER_BLOCK = 32 - CU_JIT_OVERRIDE_DIRECTIVE_VALUES = 33 - CU_JIT_SPLIT_COMPILE = 34 - CU_JIT_BINARY_LOADER_THREAD_COUNT = 35 - CU_JIT_NUM_OPTIONS = 36 - ctypedef CUjit_option_enum CUjit_option +cdef extern from 'cuda.h': + ctypedef unsigned long long CUsurfObject_v1 'CUsurfObject_v1' - cdef enum CUjit_target_enum: - CU_TARGET_COMPUTE_30 = 30 - CU_TARGET_COMPUTE_32 = 32 - CU_TARGET_COMPUTE_35 = 35 - CU_TARGET_COMPUTE_37 = 37 - CU_TARGET_COMPUTE_50 = 50 - CU_TARGET_COMPUTE_52 = 52 - CU_TARGET_COMPUTE_53 = 53 - CU_TARGET_COMPUTE_60 = 60 - CU_TARGET_COMPUTE_61 = 61 - CU_TARGET_COMPUTE_62 = 62 - CU_TARGET_COMPUTE_70 = 70 - CU_TARGET_COMPUTE_72 = 72 - CU_TARGET_COMPUTE_75 = 75 - CU_TARGET_COMPUTE_80 = 80 - CU_TARGET_COMPUTE_86 = 86 - CU_TARGET_COMPUTE_87 = 87 - CU_TARGET_COMPUTE_89 = 89 - CU_TARGET_COMPUTE_90 = 90 - CU_TARGET_COMPUTE_100 = 100 - 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_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_103F = 131175 - CU_TARGET_COMPUTE_110F = 131182 - CU_TARGET_COMPUTE_120F = 131192 - CU_TARGET_COMPUTE_121F = 131193 - ctypedef CUjit_target_enum CUjit_target +cdef extern from 'cuda.h': + cdef struct CUmemFabricHandle_st: + unsigned char data[64] + ctypedef CUmemFabricHandle_st CUmemFabricHandle_v1 + +cdef extern from 'cuda.h': + cdef struct CUipcEventHandle_st: + char reserved[64] + ctypedef CUipcEventHandle_st CUipcEventHandle_v1 + +cdef extern from 'cuda.h': + cdef struct CUipcMemHandle_st: + char reserved[64] + ctypedef CUipcMemHandle_st CUipcMemHandle_v1 + +cdef extern from 'cuda.h': + cdef struct CUdevprop_st: + int maxThreadsPerBlock + int maxThreadsDim[3] + int maxGridSize[3] + int sharedMemPerBlock + int totalConstantMemory + int SIMDWidth + int memPitch + int regsPerBlock + int clockRate + int textureAlign + ctypedef CUdevprop_st CUdevprop_v1 + +cdef extern from 'cuda.h': + cdef struct CUaccessPolicyWindow_st: + void* base_ptr + size_t num_bytes + float hitRatio + CUaccessProperty hitProp + CUaccessProperty missProp + ctypedef CUaccessPolicyWindow_st CUaccessPolicyWindow_v1 + +cdef extern from 'cuda.h': + ctypedef CUlaunchAttributeID CUkernelNodeAttrID 'CUkernelNodeAttrID' + + +cdef extern from 'cuda.h': + ctypedef CUlaunchAttributeID CUstreamAttrID 'CUstreamAttrID' + + +cdef extern from 'cuda.h': + cdef struct CUexecAffinitySmCount_st: + unsigned int val + ctypedef CUexecAffinitySmCount_st CUexecAffinitySmCount_v1 + +cdef extern from 'cuda.h': + cdef struct CUDA_ARRAY_DESCRIPTOR_st: + size_t Width + size_t Height + CUarray_format Format + unsigned int NumChannels + ctypedef CUDA_ARRAY_DESCRIPTOR_st CUDA_ARRAY_DESCRIPTOR_v2 + +cdef extern from 'cuda.h': + cdef struct CUDA_ARRAY3D_DESCRIPTOR_st: + size_t Width + size_t Height + size_t Depth + CUarray_format Format + unsigned int NumChannels + unsigned int Flags + ctypedef CUDA_ARRAY3D_DESCRIPTOR_st CUDA_ARRAY3D_DESCRIPTOR_v2 + +cdef extern from 'cuda.h': + cdef struct CUDA_ARRAY_MEMORY_REQUIREMENTS_st: + size_t size + size_t alignment + unsigned int reserved[4] + ctypedef CUDA_ARRAY_MEMORY_REQUIREMENTS_st CUDA_ARRAY_MEMORY_REQUIREMENTS_v1 + +cdef extern from 'cuda.h': + cdef struct CUDA_TEXTURE_DESC_st: + CUaddress_mode addressMode[3] + CUfilter_mode filterMode + unsigned int flags + unsigned int maxAnisotropy + CUfilter_mode mipmapFilterMode + float mipmapLevelBias + float minMipmapLevelClamp + float maxMipmapLevelClamp + float borderColor[4] + int reserved[12] + ctypedef CUDA_TEXTURE_DESC_st CUDA_TEXTURE_DESC_v1 + +cdef extern from 'cuda.h': + cdef struct CUDA_RESOURCE_VIEW_DESC_st: + CUresourceViewFormat format + size_t width + size_t height + size_t depth + unsigned int firstMipmapLevel + unsigned int lastMipmapLevel + unsigned int firstLayer + unsigned int lastLayer + unsigned int reserved[16] + ctypedef CUDA_RESOURCE_VIEW_DESC_st CUDA_RESOURCE_VIEW_DESC_v1 + +cdef extern from 'cuda.h': + cdef struct CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st: + unsigned long long p2pToken + unsigned int vaSpaceToken + ctypedef CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1 + +cdef extern from 'cuda.h': + cdef struct CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st: + unsigned long long offset + unsigned long long size + unsigned int flags + unsigned int reserved[16] + ctypedef CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1 + +cdef extern from 'cuda.h': + ctypedef unsigned long long CUmemGenericAllocationHandle_v1 'CUmemGenericAllocationHandle_v1' + + +cdef extern from 'cuda.h': + cdef struct CUmulticastObjectProp_st: + unsigned int numDevices + size_t size + unsigned long long handleTypes + unsigned long long flags + ctypedef CUmulticastObjectProp_st CUmulticastObjectProp_v1 + +cdef extern from 'cuda.h': + cdef struct CUmemPoolPtrExportData_st: + unsigned char reserved[64] + ctypedef CUmemPoolPtrExportData_st CUmemPoolPtrExportData_v1 + +cdef extern from 'cuda.h': + cdef struct CUoffset3D_st: + size_t x + size_t y + size_t z + ctypedef CUoffset3D_st CUoffset3D_v1 + +cdef extern from 'cuda.h': + cdef struct CUextent3D_st: + size_t width + size_t height + size_t depth + ctypedef CUextent3D_st CUextent3D_v1 + +cdef extern from 'cuda.h': + ctypedef unsigned int CUlogIterator 'CUlogIterator' + + +cdef extern from 'cuda.h': + ctypedef struct CUctx_st: + pass + ctypedef CUctx_st* CUcontext 'CUcontext' + + +cdef extern from 'cuda.h': + ctypedef struct CUmod_st: + pass + ctypedef CUmod_st* CUmodule 'CUmodule' + + +cdef extern from 'cuda.h': + ctypedef struct CUfunc_st: + pass + ctypedef CUfunc_st* CUfunction 'CUfunction' + + +cdef extern from 'cuda.h': + ctypedef struct CUlib_st: + pass + ctypedef CUlib_st* CUlibrary 'CUlibrary' + + +cdef extern from 'cuda.h': + ctypedef struct CUkern_st: + pass + ctypedef CUkern_st* CUkernel 'CUkernel' + + +cdef extern from 'cuda.h': + ctypedef struct CUarray_st: + pass + ctypedef CUarray_st* CUarray 'CUarray' + + +cdef extern from 'cuda.h': + ctypedef struct CUmipmappedArray_st: + pass + ctypedef CUmipmappedArray_st* CUmipmappedArray 'CUmipmappedArray' + + +cdef extern from 'cuda.h': + ctypedef struct CUtexref_st: + pass + ctypedef CUtexref_st* CUtexref 'CUtexref' + + +cdef extern from 'cuda.h': + ctypedef struct CUsurfref_st: + pass + ctypedef CUsurfref_st* CUsurfref 'CUsurfref' + + +cdef extern from 'cuda.h': + ctypedef struct CUevent_st: + pass + ctypedef CUevent_st* CUevent 'CUevent' + + +cdef extern from 'cuda.h': + ctypedef struct CUstream_st: + pass + ctypedef CUstream_st* CUstream 'CUstream' + + +cdef extern from 'cuda.h': + ctypedef struct CUgraphicsResource_st: + pass + ctypedef CUgraphicsResource_st* CUgraphicsResource 'CUgraphicsResource' + + +cdef extern from 'cuda.h': + ctypedef struct CUextMemory_st: + pass + ctypedef CUextMemory_st* CUexternalMemory 'CUexternalMemory' + + +cdef extern from 'cuda.h': + ctypedef struct CUextSemaphore_st: + pass + ctypedef CUextSemaphore_st* CUexternalSemaphore 'CUexternalSemaphore' + + +cdef extern from 'cuda.h': + ctypedef struct CUgraph_st: + pass + ctypedef CUgraph_st* CUgraph 'CUgraph' + + +cdef extern from 'cuda.h': + ctypedef struct CUgraphNode_st: + pass + ctypedef CUgraphNode_st* CUgraphNode 'CUgraphNode' + + +cdef extern from 'cuda.h': + ctypedef struct CUgraphExec_st: + pass + ctypedef CUgraphExec_st* CUgraphExec 'CUgraphExec' + + +cdef extern from 'cuda.h': + ctypedef struct CUmemPoolHandle_st: + pass + ctypedef CUmemPoolHandle_st* CUmemoryPool 'CUmemoryPool' + + +cdef extern from 'cuda.h': + ctypedef struct CUuserObject_st: + pass + ctypedef CUuserObject_st* CUuserObject 'CUuserObject' + + +cdef extern from 'cuda.h': + ctypedef struct CUgraphDeviceUpdatableNode_st: + pass + ctypedef CUgraphDeviceUpdatableNode_st* CUgraphDeviceNode 'CUgraphDeviceNode' + + +cdef extern from 'cuda.h': + ctypedef struct CUasyncCallbackEntry_st: + pass + ctypedef CUasyncCallbackEntry_st* CUasyncCallbackHandle 'CUasyncCallbackHandle' + + +cdef extern from 'cuda.h': + ctypedef struct CUgreenCtx_st: + pass + ctypedef CUgreenCtx_st* CUgreenCtx 'CUgreenCtx' + + +cdef extern from 'cuda.h': + ctypedef struct CUlinkState_st: + pass + ctypedef CUlinkState_st* CUlinkState 'CUlinkState' + + +cdef extern from 'cuda.h': + ctypedef struct CUdevResourceDesc_st: + pass + ctypedef CUdevResourceDesc_st* CUdevResourceDesc 'CUdevResourceDesc' + + +cdef extern from 'cuda.h': + ctypedef struct CUlogsCallbackEntry_st: + pass + ctypedef CUlogsCallbackEntry_st* CUlogsCallbackHandle 'CUlogsCallbackHandle' + + +cdef extern from 'cuda.h': + ctypedef struct CUcoredumpCallbackEntry_st: + pass + ctypedef CUcoredumpCallbackEntry_st* CUcoredumpCallbackHandle 'CUcoredumpCallbackHandle' + + +cdef extern from 'cuda.h': + cdef struct CUuuid_st: + char bytes[16] + ctypedef CUuuid_st CUuuid + +cdef extern from 'cuda.h': + ctypedef struct CUstreamMemOpFlushRemoteWritesParams_st 'CUstreamMemOpFlushRemoteWritesParams_st': + CUstreamBatchMemOpType operation + unsigned int flags + +cdef extern from 'cuda.h': + ctypedef struct CUstreamMemOpMemoryBarrierParams_st 'CUstreamMemOpMemoryBarrierParams_st': + CUstreamBatchMemOpType operation + unsigned int flags + +cdef struct cuda_bindings_driver__anon_pod3: + unsigned long long bytesOverBudget + +cdef extern from 'cuda.h': + ctypedef void (*CUhostFn 'CUhostFn')( + void* userData + ) + + +cdef extern from 'cuda.h': + cdef struct CUgraphEdgeData_st: + unsigned char from_port + unsigned char to_port + unsigned char type + unsigned char reserved[5] + ctypedef CUgraphEdgeData_st CUgraphEdgeData + +cdef extern from 'cuda.h': + cdef struct CUlaunchMemSyncDomainMap_st: + unsigned char default_ + unsigned char remote + ctypedef CUlaunchMemSyncDomainMap_st CUlaunchMemSyncDomainMap + +cdef struct cuda_bindings_driver__anon_pod4: + unsigned int x + unsigned int y + unsigned int z + +cdef struct cuda_bindings_driver__anon_pod7: + unsigned int x + unsigned int y + unsigned int z + +cdef extern from 'cuda.h': + cdef struct CUctxCigParam_st: + CUcigDataType sharedDataType + void* sharedData + ctypedef CUctxCigParam_st CUctxCigParam + +cdef extern from 'cuda.h': + cdef struct CUlibraryHostUniversalFunctionAndDataTable_st: + void* functionTable + size_t functionWindowSize + void* dataTable + size_t dataWindowSize + ctypedef CUlibraryHostUniversalFunctionAndDataTable_st CUlibraryHostUniversalFunctionAndDataTable + +cdef struct cuda_bindings_driver__anon_pod10: + unsigned int width + unsigned int height + unsigned int depth + +cdef struct cuda_bindings_driver__anon_pod16: + int reserved[32] + +cdef struct cuda_bindings_driver__anon_pod18: + void* handle + void* name + +cdef struct cuda_bindings_driver__anon_pod20: + void* handle + void* name + +cdef struct cuda_bindings_driver__anon_pod22: + unsigned long long value + +cdef union cuda_bindings_driver__anon_pod23: + void* fence + unsigned long long reserved + +cdef struct cuda_bindings_driver__anon_pod24: + unsigned long long key + +cdef struct cuda_bindings_driver__anon_pod26: + unsigned long long value + +cdef union cuda_bindings_driver__anon_pod27: + void* fence + unsigned long long reserved + +cdef struct cuda_bindings_driver__anon_pod28: + unsigned long long key + unsigned int timeoutMs + +cdef struct cuda_bindings_driver__anon_pod31: + unsigned int level + unsigned int layer + unsigned int offsetX + unsigned int offsetY + unsigned int offsetZ + unsigned int extentWidth + unsigned int extentHeight + unsigned int extentDepth + +cdef struct cuda_bindings_driver__anon_pod32: + unsigned int layer + unsigned long long offset + unsigned long long size + +cdef struct cuda_bindings_driver__anon_pod35: + unsigned char compressionType + unsigned char gpuDirectRDMACapable + unsigned short usage + unsigned char reserved[4] + +cdef extern from 'cuda.h': + cdef struct CUdevSmResource_st: + unsigned int smCount + unsigned int minSmPartitionSize + unsigned int smCoscheduledAlignment + unsigned int flags + ctypedef CUdevSmResource_st CUdevSmResource + +cdef extern from 'cuda.h': + cdef struct CUdevWorkqueueResource_st: + unsigned char reserved[40] + ctypedef CUdevWorkqueueResource_st CUdevWorkqueueResource + +cdef extern from 'cuda.h': + cdef struct CU_DEV_SM_RESOURCE_GROUP_PARAMS_st: + unsigned int smCount + unsigned int coscheduledSmCount + unsigned int preferredCoscheduledSmCount + unsigned int flags + unsigned int reserved[12] + ctypedef CU_DEV_SM_RESOURCE_GROUP_PARAMS_st CU_DEV_SM_RESOURCE_GROUP_PARAMS + +cdef extern from 'cuda.h': + cdef struct CUstreamCigParam_st: + CUstreamCigDataType streamSharedDataType + void* streamSharedData + ctypedef CUstreamCigParam_st CUstreamCigParam + +cdef extern from 'cuda.h': + cdef struct CUlogicalEndpointFabricHandle_st: + unsigned char data[64] + ctypedef CUlogicalEndpointFabricHandle_st CUlogicalEndpointFabricHandle + +cdef struct cuda_bindings_driver__anon_pod43: + unsigned int numDevices + +cdef extern from 'cuda.h': + ctypedef size_t (*CUoccupancyB2DSize 'CUoccupancyB2DSize')( + int blockSize + ) + + +cdef extern from 'cuda.h': + ctypedef void (*CUlogsCallback 'CUlogsCallback')( + void* data, + CUlogLevel logLevel, + char* message, + size_t length + ) + + +cdef extern from 'cuda.h': + ctypedef cuuint32_t CUlogicalEndpointId 'CUlogicalEndpointId' + + +cdef extern from 'cuda.h': + cdef struct CUmemDecompressParams_st: + size_t srcNumBytes + size_t dstNumBytes + cuuint32_t* dstActBytes + void* src + void* dst + CUmemDecompressAlgorithm algo + unsigned char padding[20] + ctypedef CUmemDecompressParams_st CUmemDecompressParams + +cdef extern from 'cuda.h': + ctypedef cuuint64_t CUgraphConditionalHandle 'CUgraphConditionalHandle' + + +cdef extern from 'cuda.h': + cdef struct CUtensorMap_st: + cuuint64_t opaque[16] + ctypedef CUtensorMap_st CUtensorMap + +cdef extern from 'cuda.h': + cdef struct CUcheckpointLockArgs_st: + unsigned int timeoutMs + unsigned int reserved0 + cuuint64_t reserved1[7] + ctypedef CUcheckpointLockArgs_st CUcheckpointLockArgs + +cdef extern from 'cuda.h': + cdef struct CUcheckpointCheckpointArgs_st: + cuuint64_t reserved[8] + ctypedef CUcheckpointCheckpointArgs_st CUcheckpointCheckpointArgs + +cdef extern from 'cuda.h': + cdef struct CUcheckpointUnlockArgs_st: + cuuint64_t reserved[8] + ctypedef CUcheckpointUnlockArgs_st CUcheckpointUnlockArgs + +cdef extern from 'cuda.h': + ctypedef CUdeviceptr_v2 CUdeviceptr 'CUdeviceptr' + + +cdef extern from 'cuda.h': + ctypedef CUdevice_v1 CUdevice 'CUdevice' + + +cdef extern from 'cuda.h': + ctypedef CUtexObject_v1 CUtexObject 'CUtexObject' + + +cdef extern from 'cuda.h': + ctypedef CUsurfObject_v1 CUsurfObject 'CUsurfObject' + + +cdef extern from 'cuda.h': + ctypedef CUmemFabricHandle_v1 CUmemFabricHandle 'CUmemFabricHandle' + + +cdef extern from 'cuda.h': + ctypedef CUipcEventHandle_v1 CUipcEventHandle 'CUipcEventHandle' + + +cdef extern from 'cuda.h': + ctypedef CUipcMemHandle_v1 CUipcMemHandle 'CUipcMemHandle' + + +cdef extern from 'cuda.h': + ctypedef CUdevprop_v1 CUdevprop 'CUdevprop' + + +cdef extern from 'cuda.h': + ctypedef CUaccessPolicyWindow_v1 CUaccessPolicyWindow 'CUaccessPolicyWindow' - cdef enum CUjit_fallback_enum: - CU_PREFER_PTX = 0 - CU_PREFER_BINARY = 1 - ctypedef CUjit_fallback_enum CUjit_fallback +cdef extern from 'cuda.h': + ctypedef CUexecAffinitySmCount_v1 CUexecAffinitySmCount 'CUexecAffinitySmCount' - cdef enum CUjit_cacheMode_enum: - CU_JIT_CACHE_OPTION_NONE = 0 - CU_JIT_CACHE_OPTION_CG = 1 - CU_JIT_CACHE_OPTION_CA = 2 - ctypedef CUjit_cacheMode_enum CUjit_cacheMode +cdef extern from 'cuda.h': + ctypedef CUDA_ARRAY_DESCRIPTOR_v2 CUDA_ARRAY_DESCRIPTOR 'CUDA_ARRAY_DESCRIPTOR' - cdef enum CUjitInputType_enum: - CU_JIT_INPUT_CUBIN = 0 - CU_JIT_INPUT_PTX = 1 - CU_JIT_INPUT_FATBINARY = 2 - CU_JIT_INPUT_OBJECT = 3 - CU_JIT_INPUT_LIBRARY = 4 - CU_JIT_INPUT_NVVM = 5 - CU_JIT_NUM_INPUT_TYPES = 6 - ctypedef CUjitInputType_enum CUjitInputType +cdef extern from 'cuda.h': + ctypedef CUDA_ARRAY3D_DESCRIPTOR_v2 CUDA_ARRAY3D_DESCRIPTOR 'CUDA_ARRAY3D_DESCRIPTOR' - cdef struct CUlinkState_st: - pass - ctypedef CUlinkState_st* CUlinkState - cdef enum CUgraphicsRegisterFlags_enum: - CU_GRAPHICS_REGISTER_FLAGS_NONE = 0 - CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY = 1 - CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD = 2 - CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST = 4 - CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER = 8 +cdef extern from 'cuda.h': + ctypedef CUDA_ARRAY_MEMORY_REQUIREMENTS_v1 CUDA_ARRAY_MEMORY_REQUIREMENTS 'CUDA_ARRAY_MEMORY_REQUIREMENTS' - ctypedef CUgraphicsRegisterFlags_enum CUgraphicsRegisterFlags - cdef enum CUgraphicsMapResourceFlags_enum: - CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE = 0 - CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY = 1 - CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD = 2 +cdef extern from 'cuda.h': + ctypedef CUDA_TEXTURE_DESC_v1 CUDA_TEXTURE_DESC 'CUDA_TEXTURE_DESC' - ctypedef CUgraphicsMapResourceFlags_enum CUgraphicsMapResourceFlags - cdef enum CUarray_cubemap_face_enum: - CU_CUBEMAP_FACE_POSITIVE_X = 0 - CU_CUBEMAP_FACE_NEGATIVE_X = 1 - CU_CUBEMAP_FACE_POSITIVE_Y = 2 - CU_CUBEMAP_FACE_NEGATIVE_Y = 3 - CU_CUBEMAP_FACE_POSITIVE_Z = 4 - CU_CUBEMAP_FACE_NEGATIVE_Z = 5 +cdef extern from 'cuda.h': + ctypedef CUDA_RESOURCE_VIEW_DESC_v1 CUDA_RESOURCE_VIEW_DESC 'CUDA_RESOURCE_VIEW_DESC' - ctypedef CUarray_cubemap_face_enum CUarray_cubemap_face - cdef enum CUlimit_enum: - CU_LIMIT_STACK_SIZE = 0 - CU_LIMIT_PRINTF_FIFO_SIZE = 1 - CU_LIMIT_MALLOC_HEAP_SIZE = 2 - CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH = 3 - CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT = 4 - CU_LIMIT_MAX_L2_FETCH_GRANULARITY = 5 - CU_LIMIT_PERSISTING_L2_CACHE_SIZE = 6 - CU_LIMIT_SHMEM_SIZE = 7 - CU_LIMIT_CIG_ENABLED = 8 - CU_LIMIT_CIG_SHMEM_FALLBACK_ENABLED = 9 - CU_LIMIT_MAX = 10 +cdef extern from 'cuda.h': + ctypedef CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1 CUDA_POINTER_ATTRIBUTE_P2P_TOKENS 'CUDA_POINTER_ATTRIBUTE_P2P_TOKENS' - ctypedef CUlimit_enum CUlimit - cdef enum CUresourcetype_enum: - CU_RESOURCE_TYPE_ARRAY = 0 - CU_RESOURCE_TYPE_MIPMAPPED_ARRAY = 1 - CU_RESOURCE_TYPE_LINEAR = 2 - CU_RESOURCE_TYPE_PITCH2D = 3 +cdef extern from 'cuda.h': + ctypedef CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1 CUDA_EXTERNAL_MEMORY_BUFFER_DESC 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC' - ctypedef CUresourcetype_enum CUresourcetype - ctypedef void (*CUhostFn)(void* userData) +cdef extern from 'cuda.h': + ctypedef CUmemGenericAllocationHandle_v1 CUmemGenericAllocationHandle 'CUmemGenericAllocationHandle' - cdef enum CUaccessProperty_enum: - CU_ACCESS_PROPERTY_NORMAL = 0 - CU_ACCESS_PROPERTY_STREAMING = 1 - CU_ACCESS_PROPERTY_PERSISTING = 2 - ctypedef CUaccessProperty_enum CUaccessProperty +cdef extern from 'cuda.h': + ctypedef CUmulticastObjectProp_v1 CUmulticastObjectProp 'CUmulticastObjectProp' - cdef struct CUaccessPolicyWindow_st: - void* base_ptr - size_t num_bytes - float hitRatio - CUaccessProperty hitProp - CUaccessProperty missProp - ctypedef CUaccessPolicyWindow_st CUaccessPolicyWindow_v1 +cdef extern from 'cuda.h': + ctypedef CUmemPoolPtrExportData_v1 CUmemPoolPtrExportData 'CUmemPoolPtrExportData' + + +cdef extern from 'cuda.h': + ctypedef CUoffset3D_v1 CUoffset3D 'CUoffset3D' + - ctypedef CUaccessPolicyWindow_v1 CUaccessPolicyWindow +cdef extern from 'cuda.h': + ctypedef CUextent3D_v1 CUextent3D 'CUextent3D' + +cdef extern from 'cuda.h': cdef struct CUDA_KERNEL_NODE_PARAMS_st: CUfunction func unsigned int gridDimX @@ -947,9 +2244,9 @@ cdef extern from "cuda.h": unsigned int sharedMemBytes void** kernelParams void** extra - ctypedef CUDA_KERNEL_NODE_PARAMS_st CUDA_KERNEL_NODE_PARAMS_v1 +cdef extern from 'cuda.h': cdef struct CUDA_KERNEL_NODE_PARAMS_v2_st: CUfunction func unsigned int gridDimX @@ -963,11 +2260,9 @@ cdef extern from "cuda.h": void** extra CUkernel kern CUcontext ctx - ctypedef CUDA_KERNEL_NODE_PARAMS_v2_st CUDA_KERNEL_NODE_PARAMS_v2 - ctypedef CUDA_KERNEL_NODE_PARAMS_v2 CUDA_KERNEL_NODE_PARAMS - +cdef extern from 'cuda.h': cdef struct CUDA_KERNEL_NODE_PARAMS_v3_st: CUfunction func unsigned int gridDimX @@ -981,226 +2276,40 @@ cdef extern from "cuda.h": void** extra CUkernel kern CUcontext ctx - ctypedef CUDA_KERNEL_NODE_PARAMS_v3_st CUDA_KERNEL_NODE_PARAMS_v3 - cdef struct CUDA_MEMSET_NODE_PARAMS_st: - CUdeviceptr dst - size_t pitch - unsigned int value - unsigned int elementSize - size_t width - size_t height - - ctypedef CUDA_MEMSET_NODE_PARAMS_st CUDA_MEMSET_NODE_PARAMS_v1 - - ctypedef CUDA_MEMSET_NODE_PARAMS_v1 CUDA_MEMSET_NODE_PARAMS - - cdef struct CUDA_MEMSET_NODE_PARAMS_v2_st: - CUdeviceptr dst - size_t pitch - unsigned int value - unsigned int elementSize - size_t width - size_t height - CUcontext ctx - - ctypedef CUDA_MEMSET_NODE_PARAMS_v2_st CUDA_MEMSET_NODE_PARAMS_v2 - - cdef struct CUDA_HOST_NODE_PARAMS_st: - CUhostFn fn - void* userData - - ctypedef CUDA_HOST_NODE_PARAMS_st CUDA_HOST_NODE_PARAMS_v1 - - ctypedef CUDA_HOST_NODE_PARAMS_v1 CUDA_HOST_NODE_PARAMS - - cdef struct CUDA_HOST_NODE_PARAMS_v2_st: - CUhostFn fn - void* userData - unsigned int syncMode - - ctypedef CUDA_HOST_NODE_PARAMS_v2_st CUDA_HOST_NODE_PARAMS_v2 - - cdef enum CUgraphConditionalNodeType_enum: - CU_GRAPH_COND_TYPE_IF = 0 - CU_GRAPH_COND_TYPE_WHILE = 1 - CU_GRAPH_COND_TYPE_SWITCH = 2 - - ctypedef CUgraphConditionalNodeType_enum CUgraphConditionalNodeType - - cdef struct CUDA_CONDITIONAL_NODE_PARAMS: - CUgraphConditionalHandle handle - CUgraphConditionalNodeType type - unsigned int size - CUgraph* phGraph_out - CUcontext ctx - - cdef enum CUgraphNodeType_enum: - CU_GRAPH_NODE_TYPE_KERNEL = 0 - CU_GRAPH_NODE_TYPE_MEMCPY = 1 - CU_GRAPH_NODE_TYPE_MEMSET = 2 - CU_GRAPH_NODE_TYPE_HOST = 3 - CU_GRAPH_NODE_TYPE_GRAPH = 4 - CU_GRAPH_NODE_TYPE_EMPTY = 5 - CU_GRAPH_NODE_TYPE_WAIT_EVENT = 6 - CU_GRAPH_NODE_TYPE_EVENT_RECORD = 7 - CU_GRAPH_NODE_TYPE_EXT_SEMAS_SIGNAL = 8 - CU_GRAPH_NODE_TYPE_EXT_SEMAS_WAIT = 9 - CU_GRAPH_NODE_TYPE_MEM_ALLOC = 10 - CU_GRAPH_NODE_TYPE_MEM_FREE = 11 - CU_GRAPH_NODE_TYPE_BATCH_MEM_OP = 12 - CU_GRAPH_NODE_TYPE_CONDITIONAL = 13 - - ctypedef CUgraphNodeType_enum CUgraphNodeType - - cdef enum CUgraphDependencyType_enum: - CU_GRAPH_DEPENDENCY_TYPE_DEFAULT = 0 - CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC = 1 - - ctypedef CUgraphDependencyType_enum CUgraphDependencyType - - cdef struct CUgraphEdgeData_st: - unsigned char from_port - unsigned char to_port - unsigned char type - unsigned char reserved[5] - - ctypedef CUgraphEdgeData_st CUgraphEdgeData - - cdef enum CUgraphInstantiateResult_enum: - CUDA_GRAPH_INSTANTIATE_SUCCESS = 0 - CUDA_GRAPH_INSTANTIATE_ERROR = 1 - CUDA_GRAPH_INSTANTIATE_INVALID_STRUCTURE = 2 - CUDA_GRAPH_INSTANTIATE_NODE_OPERATION_NOT_SUPPORTED = 3 - CUDA_GRAPH_INSTANTIATE_MULTIPLE_CTXS_NOT_SUPPORTED = 4 - CUDA_GRAPH_INSTANTIATE_CONDITIONAL_HANDLE_UNUSED = 5 - - ctypedef CUgraphInstantiateResult_enum CUgraphInstantiateResult - - cdef struct CUDA_GRAPH_INSTANTIATE_PARAMS_st: - cuuint64_t flags - CUstream hUploadStream - CUgraphNode hErrNode_out - CUgraphInstantiateResult result_out - - ctypedef CUDA_GRAPH_INSTANTIATE_PARAMS_st CUDA_GRAPH_INSTANTIATE_PARAMS - - cdef enum CUsynchronizationPolicy_enum: - CU_SYNC_POLICY_AUTO = 1 - CU_SYNC_POLICY_SPIN = 2 - CU_SYNC_POLICY_YIELD = 3 - CU_SYNC_POLICY_BLOCKING_SYNC = 4 - - ctypedef CUsynchronizationPolicy_enum CUsynchronizationPolicy - - cdef enum CUclusterSchedulingPolicy_enum: - CU_CLUSTER_SCHEDULING_POLICY_DEFAULT = 0 - CU_CLUSTER_SCHEDULING_POLICY_SPREAD = 1 - CU_CLUSTER_SCHEDULING_POLICY_LOAD_BALANCING = 2 - - ctypedef CUclusterSchedulingPolicy_enum CUclusterSchedulingPolicy - - cdef enum CUlaunchMemSyncDomain_enum: - CU_LAUNCH_MEM_SYNC_DOMAIN_DEFAULT = 0 - CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE = 1 - - ctypedef CUlaunchMemSyncDomain_enum CUlaunchMemSyncDomain - - cdef struct CUlaunchMemSyncDomainMap_st: - unsigned char default_ - unsigned char remote - - ctypedef CUlaunchMemSyncDomainMap_st CUlaunchMemSyncDomainMap - - cdef enum CUlaunchAttributePortableClusterMode_enum: - CU_LAUNCH_PORTABLE_CLUSTER_MODE_DEFAULT = 0 - CU_LAUNCH_PORTABLE_CLUSTER_MODE_REQUIRE_PORTABLE = 1 - CU_LAUNCH_PORTABLE_CLUSTER_MODE_ALLOW_NON_PORTABLE = 2 - - ctypedef CUlaunchAttributePortableClusterMode_enum CUlaunchAttributePortableClusterMode +cdef struct cuda_bindings_driver__anon_pod12: + CUarray hArray - cdef enum CUsharedMemoryMode_enum: - CU_SHARED_MEMORY_MODE_DEFAULT = 0 - CU_SHARED_MEMORY_MODE_REQUIRE_PORTABLE = 1 - CU_SHARED_MEMORY_MODE_ALLOW_NON_PORTABLE = 2 +cdef struct cuda_bindings_driver__anon_pod13: + CUmipmappedArray hMipmappedArray - ctypedef CUsharedMemoryMode_enum CUsharedMemoryMode - - cdef enum CUlaunchAttributeID_enum: - CU_LAUNCH_ATTRIBUTE_IGNORE = 0 - CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1 - CU_LAUNCH_ATTRIBUTE_COOPERATIVE = 2 - CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY = 3 - CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION = 4 - CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE = 5 - CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION = 6 - CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT = 7 - CU_LAUNCH_ATTRIBUTE_PRIORITY = 8 - CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP = 9 - CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN = 10 - CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION = 11 - 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 - CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE = 17 - CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE = 18 +cdef union cuda_bindings_driver__anon_pod29: + CUmipmappedArray mipmap + CUarray array - ctypedef CUlaunchAttributeID_enum CUlaunchAttributeID +cdef struct cuda_bindings_driver__anon_pod5: + CUevent event + int flags + int triggerAtBlockStart - cdef struct anon_struct1: - unsigned int x - unsigned int y - unsigned int z +cdef struct cuda_bindings_driver__anon_pod6: + CUevent event + int flags - cdef struct anon_struct2: +cdef extern from 'cuda.h': + cdef struct CUDA_EVENT_RECORD_NODE_PARAMS_st: CUevent event - int flags - int triggerAtBlockStart + ctypedef CUDA_EVENT_RECORD_NODE_PARAMS_st CUDA_EVENT_RECORD_NODE_PARAMS - cdef struct anon_struct3: +cdef extern from 'cuda.h': + cdef struct CUDA_EVENT_WAIT_NODE_PARAMS_st: CUevent event - int flags - - cdef struct anon_struct4: - unsigned int x - unsigned int y - unsigned int z - - cdef struct anon_struct5: - int deviceUpdatable - CUgraphDeviceNode devNode - - cdef union CUlaunchAttributeValue_union: - char pad[64] - CUaccessPolicyWindow accessPolicyWindow - int cooperative - CUsynchronizationPolicy syncPolicy - anon_struct1 clusterDim - CUclusterSchedulingPolicy clusterSchedulingPolicyPreference - int programmaticStreamSerializationAllowed - anon_struct2 programmaticEvent - anon_struct3 launchCompletionEvent - int priority - CUlaunchMemSyncDomainMap memSyncDomainMap - CUlaunchMemSyncDomain memSyncDomain - anon_struct4 preferredClusterDim - anon_struct5 deviceUpdatableKernelNode - unsigned int sharedMemCarveout - unsigned int nvlinkUtilCentricScheduling - CUlaunchAttributePortableClusterMode portableClusterSizeMode - CUsharedMemoryMode sharedMemoryMode - - ctypedef CUlaunchAttributeValue_union CUlaunchAttributeValue - - cdef struct CUlaunchAttribute_st: - CUlaunchAttributeID id - CUlaunchAttributeValue value - - ctypedef CUlaunchAttribute_st CUlaunchAttribute + ctypedef CUDA_EVENT_WAIT_NODE_PARAMS_st CUDA_EVENT_WAIT_NODE_PARAMS - cdef struct CUlaunchConfig_st: +cdef extern from 'cuda.h': + cdef struct CUDA_LAUNCH_PARAMS_st: + CUfunction function unsigned int gridDimX unsigned int gridDimY unsigned int gridDimZ @@ -1209,250 +2318,173 @@ cdef extern from "cuda.h": unsigned int blockDimZ unsigned int sharedMemBytes CUstream hStream - CUlaunchAttribute* attrs - unsigned int numAttrs - - ctypedef CUlaunchConfig_st CUlaunchConfig - - ctypedef CUlaunchAttributeID CUkernelNodeAttrID - - ctypedef CUlaunchAttributeValue CUkernelNodeAttrValue_v1 - - ctypedef CUkernelNodeAttrValue_v1 CUkernelNodeAttrValue - - cdef enum CUstreamCaptureStatus_enum: - CU_STREAM_CAPTURE_STATUS_NONE = 0 - CU_STREAM_CAPTURE_STATUS_ACTIVE = 1 - CU_STREAM_CAPTURE_STATUS_INVALIDATED = 2 - - ctypedef CUstreamCaptureStatus_enum CUstreamCaptureStatus - - cdef enum CUstreamCaptureMode_enum: - CU_STREAM_CAPTURE_MODE_GLOBAL = 0 - CU_STREAM_CAPTURE_MODE_THREAD_LOCAL = 1 - CU_STREAM_CAPTURE_MODE_RELAXED = 2 - - ctypedef CUstreamCaptureMode_enum CUstreamCaptureMode - - ctypedef CUlaunchAttributeID CUstreamAttrID - - ctypedef CUlaunchAttributeValue CUstreamAttrValue_v1 - - ctypedef CUstreamAttrValue_v1 CUstreamAttrValue - - cdef enum CUdriverProcAddress_flags_enum: - CU_GET_PROC_ADDRESS_DEFAULT = 0 - CU_GET_PROC_ADDRESS_LEGACY_STREAM = 1 - CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM = 2 - - ctypedef CUdriverProcAddress_flags_enum CUdriverProcAddress_flags - - cdef enum CUdriverProcAddressQueryResult_enum: - CU_GET_PROC_ADDRESS_SUCCESS = 0 - CU_GET_PROC_ADDRESS_SYMBOL_NOT_FOUND = 1 - CU_GET_PROC_ADDRESS_VERSION_NOT_SUFFICIENT = 2 - - ctypedef CUdriverProcAddressQueryResult_enum CUdriverProcAddressQueryResult - - cdef enum CUexecAffinityType_enum: - CU_EXEC_AFFINITY_TYPE_SM_COUNT = 0 - CU_EXEC_AFFINITY_TYPE_MAX = 1 - - ctypedef CUexecAffinityType_enum CUexecAffinityType - - cdef struct CUexecAffinitySmCount_st: - unsigned int val - - ctypedef CUexecAffinitySmCount_st CUexecAffinitySmCount_v1 - - ctypedef CUexecAffinitySmCount_v1 CUexecAffinitySmCount - - cdef union anon_union3: - CUexecAffinitySmCount smCount - - cdef struct CUexecAffinityParam_st: - CUexecAffinityType type - anon_union3 param + void** kernelParams + ctypedef CUDA_LAUNCH_PARAMS_st CUDA_LAUNCH_PARAMS_v1 - ctypedef CUexecAffinityParam_st CUexecAffinityParam_v1 +cdef extern from 'cuda.h': + ctypedef void (*CUstreamCallback 'CUstreamCallback')( + CUstream hStream, + CUresult status, + void* userData + ) - ctypedef CUexecAffinityParam_v1 CUexecAffinityParam - cdef enum CUcigDataType_enum: - CIG_DATA_TYPE_D3D12_COMMAND_QUEUE = 1 - CIG_DATA_TYPE_NV_BLOB = 2 +cdef extern from 'cuda.h': + cdef struct CUDA_CHILD_GRAPH_NODE_PARAMS_st: + CUgraph graph + CUgraphChildGraphNodeOwnership ownership + ctypedef CUDA_CHILD_GRAPH_NODE_PARAMS_st CUDA_CHILD_GRAPH_NODE_PARAMS - ctypedef CUcigDataType_enum CUcigDataType +cdef extern from 'cuda.h': + cdef struct CUDA_GRAPH_INSTANTIATE_PARAMS_st: + cuuint64_t flags + CUstream hUploadStream + CUgraphNode hErrNode_out + CUgraphInstantiateResult result_out + ctypedef CUDA_GRAPH_INSTANTIATE_PARAMS_st CUDA_GRAPH_INSTANTIATE_PARAMS - cdef struct CUctxCigParam_st: - CUcigDataType sharedDataType - void* sharedData +cdef extern from 'cuda.h': + cdef struct CUgraphExecUpdateResultInfo_st: + CUgraphExecUpdateResult result + CUgraphNode errorNode + CUgraphNode errorFromNode + ctypedef CUgraphExecUpdateResultInfo_st CUgraphExecUpdateResultInfo_v1 - ctypedef CUctxCigParam_st CUctxCigParam +cdef struct cuda_bindings_driver__anon_pod8: + int deviceUpdatable + CUgraphDeviceNode devNode - cdef struct CUctxCreateParams_st: - CUexecAffinityParam* execAffinityParams - int numExecAffinityParams - CUctxCigParam* cigParams +cdef extern from 'cuda.h': + cdef struct CUcheckpointGpuPair_st: + CUuuid oldUuid + CUuuid newUuid + ctypedef CUcheckpointGpuPair_st CUcheckpointGpuPair - ctypedef CUctxCreateParams_st CUctxCreateParams +cdef union cuda_bindings_driver__anon_pod2: + cuda_bindings_driver__anon_pod3 overBudget - cdef enum CUstreamCigDataType_enum: - STREAM_CIG_DATA_TYPE_D3D12_COMMAND_LIST = 1 +cdef extern from 'cuda.h': + cdef struct CUDA_HOST_NODE_PARAMS_st: + CUhostFn fn + void* userData + ctypedef CUDA_HOST_NODE_PARAMS_st CUDA_HOST_NODE_PARAMS_v1 - ctypedef CUstreamCigDataType_enum CUstreamCigDataType +cdef extern from 'cuda.h': + cdef struct CUDA_HOST_NODE_PARAMS_v2_st: + CUhostFn fn + void* userData + unsigned int syncMode + ctypedef CUDA_HOST_NODE_PARAMS_v2_st CUDA_HOST_NODE_PARAMS_v2 - cdef struct CUstreamCigParam_st: - CUstreamCigDataType streamSharedDataType - void* streamSharedData +cdef extern from 'cuda.h': + cdef struct CUDA_ARRAY_SPARSE_PROPERTIES_st: + cuda_bindings_driver__anon_pod10 tileExtent + unsigned int miptailFirstLevel + unsigned long long miptailSize + unsigned int flags + unsigned int reserved[4] + ctypedef CUDA_ARRAY_SPARSE_PROPERTIES_st CUDA_ARRAY_SPARSE_PROPERTIES_v1 - ctypedef CUstreamCigParam_st CUstreamCigParam +cdef union cuda_bindings_driver__anon_pod17: + int fd + cuda_bindings_driver__anon_pod18 win32 + void* nvSciBufObject + +cdef union cuda_bindings_driver__anon_pod19: + int fd + cuda_bindings_driver__anon_pod20 win32 + void* nvSciSyncObj + +cdef struct cuda_bindings_driver__anon_pod21: + cuda_bindings_driver__anon_pod22 fence + cuda_bindings_driver__anon_pod23 nvSciSync + cuda_bindings_driver__anon_pod24 keyedMutex + unsigned int reserved[12] + +cdef struct cuda_bindings_driver__anon_pod25: + cuda_bindings_driver__anon_pod26 fence + cuda_bindings_driver__anon_pod27 nvSciSync + cuda_bindings_driver__anon_pod28 keyedMutex + unsigned int reserved[10] + +cdef union cuda_bindings_driver__anon_pod30: + cuda_bindings_driver__anon_pod31 sparseLevel + cuda_bindings_driver__anon_pod32 miptail + +cdef extern from 'cuda.h': + cdef struct CUmemLocation_st: + CUmemLocationType type + int id + ctypedef CUmemLocation_st CUmemLocation_v1 +cdef extern from 'cuda.h': cdef struct CUstreamCigCaptureParams_st: CUstreamCigParam* streamCigParams - ctypedef CUstreamCigCaptureParams_st CUstreamCigCaptureParams - cdef enum CUlibraryOption_enum: - CU_LIBRARY_HOST_UNIVERSAL_FUNCTION_AND_DATA_TABLE = 0 - CU_LIBRARY_BINARY_IS_PRESERVED = 1 - CU_LIBRARY_NUM_OPTIONS = 2 - - ctypedef CUlibraryOption_enum CUlibraryOption - - cdef struct CUlibraryHostUniversalFunctionAndDataTable_st: - void* functionTable - size_t functionWindowSize - void* dataTable - size_t dataWindowSize - - ctypedef CUlibraryHostUniversalFunctionAndDataTable_st CUlibraryHostUniversalFunctionAndDataTable - - cdef enum cudaError_enum: - CUDA_SUCCESS = 0 - CUDA_ERROR_INVALID_VALUE = 1 - CUDA_ERROR_OUT_OF_MEMORY = 2 - CUDA_ERROR_NOT_INITIALIZED = 3 - CUDA_ERROR_DEINITIALIZED = 4 - CUDA_ERROR_PROFILER_DISABLED = 5 - CUDA_ERROR_PROFILER_NOT_INITIALIZED = 6 - 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 - CUDA_ERROR_DEVICE_NOT_LICENSED = 102 - CUDA_ERROR_INVALID_IMAGE = 200 - CUDA_ERROR_INVALID_CONTEXT = 201 - CUDA_ERROR_CONTEXT_ALREADY_CURRENT = 202 - CUDA_ERROR_MAP_FAILED = 205 - CUDA_ERROR_UNMAP_FAILED = 206 - CUDA_ERROR_ARRAY_IS_MAPPED = 207 - CUDA_ERROR_ALREADY_MAPPED = 208 - CUDA_ERROR_NO_BINARY_FOR_GPU = 209 - CUDA_ERROR_ALREADY_ACQUIRED = 210 - CUDA_ERROR_NOT_MAPPED = 211 - CUDA_ERROR_NOT_MAPPED_AS_ARRAY = 212 - CUDA_ERROR_NOT_MAPPED_AS_POINTER = 213 - CUDA_ERROR_ECC_UNCORRECTABLE = 214 - CUDA_ERROR_UNSUPPORTED_LIMIT = 215 - CUDA_ERROR_CONTEXT_ALREADY_IN_USE = 216 - CUDA_ERROR_PEER_ACCESS_UNSUPPORTED = 217 - CUDA_ERROR_INVALID_PTX = 218 - CUDA_ERROR_INVALID_GRAPHICS_CONTEXT = 219 - CUDA_ERROR_NVLINK_UNCORRECTABLE = 220 - CUDA_ERROR_JIT_COMPILER_NOT_FOUND = 221 - CUDA_ERROR_UNSUPPORTED_PTX_VERSION = 222 - CUDA_ERROR_JIT_COMPILATION_DISABLED = 223 - CUDA_ERROR_UNSUPPORTED_EXEC_AFFINITY = 224 - CUDA_ERROR_UNSUPPORTED_DEVSIDE_SYNC = 225 - CUDA_ERROR_CONTAINED = 226 - CUDA_ERROR_INVALID_SOURCE = 300 - CUDA_ERROR_FILE_NOT_FOUND = 301 - CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND = 302 - CUDA_ERROR_SHARED_OBJECT_INIT_FAILED = 303 - CUDA_ERROR_OPERATING_SYSTEM = 304 - CUDA_ERROR_INVALID_HANDLE = 400 - CUDA_ERROR_ILLEGAL_STATE = 401 - CUDA_ERROR_LOSSY_QUERY = 402 - CUDA_ERROR_NOT_FOUND = 500 - CUDA_ERROR_NOT_READY = 600 - CUDA_ERROR_ILLEGAL_ADDRESS = 700 - CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES = 701 - CUDA_ERROR_LAUNCH_TIMEOUT = 702 - CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING = 703 - CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED = 704 - CUDA_ERROR_PEER_ACCESS_NOT_ENABLED = 705 - CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE = 708 - CUDA_ERROR_CONTEXT_IS_DESTROYED = 709 - CUDA_ERROR_ASSERT = 710 - CUDA_ERROR_TOO_MANY_PEERS = 711 - CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED = 712 - CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED = 713 - CUDA_ERROR_HARDWARE_STACK_ERROR = 714 - CUDA_ERROR_ILLEGAL_INSTRUCTION = 715 - CUDA_ERROR_MISALIGNED_ADDRESS = 716 - CUDA_ERROR_INVALID_ADDRESS_SPACE = 717 - CUDA_ERROR_INVALID_PC = 718 - CUDA_ERROR_LAUNCH_FAILED = 719 - CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE = 720 - CUDA_ERROR_TENSOR_MEMORY_LEAK = 721 - CUDA_ERROR_NOT_PERMITTED = 800 - CUDA_ERROR_NOT_SUPPORTED = 801 - CUDA_ERROR_SYSTEM_NOT_READY = 802 - CUDA_ERROR_SYSTEM_DRIVER_MISMATCH = 803 - CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE = 804 - CUDA_ERROR_MPS_CONNECTION_FAILED = 805 - CUDA_ERROR_MPS_RPC_FAILURE = 806 - CUDA_ERROR_MPS_SERVER_NOT_READY = 807 - CUDA_ERROR_MPS_MAX_CLIENTS_REACHED = 808 - CUDA_ERROR_MPS_MAX_CONNECTIONS_REACHED = 809 - CUDA_ERROR_MPS_CLIENT_TERMINATED = 810 - CUDA_ERROR_CDP_NOT_SUPPORTED = 811 - CUDA_ERROR_CDP_VERSION_MISMATCH = 812 - CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED = 900 - CUDA_ERROR_STREAM_CAPTURE_INVALIDATED = 901 - CUDA_ERROR_STREAM_CAPTURE_MERGE = 902 - CUDA_ERROR_STREAM_CAPTURE_UNMATCHED = 903 - CUDA_ERROR_STREAM_CAPTURE_UNJOINED = 904 - CUDA_ERROR_STREAM_CAPTURE_ISOLATION = 905 - CUDA_ERROR_STREAM_CAPTURE_IMPLICIT = 906 - CUDA_ERROR_CAPTURED_EVENT = 907 - CUDA_ERROR_STREAM_CAPTURE_WRONG_THREAD = 908 - CUDA_ERROR_TIMEOUT = 909 - CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE = 910 - CUDA_ERROR_EXTERNAL_DEVICE = 911 - CUDA_ERROR_INVALID_CLUSTER_SIZE = 912 - CUDA_ERROR_FUNCTION_NOT_LOADED = 913 - CUDA_ERROR_INVALID_RESOURCE_TYPE = 914 - CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION = 915 - CUDA_ERROR_KEY_ROTATION = 916 - CUDA_ERROR_STREAM_DETACHED = 917 - CUDA_ERROR_UNKNOWN = 999 +cdef extern from 'cuda.h': + ctypedef struct CUDA_CONDITIONAL_NODE_PARAMS 'CUDA_CONDITIONAL_NODE_PARAMS': + CUgraphConditionalHandle handle + CUgraphConditionalNodeType type + unsigned int size + CUgraph* phGraph_out + CUcontext ctx - ctypedef cudaError_enum CUresult +cdef extern from 'cuda.h': + ctypedef struct CUstreamMemOpWaitValueParams_st 'CUstreamMemOpWaitValueParams_st': + CUstreamBatchMemOpType operation + CUdeviceptr address + cuuint32_t value + cuuint64_t value64 + unsigned int flags + CUdeviceptr alias - cdef enum CUdevice_P2PAttribute_enum: - CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK = 1 - CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED = 2 - 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 +cdef extern from 'cuda.h': + ctypedef struct CUstreamMemOpWriteValueParams_st 'CUstreamMemOpWriteValueParams_st': + CUstreamBatchMemOpType operation + CUdeviceptr address + cuuint32_t value + cuuint64_t value64 + unsigned int flags + CUdeviceptr alias - ctypedef CUdevice_P2PAttribute_enum CUdevice_P2PAttribute +cdef extern from 'cuda.h': + ctypedef struct CUstreamMemOpAtomicReductionParams_st 'CUstreamMemOpAtomicReductionParams_st': + CUstreamBatchMemOpType operation + unsigned int flags + CUstreamAtomicReductionOpType reductionOp + CUstreamAtomicReductionDataType dataType + CUdeviceptr address + cuuint64_t value + CUdeviceptr alias - ctypedef void (*CUstreamCallback)(CUstream hStream, CUresult status, void* userData) +cdef extern from 'cuda.h': + cdef struct CUDA_MEMSET_NODE_PARAMS_st: + CUdeviceptr dst + size_t pitch + unsigned int value + unsigned int elementSize + size_t width + size_t height + ctypedef CUDA_MEMSET_NODE_PARAMS_st CUDA_MEMSET_NODE_PARAMS_v1 - ctypedef size_t (*CUoccupancyB2DSize)(int blockSize) +cdef extern from 'cuda.h': + cdef struct CUDA_MEMSET_NODE_PARAMS_v2_st: + CUdeviceptr dst + size_t pitch + unsigned int value + unsigned int elementSize + size_t width + size_t height + CUcontext ctx + ctypedef CUDA_MEMSET_NODE_PARAMS_v2_st CUDA_MEMSET_NODE_PARAMS_v2 +cdef extern from 'cuda.h': cdef struct CUDA_MEMCPY2D_st: size_t srcXInBytes size_t srcY CUmemorytype srcMemoryType - const void* srcHost + void* srcHost CUdeviceptr srcDevice CUarray srcArray size_t srcPitch @@ -1465,18 +2497,16 @@ cdef extern from "cuda.h": size_t dstPitch size_t WidthInBytes size_t Height - ctypedef CUDA_MEMCPY2D_st CUDA_MEMCPY2D_v2 - ctypedef CUDA_MEMCPY2D_v2 CUDA_MEMCPY2D - +cdef extern from 'cuda.h': cdef struct CUDA_MEMCPY3D_st: size_t srcXInBytes size_t srcY size_t srcZ size_t srcLOD CUmemorytype srcMemoryType - const void* srcHost + void* srcHost CUdeviceptr srcDevice CUarray srcArray void* reserved0 @@ -1496,18 +2526,16 @@ cdef extern from "cuda.h": size_t WidthInBytes size_t Height size_t Depth - ctypedef CUDA_MEMCPY3D_st CUDA_MEMCPY3D_v2 - ctypedef CUDA_MEMCPY3D_v2 CUDA_MEMCPY3D - +cdef extern from 'cuda.h': cdef struct CUDA_MEMCPY3D_PEER_st: size_t srcXInBytes size_t srcY size_t srcZ size_t srcLOD CUmemorytype srcMemoryType - const void* srcHost + void* srcHost CUdeviceptr srcDevice CUarray srcArray CUcontext srcContext @@ -1527,652 +2555,266 @@ cdef extern from "cuda.h": size_t WidthInBytes size_t Height size_t Depth - ctypedef CUDA_MEMCPY3D_PEER_st CUDA_MEMCPY3D_PEER_v1 - ctypedef CUDA_MEMCPY3D_PEER_v1 CUDA_MEMCPY3D_PEER - - cdef struct CUDA_MEMCPY_NODE_PARAMS_st: - int flags - int reserved - CUcontext copyCtx - CUDA_MEMCPY3D copyParams - - ctypedef CUDA_MEMCPY_NODE_PARAMS_st CUDA_MEMCPY_NODE_PARAMS - - cdef struct CUDA_ARRAY_DESCRIPTOR_st: - size_t Width - size_t Height - CUarray_format Format - unsigned int NumChannels - - ctypedef CUDA_ARRAY_DESCRIPTOR_st CUDA_ARRAY_DESCRIPTOR_v2 - - ctypedef CUDA_ARRAY_DESCRIPTOR_v2 CUDA_ARRAY_DESCRIPTOR - - cdef struct CUDA_ARRAY3D_DESCRIPTOR_st: - size_t Width - size_t Height - size_t Depth - CUarray_format Format - unsigned int NumChannels - unsigned int Flags - - ctypedef CUDA_ARRAY3D_DESCRIPTOR_st CUDA_ARRAY3D_DESCRIPTOR_v2 - - ctypedef CUDA_ARRAY3D_DESCRIPTOR_v2 CUDA_ARRAY3D_DESCRIPTOR - - cdef struct anon_struct6: - unsigned int width - unsigned int height - unsigned int depth - - cdef struct CUDA_ARRAY_SPARSE_PROPERTIES_st: - anon_struct6 tileExtent - unsigned int miptailFirstLevel - unsigned long long miptailSize - unsigned int flags - unsigned int reserved[4] - - ctypedef CUDA_ARRAY_SPARSE_PROPERTIES_st CUDA_ARRAY_SPARSE_PROPERTIES_v1 - - ctypedef CUDA_ARRAY_SPARSE_PROPERTIES_v1 CUDA_ARRAY_SPARSE_PROPERTIES - - cdef struct CUDA_ARRAY_MEMORY_REQUIREMENTS_st: - size_t size - size_t alignment - unsigned int reserved[4] - - ctypedef CUDA_ARRAY_MEMORY_REQUIREMENTS_st CUDA_ARRAY_MEMORY_REQUIREMENTS_v1 - - ctypedef CUDA_ARRAY_MEMORY_REQUIREMENTS_v1 CUDA_ARRAY_MEMORY_REQUIREMENTS - - cdef struct anon_struct7: - CUarray hArray - - cdef struct anon_struct8: - CUmipmappedArray hMipmappedArray - - cdef struct anon_struct9: - CUdeviceptr devPtr - CUarray_format format - unsigned int numChannels - size_t sizeInBytes - - cdef struct anon_struct10: - CUdeviceptr devPtr - CUarray_format format - unsigned int numChannels - size_t width - size_t height - size_t pitchInBytes - - cdef struct anon_struct11: - int reserved[32] - - cdef union anon_union4: - anon_struct7 array - anon_struct8 mipmap - anon_struct9 linear - anon_struct10 pitch2D - anon_struct11 reserved - - cdef struct CUDA_RESOURCE_DESC_st: - CUresourcetype resType - anon_union4 res - unsigned int flags - - ctypedef CUDA_RESOURCE_DESC_st CUDA_RESOURCE_DESC_v1 - - ctypedef CUDA_RESOURCE_DESC_v1 CUDA_RESOURCE_DESC - - cdef struct CUDA_TEXTURE_DESC_st: - CUaddress_mode addressMode[3] - CUfilter_mode filterMode - unsigned int flags - unsigned int maxAnisotropy - CUfilter_mode mipmapFilterMode - float mipmapLevelBias - float minMipmapLevelClamp - float maxMipmapLevelClamp - float borderColor[4] - int reserved[12] - - ctypedef CUDA_TEXTURE_DESC_st CUDA_TEXTURE_DESC_v1 - - ctypedef CUDA_TEXTURE_DESC_v1 CUDA_TEXTURE_DESC - - cdef enum CUresourceViewFormat_enum: - CU_RES_VIEW_FORMAT_NONE = 0 - CU_RES_VIEW_FORMAT_UINT_1X8 = 1 - CU_RES_VIEW_FORMAT_UINT_2X8 = 2 - CU_RES_VIEW_FORMAT_UINT_4X8 = 3 - CU_RES_VIEW_FORMAT_SINT_1X8 = 4 - CU_RES_VIEW_FORMAT_SINT_2X8 = 5 - CU_RES_VIEW_FORMAT_SINT_4X8 = 6 - CU_RES_VIEW_FORMAT_UINT_1X16 = 7 - CU_RES_VIEW_FORMAT_UINT_2X16 = 8 - CU_RES_VIEW_FORMAT_UINT_4X16 = 9 - CU_RES_VIEW_FORMAT_SINT_1X16 = 10 - CU_RES_VIEW_FORMAT_SINT_2X16 = 11 - CU_RES_VIEW_FORMAT_SINT_4X16 = 12 - CU_RES_VIEW_FORMAT_UINT_1X32 = 13 - CU_RES_VIEW_FORMAT_UINT_2X32 = 14 - CU_RES_VIEW_FORMAT_UINT_4X32 = 15 - CU_RES_VIEW_FORMAT_SINT_1X32 = 16 - CU_RES_VIEW_FORMAT_SINT_2X32 = 17 - CU_RES_VIEW_FORMAT_SINT_4X32 = 18 - CU_RES_VIEW_FORMAT_FLOAT_1X16 = 19 - CU_RES_VIEW_FORMAT_FLOAT_2X16 = 20 - CU_RES_VIEW_FORMAT_FLOAT_4X16 = 21 - CU_RES_VIEW_FORMAT_FLOAT_1X32 = 22 - CU_RES_VIEW_FORMAT_FLOAT_2X32 = 23 - CU_RES_VIEW_FORMAT_FLOAT_4X32 = 24 - CU_RES_VIEW_FORMAT_UNSIGNED_BC1 = 25 - CU_RES_VIEW_FORMAT_UNSIGNED_BC2 = 26 - CU_RES_VIEW_FORMAT_UNSIGNED_BC3 = 27 - CU_RES_VIEW_FORMAT_UNSIGNED_BC4 = 28 - CU_RES_VIEW_FORMAT_SIGNED_BC4 = 29 - CU_RES_VIEW_FORMAT_UNSIGNED_BC5 = 30 - CU_RES_VIEW_FORMAT_SIGNED_BC5 = 31 - CU_RES_VIEW_FORMAT_UNSIGNED_BC6H = 32 - CU_RES_VIEW_FORMAT_SIGNED_BC6H = 33 - CU_RES_VIEW_FORMAT_UNSIGNED_BC7 = 34 - - ctypedef CUresourceViewFormat_enum CUresourceViewFormat - - cdef struct CUDA_RESOURCE_VIEW_DESC_st: - CUresourceViewFormat format - size_t width - size_t height - size_t depth - unsigned int firstMipmapLevel - unsigned int lastMipmapLevel - unsigned int firstLayer - unsigned int lastLayer - unsigned int reserved[16] - - ctypedef CUDA_RESOURCE_VIEW_DESC_st CUDA_RESOURCE_VIEW_DESC_v1 - - ctypedef CUDA_RESOURCE_VIEW_DESC_v1 CUDA_RESOURCE_VIEW_DESC - - cdef struct CUtensorMap_st: - cuuint64_t opaque[16] - - ctypedef CUtensorMap_st CUtensorMap - - cdef enum CUtensorMapDataType_enum: - CU_TENSOR_MAP_DATA_TYPE_UINT8 = 0 - CU_TENSOR_MAP_DATA_TYPE_UINT16 = 1 - CU_TENSOR_MAP_DATA_TYPE_UINT32 = 2 - CU_TENSOR_MAP_DATA_TYPE_INT32 = 3 - CU_TENSOR_MAP_DATA_TYPE_UINT64 = 4 - CU_TENSOR_MAP_DATA_TYPE_INT64 = 5 - CU_TENSOR_MAP_DATA_TYPE_FLOAT16 = 6 - CU_TENSOR_MAP_DATA_TYPE_FLOAT32 = 7 - CU_TENSOR_MAP_DATA_TYPE_FLOAT64 = 8 - CU_TENSOR_MAP_DATA_TYPE_BFLOAT16 = 9 - CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ = 10 - CU_TENSOR_MAP_DATA_TYPE_TFLOAT32 = 11 - CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ = 12 - CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B = 13 - CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B = 14 - CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B = 15 - - ctypedef CUtensorMapDataType_enum CUtensorMapDataType - - cdef enum CUtensorMapInterleave_enum: - CU_TENSOR_MAP_INTERLEAVE_NONE = 0 - CU_TENSOR_MAP_INTERLEAVE_16B = 1 - CU_TENSOR_MAP_INTERLEAVE_32B = 2 - - ctypedef CUtensorMapInterleave_enum CUtensorMapInterleave - - cdef enum CUtensorMapSwizzle_enum: - CU_TENSOR_MAP_SWIZZLE_NONE = 0 - CU_TENSOR_MAP_SWIZZLE_32B = 1 - CU_TENSOR_MAP_SWIZZLE_64B = 2 - CU_TENSOR_MAP_SWIZZLE_128B = 3 - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B = 4 - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B_FLIP_8B = 5 - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B = 6 - - ctypedef CUtensorMapSwizzle_enum CUtensorMapSwizzle - - cdef enum CUtensorMapL2promotion_enum: - CU_TENSOR_MAP_L2_PROMOTION_NONE = 0 - CU_TENSOR_MAP_L2_PROMOTION_L2_64B = 1 - CU_TENSOR_MAP_L2_PROMOTION_L2_128B = 2 - CU_TENSOR_MAP_L2_PROMOTION_L2_256B = 3 - - ctypedef CUtensorMapL2promotion_enum CUtensorMapL2promotion - - cdef enum CUtensorMapFloatOOBfill_enum: - CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE = 0 - CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA = 1 - - ctypedef CUtensorMapFloatOOBfill_enum CUtensorMapFloatOOBfill - - cdef enum CUtensorMapIm2ColWideMode_enum: - CU_TENSOR_MAP_IM2COL_WIDE_MODE_W = 0 - CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128 = 1 - - ctypedef CUtensorMapIm2ColWideMode_enum CUtensorMapIm2ColWideMode - - cdef struct CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st: - unsigned long long p2pToken - unsigned int vaSpaceToken - - ctypedef CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1 - - ctypedef CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1 CUDA_POINTER_ATTRIBUTE_P2P_TOKENS - - cdef enum CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum: - CU_POINTER_ATTRIBUTE_ACCESS_FLAG_NONE = 0 - CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READ = 1 - CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READWRITE = 3 - - ctypedef CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS - - cdef struct CUDA_LAUNCH_PARAMS_st: - CUfunction function - unsigned int gridDimX - unsigned int gridDimY - unsigned int gridDimZ - unsigned int blockDimX - unsigned int blockDimY - unsigned int blockDimZ - unsigned int sharedMemBytes - CUstream hStream - void** kernelParams - - ctypedef CUDA_LAUNCH_PARAMS_st CUDA_LAUNCH_PARAMS_v1 - - ctypedef CUDA_LAUNCH_PARAMS_v1 CUDA_LAUNCH_PARAMS - - cdef enum CUexternalMemoryHandleType_enum: - CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD = 1 - CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32 = 2 - CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT = 3 - CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP = 4 - CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE = 5 - 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 - - cdef struct anon_struct12: - void* handle - const void* name +cdef struct cuda_bindings_driver__anon_pod14: + CUdeviceptr devPtr + CUarray_format format + unsigned int numChannels + size_t sizeInBytes - cdef union anon_union5: - int fd - anon_struct12 win32 - const void* nvSciBufObject +cdef struct cuda_bindings_driver__anon_pod15: + CUdeviceptr devPtr + CUarray_format format + unsigned int numChannels + size_t width + size_t height + size_t pitchInBytes - cdef struct CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: - CUexternalMemoryHandleType type - anon_union5 handle - unsigned long long size - unsigned int flags - unsigned int reserved[16] +cdef extern from 'cuda.h': + cdef struct CUDA_MEM_FREE_NODE_PARAMS_st: + CUdeviceptr dptr + ctypedef CUDA_MEM_FREE_NODE_PARAMS_st CUDA_MEM_FREE_NODE_PARAMS - ctypedef CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1 +cdef extern from 'cuda.h': + cdef struct CUdevWorkqueueConfigResource_st: + CUdevice device + unsigned int wqConcurrencyLimit + CUdevWorkqueueConfigScope sharingScope + ctypedef CUdevWorkqueueConfigResource_st CUdevWorkqueueConfigResource - ctypedef CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1 CUDA_EXTERNAL_MEMORY_HANDLE_DESC +cdef struct cuda_bindings_driver__anon_pod42: + CUdevice device - cdef struct CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st: - unsigned long long offset - unsigned long long size - unsigned int flags - unsigned int reserved[16] +cdef extern from 'cuda.h': + ctypedef void (*CUcoredumpStatusCallback 'CUcoredumpStatusCallback')( + void* userData, + int pid, + CUdevice dev + ) - ctypedef CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1 - ctypedef CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1 CUDA_EXTERNAL_MEMORY_BUFFER_DESC +cdef union cuda_bindings_driver__anon_pod9: + CUexecAffinitySmCount smCount +cdef extern from 'cuda.h': cdef struct CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st: unsigned long long offset CUDA_ARRAY3D_DESCRIPTOR arrayDesc unsigned int numLevels - unsigned int reserved[16] - - ctypedef CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1 - - ctypedef CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1 CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC - - cdef enum CUexternalSemaphoreHandleType_enum: - CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD = 1 - CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32 = 2 - CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT = 3 - CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE = 4 - CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE = 5 - CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC = 6 - CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX = 7 - CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT = 8 - CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD = 9 - CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32 = 10 - - ctypedef CUexternalSemaphoreHandleType_enum CUexternalSemaphoreHandleType - - cdef struct anon_struct13: - void* handle - const void* name - - cdef union anon_union6: - int fd - anon_struct13 win32 - const void* nvSciSyncObj - - cdef struct CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: - CUexternalSemaphoreHandleType type - anon_union6 handle - unsigned int flags - unsigned int reserved[16] - - ctypedef CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1 - - ctypedef CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1 CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC - - cdef struct anon_struct14: - unsigned long long value - - cdef union anon_union7: - void* fence - unsigned long long reserved - - cdef struct anon_struct15: - unsigned long long key - - cdef struct anon_struct16: - anon_struct14 fence - anon_union7 nvSciSync - anon_struct15 keyedMutex - unsigned int reserved[12] - - cdef struct CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st: - anon_struct16 params - unsigned int flags - unsigned int reserved[16] - - ctypedef CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1 - - ctypedef CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1 CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS - - cdef struct anon_struct17: - unsigned long long value - - cdef union anon_union8: - void* fence - unsigned long long reserved - - cdef struct anon_struct18: - unsigned long long key - unsigned int timeoutMs - - cdef struct anon_struct19: - anon_struct17 fence - anon_union8 nvSciSync - anon_struct18 keyedMutex - unsigned int reserved[10] - - cdef struct CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st: - anon_struct19 params - unsigned int flags - unsigned int reserved[16] - - ctypedef CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1 - - ctypedef CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1 CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS - - cdef struct CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st: - CUexternalSemaphore* extSemArray - const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* paramsArray - unsigned int numExtSems + unsigned int reserved[16] + ctypedef CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1 - ctypedef CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1 +cdef union cuda_bindings_driver__anon_pod33: + CUmemGenericAllocationHandle memHandle - ctypedef CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1 CUDA_EXT_SEM_SIGNAL_NODE_PARAMS +cdef struct cuda_bindings_driver__anon_pod38: + CUarray array + CUoffset3D offset - cdef struct CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: - CUexternalSemaphore* extSemArray - const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* paramsArray - unsigned int numExtSems +cdef extern from 'cuda.h': + ctypedef CUDA_KERNEL_NODE_PARAMS_v2 CUDA_KERNEL_NODE_PARAMS 'CUDA_KERNEL_NODE_PARAMS' - ctypedef CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 - cdef struct CUDA_EXT_SEM_WAIT_NODE_PARAMS_st: - CUexternalSemaphore* extSemArray - const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* paramsArray - unsigned int numExtSems +cdef extern from 'cuda.h': + ctypedef CUDA_LAUNCH_PARAMS_v1 CUDA_LAUNCH_PARAMS 'CUDA_LAUNCH_PARAMS' - ctypedef CUDA_EXT_SEM_WAIT_NODE_PARAMS_st CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1 - ctypedef CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1 CUDA_EXT_SEM_WAIT_NODE_PARAMS +cdef extern from 'cuda.h': + ctypedef CUgraphExecUpdateResultInfo_v1 CUgraphExecUpdateResultInfo 'CUgraphExecUpdateResultInfo' - cdef struct CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st: - CUexternalSemaphore* extSemArray - const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* paramsArray - unsigned int numExtSems - ctypedef CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 +cdef extern from 'cuda.h': + cdef union CUlaunchAttributeValue_union: + char pad[64] + CUaccessPolicyWindow accessPolicyWindow + int cooperative + CUsynchronizationPolicy syncPolicy + cuda_bindings_driver__anon_pod4 clusterDim + CUclusterSchedulingPolicy clusterSchedulingPolicyPreference + int programmaticStreamSerializationAllowed + cuda_bindings_driver__anon_pod5 programmaticEvent + cuda_bindings_driver__anon_pod6 launchCompletionEvent + int priority + CUlaunchMemSyncDomainMap memSyncDomainMap + CUlaunchMemSyncDomain memSyncDomain + cuda_bindings_driver__anon_pod7 preferredClusterDim + cuda_bindings_driver__anon_pod8 deviceUpdatableKernelNode + unsigned int sharedMemCarveout + unsigned int nvlinkUtilCentricScheduling + CUlaunchAttributePortableClusterMode portableClusterSizeMode + CUsharedMemoryMode sharedMemoryMode + ctypedef CUlaunchAttributeValue_union CUlaunchAttributeValue - ctypedef unsigned long long CUmemGenericAllocationHandle_v1 +cdef extern from 'cuda.h': + cdef struct CUcheckpointRestoreArgs_st: + CUcheckpointGpuPair* gpuPairs + unsigned int gpuPairsCount + char reserved[((64 - 8) - 4)] + ctypedef CUcheckpointRestoreArgs_st CUcheckpointRestoreArgs - ctypedef CUmemGenericAllocationHandle_v1 CUmemGenericAllocationHandle +cdef extern from 'cuda.h': + cdef struct CUasyncNotificationInfo_st: + CUasyncNotificationType type + cuda_bindings_driver__anon_pod2 info + ctypedef CUasyncNotificationInfo_st CUasyncNotificationInfo - cdef enum CUmemAllocationHandleType_enum: - CU_MEM_HANDLE_TYPE_NONE = 0 - CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR = 1 - CU_MEM_HANDLE_TYPE_WIN32 = 2 - CU_MEM_HANDLE_TYPE_WIN32_KMT = 4 - CU_MEM_HANDLE_TYPE_FABRIC = 8 - CU_MEM_HANDLE_TYPE_MAX = 2147483647 +cdef extern from 'cuda.h': + ctypedef CUDA_HOST_NODE_PARAMS_v1 CUDA_HOST_NODE_PARAMS 'CUDA_HOST_NODE_PARAMS' - ctypedef CUmemAllocationHandleType_enum CUmemAllocationHandleType - cdef enum CUmemAccess_flags_enum: - CU_MEM_ACCESS_FLAGS_PROT_NONE = 0 - CU_MEM_ACCESS_FLAGS_PROT_READ = 1 - CU_MEM_ACCESS_FLAGS_PROT_READWRITE = 3 - CU_MEM_ACCESS_FLAGS_PROT_MAX = 2147483647 +cdef extern from 'cuda.h': + ctypedef CUDA_ARRAY_SPARSE_PROPERTIES_v1 CUDA_ARRAY_SPARSE_PROPERTIES 'CUDA_ARRAY_SPARSE_PROPERTIES' - ctypedef CUmemAccess_flags_enum CUmemAccess_flags - 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 - CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT = 4 - CU_MEM_LOCATION_TYPE_INVISIBLE = 5 - CU_MEM_LOCATION_TYPE_MAX = 2147483647 +cdef extern from 'cuda.h': + cdef struct CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: + CUexternalMemoryHandleType type + cuda_bindings_driver__anon_pod17 handle + unsigned long long size + unsigned int flags + unsigned int reserved[16] + ctypedef CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1 - ctypedef CUmemLocationType_enum CUmemLocationType +cdef extern from 'cuda.h': + cdef struct CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: + CUexternalSemaphoreHandleType type + cuda_bindings_driver__anon_pod19 handle + unsigned int flags + unsigned int reserved[16] + ctypedef CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1 - 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 +cdef extern from 'cuda.h': + cdef struct CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st: + cuda_bindings_driver__anon_pod21 params + unsigned int flags + unsigned int reserved[16] + ctypedef CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1 - ctypedef CUmemAllocationType_enum CUmemAllocationType +cdef extern from 'cuda.h': + cdef struct CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st: + cuda_bindings_driver__anon_pod25 params + unsigned int flags + unsigned int reserved[16] + ctypedef CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1 - cdef enum CUmemAllocationGranularity_flags_enum: - CU_MEM_ALLOC_GRANULARITY_MINIMUM = 0 - CU_MEM_ALLOC_GRANULARITY_RECOMMENDED = 1 +cdef extern from 'cuda.h': + ctypedef CUmemLocation_v1 CUmemLocation 'CUmemLocation' - ctypedef CUmemAllocationGranularity_flags_enum CUmemAllocationGranularity_flags - cdef enum CUmemRangeHandleType_enum: - CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD = 1 - CU_MEM_RANGE_HANDLE_TYPE_MAX = 2147483647 +cdef extern from 'cuda.h': + cdef union CUstreamBatchMemOpParams_union: + CUstreamBatchMemOpType operation + CUstreamMemOpWaitValueParams_st waitValue + CUstreamMemOpWriteValueParams_st writeValue + CUstreamMemOpFlushRemoteWritesParams_st flushRemoteWrites + CUstreamMemOpMemoryBarrierParams_st memoryBarrier + CUstreamMemOpAtomicReductionParams_st atomicReduction + cuuint64_t pad[6] + ctypedef CUstreamBatchMemOpParams_union CUstreamBatchMemOpParams_v1 - ctypedef CUmemRangeHandleType_enum CUmemRangeHandleType +cdef extern from 'cuda.h': + ctypedef CUDA_MEMSET_NODE_PARAMS_v1 CUDA_MEMSET_NODE_PARAMS 'CUDA_MEMSET_NODE_PARAMS' - cdef enum CUmemRangeFlags_enum: - CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE = 1 - ctypedef CUmemRangeFlags_enum CUmemRangeFlags +cdef extern from 'cuda.h': + ctypedef CUDA_MEMCPY2D_v2 CUDA_MEMCPY2D 'CUDA_MEMCPY2D' - cdef enum CUarraySparseSubresourceType_enum: - CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL = 0 - CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL = 1 - ctypedef CUarraySparseSubresourceType_enum CUarraySparseSubresourceType +cdef extern from 'cuda.h': + ctypedef CUDA_MEMCPY3D_v2 CUDA_MEMCPY3D 'CUDA_MEMCPY3D' - cdef enum CUmemOperationType_enum: - CU_MEM_OPERATION_TYPE_MAP = 1 - CU_MEM_OPERATION_TYPE_UNMAP = 2 - ctypedef CUmemOperationType_enum CUmemOperationType +cdef extern from 'cuda.h': + ctypedef CUDA_MEMCPY3D_PEER_v1 CUDA_MEMCPY3D_PEER 'CUDA_MEMCPY3D_PEER' - cdef enum CUmemHandleType_enum: - CU_MEM_HANDLE_TYPE_GENERIC = 0 - ctypedef CUmemHandleType_enum CUmemHandleType +cdef union cuda_bindings_driver__anon_pod11: + cuda_bindings_driver__anon_pod12 array + cuda_bindings_driver__anon_pod13 mipmap + cuda_bindings_driver__anon_pod14 linear + cuda_bindings_driver__anon_pod15 pitch2D + cuda_bindings_driver__anon_pod16 reserved - cdef union anon_union9: - CUmipmappedArray mipmap - CUarray array - - cdef struct anon_struct20: - unsigned int level - unsigned int layer - unsigned int offsetX - unsigned int offsetY - unsigned int offsetZ - unsigned int extentWidth - unsigned int extentHeight - unsigned int extentDepth - - cdef struct anon_struct21: - unsigned int layer - unsigned long long offset - unsigned long long size +cdef extern from 'cuda.h': + cdef struct CUexecAffinityParam_st: + CUexecAffinityType type + cuda_bindings_driver__anon_pod9 param + ctypedef CUexecAffinityParam_st CUexecAffinityParam_v1 - cdef union anon_union10: - anon_struct20 sparseLevel - anon_struct21 miptail +cdef extern from 'cuda.h': + ctypedef CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1 CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC' - cdef union anon_union11: - CUmemGenericAllocationHandle memHandle +cdef extern from 'cuda.h': cdef struct CUarrayMapInfo_st: CUresourcetype resourceType - anon_union9 resource + cuda_bindings_driver__anon_pod29 resource CUarraySparseSubresourceType subresourceType - anon_union10 subresource + cuda_bindings_driver__anon_pod30 subresource CUmemOperationType memOperationType CUmemHandleType memHandleType - anon_union11 memHandle + cuda_bindings_driver__anon_pod33 memHandle unsigned long long offset unsigned int deviceBitMask unsigned int flags unsigned int reserved[2] - ctypedef CUarrayMapInfo_st CUarrayMapInfo_v1 - ctypedef CUarrayMapInfo_v1 CUarrayMapInfo +cdef extern from 'cuda.h': + ctypedef CUlaunchAttributeValue CUkernelNodeAttrValue_v1 'CUkernelNodeAttrValue_v1' - cdef struct CUmemLocation_st: - CUmemLocationType type - int id - ctypedef CUmemLocation_st CUmemLocation_v1 +cdef extern from 'cuda.h': + ctypedef CUlaunchAttributeValue CUstreamAttrValue_v1 'CUstreamAttrValue_v1' - ctypedef CUmemLocation_v1 CUmemLocation - cdef enum CUmemAllocationCompType_enum: - CU_MEM_ALLOCATION_COMP_NONE = 0 - CU_MEM_ALLOCATION_COMP_GENERIC = 1 +cdef extern from 'cuda.h': + cdef struct CUlaunchAttribute_st: + CUlaunchAttributeID id + CUlaunchAttributeValue value + ctypedef CUlaunchAttribute_st CUlaunchAttribute - ctypedef CUmemAllocationCompType_enum CUmemAllocationCompType +cdef extern from 'cuda.h': + ctypedef void (*CUasyncCallback 'CUasyncCallback')( + CUasyncNotificationInfo* info, + void* userData, + CUasyncCallbackHandle callback + ) - cdef struct anon_struct22: - unsigned char compressionType - unsigned char gpuDirectRDMACapable - unsigned short usage - unsigned char reserved[4] - cdef struct CUmemAllocationProp_st: - CUmemAllocationType type - CUmemAllocationHandleType requestedHandleTypes - CUmemLocation location - void* win32HandleMetaData - anon_struct22 allocFlags +cdef extern from 'cuda.h': + ctypedef CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1 CUDA_EXTERNAL_MEMORY_HANDLE_DESC 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC' - ctypedef CUmemAllocationProp_st CUmemAllocationProp_v1 - ctypedef CUmemAllocationProp_v1 CUmemAllocationProp +cdef extern from 'cuda.h': + ctypedef CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1 CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC' - cdef enum CUmulticastGranularity_flags_enum: - CU_MULTICAST_GRANULARITY_MINIMUM = 0 - CU_MULTICAST_GRANULARITY_RECOMMENDED = 1 - ctypedef CUmulticastGranularity_flags_enum CUmulticastGranularity_flags +cdef extern from 'cuda.h': + ctypedef CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1 CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS' - cdef struct CUmulticastObjectProp_st: - unsigned int numDevices - size_t size - unsigned long long handleTypes - unsigned long long flags - ctypedef CUmulticastObjectProp_st CUmulticastObjectProp_v1 +cdef extern from 'cuda.h': + ctypedef CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1 CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS' - ctypedef CUmulticastObjectProp_v1 CUmulticastObjectProp +cdef extern from 'cuda.h': + cdef struct CUmemAllocationProp_st: + CUmemAllocationType type + CUmemAllocationHandleType requestedHandleTypes + CUmemLocation location + void* win32HandleMetaData + cuda_bindings_driver__anon_pod35 allocFlags + ctypedef CUmemAllocationProp_st CUmemAllocationProp_v1 + +cdef extern from 'cuda.h': cdef struct CUmemAccessDesc_st: CUmemLocation location CUmemAccess_flags flags - ctypedef CUmemAccessDesc_st CUmemAccessDesc_v1 - ctypedef CUmemAccessDesc_v1 CUmemAccessDesc - - cdef enum CUgraphExecUpdateResult_enum: - CU_GRAPH_EXEC_UPDATE_SUCCESS = 0 - CU_GRAPH_EXEC_UPDATE_ERROR = 1 - CU_GRAPH_EXEC_UPDATE_ERROR_TOPOLOGY_CHANGED = 2 - CU_GRAPH_EXEC_UPDATE_ERROR_NODE_TYPE_CHANGED = 3 - CU_GRAPH_EXEC_UPDATE_ERROR_FUNCTION_CHANGED = 4 - CU_GRAPH_EXEC_UPDATE_ERROR_PARAMETERS_CHANGED = 5 - CU_GRAPH_EXEC_UPDATE_ERROR_NOT_SUPPORTED = 6 - CU_GRAPH_EXEC_UPDATE_ERROR_UNSUPPORTED_FUNCTION_CHANGE = 7 - CU_GRAPH_EXEC_UPDATE_ERROR_ATTRIBUTES_CHANGED = 8 - - ctypedef CUgraphExecUpdateResult_enum CUgraphExecUpdateResult - - cdef struct CUgraphExecUpdateResultInfo_st: - CUgraphExecUpdateResult result - CUgraphNode errorNode - CUgraphNode errorFromNode - - ctypedef CUgraphExecUpdateResultInfo_st CUgraphExecUpdateResultInfo_v1 - - ctypedef CUgraphExecUpdateResultInfo_v1 CUgraphExecUpdateResultInfo - - cdef enum CUmemPool_attribute_enum: - CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES = 1 - CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC = 2 - CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES = 3 - CU_MEMPOOL_ATTR_RELEASE_THRESHOLD = 4 - CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT = 5 - CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH = 6 - CU_MEMPOOL_ATTR_USED_MEM_CURRENT = 7 - CU_MEMPOOL_ATTR_USED_MEM_HIGH = 8 - CU_MEMPOOL_ATTR_ALLOCATION_TYPE = 9 - CU_MEMPOOL_ATTR_EXPORT_HANDLE_TYPES = 10 - CU_MEMPOOL_ATTR_LOCATION_ID = 11 - CU_MEMPOOL_ATTR_LOCATION_TYPE = 12 - CU_MEMPOOL_ATTR_MAX_POOL_SIZE = 13 - CU_MEMPOOL_ATTR_HW_DECOMPRESS_ENABLED = 14 - - ctypedef CUmemPool_attribute_enum CUmemPool_attribute - +cdef extern from 'cuda.h': cdef struct CUmemPoolProps_st: CUmemAllocationType allocType CUmemAllocationHandleType handleTypes @@ -2181,568 +2823,268 @@ cdef extern from "cuda.h": size_t maxSize unsigned short usage unsigned char reserved[54] - ctypedef CUmemPoolProps_st CUmemPoolProps_v1 - ctypedef CUmemPoolProps_v1 CUmemPoolProps - - cdef struct CUmemPoolPtrExportData_st: - unsigned char reserved[64] - - ctypedef CUmemPoolPtrExportData_st CUmemPoolPtrExportData_v1 - - ctypedef CUmemPoolPtrExportData_v1 CUmemPoolPtrExportData - - cdef enum CUmemcpyFlags_enum: - CU_MEMCPY_FLAG_DEFAULT = 0 - CU_MEMCPY_FLAG_PREFER_OVERLAP_WITH_COMPUTE = 1 - - ctypedef CUmemcpyFlags_enum CUmemcpyFlags - - cdef enum CUmemcpySrcAccessOrder_enum: - CU_MEMCPY_SRC_ACCESS_ORDER_INVALID = 0 - CU_MEMCPY_SRC_ACCESS_ORDER_STREAM = 1 - CU_MEMCPY_SRC_ACCESS_ORDER_DURING_API_CALL = 2 - CU_MEMCPY_SRC_ACCESS_ORDER_ANY = 3 - CU_MEMCPY_SRC_ACCESS_ORDER_MAX = 2147483647 - - ctypedef CUmemcpySrcAccessOrder_enum CUmemcpySrcAccessOrder - - cdef struct CUmemcpyAttributes_st: - CUmemcpySrcAccessOrder srcAccessOrder - CUmemLocation srcLocHint - CUmemLocation dstLocHint - unsigned int flags - - ctypedef CUmemcpyAttributes_st CUmemcpyAttributes_v1 - - ctypedef CUmemcpyAttributes_v1 CUmemcpyAttributes - - cdef enum CUmemcpy3DOperandType_enum: - CU_MEMCPY_OPERAND_TYPE_POINTER = 1 - CU_MEMCPY_OPERAND_TYPE_ARRAY = 2 - CU_MEMCPY_OPERAND_TYPE_MAX = 2147483647 - - ctypedef CUmemcpy3DOperandType_enum CUmemcpy3DOperandType - - cdef struct CUoffset3D_st: - size_t x - size_t y - size_t z - - ctypedef CUoffset3D_st CUoffset3D_v1 - - ctypedef CUoffset3D_v1 CUoffset3D - - cdef struct CUextent3D_st: - size_t width - size_t height - size_t depth - - ctypedef CUextent3D_st CUextent3D_v1 - - ctypedef CUextent3D_v1 CUextent3D - - cdef struct anon_struct23: - CUdeviceptr ptr - size_t rowLength - size_t layerHeight - CUmemLocation locHint - - cdef struct anon_struct24: - CUarray array - CUoffset3D offset - - cdef union anon_union13: - anon_struct23 ptr - anon_struct24 array - - cdef struct CUmemcpy3DOperand_st: - CUmemcpy3DOperandType type - anon_union13 op - - ctypedef CUmemcpy3DOperand_st CUmemcpy3DOperand_v1 - - ctypedef CUmemcpy3DOperand_v1 CUmemcpy3DOperand - - cdef struct CUDA_MEMCPY3D_BATCH_OP_st: - CUmemcpy3DOperand src - CUmemcpy3DOperand dst - CUextent3D extent - CUmemcpySrcAccessOrder srcAccessOrder - unsigned int flags - - ctypedef CUDA_MEMCPY3D_BATCH_OP_st CUDA_MEMCPY3D_BATCH_OP_v1 - - ctypedef CUDA_MEMCPY3D_BATCH_OP_v1 CUDA_MEMCPY3D_BATCH_OP - - cdef struct CUDA_MEM_ALLOC_NODE_PARAMS_v1_st: - CUmemPoolProps poolProps - const CUmemAccessDesc* accessDescs - size_t accessDescCount - size_t bytesize - CUdeviceptr dptr - - ctypedef CUDA_MEM_ALLOC_NODE_PARAMS_v1_st CUDA_MEM_ALLOC_NODE_PARAMS_v1 - - ctypedef CUDA_MEM_ALLOC_NODE_PARAMS_v1 CUDA_MEM_ALLOC_NODE_PARAMS - - cdef struct CUDA_MEM_ALLOC_NODE_PARAMS_v2_st: - CUmemPoolProps poolProps - const CUmemAccessDesc* accessDescs - size_t accessDescCount - size_t bytesize - CUdeviceptr dptr - - ctypedef CUDA_MEM_ALLOC_NODE_PARAMS_v2_st CUDA_MEM_ALLOC_NODE_PARAMS_v2 - - cdef struct CUDA_MEM_FREE_NODE_PARAMS_st: - CUdeviceptr dptr - - ctypedef CUDA_MEM_FREE_NODE_PARAMS_st CUDA_MEM_FREE_NODE_PARAMS - - cdef enum CUgraphMem_attribute_enum: - CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT = 0 - CU_GRAPH_MEM_ATTR_USED_MEM_HIGH = 1 - CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT = 2 - CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH = 3 - - ctypedef CUgraphMem_attribute_enum CUgraphMem_attribute - - cdef enum CUgraphChildGraphNodeOwnership_enum: - CU_GRAPH_CHILD_GRAPH_OWNERSHIP_INVALID = -1 - CU_GRAPH_CHILD_GRAPH_OWNERSHIP_CLONE = 0 - CU_GRAPH_CHILD_GRAPH_OWNERSHIP_MOVE = 1 - - ctypedef CUgraphChildGraphNodeOwnership_enum CUgraphChildGraphNodeOwnership - - cdef struct CUDA_CHILD_GRAPH_NODE_PARAMS_st: - CUgraph graph - CUgraphChildGraphNodeOwnership ownership - - ctypedef CUDA_CHILD_GRAPH_NODE_PARAMS_st CUDA_CHILD_GRAPH_NODE_PARAMS - - cdef struct CUDA_EVENT_RECORD_NODE_PARAMS_st: - CUevent event - - ctypedef CUDA_EVENT_RECORD_NODE_PARAMS_st CUDA_EVENT_RECORD_NODE_PARAMS - - cdef struct CUDA_EVENT_WAIT_NODE_PARAMS_st: - CUevent event - - ctypedef CUDA_EVENT_WAIT_NODE_PARAMS_st CUDA_EVENT_WAIT_NODE_PARAMS - - cdef struct CUgraphNodeParams_st: - CUgraphNodeType type - int reserved0[3] - long long reserved1[29] - CUDA_KERNEL_NODE_PARAMS_v3 kernel - CUDA_MEMCPY_NODE_PARAMS memcpy - CUDA_MEMSET_NODE_PARAMS_v2 memset - CUDA_HOST_NODE_PARAMS_v2 host - CUDA_CHILD_GRAPH_NODE_PARAMS graph - CUDA_EVENT_WAIT_NODE_PARAMS eventWait - CUDA_EVENT_RECORD_NODE_PARAMS eventRecord - CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 extSemSignal - CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 extSemWait - CUDA_MEM_ALLOC_NODE_PARAMS_v2 alloc - CUDA_MEM_FREE_NODE_PARAMS free - CUDA_BATCH_MEM_OP_NODE_PARAMS_v2 memOp - CUDA_CONDITIONAL_NODE_PARAMS conditional - long long reserved2 - - ctypedef CUgraphNodeParams_st CUgraphNodeParams - - cdef enum CUflushGPUDirectRDMAWritesOptions_enum: - CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_HOST = 1 - CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_MEMOPS = 2 - - ctypedef CUflushGPUDirectRDMAWritesOptions_enum CUflushGPUDirectRDMAWritesOptions - - cdef enum CUGPUDirectRDMAWritesOrdering_enum: - CU_GPU_DIRECT_RDMA_WRITES_ORDERING_NONE = 0 - CU_GPU_DIRECT_RDMA_WRITES_ORDERING_OWNER = 100 - CU_GPU_DIRECT_RDMA_WRITES_ORDERING_ALL_DEVICES = 200 - - ctypedef CUGPUDirectRDMAWritesOrdering_enum CUGPUDirectRDMAWritesOrdering +cdef extern from 'cuda.h': + cdef struct CUmemcpyAttributes_st: + CUmemcpySrcAccessOrder srcAccessOrder + CUmemLocation srcLocHint + CUmemLocation dstLocHint + unsigned int flags + ctypedef CUmemcpyAttributes_st CUmemcpyAttributes_v1 - cdef enum CUflushGPUDirectRDMAWritesScope_enum: - CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_OWNER = 100 - CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_ALL_DEVICES = 200 +cdef struct cuda_bindings_driver__anon_pod37: + CUdeviceptr ptr + size_t rowLength + size_t layerHeight + CUmemLocation locHint - ctypedef CUflushGPUDirectRDMAWritesScope_enum CUflushGPUDirectRDMAWritesScope +cdef extern from 'cuda.h': + ctypedef CUstreamBatchMemOpParams_v1 CUstreamBatchMemOpParams 'CUstreamBatchMemOpParams' - cdef enum CUflushGPUDirectRDMAWritesTarget_enum: - CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TARGET_CURRENT_CTX = 0 - ctypedef CUflushGPUDirectRDMAWritesTarget_enum CUflushGPUDirectRDMAWritesTarget +cdef extern from 'cuda.h': + cdef struct CUDA_MEMCPY_NODE_PARAMS_st: + int flags + int reserved + CUcontext copyCtx + CUDA_MEMCPY3D copyParams + ctypedef CUDA_MEMCPY_NODE_PARAMS_st CUDA_MEMCPY_NODE_PARAMS - cdef enum CUgraphDebugDot_flags_enum: - CU_GRAPH_DEBUG_DOT_FLAGS_VERBOSE = 1 - CU_GRAPH_DEBUG_DOT_FLAGS_RUNTIME_TYPES = 2 - CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_PARAMS = 4 - CU_GRAPH_DEBUG_DOT_FLAGS_MEMCPY_NODE_PARAMS = 8 - CU_GRAPH_DEBUG_DOT_FLAGS_MEMSET_NODE_PARAMS = 16 - CU_GRAPH_DEBUG_DOT_FLAGS_HOST_NODE_PARAMS = 32 - CU_GRAPH_DEBUG_DOT_FLAGS_EVENT_NODE_PARAMS = 64 - CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_SIGNAL_NODE_PARAMS = 128 - CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_WAIT_NODE_PARAMS = 256 - CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_ATTRIBUTES = 512 - CU_GRAPH_DEBUG_DOT_FLAGS_HANDLES = 1024 - CU_GRAPH_DEBUG_DOT_FLAGS_MEM_ALLOC_NODE_PARAMS = 2048 - CU_GRAPH_DEBUG_DOT_FLAGS_MEM_FREE_NODE_PARAMS = 4096 - CU_GRAPH_DEBUG_DOT_FLAGS_BATCH_MEM_OP_NODE_PARAMS = 8192 - CU_GRAPH_DEBUG_DOT_FLAGS_EXTRA_TOPO_INFO = 16384 - CU_GRAPH_DEBUG_DOT_FLAGS_CONDITIONAL_NODE_PARAMS = 32768 +cdef extern from 'cuda.h': + cdef struct CUDA_RESOURCE_DESC_st: + CUresourcetype resType + cuda_bindings_driver__anon_pod11 res + unsigned int flags + ctypedef CUDA_RESOURCE_DESC_st CUDA_RESOURCE_DESC_v1 - ctypedef CUgraphDebugDot_flags_enum CUgraphDebugDot_flags +cdef extern from 'cuda.h': + cdef struct CUdevResource_st: + CUdevResourceType type + unsigned char _internal_padding[92] + CUdevSmResource sm + CUdevWorkqueueConfigResource wqConfig + CUdevWorkqueueResource wq + unsigned char _oversize[40] + CUdevResource_st* nextResource + ctypedef CUdevResource_st CUdevResource_v1 - cdef enum CUuserObject_flags_enum: - CU_USER_OBJECT_NO_DESTRUCTOR_SYNC = 1 +cdef extern from 'cuda.h': + cdef struct CUlogicalEndpointProp_struct: + CUlogicalEndpointType type + cuda_bindings_driver__anon_pod42 unicast + cuda_bindings_driver__anon_pod43 multicast + unsigned long long size + unsigned int ipcHandleTypes + unsigned int flags + ctypedef CUlogicalEndpointProp_struct CUlogicalEndpointProp - ctypedef CUuserObject_flags_enum CUuserObject_flags +cdef extern from 'cuda.h': + ctypedef CUexecAffinityParam_v1 CUexecAffinityParam 'CUexecAffinityParam' - cdef enum CUuserObjectRetain_flags_enum: - CU_GRAPH_USER_OBJECT_MOVE = 1 - ctypedef CUuserObjectRetain_flags_enum CUuserObjectRetain_flags +cdef extern from 'cuda.h': + ctypedef CUarrayMapInfo_v1 CUarrayMapInfo 'CUarrayMapInfo' - cdef enum CUgraphInstantiate_flags_enum: - CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH = 1 - CUDA_GRAPH_INSTANTIATE_FLAG_UPLOAD = 2 - CUDA_GRAPH_INSTANTIATE_FLAG_DEVICE_LAUNCH = 4 - CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY = 8 - ctypedef CUgraphInstantiate_flags_enum CUgraphInstantiate_flags +cdef extern from 'cuda.h': + ctypedef CUkernelNodeAttrValue_v1 CUkernelNodeAttrValue 'CUkernelNodeAttrValue' - cdef enum CUdeviceNumaConfig_enum: - CU_DEVICE_NUMA_CONFIG_NONE = 0 - CU_DEVICE_NUMA_CONFIG_NUMA_NODE = 1 - ctypedef CUdeviceNumaConfig_enum CUdeviceNumaConfig +cdef extern from 'cuda.h': + ctypedef CUstreamAttrValue_v1 CUstreamAttrValue 'CUstreamAttrValue' - cdef enum CUprocessState_enum: - CU_PROCESS_STATE_RUNNING = 0 - CU_PROCESS_STATE_LOCKED = 1 - CU_PROCESS_STATE_CHECKPOINTED = 2 - CU_PROCESS_STATE_FAILED = 3 - ctypedef CUprocessState_enum CUprocessState +cdef extern from 'cuda.h': + cdef struct CUlaunchConfig_st: + unsigned int gridDimX + unsigned int gridDimY + unsigned int gridDimZ + unsigned int blockDimX + unsigned int blockDimY + unsigned int blockDimZ + unsigned int sharedMemBytes + CUstream hStream + CUlaunchAttribute* attrs + unsigned int numAttrs + ctypedef CUlaunchConfig_st CUlaunchConfig - cdef struct CUcheckpointLockArgs_st: - unsigned int timeoutMs - unsigned int reserved0 - cuuint64_t reserved1[7] +cdef extern from 'cuda.h': + cdef struct CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st: + CUexternalSemaphore* extSemArray + CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* paramsArray + unsigned int numExtSems + ctypedef CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1 - ctypedef CUcheckpointLockArgs_st CUcheckpointLockArgs +cdef extern from 'cuda.h': + cdef struct CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: + CUexternalSemaphore* extSemArray + CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* paramsArray + unsigned int numExtSems + ctypedef CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 - cdef struct CUcheckpointCheckpointArgs_st: - cuuint64_t reserved[8] +cdef extern from 'cuda.h': + cdef struct CUDA_EXT_SEM_WAIT_NODE_PARAMS_st: + CUexternalSemaphore* extSemArray + CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* paramsArray + unsigned int numExtSems + ctypedef CUDA_EXT_SEM_WAIT_NODE_PARAMS_st CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1 - ctypedef CUcheckpointCheckpointArgs_st CUcheckpointCheckpointArgs +cdef extern from 'cuda.h': + cdef struct CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st: + CUexternalSemaphore* extSemArray + CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* paramsArray + unsigned int numExtSems + ctypedef CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 - cdef struct CUcheckpointGpuPair_st: - CUuuid oldUuid - CUuuid newUuid +cdef extern from 'cuda.h': + ctypedef CUmemAllocationProp_v1 CUmemAllocationProp 'CUmemAllocationProp' - ctypedef CUcheckpointGpuPair_st CUcheckpointGpuPair - cdef struct CUcheckpointRestoreArgs_st: - CUcheckpointGpuPair* gpuPairs - unsigned int gpuPairsCount - char reserved[44] - cuuint64_t reserved1 +cdef extern from 'cuda.h': + ctypedef CUmemAccessDesc_v1 CUmemAccessDesc 'CUmemAccessDesc' - ctypedef CUcheckpointRestoreArgs_st CUcheckpointRestoreArgs - cdef struct CUcheckpointUnlockArgs_st: - cuuint64_t reserved[8] +cdef extern from 'cuda.h': + ctypedef CUmemPoolProps_v1 CUmemPoolProps 'CUmemPoolProps' - ctypedef CUcheckpointUnlockArgs_st CUcheckpointUnlockArgs - cdef enum CUmoduleLoadingMode_enum: - CU_MODULE_EAGER_LOADING = 1 - CU_MODULE_LAZY_LOADING = 2 +cdef extern from 'cuda.h': + ctypedef CUmemcpyAttributes_v1 CUmemcpyAttributes 'CUmemcpyAttributes' - ctypedef CUmoduleLoadingMode_enum CUmoduleLoadingMode - cdef enum CUmemDecompressAlgorithm_enum: - CU_MEM_DECOMPRESS_UNSUPPORTED = 0 - CU_MEM_DECOMPRESS_ALGORITHM_DEFLATE = 1 - CU_MEM_DECOMPRESS_ALGORITHM_SNAPPY = 2 - CU_MEM_DECOMPRESS_ALGORITHM_LZ4 = 4 +cdef union cuda_bindings_driver__anon_pod36: + cuda_bindings_driver__anon_pod37 ptr + cuda_bindings_driver__anon_pod38 array - ctypedef CUmemDecompressAlgorithm_enum CUmemDecompressAlgorithm +cdef extern from 'cuda.h': + cdef struct CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st: + CUcontext ctx + unsigned int count + CUstreamBatchMemOpParams* paramArray + unsigned int flags + ctypedef CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st CUDA_BATCH_MEM_OP_NODE_PARAMS_v1 - cdef struct CUmemDecompressParams_st: - size_t srcNumBytes - size_t dstNumBytes - cuuint32_t* dstActBytes - const void* src - void* dst - CUmemDecompressAlgorithm algo - unsigned char padding[20] +cdef extern from 'cuda.h': + cdef struct CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st: + CUcontext ctx + unsigned int count + CUstreamBatchMemOpParams* paramArray + unsigned int flags + ctypedef CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st CUDA_BATCH_MEM_OP_NODE_PARAMS_v2 - ctypedef CUmemDecompressParams_st CUmemDecompressParams +cdef extern from 'cuda.h': + ctypedef CUDA_RESOURCE_DESC_v1 CUDA_RESOURCE_DESC 'CUDA_RESOURCE_DESC' - cdef enum CUfunctionLoadingState_enum: - CU_FUNCTION_LOADING_STATE_UNLOADED = 0 - CU_FUNCTION_LOADING_STATE_LOADED = 1 - CU_FUNCTION_LOADING_STATE_MAX = 2 - ctypedef CUfunctionLoadingState_enum CUfunctionLoadingState +cdef extern from 'cuda.h': + ctypedef CUdevResource_v1 CUdevResource 'CUdevResource' - cdef enum CUcoredumpSettings_enum: - CU_COREDUMP_ENABLE_ON_EXCEPTION = 1 - CU_COREDUMP_TRIGGER_HOST = 2 - CU_COREDUMP_LIGHTWEIGHT = 3 - CU_COREDUMP_ENABLE_USER_TRIGGER = 4 - CU_COREDUMP_FILE = 5 - CU_COREDUMP_PIPE = 6 - CU_COREDUMP_GENERATION_FLAGS = 7 - CU_COREDUMP_MAX = 8 - ctypedef CUcoredumpSettings_enum CUcoredumpSettings +cdef extern from 'cuda.h': + cdef struct CUctxCreateParams_st: + CUexecAffinityParam* execAffinityParams + int numExecAffinityParams + CUctxCigParam* cigParams + ctypedef CUctxCreateParams_st CUctxCreateParams - cdef enum CUCoredumpGenerationFlags: - CU_COREDUMP_DEFAULT_FLAGS = 0 - CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES = 1 - CU_COREDUMP_SKIP_GLOBAL_MEMORY = 2 - CU_COREDUMP_SKIP_SHARED_MEMORY = 4 - CU_COREDUMP_SKIP_LOCAL_MEMORY = 8 - CU_COREDUMP_SKIP_ABORT = 16 - CU_COREDUMP_SKIP_CONSTBANK_MEMORY = 32 - CU_COREDUMP_LIGHTWEIGHT_FLAGS = 47 - CU_COREDUMP_GZIP_COMPRESS = 64 - - cdef struct CUcoredumpCallbackEntry_st: - pass - ctypedef CUcoredumpCallbackEntry_st* CUcoredumpCallbackHandle +cdef extern from 'cuda.h': + ctypedef CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1 CUDA_EXT_SEM_SIGNAL_NODE_PARAMS 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS' - ctypedef void (*CUcoredumpStatusCallback)(void* userData, int pid, CUdevice dev) - cdef struct CUdevResourceDesc_st: - pass - ctypedef CUdevResourceDesc_st* CUdevResourceDesc +cdef extern from 'cuda.h': + ctypedef CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1 CUDA_EXT_SEM_WAIT_NODE_PARAMS 'CUDA_EXT_SEM_WAIT_NODE_PARAMS' - ctypedef enum CUgreenCtxCreate_flags: - CU_GREEN_CTX_DEFAULT_STREAM = 1 - ctypedef enum CUdevSmResourceGroup_flags: - CU_DEV_SM_RESOURCE_GROUP_DEFAULT = 0 - CU_DEV_SM_RESOURCE_GROUP_BACKFILL = 1 +cdef extern from 'cuda.h': + cdef struct CUDA_MEM_ALLOC_NODE_PARAMS_v1_st: + CUmemPoolProps poolProps + CUmemAccessDesc* accessDescs + size_t accessDescCount + size_t bytesize + CUdeviceptr dptr + ctypedef CUDA_MEM_ALLOC_NODE_PARAMS_v1_st CUDA_MEM_ALLOC_NODE_PARAMS_v1 - ctypedef enum CUdevSmResourceSplitByCount_flags: - CU_DEV_SM_RESOURCE_SPLIT_IGNORE_SM_COSCHEDULING = 1 - CU_DEV_SM_RESOURCE_SPLIT_MAX_POTENTIAL_CLUSTER_SIZE = 2 +cdef extern from 'cuda.h': + cdef struct CUDA_MEM_ALLOC_NODE_PARAMS_v2_st: + CUmemPoolProps poolProps + CUmemAccessDesc* accessDescs + size_t accessDescCount + size_t bytesize + CUdeviceptr dptr + ctypedef CUDA_MEM_ALLOC_NODE_PARAMS_v2_st CUDA_MEM_ALLOC_NODE_PARAMS_v2 - ctypedef enum CUdevResourceType: - CU_DEV_RESOURCE_TYPE_INVALID = 0 - CU_DEV_RESOURCE_TYPE_SM = 1 - CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG = 1000 - CU_DEV_RESOURCE_TYPE_WORKQUEUE = 10000 +cdef extern from 'cuda.h': + cdef struct CUmemcpy3DOperand_st: + CUmemcpy3DOperandType type + cuda_bindings_driver__anon_pod36 op + ctypedef CUmemcpy3DOperand_st CUmemcpy3DOperand_v1 - cdef struct CUdevSmResource_st: - unsigned int smCount - unsigned int minSmPartitionSize - unsigned int smCoscheduledAlignment - unsigned int flags +cdef extern from 'cuda.h': + ctypedef CUDA_BATCH_MEM_OP_NODE_PARAMS_v1 CUDA_BATCH_MEM_OP_NODE_PARAMS 'CUDA_BATCH_MEM_OP_NODE_PARAMS' - ctypedef CUdevSmResource_st CUdevSmResource - ctypedef enum CUdevWorkqueueConfigScope: - CU_WORKQUEUE_SCOPE_DEVICE_CTX = 0 - CU_WORKQUEUE_SCOPE_GREEN_CTX_BALANCED = 1 +cdef extern from 'cuda.h': + ctypedef CUDA_MEM_ALLOC_NODE_PARAMS_v1 CUDA_MEM_ALLOC_NODE_PARAMS 'CUDA_MEM_ALLOC_NODE_PARAMS' - cdef struct CUdevWorkqueueConfigResource_st: - CUdevice device - unsigned int wqConcurrencyLimit - CUdevWorkqueueConfigScope sharingScope - ctypedef CUdevWorkqueueConfigResource_st CUdevWorkqueueConfigResource +cdef extern from 'cuda.h': + ctypedef CUmemcpy3DOperand_v1 CUmemcpy3DOperand 'CUmemcpy3DOperand' - cdef struct CUdevWorkqueueResource_st: - unsigned char reserved[40] - ctypedef CUdevWorkqueueResource_st CUdevWorkqueueResource +cdef extern from 'cuda.h': + cdef struct CUgraphNodeParams_st: + CUgraphNodeType type + int reserved0[3] + long long reserved1[29] + CUDA_KERNEL_NODE_PARAMS_v3 kernel + CUDA_MEMCPY_NODE_PARAMS memcpy + CUDA_MEMSET_NODE_PARAMS_v2 memset + CUDA_HOST_NODE_PARAMS_v2 host + CUDA_CHILD_GRAPH_NODE_PARAMS graph + CUDA_EVENT_WAIT_NODE_PARAMS eventWait + CUDA_EVENT_RECORD_NODE_PARAMS eventRecord + CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 extSemSignal + CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 extSemWait + CUDA_MEM_ALLOC_NODE_PARAMS_v2 alloc + CUDA_MEM_FREE_NODE_PARAMS free + CUDA_BATCH_MEM_OP_NODE_PARAMS_v2 memOp + CUDA_CONDITIONAL_NODE_PARAMS conditional + char asBytes[232] + long long reserved2 + ctypedef CUgraphNodeParams_st CUgraphNodeParams - cdef struct CU_DEV_SM_RESOURCE_GROUP_PARAMS_st: - unsigned int smCount - unsigned int coscheduledSmCount - unsigned int preferredCoscheduledSmCount +cdef extern from 'cuda.h': + cdef struct CUDA_MEMCPY3D_BATCH_OP_st: + CUmemcpy3DOperand src + CUmemcpy3DOperand dst + CUextent3D extent + CUmemcpySrcAccessOrder srcAccessOrder unsigned int flags - unsigned int reserved[12] - - ctypedef CU_DEV_SM_RESOURCE_GROUP_PARAMS_st CU_DEV_SM_RESOURCE_GROUP_PARAMS + ctypedef CUDA_MEMCPY3D_BATCH_OP_st CUDA_MEMCPY3D_BATCH_OP_v1 - cdef struct CUdevResource_st: - CUdevResourceType type - unsigned char _internal_padding[92] - CUdevSmResource sm - CUdevWorkqueueConfigResource wqConfig - CUdevWorkqueueResource wq - unsigned char _oversize[40] - CUdevResource_st* nextResource +cdef extern from 'cuda.h': + ctypedef CUresult (*CUgraphRecaptureCallback 'CUgraphRecaptureCallback')( + void* data, + CUgraphNode node, + const CUgraphNodeParams* originalParams, + const CUgraphNodeParams* recaptureParams, + CUgraphRecaptureStatus status + ) - ctypedef CUdevResource_st CUdevResource_v1 - ctypedef CUdevResource_v1 CUdevResource +cdef extern from 'cuda.h': + ctypedef CUDA_MEMCPY3D_BATCH_OP_v1 CUDA_MEMCPY3D_BATCH_OP 'CUDA_MEMCPY3D_BATCH_OP' - cdef enum CUlogLevel_enum: - CU_LOG_LEVEL_ERROR = 0 - CU_LOG_LEVEL_WARNING = 1 - ctypedef CUlogLevel_enum CUlogLevel - cdef struct CUlogsCallbackEntry_st: +# Defining the types here in this way is not necessary to work, but we need to +# define them as 'cdef extern from ""' to be ABI-backward-compatible with the +# old cython-gen based bindings. +cdef extern from "": + cdef struct CUeglStreamConnection_st: pass - ctypedef CUlogsCallbackEntry_st* CUlogsCallbackHandle - - ctypedef void (*CUlogsCallback)(void* data, CUlogLevel logLevel, char* message, size_t length) - - ctypedef unsigned int CUlogIterator - -cdef extern from "cudaProfiler.h": - - cdef enum CUoutput_mode_enum: - CU_OUT_KEY_VALUE_PAIR = 0 - CU_OUT_CSV = 1 - - ctypedef CUoutput_mode_enum CUoutput_mode - -cdef enum CUeglFrameType_enum: - CU_EGL_FRAME_TYPE_ARRAY = 0 - CU_EGL_FRAME_TYPE_PITCH = 1 - -ctypedef CUeglFrameType_enum CUeglFrameType - -cdef enum CUeglResourceLocationFlags_enum: - CU_EGL_RESOURCE_LOCATION_SYSMEM = 0 - CU_EGL_RESOURCE_LOCATION_VIDMEM = 1 - -ctypedef CUeglResourceLocationFlags_enum CUeglResourceLocationFlags - -cdef enum CUeglColorFormat_enum: - CU_EGL_COLOR_FORMAT_YUV420_PLANAR = 0 - CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR = 1 - CU_EGL_COLOR_FORMAT_YUV422_PLANAR = 2 - CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR = 3 - CU_EGL_COLOR_FORMAT_RGB = 4 - CU_EGL_COLOR_FORMAT_BGR = 5 - CU_EGL_COLOR_FORMAT_ARGB = 6 - CU_EGL_COLOR_FORMAT_RGBA = 7 - CU_EGL_COLOR_FORMAT_L = 8 - CU_EGL_COLOR_FORMAT_R = 9 - CU_EGL_COLOR_FORMAT_YUV444_PLANAR = 10 - CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR = 11 - CU_EGL_COLOR_FORMAT_YUYV_422 = 12 - CU_EGL_COLOR_FORMAT_UYVY_422 = 13 - CU_EGL_COLOR_FORMAT_ABGR = 14 - CU_EGL_COLOR_FORMAT_BGRA = 15 - CU_EGL_COLOR_FORMAT_A = 16 - CU_EGL_COLOR_FORMAT_RG = 17 - CU_EGL_COLOR_FORMAT_AYUV = 18 - CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR = 19 - CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR = 20 - CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR = 21 - CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR = 22 - CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR = 23 - CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR = 24 - CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR = 25 - CU_EGL_COLOR_FORMAT_VYUY_ER = 26 - CU_EGL_COLOR_FORMAT_UYVY_ER = 27 - CU_EGL_COLOR_FORMAT_YUYV_ER = 28 - CU_EGL_COLOR_FORMAT_YVYU_ER = 29 - CU_EGL_COLOR_FORMAT_YUV_ER = 30 - CU_EGL_COLOR_FORMAT_YUVA_ER = 31 - CU_EGL_COLOR_FORMAT_AYUV_ER = 32 - CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER = 33 - CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER = 34 - CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER = 35 - CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER = 36 - CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER = 37 - CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER = 38 - CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER = 39 - CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER = 40 - CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER = 41 - CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER = 42 - CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER = 43 - CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER = 44 - CU_EGL_COLOR_FORMAT_BAYER_RGGB = 45 - CU_EGL_COLOR_FORMAT_BAYER_BGGR = 46 - CU_EGL_COLOR_FORMAT_BAYER_GRBG = 47 - CU_EGL_COLOR_FORMAT_BAYER_GBRG = 48 - CU_EGL_COLOR_FORMAT_BAYER10_RGGB = 49 - CU_EGL_COLOR_FORMAT_BAYER10_BGGR = 50 - CU_EGL_COLOR_FORMAT_BAYER10_GRBG = 51 - CU_EGL_COLOR_FORMAT_BAYER10_GBRG = 52 - CU_EGL_COLOR_FORMAT_BAYER12_RGGB = 53 - CU_EGL_COLOR_FORMAT_BAYER12_BGGR = 54 - CU_EGL_COLOR_FORMAT_BAYER12_GRBG = 55 - CU_EGL_COLOR_FORMAT_BAYER12_GBRG = 56 - CU_EGL_COLOR_FORMAT_BAYER14_RGGB = 57 - CU_EGL_COLOR_FORMAT_BAYER14_BGGR = 58 - CU_EGL_COLOR_FORMAT_BAYER14_GRBG = 59 - CU_EGL_COLOR_FORMAT_BAYER14_GBRG = 60 - CU_EGL_COLOR_FORMAT_BAYER20_RGGB = 61 - CU_EGL_COLOR_FORMAT_BAYER20_BGGR = 62 - CU_EGL_COLOR_FORMAT_BAYER20_GRBG = 63 - CU_EGL_COLOR_FORMAT_BAYER20_GBRG = 64 - CU_EGL_COLOR_FORMAT_YVU444_PLANAR = 65 - CU_EGL_COLOR_FORMAT_YVU422_PLANAR = 66 - CU_EGL_COLOR_FORMAT_YVU420_PLANAR = 67 - CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB = 68 - CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR = 69 - CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG = 70 - CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG = 71 - CU_EGL_COLOR_FORMAT_BAYER_BCCR = 72 - CU_EGL_COLOR_FORMAT_BAYER_RCCB = 73 - CU_EGL_COLOR_FORMAT_BAYER_CRBC = 74 - CU_EGL_COLOR_FORMAT_BAYER_CBRC = 75 - CU_EGL_COLOR_FORMAT_BAYER10_CCCC = 76 - CU_EGL_COLOR_FORMAT_BAYER12_BCCR = 77 - CU_EGL_COLOR_FORMAT_BAYER12_RCCB = 78 - CU_EGL_COLOR_FORMAT_BAYER12_CRBC = 79 - CU_EGL_COLOR_FORMAT_BAYER12_CBRC = 80 - CU_EGL_COLOR_FORMAT_BAYER12_CCCC = 81 - CU_EGL_COLOR_FORMAT_Y = 82 - CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020 = 83 - CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020 = 84 - CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020 = 85 - CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020 = 86 - CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709 = 87 - CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709 = 88 - CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709 = 89 - CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709 = 90 - CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 = 91 - CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 = 92 - CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 = 93 - CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR = 94 - CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709 = 95 - CU_EGL_COLOR_FORMAT_Y_ER = 96 - CU_EGL_COLOR_FORMAT_Y_709_ER = 97 - CU_EGL_COLOR_FORMAT_Y10_ER = 98 - CU_EGL_COLOR_FORMAT_Y10_709_ER = 99 - CU_EGL_COLOR_FORMAT_Y12_ER = 100 - CU_EGL_COLOR_FORMAT_Y12_709_ER = 101 - CU_EGL_COLOR_FORMAT_YUVA = 102 - CU_EGL_COLOR_FORMAT_YUV = 103 - CU_EGL_COLOR_FORMAT_YVYU = 104 - CU_EGL_COLOR_FORMAT_VYUY = 105 - CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER = 106 - CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER = 107 - CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER = 108 - CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER = 109 - CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER = 110 - CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER = 111 - CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER = 112 - CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER = 113 - CU_EGL_COLOR_FORMAT_UYVY_709 = 114 - CU_EGL_COLOR_FORMAT_UYVY_709_ER = 115 - CU_EGL_COLOR_FORMAT_UYVY_2020 = 116 - CU_EGL_COLOR_FORMAT_MAX = 117 - -ctypedef CUeglColorFormat_enum CUeglColorFormat +ctypedef CUeglStreamConnection_st* CUeglStreamConnection cdef union anon_union16: CUarray pArray[3] @@ -2764,11 +3106,6 @@ ctypedef CUeglFrame_st CUeglFrame_v1 ctypedef CUeglFrame_v1 CUeglFrame -cdef extern from "": - cdef struct CUeglStreamConnection_st: - pass -ctypedef CUeglStreamConnection_st* CUeglStreamConnection - cdef enum CUGLDeviceList_enum: CU_GL_DEVICE_LIST_ALL = 1 CU_GL_DEVICE_LIST_CURRENT_FRAME = 2 @@ -2776,2498 +3113,528 @@ cdef enum CUGLDeviceList_enum: ctypedef CUGLDeviceList_enum CUGLDeviceList -cdef enum CUGLmap_flags_enum: - CU_GL_MAP_RESOURCE_FLAGS_NONE = 0 - CU_GL_MAP_RESOURCE_FLAGS_READ_ONLY = 1 - CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD = 2 - -ctypedef CUGLmap_flags_enum CUGLmap_flags - -ctypedef unsigned int GLenum - -ctypedef unsigned int GLuint - -cdef extern from "": - cdef struct void: - pass -ctypedef void* EGLImageKHR - -cdef extern from "": - cdef struct void: - pass -ctypedef void* EGLStreamKHR - -ctypedef unsigned int EGLint - -cdef extern from "": - cdef struct void: - pass -ctypedef void* EGLSyncKHR - -ctypedef uint32_t VdpDevice - -ctypedef unsigned long long VdpGetProcAddress - -ctypedef uint32_t VdpVideoSurface - -ctypedef uint32_t VdpOutputSurface - -{{if 'cuGetErrorString' in found_functions}} +# FUNCS cdef CUresult cuGetErrorString(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGetErrorName' in found_functions}} - cdef CUresult cuGetErrorName(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuInit' in found_functions}} - cdef CUresult cuInit(unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDriverGetVersion' in found_functions}} - cdef CUresult cuDriverGetVersion(int* driverVersion) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGet' in found_functions}} - cdef CUresult cuDeviceGet(CUdevice* device, int ordinal) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetCount' in found_functions}} - cdef CUresult cuDeviceGetCount(int* count) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetName' in found_functions}} - -cdef CUresult cuDeviceGetName(char* name, int length, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetUuid_v2' in found_functions}} - +cdef CUresult cuDeviceGetName(char* name, int len, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult cuDeviceGetUuid(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetLuid' in found_functions}} - cdef CUresult cuDeviceGetLuid(char* luid, unsigned int* deviceNodeMask, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceTotalMem_v2' in found_functions}} - -cdef CUresult cuDeviceTotalMem(size_t* numbytes, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}} - -cdef CUresult cuDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, CUarray_format pformat, unsigned numChannels, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetAttribute' in found_functions}} - +cdef CUresult cuDeviceTotalMem(size_t* bytes, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, CUarray_format format, unsigned numChannels, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult cuDeviceGetAttribute(int* pi, CUdevice_attribute attrib, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{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 -{{endif}} - -{{if 'cuDeviceSetMemPool' in found_functions}} - cdef CUresult cuDeviceSetMemPool(CUdevice dev, CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetMemPool' in found_functions}} - cdef CUresult cuDeviceGetMemPool(CUmemoryPool* pool, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetDefaultMemPool' in found_functions}} - cdef CUresult cuDeviceGetDefaultMemPool(CUmemoryPool* pool_out, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetExecAffinitySupport' in found_functions}} - -cdef CUresult cuDeviceGetExecAffinitySupport(int* pi, CUexecAffinityType typename, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFlushGPUDirectRDMAWrites' in found_functions}} - +cdef CUresult cuDeviceGetExecAffinitySupport(int* pi, CUexecAffinityType type, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult cuFlushGPUDirectRDMAWrites(CUflushGPUDirectRDMAWritesTarget target, CUflushGPUDirectRDMAWritesScope scope) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetProperties' in found_functions}} - cdef CUresult cuDeviceGetProperties(CUdevprop* prop, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceComputeCapability' in found_functions}} - cdef CUresult cuDeviceComputeCapability(int* major, int* minor, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDevicePrimaryCtxRetain' in found_functions}} - cdef CUresult cuDevicePrimaryCtxRetain(CUcontext* pctx, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}} - cdef CUresult cuDevicePrimaryCtxRelease(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}} - cdef CUresult cuDevicePrimaryCtxSetFlags(CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDevicePrimaryCtxGetState' in found_functions}} - cdef CUresult cuDevicePrimaryCtxGetState(CUdevice dev, unsigned int* flags, int* active) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDevicePrimaryCtxReset_v2' in found_functions}} - cdef CUresult cuDevicePrimaryCtxReset(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxCreate_v4' in found_functions}} - +cdef CUresult cuCtxCreate_v2(CUcontext* pctx, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxCreate_v3(CUcontext* pctx, CUexecAffinityParam* paramsArray, int numParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult cuCtxCreate(CUcontext* pctx, CUctxCreateParams* ctxCreateParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxDestroy_v2' in found_functions}} - cdef CUresult cuCtxDestroy(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxPushCurrent_v2' in found_functions}} - cdef CUresult cuCtxPushCurrent(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxPopCurrent_v2' in found_functions}} - cdef CUresult cuCtxPopCurrent(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxSetCurrent' in found_functions}} - cdef CUresult cuCtxSetCurrent(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxGetCurrent' in found_functions}} - cdef CUresult cuCtxGetCurrent(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxGetDevice' in found_functions}} - 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 -{{endif}} - -{{if 'cuCtxSetFlags' in found_functions}} - cdef CUresult cuCtxSetFlags(unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxGetId' in found_functions}} - cdef CUresult cuCtxGetId(CUcontext ctx, unsigned long long* ctxId) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxSynchronize' in found_functions}} - 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 -{{endif}} - -{{if 'cuCtxGetLimit' in found_functions}} - cdef CUresult cuCtxGetLimit(size_t* pvalue, CUlimit limit) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxGetCacheConfig' in found_functions}} - cdef CUresult cuCtxGetCacheConfig(CUfunc_cache* pconfig) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxSetCacheConfig' in found_functions}} - cdef CUresult cuCtxSetCacheConfig(CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxGetApiVersion' in found_functions}} - cdef CUresult cuCtxGetApiVersion(CUcontext ctx, unsigned int* version) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxGetStreamPriorityRange' in found_functions}} - cdef CUresult cuCtxGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxResetPersistingL2Cache' in found_functions}} - cdef CUresult cuCtxResetPersistingL2Cache() except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxGetExecAffinity' in found_functions}} - -cdef CUresult cuCtxGetExecAffinity(CUexecAffinityParam* pExecAffinity, CUexecAffinityType typename) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxRecordEvent' in found_functions}} - +cdef CUresult cuCtxGetExecAffinity(CUexecAffinityParam* pExecAffinity, CUexecAffinityType type) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult cuCtxRecordEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxWaitEvent' in found_functions}} - cdef CUresult cuCtxWaitEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxAttach' in found_functions}} - cdef CUresult cuCtxAttach(CUcontext* pctx, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxDetach' in found_functions}} - cdef CUresult cuCtxDetach(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxGetSharedMemConfig' in found_functions}} - cdef CUresult cuCtxGetSharedMemConfig(CUsharedconfig* pConfig) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxSetSharedMemConfig' in found_functions}} - cdef CUresult cuCtxSetSharedMemConfig(CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuModuleLoad' in found_functions}} - cdef CUresult cuModuleLoad(CUmodule* module, const char* fname) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuModuleLoadData' in found_functions}} - cdef CUresult cuModuleLoadData(CUmodule* module, const void* image) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuModuleLoadDataEx' in found_functions}} - cdef CUresult cuModuleLoadDataEx(CUmodule* module, const void* image, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuModuleLoadFatBinary' in found_functions}} - cdef CUresult cuModuleLoadFatBinary(CUmodule* module, const void* fatCubin) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuModuleUnload' in found_functions}} - cdef CUresult cuModuleUnload(CUmodule hmod) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuModuleGetLoadingMode' in found_functions}} - cdef CUresult cuModuleGetLoadingMode(CUmoduleLoadingMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuModuleGetFunction' in found_functions}} - cdef CUresult cuModuleGetFunction(CUfunction* hfunc, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuModuleGetFunctionCount' in found_functions}} - cdef CUresult cuModuleGetFunctionCount(unsigned int* count, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuModuleEnumerateFunctions' in found_functions}} - cdef CUresult cuModuleEnumerateFunctions(CUfunction* functions, unsigned int numFunctions, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuModuleGetGlobal_v2' in found_functions}} - -cdef CUresult cuModuleGetGlobal(CUdeviceptr* dptr, size_t* numbytes, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLinkCreate_v2' in found_functions}} - +cdef CUresult cuModuleGetGlobal(CUdeviceptr* dptr, size_t* bytes, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult cuLinkCreate(unsigned int numOptions, CUjit_option* options, void** optionValues, CUlinkState* stateOut) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLinkAddData_v2' in found_functions}} - -cdef CUresult cuLinkAddData(CUlinkState state, CUjitInputType typename, void* data, size_t size, const char* name, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLinkAddFile_v2' in found_functions}} - -cdef CUresult cuLinkAddFile(CUlinkState state, CUjitInputType typename, const char* path, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLinkComplete' in found_functions}} - +cdef CUresult cuLinkAddData(CUlinkState state, CUjitInputType type, void* data, size_t size, const char* name, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLinkAddFile(CUlinkState state, CUjitInputType type, const char* path, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult cuLinkComplete(CUlinkState state, void** cubinOut, size_t* sizeOut) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLinkDestroy' in found_functions}} - cdef CUresult cuLinkDestroy(CUlinkState state) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuModuleGetTexRef' in found_functions}} - cdef CUresult cuModuleGetTexRef(CUtexref* pTexRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuModuleGetSurfRef' in found_functions}} - cdef CUresult cuModuleGetSurfRef(CUsurfref* pSurfRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLibraryLoadData' in found_functions}} - cdef CUresult cuLibraryLoadData(CUlibrary* library, const void* code, CUjit_option* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, CUlibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLibraryLoadFromFile' in found_functions}} - cdef CUresult cuLibraryLoadFromFile(CUlibrary* library, const char* fileName, CUjit_option* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, CUlibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLibraryUnload' in found_functions}} - cdef CUresult cuLibraryUnload(CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLibraryGetKernel' in found_functions}} - cdef CUresult cuLibraryGetKernel(CUkernel* pKernel, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLibraryGetKernelCount' in found_functions}} - cdef CUresult cuLibraryGetKernelCount(unsigned int* count, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLibraryEnumerateKernels' in found_functions}} - cdef CUresult cuLibraryEnumerateKernels(CUkernel* kernels, unsigned int numKernels, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLibraryGetModule' in found_functions}} - cdef CUresult cuLibraryGetModule(CUmodule* pMod, CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuKernelGetFunction' in found_functions}} - cdef CUresult cuKernelGetFunction(CUfunction* pFunc, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuKernelGetLibrary' in found_functions}} - cdef CUresult cuKernelGetLibrary(CUlibrary* pLib, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLibraryGetGlobal' in found_functions}} - -cdef CUresult cuLibraryGetGlobal(CUdeviceptr* dptr, size_t* numbytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLibraryGetManaged' in found_functions}} - -cdef CUresult cuLibraryGetManaged(CUdeviceptr* dptr, size_t* numbytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLibraryGetUnifiedFunction' in found_functions}} - +cdef CUresult cuLibraryGetGlobal(CUdeviceptr* dptr, size_t* bytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLibraryGetManaged(CUdeviceptr* dptr, size_t* bytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult cuLibraryGetUnifiedFunction(void** fptr, CUlibrary library, const char* symbol) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuKernelGetAttribute' in found_functions}} - cdef CUresult cuKernelGetAttribute(int* pi, CUfunction_attribute attrib, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuKernelSetAttribute' in found_functions}} - cdef CUresult cuKernelSetAttribute(CUfunction_attribute attrib, int val, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuKernelSetCacheConfig' in found_functions}} - cdef CUresult cuKernelSetCacheConfig(CUkernel kernel, CUfunc_cache config, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuKernelGetName' in found_functions}} - cdef CUresult cuKernelGetName(const char** name, CUkernel hfunc) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuKernelGetParamInfo' in found_functions}} - cdef CUresult cuKernelGetParamInfo(CUkernel kernel, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuKernelGetParamCount' in found_functions}} - -cdef CUresult cuKernelGetParamCount(CUkernel kernel, size_t* paramCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemGetInfo_v2' in found_functions}} - cdef CUresult cuMemGetInfo(size_t* free, size_t* total) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemAlloc_v2' in found_functions}} - cdef CUresult cuMemAlloc(CUdeviceptr* dptr, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemAllocPitch_v2' in found_functions}} - cdef CUresult cuMemAllocPitch(CUdeviceptr* dptr, size_t* pPitch, size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemFree_v2' in found_functions}} - cdef CUresult cuMemFree(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemGetAddressRange_v2' in found_functions}} - cdef CUresult cuMemGetAddressRange(CUdeviceptr* pbase, size_t* psize, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemAllocHost_v2' in found_functions}} - cdef CUresult cuMemAllocHost(void** pp, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemFreeHost' in found_functions}} - cdef CUresult cuMemFreeHost(void* p) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemHostAlloc' in found_functions}} - cdef CUresult cuMemHostAlloc(void** pp, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemHostGetDevicePointer_v2' in found_functions}} - cdef CUresult cuMemHostGetDevicePointer(CUdeviceptr* pdptr, void* p, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemHostGetFlags' in found_functions}} - cdef CUresult cuMemHostGetFlags(unsigned int* pFlags, void* p) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemAllocManaged' in found_functions}} - cdef CUresult cuMemAllocManaged(CUdeviceptr* dptr, size_t bytesize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceRegisterAsyncNotification' in found_functions}} - cdef CUresult cuDeviceRegisterAsyncNotification(CUdevice device, CUasyncCallback callbackFunc, void* userData, CUasyncCallbackHandle* callback) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceUnregisterAsyncNotification' in found_functions}} - cdef CUresult cuDeviceUnregisterAsyncNotification(CUdevice device, CUasyncCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetByPCIBusId' in found_functions}} - cdef CUresult cuDeviceGetByPCIBusId(CUdevice* dev, const char* pciBusId) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetPCIBusId' in found_functions}} - -cdef CUresult cuDeviceGetPCIBusId(char* pciBusId, int length, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuIpcGetEventHandle' in found_functions}} - +cdef CUresult cuDeviceGetPCIBusId(char* pciBusId, int len, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult cuIpcGetEventHandle(CUipcEventHandle* pHandle, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuIpcOpenEventHandle' in found_functions}} - cdef CUresult cuIpcOpenEventHandle(CUevent* phEvent, CUipcEventHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuIpcGetMemHandle' in found_functions}} - cdef CUresult cuIpcGetMemHandle(CUipcMemHandle* pHandle, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuIpcOpenMemHandle_v2' in found_functions}} - cdef CUresult cuIpcOpenMemHandle(CUdeviceptr* pdptr, CUipcMemHandle handle, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuIpcCloseMemHandle' in found_functions}} - cdef CUresult cuIpcCloseMemHandle(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemHostRegister_v2' in found_functions}} - cdef CUresult cuMemHostRegister(void* p, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemHostUnregister' in found_functions}} - cdef CUresult cuMemHostUnregister(void* p) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpy' in found_functions}} - cdef CUresult cuMemcpy(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyPeer' in found_functions}} - cdef CUresult cuMemcpyPeer(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyHtoD_v2' in found_functions}} - cdef CUresult cuMemcpyHtoD(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyDtoH_v2' in found_functions}} - cdef CUresult cuMemcpyDtoH(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyDtoD_v2' in found_functions}} - cdef CUresult cuMemcpyDtoD(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyDtoA_v2' in found_functions}} - cdef CUresult cuMemcpyDtoA(CUarray dstArray, size_t dstOffset, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyAtoD_v2' in found_functions}} - cdef CUresult cuMemcpyAtoD(CUdeviceptr dstDevice, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyHtoA_v2' in found_functions}} - cdef CUresult cuMemcpyHtoA(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyAtoH_v2' in found_functions}} - cdef CUresult cuMemcpyAtoH(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyAtoA_v2' in found_functions}} - cdef CUresult cuMemcpyAtoA(CUarray dstArray, size_t dstOffset, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpy2D_v2' in found_functions}} - cdef CUresult cuMemcpy2D(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpy2DUnaligned_v2' in found_functions}} - cdef CUresult cuMemcpy2DUnaligned(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpy3D_v2' in found_functions}} - cdef CUresult cuMemcpy3D(const CUDA_MEMCPY3D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpy3DPeer' in found_functions}} - cdef CUresult cuMemcpy3DPeer(const CUDA_MEMCPY3D_PEER* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyAsync' in found_functions}} - cdef CUresult cuMemcpyAsync(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyPeerAsync' in found_functions}} - cdef CUresult cuMemcpyPeerAsync(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyHtoDAsync_v2' in found_functions}} - cdef CUresult cuMemcpyHtoDAsync(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyDtoHAsync_v2' in found_functions}} - cdef CUresult cuMemcpyDtoHAsync(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyDtoDAsync_v2' in found_functions}} - cdef CUresult cuMemcpyDtoDAsync(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyHtoAAsync_v2' in found_functions}} - -cdef CUresult cuMemcpyHtoAAsync(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyAtoHAsync_v2' in found_functions}} - -cdef CUresult cuMemcpyAtoHAsync(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpy2DAsync_v2' in found_functions}} - -cdef CUresult cuMemcpy2DAsync(const CUDA_MEMCPY2D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpy3DAsync_v2' in found_functions}} - -cdef CUresult cuMemcpy3DAsync(const CUDA_MEMCPY3D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpy3DPeerAsync' in found_functions}} - -cdef CUresult cuMemcpy3DPeerAsync(const CUDA_MEMCPY3D_PEER* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyBatchAsync_v2' in found_functions}} - -cdef CUresult cuMemcpyBatchAsync(CUdeviceptr* dsts, CUdeviceptr* srcs, size_t* sizes, size_t count, CUmemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} - -cdef CUresult cuMemcpy3DBatchAsync(size_t numOps, CUDA_MEMCPY3D_BATCH_OP* opList, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpyWithAttributesAsync' in found_functions}} - -cdef CUresult cuMemcpyWithAttributesAsync(CUdeviceptr dst, CUdeviceptr src, size_t size, CUmemcpyAttributes* attr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemcpy3DWithAttributesAsync' in found_functions}} - -cdef CUresult cuMemcpy3DWithAttributesAsync(CUDA_MEMCPY3D_BATCH_OP* op, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemsetD8_v2' in found_functions}} - +cdef CUresult cuMemcpyHtoAAsync(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpyAtoHAsync(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpy2DAsync(const CUDA_MEMCPY2D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpy3DAsync(const CUDA_MEMCPY3D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpy3DPeerAsync(const CUDA_MEMCPY3D_PEER* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult cuMemsetD8(CUdeviceptr dstDevice, unsigned char uc, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemsetD16_v2' in found_functions}} - cdef CUresult cuMemsetD16(CUdeviceptr dstDevice, unsigned short us, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemsetD32_v2' in found_functions}} - cdef CUresult cuMemsetD32(CUdeviceptr dstDevice, unsigned int ui, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemsetD2D8_v2' in found_functions}} - cdef CUresult cuMemsetD2D8(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemsetD2D16_v2' in found_functions}} - cdef CUresult cuMemsetD2D16(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemsetD2D32_v2' in found_functions}} - cdef CUresult cuMemsetD2D32(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemsetD8Async' in found_functions}} - cdef CUresult cuMemsetD8Async(CUdeviceptr dstDevice, unsigned char uc, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemsetD16Async' in found_functions}} - cdef CUresult cuMemsetD16Async(CUdeviceptr dstDevice, unsigned short us, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemsetD32Async' in found_functions}} - cdef CUresult cuMemsetD32Async(CUdeviceptr dstDevice, unsigned int ui, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemsetD2D8Async' in found_functions}} - cdef CUresult cuMemsetD2D8Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemsetD2D16Async' in found_functions}} - cdef CUresult cuMemsetD2D16Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemsetD2D32Async' in found_functions}} - cdef CUresult cuMemsetD2D32Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuArrayCreate_v2' in found_functions}} - cdef CUresult cuArrayCreate(CUarray* pHandle, const CUDA_ARRAY_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuArrayGetDescriptor_v2' in found_functions}} - cdef CUresult cuArrayGetDescriptor(CUDA_ARRAY_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuArrayGetSparseProperties' in found_functions}} - cdef CUresult cuArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUarray array) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMipmappedArrayGetSparseProperties' in found_functions}} - cdef CUresult cuMipmappedArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUmipmappedArray mipmap) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuArrayGetMemoryRequirements' in found_functions}} - cdef CUresult cuArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUarray array, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}} - cdef CUresult cuMipmappedArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUmipmappedArray mipmap, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuArrayGetPlane' in found_functions}} - cdef CUresult cuArrayGetPlane(CUarray* pPlaneArray, CUarray hArray, unsigned int planeIdx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuArrayDestroy' in found_functions}} - cdef CUresult cuArrayDestroy(CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuArray3DCreate_v2' in found_functions}} - cdef CUresult cuArray3DCreate(CUarray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuArray3DGetDescriptor_v2' in found_functions}} - cdef CUresult cuArray3DGetDescriptor(CUDA_ARRAY3D_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMipmappedArrayCreate' in found_functions}} - cdef CUresult cuMipmappedArrayCreate(CUmipmappedArray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pMipmappedArrayDesc, unsigned int numMipmapLevels) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMipmappedArrayGetLevel' in found_functions}} - cdef CUresult cuMipmappedArrayGetLevel(CUarray* pLevelArray, CUmipmappedArray hMipmappedArray, unsigned int level) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMipmappedArrayDestroy' in found_functions}} - cdef CUresult cuMipmappedArrayDestroy(CUmipmappedArray hMipmappedArray) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemGetHandleForAddressRange' in found_functions}} - cdef CUresult cuMemGetHandleForAddressRange(void* handle, CUdeviceptr dptr, size_t size, CUmemRangeHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemBatchDecompressAsync' in found_functions}} - cdef CUresult cuMemBatchDecompressAsync(CUmemDecompressParams* paramsArray, size_t count, unsigned int flags, size_t* errorIndex, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemAddressReserve' in found_functions}} - cdef CUresult cuMemAddressReserve(CUdeviceptr* ptr, size_t size, size_t alignment, CUdeviceptr addr, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemAddressFree' in found_functions}} - cdef CUresult cuMemAddressFree(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemCreate' in found_functions}} - cdef CUresult cuMemCreate(CUmemGenericAllocationHandle* handle, size_t size, const CUmemAllocationProp* prop, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemRelease' in found_functions}} - cdef CUresult cuMemRelease(CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemMap' in found_functions}} - cdef CUresult cuMemMap(CUdeviceptr ptr, size_t size, size_t offset, CUmemGenericAllocationHandle handle, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemMapArrayAsync' in found_functions}} - cdef CUresult cuMemMapArrayAsync(CUarrayMapInfo* mapInfoList, unsigned int count, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemUnmap' in found_functions}} - cdef CUresult cuMemUnmap(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemSetAccess' in found_functions}} - cdef CUresult cuMemSetAccess(CUdeviceptr ptr, size_t size, const CUmemAccessDesc* desc, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemGetAccess' in found_functions}} - cdef CUresult cuMemGetAccess(unsigned long long* flags, const CUmemLocation* location, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemExportToShareableHandle' in found_functions}} - cdef CUresult cuMemExportToShareableHandle(void* shareableHandle, CUmemGenericAllocationHandle handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemImportFromShareableHandle' in found_functions}} - cdef CUresult cuMemImportFromShareableHandle(CUmemGenericAllocationHandle* handle, void* osHandle, CUmemAllocationHandleType shHandleType) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemGetAllocationGranularity' in found_functions}} - cdef CUresult cuMemGetAllocationGranularity(size_t* granularity, const CUmemAllocationProp* prop, CUmemAllocationGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}} - cdef CUresult cuMemGetAllocationPropertiesFromHandle(CUmemAllocationProp* prop, CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemRetainAllocationHandle' in found_functions}} - cdef CUresult cuMemRetainAllocationHandle(CUmemGenericAllocationHandle* handle, void* addr) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemFreeAsync' in found_functions}} - cdef CUresult cuMemFreeAsync(CUdeviceptr dptr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemAllocAsync' in found_functions}} - cdef CUresult cuMemAllocAsync(CUdeviceptr* dptr, size_t bytesize, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemPoolTrimTo' in found_functions}} - cdef CUresult cuMemPoolTrimTo(CUmemoryPool pool, size_t minBytesToKeep) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemPoolSetAttribute' in found_functions}} - cdef CUresult cuMemPoolSetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemPoolGetAttribute' in found_functions}} - cdef CUresult cuMemPoolGetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemPoolSetAccess' in found_functions}} - cdef CUresult cuMemPoolSetAccess(CUmemoryPool pool, const CUmemAccessDesc* map, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemPoolGetAccess' in found_functions}} - cdef CUresult cuMemPoolGetAccess(CUmemAccess_flags* flags, CUmemoryPool memPool, CUmemLocation* location) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemPoolCreate' in found_functions}} - cdef CUresult cuMemPoolCreate(CUmemoryPool* pool, const CUmemPoolProps* poolProps) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemPoolDestroy' in found_functions}} - 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 -{{endif}} - -{{if 'cuMemPoolExportToShareableHandle' in found_functions}} - cdef CUresult cuMemPoolExportToShareableHandle(void* handle_out, CUmemoryPool pool, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemPoolImportFromShareableHandle' in found_functions}} - cdef CUresult cuMemPoolImportFromShareableHandle(CUmemoryPool* pool_out, void* handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemPoolExportPointer' in found_functions}} - cdef CUresult cuMemPoolExportPointer(CUmemPoolPtrExportData* shareData_out, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemPoolImportPointer' in found_functions}} - cdef CUresult cuMemPoolImportPointer(CUdeviceptr* ptr_out, CUmemoryPool pool, CUmemPoolPtrExportData* shareData) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMulticastCreate' in found_functions}} - cdef CUresult cuMulticastCreate(CUmemGenericAllocationHandle* mcHandle, const CUmulticastObjectProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMulticastAddDevice' in found_functions}} - cdef CUresult cuMulticastAddDevice(CUmemGenericAllocationHandle mcHandle, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMulticastBindMem' in found_functions}} - cdef CUresult cuMulticastBindMem(CUmemGenericAllocationHandle mcHandle, size_t mcOffset, CUmemGenericAllocationHandle memHandle, size_t memOffset, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMulticastBindMem_v2' in found_functions}} - -cdef CUresult cuMulticastBindMem_v2(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, CUmemGenericAllocationHandle memHandle, size_t memOffset, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMulticastBindAddr' in found_functions}} - cdef CUresult cuMulticastBindAddr(CUmemGenericAllocationHandle mcHandle, size_t mcOffset, CUdeviceptr memptr, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMulticastBindAddr_v2' in found_functions}} - -cdef CUresult cuMulticastBindAddr_v2(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, CUdeviceptr memptr, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMulticastUnbind' in found_functions}} - cdef CUresult cuMulticastUnbind(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMulticastGetGranularity' in found_functions}} - cdef CUresult cuMulticastGetGranularity(size_t* granularity, const CUmulticastObjectProp* prop, CUmulticastGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuPointerGetAttribute' in found_functions}} - cdef CUresult cuPointerGetAttribute(void* data, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemPrefetchAsync_v2' in found_functions}} - cdef CUresult cuMemPrefetchAsync(CUdeviceptr devPtr, size_t count, CUmemLocation location, unsigned int flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemAdvise_v2' in found_functions}} - cdef CUresult cuMemAdvise(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUmemLocation location) except ?CUDA_ERROR_NOT_FOUND nogil -{{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 -{{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 -{{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}} - cdef CUresult cuMemRangeGetAttribute(void* data, size_t dataSize, CUmem_range_attribute attribute, CUdeviceptr devPtr, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuMemRangeGetAttributes' in found_functions}} - cdef CUresult cuMemRangeGetAttributes(void** data, size_t* dataSizes, CUmem_range_attribute* attributes, size_t numAttributes, CUdeviceptr devPtr, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuPointerSetAttribute' in found_functions}} - cdef CUresult cuPointerSetAttribute(const void* value, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuPointerGetAttributes' in found_functions}} - cdef CUresult cuPointerGetAttributes(unsigned int numAttributes, CUpointer_attribute* attributes, void** data, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamCreate' in found_functions}} - cdef CUresult cuStreamCreate(CUstream* phStream, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamCreateWithPriority' in found_functions}} - cdef CUresult cuStreamCreateWithPriority(CUstream* phStream, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamBeginCaptureToCig' in found_functions}} - -cdef CUresult cuStreamBeginCaptureToCig(CUstream hStream, CUstreamCigCaptureParams* streamCigCaptureParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamEndCaptureToCig' in found_functions}} - -cdef CUresult cuStreamEndCaptureToCig(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamGetPriority' in found_functions}} - cdef CUresult cuStreamGetPriority(CUstream hStream, int* priority) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamGetDevice' in found_functions}} - cdef CUresult cuStreamGetDevice(CUstream hStream, CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamGetFlags' in found_functions}} - cdef CUresult cuStreamGetFlags(CUstream hStream, unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamGetId' in found_functions}} - cdef CUresult cuStreamGetId(CUstream hStream, unsigned long long* streamId) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamGetCtx' in found_functions}} - cdef CUresult cuStreamGetCtx(CUstream hStream, CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamGetCtx_v2' in found_functions}} - cdef CUresult cuStreamGetCtx_v2(CUstream hStream, CUcontext* pCtx, CUgreenCtx* pGreenCtx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamWaitEvent' in found_functions}} - cdef CUresult cuStreamWaitEvent(CUstream hStream, CUevent hEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamAddCallback' in found_functions}} - cdef CUresult cuStreamAddCallback(CUstream hStream, CUstreamCallback callback, void* userData, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamBeginCapture_v2' in found_functions}} - cdef CUresult cuStreamBeginCapture(CUstream hStream, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamBeginCaptureToGraph' in found_functions}} - cdef CUresult cuStreamBeginCaptureToGraph(CUstream hStream, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuThreadExchangeStreamCaptureMode' in found_functions}} - cdef CUresult cuThreadExchangeStreamCaptureMode(CUstreamCaptureMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamEndCapture' in found_functions}} - cdef CUresult cuStreamEndCapture(CUstream hStream, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamIsCapturing' in found_functions}} - cdef CUresult cuStreamIsCapturing(CUstream hStream, CUstreamCaptureStatus* captureStatus) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamGetCaptureInfo_v3' 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 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(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}} - cdef CUresult cuStreamAttachMemAsync(CUstream hStream, CUdeviceptr dptr, size_t length, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamQuery' in found_functions}} - cdef CUresult cuStreamQuery(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamSynchronize' in found_functions}} - cdef CUresult cuStreamSynchronize(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamDestroy_v2' in found_functions}} - cdef CUresult cuStreamDestroy(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamCopyAttributes' in found_functions}} - cdef CUresult cuStreamCopyAttributes(CUstream dst, CUstream src) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamGetAttribute' in found_functions}} - cdef CUresult cuStreamGetAttribute(CUstream hStream, CUstreamAttrID attr, CUstreamAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamSetAttribute' in found_functions}} - cdef CUresult cuStreamSetAttribute(CUstream hStream, CUstreamAttrID attr, const CUstreamAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuEventCreate' in found_functions}} - cdef CUresult cuEventCreate(CUevent* phEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuEventRecord' in found_functions}} - cdef CUresult cuEventRecord(CUevent hEvent, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuEventRecordWithFlags' in found_functions}} - cdef CUresult cuEventRecordWithFlags(CUevent hEvent, CUstream hStream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuEventQuery' in found_functions}} - cdef CUresult cuEventQuery(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuEventSynchronize' in found_functions}} - cdef CUresult cuEventSynchronize(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuEventDestroy_v2' in found_functions}} - cdef CUresult cuEventDestroy(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuEventElapsedTime_v2' in found_functions}} - cdef CUresult cuEventElapsedTime(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuImportExternalMemory' in found_functions}} - cdef CUresult cuImportExternalMemory(CUexternalMemory* extMem_out, const CUDA_EXTERNAL_MEMORY_HANDLE_DESC* memHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuExternalMemoryGetMappedBuffer' in found_functions}} - cdef CUresult cuExternalMemoryGetMappedBuffer(CUdeviceptr* devPtr, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_BUFFER_DESC* bufferDesc) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}} - cdef CUresult cuExternalMemoryGetMappedMipmappedArray(CUmipmappedArray* mipmap, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC* mipmapDesc) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDestroyExternalMemory' in found_functions}} - cdef CUresult cuDestroyExternalMemory(CUexternalMemory extMem) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuImportExternalSemaphore' in found_functions}} - cdef CUresult cuImportExternalSemaphore(CUexternalSemaphore* extSem_out, const CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC* semHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuSignalExternalSemaphoresAsync' in found_functions}} - cdef CUresult cuSignalExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuWaitExternalSemaphoresAsync' in found_functions}} - cdef CUresult cuWaitExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDestroyExternalSemaphore' in found_functions}} - cdef CUresult cuDestroyExternalSemaphore(CUexternalSemaphore extSem) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamWaitValue32_v2' in found_functions}} - cdef CUresult cuStreamWaitValue32(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamWaitValue64_v2' in found_functions}} - cdef CUresult cuStreamWaitValue64(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamWriteValue32_v2' in found_functions}} - cdef CUresult cuStreamWriteValue32(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamWriteValue64_v2' in found_functions}} - cdef CUresult cuStreamWriteValue64(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamBatchMemOp_v2' in found_functions}} - cdef CUresult cuStreamBatchMemOp(CUstream stream, unsigned int count, CUstreamBatchMemOpParams* paramArray, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFuncGetAttribute' in found_functions}} - cdef CUresult cuFuncGetAttribute(int* pi, CUfunction_attribute attrib, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFuncSetAttribute' in found_functions}} - cdef CUresult cuFuncSetAttribute(CUfunction hfunc, CUfunction_attribute attrib, int value) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFuncSetCacheConfig' in found_functions}} - cdef CUresult cuFuncSetCacheConfig(CUfunction hfunc, CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFuncGetModule' in found_functions}} - cdef CUresult cuFuncGetModule(CUmodule* hmod, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFuncGetName' in found_functions}} - cdef CUresult cuFuncGetName(const char** name, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFuncGetParamInfo' in found_functions}} - cdef CUresult cuFuncGetParamInfo(CUfunction func, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFuncGetParamCount' in found_functions}} - -cdef CUresult cuFuncGetParamCount(CUfunction func, size_t* paramCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFuncIsLoaded' in found_functions}} - cdef CUresult cuFuncIsLoaded(CUfunctionLoadingState* state, CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFuncLoad' in found_functions}} - cdef CUresult cuFuncLoad(CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLaunchKernel' in found_functions}} - cdef CUresult cuLaunchKernel(CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, CUstream hStream, void** kernelParams, void** extra) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLaunchKernelEx' in found_functions}} - cdef CUresult cuLaunchKernelEx(const CUlaunchConfig* config, CUfunction f, void** kernelParams, void** extra) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLaunchCooperativeKernel' in found_functions}} - cdef CUresult cuLaunchCooperativeKernel(CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, CUstream hStream, void** kernelParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}} - cdef CUresult cuLaunchCooperativeKernelMultiDevice(CUDA_LAUNCH_PARAMS* launchParamsList, unsigned int numDevices, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLaunchHostFunc' in found_functions}} - cdef CUresult cuLaunchHostFunc(CUstream hStream, CUhostFn fn, void* userData) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLaunchHostFunc_v2' in found_functions}} - -cdef CUresult cuLaunchHostFunc_v2(CUstream hStream, CUhostFn fn, void* userData, unsigned int syncMode) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFuncSetBlockShape' in found_functions}} - cdef CUresult cuFuncSetBlockShape(CUfunction hfunc, int x, int y, int z) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFuncSetSharedSize' in found_functions}} - -cdef CUresult cuFuncSetSharedSize(CUfunction hfunc, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuParamSetSize' in found_functions}} - +cdef CUresult cuFuncSetSharedSize(CUfunction hfunc, unsigned int bytes) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult cuParamSetSize(CUfunction hfunc, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuParamSeti' in found_functions}} - cdef CUresult cuParamSeti(CUfunction hfunc, int offset, unsigned int value) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuParamSetf' in found_functions}} - cdef CUresult cuParamSetf(CUfunction hfunc, int offset, float value) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuParamSetv' in found_functions}} - cdef CUresult cuParamSetv(CUfunction hfunc, int offset, void* ptr, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLaunch' in found_functions}} - cdef CUresult cuLaunch(CUfunction f) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLaunchGrid' in found_functions}} - cdef CUresult cuLaunchGrid(CUfunction f, int grid_width, int grid_height) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLaunchGridAsync' in found_functions}} - cdef CUresult cuLaunchGridAsync(CUfunction f, int grid_width, int grid_height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuParamSetTexRef' in found_functions}} - cdef CUresult cuParamSetTexRef(CUfunction hfunc, int texunit, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuFuncSetSharedMemConfig' in found_functions}} - cdef CUresult cuFuncSetSharedMemConfig(CUfunction hfunc, CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphCreate' in found_functions}} - cdef CUresult cuGraphCreate(CUgraph* phGraph, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddKernelNode_v2' in found_functions}} - cdef CUresult cuGraphAddKernelNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphKernelNodeGetParams_v2' in found_functions}} - cdef CUresult cuGraphKernelNodeGetParams(CUgraphNode hNode, CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphKernelNodeSetParams_v2' in found_functions}} - cdef CUresult cuGraphKernelNodeSetParams(CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddMemcpyNode' in found_functions}} - cdef CUresult cuGraphAddMemcpyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_MEMCPY3D* copyParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphMemcpyNodeGetParams' in found_functions}} - cdef CUresult cuGraphMemcpyNodeGetParams(CUgraphNode hNode, CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphMemcpyNodeSetParams' in found_functions}} - cdef CUresult cuGraphMemcpyNodeSetParams(CUgraphNode hNode, const CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddMemsetNode' in found_functions}} - cdef CUresult cuGraphAddMemsetNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_MEMSET_NODE_PARAMS* memsetParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphMemsetNodeGetParams' in found_functions}} - cdef CUresult cuGraphMemsetNodeGetParams(CUgraphNode hNode, CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphMemsetNodeSetParams' in found_functions}} - cdef CUresult cuGraphMemsetNodeSetParams(CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddHostNode' in found_functions}} - cdef CUresult cuGraphAddHostNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphHostNodeGetParams' in found_functions}} - cdef CUresult cuGraphHostNodeGetParams(CUgraphNode hNode, CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphHostNodeSetParams' in found_functions}} - cdef CUresult cuGraphHostNodeSetParams(CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddChildGraphNode' in found_functions}} - cdef CUresult cuGraphAddChildGraphNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphChildGraphNodeGetGraph' in found_functions}} - cdef CUresult cuGraphChildGraphNodeGetGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddEmptyNode' in found_functions}} - cdef CUresult cuGraphAddEmptyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddEventRecordNode' in found_functions}} - cdef CUresult cuGraphAddEventRecordNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphEventRecordNodeGetEvent' in found_functions}} - cdef CUresult cuGraphEventRecordNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphEventRecordNodeSetEvent' in found_functions}} - cdef CUresult cuGraphEventRecordNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddEventWaitNode' in found_functions}} - cdef CUresult cuGraphAddEventWaitNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphEventWaitNodeGetEvent' in found_functions}} - cdef CUresult cuGraphEventWaitNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphEventWaitNodeSetEvent' in found_functions}} - cdef CUresult cuGraphEventWaitNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}} - cdef CUresult cuGraphAddExternalSemaphoresSignalNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} - cdef CUresult cuGraphExternalSemaphoresSignalNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} - cdef CUresult cuGraphExternalSemaphoresSignalNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}} - cdef CUresult cuGraphAddExternalSemaphoresWaitNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} - cdef CUresult cuGraphExternalSemaphoresWaitNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_WAIT_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} - cdef CUresult cuGraphExternalSemaphoresWaitNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddBatchMemOpNode' in found_functions}} - cdef CUresult cuGraphAddBatchMemOpNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}} - cdef CUresult cuGraphBatchMemOpNodeGetParams(CUgraphNode hNode, CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams_out) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}} - cdef CUresult cuGraphBatchMemOpNodeSetParams(CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}} - cdef CUresult cuGraphExecBatchMemOpNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddMemAllocNode' in found_functions}} - cdef CUresult cuGraphAddMemAllocNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUDA_MEM_ALLOC_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphMemAllocNodeGetParams' in found_functions}} - cdef CUresult cuGraphMemAllocNodeGetParams(CUgraphNode hNode, CUDA_MEM_ALLOC_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddMemFreeNode' in found_functions}} - cdef CUresult cuGraphAddMemFreeNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphMemFreeNodeGetParams' in found_functions}} - cdef CUresult cuGraphMemFreeNodeGetParams(CUgraphNode hNode, CUdeviceptr* dptr_out) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGraphMemTrim' in found_functions}} - cdef CUresult cuDeviceGraphMemTrim(CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetGraphMemAttribute' in found_functions}} - cdef CUresult cuDeviceGetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceSetGraphMemAttribute' in found_functions}} - cdef CUresult cuDeviceSetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphClone' in found_functions}} - cdef CUresult cuGraphClone(CUgraph* phGraphClone, CUgraph originalGraph) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphNodeFindInClone' in found_functions}} - cdef CUresult cuGraphNodeFindInClone(CUgraphNode* phNode, CUgraphNode hOriginalNode, CUgraph hClonedGraph) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphNodeGetType' in found_functions}} - -cdef CUresult cuGraphNodeGetType(CUgraphNode hNode, CUgraphNodeType* typename) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphNodeGetContainingGraph' in found_functions}} - -cdef CUresult cuGraphNodeGetContainingGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphNodeGetLocalId' in found_functions}} - -cdef CUresult cuGraphNodeGetLocalId(CUgraphNode hNode, unsigned int* nodeId) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphNodeGetToolsId' in found_functions}} - -cdef CUresult cuGraphNodeGetToolsId(CUgraphNode hNode, unsigned long long* toolsNodeId) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphGetId' in found_functions}} - -cdef CUresult cuGraphGetId(CUgraph hGraph, unsigned int* graphId) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecGetId' in found_functions}} - -cdef CUresult cuGraphExecGetId(CUgraphExec hGraphExec, unsigned int* graphId) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphGetNodes' in found_functions}} - +cdef CUresult cuGraphNodeGetType(CUgraphNode hNode, CUgraphNodeType* type) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult cuGraphGetNodes(CUgraph hGraph, CUgraphNode* nodes, size_t* numNodes) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphGetRootNodes' in found_functions}} - cdef CUresult cuGraphGetRootNodes(CUgraph hGraph, CUgraphNode* rootNodes, size_t* numRootNodes) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphGetEdges_v2' in found_functions}} - cdef CUresult cuGraphGetEdges(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, CUgraphEdgeData* edgeData, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphNodeGetDependencies_v2' in found_functions}} - cdef CUresult cuGraphNodeGetDependencies(CUgraphNode hNode, CUgraphNode* dependencies, CUgraphEdgeData* edgeData, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} - cdef CUresult cuGraphNodeGetDependentNodes(CUgraphNode hNode, CUgraphNode* dependentNodes, CUgraphEdgeData* edgeData, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddDependencies_v2' in found_functions}} - cdef CUresult cuGraphAddDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphRemoveDependencies_v2' in found_functions}} - cdef CUresult cuGraphRemoveDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphDestroyNode' in found_functions}} - cdef CUresult cuGraphDestroyNode(CUgraphNode hNode) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphInstantiateWithFlags' in found_functions}} - cdef CUresult cuGraphInstantiate(CUgraphExec* phGraphExec, CUgraph hGraph, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphInstantiateWithParams' in found_functions}} - cdef CUresult cuGraphInstantiateWithParams(CUgraphExec* phGraphExec, CUgraph hGraph, CUDA_GRAPH_INSTANTIATE_PARAMS* instantiateParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecGetFlags' in found_functions}} - cdef CUresult cuGraphExecGetFlags(CUgraphExec hGraphExec, cuuint64_t* flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}} - cdef CUresult cuGraphExecKernelNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}} - cdef CUresult cuGraphExecMemcpyNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMCPY3D* copyParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecMemsetNodeSetParams' in found_functions}} - cdef CUresult cuGraphExecMemsetNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* memsetParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecHostNodeSetParams' in found_functions}} - cdef CUresult cuGraphExecHostNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}} - cdef CUresult cuGraphExecChildGraphNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}} - cdef CUresult cuGraphExecEventRecordNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}} - cdef CUresult cuGraphExecEventWaitNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} - cdef CUresult cuGraphExecExternalSemaphoresSignalNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} - cdef CUresult cuGraphExecExternalSemaphoresWaitNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphNodeSetEnabled' in found_functions}} - cdef CUresult cuGraphNodeSetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphNodeGetEnabled' in found_functions}} - cdef CUresult cuGraphNodeGetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int* isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphUpload' in found_functions}} - cdef CUresult cuGraphUpload(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphLaunch' in found_functions}} - cdef CUresult cuGraphLaunch(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecDestroy' in found_functions}} - cdef CUresult cuGraphExecDestroy(CUgraphExec hGraphExec) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphDestroy' in found_functions}} - cdef CUresult cuGraphDestroy(CUgraph hGraph) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecUpdate_v2' in found_functions}} - cdef CUresult cuGraphExecUpdate(CUgraphExec hGraphExec, CUgraph hGraph, CUgraphExecUpdateResultInfo* resultInfo) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphKernelNodeCopyAttributes' in found_functions}} - cdef CUresult cuGraphKernelNodeCopyAttributes(CUgraphNode dst, CUgraphNode src) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphKernelNodeGetAttribute' in found_functions}} - cdef CUresult cuGraphKernelNodeGetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, CUkernelNodeAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphKernelNodeSetAttribute' in found_functions}} - cdef CUresult cuGraphKernelNodeSetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, const CUkernelNodeAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphDebugDotPrint' in found_functions}} - cdef CUresult cuGraphDebugDotPrint(CUgraph hGraph, const char* path, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuUserObjectCreate' in found_functions}} - cdef CUresult cuUserObjectCreate(CUuserObject* object_out, void* ptr, CUhostFn destroy, unsigned int initialRefcount, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuUserObjectRetain' in found_functions}} - cdef CUresult cuUserObjectRetain(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuUserObjectRelease' in found_functions}} - cdef CUresult cuUserObjectRelease(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphRetainUserObject' in found_functions}} - cdef CUresult cuGraphRetainUserObject(CUgraph graph, CUuserObject object, unsigned int count, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphReleaseUserObject' in found_functions}} - cdef CUresult cuGraphReleaseUserObject(CUgraph graph, CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphAddNode_v2' in found_functions}} - cdef CUresult cuGraphAddNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphNodeSetParams' in found_functions}} - cdef CUresult cuGraphNodeSetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphNodeGetParams' in found_functions}} - -cdef CUresult cuGraphNodeGetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphExecNodeSetParams' in found_functions}} - cdef CUresult cuGraphExecNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphConditionalHandleCreate' in found_functions}} - cdef CUresult cuGraphConditionalHandleCreate(CUgraphConditionalHandle* pHandle_out, CUgraph hGraph, CUcontext ctx, unsigned int defaultLaunchValue, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} - cdef CUresult cuOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} - cdef CUresult cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}} - cdef CUresult cuOccupancyMaxPotentialBlockSize(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}} - cdef CUresult cuOccupancyMaxPotentialBlockSizeWithFlags(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}} - cdef CUresult cuOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, CUfunction func, int numBlocks, int blockSize) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}} - cdef CUresult cuOccupancyMaxPotentialClusterSize(int* clusterSize, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuOccupancyMaxActiveClusters' in found_functions}} - cdef CUresult cuOccupancyMaxActiveClusters(int* numClusters, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetArray' in found_functions}} - cdef CUresult cuTexRefSetArray(CUtexref hTexRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetMipmappedArray' in found_functions}} - cdef CUresult cuTexRefSetMipmappedArray(CUtexref hTexRef, CUmipmappedArray hMipmappedArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetAddress_v2' in found_functions}} - -cdef CUresult cuTexRefSetAddress(size_t* ByteOffset, CUtexref hTexRef, CUdeviceptr dptr, size_t numbytes) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetAddress2D_v3' in found_functions}} - +cdef CUresult cuTexRefSetAddress(size_t* ByteOffset, CUtexref hTexRef, CUdeviceptr dptr, size_t bytes) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult cuTexRefSetAddress2D(CUtexref hTexRef, const CUDA_ARRAY_DESCRIPTOR* desc, CUdeviceptr dptr, size_t Pitch) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetFormat' in found_functions}} - cdef CUresult cuTexRefSetFormat(CUtexref hTexRef, CUarray_format fmt, int NumPackedComponents) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetAddressMode' in found_functions}} - cdef CUresult cuTexRefSetAddressMode(CUtexref hTexRef, int dim, CUaddress_mode am) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetFilterMode' in found_functions}} - cdef CUresult cuTexRefSetFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetMipmapFilterMode' in found_functions}} - cdef CUresult cuTexRefSetMipmapFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetMipmapLevelBias' in found_functions}} - cdef CUresult cuTexRefSetMipmapLevelBias(CUtexref hTexRef, float bias) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetMipmapLevelClamp' in found_functions}} - cdef CUresult cuTexRefSetMipmapLevelClamp(CUtexref hTexRef, float minMipmapLevelClamp, float maxMipmapLevelClamp) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetMaxAnisotropy' in found_functions}} - cdef CUresult cuTexRefSetMaxAnisotropy(CUtexref hTexRef, unsigned int maxAniso) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetBorderColor' in found_functions}} - cdef CUresult cuTexRefSetBorderColor(CUtexref hTexRef, float* pBorderColor) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefSetFlags' in found_functions}} - cdef CUresult cuTexRefSetFlags(CUtexref hTexRef, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefGetAddress_v2' in found_functions}} - cdef CUresult cuTexRefGetAddress(CUdeviceptr* pdptr, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefGetArray' in found_functions}} - cdef CUresult cuTexRefGetArray(CUarray* phArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefGetMipmappedArray' in found_functions}} - cdef CUresult cuTexRefGetMipmappedArray(CUmipmappedArray* phMipmappedArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefGetAddressMode' in found_functions}} - cdef CUresult cuTexRefGetAddressMode(CUaddress_mode* pam, CUtexref hTexRef, int dim) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefGetFilterMode' in found_functions}} - cdef CUresult cuTexRefGetFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefGetFormat' in found_functions}} - cdef CUresult cuTexRefGetFormat(CUarray_format* pFormat, int* pNumChannels, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefGetMipmapFilterMode' in found_functions}} - cdef CUresult cuTexRefGetMipmapFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefGetMipmapLevelBias' in found_functions}} - cdef CUresult cuTexRefGetMipmapLevelBias(float* pbias, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefGetMipmapLevelClamp' in found_functions}} - cdef CUresult cuTexRefGetMipmapLevelClamp(float* pminMipmapLevelClamp, float* pmaxMipmapLevelClamp, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefGetMaxAnisotropy' in found_functions}} - cdef CUresult cuTexRefGetMaxAnisotropy(int* pmaxAniso, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefGetBorderColor' in found_functions}} - cdef CUresult cuTexRefGetBorderColor(float* pBorderColor, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefGetFlags' in found_functions}} - cdef CUresult cuTexRefGetFlags(unsigned int* pFlags, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefCreate' in found_functions}} - cdef CUresult cuTexRefCreate(CUtexref* pTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexRefDestroy' in found_functions}} - cdef CUresult cuTexRefDestroy(CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuSurfRefSetArray' in found_functions}} - cdef CUresult cuSurfRefSetArray(CUsurfref hSurfRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuSurfRefGetArray' in found_functions}} - cdef CUresult cuSurfRefGetArray(CUarray* phArray, CUsurfref hSurfRef) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexObjectCreate' in found_functions}} - cdef CUresult cuTexObjectCreate(CUtexObject* pTexObject, const CUDA_RESOURCE_DESC* pResDesc, const CUDA_TEXTURE_DESC* pTexDesc, const CUDA_RESOURCE_VIEW_DESC* pResViewDesc) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexObjectDestroy' in found_functions}} - cdef CUresult cuTexObjectDestroy(CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexObjectGetResourceDesc' in found_functions}} - cdef CUresult cuTexObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexObjectGetTextureDesc' in found_functions}} - cdef CUresult cuTexObjectGetTextureDesc(CUDA_TEXTURE_DESC* pTexDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTexObjectGetResourceViewDesc' in found_functions}} - cdef CUresult cuTexObjectGetResourceViewDesc(CUDA_RESOURCE_VIEW_DESC* pResViewDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuSurfObjectCreate' in found_functions}} - cdef CUresult cuSurfObjectCreate(CUsurfObject* pSurfObject, const CUDA_RESOURCE_DESC* pResDesc) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuSurfObjectDestroy' in found_functions}} - cdef CUresult cuSurfObjectDestroy(CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuSurfObjectGetResourceDesc' in found_functions}} - cdef CUresult cuSurfObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTensorMapEncodeTiled' in found_functions}} - cdef CUresult cuTensorMapEncodeTiled(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, const cuuint32_t* boxDim, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTensorMapEncodeIm2col' in found_functions}} - cdef CUresult cuTensorMapEncodeIm2col(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, const int* pixelBoxLowerCorner, const int* pixelBoxUpperCorner, cuuint32_t channelsPerPixel, cuuint32_t pixelsPerColumn, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTensorMapEncodeIm2colWide' in found_functions}} - cdef CUresult cuTensorMapEncodeIm2colWide(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, int pixelBoxLowerCornerWidth, int pixelBoxUpperCornerWidth, cuuint32_t channelsPerPixel, cuuint32_t pixelsPerColumn, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapIm2ColWideMode mode, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuTensorMapReplaceAddress' in found_functions}} - cdef CUresult cuTensorMapReplaceAddress(CUtensorMap* tensorMap, void* globalAddress) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceCanAccessPeer' in found_functions}} - cdef CUresult cuDeviceCanAccessPeer(int* canAccessPeer, CUdevice dev, CUdevice peerDev) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxEnablePeerAccess' in found_functions}} - cdef CUresult cuCtxEnablePeerAccess(CUcontext peerContext, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxDisablePeerAccess' in found_functions}} - cdef CUresult cuCtxDisablePeerAccess(CUcontext peerContext) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetP2PAttribute' in found_functions}} - 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 -{{endif}} - -{{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}} - cdef CUresult cuGraphicsSubResourceGetMappedArray(CUarray* pArray, CUgraphicsResource resource, unsigned int arrayIndex, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}} - cdef CUresult cuGraphicsResourceGetMappedMipmappedArray(CUmipmappedArray* pMipmappedArray, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}} - cdef CUresult cuGraphicsResourceGetMappedPointer(CUdeviceptr* pDevPtr, size_t* pSize, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}} - cdef CUresult cuGraphicsResourceSetMapFlags(CUgraphicsResource resource, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphicsMapResources' in found_functions}} - cdef CUresult cuGraphicsMapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGraphicsUnmapResources' in found_functions}} - cdef CUresult cuGraphicsUnmapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGetProcAddress_v2' in found_functions}} - cdef CUresult cuGetProcAddress(const char* symbol, void** pfn, int cudaVersion, cuuint64_t flags, CUdriverProcAddressQueryResult* symbolStatus) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCoredumpGetAttribute' in found_functions}} - cdef CUresult cuCoredumpGetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCoredumpGetAttributeGlobal' in found_functions}} - cdef CUresult cuCoredumpGetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCoredumpSetAttribute' in found_functions}} - cdef CUresult cuCoredumpSetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCoredumpSetAttributeGlobal' in found_functions}} - cdef CUresult cuCoredumpSetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCoredumpRegisterStartCallback' in found_functions}} - -cdef CUresult cuCoredumpRegisterStartCallback(CUcoredumpStatusCallback callback, void* userData, CUcoredumpCallbackHandle* callbackOut) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCoredumpRegisterCompleteCallback' in found_functions}} - -cdef CUresult cuCoredumpRegisterCompleteCallback(CUcoredumpStatusCallback callback, void* userData, CUcoredumpCallbackHandle* callbackOut) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCoredumpDeregisterStartCallback' in found_functions}} - -cdef CUresult cuCoredumpDeregisterStartCallback(CUcoredumpCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCoredumpDeregisterCompleteCallback' in found_functions}} - -cdef CUresult cuCoredumpDeregisterCompleteCallback(CUcoredumpCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGetExportTable' in found_functions}} - cdef CUresult cuGetExportTable(const void** ppExportTable, const CUuuid* pExportTableId) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGreenCtxCreate' in found_functions}} - cdef CUresult cuGreenCtxCreate(CUgreenCtx* phCtx, CUdevResourceDesc desc, CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGreenCtxDestroy' in found_functions}} - cdef CUresult cuGreenCtxDestroy(CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxFromGreenCtx' in found_functions}} - cdef CUresult cuCtxFromGreenCtx(CUcontext* pContext, CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDeviceGetDevResource' in found_functions}} - -cdef CUresult cuDeviceGetDevResource(CUdevice device, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCtxGetDevResource' in found_functions}} - -cdef CUresult cuCtxGetDevResource(CUcontext hCtx, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGreenCtxGetDevResource' in found_functions}} - -cdef CUresult cuGreenCtxGetDevResource(CUgreenCtx hCtx, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDevSmResourceSplitByCount' in found_functions}} - +cdef CUresult cuDeviceGetDevResource(CUdevice device, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxGetDevResource(CUcontext hCtx, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGreenCtxGetDevResource(CUgreenCtx hCtx, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult cuDevSmResourceSplitByCount(CUdevResource* result, unsigned int* nbGroups, const CUdevResource* input, CUdevResource* remainder, unsigned int flags, unsigned int minCount) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDevSmResourceSplit' in found_functions}} - -cdef CUresult cuDevSmResourceSplit(CUdevResource* result, unsigned int nbGroups, const CUdevResource* input, CUdevResource* remainder, unsigned int flags, CU_DEV_SM_RESOURCE_GROUP_PARAMS* groupParams) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuDevResourceGenerateDesc' in found_functions}} - cdef CUresult cuDevResourceGenerateDesc(CUdevResourceDesc* phDesc, CUdevResource* resources, unsigned int nbResources) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGreenCtxRecordEvent' in found_functions}} - cdef CUresult cuGreenCtxRecordEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGreenCtxWaitEvent' in found_functions}} - cdef CUresult cuGreenCtxWaitEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuStreamGetGreenCtx' in found_functions}} - cdef CUresult cuStreamGetGreenCtx(CUstream hStream, CUgreenCtx* phCtx) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuGreenCtxStreamCreate' in found_functions}} - 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 'cuStreamGetDevResource' in found_functions}} - -cdef CUresult cuStreamGetDevResource(CUstream hStream, CUdevResource* resource, CUdevResourceType typename) 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 -{{endif}} - -{{if 'cuLogsUnregisterCallback' in found_functions}} - cdef CUresult cuLogsUnregisterCallback(CUlogsCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLogsCurrent' in found_functions}} - cdef CUresult cuLogsCurrent(CUlogIterator* iterator_out, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLogsDumpToFile' in found_functions}} - cdef CUresult cuLogsDumpToFile(CUlogIterator* iterator, const char* pathToFile, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuLogsDumpToMemory' in found_functions}} - cdef CUresult cuLogsDumpToMemory(CUlogIterator* iterator, char* buffer, size_t* size, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}} - cdef CUresult cuCheckpointProcessGetRestoreThreadId(int pid, int* tid) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCheckpointProcessGetState' in found_functions}} - cdef CUresult cuCheckpointProcessGetState(int pid, CUprocessState* state) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCheckpointProcessLock' in found_functions}} - cdef CUresult cuCheckpointProcessLock(int pid, CUcheckpointLockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuCheckpointProcessCheckpoint' in found_functions}} - 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 -{{endif}} - -{{if 'cuProfilerStart' in found_functions}} - -cdef CUresult cuProfilerStart() except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if 'cuProfilerStop' in found_functions}} - -cdef CUresult cuProfilerStop() except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult cuGraphicsEGLRegisterImage(CUgraphicsResource* pCudaResource, EGLImageKHR image, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult cuEGLStreamConsumerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult cuEGLStreamConsumerConnectWithFlags(CUeglStreamConnection* conn, EGLStreamKHR stream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult cuEGLStreamConsumerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult cuEGLStreamConsumerAcquireFrame(CUeglStreamConnection* conn, CUgraphicsResource* pCudaResource, CUstream* pStream, unsigned int timeout) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult cuEGLStreamConsumerReleaseFrame(CUeglStreamConnection* conn, CUgraphicsResource pCudaResource, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult cuEGLStreamProducerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream, EGLint width, EGLint height) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult cuEGLStreamProducerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult cuEGLStreamProducerPresentFrame(CUeglStreamConnection* conn, CUeglFrame eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult cuEGLStreamProducerReturnFrame(CUeglStreamConnection* conn, CUeglFrame* eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult cuGraphicsResourceGetMappedEglFrame(CUeglFrame* eglFrame, CUgraphicsResource resource, unsigned int index, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult cuEventCreateFromEGLSync(CUevent* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult cuGraphicsGLRegisterBuffer(CUgraphicsResource* pCudaResource, GLuint buffer, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult cuGraphicsGLRegisterImage(CUgraphicsResource* pCudaResource, GLuint image, GLenum target, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult cuGLGetDevices(unsigned int* pCudaDeviceCount, CUdevice* pCudaDevices, unsigned int cudaDeviceCount, CUGLDeviceList deviceList) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - +cdef CUresult cuGLCtxCreate(CUcontext* pCtx, unsigned int Flags, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGLInit() except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGLRegisterBufferObject(GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGLMapBufferObject(CUdeviceptr* dptr, size_t* size, GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGLUnmapBufferObject(GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGLUnregisterBufferObject(GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGLSetBufferObjectMapFlags(GLuint buffer, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGLMapBufferObjectAsync(CUdeviceptr* dptr, size_t* size, GLuint buffer, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGLUnmapBufferObjectAsync(GLuint buffer, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuProfilerInitialize(const char* configFile, const char* outputFile, CUoutput_mode outputMode) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuProfilerStart() except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuProfilerStop() except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult cuVDPAUGetDevice(CUdevice* pDevice, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult cuVDPAUCtxCreate(CUcontext* pCtx, unsigned int flags, CUdevice device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult cuGraphicsVDPAURegisterVideoSurface(CUgraphicsResource* pCudaResource, VdpVideoSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -{{if True}} - cdef CUresult cuGraphicsVDPAURegisterOutputSurface(CUgraphicsResource* pCudaResource, VdpOutputSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil -{{endif}} - -cdef enum: CUDA_VERSION = 13020 +cdef CUresult cuDeviceGetHostAtomicCapabilities(unsigned int* capabilities, const CUatomicOperation* operations, unsigned int count, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxGetDevice_v2(CUdevice* device, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCtxSynchronize_v2(CUcontext ctx) 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 +cdef CUresult cuMemcpy3DBatchAsync(size_t numOps, CUDA_MEMCPY3D_BATCH_OP* opList, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemGetDefaultMemPool(CUmemoryPool* pool_out, CUmemLocation* location, CUmemAllocationType type) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemGetMemPool(CUmemoryPool* pool, CUmemLocation* location, CUmemAllocationType type) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemSetMemPool(CUmemLocation* location, CUmemAllocationType type, CUmemoryPool pool) 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 +cdef CUresult cuMemDiscardBatchAsync(CUdeviceptr* dptrs, size_t* sizes, size_t count, unsigned long long flags, CUstream hStream) 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 +cdef CUresult cuDeviceGetP2PAtomicCapabilities(unsigned int* capabilities, const CUatomicOperation* operations, unsigned int count, CUdevice srcDevice, CUdevice dstDevice) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGreenCtxGetId(CUgreenCtx greenCtx, unsigned long long* greenCtxId) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMulticastBindMem_v2(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, CUmemGenericAllocationHandle memHandle, size_t memOffset, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMulticastBindAddr_v2(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, CUdeviceptr memptr, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphNodeGetContainingGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphNodeGetLocalId(CUgraphNode hNode, unsigned int* nodeId) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphNodeGetToolsId(CUgraphNode hNode, unsigned long long* toolsNodeId) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphGetId(CUgraph hGraph, unsigned int* graphId) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphExecGetId(CUgraphExec hGraphExec, unsigned int* graphId) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDevSmResourceSplit(CUdevResource* result, unsigned int nbGroups, const CUdevResource* input, CUdevResource* remainder, unsigned int flags, CU_DEV_SM_RESOURCE_GROUP_PARAMS* groupParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamGetDevResource(CUstream hStream, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuKernelGetParamCount(CUkernel kernel, size_t* paramCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpyWithAttributesAsync(CUdeviceptr dst, CUdeviceptr src, size_t size, CUmemcpyAttributes* attr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemcpy3DWithAttributesAsync(CUDA_MEMCPY3D_BATCH_OP* op, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamBeginCaptureToCig(CUstream hStream, CUstreamCigCaptureParams* streamCigCaptureParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamEndCaptureToCig(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuFuncGetParamCount(CUfunction func, size_t* paramCount) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLaunchHostFunc_v2(CUstream hStream, CUhostFn fn, void* userData, unsigned int syncMode) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphNodeGetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCoredumpRegisterStartCallback(CUcoredumpStatusCallback callback, void* userData, CUcoredumpCallbackHandle* callbackOut) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCoredumpRegisterCompleteCallback(CUcoredumpStatusCallback callback, void* userData, CUcoredumpCallbackHandle* callbackOut) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCoredumpDeregisterStartCallback(CUcoredumpCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCoredumpDeregisterCompleteCallback(CUcoredumpCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLogicalEndpointIdReserve(CUlogicalEndpointId* baseLeId, cuuint32_t count) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLogicalEndpointIdRelease(CUlogicalEndpointId baseLeId, cuuint32_t count) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLogicalEndpointCreate(CUlogicalEndpointId leId, const CUlogicalEndpointProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLogicalEndpointAddDevice(CUlogicalEndpointId leId, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLogicalEndpointDestroy(CUlogicalEndpointId leId) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLogicalEndpointBindAddr(CUlogicalEndpointId leId, CUdevice dev, cuuint64_t offset, void* ptr, cuuint64_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLogicalEndpointBindMem(CUlogicalEndpointId leId, CUdevice dev, cuuint64_t offset, CUmemGenericAllocationHandle memHandle, cuuint64_t memOffset, cuuint64_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLogicalEndpointUnbind(CUlogicalEndpointId leId, CUdevice dev, cuuint64_t offset, cuuint64_t size) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLogicalEndpointExport(void* handle, CUlogicalEndpointId leId, CUlogicalEndpointIpcHandleType handleType) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLogicalEndpointImport(CUlogicalEndpointId leId, const void* handle, CUlogicalEndpointIpcHandleType handleType) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLogicalEndpointGetLimits(cuuint64_t* bindAlignment, cuuint64_t* maxSize, const CUlogicalEndpointProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuLogicalEndpointQuery(CUlogicalEndpointId leId, cuuint32_t count, int* queryStatus) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuStreamBeginRecaptureToGraph(CUstream hStream, CUstreamCaptureMode mode, CUgraph hGraph, CUgraphRecaptureCallback callbackFunc, void* userData) except ?CUDA_ERROR_NOT_FOUND nogil + + +# TODO: Extract these defines somehow? cdef enum: CU_IPC_HANDLE_SIZE = 64 @@ -5409,4 +3776,8 @@ cdef enum: CU_DEVICE_INVALID = -2 cdef enum: MAX_PLANES = 3 -cdef enum: CUDA_EGL_INFINITE_TIMEOUT = 4294967295 \ No newline at end of file +cdef enum: CUDA_EGL_INFINITE_TIMEOUT = 4294967295 + +cdef enum: RESOURCE_ABI_VERSION = 1 + +cdef enum: RESOURCE_ABI_EXTERNAL_BYTES = 42 diff --git a/cuda_bindings/cuda/bindings/cydriver.pyx.in b/cuda_bindings/cuda/bindings/cydriver.pyx similarity index 50% rename from cuda_bindings/cuda/bindings/cydriver.pyx.in rename to cuda_bindings/cuda/bindings/cydriver.pyx index d1d7efa23b8..2ca1d97644e 100644 --- a/cuda_bindings/cuda/bindings/cydriver.pyx.in +++ b/cuda_bindings/cuda/bindings/cydriver.pyx @@ -1,2951 +1,2075 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. -# This code was automatically generated with version 13.2.0, generator version 8797618. Do not modify it directly. -cimport cuda.bindings._bindings.cydriver as cydriver - -{{if 'cuGetErrorString' in found_functions}} +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=5b828e2ee0de9b245c71a6ba9361656ab10f7564caa7e3d9c162b2c6a07fb3df +from ._internal cimport driver as _driver cdef CUresult cuGetErrorString(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGetErrorString(error, pStr) -{{endif}} + return _driver._cuGetErrorString(error, pStr) -{{if 'cuGetErrorName' in found_functions}} cdef CUresult cuGetErrorName(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGetErrorName(error, pStr) -{{endif}} + return _driver._cuGetErrorName(error, pStr) -{{if 'cuInit' in found_functions}} cdef CUresult cuInit(unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuInit(Flags) -{{endif}} + return _driver._cuInit(Flags) -{{if 'cuDriverGetVersion' in found_functions}} cdef CUresult cuDriverGetVersion(int* driverVersion) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDriverGetVersion(driverVersion) -{{endif}} + return _driver._cuDriverGetVersion(driverVersion) -{{if 'cuDeviceGet' in found_functions}} cdef CUresult cuDeviceGet(CUdevice* device, int ordinal) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceGet(device, ordinal) -{{endif}} + return _driver._cuDeviceGet(device, ordinal) -{{if 'cuDeviceGetCount' in found_functions}} cdef CUresult cuDeviceGetCount(int* count) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceGetCount(count) -{{endif}} + return _driver._cuDeviceGetCount(count) -{{if 'cuDeviceGetName' in found_functions}} -cdef CUresult cuDeviceGetName(char* name, int length, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceGetName(name, length, dev) -{{endif}} +cdef CUresult cuDeviceGetName(char* name, int len, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetName(name, len, dev) -{{if 'cuDeviceGetUuid_v2' in found_functions}} cdef CUresult cuDeviceGetUuid(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceGetUuid_v2(uuid, dev) -{{endif}} + return _driver._cuDeviceGetUuid_v2(uuid, dev) -{{if 'cuDeviceGetLuid' in found_functions}} cdef CUresult cuDeviceGetLuid(char* luid, unsigned int* deviceNodeMask, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceGetLuid(luid, deviceNodeMask, dev) -{{endif}} + return _driver._cuDeviceGetLuid(luid, deviceNodeMask, dev) -{{if 'cuDeviceTotalMem_v2' in found_functions}} -cdef CUresult cuDeviceTotalMem(size_t* numbytes, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceTotalMem_v2(numbytes, dev) -{{endif}} +cdef CUresult cuDeviceTotalMem(size_t* bytes, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceTotalMem_v2(bytes, dev) -{{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}} -cdef CUresult cuDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, CUarray_format pformat, unsigned numChannels, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceGetTexture1DLinearMaxWidth(maxWidthInElements, pformat, numChannels, dev) -{{endif}} +cdef CUresult cuDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements, CUarray_format format, unsigned numChannels, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetTexture1DLinearMaxWidth(maxWidthInElements, format, numChannels, dev) -{{if 'cuDeviceGetAttribute' in found_functions}} cdef CUresult cuDeviceGetAttribute(int* pi, CUdevice_attribute attrib, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceGetAttribute(pi, attrib, dev) -{{endif}} - -{{if 'cuDeviceGetHostAtomicCapabilities' in found_functions}} + return _driver._cuDeviceGetAttribute(pi, attrib, dev) -cdef CUresult cuDeviceGetHostAtomicCapabilities(unsigned int* capabilities, const CUatomicOperation* operations, unsigned int count, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceGetHostAtomicCapabilities(capabilities, operations, count, dev) -{{endif}} - -{{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} cdef CUresult cuDeviceGetNvSciSyncAttributes(void* nvSciSyncAttrList, CUdevice dev, int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, dev, flags) -{{endif}} + return _driver._cuDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, dev, flags) -{{if 'cuDeviceSetMemPool' in found_functions}} cdef CUresult cuDeviceSetMemPool(CUdevice dev, CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceSetMemPool(dev, pool) -{{endif}} + return _driver._cuDeviceSetMemPool(dev, pool) -{{if 'cuDeviceGetMemPool' in found_functions}} cdef CUresult cuDeviceGetMemPool(CUmemoryPool* pool, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceGetMemPool(pool, dev) -{{endif}} + return _driver._cuDeviceGetMemPool(pool, dev) -{{if 'cuDeviceGetDefaultMemPool' in found_functions}} cdef CUresult cuDeviceGetDefaultMemPool(CUmemoryPool* pool_out, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceGetDefaultMemPool(pool_out, dev) -{{endif}} + return _driver._cuDeviceGetDefaultMemPool(pool_out, dev) -{{if 'cuDeviceGetExecAffinitySupport' in found_functions}} -cdef CUresult cuDeviceGetExecAffinitySupport(int* pi, CUexecAffinityType typename, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceGetExecAffinitySupport(pi, typename, dev) -{{endif}} +cdef CUresult cuDeviceGetExecAffinitySupport(int* pi, CUexecAffinityType type, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetExecAffinitySupport(pi, type, dev) -{{if 'cuFlushGPUDirectRDMAWrites' in found_functions}} cdef CUresult cuFlushGPUDirectRDMAWrites(CUflushGPUDirectRDMAWritesTarget target, CUflushGPUDirectRDMAWritesScope scope) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuFlushGPUDirectRDMAWrites(target, scope) -{{endif}} + return _driver._cuFlushGPUDirectRDMAWrites(target, scope) -{{if 'cuDeviceGetProperties' in found_functions}} cdef CUresult cuDeviceGetProperties(CUdevprop* prop, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceGetProperties(prop, dev) -{{endif}} + return _driver._cuDeviceGetProperties(prop, dev) -{{if 'cuDeviceComputeCapability' in found_functions}} cdef CUresult cuDeviceComputeCapability(int* major, int* minor, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceComputeCapability(major, minor, dev) -{{endif}} + return _driver._cuDeviceComputeCapability(major, minor, dev) -{{if 'cuDevicePrimaryCtxRetain' in found_functions}} cdef CUresult cuDevicePrimaryCtxRetain(CUcontext* pctx, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDevicePrimaryCtxRetain(pctx, dev) -{{endif}} + return _driver._cuDevicePrimaryCtxRetain(pctx, dev) -{{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}} cdef CUresult cuDevicePrimaryCtxRelease(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDevicePrimaryCtxRelease_v2(dev) -{{endif}} + return _driver._cuDevicePrimaryCtxRelease_v2(dev) -{{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}} cdef CUresult cuDevicePrimaryCtxSetFlags(CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDevicePrimaryCtxSetFlags_v2(dev, flags) -{{endif}} + return _driver._cuDevicePrimaryCtxSetFlags_v2(dev, flags) -{{if 'cuDevicePrimaryCtxGetState' in found_functions}} cdef CUresult cuDevicePrimaryCtxGetState(CUdevice dev, unsigned int* flags, int* active) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDevicePrimaryCtxGetState(dev, flags, active) -{{endif}} + return _driver._cuDevicePrimaryCtxGetState(dev, flags, active) -{{if 'cuDevicePrimaryCtxReset_v2' in found_functions}} cdef CUresult cuDevicePrimaryCtxReset(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDevicePrimaryCtxReset_v2(dev) -{{endif}} + return _driver._cuDevicePrimaryCtxReset_v2(dev) + + +cdef CUresult cuCtxCreate_v2(CUcontext* pctx, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxCreate_v2(pctx, flags, dev) + + +cdef CUresult cuCtxCreate_v3(CUcontext* pctx, CUexecAffinityParam* paramsArray, int numParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxCreate_v3(pctx, paramsArray, numParams, flags, dev) -{{if 'cuCtxCreate_v4' in found_functions}} cdef CUresult cuCtxCreate(CUcontext* pctx, CUctxCreateParams* ctxCreateParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxCreate_v4(pctx, ctxCreateParams, flags, dev) -{{endif}} + return _driver._cuCtxCreate_v4(pctx, ctxCreateParams, flags, dev) -{{if 'cuCtxDestroy_v2' in found_functions}} cdef CUresult cuCtxDestroy(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxDestroy_v2(ctx) -{{endif}} + return _driver._cuCtxDestroy_v2(ctx) -{{if 'cuCtxPushCurrent_v2' in found_functions}} cdef CUresult cuCtxPushCurrent(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxPushCurrent_v2(ctx) -{{endif}} + return _driver._cuCtxPushCurrent_v2(ctx) -{{if 'cuCtxPopCurrent_v2' in found_functions}} cdef CUresult cuCtxPopCurrent(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxPopCurrent_v2(pctx) -{{endif}} + return _driver._cuCtxPopCurrent_v2(pctx) -{{if 'cuCtxSetCurrent' in found_functions}} cdef CUresult cuCtxSetCurrent(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxSetCurrent(ctx) -{{endif}} + return _driver._cuCtxSetCurrent(ctx) -{{if 'cuCtxGetCurrent' in found_functions}} cdef CUresult cuCtxGetCurrent(CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxGetCurrent(pctx) -{{endif}} + return _driver._cuCtxGetCurrent(pctx) -{{if 'cuCtxGetDevice' in found_functions}} cdef CUresult cuCtxGetDevice(CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxGetDevice(device) -{{endif}} + return _driver._cuCtxGetDevice(device) -{{if 'cuCtxGetDevice_v2' in found_functions}} - -cdef CUresult cuCtxGetDevice_v2(CUdevice* device, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxGetDevice_v2(device, ctx) -{{endif}} - -{{if 'cuCtxGetFlags' in found_functions}} cdef CUresult cuCtxGetFlags(unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxGetFlags(flags) -{{endif}} + return _driver._cuCtxGetFlags(flags) -{{if 'cuCtxSetFlags' in found_functions}} cdef CUresult cuCtxSetFlags(unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxSetFlags(flags) -{{endif}} + return _driver._cuCtxSetFlags(flags) -{{if 'cuCtxGetId' in found_functions}} cdef CUresult cuCtxGetId(CUcontext ctx, unsigned long long* ctxId) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxGetId(ctx, ctxId) -{{endif}} + return _driver._cuCtxGetId(ctx, ctxId) -{{if 'cuCtxSynchronize' in found_functions}} cdef CUresult cuCtxSynchronize() except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxSynchronize() -{{endif}} - -{{if 'cuCtxSynchronize_v2' in found_functions}} - -cdef CUresult cuCtxSynchronize_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxSynchronize_v2(ctx) -{{endif}} + return _driver._cuCtxSynchronize() -{{if 'cuCtxSetLimit' in found_functions}} cdef CUresult cuCtxSetLimit(CUlimit limit, size_t value) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxSetLimit(limit, value) -{{endif}} + return _driver._cuCtxSetLimit(limit, value) -{{if 'cuCtxGetLimit' in found_functions}} cdef CUresult cuCtxGetLimit(size_t* pvalue, CUlimit limit) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxGetLimit(pvalue, limit) -{{endif}} + return _driver._cuCtxGetLimit(pvalue, limit) -{{if 'cuCtxGetCacheConfig' in found_functions}} cdef CUresult cuCtxGetCacheConfig(CUfunc_cache* pconfig) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxGetCacheConfig(pconfig) -{{endif}} + return _driver._cuCtxGetCacheConfig(pconfig) -{{if 'cuCtxSetCacheConfig' in found_functions}} cdef CUresult cuCtxSetCacheConfig(CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxSetCacheConfig(config) -{{endif}} + return _driver._cuCtxSetCacheConfig(config) -{{if 'cuCtxGetApiVersion' in found_functions}} cdef CUresult cuCtxGetApiVersion(CUcontext ctx, unsigned int* version) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxGetApiVersion(ctx, version) -{{endif}} + return _driver._cuCtxGetApiVersion(ctx, version) -{{if 'cuCtxGetStreamPriorityRange' in found_functions}} cdef CUresult cuCtxGetStreamPriorityRange(int* leastPriority, int* greatestPriority) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxGetStreamPriorityRange(leastPriority, greatestPriority) -{{endif}} + return _driver._cuCtxGetStreamPriorityRange(leastPriority, greatestPriority) -{{if 'cuCtxResetPersistingL2Cache' in found_functions}} cdef CUresult cuCtxResetPersistingL2Cache() except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxResetPersistingL2Cache() -{{endif}} + return _driver._cuCtxResetPersistingL2Cache() -{{if 'cuCtxGetExecAffinity' in found_functions}} -cdef CUresult cuCtxGetExecAffinity(CUexecAffinityParam* pExecAffinity, CUexecAffinityType typename) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxGetExecAffinity(pExecAffinity, typename) -{{endif}} +cdef CUresult cuCtxGetExecAffinity(CUexecAffinityParam* pExecAffinity, CUexecAffinityType type) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxGetExecAffinity(pExecAffinity, type) -{{if 'cuCtxRecordEvent' in found_functions}} cdef CUresult cuCtxRecordEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxRecordEvent(hCtx, hEvent) -{{endif}} + return _driver._cuCtxRecordEvent(hCtx, hEvent) -{{if 'cuCtxWaitEvent' in found_functions}} cdef CUresult cuCtxWaitEvent(CUcontext hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxWaitEvent(hCtx, hEvent) -{{endif}} + return _driver._cuCtxWaitEvent(hCtx, hEvent) -{{if 'cuCtxAttach' in found_functions}} cdef CUresult cuCtxAttach(CUcontext* pctx, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxAttach(pctx, flags) -{{endif}} + return _driver._cuCtxAttach(pctx, flags) -{{if 'cuCtxDetach' in found_functions}} cdef CUresult cuCtxDetach(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxDetach(ctx) -{{endif}} + return _driver._cuCtxDetach(ctx) -{{if 'cuCtxGetSharedMemConfig' in found_functions}} cdef CUresult cuCtxGetSharedMemConfig(CUsharedconfig* pConfig) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxGetSharedMemConfig(pConfig) -{{endif}} + return _driver._cuCtxGetSharedMemConfig(pConfig) -{{if 'cuCtxSetSharedMemConfig' in found_functions}} cdef CUresult cuCtxSetSharedMemConfig(CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxSetSharedMemConfig(config) -{{endif}} + return _driver._cuCtxSetSharedMemConfig(config) -{{if 'cuModuleLoad' in found_functions}} cdef CUresult cuModuleLoad(CUmodule* module, const char* fname) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuModuleLoad(module, fname) -{{endif}} + return _driver._cuModuleLoad(module, fname) -{{if 'cuModuleLoadData' in found_functions}} cdef CUresult cuModuleLoadData(CUmodule* module, const void* image) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuModuleLoadData(module, image) -{{endif}} + return _driver._cuModuleLoadData(module, image) -{{if 'cuModuleLoadDataEx' in found_functions}} cdef CUresult cuModuleLoadDataEx(CUmodule* module, const void* image, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuModuleLoadDataEx(module, image, numOptions, options, optionValues) -{{endif}} + return _driver._cuModuleLoadDataEx(module, image, numOptions, options, optionValues) -{{if 'cuModuleLoadFatBinary' in found_functions}} cdef CUresult cuModuleLoadFatBinary(CUmodule* module, const void* fatCubin) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuModuleLoadFatBinary(module, fatCubin) -{{endif}} + return _driver._cuModuleLoadFatBinary(module, fatCubin) -{{if 'cuModuleUnload' in found_functions}} cdef CUresult cuModuleUnload(CUmodule hmod) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuModuleUnload(hmod) -{{endif}} + return _driver._cuModuleUnload(hmod) -{{if 'cuModuleGetLoadingMode' in found_functions}} cdef CUresult cuModuleGetLoadingMode(CUmoduleLoadingMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuModuleGetLoadingMode(mode) -{{endif}} + return _driver._cuModuleGetLoadingMode(mode) -{{if 'cuModuleGetFunction' in found_functions}} cdef CUresult cuModuleGetFunction(CUfunction* hfunc, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuModuleGetFunction(hfunc, hmod, name) -{{endif}} + return _driver._cuModuleGetFunction(hfunc, hmod, name) -{{if 'cuModuleGetFunctionCount' in found_functions}} cdef CUresult cuModuleGetFunctionCount(unsigned int* count, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuModuleGetFunctionCount(count, mod) -{{endif}} + return _driver._cuModuleGetFunctionCount(count, mod) -{{if 'cuModuleEnumerateFunctions' in found_functions}} cdef CUresult cuModuleEnumerateFunctions(CUfunction* functions, unsigned int numFunctions, CUmodule mod) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuModuleEnumerateFunctions(functions, numFunctions, mod) -{{endif}} + return _driver._cuModuleEnumerateFunctions(functions, numFunctions, mod) -{{if 'cuModuleGetGlobal_v2' in found_functions}} -cdef CUresult cuModuleGetGlobal(CUdeviceptr* dptr, size_t* numbytes, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuModuleGetGlobal_v2(dptr, numbytes, hmod, name) -{{endif}} +cdef CUresult cuModuleGetGlobal(CUdeviceptr* dptr, size_t* bytes, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuModuleGetGlobal_v2(dptr, bytes, hmod, name) -{{if 'cuLinkCreate_v2' in found_functions}} cdef CUresult cuLinkCreate(unsigned int numOptions, CUjit_option* options, void** optionValues, CUlinkState* stateOut) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLinkCreate_v2(numOptions, options, optionValues, stateOut) -{{endif}} + return _driver._cuLinkCreate_v2(numOptions, options, optionValues, stateOut) -{{if 'cuLinkAddData_v2' in found_functions}} -cdef CUresult cuLinkAddData(CUlinkState state, CUjitInputType typename, void* data, size_t size, const char* name, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLinkAddData_v2(state, typename, data, size, name, numOptions, options, optionValues) -{{endif}} +cdef CUresult cuLinkAddData(CUlinkState state, CUjitInputType type, void* data, size_t size, const char* name, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLinkAddData_v2(state, type, data, size, name, numOptions, options, optionValues) -{{if 'cuLinkAddFile_v2' in found_functions}} -cdef CUresult cuLinkAddFile(CUlinkState state, CUjitInputType typename, const char* path, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLinkAddFile_v2(state, typename, path, numOptions, options, optionValues) -{{endif}} +cdef CUresult cuLinkAddFile(CUlinkState state, CUjitInputType type, const char* path, unsigned int numOptions, CUjit_option* options, void** optionValues) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLinkAddFile_v2(state, type, path, numOptions, options, optionValues) -{{if 'cuLinkComplete' in found_functions}} cdef CUresult cuLinkComplete(CUlinkState state, void** cubinOut, size_t* sizeOut) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLinkComplete(state, cubinOut, sizeOut) -{{endif}} + return _driver._cuLinkComplete(state, cubinOut, sizeOut) -{{if 'cuLinkDestroy' in found_functions}} cdef CUresult cuLinkDestroy(CUlinkState state) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLinkDestroy(state) -{{endif}} + return _driver._cuLinkDestroy(state) -{{if 'cuModuleGetTexRef' in found_functions}} cdef CUresult cuModuleGetTexRef(CUtexref* pTexRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuModuleGetTexRef(pTexRef, hmod, name) -{{endif}} + return _driver._cuModuleGetTexRef(pTexRef, hmod, name) -{{if 'cuModuleGetSurfRef' in found_functions}} cdef CUresult cuModuleGetSurfRef(CUsurfref* pSurfRef, CUmodule hmod, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuModuleGetSurfRef(pSurfRef, hmod, name) -{{endif}} + return _driver._cuModuleGetSurfRef(pSurfRef, hmod, name) -{{if 'cuLibraryLoadData' in found_functions}} cdef CUresult cuLibraryLoadData(CUlibrary* library, const void* code, CUjit_option* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, CUlibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLibraryLoadData(library, code, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions) -{{endif}} + return _driver._cuLibraryLoadData(library, code, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions) -{{if 'cuLibraryLoadFromFile' in found_functions}} cdef CUresult cuLibraryLoadFromFile(CUlibrary* library, const char* fileName, CUjit_option* jitOptions, void** jitOptionsValues, unsigned int numJitOptions, CUlibraryOption* libraryOptions, void** libraryOptionValues, unsigned int numLibraryOptions) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLibraryLoadFromFile(library, fileName, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions) -{{endif}} + return _driver._cuLibraryLoadFromFile(library, fileName, jitOptions, jitOptionsValues, numJitOptions, libraryOptions, libraryOptionValues, numLibraryOptions) -{{if 'cuLibraryUnload' in found_functions}} cdef CUresult cuLibraryUnload(CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLibraryUnload(library) -{{endif}} + return _driver._cuLibraryUnload(library) -{{if 'cuLibraryGetKernel' in found_functions}} cdef CUresult cuLibraryGetKernel(CUkernel* pKernel, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLibraryGetKernel(pKernel, library, name) -{{endif}} + return _driver._cuLibraryGetKernel(pKernel, library, name) -{{if 'cuLibraryGetKernelCount' in found_functions}} cdef CUresult cuLibraryGetKernelCount(unsigned int* count, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLibraryGetKernelCount(count, lib) -{{endif}} + return _driver._cuLibraryGetKernelCount(count, lib) -{{if 'cuLibraryEnumerateKernels' in found_functions}} cdef CUresult cuLibraryEnumerateKernels(CUkernel* kernels, unsigned int numKernels, CUlibrary lib) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLibraryEnumerateKernels(kernels, numKernels, lib) -{{endif}} + return _driver._cuLibraryEnumerateKernels(kernels, numKernels, lib) -{{if 'cuLibraryGetModule' in found_functions}} cdef CUresult cuLibraryGetModule(CUmodule* pMod, CUlibrary library) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLibraryGetModule(pMod, library) -{{endif}} + return _driver._cuLibraryGetModule(pMod, library) -{{if 'cuKernelGetFunction' in found_functions}} cdef CUresult cuKernelGetFunction(CUfunction* pFunc, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuKernelGetFunction(pFunc, kernel) -{{endif}} + return _driver._cuKernelGetFunction(pFunc, kernel) -{{if 'cuKernelGetLibrary' in found_functions}} cdef CUresult cuKernelGetLibrary(CUlibrary* pLib, CUkernel kernel) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuKernelGetLibrary(pLib, kernel) -{{endif}} + return _driver._cuKernelGetLibrary(pLib, kernel) -{{if 'cuLibraryGetGlobal' in found_functions}} -cdef CUresult cuLibraryGetGlobal(CUdeviceptr* dptr, size_t* numbytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLibraryGetGlobal(dptr, numbytes, library, name) -{{endif}} +cdef CUresult cuLibraryGetGlobal(CUdeviceptr* dptr, size_t* bytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLibraryGetGlobal(dptr, bytes, library, name) -{{if 'cuLibraryGetManaged' in found_functions}} -cdef CUresult cuLibraryGetManaged(CUdeviceptr* dptr, size_t* numbytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLibraryGetManaged(dptr, numbytes, library, name) -{{endif}} +cdef CUresult cuLibraryGetManaged(CUdeviceptr* dptr, size_t* bytes, CUlibrary library, const char* name) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLibraryGetManaged(dptr, bytes, library, name) -{{if 'cuLibraryGetUnifiedFunction' in found_functions}} cdef CUresult cuLibraryGetUnifiedFunction(void** fptr, CUlibrary library, const char* symbol) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLibraryGetUnifiedFunction(fptr, library, symbol) -{{endif}} + return _driver._cuLibraryGetUnifiedFunction(fptr, library, symbol) -{{if 'cuKernelGetAttribute' in found_functions}} cdef CUresult cuKernelGetAttribute(int* pi, CUfunction_attribute attrib, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuKernelGetAttribute(pi, attrib, kernel, dev) -{{endif}} + return _driver._cuKernelGetAttribute(pi, attrib, kernel, dev) -{{if 'cuKernelSetAttribute' in found_functions}} cdef CUresult cuKernelSetAttribute(CUfunction_attribute attrib, int val, CUkernel kernel, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuKernelSetAttribute(attrib, val, kernel, dev) -{{endif}} + return _driver._cuKernelSetAttribute(attrib, val, kernel, dev) -{{if 'cuKernelSetCacheConfig' in found_functions}} cdef CUresult cuKernelSetCacheConfig(CUkernel kernel, CUfunc_cache config, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuKernelSetCacheConfig(kernel, config, dev) -{{endif}} + return _driver._cuKernelSetCacheConfig(kernel, config, dev) -{{if 'cuKernelGetName' in found_functions}} cdef CUresult cuKernelGetName(const char** name, CUkernel hfunc) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuKernelGetName(name, hfunc) -{{endif}} + return _driver._cuKernelGetName(name, hfunc) -{{if 'cuKernelGetParamInfo' in found_functions}} cdef CUresult cuKernelGetParamInfo(CUkernel kernel, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuKernelGetParamInfo(kernel, paramIndex, paramOffset, paramSize) -{{endif}} - -{{if 'cuKernelGetParamCount' in found_functions}} - -cdef CUresult cuKernelGetParamCount(CUkernel kernel, size_t* paramCount) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuKernelGetParamCount(kernel, paramCount) -{{endif}} + return _driver._cuKernelGetParamInfo(kernel, paramIndex, paramOffset, paramSize) -{{if 'cuMemGetInfo_v2' in found_functions}} cdef CUresult cuMemGetInfo(size_t* free, size_t* total) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemGetInfo_v2(free, total) -{{endif}} + return _driver._cuMemGetInfo_v2(free, total) -{{if 'cuMemAlloc_v2' in found_functions}} cdef CUresult cuMemAlloc(CUdeviceptr* dptr, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemAlloc_v2(dptr, bytesize) -{{endif}} + return _driver._cuMemAlloc_v2(dptr, bytesize) -{{if 'cuMemAllocPitch_v2' in found_functions}} cdef CUresult cuMemAllocPitch(CUdeviceptr* dptr, size_t* pPitch, size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemAllocPitch_v2(dptr, pPitch, WidthInBytes, Height, ElementSizeBytes) -{{endif}} + return _driver._cuMemAllocPitch_v2(dptr, pPitch, WidthInBytes, Height, ElementSizeBytes) -{{if 'cuMemFree_v2' in found_functions}} cdef CUresult cuMemFree(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemFree_v2(dptr) -{{endif}} + return _driver._cuMemFree_v2(dptr) -{{if 'cuMemGetAddressRange_v2' in found_functions}} cdef CUresult cuMemGetAddressRange(CUdeviceptr* pbase, size_t* psize, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemGetAddressRange_v2(pbase, psize, dptr) -{{endif}} + return _driver._cuMemGetAddressRange_v2(pbase, psize, dptr) -{{if 'cuMemAllocHost_v2' in found_functions}} cdef CUresult cuMemAllocHost(void** pp, size_t bytesize) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemAllocHost_v2(pp, bytesize) -{{endif}} + return _driver._cuMemAllocHost_v2(pp, bytesize) -{{if 'cuMemFreeHost' in found_functions}} cdef CUresult cuMemFreeHost(void* p) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemFreeHost(p) -{{endif}} + return _driver._cuMemFreeHost(p) -{{if 'cuMemHostAlloc' in found_functions}} cdef CUresult cuMemHostAlloc(void** pp, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemHostAlloc(pp, bytesize, Flags) -{{endif}} + return _driver._cuMemHostAlloc(pp, bytesize, Flags) -{{if 'cuMemHostGetDevicePointer_v2' in found_functions}} cdef CUresult cuMemHostGetDevicePointer(CUdeviceptr* pdptr, void* p, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemHostGetDevicePointer_v2(pdptr, p, Flags) -{{endif}} + return _driver._cuMemHostGetDevicePointer_v2(pdptr, p, Flags) -{{if 'cuMemHostGetFlags' in found_functions}} cdef CUresult cuMemHostGetFlags(unsigned int* pFlags, void* p) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemHostGetFlags(pFlags, p) -{{endif}} + return _driver._cuMemHostGetFlags(pFlags, p) -{{if 'cuMemAllocManaged' in found_functions}} cdef CUresult cuMemAllocManaged(CUdeviceptr* dptr, size_t bytesize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemAllocManaged(dptr, bytesize, flags) -{{endif}} + return _driver._cuMemAllocManaged(dptr, bytesize, flags) -{{if 'cuDeviceRegisterAsyncNotification' in found_functions}} cdef CUresult cuDeviceRegisterAsyncNotification(CUdevice device, CUasyncCallback callbackFunc, void* userData, CUasyncCallbackHandle* callback) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceRegisterAsyncNotification(device, callbackFunc, userData, callback) -{{endif}} + return _driver._cuDeviceRegisterAsyncNotification(device, callbackFunc, userData, callback) -{{if 'cuDeviceUnregisterAsyncNotification' in found_functions}} cdef CUresult cuDeviceUnregisterAsyncNotification(CUdevice device, CUasyncCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceUnregisterAsyncNotification(device, callback) -{{endif}} + return _driver._cuDeviceUnregisterAsyncNotification(device, callback) -{{if 'cuDeviceGetByPCIBusId' in found_functions}} cdef CUresult cuDeviceGetByPCIBusId(CUdevice* dev, const char* pciBusId) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceGetByPCIBusId(dev, pciBusId) -{{endif}} + return _driver._cuDeviceGetByPCIBusId(dev, pciBusId) -{{if 'cuDeviceGetPCIBusId' in found_functions}} -cdef CUresult cuDeviceGetPCIBusId(char* pciBusId, int length, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceGetPCIBusId(pciBusId, length, dev) -{{endif}} +cdef CUresult cuDeviceGetPCIBusId(char* pciBusId, int len, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetPCIBusId(pciBusId, len, dev) -{{if 'cuIpcGetEventHandle' in found_functions}} cdef CUresult cuIpcGetEventHandle(CUipcEventHandle* pHandle, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuIpcGetEventHandle(pHandle, event) -{{endif}} + return _driver._cuIpcGetEventHandle(pHandle, event) -{{if 'cuIpcOpenEventHandle' in found_functions}} cdef CUresult cuIpcOpenEventHandle(CUevent* phEvent, CUipcEventHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuIpcOpenEventHandle(phEvent, handle) -{{endif}} + return _driver._cuIpcOpenEventHandle(phEvent, handle) -{{if 'cuIpcGetMemHandle' in found_functions}} cdef CUresult cuIpcGetMemHandle(CUipcMemHandle* pHandle, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuIpcGetMemHandle(pHandle, dptr) -{{endif}} + return _driver._cuIpcGetMemHandle(pHandle, dptr) -{{if 'cuIpcOpenMemHandle_v2' in found_functions}} cdef CUresult cuIpcOpenMemHandle(CUdeviceptr* pdptr, CUipcMemHandle handle, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuIpcOpenMemHandle_v2(pdptr, handle, Flags) -{{endif}} + return _driver._cuIpcOpenMemHandle_v2(pdptr, handle, Flags) -{{if 'cuIpcCloseMemHandle' in found_functions}} cdef CUresult cuIpcCloseMemHandle(CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuIpcCloseMemHandle(dptr) -{{endif}} + return _driver._cuIpcCloseMemHandle(dptr) -{{if 'cuMemHostRegister_v2' in found_functions}} cdef CUresult cuMemHostRegister(void* p, size_t bytesize, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemHostRegister_v2(p, bytesize, Flags) -{{endif}} + return _driver._cuMemHostRegister_v2(p, bytesize, Flags) -{{if 'cuMemHostUnregister' in found_functions}} cdef CUresult cuMemHostUnregister(void* p) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemHostUnregister(p) -{{endif}} + return _driver._cuMemHostUnregister(p) -{{if 'cuMemcpy' in found_functions}} cdef CUresult cuMemcpy(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpy(dst, src, ByteCount) -{{endif}} + return _driver._cuMemcpy(dst, src, ByteCount) -{{if 'cuMemcpyPeer' in found_functions}} cdef CUresult cuMemcpyPeer(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpyPeer(dstDevice, dstContext, srcDevice, srcContext, ByteCount) -{{endif}} + return _driver._cuMemcpyPeer(dstDevice, dstContext, srcDevice, srcContext, ByteCount) -{{if 'cuMemcpyHtoD_v2' in found_functions}} cdef CUresult cuMemcpyHtoD(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpyHtoD_v2(dstDevice, srcHost, ByteCount) -{{endif}} + return _driver._cuMemcpyHtoD_v2(dstDevice, srcHost, ByteCount) -{{if 'cuMemcpyDtoH_v2' in found_functions}} cdef CUresult cuMemcpyDtoH(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpyDtoH_v2(dstHost, srcDevice, ByteCount) -{{endif}} + return _driver._cuMemcpyDtoH_v2(dstHost, srcDevice, ByteCount) -{{if 'cuMemcpyDtoD_v2' in found_functions}} cdef CUresult cuMemcpyDtoD(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpyDtoD_v2(dstDevice, srcDevice, ByteCount) -{{endif}} + return _driver._cuMemcpyDtoD_v2(dstDevice, srcDevice, ByteCount) -{{if 'cuMemcpyDtoA_v2' in found_functions}} cdef CUresult cuMemcpyDtoA(CUarray dstArray, size_t dstOffset, CUdeviceptr srcDevice, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpyDtoA_v2(dstArray, dstOffset, srcDevice, ByteCount) -{{endif}} + return _driver._cuMemcpyDtoA_v2(dstArray, dstOffset, srcDevice, ByteCount) -{{if 'cuMemcpyAtoD_v2' in found_functions}} cdef CUresult cuMemcpyAtoD(CUdeviceptr dstDevice, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpyAtoD_v2(dstDevice, srcArray, srcOffset, ByteCount) -{{endif}} + return _driver._cuMemcpyAtoD_v2(dstDevice, srcArray, srcOffset, ByteCount) -{{if 'cuMemcpyHtoA_v2' in found_functions}} cdef CUresult cuMemcpyHtoA(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpyHtoA_v2(dstArray, dstOffset, srcHost, ByteCount) -{{endif}} + return _driver._cuMemcpyHtoA_v2(dstArray, dstOffset, srcHost, ByteCount) -{{if 'cuMemcpyAtoH_v2' in found_functions}} cdef CUresult cuMemcpyAtoH(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpyAtoH_v2(dstHost, srcArray, srcOffset, ByteCount) -{{endif}} + return _driver._cuMemcpyAtoH_v2(dstHost, srcArray, srcOffset, ByteCount) -{{if 'cuMemcpyAtoA_v2' in found_functions}} cdef CUresult cuMemcpyAtoA(CUarray dstArray, size_t dstOffset, CUarray srcArray, size_t srcOffset, size_t ByteCount) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpyAtoA_v2(dstArray, dstOffset, srcArray, srcOffset, ByteCount) -{{endif}} + return _driver._cuMemcpyAtoA_v2(dstArray, dstOffset, srcArray, srcOffset, ByteCount) -{{if 'cuMemcpy2D_v2' in found_functions}} cdef CUresult cuMemcpy2D(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpy2D_v2(pCopy) -{{endif}} + return _driver._cuMemcpy2D_v2(pCopy) -{{if 'cuMemcpy2DUnaligned_v2' in found_functions}} cdef CUresult cuMemcpy2DUnaligned(const CUDA_MEMCPY2D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpy2DUnaligned_v2(pCopy) -{{endif}} + return _driver._cuMemcpy2DUnaligned_v2(pCopy) -{{if 'cuMemcpy3D_v2' in found_functions}} cdef CUresult cuMemcpy3D(const CUDA_MEMCPY3D* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpy3D_v2(pCopy) -{{endif}} + return _driver._cuMemcpy3D_v2(pCopy) -{{if 'cuMemcpy3DPeer' in found_functions}} cdef CUresult cuMemcpy3DPeer(const CUDA_MEMCPY3D_PEER* pCopy) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpy3DPeer(pCopy) -{{endif}} + return _driver._cuMemcpy3DPeer(pCopy) -{{if 'cuMemcpyAsync' in found_functions}} cdef CUresult cuMemcpyAsync(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpyAsync(dst, src, ByteCount, hStream) -{{endif}} + return _driver._cuMemcpyAsync(dst, src, ByteCount, hStream) -{{if 'cuMemcpyPeerAsync' in found_functions}} cdef CUresult cuMemcpyPeerAsync(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpyPeerAsync(dstDevice, dstContext, srcDevice, srcContext, ByteCount, hStream) -{{endif}} + return _driver._cuMemcpyPeerAsync(dstDevice, dstContext, srcDevice, srcContext, ByteCount, hStream) -{{if 'cuMemcpyHtoDAsync_v2' in found_functions}} cdef CUresult cuMemcpyHtoDAsync(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpyHtoDAsync_v2(dstDevice, srcHost, ByteCount, hStream) -{{endif}} + return _driver._cuMemcpyHtoDAsync_v2(dstDevice, srcHost, ByteCount, hStream) -{{if 'cuMemcpyDtoHAsync_v2' in found_functions}} cdef CUresult cuMemcpyDtoHAsync(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpyDtoHAsync_v2(dstHost, srcDevice, ByteCount, hStream) -{{endif}} + return _driver._cuMemcpyDtoHAsync_v2(dstHost, srcDevice, ByteCount, hStream) -{{if 'cuMemcpyDtoDAsync_v2' in found_functions}} cdef CUresult cuMemcpyDtoDAsync(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpyDtoDAsync_v2(dstDevice, srcDevice, ByteCount, hStream) -{{endif}} + return _driver._cuMemcpyDtoDAsync_v2(dstDevice, srcDevice, ByteCount, hStream) -{{if 'cuMemcpyHtoAAsync_v2' in found_functions}} cdef CUresult cuMemcpyHtoAAsync(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpyHtoAAsync_v2(dstArray, dstOffset, srcHost, ByteCount, hStream) -{{endif}} + return _driver._cuMemcpyHtoAAsync_v2(dstArray, dstOffset, srcHost, ByteCount, hStream) -{{if 'cuMemcpyAtoHAsync_v2' in found_functions}} cdef CUresult cuMemcpyAtoHAsync(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpyAtoHAsync_v2(dstHost, srcArray, srcOffset, ByteCount, hStream) -{{endif}} + return _driver._cuMemcpyAtoHAsync_v2(dstHost, srcArray, srcOffset, ByteCount, hStream) -{{if 'cuMemcpy2DAsync_v2' in found_functions}} cdef CUresult cuMemcpy2DAsync(const CUDA_MEMCPY2D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpy2DAsync_v2(pCopy, hStream) -{{endif}} + return _driver._cuMemcpy2DAsync_v2(pCopy, hStream) -{{if 'cuMemcpy3DAsync_v2' in found_functions}} cdef CUresult cuMemcpy3DAsync(const CUDA_MEMCPY3D* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpy3DAsync_v2(pCopy, hStream) -{{endif}} + return _driver._cuMemcpy3DAsync_v2(pCopy, hStream) -{{if 'cuMemcpy3DPeerAsync' in found_functions}} cdef CUresult cuMemcpy3DPeerAsync(const CUDA_MEMCPY3D_PEER* pCopy, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpy3DPeerAsync(pCopy, hStream) -{{endif}} + return _driver._cuMemcpy3DPeerAsync(pCopy, hStream) -{{if 'cuMemcpyBatchAsync_v2' in found_functions}} - -cdef CUresult cuMemcpyBatchAsync(CUdeviceptr* dsts, CUdeviceptr* srcs, size_t* sizes, size_t count, CUmemcpyAttributes* attrs, size_t* attrsIdxs, size_t numAttrs, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpyBatchAsync_v2(dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, hStream) -{{endif}} - -{{if 'cuMemcpy3DBatchAsync_v2' in found_functions}} - -cdef CUresult cuMemcpy3DBatchAsync(size_t numOps, CUDA_MEMCPY3D_BATCH_OP* opList, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpy3DBatchAsync_v2(numOps, opList, flags, hStream) -{{endif}} - -{{if 'cuMemcpyWithAttributesAsync' in found_functions}} - -cdef CUresult cuMemcpyWithAttributesAsync(CUdeviceptr dst, CUdeviceptr src, size_t size, CUmemcpyAttributes* attr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpyWithAttributesAsync(dst, src, size, attr, hStream) -{{endif}} - -{{if 'cuMemcpy3DWithAttributesAsync' in found_functions}} - -cdef CUresult cuMemcpy3DWithAttributesAsync(CUDA_MEMCPY3D_BATCH_OP* op, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemcpy3DWithAttributesAsync(op, flags, hStream) -{{endif}} - -{{if 'cuMemsetD8_v2' in found_functions}} cdef CUresult cuMemsetD8(CUdeviceptr dstDevice, unsigned char uc, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemsetD8_v2(dstDevice, uc, N) -{{endif}} + return _driver._cuMemsetD8_v2(dstDevice, uc, N) -{{if 'cuMemsetD16_v2' in found_functions}} cdef CUresult cuMemsetD16(CUdeviceptr dstDevice, unsigned short us, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemsetD16_v2(dstDevice, us, N) -{{endif}} + return _driver._cuMemsetD16_v2(dstDevice, us, N) -{{if 'cuMemsetD32_v2' in found_functions}} cdef CUresult cuMemsetD32(CUdeviceptr dstDevice, unsigned int ui, size_t N) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemsetD32_v2(dstDevice, ui, N) -{{endif}} + return _driver._cuMemsetD32_v2(dstDevice, ui, N) -{{if 'cuMemsetD2D8_v2' in found_functions}} cdef CUresult cuMemsetD2D8(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemsetD2D8_v2(dstDevice, dstPitch, uc, Width, Height) -{{endif}} + return _driver._cuMemsetD2D8_v2(dstDevice, dstPitch, uc, Width, Height) -{{if 'cuMemsetD2D16_v2' in found_functions}} cdef CUresult cuMemsetD2D16(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemsetD2D16_v2(dstDevice, dstPitch, us, Width, Height) -{{endif}} + return _driver._cuMemsetD2D16_v2(dstDevice, dstPitch, us, Width, Height) -{{if 'cuMemsetD2D32_v2' in found_functions}} cdef CUresult cuMemsetD2D32(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemsetD2D32_v2(dstDevice, dstPitch, ui, Width, Height) -{{endif}} + return _driver._cuMemsetD2D32_v2(dstDevice, dstPitch, ui, Width, Height) -{{if 'cuMemsetD8Async' in found_functions}} cdef CUresult cuMemsetD8Async(CUdeviceptr dstDevice, unsigned char uc, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemsetD8Async(dstDevice, uc, N, hStream) -{{endif}} + return _driver._cuMemsetD8Async(dstDevice, uc, N, hStream) -{{if 'cuMemsetD16Async' in found_functions}} cdef CUresult cuMemsetD16Async(CUdeviceptr dstDevice, unsigned short us, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemsetD16Async(dstDevice, us, N, hStream) -{{endif}} + return _driver._cuMemsetD16Async(dstDevice, us, N, hStream) -{{if 'cuMemsetD32Async' in found_functions}} cdef CUresult cuMemsetD32Async(CUdeviceptr dstDevice, unsigned int ui, size_t N, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemsetD32Async(dstDevice, ui, N, hStream) -{{endif}} + return _driver._cuMemsetD32Async(dstDevice, ui, N, hStream) -{{if 'cuMemsetD2D8Async' in found_functions}} cdef CUresult cuMemsetD2D8Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemsetD2D8Async(dstDevice, dstPitch, uc, Width, Height, hStream) -{{endif}} + return _driver._cuMemsetD2D8Async(dstDevice, dstPitch, uc, Width, Height, hStream) -{{if 'cuMemsetD2D16Async' in found_functions}} cdef CUresult cuMemsetD2D16Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemsetD2D16Async(dstDevice, dstPitch, us, Width, Height, hStream) -{{endif}} + return _driver._cuMemsetD2D16Async(dstDevice, dstPitch, us, Width, Height, hStream) -{{if 'cuMemsetD2D32Async' in found_functions}} cdef CUresult cuMemsetD2D32Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemsetD2D32Async(dstDevice, dstPitch, ui, Width, Height, hStream) -{{endif}} + return _driver._cuMemsetD2D32Async(dstDevice, dstPitch, ui, Width, Height, hStream) -{{if 'cuArrayCreate_v2' in found_functions}} cdef CUresult cuArrayCreate(CUarray* pHandle, const CUDA_ARRAY_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuArrayCreate_v2(pHandle, pAllocateArray) -{{endif}} + return _driver._cuArrayCreate_v2(pHandle, pAllocateArray) -{{if 'cuArrayGetDescriptor_v2' in found_functions}} cdef CUresult cuArrayGetDescriptor(CUDA_ARRAY_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuArrayGetDescriptor_v2(pArrayDescriptor, hArray) -{{endif}} + return _driver._cuArrayGetDescriptor_v2(pArrayDescriptor, hArray) -{{if 'cuArrayGetSparseProperties' in found_functions}} cdef CUresult cuArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUarray array) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuArrayGetSparseProperties(sparseProperties, array) -{{endif}} + return _driver._cuArrayGetSparseProperties(sparseProperties, array) -{{if 'cuMipmappedArrayGetSparseProperties' in found_functions}} cdef CUresult cuMipmappedArrayGetSparseProperties(CUDA_ARRAY_SPARSE_PROPERTIES* sparseProperties, CUmipmappedArray mipmap) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMipmappedArrayGetSparseProperties(sparseProperties, mipmap) -{{endif}} + return _driver._cuMipmappedArrayGetSparseProperties(sparseProperties, mipmap) -{{if 'cuArrayGetMemoryRequirements' in found_functions}} cdef CUresult cuArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUarray array, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuArrayGetMemoryRequirements(memoryRequirements, array, device) -{{endif}} + return _driver._cuArrayGetMemoryRequirements(memoryRequirements, array, device) -{{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}} cdef CUresult cuMipmappedArrayGetMemoryRequirements(CUDA_ARRAY_MEMORY_REQUIREMENTS* memoryRequirements, CUmipmappedArray mipmap, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMipmappedArrayGetMemoryRequirements(memoryRequirements, mipmap, device) -{{endif}} + return _driver._cuMipmappedArrayGetMemoryRequirements(memoryRequirements, mipmap, device) -{{if 'cuArrayGetPlane' in found_functions}} cdef CUresult cuArrayGetPlane(CUarray* pPlaneArray, CUarray hArray, unsigned int planeIdx) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuArrayGetPlane(pPlaneArray, hArray, planeIdx) -{{endif}} + return _driver._cuArrayGetPlane(pPlaneArray, hArray, planeIdx) -{{if 'cuArrayDestroy' in found_functions}} cdef CUresult cuArrayDestroy(CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuArrayDestroy(hArray) -{{endif}} + return _driver._cuArrayDestroy(hArray) -{{if 'cuArray3DCreate_v2' in found_functions}} cdef CUresult cuArray3DCreate(CUarray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pAllocateArray) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuArray3DCreate_v2(pHandle, pAllocateArray) -{{endif}} + return _driver._cuArray3DCreate_v2(pHandle, pAllocateArray) -{{if 'cuArray3DGetDescriptor_v2' in found_functions}} cdef CUresult cuArray3DGetDescriptor(CUDA_ARRAY3D_DESCRIPTOR* pArrayDescriptor, CUarray hArray) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuArray3DGetDescriptor_v2(pArrayDescriptor, hArray) -{{endif}} + return _driver._cuArray3DGetDescriptor_v2(pArrayDescriptor, hArray) -{{if 'cuMipmappedArrayCreate' in found_functions}} cdef CUresult cuMipmappedArrayCreate(CUmipmappedArray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pMipmappedArrayDesc, unsigned int numMipmapLevels) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMipmappedArrayCreate(pHandle, pMipmappedArrayDesc, numMipmapLevels) -{{endif}} + return _driver._cuMipmappedArrayCreate(pHandle, pMipmappedArrayDesc, numMipmapLevels) -{{if 'cuMipmappedArrayGetLevel' in found_functions}} cdef CUresult cuMipmappedArrayGetLevel(CUarray* pLevelArray, CUmipmappedArray hMipmappedArray, unsigned int level) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMipmappedArrayGetLevel(pLevelArray, hMipmappedArray, level) -{{endif}} + return _driver._cuMipmappedArrayGetLevel(pLevelArray, hMipmappedArray, level) -{{if 'cuMipmappedArrayDestroy' in found_functions}} cdef CUresult cuMipmappedArrayDestroy(CUmipmappedArray hMipmappedArray) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMipmappedArrayDestroy(hMipmappedArray) -{{endif}} + return _driver._cuMipmappedArrayDestroy(hMipmappedArray) -{{if 'cuMemGetHandleForAddressRange' in found_functions}} cdef CUresult cuMemGetHandleForAddressRange(void* handle, CUdeviceptr dptr, size_t size, CUmemRangeHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemGetHandleForAddressRange(handle, dptr, size, handleType, flags) -{{endif}} + return _driver._cuMemGetHandleForAddressRange(handle, dptr, size, handleType, flags) -{{if 'cuMemBatchDecompressAsync' in found_functions}} cdef CUresult cuMemBatchDecompressAsync(CUmemDecompressParams* paramsArray, size_t count, unsigned int flags, size_t* errorIndex, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemBatchDecompressAsync(paramsArray, count, flags, errorIndex, stream) -{{endif}} + return _driver._cuMemBatchDecompressAsync(paramsArray, count, flags, errorIndex, stream) -{{if 'cuMemAddressReserve' in found_functions}} cdef CUresult cuMemAddressReserve(CUdeviceptr* ptr, size_t size, size_t alignment, CUdeviceptr addr, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemAddressReserve(ptr, size, alignment, addr, flags) -{{endif}} + return _driver._cuMemAddressReserve(ptr, size, alignment, addr, flags) -{{if 'cuMemAddressFree' in found_functions}} cdef CUresult cuMemAddressFree(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemAddressFree(ptr, size) -{{endif}} + return _driver._cuMemAddressFree(ptr, size) -{{if 'cuMemCreate' in found_functions}} cdef CUresult cuMemCreate(CUmemGenericAllocationHandle* handle, size_t size, const CUmemAllocationProp* prop, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemCreate(handle, size, prop, flags) -{{endif}} + return _driver._cuMemCreate(handle, size, prop, flags) -{{if 'cuMemRelease' in found_functions}} cdef CUresult cuMemRelease(CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemRelease(handle) -{{endif}} + return _driver._cuMemRelease(handle) -{{if 'cuMemMap' in found_functions}} cdef CUresult cuMemMap(CUdeviceptr ptr, size_t size, size_t offset, CUmemGenericAllocationHandle handle, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemMap(ptr, size, offset, handle, flags) -{{endif}} + return _driver._cuMemMap(ptr, size, offset, handle, flags) -{{if 'cuMemMapArrayAsync' in found_functions}} cdef CUresult cuMemMapArrayAsync(CUarrayMapInfo* mapInfoList, unsigned int count, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemMapArrayAsync(mapInfoList, count, hStream) -{{endif}} + return _driver._cuMemMapArrayAsync(mapInfoList, count, hStream) -{{if 'cuMemUnmap' in found_functions}} cdef CUresult cuMemUnmap(CUdeviceptr ptr, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemUnmap(ptr, size) -{{endif}} + return _driver._cuMemUnmap(ptr, size) -{{if 'cuMemSetAccess' in found_functions}} cdef CUresult cuMemSetAccess(CUdeviceptr ptr, size_t size, const CUmemAccessDesc* desc, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemSetAccess(ptr, size, desc, count) -{{endif}} + return _driver._cuMemSetAccess(ptr, size, desc, count) -{{if 'cuMemGetAccess' in found_functions}} cdef CUresult cuMemGetAccess(unsigned long long* flags, const CUmemLocation* location, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemGetAccess(flags, location, ptr) -{{endif}} + return _driver._cuMemGetAccess(flags, location, ptr) -{{if 'cuMemExportToShareableHandle' in found_functions}} cdef CUresult cuMemExportToShareableHandle(void* shareableHandle, CUmemGenericAllocationHandle handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemExportToShareableHandle(shareableHandle, handle, handleType, flags) -{{endif}} + return _driver._cuMemExportToShareableHandle(shareableHandle, handle, handleType, flags) -{{if 'cuMemImportFromShareableHandle' in found_functions}} cdef CUresult cuMemImportFromShareableHandle(CUmemGenericAllocationHandle* handle, void* osHandle, CUmemAllocationHandleType shHandleType) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemImportFromShareableHandle(handle, osHandle, shHandleType) -{{endif}} + return _driver._cuMemImportFromShareableHandle(handle, osHandle, shHandleType) -{{if 'cuMemGetAllocationGranularity' in found_functions}} cdef CUresult cuMemGetAllocationGranularity(size_t* granularity, const CUmemAllocationProp* prop, CUmemAllocationGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemGetAllocationGranularity(granularity, prop, option) -{{endif}} + return _driver._cuMemGetAllocationGranularity(granularity, prop, option) -{{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}} cdef CUresult cuMemGetAllocationPropertiesFromHandle(CUmemAllocationProp* prop, CUmemGenericAllocationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemGetAllocationPropertiesFromHandle(prop, handle) -{{endif}} + return _driver._cuMemGetAllocationPropertiesFromHandle(prop, handle) -{{if 'cuMemRetainAllocationHandle' in found_functions}} cdef CUresult cuMemRetainAllocationHandle(CUmemGenericAllocationHandle* handle, void* addr) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemRetainAllocationHandle(handle, addr) -{{endif}} + return _driver._cuMemRetainAllocationHandle(handle, addr) -{{if 'cuMemFreeAsync' in found_functions}} cdef CUresult cuMemFreeAsync(CUdeviceptr dptr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemFreeAsync(dptr, hStream) -{{endif}} + return _driver._cuMemFreeAsync(dptr, hStream) -{{if 'cuMemAllocAsync' in found_functions}} cdef CUresult cuMemAllocAsync(CUdeviceptr* dptr, size_t bytesize, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemAllocAsync(dptr, bytesize, hStream) -{{endif}} + return _driver._cuMemAllocAsync(dptr, bytesize, hStream) -{{if 'cuMemPoolTrimTo' in found_functions}} cdef CUresult cuMemPoolTrimTo(CUmemoryPool pool, size_t minBytesToKeep) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemPoolTrimTo(pool, minBytesToKeep) -{{endif}} + return _driver._cuMemPoolTrimTo(pool, minBytesToKeep) -{{if 'cuMemPoolSetAttribute' in found_functions}} cdef CUresult cuMemPoolSetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemPoolSetAttribute(pool, attr, value) -{{endif}} + return _driver._cuMemPoolSetAttribute(pool, attr, value) -{{if 'cuMemPoolGetAttribute' in found_functions}} cdef CUresult cuMemPoolGetAttribute(CUmemoryPool pool, CUmemPool_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemPoolGetAttribute(pool, attr, value) -{{endif}} + return _driver._cuMemPoolGetAttribute(pool, attr, value) -{{if 'cuMemPoolSetAccess' in found_functions}} cdef CUresult cuMemPoolSetAccess(CUmemoryPool pool, const CUmemAccessDesc* map, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemPoolSetAccess(pool, map, count) -{{endif}} + return _driver._cuMemPoolSetAccess(pool, map, count) -{{if 'cuMemPoolGetAccess' in found_functions}} cdef CUresult cuMemPoolGetAccess(CUmemAccess_flags* flags, CUmemoryPool memPool, CUmemLocation* location) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemPoolGetAccess(flags, memPool, location) -{{endif}} + return _driver._cuMemPoolGetAccess(flags, memPool, location) -{{if 'cuMemPoolCreate' in found_functions}} cdef CUresult cuMemPoolCreate(CUmemoryPool* pool, const CUmemPoolProps* poolProps) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemPoolCreate(pool, poolProps) -{{endif}} + return _driver._cuMemPoolCreate(pool, poolProps) -{{if 'cuMemPoolDestroy' in found_functions}} cdef CUresult cuMemPoolDestroy(CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemPoolDestroy(pool) -{{endif}} - -{{if 'cuMemGetDefaultMemPool' in found_functions}} - -cdef CUresult cuMemGetDefaultMemPool(CUmemoryPool* pool_out, CUmemLocation* location, CUmemAllocationType typename) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemGetDefaultMemPool(pool_out, location, typename) -{{endif}} - -{{if 'cuMemGetMemPool' in found_functions}} - -cdef CUresult cuMemGetMemPool(CUmemoryPool* pool, CUmemLocation* location, CUmemAllocationType typename) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemGetMemPool(pool, location, typename) -{{endif}} + return _driver._cuMemPoolDestroy(pool) -{{if 'cuMemSetMemPool' in found_functions}} - -cdef CUresult cuMemSetMemPool(CUmemLocation* location, CUmemAllocationType typename, CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemSetMemPool(location, typename, pool) -{{endif}} - -{{if 'cuMemAllocFromPoolAsync' in found_functions}} cdef CUresult cuMemAllocFromPoolAsync(CUdeviceptr* dptr, size_t bytesize, CUmemoryPool pool, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemAllocFromPoolAsync(dptr, bytesize, pool, hStream) -{{endif}} + return _driver._cuMemAllocFromPoolAsync(dptr, bytesize, pool, hStream) -{{if 'cuMemPoolExportToShareableHandle' in found_functions}} cdef CUresult cuMemPoolExportToShareableHandle(void* handle_out, CUmemoryPool pool, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemPoolExportToShareableHandle(handle_out, pool, handleType, flags) -{{endif}} + return _driver._cuMemPoolExportToShareableHandle(handle_out, pool, handleType, flags) -{{if 'cuMemPoolImportFromShareableHandle' in found_functions}} cdef CUresult cuMemPoolImportFromShareableHandle(CUmemoryPool* pool_out, void* handle, CUmemAllocationHandleType handleType, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemPoolImportFromShareableHandle(pool_out, handle, handleType, flags) -{{endif}} + return _driver._cuMemPoolImportFromShareableHandle(pool_out, handle, handleType, flags) -{{if 'cuMemPoolExportPointer' in found_functions}} cdef CUresult cuMemPoolExportPointer(CUmemPoolPtrExportData* shareData_out, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemPoolExportPointer(shareData_out, ptr) -{{endif}} + return _driver._cuMemPoolExportPointer(shareData_out, ptr) -{{if 'cuMemPoolImportPointer' in found_functions}} cdef CUresult cuMemPoolImportPointer(CUdeviceptr* ptr_out, CUmemoryPool pool, CUmemPoolPtrExportData* shareData) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemPoolImportPointer(ptr_out, pool, shareData) -{{endif}} + return _driver._cuMemPoolImportPointer(ptr_out, pool, shareData) -{{if 'cuMulticastCreate' in found_functions}} cdef CUresult cuMulticastCreate(CUmemGenericAllocationHandle* mcHandle, const CUmulticastObjectProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMulticastCreate(mcHandle, prop) -{{endif}} + return _driver._cuMulticastCreate(mcHandle, prop) -{{if 'cuMulticastAddDevice' in found_functions}} cdef CUresult cuMulticastAddDevice(CUmemGenericAllocationHandle mcHandle, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMulticastAddDevice(mcHandle, dev) -{{endif}} + return _driver._cuMulticastAddDevice(mcHandle, dev) -{{if 'cuMulticastBindMem' in found_functions}} cdef CUresult cuMulticastBindMem(CUmemGenericAllocationHandle mcHandle, size_t mcOffset, CUmemGenericAllocationHandle memHandle, size_t memOffset, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMulticastBindMem(mcHandle, mcOffset, memHandle, memOffset, size, flags) -{{endif}} - -{{if 'cuMulticastBindMem_v2' in found_functions}} - -cdef CUresult cuMulticastBindMem_v2(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, CUmemGenericAllocationHandle memHandle, size_t memOffset, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMulticastBindMem_v2(mcHandle, dev, mcOffset, memHandle, memOffset, size, flags) -{{endif}} + return _driver._cuMulticastBindMem(mcHandle, mcOffset, memHandle, memOffset, size, flags) -{{if 'cuMulticastBindAddr' in found_functions}} cdef CUresult cuMulticastBindAddr(CUmemGenericAllocationHandle mcHandle, size_t mcOffset, CUdeviceptr memptr, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMulticastBindAddr(mcHandle, mcOffset, memptr, size, flags) -{{endif}} + return _driver._cuMulticastBindAddr(mcHandle, mcOffset, memptr, size, flags) -{{if 'cuMulticastBindAddr_v2' in found_functions}} - -cdef CUresult cuMulticastBindAddr_v2(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, CUdeviceptr memptr, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMulticastBindAddr_v2(mcHandle, dev, mcOffset, memptr, size, flags) -{{endif}} - -{{if 'cuMulticastUnbind' in found_functions}} cdef CUresult cuMulticastUnbind(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, size_t size) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMulticastUnbind(mcHandle, dev, mcOffset, size) -{{endif}} + return _driver._cuMulticastUnbind(mcHandle, dev, mcOffset, size) -{{if 'cuMulticastGetGranularity' in found_functions}} cdef CUresult cuMulticastGetGranularity(size_t* granularity, const CUmulticastObjectProp* prop, CUmulticastGranularity_flags option) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMulticastGetGranularity(granularity, prop, option) -{{endif}} + return _driver._cuMulticastGetGranularity(granularity, prop, option) -{{if 'cuPointerGetAttribute' in found_functions}} cdef CUresult cuPointerGetAttribute(void* data, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuPointerGetAttribute(data, attribute, ptr) -{{endif}} + return _driver._cuPointerGetAttribute(data, attribute, ptr) -{{if 'cuMemPrefetchAsync_v2' in found_functions}} cdef CUresult cuMemPrefetchAsync(CUdeviceptr devPtr, size_t count, CUmemLocation location, unsigned int flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemPrefetchAsync_v2(devPtr, count, location, flags, hStream) -{{endif}} + return _driver._cuMemPrefetchAsync_v2(devPtr, count, location, flags, hStream) -{{if 'cuMemAdvise_v2' in found_functions}} cdef CUresult cuMemAdvise(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUmemLocation location) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemAdvise_v2(devPtr, count, advice, location) -{{endif}} - -{{if 'cuMemPrefetchBatchAsync' in found_functions}} - -cdef CUresult cuMemPrefetchBatchAsync(CUdeviceptr* dptrs, size_t* sizes, size_t count, CUmemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemPrefetchBatchAsync(dptrs, sizes, count, prefetchLocs, prefetchLocIdxs, numPrefetchLocs, flags, hStream) -{{endif}} - -{{if 'cuMemDiscardBatchAsync' in found_functions}} - -cdef CUresult cuMemDiscardBatchAsync(CUdeviceptr* dptrs, size_t* sizes, size_t count, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemDiscardBatchAsync(dptrs, sizes, count, flags, hStream) -{{endif}} - -{{if 'cuMemDiscardAndPrefetchBatchAsync' in found_functions}} - -cdef CUresult cuMemDiscardAndPrefetchBatchAsync(CUdeviceptr* dptrs, size_t* sizes, size_t count, CUmemLocation* prefetchLocs, size_t* prefetchLocIdxs, size_t numPrefetchLocs, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemDiscardAndPrefetchBatchAsync(dptrs, sizes, count, prefetchLocs, prefetchLocIdxs, numPrefetchLocs, flags, hStream) -{{endif}} + return _driver._cuMemAdvise_v2(devPtr, count, advice, location) -{{if 'cuMemRangeGetAttribute' in found_functions}} cdef CUresult cuMemRangeGetAttribute(void* data, size_t dataSize, CUmem_range_attribute attribute, CUdeviceptr devPtr, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemRangeGetAttribute(data, dataSize, attribute, devPtr, count) -{{endif}} + return _driver._cuMemRangeGetAttribute(data, dataSize, attribute, devPtr, count) -{{if 'cuMemRangeGetAttributes' in found_functions}} cdef CUresult cuMemRangeGetAttributes(void** data, size_t* dataSizes, CUmem_range_attribute* attributes, size_t numAttributes, CUdeviceptr devPtr, size_t count) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuMemRangeGetAttributes(data, dataSizes, attributes, numAttributes, devPtr, count) -{{endif}} + return _driver._cuMemRangeGetAttributes(data, dataSizes, attributes, numAttributes, devPtr, count) -{{if 'cuPointerSetAttribute' in found_functions}} cdef CUresult cuPointerSetAttribute(const void* value, CUpointer_attribute attribute, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuPointerSetAttribute(value, attribute, ptr) -{{endif}} + return _driver._cuPointerSetAttribute(value, attribute, ptr) -{{if 'cuPointerGetAttributes' in found_functions}} cdef CUresult cuPointerGetAttributes(unsigned int numAttributes, CUpointer_attribute* attributes, void** data, CUdeviceptr ptr) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuPointerGetAttributes(numAttributes, attributes, data, ptr) -{{endif}} + return _driver._cuPointerGetAttributes(numAttributes, attributes, data, ptr) -{{if 'cuStreamCreate' in found_functions}} cdef CUresult cuStreamCreate(CUstream* phStream, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamCreate(phStream, Flags) -{{endif}} + return _driver._cuStreamCreate(phStream, Flags) -{{if 'cuStreamCreateWithPriority' in found_functions}} cdef CUresult cuStreamCreateWithPriority(CUstream* phStream, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamCreateWithPriority(phStream, flags, priority) -{{endif}} + return _driver._cuStreamCreateWithPriority(phStream, flags, priority) -{{if 'cuStreamBeginCaptureToCig' in found_functions}} - -cdef CUresult cuStreamBeginCaptureToCig(CUstream hStream, CUstreamCigCaptureParams* streamCigCaptureParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamBeginCaptureToCig(hStream, streamCigCaptureParams) -{{endif}} - -{{if 'cuStreamEndCaptureToCig' in found_functions}} - -cdef CUresult cuStreamEndCaptureToCig(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamEndCaptureToCig(hStream) -{{endif}} - -{{if 'cuStreamGetPriority' in found_functions}} cdef CUresult cuStreamGetPriority(CUstream hStream, int* priority) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamGetPriority(hStream, priority) -{{endif}} + return _driver._cuStreamGetPriority(hStream, priority) -{{if 'cuStreamGetDevice' in found_functions}} cdef CUresult cuStreamGetDevice(CUstream hStream, CUdevice* device) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamGetDevice(hStream, device) -{{endif}} + return _driver._cuStreamGetDevice(hStream, device) -{{if 'cuStreamGetFlags' in found_functions}} cdef CUresult cuStreamGetFlags(CUstream hStream, unsigned int* flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamGetFlags(hStream, flags) -{{endif}} + return _driver._cuStreamGetFlags(hStream, flags) -{{if 'cuStreamGetId' in found_functions}} cdef CUresult cuStreamGetId(CUstream hStream, unsigned long long* streamId) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamGetId(hStream, streamId) -{{endif}} + return _driver._cuStreamGetId(hStream, streamId) -{{if 'cuStreamGetCtx' in found_functions}} cdef CUresult cuStreamGetCtx(CUstream hStream, CUcontext* pctx) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamGetCtx(hStream, pctx) -{{endif}} + return _driver._cuStreamGetCtx(hStream, pctx) -{{if 'cuStreamGetCtx_v2' in found_functions}} cdef CUresult cuStreamGetCtx_v2(CUstream hStream, CUcontext* pCtx, CUgreenCtx* pGreenCtx) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamGetCtx_v2(hStream, pCtx, pGreenCtx) -{{endif}} + return _driver._cuStreamGetCtx_v2(hStream, pCtx, pGreenCtx) -{{if 'cuStreamWaitEvent' in found_functions}} cdef CUresult cuStreamWaitEvent(CUstream hStream, CUevent hEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamWaitEvent(hStream, hEvent, Flags) -{{endif}} + return _driver._cuStreamWaitEvent(hStream, hEvent, Flags) -{{if 'cuStreamAddCallback' in found_functions}} cdef CUresult cuStreamAddCallback(CUstream hStream, CUstreamCallback callback, void* userData, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamAddCallback(hStream, callback, userData, flags) -{{endif}} + return _driver._cuStreamAddCallback(hStream, callback, userData, flags) -{{if 'cuStreamBeginCapture_v2' in found_functions}} cdef CUresult cuStreamBeginCapture(CUstream hStream, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamBeginCapture_v2(hStream, mode) -{{endif}} + return _driver._cuStreamBeginCapture_v2(hStream, mode) -{{if 'cuStreamBeginCaptureToGraph' in found_functions}} cdef CUresult cuStreamBeginCaptureToGraph(CUstream hStream, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUstreamCaptureMode mode) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamBeginCaptureToGraph(hStream, hGraph, dependencies, dependencyData, numDependencies, mode) -{{endif}} + return _driver._cuStreamBeginCaptureToGraph(hStream, hGraph, dependencies, dependencyData, numDependencies, mode) -{{if 'cuThreadExchangeStreamCaptureMode' in found_functions}} cdef CUresult cuThreadExchangeStreamCaptureMode(CUstreamCaptureMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuThreadExchangeStreamCaptureMode(mode) -{{endif}} + return _driver._cuThreadExchangeStreamCaptureMode(mode) -{{if 'cuStreamEndCapture' in found_functions}} cdef CUresult cuStreamEndCapture(CUstream hStream, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamEndCapture(hStream, phGraph) -{{endif}} + return _driver._cuStreamEndCapture(hStream, phGraph) -{{if 'cuStreamIsCapturing' in found_functions}} cdef CUresult cuStreamIsCapturing(CUstream hStream, CUstreamCaptureStatus* captureStatus) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamIsCapturing(hStream, captureStatus) -{{endif}} + return _driver._cuStreamIsCapturing(hStream, captureStatus) + + +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: + return _driver._cuStreamGetCaptureInfo_v2(hStream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out) -{{if 'cuStreamGetCaptureInfo_v3' in found_functions}} cdef CUresult cuStreamGetCaptureInfo(CUstream hStream, CUstreamCaptureStatus* captureStatus_out, cuuint64_t* id_out, CUgraph* graph_out, const CUgraphNode** dependencies_out, const CUgraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamGetCaptureInfo_v3(hStream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out) -{{endif}} + return _driver._cuStreamGetCaptureInfo_v3(hStream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out) -{{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} cdef CUresult cuStreamUpdateCaptureDependencies(CUstream hStream, CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamUpdateCaptureDependencies_v2(hStream, dependencies, dependencyData, numDependencies, flags) -{{endif}} + return _driver._cuStreamUpdateCaptureDependencies_v2(hStream, dependencies, dependencyData, numDependencies, flags) -{{if 'cuStreamAttachMemAsync' in found_functions}} cdef CUresult cuStreamAttachMemAsync(CUstream hStream, CUdeviceptr dptr, size_t length, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamAttachMemAsync(hStream, dptr, length, flags) -{{endif}} + return _driver._cuStreamAttachMemAsync(hStream, dptr, length, flags) -{{if 'cuStreamQuery' in found_functions}} cdef CUresult cuStreamQuery(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamQuery(hStream) -{{endif}} + return _driver._cuStreamQuery(hStream) -{{if 'cuStreamSynchronize' in found_functions}} cdef CUresult cuStreamSynchronize(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamSynchronize(hStream) -{{endif}} + return _driver._cuStreamSynchronize(hStream) -{{if 'cuStreamDestroy_v2' in found_functions}} cdef CUresult cuStreamDestroy(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamDestroy_v2(hStream) -{{endif}} + return _driver._cuStreamDestroy_v2(hStream) -{{if 'cuStreamCopyAttributes' in found_functions}} cdef CUresult cuStreamCopyAttributes(CUstream dst, CUstream src) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamCopyAttributes(dst, src) -{{endif}} + return _driver._cuStreamCopyAttributes(dst, src) -{{if 'cuStreamGetAttribute' in found_functions}} cdef CUresult cuStreamGetAttribute(CUstream hStream, CUstreamAttrID attr, CUstreamAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamGetAttribute(hStream, attr, value_out) -{{endif}} + return _driver._cuStreamGetAttribute(hStream, attr, value_out) -{{if 'cuStreamSetAttribute' in found_functions}} cdef CUresult cuStreamSetAttribute(CUstream hStream, CUstreamAttrID attr, const CUstreamAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamSetAttribute(hStream, attr, value) -{{endif}} + return _driver._cuStreamSetAttribute(hStream, attr, value) -{{if 'cuEventCreate' in found_functions}} cdef CUresult cuEventCreate(CUevent* phEvent, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuEventCreate(phEvent, Flags) -{{endif}} + return _driver._cuEventCreate(phEvent, Flags) -{{if 'cuEventRecord' in found_functions}} cdef CUresult cuEventRecord(CUevent hEvent, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuEventRecord(hEvent, hStream) -{{endif}} + return _driver._cuEventRecord(hEvent, hStream) -{{if 'cuEventRecordWithFlags' in found_functions}} cdef CUresult cuEventRecordWithFlags(CUevent hEvent, CUstream hStream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuEventRecordWithFlags(hEvent, hStream, flags) -{{endif}} + return _driver._cuEventRecordWithFlags(hEvent, hStream, flags) -{{if 'cuEventQuery' in found_functions}} cdef CUresult cuEventQuery(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuEventQuery(hEvent) -{{endif}} + return _driver._cuEventQuery(hEvent) -{{if 'cuEventSynchronize' in found_functions}} cdef CUresult cuEventSynchronize(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuEventSynchronize(hEvent) -{{endif}} + return _driver._cuEventSynchronize(hEvent) -{{if 'cuEventDestroy_v2' in found_functions}} cdef CUresult cuEventDestroy(CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuEventDestroy_v2(hEvent) -{{endif}} + return _driver._cuEventDestroy_v2(hEvent) -{{if 'cuEventElapsedTime_v2' in found_functions}} cdef CUresult cuEventElapsedTime(float* pMilliseconds, CUevent hStart, CUevent hEnd) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuEventElapsedTime_v2(pMilliseconds, hStart, hEnd) -{{endif}} + return _driver._cuEventElapsedTime_v2(pMilliseconds, hStart, hEnd) -{{if 'cuImportExternalMemory' in found_functions}} cdef CUresult cuImportExternalMemory(CUexternalMemory* extMem_out, const CUDA_EXTERNAL_MEMORY_HANDLE_DESC* memHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuImportExternalMemory(extMem_out, memHandleDesc) -{{endif}} + return _driver._cuImportExternalMemory(extMem_out, memHandleDesc) -{{if 'cuExternalMemoryGetMappedBuffer' in found_functions}} cdef CUresult cuExternalMemoryGetMappedBuffer(CUdeviceptr* devPtr, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_BUFFER_DESC* bufferDesc) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuExternalMemoryGetMappedBuffer(devPtr, extMem, bufferDesc) -{{endif}} + return _driver._cuExternalMemoryGetMappedBuffer(devPtr, extMem, bufferDesc) -{{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}} cdef CUresult cuExternalMemoryGetMappedMipmappedArray(CUmipmappedArray* mipmap, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC* mipmapDesc) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuExternalMemoryGetMappedMipmappedArray(mipmap, extMem, mipmapDesc) -{{endif}} + return _driver._cuExternalMemoryGetMappedMipmappedArray(mipmap, extMem, mipmapDesc) -{{if 'cuDestroyExternalMemory' in found_functions}} cdef CUresult cuDestroyExternalMemory(CUexternalMemory extMem) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDestroyExternalMemory(extMem) -{{endif}} + return _driver._cuDestroyExternalMemory(extMem) -{{if 'cuImportExternalSemaphore' in found_functions}} cdef CUresult cuImportExternalSemaphore(CUexternalSemaphore* extSem_out, const CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC* semHandleDesc) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuImportExternalSemaphore(extSem_out, semHandleDesc) -{{endif}} + return _driver._cuImportExternalSemaphore(extSem_out, semHandleDesc) -{{if 'cuSignalExternalSemaphoresAsync' in found_functions}} cdef CUresult cuSignalExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuSignalExternalSemaphoresAsync(extSemArray, paramsArray, numExtSems, stream) -{{endif}} + return _driver._cuSignalExternalSemaphoresAsync(extSemArray, paramsArray, numExtSems, stream) -{{if 'cuWaitExternalSemaphoresAsync' in found_functions}} cdef CUresult cuWaitExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuWaitExternalSemaphoresAsync(extSemArray, paramsArray, numExtSems, stream) -{{endif}} + return _driver._cuWaitExternalSemaphoresAsync(extSemArray, paramsArray, numExtSems, stream) -{{if 'cuDestroyExternalSemaphore' in found_functions}} cdef CUresult cuDestroyExternalSemaphore(CUexternalSemaphore extSem) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDestroyExternalSemaphore(extSem) -{{endif}} + return _driver._cuDestroyExternalSemaphore(extSem) -{{if 'cuStreamWaitValue32_v2' in found_functions}} cdef CUresult cuStreamWaitValue32(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamWaitValue32_v2(stream, addr, value, flags) -{{endif}} + return _driver._cuStreamWaitValue32_v2(stream, addr, value, flags) -{{if 'cuStreamWaitValue64_v2' in found_functions}} cdef CUresult cuStreamWaitValue64(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamWaitValue64_v2(stream, addr, value, flags) -{{endif}} + return _driver._cuStreamWaitValue64_v2(stream, addr, value, flags) -{{if 'cuStreamWriteValue32_v2' in found_functions}} cdef CUresult cuStreamWriteValue32(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamWriteValue32_v2(stream, addr, value, flags) -{{endif}} + return _driver._cuStreamWriteValue32_v2(stream, addr, value, flags) -{{if 'cuStreamWriteValue64_v2' in found_functions}} cdef CUresult cuStreamWriteValue64(CUstream stream, CUdeviceptr addr, cuuint64_t value, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamWriteValue64_v2(stream, addr, value, flags) -{{endif}} + return _driver._cuStreamWriteValue64_v2(stream, addr, value, flags) -{{if 'cuStreamBatchMemOp_v2' in found_functions}} cdef CUresult cuStreamBatchMemOp(CUstream stream, unsigned int count, CUstreamBatchMemOpParams* paramArray, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamBatchMemOp_v2(stream, count, paramArray, flags) -{{endif}} + return _driver._cuStreamBatchMemOp_v2(stream, count, paramArray, flags) -{{if 'cuFuncGetAttribute' in found_functions}} cdef CUresult cuFuncGetAttribute(int* pi, CUfunction_attribute attrib, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuFuncGetAttribute(pi, attrib, hfunc) -{{endif}} + return _driver._cuFuncGetAttribute(pi, attrib, hfunc) -{{if 'cuFuncSetAttribute' in found_functions}} cdef CUresult cuFuncSetAttribute(CUfunction hfunc, CUfunction_attribute attrib, int value) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuFuncSetAttribute(hfunc, attrib, value) -{{endif}} + return _driver._cuFuncSetAttribute(hfunc, attrib, value) -{{if 'cuFuncSetCacheConfig' in found_functions}} cdef CUresult cuFuncSetCacheConfig(CUfunction hfunc, CUfunc_cache config) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuFuncSetCacheConfig(hfunc, config) -{{endif}} + return _driver._cuFuncSetCacheConfig(hfunc, config) -{{if 'cuFuncGetModule' in found_functions}} cdef CUresult cuFuncGetModule(CUmodule* hmod, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuFuncGetModule(hmod, hfunc) -{{endif}} + return _driver._cuFuncGetModule(hmod, hfunc) -{{if 'cuFuncGetName' in found_functions}} cdef CUresult cuFuncGetName(const char** name, CUfunction hfunc) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuFuncGetName(name, hfunc) -{{endif}} + return _driver._cuFuncGetName(name, hfunc) -{{if 'cuFuncGetParamInfo' in found_functions}} cdef CUresult cuFuncGetParamInfo(CUfunction func, size_t paramIndex, size_t* paramOffset, size_t* paramSize) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuFuncGetParamInfo(func, paramIndex, paramOffset, paramSize) -{{endif}} + return _driver._cuFuncGetParamInfo(func, paramIndex, paramOffset, paramSize) -{{if 'cuFuncGetParamCount' in found_functions}} - -cdef CUresult cuFuncGetParamCount(CUfunction func, size_t* paramCount) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuFuncGetParamCount(func, paramCount) -{{endif}} - -{{if 'cuFuncIsLoaded' in found_functions}} cdef CUresult cuFuncIsLoaded(CUfunctionLoadingState* state, CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuFuncIsLoaded(state, function) -{{endif}} + return _driver._cuFuncIsLoaded(state, function) -{{if 'cuFuncLoad' in found_functions}} cdef CUresult cuFuncLoad(CUfunction function) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuFuncLoad(function) -{{endif}} + return _driver._cuFuncLoad(function) -{{if 'cuLaunchKernel' in found_functions}} cdef CUresult cuLaunchKernel(CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, CUstream hStream, void** kernelParams, void** extra) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLaunchKernel(f, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, hStream, kernelParams, extra) -{{endif}} + return _driver._cuLaunchKernel(f, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, hStream, kernelParams, extra) -{{if 'cuLaunchKernelEx' in found_functions}} cdef CUresult cuLaunchKernelEx(const CUlaunchConfig* config, CUfunction f, void** kernelParams, void** extra) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLaunchKernelEx(config, f, kernelParams, extra) -{{endif}} + return _driver._cuLaunchKernelEx(config, f, kernelParams, extra) -{{if 'cuLaunchCooperativeKernel' in found_functions}} cdef CUresult cuLaunchCooperativeKernel(CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, CUstream hStream, void** kernelParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLaunchCooperativeKernel(f, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, hStream, kernelParams) -{{endif}} + return _driver._cuLaunchCooperativeKernel(f, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, hStream, kernelParams) -{{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}} cdef CUresult cuLaunchCooperativeKernelMultiDevice(CUDA_LAUNCH_PARAMS* launchParamsList, unsigned int numDevices, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLaunchCooperativeKernelMultiDevice(launchParamsList, numDevices, flags) -{{endif}} + return _driver._cuLaunchCooperativeKernelMultiDevice(launchParamsList, numDevices, flags) -{{if 'cuLaunchHostFunc' in found_functions}} cdef CUresult cuLaunchHostFunc(CUstream hStream, CUhostFn fn, void* userData) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLaunchHostFunc(hStream, fn, userData) -{{endif}} - -{{if 'cuLaunchHostFunc_v2' in found_functions}} + return _driver._cuLaunchHostFunc(hStream, fn, userData) -cdef CUresult cuLaunchHostFunc_v2(CUstream hStream, CUhostFn fn, void* userData, unsigned int syncMode) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLaunchHostFunc_v2(hStream, fn, userData, syncMode) -{{endif}} - -{{if 'cuFuncSetBlockShape' in found_functions}} cdef CUresult cuFuncSetBlockShape(CUfunction hfunc, int x, int y, int z) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuFuncSetBlockShape(hfunc, x, y, z) -{{endif}} + return _driver._cuFuncSetBlockShape(hfunc, x, y, z) -{{if 'cuFuncSetSharedSize' in found_functions}} -cdef CUresult cuFuncSetSharedSize(CUfunction hfunc, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuFuncSetSharedSize(hfunc, numbytes) -{{endif}} +cdef CUresult cuFuncSetSharedSize(CUfunction hfunc, unsigned int bytes) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuFuncSetSharedSize(hfunc, bytes) -{{if 'cuParamSetSize' in found_functions}} cdef CUresult cuParamSetSize(CUfunction hfunc, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuParamSetSize(hfunc, numbytes) -{{endif}} + return _driver._cuParamSetSize(hfunc, numbytes) -{{if 'cuParamSeti' in found_functions}} cdef CUresult cuParamSeti(CUfunction hfunc, int offset, unsigned int value) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuParamSeti(hfunc, offset, value) -{{endif}} + return _driver._cuParamSeti(hfunc, offset, value) -{{if 'cuParamSetf' in found_functions}} cdef CUresult cuParamSetf(CUfunction hfunc, int offset, float value) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuParamSetf(hfunc, offset, value) -{{endif}} + return _driver._cuParamSetf(hfunc, offset, value) -{{if 'cuParamSetv' in found_functions}} cdef CUresult cuParamSetv(CUfunction hfunc, int offset, void* ptr, unsigned int numbytes) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuParamSetv(hfunc, offset, ptr, numbytes) -{{endif}} + return _driver._cuParamSetv(hfunc, offset, ptr, numbytes) -{{if 'cuLaunch' in found_functions}} cdef CUresult cuLaunch(CUfunction f) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLaunch(f) -{{endif}} + return _driver._cuLaunch(f) -{{if 'cuLaunchGrid' in found_functions}} cdef CUresult cuLaunchGrid(CUfunction f, int grid_width, int grid_height) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLaunchGrid(f, grid_width, grid_height) -{{endif}} + return _driver._cuLaunchGrid(f, grid_width, grid_height) -{{if 'cuLaunchGridAsync' in found_functions}} cdef CUresult cuLaunchGridAsync(CUfunction f, int grid_width, int grid_height, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLaunchGridAsync(f, grid_width, grid_height, hStream) -{{endif}} + return _driver._cuLaunchGridAsync(f, grid_width, grid_height, hStream) -{{if 'cuParamSetTexRef' in found_functions}} cdef CUresult cuParamSetTexRef(CUfunction hfunc, int texunit, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuParamSetTexRef(hfunc, texunit, hTexRef) -{{endif}} + return _driver._cuParamSetTexRef(hfunc, texunit, hTexRef) -{{if 'cuFuncSetSharedMemConfig' in found_functions}} cdef CUresult cuFuncSetSharedMemConfig(CUfunction hfunc, CUsharedconfig config) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuFuncSetSharedMemConfig(hfunc, config) -{{endif}} + return _driver._cuFuncSetSharedMemConfig(hfunc, config) -{{if 'cuGraphCreate' in found_functions}} cdef CUresult cuGraphCreate(CUgraph* phGraph, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphCreate(phGraph, flags) -{{endif}} + return _driver._cuGraphCreate(phGraph, flags) -{{if 'cuGraphAddKernelNode_v2' in found_functions}} cdef CUresult cuGraphAddKernelNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphAddKernelNode_v2(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) -{{endif}} + return _driver._cuGraphAddKernelNode_v2(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) -{{if 'cuGraphKernelNodeGetParams_v2' in found_functions}} cdef CUresult cuGraphKernelNodeGetParams(CUgraphNode hNode, CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphKernelNodeGetParams_v2(hNode, nodeParams) -{{endif}} + return _driver._cuGraphKernelNodeGetParams_v2(hNode, nodeParams) -{{if 'cuGraphKernelNodeSetParams_v2' in found_functions}} cdef CUresult cuGraphKernelNodeSetParams(CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphKernelNodeSetParams_v2(hNode, nodeParams) -{{endif}} + return _driver._cuGraphKernelNodeSetParams_v2(hNode, nodeParams) -{{if 'cuGraphAddMemcpyNode' in found_functions}} cdef CUresult cuGraphAddMemcpyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_MEMCPY3D* copyParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphAddMemcpyNode(phGraphNode, hGraph, dependencies, numDependencies, copyParams, ctx) -{{endif}} + return _driver._cuGraphAddMemcpyNode(phGraphNode, hGraph, dependencies, numDependencies, copyParams, ctx) -{{if 'cuGraphMemcpyNodeGetParams' in found_functions}} cdef CUresult cuGraphMemcpyNodeGetParams(CUgraphNode hNode, CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphMemcpyNodeGetParams(hNode, nodeParams) -{{endif}} + return _driver._cuGraphMemcpyNodeGetParams(hNode, nodeParams) -{{if 'cuGraphMemcpyNodeSetParams' in found_functions}} cdef CUresult cuGraphMemcpyNodeSetParams(CUgraphNode hNode, const CUDA_MEMCPY3D* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphMemcpyNodeSetParams(hNode, nodeParams) -{{endif}} + return _driver._cuGraphMemcpyNodeSetParams(hNode, nodeParams) -{{if 'cuGraphAddMemsetNode' in found_functions}} cdef CUresult cuGraphAddMemsetNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_MEMSET_NODE_PARAMS* memsetParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphAddMemsetNode(phGraphNode, hGraph, dependencies, numDependencies, memsetParams, ctx) -{{endif}} + return _driver._cuGraphAddMemsetNode(phGraphNode, hGraph, dependencies, numDependencies, memsetParams, ctx) -{{if 'cuGraphMemsetNodeGetParams' in found_functions}} cdef CUresult cuGraphMemsetNodeGetParams(CUgraphNode hNode, CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphMemsetNodeGetParams(hNode, nodeParams) -{{endif}} + return _driver._cuGraphMemsetNodeGetParams(hNode, nodeParams) -{{if 'cuGraphMemsetNodeSetParams' in found_functions}} cdef CUresult cuGraphMemsetNodeSetParams(CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphMemsetNodeSetParams(hNode, nodeParams) -{{endif}} + return _driver._cuGraphMemsetNodeSetParams(hNode, nodeParams) -{{if 'cuGraphAddHostNode' in found_functions}} cdef CUresult cuGraphAddHostNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphAddHostNode(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) -{{endif}} + return _driver._cuGraphAddHostNode(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) -{{if 'cuGraphHostNodeGetParams' in found_functions}} cdef CUresult cuGraphHostNodeGetParams(CUgraphNode hNode, CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphHostNodeGetParams(hNode, nodeParams) -{{endif}} + return _driver._cuGraphHostNodeGetParams(hNode, nodeParams) -{{if 'cuGraphHostNodeSetParams' in found_functions}} cdef CUresult cuGraphHostNodeSetParams(CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphHostNodeSetParams(hNode, nodeParams) -{{endif}} + return _driver._cuGraphHostNodeSetParams(hNode, nodeParams) -{{if 'cuGraphAddChildGraphNode' in found_functions}} cdef CUresult cuGraphAddChildGraphNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphAddChildGraphNode(phGraphNode, hGraph, dependencies, numDependencies, childGraph) -{{endif}} + return _driver._cuGraphAddChildGraphNode(phGraphNode, hGraph, dependencies, numDependencies, childGraph) -{{if 'cuGraphChildGraphNodeGetGraph' in found_functions}} cdef CUresult cuGraphChildGraphNodeGetGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphChildGraphNodeGetGraph(hNode, phGraph) -{{endif}} + return _driver._cuGraphChildGraphNodeGetGraph(hNode, phGraph) -{{if 'cuGraphAddEmptyNode' in found_functions}} cdef CUresult cuGraphAddEmptyNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphAddEmptyNode(phGraphNode, hGraph, dependencies, numDependencies) -{{endif}} + return _driver._cuGraphAddEmptyNode(phGraphNode, hGraph, dependencies, numDependencies) -{{if 'cuGraphAddEventRecordNode' in found_functions}} cdef CUresult cuGraphAddEventRecordNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphAddEventRecordNode(phGraphNode, hGraph, dependencies, numDependencies, event) -{{endif}} + return _driver._cuGraphAddEventRecordNode(phGraphNode, hGraph, dependencies, numDependencies, event) -{{if 'cuGraphEventRecordNodeGetEvent' in found_functions}} cdef CUresult cuGraphEventRecordNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphEventRecordNodeGetEvent(hNode, event_out) -{{endif}} + return _driver._cuGraphEventRecordNodeGetEvent(hNode, event_out) -{{if 'cuGraphEventRecordNodeSetEvent' in found_functions}} cdef CUresult cuGraphEventRecordNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphEventRecordNodeSetEvent(hNode, event) -{{endif}} + return _driver._cuGraphEventRecordNodeSetEvent(hNode, event) -{{if 'cuGraphAddEventWaitNode' in found_functions}} cdef CUresult cuGraphAddEventWaitNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphAddEventWaitNode(phGraphNode, hGraph, dependencies, numDependencies, event) -{{endif}} + return _driver._cuGraphAddEventWaitNode(phGraphNode, hGraph, dependencies, numDependencies, event) -{{if 'cuGraphEventWaitNodeGetEvent' in found_functions}} cdef CUresult cuGraphEventWaitNodeGetEvent(CUgraphNode hNode, CUevent* event_out) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphEventWaitNodeGetEvent(hNode, event_out) -{{endif}} + return _driver._cuGraphEventWaitNodeGetEvent(hNode, event_out) -{{if 'cuGraphEventWaitNodeSetEvent' in found_functions}} cdef CUresult cuGraphEventWaitNodeSetEvent(CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphEventWaitNodeSetEvent(hNode, event) -{{endif}} + return _driver._cuGraphEventWaitNodeSetEvent(hNode, event) -{{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}} cdef CUresult cuGraphAddExternalSemaphoresSignalNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphAddExternalSemaphoresSignalNode(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) -{{endif}} + return _driver._cuGraphAddExternalSemaphoresSignalNode(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) -{{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} cdef CUresult cuGraphExternalSemaphoresSignalNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphExternalSemaphoresSignalNodeGetParams(hNode, params_out) -{{endif}} + return _driver._cuGraphExternalSemaphoresSignalNodeGetParams(hNode, params_out) -{{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} cdef CUresult cuGraphExternalSemaphoresSignalNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams) -{{endif}} + return _driver._cuGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams) -{{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}} cdef CUresult cuGraphAddExternalSemaphoresWaitNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphAddExternalSemaphoresWaitNode(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) -{{endif}} + return _driver._cuGraphAddExternalSemaphoresWaitNode(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) -{{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} cdef CUresult cuGraphExternalSemaphoresWaitNodeGetParams(CUgraphNode hNode, CUDA_EXT_SEM_WAIT_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphExternalSemaphoresWaitNodeGetParams(hNode, params_out) -{{endif}} + return _driver._cuGraphExternalSemaphoresWaitNodeGetParams(hNode, params_out) -{{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} cdef CUresult cuGraphExternalSemaphoresWaitNodeSetParams(CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams) -{{endif}} + return _driver._cuGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams) -{{if 'cuGraphAddBatchMemOpNode' in found_functions}} cdef CUresult cuGraphAddBatchMemOpNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphAddBatchMemOpNode(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) -{{endif}} + return _driver._cuGraphAddBatchMemOpNode(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) -{{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}} cdef CUresult cuGraphBatchMemOpNodeGetParams(CUgraphNode hNode, CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams_out) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphBatchMemOpNodeGetParams(hNode, nodeParams_out) -{{endif}} + return _driver._cuGraphBatchMemOpNodeGetParams(hNode, nodeParams_out) -{{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}} cdef CUresult cuGraphBatchMemOpNodeSetParams(CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphBatchMemOpNodeSetParams(hNode, nodeParams) -{{endif}} + return _driver._cuGraphBatchMemOpNodeSetParams(hNode, nodeParams) -{{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}} cdef CUresult cuGraphExecBatchMemOpNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_BATCH_MEM_OP_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphExecBatchMemOpNodeSetParams(hGraphExec, hNode, nodeParams) -{{endif}} + return _driver._cuGraphExecBatchMemOpNodeSetParams(hGraphExec, hNode, nodeParams) -{{if 'cuGraphAddMemAllocNode' in found_functions}} cdef CUresult cuGraphAddMemAllocNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUDA_MEM_ALLOC_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphAddMemAllocNode(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) -{{endif}} + return _driver._cuGraphAddMemAllocNode(phGraphNode, hGraph, dependencies, numDependencies, nodeParams) -{{if 'cuGraphMemAllocNodeGetParams' in found_functions}} cdef CUresult cuGraphMemAllocNodeGetParams(CUgraphNode hNode, CUDA_MEM_ALLOC_NODE_PARAMS* params_out) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphMemAllocNodeGetParams(hNode, params_out) -{{endif}} + return _driver._cuGraphMemAllocNodeGetParams(hNode, params_out) -{{if 'cuGraphAddMemFreeNode' in found_functions}} cdef CUresult cuGraphAddMemFreeNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, size_t numDependencies, CUdeviceptr dptr) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphAddMemFreeNode(phGraphNode, hGraph, dependencies, numDependencies, dptr) -{{endif}} + return _driver._cuGraphAddMemFreeNode(phGraphNode, hGraph, dependencies, numDependencies, dptr) -{{if 'cuGraphMemFreeNodeGetParams' in found_functions}} cdef CUresult cuGraphMemFreeNodeGetParams(CUgraphNode hNode, CUdeviceptr* dptr_out) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphMemFreeNodeGetParams(hNode, dptr_out) -{{endif}} + return _driver._cuGraphMemFreeNodeGetParams(hNode, dptr_out) -{{if 'cuDeviceGraphMemTrim' in found_functions}} cdef CUresult cuDeviceGraphMemTrim(CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceGraphMemTrim(device) -{{endif}} + return _driver._cuDeviceGraphMemTrim(device) -{{if 'cuDeviceGetGraphMemAttribute' in found_functions}} cdef CUresult cuDeviceGetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceGetGraphMemAttribute(device, attr, value) -{{endif}} + return _driver._cuDeviceGetGraphMemAttribute(device, attr, value) -{{if 'cuDeviceSetGraphMemAttribute' in found_functions}} cdef CUresult cuDeviceSetGraphMemAttribute(CUdevice device, CUgraphMem_attribute attr, void* value) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceSetGraphMemAttribute(device, attr, value) -{{endif}} + return _driver._cuDeviceSetGraphMemAttribute(device, attr, value) -{{if 'cuGraphClone' in found_functions}} cdef CUresult cuGraphClone(CUgraph* phGraphClone, CUgraph originalGraph) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphClone(phGraphClone, originalGraph) -{{endif}} + return _driver._cuGraphClone(phGraphClone, originalGraph) -{{if 'cuGraphNodeFindInClone' in found_functions}} cdef CUresult cuGraphNodeFindInClone(CUgraphNode* phNode, CUgraphNode hOriginalNode, CUgraph hClonedGraph) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphNodeFindInClone(phNode, hOriginalNode, hClonedGraph) -{{endif}} + return _driver._cuGraphNodeFindInClone(phNode, hOriginalNode, hClonedGraph) -{{if 'cuGraphNodeGetType' in found_functions}} -cdef CUresult cuGraphNodeGetType(CUgraphNode hNode, CUgraphNodeType* typename) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphNodeGetType(hNode, typename) -{{endif}} +cdef CUresult cuGraphNodeGetType(CUgraphNode hNode, CUgraphNodeType* type) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphNodeGetType(hNode, type) -{{if 'cuGraphNodeGetContainingGraph' in found_functions}} - -cdef CUresult cuGraphNodeGetContainingGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphNodeGetContainingGraph(hNode, phGraph) -{{endif}} - -{{if 'cuGraphNodeGetLocalId' in found_functions}} - -cdef CUresult cuGraphNodeGetLocalId(CUgraphNode hNode, unsigned int* nodeId) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphNodeGetLocalId(hNode, nodeId) -{{endif}} - -{{if 'cuGraphNodeGetToolsId' in found_functions}} - -cdef CUresult cuGraphNodeGetToolsId(CUgraphNode hNode, unsigned long long* toolsNodeId) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphNodeGetToolsId(hNode, toolsNodeId) -{{endif}} - -{{if 'cuGraphGetId' in found_functions}} - -cdef CUresult cuGraphGetId(CUgraph hGraph, unsigned int* graphId) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphGetId(hGraph, graphId) -{{endif}} - -{{if 'cuGraphExecGetId' in found_functions}} - -cdef CUresult cuGraphExecGetId(CUgraphExec hGraphExec, unsigned int* graphId) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphExecGetId(hGraphExec, graphId) -{{endif}} - -{{if 'cuGraphGetNodes' in found_functions}} cdef CUresult cuGraphGetNodes(CUgraph hGraph, CUgraphNode* nodes, size_t* numNodes) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphGetNodes(hGraph, nodes, numNodes) -{{endif}} + return _driver._cuGraphGetNodes(hGraph, nodes, numNodes) -{{if 'cuGraphGetRootNodes' in found_functions}} cdef CUresult cuGraphGetRootNodes(CUgraph hGraph, CUgraphNode* rootNodes, size_t* numRootNodes) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphGetRootNodes(hGraph, rootNodes, numRootNodes) -{{endif}} + return _driver._cuGraphGetRootNodes(hGraph, rootNodes, numRootNodes) -{{if 'cuGraphGetEdges_v2' in found_functions}} cdef CUresult cuGraphGetEdges(CUgraph hGraph, CUgraphNode* from_, CUgraphNode* to, CUgraphEdgeData* edgeData, size_t* numEdges) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphGetEdges_v2(hGraph, from_, to, edgeData, numEdges) -{{endif}} + return _driver._cuGraphGetEdges_v2(hGraph, from_, to, edgeData, numEdges) -{{if 'cuGraphNodeGetDependencies_v2' in found_functions}} cdef CUresult cuGraphNodeGetDependencies(CUgraphNode hNode, CUgraphNode* dependencies, CUgraphEdgeData* edgeData, size_t* numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphNodeGetDependencies_v2(hNode, dependencies, edgeData, numDependencies) -{{endif}} + return _driver._cuGraphNodeGetDependencies_v2(hNode, dependencies, edgeData, numDependencies) -{{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} cdef CUresult cuGraphNodeGetDependentNodes(CUgraphNode hNode, CUgraphNode* dependentNodes, CUgraphEdgeData* edgeData, size_t* numDependentNodes) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphNodeGetDependentNodes_v2(hNode, dependentNodes, edgeData, numDependentNodes) -{{endif}} + return _driver._cuGraphNodeGetDependentNodes_v2(hNode, dependentNodes, edgeData, numDependentNodes) -{{if 'cuGraphAddDependencies_v2' in found_functions}} cdef CUresult cuGraphAddDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphAddDependencies_v2(hGraph, from_, to, edgeData, numDependencies) -{{endif}} + return _driver._cuGraphAddDependencies_v2(hGraph, from_, to, edgeData, numDependencies) -{{if 'cuGraphRemoveDependencies_v2' in found_functions}} cdef CUresult cuGraphRemoveDependencies(CUgraph hGraph, const CUgraphNode* from_, const CUgraphNode* to, const CUgraphEdgeData* edgeData, size_t numDependencies) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphRemoveDependencies_v2(hGraph, from_, to, edgeData, numDependencies) -{{endif}} + return _driver._cuGraphRemoveDependencies_v2(hGraph, from_, to, edgeData, numDependencies) -{{if 'cuGraphDestroyNode' in found_functions}} cdef CUresult cuGraphDestroyNode(CUgraphNode hNode) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphDestroyNode(hNode) -{{endif}} + return _driver._cuGraphDestroyNode(hNode) -{{if 'cuGraphInstantiateWithFlags' in found_functions}} cdef CUresult cuGraphInstantiate(CUgraphExec* phGraphExec, CUgraph hGraph, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphInstantiateWithFlags(phGraphExec, hGraph, flags) -{{endif}} + return _driver._cuGraphInstantiateWithFlags(phGraphExec, hGraph, flags) -{{if 'cuGraphInstantiateWithParams' in found_functions}} cdef CUresult cuGraphInstantiateWithParams(CUgraphExec* phGraphExec, CUgraph hGraph, CUDA_GRAPH_INSTANTIATE_PARAMS* instantiateParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphInstantiateWithParams(phGraphExec, hGraph, instantiateParams) -{{endif}} + return _driver._cuGraphInstantiateWithParams(phGraphExec, hGraph, instantiateParams) -{{if 'cuGraphExecGetFlags' in found_functions}} cdef CUresult cuGraphExecGetFlags(CUgraphExec hGraphExec, cuuint64_t* flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphExecGetFlags(hGraphExec, flags) -{{endif}} + return _driver._cuGraphExecGetFlags(hGraphExec, flags) -{{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}} cdef CUresult cuGraphExecKernelNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphExecKernelNodeSetParams_v2(hGraphExec, hNode, nodeParams) -{{endif}} + return _driver._cuGraphExecKernelNodeSetParams_v2(hGraphExec, hNode, nodeParams) -{{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}} cdef CUresult cuGraphExecMemcpyNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMCPY3D* copyParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphExecMemcpyNodeSetParams(hGraphExec, hNode, copyParams, ctx) -{{endif}} + return _driver._cuGraphExecMemcpyNodeSetParams(hGraphExec, hNode, copyParams, ctx) -{{if 'cuGraphExecMemsetNodeSetParams' in found_functions}} cdef CUresult cuGraphExecMemsetNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS* memsetParams, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphExecMemsetNodeSetParams(hGraphExec, hNode, memsetParams, ctx) -{{endif}} + return _driver._cuGraphExecMemsetNodeSetParams(hGraphExec, hNode, memsetParams, ctx) -{{if 'cuGraphExecHostNodeSetParams' in found_functions}} cdef CUresult cuGraphExecHostNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphExecHostNodeSetParams(hGraphExec, hNode, nodeParams) -{{endif}} + return _driver._cuGraphExecHostNodeSetParams(hGraphExec, hNode, nodeParams) -{{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}} cdef CUresult cuGraphExecChildGraphNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraph childGraph) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphExecChildGraphNodeSetParams(hGraphExec, hNode, childGraph) -{{endif}} + return _driver._cuGraphExecChildGraphNodeSetParams(hGraphExec, hNode, childGraph) -{{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}} cdef CUresult cuGraphExecEventRecordNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphExecEventRecordNodeSetEvent(hGraphExec, hNode, event) -{{endif}} + return _driver._cuGraphExecEventRecordNodeSetEvent(hGraphExec, hNode, event) -{{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}} cdef CUresult cuGraphExecEventWaitNodeSetEvent(CUgraphExec hGraphExec, CUgraphNode hNode, CUevent event) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphExecEventWaitNodeSetEvent(hGraphExec, hNode, event) -{{endif}} + return _driver._cuGraphExecEventWaitNodeSetEvent(hGraphExec, hNode, event) -{{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} cdef CUresult cuGraphExecExternalSemaphoresSignalNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphExecExternalSemaphoresSignalNodeSetParams(hGraphExec, hNode, nodeParams) -{{endif}} + return _driver._cuGraphExecExternalSemaphoresSignalNodeSetParams(hGraphExec, hNode, nodeParams) -{{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} cdef CUresult cuGraphExecExternalSemaphoresWaitNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, const CUDA_EXT_SEM_WAIT_NODE_PARAMS* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphExecExternalSemaphoresWaitNodeSetParams(hGraphExec, hNode, nodeParams) -{{endif}} + return _driver._cuGraphExecExternalSemaphoresWaitNodeSetParams(hGraphExec, hNode, nodeParams) -{{if 'cuGraphNodeSetEnabled' in found_functions}} cdef CUresult cuGraphNodeSetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphNodeSetEnabled(hGraphExec, hNode, isEnabled) -{{endif}} + return _driver._cuGraphNodeSetEnabled(hGraphExec, hNode, isEnabled) -{{if 'cuGraphNodeGetEnabled' in found_functions}} cdef CUresult cuGraphNodeGetEnabled(CUgraphExec hGraphExec, CUgraphNode hNode, unsigned int* isEnabled) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphNodeGetEnabled(hGraphExec, hNode, isEnabled) -{{endif}} + return _driver._cuGraphNodeGetEnabled(hGraphExec, hNode, isEnabled) -{{if 'cuGraphUpload' in found_functions}} cdef CUresult cuGraphUpload(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphUpload(hGraphExec, hStream) -{{endif}} + return _driver._cuGraphUpload(hGraphExec, hStream) -{{if 'cuGraphLaunch' in found_functions}} cdef CUresult cuGraphLaunch(CUgraphExec hGraphExec, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphLaunch(hGraphExec, hStream) -{{endif}} + return _driver._cuGraphLaunch(hGraphExec, hStream) -{{if 'cuGraphExecDestroy' in found_functions}} cdef CUresult cuGraphExecDestroy(CUgraphExec hGraphExec) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphExecDestroy(hGraphExec) -{{endif}} + return _driver._cuGraphExecDestroy(hGraphExec) -{{if 'cuGraphDestroy' in found_functions}} cdef CUresult cuGraphDestroy(CUgraph hGraph) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphDestroy(hGraph) -{{endif}} + return _driver._cuGraphDestroy(hGraph) -{{if 'cuGraphExecUpdate_v2' in found_functions}} cdef CUresult cuGraphExecUpdate(CUgraphExec hGraphExec, CUgraph hGraph, CUgraphExecUpdateResultInfo* resultInfo) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphExecUpdate_v2(hGraphExec, hGraph, resultInfo) -{{endif}} + return _driver._cuGraphExecUpdate_v2(hGraphExec, hGraph, resultInfo) -{{if 'cuGraphKernelNodeCopyAttributes' in found_functions}} cdef CUresult cuGraphKernelNodeCopyAttributes(CUgraphNode dst, CUgraphNode src) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphKernelNodeCopyAttributes(dst, src) -{{endif}} + return _driver._cuGraphKernelNodeCopyAttributes(dst, src) -{{if 'cuGraphKernelNodeGetAttribute' in found_functions}} cdef CUresult cuGraphKernelNodeGetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, CUkernelNodeAttrValue* value_out) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphKernelNodeGetAttribute(hNode, attr, value_out) -{{endif}} + return _driver._cuGraphKernelNodeGetAttribute(hNode, attr, value_out) -{{if 'cuGraphKernelNodeSetAttribute' in found_functions}} cdef CUresult cuGraphKernelNodeSetAttribute(CUgraphNode hNode, CUkernelNodeAttrID attr, const CUkernelNodeAttrValue* value) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphKernelNodeSetAttribute(hNode, attr, value) -{{endif}} + return _driver._cuGraphKernelNodeSetAttribute(hNode, attr, value) -{{if 'cuGraphDebugDotPrint' in found_functions}} cdef CUresult cuGraphDebugDotPrint(CUgraph hGraph, const char* path, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphDebugDotPrint(hGraph, path, flags) -{{endif}} + return _driver._cuGraphDebugDotPrint(hGraph, path, flags) -{{if 'cuUserObjectCreate' in found_functions}} cdef CUresult cuUserObjectCreate(CUuserObject* object_out, void* ptr, CUhostFn destroy, unsigned int initialRefcount, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuUserObjectCreate(object_out, ptr, destroy, initialRefcount, flags) -{{endif}} + return _driver._cuUserObjectCreate(object_out, ptr, destroy, initialRefcount, flags) -{{if 'cuUserObjectRetain' in found_functions}} cdef CUresult cuUserObjectRetain(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuUserObjectRetain(object, count) -{{endif}} + return _driver._cuUserObjectRetain(object, count) -{{if 'cuUserObjectRelease' in found_functions}} cdef CUresult cuUserObjectRelease(CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuUserObjectRelease(object, count) -{{endif}} + return _driver._cuUserObjectRelease(object, count) -{{if 'cuGraphRetainUserObject' in found_functions}} cdef CUresult cuGraphRetainUserObject(CUgraph graph, CUuserObject object, unsigned int count, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphRetainUserObject(graph, object, count, flags) -{{endif}} + return _driver._cuGraphRetainUserObject(graph, object, count, flags) -{{if 'cuGraphReleaseUserObject' in found_functions}} cdef CUresult cuGraphReleaseUserObject(CUgraph graph, CUuserObject object, unsigned int count) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphReleaseUserObject(graph, object, count) -{{endif}} + return _driver._cuGraphReleaseUserObject(graph, object, count) -{{if 'cuGraphAddNode_v2' in found_functions}} cdef CUresult cuGraphAddNode(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphAddNode_v2(phGraphNode, hGraph, dependencies, dependencyData, numDependencies, nodeParams) -{{endif}} + return _driver._cuGraphAddNode_v2(phGraphNode, hGraph, dependencies, dependencyData, numDependencies, nodeParams) -{{if 'cuGraphNodeSetParams' in found_functions}} cdef CUresult cuGraphNodeSetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphNodeSetParams(hNode, nodeParams) -{{endif}} + return _driver._cuGraphNodeSetParams(hNode, nodeParams) -{{if 'cuGraphNodeGetParams' in found_functions}} - -cdef CUresult cuGraphNodeGetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphNodeGetParams(hNode, nodeParams) -{{endif}} - -{{if 'cuGraphExecNodeSetParams' in found_functions}} cdef CUresult cuGraphExecNodeSetParams(CUgraphExec hGraphExec, CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphExecNodeSetParams(hGraphExec, hNode, nodeParams) -{{endif}} + return _driver._cuGraphExecNodeSetParams(hGraphExec, hNode, nodeParams) -{{if 'cuGraphConditionalHandleCreate' in found_functions}} cdef CUresult cuGraphConditionalHandleCreate(CUgraphConditionalHandle* pHandle_out, CUgraph hGraph, CUcontext ctx, unsigned int defaultLaunchValue, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphConditionalHandleCreate(pHandle_out, hGraph, ctx, defaultLaunchValue, flags) -{{endif}} + return _driver._cuGraphConditionalHandleCreate(pHandle_out, hGraph, ctx, defaultLaunchValue, flags) -{{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} cdef CUresult cuOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, func, blockSize, dynamicSMemSize) -{{endif}} + return _driver._cuOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, func, blockSize, dynamicSMemSize) -{{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} cdef CUresult cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(numBlocks, func, blockSize, dynamicSMemSize, flags) -{{endif}} + return _driver._cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(numBlocks, func, blockSize, dynamicSMemSize, flags) -{{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}} cdef CUresult cuOccupancyMaxPotentialBlockSize(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuOccupancyMaxPotentialBlockSize(minGridSize, blockSize, func, blockSizeToDynamicSMemSize, dynamicSMemSize, blockSizeLimit) -{{endif}} + return _driver._cuOccupancyMaxPotentialBlockSize(minGridSize, blockSize, func, blockSizeToDynamicSMemSize, dynamicSMemSize, blockSizeLimit) -{{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}} cdef CUresult cuOccupancyMaxPotentialBlockSizeWithFlags(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuOccupancyMaxPotentialBlockSizeWithFlags(minGridSize, blockSize, func, blockSizeToDynamicSMemSize, dynamicSMemSize, blockSizeLimit, flags) -{{endif}} + return _driver._cuOccupancyMaxPotentialBlockSizeWithFlags(minGridSize, blockSize, func, blockSizeToDynamicSMemSize, dynamicSMemSize, blockSizeLimit, flags) -{{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}} cdef CUresult cuOccupancyAvailableDynamicSMemPerBlock(size_t* dynamicSmemSize, CUfunction func, int numBlocks, int blockSize) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuOccupancyAvailableDynamicSMemPerBlock(dynamicSmemSize, func, numBlocks, blockSize) -{{endif}} + return _driver._cuOccupancyAvailableDynamicSMemPerBlock(dynamicSmemSize, func, numBlocks, blockSize) -{{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}} cdef CUresult cuOccupancyMaxPotentialClusterSize(int* clusterSize, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuOccupancyMaxPotentialClusterSize(clusterSize, func, config) -{{endif}} + return _driver._cuOccupancyMaxPotentialClusterSize(clusterSize, func, config) -{{if 'cuOccupancyMaxActiveClusters' in found_functions}} cdef CUresult cuOccupancyMaxActiveClusters(int* numClusters, CUfunction func, const CUlaunchConfig* config) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuOccupancyMaxActiveClusters(numClusters, func, config) -{{endif}} + return _driver._cuOccupancyMaxActiveClusters(numClusters, func, config) -{{if 'cuTexRefSetArray' in found_functions}} cdef CUresult cuTexRefSetArray(CUtexref hTexRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefSetArray(hTexRef, hArray, Flags) -{{endif}} + return _driver._cuTexRefSetArray(hTexRef, hArray, Flags) -{{if 'cuTexRefSetMipmappedArray' in found_functions}} cdef CUresult cuTexRefSetMipmappedArray(CUtexref hTexRef, CUmipmappedArray hMipmappedArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefSetMipmappedArray(hTexRef, hMipmappedArray, Flags) -{{endif}} + return _driver._cuTexRefSetMipmappedArray(hTexRef, hMipmappedArray, Flags) -{{if 'cuTexRefSetAddress_v2' in found_functions}} -cdef CUresult cuTexRefSetAddress(size_t* ByteOffset, CUtexref hTexRef, CUdeviceptr dptr, size_t numbytes) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefSetAddress_v2(ByteOffset, hTexRef, dptr, numbytes) -{{endif}} +cdef CUresult cuTexRefSetAddress(size_t* ByteOffset, CUtexref hTexRef, CUdeviceptr dptr, size_t bytes) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTexRefSetAddress_v2(ByteOffset, hTexRef, dptr, bytes) -{{if 'cuTexRefSetAddress2D_v3' in found_functions}} cdef CUresult cuTexRefSetAddress2D(CUtexref hTexRef, const CUDA_ARRAY_DESCRIPTOR* desc, CUdeviceptr dptr, size_t Pitch) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefSetAddress2D_v3(hTexRef, desc, dptr, Pitch) -{{endif}} + return _driver._cuTexRefSetAddress2D_v3(hTexRef, desc, dptr, Pitch) -{{if 'cuTexRefSetFormat' in found_functions}} cdef CUresult cuTexRefSetFormat(CUtexref hTexRef, CUarray_format fmt, int NumPackedComponents) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefSetFormat(hTexRef, fmt, NumPackedComponents) -{{endif}} + return _driver._cuTexRefSetFormat(hTexRef, fmt, NumPackedComponents) -{{if 'cuTexRefSetAddressMode' in found_functions}} cdef CUresult cuTexRefSetAddressMode(CUtexref hTexRef, int dim, CUaddress_mode am) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefSetAddressMode(hTexRef, dim, am) -{{endif}} + return _driver._cuTexRefSetAddressMode(hTexRef, dim, am) -{{if 'cuTexRefSetFilterMode' in found_functions}} cdef CUresult cuTexRefSetFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefSetFilterMode(hTexRef, fm) -{{endif}} + return _driver._cuTexRefSetFilterMode(hTexRef, fm) -{{if 'cuTexRefSetMipmapFilterMode' in found_functions}} cdef CUresult cuTexRefSetMipmapFilterMode(CUtexref hTexRef, CUfilter_mode fm) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefSetMipmapFilterMode(hTexRef, fm) -{{endif}} + return _driver._cuTexRefSetMipmapFilterMode(hTexRef, fm) -{{if 'cuTexRefSetMipmapLevelBias' in found_functions}} cdef CUresult cuTexRefSetMipmapLevelBias(CUtexref hTexRef, float bias) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefSetMipmapLevelBias(hTexRef, bias) -{{endif}} + return _driver._cuTexRefSetMipmapLevelBias(hTexRef, bias) -{{if 'cuTexRefSetMipmapLevelClamp' in found_functions}} cdef CUresult cuTexRefSetMipmapLevelClamp(CUtexref hTexRef, float minMipmapLevelClamp, float maxMipmapLevelClamp) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefSetMipmapLevelClamp(hTexRef, minMipmapLevelClamp, maxMipmapLevelClamp) -{{endif}} + return _driver._cuTexRefSetMipmapLevelClamp(hTexRef, minMipmapLevelClamp, maxMipmapLevelClamp) -{{if 'cuTexRefSetMaxAnisotropy' in found_functions}} cdef CUresult cuTexRefSetMaxAnisotropy(CUtexref hTexRef, unsigned int maxAniso) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefSetMaxAnisotropy(hTexRef, maxAniso) -{{endif}} + return _driver._cuTexRefSetMaxAnisotropy(hTexRef, maxAniso) -{{if 'cuTexRefSetBorderColor' in found_functions}} cdef CUresult cuTexRefSetBorderColor(CUtexref hTexRef, float* pBorderColor) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefSetBorderColor(hTexRef, pBorderColor) -{{endif}} + return _driver._cuTexRefSetBorderColor(hTexRef, pBorderColor) -{{if 'cuTexRefSetFlags' in found_functions}} cdef CUresult cuTexRefSetFlags(CUtexref hTexRef, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefSetFlags(hTexRef, Flags) -{{endif}} + return _driver._cuTexRefSetFlags(hTexRef, Flags) -{{if 'cuTexRefGetAddress_v2' in found_functions}} cdef CUresult cuTexRefGetAddress(CUdeviceptr* pdptr, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefGetAddress_v2(pdptr, hTexRef) -{{endif}} + return _driver._cuTexRefGetAddress_v2(pdptr, hTexRef) -{{if 'cuTexRefGetArray' in found_functions}} cdef CUresult cuTexRefGetArray(CUarray* phArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefGetArray(phArray, hTexRef) -{{endif}} + return _driver._cuTexRefGetArray(phArray, hTexRef) -{{if 'cuTexRefGetMipmappedArray' in found_functions}} cdef CUresult cuTexRefGetMipmappedArray(CUmipmappedArray* phMipmappedArray, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefGetMipmappedArray(phMipmappedArray, hTexRef) -{{endif}} + return _driver._cuTexRefGetMipmappedArray(phMipmappedArray, hTexRef) -{{if 'cuTexRefGetAddressMode' in found_functions}} cdef CUresult cuTexRefGetAddressMode(CUaddress_mode* pam, CUtexref hTexRef, int dim) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefGetAddressMode(pam, hTexRef, dim) -{{endif}} + return _driver._cuTexRefGetAddressMode(pam, hTexRef, dim) -{{if 'cuTexRefGetFilterMode' in found_functions}} cdef CUresult cuTexRefGetFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefGetFilterMode(pfm, hTexRef) -{{endif}} + return _driver._cuTexRefGetFilterMode(pfm, hTexRef) -{{if 'cuTexRefGetFormat' in found_functions}} cdef CUresult cuTexRefGetFormat(CUarray_format* pFormat, int* pNumChannels, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefGetFormat(pFormat, pNumChannels, hTexRef) -{{endif}} + return _driver._cuTexRefGetFormat(pFormat, pNumChannels, hTexRef) -{{if 'cuTexRefGetMipmapFilterMode' in found_functions}} cdef CUresult cuTexRefGetMipmapFilterMode(CUfilter_mode* pfm, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefGetMipmapFilterMode(pfm, hTexRef) -{{endif}} + return _driver._cuTexRefGetMipmapFilterMode(pfm, hTexRef) -{{if 'cuTexRefGetMipmapLevelBias' in found_functions}} cdef CUresult cuTexRefGetMipmapLevelBias(float* pbias, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefGetMipmapLevelBias(pbias, hTexRef) -{{endif}} + return _driver._cuTexRefGetMipmapLevelBias(pbias, hTexRef) -{{if 'cuTexRefGetMipmapLevelClamp' in found_functions}} cdef CUresult cuTexRefGetMipmapLevelClamp(float* pminMipmapLevelClamp, float* pmaxMipmapLevelClamp, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefGetMipmapLevelClamp(pminMipmapLevelClamp, pmaxMipmapLevelClamp, hTexRef) -{{endif}} + return _driver._cuTexRefGetMipmapLevelClamp(pminMipmapLevelClamp, pmaxMipmapLevelClamp, hTexRef) -{{if 'cuTexRefGetMaxAnisotropy' in found_functions}} cdef CUresult cuTexRefGetMaxAnisotropy(int* pmaxAniso, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefGetMaxAnisotropy(pmaxAniso, hTexRef) -{{endif}} + return _driver._cuTexRefGetMaxAnisotropy(pmaxAniso, hTexRef) -{{if 'cuTexRefGetBorderColor' in found_functions}} cdef CUresult cuTexRefGetBorderColor(float* pBorderColor, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefGetBorderColor(pBorderColor, hTexRef) -{{endif}} + return _driver._cuTexRefGetBorderColor(pBorderColor, hTexRef) -{{if 'cuTexRefGetFlags' in found_functions}} cdef CUresult cuTexRefGetFlags(unsigned int* pFlags, CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefGetFlags(pFlags, hTexRef) -{{endif}} + return _driver._cuTexRefGetFlags(pFlags, hTexRef) -{{if 'cuTexRefCreate' in found_functions}} cdef CUresult cuTexRefCreate(CUtexref* pTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefCreate(pTexRef) -{{endif}} + return _driver._cuTexRefCreate(pTexRef) -{{if 'cuTexRefDestroy' in found_functions}} cdef CUresult cuTexRefDestroy(CUtexref hTexRef) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexRefDestroy(hTexRef) -{{endif}} + return _driver._cuTexRefDestroy(hTexRef) -{{if 'cuSurfRefSetArray' in found_functions}} cdef CUresult cuSurfRefSetArray(CUsurfref hSurfRef, CUarray hArray, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuSurfRefSetArray(hSurfRef, hArray, Flags) -{{endif}} + return _driver._cuSurfRefSetArray(hSurfRef, hArray, Flags) -{{if 'cuSurfRefGetArray' in found_functions}} cdef CUresult cuSurfRefGetArray(CUarray* phArray, CUsurfref hSurfRef) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuSurfRefGetArray(phArray, hSurfRef) -{{endif}} + return _driver._cuSurfRefGetArray(phArray, hSurfRef) -{{if 'cuTexObjectCreate' in found_functions}} cdef CUresult cuTexObjectCreate(CUtexObject* pTexObject, const CUDA_RESOURCE_DESC* pResDesc, const CUDA_TEXTURE_DESC* pTexDesc, const CUDA_RESOURCE_VIEW_DESC* pResViewDesc) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexObjectCreate(pTexObject, pResDesc, pTexDesc, pResViewDesc) -{{endif}} + return _driver._cuTexObjectCreate(pTexObject, pResDesc, pTexDesc, pResViewDesc) -{{if 'cuTexObjectDestroy' in found_functions}} cdef CUresult cuTexObjectDestroy(CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexObjectDestroy(texObject) -{{endif}} + return _driver._cuTexObjectDestroy(texObject) -{{if 'cuTexObjectGetResourceDesc' in found_functions}} cdef CUresult cuTexObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexObjectGetResourceDesc(pResDesc, texObject) -{{endif}} + return _driver._cuTexObjectGetResourceDesc(pResDesc, texObject) -{{if 'cuTexObjectGetTextureDesc' in found_functions}} cdef CUresult cuTexObjectGetTextureDesc(CUDA_TEXTURE_DESC* pTexDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexObjectGetTextureDesc(pTexDesc, texObject) -{{endif}} + return _driver._cuTexObjectGetTextureDesc(pTexDesc, texObject) -{{if 'cuTexObjectGetResourceViewDesc' in found_functions}} cdef CUresult cuTexObjectGetResourceViewDesc(CUDA_RESOURCE_VIEW_DESC* pResViewDesc, CUtexObject texObject) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTexObjectGetResourceViewDesc(pResViewDesc, texObject) -{{endif}} + return _driver._cuTexObjectGetResourceViewDesc(pResViewDesc, texObject) -{{if 'cuSurfObjectCreate' in found_functions}} cdef CUresult cuSurfObjectCreate(CUsurfObject* pSurfObject, const CUDA_RESOURCE_DESC* pResDesc) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuSurfObjectCreate(pSurfObject, pResDesc) -{{endif}} + return _driver._cuSurfObjectCreate(pSurfObject, pResDesc) -{{if 'cuSurfObjectDestroy' in found_functions}} cdef CUresult cuSurfObjectDestroy(CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuSurfObjectDestroy(surfObject) -{{endif}} + return _driver._cuSurfObjectDestroy(surfObject) -{{if 'cuSurfObjectGetResourceDesc' in found_functions}} cdef CUresult cuSurfObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUsurfObject surfObject) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuSurfObjectGetResourceDesc(pResDesc, surfObject) -{{endif}} + return _driver._cuSurfObjectGetResourceDesc(pResDesc, surfObject) -{{if 'cuTensorMapEncodeTiled' in found_functions}} cdef CUresult cuTensorMapEncodeTiled(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, const cuuint32_t* boxDim, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTensorMapEncodeTiled(tensorMap, tensorDataType, tensorRank, globalAddress, globalDim, globalStrides, boxDim, elementStrides, interleave, swizzle, l2Promotion, oobFill) -{{endif}} + return _driver._cuTensorMapEncodeTiled(tensorMap, tensorDataType, tensorRank, globalAddress, globalDim, globalStrides, boxDim, elementStrides, interleave, swizzle, l2Promotion, oobFill) -{{if 'cuTensorMapEncodeIm2col' in found_functions}} cdef CUresult cuTensorMapEncodeIm2col(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, const int* pixelBoxLowerCorner, const int* pixelBoxUpperCorner, cuuint32_t channelsPerPixel, cuuint32_t pixelsPerColumn, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTensorMapEncodeIm2col(tensorMap, tensorDataType, tensorRank, globalAddress, globalDim, globalStrides, pixelBoxLowerCorner, pixelBoxUpperCorner, channelsPerPixel, pixelsPerColumn, elementStrides, interleave, swizzle, l2Promotion, oobFill) -{{endif}} + return _driver._cuTensorMapEncodeIm2col(tensorMap, tensorDataType, tensorRank, globalAddress, globalDim, globalStrides, pixelBoxLowerCorner, pixelBoxUpperCorner, channelsPerPixel, pixelsPerColumn, elementStrides, interleave, swizzle, l2Promotion, oobFill) -{{if 'cuTensorMapEncodeIm2colWide' in found_functions}} cdef CUresult cuTensorMapEncodeIm2colWide(CUtensorMap* tensorMap, CUtensorMapDataType tensorDataType, cuuint32_t tensorRank, void* globalAddress, const cuuint64_t* globalDim, const cuuint64_t* globalStrides, int pixelBoxLowerCornerWidth, int pixelBoxUpperCornerWidth, cuuint32_t channelsPerPixel, cuuint32_t pixelsPerColumn, const cuuint32_t* elementStrides, CUtensorMapInterleave interleave, CUtensorMapIm2ColWideMode mode, CUtensorMapSwizzle swizzle, CUtensorMapL2promotion l2Promotion, CUtensorMapFloatOOBfill oobFill) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTensorMapEncodeIm2colWide(tensorMap, tensorDataType, tensorRank, globalAddress, globalDim, globalStrides, pixelBoxLowerCornerWidth, pixelBoxUpperCornerWidth, channelsPerPixel, pixelsPerColumn, elementStrides, interleave, mode, swizzle, l2Promotion, oobFill) -{{endif}} + return _driver._cuTensorMapEncodeIm2colWide(tensorMap, tensorDataType, tensorRank, globalAddress, globalDim, globalStrides, pixelBoxLowerCornerWidth, pixelBoxUpperCornerWidth, channelsPerPixel, pixelsPerColumn, elementStrides, interleave, mode, swizzle, l2Promotion, oobFill) -{{if 'cuTensorMapReplaceAddress' in found_functions}} cdef CUresult cuTensorMapReplaceAddress(CUtensorMap* tensorMap, void* globalAddress) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuTensorMapReplaceAddress(tensorMap, globalAddress) -{{endif}} + return _driver._cuTensorMapReplaceAddress(tensorMap, globalAddress) -{{if 'cuDeviceCanAccessPeer' in found_functions}} cdef CUresult cuDeviceCanAccessPeer(int* canAccessPeer, CUdevice dev, CUdevice peerDev) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceCanAccessPeer(canAccessPeer, dev, peerDev) -{{endif}} + return _driver._cuDeviceCanAccessPeer(canAccessPeer, dev, peerDev) -{{if 'cuCtxEnablePeerAccess' in found_functions}} cdef CUresult cuCtxEnablePeerAccess(CUcontext peerContext, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxEnablePeerAccess(peerContext, Flags) -{{endif}} + return _driver._cuCtxEnablePeerAccess(peerContext, Flags) -{{if 'cuCtxDisablePeerAccess' in found_functions}} cdef CUresult cuCtxDisablePeerAccess(CUcontext peerContext) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxDisablePeerAccess(peerContext) -{{endif}} + return _driver._cuCtxDisablePeerAccess(peerContext) -{{if 'cuDeviceGetP2PAttribute' in found_functions}} cdef CUresult cuDeviceGetP2PAttribute(int* value, CUdevice_P2PAttribute attrib, CUdevice srcDevice, CUdevice dstDevice) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceGetP2PAttribute(value, attrib, srcDevice, dstDevice) -{{endif}} + return _driver._cuDeviceGetP2PAttribute(value, attrib, srcDevice, dstDevice) -{{if 'cuDeviceGetP2PAtomicCapabilities' in found_functions}} - -cdef CUresult cuDeviceGetP2PAtomicCapabilities(unsigned int* capabilities, const CUatomicOperation* operations, unsigned int count, CUdevice srcDevice, CUdevice dstDevice) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceGetP2PAtomicCapabilities(capabilities, operations, count, srcDevice, dstDevice) -{{endif}} - -{{if 'cuGraphicsUnregisterResource' in found_functions}} cdef CUresult cuGraphicsUnregisterResource(CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphicsUnregisterResource(resource) -{{endif}} + return _driver._cuGraphicsUnregisterResource(resource) -{{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}} cdef CUresult cuGraphicsSubResourceGetMappedArray(CUarray* pArray, CUgraphicsResource resource, unsigned int arrayIndex, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphicsSubResourceGetMappedArray(pArray, resource, arrayIndex, mipLevel) -{{endif}} + return _driver._cuGraphicsSubResourceGetMappedArray(pArray, resource, arrayIndex, mipLevel) -{{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}} cdef CUresult cuGraphicsResourceGetMappedMipmappedArray(CUmipmappedArray* pMipmappedArray, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphicsResourceGetMappedMipmappedArray(pMipmappedArray, resource) -{{endif}} + return _driver._cuGraphicsResourceGetMappedMipmappedArray(pMipmappedArray, resource) -{{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}} cdef CUresult cuGraphicsResourceGetMappedPointer(CUdeviceptr* pDevPtr, size_t* pSize, CUgraphicsResource resource) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphicsResourceGetMappedPointer_v2(pDevPtr, pSize, resource) -{{endif}} + return _driver._cuGraphicsResourceGetMappedPointer_v2(pDevPtr, pSize, resource) -{{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}} cdef CUresult cuGraphicsResourceSetMapFlags(CUgraphicsResource resource, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphicsResourceSetMapFlags_v2(resource, flags) -{{endif}} + return _driver._cuGraphicsResourceSetMapFlags_v2(resource, flags) -{{if 'cuGraphicsMapResources' in found_functions}} cdef CUresult cuGraphicsMapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphicsMapResources(count, resources, hStream) -{{endif}} + return _driver._cuGraphicsMapResources(count, resources, hStream) -{{if 'cuGraphicsUnmapResources' in found_functions}} cdef CUresult cuGraphicsUnmapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphicsUnmapResources(count, resources, hStream) -{{endif}} + return _driver._cuGraphicsUnmapResources(count, resources, hStream) -{{if 'cuGetProcAddress_v2' in found_functions}} cdef CUresult cuGetProcAddress(const char* symbol, void** pfn, int cudaVersion, cuuint64_t flags, CUdriverProcAddressQueryResult* symbolStatus) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGetProcAddress_v2(symbol, pfn, cudaVersion, flags, symbolStatus) -{{endif}} + return _driver._cuGetProcAddress_v2(symbol, pfn, cudaVersion, flags, symbolStatus) -{{if 'cuCoredumpGetAttribute' in found_functions}} cdef CUresult cuCoredumpGetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCoredumpGetAttribute(attrib, value, size) -{{endif}} + return _driver._cuCoredumpGetAttribute(attrib, value, size) -{{if 'cuCoredumpGetAttributeGlobal' in found_functions}} cdef CUresult cuCoredumpGetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCoredumpGetAttributeGlobal(attrib, value, size) -{{endif}} + return _driver._cuCoredumpGetAttributeGlobal(attrib, value, size) -{{if 'cuCoredumpSetAttribute' in found_functions}} cdef CUresult cuCoredumpSetAttribute(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCoredumpSetAttribute(attrib, value, size) -{{endif}} + return _driver._cuCoredumpSetAttribute(attrib, value, size) -{{if 'cuCoredumpSetAttributeGlobal' in found_functions}} cdef CUresult cuCoredumpSetAttributeGlobal(CUcoredumpSettings attrib, void* value, size_t* size) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCoredumpSetAttributeGlobal(attrib, value, size) -{{endif}} - -{{if 'cuCoredumpRegisterStartCallback' in found_functions}} - -cdef CUresult cuCoredumpRegisterStartCallback(CUcoredumpStatusCallback callback, void* userData, CUcoredumpCallbackHandle* callbackOut) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCoredumpRegisterStartCallback(callback, userData, callbackOut) -{{endif}} - -{{if 'cuCoredumpRegisterCompleteCallback' in found_functions}} - -cdef CUresult cuCoredumpRegisterCompleteCallback(CUcoredumpStatusCallback callback, void* userData, CUcoredumpCallbackHandle* callbackOut) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCoredumpRegisterCompleteCallback(callback, userData, callbackOut) -{{endif}} + return _driver._cuCoredumpSetAttributeGlobal(attrib, value, size) -{{if 'cuCoredumpDeregisterStartCallback' in found_functions}} - -cdef CUresult cuCoredumpDeregisterStartCallback(CUcoredumpCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCoredumpDeregisterStartCallback(callback) -{{endif}} - -{{if 'cuCoredumpDeregisterCompleteCallback' in found_functions}} - -cdef CUresult cuCoredumpDeregisterCompleteCallback(CUcoredumpCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCoredumpDeregisterCompleteCallback(callback) -{{endif}} - -{{if 'cuGetExportTable' in found_functions}} cdef CUresult cuGetExportTable(const void** ppExportTable, const CUuuid* pExportTableId) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGetExportTable(ppExportTable, pExportTableId) -{{endif}} + return _driver._cuGetExportTable(ppExportTable, pExportTableId) -{{if 'cuGreenCtxCreate' in found_functions}} cdef CUresult cuGreenCtxCreate(CUgreenCtx* phCtx, CUdevResourceDesc desc, CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGreenCtxCreate(phCtx, desc, dev, flags) -{{endif}} + return _driver._cuGreenCtxCreate(phCtx, desc, dev, flags) -{{if 'cuGreenCtxDestroy' in found_functions}} cdef CUresult cuGreenCtxDestroy(CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGreenCtxDestroy(hCtx) -{{endif}} + return _driver._cuGreenCtxDestroy(hCtx) -{{if 'cuCtxFromGreenCtx' in found_functions}} cdef CUresult cuCtxFromGreenCtx(CUcontext* pContext, CUgreenCtx hCtx) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxFromGreenCtx(pContext, hCtx) -{{endif}} + return _driver._cuCtxFromGreenCtx(pContext, hCtx) -{{if 'cuDeviceGetDevResource' in found_functions}} -cdef CUresult cuDeviceGetDevResource(CUdevice device, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDeviceGetDevResource(device, resource, typename) -{{endif}} +cdef CUresult cuDeviceGetDevResource(CUdevice device, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetDevResource(device, resource, type) -{{if 'cuCtxGetDevResource' in found_functions}} -cdef CUresult cuCtxGetDevResource(CUcontext hCtx, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCtxGetDevResource(hCtx, resource, typename) -{{endif}} +cdef CUresult cuCtxGetDevResource(CUcontext hCtx, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxGetDevResource(hCtx, resource, type) -{{if 'cuGreenCtxGetDevResource' in found_functions}} -cdef CUresult cuGreenCtxGetDevResource(CUgreenCtx hCtx, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGreenCtxGetDevResource(hCtx, resource, typename) -{{endif}} +cdef CUresult cuGreenCtxGetDevResource(CUgreenCtx hCtx, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGreenCtxGetDevResource(hCtx, resource, type) -{{if 'cuDevSmResourceSplitByCount' in found_functions}} cdef CUresult cuDevSmResourceSplitByCount(CUdevResource* result, unsigned int* nbGroups, const CUdevResource* input, CUdevResource* remainder, unsigned int flags, unsigned int minCount) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDevSmResourceSplitByCount(result, nbGroups, input, remainder, flags, minCount) -{{endif}} + return _driver._cuDevSmResourceSplitByCount(result, nbGroups, input, remainder, flags, minCount) -{{if 'cuDevSmResourceSplit' in found_functions}} - -cdef CUresult cuDevSmResourceSplit(CUdevResource* result, unsigned int nbGroups, const CUdevResource* input, CUdevResource* remainder, unsigned int flags, CU_DEV_SM_RESOURCE_GROUP_PARAMS* groupParams) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDevSmResourceSplit(result, nbGroups, input, remainder, flags, groupParams) -{{endif}} - -{{if 'cuDevResourceGenerateDesc' in found_functions}} cdef CUresult cuDevResourceGenerateDesc(CUdevResourceDesc* phDesc, CUdevResource* resources, unsigned int nbResources) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuDevResourceGenerateDesc(phDesc, resources, nbResources) -{{endif}} + return _driver._cuDevResourceGenerateDesc(phDesc, resources, nbResources) -{{if 'cuGreenCtxRecordEvent' in found_functions}} cdef CUresult cuGreenCtxRecordEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGreenCtxRecordEvent(hCtx, hEvent) -{{endif}} + return _driver._cuGreenCtxRecordEvent(hCtx, hEvent) -{{if 'cuGreenCtxWaitEvent' in found_functions}} cdef CUresult cuGreenCtxWaitEvent(CUgreenCtx hCtx, CUevent hEvent) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGreenCtxWaitEvent(hCtx, hEvent) -{{endif}} + return _driver._cuGreenCtxWaitEvent(hCtx, hEvent) -{{if 'cuStreamGetGreenCtx' in found_functions}} cdef CUresult cuStreamGetGreenCtx(CUstream hStream, CUgreenCtx* phCtx) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamGetGreenCtx(hStream, phCtx) -{{endif}} + return _driver._cuStreamGetGreenCtx(hStream, phCtx) -{{if 'cuGreenCtxStreamCreate' in found_functions}} cdef CUresult cuGreenCtxStreamCreate(CUstream* phStream, CUgreenCtx greenCtx, unsigned int flags, int priority) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGreenCtxStreamCreate(phStream, greenCtx, flags, priority) -{{endif}} - -{{if 'cuGreenCtxGetId' in found_functions}} - -cdef CUresult cuGreenCtxGetId(CUgreenCtx greenCtx, unsigned long long* greenCtxId) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGreenCtxGetId(greenCtx, greenCtxId) -{{endif}} + return _driver._cuGreenCtxStreamCreate(phStream, greenCtx, flags, priority) -{{if 'cuStreamGetDevResource' in found_functions}} - -cdef CUresult cuStreamGetDevResource(CUstream hStream, CUdevResource* resource, CUdevResourceType typename) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuStreamGetDevResource(hStream, resource, typename) -{{endif}} - -{{if 'cuLogsRegisterCallback' in found_functions}} cdef CUresult cuLogsRegisterCallback(CUlogsCallback callbackFunc, void* userData, CUlogsCallbackHandle* callback_out) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLogsRegisterCallback(callbackFunc, userData, callback_out) -{{endif}} + return _driver._cuLogsRegisterCallback(callbackFunc, userData, callback_out) -{{if 'cuLogsUnregisterCallback' in found_functions}} cdef CUresult cuLogsUnregisterCallback(CUlogsCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLogsUnregisterCallback(callback) -{{endif}} + return _driver._cuLogsUnregisterCallback(callback) -{{if 'cuLogsCurrent' in found_functions}} cdef CUresult cuLogsCurrent(CUlogIterator* iterator_out, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLogsCurrent(iterator_out, flags) -{{endif}} + return _driver._cuLogsCurrent(iterator_out, flags) -{{if 'cuLogsDumpToFile' in found_functions}} cdef CUresult cuLogsDumpToFile(CUlogIterator* iterator, const char* pathToFile, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLogsDumpToFile(iterator, pathToFile, flags) -{{endif}} + return _driver._cuLogsDumpToFile(iterator, pathToFile, flags) -{{if 'cuLogsDumpToMemory' in found_functions}} cdef CUresult cuLogsDumpToMemory(CUlogIterator* iterator, char* buffer, size_t* size, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuLogsDumpToMemory(iterator, buffer, size, flags) -{{endif}} + return _driver._cuLogsDumpToMemory(iterator, buffer, size, flags) -{{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}} cdef CUresult cuCheckpointProcessGetRestoreThreadId(int pid, int* tid) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCheckpointProcessGetRestoreThreadId(pid, tid) -{{endif}} + return _driver._cuCheckpointProcessGetRestoreThreadId(pid, tid) -{{if 'cuCheckpointProcessGetState' in found_functions}} cdef CUresult cuCheckpointProcessGetState(int pid, CUprocessState* state) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCheckpointProcessGetState(pid, state) -{{endif}} + return _driver._cuCheckpointProcessGetState(pid, state) -{{if 'cuCheckpointProcessLock' in found_functions}} cdef CUresult cuCheckpointProcessLock(int pid, CUcheckpointLockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCheckpointProcessLock(pid, args) -{{endif}} + return _driver._cuCheckpointProcessLock(pid, args) -{{if 'cuCheckpointProcessCheckpoint' in found_functions}} cdef CUresult cuCheckpointProcessCheckpoint(int pid, CUcheckpointCheckpointArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCheckpointProcessCheckpoint(pid, args) -{{endif}} + return _driver._cuCheckpointProcessCheckpoint(pid, args) -{{if 'cuCheckpointProcessRestore' in found_functions}} cdef CUresult cuCheckpointProcessRestore(int pid, CUcheckpointRestoreArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCheckpointProcessRestore(pid, args) -{{endif}} + return _driver._cuCheckpointProcessRestore(pid, args) -{{if 'cuCheckpointProcessUnlock' in found_functions}} cdef CUresult cuCheckpointProcessUnlock(int pid, CUcheckpointUnlockArgs* args) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuCheckpointProcessUnlock(pid, args) -{{endif}} - -{{if 'cuProfilerStart' in found_functions}} - -cdef CUresult cuProfilerStart() except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuProfilerStart() -{{endif}} - -{{if 'cuProfilerStop' in found_functions}} - -cdef CUresult cuProfilerStop() except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuProfilerStop() -{{endif}} + return _driver._cuCheckpointProcessUnlock(pid, args) -{{if True}} cdef CUresult cuGraphicsEGLRegisterImage(CUgraphicsResource* pCudaResource, EGLImageKHR image, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphicsEGLRegisterImage(pCudaResource, image, flags) -{{endif}} + return _driver._cuGraphicsEGLRegisterImage(pCudaResource, image, flags) -{{if True}} cdef CUresult cuEGLStreamConsumerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuEGLStreamConsumerConnect(conn, stream) -{{endif}} + return _driver._cuEGLStreamConsumerConnect(conn, stream) -{{if True}} cdef CUresult cuEGLStreamConsumerConnectWithFlags(CUeglStreamConnection* conn, EGLStreamKHR stream, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuEGLStreamConsumerConnectWithFlags(conn, stream, flags) -{{endif}} + return _driver._cuEGLStreamConsumerConnectWithFlags(conn, stream, flags) -{{if True}} cdef CUresult cuEGLStreamConsumerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuEGLStreamConsumerDisconnect(conn) -{{endif}} + return _driver._cuEGLStreamConsumerDisconnect(conn) -{{if True}} cdef CUresult cuEGLStreamConsumerAcquireFrame(CUeglStreamConnection* conn, CUgraphicsResource* pCudaResource, CUstream* pStream, unsigned int timeout) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuEGLStreamConsumerAcquireFrame(conn, pCudaResource, pStream, timeout) -{{endif}} + return _driver._cuEGLStreamConsumerAcquireFrame(conn, pCudaResource, pStream, timeout) -{{if True}} cdef CUresult cuEGLStreamConsumerReleaseFrame(CUeglStreamConnection* conn, CUgraphicsResource pCudaResource, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuEGLStreamConsumerReleaseFrame(conn, pCudaResource, pStream) -{{endif}} + return _driver._cuEGLStreamConsumerReleaseFrame(conn, pCudaResource, pStream) -{{if True}} cdef CUresult cuEGLStreamProducerConnect(CUeglStreamConnection* conn, EGLStreamKHR stream, EGLint width, EGLint height) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuEGLStreamProducerConnect(conn, stream, width, height) -{{endif}} + return _driver._cuEGLStreamProducerConnect(conn, stream, width, height) -{{if True}} cdef CUresult cuEGLStreamProducerDisconnect(CUeglStreamConnection* conn) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuEGLStreamProducerDisconnect(conn) -{{endif}} + return _driver._cuEGLStreamProducerDisconnect(conn) -{{if True}} cdef CUresult cuEGLStreamProducerPresentFrame(CUeglStreamConnection* conn, CUeglFrame eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuEGLStreamProducerPresentFrame(conn, eglframe, pStream) -{{endif}} + return _driver._cuEGLStreamProducerPresentFrame(conn, eglframe, pStream) -{{if True}} cdef CUresult cuEGLStreamProducerReturnFrame(CUeglStreamConnection* conn, CUeglFrame* eglframe, CUstream* pStream) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuEGLStreamProducerReturnFrame(conn, eglframe, pStream) -{{endif}} + return _driver._cuEGLStreamProducerReturnFrame(conn, eglframe, pStream) -{{if True}} cdef CUresult cuGraphicsResourceGetMappedEglFrame(CUeglFrame* eglFrame, CUgraphicsResource resource, unsigned int index, unsigned int mipLevel) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphicsResourceGetMappedEglFrame(eglFrame, resource, index, mipLevel) -{{endif}} + return _driver._cuGraphicsResourceGetMappedEglFrame(eglFrame, resource, index, mipLevel) -{{if True}} cdef CUresult cuEventCreateFromEGLSync(CUevent* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuEventCreateFromEGLSync(phEvent, eglSync, flags) -{{endif}} + return _driver._cuEventCreateFromEGLSync(phEvent, eglSync, flags) -{{if True}} cdef CUresult cuGraphicsGLRegisterBuffer(CUgraphicsResource* pCudaResource, GLuint buffer, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphicsGLRegisterBuffer(pCudaResource, buffer, Flags) -{{endif}} + return _driver._cuGraphicsGLRegisterBuffer(pCudaResource, buffer, Flags) -{{if True}} cdef CUresult cuGraphicsGLRegisterImage(CUgraphicsResource* pCudaResource, GLuint image, GLenum target, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphicsGLRegisterImage(pCudaResource, image, target, Flags) -{{endif}} + return _driver._cuGraphicsGLRegisterImage(pCudaResource, image, target, Flags) -{{if True}} cdef CUresult cuGLGetDevices(unsigned int* pCudaDeviceCount, CUdevice* pCudaDevices, unsigned int cudaDeviceCount, CUGLDeviceList deviceList) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGLGetDevices_v2(pCudaDeviceCount, pCudaDevices, cudaDeviceCount, deviceList) -{{endif}} + return _driver._cuGLGetDevices_v2(pCudaDeviceCount, pCudaDevices, cudaDeviceCount, deviceList) + + +cdef CUresult cuGLCtxCreate(CUcontext* pCtx, unsigned int Flags, CUdevice device) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGLCtxCreate_v2(pCtx, Flags, device) + + +cdef CUresult cuGLInit() except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGLInit() + + +cdef CUresult cuGLRegisterBufferObject(GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGLRegisterBufferObject(buffer) + + +cdef CUresult cuGLMapBufferObject(CUdeviceptr* dptr, size_t* size, GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGLMapBufferObject_v2(dptr, size, buffer) + + +cdef CUresult cuGLUnmapBufferObject(GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGLUnmapBufferObject(buffer) + + +cdef CUresult cuGLUnregisterBufferObject(GLuint buffer) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGLUnregisterBufferObject(buffer) + + +cdef CUresult cuGLSetBufferObjectMapFlags(GLuint buffer, unsigned int Flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGLSetBufferObjectMapFlags(buffer, Flags) + + +cdef CUresult cuGLMapBufferObjectAsync(CUdeviceptr* dptr, size_t* size, GLuint buffer, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGLMapBufferObjectAsync_v2(dptr, size, buffer, hStream) + + +cdef CUresult cuGLUnmapBufferObjectAsync(GLuint buffer, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGLUnmapBufferObjectAsync(buffer, hStream) + + +cdef CUresult cuProfilerInitialize(const char* configFile, const char* outputFile, CUoutput_mode outputMode) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuProfilerInitialize(configFile, outputFile, outputMode) + + +cdef CUresult cuProfilerStart() except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuProfilerStart() + + +cdef CUresult cuProfilerStop() except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuProfilerStop() -{{if True}} cdef CUresult cuVDPAUGetDevice(CUdevice* pDevice, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuVDPAUGetDevice(pDevice, vdpDevice, vdpGetProcAddress) -{{endif}} + return _driver._cuVDPAUGetDevice(pDevice, vdpDevice, vdpGetProcAddress) -{{if True}} cdef CUresult cuVDPAUCtxCreate(CUcontext* pCtx, unsigned int flags, CUdevice device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuVDPAUCtxCreate_v2(pCtx, flags, device, vdpDevice, vdpGetProcAddress) -{{endif}} + return _driver._cuVDPAUCtxCreate_v2(pCtx, flags, device, vdpDevice, vdpGetProcAddress) -{{if True}} cdef CUresult cuGraphicsVDPAURegisterVideoSurface(CUgraphicsResource* pCudaResource, VdpVideoSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphicsVDPAURegisterVideoSurface(pCudaResource, vdpSurface, flags) -{{endif}} + return _driver._cuGraphicsVDPAURegisterVideoSurface(pCudaResource, vdpSurface, flags) -{{if True}} cdef CUresult cuGraphicsVDPAURegisterOutputSurface(CUgraphicsResource* pCudaResource, VdpOutputSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil: - return cydriver._cuGraphicsVDPAURegisterOutputSurface(pCudaResource, vdpSurface, flags) -{{endif}} + return _driver._cuGraphicsVDPAURegisterOutputSurface(pCudaResource, vdpSurface, flags) + + +cdef CUresult cuDeviceGetHostAtomicCapabilities(unsigned int* capabilities, const CUatomicOperation* operations, unsigned int count, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetHostAtomicCapabilities(capabilities, operations, count, dev) + + +cdef CUresult cuCtxGetDevice_v2(CUdevice* device, CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxGetDevice_v2(device, ctx) + + +cdef CUresult cuCtxSynchronize_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCtxSynchronize_v2(ctx) + + +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 _driver._cuMemcpyBatchAsync_v2(dsts, srcs, sizes, count, attrs, attrsIdxs, numAttrs, 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 _driver._cuMemcpy3DBatchAsync_v2(numOps, opList, flags, hStream) + + +cdef CUresult cuMemGetDefaultMemPool(CUmemoryPool* pool_out, CUmemLocation* location, CUmemAllocationType type) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemGetDefaultMemPool(pool_out, location, type) + + +cdef CUresult cuMemGetMemPool(CUmemoryPool* pool, CUmemLocation* location, CUmemAllocationType type) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemGetMemPool(pool, location, type) + + +cdef CUresult cuMemSetMemPool(CUmemLocation* location, CUmemAllocationType type, CUmemoryPool pool) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemSetMemPool(location, type, pool) + + +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 _driver._cuMemPrefetchBatchAsync(dptrs, sizes, count, prefetchLocs, prefetchLocIdxs, numPrefetchLocs, flags, hStream) + + +cdef CUresult cuMemDiscardBatchAsync(CUdeviceptr* dptrs, size_t* sizes, size_t count, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemDiscardBatchAsync(dptrs, sizes, count, flags, hStream) + + +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 _driver._cuMemDiscardAndPrefetchBatchAsync(dptrs, sizes, count, prefetchLocs, prefetchLocIdxs, numPrefetchLocs, flags, hStream) + + +cdef CUresult cuDeviceGetP2PAtomicCapabilities(unsigned int* capabilities, const CUatomicOperation* operations, unsigned int count, CUdevice srcDevice, CUdevice dstDevice) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetP2PAtomicCapabilities(capabilities, operations, count, srcDevice, dstDevice) + + +cdef CUresult cuGreenCtxGetId(CUgreenCtx greenCtx, unsigned long long* greenCtxId) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGreenCtxGetId(greenCtx, greenCtxId) + + +cdef CUresult cuMulticastBindMem_v2(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, CUmemGenericAllocationHandle memHandle, size_t memOffset, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMulticastBindMem_v2(mcHandle, dev, mcOffset, memHandle, memOffset, size, flags) + + +cdef CUresult cuMulticastBindAddr_v2(CUmemGenericAllocationHandle mcHandle, CUdevice dev, size_t mcOffset, CUdeviceptr memptr, size_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMulticastBindAddr_v2(mcHandle, dev, mcOffset, memptr, size, flags) + + +cdef CUresult cuGraphNodeGetContainingGraph(CUgraphNode hNode, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphNodeGetContainingGraph(hNode, phGraph) + + +cdef CUresult cuGraphNodeGetLocalId(CUgraphNode hNode, unsigned int* nodeId) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphNodeGetLocalId(hNode, nodeId) + + +cdef CUresult cuGraphNodeGetToolsId(CUgraphNode hNode, unsigned long long* toolsNodeId) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphNodeGetToolsId(hNode, toolsNodeId) + + +cdef CUresult cuGraphGetId(CUgraph hGraph, unsigned int* graphId) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphGetId(hGraph, graphId) + + +cdef CUresult cuGraphExecGetId(CUgraphExec hGraphExec, unsigned int* graphId) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphExecGetId(hGraphExec, graphId) + + +cdef CUresult cuDevSmResourceSplit(CUdevResource* result, unsigned int nbGroups, const CUdevResource* input, CUdevResource* remainder, unsigned int flags, CU_DEV_SM_RESOURCE_GROUP_PARAMS* groupParams) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDevSmResourceSplit(result, nbGroups, input, remainder, flags, groupParams) + + +cdef CUresult cuStreamGetDevResource(CUstream hStream, CUdevResource* resource, CUdevResourceType type) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamGetDevResource(hStream, resource, type) + + +cdef CUresult cuKernelGetParamCount(CUkernel kernel, size_t* paramCount) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuKernelGetParamCount(kernel, paramCount) + + +cdef CUresult cuMemcpyWithAttributesAsync(CUdeviceptr dst, CUdeviceptr src, size_t size, CUmemcpyAttributes* attr, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpyWithAttributesAsync(dst, src, size, attr, hStream) + + +cdef CUresult cuMemcpy3DWithAttributesAsync(CUDA_MEMCPY3D_BATCH_OP* op, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemcpy3DWithAttributesAsync(op, flags, hStream) + + +cdef CUresult cuStreamBeginCaptureToCig(CUstream hStream, CUstreamCigCaptureParams* streamCigCaptureParams) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamBeginCaptureToCig(hStream, streamCigCaptureParams) + + +cdef CUresult cuStreamEndCaptureToCig(CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamEndCaptureToCig(hStream) + + +cdef CUresult cuFuncGetParamCount(CUfunction func, size_t* paramCount) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuFuncGetParamCount(func, paramCount) + + +cdef CUresult cuLaunchHostFunc_v2(CUstream hStream, CUhostFn fn, void* userData, unsigned int syncMode) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLaunchHostFunc_v2(hStream, fn, userData, syncMode) + + +cdef CUresult cuGraphNodeGetParams(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphNodeGetParams(hNode, nodeParams) + + +cdef CUresult cuCoredumpRegisterStartCallback(CUcoredumpStatusCallback callback, void* userData, CUcoredumpCallbackHandle* callbackOut) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCoredumpRegisterStartCallback(callback, userData, callbackOut) + + +cdef CUresult cuCoredumpRegisterCompleteCallback(CUcoredumpStatusCallback callback, void* userData, CUcoredumpCallbackHandle* callbackOut) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCoredumpRegisterCompleteCallback(callback, userData, callbackOut) + + +cdef CUresult cuCoredumpDeregisterStartCallback(CUcoredumpCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCoredumpDeregisterStartCallback(callback) + + +cdef CUresult cuCoredumpDeregisterCompleteCallback(CUcoredumpCallbackHandle callback) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCoredumpDeregisterCompleteCallback(callback) + + +cdef CUresult cuLogicalEndpointIdReserve(CUlogicalEndpointId* baseLeId, cuuint32_t count) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLogicalEndpointIdReserve(baseLeId, count) + + +cdef CUresult cuLogicalEndpointIdRelease(CUlogicalEndpointId baseLeId, cuuint32_t count) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLogicalEndpointIdRelease(baseLeId, count) + + +cdef CUresult cuLogicalEndpointCreate(CUlogicalEndpointId leId, const CUlogicalEndpointProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLogicalEndpointCreate(leId, prop) + + +cdef CUresult cuLogicalEndpointAddDevice(CUlogicalEndpointId leId, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLogicalEndpointAddDevice(leId, dev) + + +cdef CUresult cuLogicalEndpointDestroy(CUlogicalEndpointId leId) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLogicalEndpointDestroy(leId) + + +cdef CUresult cuLogicalEndpointBindAddr(CUlogicalEndpointId leId, CUdevice dev, cuuint64_t offset, void* ptr, cuuint64_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLogicalEndpointBindAddr(leId, dev, offset, ptr, size, flags) + + +cdef CUresult cuLogicalEndpointBindMem(CUlogicalEndpointId leId, CUdevice dev, cuuint64_t offset, CUmemGenericAllocationHandle memHandle, cuuint64_t memOffset, cuuint64_t size, unsigned long long flags) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLogicalEndpointBindMem(leId, dev, offset, memHandle, memOffset, size, flags) + + +cdef CUresult cuLogicalEndpointUnbind(CUlogicalEndpointId leId, CUdevice dev, cuuint64_t offset, cuuint64_t size) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLogicalEndpointUnbind(leId, dev, offset, size) + + +cdef CUresult cuLogicalEndpointExport(void* handle, CUlogicalEndpointId leId, CUlogicalEndpointIpcHandleType handleType) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLogicalEndpointExport(handle, leId, handleType) + + +cdef CUresult cuLogicalEndpointImport(CUlogicalEndpointId leId, const void* handle, CUlogicalEndpointIpcHandleType handleType) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLogicalEndpointImport(leId, handle, handleType) + + +cdef CUresult cuLogicalEndpointGetLimits(cuuint64_t* bindAlignment, cuuint64_t* maxSize, const CUlogicalEndpointProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLogicalEndpointGetLimits(bindAlignment, maxSize, prop) + + +cdef CUresult cuLogicalEndpointQuery(CUlogicalEndpointId leId, cuuint32_t count, int* queryStatus) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuLogicalEndpointQuery(leId, count, queryStatus) + + +cdef CUresult cuStreamBeginRecaptureToGraph(CUstream hStream, CUstreamCaptureMode mode, CUgraph hGraph, CUgraphRecaptureCallback callbackFunc, void* userData) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuStreamBeginRecaptureToGraph(hStream, mode, hGraph, callbackFunc, userData) diff --git a/cuda_bindings/cuda/bindings/cynvfatbin.pxd b/cuda_bindings/cuda/bindings/cynvfatbin.pxd index 3cf5c542e25..ef8951fbcc3 100644 --- a/cuda_bindings/cuda/bindings/cynvfatbin.pxd +++ b/cuda_bindings/cuda/bindings/cynvfatbin.pxd @@ -1,9 +1,10 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.4.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.4.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=fede358631d711050e04c9b0f7582773ba7012844987bc47358f1378d484a136 from libc.stdint cimport intptr_t, uint32_t @@ -51,5 +52,6 @@ cdef nvFatbinResult nvFatbinAddLTOIR(nvFatbinHandle handle, const void* code, si cdef nvFatbinResult nvFatbinSize(nvFatbinHandle handle, size_t* size) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil cdef nvFatbinResult nvFatbinGet(nvFatbinHandle handle, void* buffer) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil cdef nvFatbinResult nvFatbinVersion(unsigned int* major, unsigned int* minor) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvFatbinResult nvFatbinAddIndex(nvFatbinHandle handle, const void* code, size_t size, const char* identifier) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil cdef nvFatbinResult nvFatbinAddReloc(nvFatbinHandle handle, const void* code, size_t size) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil cdef nvFatbinResult nvFatbinAddTileIR(nvFatbinHandle handle, const void* code, size_t size, const char* identifier, const char* optionsCmdLine) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil diff --git a/cuda_bindings/cuda/bindings/cynvfatbin.pyx b/cuda_bindings/cuda/bindings/cynvfatbin.pyx index 07492e51a94..86bdd89f0f3 100644 --- a/cuda_bindings/cuda/bindings/cynvfatbin.pyx +++ b/cuda_bindings/cuda/bindings/cynvfatbin.pyx @@ -1,9 +1,10 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.4.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.4.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=bae30bbdaff2009b86c05de2a46bbaecad9e63327c93a10b6f2e8a2d95fd6a60 from ._internal cimport nvfatbin as _nvfatbin @@ -47,6 +48,10 @@ cdef nvFatbinResult nvFatbinVersion(unsigned int* major, unsigned int* minor) ex return _nvfatbin._nvFatbinVersion(major, minor) +cdef nvFatbinResult nvFatbinAddIndex(nvFatbinHandle handle, const void* code, size_t size, const char* identifier) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvfatbin._nvFatbinAddIndex(handle, code, size, identifier) + + cdef nvFatbinResult nvFatbinAddReloc(nvFatbinHandle handle, const void* code, size_t size) except?_NVFATBINRESULT_INTERNAL_LOADING_ERROR nogil: return _nvfatbin._nvFatbinAddReloc(handle, code, size) diff --git a/cuda_bindings/cuda/bindings/cynvjitlink.pxd b/cuda_bindings/cuda/bindings/cynvjitlink.pxd index 50d817f13bd..ff80a17c5ab 100644 --- a/cuda_bindings/cuda/bindings/cynvjitlink.pxd +++ b/cuda_bindings/cuda/bindings/cynvjitlink.pxd @@ -1,9 +1,10 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=58778b073e81f54fcf5c42775b45944d22b6e944fe6965b42d83898239f1e1b6 from libc.stdint cimport intptr_t, uint32_t @@ -68,3 +69,5 @@ cdef nvJitLinkResult nvJitLinkGetErrorLog(nvJitLinkHandle handle, char* log) exc cdef nvJitLinkResult nvJitLinkGetInfoLogSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil cdef nvJitLinkResult nvJitLinkGetInfoLog(nvJitLinkHandle handle, char* log) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil cdef nvJitLinkResult nvJitLinkVersion(unsigned int* major, unsigned int* minor) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult nvJitLinkGetLinkedLTOIRSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvJitLinkResult nvJitLinkGetLinkedLTOIR(nvJitLinkHandle handle, void* ltoir) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil diff --git a/cuda_bindings/cuda/bindings/cynvjitlink.pyx b/cuda_bindings/cuda/bindings/cynvjitlink.pyx index 53639e64a95..cf4ee0332a0 100644 --- a/cuda_bindings/cuda/bindings/cynvjitlink.pyx +++ b/cuda_bindings/cuda/bindings/cynvjitlink.pyx @@ -1,9 +1,10 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=e507515291c3bc20b88d0b58ab5b01a1cc38c5d21bca87a4f379cc846b869ed4 from ._internal cimport nvjitlink as _nvjitlink @@ -65,3 +66,11 @@ cdef nvJitLinkResult nvJitLinkGetInfoLog(nvJitLinkHandle handle, char* log) exce cdef nvJitLinkResult nvJitLinkVersion(unsigned int* major, unsigned int* minor) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: return _nvjitlink._nvJitLinkVersion(major, minor) + + +cdef nvJitLinkResult nvJitLinkGetLinkedLTOIRSize(nvJitLinkHandle handle, size_t* size) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvjitlink._nvJitLinkGetLinkedLTOIRSize(handle, size) + + +cdef nvJitLinkResult nvJitLinkGetLinkedLTOIR(nvJitLinkHandle handle, void* ltoir) except?_NVJITLINKRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvjitlink._nvJitLinkGetLinkedLTOIR(handle, ltoir) diff --git a/cuda_bindings/cuda/bindings/cynvml.pxd b/cuda_bindings/cuda/bindings/cynvml.pxd index a1bb81ffb50..61ac3fa0da7 100644 --- a/cuda_bindings/cuda/bindings/cynvml.pxd +++ b/cuda_bindings/cuda/bindings/cynvml.pxd @@ -1,9 +1,10 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.9.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=5e55307c8ff89e076c29fc7c2a36bf0af7ecf3162693a4c94d7fca65454d6a9e from libc.stdint cimport int64_t @@ -235,6 +236,7 @@ ctypedef enum nvmlNvlinkVersion_t "nvmlNvlinkVersion_t": NVML_NVLINK_VERSION_3_1 "NVML_NVLINK_VERSION_3_1" = 5 NVML_NVLINK_VERSION_4_0 "NVML_NVLINK_VERSION_4_0" = 6 NVML_NVLINK_VERSION_5_0 "NVML_NVLINK_VERSION_5_0" = 7 + NVML_NVLINK_VERSION_6_0 "NVML_NVLINK_VERSION_6_0" = 8 ctypedef enum nvmlEccCounterType_t "nvmlEccCounterType_t": NVML_VOLATILE_ECC "NVML_VOLATILE_ECC" = 0 @@ -415,6 +417,7 @@ ctypedef enum nvmlDeviceGpuRecoveryAction_t "nvmlDeviceGpuRecoveryAction_t": NVML_GPU_RECOVERY_ACTION_NODE_REBOOT "NVML_GPU_RECOVERY_ACTION_NODE_REBOOT" = 2 NVML_GPU_RECOVERY_ACTION_DRAIN_P2P "NVML_GPU_RECOVERY_ACTION_DRAIN_P2P" = 3 NVML_GPU_RECOVERY_ACTION_DRAIN_AND_RESET "NVML_GPU_RECOVERY_ACTION_DRAIN_AND_RESET" = 4 + NVML_GPU_RECOVERY_ACTION_RECOVER_IMEX_DOMAIN "NVML_GPU_RECOVERY_ACTION_RECOVER_IMEX_DOMAIN" = 5 ctypedef enum nvmlFanState_t "nvmlFanState_t": NVML_FAN_NORMAL "NVML_FAN_NORMAL" = 0 @@ -646,6 +649,42 @@ ctypedef enum nvmlGpmMetricId_t "nvmlGpmMetricId_t": NVML_GPM_METRIC_GR7_CTXSW_REQUESTS "NVML_GPM_METRIC_GR7_CTXSW_REQUESTS" = 207 NVML_GPM_METRIC_GR7_CTXSW_CYCLES_PER_REQ "NVML_GPM_METRIC_GR7_CTXSW_CYCLES_PER_REQ" = 208 NVML_GPM_METRIC_GR7_CTXSW_ACTIVE_PCT "NVML_GPM_METRIC_GR7_CTXSW_ACTIVE_PCT" = 209 + NVML_GPM_METRIC_NVLINK_L18_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L18_RX_PER_SEC" = 212 + NVML_GPM_METRIC_NVLINK_L18_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L18_TX_PER_SEC" = 213 + NVML_GPM_METRIC_NVLINK_L19_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L19_RX_PER_SEC" = 214 + NVML_GPM_METRIC_NVLINK_L19_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L19_TX_PER_SEC" = 215 + NVML_GPM_METRIC_NVLINK_L20_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L20_RX_PER_SEC" = 216 + NVML_GPM_METRIC_NVLINK_L20_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L20_TX_PER_SEC" = 217 + NVML_GPM_METRIC_NVLINK_L21_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L21_RX_PER_SEC" = 218 + NVML_GPM_METRIC_NVLINK_L21_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L21_TX_PER_SEC" = 219 + NVML_GPM_METRIC_NVLINK_L22_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L22_RX_PER_SEC" = 220 + NVML_GPM_METRIC_NVLINK_L22_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L22_TX_PER_SEC" = 221 + NVML_GPM_METRIC_NVLINK_L23_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L23_RX_PER_SEC" = 222 + NVML_GPM_METRIC_NVLINK_L23_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L23_TX_PER_SEC" = 223 + NVML_GPM_METRIC_NVLINK_L24_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L24_RX_PER_SEC" = 224 + NVML_GPM_METRIC_NVLINK_L24_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L24_TX_PER_SEC" = 225 + NVML_GPM_METRIC_NVLINK_L25_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L25_RX_PER_SEC" = 226 + NVML_GPM_METRIC_NVLINK_L25_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L25_TX_PER_SEC" = 227 + NVML_GPM_METRIC_NVLINK_L26_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L26_RX_PER_SEC" = 228 + NVML_GPM_METRIC_NVLINK_L26_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L26_TX_PER_SEC" = 229 + NVML_GPM_METRIC_NVLINK_L27_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L27_RX_PER_SEC" = 230 + NVML_GPM_METRIC_NVLINK_L27_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L27_TX_PER_SEC" = 231 + NVML_GPM_METRIC_NVLINK_L28_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L28_RX_PER_SEC" = 232 + NVML_GPM_METRIC_NVLINK_L28_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L28_TX_PER_SEC" = 233 + NVML_GPM_METRIC_NVLINK_L29_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L29_RX_PER_SEC" = 234 + NVML_GPM_METRIC_NVLINK_L29_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L29_TX_PER_SEC" = 235 + NVML_GPM_METRIC_NVLINK_L30_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L30_RX_PER_SEC" = 236 + NVML_GPM_METRIC_NVLINK_L30_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L30_TX_PER_SEC" = 237 + NVML_GPM_METRIC_NVLINK_L31_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L31_RX_PER_SEC" = 238 + NVML_GPM_METRIC_NVLINK_L31_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L31_TX_PER_SEC" = 239 + NVML_GPM_METRIC_NVLINK_L32_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L32_RX_PER_SEC" = 240 + NVML_GPM_METRIC_NVLINK_L32_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L32_TX_PER_SEC" = 241 + NVML_GPM_METRIC_NVLINK_L33_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L33_RX_PER_SEC" = 242 + NVML_GPM_METRIC_NVLINK_L33_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L33_TX_PER_SEC" = 243 + NVML_GPM_METRIC_NVLINK_L34_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L34_RX_PER_SEC" = 244 + NVML_GPM_METRIC_NVLINK_L34_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L34_TX_PER_SEC" = 245 + NVML_GPM_METRIC_NVLINK_L35_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L35_RX_PER_SEC" = 246 + NVML_GPM_METRIC_NVLINK_L35_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L35_TX_PER_SEC" = 247 NVML_GPM_METRIC_SM_CYCLES_ELAPSED "NVML_GPM_METRIC_SM_CYCLES_ELAPSED" = 248 NVML_GPM_METRIC_SM_CYCLES_ACTIVE "NVML_GPM_METRIC_SM_CYCLES_ACTIVE" = 249 NVML_GPM_METRIC_MMA_CYCLES_ACTIVE "NVML_GPM_METRIC_MMA_CYCLES_ACTIVE" = 250 @@ -695,6 +734,42 @@ ctypedef enum nvmlGpmMetricId_t "nvmlGpmMetricId_t": NVML_GPM_METRIC_NVLINK_L16_TX "NVML_GPM_METRIC_NVLINK_L16_TX" = 294 NVML_GPM_METRIC_NVLINK_L17_RX "NVML_GPM_METRIC_NVLINK_L17_RX" = 295 NVML_GPM_METRIC_NVLINK_L17_TX "NVML_GPM_METRIC_NVLINK_L17_TX" = 296 + NVML_GPM_METRIC_NVLINK_L18_RX "NVML_GPM_METRIC_NVLINK_L18_RX" = 297 + NVML_GPM_METRIC_NVLINK_L18_TX "NVML_GPM_METRIC_NVLINK_L18_TX" = 298 + NVML_GPM_METRIC_NVLINK_L19_RX "NVML_GPM_METRIC_NVLINK_L19_RX" = 299 + NVML_GPM_METRIC_NVLINK_L19_TX "NVML_GPM_METRIC_NVLINK_L19_TX" = 300 + NVML_GPM_METRIC_NVLINK_L20_RX "NVML_GPM_METRIC_NVLINK_L20_RX" = 301 + NVML_GPM_METRIC_NVLINK_L20_TX "NVML_GPM_METRIC_NVLINK_L20_TX" = 302 + NVML_GPM_METRIC_NVLINK_L21_RX "NVML_GPM_METRIC_NVLINK_L21_RX" = 303 + NVML_GPM_METRIC_NVLINK_L21_TX "NVML_GPM_METRIC_NVLINK_L21_TX" = 304 + NVML_GPM_METRIC_NVLINK_L22_RX "NVML_GPM_METRIC_NVLINK_L22_RX" = 305 + NVML_GPM_METRIC_NVLINK_L22_TX "NVML_GPM_METRIC_NVLINK_L22_TX" = 306 + NVML_GPM_METRIC_NVLINK_L23_RX "NVML_GPM_METRIC_NVLINK_L23_RX" = 307 + NVML_GPM_METRIC_NVLINK_L23_TX "NVML_GPM_METRIC_NVLINK_L23_TX" = 308 + NVML_GPM_METRIC_NVLINK_L24_RX "NVML_GPM_METRIC_NVLINK_L24_RX" = 309 + NVML_GPM_METRIC_NVLINK_L24_TX "NVML_GPM_METRIC_NVLINK_L24_TX" = 310 + NVML_GPM_METRIC_NVLINK_L25_RX "NVML_GPM_METRIC_NVLINK_L25_RX" = 311 + NVML_GPM_METRIC_NVLINK_L25_TX "NVML_GPM_METRIC_NVLINK_L25_TX" = 312 + NVML_GPM_METRIC_NVLINK_L26_RX "NVML_GPM_METRIC_NVLINK_L26_RX" = 313 + NVML_GPM_METRIC_NVLINK_L26_TX "NVML_GPM_METRIC_NVLINK_L26_TX" = 314 + NVML_GPM_METRIC_NVLINK_L27_RX "NVML_GPM_METRIC_NVLINK_L27_RX" = 315 + NVML_GPM_METRIC_NVLINK_L27_TX "NVML_GPM_METRIC_NVLINK_L27_TX" = 316 + NVML_GPM_METRIC_NVLINK_L28_RX "NVML_GPM_METRIC_NVLINK_L28_RX" = 317 + NVML_GPM_METRIC_NVLINK_L28_TX "NVML_GPM_METRIC_NVLINK_L28_TX" = 318 + NVML_GPM_METRIC_NVLINK_L29_RX "NVML_GPM_METRIC_NVLINK_L29_RX" = 319 + NVML_GPM_METRIC_NVLINK_L29_TX "NVML_GPM_METRIC_NVLINK_L29_TX" = 320 + NVML_GPM_METRIC_NVLINK_L30_RX "NVML_GPM_METRIC_NVLINK_L30_RX" = 321 + NVML_GPM_METRIC_NVLINK_L30_TX "NVML_GPM_METRIC_NVLINK_L30_TX" = 322 + NVML_GPM_METRIC_NVLINK_L31_RX "NVML_GPM_METRIC_NVLINK_L31_RX" = 323 + NVML_GPM_METRIC_NVLINK_L31_TX "NVML_GPM_METRIC_NVLINK_L31_TX" = 324 + NVML_GPM_METRIC_NVLINK_L32_RX "NVML_GPM_METRIC_NVLINK_L32_RX" = 325 + NVML_GPM_METRIC_NVLINK_L32_TX "NVML_GPM_METRIC_NVLINK_L32_TX" = 326 + NVML_GPM_METRIC_NVLINK_L33_RX "NVML_GPM_METRIC_NVLINK_L33_RX" = 327 + NVML_GPM_METRIC_NVLINK_L33_TX "NVML_GPM_METRIC_NVLINK_L33_TX" = 328 + NVML_GPM_METRIC_NVLINK_L34_RX "NVML_GPM_METRIC_NVLINK_L34_RX" = 329 + NVML_GPM_METRIC_NVLINK_L34_TX "NVML_GPM_METRIC_NVLINK_L34_TX" = 330 + NVML_GPM_METRIC_NVLINK_L35_RX "NVML_GPM_METRIC_NVLINK_L35_RX" = 331 + NVML_GPM_METRIC_NVLINK_L35_TX "NVML_GPM_METRIC_NVLINK_L35_TX" = 332 NVML_GPM_METRIC_MAX "NVML_GPM_METRIC_MAX" = 333 ctypedef enum nvmlPowerProfileType_t "nvmlPowerProfileType_t": @@ -743,6 +818,16 @@ ctypedef enum nvmlPowerProfileOperation_t "nvmlPowerProfileOperation_t": NVML_POWER_PROFILE_OPERATION_SET_AND_OVERWRITE "NVML_POWER_PROFILE_OPERATION_SET_AND_OVERWRITE" = 2 NVML_POWER_PROFILE_OPERATION_MAX "NVML_POWER_PROFILE_OPERATION_MAX" = 3 +ctypedef enum nvmlProcessMode_t "nvmlProcessMode_t": + NVML_PROCESS_MODE_COMPUTE "NVML_PROCESS_MODE_COMPUTE" = 0 + NVML_PROCESS_MODE_GRAPHICS "NVML_PROCESS_MODE_GRAPHICS" = 1 + NVML_PROCESS_MODE_MPS "NVML_PROCESS_MODE_MPS" = 2 + NVML_PROCESS_MODE_ALL "NVML_PROCESS_MODE_ALL" = 3 + NVML_PROCESS_MODE_MAX "NVML_PROCESS_MODE_MAX" = (NVML_PROCESS_MODE_ALL + 1) + +ctypedef enum nvmlCPERType_t "nvmlCPERType_t": + NVML_CPER_ACCESS_TYPE_GPU "NVML_CPER_ACCESS_TYPE_GPU" = (1 << 0) + # types ctypedef struct nvmlPciInfoExt_v1_t 'nvmlPciInfoExt_v1_t': @@ -817,12 +902,19 @@ ctypedef struct nvmlPlatformInfo_v2_t 'nvmlPlatformInfo_v2_t': unsigned char moduleId ctypedef unsigned int nvmlDeviceArchitecture_t 'nvmlDeviceArchitecture_t' + ctypedef unsigned int nvmlBusType_t 'nvmlBusType_t' + ctypedef unsigned int nvmlFanControlPolicy_t 'nvmlFanControlPolicy_t' + ctypedef unsigned int nvmlPowerSource_t 'nvmlPowerSource_t' + ctypedef unsigned char nvmlPowerScopeType_t 'nvmlPowerScopeType_t' + ctypedef unsigned int nvmlVgpuTypeId_t 'nvmlVgpuTypeId_t' + ctypedef unsigned int nvmlVgpuInstance_t 'nvmlVgpuInstance_t' + ctypedef struct nvmlVgpuHeterogeneousMode_v1_t 'nvmlVgpuHeterogeneousMode_v1_t': unsigned int version unsigned int mode @@ -862,11 +954,13 @@ ctypedef struct nvmlConfComputeGetKeyRotationThresholdInfo_v1_t 'nvmlConfCompute unsigned long long attackerAdvantage ctypedef unsigned char nvmlGpuFabricState_t 'nvmlGpuFabricState_t' + ctypedef struct nvmlSystemDriverBranchInfo_v1_t 'nvmlSystemDriverBranchInfo_v1_t': unsigned int version char branch[80] ctypedef unsigned int nvmlAffinityScope_t 'nvmlAffinityScope_t' + ctypedef struct nvmlTemperature_v1_t 'nvmlTemperature_v1_t': unsigned int version nvmlTemperatureSensors_t sensorType @@ -914,13 +1008,22 @@ ctypedef struct nvmlPdi_v1_t 'nvmlPdi_v1_t': unsigned int version unsigned long long value +ctypedef unsigned long long nvmlCPERCursorHandle_t 'nvmlCPERCursorHandle_t' + ctypedef void* nvmlDevice_t 'nvmlDevice_t' + ctypedef void* nvmlGpuInstance_t 'nvmlGpuInstance_t' + ctypedef void* nvmlUnit_t 'nvmlUnit_t' + ctypedef void* nvmlEventSet_t 'nvmlEventSet_t' + ctypedef void* nvmlSystemEventSet_t 'nvmlSystemEventSet_t' + ctypedef void* nvmlComputeInstance_t 'nvmlComputeInstance_t' + ctypedef void* nvmlGpmSample_t 'nvmlGpmSample_t' + ctypedef struct nvmlPciInfo_t 'nvmlPciInfo_t': char busIdLegacy[16] unsigned int domain @@ -1022,7 +1125,7 @@ ctypedef struct nvmlViolationTime_t 'nvmlViolationTime_t': unsigned long long referenceTime unsigned long long violationTime -ctypedef struct _anon_pod0 '_anon_pod0': +ctypedef struct cuda_bindings_nvml__anon_pod0: nvmlThermalController_t controller int defaultMinTemp int defaultMaxTemp @@ -1065,7 +1168,7 @@ ctypedef struct nvmlPlatformInfo_v1_t 'nvmlPlatformInfo_v1_t': unsigned char peerType unsigned char moduleId -ctypedef struct _anon_pod1 '_anon_pod1': +ctypedef struct cuda_bindings_nvml__anon_pod1: unsigned int bIsPresent unsigned int percentage unsigned int incThreshold @@ -1077,11 +1180,11 @@ ctypedef struct nvmlVgpuPlacementList_v1_t 'nvmlVgpuPlacementList_v1_t': unsigned int count unsigned int* placementIds -ctypedef struct _anon_pod2 '_anon_pod2': +ctypedef struct cuda_bindings_nvml__anon_pod2: unsigned int avgFactor unsigned int timeslice -ctypedef struct _anon_pod3 '_anon_pod3': +ctypedef struct cuda_bindings_nvml__anon_pod3: unsigned int timeslice ctypedef struct nvmlVgpuSchedulerLogEntry_t 'nvmlVgpuSchedulerLogEntry_t': @@ -1092,11 +1195,11 @@ ctypedef struct nvmlVgpuSchedulerLogEntry_t 'nvmlVgpuSchedulerLogEntry_t': unsigned long long targetTimeSlice unsigned long long cumulativePreemptionTime -ctypedef struct _anon_pod4 '_anon_pod4': +ctypedef struct cuda_bindings_nvml__anon_pod4: unsigned int avgFactor unsigned int frequency -ctypedef struct _anon_pod5 '_anon_pod5': +ctypedef struct cuda_bindings_nvml__anon_pod5: unsigned int timeslice ctypedef struct nvmlVgpuSchedulerCapabilities_t 'nvmlVgpuSchedulerCapabilities_t': @@ -1308,7 +1411,7 @@ ctypedef struct nvmlComputeInstanceProfileInfo_v3_t 'nvmlComputeInstanceProfileI char name[96] unsigned int capabilities -ctypedef struct _anon_pod6 '_anon_pod6': +ctypedef struct cuda_bindings_nvml__anon_pod6: char* shortName char* longName char* unit @@ -1347,7 +1450,7 @@ ctypedef struct nvmlNvlinkFirmwareVersion_t 'nvmlNvlinkFirmwareVersion_t': unsigned int minor unsigned int subMinor -ctypedef union _anon_pod7 '_anon_pod7': +ctypedef union cuda_bindings_nvml__anon_pod7: unsigned char inData[496] unsigned char outData[496] @@ -1382,16 +1485,49 @@ ctypedef struct nvmlVgpuSchedulerState_v2_t 'nvmlVgpuSchedulerState_v2_t': unsigned int avgFactor unsigned int frequency +ctypedef struct nvmlBBXTimeData_v1_t 'nvmlBBXTimeData_v1_t': + unsigned int timeRun + +ctypedef struct nvmlRemappedRowsInfo_v2_t 'nvmlRemappedRowsInfo_v2_t': + unsigned int corrActiveRemaps + unsigned int corrInactiveRemaps + unsigned int uncActiveRemaps + unsigned int uncInactiveRemaps + unsigned int bPending + unsigned int bFailureOccurred + +ctypedef struct nvmlAccountingStats_v2_t 'nvmlAccountingStats_v2_t': + unsigned int pid + unsigned int isRunning + unsigned int gpuUtilization + unsigned int memoryUtilization + unsigned long long maxMemoryUsage + unsigned int sampleCount + unsigned long long sumGpuUtil + unsigned long long sumFbUtil + unsigned long long time + unsigned long long startTime + ctypedef nvmlPciInfoExt_v1_t nvmlPciInfoExt_t 'nvmlPciInfoExt_t' + ctypedef nvmlCoolerInfo_v1_t nvmlCoolerInfo_t 'nvmlCoolerInfo_t' + ctypedef nvmlDramEncryptionInfo_v1_t nvmlDramEncryptionInfo_t 'nvmlDramEncryptionInfo_t' + ctypedef nvmlMarginTemperature_v1_t nvmlMarginTemperature_t 'nvmlMarginTemperature_t' + ctypedef nvmlClockOffset_v1_t nvmlClockOffset_t 'nvmlClockOffset_t' + ctypedef nvmlFanSpeedInfo_v1_t nvmlFanSpeedInfo_t 'nvmlFanSpeedInfo_t' + ctypedef nvmlDevicePerfModes_v1_t nvmlDevicePerfModes_t 'nvmlDevicePerfModes_t' + ctypedef nvmlDeviceCurrentClockFreqs_v1_t nvmlDeviceCurrentClockFreqs_t 'nvmlDeviceCurrentClockFreqs_t' + ctypedef nvmlEccSramErrorStatus_v1_t nvmlEccSramErrorStatus_t 'nvmlEccSramErrorStatus_t' + ctypedef nvmlPlatformInfo_v2_t nvmlPlatformInfo_t 'nvmlPlatformInfo_t' + ctypedef struct nvmlPowerValue_v2_t 'nvmlPowerValue_v2_t': unsigned int version nvmlPowerScopeType_t powerScope @@ -1466,13 +1602,21 @@ ctypedef struct nvmlFBCSessionInfo_t 'nvmlFBCSessionInfo_t': unsigned int averageLatency ctypedef nvmlVgpuHeterogeneousMode_v1_t nvmlVgpuHeterogeneousMode_t 'nvmlVgpuHeterogeneousMode_t' + ctypedef nvmlVgpuPlacementId_v1_t nvmlVgpuPlacementId_t 'nvmlVgpuPlacementId_t' + ctypedef nvmlVgpuPlacementList_v2_t nvmlVgpuPlacementList_t 'nvmlVgpuPlacementList_t' + ctypedef nvmlVgpuTypeBar1Info_v1_t nvmlVgpuTypeBar1Info_t 'nvmlVgpuTypeBar1Info_t' + ctypedef nvmlVgpuRuntimeState_v1_t nvmlVgpuRuntimeState_t 'nvmlVgpuRuntimeState_t' + ctypedef nvmlSystemConfComputeSettings_v1_t nvmlSystemConfComputeSettings_t 'nvmlSystemConfComputeSettings_t' + ctypedef nvmlConfComputeSetKeyRotationThresholdInfo_v1_t nvmlConfComputeSetKeyRotationThresholdInfo_t 'nvmlConfComputeSetKeyRotationThresholdInfo_t' + ctypedef nvmlConfComputeGetKeyRotationThresholdInfo_v1_t nvmlConfComputeGetKeyRotationThresholdInfo_t 'nvmlConfComputeGetKeyRotationThresholdInfo_t' + ctypedef struct nvmlGpuFabricInfo_t 'nvmlGpuFabricInfo_t': unsigned char clusterUuid[16] nvmlReturn_t status @@ -1497,16 +1641,32 @@ ctypedef struct nvmlGpuFabricInfo_v3_t 'nvmlGpuFabricInfo_v3_t': unsigned char healthSummary ctypedef nvmlSystemDriverBranchInfo_v1_t nvmlSystemDriverBranchInfo_t 'nvmlSystemDriverBranchInfo_t' + ctypedef nvmlTemperature_v1_t nvmlTemperature_t 'nvmlTemperature_t' + ctypedef nvmlNvlinkSupportedBwModes_v1_t nvmlNvlinkSupportedBwModes_t 'nvmlNvlinkSupportedBwModes_t' + ctypedef nvmlNvlinkGetBwMode_v1_t nvmlNvlinkGetBwMode_t 'nvmlNvlinkGetBwMode_t' + ctypedef nvmlNvlinkSetBwMode_v1_t nvmlNvlinkSetBwMode_t 'nvmlNvlinkSetBwMode_t' + ctypedef nvmlDeviceCapabilities_v1_t nvmlDeviceCapabilities_t 'nvmlDeviceCapabilities_t' + ctypedef nvmlPowerSmoothingProfile_v1_t nvmlPowerSmoothingProfile_t 'nvmlPowerSmoothingProfile_t' + ctypedef nvmlPowerSmoothingState_v1_t nvmlPowerSmoothingState_t 'nvmlPowerSmoothingState_t' + ctypedef nvmlDeviceAddressingMode_v1_t nvmlDeviceAddressingMode_t 'nvmlDeviceAddressingMode_t' + ctypedef nvmlRepairStatus_v1_t nvmlRepairStatus_t 'nvmlRepairStatus_t' + ctypedef nvmlPdi_v1_t nvmlPdi_t 'nvmlPdi_t' + +ctypedef struct nvmlCPERCursor_v1_t 'nvmlCPERCursor_v1_t': + unsigned int cperTypeMask + char uuid[80] + nvmlCPERCursorHandle_t handle + ctypedef struct nvmlEventData_t 'nvmlEventData_t': nvmlDevice_t device unsigned long long eventType @@ -1579,7 +1739,7 @@ ctypedef struct nvmlPRMCounterValue_v1_t 'nvmlPRMCounterValue_v1_t': ctypedef struct nvmlGpuThermalSettings_t 'nvmlGpuThermalSettings_t': unsigned int count - _anon_pod0 sensor[3] + cuda_bindings_nvml__anon_pod0 sensor[3] ctypedef struct nvmlUUID_v1_t 'nvmlUUID_v1_t': unsigned int version @@ -1599,15 +1759,15 @@ ctypedef struct nvmlProcessesUtilizationInfo_v1_t 'nvmlProcessesUtilizationInfo_ ctypedef struct nvmlGpuDynamicPstatesInfo_t 'nvmlGpuDynamicPstatesInfo_t': unsigned int flags - _anon_pod1 utilization[8] + cuda_bindings_nvml__anon_pod1 utilization[8] ctypedef union nvmlVgpuSchedulerParams_t 'nvmlVgpuSchedulerParams_t': - _anon_pod2 vgpuSchedDataWithARR - _anon_pod3 vgpuSchedData + cuda_bindings_nvml__anon_pod2 vgpuSchedDataWithARR + cuda_bindings_nvml__anon_pod3 vgpuSchedData ctypedef union nvmlVgpuSchedulerSetParams_t 'nvmlVgpuSchedulerSetParams_t': - _anon_pod4 vgpuSchedDataWithARR - _anon_pod5 vgpuSchedData + cuda_bindings_nvml__anon_pod4 vgpuSchedDataWithARR + cuda_bindings_nvml__anon_pod5 vgpuSchedData ctypedef struct nvmlVgpuLicenseInfo_t 'nvmlVgpuLicenseInfo_t': unsigned char isLicensed @@ -1661,7 +1821,7 @@ ctypedef struct nvmlGpmMetric_t 'nvmlGpmMetric_t': unsigned int metricId nvmlReturn_t nvmlReturn double value - _anon_pod6 metricInfo + cuda_bindings_nvml__anon_pod6 metricInfo ctypedef struct nvmlWorkloadPowerProfileInfo_v1_t 'nvmlWorkloadPowerProfileInfo_v1_t': unsigned int version @@ -1695,7 +1855,7 @@ ctypedef struct nvmlNvlinkFirmwareInfo_t 'nvmlNvlinkFirmwareInfo_t': ctypedef struct nvmlPRMTLV_v1_t 'nvmlPRMTLV_v1_t': unsigned dataSize unsigned status - _anon_pod7 _anon_pod_member0 + cuda_bindings_nvml__anon_pod7 _anon_pod_member0 ctypedef struct nvmlVgpuSchedulerLogInfo_v2_t 'nvmlVgpuSchedulerLogInfo_v2_t': unsigned int engineId @@ -1706,8 +1866,11 @@ ctypedef struct nvmlVgpuSchedulerLogInfo_v2_t 'nvmlVgpuSchedulerLogInfo_v2_t': nvmlVgpuSchedulerLogEntry_v2_t logEntries[200] ctypedef nvmlVgpuTypeIdInfo_v1_t nvmlVgpuTypeIdInfo_t 'nvmlVgpuTypeIdInfo_t' + ctypedef nvmlVgpuTypeMaxInstance_v1_t nvmlVgpuTypeMaxInstance_t 'nvmlVgpuTypeMaxInstance_t' + ctypedef nvmlVgpuCreatablePlacementInfo_v1_t nvmlVgpuCreatablePlacementInfo_t 'nvmlVgpuCreatablePlacementInfo_t' + ctypedef struct nvmlVgpuProcessesUtilizationInfo_v1_t 'nvmlVgpuProcessesUtilizationInfo_v1_t': unsigned int version unsigned int vgpuProcessCount @@ -1715,11 +1878,22 @@ ctypedef struct nvmlVgpuProcessesUtilizationInfo_v1_t 'nvmlVgpuProcessesUtilizat nvmlVgpuProcessUtilizationInfo_v1_t* vgpuProcUtilArray ctypedef nvmlActiveVgpuInstanceInfo_v1_t nvmlActiveVgpuInstanceInfo_t 'nvmlActiveVgpuInstanceInfo_t' + ctypedef nvmlGpuFabricInfo_v3_t nvmlGpuFabricInfoV_t 'nvmlGpuFabricInfoV_t' + +ctypedef struct nvmlGetCPER_v1_t 'nvmlGetCPER_v1_t': + nvmlCPERCursor_v1_t cursor + unsigned char* buffer + unsigned int bufferSize + ctypedef nvmlSystemEventSetCreateRequest_v1_t nvmlSystemEventSetCreateRequest_t 'nvmlSystemEventSetCreateRequest_t' + ctypedef nvmlSystemEventSetFreeRequest_v1_t nvmlSystemEventSetFreeRequest_t 'nvmlSystemEventSetFreeRequest_t' + ctypedef nvmlSystemRegisterEventRequest_v1_t nvmlSystemRegisterEventRequest_t 'nvmlSystemRegisterEventRequest_t' + ctypedef nvmlProcessDetailList_v1_t nvmlProcessDetailList_t 'nvmlProcessDetailList_t' + ctypedef struct nvmlVgpuInstancesUtilizationInfo_v1_t 'nvmlVgpuInstancesUtilizationInfo_v1_t': unsigned int version nvmlValueType_t sampleValType @@ -1733,7 +1907,9 @@ ctypedef struct nvmlPRMCounter_v1_t 'nvmlPRMCounter_v1_t': nvmlPRMCounterValue_v1_t counterValue ctypedef nvmlUUID_v1_t nvmlUUID_t 'nvmlUUID_t' + ctypedef nvmlProcessesUtilizationInfo_v1_t nvmlProcessesUtilizationInfo_t 'nvmlProcessesUtilizationInfo_t' + ctypedef struct nvmlVgpuSchedulerLog_t 'nvmlVgpuSchedulerLog_t': unsigned int engineId unsigned int schedulerPolicy @@ -1781,6 +1957,7 @@ ctypedef struct nvmlGridLicensableFeatures_t 'nvmlGridLicensableFeatures_t': nvmlGridLicensableFeature_t gridLicensableFeatures[3] ctypedef nvmlSystemEventSetWaitRequest_v1_t nvmlSystemEventSetWaitRequest_t 'nvmlSystemEventSetWaitRequest_t' + ctypedef struct nvmlGpmMetricsGet_t 'nvmlGpmMetricsGet_t': unsigned int version unsigned int numMetrics @@ -1789,29 +1966,39 @@ ctypedef struct nvmlGpmMetricsGet_t 'nvmlGpmMetricsGet_t': nvmlGpmMetric_t metrics[333] ctypedef nvmlWorkloadPowerProfileInfo_v1_t nvmlWorkloadPowerProfileInfo_t 'nvmlWorkloadPowerProfileInfo_t' + ctypedef nvmlWorkloadPowerProfileCurrentProfiles_v1_t nvmlWorkloadPowerProfileCurrentProfiles_t 'nvmlWorkloadPowerProfileCurrentProfiles_t' + ctypedef nvmlWorkloadPowerProfileRequestedProfiles_v1_t nvmlWorkloadPowerProfileRequestedProfiles_t 'nvmlWorkloadPowerProfileRequestedProfiles_t' + ctypedef nvmlEccSramUniqueUncorrectedErrorCounts_v1_t nvmlEccSramUniqueUncorrectedErrorCounts_t 'nvmlEccSramUniqueUncorrectedErrorCounts_t' + ctypedef struct nvmlNvLinkInfo_v2_t 'nvmlNvLinkInfo_v2_t': unsigned int version unsigned int isNvleEnabled nvmlNvlinkFirmwareInfo_t firmwareInfo ctypedef nvmlVgpuProcessesUtilizationInfo_v1_t nvmlVgpuProcessesUtilizationInfo_t 'nvmlVgpuProcessesUtilizationInfo_t' + ctypedef nvmlVgpuInstancesUtilizationInfo_v1_t nvmlVgpuInstancesUtilizationInfo_t 'nvmlVgpuInstancesUtilizationInfo_t' + ctypedef struct nvmlPRMCounterList_v1_t 'nvmlPRMCounterList_v1_t': unsigned int numCounters nvmlPRMCounter_v1_t* counters ctypedef nvmlVgpuSchedulerStateInfo_v1_t nvmlVgpuSchedulerStateInfo_t 'nvmlVgpuSchedulerStateInfo_t' + ctypedef nvmlVgpuSchedulerLogInfo_v1_t nvmlVgpuSchedulerLogInfo_t 'nvmlVgpuSchedulerLogInfo_t' + ctypedef nvmlVgpuSchedulerState_v1_t nvmlVgpuSchedulerState_t 'nvmlVgpuSchedulerState_t' + ctypedef struct nvmlWorkloadPowerProfileProfilesInfo_v1_t 'nvmlWorkloadPowerProfileProfilesInfo_v1_t': unsigned int version nvmlMask255_t perfProfilesMask nvmlWorkloadPowerProfileInfo_t perfProfile[255] ctypedef nvmlNvLinkInfo_v2_t nvmlNvLinkInfo_t 'nvmlNvLinkInfo_t' + ctypedef nvmlWorkloadPowerProfileProfilesInfo_v1_t nvmlWorkloadPowerProfileProfilesInfo_t 'nvmlWorkloadPowerProfileProfilesInfo_t' @@ -1947,6 +2134,7 @@ cdef nvmlReturn_t nvmlDeviceGetDriverModel_v2(nvmlDevice_t device, nvmlDriverMod cdef nvmlReturn_t nvmlDeviceGetVbiosVersion(nvmlDevice_t device, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t nvmlDeviceGetBridgeChipInfo(nvmlDevice_t device, nvmlBridgeChipHierarchy_t* bridgeHierarchy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t nvmlDeviceGetComputeRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGraphicsRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t nvmlDeviceGetMPSComputeRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t nvmlDeviceGetRunningProcessDetailList(nvmlDevice_t device, nvmlProcessDetailList_t* plist) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t nvmlDeviceOnSameBoard(nvmlDevice_t device1, nvmlDevice_t device2, int* onSameBoard) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil @@ -2162,3 +2350,10 @@ cdef nvmlReturn_t nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts(nvmlDevice_t cdef nvmlReturn_t nvmlDeviceGetUnrepairableMemoryFlag_v1(nvmlDevice_t device, nvmlUnrepairableMemoryStatus_v1_t* unrepairableMemoryStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t nvmlDeviceReadPRMCounters_v1(nvmlDevice_t device, nvmlPRMCounterList_v1_t* counterList) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t nvmlDeviceSetRusdSettings_v1(nvmlDevice_t device, nvmlRusdSettings_v1_t* settings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceVgpuForceGspUnload(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerStateInfo_v2_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerStateInfo_v2_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuSchedulerLog_v2(nvmlDevice_t device, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetVgpuSchedulerLog_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceSetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil diff --git a/cuda_bindings/cuda/bindings/cynvml.pyx b/cuda_bindings/cuda/bindings/cynvml.pyx index 1200442977b..612368c7736 100644 --- a/cuda_bindings/cuda/bindings/cynvml.pyx +++ b/cuda_bindings/cuda/bindings/cynvml.pyx @@ -1,9 +1,10 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.9.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=ec221879a459b2de9b3dfe54cba58613e9c08b279a95f782a450c98fd7cea532 from ._internal cimport nvml as _nvml @@ -523,6 +524,10 @@ cdef nvmlReturn_t nvmlDeviceGetComputeRunningProcesses_v3(nvmlDevice_t device, u return _nvml._nvmlDeviceGetComputeRunningProcesses_v3(device, infoCount, infos) +cdef nvmlReturn_t nvmlDeviceGetGraphicsRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetGraphicsRunningProcesses_v3(device, infoCount, infos) + + cdef nvmlReturn_t nvmlDeviceGetMPSComputeRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: return _nvml._nvmlDeviceGetMPSComputeRunningProcesses_v3(device, infoCount, infos) @@ -1381,3 +1386,31 @@ cdef nvmlReturn_t nvmlDeviceReadPRMCounters_v1(nvmlDevice_t device, nvmlPRMCount cdef nvmlReturn_t nvmlDeviceSetRusdSettings_v1(nvmlDevice_t device, nvmlRusdSettings_v1_t* settings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: return _nvml._nvmlDeviceSetRusdSettings_v1(device, settings) + + +cdef nvmlReturn_t nvmlDeviceVgpuForceGspUnload(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceVgpuForceGspUnload(device) + + +cdef nvmlReturn_t nvmlDeviceGetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerStateInfo_v2_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetVgpuSchedulerState_v2(device, pSchedulerStateInfo) + + +cdef nvmlReturn_t nvmlGpuInstanceGetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerStateInfo_v2_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGpuInstanceGetVgpuSchedulerState_v2(gpuInstance, pSchedulerStateInfo) + + +cdef nvmlReturn_t nvmlDeviceGetVgpuSchedulerLog_v2(nvmlDevice_t device, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetVgpuSchedulerLog_v2(device, pSchedulerLogInfo) + + +cdef nvmlReturn_t nvmlGpuInstanceGetVgpuSchedulerLog_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGpuInstanceGetVgpuSchedulerLog_v2(gpuInstance, pSchedulerLogInfo) + + +cdef nvmlReturn_t nvmlDeviceSetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetVgpuSchedulerState_v2(device, pSchedulerState) + + +cdef nvmlReturn_t nvmlGpuInstanceSetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGpuInstanceSetVgpuSchedulerState_v2(gpuInstance, pSchedulerState) diff --git a/cuda_bindings/cuda/bindings/cynvrtc.pxd.in b/cuda_bindings/cuda/bindings/cynvrtc.pxd similarity index 50% rename from cuda_bindings/cuda/bindings/cynvrtc.pxd.in rename to cuda_bindings/cuda/bindings/cynvrtc.pxd index 5e5eb688420..0c0ec2f624d 100644 --- a/cuda_bindings/cuda/bindings/cynvrtc.pxd.in +++ b/cuda_bindings/cuda/bindings/cynvrtc.pxd @@ -1,163 +1,87 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -# This code was automatically generated with version 13.2.0, generator version 8797618. Do not modify it directly. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=0da658de603326899002d26fdbea39e6f469626207e7b40435f7f24a7e5accf0 from libc.stdint cimport uint32_t, uint64_t -cdef extern from "nvrtc.h": +# ENUMS +cdef extern from 'nvrtc.h': ctypedef enum nvrtcResult: - NVRTC_SUCCESS = 0 - NVRTC_ERROR_OUT_OF_MEMORY = 1 - NVRTC_ERROR_PROGRAM_CREATION_FAILURE = 2 - NVRTC_ERROR_INVALID_INPUT = 3 - NVRTC_ERROR_INVALID_PROGRAM = 4 - NVRTC_ERROR_INVALID_OPTION = 5 - NVRTC_ERROR_COMPILATION = 6 - NVRTC_ERROR_BUILTIN_OPERATION_FAILURE = 7 - NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION = 8 - NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION = 9 - NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID = 10 - NVRTC_ERROR_INTERNAL_ERROR = 11 - NVRTC_ERROR_TIME_FILE_WRITE_FAILED = 12 - NVRTC_ERROR_NO_PCH_CREATE_ATTEMPTED = 13 - 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: + NVRTC_SUCCESS + NVRTC_ERROR_OUT_OF_MEMORY + NVRTC_ERROR_PROGRAM_CREATION_FAILURE + NVRTC_ERROR_INVALID_INPUT + NVRTC_ERROR_INVALID_PROGRAM + NVRTC_ERROR_INVALID_OPTION + NVRTC_ERROR_COMPILATION + NVRTC_ERROR_BUILTIN_OPERATION_FAILURE + NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION + NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION + NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID + NVRTC_ERROR_INTERNAL_ERROR + NVRTC_ERROR_TIME_FILE_WRITE_FAILED + NVRTC_ERROR_NO_PCH_CREATE_ATTEMPTED + NVRTC_ERROR_PCH_CREATE_HEAP_EXHAUSTED + NVRTC_ERROR_PCH_CREATE + NVRTC_ERROR_CANCELLED + NVRTC_ERROR_TIME_TRACE_FILE_WRITE_FAILED + NVRTC_ERROR_BUSY +cdef enum: _NVRTCRESULT_INTERNAL_LOADING_ERROR = -42 + + +cdef enum: NVRTC_INSTALL_HEADERS_SKIP_IF_EXISTS = 0 +cdef enum: NVRTC_INSTALL_HEADERS_FORCE_OVERWRITE = 1 +cdef enum: NVRTC_INSTALL_HEADERS_NO_WAIT = 2 + + +# TYPES +cdef extern from 'nvrtc.h': + ctypedef struct _nvrtcProgram: pass - ctypedef _nvrtcProgram* nvrtcProgram + ctypedef _nvrtcProgram* nvrtcProgram 'nvrtcProgram' -{{if 'nvrtcGetErrorString' in found_functions}} -cdef const char* nvrtcGetErrorString(nvrtcResult result) except ?NULL nogil -{{endif}} +cdef extern from 'nvrtc.h': + ctypedef struct nvrtcBundledHeadersInfo 'nvrtcBundledHeadersInfo': + int available + size_t compressedSize + size_t uncompressedSize + int cudaVersionMajor + int cudaVersionMinor + unsigned int numFiles -{{if 'nvrtcVersion' in found_functions}} +# FUNCTIONS +cdef const char* nvrtcGetErrorString(nvrtcResult result) except?NULL nogil cdef nvrtcResult nvrtcVersion(int* major, int* minor) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetNumSupportedArchs' in found_functions}} - cdef nvrtcResult nvrtcGetNumSupportedArchs(int* numArchs) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetSupportedArchs' in found_functions}} - cdef nvrtcResult nvrtcGetSupportedArchs(int* supportedArchs) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcCreateProgram' in found_functions}} - cdef nvrtcResult nvrtcCreateProgram(nvrtcProgram* prog, const char* src, const char* name, int numHeaders, const char** headers, const char** includeNames) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcDestroyProgram' in found_functions}} - cdef nvrtcResult nvrtcDestroyProgram(nvrtcProgram* prog) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcCompileProgram' in found_functions}} - cdef nvrtcResult nvrtcCompileProgram(nvrtcProgram prog, int numOptions, const char** options) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetPTXSize' in found_functions}} - cdef nvrtcResult nvrtcGetPTXSize(nvrtcProgram prog, size_t* ptxSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetPTX' in found_functions}} - cdef nvrtcResult nvrtcGetPTX(nvrtcProgram prog, char* ptx) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetCUBINSize' in found_functions}} - cdef nvrtcResult nvrtcGetCUBINSize(nvrtcProgram prog, size_t* cubinSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetCUBIN' in found_functions}} - cdef nvrtcResult nvrtcGetCUBIN(nvrtcProgram prog, char* cubin) 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 -{{endif}} - -{{if 'nvrtcGetLTOIR' in found_functions}} - cdef nvrtcResult nvrtcGetLTOIR(nvrtcProgram prog, char* LTOIR) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetOptiXIRSize' in found_functions}} - cdef nvrtcResult nvrtcGetOptiXIRSize(nvrtcProgram prog, size_t* optixirSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetOptiXIR' in found_functions}} - cdef nvrtcResult nvrtcGetOptiXIR(nvrtcProgram prog, char* optixir) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetProgramLogSize' in found_functions}} - cdef nvrtcResult nvrtcGetProgramLogSize(nvrtcProgram prog, size_t* logSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetProgramLog' in found_functions}} - cdef nvrtcResult nvrtcGetProgramLog(nvrtcProgram prog, char* log) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcAddNameExpression' in found_functions}} - cdef nvrtcResult nvrtcAddNameExpression(nvrtcProgram prog, const char* name_expression) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetLoweredName' in found_functions}} - cdef nvrtcResult nvrtcGetLoweredName(nvrtcProgram prog, const char* name_expression, const char** lowered_name) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetPCHHeapSize' in found_functions}} - cdef nvrtcResult nvrtcGetPCHHeapSize(size_t* ret) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcSetPCHHeapSize' in found_functions}} - cdef nvrtcResult nvrtcSetPCHHeapSize(size_t size) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetPCHCreateStatus' in found_functions}} - cdef nvrtcResult nvrtcGetPCHCreateStatus(nvrtcProgram prog) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetPCHHeapSizeRequired' in found_functions}} - cdef nvrtcResult nvrtcGetPCHHeapSizeRequired(nvrtcProgram prog, size_t* size) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcSetFlowCallback' in found_functions}} - -cdef nvrtcResult nvrtcSetFlowCallback(nvrtcProgram prog, void* callback, void* payload) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetTileIRSize' in found_functions}} - +cdef nvrtcResult nvrtcSetFlowCallback(nvrtcProgram prog, void * callback, void* payload) except ?NVRTC_ERROR_INVALID_INPUT nogil cdef nvrtcResult nvrtcGetTileIRSize(nvrtcProgram prog, size_t* TileIRSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - -{{if 'nvrtcGetTileIR' in found_functions}} - cdef nvrtcResult nvrtcGetTileIR(nvrtcProgram prog, char* TileIR) except ?NVRTC_ERROR_INVALID_INPUT nogil -{{endif}} - +cdef nvrtcResult nvrtcInstallBundledHeaders(const char* installPath, unsigned int flags, const char** errorLog) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult nvrtcGetBundledHeadersInfo(nvrtcBundledHeadersInfo* info, const char** errorLog) except ?NVRTC_ERROR_INVALID_INPUT nogil +cdef nvrtcResult nvrtcRemoveBundledHeaders(const char* installPath, const char** errorLog) except ?NVRTC_ERROR_INVALID_INPUT nogil diff --git a/cuda_bindings/cuda/bindings/cynvrtc.pyx b/cuda_bindings/cuda/bindings/cynvrtc.pyx new file mode 100644 index 00000000000..6289a40092a --- /dev/null +++ b/cuda_bindings/cuda/bindings/cynvrtc.pyx @@ -0,0 +1,123 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. + +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=9725757222bfc514253ab6a6113b4e6b1c33fab841fe2fff8ebb1012ecf7715b +from ._internal cimport nvrtc as _nvrtc + +cdef const char* nvrtcGetErrorString(nvrtcResult result) except?NULL nogil: + return _nvrtc._nvrtcGetErrorString(result) + + +cdef nvrtcResult nvrtcVersion(int* major, int* minor) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcVersion(major, minor) + + +cdef nvrtcResult nvrtcGetNumSupportedArchs(int* numArchs) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcGetNumSupportedArchs(numArchs) + + +cdef nvrtcResult nvrtcGetSupportedArchs(int* supportedArchs) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcGetSupportedArchs(supportedArchs) + + +cdef nvrtcResult nvrtcCreateProgram(nvrtcProgram* prog, const char* src, const char* name, int numHeaders, const char** headers, const char** includeNames) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcCreateProgram(prog, src, name, numHeaders, headers, includeNames) + + +cdef nvrtcResult nvrtcDestroyProgram(nvrtcProgram* prog) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcDestroyProgram(prog) + + +cdef nvrtcResult nvrtcCompileProgram(nvrtcProgram prog, int numOptions, const char** options) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcCompileProgram(prog, numOptions, options) + + +cdef nvrtcResult nvrtcGetPTXSize(nvrtcProgram prog, size_t* ptxSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcGetPTXSize(prog, ptxSizeRet) + + +cdef nvrtcResult nvrtcGetPTX(nvrtcProgram prog, char* ptx) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcGetPTX(prog, ptx) + + +cdef nvrtcResult nvrtcGetCUBINSize(nvrtcProgram prog, size_t* cubinSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcGetCUBINSize(prog, cubinSizeRet) + + +cdef nvrtcResult nvrtcGetCUBIN(nvrtcProgram prog, char* cubin) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcGetCUBIN(prog, cubin) + + +cdef nvrtcResult nvrtcGetLTOIRSize(nvrtcProgram prog, size_t* LTOIRSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcGetLTOIRSize(prog, LTOIRSizeRet) + + +cdef nvrtcResult nvrtcGetLTOIR(nvrtcProgram prog, char* LTOIR) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcGetLTOIR(prog, LTOIR) + + +cdef nvrtcResult nvrtcGetOptiXIRSize(nvrtcProgram prog, size_t* optixirSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcGetOptiXIRSize(prog, optixirSizeRet) + + +cdef nvrtcResult nvrtcGetOptiXIR(nvrtcProgram prog, char* optixir) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcGetOptiXIR(prog, optixir) + + +cdef nvrtcResult nvrtcGetProgramLogSize(nvrtcProgram prog, size_t* logSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcGetProgramLogSize(prog, logSizeRet) + + +cdef nvrtcResult nvrtcGetProgramLog(nvrtcProgram prog, char* log) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcGetProgramLog(prog, log) + + +cdef nvrtcResult nvrtcAddNameExpression(nvrtcProgram prog, const char* name_expression) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcAddNameExpression(prog, name_expression) + + +cdef nvrtcResult nvrtcGetLoweredName(nvrtcProgram prog, const char* name_expression, const char** lowered_name) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcGetLoweredName(prog, name_expression, lowered_name) + + +cdef nvrtcResult nvrtcGetPCHHeapSize(size_t* ret) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcGetPCHHeapSize(ret) + + +cdef nvrtcResult nvrtcSetPCHHeapSize(size_t size) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcSetPCHHeapSize(size) + + +cdef nvrtcResult nvrtcGetPCHCreateStatus(nvrtcProgram prog) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcGetPCHCreateStatus(prog) + + +cdef nvrtcResult nvrtcGetPCHHeapSizeRequired(nvrtcProgram prog, size_t* size) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcGetPCHHeapSizeRequired(prog, size) + + +cdef nvrtcResult nvrtcSetFlowCallback(nvrtcProgram prog, void * callback, void* payload) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcSetFlowCallback(prog, callback, payload) + + +cdef nvrtcResult nvrtcGetTileIRSize(nvrtcProgram prog, size_t* TileIRSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcGetTileIRSize(prog, TileIRSizeRet) + + +cdef nvrtcResult nvrtcGetTileIR(nvrtcProgram prog, char* TileIR) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcGetTileIR(prog, TileIR) + + +cdef nvrtcResult nvrtcInstallBundledHeaders(const char* installPath, unsigned int flags, const char** errorLog) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcInstallBundledHeaders(installPath, flags, errorLog) + + +cdef nvrtcResult nvrtcGetBundledHeadersInfo(nvrtcBundledHeadersInfo* info, const char** errorLog) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcGetBundledHeadersInfo(info, errorLog) + + +cdef nvrtcResult nvrtcRemoveBundledHeaders(const char* installPath, const char** errorLog) except ?NVRTC_ERROR_INVALID_INPUT nogil: + return _nvrtc._nvrtcRemoveBundledHeaders(installPath, errorLog) diff --git a/cuda_bindings/cuda/bindings/cynvrtc.pyx.in b/cuda_bindings/cuda/bindings/cynvrtc.pyx.in deleted file mode 100644 index c9e698ae019..00000000000 --- a/cuda_bindings/cuda/bindings/cynvrtc.pyx.in +++ /dev/null @@ -1,161 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -# This code was automatically generated with version 13.2.0, generator version 8797618. Do not modify it directly. -cimport cuda.bindings._bindings.cynvrtc as cynvrtc - -{{if 'nvrtcGetErrorString' in found_functions}} - -cdef const char* nvrtcGetErrorString(nvrtcResult result) except ?NULL nogil: - return cynvrtc._nvrtcGetErrorString(result) -{{endif}} - -{{if 'nvrtcVersion' in found_functions}} - -cdef nvrtcResult nvrtcVersion(int* major, int* minor) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcVersion(major, minor) -{{endif}} - -{{if 'nvrtcGetNumSupportedArchs' in found_functions}} - -cdef nvrtcResult nvrtcGetNumSupportedArchs(int* numArchs) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcGetNumSupportedArchs(numArchs) -{{endif}} - -{{if 'nvrtcGetSupportedArchs' in found_functions}} - -cdef nvrtcResult nvrtcGetSupportedArchs(int* supportedArchs) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcGetSupportedArchs(supportedArchs) -{{endif}} - -{{if 'nvrtcCreateProgram' in found_functions}} - -cdef nvrtcResult nvrtcCreateProgram(nvrtcProgram* prog, const char* src, const char* name, int numHeaders, const char** headers, const char** includeNames) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcCreateProgram(prog, src, name, numHeaders, headers, includeNames) -{{endif}} - -{{if 'nvrtcDestroyProgram' in found_functions}} - -cdef nvrtcResult nvrtcDestroyProgram(nvrtcProgram* prog) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcDestroyProgram(prog) -{{endif}} - -{{if 'nvrtcCompileProgram' in found_functions}} - -cdef nvrtcResult nvrtcCompileProgram(nvrtcProgram prog, int numOptions, const char** options) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcCompileProgram(prog, numOptions, options) -{{endif}} - -{{if 'nvrtcGetPTXSize' in found_functions}} - -cdef nvrtcResult nvrtcGetPTXSize(nvrtcProgram prog, size_t* ptxSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcGetPTXSize(prog, ptxSizeRet) -{{endif}} - -{{if 'nvrtcGetPTX' in found_functions}} - -cdef nvrtcResult nvrtcGetPTX(nvrtcProgram prog, char* ptx) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcGetPTX(prog, ptx) -{{endif}} - -{{if 'nvrtcGetCUBINSize' in found_functions}} - -cdef nvrtcResult nvrtcGetCUBINSize(nvrtcProgram prog, size_t* cubinSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcGetCUBINSize(prog, cubinSizeRet) -{{endif}} - -{{if 'nvrtcGetCUBIN' in found_functions}} - -cdef nvrtcResult nvrtcGetCUBIN(nvrtcProgram prog, char* cubin) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcGetCUBIN(prog, cubin) -{{endif}} - -{{if 'nvrtcGetLTOIRSize' in found_functions}} - -cdef nvrtcResult nvrtcGetLTOIRSize(nvrtcProgram prog, size_t* LTOIRSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcGetLTOIRSize(prog, LTOIRSizeRet) -{{endif}} - -{{if 'nvrtcGetLTOIR' in found_functions}} - -cdef nvrtcResult nvrtcGetLTOIR(nvrtcProgram prog, char* LTOIR) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcGetLTOIR(prog, LTOIR) -{{endif}} - -{{if 'nvrtcGetOptiXIRSize' in found_functions}} - -cdef nvrtcResult nvrtcGetOptiXIRSize(nvrtcProgram prog, size_t* optixirSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcGetOptiXIRSize(prog, optixirSizeRet) -{{endif}} - -{{if 'nvrtcGetOptiXIR' in found_functions}} - -cdef nvrtcResult nvrtcGetOptiXIR(nvrtcProgram prog, char* optixir) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcGetOptiXIR(prog, optixir) -{{endif}} - -{{if 'nvrtcGetProgramLogSize' in found_functions}} - -cdef nvrtcResult nvrtcGetProgramLogSize(nvrtcProgram prog, size_t* logSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcGetProgramLogSize(prog, logSizeRet) -{{endif}} - -{{if 'nvrtcGetProgramLog' in found_functions}} - -cdef nvrtcResult nvrtcGetProgramLog(nvrtcProgram prog, char* log) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcGetProgramLog(prog, log) -{{endif}} - -{{if 'nvrtcAddNameExpression' in found_functions}} - -cdef nvrtcResult nvrtcAddNameExpression(nvrtcProgram prog, const char* name_expression) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcAddNameExpression(prog, name_expression) -{{endif}} - -{{if 'nvrtcGetLoweredName' in found_functions}} - -cdef nvrtcResult nvrtcGetLoweredName(nvrtcProgram prog, const char* name_expression, const char** lowered_name) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcGetLoweredName(prog, name_expression, lowered_name) -{{endif}} - -{{if 'nvrtcGetPCHHeapSize' in found_functions}} - -cdef nvrtcResult nvrtcGetPCHHeapSize(size_t* ret) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcGetPCHHeapSize(ret) -{{endif}} - -{{if 'nvrtcSetPCHHeapSize' in found_functions}} - -cdef nvrtcResult nvrtcSetPCHHeapSize(size_t size) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcSetPCHHeapSize(size) -{{endif}} - -{{if 'nvrtcGetPCHCreateStatus' in found_functions}} - -cdef nvrtcResult nvrtcGetPCHCreateStatus(nvrtcProgram prog) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcGetPCHCreateStatus(prog) -{{endif}} - -{{if 'nvrtcGetPCHHeapSizeRequired' in found_functions}} - -cdef nvrtcResult nvrtcGetPCHHeapSizeRequired(nvrtcProgram prog, size_t* size) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcGetPCHHeapSizeRequired(prog, size) -{{endif}} - -{{if 'nvrtcSetFlowCallback' in found_functions}} - -cdef nvrtcResult nvrtcSetFlowCallback(nvrtcProgram prog, void* callback, void* payload) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcSetFlowCallback(prog, callback, payload) -{{endif}} - -{{if 'nvrtcGetTileIRSize' in found_functions}} - -cdef nvrtcResult nvrtcGetTileIRSize(nvrtcProgram prog, size_t* TileIRSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcGetTileIRSize(prog, TileIRSizeRet) -{{endif}} - -{{if 'nvrtcGetTileIR' in found_functions}} - -cdef nvrtcResult nvrtcGetTileIR(nvrtcProgram prog, char* TileIR) except ?NVRTC_ERROR_INVALID_INPUT nogil: - return cynvrtc._nvrtcGetTileIR(prog, TileIR) -{{endif}} diff --git a/cuda_bindings/cuda/bindings/cynvvm.pxd b/cuda_bindings/cuda/bindings/cynvvm.pxd index 300123115fb..f25e7e84b3b 100644 --- a/cuda_bindings/cuda/bindings/cynvvm.pxd +++ b/cuda_bindings/cuda/bindings/cynvvm.pxd @@ -1,8 +1,8 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. ############################################################################### @@ -10,6 +10,7 @@ ############################################################################### # enums +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=79be0fd21f7c6b6112743eb60ce9e69287a66999ecaaa063d87a52ab64982bce ctypedef enum nvvmResult "nvvmResult": NVVM_SUCCESS "NVVM_SUCCESS" = 0 NVVM_ERROR_OUT_OF_MEMORY "NVVM_ERROR_OUT_OF_MEMORY" = 1 @@ -46,3 +47,4 @@ cdef nvvmResult nvvmGetCompiledResultSize(nvvmProgram prog, size_t* bufferSizeRe cdef nvvmResult nvvmGetCompiledResult(nvvmProgram prog, char* buffer) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil cdef nvvmResult nvvmGetProgramLogSize(nvvmProgram prog, size_t* bufferSizeRet) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil cdef nvvmResult nvvmGetProgramLog(nvvmProgram prog, char* buffer) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil +cdef nvvmResult nvvmLLVMVersion(const char* arch, int* major) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil diff --git a/cuda_bindings/cuda/bindings/cynvvm.pyx b/cuda_bindings/cuda/bindings/cynvvm.pyx index 7fe22f0dbfd..43f036a36c0 100644 --- a/cuda_bindings/cuda/bindings/cynvvm.pyx +++ b/cuda_bindings/cuda/bindings/cynvvm.pyx @@ -1,9 +1,10 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=7ea5803be62646c287bad43350e27d3254f35d25ab50b9c54f7ac5695b4c3114 from ._internal cimport nvvm as _nvvm @@ -61,3 +62,7 @@ cdef nvvmResult nvvmGetProgramLogSize(nvvmProgram prog, size_t* bufferSizeRet) e cdef nvvmResult nvvmGetProgramLog(nvvmProgram prog, char* buffer) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: return _nvvm._nvvmGetProgramLog(prog, buffer) + + +cdef nvvmResult nvvmLLVMVersion(const char* arch, int* major) except?_NVVMRESULT_INTERNAL_LOADING_ERROR nogil: + return _nvvm._nvvmLLVMVersion(arch, major) diff --git a/cuda_bindings/cuda/bindings/cyruntime.pxd.in b/cuda_bindings/cuda/bindings/cyruntime.pxd.in index d2773d7d5f8..952d5137f42 100644 --- a/cuda_bindings/cuda/bindings/cyruntime.pxd.in +++ b/cuda_bindings/cuda/bindings/cyruntime.pxd.in @@ -1,8 +1,9 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated with version 13.2.0, generator version 8797618. Do not modify it directly. +# This code was automatically generated with version 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=2d7f136277c2cc633450e22e7833a0cab63cdfc70e07719a2e46d3812cd11a2f from libc.stdint cimport uint32_t, uint64_t include "cyruntime_types.pxi" @@ -176,12 +177,12 @@ cdef struct cudaEglPlaneDesc_st: ctypedef cudaEglPlaneDesc_st cudaEglPlaneDesc -cdef union anon_union11: +cdef union anon_union12: cudaArray_t pArray[3] cudaPitchedPtr pPitch[3] cdef struct cudaEglFrame_st: - anon_union11 frame + anon_union12 frame cudaEglPlaneDesc planeDesc[3] unsigned int planeCount cudaEglFrameType frameType @@ -494,6 +495,11 @@ cdef cudaError_t cudaStreamAttachMemAsync(cudaStream_t stream, void* devPtr, siz cdef cudaError_t cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil {{endif}} +{{if 'cudaStreamBeginRecaptureToGraph' in found_functions}} + +cdef cudaError_t cudaStreamBeginRecaptureToGraph(cudaStream_t stream, cudaStreamCaptureMode mode, cudaGraph_t graph, cudaGraphRecaptureCallbackData* callbackData) except ?cudaErrorCallRequiresNewerDriver nogil +{{endif}} + {{if 'cudaStreamBeginCaptureToGraph' in found_functions}} cdef cudaError_t cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil @@ -2082,8 +2088,8 @@ cdef enum: cudaTextureType2DLayered = 242 cdef enum: cudaTextureTypeCubemapLayered = 252 -cdef enum: CUDART_VERSION = 13020 +cdef enum: CUDART_VERSION = 13030 -cdef enum: __CUDART_API_VERSION = 13020 +cdef enum: __CUDART_API_VERSION = 13030 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 d5c0e5b7ae6..0d6e5c1b490 100644 --- a/cuda_bindings/cuda/bindings/cyruntime.pyx.in +++ b/cuda_bindings/cuda/bindings/cyruntime.pyx.in @@ -1,7 +1,8 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated with version 13.2.0, generator version 8797618. Do not modify it directly. +# This code was automatically generated with version 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=8eaac6db08318ecc59f425f779f230fc18f12a64d077e6c9b3d0197725b747a4 cimport cuda.bindings._bindings.cyruntime as cyruntime cimport cython @@ -353,6 +354,12 @@ cdef cudaError_t cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMo return cyruntime._cudaStreamBeginCapture(stream, mode) {{endif}} +{{if 'cudaStreamBeginRecaptureToGraph' in found_functions}} + +cdef cudaError_t cudaStreamBeginRecaptureToGraph(cudaStream_t stream, cudaStreamCaptureMode mode, cudaGraph_t graph, cudaGraphRecaptureCallbackData* callbackData) except ?cudaErrorCallRequiresNewerDriver nogil: + return cyruntime._cudaStreamBeginRecaptureToGraph(stream, mode, graph, callbackData) +{{endif}} + {{if 'cudaStreamBeginCaptureToGraph' in found_functions}} cdef cudaError_t cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t* dependencies, const cudaGraphEdgeData* dependencyData, size_t numDependencies, cudaStreamCaptureMode mode) except ?cudaErrorCallRequiresNewerDriver nogil: diff --git a/cuda_bindings/cuda/bindings/cyruntime_functions.pxi.in b/cuda_bindings/cuda/bindings/cyruntime_functions.pxi.in index f52ddcdea0d..69c75821056 100644 --- a/cuda_bindings/cuda/bindings/cyruntime_functions.pxi.in +++ b/cuda_bindings/cuda/bindings/cyruntime_functions.pxi.in @@ -1,7 +1,8 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated with version 13.2.0, generator version 8797618. Do not modify it directly. +# This code was automatically generated with version 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=29630fb8d40658dc3ed853407f00b4618688984d4227aae877e2f32807fef519 cdef extern from "cuda_runtime_api.h": {{if 'cudaDeviceReset' in found_functions}} @@ -293,6 +294,11 @@ cdef extern from "cuda_runtime_api.h": cudaError_t cudaStreamBeginCapture(cudaStream_t stream, cudaStreamCaptureMode mode) nogil + {{endif}} + {{if 'cudaStreamBeginRecaptureToGraph' in found_functions}} + + cudaError_t cudaStreamBeginRecaptureToGraph(cudaStream_t stream, cudaStreamCaptureMode mode, cudaGraph_t graph, cudaGraphRecaptureCallbackData* callbackData) nogil + {{endif}} {{if 'cudaStreamBeginCaptureToGraph' in found_functions}} diff --git a/cuda_bindings/cuda/bindings/cyruntime_types.pxi.in b/cuda_bindings/cuda/bindings/cyruntime_types.pxi.in index dd24aeb953c..fa881e951dc 100644 --- a/cuda_bindings/cuda/bindings/cyruntime_types.pxi.in +++ b/cuda_bindings/cuda/bindings/cyruntime_types.pxi.in @@ -1,8 +1,9 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated with version 13.2.0, generator version 8797618. Do not modify it directly. +# This code was automatically generated with version 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=93953ce179542f5c6172446b305a7568ce2b5190b3bfba1f1c9da282c3b965f0 cdef extern from "vector_types.h": cdef struct dim3: @@ -147,6 +148,7 @@ cdef extern from "driver_types.h": cudaErrorInvalidResourceType = 914 cudaErrorInvalidResourceConfiguration = 915 cudaErrorStreamDetached = 917 + cudaErrorGraphRecaptureFailure = 918 cudaErrorUnknown = 999 cudaErrorApiFailureBase = 10000 @@ -322,6 +324,11 @@ cdef extern from "driver_types.h": unsigned int lastLayer unsigned int reserved[16] + cdef enum cudaSharedMemoryMode: + cudaSharedMemoryModeDefault = 0 + cudaSharedMemoryModeRequirePortable = 1 + cudaSharedMemoryModeAllowNonPortable = 2 + cdef struct cudaPointerAttributes: cudaMemoryType type int device @@ -346,8 +353,9 @@ cdef extern from "driver_types.h": int requiredClusterDepth int clusterSchedulingPolicyPreference int nonPortableClusterSizeAllowed - int reserved0 - int reserved[15] + int deviceNodeUpdateStatus + int reserved1 + int reserved[14] cdef struct cudaMemLocation: cudaMemLocationType type @@ -407,13 +415,13 @@ cdef extern from "driver_types.h": cudaArray_t array cudaOffset3D offset - cdef union anon_union1: + cdef union anon_union2: anon_struct6 ptr anon_struct7 array cdef struct cudaMemcpy3DOperand: cudaMemcpy3DOperandType type - anon_union1 op + anon_union2 op cdef struct cudaMemcpy3DBatchOp: cudaMemcpy3DOperand src @@ -543,14 +551,14 @@ cdef extern from "driver_types.h": void* handle const void* name - cdef union anon_union2: + cdef union anon_union3: int fd anon_struct8 win32 const void* nvSciBufObject cdef struct cudaExternalMemoryHandleDesc: cudaExternalMemoryHandleType type - anon_union2 handle + anon_union3 handle unsigned long long size unsigned int flags unsigned int reserved[16] @@ -573,21 +581,21 @@ cdef extern from "driver_types.h": void* handle const void* name - cdef union anon_union3: + cdef union anon_union4: int fd anon_struct9 win32 const void* nvSciSyncObj cdef struct cudaExternalSemaphoreHandleDesc: cudaExternalSemaphoreHandleType type - anon_union3 handle + anon_union4 handle unsigned int flags unsigned int reserved[16] cdef struct anon_struct10: unsigned long long value - cdef union anon_union4: + cdef union anon_union5: void* fence unsigned long long reserved @@ -596,7 +604,7 @@ cdef extern from "driver_types.h": cdef struct anon_struct12: anon_struct10 fence - anon_union4 nvSciSync + anon_union5 nvSciSync anon_struct11 keyedMutex unsigned int reserved[12] @@ -608,7 +616,7 @@ cdef extern from "driver_types.h": cdef struct anon_struct13: unsigned long long value - cdef union anon_union5: + cdef union anon_union6: void* fence unsigned long long reserved @@ -618,7 +626,7 @@ cdef extern from "driver_types.h": cdef struct anon_struct15: anon_struct13 fence - anon_union5 nvSciSync + anon_union6 nvSciSync anon_struct14 keyedMutex unsigned int reserved[10] @@ -842,7 +850,7 @@ cdef extern from "driver_types.h": size_t offset size_t size - cdef union anon_union9: + cdef union anon_union10: dim3 gridDim anon_struct16 param unsigned int isEnabled @@ -850,7 +858,7 @@ cdef extern from "driver_types.h": cdef struct cudaGraphKernelNodeUpdate: cudaGraphDeviceNode_t node cudaGraphKernelNodeField field - anon_union9 updateData + anon_union10 updateData cdef enum cudaLaunchMemSyncDomain: cudaLaunchMemSyncDomainDefault = 0 @@ -867,11 +875,6 @@ cdef extern from "driver_types.h": cudaLaunchPortableClusterModeRequirePortable = 1 cudaLaunchPortableClusterModeAllowNonPortable = 2 - cdef enum cudaSharedMemoryMode: - cudaSharedMemoryModeDefault = 0 - cudaSharedMemoryModeRequirePortable = 1 - cudaSharedMemoryModeAllowNonPortable = 2 - cdef enum cudaLaunchAttributeID: cudaLaunchAttributeIgnore = 0 cudaLaunchAttributeAccessPolicyWindow = 1 @@ -953,12 +956,12 @@ cdef extern from "driver_types.h": cdef struct anon_struct22: unsigned long long bytesOverBudget - cdef union anon_union10: + cdef union anon_union11: anon_struct22 overBudget cdef struct cudaAsyncNotificationInfo: cudaAsyncNotificationType type - anon_union10 info + anon_union11 info ctypedef cudaAsyncNotificationInfo cudaAsyncNotificationInfo_t @@ -1009,6 +1012,20 @@ cdef extern from "driver_types.h": cudaChannelFormatKindUnsignedBlockCompressed7 = 29 cudaChannelFormatKindUnsignedBlockCompressed7SRGB = 30 cudaChannelFormatKindUnsignedNormalized1010102 = 31 + cudaChannelFormatKindUnsigned8Packed422 = 32 + cudaChannelFormatKindUnsigned8Packed444 = 33 + cudaChannelFormatKindUnsigned8SemiPlanar420 = 34 + cudaChannelFormatKindUnsigned16SemiPlanar420 = 35 + cudaChannelFormatKindUnsigned8SemiPlanar422 = 36 + cudaChannelFormatKindUnsigned16SemiPlanar422 = 37 + cudaChannelFormatKindUnsigned8SemiPlanar444 = 38 + cudaChannelFormatKindUnsigned16SemiPlanar444 = 39 + cudaChannelFormatKindUnsigned8Planar420 = 40 + cudaChannelFormatKindUnsigned16Planar420 = 41 + cudaChannelFormatKindUnsigned8Planar422 = 42 + cudaChannelFormatKindUnsigned16Planar422 = 43 + cudaChannelFormatKindUnsigned8Planar444 = 44 + cudaChannelFormatKindUnsigned16Planar444 = 45 cdef enum cudaMemoryType: cudaMemoryTypeUnregistered = 0 @@ -1033,6 +1050,11 @@ cdef extern from "driver_types.h": cudaStreamCaptureStatusActive = 1 cudaStreamCaptureStatusInvalidated = 2 + cdef enum cudaGraphRecaptureStatus: + cudaGraphRecaptureEligibleForUpdate = 0 + cudaGraphRecaptureIneligibleForUpdate = 1 + cudaGraphRecaptureError = 2 + cdef enum cudaStreamCaptureMode: cudaStreamCaptureModeGlobal = 0 cudaStreamCaptureModeThreadLocal = 1 @@ -1340,7 +1362,9 @@ cdef extern from "driver_types.h": cudaDevAttrHostMemoryPoolsSupported = 144 cudaDevAttrReserved145 = 145 cudaDevAttrOnlyPartialHostNativeAtomicSupported = 147 - cudaDevAttrMax = 148 + cudaDevAttrAtomicReductionSupported = 148 + cudaDevAttrCigStreamsSupported = 151 + cudaDevAttrMax = 152 cdef enum cudaMemPoolAttr: cudaMemPoolReuseFollowEventDependencies = 1 @@ -1543,7 +1567,8 @@ cdef extern from "driver_types.h": cudaGraphNodeTypeMemAlloc = 10 cudaGraphNodeTypeMemFree = 11 cudaGraphNodeTypeConditional = 13 - cudaGraphNodeTypeCount = 14 + cudaGraphNodeTypeReserved16 = 16 + cudaGraphNodeTypeCount = 17 cdef enum cudaGraphChildGraphNodeOwnership: cudaGraphChildGraphOwnershipInvalid = -1 @@ -1600,6 +1625,15 @@ cdef extern from "driver_types.h": cudaDeviceNumaConfigNone = 0 cudaDeviceNumaConfigNumaNode = 1 + cdef enum cudaFabricOpStatusSource: + cudaFabricOpStatusSourceMbarrierV1 = 0 + cudaFabricOpStatusSourceMax = 2147483647 + + cdef enum cudaFabricOpStatusInfo: + cudaFabricOpStatusInfoSuccess = 0 + cudaFabricOpStatusInfoLast = 0 + cudaFabricOpStatusInfoMax = 2147483647 + cdef extern from "surface_types.h": ctypedef unsigned long long cudaSurfaceObject_t @@ -1719,6 +1753,12 @@ cdef extern from "cuda_runtime_api.h": ctypedef void (*cudaStreamCallback_t)(cudaStream_t stream, cudaError_t status, void* userData) + ctypedef cudaError_t (*cudaGraphRecaptureCallback_t)(void* data, cudaGraphNode_t node, const cudaGraphNodeParams* originalParams, const cudaGraphNodeParams* recaptureParams, cudaGraphRecaptureStatus status) + + cdef struct cudaGraphRecaptureCallbackData: + cudaGraphRecaptureCallback_t callbackFunc + void* userData + ctypedef void (*cudaLogsCallback_t)(void* data, cudaLogLevel logLevel, char* message, size_t length) cdef extern from "device_types.h": diff --git a/cuda_bindings/cuda/bindings/driver.pxd.in b/cuda_bindings/cuda/bindings/driver.pxd similarity index 60% rename from cuda_bindings/cuda/bindings/driver.pxd.in rename to cuda_bindings/cuda/bindings/driver.pxd index 0d623358282..9f4d912a3c4 100644 --- a/cuda_bindings/cuda/bindings/driver.pxd.in +++ b/cuda_bindings/cuda/bindings/driver.pxd @@ -1,13 +1,12 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated with version 13.2.0, generator version 8797618. Do not modify it directly. +# This code was automatically generated with version 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f4b08b7f4b26966f9f462562819700500a100748c5b34ab47de79836e6bec3f2 cimport cuda.bindings.cydriver as cydriver include "_lib/utils.pxd" -{{if 'CUcontext' in found_types}} - cdef class CUcontext: """ @@ -21,9 +20,6 @@ cdef class CUcontext: """ cdef cydriver.CUcontext _pvt_val cdef cydriver.CUcontext* _pvt_ptr -{{endif}} - -{{if 'CUmodule' in found_types}} cdef class CUmodule: """ @@ -38,9 +34,6 @@ cdef class CUmodule: """ cdef cydriver.CUmodule _pvt_val cdef cydriver.CUmodule* _pvt_ptr -{{endif}} - -{{if 'CUfunction' in found_types}} cdef class CUfunction: """ @@ -55,9 +48,6 @@ cdef class CUfunction: """ cdef cydriver.CUfunction _pvt_val cdef cydriver.CUfunction* _pvt_ptr -{{endif}} - -{{if 'CUlibrary' in found_types}} cdef class CUlibrary: """ @@ -72,9 +62,6 @@ cdef class CUlibrary: """ cdef cydriver.CUlibrary _pvt_val cdef cydriver.CUlibrary* _pvt_ptr -{{endif}} - -{{if 'CUkernel' in found_types}} cdef class CUkernel: """ @@ -89,9 +76,6 @@ cdef class CUkernel: """ cdef cydriver.CUkernel _pvt_val cdef cydriver.CUkernel* _pvt_ptr -{{endif}} - -{{if 'CUarray' in found_types}} cdef class CUarray: """ @@ -106,9 +90,6 @@ cdef class CUarray: """ cdef cydriver.CUarray _pvt_val cdef cydriver.CUarray* _pvt_ptr -{{endif}} - -{{if 'CUmipmappedArray' in found_types}} cdef class CUmipmappedArray: """ @@ -123,9 +104,6 @@ cdef class CUmipmappedArray: """ cdef cydriver.CUmipmappedArray _pvt_val cdef cydriver.CUmipmappedArray* _pvt_ptr -{{endif}} - -{{if 'CUtexref' in found_types}} cdef class CUtexref: """ @@ -140,9 +118,6 @@ cdef class CUtexref: """ cdef cydriver.CUtexref _pvt_val cdef cydriver.CUtexref* _pvt_ptr -{{endif}} - -{{if 'CUsurfref' in found_types}} cdef class CUsurfref: """ @@ -157,9 +132,6 @@ cdef class CUsurfref: """ cdef cydriver.CUsurfref _pvt_val cdef cydriver.CUsurfref* _pvt_ptr -{{endif}} - -{{if 'CUevent' in found_types}} cdef class CUevent: """ @@ -174,9 +146,6 @@ cdef class CUevent: """ cdef cydriver.CUevent _pvt_val cdef cydriver.CUevent* _pvt_ptr -{{endif}} - -{{if 'CUstream' in found_types}} cdef class CUstream: """ @@ -191,9 +160,6 @@ cdef class CUstream: """ cdef cydriver.CUstream _pvt_val cdef cydriver.CUstream* _pvt_ptr -{{endif}} - -{{if 'CUgraphicsResource' in found_types}} cdef class CUgraphicsResource: """ @@ -208,9 +174,6 @@ cdef class CUgraphicsResource: """ cdef cydriver.CUgraphicsResource _pvt_val cdef cydriver.CUgraphicsResource* _pvt_ptr -{{endif}} - -{{if 'CUexternalMemory' in found_types}} cdef class CUexternalMemory: """ @@ -225,9 +188,6 @@ cdef class CUexternalMemory: """ cdef cydriver.CUexternalMemory _pvt_val cdef cydriver.CUexternalMemory* _pvt_ptr -{{endif}} - -{{if 'CUexternalSemaphore' in found_types}} cdef class CUexternalSemaphore: """ @@ -242,9 +202,6 @@ cdef class CUexternalSemaphore: """ cdef cydriver.CUexternalSemaphore _pvt_val cdef cydriver.CUexternalSemaphore* _pvt_ptr -{{endif}} - -{{if 'CUgraph' in found_types}} cdef class CUgraph: """ @@ -259,9 +216,6 @@ cdef class CUgraph: """ cdef cydriver.CUgraph _pvt_val cdef cydriver.CUgraph* _pvt_ptr -{{endif}} - -{{if 'CUgraphNode' in found_types}} cdef class CUgraphNode: """ @@ -276,9 +230,6 @@ cdef class CUgraphNode: """ cdef cydriver.CUgraphNode _pvt_val cdef cydriver.CUgraphNode* _pvt_ptr -{{endif}} - -{{if 'CUgraphExec' in found_types}} cdef class CUgraphExec: """ @@ -293,9 +244,6 @@ cdef class CUgraphExec: """ cdef cydriver.CUgraphExec _pvt_val cdef cydriver.CUgraphExec* _pvt_ptr -{{endif}} - -{{if 'CUmemoryPool' in found_types}} cdef class CUmemoryPool: """ @@ -310,9 +258,6 @@ cdef class CUmemoryPool: """ cdef cydriver.CUmemoryPool _pvt_val cdef cydriver.CUmemoryPool* _pvt_ptr -{{endif}} - -{{if 'CUuserObject' in found_types}} cdef class CUuserObject: """ @@ -327,9 +272,6 @@ cdef class CUuserObject: """ cdef cydriver.CUuserObject _pvt_val cdef cydriver.CUuserObject* _pvt_ptr -{{endif}} - -{{if 'CUgraphDeviceNode' in found_types}} cdef class CUgraphDeviceNode: """ @@ -344,9 +286,6 @@ cdef class CUgraphDeviceNode: """ cdef cydriver.CUgraphDeviceNode _pvt_val cdef cydriver.CUgraphDeviceNode* _pvt_ptr -{{endif}} - -{{if 'CUasyncCallbackHandle' in found_types}} cdef class CUasyncCallbackHandle: """ @@ -361,9 +300,6 @@ cdef class CUasyncCallbackHandle: """ cdef cydriver.CUasyncCallbackHandle _pvt_val cdef cydriver.CUasyncCallbackHandle* _pvt_ptr -{{endif}} - -{{if 'CUgreenCtx' in found_types}} cdef class CUgreenCtx: """ @@ -378,9 +314,6 @@ cdef class CUgreenCtx: """ cdef cydriver.CUgreenCtx _pvt_val cdef cydriver.CUgreenCtx* _pvt_ptr -{{endif}} - -{{if 'CUlinkState' in found_types}} cdef class CUlinkState: """ @@ -394,9 +327,6 @@ cdef class CUlinkState: cdef cydriver.CUlinkState _pvt_val cdef cydriver.CUlinkState* _pvt_ptr cdef list _keepalive -{{endif}} - -{{if 'CUcoredumpCallbackHandle' in found_types}} cdef class CUcoredumpCallbackHandle: """ Opaque handle representing a registered coredump status callback. @@ -411,9 +341,6 @@ cdef class CUcoredumpCallbackHandle: """ cdef cydriver.CUcoredumpCallbackHandle _pvt_val cdef cydriver.CUcoredumpCallbackHandle* _pvt_ptr -{{endif}} - -{{if 'CUdevResourceDesc' in found_types}} cdef class CUdevResourceDesc: """ @@ -428,9 +355,6 @@ cdef class CUdevResourceDesc: """ cdef cydriver.CUdevResourceDesc _pvt_val cdef cydriver.CUdevResourceDesc* _pvt_ptr -{{endif}} - -{{if 'CUlogsCallbackHandle' in found_types}} cdef class CUlogsCallbackHandle: """ @@ -443,9 +367,6 @@ cdef class CUlogsCallbackHandle: """ cdef cydriver.CUlogsCallbackHandle _pvt_val cdef cydriver.CUlogsCallbackHandle* _pvt_ptr -{{endif}} - -{{if True}} cdef class CUeglStreamConnection: """ @@ -460,9 +381,6 @@ cdef class CUeglStreamConnection: """ cdef cydriver.CUeglStreamConnection _pvt_val cdef cydriver.CUeglStreamConnection* _pvt_ptr -{{endif}} - -{{if True}} cdef class EGLImageKHR: """ @@ -475,9 +393,6 @@ cdef class EGLImageKHR: """ cdef cydriver.EGLImageKHR _pvt_val cdef cydriver.EGLImageKHR* _pvt_ptr -{{endif}} - -{{if True}} cdef class EGLStreamKHR: """ @@ -490,9 +405,6 @@ cdef class EGLStreamKHR: """ cdef cydriver.EGLStreamKHR _pvt_val cdef cydriver.EGLStreamKHR* _pvt_ptr -{{endif}} - -{{if True}} cdef class EGLSyncKHR: """ @@ -505,9 +417,6 @@ cdef class EGLSyncKHR: """ cdef cydriver.EGLSyncKHR _pvt_val cdef cydriver.EGLSyncKHR* _pvt_ptr -{{endif}} - -{{if 'CUasyncCallback' in found_types}} cdef class CUasyncCallback: """ @@ -520,9 +429,6 @@ cdef class CUasyncCallback: """ cdef cydriver.CUasyncCallback _pvt_val cdef cydriver.CUasyncCallback* _pvt_ptr -{{endif}} - -{{if 'CUhostFn' in found_types}} cdef class CUhostFn: """ @@ -535,9 +441,6 @@ cdef class CUhostFn: """ cdef cydriver.CUhostFn _pvt_val cdef cydriver.CUhostFn* _pvt_ptr -{{endif}} - -{{if 'CUstreamCallback' in found_types}} cdef class CUstreamCallback: """ @@ -550,9 +453,6 @@ cdef class CUstreamCallback: """ cdef cydriver.CUstreamCallback _pvt_val cdef cydriver.CUstreamCallback* _pvt_ptr -{{endif}} - -{{if 'CUoccupancyB2DSize' in found_types}} cdef class CUoccupancyB2DSize: """ @@ -565,9 +465,18 @@ cdef class CUoccupancyB2DSize: """ cdef cydriver.CUoccupancyB2DSize _pvt_val cdef cydriver.CUoccupancyB2DSize* _pvt_ptr -{{endif}} -{{if 'CUcoredumpStatusCallback' in found_types}} +cdef class CUgraphRecaptureCallback: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUgraphRecaptureCallback _pvt_val + cdef cydriver.CUgraphRecaptureCallback* _pvt_ptr cdef class CUcoredumpStatusCallback: """ @@ -580,9 +489,6 @@ cdef class CUcoredumpStatusCallback: """ cdef cydriver.CUcoredumpStatusCallback _pvt_val cdef cydriver.CUcoredumpStatusCallback* _pvt_ptr -{{endif}} - -{{if 'CUlogsCallback' in found_types}} cdef class CUlogsCallback: """ @@ -595,18 +501,15 @@ cdef class CUlogsCallback: """ cdef cydriver.CUlogsCallback _pvt_val cdef cydriver.CUlogsCallback* _pvt_ptr -{{endif}} - -{{if 'CUuuid_st' in found_struct}} cdef class CUuuid_st: """ Attributes ---------- - {{if 'CUuuid_st.bytes' in found_struct}} + bytes : bytes < CUDA definition of UUID - {{endif}} + Methods ------- @@ -615,8 +518,6 @@ cdef class CUuuid_st: """ cdef cydriver.CUuuid_st _pvt_val cdef cydriver.CUuuid_st* _pvt_ptr -{{endif}} -{{if 'CUmemFabricHandle_st' in found_struct}} cdef class CUmemFabricHandle_st: """ @@ -627,10 +528,10 @@ cdef class CUmemFabricHandle_st: Attributes ---------- - {{if 'CUmemFabricHandle_st.data' in found_struct}} + data : bytes - {{endif}} + Methods ------- @@ -639,8 +540,6 @@ cdef class CUmemFabricHandle_st: """ cdef cydriver.CUmemFabricHandle_st _pvt_val cdef cydriver.CUmemFabricHandle_st* _pvt_ptr -{{endif}} -{{if 'CUipcEventHandle_st' in found_struct}} cdef class CUipcEventHandle_st: """ @@ -648,10 +547,10 @@ cdef class CUipcEventHandle_st: Attributes ---------- - {{if 'CUipcEventHandle_st.reserved' in found_struct}} + reserved : bytes - {{endif}} + Methods ------- @@ -660,8 +559,6 @@ cdef class CUipcEventHandle_st: """ cdef cydriver.CUipcEventHandle_st _pvt_val cdef cydriver.CUipcEventHandle_st* _pvt_ptr -{{endif}} -{{if 'CUipcMemHandle_st' in found_struct}} cdef class CUipcMemHandle_st: """ @@ -669,10 +566,10 @@ cdef class CUipcMemHandle_st: Attributes ---------- - {{if 'CUipcMemHandle_st.reserved' in found_struct}} + reserved : bytes - {{endif}} + Methods ------- @@ -681,37 +578,35 @@ cdef class CUipcMemHandle_st: """ cdef cydriver.CUipcMemHandle_st _pvt_val cdef cydriver.CUipcMemHandle_st* _pvt_ptr -{{endif}} -{{if 'CUstreamBatchMemOpParams_union.waitValue' in found_struct}} cdef class CUstreamMemOpWaitValueParams_st: """ Attributes ---------- - {{if 'CUstreamBatchMemOpParams_union.waitValue.operation' in found_struct}} + operation : CUstreamBatchMemOpType - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.waitValue.address' in found_struct}} + + address : CUdeviceptr - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.waitValue.value' in found_struct}} + + value : cuuint32_t - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.waitValue.value64' in found_struct}} + + value64 : cuuint64_t - {{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 For driver internal use. Initial value is unimportant. - {{endif}} + Methods ------- @@ -719,49 +614,47 @@ cdef class CUstreamMemOpWaitValueParams_st: Get memory address of class instance """ cdef cydriver.CUstreamBatchMemOpParams_union* _pvt_ptr - {{if 'CUstreamBatchMemOpParams_union.waitValue.address' in found_struct}} + cdef CUdeviceptr _address - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.waitValue.value' in found_struct}} + + cdef cuuint32_t _value - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.waitValue.value64' in found_struct}} + + cdef cuuint64_t _value64 - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.waitValue.alias' in found_struct}} + + cdef CUdeviceptr _alias - {{endif}} -{{endif}} -{{if 'CUstreamBatchMemOpParams_union.writeValue' in found_struct}} + cdef class CUstreamMemOpWriteValueParams_st: """ Attributes ---------- - {{if 'CUstreamBatchMemOpParams_union.writeValue.operation' in found_struct}} + operation : CUstreamBatchMemOpType - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue.address' in found_struct}} + + address : CUdeviceptr - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue.value' in found_struct}} + + value : cuuint32_t - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue.value64' in found_struct}} + + value64 : cuuint64_t - {{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 For driver internal use. Initial value is unimportant. - {{endif}} + Methods ------- @@ -769,33 +662,31 @@ cdef class CUstreamMemOpWriteValueParams_st: Get memory address of class instance """ cdef cydriver.CUstreamBatchMemOpParams_union* _pvt_ptr - {{if 'CUstreamBatchMemOpParams_union.writeValue.address' in found_struct}} + cdef CUdeviceptr _address - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue.value' in found_struct}} + + cdef cuuint32_t _value - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue.value64' in found_struct}} + + cdef cuuint64_t _value64 - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue.alias' in found_struct}} + + cdef CUdeviceptr _alias - {{endif}} -{{endif}} -{{if 'CUstreamBatchMemOpParams_union.flushRemoteWrites' in found_struct}} + cdef class CUstreamMemOpFlushRemoteWritesParams_st: """ Attributes ---------- - {{if 'CUstreamBatchMemOpParams_union.flushRemoteWrites.operation' in found_struct}} + operation : CUstreamBatchMemOpType - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.flushRemoteWrites.flags' in found_struct}} + + flags : unsigned int Must be 0. - {{endif}} + Methods ------- @@ -803,21 +694,19 @@ cdef class CUstreamMemOpFlushRemoteWritesParams_st: Get memory address of class instance """ cdef cydriver.CUstreamBatchMemOpParams_union* _pvt_ptr -{{endif}} -{{if 'CUstreamBatchMemOpParams_union.memoryBarrier' in found_struct}} cdef class CUstreamMemOpMemoryBarrierParams_st: """ Attributes ---------- - {{if 'CUstreamBatchMemOpParams_union.memoryBarrier.operation' in found_struct}} + operation : CUstreamBatchMemOpType < Only supported in the _v2 API - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.memoryBarrier.flags' in found_struct}} + + flags : unsigned int See CUstreamMemoryBarrier_flags - {{endif}} + Methods ------- @@ -825,41 +714,39 @@ cdef class CUstreamMemOpMemoryBarrierParams_st: Get memory address of class instance """ cdef cydriver.CUstreamBatchMemOpParams_union* _pvt_ptr -{{endif}} -{{if 'CUstreamBatchMemOpParams_union.atomicReduction' in found_struct}} cdef class CUstreamMemOpAtomicReductionParams_st: """ Attributes ---------- - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.operation' in found_struct}} + operation : CUstreamBatchMemOpType - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.flags' in found_struct}} + + flags : unsigned int Must be 0 - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.reductionOp' in found_struct}} + + reductionOp : CUstreamAtomicReductionOpType See CUstreamAtomicReductionOpType - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.dataType' in found_struct}} + + dataType : CUstreamAtomicReductionDataType See CUstreamAtomicReductionDataType - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.address' in found_struct}} + + address : CUdeviceptr The address the atomic operation will be operated on - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.value' in found_struct}} + + value : cuuint64_t The operand value the atomic operation will operate with - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.alias' in found_struct}} + + alias : CUdeviceptr For driver internal use. Initial value is unimportant. - {{endif}} + Methods ------- @@ -867,17 +754,15 @@ cdef class CUstreamMemOpAtomicReductionParams_st: Get memory address of class instance """ cdef cydriver.CUstreamBatchMemOpParams_union* _pvt_ptr - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.address' in found_struct}} + cdef CUdeviceptr _address - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.value' in found_struct}} + + cdef cuuint64_t _value - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.alias' in found_struct}} + + cdef CUdeviceptr _alias - {{endif}} -{{endif}} -{{if 'CUstreamBatchMemOpParams_union' in found_struct}} + cdef class CUstreamBatchMemOpParams_union: """ @@ -885,37 +770,37 @@ cdef class CUstreamBatchMemOpParams_union: Attributes ---------- - {{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.atomicReduction' in found_struct}} + + atomicReduction : CUstreamMemOpAtomicReductionParams_st - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.pad' in found_struct}} + + pad : list[cuuint64_t] - {{endif}} + Methods ------- @@ -924,23 +809,21 @@ cdef class CUstreamBatchMemOpParams_union: """ cdef cydriver.CUstreamBatchMemOpParams_union _pvt_val cdef cydriver.CUstreamBatchMemOpParams_union* _pvt_ptr - {{if 'CUstreamBatchMemOpParams_union.waitValue' in found_struct}} + cdef CUstreamMemOpWaitValueParams_st _waitValue - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue' in found_struct}} + + cdef CUstreamMemOpWriteValueParams_st _writeValue - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.flushRemoteWrites' in found_struct}} + + cdef CUstreamMemOpFlushRemoteWritesParams_st _flushRemoteWrites - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.memoryBarrier' in found_struct}} + + cdef CUstreamMemOpMemoryBarrierParams_st _memoryBarrier - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction' in found_struct}} + + cdef CUstreamMemOpAtomicReductionParams_st _atomicReduction - {{endif}} -{{endif}} -{{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st' in found_struct}} + cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st: """ @@ -949,22 +832,22 @@ cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st: Attributes ---------- - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.ctx' in found_struct}} + ctx : CUcontext - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.count' in found_struct}} + + count : unsigned int - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.paramArray' in found_struct}} + + paramArray : CUstreamBatchMemOpParams - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.flags' in found_struct}} + + flags : unsigned int - {{endif}} + Methods ------- @@ -973,15 +856,13 @@ cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st: """ cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st _pvt_val cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st* _pvt_ptr - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.ctx' in found_struct}} + cdef CUcontext _ctx - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.paramArray' in found_struct}} + + cdef size_t _paramArray_length cdef cydriver.CUstreamBatchMemOpParams* _paramArray - {{endif}} -{{endif}} -{{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st' in found_struct}} + cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st: """ @@ -989,22 +870,22 @@ cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st: Attributes ---------- - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st.ctx' in found_struct}} + ctx : CUcontext Context to use for the operations. - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st.count' in found_struct}} + + count : unsigned int Number of operations in paramArray. - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st.paramArray' in found_struct}} + + paramArray : CUstreamBatchMemOpParams Array of batch memory operations. - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st.flags' in found_struct}} + + flags : unsigned int Flags to control the node. - {{endif}} + Methods ------- @@ -1013,24 +894,22 @@ cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st: """ cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st _pvt_val cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st* _pvt_ptr - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st.ctx' in found_struct}} + cdef CUcontext _ctx - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st.paramArray' in found_struct}} + + cdef size_t _paramArray_length cdef cydriver.CUstreamBatchMemOpParams* _paramArray - {{endif}} -{{endif}} -{{if 'CUasyncNotificationInfo_st.info.overBudget' in found_struct}} + cdef class anon_struct0: """ Attributes ---------- - {{if 'CUasyncNotificationInfo_st.info.overBudget.bytesOverBudget' in found_struct}} + bytesOverBudget : unsigned long long - {{endif}} + Methods ------- @@ -1038,17 +917,15 @@ cdef class anon_struct0: Get memory address of class instance """ cdef cydriver.CUasyncNotificationInfo_st* _pvt_ptr -{{endif}} -{{if 'CUasyncNotificationInfo_st.info' in found_struct}} cdef class anon_union2: """ Attributes ---------- - {{if 'CUasyncNotificationInfo_st.info.overBudget' in found_struct}} + overBudget : anon_struct0 - {{endif}} + Methods ------- @@ -1056,11 +933,9 @@ cdef class anon_union2: Get memory address of class instance """ cdef cydriver.CUasyncNotificationInfo_st* _pvt_ptr - {{if 'CUasyncNotificationInfo_st.info.overBudget' in found_struct}} + cdef anon_struct0 _overBudget - {{endif}} -{{endif}} -{{if 'CUasyncNotificationInfo_st' in found_struct}} + cdef class CUasyncNotificationInfo_st: """ @@ -1068,15 +943,15 @@ cdef class CUasyncNotificationInfo_st: Attributes ---------- - {{if 'CUasyncNotificationInfo_st.type' in found_struct}} + type : CUasyncNotificationType The type of notification being sent - {{endif}} - {{if 'CUasyncNotificationInfo_st.info' in found_struct}} + + info : anon_union2 Information about the notification. `typename` must be checked in order to interpret this field. - {{endif}} + Methods ------- @@ -1085,11 +960,9 @@ cdef class CUasyncNotificationInfo_st: """ cdef cydriver.CUasyncNotificationInfo_st* _val_ptr cdef cydriver.CUasyncNotificationInfo_st* _pvt_ptr - {{if 'CUasyncNotificationInfo_st.info' in found_struct}} + cdef anon_union2 _info - {{endif}} -{{endif}} -{{if 'CUdevprop_st' in found_struct}} + cdef class CUdevprop_st: """ @@ -1097,46 +970,46 @@ cdef class CUdevprop_st: Attributes ---------- - {{if 'CUdevprop_st.maxThreadsPerBlock' in found_struct}} + maxThreadsPerBlock : int Maximum number of threads per block - {{endif}} - {{if 'CUdevprop_st.maxThreadsDim' in found_struct}} + + maxThreadsDim : list[int] Maximum size of each dimension of a block - {{endif}} - {{if 'CUdevprop_st.maxGridSize' in found_struct}} + + maxGridSize : list[int] Maximum size of each dimension of a grid - {{endif}} - {{if 'CUdevprop_st.sharedMemPerBlock' in found_struct}} + + sharedMemPerBlock : int Shared memory available per block in bytes - {{endif}} - {{if 'CUdevprop_st.totalConstantMemory' in found_struct}} + + totalConstantMemory : int Constant memory available on device in bytes - {{endif}} - {{if 'CUdevprop_st.SIMDWidth' in found_struct}} + + SIMDWidth : int Warp size in threads - {{endif}} - {{if 'CUdevprop_st.memPitch' in found_struct}} + + memPitch : int Maximum pitch in bytes allowed by memory copies - {{endif}} - {{if 'CUdevprop_st.regsPerBlock' in found_struct}} + + regsPerBlock : int 32-bit registers available per block - {{endif}} - {{if 'CUdevprop_st.clockRate' in found_struct}} + + clockRate : int Clock frequency in kilohertz - {{endif}} - {{if 'CUdevprop_st.textureAlign' in found_struct}} + + textureAlign : int Alignment requirement for textures - {{endif}} + Methods ------- @@ -1145,8 +1018,6 @@ cdef class CUdevprop_st: """ cdef cydriver.CUdevprop_st _pvt_val cdef cydriver.CUdevprop_st* _pvt_ptr -{{endif}} -{{if 'CUaccessPolicyWindow_st' in found_struct}} cdef class CUaccessPolicyWindow_st: """ @@ -1163,29 +1034,29 @@ cdef class CUaccessPolicyWindow_st: Attributes ---------- - {{if 'CUaccessPolicyWindow_st.base_ptr' in found_struct}} + base_ptr : Any Starting address of the access policy window. CUDA driver may align it. - {{endif}} - {{if 'CUaccessPolicyWindow_st.num_bytes' in found_struct}} + + num_bytes : size_t Size in bytes of the window policy. CUDA driver may restrict the maximum size and alignment. - {{endif}} - {{if 'CUaccessPolicyWindow_st.hitRatio' in found_struct}} + + hitRatio : float hitRatio specifies percentage of lines assigned hitProp, rest are assigned missProp. - {{endif}} - {{if 'CUaccessPolicyWindow_st.hitProp' in found_struct}} + + hitProp : CUaccessProperty CUaccessProperty set for hit. - {{endif}} - {{if 'CUaccessPolicyWindow_st.missProp' in found_struct}} + + missProp : CUaccessProperty CUaccessProperty set for miss. Must be either NORMAL or STREAMING - {{endif}} + Methods ------- @@ -1194,11 +1065,9 @@ cdef class CUaccessPolicyWindow_st: """ cdef cydriver.CUaccessPolicyWindow_st _pvt_val cdef cydriver.CUaccessPolicyWindow_st* _pvt_ptr - {{if 'CUaccessPolicyWindow_st.base_ptr' in found_struct}} + cdef _HelperInputVoidPtr _cybase_ptr - {{endif}} -{{endif}} -{{if 'CUDA_KERNEL_NODE_PARAMS_st' in found_struct}} + cdef class CUDA_KERNEL_NODE_PARAMS_st: """ @@ -1206,46 +1075,46 @@ cdef class CUDA_KERNEL_NODE_PARAMS_st: Attributes ---------- - {{if 'CUDA_KERNEL_NODE_PARAMS_st.func' in found_struct}} + func : CUfunction Kernel to launch - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.gridDimX' in found_struct}} + + gridDimX : unsigned int Width of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.gridDimY' in found_struct}} + + gridDimY : unsigned int Height of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.gridDimZ' in found_struct}} + + gridDimZ : unsigned int Depth of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.blockDimX' in found_struct}} + + blockDimX : unsigned int X dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.blockDimY' in found_struct}} + + blockDimY : unsigned int Y dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.blockDimZ' in found_struct}} + + blockDimZ : unsigned int Z dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.sharedMemBytes' in found_struct}} + + sharedMemBytes : unsigned int Dynamic shared-memory size per thread block in bytes - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.kernelParams' in found_struct}} + + kernelParams : Any Array of pointers to kernel parameters - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.extra' in found_struct}} + + extra : Any Extra options - {{endif}} + Methods ------- @@ -1254,14 +1123,12 @@ cdef class CUDA_KERNEL_NODE_PARAMS_st: """ cdef cydriver.CUDA_KERNEL_NODE_PARAMS_st _pvt_val cdef cydriver.CUDA_KERNEL_NODE_PARAMS_st* _pvt_ptr - {{if 'CUDA_KERNEL_NODE_PARAMS_st.func' in found_struct}} + cdef CUfunction _func - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.kernelParams' in found_struct}} + + cdef _HelperKernelParams _cykernelParams - {{endif}} -{{endif}} -{{if 'CUDA_KERNEL_NODE_PARAMS_v2_st' in found_struct}} + cdef class CUDA_KERNEL_NODE_PARAMS_v2_st: """ @@ -1269,56 +1136,56 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v2_st: Attributes ---------- - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.func' in found_struct}} + func : CUfunction Kernel to launch - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.gridDimX' in found_struct}} + + gridDimX : unsigned int Width of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.gridDimY' in found_struct}} + + gridDimY : unsigned int Height of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.gridDimZ' in found_struct}} + + gridDimZ : unsigned int Depth of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.blockDimX' in found_struct}} + + blockDimX : unsigned int X dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.blockDimY' in found_struct}} + + blockDimY : unsigned int Y dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.blockDimZ' in found_struct}} + + blockDimZ : unsigned int Z dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.sharedMemBytes' in found_struct}} + + sharedMemBytes : unsigned int Dynamic shared-memory size per thread block in bytes - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.kernelParams' in found_struct}} + + kernelParams : Any Array of pointers to kernel parameters - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.extra' in found_struct}} + + extra : Any Extra options - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.kern' in found_struct}} - kern : CUkernel + + + kern : CUkernel Kernel to launch, will only be referenced if func is NULL - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.ctx' in found_struct}} + + ctx : CUcontext Context for the kernel task to run in. The value NULL will indicate the current context should be used by the api. This field is ignored if func is set. - {{endif}} + Methods ------- @@ -1327,20 +1194,18 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v2_st: """ cdef cydriver.CUDA_KERNEL_NODE_PARAMS_v2_st _pvt_val cdef cydriver.CUDA_KERNEL_NODE_PARAMS_v2_st* _pvt_ptr - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.func' in found_struct}} + cdef CUfunction _func - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.kernelParams' in found_struct}} + + cdef _HelperKernelParams _cykernelParams - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.kern' in found_struct}} + + cdef CUkernel _kern - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.ctx' in found_struct}} + + cdef CUcontext _ctx - {{endif}} -{{endif}} -{{if 'CUDA_KERNEL_NODE_PARAMS_v3_st' in found_struct}} + cdef class CUDA_KERNEL_NODE_PARAMS_v3_st: """ @@ -1348,56 +1213,56 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v3_st: Attributes ---------- - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.func' in found_struct}} + func : CUfunction Kernel to launch - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.gridDimX' in found_struct}} + + gridDimX : unsigned int Width of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.gridDimY' in found_struct}} + + gridDimY : unsigned int Height of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.gridDimZ' in found_struct}} + + gridDimZ : unsigned int Depth of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.blockDimX' in found_struct}} + + blockDimX : unsigned int X dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.blockDimY' in found_struct}} + + blockDimY : unsigned int Y dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.blockDimZ' in found_struct}} + + blockDimZ : unsigned int Z dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.sharedMemBytes' in found_struct}} + + sharedMemBytes : unsigned int Dynamic shared-memory size per thread block in bytes - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.kernelParams' in found_struct}} + + kernelParams : Any Array of pointers to kernel parameters - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.extra' in found_struct}} + + extra : Any Extra options - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.kern' in found_struct}} + + kern : CUkernel Kernel to launch, will only be referenced if func is NULL - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.ctx' in found_struct}} + + ctx : CUcontext Context for the kernel task to run in. The value NULL will indicate the current context should be used by the api. This field is ignored if func is set. - {{endif}} + Methods ------- @@ -1406,20 +1271,18 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v3_st: """ cdef cydriver.CUDA_KERNEL_NODE_PARAMS_v3_st _pvt_val cdef cydriver.CUDA_KERNEL_NODE_PARAMS_v3_st* _pvt_ptr - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.func' in found_struct}} + cdef CUfunction _func - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.kernelParams' in found_struct}} + + cdef _HelperKernelParams _cykernelParams - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.kern' in found_struct}} + + cdef CUkernel _kern - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.ctx' in found_struct}} + + cdef CUcontext _ctx - {{endif}} -{{endif}} -{{if 'CUDA_MEMSET_NODE_PARAMS_st' in found_struct}} + cdef class CUDA_MEMSET_NODE_PARAMS_st: """ @@ -1427,30 +1290,30 @@ cdef class CUDA_MEMSET_NODE_PARAMS_st: Attributes ---------- - {{if 'CUDA_MEMSET_NODE_PARAMS_st.dst' in found_struct}} + dst : CUdeviceptr Destination device pointer - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.pitch' in found_struct}} + + pitch : size_t Pitch of destination device pointer. Unused if height is 1 - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.value' in found_struct}} + + value : unsigned int Value to be set - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.elementSize' in found_struct}} + + elementSize : unsigned int Size of each element in bytes. Must be 1, 2, or 4. - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.width' in found_struct}} + + width : size_t Width of the row in elements - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.height' in found_struct}} + + height : size_t Number of rows - {{endif}} + Methods ------- @@ -1459,11 +1322,9 @@ cdef class CUDA_MEMSET_NODE_PARAMS_st: """ cdef cydriver.CUDA_MEMSET_NODE_PARAMS_st _pvt_val cdef cydriver.CUDA_MEMSET_NODE_PARAMS_st* _pvt_ptr - {{if 'CUDA_MEMSET_NODE_PARAMS_st.dst' in found_struct}} + cdef CUdeviceptr _dst - {{endif}} -{{endif}} -{{if 'CUDA_MEMSET_NODE_PARAMS_v2_st' in found_struct}} + cdef class CUDA_MEMSET_NODE_PARAMS_v2_st: """ @@ -1471,34 +1332,34 @@ cdef class CUDA_MEMSET_NODE_PARAMS_v2_st: Attributes ---------- - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.dst' in found_struct}} + dst : CUdeviceptr Destination device pointer - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.pitch' in found_struct}} + + pitch : size_t Pitch of destination device pointer. Unused if height is 1 - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.value' in found_struct}} + + value : unsigned int Value to be set - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.elementSize' in found_struct}} + + elementSize : unsigned int Size of each element in bytes. Must be 1, 2, or 4. - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.width' in found_struct}} + + width : size_t Width of the row in elements - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.height' in found_struct}} + + height : size_t Number of rows - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.ctx' in found_struct}} + + ctx : CUcontext Context on which to run the node - {{endif}} + Methods ------- @@ -1507,14 +1368,12 @@ cdef class CUDA_MEMSET_NODE_PARAMS_v2_st: """ cdef cydriver.CUDA_MEMSET_NODE_PARAMS_v2_st _pvt_val cdef cydriver.CUDA_MEMSET_NODE_PARAMS_v2_st* _pvt_ptr - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.dst' in found_struct}} + cdef CUdeviceptr _dst - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.ctx' in found_struct}} + + cdef CUcontext _ctx - {{endif}} -{{endif}} -{{if 'CUDA_HOST_NODE_PARAMS_st' in found_struct}} + cdef class CUDA_HOST_NODE_PARAMS_st: """ @@ -1522,14 +1381,14 @@ cdef class CUDA_HOST_NODE_PARAMS_st: Attributes ---------- - {{if 'CUDA_HOST_NODE_PARAMS_st.fn' in found_struct}} + fn : CUhostFn The function to call when the node executes - {{endif}} - {{if 'CUDA_HOST_NODE_PARAMS_st.userData' in found_struct}} + + userData : Any Argument to pass to the function - {{endif}} + Methods ------- @@ -1538,14 +1397,12 @@ cdef class CUDA_HOST_NODE_PARAMS_st: """ cdef cydriver.CUDA_HOST_NODE_PARAMS_st _pvt_val cdef cydriver.CUDA_HOST_NODE_PARAMS_st* _pvt_ptr - {{if 'CUDA_HOST_NODE_PARAMS_st.fn' in found_struct}} + cdef CUhostFn _fn - {{endif}} - {{if 'CUDA_HOST_NODE_PARAMS_st.userData' in found_struct}} + + cdef _HelperInputVoidPtr _cyuserData - {{endif}} -{{endif}} -{{if 'CUDA_HOST_NODE_PARAMS_v2_st' in found_struct}} + cdef class CUDA_HOST_NODE_PARAMS_v2_st: """ @@ -1553,18 +1410,18 @@ cdef class CUDA_HOST_NODE_PARAMS_v2_st: Attributes ---------- - {{if 'CUDA_HOST_NODE_PARAMS_v2_st.fn' in found_struct}} + fn : CUhostFn The function to call when the node executes - {{endif}} - {{if 'CUDA_HOST_NODE_PARAMS_v2_st.userData' in found_struct}} + + userData : Any Argument to pass to the function - {{endif}} - {{if 'CUDA_HOST_NODE_PARAMS_v2_st.syncMode' in found_struct}} + + syncMode : unsigned int The sync mode to use for the host task - {{endif}} + Methods ------- @@ -1573,14 +1430,12 @@ cdef class CUDA_HOST_NODE_PARAMS_v2_st: """ cdef cydriver.CUDA_HOST_NODE_PARAMS_v2_st _pvt_val cdef cydriver.CUDA_HOST_NODE_PARAMS_v2_st* _pvt_ptr - {{if 'CUDA_HOST_NODE_PARAMS_v2_st.fn' in found_struct}} + cdef CUhostFn _fn - {{endif}} - {{if 'CUDA_HOST_NODE_PARAMS_v2_st.userData' in found_struct}} + + cdef _HelperInputVoidPtr _cyuserData - {{endif}} -{{endif}} -{{if 'CUDA_CONDITIONAL_NODE_PARAMS' in found_struct}} + cdef class CUDA_CONDITIONAL_NODE_PARAMS: """ @@ -1588,22 +1443,22 @@ cdef class CUDA_CONDITIONAL_NODE_PARAMS: Attributes ---------- - {{if 'CUDA_CONDITIONAL_NODE_PARAMS.handle' in found_struct}} + handle : CUgraphConditionalHandle Conditional node handle. Handles must be created in advance of creating the node using cuGraphConditionalHandleCreate. - {{endif}} - {{if 'CUDA_CONDITIONAL_NODE_PARAMS.type' in found_struct}} + + type : CUgraphConditionalNodeType Type of conditional node. - {{endif}} - {{if 'CUDA_CONDITIONAL_NODE_PARAMS.size' in found_struct}} + + size : unsigned int Size of graph output array. Allowed values are 1 for CU_GRAPH_COND_TYPE_WHILE, 1 or 2 for CU_GRAPH_COND_TYPE_IF, or any value greater than zero for CU_GRAPH_COND_TYPE_SWITCH. - {{endif}} - {{if 'CUDA_CONDITIONAL_NODE_PARAMS.phGraph_out' in found_struct}} + + phGraph_out : CUgraph CUDA-owned array populated with conditional node child graphs during creation of the node. Valid for the lifetime of the @@ -1621,12 +1476,12 @@ cdef class CUDA_CONDITIONAL_NODE_PARAMS: condition is non-zero. CU_GRAPH_COND_TYPE_SWITCH: phGraph_out[n] is executed when the condition is equal to n. If the condition >= `size`, no body graph is executed. - {{endif}} - {{if 'CUDA_CONDITIONAL_NODE_PARAMS.ctx' in found_struct}} + + ctx : CUcontext Context on which to run the node. Must match context used to create the handle and all body nodes. - {{endif}} + Methods ------- @@ -1635,18 +1490,16 @@ cdef class CUDA_CONDITIONAL_NODE_PARAMS: """ cdef cydriver.CUDA_CONDITIONAL_NODE_PARAMS _pvt_val cdef cydriver.CUDA_CONDITIONAL_NODE_PARAMS* _pvt_ptr - {{if 'CUDA_CONDITIONAL_NODE_PARAMS.handle' in found_struct}} + cdef CUgraphConditionalHandle _handle - {{endif}} - {{if 'CUDA_CONDITIONAL_NODE_PARAMS.phGraph_out' in found_struct}} + + cdef size_t _phGraph_out_length cdef cydriver.CUgraph* _phGraph_out - {{endif}} - {{if 'CUDA_CONDITIONAL_NODE_PARAMS.ctx' in found_struct}} + + cdef CUcontext _ctx - {{endif}} -{{endif}} -{{if 'CUgraphEdgeData_st' in found_struct}} + cdef class CUgraphEdgeData_st: """ @@ -1657,7 +1510,7 @@ cdef class CUgraphEdgeData_st: Attributes ---------- - {{if 'CUgraphEdgeData_st.from_port' in found_struct}} + from_port : bytes This indicates when the dependency is triggered from the upstream node on the edge. The meaning is specfic to the node type. A value @@ -1668,8 +1521,8 @@ cdef class CUgraphEdgeData_st: CU_GRAPH_KERNEL_NODE_PORT_DEFAULT, CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC, or CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER. - {{endif}} - {{if 'CUgraphEdgeData_st.to_port' in found_struct}} + + to_port : bytes This indicates what portion of the downstream node is dependent on the upstream node or portion thereof (indicated by `from_port`). @@ -1677,18 +1530,18 @@ cdef class CUgraphEdgeData_st: means the entirety of the downstream node is dependent on the upstream work. Currently no node types define non-zero ports. Accordingly, this field must be set to zero. - {{endif}} - {{if 'CUgraphEdgeData_st.type' in found_struct}} + + type : bytes This should be populated with a value from CUgraphDependencyType. (It is typed as char due to compiler-specific layout of bitfields.) See CUgraphDependencyType. - {{endif}} - {{if 'CUgraphEdgeData_st.reserved' in found_struct}} + + reserved : bytes These bytes are unused and must be zeroed. This ensures compatibility if additional fields are added in the future. - {{endif}} + Methods ------- @@ -1697,8 +1550,6 @@ cdef class CUgraphEdgeData_st: """ cdef cydriver.CUgraphEdgeData_st _pvt_val cdef cydriver.CUgraphEdgeData_st* _pvt_ptr -{{endif}} -{{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st' in found_struct}} cdef class CUDA_GRAPH_INSTANTIATE_PARAMS_st: """ @@ -1706,22 +1557,22 @@ cdef class CUDA_GRAPH_INSTANTIATE_PARAMS_st: Attributes ---------- - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.flags' in found_struct}} + flags : cuuint64_t Instantiation flags - {{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.hUploadStream' in found_struct}} + + hUploadStream : CUstream Upload stream - {{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.hErrNode_out' in found_struct}} + + hErrNode_out : CUgraphNode The node which caused instantiation to fail, if any - {{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.result_out' in found_struct}} + + result_out : CUgraphInstantiateResult Whether instantiation was successful. If it failed, the reason why - {{endif}} + Methods ------- @@ -1730,17 +1581,15 @@ cdef class CUDA_GRAPH_INSTANTIATE_PARAMS_st: """ cdef cydriver.CUDA_GRAPH_INSTANTIATE_PARAMS_st _pvt_val cdef cydriver.CUDA_GRAPH_INSTANTIATE_PARAMS_st* _pvt_ptr - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.flags' in found_struct}} + cdef cuuint64_t _flags - {{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.hUploadStream' in found_struct}} + + cdef CUstream _hUploadStream - {{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.hErrNode_out' in found_struct}} + + cdef CUgraphNode _hErrNode_out - {{endif}} -{{endif}} -{{if 'CUlaunchMemSyncDomainMap_st' in found_struct}} + cdef class CUlaunchMemSyncDomainMap_st: """ @@ -1754,14 +1603,14 @@ cdef class CUlaunchMemSyncDomainMap_st: Attributes ---------- - {{if 'CUlaunchMemSyncDomainMap_st.default_' in found_struct}} + default_ : bytes The default domain ID to use for designated kernels - {{endif}} - {{if 'CUlaunchMemSyncDomainMap_st.remote' in found_struct}} + + remote : bytes The remote domain ID to use for designated kernels - {{endif}} + Methods ------- @@ -1770,25 +1619,23 @@ cdef class CUlaunchMemSyncDomainMap_st: """ cdef cydriver.CUlaunchMemSyncDomainMap_st _pvt_val cdef cydriver.CUlaunchMemSyncDomainMap_st* _pvt_ptr -{{endif}} -{{if 'CUlaunchAttributeValue_union.clusterDim' in found_struct}} cdef class anon_struct1: """ Attributes ---------- - {{if 'CUlaunchAttributeValue_union.clusterDim.x' in found_struct}} + x : unsigned int - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterDim.y' in found_struct}} + + y : unsigned int - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterDim.z' in found_struct}} + + z : unsigned int - {{endif}} + Methods ------- @@ -1796,25 +1643,23 @@ cdef class anon_struct1: Get memory address of class instance """ cdef cydriver.CUlaunchAttributeValue_union* _pvt_ptr -{{endif}} -{{if 'CUlaunchAttributeValue_union.programmaticEvent' in found_struct}} cdef class anon_struct2: """ Attributes ---------- - {{if 'CUlaunchAttributeValue_union.programmaticEvent.event' in found_struct}} + event : CUevent - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticEvent.flags' in found_struct}} + + flags : int - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticEvent.triggerAtBlockStart' in found_struct}} + + triggerAtBlockStart : int - {{endif}} + Methods ------- @@ -1822,24 +1667,22 @@ cdef class anon_struct2: Get memory address of class instance """ cdef cydriver.CUlaunchAttributeValue_union* _pvt_ptr - {{if 'CUlaunchAttributeValue_union.programmaticEvent.event' in found_struct}} + cdef CUevent _event - {{endif}} -{{endif}} -{{if 'CUlaunchAttributeValue_union.launchCompletionEvent' in found_struct}} + cdef class anon_struct3: """ Attributes ---------- - {{if 'CUlaunchAttributeValue_union.launchCompletionEvent.event' in found_struct}} + event : CUevent - {{endif}} - {{if 'CUlaunchAttributeValue_union.launchCompletionEvent.flags' in found_struct}} + + flags : int - {{endif}} + Methods ------- @@ -1847,28 +1690,26 @@ cdef class anon_struct3: Get memory address of class instance """ cdef cydriver.CUlaunchAttributeValue_union* _pvt_ptr - {{if 'CUlaunchAttributeValue_union.launchCompletionEvent.event' in found_struct}} + cdef CUevent _event - {{endif}} -{{endif}} -{{if 'CUlaunchAttributeValue_union.preferredClusterDim' in found_struct}} + cdef class anon_struct4: """ Attributes ---------- - {{if 'CUlaunchAttributeValue_union.preferredClusterDim.x' in found_struct}} + x : unsigned int - {{endif}} - {{if 'CUlaunchAttributeValue_union.preferredClusterDim.y' in found_struct}} + + y : unsigned int - {{endif}} - {{if 'CUlaunchAttributeValue_union.preferredClusterDim.z' in found_struct}} + + z : unsigned int - {{endif}} + Methods ------- @@ -1876,21 +1717,19 @@ cdef class anon_struct4: Get memory address of class instance """ cdef cydriver.CUlaunchAttributeValue_union* _pvt_ptr -{{endif}} -{{if 'CUlaunchAttributeValue_union.deviceUpdatableKernelNode' in found_struct}} cdef class anon_struct5: """ Attributes ---------- - {{if 'CUlaunchAttributeValue_union.deviceUpdatableKernelNode.deviceUpdatable' in found_struct}} + deviceUpdatable : int - {{endif}} - {{if 'CUlaunchAttributeValue_union.deviceUpdatableKernelNode.devNode' in found_struct}} + + devNode : CUgraphDeviceNode - {{endif}} + Methods ------- @@ -1898,11 +1737,9 @@ cdef class anon_struct5: Get memory address of class instance """ cdef cydriver.CUlaunchAttributeValue_union* _pvt_ptr - {{if 'CUlaunchAttributeValue_union.deviceUpdatableKernelNode.devNode' in found_struct}} + cdef CUgraphDeviceNode _devNode - {{endif}} -{{endif}} -{{if 'CUlaunchAttributeValue_union' in found_struct}} + cdef class CUlaunchAttributeValue_union: """ @@ -1910,26 +1747,26 @@ cdef class CUlaunchAttributeValue_union: Attributes ---------- - {{if 'CUlaunchAttributeValue_union.pad' in found_struct}} + pad : bytes - {{endif}} - {{if 'CUlaunchAttributeValue_union.accessPolicyWindow' in found_struct}} + + accessPolicyWindow : CUaccessPolicyWindow Value of launch attribute CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW. - {{endif}} - {{if 'CUlaunchAttributeValue_union.cooperative' in found_struct}} + + cooperative : int Value of launch attribute CU_LAUNCH_ATTRIBUTE_COOPERATIVE. Nonzero indicates a cooperative kernel (see cuLaunchCooperativeKernel). - {{endif}} - {{if 'CUlaunchAttributeValue_union.syncPolicy' in found_struct}} + + syncPolicy : CUsynchronizationPolicy Value of launch attribute - CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY. - ::CUsynchronizationPolicy for work queued up in this stream - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterDim' in found_struct}} + CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY. CUsynchronizationPolicy + for work queued up in this stream + + clusterDim : anon_struct1 Value of launch attribute CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION that represents the desired cluster dimensions for the kernel. @@ -1938,19 +1775,19 @@ cdef class CUlaunchAttributeValue_union: - `y` - The Y dimension of the cluster, in blocks. Must be a divisor of the grid Y dimension. - `z` - The Z dimension of the cluster, in blocks. Must be a divisor of the grid Z dimension. - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterSchedulingPolicyPreference' in found_struct}} + + clusterSchedulingPolicyPreference : CUclusterSchedulingPolicy Value of launch attribute CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE. Cluster scheduling policy preference for the kernel. - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticStreamSerializationAllowed' in found_struct}} + + programmaticStreamSerializationAllowed : int Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION. - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticEvent' in found_struct}} + + programmaticEvent : anon_struct2 Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT with the following fields: - `CUevent` event - Event to fire when @@ -1958,31 +1795,31 @@ cdef class CUlaunchAttributeValue_union: cuEventRecordWithFlags. Does not accept :CU_EVENT_RECORD_EXTERNAL. - `triggerAtBlockStart` - If this is set to non-0, each block launch will automatically trigger the event. - {{endif}} - {{if 'CUlaunchAttributeValue_union.launchCompletionEvent' in found_struct}} + + launchCompletionEvent : anon_struct3 Value of launch attribute CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT with the following fields: - `CUevent` event - Event to fire when the last block launches - `int` flags; - Event record flags, see cuEventRecordWithFlags. Does not accept CU_EVENT_RECORD_EXTERNAL. - {{endif}} - {{if 'CUlaunchAttributeValue_union.priority' in found_struct}} + + priority : int Value of launch attribute CU_LAUNCH_ATTRIBUTE_PRIORITY. Execution priority of the kernel. - {{endif}} - {{if 'CUlaunchAttributeValue_union.memSyncDomainMap' in found_struct}} + + memSyncDomainMap : CUlaunchMemSyncDomainMap Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. See CUlaunchMemSyncDomainMap. - {{endif}} - {{if 'CUlaunchAttributeValue_union.memSyncDomain' in found_struct}} + + memSyncDomain : CUlaunchMemSyncDomain Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN. See::CUlaunchMemSyncDomain - {{endif}} - {{if 'CUlaunchAttributeValue_union.preferredClusterDim' in found_struct}} + + preferredClusterDim : anon_struct4 Value of launch attribute CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION that represents the @@ -1996,8 +1833,8 @@ cdef class CUlaunchAttributeValue_union: CUlaunchAttributeValue::clusterDim. - `z` - The Z dimension of the preferred cluster, in blocks. Must be equal to the `z` field of CUlaunchAttributeValue::clusterDim. - {{endif}} - {{if 'CUlaunchAttributeValue_union.deviceUpdatableKernelNode' in found_struct}} + + deviceUpdatableKernelNode : anon_struct5 Value of launch attribute CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE. with the @@ -2005,26 +1842,26 @@ cdef class CUlaunchAttributeValue_union: resulting kernel node should be device-updatable. - `CUgraphDeviceNode` devNode - Returns a handle to pass to the various device-side update functions. - {{endif}} - {{if 'CUlaunchAttributeValue_union.sharedMemCarveout' in found_struct}} + + sharedMemCarveout : unsigned int Value of launch attribute CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. - {{endif}} - {{if 'CUlaunchAttributeValue_union.nvlinkUtilCentricScheduling' in found_struct}} + + nvlinkUtilCentricScheduling : unsigned int - {{endif}} - {{if 'CUlaunchAttributeValue_union.portableClusterSizeMode' in found_struct}} + + portableClusterSizeMode : CUlaunchAttributePortableClusterMode Value of launch attribute CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE. - {{endif}} - {{if 'CUlaunchAttributeValue_union.sharedMemoryMode' in found_struct}} + + sharedMemoryMode : CUsharedMemoryMode Value of launch attribute CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE. See CUsharedMemoryMode for acceptable values. - {{endif}} + Methods ------- @@ -2033,29 +1870,27 @@ cdef class CUlaunchAttributeValue_union: """ cdef cydriver.CUlaunchAttributeValue_union _pvt_val cdef cydriver.CUlaunchAttributeValue_union* _pvt_ptr - {{if 'CUlaunchAttributeValue_union.accessPolicyWindow' in found_struct}} + cdef CUaccessPolicyWindow _accessPolicyWindow - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterDim' in found_struct}} + + cdef anon_struct1 _clusterDim - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticEvent' in found_struct}} + + cdef anon_struct2 _programmaticEvent - {{endif}} - {{if 'CUlaunchAttributeValue_union.launchCompletionEvent' in found_struct}} + + cdef anon_struct3 _launchCompletionEvent - {{endif}} - {{if 'CUlaunchAttributeValue_union.memSyncDomainMap' in found_struct}} + + cdef CUlaunchMemSyncDomainMap _memSyncDomainMap - {{endif}} - {{if 'CUlaunchAttributeValue_union.preferredClusterDim' in found_struct}} + + cdef anon_struct4 _preferredClusterDim - {{endif}} - {{if 'CUlaunchAttributeValue_union.deviceUpdatableKernelNode' in found_struct}} + + cdef anon_struct5 _deviceUpdatableKernelNode - {{endif}} -{{endif}} -{{if 'CUlaunchAttribute_st' in found_struct}} + cdef class CUlaunchAttribute_st: """ @@ -2063,14 +1898,14 @@ cdef class CUlaunchAttribute_st: Attributes ---------- - {{if 'CUlaunchAttribute_st.id' in found_struct}} + id : CUlaunchAttributeID Attribute to set - {{endif}} - {{if 'CUlaunchAttribute_st.value' in found_struct}} + + value : CUlaunchAttributeValue Value of the attribute - {{endif}} + Methods ------- @@ -2079,11 +1914,9 @@ cdef class CUlaunchAttribute_st: """ cdef cydriver.CUlaunchAttribute_st _pvt_val cdef cydriver.CUlaunchAttribute_st* _pvt_ptr - {{if 'CUlaunchAttribute_st.value' in found_struct}} + cdef CUlaunchAttributeValue _value - {{endif}} -{{endif}} -{{if 'CUlaunchConfig_st' in found_struct}} + cdef class CUlaunchConfig_st: """ @@ -2091,46 +1924,46 @@ cdef class CUlaunchConfig_st: Attributes ---------- - {{if 'CUlaunchConfig_st.gridDimX' in found_struct}} + gridDimX : unsigned int Width of grid in blocks - {{endif}} - {{if 'CUlaunchConfig_st.gridDimY' in found_struct}} + + gridDimY : unsigned int Height of grid in blocks - {{endif}} - {{if 'CUlaunchConfig_st.gridDimZ' in found_struct}} + + gridDimZ : unsigned int Depth of grid in blocks - {{endif}} - {{if 'CUlaunchConfig_st.blockDimX' in found_struct}} + + blockDimX : unsigned int X dimension of each thread block - {{endif}} - {{if 'CUlaunchConfig_st.blockDimY' in found_struct}} + + blockDimY : unsigned int Y dimension of each thread block - {{endif}} - {{if 'CUlaunchConfig_st.blockDimZ' in found_struct}} + + blockDimZ : unsigned int Z dimension of each thread block - {{endif}} - {{if 'CUlaunchConfig_st.sharedMemBytes' in found_struct}} + + sharedMemBytes : unsigned int Dynamic shared-memory size per thread block in bytes - {{endif}} - {{if 'CUlaunchConfig_st.hStream' in found_struct}} + + hStream : CUstream Stream identifier - {{endif}} - {{if 'CUlaunchConfig_st.attrs' in found_struct}} + + attrs : CUlaunchAttribute List of attributes; nullable if CUlaunchConfig::numAttrs == 0 - {{endif}} - {{if 'CUlaunchConfig_st.numAttrs' in found_struct}} + + numAttrs : unsigned int Number of attributes populated in CUlaunchConfig::attrs - {{endif}} + Methods ------- @@ -2139,15 +1972,13 @@ cdef class CUlaunchConfig_st: """ cdef cydriver.CUlaunchConfig_st _pvt_val cdef cydriver.CUlaunchConfig_st* _pvt_ptr - {{if 'CUlaunchConfig_st.hStream' in found_struct}} + cdef CUstream _hStream - {{endif}} - {{if 'CUlaunchConfig_st.attrs' in found_struct}} + + cdef size_t _attrs_length cdef cydriver.CUlaunchAttribute* _attrs - {{endif}} -{{endif}} -{{if 'CUexecAffinitySmCount_st' in found_struct}} + cdef class CUexecAffinitySmCount_st: """ @@ -2155,10 +1986,10 @@ cdef class CUexecAffinitySmCount_st: Attributes ---------- - {{if 'CUexecAffinitySmCount_st.val' in found_struct}} + val : unsigned int The number of SMs the context is limited to use. - {{endif}} + Methods ------- @@ -2167,17 +1998,15 @@ cdef class CUexecAffinitySmCount_st: """ cdef cydriver.CUexecAffinitySmCount_st _pvt_val cdef cydriver.CUexecAffinitySmCount_st* _pvt_ptr -{{endif}} -{{if 'CUexecAffinityParam_st.param' in found_struct}} cdef class anon_union3: """ Attributes ---------- - {{if 'CUexecAffinityParam_st.param.smCount' in found_struct}} + smCount : CUexecAffinitySmCount - {{endif}} + Methods ------- @@ -2185,11 +2014,9 @@ cdef class anon_union3: Get memory address of class instance """ cdef cydriver.CUexecAffinityParam_st* _pvt_ptr - {{if 'CUexecAffinityParam_st.param.smCount' in found_struct}} + cdef CUexecAffinitySmCount _smCount - {{endif}} -{{endif}} -{{if 'CUexecAffinityParam_st' in found_struct}} + cdef class CUexecAffinityParam_st: """ @@ -2197,14 +2024,14 @@ cdef class CUexecAffinityParam_st: Attributes ---------- - {{if 'CUexecAffinityParam_st.type' in found_struct}} + type : CUexecAffinityType Type of execution affinity. - {{endif}} - {{if 'CUexecAffinityParam_st.param' in found_struct}} + + param : anon_union3 - {{endif}} + Methods ------- @@ -2213,11 +2040,9 @@ cdef class CUexecAffinityParam_st: """ cdef cydriver.CUexecAffinityParam_st* _val_ptr cdef cydriver.CUexecAffinityParam_st* _pvt_ptr - {{if 'CUexecAffinityParam_st.param' in found_struct}} + cdef anon_union3 _param - {{endif}} -{{endif}} -{{if 'CUctxCigParam_st' in found_struct}} + cdef class CUctxCigParam_st: """ @@ -2225,15 +2050,15 @@ cdef class CUctxCigParam_st: Attributes ---------- - {{if 'CUctxCigParam_st.sharedDataType' in found_struct}} + sharedDataType : CUcigDataType Type of shared data from graphics client (D3D12 or Vulkan). - {{endif}} - {{if 'CUctxCigParam_st.sharedData' in found_struct}} + + sharedData : Any Graphics client data handle (ID3D12CommandQueue or Nvidia specific data blob). - {{endif}} + Methods ------- @@ -2242,11 +2067,9 @@ cdef class CUctxCigParam_st: """ cdef cydriver.CUctxCigParam_st _pvt_val cdef cydriver.CUctxCigParam_st* _pvt_ptr - {{if 'CUctxCigParam_st.sharedData' in found_struct}} + cdef _HelperInputVoidPtr _cysharedData - {{endif}} -{{endif}} -{{if 'CUctxCreateParams_st' in found_struct}} + cdef class CUctxCreateParams_st: """ @@ -2256,23 +2079,23 @@ cdef class CUctxCreateParams_st: Attributes ---------- - {{if 'CUctxCreateParams_st.execAffinityParams' in found_struct}} + execAffinityParams : CUexecAffinityParam Array of execution affinity parameters to limit context resources (e.g., SM count). Only supported Volta+ MPS. Mutually exclusive with cigParams. - {{endif}} - {{if 'CUctxCreateParams_st.numExecAffinityParams' in found_struct}} + + numExecAffinityParams : int Number of elements in execAffinityParams array. Must be 0 if execAffinityParams is NULL. - {{endif}} - {{if 'CUctxCreateParams_st.cigParams' in found_struct}} + + cigParams : CUctxCigParam CIG (CUDA in Graphics) parameters for sharing data from D3D12/Vulkan graphics clients. Mutually exclusive with execAffinityParams. - {{endif}} + Methods ------- @@ -2281,16 +2104,14 @@ cdef class CUctxCreateParams_st: """ cdef cydriver.CUctxCreateParams_st _pvt_val cdef cydriver.CUctxCreateParams_st* _pvt_ptr - {{if 'CUctxCreateParams_st.execAffinityParams' in found_struct}} + cdef size_t _execAffinityParams_length cdef cydriver.CUexecAffinityParam* _execAffinityParams - {{endif}} - {{if 'CUctxCreateParams_st.cigParams' in found_struct}} + + cdef size_t _cigParams_length cdef cydriver.CUctxCigParam* _cigParams - {{endif}} -{{endif}} -{{if 'CUstreamCigParam_st' in found_struct}} + cdef class CUstreamCigParam_st: """ @@ -2298,15 +2119,15 @@ cdef class CUstreamCigParam_st: Attributes ---------- - {{if 'CUstreamCigParam_st.streamSharedDataType' in found_struct}} + streamSharedDataType : CUstreamCigDataType Type of shared data from graphics client (D3D12). - {{endif}} - {{if 'CUstreamCigParam_st.streamSharedData' in found_struct}} + + streamSharedData : Any Graphics client data handle (ID3D12CommandList/ID3D12GraphicsCommandList). - {{endif}} + Methods ------- @@ -2315,11 +2136,9 @@ cdef class CUstreamCigParam_st: """ cdef cydriver.CUstreamCigParam_st _pvt_val cdef cydriver.CUstreamCigParam_st* _pvt_ptr - {{if 'CUstreamCigParam_st.streamSharedData' in found_struct}} + cdef _HelperInputVoidPtr _cystreamSharedData - {{endif}} -{{endif}} -{{if 'CUstreamCigCaptureParams_st' in found_struct}} + cdef class CUstreamCigCaptureParams_st: """ @@ -2328,11 +2147,11 @@ cdef class CUstreamCigCaptureParams_st: Attributes ---------- - {{if 'CUstreamCigCaptureParams_st.streamCigParams' in found_struct}} + streamCigParams : CUstreamCigParam CIG (CUDA in Graphics) parameters for sharing command list data from D3D12 graphics clients. - {{endif}} + Methods ------- @@ -2341,33 +2160,31 @@ cdef class CUstreamCigCaptureParams_st: """ cdef cydriver.CUstreamCigCaptureParams_st _pvt_val cdef cydriver.CUstreamCigCaptureParams_st* _pvt_ptr - {{if 'CUstreamCigCaptureParams_st.streamCigParams' in found_struct}} + cdef size_t _streamCigParams_length cdef cydriver.CUstreamCigParam* _streamCigParams - {{endif}} -{{endif}} -{{if 'CUlibraryHostUniversalFunctionAndDataTable_st' in found_struct}} + cdef class CUlibraryHostUniversalFunctionAndDataTable_st: """ Attributes ---------- - {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.functionTable' in found_struct}} + functionTable : Any - {{endif}} - {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.functionWindowSize' in found_struct}} + + functionWindowSize : size_t - {{endif}} - {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.dataTable' in found_struct}} + + dataTable : Any - {{endif}} - {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.dataWindowSize' in found_struct}} + + dataWindowSize : size_t - {{endif}} + Methods ------- @@ -2376,14 +2193,12 @@ cdef class CUlibraryHostUniversalFunctionAndDataTable_st: """ cdef cydriver.CUlibraryHostUniversalFunctionAndDataTable_st _pvt_val cdef cydriver.CUlibraryHostUniversalFunctionAndDataTable_st* _pvt_ptr - {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.functionTable' in found_struct}} + cdef _HelperInputVoidPtr _cyfunctionTable - {{endif}} - {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.dataTable' in found_struct}} + + cdef _HelperInputVoidPtr _cydataTable - {{endif}} -{{endif}} -{{if 'CUDA_MEMCPY2D_st' in found_struct}} + cdef class CUDA_MEMCPY2D_st: """ @@ -2391,70 +2206,70 @@ cdef class CUDA_MEMCPY2D_st: Attributes ---------- - {{if 'CUDA_MEMCPY2D_st.srcXInBytes' in found_struct}} + srcXInBytes : size_t Source X in bytes - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcY' in found_struct}} + + srcY : size_t Source Y - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcMemoryType' in found_struct}} + + srcMemoryType : CUmemorytype Source memory type (host, device, array) - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcHost' in found_struct}} + + srcHost : Any Source host pointer - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcDevice' in found_struct}} + + srcDevice : CUdeviceptr Source device pointer - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcArray' in found_struct}} + + srcArray : CUarray Source array reference - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcPitch' in found_struct}} + + srcPitch : size_t Source pitch (ignored when src is array) - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstXInBytes' in found_struct}} + + dstXInBytes : size_t Destination X in bytes - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstY' in found_struct}} + + dstY : size_t Destination Y - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstMemoryType' in found_struct}} + + dstMemoryType : CUmemorytype Destination memory type (host, device, array) - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstHost' in found_struct}} + + dstHost : Any Destination host pointer - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstDevice' in found_struct}} + + dstDevice : CUdeviceptr Destination device pointer - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstArray' in found_struct}} + + dstArray : CUarray Destination array reference - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstPitch' in found_struct}} + + dstPitch : size_t Destination pitch (ignored when dst is array) - {{endif}} - {{if 'CUDA_MEMCPY2D_st.WidthInBytes' in found_struct}} + + WidthInBytes : size_t Width of 2D memory copy in bytes - {{endif}} - {{if 'CUDA_MEMCPY2D_st.Height' in found_struct}} + + Height : size_t Height of 2D memory copy - {{endif}} + Methods ------- @@ -2463,26 +2278,24 @@ cdef class CUDA_MEMCPY2D_st: """ cdef cydriver.CUDA_MEMCPY2D_st _pvt_val cdef cydriver.CUDA_MEMCPY2D_st* _pvt_ptr - {{if 'CUDA_MEMCPY2D_st.srcHost' in found_struct}} + cdef _HelperInputVoidPtr _cysrcHost - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcDevice' in found_struct}} + + cdef CUdeviceptr _srcDevice - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcArray' in found_struct}} + + cdef CUarray _srcArray - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstHost' in found_struct}} + + cdef _HelperInputVoidPtr _cydstHost - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstDevice' in found_struct}} + + cdef CUdeviceptr _dstDevice - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstArray' in found_struct}} + + cdef CUarray _dstArray - {{endif}} -{{endif}} -{{if 'CUDA_MEMCPY3D_st' in found_struct}} + cdef class CUDA_MEMCPY3D_st: """ @@ -2490,107 +2303,107 @@ cdef class CUDA_MEMCPY3D_st: Attributes ---------- - {{if 'CUDA_MEMCPY3D_st.srcXInBytes' in found_struct}} + srcXInBytes : size_t Source X in bytes - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcY' in found_struct}} + + srcY : size_t Source Y - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcZ' in found_struct}} + + srcZ : size_t Source Z - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcLOD' in found_struct}} + + srcLOD : size_t Source LOD - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcMemoryType' in found_struct}} + + srcMemoryType : CUmemorytype Source memory type (host, device, array) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcHost' in found_struct}} + + srcHost : Any Source host pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcDevice' in found_struct}} + + srcDevice : CUdeviceptr Source device pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcArray' in found_struct}} + + srcArray : CUarray Source array reference - {{endif}} - {{if 'CUDA_MEMCPY3D_st.reserved0' in found_struct}} + + reserved0 : Any Must be NULL - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcPitch' in found_struct}} + + srcPitch : size_t Source pitch (ignored when src is array) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcHeight' in found_struct}} + + srcHeight : size_t Source height (ignored when src is array; may be 0 if Depth==1) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstXInBytes' in found_struct}} + + dstXInBytes : size_t Destination X in bytes - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstY' in found_struct}} + + dstY : size_t Destination Y - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstZ' in found_struct}} + + dstZ : size_t Destination Z - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstLOD' in found_struct}} + + dstLOD : size_t Destination LOD - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstMemoryType' in found_struct}} + + dstMemoryType : CUmemorytype Destination memory type (host, device, array) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstHost' in found_struct}} + + dstHost : Any Destination host pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstDevice' in found_struct}} + + dstDevice : CUdeviceptr Destination device pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstArray' in found_struct}} + + dstArray : CUarray Destination array reference - {{endif}} - {{if 'CUDA_MEMCPY3D_st.reserved1' in found_struct}} + + reserved1 : Any Must be NULL - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstPitch' in found_struct}} + + dstPitch : size_t Destination pitch (ignored when dst is array) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstHeight' in found_struct}} + + dstHeight : size_t Destination height (ignored when dst is array; may be 0 if Depth==1) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.WidthInBytes' in found_struct}} + + WidthInBytes : size_t Width of 3D memory copy in bytes - {{endif}} - {{if 'CUDA_MEMCPY3D_st.Height' in found_struct}} + + Height : size_t Height of 3D memory copy - {{endif}} - {{if 'CUDA_MEMCPY3D_st.Depth' in found_struct}} + + Depth : size_t Depth of 3D memory copy - {{endif}} + Methods ------- @@ -2599,32 +2412,30 @@ cdef class CUDA_MEMCPY3D_st: """ cdef cydriver.CUDA_MEMCPY3D_st _pvt_val cdef cydriver.CUDA_MEMCPY3D_st* _pvt_ptr - {{if 'CUDA_MEMCPY3D_st.srcHost' in found_struct}} + cdef _HelperInputVoidPtr _cysrcHost - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcDevice' in found_struct}} + + cdef CUdeviceptr _srcDevice - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcArray' in found_struct}} + + cdef CUarray _srcArray - {{endif}} - {{if 'CUDA_MEMCPY3D_st.reserved0' in found_struct}} + + cdef _HelperInputVoidPtr _cyreserved0 - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstHost' in found_struct}} + + cdef _HelperInputVoidPtr _cydstHost - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstDevice' in found_struct}} + + cdef CUdeviceptr _dstDevice - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstArray' in found_struct}} + + cdef CUarray _dstArray - {{endif}} - {{if 'CUDA_MEMCPY3D_st.reserved1' in found_struct}} + + cdef _HelperInputVoidPtr _cyreserved1 - {{endif}} -{{endif}} -{{if 'CUDA_MEMCPY3D_PEER_st' in found_struct}} + cdef class CUDA_MEMCPY3D_PEER_st: """ @@ -2632,108 +2443,108 @@ cdef class CUDA_MEMCPY3D_PEER_st: Attributes ---------- - {{if 'CUDA_MEMCPY3D_PEER_st.srcXInBytes' in found_struct}} + srcXInBytes : size_t Source X in bytes - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcY' in found_struct}} + + srcY : size_t Source Y - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcZ' in found_struct}} + + srcZ : size_t Source Z - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcLOD' in found_struct}} + + srcLOD : size_t Source LOD - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcMemoryType' in found_struct}} + + srcMemoryType : CUmemorytype Source memory type (host, device, array) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcHost' in found_struct}} + + srcHost : Any Source host pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcDevice' in found_struct}} + + srcDevice : CUdeviceptr Source device pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcArray' in found_struct}} + + srcArray : CUarray Source array reference - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcContext' in found_struct}} + + srcContext : CUcontext Source context (ignored with srcMemoryType is CU_MEMORYTYPE_ARRAY) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcPitch' in found_struct}} + + srcPitch : size_t Source pitch (ignored when src is array) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcHeight' in found_struct}} + + srcHeight : size_t Source height (ignored when src is array; may be 0 if Depth==1) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstXInBytes' in found_struct}} + + dstXInBytes : size_t Destination X in bytes - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstY' in found_struct}} + + dstY : size_t Destination Y - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstZ' in found_struct}} + + dstZ : size_t Destination Z - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstLOD' in found_struct}} + + dstLOD : size_t Destination LOD - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstMemoryType' in found_struct}} + + dstMemoryType : CUmemorytype Destination memory type (host, device, array) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstHost' in found_struct}} + + dstHost : Any Destination host pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstDevice' in found_struct}} + + dstDevice : CUdeviceptr Destination device pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstArray' in found_struct}} + + dstArray : CUarray Destination array reference - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstContext' in found_struct}} + + dstContext : CUcontext Destination context (ignored with dstMemoryType is CU_MEMORYTYPE_ARRAY) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstPitch' in found_struct}} + + dstPitch : size_t Destination pitch (ignored when dst is array) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstHeight' in found_struct}} + + dstHeight : size_t Destination height (ignored when dst is array; may be 0 if Depth==1) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.WidthInBytes' in found_struct}} + + WidthInBytes : size_t Width of 3D memory copy in bytes - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.Height' in found_struct}} + + Height : size_t Height of 3D memory copy - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.Depth' in found_struct}} + + Depth : size_t Depth of 3D memory copy - {{endif}} + Methods ------- @@ -2742,32 +2553,30 @@ cdef class CUDA_MEMCPY3D_PEER_st: """ cdef cydriver.CUDA_MEMCPY3D_PEER_st _pvt_val cdef cydriver.CUDA_MEMCPY3D_PEER_st* _pvt_ptr - {{if 'CUDA_MEMCPY3D_PEER_st.srcHost' in found_struct}} + cdef _HelperInputVoidPtr _cysrcHost - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcDevice' in found_struct}} + + cdef CUdeviceptr _srcDevice - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcArray' in found_struct}} + + cdef CUarray _srcArray - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcContext' in found_struct}} + + cdef CUcontext _srcContext - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstHost' in found_struct}} + + cdef _HelperInputVoidPtr _cydstHost - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstDevice' in found_struct}} + + cdef CUdeviceptr _dstDevice - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstArray' in found_struct}} + + cdef CUarray _dstArray - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstContext' in found_struct}} + + cdef CUcontext _dstContext - {{endif}} -{{endif}} -{{if 'CUDA_MEMCPY_NODE_PARAMS_st' in found_struct}} + cdef class CUDA_MEMCPY_NODE_PARAMS_st: """ @@ -2775,22 +2584,22 @@ cdef class CUDA_MEMCPY_NODE_PARAMS_st: Attributes ---------- - {{if 'CUDA_MEMCPY_NODE_PARAMS_st.flags' in found_struct}} + flags : int Must be zero - {{endif}} - {{if 'CUDA_MEMCPY_NODE_PARAMS_st.reserved' in found_struct}} + + reserved : int Must be zero - {{endif}} - {{if 'CUDA_MEMCPY_NODE_PARAMS_st.copyCtx' in found_struct}} + + copyCtx : CUcontext Context on which to run the node - {{endif}} - {{if 'CUDA_MEMCPY_NODE_PARAMS_st.copyParams' in found_struct}} + + copyParams : CUDA_MEMCPY3D Parameters for the memory copy - {{endif}} + Methods ------- @@ -2799,14 +2608,12 @@ cdef class CUDA_MEMCPY_NODE_PARAMS_st: """ cdef cydriver.CUDA_MEMCPY_NODE_PARAMS_st _pvt_val cdef cydriver.CUDA_MEMCPY_NODE_PARAMS_st* _pvt_ptr - {{if 'CUDA_MEMCPY_NODE_PARAMS_st.copyCtx' in found_struct}} + cdef CUcontext _copyCtx - {{endif}} - {{if 'CUDA_MEMCPY_NODE_PARAMS_st.copyParams' in found_struct}} + + cdef CUDA_MEMCPY3D _copyParams - {{endif}} -{{endif}} -{{if 'CUDA_ARRAY_DESCRIPTOR_st' in found_struct}} + cdef class CUDA_ARRAY_DESCRIPTOR_st: """ @@ -2814,22 +2621,22 @@ cdef class CUDA_ARRAY_DESCRIPTOR_st: Attributes ---------- - {{if 'CUDA_ARRAY_DESCRIPTOR_st.Width' in found_struct}} + Width : size_t Width of array - {{endif}} - {{if 'CUDA_ARRAY_DESCRIPTOR_st.Height' in found_struct}} + + Height : size_t Height of array - {{endif}} - {{if 'CUDA_ARRAY_DESCRIPTOR_st.Format' in found_struct}} + + Format : CUarray_format Array format - {{endif}} - {{if 'CUDA_ARRAY_DESCRIPTOR_st.NumChannels' in found_struct}} + + NumChannels : unsigned int Channels per array element - {{endif}} + Methods ------- @@ -2838,8 +2645,6 @@ cdef class CUDA_ARRAY_DESCRIPTOR_st: """ cdef cydriver.CUDA_ARRAY_DESCRIPTOR_st _pvt_val cdef cydriver.CUDA_ARRAY_DESCRIPTOR_st* _pvt_ptr -{{endif}} -{{if 'CUDA_ARRAY3D_DESCRIPTOR_st' in found_struct}} cdef class CUDA_ARRAY3D_DESCRIPTOR_st: """ @@ -2847,30 +2652,30 @@ cdef class CUDA_ARRAY3D_DESCRIPTOR_st: Attributes ---------- - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Width' in found_struct}} + Width : size_t Width of 3D array - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Height' in found_struct}} + + Height : size_t Height of 3D array - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Depth' in found_struct}} + + Depth : size_t Depth of 3D array - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Format' in found_struct}} + + Format : CUarray_format Array format - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.NumChannels' in found_struct}} + + NumChannels : unsigned int Channels per array element - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Flags' in found_struct}} + + Flags : unsigned int Flags - {{endif}} + Methods ------- @@ -2879,25 +2684,23 @@ cdef class CUDA_ARRAY3D_DESCRIPTOR_st: """ cdef cydriver.CUDA_ARRAY3D_DESCRIPTOR_st _pvt_val cdef cydriver.CUDA_ARRAY3D_DESCRIPTOR_st* _pvt_ptr -{{endif}} -{{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.tileExtent' in found_struct}} cdef class anon_struct6: """ Attributes ---------- - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.tileExtent.width' in found_struct}} + width : unsigned int - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.tileExtent.height' in found_struct}} + + height : unsigned int - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.tileExtent.depth' in found_struct}} - depth : unsigned int - {{endif}} + + depth : unsigned int + + Methods ------- @@ -2905,8 +2708,6 @@ cdef class anon_struct6: Get memory address of class instance """ cdef cydriver.CUDA_ARRAY_SPARSE_PROPERTIES_st* _pvt_ptr -{{endif}} -{{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st' in found_struct}} cdef class CUDA_ARRAY_SPARSE_PROPERTIES_st: """ @@ -2914,27 +2715,27 @@ cdef class CUDA_ARRAY_SPARSE_PROPERTIES_st: Attributes ---------- - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.tileExtent' in found_struct}} + tileExtent : anon_struct6 - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.miptailFirstLevel' in found_struct}} + + miptailFirstLevel : unsigned int First mip level at which the mip tail begins. - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.miptailSize' in found_struct}} + + miptailSize : unsigned long long Total size of the mip tail. - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.flags' in found_struct}} + + flags : unsigned int Flags will either be zero or CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -2943,11 +2744,9 @@ cdef class CUDA_ARRAY_SPARSE_PROPERTIES_st: """ cdef cydriver.CUDA_ARRAY_SPARSE_PROPERTIES_st _pvt_val cdef cydriver.CUDA_ARRAY_SPARSE_PROPERTIES_st* _pvt_ptr - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.tileExtent' in found_struct}} + cdef anon_struct6 _tileExtent - {{endif}} -{{endif}} -{{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st' in found_struct}} + cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS_st: """ @@ -2955,18 +2754,18 @@ cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS_st: Attributes ---------- - {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.size' in found_struct}} + size : size_t Total required memory size - {{endif}} - {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.alignment' in found_struct}} + + alignment : size_t alignment requirement - {{endif}} - {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -2975,17 +2774,15 @@ cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS_st: """ cdef cydriver.CUDA_ARRAY_MEMORY_REQUIREMENTS_st _pvt_val cdef cydriver.CUDA_ARRAY_MEMORY_REQUIREMENTS_st* _pvt_ptr -{{endif}} -{{if 'CUDA_RESOURCE_DESC_st.res.array' in found_struct}} cdef class anon_struct7: """ Attributes ---------- - {{if 'CUDA_RESOURCE_DESC_st.res.array.hArray' in found_struct}} + hArray : CUarray - {{endif}} + Methods ------- @@ -2993,20 +2790,18 @@ cdef class anon_struct7: Get memory address of class instance """ cdef cydriver.CUDA_RESOURCE_DESC_st* _pvt_ptr - {{if 'CUDA_RESOURCE_DESC_st.res.array.hArray' in found_struct}} + cdef CUarray _hArray - {{endif}} -{{endif}} -{{if 'CUDA_RESOURCE_DESC_st.res.mipmap' in found_struct}} + cdef class anon_struct8: """ Attributes ---------- - {{if 'CUDA_RESOURCE_DESC_st.res.mipmap.hMipmappedArray' in found_struct}} + hMipmappedArray : CUmipmappedArray - {{endif}} + Methods ------- @@ -3014,32 +2809,30 @@ cdef class anon_struct8: Get memory address of class instance """ cdef cydriver.CUDA_RESOURCE_DESC_st* _pvt_ptr - {{if 'CUDA_RESOURCE_DESC_st.res.mipmap.hMipmappedArray' in found_struct}} + cdef CUmipmappedArray _hMipmappedArray - {{endif}} -{{endif}} -{{if 'CUDA_RESOURCE_DESC_st.res.linear' in found_struct}} + cdef class anon_struct9: """ Attributes ---------- - {{if 'CUDA_RESOURCE_DESC_st.res.linear.devPtr' in found_struct}} + devPtr : CUdeviceptr - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.linear.format' in found_struct}} + + format : CUarray_format - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.linear.numChannels' in found_struct}} + + numChannels : unsigned int - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.linear.sizeInBytes' in found_struct}} + + sizeInBytes : size_t - {{endif}} + Methods ------- @@ -3047,40 +2840,38 @@ cdef class anon_struct9: Get memory address of class instance """ cdef cydriver.CUDA_RESOURCE_DESC_st* _pvt_ptr - {{if 'CUDA_RESOURCE_DESC_st.res.linear.devPtr' in found_struct}} + cdef CUdeviceptr _devPtr - {{endif}} -{{endif}} -{{if 'CUDA_RESOURCE_DESC_st.res.pitch2D' in found_struct}} + cdef class anon_struct10: """ Attributes ---------- - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.devPtr' in found_struct}} + devPtr : CUdeviceptr - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.format' in found_struct}} + + format : CUarray_format - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.numChannels' in found_struct}} + + numChannels : unsigned int - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.width' in found_struct}} + + width : size_t - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.height' in found_struct}} + + height : size_t - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.pitchInBytes' in found_struct}} + + pitchInBytes : size_t - {{endif}} + Methods ------- @@ -3088,20 +2879,18 @@ cdef class anon_struct10: Get memory address of class instance """ cdef cydriver.CUDA_RESOURCE_DESC_st* _pvt_ptr - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.devPtr' in found_struct}} + cdef CUdeviceptr _devPtr - {{endif}} -{{endif}} -{{if 'CUDA_RESOURCE_DESC_st.res.reserved' in found_struct}} + cdef class anon_struct11: """ Attributes ---------- - {{if 'CUDA_RESOURCE_DESC_st.res.reserved.reserved' in found_struct}} + reserved : list[int] - {{endif}} + Methods ------- @@ -3109,33 +2898,31 @@ cdef class anon_struct11: Get memory address of class instance """ cdef cydriver.CUDA_RESOURCE_DESC_st* _pvt_ptr -{{endif}} -{{if 'CUDA_RESOURCE_DESC_st.res' in found_struct}} cdef class anon_union4: """ Attributes ---------- - {{if 'CUDA_RESOURCE_DESC_st.res.array' in found_struct}} + array : anon_struct7 - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.mipmap' in found_struct}} + + mipmap : anon_struct8 - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.linear' in found_struct}} + + linear : anon_struct9 - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D' in found_struct}} + + pitch2D : anon_struct10 - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.reserved' in found_struct}} + + reserved : anon_struct11 - {{endif}} + Methods ------- @@ -3143,23 +2930,21 @@ cdef class anon_union4: Get memory address of class instance """ cdef cydriver.CUDA_RESOURCE_DESC_st* _pvt_ptr - {{if 'CUDA_RESOURCE_DESC_st.res.array' in found_struct}} + cdef anon_struct7 _array - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.mipmap' in found_struct}} + + cdef anon_struct8 _mipmap - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.linear' in found_struct}} + + cdef anon_struct9 _linear - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D' in found_struct}} + + cdef anon_struct10 _pitch2D - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.reserved' in found_struct}} + + cdef anon_struct11 _reserved - {{endif}} -{{endif}} -{{if 'CUDA_RESOURCE_DESC_st' in found_struct}} + cdef class CUDA_RESOURCE_DESC_st: """ @@ -3167,18 +2952,18 @@ cdef class CUDA_RESOURCE_DESC_st: Attributes ---------- - {{if 'CUDA_RESOURCE_DESC_st.resType' in found_struct}} + resType : CUresourcetype Resource type - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res' in found_struct}} + + res : anon_union4 - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.flags' in found_struct}} + + flags : unsigned int Flags (must be zero) - {{endif}} + Methods ------- @@ -3187,11 +2972,9 @@ cdef class CUDA_RESOURCE_DESC_st: """ cdef cydriver.CUDA_RESOURCE_DESC_st* _val_ptr cdef cydriver.CUDA_RESOURCE_DESC_st* _pvt_ptr - {{if 'CUDA_RESOURCE_DESC_st.res' in found_struct}} + cdef anon_union4 _res - {{endif}} -{{endif}} -{{if 'CUDA_TEXTURE_DESC_st' in found_struct}} + cdef class CUDA_TEXTURE_DESC_st: """ @@ -3199,46 +2982,46 @@ cdef class CUDA_TEXTURE_DESC_st: Attributes ---------- - {{if 'CUDA_TEXTURE_DESC_st.addressMode' in found_struct}} + addressMode : list[CUaddress_mode] Address modes - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.filterMode' in found_struct}} + + filterMode : CUfilter_mode Filter mode - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.flags' in found_struct}} + + flags : unsigned int Flags - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.maxAnisotropy' in found_struct}} + + maxAnisotropy : unsigned int Maximum anisotropy ratio - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.mipmapFilterMode' in found_struct}} + + mipmapFilterMode : CUfilter_mode Mipmap filter mode - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.mipmapLevelBias' in found_struct}} + + mipmapLevelBias : float Mipmap level bias - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.minMipmapLevelClamp' in found_struct}} + + minMipmapLevelClamp : float Mipmap minimum level clamp - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.maxMipmapLevelClamp' in found_struct}} + + maxMipmapLevelClamp : float Mipmap maximum level clamp - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.borderColor' in found_struct}} + + borderColor : list[float] Border Color - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.reserved' in found_struct}} + + reserved : list[int] - {{endif}} + Methods ------- @@ -3247,8 +3030,6 @@ cdef class CUDA_TEXTURE_DESC_st: """ cdef cydriver.CUDA_TEXTURE_DESC_st _pvt_val cdef cydriver.CUDA_TEXTURE_DESC_st* _pvt_ptr -{{endif}} -{{if 'CUDA_RESOURCE_VIEW_DESC_st' in found_struct}} cdef class CUDA_RESOURCE_VIEW_DESC_st: """ @@ -3256,42 +3037,42 @@ cdef class CUDA_RESOURCE_VIEW_DESC_st: Attributes ---------- - {{if 'CUDA_RESOURCE_VIEW_DESC_st.format' in found_struct}} + format : CUresourceViewFormat Resource view format - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.width' in found_struct}} + + width : size_t Width of the resource view - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.height' in found_struct}} + + height : size_t Height of the resource view - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.depth' in found_struct}} + + depth : size_t Depth of the resource view - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.firstMipmapLevel' in found_struct}} + + firstMipmapLevel : unsigned int First defined mipmap level - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.lastMipmapLevel' in found_struct}} + + lastMipmapLevel : unsigned int Last defined mipmap level - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.firstLayer' in found_struct}} + + firstLayer : unsigned int First layer index - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.lastLayer' in found_struct}} + + lastLayer : unsigned int Last layer index - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -3300,8 +3081,6 @@ cdef class CUDA_RESOURCE_VIEW_DESC_st: """ cdef cydriver.CUDA_RESOURCE_VIEW_DESC_st _pvt_val cdef cydriver.CUDA_RESOURCE_VIEW_DESC_st* _pvt_ptr -{{endif}} -{{if 'CUtensorMap_st' in found_struct}} cdef class CUtensorMap_st: """ @@ -3310,10 +3089,10 @@ cdef class CUtensorMap_st: Attributes ---------- - {{if 'CUtensorMap_st.opaque' in found_struct}} + opaque : list[cuuint64_t] - {{endif}} + Methods ------- @@ -3322,8 +3101,6 @@ cdef class CUtensorMap_st: """ cdef cydriver.CUtensorMap_st _pvt_val cdef cydriver.CUtensorMap_st* _pvt_ptr -{{endif}} -{{if 'CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st' in found_struct}} cdef class CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st: """ @@ -3331,14 +3108,14 @@ cdef class CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st: Attributes ---------- - {{if 'CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st.p2pToken' in found_struct}} + p2pToken : unsigned long long - {{endif}} - {{if 'CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st.vaSpaceToken' in found_struct}} + + vaSpaceToken : unsigned int - {{endif}} + Methods ------- @@ -3347,8 +3124,6 @@ cdef class CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st: """ cdef cydriver.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st _pvt_val cdef cydriver.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st* _pvt_ptr -{{endif}} -{{if 'CUDA_LAUNCH_PARAMS_st' in found_struct}} cdef class CUDA_LAUNCH_PARAMS_st: """ @@ -3356,46 +3131,46 @@ cdef class CUDA_LAUNCH_PARAMS_st: Attributes ---------- - {{if 'CUDA_LAUNCH_PARAMS_st.function' in found_struct}} + function : CUfunction Kernel to launch - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.gridDimX' in found_struct}} + + gridDimX : unsigned int Width of grid in blocks - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.gridDimY' in found_struct}} + + gridDimY : unsigned int Height of grid in blocks - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.gridDimZ' in found_struct}} + + gridDimZ : unsigned int Depth of grid in blocks - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.blockDimX' in found_struct}} + + blockDimX : unsigned int X dimension of each thread block - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.blockDimY' in found_struct}} + + blockDimY : unsigned int Y dimension of each thread block - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.blockDimZ' in found_struct}} + + blockDimZ : unsigned int Z dimension of each thread block - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.sharedMemBytes' in found_struct}} + + sharedMemBytes : unsigned int Dynamic shared-memory size per thread block in bytes - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.hStream' in found_struct}} + + hStream : CUstream Stream identifier - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.kernelParams' in found_struct}} + + kernelParams : Any Array of pointers to kernel parameters - {{endif}} + Methods ------- @@ -3404,30 +3179,28 @@ cdef class CUDA_LAUNCH_PARAMS_st: """ cdef cydriver.CUDA_LAUNCH_PARAMS_st _pvt_val cdef cydriver.CUDA_LAUNCH_PARAMS_st* _pvt_ptr - {{if 'CUDA_LAUNCH_PARAMS_st.function' in found_struct}} + cdef CUfunction _function - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.hStream' in found_struct}} + + cdef CUstream _hStream - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.kernelParams' in found_struct}} + + cdef _HelperKernelParams _cykernelParams - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.win32' in found_struct}} + cdef class anon_struct12: """ Attributes ---------- - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.win32.handle' in found_struct}} + handle : Any - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.win32.name' in found_struct}} + + name : Any - {{endif}} + Methods ------- @@ -3435,31 +3208,29 @@ cdef class anon_struct12: Get memory address of class instance """ cdef cydriver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st* _pvt_ptr - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.win32.handle' in found_struct}} + cdef _HelperInputVoidPtr _cyhandle - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.win32.name' in found_struct}} + + cdef _HelperInputVoidPtr _cyname - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle' in found_struct}} + cdef class anon_union5: """ Attributes ---------- - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.fd' in found_struct}} + fd : int - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.win32' in found_struct}} + + win32 : anon_struct12 - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.nvSciBufObject' in found_struct}} + + nvSciBufObject : Any - {{endif}} + Methods ------- @@ -3467,14 +3238,12 @@ cdef class anon_union5: Get memory address of class instance """ cdef cydriver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st* _pvt_ptr - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.win32' in found_struct}} + cdef anon_struct12 _win32 - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.nvSciBufObject' in found_struct}} + + cdef _HelperInputVoidPtr _cynvSciBufObject - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st' in found_struct}} + cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: """ @@ -3482,26 +3251,26 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: Attributes ---------- - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.type' in found_struct}} + type : CUexternalMemoryHandleType Type of the handle - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle' in found_struct}} + + handle : anon_union5 - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.size' in found_struct}} + + size : unsigned long long Size of the memory allocation - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.flags' in found_struct}} + + flags : unsigned int 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] - {{endif}} + Methods ------- @@ -3510,11 +3279,9 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: """ cdef cydriver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st* _val_ptr cdef cydriver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st* _pvt_ptr - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle' in found_struct}} + cdef anon_union5 _handle - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st' in found_struct}} + cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st: """ @@ -3522,22 +3289,22 @@ cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st: Attributes ---------- - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.offset' in found_struct}} + offset : unsigned long long Offset into the memory object where the buffer's base is - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.size' in found_struct}} + + size : unsigned long long Size of the buffer - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.flags' in found_struct}} + + flags : unsigned int Flags reserved for future use. Must be zero. - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -3546,8 +3313,6 @@ cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st: """ cdef cydriver.CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st _pvt_val cdef cydriver.CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st* _pvt_ptr -{{endif}} -{{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st' in found_struct}} cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st: """ @@ -3555,23 +3320,23 @@ cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st: Attributes ---------- - {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.offset' in found_struct}} + offset : unsigned long long Offset into the memory object where the base level of the mipmap chain is. - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.arrayDesc' in found_struct}} + + arrayDesc : CUDA_ARRAY3D_DESCRIPTOR Format, dimension and type of base level of the mipmap chain - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.numLevels' in found_struct}} + + numLevels : unsigned int 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] - {{endif}} + Methods ------- @@ -3580,24 +3345,22 @@ cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st: """ cdef cydriver.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st _pvt_val cdef cydriver.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st* _pvt_ptr - {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.arrayDesc' in found_struct}} + cdef CUDA_ARRAY3D_DESCRIPTOR _arrayDesc - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.win32' in found_struct}} + cdef class anon_struct13: """ Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.win32.handle' in found_struct}} + handle : Any - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.win32.name' in found_struct}} + + name : Any - {{endif}} + Methods ------- @@ -3605,31 +3368,29 @@ cdef class anon_struct13: Get memory address of class instance """ cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st* _pvt_ptr - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.win32.handle' in found_struct}} + cdef _HelperInputVoidPtr _cyhandle - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.win32.name' in found_struct}} + + cdef _HelperInputVoidPtr _cyname - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle' in found_struct}} + cdef class anon_union6: """ Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.fd' in found_struct}} + fd : int - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.win32' in found_struct}} + + win32 : anon_struct13 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.nvSciSyncObj' in found_struct}} + + nvSciSyncObj : Any - {{endif}} + Methods ------- @@ -3637,14 +3398,12 @@ cdef class anon_union6: Get memory address of class instance """ cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st* _pvt_ptr - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.win32' in found_struct}} + cdef anon_struct13 _win32 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.nvSciSyncObj' in found_struct}} + + cdef _HelperInputVoidPtr _cynvSciSyncObj - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st' in found_struct}} + cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: """ @@ -3652,22 +3411,22 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.type' in found_struct}} + type : CUexternalSemaphoreHandleType Type of the handle - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle' in found_struct}} + + handle : anon_union6 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.flags' in found_struct}} + + flags : unsigned int Flags reserved for the future. Must be zero. - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -3676,20 +3435,18 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: """ cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st* _val_ptr cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st* _pvt_ptr - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle' in found_struct}} + cdef anon_union6 _handle - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.fence' in found_struct}} + cdef class anon_struct14: """ Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.fence.value' in found_struct}} + value : unsigned long long - {{endif}} + Methods ------- @@ -3697,21 +3454,19 @@ cdef class anon_struct14: Get memory address of class instance """ cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st* _pvt_ptr -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.nvSciSync' in found_struct}} cdef class anon_union7: """ Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.nvSciSync.fence' in found_struct}} + fence : Any - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.nvSciSync.reserved' in found_struct}} + + reserved : unsigned long long - {{endif}} + Methods ------- @@ -3719,20 +3474,18 @@ cdef class anon_union7: Get memory address of class instance """ cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st* _pvt_ptr - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.nvSciSync.fence' in found_struct}} + cdef _HelperInputVoidPtr _cyfence - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.keyedMutex' in found_struct}} + cdef class anon_struct15: """ Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.keyedMutex.key' in found_struct}} + key : unsigned long long - {{endif}} + Methods ------- @@ -3740,29 +3493,27 @@ cdef class anon_struct15: Get memory address of class instance """ cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st* _pvt_ptr -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params' in found_struct}} cdef class anon_struct16: """ Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.fence' in found_struct}} + fence : anon_struct14 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.nvSciSync' in found_struct}} + + nvSciSync : anon_union7 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.keyedMutex' in found_struct}} + + keyedMutex : anon_struct15 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -3770,17 +3521,15 @@ cdef class anon_struct16: Get memory address of class instance """ cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st* _pvt_ptr - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.fence' in found_struct}} + cdef anon_struct14 _fence - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.nvSciSync' in found_struct}} + + cdef anon_union7 _nvSciSync - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.keyedMutex' in found_struct}} + + cdef anon_struct15 _keyedMutex - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st' in found_struct}} + cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st: """ @@ -3788,25 +3537,25 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st: Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params' in found_struct}} + params : anon_struct16 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.flags' in found_struct}} - flags : unsigned int - Only when ::CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS is used to signal - a CUexternalSemaphore of type + + + flags : unsigned int + Only when CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS is used to signal a + CUexternalSemaphore of type CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC, the valid flag is CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC which indicates that while signaling the CUexternalSemaphore, no memory synchronization operations should be performed for any external memory object imported as CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF. 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] - {{endif}} + Methods ------- @@ -3815,20 +3564,18 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st: """ cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st _pvt_val cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st* _pvt_ptr - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params' in found_struct}} + cdef anon_struct16 _params - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.fence' in found_struct}} + cdef class anon_struct17: """ Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.fence.value' in found_struct}} + value : unsigned long long - {{endif}} + Methods ------- @@ -3836,21 +3583,19 @@ cdef class anon_struct17: Get memory address of class instance """ cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st* _pvt_ptr -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.nvSciSync' in found_struct}} cdef class anon_union8: """ Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.nvSciSync.fence' in found_struct}} + fence : Any - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.nvSciSync.reserved' in found_struct}} + + reserved : unsigned long long - {{endif}} + Methods ------- @@ -3858,24 +3603,22 @@ cdef class anon_union8: Get memory address of class instance """ cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st* _pvt_ptr - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.nvSciSync.fence' in found_struct}} + cdef _HelperInputVoidPtr _cyfence - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.keyedMutex' in found_struct}} + cdef class anon_struct18: """ Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.keyedMutex.key' in found_struct}} + key : unsigned long long - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.keyedMutex.timeoutMs' in found_struct}} + + timeoutMs : unsigned int - {{endif}} + Methods ------- @@ -3883,29 +3626,27 @@ cdef class anon_struct18: Get memory address of class instance """ cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st* _pvt_ptr -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params' in found_struct}} cdef class anon_struct19: """ Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.fence' in found_struct}} + fence : anon_struct17 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.nvSciSync' in found_struct}} + + nvSciSync : anon_union8 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.keyedMutex' in found_struct}} + + keyedMutex : anon_struct18 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -3913,17 +3654,15 @@ cdef class anon_struct19: Get memory address of class instance """ cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st* _pvt_ptr - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.fence' in found_struct}} + cdef anon_struct17 _fence - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.nvSciSync' in found_struct}} + + cdef anon_union8 _nvSciSync - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.keyedMutex' in found_struct}} + + cdef anon_struct18 _keyedMutex - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st' in found_struct}} + cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st: """ @@ -3931,25 +3670,25 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st: Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params' in found_struct}} + params : anon_struct19 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.flags' in found_struct}} + + flags : unsigned int - Only when ::CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS is used to wait on - a CUexternalSemaphore of type + Only when CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS is used to wait on a + CUexternalSemaphore of type CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC, the valid flag is CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC which indicates that while waiting for the CUexternalSemaphore, no memory synchronization operations should be performed for any external memory object imported as CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF. 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] - {{endif}} + Methods ------- @@ -3958,11 +3697,9 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st: """ cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st _pvt_val cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st* _pvt_ptr - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params' in found_struct}} + cdef anon_struct19 _params - {{endif}} -{{endif}} -{{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st' in found_struct}} + cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st: """ @@ -3970,19 +3707,19 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st: Attributes ---------- - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st.extSemArray' in found_struct}} + extSemArray : CUexternalSemaphore Array of external semaphore handles. - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st.paramsArray' in found_struct}} + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS Array of external semaphore signal parameters. - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st.numExtSems' in found_struct}} + + numExtSems : unsigned int Number of handles and parameters supplied in extSemArray and paramsArray. - {{endif}} + Methods ------- @@ -3991,16 +3728,14 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st: """ cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st _pvt_val cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st* _pvt_ptr - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st.extSemArray' in found_struct}} + cdef size_t _extSemArray_length cdef cydriver.CUexternalSemaphore* _extSemArray - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st.paramsArray' in found_struct}} + + cdef size_t _paramsArray_length cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* _paramsArray - {{endif}} -{{endif}} -{{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st' in found_struct}} + cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: """ @@ -4008,19 +3743,19 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: Attributes ---------- - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st.extSemArray' in found_struct}} + extSemArray : CUexternalSemaphore Array of external semaphore handles. - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st.paramsArray' in found_struct}} + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS Array of external semaphore signal parameters. - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st.numExtSems' in found_struct}} + + numExtSems : unsigned int Number of handles and parameters supplied in extSemArray and paramsArray. - {{endif}} + Methods ------- @@ -4029,16 +3764,14 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: """ cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st _pvt_val cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st* _pvt_ptr - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st.extSemArray' in found_struct}} + cdef size_t _extSemArray_length cdef cydriver.CUexternalSemaphore* _extSemArray - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st.paramsArray' in found_struct}} + + cdef size_t _paramsArray_length cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* _paramsArray - {{endif}} -{{endif}} -{{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_st' in found_struct}} + cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_st: """ @@ -4046,19 +3779,19 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_st: Attributes ---------- - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_st.extSemArray' in found_struct}} + extSemArray : CUexternalSemaphore Array of external semaphore handles. - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_st.paramsArray' in found_struct}} + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS Array of external semaphore wait parameters. - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_st.numExtSems' in found_struct}} + + numExtSems : unsigned int Number of handles and parameters supplied in extSemArray and paramsArray. - {{endif}} + Methods ------- @@ -4067,16 +3800,14 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_st: """ cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_st _pvt_val cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_st* _pvt_ptr - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_st.extSemArray' in found_struct}} + cdef size_t _extSemArray_length cdef cydriver.CUexternalSemaphore* _extSemArray - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_st.paramsArray' in found_struct}} + + cdef size_t _paramsArray_length cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* _paramsArray - {{endif}} -{{endif}} -{{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st' in found_struct}} + cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st: """ @@ -4084,19 +3815,19 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st: Attributes ---------- - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st.extSemArray' in found_struct}} + extSemArray : CUexternalSemaphore Array of external semaphore handles. - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st.paramsArray' in found_struct}} + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS Array of external semaphore wait parameters. - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st.numExtSems' in found_struct}} + + numExtSems : unsigned int Number of handles and parameters supplied in extSemArray and paramsArray. - {{endif}} + Methods ------- @@ -4105,29 +3836,27 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st: """ cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st _pvt_val cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st* _pvt_ptr - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st.extSemArray' in found_struct}} + cdef size_t _extSemArray_length cdef cydriver.CUexternalSemaphore* _extSemArray - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st.paramsArray' in found_struct}} + + cdef size_t _paramsArray_length cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* _paramsArray - {{endif}} -{{endif}} -{{if 'CUarrayMapInfo_st.resource' in found_struct}} + cdef class anon_union9: """ Attributes ---------- - {{if 'CUarrayMapInfo_st.resource.mipmap' in found_struct}} + mipmap : CUmipmappedArray - {{endif}} - {{if 'CUarrayMapInfo_st.resource.array' in found_struct}} + + array : CUarray - {{endif}} + Methods ------- @@ -4135,51 +3864,49 @@ cdef class anon_union9: Get memory address of class instance """ cdef cydriver.CUarrayMapInfo_st* _pvt_ptr - {{if 'CUarrayMapInfo_st.resource.mipmap' in found_struct}} + cdef CUmipmappedArray _mipmap - {{endif}} - {{if 'CUarrayMapInfo_st.resource.array' in found_struct}} + + cdef CUarray _array - {{endif}} -{{endif}} -{{if 'CUarrayMapInfo_st.subresource.sparseLevel' in found_struct}} + cdef class anon_struct20: """ Attributes ---------- - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.level' in found_struct}} + level : unsigned int - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.layer' in found_struct}} + + layer : unsigned int - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.offsetX' in found_struct}} + + offsetX : unsigned int - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.offsetY' in found_struct}} + + offsetY : unsigned int - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.offsetZ' in found_struct}} + + offsetZ : unsigned int - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.extentWidth' in found_struct}} + + extentWidth : unsigned int - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.extentHeight' in found_struct}} + + extentHeight : unsigned int - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.extentDepth' in found_struct}} + + extentDepth : unsigned int - {{endif}} + Methods ------- @@ -4187,25 +3914,23 @@ cdef class anon_struct20: Get memory address of class instance """ cdef cydriver.CUarrayMapInfo_st* _pvt_ptr -{{endif}} -{{if 'CUarrayMapInfo_st.subresource.miptail' in found_struct}} cdef class anon_struct21: """ Attributes ---------- - {{if 'CUarrayMapInfo_st.subresource.miptail.layer' in found_struct}} + layer : unsigned int - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.miptail.offset' in found_struct}} + + offset : unsigned long long - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.miptail.size' in found_struct}} + + size : unsigned long long - {{endif}} + Methods ------- @@ -4213,21 +3938,19 @@ cdef class anon_struct21: Get memory address of class instance """ cdef cydriver.CUarrayMapInfo_st* _pvt_ptr -{{endif}} -{{if 'CUarrayMapInfo_st.subresource' in found_struct}} cdef class anon_union10: """ Attributes ---------- - {{if 'CUarrayMapInfo_st.subresource.sparseLevel' in found_struct}} + sparseLevel : anon_struct20 - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.miptail' in found_struct}} + + miptail : anon_struct21 - {{endif}} + Methods ------- @@ -4235,23 +3958,21 @@ cdef class anon_union10: Get memory address of class instance """ cdef cydriver.CUarrayMapInfo_st* _pvt_ptr - {{if 'CUarrayMapInfo_st.subresource.sparseLevel' in found_struct}} + cdef anon_struct20 _sparseLevel - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.miptail' in found_struct}} + + cdef anon_struct21 _miptail - {{endif}} -{{endif}} -{{if 'CUarrayMapInfo_st.memHandle' in found_struct}} + cdef class anon_union11: """ Attributes ---------- - {{if 'CUarrayMapInfo_st.memHandle.memHandle' in found_struct}} + memHandle : CUmemGenericAllocationHandle - {{endif}} + Methods ------- @@ -4259,11 +3980,9 @@ cdef class anon_union11: Get memory address of class instance """ cdef cydriver.CUarrayMapInfo_st* _pvt_ptr - {{if 'CUarrayMapInfo_st.memHandle.memHandle' in found_struct}} + cdef CUmemGenericAllocationHandle _memHandle - {{endif}} -{{endif}} -{{if 'CUarrayMapInfo_st' in found_struct}} + cdef class CUarrayMapInfo_st: """ @@ -4272,50 +3991,50 @@ cdef class CUarrayMapInfo_st: Attributes ---------- - {{if 'CUarrayMapInfo_st.resourceType' in found_struct}} + resourceType : CUresourcetype Resource type - {{endif}} - {{if 'CUarrayMapInfo_st.resource' in found_struct}} + + resource : anon_union9 - {{endif}} - {{if 'CUarrayMapInfo_st.subresourceType' in found_struct}} + + subresourceType : CUarraySparseSubresourceType Sparse subresource type - {{endif}} - {{if 'CUarrayMapInfo_st.subresource' in found_struct}} + + subresource : anon_union10 - {{endif}} - {{if 'CUarrayMapInfo_st.memOperationType' in found_struct}} + + memOperationType : CUmemOperationType Memory operation type - {{endif}} - {{if 'CUarrayMapInfo_st.memHandleType' in found_struct}} + + memHandleType : CUmemHandleType Memory handle type - {{endif}} - {{if 'CUarrayMapInfo_st.memHandle' in found_struct}} + + memHandle : anon_union11 - {{endif}} - {{if 'CUarrayMapInfo_st.offset' in found_struct}} + + offset : unsigned long long Offset within mip tail Offset within the memory - {{endif}} - {{if 'CUarrayMapInfo_st.deviceBitMask' in found_struct}} + + deviceBitMask : unsigned int Device ordinal bit mask - {{endif}} - {{if 'CUarrayMapInfo_st.flags' in found_struct}} + + flags : unsigned int flags for future use, must be zero now. - {{endif}} - {{if 'CUarrayMapInfo_st.reserved' in found_struct}} + + reserved : list[unsigned int] Reserved for future use, must be zero now. - {{endif}} + Methods ------- @@ -4324,17 +4043,15 @@ cdef class CUarrayMapInfo_st: """ cdef cydriver.CUarrayMapInfo_st* _val_ptr cdef cydriver.CUarrayMapInfo_st* _pvt_ptr - {{if 'CUarrayMapInfo_st.resource' in found_struct}} + cdef anon_union9 _resource - {{endif}} - {{if 'CUarrayMapInfo_st.subresource' in found_struct}} + + cdef anon_union10 _subresource - {{endif}} - {{if 'CUarrayMapInfo_st.memHandle' in found_struct}} + + cdef anon_union11 _memHandle - {{endif}} -{{endif}} -{{if 'CUmemLocation_st' in found_struct}} + cdef class CUmemLocation_st: """ @@ -4342,14 +4059,16 @@ cdef class CUmemLocation_st: Attributes ---------- - {{if 'CUmemLocation_st.type' in found_struct}} + type : CUmemLocationType Specifies the location type, which modifies the meaning of id. - {{endif}} - {{if 'CUmemLocation_st.id' in found_struct}} + + id : int + Identifier for CUmemLocationType::CU_MEM_LOCATION_TYPE_DEVICE, + CUmemLocationType::CU_MEM_LOCATION_TYPE_HOST, + CUmemLocationType::CU_MEM_LOCATION_TYPE_HOST_NUMA. - {{endif}} Methods ------- @@ -4358,29 +4077,27 @@ cdef class CUmemLocation_st: """ cdef cydriver.CUmemLocation_st* _val_ptr cdef cydriver.CUmemLocation_st* _pvt_ptr -{{endif}} -{{if 'CUmemAllocationProp_st.allocFlags' in found_struct}} cdef class anon_struct22: """ Attributes ---------- - {{if 'CUmemAllocationProp_st.allocFlags.compressionType' in found_struct}} + compressionType : bytes - {{endif}} - {{if 'CUmemAllocationProp_st.allocFlags.gpuDirectRDMACapable' in found_struct}} + + gpuDirectRDMACapable : bytes - {{endif}} - {{if 'CUmemAllocationProp_st.allocFlags.usage' in found_struct}} + + usage : unsigned short - {{endif}} - {{if 'CUmemAllocationProp_st.allocFlags.reserved' in found_struct}} + + reserved : bytes - {{endif}} + Methods ------- @@ -4388,8 +4105,6 @@ cdef class anon_struct22: Get memory address of class instance """ cdef cydriver.CUmemAllocationProp_st* _pvt_ptr -{{endif}} -{{if 'CUmemAllocationProp_st' in found_struct}} cdef class CUmemAllocationProp_st: """ @@ -4397,30 +4112,30 @@ cdef class CUmemAllocationProp_st: Attributes ---------- - {{if 'CUmemAllocationProp_st.type' in found_struct}} + type : CUmemAllocationType Allocation type - {{endif}} - {{if 'CUmemAllocationProp_st.requestedHandleTypes' in found_struct}} + + requestedHandleTypes : CUmemAllocationHandleType requested CUmemAllocationHandleType - {{endif}} - {{if 'CUmemAllocationProp_st.location' in found_struct}} + + location : CUmemLocation Location of allocation - {{endif}} - {{if 'CUmemAllocationProp_st.win32HandleMetaData' in found_struct}} + + win32HandleMetaData : Any Windows-specific POBJECT_ATTRIBUTES required when CU_MEM_HANDLE_TYPE_WIN32 is specified. This object attributes structure includes security attributes that define the scope of which exported allocations may be transferred to other processes. In all other cases, this field is required to be zero. - {{endif}} - {{if 'CUmemAllocationProp_st.allocFlags' in found_struct}} + + allocFlags : anon_struct22 - {{endif}} + Methods ------- @@ -4429,17 +4144,15 @@ cdef class CUmemAllocationProp_st: """ cdef cydriver.CUmemAllocationProp_st _pvt_val cdef cydriver.CUmemAllocationProp_st* _pvt_ptr - {{if 'CUmemAllocationProp_st.location' in found_struct}} + cdef CUmemLocation _location - {{endif}} - {{if 'CUmemAllocationProp_st.win32HandleMetaData' in found_struct}} + + cdef _HelperInputVoidPtr _cywin32HandleMetaData - {{endif}} - {{if 'CUmemAllocationProp_st.allocFlags' in found_struct}} + + cdef anon_struct22 _allocFlags - {{endif}} -{{endif}} -{{if 'CUmulticastObjectProp_st' in found_struct}} + cdef class CUmulticastObjectProp_st: """ @@ -4447,25 +4160,25 @@ cdef class CUmulticastObjectProp_st: Attributes ---------- - {{if 'CUmulticastObjectProp_st.numDevices' in found_struct}} + numDevices : unsigned int The number of devices in the multicast team that will bind memory to this object - {{endif}} - {{if 'CUmulticastObjectProp_st.size' in found_struct}} + + size : size_t The maximum amount of memory that can be bound to this multicast object per device - {{endif}} - {{if 'CUmulticastObjectProp_st.handleTypes' in found_struct}} + + handleTypes : unsigned long long Bitmask of exportable handle types (see CUmemAllocationHandleType) for this object - {{endif}} - {{if 'CUmulticastObjectProp_st.flags' in found_struct}} + + flags : unsigned long long Flags for future use, must be zero now - {{endif}} + Methods ------- @@ -4474,8 +4187,6 @@ cdef class CUmulticastObjectProp_st: """ cdef cydriver.CUmulticastObjectProp_st _pvt_val cdef cydriver.CUmulticastObjectProp_st* _pvt_ptr -{{endif}} -{{if 'CUmemAccessDesc_st' in found_struct}} cdef class CUmemAccessDesc_st: """ @@ -4483,14 +4194,14 @@ cdef class CUmemAccessDesc_st: Attributes ---------- - {{if 'CUmemAccessDesc_st.location' in found_struct}} + location : CUmemLocation Location on which the request is to change it's accessibility - {{endif}} - {{if 'CUmemAccessDesc_st.flags' in found_struct}} + + flags : CUmemAccess_flags ::CUmemProt accessibility flags to set on the request - {{endif}} + Methods ------- @@ -4499,11 +4210,9 @@ cdef class CUmemAccessDesc_st: """ cdef cydriver.CUmemAccessDesc_st _pvt_val cdef cydriver.CUmemAccessDesc_st* _pvt_ptr - {{if 'CUmemAccessDesc_st.location' in found_struct}} + cdef CUmemLocation _location - {{endif}} -{{endif}} -{{if 'CUgraphExecUpdateResultInfo_st' in found_struct}} + cdef class CUgraphExecUpdateResultInfo_st: """ @@ -4511,21 +4220,21 @@ cdef class CUgraphExecUpdateResultInfo_st: Attributes ---------- - {{if 'CUgraphExecUpdateResultInfo_st.result' in found_struct}} + result : CUgraphExecUpdateResult Gives more specific detail when a cuda graph update fails. - {{endif}} - {{if 'CUgraphExecUpdateResultInfo_st.errorNode' in found_struct}} + + errorNode : CUgraphNode The "to node" of the error edge when the topologies do not match. The error node when the error is associated with a specific node. NULL when the error is generic. - {{endif}} - {{if 'CUgraphExecUpdateResultInfo_st.errorFromNode' in found_struct}} + + errorFromNode : CUgraphNode The from node of error edge when the topologies do not match. Otherwise NULL. - {{endif}} + Methods ------- @@ -4534,14 +4243,12 @@ cdef class CUgraphExecUpdateResultInfo_st: """ cdef cydriver.CUgraphExecUpdateResultInfo_st _pvt_val cdef cydriver.CUgraphExecUpdateResultInfo_st* _pvt_ptr - {{if 'CUgraphExecUpdateResultInfo_st.errorNode' in found_struct}} + cdef CUgraphNode _errorNode - {{endif}} - {{if 'CUgraphExecUpdateResultInfo_st.errorFromNode' in found_struct}} + + cdef CUgraphNode _errorFromNode - {{endif}} -{{endif}} -{{if 'CUmemPoolProps_st' in found_struct}} + cdef class CUmemPoolProps_st: """ @@ -4549,40 +4256,40 @@ cdef class CUmemPoolProps_st: Attributes ---------- - {{if 'CUmemPoolProps_st.allocType' in found_struct}} + allocType : CUmemAllocationType Allocation type. Currently must be specified as CU_MEM_ALLOCATION_TYPE_PINNED - {{endif}} - {{if 'CUmemPoolProps_st.handleTypes' in found_struct}} + + handleTypes : CUmemAllocationHandleType Handle types that will be supported by allocations from the pool. - {{endif}} - {{if 'CUmemPoolProps_st.location' in found_struct}} + + location : CUmemLocation Location where allocations should reside. - {{endif}} - {{if 'CUmemPoolProps_st.win32SecurityAttributes' in found_struct}} + + win32SecurityAttributes : Any Windows-specific LPSECURITYATTRIBUTES required when CU_MEM_HANDLE_TYPE_WIN32 is specified. This security attribute defines the scope of which exported allocations may be transferred to other processes. In all other cases, this field is required to be zero. - {{endif}} - {{if 'CUmemPoolProps_st.maxSize' in found_struct}} + + maxSize : size_t Maximum pool size. When set to 0, defaults to a system dependent value. - {{endif}} - {{if 'CUmemPoolProps_st.usage' in found_struct}} + + usage : unsigned short Bitmask indicating intended usage for the pool. - {{endif}} - {{if 'CUmemPoolProps_st.reserved' in found_struct}} + + reserved : bytes reserved for future use, must be 0 - {{endif}} + Methods ------- @@ -4591,14 +4298,12 @@ cdef class CUmemPoolProps_st: """ cdef cydriver.CUmemPoolProps_st _pvt_val cdef cydriver.CUmemPoolProps_st* _pvt_ptr - {{if 'CUmemPoolProps_st.location' in found_struct}} + cdef CUmemLocation _location - {{endif}} - {{if 'CUmemPoolProps_st.win32SecurityAttributes' in found_struct}} + + cdef _HelperInputVoidPtr _cywin32SecurityAttributes - {{endif}} -{{endif}} -{{if 'CUmemPoolPtrExportData_st' in found_struct}} + cdef class CUmemPoolPtrExportData_st: """ @@ -4606,10 +4311,10 @@ cdef class CUmemPoolPtrExportData_st: Attributes ---------- - {{if 'CUmemPoolPtrExportData_st.reserved' in found_struct}} + reserved : bytes - {{endif}} + Methods ------- @@ -4618,8 +4323,6 @@ cdef class CUmemPoolPtrExportData_st: """ cdef cydriver.CUmemPoolPtrExportData_st _pvt_val cdef cydriver.CUmemPoolPtrExportData_st* _pvt_ptr -{{endif}} -{{if 'CUmemcpyAttributes_st' in found_struct}} cdef class CUmemcpyAttributes_st: """ @@ -4628,25 +4331,25 @@ cdef class CUmemcpyAttributes_st: Attributes ---------- - {{if 'CUmemcpyAttributes_st.srcAccessOrder' in found_struct}} + srcAccessOrder : CUmemcpySrcAccessOrder Source access ordering to be observed for copies with this attribute. - {{endif}} - {{if 'CUmemcpyAttributes_st.srcLocHint' in found_struct}} + + srcLocHint : CUmemLocation Hint location for the source operand. Ignored when the pointers are not managed memory or memory allocated outside CUDA. - {{endif}} - {{if 'CUmemcpyAttributes_st.dstLocHint' in found_struct}} + + dstLocHint : CUmemLocation Hint location for the destination operand. Ignored when the pointers are not managed memory or memory allocated outside CUDA. - {{endif}} - {{if 'CUmemcpyAttributes_st.flags' in found_struct}} + + flags : unsigned int Additional flags for copies with this attribute. See CUmemcpyFlags - {{endif}} + Methods ------- @@ -4655,14 +4358,12 @@ cdef class CUmemcpyAttributes_st: """ cdef cydriver.CUmemcpyAttributes_st _pvt_val cdef cydriver.CUmemcpyAttributes_st* _pvt_ptr - {{if 'CUmemcpyAttributes_st.srcLocHint' in found_struct}} + cdef CUmemLocation _srcLocHint - {{endif}} - {{if 'CUmemcpyAttributes_st.dstLocHint' in found_struct}} + + cdef CUmemLocation _dstLocHint - {{endif}} -{{endif}} -{{if 'CUoffset3D_st' in found_struct}} + cdef class CUoffset3D_st: """ @@ -4670,18 +4371,18 @@ cdef class CUoffset3D_st: Attributes ---------- - {{if 'CUoffset3D_st.x' in found_struct}} + x : size_t - {{endif}} - {{if 'CUoffset3D_st.y' in found_struct}} + + y : size_t - {{endif}} - {{if 'CUoffset3D_st.z' in found_struct}} + + z : size_t - {{endif}} + Methods ------- @@ -4690,8 +4391,6 @@ cdef class CUoffset3D_st: """ cdef cydriver.CUoffset3D_st _pvt_val cdef cydriver.CUoffset3D_st* _pvt_ptr -{{endif}} -{{if 'CUextent3D_st' in found_struct}} cdef class CUextent3D_st: """ @@ -4699,18 +4398,18 @@ cdef class CUextent3D_st: Attributes ---------- - {{if 'CUextent3D_st.width' in found_struct}} + width : size_t - {{endif}} - {{if 'CUextent3D_st.height' in found_struct}} + + height : size_t - {{endif}} - {{if 'CUextent3D_st.depth' in found_struct}} + + depth : size_t - {{endif}} + Methods ------- @@ -4719,29 +4418,27 @@ cdef class CUextent3D_st: """ cdef cydriver.CUextent3D_st _pvt_val cdef cydriver.CUextent3D_st* _pvt_ptr -{{endif}} -{{if 'CUmemcpy3DOperand_st.op.ptr' in found_struct}} cdef class anon_struct23: """ Attributes ---------- - {{if 'CUmemcpy3DOperand_st.op.ptr.ptr' in found_struct}} + ptr : CUdeviceptr - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.ptr.rowLength' in found_struct}} + + rowLength : size_t - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.ptr.layerHeight' in found_struct}} + + layerHeight : size_t - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.ptr.locHint' in found_struct}} + + locHint : CUmemLocation - {{endif}} + Methods ------- @@ -4749,27 +4446,25 @@ cdef class anon_struct23: Get memory address of class instance """ cdef cydriver.CUmemcpy3DOperand_st* _pvt_ptr - {{if 'CUmemcpy3DOperand_st.op.ptr.ptr' in found_struct}} + cdef CUdeviceptr _ptr - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.ptr.locHint' in found_struct}} + + cdef CUmemLocation _locHint - {{endif}} -{{endif}} -{{if 'CUmemcpy3DOperand_st.op.array' in found_struct}} + cdef class anon_struct24: """ Attributes ---------- - {{if 'CUmemcpy3DOperand_st.op.array.array' in found_struct}} + array : CUarray - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.array.offset' in found_struct}} + + offset : CUoffset3D - {{endif}} + Methods ------- @@ -4777,27 +4472,25 @@ cdef class anon_struct24: Get memory address of class instance """ cdef cydriver.CUmemcpy3DOperand_st* _pvt_ptr - {{if 'CUmemcpy3DOperand_st.op.array.array' in found_struct}} + cdef CUarray _array - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.array.offset' in found_struct}} + + cdef CUoffset3D _offset - {{endif}} -{{endif}} -{{if 'CUmemcpy3DOperand_st.op' in found_struct}} + cdef class anon_union13: """ Attributes ---------- - {{if 'CUmemcpy3DOperand_st.op.ptr' in found_struct}} + ptr : anon_struct23 - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.array' in found_struct}} + + array : anon_struct24 - {{endif}} + Methods ------- @@ -4805,14 +4498,12 @@ cdef class anon_union13: Get memory address of class instance """ cdef cydriver.CUmemcpy3DOperand_st* _pvt_ptr - {{if 'CUmemcpy3DOperand_st.op.ptr' in found_struct}} + cdef anon_struct23 _ptr - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.array' in found_struct}} + + cdef anon_struct24 _array - {{endif}} -{{endif}} -{{if 'CUmemcpy3DOperand_st' in found_struct}} + cdef class CUmemcpy3DOperand_st: """ @@ -4820,14 +4511,14 @@ cdef class CUmemcpy3DOperand_st: Attributes ---------- - {{if 'CUmemcpy3DOperand_st.type' in found_struct}} + type : CUmemcpy3DOperandType - {{endif}} - {{if 'CUmemcpy3DOperand_st.op' in found_struct}} + + op : anon_union13 - {{endif}} + Methods ------- @@ -4836,37 +4527,35 @@ cdef class CUmemcpy3DOperand_st: """ cdef cydriver.CUmemcpy3DOperand_st* _val_ptr cdef cydriver.CUmemcpy3DOperand_st* _pvt_ptr - {{if 'CUmemcpy3DOperand_st.op' in found_struct}} + cdef anon_union13 _op - {{endif}} -{{endif}} -{{if 'CUDA_MEMCPY3D_BATCH_OP_st' in found_struct}} + cdef class CUDA_MEMCPY3D_BATCH_OP_st: """ Attributes ---------- - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.src' in found_struct}} + src : CUmemcpy3DOperand Source memcpy operand. - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.dst' in found_struct}} + + dst : CUmemcpy3DOperand Destination memcpy operand. - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.extent' in found_struct}} + + extent : CUextent3D Extents of the memcpy between src and dst. The width, height and depth components must not be 0. - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.srcAccessOrder' in found_struct}} + + srcAccessOrder : CUmemcpySrcAccessOrder Source access ordering to be observed for copy from src to dst. - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.flags' in found_struct}} + + flags : unsigned int Additional flags for copies with this attribute. See CUmemcpyFlags - {{endif}} + Methods ------- @@ -4875,17 +4564,15 @@ cdef class CUDA_MEMCPY3D_BATCH_OP_st: """ cdef cydriver.CUDA_MEMCPY3D_BATCH_OP_st _pvt_val cdef cydriver.CUDA_MEMCPY3D_BATCH_OP_st* _pvt_ptr - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.src' in found_struct}} + cdef CUmemcpy3DOperand _src - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.dst' in found_struct}} + + cdef CUmemcpy3DOperand _dst - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.extent' in found_struct}} + + cdef CUextent3D _extent - {{endif}} -{{endif}} -{{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st' in found_struct}} + cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v1_st: """ @@ -4893,30 +4580,30 @@ cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v1_st: Attributes ---------- - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.poolProps' in found_struct}} + poolProps : CUmemPoolProps in: location where the allocation should reside (specified in ::location). ::handleTypes must be CU_MEM_HANDLE_TYPE_NONE. IPC is not supported. - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.accessDescs' in found_struct}} + + accessDescs : CUmemAccessDesc in: array of memory access descriptors. Used to describe peer GPU access - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.accessDescCount' in found_struct}} + + accessDescCount : size_t in: number of memory access descriptors. Must not exceed the number of GPUs. - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.bytesize' in found_struct}} + + bytesize : size_t in: size in bytes of the requested allocation - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.dptr' in found_struct}} + + dptr : CUdeviceptr out: address of the allocation returned by CUDA - {{endif}} + Methods ------- @@ -4925,18 +4612,16 @@ cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v1_st: """ cdef cydriver.CUDA_MEM_ALLOC_NODE_PARAMS_v1_st _pvt_val cdef cydriver.CUDA_MEM_ALLOC_NODE_PARAMS_v1_st* _pvt_ptr - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.poolProps' in found_struct}} + cdef CUmemPoolProps _poolProps - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.accessDescs' in found_struct}} + + cdef size_t _accessDescs_length cdef cydriver.CUmemAccessDesc* _accessDescs - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.dptr' in found_struct}} + + cdef CUdeviceptr _dptr - {{endif}} -{{endif}} -{{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st' in found_struct}} + cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v2_st: """ @@ -4944,30 +4629,30 @@ cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v2_st: Attributes ---------- - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.poolProps' in found_struct}} + poolProps : CUmemPoolProps in: location where the allocation should reside (specified in ::location). ::handleTypes must be CU_MEM_HANDLE_TYPE_NONE. IPC is not supported. - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.accessDescs' in found_struct}} + + accessDescs : CUmemAccessDesc in: array of memory access descriptors. Used to describe peer GPU access - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.accessDescCount' in found_struct}} + + accessDescCount : size_t in: number of memory access descriptors. Must not exceed the number of GPUs. - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.bytesize' in found_struct}} + + bytesize : size_t in: size in bytes of the requested allocation - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.dptr' in found_struct}} + + dptr : CUdeviceptr out: address of the allocation returned by CUDA - {{endif}} + Methods ------- @@ -4976,18 +4661,16 @@ cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v2_st: """ cdef cydriver.CUDA_MEM_ALLOC_NODE_PARAMS_v2_st _pvt_val cdef cydriver.CUDA_MEM_ALLOC_NODE_PARAMS_v2_st* _pvt_ptr - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.poolProps' in found_struct}} + cdef CUmemPoolProps _poolProps - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.accessDescs' in found_struct}} + + cdef size_t _accessDescs_length cdef cydriver.CUmemAccessDesc* _accessDescs - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.dptr' in found_struct}} + + cdef CUdeviceptr _dptr - {{endif}} -{{endif}} -{{if 'CUDA_MEM_FREE_NODE_PARAMS_st' in found_struct}} + cdef class CUDA_MEM_FREE_NODE_PARAMS_st: """ @@ -4995,10 +4678,10 @@ cdef class CUDA_MEM_FREE_NODE_PARAMS_st: Attributes ---------- - {{if 'CUDA_MEM_FREE_NODE_PARAMS_st.dptr' in found_struct}} + dptr : CUdeviceptr in: the pointer to free - {{endif}} + Methods ------- @@ -5007,11 +4690,9 @@ cdef class CUDA_MEM_FREE_NODE_PARAMS_st: """ cdef cydriver.CUDA_MEM_FREE_NODE_PARAMS_st _pvt_val cdef cydriver.CUDA_MEM_FREE_NODE_PARAMS_st* _pvt_ptr - {{if 'CUDA_MEM_FREE_NODE_PARAMS_st.dptr' in found_struct}} + cdef CUdeviceptr _dptr - {{endif}} -{{endif}} -{{if 'CUDA_CHILD_GRAPH_NODE_PARAMS_st' in found_struct}} + cdef class CUDA_CHILD_GRAPH_NODE_PARAMS_st: """ @@ -5019,18 +4700,18 @@ cdef class CUDA_CHILD_GRAPH_NODE_PARAMS_st: Attributes ---------- - {{if 'CUDA_CHILD_GRAPH_NODE_PARAMS_st.graph' in found_struct}} + graph : CUgraph The child graph to clone into the node for node creation, or a handle to the graph owned by the node for node query. The graph must not contain conditional nodes. Graphs containing memory allocation or memory free nodes must set the ownership to be moved to the parent. - {{endif}} - {{if 'CUDA_CHILD_GRAPH_NODE_PARAMS_st.ownership' in found_struct}} + + ownership : CUgraphChildGraphNodeOwnership The ownership relationship of the child graph node. - {{endif}} + Methods ------- @@ -5039,11 +4720,9 @@ cdef class CUDA_CHILD_GRAPH_NODE_PARAMS_st: """ cdef cydriver.CUDA_CHILD_GRAPH_NODE_PARAMS_st _pvt_val cdef cydriver.CUDA_CHILD_GRAPH_NODE_PARAMS_st* _pvt_ptr - {{if 'CUDA_CHILD_GRAPH_NODE_PARAMS_st.graph' in found_struct}} + cdef CUgraph _graph - {{endif}} -{{endif}} -{{if 'CUDA_EVENT_RECORD_NODE_PARAMS_st' in found_struct}} + cdef class CUDA_EVENT_RECORD_NODE_PARAMS_st: """ @@ -5051,10 +4730,10 @@ cdef class CUDA_EVENT_RECORD_NODE_PARAMS_st: Attributes ---------- - {{if 'CUDA_EVENT_RECORD_NODE_PARAMS_st.event' in found_struct}} + event : CUevent The event to record when the node executes - {{endif}} + Methods ------- @@ -5063,11 +4742,9 @@ cdef class CUDA_EVENT_RECORD_NODE_PARAMS_st: """ cdef cydriver.CUDA_EVENT_RECORD_NODE_PARAMS_st _pvt_val cdef cydriver.CUDA_EVENT_RECORD_NODE_PARAMS_st* _pvt_ptr - {{if 'CUDA_EVENT_RECORD_NODE_PARAMS_st.event' in found_struct}} + cdef CUevent _event - {{endif}} -{{endif}} -{{if 'CUDA_EVENT_WAIT_NODE_PARAMS_st' in found_struct}} + cdef class CUDA_EVENT_WAIT_NODE_PARAMS_st: """ @@ -5075,10 +4752,10 @@ cdef class CUDA_EVENT_WAIT_NODE_PARAMS_st: Attributes ---------- - {{if 'CUDA_EVENT_WAIT_NODE_PARAMS_st.event' in found_struct}} + event : CUevent The event to wait on from the node - {{endif}} + Methods ------- @@ -5087,11 +4764,9 @@ cdef class CUDA_EVENT_WAIT_NODE_PARAMS_st: """ cdef cydriver.CUDA_EVENT_WAIT_NODE_PARAMS_st _pvt_val cdef cydriver.CUDA_EVENT_WAIT_NODE_PARAMS_st* _pvt_ptr - {{if 'CUDA_EVENT_WAIT_NODE_PARAMS_st.event' in found_struct}} + cdef CUevent _event - {{endif}} -{{endif}} -{{if 'CUgraphNodeParams_st' in found_struct}} + cdef class CUgraphNodeParams_st: """ @@ -5099,74 +4774,78 @@ cdef class CUgraphNodeParams_st: Attributes ---------- - {{if 'CUgraphNodeParams_st.type' in found_struct}} + type : CUgraphNodeType Type of the node - {{endif}} - {{if 'CUgraphNodeParams_st.reserved0' in found_struct}} + + reserved0 : list[int] Reserved. Must be zero. - {{endif}} - {{if 'CUgraphNodeParams_st.reserved1' in found_struct}} + + reserved1 : list[long long] Padding. Unused bytes must be zero. - {{endif}} - {{if 'CUgraphNodeParams_st.kernel' in found_struct}} + + kernel : CUDA_KERNEL_NODE_PARAMS_v3 Kernel node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.memcpy' in found_struct}} + + memcpy : CUDA_MEMCPY_NODE_PARAMS Memcpy node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.memset' in found_struct}} + + memset : CUDA_MEMSET_NODE_PARAMS_v2 Memset node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.host' in found_struct}} + + host : CUDA_HOST_NODE_PARAMS_v2 Host node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.graph' in found_struct}} + + graph : CUDA_CHILD_GRAPH_NODE_PARAMS Child graph node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.eventWait' in found_struct}} + + eventWait : CUDA_EVENT_WAIT_NODE_PARAMS Event wait node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.eventRecord' in found_struct}} + + eventRecord : CUDA_EVENT_RECORD_NODE_PARAMS Event record node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.extSemSignal' in found_struct}} + + extSemSignal : CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 External semaphore signal node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.extSemWait' in found_struct}} + + extSemWait : CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 External semaphore wait node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.alloc' in found_struct}} + + alloc : CUDA_MEM_ALLOC_NODE_PARAMS_v2 Memory allocation node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.free' in found_struct}} + + free : CUDA_MEM_FREE_NODE_PARAMS Memory free node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.memOp' in found_struct}} + + memOp : CUDA_BATCH_MEM_OP_NODE_PARAMS_v2 MemOp node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.conditional' in found_struct}} + + conditional : CUDA_CONDITIONAL_NODE_PARAMS Conditional node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.reserved2' in found_struct}} + + + asBytes : bytes + Padding as bytes + + reserved2 : long long Reserved bytes. Must be zero. - {{endif}} + Methods ------- @@ -5175,47 +4854,45 @@ cdef class CUgraphNodeParams_st: """ cdef cydriver.CUgraphNodeParams_st* _val_ptr cdef cydriver.CUgraphNodeParams_st* _pvt_ptr - {{if 'CUgraphNodeParams_st.kernel' in found_struct}} + cdef CUDA_KERNEL_NODE_PARAMS_v3 _kernel - {{endif}} - {{if 'CUgraphNodeParams_st.memcpy' in found_struct}} + + cdef CUDA_MEMCPY_NODE_PARAMS _memcpy - {{endif}} - {{if 'CUgraphNodeParams_st.memset' in found_struct}} + + cdef CUDA_MEMSET_NODE_PARAMS_v2 _memset - {{endif}} - {{if 'CUgraphNodeParams_st.host' in found_struct}} + + cdef CUDA_HOST_NODE_PARAMS_v2 _host - {{endif}} - {{if 'CUgraphNodeParams_st.graph' in found_struct}} + + cdef CUDA_CHILD_GRAPH_NODE_PARAMS _graph - {{endif}} - {{if 'CUgraphNodeParams_st.eventWait' in found_struct}} + + cdef CUDA_EVENT_WAIT_NODE_PARAMS _eventWait - {{endif}} - {{if 'CUgraphNodeParams_st.eventRecord' in found_struct}} + + cdef CUDA_EVENT_RECORD_NODE_PARAMS _eventRecord - {{endif}} - {{if 'CUgraphNodeParams_st.extSemSignal' in found_struct}} + + cdef CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 _extSemSignal - {{endif}} - {{if 'CUgraphNodeParams_st.extSemWait' in found_struct}} + + cdef CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 _extSemWait - {{endif}} - {{if 'CUgraphNodeParams_st.alloc' in found_struct}} + + cdef CUDA_MEM_ALLOC_NODE_PARAMS_v2 _alloc - {{endif}} - {{if 'CUgraphNodeParams_st.free' in found_struct}} + + cdef CUDA_MEM_FREE_NODE_PARAMS _free - {{endif}} - {{if 'CUgraphNodeParams_st.memOp' in found_struct}} + + cdef CUDA_BATCH_MEM_OP_NODE_PARAMS_v2 _memOp - {{endif}} - {{if 'CUgraphNodeParams_st.conditional' in found_struct}} + + cdef CUDA_CONDITIONAL_NODE_PARAMS _conditional - {{endif}} -{{endif}} -{{if 'CUcheckpointLockArgs_st' in found_struct}} + cdef class CUcheckpointLockArgs_st: """ @@ -5223,19 +4900,19 @@ cdef class CUcheckpointLockArgs_st: Attributes ---------- - {{if 'CUcheckpointLockArgs_st.timeoutMs' in found_struct}} + timeoutMs : unsigned int Timeout in milliseconds to attempt to lock the process, 0 indicates no timeout - {{endif}} - {{if 'CUcheckpointLockArgs_st.reserved0' in found_struct}} + + reserved0 : unsigned int Reserved for future use, must be zero - {{endif}} - {{if 'CUcheckpointLockArgs_st.reserved1' in found_struct}} + + reserved1 : list[cuuint64_t] Reserved for future use, must be zeroed - {{endif}} + Methods ------- @@ -5244,8 +4921,6 @@ cdef class CUcheckpointLockArgs_st: """ cdef cydriver.CUcheckpointLockArgs_st _pvt_val cdef cydriver.CUcheckpointLockArgs_st* _pvt_ptr -{{endif}} -{{if 'CUcheckpointCheckpointArgs_st' in found_struct}} cdef class CUcheckpointCheckpointArgs_st: """ @@ -5253,10 +4928,10 @@ cdef class CUcheckpointCheckpointArgs_st: Attributes ---------- - {{if 'CUcheckpointCheckpointArgs_st.reserved' in found_struct}} + reserved : list[cuuint64_t] Reserved for future use, must be zeroed - {{endif}} + Methods ------- @@ -5265,8 +4940,6 @@ cdef class CUcheckpointCheckpointArgs_st: """ cdef cydriver.CUcheckpointCheckpointArgs_st _pvt_val cdef cydriver.CUcheckpointCheckpointArgs_st* _pvt_ptr -{{endif}} -{{if 'CUcheckpointGpuPair_st' in found_struct}} cdef class CUcheckpointGpuPair_st: """ @@ -5274,14 +4947,14 @@ cdef class CUcheckpointGpuPair_st: Attributes ---------- - {{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 ------- @@ -5290,14 +4963,12 @@ cdef class CUcheckpointGpuPair_st: """ 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 'CUcheckpointRestoreArgs_st' in found_struct}} + cdef class CUcheckpointRestoreArgs_st: """ @@ -5305,23 +4976,23 @@ cdef class CUcheckpointRestoreArgs_st: 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 : list[cuuint64_t] Reserved for future use, must be zeroed - {{endif}} + Methods ------- @@ -5330,15 +5001,10 @@ cdef class CUcheckpointRestoreArgs_st: """ 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: """ @@ -5346,10 +5012,10 @@ cdef class CUcheckpointUnlockArgs_st: Attributes ---------- - {{if 'CUcheckpointUnlockArgs_st.reserved' in found_struct}} + reserved : list[cuuint64_t] Reserved for future use, must be zeroed - {{endif}} + Methods ------- @@ -5358,8 +5024,6 @@ cdef class CUcheckpointUnlockArgs_st: """ cdef cydriver.CUcheckpointUnlockArgs_st _pvt_val cdef cydriver.CUcheckpointUnlockArgs_st* _pvt_ptr -{{endif}} -{{if 'CUmemDecompressParams_st' in found_struct}} cdef class CUmemDecompressParams_st: """ @@ -5368,43 +5032,43 @@ cdef class CUmemDecompressParams_st: Attributes ---------- - {{if 'CUmemDecompressParams_st.srcNumBytes' in found_struct}} + srcNumBytes : size_t The number of bytes to be read and decompressed from CUmemDecompressParams_st.src. - {{endif}} - {{if 'CUmemDecompressParams_st.dstNumBytes' in found_struct}} + + dstNumBytes : size_t The number of bytes that the decompression operation will be expected to write to CUmemDecompressParams_st.dst. This value is optional; if present, it may be used by the CUDA driver as a heuristic for scheduling the individual decompression operations. - {{endif}} - {{if 'CUmemDecompressParams_st.dstActBytes' in found_struct}} + + dstActBytes : cuuint32_t After the decompression operation has completed, the actual number of bytes written to CUmemDecompressParams.dst will be recorded as a 32-bit unsigned integer in the memory at this address. - {{endif}} - {{if 'CUmemDecompressParams_st.src' in found_struct}} + + src : Any Pointer to a buffer of at least CUmemDecompressParams_st.srcNumBytes compressed bytes. - {{endif}} - {{if 'CUmemDecompressParams_st.dst' in found_struct}} + + dst : Any Pointer to a buffer where the decompressed data will be written. The number of bytes written to this location will be recorded in the memory pointed to by CUmemDecompressParams_st.dstActBytes - {{endif}} - {{if 'CUmemDecompressParams_st.algo' in found_struct}} + + algo : CUmemDecompressAlgorithm The decompression algorithm to use. - {{endif}} - {{if 'CUmemDecompressParams_st.padding' in found_struct}} + + padding : bytes - {{endif}} + Methods ------- @@ -5413,127 +5077,219 @@ cdef class CUmemDecompressParams_st: """ cdef cydriver.CUmemDecompressParams_st _pvt_val cdef cydriver.CUmemDecompressParams_st* _pvt_ptr - {{if 'CUmemDecompressParams_st.src' in found_struct}} + cdef _HelperInputVoidPtr _cysrc - {{endif}} - {{if 'CUmemDecompressParams_st.dst' in found_struct}} + + cdef _HelperInputVoidPtr _cydst - {{endif}} -{{endif}} -{{if 'CUdevSmResource_st' in found_struct}} -cdef class CUdevSmResource_st: + +cdef class CUlogicalEndpointFabricHandle_st: """ + Fabric handle for a logical endpoint + Attributes ---------- - {{if 'CUdevSmResource_st.smCount' in found_struct}} - smCount : unsigned int - The amount of streaming multiprocessors available in this resource. - {{endif}} - {{if 'CUdevSmResource_st.minSmPartitionSize' in found_struct}} - minSmPartitionSize : unsigned int - The minimum number of streaming multiprocessors required to - partition this resource. - {{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 will be a multiple of this value, unless the backfill flag - is set. - {{endif}} - {{if 'CUdevSmResource_st.flags' in found_struct}} - flags : unsigned int - The flags set on this SM resource. For possible values see - CUdevSmResourceGroup_flags. - {{endif}} + + data : bytes + + Methods ------- getPtr() Get memory address of class instance """ - cdef cydriver.CUdevSmResource_st _pvt_val - cdef cydriver.CUdevSmResource_st* _pvt_ptr -{{endif}} -{{if 'CUdevWorkqueueConfigResource_st' in found_struct}} + cdef cydriver.CUlogicalEndpointFabricHandle_st _pvt_val + cdef cydriver.CUlogicalEndpointFabricHandle_st* _pvt_ptr -cdef class CUdevWorkqueueConfigResource_st: +cdef class anon_struct25: """ Attributes ---------- - {{if 'CUdevWorkqueueConfigResource_st.device' in found_struct}} + device : CUdevice - The device on which the workqueue resources are available - {{endif}} - {{if 'CUdevWorkqueueConfigResource_st.wqConcurrencyLimit' in found_struct}} - wqConcurrencyLimit : unsigned int - The expected maximum number of concurrent stream-ordered workloads - {{endif}} - {{if 'CUdevWorkqueueConfigResource_st.sharingScope' in found_struct}} - sharingScope : CUdevWorkqueueConfigScope - The sharing scope for the workqueue resources - {{endif}} + + Methods ------- getPtr() Get memory address of class instance """ - cdef cydriver.CUdevWorkqueueConfigResource_st _pvt_val - cdef cydriver.CUdevWorkqueueConfigResource_st* _pvt_ptr - {{if 'CUdevWorkqueueConfigResource_st.device' in found_struct}} + cdef cydriver.CUlogicalEndpointProp_struct* _pvt_ptr + cdef CUdevice _device - {{endif}} -{{endif}} -{{if 'CUdevWorkqueueResource_st' in found_struct}} -cdef class CUdevWorkqueueResource_st: + +cdef class anon_struct26: """ Attributes ---------- - {{if 'CUdevWorkqueueResource_st.reserved' in found_struct}} - reserved : bytes - Reserved for future use - {{endif}} + + numDevices : unsigned int + + Methods ------- getPtr() Get memory address of class instance """ - cdef cydriver.CUdevWorkqueueResource_st _pvt_val - cdef cydriver.CUdevWorkqueueResource_st* _pvt_ptr -{{endif}} -{{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st' in found_struct}} + cdef cydriver.CUlogicalEndpointProp_struct* _pvt_ptr -cdef class CU_DEV_SM_RESOURCE_GROUP_PARAMS_st: +cdef class CUlogicalEndpointProp_struct: """ + Properties of a logical endpoint construction + Attributes ---------- - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st.smCount' in found_struct}} - smCount : unsigned int - The amount of SMs available in this resource. - {{endif}} - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st.coscheduledSmCount' in found_struct}} - coscheduledSmCount : unsigned int - The amount of co-scheduled SMs grouped together for locality - purposes. - {{endif}} - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st.preferredCoscheduledSmCount' in found_struct}} - preferredCoscheduledSmCount : unsigned int - When possible, combine co-scheduled groups together into larger - groups of this size. - {{endif}} - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st.flags' in found_struct}} - flags : unsigned int - The flags set on this SM resource group. For possible values see - CUdevSmResourceGroup_flags. - {{endif}} - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st.reserved' in found_struct}} + + type : CUlogicalEndpointType + Type of the logical endpoint defined in CUlogicalEndpointType + + + unicast : anon_struct25 + + + + multicast : anon_struct26 + + + + size : unsigned long long + Size of the logical endpoint + + + ipcHandleTypes : unsigned int + A bitmask of IPC handle types defined in + CUlogicalEndpointIpcHandleType + + + flags : unsigned int + A bitmask of flags defined in CUlogicalEndpointFlag + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUlogicalEndpointProp_struct* _val_ptr + cdef cydriver.CUlogicalEndpointProp_struct* _pvt_ptr + + cdef anon_struct25 _unicast + + + cdef anon_struct26 _multicast + + +cdef class CUdevSmResource_st: + """ + Attributes + ---------- + + smCount : unsigned int + The amount of streaming multiprocessors available in this resource. + + + minSmPartitionSize : unsigned int + The minimum number of streaming multiprocessors required to + partition this resource. + + + 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 will be a multiple of this value, unless the backfill flag + is set. + + + flags : unsigned int + The flags set on this SM resource. For possible values see + CUdevSmResourceGroup_flags. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUdevSmResource_st _pvt_val + cdef cydriver.CUdevSmResource_st* _pvt_ptr + +cdef class CUdevWorkqueueConfigResource_st: + """ + Attributes + ---------- + + device : CUdevice + The device on which the workqueue resources are available + + + wqConcurrencyLimit : unsigned int + The expected maximum number of concurrent stream-ordered workloads + + + sharingScope : CUdevWorkqueueConfigScope + The sharing scope for the workqueue resources + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUdevWorkqueueConfigResource_st _pvt_val + cdef cydriver.CUdevWorkqueueConfigResource_st* _pvt_ptr + + cdef CUdevice _device + + +cdef class CUdevWorkqueueResource_st: + """ + Attributes + ---------- + + reserved : bytes + Reserved for future use + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUdevWorkqueueResource_st _pvt_val + cdef cydriver.CUdevWorkqueueResource_st* _pvt_ptr + +cdef class CU_DEV_SM_RESOURCE_GROUP_PARAMS_st: + """ + Attributes + ---------- + + smCount : unsigned int + The amount of SMs available in this resource. + + + coscheduledSmCount : unsigned int + The amount of co-scheduled SMs grouped together for locality + purposes. + + + preferredCoscheduledSmCount : unsigned int + When possible, combine co-scheduled groups together into larger + groups of this size. + + + flags : unsigned int + The flags set on this SM resource group. For possible values see + CUdevSmResourceGroup_flags. + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -5542,43 +5298,41 @@ cdef class CU_DEV_SM_RESOURCE_GROUP_PARAMS_st: """ cdef cydriver.CU_DEV_SM_RESOURCE_GROUP_PARAMS_st _pvt_val cdef cydriver.CU_DEV_SM_RESOURCE_GROUP_PARAMS_st* _pvt_ptr -{{endif}} -{{if 'CUdevResource_st' in found_struct}} cdef class CUdevResource_st: """ Attributes ---------- - {{if 'CUdevResource_st.type' in found_struct}} + type : CUdevResourceType Type of resource, dictates which union field was last set - {{endif}} - {{if 'CUdevResource_st._internal_padding' in found_struct}} + + _internal_padding : bytes - {{endif}} - {{if 'CUdevResource_st.sm' in found_struct}} + + sm : CUdevSmResource Resource corresponding to CU_DEV_RESOURCE_TYPE_SM `typename`. - {{endif}} - {{if 'CUdevResource_st.wqConfig' in found_struct}} + + wqConfig : CUdevWorkqueueConfigResource Resource corresponding to CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG `typename`. - {{endif}} - {{if 'CUdevResource_st.wq' in found_struct}} + + wq : CUdevWorkqueueResource Resource corresponding to CU_DEV_RESOURCE_TYPE_WORKQUEUE `typename`. - {{endif}} - {{if 'CUdevResource_st._oversize' in found_struct}} + + _oversize : bytes - {{endif}} - {{if 'CUdevResource_st.nextResource' in found_struct}} + + nextResource : CUdevResource_st - {{endif}} + Methods ------- @@ -5587,34 +5341,32 @@ cdef class CUdevResource_st: """ cdef cydriver.CUdevResource_st* _val_ptr cdef cydriver.CUdevResource_st* _pvt_ptr - {{if 'CUdevResource_st.sm' in found_struct}} + cdef CUdevSmResource _sm - {{endif}} - {{if 'CUdevResource_st.wqConfig' in found_struct}} + + cdef CUdevWorkqueueConfigResource _wqConfig - {{endif}} - {{if 'CUdevResource_st.wq' in found_struct}} + + cdef CUdevWorkqueueResource _wq - {{endif}} - {{if 'CUdevResource_st.nextResource' in found_struct}} + + cdef size_t _nextResource_length cdef cydriver.CUdevResource_st* _nextResource - {{endif}} -{{endif}} -{{if True}} -cdef class anon_union16: + +cdef class anon_union17: """ Attributes ---------- - {{if True}} + pArray : list[CUarray] - {{endif}} - {{if True}} + + pPitch : list[Any] - {{endif}} + Methods ------- @@ -5622,8 +5374,6 @@ cdef class anon_union16: Get memory address of class instance """ cdef cydriver.CUeglFrame_st* _pvt_ptr -{{endif}} -{{if True}} cdef class CUeglFrame_st: """ @@ -5633,46 +5383,46 @@ cdef class CUeglFrame_st: Attributes ---------- - {{if True}} - frame : anon_union16 - {{endif}} - {{if True}} + frame : anon_union17 + + + width : unsigned int Width of first plane - {{endif}} - {{if True}} + + height : unsigned int Height of first plane - {{endif}} - {{if True}} + + depth : unsigned int Depth of first plane - {{endif}} - {{if True}} + + pitch : unsigned int Pitch of first plane - {{endif}} - {{if True}} + + planeCount : unsigned int Number of planes - {{endif}} - {{if True}} + + numChannels : unsigned int Number of channels for the plane - {{endif}} - {{if True}} + + frameType : CUeglFrameType Array or Pitch - {{endif}} - {{if True}} + + eglColorFormat : CUeglColorFormat CUDA EGL Color Format - {{endif}} - {{if True}} + + cuFormat : CUarray_format CUDA Array Format - {{endif}} + Methods ------- @@ -5681,11 +5431,9 @@ cdef class CUeglFrame_st: """ cdef cydriver.CUeglFrame_st* _val_ptr cdef cydriver.CUeglFrame_st* _pvt_ptr - {{if True}} - cdef anon_union16 _frame - {{endif}} -{{endif}} -{{if 'CUdeviceptr' in found_types}} + + cdef anon_union17 _frame + cdef class CUdeviceptr: """ @@ -5700,8 +5448,6 @@ cdef class CUdeviceptr: """ cdef cydriver.CUdeviceptr _pvt_val cdef cydriver.CUdeviceptr* _pvt_ptr -{{endif}} -{{if 'CUdevice' in found_types}} cdef class CUdevice: """ @@ -5716,8 +5462,6 @@ cdef class CUdevice: """ cdef cydriver.CUdevice _pvt_val cdef cydriver.CUdevice* _pvt_ptr -{{endif}} -{{if 'CUtexObject' in found_types}} cdef class CUtexObject: """ @@ -5732,8 +5476,6 @@ cdef class CUtexObject: """ cdef cydriver.CUtexObject _pvt_val cdef cydriver.CUtexObject* _pvt_ptr -{{endif}} -{{if 'CUsurfObject' in found_types}} cdef class CUsurfObject: """ @@ -5748,8 +5490,6 @@ cdef class CUsurfObject: """ cdef cydriver.CUsurfObject _pvt_val cdef cydriver.CUsurfObject* _pvt_ptr -{{endif}} -{{if 'CUgraphConditionalHandle' in found_types}} cdef class CUgraphConditionalHandle: """ @@ -5762,17 +5502,15 @@ cdef class CUgraphConditionalHandle: """ cdef cydriver.CUgraphConditionalHandle _pvt_val cdef cydriver.CUgraphConditionalHandle* _pvt_ptr -{{endif}} -{{if 'CUuuid' in found_types}} cdef class CUuuid(CUuuid_st): """ Attributes ---------- - {{if 'CUuuid_st.bytes' in found_struct}} + bytes : bytes < CUDA definition of UUID - {{endif}} + Methods ------- @@ -5780,8 +5518,6 @@ cdef class CUuuid(CUuuid_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUmemFabricHandle_v1' in found_types}} cdef class CUmemFabricHandle_v1(CUmemFabricHandle_st): """ @@ -5792,10 +5528,10 @@ cdef class CUmemFabricHandle_v1(CUmemFabricHandle_st): Attributes ---------- - {{if 'CUmemFabricHandle_st.data' in found_struct}} + data : bytes - {{endif}} + Methods ------- @@ -5803,8 +5539,6 @@ cdef class CUmemFabricHandle_v1(CUmemFabricHandle_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUmemFabricHandle' in found_types}} cdef class CUmemFabricHandle(CUmemFabricHandle_v1): """ @@ -5815,10 +5549,10 @@ cdef class CUmemFabricHandle(CUmemFabricHandle_v1): Attributes ---------- - {{if 'CUmemFabricHandle_st.data' in found_struct}} + data : bytes - {{endif}} + Methods ------- @@ -5826,8 +5560,6 @@ cdef class CUmemFabricHandle(CUmemFabricHandle_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUipcEventHandle_v1' in found_types}} cdef class CUipcEventHandle_v1(CUipcEventHandle_st): """ @@ -5835,10 +5567,10 @@ cdef class CUipcEventHandle_v1(CUipcEventHandle_st): Attributes ---------- - {{if 'CUipcEventHandle_st.reserved' in found_struct}} + reserved : bytes - {{endif}} + Methods ------- @@ -5846,8 +5578,6 @@ cdef class CUipcEventHandle_v1(CUipcEventHandle_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUipcEventHandle' in found_types}} cdef class CUipcEventHandle(CUipcEventHandle_v1): """ @@ -5855,10 +5585,10 @@ cdef class CUipcEventHandle(CUipcEventHandle_v1): Attributes ---------- - {{if 'CUipcEventHandle_st.reserved' in found_struct}} + reserved : bytes - {{endif}} + Methods ------- @@ -5866,8 +5596,6 @@ cdef class CUipcEventHandle(CUipcEventHandle_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUipcMemHandle_v1' in found_types}} cdef class CUipcMemHandle_v1(CUipcMemHandle_st): """ @@ -5875,10 +5603,10 @@ cdef class CUipcMemHandle_v1(CUipcMemHandle_st): Attributes ---------- - {{if 'CUipcMemHandle_st.reserved' in found_struct}} + reserved : bytes - {{endif}} + Methods ------- @@ -5886,8 +5614,6 @@ cdef class CUipcMemHandle_v1(CUipcMemHandle_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUipcMemHandle' in found_types}} cdef class CUipcMemHandle(CUipcMemHandle_v1): """ @@ -5895,10 +5621,10 @@ cdef class CUipcMemHandle(CUipcMemHandle_v1): Attributes ---------- - {{if 'CUipcMemHandle_st.reserved' in found_struct}} + reserved : bytes - {{endif}} + Methods ------- @@ -5906,8 +5632,6 @@ cdef class CUipcMemHandle(CUipcMemHandle_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUstreamBatchMemOpParams_v1' in found_types}} cdef class CUstreamBatchMemOpParams_v1(CUstreamBatchMemOpParams_union): """ @@ -5915,37 +5639,37 @@ cdef class CUstreamBatchMemOpParams_v1(CUstreamBatchMemOpParams_union): Attributes ---------- - {{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.atomicReduction' in found_struct}} + + atomicReduction : CUstreamMemOpAtomicReductionParams_st - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.pad' in found_struct}} + + pad : list[cuuint64_t] - {{endif}} + Methods ------- @@ -5953,8 +5677,6 @@ cdef class CUstreamBatchMemOpParams_v1(CUstreamBatchMemOpParams_union): Get memory address of class instance """ pass -{{endif}} -{{if 'CUstreamBatchMemOpParams' in found_types}} cdef class CUstreamBatchMemOpParams(CUstreamBatchMemOpParams_v1): """ @@ -5962,37 +5684,37 @@ cdef class CUstreamBatchMemOpParams(CUstreamBatchMemOpParams_v1): Attributes ---------- - {{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.atomicReduction' in found_struct}} + + atomicReduction : CUstreamMemOpAtomicReductionParams_st - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.pad' in found_struct}} + + pad : list[cuuint64_t] - {{endif}} + Methods ------- @@ -6000,8 +5722,6 @@ cdef class CUstreamBatchMemOpParams(CUstreamBatchMemOpParams_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1' in found_types}} cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v1(CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st): """ @@ -6010,22 +5730,22 @@ cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v1(CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st) Attributes ---------- - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.ctx' in found_struct}} + ctx : CUcontext - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.count' in found_struct}} + + count : unsigned int - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.paramArray' in found_struct}} + + paramArray : CUstreamBatchMemOpParams - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.flags' in found_struct}} + + flags : unsigned int - {{endif}} + Methods ------- @@ -6033,8 +5753,6 @@ cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v1(CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st) Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS' in found_types}} cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS(CUDA_BATCH_MEM_OP_NODE_PARAMS_v1): """ @@ -6043,22 +5761,22 @@ cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS(CUDA_BATCH_MEM_OP_NODE_PARAMS_v1): Attributes ---------- - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.ctx' in found_struct}} + ctx : CUcontext - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.count' in found_struct}} + + count : unsigned int - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.paramArray' in found_struct}} + + paramArray : CUstreamBatchMemOpParams - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.flags' in found_struct}} + + flags : unsigned int - {{endif}} + Methods ------- @@ -6066,8 +5784,6 @@ cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS(CUDA_BATCH_MEM_OP_NODE_PARAMS_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2' in found_types}} cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v2(CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st): """ @@ -6075,22 +5791,22 @@ cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v2(CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st) Attributes ---------- - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st.ctx' in found_struct}} + ctx : CUcontext Context to use for the operations. - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st.count' in found_struct}} + + count : unsigned int Number of operations in paramArray. - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st.paramArray' in found_struct}} + + paramArray : CUstreamBatchMemOpParams Array of batch memory operations. - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st.flags' in found_struct}} + + flags : unsigned int Flags to control the node. - {{endif}} + Methods ------- @@ -6098,8 +5814,6 @@ cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v2(CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st) Get memory address of class instance """ pass -{{endif}} -{{if 'CUasyncNotificationInfo' in found_types}} cdef class CUasyncNotificationInfo(CUasyncNotificationInfo_st): """ @@ -6107,15 +5821,15 @@ cdef class CUasyncNotificationInfo(CUasyncNotificationInfo_st): Attributes ---------- - {{if 'CUasyncNotificationInfo_st.type' in found_struct}} + type : CUasyncNotificationType The type of notification being sent - {{endif}} - {{if 'CUasyncNotificationInfo_st.info' in found_struct}} + + info : anon_union2 Information about the notification. `typename` must be checked in order to interpret this field. - {{endif}} + Methods ------- @@ -6123,8 +5837,6 @@ cdef class CUasyncNotificationInfo(CUasyncNotificationInfo_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUdevprop_v1' in found_types}} cdef class CUdevprop_v1(CUdevprop_st): """ @@ -6132,46 +5844,46 @@ cdef class CUdevprop_v1(CUdevprop_st): Attributes ---------- - {{if 'CUdevprop_st.maxThreadsPerBlock' in found_struct}} + maxThreadsPerBlock : int Maximum number of threads per block - {{endif}} - {{if 'CUdevprop_st.maxThreadsDim' in found_struct}} + + maxThreadsDim : list[int] Maximum size of each dimension of a block - {{endif}} - {{if 'CUdevprop_st.maxGridSize' in found_struct}} + + maxGridSize : list[int] Maximum size of each dimension of a grid - {{endif}} - {{if 'CUdevprop_st.sharedMemPerBlock' in found_struct}} + + sharedMemPerBlock : int Shared memory available per block in bytes - {{endif}} - {{if 'CUdevprop_st.totalConstantMemory' in found_struct}} + + totalConstantMemory : int Constant memory available on device in bytes - {{endif}} - {{if 'CUdevprop_st.SIMDWidth' in found_struct}} + + SIMDWidth : int Warp size in threads - {{endif}} - {{if 'CUdevprop_st.memPitch' in found_struct}} + + memPitch : int Maximum pitch in bytes allowed by memory copies - {{endif}} - {{if 'CUdevprop_st.regsPerBlock' in found_struct}} + + regsPerBlock : int 32-bit registers available per block - {{endif}} - {{if 'CUdevprop_st.clockRate' in found_struct}} + + clockRate : int Clock frequency in kilohertz - {{endif}} - {{if 'CUdevprop_st.textureAlign' in found_struct}} + + textureAlign : int Alignment requirement for textures - {{endif}} + Methods ------- @@ -6179,8 +5891,6 @@ cdef class CUdevprop_v1(CUdevprop_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUdevprop' in found_types}} cdef class CUdevprop(CUdevprop_v1): """ @@ -6188,46 +5898,46 @@ cdef class CUdevprop(CUdevprop_v1): Attributes ---------- - {{if 'CUdevprop_st.maxThreadsPerBlock' in found_struct}} + maxThreadsPerBlock : int Maximum number of threads per block - {{endif}} - {{if 'CUdevprop_st.maxThreadsDim' in found_struct}} + + maxThreadsDim : list[int] Maximum size of each dimension of a block - {{endif}} - {{if 'CUdevprop_st.maxGridSize' in found_struct}} + + maxGridSize : list[int] Maximum size of each dimension of a grid - {{endif}} - {{if 'CUdevprop_st.sharedMemPerBlock' in found_struct}} + + sharedMemPerBlock : int Shared memory available per block in bytes - {{endif}} - {{if 'CUdevprop_st.totalConstantMemory' in found_struct}} + + totalConstantMemory : int Constant memory available on device in bytes - {{endif}} - {{if 'CUdevprop_st.SIMDWidth' in found_struct}} + + SIMDWidth : int Warp size in threads - {{endif}} - {{if 'CUdevprop_st.memPitch' in found_struct}} + + memPitch : int Maximum pitch in bytes allowed by memory copies - {{endif}} - {{if 'CUdevprop_st.regsPerBlock' in found_struct}} + + regsPerBlock : int 32-bit registers available per block - {{endif}} - {{if 'CUdevprop_st.clockRate' in found_struct}} + + clockRate : int Clock frequency in kilohertz - {{endif}} - {{if 'CUdevprop_st.textureAlign' in found_struct}} + + textureAlign : int Alignment requirement for textures - {{endif}} + Methods ------- @@ -6235,8 +5945,6 @@ cdef class CUdevprop(CUdevprop_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUaccessPolicyWindow_v1' in found_types}} cdef class CUaccessPolicyWindow_v1(CUaccessPolicyWindow_st): """ @@ -6253,29 +5961,29 @@ cdef class CUaccessPolicyWindow_v1(CUaccessPolicyWindow_st): Attributes ---------- - {{if 'CUaccessPolicyWindow_st.base_ptr' in found_struct}} + base_ptr : Any Starting address of the access policy window. CUDA driver may align it. - {{endif}} - {{if 'CUaccessPolicyWindow_st.num_bytes' in found_struct}} + + num_bytes : size_t Size in bytes of the window policy. CUDA driver may restrict the maximum size and alignment. - {{endif}} - {{if 'CUaccessPolicyWindow_st.hitRatio' in found_struct}} + + hitRatio : float hitRatio specifies percentage of lines assigned hitProp, rest are assigned missProp. - {{endif}} - {{if 'CUaccessPolicyWindow_st.hitProp' in found_struct}} + + hitProp : CUaccessProperty CUaccessProperty set for hit. - {{endif}} - {{if 'CUaccessPolicyWindow_st.missProp' in found_struct}} + + missProp : CUaccessProperty CUaccessProperty set for miss. Must be either NORMAL or STREAMING - {{endif}} + Methods ------- @@ -6283,8 +5991,6 @@ cdef class CUaccessPolicyWindow_v1(CUaccessPolicyWindow_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUaccessPolicyWindow' in found_types}} cdef class CUaccessPolicyWindow(CUaccessPolicyWindow_v1): """ @@ -6301,29 +6007,29 @@ cdef class CUaccessPolicyWindow(CUaccessPolicyWindow_v1): Attributes ---------- - {{if 'CUaccessPolicyWindow_st.base_ptr' in found_struct}} + base_ptr : Any Starting address of the access policy window. CUDA driver may align it. - {{endif}} - {{if 'CUaccessPolicyWindow_st.num_bytes' in found_struct}} + + num_bytes : size_t Size in bytes of the window policy. CUDA driver may restrict the maximum size and alignment. - {{endif}} - {{if 'CUaccessPolicyWindow_st.hitRatio' in found_struct}} + + hitRatio : float hitRatio specifies percentage of lines assigned hitProp, rest are assigned missProp. - {{endif}} - {{if 'CUaccessPolicyWindow_st.hitProp' in found_struct}} + + hitProp : CUaccessProperty CUaccessProperty set for hit. - {{endif}} - {{if 'CUaccessPolicyWindow_st.missProp' in found_struct}} + + missProp : CUaccessProperty CUaccessProperty set for miss. Must be either NORMAL or STREAMING - {{endif}} + Methods ------- @@ -6331,8 +6037,6 @@ cdef class CUaccessPolicyWindow(CUaccessPolicyWindow_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_KERNEL_NODE_PARAMS_v1' in found_types}} cdef class CUDA_KERNEL_NODE_PARAMS_v1(CUDA_KERNEL_NODE_PARAMS_st): """ @@ -6340,46 +6044,46 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v1(CUDA_KERNEL_NODE_PARAMS_st): Attributes ---------- - {{if 'CUDA_KERNEL_NODE_PARAMS_st.func' in found_struct}} + func : CUfunction Kernel to launch - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.gridDimX' in found_struct}} + + gridDimX : unsigned int Width of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.gridDimY' in found_struct}} + + gridDimY : unsigned int Height of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.gridDimZ' in found_struct}} + + gridDimZ : unsigned int Depth of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.blockDimX' in found_struct}} + + blockDimX : unsigned int X dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.blockDimY' in found_struct}} + + blockDimY : unsigned int Y dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.blockDimZ' in found_struct}} + + blockDimZ : unsigned int Z dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.sharedMemBytes' in found_struct}} + + sharedMemBytes : unsigned int Dynamic shared-memory size per thread block in bytes - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.kernelParams' in found_struct}} + + kernelParams : Any Array of pointers to kernel parameters - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.extra' in found_struct}} + + extra : Any Extra options - {{endif}} + Methods ------- @@ -6387,8 +6091,6 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v1(CUDA_KERNEL_NODE_PARAMS_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_KERNEL_NODE_PARAMS_v2' in found_types}} cdef class CUDA_KERNEL_NODE_PARAMS_v2(CUDA_KERNEL_NODE_PARAMS_v2_st): """ @@ -6396,56 +6098,56 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v2(CUDA_KERNEL_NODE_PARAMS_v2_st): Attributes ---------- - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.func' in found_struct}} + func : CUfunction Kernel to launch - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.gridDimX' in found_struct}} + + gridDimX : unsigned int Width of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.gridDimY' in found_struct}} + + gridDimY : unsigned int Height of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.gridDimZ' in found_struct}} + + gridDimZ : unsigned int Depth of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.blockDimX' in found_struct}} + + blockDimX : unsigned int X dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.blockDimY' in found_struct}} + + blockDimY : unsigned int Y dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.blockDimZ' in found_struct}} + + blockDimZ : unsigned int Z dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.sharedMemBytes' in found_struct}} + + sharedMemBytes : unsigned int Dynamic shared-memory size per thread block in bytes - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.kernelParams' in found_struct}} + + kernelParams : Any Array of pointers to kernel parameters - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.extra' in found_struct}} + + extra : Any Extra options - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.kern' in found_struct}} + + kern : CUkernel Kernel to launch, will only be referenced if func is NULL - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.ctx' in found_struct}} + + ctx : CUcontext Context for the kernel task to run in. The value NULL will indicate the current context should be used by the api. This field is ignored if func is set. - {{endif}} + Methods ------- @@ -6453,8 +6155,6 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v2(CUDA_KERNEL_NODE_PARAMS_v2_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_KERNEL_NODE_PARAMS' in found_types}} cdef class CUDA_KERNEL_NODE_PARAMS(CUDA_KERNEL_NODE_PARAMS_v2): """ @@ -6462,56 +6162,56 @@ cdef class CUDA_KERNEL_NODE_PARAMS(CUDA_KERNEL_NODE_PARAMS_v2): Attributes ---------- - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.func' in found_struct}} + func : CUfunction Kernel to launch - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.gridDimX' in found_struct}} + + gridDimX : unsigned int Width of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.gridDimY' in found_struct}} + + gridDimY : unsigned int Height of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.gridDimZ' in found_struct}} + + gridDimZ : unsigned int Depth of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.blockDimX' in found_struct}} + + blockDimX : unsigned int X dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.blockDimY' in found_struct}} + + blockDimY : unsigned int Y dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.blockDimZ' in found_struct}} + + blockDimZ : unsigned int Z dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.sharedMemBytes' in found_struct}} + + sharedMemBytes : unsigned int Dynamic shared-memory size per thread block in bytes - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.kernelParams' in found_struct}} + + kernelParams : Any Array of pointers to kernel parameters - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.extra' in found_struct}} + + extra : Any Extra options - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.kern' in found_struct}} + + kern : CUkernel Kernel to launch, will only be referenced if func is NULL - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.ctx' in found_struct}} + + ctx : CUcontext Context for the kernel task to run in. The value NULL will indicate the current context should be used by the api. This field is ignored if func is set. - {{endif}} + Methods ------- @@ -6519,8 +6219,6 @@ cdef class CUDA_KERNEL_NODE_PARAMS(CUDA_KERNEL_NODE_PARAMS_v2): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_KERNEL_NODE_PARAMS_v3' in found_types}} cdef class CUDA_KERNEL_NODE_PARAMS_v3(CUDA_KERNEL_NODE_PARAMS_v3_st): """ @@ -6528,56 +6226,56 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v3(CUDA_KERNEL_NODE_PARAMS_v3_st): Attributes ---------- - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.func' in found_struct}} + func : CUfunction Kernel to launch - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.gridDimX' in found_struct}} + + gridDimX : unsigned int Width of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.gridDimY' in found_struct}} + + gridDimY : unsigned int Height of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.gridDimZ' in found_struct}} + + gridDimZ : unsigned int Depth of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.blockDimX' in found_struct}} + + blockDimX : unsigned int X dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.blockDimY' in found_struct}} + + blockDimY : unsigned int Y dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.blockDimZ' in found_struct}} + + blockDimZ : unsigned int Z dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.sharedMemBytes' in found_struct}} + + sharedMemBytes : unsigned int Dynamic shared-memory size per thread block in bytes - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.kernelParams' in found_struct}} + + kernelParams : Any Array of pointers to kernel parameters - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.extra' in found_struct}} + + extra : Any Extra options - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.kern' in found_struct}} + + kern : CUkernel Kernel to launch, will only be referenced if func is NULL - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.ctx' in found_struct}} + + ctx : CUcontext Context for the kernel task to run in. The value NULL will indicate the current context should be used by the api. This field is ignored if func is set. - {{endif}} + Methods ------- @@ -6585,8 +6283,6 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v3(CUDA_KERNEL_NODE_PARAMS_v3_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_MEMSET_NODE_PARAMS_v1' in found_types}} cdef class CUDA_MEMSET_NODE_PARAMS_v1(CUDA_MEMSET_NODE_PARAMS_st): """ @@ -6594,30 +6290,30 @@ cdef class CUDA_MEMSET_NODE_PARAMS_v1(CUDA_MEMSET_NODE_PARAMS_st): Attributes ---------- - {{if 'CUDA_MEMSET_NODE_PARAMS_st.dst' in found_struct}} + dst : CUdeviceptr Destination device pointer - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.pitch' in found_struct}} + + pitch : size_t Pitch of destination device pointer. Unused if height is 1 - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.value' in found_struct}} + + value : unsigned int Value to be set - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.elementSize' in found_struct}} + + elementSize : unsigned int Size of each element in bytes. Must be 1, 2, or 4. - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.width' in found_struct}} + + width : size_t Width of the row in elements - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.height' in found_struct}} + + height : size_t Number of rows - {{endif}} + Methods ------- @@ -6625,8 +6321,6 @@ cdef class CUDA_MEMSET_NODE_PARAMS_v1(CUDA_MEMSET_NODE_PARAMS_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_MEMSET_NODE_PARAMS' in found_types}} cdef class CUDA_MEMSET_NODE_PARAMS(CUDA_MEMSET_NODE_PARAMS_v1): """ @@ -6634,30 +6328,30 @@ cdef class CUDA_MEMSET_NODE_PARAMS(CUDA_MEMSET_NODE_PARAMS_v1): Attributes ---------- - {{if 'CUDA_MEMSET_NODE_PARAMS_st.dst' in found_struct}} + dst : CUdeviceptr Destination device pointer - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.pitch' in found_struct}} + + pitch : size_t Pitch of destination device pointer. Unused if height is 1 - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.value' in found_struct}} + + value : unsigned int Value to be set - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.elementSize' in found_struct}} + + elementSize : unsigned int Size of each element in bytes. Must be 1, 2, or 4. - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.width' in found_struct}} + + width : size_t Width of the row in elements - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.height' in found_struct}} + + height : size_t Number of rows - {{endif}} + Methods ------- @@ -6665,8 +6359,6 @@ cdef class CUDA_MEMSET_NODE_PARAMS(CUDA_MEMSET_NODE_PARAMS_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_MEMSET_NODE_PARAMS_v2' in found_types}} cdef class CUDA_MEMSET_NODE_PARAMS_v2(CUDA_MEMSET_NODE_PARAMS_v2_st): """ @@ -6674,34 +6366,34 @@ cdef class CUDA_MEMSET_NODE_PARAMS_v2(CUDA_MEMSET_NODE_PARAMS_v2_st): Attributes ---------- - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.dst' in found_struct}} + dst : CUdeviceptr Destination device pointer - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.pitch' in found_struct}} + + pitch : size_t Pitch of destination device pointer. Unused if height is 1 - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.value' in found_struct}} + + value : unsigned int Value to be set - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.elementSize' in found_struct}} + + elementSize : unsigned int Size of each element in bytes. Must be 1, 2, or 4. - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.width' in found_struct}} + + width : size_t Width of the row in elements - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.height' in found_struct}} + + height : size_t Number of rows - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.ctx' in found_struct}} + + ctx : CUcontext Context on which to run the node - {{endif}} + Methods ------- @@ -6709,8 +6401,6 @@ cdef class CUDA_MEMSET_NODE_PARAMS_v2(CUDA_MEMSET_NODE_PARAMS_v2_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_HOST_NODE_PARAMS_v1' in found_types}} cdef class CUDA_HOST_NODE_PARAMS_v1(CUDA_HOST_NODE_PARAMS_st): """ @@ -6718,14 +6408,14 @@ cdef class CUDA_HOST_NODE_PARAMS_v1(CUDA_HOST_NODE_PARAMS_st): Attributes ---------- - {{if 'CUDA_HOST_NODE_PARAMS_st.fn' in found_struct}} + fn : CUhostFn The function to call when the node executes - {{endif}} - {{if 'CUDA_HOST_NODE_PARAMS_st.userData' in found_struct}} + + userData : Any Argument to pass to the function - {{endif}} + Methods ------- @@ -6733,8 +6423,6 @@ cdef class CUDA_HOST_NODE_PARAMS_v1(CUDA_HOST_NODE_PARAMS_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_HOST_NODE_PARAMS' in found_types}} cdef class CUDA_HOST_NODE_PARAMS(CUDA_HOST_NODE_PARAMS_v1): """ @@ -6742,14 +6430,14 @@ cdef class CUDA_HOST_NODE_PARAMS(CUDA_HOST_NODE_PARAMS_v1): Attributes ---------- - {{if 'CUDA_HOST_NODE_PARAMS_st.fn' in found_struct}} + fn : CUhostFn The function to call when the node executes - {{endif}} - {{if 'CUDA_HOST_NODE_PARAMS_st.userData' in found_struct}} + + userData : Any Argument to pass to the function - {{endif}} + Methods ------- @@ -6757,8 +6445,6 @@ cdef class CUDA_HOST_NODE_PARAMS(CUDA_HOST_NODE_PARAMS_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_HOST_NODE_PARAMS_v2' in found_types}} cdef class CUDA_HOST_NODE_PARAMS_v2(CUDA_HOST_NODE_PARAMS_v2_st): """ @@ -6766,18 +6452,18 @@ cdef class CUDA_HOST_NODE_PARAMS_v2(CUDA_HOST_NODE_PARAMS_v2_st): Attributes ---------- - {{if 'CUDA_HOST_NODE_PARAMS_v2_st.fn' in found_struct}} + fn : CUhostFn The function to call when the node executes - {{endif}} - {{if 'CUDA_HOST_NODE_PARAMS_v2_st.userData' in found_struct}} + + userData : Any Argument to pass to the function - {{endif}} - {{if 'CUDA_HOST_NODE_PARAMS_v2_st.syncMode' in found_struct}} + + syncMode : unsigned int The sync mode to use for the host task - {{endif}} + Methods ------- @@ -6785,8 +6471,6 @@ cdef class CUDA_HOST_NODE_PARAMS_v2(CUDA_HOST_NODE_PARAMS_v2_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUgraphEdgeData' in found_types}} cdef class CUgraphEdgeData(CUgraphEdgeData_st): """ @@ -6797,7 +6481,7 @@ cdef class CUgraphEdgeData(CUgraphEdgeData_st): Attributes ---------- - {{if 'CUgraphEdgeData_st.from_port' in found_struct}} + from_port : bytes This indicates when the dependency is triggered from the upstream node on the edge. The meaning is specfic to the node type. A value @@ -6808,8 +6492,8 @@ cdef class CUgraphEdgeData(CUgraphEdgeData_st): CU_GRAPH_KERNEL_NODE_PORT_DEFAULT, CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC, or CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER. - {{endif}} - {{if 'CUgraphEdgeData_st.to_port' in found_struct}} + + to_port : bytes This indicates what portion of the downstream node is dependent on the upstream node or portion thereof (indicated by `from_port`). @@ -6817,18 +6501,18 @@ cdef class CUgraphEdgeData(CUgraphEdgeData_st): means the entirety of the downstream node is dependent on the upstream work. Currently no node types define non-zero ports. Accordingly, this field must be set to zero. - {{endif}} - {{if 'CUgraphEdgeData_st.type' in found_struct}} + + type : bytes This should be populated with a value from CUgraphDependencyType. (It is typed as char due to compiler-specific layout of bitfields.) See CUgraphDependencyType. - {{endif}} - {{if 'CUgraphEdgeData_st.reserved' in found_struct}} + + reserved : bytes These bytes are unused and must be zeroed. This ensures compatibility if additional fields are added in the future. - {{endif}} + Methods ------- @@ -6836,8 +6520,6 @@ cdef class CUgraphEdgeData(CUgraphEdgeData_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_GRAPH_INSTANTIATE_PARAMS' in found_types}} cdef class CUDA_GRAPH_INSTANTIATE_PARAMS(CUDA_GRAPH_INSTANTIATE_PARAMS_st): """ @@ -6845,22 +6527,22 @@ cdef class CUDA_GRAPH_INSTANTIATE_PARAMS(CUDA_GRAPH_INSTANTIATE_PARAMS_st): Attributes ---------- - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.flags' in found_struct}} + flags : cuuint64_t Instantiation flags - {{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.hUploadStream' in found_struct}} + + hUploadStream : CUstream Upload stream - {{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.hErrNode_out' in found_struct}} + + hErrNode_out : CUgraphNode The node which caused instantiation to fail, if any - {{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.result_out' in found_struct}} + + result_out : CUgraphInstantiateResult Whether instantiation was successful. If it failed, the reason why - {{endif}} + Methods ------- @@ -6868,8 +6550,6 @@ cdef class CUDA_GRAPH_INSTANTIATE_PARAMS(CUDA_GRAPH_INSTANTIATE_PARAMS_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUlaunchMemSyncDomainMap' in found_types}} cdef class CUlaunchMemSyncDomainMap(CUlaunchMemSyncDomainMap_st): """ @@ -6883,14 +6563,14 @@ cdef class CUlaunchMemSyncDomainMap(CUlaunchMemSyncDomainMap_st): Attributes ---------- - {{if 'CUlaunchMemSyncDomainMap_st.default_' in found_struct}} + default_ : bytes The default domain ID to use for designated kernels - {{endif}} - {{if 'CUlaunchMemSyncDomainMap_st.remote' in found_struct}} + + remote : bytes The remote domain ID to use for designated kernels - {{endif}} + Methods ------- @@ -6898,8 +6578,6 @@ cdef class CUlaunchMemSyncDomainMap(CUlaunchMemSyncDomainMap_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUlaunchAttributeValue' in found_types}} cdef class CUlaunchAttributeValue(CUlaunchAttributeValue_union): """ @@ -6907,26 +6585,26 @@ cdef class CUlaunchAttributeValue(CUlaunchAttributeValue_union): Attributes ---------- - {{if 'CUlaunchAttributeValue_union.pad' in found_struct}} + pad : bytes - {{endif}} - {{if 'CUlaunchAttributeValue_union.accessPolicyWindow' in found_struct}} + + accessPolicyWindow : CUaccessPolicyWindow Value of launch attribute CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW. - {{endif}} - {{if 'CUlaunchAttributeValue_union.cooperative' in found_struct}} + + cooperative : int Value of launch attribute CU_LAUNCH_ATTRIBUTE_COOPERATIVE. Nonzero indicates a cooperative kernel (see cuLaunchCooperativeKernel). - {{endif}} - {{if 'CUlaunchAttributeValue_union.syncPolicy' in found_struct}} + + syncPolicy : CUsynchronizationPolicy Value of launch attribute - CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY. - ::CUsynchronizationPolicy for work queued up in this stream - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterDim' in found_struct}} + CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY. CUsynchronizationPolicy + for work queued up in this stream + + clusterDim : anon_struct1 Value of launch attribute CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION that represents the desired cluster dimensions for the kernel. @@ -6935,19 +6613,19 @@ cdef class CUlaunchAttributeValue(CUlaunchAttributeValue_union): - `y` - The Y dimension of the cluster, in blocks. Must be a divisor of the grid Y dimension. - `z` - The Z dimension of the cluster, in blocks. Must be a divisor of the grid Z dimension. - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterSchedulingPolicyPreference' in found_struct}} + + clusterSchedulingPolicyPreference : CUclusterSchedulingPolicy Value of launch attribute CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE. Cluster scheduling policy preference for the kernel. - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticStreamSerializationAllowed' in found_struct}} + + programmaticStreamSerializationAllowed : int Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION. - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticEvent' in found_struct}} + + programmaticEvent : anon_struct2 Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT with the following fields: - `CUevent` event - Event to fire when @@ -6955,31 +6633,31 @@ cdef class CUlaunchAttributeValue(CUlaunchAttributeValue_union): cuEventRecordWithFlags. Does not accept :CU_EVENT_RECORD_EXTERNAL. - `triggerAtBlockStart` - If this is set to non-0, each block launch will automatically trigger the event. - {{endif}} - {{if 'CUlaunchAttributeValue_union.launchCompletionEvent' in found_struct}} + + launchCompletionEvent : anon_struct3 Value of launch attribute CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT with the following fields: - `CUevent` event - Event to fire when the last block launches - `int` flags; - Event record flags, see cuEventRecordWithFlags. Does not accept CU_EVENT_RECORD_EXTERNAL. - {{endif}} - {{if 'CUlaunchAttributeValue_union.priority' in found_struct}} + + priority : int Value of launch attribute CU_LAUNCH_ATTRIBUTE_PRIORITY. Execution priority of the kernel. - {{endif}} - {{if 'CUlaunchAttributeValue_union.memSyncDomainMap' in found_struct}} + + memSyncDomainMap : CUlaunchMemSyncDomainMap Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. See CUlaunchMemSyncDomainMap. - {{endif}} - {{if 'CUlaunchAttributeValue_union.memSyncDomain' in found_struct}} + + memSyncDomain : CUlaunchMemSyncDomain Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN. See::CUlaunchMemSyncDomain - {{endif}} - {{if 'CUlaunchAttributeValue_union.preferredClusterDim' in found_struct}} + + preferredClusterDim : anon_struct4 Value of launch attribute CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION that represents the @@ -6993,8 +6671,8 @@ cdef class CUlaunchAttributeValue(CUlaunchAttributeValue_union): CUlaunchAttributeValue::clusterDim. - `z` - The Z dimension of the preferred cluster, in blocks. Must be equal to the `z` field of CUlaunchAttributeValue::clusterDim. - {{endif}} - {{if 'CUlaunchAttributeValue_union.deviceUpdatableKernelNode' in found_struct}} + + deviceUpdatableKernelNode : anon_struct5 Value of launch attribute CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE. with the @@ -7002,26 +6680,26 @@ cdef class CUlaunchAttributeValue(CUlaunchAttributeValue_union): resulting kernel node should be device-updatable. - `CUgraphDeviceNode` devNode - Returns a handle to pass to the various device-side update functions. - {{endif}} - {{if 'CUlaunchAttributeValue_union.sharedMemCarveout' in found_struct}} + + sharedMemCarveout : unsigned int Value of launch attribute CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. - {{endif}} - {{if 'CUlaunchAttributeValue_union.nvlinkUtilCentricScheduling' in found_struct}} + + nvlinkUtilCentricScheduling : unsigned int - {{endif}} - {{if 'CUlaunchAttributeValue_union.portableClusterSizeMode' in found_struct}} + + portableClusterSizeMode : CUlaunchAttributePortableClusterMode Value of launch attribute CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE. - {{endif}} - {{if 'CUlaunchAttributeValue_union.sharedMemoryMode' in found_struct}} + + sharedMemoryMode : CUsharedMemoryMode Value of launch attribute CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE. See CUsharedMemoryMode for acceptable values. - {{endif}} + Methods ------- @@ -7029,8 +6707,6 @@ cdef class CUlaunchAttributeValue(CUlaunchAttributeValue_union): Get memory address of class instance """ pass -{{endif}} -{{if 'CUlaunchAttribute' in found_types}} cdef class CUlaunchAttribute(CUlaunchAttribute_st): """ @@ -7038,14 +6714,14 @@ cdef class CUlaunchAttribute(CUlaunchAttribute_st): Attributes ---------- - {{if 'CUlaunchAttribute_st.id' in found_struct}} + id : CUlaunchAttributeID Attribute to set - {{endif}} - {{if 'CUlaunchAttribute_st.value' in found_struct}} + + value : CUlaunchAttributeValue Value of the attribute - {{endif}} + Methods ------- @@ -7053,8 +6729,6 @@ cdef class CUlaunchAttribute(CUlaunchAttribute_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUlaunchConfig' in found_types}} cdef class CUlaunchConfig(CUlaunchConfig_st): """ @@ -7062,46 +6736,46 @@ cdef class CUlaunchConfig(CUlaunchConfig_st): Attributes ---------- - {{if 'CUlaunchConfig_st.gridDimX' in found_struct}} + gridDimX : unsigned int Width of grid in blocks - {{endif}} - {{if 'CUlaunchConfig_st.gridDimY' in found_struct}} + + gridDimY : unsigned int Height of grid in blocks - {{endif}} - {{if 'CUlaunchConfig_st.gridDimZ' in found_struct}} + + gridDimZ : unsigned int Depth of grid in blocks - {{endif}} - {{if 'CUlaunchConfig_st.blockDimX' in found_struct}} + + blockDimX : unsigned int X dimension of each thread block - {{endif}} - {{if 'CUlaunchConfig_st.blockDimY' in found_struct}} + + blockDimY : unsigned int Y dimension of each thread block - {{endif}} - {{if 'CUlaunchConfig_st.blockDimZ' in found_struct}} + + blockDimZ : unsigned int Z dimension of each thread block - {{endif}} - {{if 'CUlaunchConfig_st.sharedMemBytes' in found_struct}} + + sharedMemBytes : unsigned int Dynamic shared-memory size per thread block in bytes - {{endif}} - {{if 'CUlaunchConfig_st.hStream' in found_struct}} + + hStream : CUstream Stream identifier - {{endif}} - {{if 'CUlaunchConfig_st.attrs' in found_struct}} + + attrs : CUlaunchAttribute List of attributes; nullable if CUlaunchConfig::numAttrs == 0 - {{endif}} - {{if 'CUlaunchConfig_st.numAttrs' in found_struct}} + + numAttrs : unsigned int Number of attributes populated in CUlaunchConfig::attrs - {{endif}} + Methods ------- @@ -7109,8 +6783,6 @@ cdef class CUlaunchConfig(CUlaunchConfig_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUkernelNodeAttrValue_v1' in found_types}} cdef class CUkernelNodeAttrValue_v1(CUlaunchAttributeValue): """ @@ -7118,26 +6790,26 @@ cdef class CUkernelNodeAttrValue_v1(CUlaunchAttributeValue): Attributes ---------- - {{if 'CUlaunchAttributeValue_union.pad' in found_struct}} + pad : bytes - {{endif}} - {{if 'CUlaunchAttributeValue_union.accessPolicyWindow' in found_struct}} + + accessPolicyWindow : CUaccessPolicyWindow Value of launch attribute CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW. - {{endif}} - {{if 'CUlaunchAttributeValue_union.cooperative' in found_struct}} + + cooperative : int Value of launch attribute CU_LAUNCH_ATTRIBUTE_COOPERATIVE. Nonzero indicates a cooperative kernel (see cuLaunchCooperativeKernel). - {{endif}} - {{if 'CUlaunchAttributeValue_union.syncPolicy' in found_struct}} + + syncPolicy : CUsynchronizationPolicy Value of launch attribute - CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY. - ::CUsynchronizationPolicy for work queued up in this stream - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterDim' in found_struct}} + CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY. CUsynchronizationPolicy + for work queued up in this stream + + clusterDim : anon_struct1 Value of launch attribute CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION that represents the desired cluster dimensions for the kernel. @@ -7146,19 +6818,19 @@ cdef class CUkernelNodeAttrValue_v1(CUlaunchAttributeValue): - `y` - The Y dimension of the cluster, in blocks. Must be a divisor of the grid Y dimension. - `z` - The Z dimension of the cluster, in blocks. Must be a divisor of the grid Z dimension. - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterSchedulingPolicyPreference' in found_struct}} + + clusterSchedulingPolicyPreference : CUclusterSchedulingPolicy Value of launch attribute CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE. Cluster scheduling policy preference for the kernel. - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticStreamSerializationAllowed' in found_struct}} + + programmaticStreamSerializationAllowed : int Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION. - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticEvent' in found_struct}} + + programmaticEvent : anon_struct2 Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT with the following fields: - `CUevent` event - Event to fire when @@ -7166,31 +6838,31 @@ cdef class CUkernelNodeAttrValue_v1(CUlaunchAttributeValue): cuEventRecordWithFlags. Does not accept :CU_EVENT_RECORD_EXTERNAL. - `triggerAtBlockStart` - If this is set to non-0, each block launch will automatically trigger the event. - {{endif}} - {{if 'CUlaunchAttributeValue_union.launchCompletionEvent' in found_struct}} + + launchCompletionEvent : anon_struct3 Value of launch attribute CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT with the following fields: - `CUevent` event - Event to fire when the last block launches - `int` flags; - Event record flags, see cuEventRecordWithFlags. Does not accept CU_EVENT_RECORD_EXTERNAL. - {{endif}} - {{if 'CUlaunchAttributeValue_union.priority' in found_struct}} + + priority : int Value of launch attribute CU_LAUNCH_ATTRIBUTE_PRIORITY. Execution priority of the kernel. - {{endif}} - {{if 'CUlaunchAttributeValue_union.memSyncDomainMap' in found_struct}} + + memSyncDomainMap : CUlaunchMemSyncDomainMap Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. See CUlaunchMemSyncDomainMap. - {{endif}} - {{if 'CUlaunchAttributeValue_union.memSyncDomain' in found_struct}} + + memSyncDomain : CUlaunchMemSyncDomain Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN. See::CUlaunchMemSyncDomain - {{endif}} - {{if 'CUlaunchAttributeValue_union.preferredClusterDim' in found_struct}} + + preferredClusterDim : anon_struct4 Value of launch attribute CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION that represents the @@ -7204,8 +6876,8 @@ cdef class CUkernelNodeAttrValue_v1(CUlaunchAttributeValue): CUlaunchAttributeValue::clusterDim. - `z` - The Z dimension of the preferred cluster, in blocks. Must be equal to the `z` field of CUlaunchAttributeValue::clusterDim. - {{endif}} - {{if 'CUlaunchAttributeValue_union.deviceUpdatableKernelNode' in found_struct}} + + deviceUpdatableKernelNode : anon_struct5 Value of launch attribute CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE. with the @@ -7213,26 +6885,26 @@ cdef class CUkernelNodeAttrValue_v1(CUlaunchAttributeValue): resulting kernel node should be device-updatable. - `CUgraphDeviceNode` devNode - Returns a handle to pass to the various device-side update functions. - {{endif}} - {{if 'CUlaunchAttributeValue_union.sharedMemCarveout' in found_struct}} + + sharedMemCarveout : unsigned int Value of launch attribute CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. - {{endif}} - {{if 'CUlaunchAttributeValue_union.nvlinkUtilCentricScheduling' in found_struct}} + + nvlinkUtilCentricScheduling : unsigned int - {{endif}} - {{if 'CUlaunchAttributeValue_union.portableClusterSizeMode' in found_struct}} + + portableClusterSizeMode : CUlaunchAttributePortableClusterMode Value of launch attribute CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE. - {{endif}} - {{if 'CUlaunchAttributeValue_union.sharedMemoryMode' in found_struct}} + + sharedMemoryMode : CUsharedMemoryMode Value of launch attribute CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE. See CUsharedMemoryMode for acceptable values. - {{endif}} + Methods ------- @@ -7240,8 +6912,6 @@ cdef class CUkernelNodeAttrValue_v1(CUlaunchAttributeValue): Get memory address of class instance """ pass -{{endif}} -{{if 'CUkernelNodeAttrValue' in found_types}} cdef class CUkernelNodeAttrValue(CUkernelNodeAttrValue_v1): """ @@ -7249,26 +6919,26 @@ cdef class CUkernelNodeAttrValue(CUkernelNodeAttrValue_v1): Attributes ---------- - {{if 'CUlaunchAttributeValue_union.pad' in found_struct}} + pad : bytes - {{endif}} - {{if 'CUlaunchAttributeValue_union.accessPolicyWindow' in found_struct}} + + accessPolicyWindow : CUaccessPolicyWindow Value of launch attribute CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW. - {{endif}} - {{if 'CUlaunchAttributeValue_union.cooperative' in found_struct}} + + cooperative : int Value of launch attribute CU_LAUNCH_ATTRIBUTE_COOPERATIVE. Nonzero indicates a cooperative kernel (see cuLaunchCooperativeKernel). - {{endif}} - {{if 'CUlaunchAttributeValue_union.syncPolicy' in found_struct}} + + syncPolicy : CUsynchronizationPolicy Value of launch attribute - CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY. - ::CUsynchronizationPolicy for work queued up in this stream - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterDim' in found_struct}} + CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY. CUsynchronizationPolicy + for work queued up in this stream + + clusterDim : anon_struct1 Value of launch attribute CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION that represents the desired cluster dimensions for the kernel. @@ -7277,19 +6947,19 @@ cdef class CUkernelNodeAttrValue(CUkernelNodeAttrValue_v1): - `y` - The Y dimension of the cluster, in blocks. Must be a divisor of the grid Y dimension. - `z` - The Z dimension of the cluster, in blocks. Must be a divisor of the grid Z dimension. - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterSchedulingPolicyPreference' in found_struct}} + + clusterSchedulingPolicyPreference : CUclusterSchedulingPolicy Value of launch attribute CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE. Cluster scheduling policy preference for the kernel. - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticStreamSerializationAllowed' in found_struct}} + + programmaticStreamSerializationAllowed : int Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION. - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticEvent' in found_struct}} + + programmaticEvent : anon_struct2 Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT with the following fields: - `CUevent` event - Event to fire when @@ -7297,31 +6967,31 @@ cdef class CUkernelNodeAttrValue(CUkernelNodeAttrValue_v1): cuEventRecordWithFlags. Does not accept :CU_EVENT_RECORD_EXTERNAL. - `triggerAtBlockStart` - If this is set to non-0, each block launch will automatically trigger the event. - {{endif}} - {{if 'CUlaunchAttributeValue_union.launchCompletionEvent' in found_struct}} + + launchCompletionEvent : anon_struct3 Value of launch attribute CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT with the following fields: - `CUevent` event - Event to fire when the last block launches - `int` flags; - Event record flags, see cuEventRecordWithFlags. Does not accept CU_EVENT_RECORD_EXTERNAL. - {{endif}} - {{if 'CUlaunchAttributeValue_union.priority' in found_struct}} + + priority : int Value of launch attribute CU_LAUNCH_ATTRIBUTE_PRIORITY. Execution priority of the kernel. - {{endif}} - {{if 'CUlaunchAttributeValue_union.memSyncDomainMap' in found_struct}} + + memSyncDomainMap : CUlaunchMemSyncDomainMap Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. See CUlaunchMemSyncDomainMap. - {{endif}} - {{if 'CUlaunchAttributeValue_union.memSyncDomain' in found_struct}} + + memSyncDomain : CUlaunchMemSyncDomain Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN. See::CUlaunchMemSyncDomain - {{endif}} - {{if 'CUlaunchAttributeValue_union.preferredClusterDim' in found_struct}} + + preferredClusterDim : anon_struct4 Value of launch attribute CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION that represents the @@ -7335,8 +7005,8 @@ cdef class CUkernelNodeAttrValue(CUkernelNodeAttrValue_v1): CUlaunchAttributeValue::clusterDim. - `z` - The Z dimension of the preferred cluster, in blocks. Must be equal to the `z` field of CUlaunchAttributeValue::clusterDim. - {{endif}} - {{if 'CUlaunchAttributeValue_union.deviceUpdatableKernelNode' in found_struct}} + + deviceUpdatableKernelNode : anon_struct5 Value of launch attribute CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE. with the @@ -7344,26 +7014,26 @@ cdef class CUkernelNodeAttrValue(CUkernelNodeAttrValue_v1): resulting kernel node should be device-updatable. - `CUgraphDeviceNode` devNode - Returns a handle to pass to the various device-side update functions. - {{endif}} - {{if 'CUlaunchAttributeValue_union.sharedMemCarveout' in found_struct}} + + sharedMemCarveout : unsigned int Value of launch attribute CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. - {{endif}} - {{if 'CUlaunchAttributeValue_union.nvlinkUtilCentricScheduling' in found_struct}} + + nvlinkUtilCentricScheduling : unsigned int - {{endif}} - {{if 'CUlaunchAttributeValue_union.portableClusterSizeMode' in found_struct}} + + portableClusterSizeMode : CUlaunchAttributePortableClusterMode Value of launch attribute CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE. - {{endif}} - {{if 'CUlaunchAttributeValue_union.sharedMemoryMode' in found_struct}} + + sharedMemoryMode : CUsharedMemoryMode Value of launch attribute CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE. See CUsharedMemoryMode for acceptable values. - {{endif}} + Methods ------- @@ -7371,8 +7041,6 @@ cdef class CUkernelNodeAttrValue(CUkernelNodeAttrValue_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUstreamAttrValue_v1' in found_types}} cdef class CUstreamAttrValue_v1(CUlaunchAttributeValue): """ @@ -7380,26 +7048,26 @@ cdef class CUstreamAttrValue_v1(CUlaunchAttributeValue): Attributes ---------- - {{if 'CUlaunchAttributeValue_union.pad' in found_struct}} + pad : bytes - {{endif}} - {{if 'CUlaunchAttributeValue_union.accessPolicyWindow' in found_struct}} + + accessPolicyWindow : CUaccessPolicyWindow Value of launch attribute CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW. - {{endif}} - {{if 'CUlaunchAttributeValue_union.cooperative' in found_struct}} + + cooperative : int Value of launch attribute CU_LAUNCH_ATTRIBUTE_COOPERATIVE. Nonzero indicates a cooperative kernel (see cuLaunchCooperativeKernel). - {{endif}} - {{if 'CUlaunchAttributeValue_union.syncPolicy' in found_struct}} + + syncPolicy : CUsynchronizationPolicy Value of launch attribute - CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY. - ::CUsynchronizationPolicy for work queued up in this stream - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterDim' in found_struct}} + CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY. CUsynchronizationPolicy + for work queued up in this stream + + clusterDim : anon_struct1 Value of launch attribute CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION that represents the desired cluster dimensions for the kernel. @@ -7408,19 +7076,19 @@ cdef class CUstreamAttrValue_v1(CUlaunchAttributeValue): - `y` - The Y dimension of the cluster, in blocks. Must be a divisor of the grid Y dimension. - `z` - The Z dimension of the cluster, in blocks. Must be a divisor of the grid Z dimension. - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterSchedulingPolicyPreference' in found_struct}} + + clusterSchedulingPolicyPreference : CUclusterSchedulingPolicy Value of launch attribute CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE. Cluster scheduling policy preference for the kernel. - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticStreamSerializationAllowed' in found_struct}} + + programmaticStreamSerializationAllowed : int Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION. - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticEvent' in found_struct}} + + programmaticEvent : anon_struct2 Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT with the following fields: - `CUevent` event - Event to fire when @@ -7428,31 +7096,31 @@ cdef class CUstreamAttrValue_v1(CUlaunchAttributeValue): cuEventRecordWithFlags. Does not accept :CU_EVENT_RECORD_EXTERNAL. - `triggerAtBlockStart` - If this is set to non-0, each block launch will automatically trigger the event. - {{endif}} - {{if 'CUlaunchAttributeValue_union.launchCompletionEvent' in found_struct}} + + launchCompletionEvent : anon_struct3 Value of launch attribute CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT with the following fields: - `CUevent` event - Event to fire when the last block launches - `int` flags; - Event record flags, see cuEventRecordWithFlags. Does not accept CU_EVENT_RECORD_EXTERNAL. - {{endif}} - {{if 'CUlaunchAttributeValue_union.priority' in found_struct}} + + priority : int Value of launch attribute CU_LAUNCH_ATTRIBUTE_PRIORITY. Execution priority of the kernel. - {{endif}} - {{if 'CUlaunchAttributeValue_union.memSyncDomainMap' in found_struct}} + + memSyncDomainMap : CUlaunchMemSyncDomainMap Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. See CUlaunchMemSyncDomainMap. - {{endif}} - {{if 'CUlaunchAttributeValue_union.memSyncDomain' in found_struct}} + + memSyncDomain : CUlaunchMemSyncDomain Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN. See::CUlaunchMemSyncDomain - {{endif}} - {{if 'CUlaunchAttributeValue_union.preferredClusterDim' in found_struct}} + + preferredClusterDim : anon_struct4 Value of launch attribute CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION that represents the @@ -7466,8 +7134,8 @@ cdef class CUstreamAttrValue_v1(CUlaunchAttributeValue): CUlaunchAttributeValue::clusterDim. - `z` - The Z dimension of the preferred cluster, in blocks. Must be equal to the `z` field of CUlaunchAttributeValue::clusterDim. - {{endif}} - {{if 'CUlaunchAttributeValue_union.deviceUpdatableKernelNode' in found_struct}} + + deviceUpdatableKernelNode : anon_struct5 Value of launch attribute CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE. with the @@ -7475,26 +7143,26 @@ cdef class CUstreamAttrValue_v1(CUlaunchAttributeValue): resulting kernel node should be device-updatable. - `CUgraphDeviceNode` devNode - Returns a handle to pass to the various device-side update functions. - {{endif}} - {{if 'CUlaunchAttributeValue_union.sharedMemCarveout' in found_struct}} + + sharedMemCarveout : unsigned int Value of launch attribute CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. - {{endif}} - {{if 'CUlaunchAttributeValue_union.nvlinkUtilCentricScheduling' in found_struct}} + + nvlinkUtilCentricScheduling : unsigned int - {{endif}} - {{if 'CUlaunchAttributeValue_union.portableClusterSizeMode' in found_struct}} + + portableClusterSizeMode : CUlaunchAttributePortableClusterMode Value of launch attribute CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE. - {{endif}} - {{if 'CUlaunchAttributeValue_union.sharedMemoryMode' in found_struct}} + + sharedMemoryMode : CUsharedMemoryMode Value of launch attribute CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE. See CUsharedMemoryMode for acceptable values. - {{endif}} + Methods ------- @@ -7502,8 +7170,6 @@ cdef class CUstreamAttrValue_v1(CUlaunchAttributeValue): Get memory address of class instance """ pass -{{endif}} -{{if 'CUstreamAttrValue' in found_types}} cdef class CUstreamAttrValue(CUstreamAttrValue_v1): """ @@ -7511,26 +7177,26 @@ cdef class CUstreamAttrValue(CUstreamAttrValue_v1): Attributes ---------- - {{if 'CUlaunchAttributeValue_union.pad' in found_struct}} + pad : bytes - {{endif}} - {{if 'CUlaunchAttributeValue_union.accessPolicyWindow' in found_struct}} + + accessPolicyWindow : CUaccessPolicyWindow Value of launch attribute CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW. - {{endif}} - {{if 'CUlaunchAttributeValue_union.cooperative' in found_struct}} + + cooperative : int Value of launch attribute CU_LAUNCH_ATTRIBUTE_COOPERATIVE. Nonzero indicates a cooperative kernel (see cuLaunchCooperativeKernel). - {{endif}} - {{if 'CUlaunchAttributeValue_union.syncPolicy' in found_struct}} + + syncPolicy : CUsynchronizationPolicy Value of launch attribute - CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY. - ::CUsynchronizationPolicy for work queued up in this stream - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterDim' in found_struct}} + CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY. CUsynchronizationPolicy + for work queued up in this stream + + clusterDim : anon_struct1 Value of launch attribute CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION that represents the desired cluster dimensions for the kernel. @@ -7539,19 +7205,19 @@ cdef class CUstreamAttrValue(CUstreamAttrValue_v1): - `y` - The Y dimension of the cluster, in blocks. Must be a divisor of the grid Y dimension. - `z` - The Z dimension of the cluster, in blocks. Must be a divisor of the grid Z dimension. - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterSchedulingPolicyPreference' in found_struct}} + + clusterSchedulingPolicyPreference : CUclusterSchedulingPolicy Value of launch attribute CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE. Cluster scheduling policy preference for the kernel. - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticStreamSerializationAllowed' in found_struct}} + + programmaticStreamSerializationAllowed : int Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION. - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticEvent' in found_struct}} + + programmaticEvent : anon_struct2 Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT with the following fields: - `CUevent` event - Event to fire when @@ -7559,31 +7225,31 @@ cdef class CUstreamAttrValue(CUstreamAttrValue_v1): cuEventRecordWithFlags. Does not accept :CU_EVENT_RECORD_EXTERNAL. - `triggerAtBlockStart` - If this is set to non-0, each block launch will automatically trigger the event. - {{endif}} - {{if 'CUlaunchAttributeValue_union.launchCompletionEvent' in found_struct}} + + launchCompletionEvent : anon_struct3 Value of launch attribute CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT with the following fields: - `CUevent` event - Event to fire when the last block launches - `int` flags; - Event record flags, see cuEventRecordWithFlags. Does not accept CU_EVENT_RECORD_EXTERNAL. - {{endif}} - {{if 'CUlaunchAttributeValue_union.priority' in found_struct}} + + priority : int Value of launch attribute CU_LAUNCH_ATTRIBUTE_PRIORITY. Execution priority of the kernel. - {{endif}} - {{if 'CUlaunchAttributeValue_union.memSyncDomainMap' in found_struct}} + + memSyncDomainMap : CUlaunchMemSyncDomainMap Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. See CUlaunchMemSyncDomainMap. - {{endif}} - {{if 'CUlaunchAttributeValue_union.memSyncDomain' in found_struct}} + + memSyncDomain : CUlaunchMemSyncDomain Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN. See::CUlaunchMemSyncDomain - {{endif}} - {{if 'CUlaunchAttributeValue_union.preferredClusterDim' in found_struct}} + + preferredClusterDim : anon_struct4 Value of launch attribute CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION that represents the @@ -7597,8 +7263,8 @@ cdef class CUstreamAttrValue(CUstreamAttrValue_v1): CUlaunchAttributeValue::clusterDim. - `z` - The Z dimension of the preferred cluster, in blocks. Must be equal to the `z` field of CUlaunchAttributeValue::clusterDim. - {{endif}} - {{if 'CUlaunchAttributeValue_union.deviceUpdatableKernelNode' in found_struct}} + + deviceUpdatableKernelNode : anon_struct5 Value of launch attribute CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE. with the @@ -7606,26 +7272,26 @@ cdef class CUstreamAttrValue(CUstreamAttrValue_v1): resulting kernel node should be device-updatable. - `CUgraphDeviceNode` devNode - Returns a handle to pass to the various device-side update functions. - {{endif}} - {{if 'CUlaunchAttributeValue_union.sharedMemCarveout' in found_struct}} + + sharedMemCarveout : unsigned int Value of launch attribute CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. - {{endif}} - {{if 'CUlaunchAttributeValue_union.nvlinkUtilCentricScheduling' in found_struct}} + + nvlinkUtilCentricScheduling : unsigned int - {{endif}} - {{if 'CUlaunchAttributeValue_union.portableClusterSizeMode' in found_struct}} + + portableClusterSizeMode : CUlaunchAttributePortableClusterMode Value of launch attribute CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE. - {{endif}} - {{if 'CUlaunchAttributeValue_union.sharedMemoryMode' in found_struct}} + + sharedMemoryMode : CUsharedMemoryMode Value of launch attribute CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE. See CUsharedMemoryMode for acceptable values. - {{endif}} + Methods ------- @@ -7633,8 +7299,6 @@ cdef class CUstreamAttrValue(CUstreamAttrValue_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUexecAffinitySmCount_v1' in found_types}} cdef class CUexecAffinitySmCount_v1(CUexecAffinitySmCount_st): """ @@ -7642,10 +7306,10 @@ cdef class CUexecAffinitySmCount_v1(CUexecAffinitySmCount_st): Attributes ---------- - {{if 'CUexecAffinitySmCount_st.val' in found_struct}} + val : unsigned int The number of SMs the context is limited to use. - {{endif}} + Methods ------- @@ -7653,8 +7317,6 @@ cdef class CUexecAffinitySmCount_v1(CUexecAffinitySmCount_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUexecAffinitySmCount' in found_types}} cdef class CUexecAffinitySmCount(CUexecAffinitySmCount_v1): """ @@ -7662,10 +7324,10 @@ cdef class CUexecAffinitySmCount(CUexecAffinitySmCount_v1): Attributes ---------- - {{if 'CUexecAffinitySmCount_st.val' in found_struct}} + val : unsigned int The number of SMs the context is limited to use. - {{endif}} + Methods ------- @@ -7673,8 +7335,6 @@ cdef class CUexecAffinitySmCount(CUexecAffinitySmCount_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUexecAffinityParam_v1' in found_types}} cdef class CUexecAffinityParam_v1(CUexecAffinityParam_st): """ @@ -7682,14 +7342,14 @@ cdef class CUexecAffinityParam_v1(CUexecAffinityParam_st): Attributes ---------- - {{if 'CUexecAffinityParam_st.type' in found_struct}} + type : CUexecAffinityType Type of execution affinity. - {{endif}} - {{if 'CUexecAffinityParam_st.param' in found_struct}} + + param : anon_union3 - {{endif}} + Methods ------- @@ -7697,8 +7357,6 @@ cdef class CUexecAffinityParam_v1(CUexecAffinityParam_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUexecAffinityParam' in found_types}} cdef class CUexecAffinityParam(CUexecAffinityParam_v1): """ @@ -7706,14 +7364,14 @@ cdef class CUexecAffinityParam(CUexecAffinityParam_v1): Attributes ---------- - {{if 'CUexecAffinityParam_st.type' in found_struct}} + type : CUexecAffinityType Type of execution affinity. - {{endif}} - {{if 'CUexecAffinityParam_st.param' in found_struct}} + + param : anon_union3 - {{endif}} + Methods ------- @@ -7721,8 +7379,6 @@ cdef class CUexecAffinityParam(CUexecAffinityParam_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUctxCigParam' in found_types}} cdef class CUctxCigParam(CUctxCigParam_st): """ @@ -7730,15 +7386,15 @@ cdef class CUctxCigParam(CUctxCigParam_st): Attributes ---------- - {{if 'CUctxCigParam_st.sharedDataType' in found_struct}} + sharedDataType : CUcigDataType Type of shared data from graphics client (D3D12 or Vulkan). - {{endif}} - {{if 'CUctxCigParam_st.sharedData' in found_struct}} + + sharedData : Any Graphics client data handle (ID3D12CommandQueue or Nvidia specific data blob). - {{endif}} + Methods ------- @@ -7746,8 +7402,6 @@ cdef class CUctxCigParam(CUctxCigParam_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUctxCreateParams' in found_types}} cdef class CUctxCreateParams(CUctxCreateParams_st): """ @@ -7757,23 +7411,23 @@ cdef class CUctxCreateParams(CUctxCreateParams_st): Attributes ---------- - {{if 'CUctxCreateParams_st.execAffinityParams' in found_struct}} + execAffinityParams : CUexecAffinityParam Array of execution affinity parameters to limit context resources (e.g., SM count). Only supported Volta+ MPS. Mutually exclusive with cigParams. - {{endif}} - {{if 'CUctxCreateParams_st.numExecAffinityParams' in found_struct}} + + numExecAffinityParams : int Number of elements in execAffinityParams array. Must be 0 if execAffinityParams is NULL. - {{endif}} - {{if 'CUctxCreateParams_st.cigParams' in found_struct}} + + cigParams : CUctxCigParam CIG (CUDA in Graphics) parameters for sharing data from D3D12/Vulkan graphics clients. Mutually exclusive with execAffinityParams. - {{endif}} + Methods ------- @@ -7781,8 +7435,6 @@ cdef class CUctxCreateParams(CUctxCreateParams_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUstreamCigParam' in found_types}} cdef class CUstreamCigParam(CUstreamCigParam_st): """ @@ -7790,15 +7442,15 @@ cdef class CUstreamCigParam(CUstreamCigParam_st): Attributes ---------- - {{if 'CUstreamCigParam_st.streamSharedDataType' in found_struct}} + streamSharedDataType : CUstreamCigDataType Type of shared data from graphics client (D3D12). - {{endif}} - {{if 'CUstreamCigParam_st.streamSharedData' in found_struct}} + + streamSharedData : Any Graphics client data handle (ID3D12CommandList/ID3D12GraphicsCommandList). - {{endif}} + Methods ------- @@ -7806,8 +7458,6 @@ cdef class CUstreamCigParam(CUstreamCigParam_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUstreamCigCaptureParams' in found_types}} cdef class CUstreamCigCaptureParams(CUstreamCigCaptureParams_st): """ @@ -7816,11 +7466,11 @@ cdef class CUstreamCigCaptureParams(CUstreamCigCaptureParams_st): Attributes ---------- - {{if 'CUstreamCigCaptureParams_st.streamCigParams' in found_struct}} + streamCigParams : CUstreamCigParam CIG (CUDA in Graphics) parameters for sharing command list data from D3D12 graphics clients. - {{endif}} + Methods ------- @@ -7828,29 +7478,27 @@ cdef class CUstreamCigCaptureParams(CUstreamCigCaptureParams_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUlibraryHostUniversalFunctionAndDataTable' in found_types}} cdef class CUlibraryHostUniversalFunctionAndDataTable(CUlibraryHostUniversalFunctionAndDataTable_st): """ Attributes ---------- - {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.functionTable' in found_struct}} + functionTable : Any - {{endif}} - {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.functionWindowSize' in found_struct}} + + functionWindowSize : size_t - {{endif}} - {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.dataTable' in found_struct}} + + dataTable : Any - {{endif}} - {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.dataWindowSize' in found_struct}} + + dataWindowSize : size_t - {{endif}} + Methods ------- @@ -7858,8 +7506,6 @@ cdef class CUlibraryHostUniversalFunctionAndDataTable(CUlibraryHostUniversalFunc Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_MEMCPY2D_v2' in found_types}} cdef class CUDA_MEMCPY2D_v2(CUDA_MEMCPY2D_st): """ @@ -7867,70 +7513,70 @@ cdef class CUDA_MEMCPY2D_v2(CUDA_MEMCPY2D_st): Attributes ---------- - {{if 'CUDA_MEMCPY2D_st.srcXInBytes' in found_struct}} + srcXInBytes : size_t Source X in bytes - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcY' in found_struct}} + + srcY : size_t Source Y - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcMemoryType' in found_struct}} + + srcMemoryType : CUmemorytype Source memory type (host, device, array) - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcHost' in found_struct}} + + srcHost : Any Source host pointer - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcDevice' in found_struct}} + + srcDevice : CUdeviceptr Source device pointer - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcArray' in found_struct}} + + srcArray : CUarray Source array reference - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcPitch' in found_struct}} + + srcPitch : size_t Source pitch (ignored when src is array) - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstXInBytes' in found_struct}} + + dstXInBytes : size_t Destination X in bytes - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstY' in found_struct}} + + dstY : size_t Destination Y - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstMemoryType' in found_struct}} + + dstMemoryType : CUmemorytype Destination memory type (host, device, array) - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstHost' in found_struct}} + + dstHost : Any Destination host pointer - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstDevice' in found_struct}} + + dstDevice : CUdeviceptr Destination device pointer - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstArray' in found_struct}} + + dstArray : CUarray Destination array reference - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstPitch' in found_struct}} + + dstPitch : size_t Destination pitch (ignored when dst is array) - {{endif}} - {{if 'CUDA_MEMCPY2D_st.WidthInBytes' in found_struct}} + + WidthInBytes : size_t Width of 2D memory copy in bytes - {{endif}} - {{if 'CUDA_MEMCPY2D_st.Height' in found_struct}} + + Height : size_t Height of 2D memory copy - {{endif}} + Methods ------- @@ -7938,8 +7584,6 @@ cdef class CUDA_MEMCPY2D_v2(CUDA_MEMCPY2D_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_MEMCPY2D' in found_types}} cdef class CUDA_MEMCPY2D(CUDA_MEMCPY2D_v2): """ @@ -7947,70 +7591,70 @@ cdef class CUDA_MEMCPY2D(CUDA_MEMCPY2D_v2): Attributes ---------- - {{if 'CUDA_MEMCPY2D_st.srcXInBytes' in found_struct}} + srcXInBytes : size_t Source X in bytes - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcY' in found_struct}} + + srcY : size_t Source Y - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcMemoryType' in found_struct}} + + srcMemoryType : CUmemorytype Source memory type (host, device, array) - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcHost' in found_struct}} + + srcHost : Any Source host pointer - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcDevice' in found_struct}} + + srcDevice : CUdeviceptr Source device pointer - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcArray' in found_struct}} + + srcArray : CUarray Source array reference - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcPitch' in found_struct}} + + srcPitch : size_t Source pitch (ignored when src is array) - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstXInBytes' in found_struct}} + + dstXInBytes : size_t Destination X in bytes - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstY' in found_struct}} + + dstY : size_t Destination Y - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstMemoryType' in found_struct}} + + dstMemoryType : CUmemorytype Destination memory type (host, device, array) - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstHost' in found_struct}} + + dstHost : Any Destination host pointer - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstDevice' in found_struct}} + + dstDevice : CUdeviceptr Destination device pointer - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstArray' in found_struct}} + + dstArray : CUarray Destination array reference - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstPitch' in found_struct}} + + dstPitch : size_t Destination pitch (ignored when dst is array) - {{endif}} - {{if 'CUDA_MEMCPY2D_st.WidthInBytes' in found_struct}} + + WidthInBytes : size_t Width of 2D memory copy in bytes - {{endif}} - {{if 'CUDA_MEMCPY2D_st.Height' in found_struct}} + + Height : size_t Height of 2D memory copy - {{endif}} + Methods ------- @@ -8018,8 +7662,6 @@ cdef class CUDA_MEMCPY2D(CUDA_MEMCPY2D_v2): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_MEMCPY3D_v2' in found_types}} cdef class CUDA_MEMCPY3D_v2(CUDA_MEMCPY3D_st): """ @@ -8027,107 +7669,107 @@ cdef class CUDA_MEMCPY3D_v2(CUDA_MEMCPY3D_st): Attributes ---------- - {{if 'CUDA_MEMCPY3D_st.srcXInBytes' in found_struct}} + srcXInBytes : size_t Source X in bytes - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcY' in found_struct}} + + srcY : size_t Source Y - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcZ' in found_struct}} + + srcZ : size_t Source Z - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcLOD' in found_struct}} + + srcLOD : size_t Source LOD - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcMemoryType' in found_struct}} + + srcMemoryType : CUmemorytype Source memory type (host, device, array) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcHost' in found_struct}} + + srcHost : Any Source host pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcDevice' in found_struct}} + + srcDevice : CUdeviceptr Source device pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcArray' in found_struct}} + + srcArray : CUarray Source array reference - {{endif}} - {{if 'CUDA_MEMCPY3D_st.reserved0' in found_struct}} + + reserved0 : Any Must be NULL - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcPitch' in found_struct}} + + srcPitch : size_t Source pitch (ignored when src is array) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcHeight' in found_struct}} + + srcHeight : size_t Source height (ignored when src is array; may be 0 if Depth==1) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstXInBytes' in found_struct}} + + dstXInBytes : size_t Destination X in bytes - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstY' in found_struct}} + + dstY : size_t Destination Y - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstZ' in found_struct}} + + dstZ : size_t Destination Z - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstLOD' in found_struct}} + + dstLOD : size_t Destination LOD - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstMemoryType' in found_struct}} + + dstMemoryType : CUmemorytype Destination memory type (host, device, array) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstHost' in found_struct}} + + dstHost : Any Destination host pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstDevice' in found_struct}} + + dstDevice : CUdeviceptr Destination device pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstArray' in found_struct}} + + dstArray : CUarray Destination array reference - {{endif}} - {{if 'CUDA_MEMCPY3D_st.reserved1' in found_struct}} + + reserved1 : Any Must be NULL - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstPitch' in found_struct}} + + dstPitch : size_t Destination pitch (ignored when dst is array) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstHeight' in found_struct}} + + dstHeight : size_t Destination height (ignored when dst is array; may be 0 if Depth==1) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.WidthInBytes' in found_struct}} + + WidthInBytes : size_t Width of 3D memory copy in bytes - {{endif}} - {{if 'CUDA_MEMCPY3D_st.Height' in found_struct}} + + Height : size_t Height of 3D memory copy - {{endif}} - {{if 'CUDA_MEMCPY3D_st.Depth' in found_struct}} + + Depth : size_t Depth of 3D memory copy - {{endif}} + Methods ------- @@ -8135,8 +7777,6 @@ cdef class CUDA_MEMCPY3D_v2(CUDA_MEMCPY3D_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_MEMCPY3D' in found_types}} cdef class CUDA_MEMCPY3D(CUDA_MEMCPY3D_v2): """ @@ -8144,107 +7784,107 @@ cdef class CUDA_MEMCPY3D(CUDA_MEMCPY3D_v2): Attributes ---------- - {{if 'CUDA_MEMCPY3D_st.srcXInBytes' in found_struct}} + srcXInBytes : size_t Source X in bytes - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcY' in found_struct}} + + srcY : size_t Source Y - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcZ' in found_struct}} + + srcZ : size_t Source Z - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcLOD' in found_struct}} + + srcLOD : size_t Source LOD - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcMemoryType' in found_struct}} + + srcMemoryType : CUmemorytype Source memory type (host, device, array) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcHost' in found_struct}} + + srcHost : Any Source host pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcDevice' in found_struct}} + + srcDevice : CUdeviceptr Source device pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcArray' in found_struct}} + + srcArray : CUarray Source array reference - {{endif}} - {{if 'CUDA_MEMCPY3D_st.reserved0' in found_struct}} + + reserved0 : Any Must be NULL - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcPitch' in found_struct}} + + srcPitch : size_t Source pitch (ignored when src is array) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcHeight' in found_struct}} + + srcHeight : size_t Source height (ignored when src is array; may be 0 if Depth==1) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstXInBytes' in found_struct}} + + dstXInBytes : size_t Destination X in bytes - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstY' in found_struct}} + + dstY : size_t Destination Y - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstZ' in found_struct}} + + dstZ : size_t Destination Z - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstLOD' in found_struct}} + + dstLOD : size_t Destination LOD - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstMemoryType' in found_struct}} + + dstMemoryType : CUmemorytype Destination memory type (host, device, array) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstHost' in found_struct}} + + dstHost : Any Destination host pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstDevice' in found_struct}} + + dstDevice : CUdeviceptr Destination device pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstArray' in found_struct}} + + dstArray : CUarray Destination array reference - {{endif}} - {{if 'CUDA_MEMCPY3D_st.reserved1' in found_struct}} + + reserved1 : Any Must be NULL - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstPitch' in found_struct}} + + dstPitch : size_t Destination pitch (ignored when dst is array) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstHeight' in found_struct}} + + dstHeight : size_t Destination height (ignored when dst is array; may be 0 if Depth==1) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.WidthInBytes' in found_struct}} + + WidthInBytes : size_t Width of 3D memory copy in bytes - {{endif}} - {{if 'CUDA_MEMCPY3D_st.Height' in found_struct}} + + Height : size_t Height of 3D memory copy - {{endif}} - {{if 'CUDA_MEMCPY3D_st.Depth' in found_struct}} + + Depth : size_t Depth of 3D memory copy - {{endif}} + Methods ------- @@ -8252,8 +7892,6 @@ cdef class CUDA_MEMCPY3D(CUDA_MEMCPY3D_v2): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_MEMCPY3D_PEER_v1' in found_types}} cdef class CUDA_MEMCPY3D_PEER_v1(CUDA_MEMCPY3D_PEER_st): """ @@ -8261,108 +7899,108 @@ cdef class CUDA_MEMCPY3D_PEER_v1(CUDA_MEMCPY3D_PEER_st): Attributes ---------- - {{if 'CUDA_MEMCPY3D_PEER_st.srcXInBytes' in found_struct}} + srcXInBytes : size_t Source X in bytes - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcY' in found_struct}} + + srcY : size_t Source Y - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcZ' in found_struct}} + + srcZ : size_t Source Z - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcLOD' in found_struct}} + + srcLOD : size_t Source LOD - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcMemoryType' in found_struct}} + + srcMemoryType : CUmemorytype Source memory type (host, device, array) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcHost' in found_struct}} + + srcHost : Any Source host pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcDevice' in found_struct}} + + srcDevice : CUdeviceptr Source device pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcArray' in found_struct}} + + srcArray : CUarray Source array reference - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcContext' in found_struct}} + + srcContext : CUcontext Source context (ignored with srcMemoryType is CU_MEMORYTYPE_ARRAY) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcPitch' in found_struct}} + + srcPitch : size_t Source pitch (ignored when src is array) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcHeight' in found_struct}} + + srcHeight : size_t Source height (ignored when src is array; may be 0 if Depth==1) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstXInBytes' in found_struct}} + + dstXInBytes : size_t Destination X in bytes - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstY' in found_struct}} + + dstY : size_t Destination Y - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstZ' in found_struct}} + + dstZ : size_t Destination Z - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstLOD' in found_struct}} + + dstLOD : size_t Destination LOD - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstMemoryType' in found_struct}} + + dstMemoryType : CUmemorytype Destination memory type (host, device, array) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstHost' in found_struct}} + + dstHost : Any Destination host pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstDevice' in found_struct}} + + dstDevice : CUdeviceptr Destination device pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstArray' in found_struct}} + + dstArray : CUarray Destination array reference - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstContext' in found_struct}} + + dstContext : CUcontext Destination context (ignored with dstMemoryType is CU_MEMORYTYPE_ARRAY) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstPitch' in found_struct}} + + dstPitch : size_t Destination pitch (ignored when dst is array) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstHeight' in found_struct}} + + dstHeight : size_t Destination height (ignored when dst is array; may be 0 if Depth==1) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.WidthInBytes' in found_struct}} + + WidthInBytes : size_t Width of 3D memory copy in bytes - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.Height' in found_struct}} + + Height : size_t Height of 3D memory copy - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.Depth' in found_struct}} + + Depth : size_t Depth of 3D memory copy - {{endif}} + Methods ------- @@ -8370,8 +8008,6 @@ cdef class CUDA_MEMCPY3D_PEER_v1(CUDA_MEMCPY3D_PEER_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_MEMCPY3D_PEER' in found_types}} cdef class CUDA_MEMCPY3D_PEER(CUDA_MEMCPY3D_PEER_v1): """ @@ -8379,108 +8015,108 @@ cdef class CUDA_MEMCPY3D_PEER(CUDA_MEMCPY3D_PEER_v1): Attributes ---------- - {{if 'CUDA_MEMCPY3D_PEER_st.srcXInBytes' in found_struct}} + srcXInBytes : size_t Source X in bytes - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcY' in found_struct}} + + srcY : size_t Source Y - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcZ' in found_struct}} + + srcZ : size_t Source Z - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcLOD' in found_struct}} + + srcLOD : size_t Source LOD - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcMemoryType' in found_struct}} + + srcMemoryType : CUmemorytype Source memory type (host, device, array) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcHost' in found_struct}} + + srcHost : Any Source host pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcDevice' in found_struct}} + + srcDevice : CUdeviceptr Source device pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcArray' in found_struct}} + + srcArray : CUarray Source array reference - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcContext' in found_struct}} + + srcContext : CUcontext Source context (ignored with srcMemoryType is CU_MEMORYTYPE_ARRAY) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcPitch' in found_struct}} + + srcPitch : size_t Source pitch (ignored when src is array) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcHeight' in found_struct}} + + srcHeight : size_t Source height (ignored when src is array; may be 0 if Depth==1) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstXInBytes' in found_struct}} + + dstXInBytes : size_t Destination X in bytes - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstY' in found_struct}} + + dstY : size_t Destination Y - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstZ' in found_struct}} + + dstZ : size_t Destination Z - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstLOD' in found_struct}} + + dstLOD : size_t Destination LOD - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstMemoryType' in found_struct}} + + dstMemoryType : CUmemorytype Destination memory type (host, device, array) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstHost' in found_struct}} + + dstHost : Any Destination host pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstDevice' in found_struct}} + + dstDevice : CUdeviceptr Destination device pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstArray' in found_struct}} + + dstArray : CUarray Destination array reference - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstContext' in found_struct}} + + dstContext : CUcontext Destination context (ignored with dstMemoryType is CU_MEMORYTYPE_ARRAY) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstPitch' in found_struct}} + + dstPitch : size_t Destination pitch (ignored when dst is array) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstHeight' in found_struct}} + + dstHeight : size_t Destination height (ignored when dst is array; may be 0 if Depth==1) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.WidthInBytes' in found_struct}} + + WidthInBytes : size_t Width of 3D memory copy in bytes - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.Height' in found_struct}} + + Height : size_t Height of 3D memory copy - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.Depth' in found_struct}} + + Depth : size_t Depth of 3D memory copy - {{endif}} + Methods ------- @@ -8488,8 +8124,6 @@ cdef class CUDA_MEMCPY3D_PEER(CUDA_MEMCPY3D_PEER_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_MEMCPY_NODE_PARAMS' in found_types}} cdef class CUDA_MEMCPY_NODE_PARAMS(CUDA_MEMCPY_NODE_PARAMS_st): """ @@ -8497,22 +8131,22 @@ cdef class CUDA_MEMCPY_NODE_PARAMS(CUDA_MEMCPY_NODE_PARAMS_st): Attributes ---------- - {{if 'CUDA_MEMCPY_NODE_PARAMS_st.flags' in found_struct}} + flags : int Must be zero - {{endif}} - {{if 'CUDA_MEMCPY_NODE_PARAMS_st.reserved' in found_struct}} + + reserved : int Must be zero - {{endif}} - {{if 'CUDA_MEMCPY_NODE_PARAMS_st.copyCtx' in found_struct}} + + copyCtx : CUcontext Context on which to run the node - {{endif}} - {{if 'CUDA_MEMCPY_NODE_PARAMS_st.copyParams' in found_struct}} + + copyParams : CUDA_MEMCPY3D Parameters for the memory copy - {{endif}} + Methods ------- @@ -8520,8 +8154,6 @@ cdef class CUDA_MEMCPY_NODE_PARAMS(CUDA_MEMCPY_NODE_PARAMS_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_ARRAY_DESCRIPTOR_v2' in found_types}} cdef class CUDA_ARRAY_DESCRIPTOR_v2(CUDA_ARRAY_DESCRIPTOR_st): """ @@ -8529,22 +8161,22 @@ cdef class CUDA_ARRAY_DESCRIPTOR_v2(CUDA_ARRAY_DESCRIPTOR_st): Attributes ---------- - {{if 'CUDA_ARRAY_DESCRIPTOR_st.Width' in found_struct}} + Width : size_t Width of array - {{endif}} - {{if 'CUDA_ARRAY_DESCRIPTOR_st.Height' in found_struct}} + + Height : size_t Height of array - {{endif}} - {{if 'CUDA_ARRAY_DESCRIPTOR_st.Format' in found_struct}} + + Format : CUarray_format Array format - {{endif}} - {{if 'CUDA_ARRAY_DESCRIPTOR_st.NumChannels' in found_struct}} + + NumChannels : unsigned int Channels per array element - {{endif}} + Methods ------- @@ -8552,8 +8184,6 @@ cdef class CUDA_ARRAY_DESCRIPTOR_v2(CUDA_ARRAY_DESCRIPTOR_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_ARRAY_DESCRIPTOR' in found_types}} cdef class CUDA_ARRAY_DESCRIPTOR(CUDA_ARRAY_DESCRIPTOR_v2): """ @@ -8561,22 +8191,22 @@ cdef class CUDA_ARRAY_DESCRIPTOR(CUDA_ARRAY_DESCRIPTOR_v2): Attributes ---------- - {{if 'CUDA_ARRAY_DESCRIPTOR_st.Width' in found_struct}} + Width : size_t Width of array - {{endif}} - {{if 'CUDA_ARRAY_DESCRIPTOR_st.Height' in found_struct}} + + Height : size_t Height of array - {{endif}} - {{if 'CUDA_ARRAY_DESCRIPTOR_st.Format' in found_struct}} + + Format : CUarray_format Array format - {{endif}} - {{if 'CUDA_ARRAY_DESCRIPTOR_st.NumChannels' in found_struct}} + + NumChannels : unsigned int Channels per array element - {{endif}} + Methods ------- @@ -8584,8 +8214,6 @@ cdef class CUDA_ARRAY_DESCRIPTOR(CUDA_ARRAY_DESCRIPTOR_v2): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_ARRAY3D_DESCRIPTOR_v2' in found_types}} cdef class CUDA_ARRAY3D_DESCRIPTOR_v2(CUDA_ARRAY3D_DESCRIPTOR_st): """ @@ -8593,30 +8221,30 @@ cdef class CUDA_ARRAY3D_DESCRIPTOR_v2(CUDA_ARRAY3D_DESCRIPTOR_st): Attributes ---------- - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Width' in found_struct}} + Width : size_t Width of 3D array - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Height' in found_struct}} + + Height : size_t Height of 3D array - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Depth' in found_struct}} + + Depth : size_t Depth of 3D array - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Format' in found_struct}} + + Format : CUarray_format Array format - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.NumChannels' in found_struct}} + + NumChannels : unsigned int Channels per array element - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Flags' in found_struct}} + + Flags : unsigned int Flags - {{endif}} + Methods ------- @@ -8624,8 +8252,6 @@ cdef class CUDA_ARRAY3D_DESCRIPTOR_v2(CUDA_ARRAY3D_DESCRIPTOR_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_ARRAY3D_DESCRIPTOR' in found_types}} cdef class CUDA_ARRAY3D_DESCRIPTOR(CUDA_ARRAY3D_DESCRIPTOR_v2): """ @@ -8633,30 +8259,30 @@ cdef class CUDA_ARRAY3D_DESCRIPTOR(CUDA_ARRAY3D_DESCRIPTOR_v2): Attributes ---------- - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Width' in found_struct}} + Width : size_t Width of 3D array - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Height' in found_struct}} + + Height : size_t Height of 3D array - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Depth' in found_struct}} + + Depth : size_t Depth of 3D array - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Format' in found_struct}} + + Format : CUarray_format Array format - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.NumChannels' in found_struct}} + + NumChannels : unsigned int Channels per array element - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Flags' in found_struct}} + + Flags : unsigned int Flags - {{endif}} + Methods ------- @@ -8664,8 +8290,6 @@ cdef class CUDA_ARRAY3D_DESCRIPTOR(CUDA_ARRAY3D_DESCRIPTOR_v2): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_ARRAY_SPARSE_PROPERTIES_v1' in found_types}} cdef class CUDA_ARRAY_SPARSE_PROPERTIES_v1(CUDA_ARRAY_SPARSE_PROPERTIES_st): """ @@ -8673,27 +8297,27 @@ cdef class CUDA_ARRAY_SPARSE_PROPERTIES_v1(CUDA_ARRAY_SPARSE_PROPERTIES_st): Attributes ---------- - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.tileExtent' in found_struct}} + tileExtent : anon_struct6 - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.miptailFirstLevel' in found_struct}} + + miptailFirstLevel : unsigned int First mip level at which the mip tail begins. - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.miptailSize' in found_struct}} + + miptailSize : unsigned long long Total size of the mip tail. - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.flags' in found_struct}} + + flags : unsigned int Flags will either be zero or CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -8701,8 +8325,6 @@ cdef class CUDA_ARRAY_SPARSE_PROPERTIES_v1(CUDA_ARRAY_SPARSE_PROPERTIES_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_ARRAY_SPARSE_PROPERTIES' in found_types}} cdef class CUDA_ARRAY_SPARSE_PROPERTIES(CUDA_ARRAY_SPARSE_PROPERTIES_v1): """ @@ -8710,27 +8332,27 @@ cdef class CUDA_ARRAY_SPARSE_PROPERTIES(CUDA_ARRAY_SPARSE_PROPERTIES_v1): Attributes ---------- - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.tileExtent' in found_struct}} + tileExtent : anon_struct6 - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.miptailFirstLevel' in found_struct}} + + miptailFirstLevel : unsigned int First mip level at which the mip tail begins. - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.miptailSize' in found_struct}} + + miptailSize : unsigned long long Total size of the mip tail. - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.flags' in found_struct}} + + flags : unsigned int Flags will either be zero or CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -8738,8 +8360,6 @@ cdef class CUDA_ARRAY_SPARSE_PROPERTIES(CUDA_ARRAY_SPARSE_PROPERTIES_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_v1' in found_types}} cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS_v1(CUDA_ARRAY_MEMORY_REQUIREMENTS_st): """ @@ -8747,18 +8367,18 @@ cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS_v1(CUDA_ARRAY_MEMORY_REQUIREMENTS_st): Attributes ---------- - {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.size' in found_struct}} + size : size_t Total required memory size - {{endif}} - {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.alignment' in found_struct}} + + alignment : size_t alignment requirement - {{endif}} - {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -8766,8 +8386,6 @@ cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS_v1(CUDA_ARRAY_MEMORY_REQUIREMENTS_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS' in found_types}} cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS(CUDA_ARRAY_MEMORY_REQUIREMENTS_v1): """ @@ -8775,18 +8393,18 @@ cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS(CUDA_ARRAY_MEMORY_REQUIREMENTS_v1): Attributes ---------- - {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.size' in found_struct}} + size : size_t Total required memory size - {{endif}} - {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.alignment' in found_struct}} + + alignment : size_t alignment requirement - {{endif}} - {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -8794,8 +8412,6 @@ cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS(CUDA_ARRAY_MEMORY_REQUIREMENTS_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_RESOURCE_DESC_v1' in found_types}} cdef class CUDA_RESOURCE_DESC_v1(CUDA_RESOURCE_DESC_st): """ @@ -8803,18 +8419,18 @@ cdef class CUDA_RESOURCE_DESC_v1(CUDA_RESOURCE_DESC_st): Attributes ---------- - {{if 'CUDA_RESOURCE_DESC_st.resType' in found_struct}} + resType : CUresourcetype Resource type - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res' in found_struct}} + + res : anon_union4 - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.flags' in found_struct}} + + flags : unsigned int Flags (must be zero) - {{endif}} + Methods ------- @@ -8822,8 +8438,6 @@ cdef class CUDA_RESOURCE_DESC_v1(CUDA_RESOURCE_DESC_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_RESOURCE_DESC' in found_types}} cdef class CUDA_RESOURCE_DESC(CUDA_RESOURCE_DESC_v1): """ @@ -8831,18 +8445,18 @@ cdef class CUDA_RESOURCE_DESC(CUDA_RESOURCE_DESC_v1): Attributes ---------- - {{if 'CUDA_RESOURCE_DESC_st.resType' in found_struct}} + resType : CUresourcetype Resource type - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res' in found_struct}} + + res : anon_union4 - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.flags' in found_struct}} + + flags : unsigned int Flags (must be zero) - {{endif}} + Methods ------- @@ -8850,8 +8464,6 @@ cdef class CUDA_RESOURCE_DESC(CUDA_RESOURCE_DESC_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_TEXTURE_DESC_v1' in found_types}} cdef class CUDA_TEXTURE_DESC_v1(CUDA_TEXTURE_DESC_st): """ @@ -8859,46 +8471,46 @@ cdef class CUDA_TEXTURE_DESC_v1(CUDA_TEXTURE_DESC_st): Attributes ---------- - {{if 'CUDA_TEXTURE_DESC_st.addressMode' in found_struct}} + addressMode : list[CUaddress_mode] Address modes - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.filterMode' in found_struct}} + + filterMode : CUfilter_mode Filter mode - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.flags' in found_struct}} + + flags : unsigned int Flags - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.maxAnisotropy' in found_struct}} + + maxAnisotropy : unsigned int Maximum anisotropy ratio - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.mipmapFilterMode' in found_struct}} + + mipmapFilterMode : CUfilter_mode Mipmap filter mode - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.mipmapLevelBias' in found_struct}} + + mipmapLevelBias : float Mipmap level bias - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.minMipmapLevelClamp' in found_struct}} + + minMipmapLevelClamp : float Mipmap minimum level clamp - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.maxMipmapLevelClamp' in found_struct}} + + maxMipmapLevelClamp : float Mipmap maximum level clamp - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.borderColor' in found_struct}} + + borderColor : list[float] Border Color - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.reserved' in found_struct}} + + reserved : list[int] - {{endif}} + Methods ------- @@ -8906,8 +8518,6 @@ cdef class CUDA_TEXTURE_DESC_v1(CUDA_TEXTURE_DESC_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_TEXTURE_DESC' in found_types}} cdef class CUDA_TEXTURE_DESC(CUDA_TEXTURE_DESC_v1): """ @@ -8915,46 +8525,46 @@ cdef class CUDA_TEXTURE_DESC(CUDA_TEXTURE_DESC_v1): Attributes ---------- - {{if 'CUDA_TEXTURE_DESC_st.addressMode' in found_struct}} + addressMode : list[CUaddress_mode] Address modes - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.filterMode' in found_struct}} + + filterMode : CUfilter_mode Filter mode - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.flags' in found_struct}} + + flags : unsigned int Flags - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.maxAnisotropy' in found_struct}} + + maxAnisotropy : unsigned int Maximum anisotropy ratio - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.mipmapFilterMode' in found_struct}} + + mipmapFilterMode : CUfilter_mode Mipmap filter mode - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.mipmapLevelBias' in found_struct}} + + mipmapLevelBias : float Mipmap level bias - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.minMipmapLevelClamp' in found_struct}} + + minMipmapLevelClamp : float Mipmap minimum level clamp - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.maxMipmapLevelClamp' in found_struct}} + + maxMipmapLevelClamp : float Mipmap maximum level clamp - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.borderColor' in found_struct}} + + borderColor : list[float] Border Color - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.reserved' in found_struct}} + + reserved : list[int] - {{endif}} + Methods ------- @@ -8962,8 +8572,6 @@ cdef class CUDA_TEXTURE_DESC(CUDA_TEXTURE_DESC_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_RESOURCE_VIEW_DESC_v1' in found_types}} cdef class CUDA_RESOURCE_VIEW_DESC_v1(CUDA_RESOURCE_VIEW_DESC_st): """ @@ -8971,42 +8579,42 @@ cdef class CUDA_RESOURCE_VIEW_DESC_v1(CUDA_RESOURCE_VIEW_DESC_st): Attributes ---------- - {{if 'CUDA_RESOURCE_VIEW_DESC_st.format' in found_struct}} + format : CUresourceViewFormat Resource view format - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.width' in found_struct}} + + width : size_t Width of the resource view - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.height' in found_struct}} + + height : size_t Height of the resource view - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.depth' in found_struct}} + + depth : size_t Depth of the resource view - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.firstMipmapLevel' in found_struct}} + + firstMipmapLevel : unsigned int First defined mipmap level - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.lastMipmapLevel' in found_struct}} + + lastMipmapLevel : unsigned int Last defined mipmap level - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.firstLayer' in found_struct}} + + firstLayer : unsigned int First layer index - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.lastLayer' in found_struct}} + + lastLayer : unsigned int Last layer index - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -9014,8 +8622,6 @@ cdef class CUDA_RESOURCE_VIEW_DESC_v1(CUDA_RESOURCE_VIEW_DESC_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_RESOURCE_VIEW_DESC' in found_types}} cdef class CUDA_RESOURCE_VIEW_DESC(CUDA_RESOURCE_VIEW_DESC_v1): """ @@ -9023,42 +8629,42 @@ cdef class CUDA_RESOURCE_VIEW_DESC(CUDA_RESOURCE_VIEW_DESC_v1): Attributes ---------- - {{if 'CUDA_RESOURCE_VIEW_DESC_st.format' in found_struct}} + format : CUresourceViewFormat Resource view format - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.width' in found_struct}} + + width : size_t Width of the resource view - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.height' in found_struct}} + + height : size_t Height of the resource view - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.depth' in found_struct}} + + depth : size_t Depth of the resource view - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.firstMipmapLevel' in found_struct}} + + firstMipmapLevel : unsigned int First defined mipmap level - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.lastMipmapLevel' in found_struct}} + + lastMipmapLevel : unsigned int Last defined mipmap level - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.firstLayer' in found_struct}} + + firstLayer : unsigned int First layer index - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.lastLayer' in found_struct}} + + lastLayer : unsigned int Last layer index - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -9066,8 +8672,6 @@ cdef class CUDA_RESOURCE_VIEW_DESC(CUDA_RESOURCE_VIEW_DESC_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUtensorMap' in found_types}} cdef class CUtensorMap(CUtensorMap_st): """ @@ -9076,10 +8680,10 @@ cdef class CUtensorMap(CUtensorMap_st): Attributes ---------- - {{if 'CUtensorMap_st.opaque' in found_struct}} + opaque : list[cuuint64_t] - {{endif}} + Methods ------- @@ -9087,8 +8691,6 @@ cdef class CUtensorMap(CUtensorMap_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1' in found_types}} cdef class CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1(CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st): """ @@ -9096,14 +8698,14 @@ cdef class CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1(CUDA_POINTER_ATTRIBUTE_P2P_TOKEN Attributes ---------- - {{if 'CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st.p2pToken' in found_struct}} + p2pToken : unsigned long long - {{endif}} - {{if 'CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st.vaSpaceToken' in found_struct}} + + vaSpaceToken : unsigned int - {{endif}} + Methods ------- @@ -9111,8 +8713,6 @@ cdef class CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1(CUDA_POINTER_ATTRIBUTE_P2P_TOKEN Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_POINTER_ATTRIBUTE_P2P_TOKENS' in found_types}} cdef class CUDA_POINTER_ATTRIBUTE_P2P_TOKENS(CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1): """ @@ -9120,14 +8720,14 @@ cdef class CUDA_POINTER_ATTRIBUTE_P2P_TOKENS(CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v Attributes ---------- - {{if 'CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st.p2pToken' in found_struct}} + p2pToken : unsigned long long - {{endif}} - {{if 'CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st.vaSpaceToken' in found_struct}} + + vaSpaceToken : unsigned int - {{endif}} + Methods ------- @@ -9135,8 +8735,6 @@ cdef class CUDA_POINTER_ATTRIBUTE_P2P_TOKENS(CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_LAUNCH_PARAMS_v1' in found_types}} cdef class CUDA_LAUNCH_PARAMS_v1(CUDA_LAUNCH_PARAMS_st): """ @@ -9144,46 +8742,46 @@ cdef class CUDA_LAUNCH_PARAMS_v1(CUDA_LAUNCH_PARAMS_st): Attributes ---------- - {{if 'CUDA_LAUNCH_PARAMS_st.function' in found_struct}} + function : CUfunction Kernel to launch - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.gridDimX' in found_struct}} + + gridDimX : unsigned int Width of grid in blocks - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.gridDimY' in found_struct}} + + gridDimY : unsigned int Height of grid in blocks - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.gridDimZ' in found_struct}} + + gridDimZ : unsigned int Depth of grid in blocks - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.blockDimX' in found_struct}} + + blockDimX : unsigned int X dimension of each thread block - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.blockDimY' in found_struct}} + + blockDimY : unsigned int Y dimension of each thread block - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.blockDimZ' in found_struct}} + + blockDimZ : unsigned int Z dimension of each thread block - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.sharedMemBytes' in found_struct}} + + sharedMemBytes : unsigned int Dynamic shared-memory size per thread block in bytes - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.hStream' in found_struct}} + + hStream : CUstream Stream identifier - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.kernelParams' in found_struct}} + + kernelParams : Any Array of pointers to kernel parameters - {{endif}} + Methods ------- @@ -9191,8 +8789,6 @@ cdef class CUDA_LAUNCH_PARAMS_v1(CUDA_LAUNCH_PARAMS_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_LAUNCH_PARAMS' in found_types}} cdef class CUDA_LAUNCH_PARAMS(CUDA_LAUNCH_PARAMS_v1): """ @@ -9200,46 +8796,46 @@ cdef class CUDA_LAUNCH_PARAMS(CUDA_LAUNCH_PARAMS_v1): Attributes ---------- - {{if 'CUDA_LAUNCH_PARAMS_st.function' in found_struct}} + function : CUfunction Kernel to launch - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.gridDimX' in found_struct}} + + gridDimX : unsigned int Width of grid in blocks - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.gridDimY' in found_struct}} + + gridDimY : unsigned int Height of grid in blocks - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.gridDimZ' in found_struct}} + + gridDimZ : unsigned int Depth of grid in blocks - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.blockDimX' in found_struct}} + + blockDimX : unsigned int X dimension of each thread block - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.blockDimY' in found_struct}} + + blockDimY : unsigned int Y dimension of each thread block - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.blockDimZ' in found_struct}} + + blockDimZ : unsigned int Z dimension of each thread block - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.sharedMemBytes' in found_struct}} + + sharedMemBytes : unsigned int Dynamic shared-memory size per thread block in bytes - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.hStream' in found_struct}} + + hStream : CUstream Stream identifier - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.kernelParams' in found_struct}} + + kernelParams : Any Array of pointers to kernel parameters - {{endif}} + Methods ------- @@ -9247,8 +8843,6 @@ cdef class CUDA_LAUNCH_PARAMS(CUDA_LAUNCH_PARAMS_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1' in found_types}} cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1(CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st): """ @@ -9256,26 +8850,26 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1(CUDA_EXTERNAL_MEMORY_HANDLE_DESC_ Attributes ---------- - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.type' in found_struct}} + type : CUexternalMemoryHandleType Type of the handle - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle' in found_struct}} + + handle : anon_union5 - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.size' in found_struct}} + + size : unsigned long long Size of the memory allocation - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.flags' in found_struct}} + + flags : unsigned int 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] - {{endif}} + Methods ------- @@ -9283,8 +8877,6 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1(CUDA_EXTERNAL_MEMORY_HANDLE_DESC_ Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC' in found_types}} cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC(CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1): """ @@ -9292,26 +8884,26 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC(CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1) Attributes ---------- - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.type' in found_struct}} + type : CUexternalMemoryHandleType Type of the handle - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle' in found_struct}} + + handle : anon_union5 - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.size' in found_struct}} + + size : unsigned long long Size of the memory allocation - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.flags' in found_struct}} + + flags : unsigned int 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] - {{endif}} + Methods ------- @@ -9319,8 +8911,6 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC(CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1) Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1' in found_types}} cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1(CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st): """ @@ -9328,22 +8918,22 @@ cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1(CUDA_EXTERNAL_MEMORY_BUFFER_DESC_ Attributes ---------- - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.offset' in found_struct}} + offset : unsigned long long Offset into the memory object where the buffer's base is - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.size' in found_struct}} + + size : unsigned long long Size of the buffer - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.flags' in found_struct}} + + flags : unsigned int Flags reserved for future use. Must be zero. - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -9351,8 +8941,6 @@ cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1(CUDA_EXTERNAL_MEMORY_BUFFER_DESC_ Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC' in found_types}} cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC(CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1): """ @@ -9360,22 +8948,22 @@ cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC(CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1) Attributes ---------- - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.offset' in found_struct}} + offset : unsigned long long Offset into the memory object where the buffer's base is - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.size' in found_struct}} + + size : unsigned long long Size of the buffer - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.flags' in found_struct}} + + flags : unsigned int Flags reserved for future use. Must be zero. - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -9383,8 +8971,6 @@ cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC(CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1) Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1' in found_types}} cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1(CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st): """ @@ -9392,23 +8978,23 @@ cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1(CUDA_EXTERNAL_MEMORY_MIP Attributes ---------- - {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.offset' in found_struct}} + offset : unsigned long long Offset into the memory object where the base level of the mipmap chain is. - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.arrayDesc' in found_struct}} + + arrayDesc : CUDA_ARRAY3D_DESCRIPTOR Format, dimension and type of base level of the mipmap chain - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.numLevels' in found_struct}} + + numLevels : unsigned int 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] - {{endif}} + Methods ------- @@ -9416,8 +9002,6 @@ cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1(CUDA_EXTERNAL_MEMORY_MIP Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC' in found_types}} cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC(CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1): """ @@ -9425,23 +9009,23 @@ cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC(CUDA_EXTERNAL_MEMORY_MIPMAP Attributes ---------- - {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.offset' in found_struct}} + offset : unsigned long long Offset into the memory object where the base level of the mipmap chain is. - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.arrayDesc' in found_struct}} + + arrayDesc : CUDA_ARRAY3D_DESCRIPTOR Format, dimension and type of base level of the mipmap chain - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.numLevels' in found_struct}} + + numLevels : unsigned int 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] - {{endif}} + Methods ------- @@ -9449,8 +9033,6 @@ cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC(CUDA_EXTERNAL_MEMORY_MIPMAP Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1' in found_types}} cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1(CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st): """ @@ -9458,22 +9040,22 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1(CUDA_EXTERNAL_SEMAPHORE_HANDLE Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.type' in found_struct}} + type : CUexternalSemaphoreHandleType Type of the handle - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle' in found_struct}} + + handle : anon_union6 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.flags' in found_struct}} + + flags : unsigned int Flags reserved for the future. Must be zero. - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -9481,8 +9063,6 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1(CUDA_EXTERNAL_SEMAPHORE_HANDLE Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC' in found_types}} cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC(CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1): """ @@ -9490,22 +9070,22 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC(CUDA_EXTERNAL_SEMAPHORE_HANDLE_DE Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.type' in found_struct}} + type : CUexternalSemaphoreHandleType Type of the handle - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle' in found_struct}} + + handle : anon_union6 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.flags' in found_struct}} + + flags : unsigned int Flags reserved for the future. Must be zero. - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -9513,8 +9093,6 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC(CUDA_EXTERNAL_SEMAPHORE_HANDLE_DE Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1' in found_types}} cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1(CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st): """ @@ -9522,25 +9100,25 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1(CUDA_EXTERNAL_SEMAPHORE_SIGN Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params' in found_struct}} + params : anon_struct16 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.flags' in found_struct}} + + flags : unsigned int - Only when ::CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS is used to signal - a CUexternalSemaphore of type + Only when CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS is used to signal a + CUexternalSemaphore of type CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC, the valid flag is CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC which indicates that while signaling the CUexternalSemaphore, no memory synchronization operations should be performed for any external memory object imported as CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF. 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] - {{endif}} + Methods ------- @@ -9548,8 +9126,6 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1(CUDA_EXTERNAL_SEMAPHORE_SIGN Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS' in found_types}} cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS(CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1): """ @@ -9557,25 +9133,25 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS(CUDA_EXTERNAL_SEMAPHORE_SIGNAL_ Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params' in found_struct}} + params : anon_struct16 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.flags' in found_struct}} + + flags : unsigned int - Only when ::CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS is used to signal - a CUexternalSemaphore of type + Only when CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS is used to signal a + CUexternalSemaphore of type CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC, the valid flag is CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC which indicates that while signaling the CUexternalSemaphore, no memory synchronization operations should be performed for any external memory object imported as CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF. 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] - {{endif}} + Methods ------- @@ -9583,8 +9159,6 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS(CUDA_EXTERNAL_SEMAPHORE_SIGNAL_ Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1' in found_types}} cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1(CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st): """ @@ -9592,25 +9166,25 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1(CUDA_EXTERNAL_SEMAPHORE_WAIT_P Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params' in found_struct}} + params : anon_struct19 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.flags' in found_struct}} + + flags : unsigned int - Only when ::CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS is used to wait on - a CUexternalSemaphore of type + Only when CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS is used to wait on a + CUexternalSemaphore of type CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC, the valid flag is CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC which indicates that while waiting for the CUexternalSemaphore, no memory synchronization operations should be performed for any external memory object imported as CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF. 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] - {{endif}} + Methods ------- @@ -9618,8 +9192,6 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1(CUDA_EXTERNAL_SEMAPHORE_WAIT_P Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS' in found_types}} cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS(CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1): """ @@ -9627,25 +9199,25 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS(CUDA_EXTERNAL_SEMAPHORE_WAIT_PARA Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params' in found_struct}} + params : anon_struct19 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.flags' in found_struct}} + + flags : unsigned int - Only when ::CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS is used to wait on - a CUexternalSemaphore of type + Only when CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS is used to wait on a + CUexternalSemaphore of type CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC, the valid flag is CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC which indicates that while waiting for the CUexternalSemaphore, no memory synchronization operations should be performed for any external memory object imported as CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF. 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] - {{endif}} + Methods ------- @@ -9653,8 +9225,6 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS(CUDA_EXTERNAL_SEMAPHORE_WAIT_PARA Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1' in found_types}} cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st): """ @@ -9662,19 +9232,19 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st Attributes ---------- - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st.extSemArray' in found_struct}} + extSemArray : CUexternalSemaphore Array of external semaphore handles. - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st.paramsArray' in found_struct}} + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS Array of external semaphore signal parameters. - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st.numExtSems' in found_struct}} + + numExtSems : unsigned int Number of handles and parameters supplied in extSemArray and paramsArray. - {{endif}} + Methods ------- @@ -9682,8 +9252,6 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS' in found_types}} cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1): """ @@ -9691,19 +9259,19 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1): Attributes ---------- - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st.extSemArray' in found_struct}} + extSemArray : CUexternalSemaphore Array of external semaphore handles. - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st.paramsArray' in found_struct}} + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS Array of external semaphore signal parameters. - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st.numExtSems' in found_struct}} + + numExtSems : unsigned int Number of handles and parameters supplied in extSemArray and paramsArray. - {{endif}} + Methods ------- @@ -9711,8 +9279,6 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2' in found_types}} cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st): """ @@ -9720,19 +9286,19 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 Attributes ---------- - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st.extSemArray' in found_struct}} + extSemArray : CUexternalSemaphore Array of external semaphore handles. - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st.paramsArray' in found_struct}} + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS Array of external semaphore signal parameters. - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st.numExtSems' in found_struct}} + + numExtSems : unsigned int Number of handles and parameters supplied in extSemArray and paramsArray. - {{endif}} + Methods ------- @@ -9740,8 +9306,6 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1' in found_types}} cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1(CUDA_EXT_SEM_WAIT_NODE_PARAMS_st): """ @@ -9749,19 +9313,19 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1(CUDA_EXT_SEM_WAIT_NODE_PARAMS_st): Attributes ---------- - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_st.extSemArray' in found_struct}} + extSemArray : CUexternalSemaphore Array of external semaphore handles. - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_st.paramsArray' in found_struct}} + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS Array of external semaphore wait parameters. - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_st.numExtSems' in found_struct}} + + numExtSems : unsigned int Number of handles and parameters supplied in extSemArray and paramsArray. - {{endif}} + Methods ------- @@ -9769,8 +9333,6 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1(CUDA_EXT_SEM_WAIT_NODE_PARAMS_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS' in found_types}} cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS(CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1): """ @@ -9778,19 +9340,19 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS(CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1): Attributes ---------- - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_st.extSemArray' in found_struct}} + extSemArray : CUexternalSemaphore Array of external semaphore handles. - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_st.paramsArray' in found_struct}} + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS Array of external semaphore wait parameters. - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_st.numExtSems' in found_struct}} + + numExtSems : unsigned int Number of handles and parameters supplied in extSemArray and paramsArray. - {{endif}} + Methods ------- @@ -9798,8 +9360,6 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS(CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2' in found_types}} cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2(CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st): """ @@ -9807,19 +9367,19 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2(CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st) Attributes ---------- - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st.extSemArray' in found_struct}} + extSemArray : CUexternalSemaphore Array of external semaphore handles. - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st.paramsArray' in found_struct}} + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS Array of external semaphore wait parameters. - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st.numExtSems' in found_struct}} + + numExtSems : unsigned int Number of handles and parameters supplied in extSemArray and paramsArray. - {{endif}} + Methods ------- @@ -9827,8 +9387,6 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2(CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st) Get memory address of class instance """ pass -{{endif}} -{{if 'CUmemGenericAllocationHandle' in found_types}} cdef class CUmemGenericAllocationHandle: """ @@ -9841,8 +9399,6 @@ cdef class CUmemGenericAllocationHandle: """ cdef cydriver.CUmemGenericAllocationHandle _pvt_val cdef cydriver.CUmemGenericAllocationHandle* _pvt_ptr -{{endif}} -{{if 'CUarrayMapInfo_v1' in found_types}} cdef class CUarrayMapInfo_v1(CUarrayMapInfo_st): """ @@ -9851,50 +9407,50 @@ cdef class CUarrayMapInfo_v1(CUarrayMapInfo_st): Attributes ---------- - {{if 'CUarrayMapInfo_st.resourceType' in found_struct}} + resourceType : CUresourcetype Resource type - {{endif}} - {{if 'CUarrayMapInfo_st.resource' in found_struct}} + + resource : anon_union9 - {{endif}} - {{if 'CUarrayMapInfo_st.subresourceType' in found_struct}} + + subresourceType : CUarraySparseSubresourceType Sparse subresource type - {{endif}} - {{if 'CUarrayMapInfo_st.subresource' in found_struct}} + + subresource : anon_union10 - {{endif}} - {{if 'CUarrayMapInfo_st.memOperationType' in found_struct}} + + memOperationType : CUmemOperationType Memory operation type - {{endif}} - {{if 'CUarrayMapInfo_st.memHandleType' in found_struct}} + + memHandleType : CUmemHandleType Memory handle type - {{endif}} - {{if 'CUarrayMapInfo_st.memHandle' in found_struct}} + + memHandle : anon_union11 - {{endif}} - {{if 'CUarrayMapInfo_st.offset' in found_struct}} + + offset : unsigned long long Offset within mip tail Offset within the memory - {{endif}} - {{if 'CUarrayMapInfo_st.deviceBitMask' in found_struct}} + + deviceBitMask : unsigned int Device ordinal bit mask - {{endif}} - {{if 'CUarrayMapInfo_st.flags' in found_struct}} + + flags : unsigned int flags for future use, must be zero now. - {{endif}} - {{if 'CUarrayMapInfo_st.reserved' in found_struct}} + + reserved : list[unsigned int] Reserved for future use, must be zero now. - {{endif}} + Methods ------- @@ -9902,8 +9458,6 @@ cdef class CUarrayMapInfo_v1(CUarrayMapInfo_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUarrayMapInfo' in found_types}} cdef class CUarrayMapInfo(CUarrayMapInfo_v1): """ @@ -9912,50 +9466,50 @@ cdef class CUarrayMapInfo(CUarrayMapInfo_v1): Attributes ---------- - {{if 'CUarrayMapInfo_st.resourceType' in found_struct}} + resourceType : CUresourcetype Resource type - {{endif}} - {{if 'CUarrayMapInfo_st.resource' in found_struct}} + + resource : anon_union9 - {{endif}} - {{if 'CUarrayMapInfo_st.subresourceType' in found_struct}} + + subresourceType : CUarraySparseSubresourceType Sparse subresource type - {{endif}} - {{if 'CUarrayMapInfo_st.subresource' in found_struct}} + + subresource : anon_union10 - {{endif}} - {{if 'CUarrayMapInfo_st.memOperationType' in found_struct}} + + memOperationType : CUmemOperationType Memory operation type - {{endif}} - {{if 'CUarrayMapInfo_st.memHandleType' in found_struct}} + + memHandleType : CUmemHandleType Memory handle type - {{endif}} - {{if 'CUarrayMapInfo_st.memHandle' in found_struct}} + + memHandle : anon_union11 - {{endif}} - {{if 'CUarrayMapInfo_st.offset' in found_struct}} + + offset : unsigned long long Offset within mip tail Offset within the memory - {{endif}} - {{if 'CUarrayMapInfo_st.deviceBitMask' in found_struct}} + + deviceBitMask : unsigned int Device ordinal bit mask - {{endif}} - {{if 'CUarrayMapInfo_st.flags' in found_struct}} + + flags : unsigned int flags for future use, must be zero now. - {{endif}} - {{if 'CUarrayMapInfo_st.reserved' in found_struct}} + + reserved : list[unsigned int] Reserved for future use, must be zero now. - {{endif}} + Methods ------- @@ -9963,8 +9517,6 @@ cdef class CUarrayMapInfo(CUarrayMapInfo_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUmemLocation_v1' in found_types}} cdef class CUmemLocation_v1(CUmemLocation_st): """ @@ -9972,14 +9524,16 @@ cdef class CUmemLocation_v1(CUmemLocation_st): Attributes ---------- - {{if 'CUmemLocation_st.type' in found_struct}} + type : CUmemLocationType Specifies the location type, which modifies the meaning of id. - {{endif}} - {{if 'CUmemLocation_st.id' in found_struct}} + + id : int + Identifier for CUmemLocationType::CU_MEM_LOCATION_TYPE_DEVICE, + CUmemLocationType::CU_MEM_LOCATION_TYPE_HOST, + CUmemLocationType::CU_MEM_LOCATION_TYPE_HOST_NUMA. - {{endif}} Methods ------- @@ -9987,8 +9541,6 @@ cdef class CUmemLocation_v1(CUmemLocation_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUmemLocation' in found_types}} cdef class CUmemLocation(CUmemLocation_v1): """ @@ -9996,14 +9548,16 @@ cdef class CUmemLocation(CUmemLocation_v1): Attributes ---------- - {{if 'CUmemLocation_st.type' in found_struct}} + type : CUmemLocationType Specifies the location type, which modifies the meaning of id. - {{endif}} - {{if 'CUmemLocation_st.id' in found_struct}} + + id : int + Identifier for CUmemLocationType::CU_MEM_LOCATION_TYPE_DEVICE, + CUmemLocationType::CU_MEM_LOCATION_TYPE_HOST, + CUmemLocationType::CU_MEM_LOCATION_TYPE_HOST_NUMA. - {{endif}} Methods ------- @@ -10011,8 +9565,6 @@ cdef class CUmemLocation(CUmemLocation_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUmemAllocationProp_v1' in found_types}} cdef class CUmemAllocationProp_v1(CUmemAllocationProp_st): """ @@ -10020,30 +9572,30 @@ cdef class CUmemAllocationProp_v1(CUmemAllocationProp_st): Attributes ---------- - {{if 'CUmemAllocationProp_st.type' in found_struct}} + type : CUmemAllocationType Allocation type - {{endif}} - {{if 'CUmemAllocationProp_st.requestedHandleTypes' in found_struct}} + + requestedHandleTypes : CUmemAllocationHandleType requested CUmemAllocationHandleType - {{endif}} - {{if 'CUmemAllocationProp_st.location' in found_struct}} + + location : CUmemLocation Location of allocation - {{endif}} - {{if 'CUmemAllocationProp_st.win32HandleMetaData' in found_struct}} + + win32HandleMetaData : Any Windows-specific POBJECT_ATTRIBUTES required when CU_MEM_HANDLE_TYPE_WIN32 is specified. This object attributes structure includes security attributes that define the scope of which exported allocations may be transferred to other processes. In all other cases, this field is required to be zero. - {{endif}} - {{if 'CUmemAllocationProp_st.allocFlags' in found_struct}} + + allocFlags : anon_struct22 - {{endif}} + Methods ------- @@ -10051,8 +9603,6 @@ cdef class CUmemAllocationProp_v1(CUmemAllocationProp_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUmemAllocationProp' in found_types}} cdef class CUmemAllocationProp(CUmemAllocationProp_v1): """ @@ -10060,30 +9610,30 @@ cdef class CUmemAllocationProp(CUmemAllocationProp_v1): Attributes ---------- - {{if 'CUmemAllocationProp_st.type' in found_struct}} + type : CUmemAllocationType Allocation type - {{endif}} - {{if 'CUmemAllocationProp_st.requestedHandleTypes' in found_struct}} + + requestedHandleTypes : CUmemAllocationHandleType requested CUmemAllocationHandleType - {{endif}} - {{if 'CUmemAllocationProp_st.location' in found_struct}} + + location : CUmemLocation Location of allocation - {{endif}} - {{if 'CUmemAllocationProp_st.win32HandleMetaData' in found_struct}} + + win32HandleMetaData : Any Windows-specific POBJECT_ATTRIBUTES required when CU_MEM_HANDLE_TYPE_WIN32 is specified. This object attributes structure includes security attributes that define the scope of which exported allocations may be transferred to other processes. In all other cases, this field is required to be zero. - {{endif}} - {{if 'CUmemAllocationProp_st.allocFlags' in found_struct}} + + allocFlags : anon_struct22 - {{endif}} + Methods ------- @@ -10091,8 +9641,6 @@ cdef class CUmemAllocationProp(CUmemAllocationProp_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUmulticastObjectProp_v1' in found_types}} cdef class CUmulticastObjectProp_v1(CUmulticastObjectProp_st): """ @@ -10100,25 +9648,25 @@ cdef class CUmulticastObjectProp_v1(CUmulticastObjectProp_st): Attributes ---------- - {{if 'CUmulticastObjectProp_st.numDevices' in found_struct}} + numDevices : unsigned int The number of devices in the multicast team that will bind memory to this object - {{endif}} - {{if 'CUmulticastObjectProp_st.size' in found_struct}} + + size : size_t The maximum amount of memory that can be bound to this multicast object per device - {{endif}} - {{if 'CUmulticastObjectProp_st.handleTypes' in found_struct}} + + handleTypes : unsigned long long Bitmask of exportable handle types (see CUmemAllocationHandleType) for this object - {{endif}} - {{if 'CUmulticastObjectProp_st.flags' in found_struct}} + + flags : unsigned long long Flags for future use, must be zero now - {{endif}} + Methods ------- @@ -10126,8 +9674,6 @@ cdef class CUmulticastObjectProp_v1(CUmulticastObjectProp_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUmulticastObjectProp' in found_types}} cdef class CUmulticastObjectProp(CUmulticastObjectProp_v1): """ @@ -10135,25 +9681,25 @@ cdef class CUmulticastObjectProp(CUmulticastObjectProp_v1): Attributes ---------- - {{if 'CUmulticastObjectProp_st.numDevices' in found_struct}} + numDevices : unsigned int The number of devices in the multicast team that will bind memory to this object - {{endif}} - {{if 'CUmulticastObjectProp_st.size' in found_struct}} + + size : size_t The maximum amount of memory that can be bound to this multicast object per device - {{endif}} - {{if 'CUmulticastObjectProp_st.handleTypes' in found_struct}} + + handleTypes : unsigned long long Bitmask of exportable handle types (see CUmemAllocationHandleType) for this object - {{endif}} - {{if 'CUmulticastObjectProp_st.flags' in found_struct}} + + flags : unsigned long long Flags for future use, must be zero now - {{endif}} + Methods ------- @@ -10161,8 +9707,6 @@ cdef class CUmulticastObjectProp(CUmulticastObjectProp_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUmemAccessDesc_v1' in found_types}} cdef class CUmemAccessDesc_v1(CUmemAccessDesc_st): """ @@ -10170,14 +9714,14 @@ cdef class CUmemAccessDesc_v1(CUmemAccessDesc_st): Attributes ---------- - {{if 'CUmemAccessDesc_st.location' in found_struct}} + location : CUmemLocation Location on which the request is to change it's accessibility - {{endif}} - {{if 'CUmemAccessDesc_st.flags' in found_struct}} + + flags : CUmemAccess_flags ::CUmemProt accessibility flags to set on the request - {{endif}} + Methods ------- @@ -10185,8 +9729,6 @@ cdef class CUmemAccessDesc_v1(CUmemAccessDesc_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUmemAccessDesc' in found_types}} cdef class CUmemAccessDesc(CUmemAccessDesc_v1): """ @@ -10194,14 +9736,14 @@ cdef class CUmemAccessDesc(CUmemAccessDesc_v1): Attributes ---------- - {{if 'CUmemAccessDesc_st.location' in found_struct}} + location : CUmemLocation Location on which the request is to change it's accessibility - {{endif}} - {{if 'CUmemAccessDesc_st.flags' in found_struct}} + + flags : CUmemAccess_flags ::CUmemProt accessibility flags to set on the request - {{endif}} + Methods ------- @@ -10209,8 +9751,6 @@ cdef class CUmemAccessDesc(CUmemAccessDesc_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUgraphExecUpdateResultInfo_v1' in found_types}} cdef class CUgraphExecUpdateResultInfo_v1(CUgraphExecUpdateResultInfo_st): """ @@ -10218,21 +9758,21 @@ cdef class CUgraphExecUpdateResultInfo_v1(CUgraphExecUpdateResultInfo_st): Attributes ---------- - {{if 'CUgraphExecUpdateResultInfo_st.result' in found_struct}} + result : CUgraphExecUpdateResult Gives more specific detail when a cuda graph update fails. - {{endif}} - {{if 'CUgraphExecUpdateResultInfo_st.errorNode' in found_struct}} + + errorNode : CUgraphNode The "to node" of the error edge when the topologies do not match. The error node when the error is associated with a specific node. NULL when the error is generic. - {{endif}} - {{if 'CUgraphExecUpdateResultInfo_st.errorFromNode' in found_struct}} + + errorFromNode : CUgraphNode The from node of error edge when the topologies do not match. Otherwise NULL. - {{endif}} + Methods ------- @@ -10240,8 +9780,6 @@ cdef class CUgraphExecUpdateResultInfo_v1(CUgraphExecUpdateResultInfo_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUgraphExecUpdateResultInfo' in found_types}} cdef class CUgraphExecUpdateResultInfo(CUgraphExecUpdateResultInfo_v1): """ @@ -10249,21 +9787,21 @@ cdef class CUgraphExecUpdateResultInfo(CUgraphExecUpdateResultInfo_v1): Attributes ---------- - {{if 'CUgraphExecUpdateResultInfo_st.result' in found_struct}} + result : CUgraphExecUpdateResult Gives more specific detail when a cuda graph update fails. - {{endif}} - {{if 'CUgraphExecUpdateResultInfo_st.errorNode' in found_struct}} + + errorNode : CUgraphNode The "to node" of the error edge when the topologies do not match. The error node when the error is associated with a specific node. NULL when the error is generic. - {{endif}} - {{if 'CUgraphExecUpdateResultInfo_st.errorFromNode' in found_struct}} + + errorFromNode : CUgraphNode The from node of error edge when the topologies do not match. Otherwise NULL. - {{endif}} + Methods ------- @@ -10271,8 +9809,6 @@ cdef class CUgraphExecUpdateResultInfo(CUgraphExecUpdateResultInfo_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUmemPoolProps_v1' in found_types}} cdef class CUmemPoolProps_v1(CUmemPoolProps_st): """ @@ -10280,40 +9816,40 @@ cdef class CUmemPoolProps_v1(CUmemPoolProps_st): Attributes ---------- - {{if 'CUmemPoolProps_st.allocType' in found_struct}} + allocType : CUmemAllocationType Allocation type. Currently must be specified as CU_MEM_ALLOCATION_TYPE_PINNED - {{endif}} - {{if 'CUmemPoolProps_st.handleTypes' in found_struct}} + + handleTypes : CUmemAllocationHandleType Handle types that will be supported by allocations from the pool. - {{endif}} - {{if 'CUmemPoolProps_st.location' in found_struct}} + + location : CUmemLocation Location where allocations should reside. - {{endif}} - {{if 'CUmemPoolProps_st.win32SecurityAttributes' in found_struct}} + + win32SecurityAttributes : Any Windows-specific LPSECURITYATTRIBUTES required when CU_MEM_HANDLE_TYPE_WIN32 is specified. This security attribute defines the scope of which exported allocations may be transferred to other processes. In all other cases, this field is required to be zero. - {{endif}} - {{if 'CUmemPoolProps_st.maxSize' in found_struct}} + + maxSize : size_t Maximum pool size. When set to 0, defaults to a system dependent value. - {{endif}} - {{if 'CUmemPoolProps_st.usage' in found_struct}} + + usage : unsigned short Bitmask indicating intended usage for the pool. - {{endif}} - {{if 'CUmemPoolProps_st.reserved' in found_struct}} + + reserved : bytes reserved for future use, must be 0 - {{endif}} + Methods ------- @@ -10321,8 +9857,6 @@ cdef class CUmemPoolProps_v1(CUmemPoolProps_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUmemPoolProps' in found_types}} cdef class CUmemPoolProps(CUmemPoolProps_v1): """ @@ -10330,40 +9864,40 @@ cdef class CUmemPoolProps(CUmemPoolProps_v1): Attributes ---------- - {{if 'CUmemPoolProps_st.allocType' in found_struct}} + allocType : CUmemAllocationType Allocation type. Currently must be specified as CU_MEM_ALLOCATION_TYPE_PINNED - {{endif}} - {{if 'CUmemPoolProps_st.handleTypes' in found_struct}} + + handleTypes : CUmemAllocationHandleType Handle types that will be supported by allocations from the pool. - {{endif}} - {{if 'CUmemPoolProps_st.location' in found_struct}} + + location : CUmemLocation Location where allocations should reside. - {{endif}} - {{if 'CUmemPoolProps_st.win32SecurityAttributes' in found_struct}} + + win32SecurityAttributes : Any Windows-specific LPSECURITYATTRIBUTES required when CU_MEM_HANDLE_TYPE_WIN32 is specified. This security attribute defines the scope of which exported allocations may be transferred to other processes. In all other cases, this field is required to be zero. - {{endif}} - {{if 'CUmemPoolProps_st.maxSize' in found_struct}} + + maxSize : size_t Maximum pool size. When set to 0, defaults to a system dependent value. - {{endif}} - {{if 'CUmemPoolProps_st.usage' in found_struct}} + + usage : unsigned short Bitmask indicating intended usage for the pool. - {{endif}} - {{if 'CUmemPoolProps_st.reserved' in found_struct}} + + reserved : bytes reserved for future use, must be 0 - {{endif}} + Methods ------- @@ -10371,8 +9905,6 @@ cdef class CUmemPoolProps(CUmemPoolProps_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUmemPoolPtrExportData_v1' in found_types}} cdef class CUmemPoolPtrExportData_v1(CUmemPoolPtrExportData_st): """ @@ -10380,10 +9912,10 @@ cdef class CUmemPoolPtrExportData_v1(CUmemPoolPtrExportData_st): Attributes ---------- - {{if 'CUmemPoolPtrExportData_st.reserved' in found_struct}} + reserved : bytes - {{endif}} + Methods ------- @@ -10391,8 +9923,6 @@ cdef class CUmemPoolPtrExportData_v1(CUmemPoolPtrExportData_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUmemPoolPtrExportData' in found_types}} cdef class CUmemPoolPtrExportData(CUmemPoolPtrExportData_v1): """ @@ -10400,10 +9930,10 @@ cdef class CUmemPoolPtrExportData(CUmemPoolPtrExportData_v1): Attributes ---------- - {{if 'CUmemPoolPtrExportData_st.reserved' in found_struct}} + reserved : bytes - {{endif}} + Methods ------- @@ -10411,8 +9941,6 @@ cdef class CUmemPoolPtrExportData(CUmemPoolPtrExportData_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUmemcpyAttributes_v1' in found_types}} cdef class CUmemcpyAttributes_v1(CUmemcpyAttributes_st): """ @@ -10421,25 +9949,25 @@ cdef class CUmemcpyAttributes_v1(CUmemcpyAttributes_st): Attributes ---------- - {{if 'CUmemcpyAttributes_st.srcAccessOrder' in found_struct}} + srcAccessOrder : CUmemcpySrcAccessOrder Source access ordering to be observed for copies with this attribute. - {{endif}} - {{if 'CUmemcpyAttributes_st.srcLocHint' in found_struct}} + + srcLocHint : CUmemLocation Hint location for the source operand. Ignored when the pointers are not managed memory or memory allocated outside CUDA. - {{endif}} - {{if 'CUmemcpyAttributes_st.dstLocHint' in found_struct}} + + dstLocHint : CUmemLocation Hint location for the destination operand. Ignored when the pointers are not managed memory or memory allocated outside CUDA. - {{endif}} - {{if 'CUmemcpyAttributes_st.flags' in found_struct}} + + flags : unsigned int Additional flags for copies with this attribute. See CUmemcpyFlags - {{endif}} + Methods ------- @@ -10447,8 +9975,6 @@ cdef class CUmemcpyAttributes_v1(CUmemcpyAttributes_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUmemcpyAttributes' in found_types}} cdef class CUmemcpyAttributes(CUmemcpyAttributes_v1): """ @@ -10457,25 +9983,25 @@ cdef class CUmemcpyAttributes(CUmemcpyAttributes_v1): Attributes ---------- - {{if 'CUmemcpyAttributes_st.srcAccessOrder' in found_struct}} + srcAccessOrder : CUmemcpySrcAccessOrder Source access ordering to be observed for copies with this attribute. - {{endif}} - {{if 'CUmemcpyAttributes_st.srcLocHint' in found_struct}} + + srcLocHint : CUmemLocation Hint location for the source operand. Ignored when the pointers are not managed memory or memory allocated outside CUDA. - {{endif}} - {{if 'CUmemcpyAttributes_st.dstLocHint' in found_struct}} + + dstLocHint : CUmemLocation Hint location for the destination operand. Ignored when the pointers are not managed memory or memory allocated outside CUDA. - {{endif}} - {{if 'CUmemcpyAttributes_st.flags' in found_struct}} + + flags : unsigned int Additional flags for copies with this attribute. See CUmemcpyFlags - {{endif}} + Methods ------- @@ -10483,8 +10009,6 @@ cdef class CUmemcpyAttributes(CUmemcpyAttributes_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUoffset3D_v1' in found_types}} cdef class CUoffset3D_v1(CUoffset3D_st): """ @@ -10492,18 +10016,18 @@ cdef class CUoffset3D_v1(CUoffset3D_st): Attributes ---------- - {{if 'CUoffset3D_st.x' in found_struct}} + x : size_t - {{endif}} - {{if 'CUoffset3D_st.y' in found_struct}} + + y : size_t - {{endif}} - {{if 'CUoffset3D_st.z' in found_struct}} + + z : size_t - {{endif}} + Methods ------- @@ -10511,8 +10035,6 @@ cdef class CUoffset3D_v1(CUoffset3D_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUoffset3D' in found_types}} cdef class CUoffset3D(CUoffset3D_v1): """ @@ -10520,18 +10042,18 @@ cdef class CUoffset3D(CUoffset3D_v1): Attributes ---------- - {{if 'CUoffset3D_st.x' in found_struct}} + x : size_t - {{endif}} - {{if 'CUoffset3D_st.y' in found_struct}} + + y : size_t - {{endif}} - {{if 'CUoffset3D_st.z' in found_struct}} + + z : size_t - {{endif}} + Methods ------- @@ -10539,8 +10061,6 @@ cdef class CUoffset3D(CUoffset3D_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUextent3D_v1' in found_types}} cdef class CUextent3D_v1(CUextent3D_st): """ @@ -10548,18 +10068,18 @@ cdef class CUextent3D_v1(CUextent3D_st): Attributes ---------- - {{if 'CUextent3D_st.width' in found_struct}} + width : size_t - {{endif}} - {{if 'CUextent3D_st.height' in found_struct}} + + height : size_t - {{endif}} - {{if 'CUextent3D_st.depth' in found_struct}} + + depth : size_t - {{endif}} + Methods ------- @@ -10567,8 +10087,6 @@ cdef class CUextent3D_v1(CUextent3D_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUextent3D' in found_types}} cdef class CUextent3D(CUextent3D_v1): """ @@ -10576,18 +10094,18 @@ cdef class CUextent3D(CUextent3D_v1): Attributes ---------- - {{if 'CUextent3D_st.width' in found_struct}} + width : size_t - {{endif}} - {{if 'CUextent3D_st.height' in found_struct}} + + height : size_t - {{endif}} - {{if 'CUextent3D_st.depth' in found_struct}} + + depth : size_t - {{endif}} + Methods ------- @@ -10595,8 +10113,6 @@ cdef class CUextent3D(CUextent3D_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUmemcpy3DOperand_v1' in found_types}} cdef class CUmemcpy3DOperand_v1(CUmemcpy3DOperand_st): """ @@ -10604,14 +10120,14 @@ cdef class CUmemcpy3DOperand_v1(CUmemcpy3DOperand_st): Attributes ---------- - {{if 'CUmemcpy3DOperand_st.type' in found_struct}} + type : CUmemcpy3DOperandType - {{endif}} - {{if 'CUmemcpy3DOperand_st.op' in found_struct}} + + op : anon_union13 - {{endif}} + Methods ------- @@ -10619,8 +10135,6 @@ cdef class CUmemcpy3DOperand_v1(CUmemcpy3DOperand_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUmemcpy3DOperand' in found_types}} cdef class CUmemcpy3DOperand(CUmemcpy3DOperand_v1): """ @@ -10628,14 +10142,14 @@ cdef class CUmemcpy3DOperand(CUmemcpy3DOperand_v1): Attributes ---------- - {{if 'CUmemcpy3DOperand_st.type' in found_struct}} + type : CUmemcpy3DOperandType - {{endif}} - {{if 'CUmemcpy3DOperand_st.op' in found_struct}} + + op : anon_union13 - {{endif}} + Methods ------- @@ -10643,34 +10157,32 @@ cdef class CUmemcpy3DOperand(CUmemcpy3DOperand_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_MEMCPY3D_BATCH_OP_v1' in found_types}} cdef class CUDA_MEMCPY3D_BATCH_OP_v1(CUDA_MEMCPY3D_BATCH_OP_st): """ Attributes ---------- - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.src' in found_struct}} + src : CUmemcpy3DOperand Source memcpy operand. - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.dst' in found_struct}} + + dst : CUmemcpy3DOperand Destination memcpy operand. - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.extent' in found_struct}} + + extent : CUextent3D Extents of the memcpy between src and dst. The width, height and depth components must not be 0. - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.srcAccessOrder' in found_struct}} + + srcAccessOrder : CUmemcpySrcAccessOrder Source access ordering to be observed for copy from src to dst. - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.flags' in found_struct}} + + flags : unsigned int Additional flags for copies with this attribute. See CUmemcpyFlags - {{endif}} + Methods ------- @@ -10678,34 +10190,32 @@ cdef class CUDA_MEMCPY3D_BATCH_OP_v1(CUDA_MEMCPY3D_BATCH_OP_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_MEMCPY3D_BATCH_OP' in found_types}} cdef class CUDA_MEMCPY3D_BATCH_OP(CUDA_MEMCPY3D_BATCH_OP_v1): """ Attributes ---------- - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.src' in found_struct}} + src : CUmemcpy3DOperand Source memcpy operand. - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.dst' in found_struct}} + + dst : CUmemcpy3DOperand Destination memcpy operand. - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.extent' in found_struct}} + + extent : CUextent3D Extents of the memcpy between src and dst. The width, height and depth components must not be 0. - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.srcAccessOrder' in found_struct}} + + srcAccessOrder : CUmemcpySrcAccessOrder Source access ordering to be observed for copy from src to dst. - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.flags' in found_struct}} + + flags : unsigned int Additional flags for copies with this attribute. See CUmemcpyFlags - {{endif}} + Methods ------- @@ -10713,8 +10223,6 @@ cdef class CUDA_MEMCPY3D_BATCH_OP(CUDA_MEMCPY3D_BATCH_OP_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1' in found_types}} cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v1(CUDA_MEM_ALLOC_NODE_PARAMS_v1_st): """ @@ -10722,30 +10230,30 @@ cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v1(CUDA_MEM_ALLOC_NODE_PARAMS_v1_st): Attributes ---------- - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.poolProps' in found_struct}} + poolProps : CUmemPoolProps in: location where the allocation should reside (specified in ::location). ::handleTypes must be CU_MEM_HANDLE_TYPE_NONE. IPC is not supported. - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.accessDescs' in found_struct}} + + accessDescs : CUmemAccessDesc in: array of memory access descriptors. Used to describe peer GPU access - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.accessDescCount' in found_struct}} + + accessDescCount : size_t in: number of memory access descriptors. Must not exceed the number of GPUs. - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.bytesize' in found_struct}} + + bytesize : size_t in: size in bytes of the requested allocation - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.dptr' in found_struct}} + + dptr : CUdeviceptr out: address of the allocation returned by CUDA - {{endif}} + Methods ------- @@ -10753,8 +10261,6 @@ cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v1(CUDA_MEM_ALLOC_NODE_PARAMS_v1_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_MEM_ALLOC_NODE_PARAMS' in found_types}} cdef class CUDA_MEM_ALLOC_NODE_PARAMS(CUDA_MEM_ALLOC_NODE_PARAMS_v1): """ @@ -10762,30 +10268,30 @@ cdef class CUDA_MEM_ALLOC_NODE_PARAMS(CUDA_MEM_ALLOC_NODE_PARAMS_v1): Attributes ---------- - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.poolProps' in found_struct}} + poolProps : CUmemPoolProps in: location where the allocation should reside (specified in ::location). ::handleTypes must be CU_MEM_HANDLE_TYPE_NONE. IPC is not supported. - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.accessDescs' in found_struct}} + + accessDescs : CUmemAccessDesc in: array of memory access descriptors. Used to describe peer GPU access - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.accessDescCount' in found_struct}} + + accessDescCount : size_t in: number of memory access descriptors. Must not exceed the number of GPUs. - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.bytesize' in found_struct}} + + bytesize : size_t in: size in bytes of the requested allocation - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.dptr' in found_struct}} + + dptr : CUdeviceptr out: address of the allocation returned by CUDA - {{endif}} + Methods ------- @@ -10793,8 +10299,6 @@ cdef class CUDA_MEM_ALLOC_NODE_PARAMS(CUDA_MEM_ALLOC_NODE_PARAMS_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2' in found_types}} cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v2(CUDA_MEM_ALLOC_NODE_PARAMS_v2_st): """ @@ -10802,30 +10306,30 @@ cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v2(CUDA_MEM_ALLOC_NODE_PARAMS_v2_st): Attributes ---------- - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.poolProps' in found_struct}} + poolProps : CUmemPoolProps in: location where the allocation should reside (specified in ::location). ::handleTypes must be CU_MEM_HANDLE_TYPE_NONE. IPC is not supported. - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.accessDescs' in found_struct}} + + accessDescs : CUmemAccessDesc in: array of memory access descriptors. Used to describe peer GPU access - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.accessDescCount' in found_struct}} + + accessDescCount : size_t in: number of memory access descriptors. Must not exceed the number of GPUs. - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.bytesize' in found_struct}} + + bytesize : size_t in: size in bytes of the requested allocation - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.dptr' in found_struct}} + + dptr : CUdeviceptr out: address of the allocation returned by CUDA - {{endif}} + Methods ------- @@ -10833,8 +10337,6 @@ cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v2(CUDA_MEM_ALLOC_NODE_PARAMS_v2_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_MEM_FREE_NODE_PARAMS' in found_types}} cdef class CUDA_MEM_FREE_NODE_PARAMS(CUDA_MEM_FREE_NODE_PARAMS_st): """ @@ -10842,10 +10344,10 @@ cdef class CUDA_MEM_FREE_NODE_PARAMS(CUDA_MEM_FREE_NODE_PARAMS_st): Attributes ---------- - {{if 'CUDA_MEM_FREE_NODE_PARAMS_st.dptr' in found_struct}} + dptr : CUdeviceptr in: the pointer to free - {{endif}} + Methods ------- @@ -10853,8 +10355,6 @@ cdef class CUDA_MEM_FREE_NODE_PARAMS(CUDA_MEM_FREE_NODE_PARAMS_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_CHILD_GRAPH_NODE_PARAMS' in found_types}} cdef class CUDA_CHILD_GRAPH_NODE_PARAMS(CUDA_CHILD_GRAPH_NODE_PARAMS_st): """ @@ -10862,18 +10362,18 @@ cdef class CUDA_CHILD_GRAPH_NODE_PARAMS(CUDA_CHILD_GRAPH_NODE_PARAMS_st): Attributes ---------- - {{if 'CUDA_CHILD_GRAPH_NODE_PARAMS_st.graph' in found_struct}} + graph : CUgraph The child graph to clone into the node for node creation, or a handle to the graph owned by the node for node query. The graph must not contain conditional nodes. Graphs containing memory allocation or memory free nodes must set the ownership to be moved to the parent. - {{endif}} - {{if 'CUDA_CHILD_GRAPH_NODE_PARAMS_st.ownership' in found_struct}} + + ownership : CUgraphChildGraphNodeOwnership The ownership relationship of the child graph node. - {{endif}} + Methods ------- @@ -10881,8 +10381,6 @@ cdef class CUDA_CHILD_GRAPH_NODE_PARAMS(CUDA_CHILD_GRAPH_NODE_PARAMS_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_EVENT_RECORD_NODE_PARAMS' in found_types}} cdef class CUDA_EVENT_RECORD_NODE_PARAMS(CUDA_EVENT_RECORD_NODE_PARAMS_st): """ @@ -10890,10 +10388,10 @@ cdef class CUDA_EVENT_RECORD_NODE_PARAMS(CUDA_EVENT_RECORD_NODE_PARAMS_st): Attributes ---------- - {{if 'CUDA_EVENT_RECORD_NODE_PARAMS_st.event' in found_struct}} + event : CUevent The event to record when the node executes - {{endif}} + Methods ------- @@ -10901,8 +10399,6 @@ cdef class CUDA_EVENT_RECORD_NODE_PARAMS(CUDA_EVENT_RECORD_NODE_PARAMS_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUDA_EVENT_WAIT_NODE_PARAMS' in found_types}} cdef class CUDA_EVENT_WAIT_NODE_PARAMS(CUDA_EVENT_WAIT_NODE_PARAMS_st): """ @@ -10910,10 +10406,10 @@ cdef class CUDA_EVENT_WAIT_NODE_PARAMS(CUDA_EVENT_WAIT_NODE_PARAMS_st): Attributes ---------- - {{if 'CUDA_EVENT_WAIT_NODE_PARAMS_st.event' in found_struct}} + event : CUevent The event to wait on from the node - {{endif}} + Methods ------- @@ -10921,8 +10417,6 @@ cdef class CUDA_EVENT_WAIT_NODE_PARAMS(CUDA_EVENT_WAIT_NODE_PARAMS_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUgraphNodeParams' in found_types}} cdef class CUgraphNodeParams(CUgraphNodeParams_st): """ @@ -10930,74 +10424,78 @@ cdef class CUgraphNodeParams(CUgraphNodeParams_st): Attributes ---------- - {{if 'CUgraphNodeParams_st.type' in found_struct}} + type : CUgraphNodeType Type of the node - {{endif}} - {{if 'CUgraphNodeParams_st.reserved0' in found_struct}} + + reserved0 : list[int] Reserved. Must be zero. - {{endif}} - {{if 'CUgraphNodeParams_st.reserved1' in found_struct}} + + reserved1 : list[long long] Padding. Unused bytes must be zero. - {{endif}} - {{if 'CUgraphNodeParams_st.kernel' in found_struct}} + + kernel : CUDA_KERNEL_NODE_PARAMS_v3 Kernel node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.memcpy' in found_struct}} + + memcpy : CUDA_MEMCPY_NODE_PARAMS Memcpy node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.memset' in found_struct}} + + memset : CUDA_MEMSET_NODE_PARAMS_v2 Memset node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.host' in found_struct}} + + host : CUDA_HOST_NODE_PARAMS_v2 Host node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.graph' in found_struct}} + + graph : CUDA_CHILD_GRAPH_NODE_PARAMS Child graph node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.eventWait' in found_struct}} + + eventWait : CUDA_EVENT_WAIT_NODE_PARAMS Event wait node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.eventRecord' in found_struct}} + + eventRecord : CUDA_EVENT_RECORD_NODE_PARAMS Event record node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.extSemSignal' in found_struct}} + + extSemSignal : CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 External semaphore signal node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.extSemWait' in found_struct}} + + extSemWait : CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 External semaphore wait node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.alloc' in found_struct}} + + alloc : CUDA_MEM_ALLOC_NODE_PARAMS_v2 Memory allocation node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.free' in found_struct}} + + free : CUDA_MEM_FREE_NODE_PARAMS Memory free node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.memOp' in found_struct}} + + memOp : CUDA_BATCH_MEM_OP_NODE_PARAMS_v2 MemOp node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.conditional' in found_struct}} + + conditional : CUDA_CONDITIONAL_NODE_PARAMS Conditional node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.reserved2' in found_struct}} + + + asBytes : bytes + Padding as bytes + + reserved2 : long long Reserved bytes. Must be zero. - {{endif}} + Methods ------- @@ -11005,8 +10503,6 @@ cdef class CUgraphNodeParams(CUgraphNodeParams_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUcheckpointLockArgs' in found_types}} cdef class CUcheckpointLockArgs(CUcheckpointLockArgs_st): """ @@ -11014,19 +10510,19 @@ cdef class CUcheckpointLockArgs(CUcheckpointLockArgs_st): Attributes ---------- - {{if 'CUcheckpointLockArgs_st.timeoutMs' in found_struct}} + timeoutMs : unsigned int Timeout in milliseconds to attempt to lock the process, 0 indicates no timeout - {{endif}} - {{if 'CUcheckpointLockArgs_st.reserved0' in found_struct}} + + reserved0 : unsigned int Reserved for future use, must be zero - {{endif}} - {{if 'CUcheckpointLockArgs_st.reserved1' in found_struct}} + + reserved1 : list[cuuint64_t] Reserved for future use, must be zeroed - {{endif}} + Methods ------- @@ -11034,8 +10530,6 @@ cdef class CUcheckpointLockArgs(CUcheckpointLockArgs_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUcheckpointCheckpointArgs' in found_types}} cdef class CUcheckpointCheckpointArgs(CUcheckpointCheckpointArgs_st): """ @@ -11043,10 +10537,10 @@ cdef class CUcheckpointCheckpointArgs(CUcheckpointCheckpointArgs_st): Attributes ---------- - {{if 'CUcheckpointCheckpointArgs_st.reserved' in found_struct}} + reserved : list[cuuint64_t] Reserved for future use, must be zeroed - {{endif}} + Methods ------- @@ -11054,8 +10548,6 @@ cdef class CUcheckpointCheckpointArgs(CUcheckpointCheckpointArgs_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUcheckpointGpuPair' in found_types}} cdef class CUcheckpointGpuPair(CUcheckpointGpuPair_st): """ @@ -11063,14 +10555,14 @@ cdef class CUcheckpointGpuPair(CUcheckpointGpuPair_st): Attributes ---------- - {{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 ------- @@ -11078,8 +10570,6 @@ cdef class CUcheckpointGpuPair(CUcheckpointGpuPair_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUcheckpointRestoreArgs' in found_types}} cdef class CUcheckpointRestoreArgs(CUcheckpointRestoreArgs_st): """ @@ -11087,23 +10577,23 @@ cdef class CUcheckpointRestoreArgs(CUcheckpointRestoreArgs_st): 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 : list[cuuint64_t] Reserved for future use, must be zeroed - {{endif}} + Methods ------- @@ -11111,8 +10601,6 @@ cdef class CUcheckpointRestoreArgs(CUcheckpointRestoreArgs_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUcheckpointUnlockArgs' in found_types}} cdef class CUcheckpointUnlockArgs(CUcheckpointUnlockArgs_st): """ @@ -11120,10 +10608,10 @@ cdef class CUcheckpointUnlockArgs(CUcheckpointUnlockArgs_st): Attributes ---------- - {{if 'CUcheckpointUnlockArgs_st.reserved' in found_struct}} + reserved : list[cuuint64_t] Reserved for future use, must be zeroed - {{endif}} + Methods ------- @@ -11131,8 +10619,6 @@ cdef class CUcheckpointUnlockArgs(CUcheckpointUnlockArgs_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUmemDecompressParams' in found_types}} cdef class CUmemDecompressParams(CUmemDecompressParams_st): """ @@ -11141,43 +10627,112 @@ cdef class CUmemDecompressParams(CUmemDecompressParams_st): Attributes ---------- - {{if 'CUmemDecompressParams_st.srcNumBytes' in found_struct}} + srcNumBytes : size_t The number of bytes to be read and decompressed from CUmemDecompressParams_st.src. - {{endif}} - {{if 'CUmemDecompressParams_st.dstNumBytes' in found_struct}} + + dstNumBytes : size_t The number of bytes that the decompression operation will be expected to write to CUmemDecompressParams_st.dst. This value is optional; if present, it may be used by the CUDA driver as a heuristic for scheduling the individual decompression operations. - {{endif}} - {{if 'CUmemDecompressParams_st.dstActBytes' in found_struct}} + + dstActBytes : cuuint32_t After the decompression operation has completed, the actual number of bytes written to CUmemDecompressParams.dst will be recorded as a 32-bit unsigned integer in the memory at this address. - {{endif}} - {{if 'CUmemDecompressParams_st.src' in found_struct}} + + src : Any Pointer to a buffer of at least CUmemDecompressParams_st.srcNumBytes compressed bytes. - {{endif}} - {{if 'CUmemDecompressParams_st.dst' in found_struct}} + + dst : Any Pointer to a buffer where the decompressed data will be written. The number of bytes written to this location will be recorded in the memory pointed to by CUmemDecompressParams_st.dstActBytes - {{endif}} - {{if 'CUmemDecompressParams_st.algo' in found_struct}} + + algo : CUmemDecompressAlgorithm The decompression algorithm to use. - {{endif}} - {{if 'CUmemDecompressParams_st.padding' in found_struct}} + + padding : bytes - {{endif}} + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUlogicalEndpointId: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUlogicalEndpointId _pvt_val + cdef cydriver.CUlogicalEndpointId* _pvt_ptr + +cdef class CUlogicalEndpointFabricHandle(CUlogicalEndpointFabricHandle_st): + """ + Fabric handle for a logical endpoint + + Attributes + ---------- + + data : bytes + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUlogicalEndpointProp(CUlogicalEndpointProp_struct): + """ + Properties of a logical endpoint construction + + Attributes + ---------- + + type : CUlogicalEndpointType + Type of the logical endpoint defined in CUlogicalEndpointType + + + unicast : anon_struct25 + + + + multicast : anon_struct26 + + + + size : unsigned long long + Size of the logical endpoint + + + ipcHandleTypes : unsigned int + A bitmask of IPC handle types defined in + CUlogicalEndpointIpcHandleType + + + flags : unsigned int + A bitmask of flags defined in CUlogicalEndpointFlag + Methods ------- @@ -11185,34 +10740,32 @@ cdef class CUmemDecompressParams(CUmemDecompressParams_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUdevSmResource' in found_types}} cdef class CUdevSmResource(CUdevSmResource_st): """ Attributes ---------- - {{if 'CUdevSmResource_st.smCount' in found_struct}} + smCount : unsigned int The amount of streaming multiprocessors available in this resource. - {{endif}} - {{if 'CUdevSmResource_st.minSmPartitionSize' in found_struct}} + + minSmPartitionSize : unsigned int The minimum number of streaming multiprocessors required to partition this resource. - {{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 will be a multiple of this value, unless the backfill flag is set. - {{endif}} - {{if 'CUdevSmResource_st.flags' in found_struct}} + + flags : unsigned int The flags set on this SM resource. For possible values see CUdevSmResourceGroup_flags. - {{endif}} + Methods ------- @@ -11220,25 +10773,23 @@ cdef class CUdevSmResource(CUdevSmResource_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUdevWorkqueueConfigResource' in found_types}} cdef class CUdevWorkqueueConfigResource(CUdevWorkqueueConfigResource_st): """ Attributes ---------- - {{if 'CUdevWorkqueueConfigResource_st.device' in found_struct}} + device : CUdevice The device on which the workqueue resources are available - {{endif}} - {{if 'CUdevWorkqueueConfigResource_st.wqConcurrencyLimit' in found_struct}} + + wqConcurrencyLimit : unsigned int The expected maximum number of concurrent stream-ordered workloads - {{endif}} - {{if 'CUdevWorkqueueConfigResource_st.sharingScope' in found_struct}} + + sharingScope : CUdevWorkqueueConfigScope The sharing scope for the workqueue resources - {{endif}} + Methods ------- @@ -11246,17 +10797,15 @@ cdef class CUdevWorkqueueConfigResource(CUdevWorkqueueConfigResource_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CUdevWorkqueueResource' in found_types}} cdef class CUdevWorkqueueResource(CUdevWorkqueueResource_st): """ Attributes ---------- - {{if 'CUdevWorkqueueResource_st.reserved' in found_struct}} + reserved : bytes Reserved for future use - {{endif}} + Methods ------- @@ -11264,36 +10813,34 @@ cdef class CUdevWorkqueueResource(CUdevWorkqueueResource_st): Get memory address of class instance """ pass -{{endif}} -{{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS' in found_types}} cdef class CU_DEV_SM_RESOURCE_GROUP_PARAMS(CU_DEV_SM_RESOURCE_GROUP_PARAMS_st): """ Attributes ---------- - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st.smCount' in found_struct}} + smCount : unsigned int The amount of SMs available in this resource. - {{endif}} - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st.coscheduledSmCount' in found_struct}} + + coscheduledSmCount : unsigned int The amount of co-scheduled SMs grouped together for locality purposes. - {{endif}} - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st.preferredCoscheduledSmCount' in found_struct}} + + preferredCoscheduledSmCount : unsigned int When possible, combine co-scheduled groups together into larger groups of this size. - {{endif}} - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st.flags' in found_struct}} + + flags : unsigned int The flags set on this SM resource group. For possible values see CUdevSmResourceGroup_flags. - {{endif}} - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -11301,43 +10848,41 @@ cdef class CU_DEV_SM_RESOURCE_GROUP_PARAMS(CU_DEV_SM_RESOURCE_GROUP_PARAMS_st): Get memory address of class instance """ pass -{{endif}} -{{if 'struct CUdevResource_st' in found_types}} cdef class CUdevResource_v1(CUdevResource_st): """ Attributes ---------- - {{if 'CUdevResource_st.type' in found_struct}} + type : CUdevResourceType Type of resource, dictates which union field was last set - {{endif}} - {{if 'CUdevResource_st._internal_padding' in found_struct}} + + _internal_padding : bytes - {{endif}} - {{if 'CUdevResource_st.sm' in found_struct}} + + sm : CUdevSmResource Resource corresponding to CU_DEV_RESOURCE_TYPE_SM `typename`. - {{endif}} - {{if 'CUdevResource_st.wqConfig' in found_struct}} + + wqConfig : CUdevWorkqueueConfigResource Resource corresponding to CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG `typename`. - {{endif}} - {{if 'CUdevResource_st.wq' in found_struct}} + + wq : CUdevWorkqueueResource Resource corresponding to CU_DEV_RESOURCE_TYPE_WORKQUEUE `typename`. - {{endif}} - {{if 'CUdevResource_st._oversize' in found_struct}} + + _oversize : bytes - {{endif}} - {{if 'CUdevResource_st.nextResource' in found_struct}} + + nextResource : CUdevResource_st - {{endif}} + Methods ------- @@ -11345,43 +10890,41 @@ cdef class CUdevResource_v1(CUdevResource_st): Get memory address of class instance """ pass -{{endif}} -{{if 'struct CUdevResource_st' in found_types}} cdef class CUdevResource(CUdevResource_v1): """ Attributes ---------- - {{if 'CUdevResource_st.type' in found_struct}} + type : CUdevResourceType Type of resource, dictates which union field was last set - {{endif}} - {{if 'CUdevResource_st._internal_padding' in found_struct}} + + _internal_padding : bytes - {{endif}} - {{if 'CUdevResource_st.sm' in found_struct}} + + sm : CUdevSmResource Resource corresponding to CU_DEV_RESOURCE_TYPE_SM `typename`. - {{endif}} - {{if 'CUdevResource_st.wqConfig' in found_struct}} + + wqConfig : CUdevWorkqueueConfigResource Resource corresponding to CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG `typename`. - {{endif}} - {{if 'CUdevResource_st.wq' in found_struct}} + + wq : CUdevWorkqueueResource Resource corresponding to CU_DEV_RESOURCE_TYPE_WORKQUEUE `typename`. - {{endif}} - {{if 'CUdevResource_st._oversize' in found_struct}} + + _oversize : bytes - {{endif}} - {{if 'CUdevResource_st.nextResource' in found_struct}} + + nextResource : CUdevResource_st - {{endif}} + Methods ------- @@ -11389,8 +10932,6 @@ cdef class CUdevResource(CUdevResource_v1): Get memory address of class instance """ pass -{{endif}} -{{if True}} cdef class CUeglFrame_v1(CUeglFrame_st): """ @@ -11400,46 +10941,46 @@ cdef class CUeglFrame_v1(CUeglFrame_st): Attributes ---------- - {{if True}} - frame : anon_union16 - {{endif}} - {{if True}} + frame : anon_union17 + + + width : unsigned int Width of first plane - {{endif}} - {{if True}} + + height : unsigned int Height of first plane - {{endif}} - {{if True}} + + depth : unsigned int Depth of first plane - {{endif}} - {{if True}} + + pitch : unsigned int Pitch of first plane - {{endif}} - {{if True}} + + planeCount : unsigned int Number of planes - {{endif}} - {{if True}} + + numChannels : unsigned int Number of channels for the plane - {{endif}} - {{if True}} + + frameType : CUeglFrameType Array or Pitch - {{endif}} - {{if True}} + + eglColorFormat : CUeglColorFormat CUDA EGL Color Format - {{endif}} - {{if True}} + + cuFormat : CUarray_format CUDA Array Format - {{endif}} + Methods ------- @@ -11447,8 +10988,6 @@ cdef class CUeglFrame_v1(CUeglFrame_st): Get memory address of class instance """ pass -{{endif}} -{{if True}} cdef class CUeglFrame(CUeglFrame_v1): """ @@ -11458,46 +10997,46 @@ cdef class CUeglFrame(CUeglFrame_v1): Attributes ---------- - {{if True}} - frame : anon_union16 - {{endif}} - {{if True}} + frame : anon_union17 + + + width : unsigned int Width of first plane - {{endif}} - {{if True}} + + height : unsigned int Height of first plane - {{endif}} - {{if True}} + + depth : unsigned int Depth of first plane - {{endif}} - {{if True}} + + pitch : unsigned int Pitch of first plane - {{endif}} - {{if True}} + + planeCount : unsigned int Number of planes - {{endif}} - {{if True}} + + numChannels : unsigned int Number of channels for the plane - {{endif}} - {{if True}} + + frameType : CUeglFrameType Array or Pitch - {{endif}} - {{if True}} + + eglColorFormat : CUeglColorFormat CUDA EGL Color Format - {{endif}} - {{if True}} + + cuFormat : CUarray_format CUDA Array Format - {{endif}} + Methods ------- @@ -11505,8 +11044,6 @@ cdef class CUeglFrame(CUeglFrame_v1): Get memory address of class instance """ pass -{{endif}} -{{if 'cuuint32_t' in found_types}} cdef class cuuint32_t: """ @@ -11519,9 +11056,6 @@ cdef class cuuint32_t: """ cdef cydriver.cuuint32_t _pvt_val cdef cydriver.cuuint32_t* _pvt_ptr -{{endif}} - -{{if 'cuuint64_t' in found_types}} cdef class cuuint64_t: """ @@ -11534,9 +11068,6 @@ cdef class cuuint64_t: """ cdef cydriver.cuuint64_t _pvt_val cdef cydriver.cuuint64_t* _pvt_ptr -{{endif}} - -{{if 'CUdeviceptr_v2' in found_types}} cdef class CUdeviceptr_v2: """ @@ -11551,9 +11082,6 @@ cdef class CUdeviceptr_v2: """ cdef cydriver.CUdeviceptr_v2 _pvt_val cdef cydriver.CUdeviceptr_v2* _pvt_ptr -{{endif}} - -{{if 'CUdevice_v1' in found_types}} cdef class CUdevice_v1: """ @@ -11568,9 +11096,6 @@ cdef class CUdevice_v1: """ cdef cydriver.CUdevice_v1 _pvt_val cdef cydriver.CUdevice_v1* _pvt_ptr -{{endif}} - -{{if 'CUtexObject_v1' in found_types}} cdef class CUtexObject_v1: """ @@ -11585,9 +11110,6 @@ cdef class CUtexObject_v1: """ cdef cydriver.CUtexObject_v1 _pvt_val cdef cydriver.CUtexObject_v1* _pvt_ptr -{{endif}} - -{{if 'CUsurfObject_v1' in found_types}} cdef class CUsurfObject_v1: """ @@ -11602,9 +11124,6 @@ cdef class CUsurfObject_v1: """ cdef cydriver.CUsurfObject_v1 _pvt_val cdef cydriver.CUsurfObject_v1* _pvt_ptr -{{endif}} - -{{if 'CUmemGenericAllocationHandle_v1' in found_types}} cdef class CUmemGenericAllocationHandle_v1: """ @@ -11617,9 +11136,6 @@ cdef class CUmemGenericAllocationHandle_v1: """ cdef cydriver.CUmemGenericAllocationHandle_v1 _pvt_val cdef cydriver.CUmemGenericAllocationHandle_v1* _pvt_ptr -{{endif}} - -{{if 'CUlogIterator' in found_types}} cdef class CUlogIterator: """ @@ -11632,9 +11148,6 @@ cdef class CUlogIterator: """ cdef cydriver.CUlogIterator _pvt_val cdef cydriver.CUlogIterator* _pvt_ptr -{{endif}} - -{{if True}} cdef class GLenum: """ @@ -11647,9 +11160,6 @@ cdef class GLenum: """ cdef cydriver.GLenum _pvt_val cdef cydriver.GLenum* _pvt_ptr -{{endif}} - -{{if True}} cdef class GLuint: """ @@ -11662,9 +11172,6 @@ cdef class GLuint: """ cdef cydriver.GLuint _pvt_val cdef cydriver.GLuint* _pvt_ptr -{{endif}} - -{{if True}} cdef class EGLint: """ @@ -11677,9 +11184,6 @@ cdef class EGLint: """ cdef cydriver.EGLint _pvt_val cdef cydriver.EGLint* _pvt_ptr -{{endif}} - -{{if True}} cdef class VdpDevice: """ @@ -11692,9 +11196,6 @@ cdef class VdpDevice: """ cdef cydriver.VdpDevice _pvt_val cdef cydriver.VdpDevice* _pvt_ptr -{{endif}} - -{{if True}} cdef class VdpGetProcAddress: """ @@ -11707,9 +11208,6 @@ cdef class VdpGetProcAddress: """ cdef cydriver.VdpGetProcAddress _pvt_val cdef cydriver.VdpGetProcAddress* _pvt_ptr -{{endif}} - -{{if True}} cdef class VdpVideoSurface: """ @@ -11722,9 +11220,6 @@ cdef class VdpVideoSurface: """ cdef cydriver.VdpVideoSurface _pvt_val cdef cydriver.VdpVideoSurface* _pvt_ptr -{{endif}} - -{{if True}} cdef class VdpOutputSurface: """ @@ -11737,4 +11232,3 @@ cdef class VdpOutputSurface: """ cdef cydriver.VdpOutputSurface _pvt_val cdef cydriver.VdpOutputSurface* _pvt_ptr -{{endif}} diff --git a/cuda_bindings/cuda/bindings/driver.pyx.in b/cuda_bindings/cuda/bindings/driver.pyx similarity index 85% rename from cuda_bindings/cuda/bindings/driver.pyx.in rename to cuda_bindings/cuda/bindings/driver.pyx index 70f83f4c931..44b7c4c567c 100644 --- a/cuda_bindings/cuda/bindings/driver.pyx.in +++ b/cuda_bindings/cuda/bindings/driver.pyx @@ -1,7 +1,8 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated with version 13.2.0, generator version 8797618. Do not modify it directly. +# This code was automatically generated with version 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=4a70be46627269cff03a2b89504463158d6e50d738cfde91e8c3ed1bf88fd9e0 from typing import Any, Optional import cython import ctypes @@ -52,16 +53,16 @@ CU_IPC_HANDLE_SIZE = cydriver.CU_IPC_HANDLE_SIZE #: Legacy stream handle #: -#: Stream handle that can be passed as a CUstream to use an implicit stream -#: with legacy synchronization behavior. +#: Stream handle that can be passed as a :py:obj:`~.CUstream` to use an +#: implicit stream with legacy synchronization behavior. #: #: See details of the \link_sync_behavior CU_STREAM_LEGACY = cydriver.CU_STREAM_LEGACY #: Per-thread stream handle #: -#: Stream handle that can be passed as a CUstream to use an implicit stream -#: with per-thread synchronization behavior. +#: Stream handle that can be passed as a :py:obj:`~.CUstream` to use an +#: implicit stream with per-thread synchronization behavior. #: #: See details of the \link_sync_behavior CU_STREAM_PER_THREAD = cydriver.CU_STREAM_PER_THREAD @@ -229,8 +230,8 @@ CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC = cydriver.CUDA_COOPERA #: If set, the CUDA array is a collection of layers, where each layer is #: either a 1D or a 2D array and the Depth member of -#: CUDA_ARRAY3D_DESCRIPTOR specifies the number of layers, not the depth of -#: a 3D array. +#: :py:obj:`~.CUDA_ARRAY3D_DESCRIPTOR` specifies the number of layers, not +#: the depth of a 3D array. CUDA_ARRAY3D_LAYERED = cydriver.CUDA_ARRAY3D_LAYERED #: Deprecated, use CUDA_ARRAY3D_LAYERED @@ -347,422 +348,382 @@ MAX_PLANES = cydriver.MAX_PLANES #: is infinite. CUDA_EGL_INFINITE_TIMEOUT = cydriver.CUDA_EGL_INFINITE_TIMEOUT -{{if 'CUipcMem_flags_enum' in found_types}} - class CUipcMem_flags(_FastEnum): """ CUDA Ipc Mem Flags """ - {{if 'CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS' in found_values}} + CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS = ( cydriver.CUipcMem_flags_enum.CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS, 'Automatically enable peer access between remote devices as needed\n' - ){{endif}} - -{{endif}} -{{if 'CUmemAttach_flags_enum' in found_types}} + ) class CUmemAttach_flags(_FastEnum): """ CUDA Mem Attach Flags """ - {{if 'CU_MEM_ATTACH_GLOBAL' in found_values}} + CU_MEM_ATTACH_GLOBAL = ( cydriver.CUmemAttach_flags_enum.CU_MEM_ATTACH_GLOBAL, 'Memory can be accessed by any stream on any device\n' - ){{endif}} - {{if 'CU_MEM_ATTACH_HOST' in found_values}} + ) + CU_MEM_ATTACH_HOST = ( cydriver.CUmemAttach_flags_enum.CU_MEM_ATTACH_HOST, 'Memory cannot be accessed by any stream on any device\n' - ){{endif}} - {{if 'CU_MEM_ATTACH_SINGLE' in found_values}} + ) + CU_MEM_ATTACH_SINGLE = ( cydriver.CUmemAttach_flags_enum.CU_MEM_ATTACH_SINGLE, 'Memory can only be accessed by a single stream on the associated device\n' - ){{endif}} - -{{endif}} -{{if 'CUctx_flags_enum' in found_types}} + ) class CUctx_flags(_FastEnum): """ Context creation flags """ - {{if 'CU_CTX_SCHED_AUTO' in found_values}} + CU_CTX_SCHED_AUTO = ( cydriver.CUctx_flags_enum.CU_CTX_SCHED_AUTO, 'Automatic scheduling\n' - ){{endif}} - {{if 'CU_CTX_SCHED_SPIN' in found_values}} + ) + CU_CTX_SCHED_SPIN = ( cydriver.CUctx_flags_enum.CU_CTX_SCHED_SPIN, 'Set spin as default scheduling\n' - ){{endif}} - {{if 'CU_CTX_SCHED_YIELD' in found_values}} + ) + CU_CTX_SCHED_YIELD = ( cydriver.CUctx_flags_enum.CU_CTX_SCHED_YIELD, 'Set yield as default scheduling\n' - ){{endif}} - {{if 'CU_CTX_SCHED_BLOCKING_SYNC' in found_values}} + ) + CU_CTX_SCHED_BLOCKING_SYNC = ( cydriver.CUctx_flags_enum.CU_CTX_SCHED_BLOCKING_SYNC, 'Set blocking synchronization as default scheduling\n' - ){{endif}} - {{if 'CU_CTX_BLOCKING_SYNC' in found_values}} + ) + CU_CTX_BLOCKING_SYNC = ( cydriver.CUctx_flags_enum.CU_CTX_BLOCKING_SYNC, - 'Set blocking synchronization as default scheduling [Deprecated]\n' - ){{endif}} - {{if 'CU_CTX_SCHED_MASK' in found_values}} - CU_CTX_SCHED_MASK = cydriver.CUctx_flags_enum.CU_CTX_SCHED_MASK{{endif}} - {{if 'CU_CTX_MAP_HOST' in found_values}} + 'Set blocking synchronization as default scheduling\n' + '[Deprecated]\n' + ) + + CU_CTX_SCHED_MASK = cydriver.CUctx_flags_enum.CU_CTX_SCHED_MASK + CU_CTX_MAP_HOST = ( cydriver.CUctx_flags_enum.CU_CTX_MAP_HOST, '[Deprecated]\n' - ){{endif}} - {{if 'CU_CTX_LMEM_RESIZE_TO_MAX' in found_values}} + ) + CU_CTX_LMEM_RESIZE_TO_MAX = ( cydriver.CUctx_flags_enum.CU_CTX_LMEM_RESIZE_TO_MAX, 'Keep local memory allocation after launch\n' - ){{endif}} - {{if 'CU_CTX_COREDUMP_ENABLE' in found_values}} + ) + CU_CTX_COREDUMP_ENABLE = ( cydriver.CUctx_flags_enum.CU_CTX_COREDUMP_ENABLE, 'Trigger coredumps from exceptions in this context\n' - ){{endif}} - {{if 'CU_CTX_USER_COREDUMP_ENABLE' in found_values}} + ) + CU_CTX_USER_COREDUMP_ENABLE = ( cydriver.CUctx_flags_enum.CU_CTX_USER_COREDUMP_ENABLE, 'Enable user pipe to trigger coredumps in this context\n' - ){{endif}} - {{if 'CU_CTX_SYNC_MEMOPS' in found_values}} + ) + CU_CTX_SYNC_MEMOPS = ( cydriver.CUctx_flags_enum.CU_CTX_SYNC_MEMOPS, 'Ensure synchronous memory operations on this context will synchronize\n' - ){{endif}} - {{if 'CU_CTX_FLAGS_MASK' in found_values}} - CU_CTX_FLAGS_MASK = cydriver.CUctx_flags_enum.CU_CTX_FLAGS_MASK{{endif}} + ) -{{endif}} -{{if 'CUevent_sched_flags_enum' in found_types}} + CU_CTX_FLAGS_MASK = cydriver.CUctx_flags_enum.CU_CTX_FLAGS_MASK class CUevent_sched_flags(_FastEnum): """ Event sched flags """ - {{if 'CU_EVENT_SCHED_AUTO' in found_values}} + CU_EVENT_SCHED_AUTO = ( cydriver.CUevent_sched_flags_enum.CU_EVENT_SCHED_AUTO, 'Automatic scheduling\n' - ){{endif}} - {{if 'CU_EVENT_SCHED_SPIN' in found_values}} + ) + CU_EVENT_SCHED_SPIN = ( cydriver.CUevent_sched_flags_enum.CU_EVENT_SCHED_SPIN, 'Set spin as default scheduling\n' - ){{endif}} - {{if 'CU_EVENT_SCHED_YIELD' in found_values}} + ) + CU_EVENT_SCHED_YIELD = ( cydriver.CUevent_sched_flags_enum.CU_EVENT_SCHED_YIELD, 'Set yield as default scheduling\n' - ){{endif}} - {{if 'CU_EVENT_SCHED_BLOCKING_SYNC' in found_values}} + ) + CU_EVENT_SCHED_BLOCKING_SYNC = ( cydriver.CUevent_sched_flags_enum.CU_EVENT_SCHED_BLOCKING_SYNC, 'Set blocking synchronization as default scheduling\n' - ){{endif}} - -{{endif}} -{{if 'cl_event_flags_enum' in found_types}} + ) class cl_event_flags(_FastEnum): """ NVCL event scheduling flags """ - {{if 'NVCL_EVENT_SCHED_AUTO' in found_values}} + NVCL_EVENT_SCHED_AUTO = ( cydriver.cl_event_flags_enum.NVCL_EVENT_SCHED_AUTO, 'Automatic scheduling\n' - ){{endif}} - {{if 'NVCL_EVENT_SCHED_SPIN' in found_values}} + ) + NVCL_EVENT_SCHED_SPIN = ( cydriver.cl_event_flags_enum.NVCL_EVENT_SCHED_SPIN, 'Set spin as default scheduling\n' - ){{endif}} - {{if 'NVCL_EVENT_SCHED_YIELD' in found_values}} + ) + NVCL_EVENT_SCHED_YIELD = ( cydriver.cl_event_flags_enum.NVCL_EVENT_SCHED_YIELD, 'Set yield as default scheduling\n' - ){{endif}} - {{if 'NVCL_EVENT_SCHED_BLOCKING_SYNC' in found_values}} + ) + NVCL_EVENT_SCHED_BLOCKING_SYNC = ( cydriver.cl_event_flags_enum.NVCL_EVENT_SCHED_BLOCKING_SYNC, 'Set blocking synchronization as default scheduling\n' - ){{endif}} - -{{endif}} -{{if 'cl_context_flags_enum' in found_types}} + ) class cl_context_flags(_FastEnum): """ NVCL context scheduling flags """ - {{if 'NVCL_CTX_SCHED_AUTO' in found_values}} + NVCL_CTX_SCHED_AUTO = ( cydriver.cl_context_flags_enum.NVCL_CTX_SCHED_AUTO, 'Automatic scheduling\n' - ){{endif}} - {{if 'NVCL_CTX_SCHED_SPIN' in found_values}} + ) + NVCL_CTX_SCHED_SPIN = ( cydriver.cl_context_flags_enum.NVCL_CTX_SCHED_SPIN, 'Set spin as default scheduling\n' - ){{endif}} - {{if 'NVCL_CTX_SCHED_YIELD' in found_values}} + ) + NVCL_CTX_SCHED_YIELD = ( cydriver.cl_context_flags_enum.NVCL_CTX_SCHED_YIELD, 'Set yield as default scheduling\n' - ){{endif}} - {{if 'NVCL_CTX_SCHED_BLOCKING_SYNC' in found_values}} + ) + NVCL_CTX_SCHED_BLOCKING_SYNC = ( cydriver.cl_context_flags_enum.NVCL_CTX_SCHED_BLOCKING_SYNC, 'Set blocking synchronization as default scheduling\n' - ){{endif}} - -{{endif}} -{{if 'CUhostTaskSyncMode_enum' in found_types}} + ) class CUhostTaskSyncMode(_FastEnum): """ """ - {{if 'CU_HOST_TASK_BLOCKING' in found_values}} + CU_HOST_TASK_BLOCKING = ( cydriver.CUhostTaskSyncMode_enum.CU_HOST_TASK_BLOCKING, 'The execution thread will block until new host tasks are ready to run\n' - ){{endif}} - {{if 'CU_HOST_TASK_SPINWAIT' in found_values}} + ) + CU_HOST_TASK_SPINWAIT = ( cydriver.CUhostTaskSyncMode_enum.CU_HOST_TASK_SPINWAIT, 'The execution thread will spin wait until new host tasks are ready to run\n' - ){{endif}} - -{{endif}} -{{if 'CUstream_flags_enum' in found_types}} + ) class CUstream_flags(_FastEnum): """ Stream creation flags """ - {{if 'CU_STREAM_DEFAULT' in found_values}} + CU_STREAM_DEFAULT = ( cydriver.CUstream_flags_enum.CU_STREAM_DEFAULT, 'Default stream flag\n' - ){{endif}} - {{if 'CU_STREAM_NON_BLOCKING' in found_values}} + ) + CU_STREAM_NON_BLOCKING = ( cydriver.CUstream_flags_enum.CU_STREAM_NON_BLOCKING, 'Stream does not synchronize with stream 0 (the NULL stream)\n' - ){{endif}} - -{{endif}} -{{if 'CUevent_flags_enum' in found_types}} + ) class CUevent_flags(_FastEnum): """ Event creation flags """ - {{if 'CU_EVENT_DEFAULT' in found_values}} + CU_EVENT_DEFAULT = ( cydriver.CUevent_flags_enum.CU_EVENT_DEFAULT, 'Default event flag\n' - ){{endif}} - {{if 'CU_EVENT_BLOCKING_SYNC' in found_values}} + ) + CU_EVENT_BLOCKING_SYNC = ( cydriver.CUevent_flags_enum.CU_EVENT_BLOCKING_SYNC, 'Event uses blocking synchronization\n' - ){{endif}} - {{if 'CU_EVENT_DISABLE_TIMING' in found_values}} + ) + CU_EVENT_DISABLE_TIMING = ( cydriver.CUevent_flags_enum.CU_EVENT_DISABLE_TIMING, 'Event will not record timing data\n' - ){{endif}} - {{if 'CU_EVENT_INTERPROCESS' in found_values}} + ) + CU_EVENT_INTERPROCESS = ( cydriver.CUevent_flags_enum.CU_EVENT_INTERPROCESS, 'Event is suitable for interprocess use. CU_EVENT_DISABLE_TIMING must be set\n' - ){{endif}} - -{{endif}} -{{if 'CUevent_record_flags_enum' in found_types}} + ) class CUevent_record_flags(_FastEnum): """ Event record flags """ - {{if 'CU_EVENT_RECORD_DEFAULT' in found_values}} + CU_EVENT_RECORD_DEFAULT = ( cydriver.CUevent_record_flags_enum.CU_EVENT_RECORD_DEFAULT, 'Default event record flag\n' - ){{endif}} - {{if 'CU_EVENT_RECORD_EXTERNAL' in found_values}} + ) + CU_EVENT_RECORD_EXTERNAL = ( cydriver.CUevent_record_flags_enum.CU_EVENT_RECORD_EXTERNAL, 'When using stream capture, create an event record node instead of the\n' 'default behavior. This flag is invalid when used outside of capture.\n' - ){{endif}} - -{{endif}} -{{if 'CUevent_wait_flags_enum' in found_types}} + ) class CUevent_wait_flags(_FastEnum): """ Event wait flags """ - {{if 'CU_EVENT_WAIT_DEFAULT' in found_values}} + CU_EVENT_WAIT_DEFAULT = ( cydriver.CUevent_wait_flags_enum.CU_EVENT_WAIT_DEFAULT, 'Default event wait flag\n' - ){{endif}} - {{if 'CU_EVENT_WAIT_EXTERNAL' in found_values}} + ) + CU_EVENT_WAIT_EXTERNAL = ( cydriver.CUevent_wait_flags_enum.CU_EVENT_WAIT_EXTERNAL, 'When using stream capture, create an event wait node instead of the default\n' 'behavior. This flag is invalid when used outside of capture.\n' - ){{endif}} - -{{endif}} -{{if 'CUatomicOperation_enum' in found_types}} + ) class CUatomicOperation(_FastEnum): """ 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}} - -{{endif}} -{{if 'CUatomicOperationCapability_enum' in found_types}} + + CU_ATOMIC_OPERATION_INTEGER_ADD = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_INTEGER_ADD + + CU_ATOMIC_OPERATION_INTEGER_MIN = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_INTEGER_MIN + + CU_ATOMIC_OPERATION_INTEGER_MAX = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_INTEGER_MAX + + CU_ATOMIC_OPERATION_INTEGER_INCREMENT = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_INTEGER_INCREMENT + + CU_ATOMIC_OPERATION_INTEGER_DECREMENT = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_INTEGER_DECREMENT + + CU_ATOMIC_OPERATION_AND = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_AND + + CU_ATOMIC_OPERATION_OR = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_OR + + CU_ATOMIC_OPERATION_XOR = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_XOR + + CU_ATOMIC_OPERATION_EXCHANGE = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_EXCHANGE + + CU_ATOMIC_OPERATION_CAS = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_CAS + + CU_ATOMIC_OPERATION_FLOAT_ADD = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_FLOAT_ADD + + CU_ATOMIC_OPERATION_FLOAT_MIN = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_FLOAT_MIN + + CU_ATOMIC_OPERATION_FLOAT_MAX = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_FLOAT_MAX + + CU_ATOMIC_OPERATION_MAX = cydriver.CUatomicOperation_enum.CU_ATOMIC_OPERATION_MAX class CUatomicOperationCapability(_FastEnum): """ 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}} - -{{endif}} -{{if 'CUstreamWaitValue_flags_enum' in found_types}} + + CU_ATOMIC_CAPABILITY_SIGNED = cydriver.CUatomicOperationCapability_enum.CU_ATOMIC_CAPABILITY_SIGNED + + CU_ATOMIC_CAPABILITY_UNSIGNED = cydriver.CUatomicOperationCapability_enum.CU_ATOMIC_CAPABILITY_UNSIGNED + + CU_ATOMIC_CAPABILITY_REDUCTION = cydriver.CUatomicOperationCapability_enum.CU_ATOMIC_CAPABILITY_REDUCTION + + CU_ATOMIC_CAPABILITY_SCALAR_32 = cydriver.CUatomicOperationCapability_enum.CU_ATOMIC_CAPABILITY_SCALAR_32 + + CU_ATOMIC_CAPABILITY_SCALAR_64 = cydriver.CUatomicOperationCapability_enum.CU_ATOMIC_CAPABILITY_SCALAR_64 + + CU_ATOMIC_CAPABILITY_SCALAR_128 = cydriver.CUatomicOperationCapability_enum.CU_ATOMIC_CAPABILITY_SCALAR_128 + + CU_ATOMIC_CAPABILITY_VECTOR_32x4 = cydriver.CUatomicOperationCapability_enum.CU_ATOMIC_CAPABILITY_VECTOR_32x4 class CUstreamWaitValue_flags(_FastEnum): """ Flags for :py:obj:`~.cuStreamWaitValue32` and :py:obj:`~.cuStreamWaitValue64` """ - {{if 'CU_STREAM_WAIT_VALUE_GEQ' in found_values}} + CU_STREAM_WAIT_VALUE_GEQ = ( cydriver.CUstreamWaitValue_flags_enum.CU_STREAM_WAIT_VALUE_GEQ, 'Wait until (int32_t)(*addr - value) >= 0 (or int64_t for 64 bit values).\n' 'Note this is a cyclic comparison which ignores wraparound. (Default\n' 'behavior.)\n' - ){{endif}} - {{if 'CU_STREAM_WAIT_VALUE_EQ' in found_values}} + ) + CU_STREAM_WAIT_VALUE_EQ = ( cydriver.CUstreamWaitValue_flags_enum.CU_STREAM_WAIT_VALUE_EQ, 'Wait until *addr == value.\n' - ){{endif}} - {{if 'CU_STREAM_WAIT_VALUE_AND' in found_values}} + ) + CU_STREAM_WAIT_VALUE_AND = ( cydriver.CUstreamWaitValue_flags_enum.CU_STREAM_WAIT_VALUE_AND, 'Wait until (*addr & value) != 0.\n' - ){{endif}} - {{if 'CU_STREAM_WAIT_VALUE_NOR' in found_values}} + ) + CU_STREAM_WAIT_VALUE_NOR = ( cydriver.CUstreamWaitValue_flags_enum.CU_STREAM_WAIT_VALUE_NOR, 'Wait until ~(*addr | value) != 0. Support for this operation can be queried\n' 'with :py:obj:`~.cuDeviceGetAttribute()` and\n' ':py:obj:`~.CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR`.\n' - ){{endif}} - {{if 'CU_STREAM_WAIT_VALUE_FLUSH' in found_values}} + ) + CU_STREAM_WAIT_VALUE_FLUSH = ( cydriver.CUstreamWaitValue_flags_enum.CU_STREAM_WAIT_VALUE_FLUSH, @@ -775,22 +736,19 @@ class CUstreamWaitValue_flags(_FastEnum): 'second write, and downstream work needs to observe the first write. Support\n' 'for this operation is restricted to selected platforms and can be queried\n' 'with :py:obj:`~.CU_DEVICE_ATTRIBUTE_CAN_FLUSH_REMOTE_WRITES`.\n' - ){{endif}} - -{{endif}} -{{if 'CUstreamWriteValue_flags_enum' in found_types}} + ) class CUstreamWriteValue_flags(_FastEnum): """ Flags for :py:obj:`~.cuStreamWriteValue32` """ - {{if 'CU_STREAM_WRITE_VALUE_DEFAULT' in found_values}} + CU_STREAM_WRITE_VALUE_DEFAULT = ( cydriver.CUstreamWriteValue_flags_enum.CU_STREAM_WRITE_VALUE_DEFAULT, 'Default behavior\n' - ){{endif}} - {{if 'CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER' in found_values}} + ) + CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER = ( cydriver.CUstreamWriteValue_flags_enum.CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER, @@ -799,1404 +757,1374 @@ class CUstreamWriteValue_flags(_FastEnum): 'will provide a memory fence before the write, which has similar semantics\n' 'to __threadfence_system() but is scoped to the stream rather than a CUDA\n' 'thread. This flag is not supported in the v2 API.\n' - ){{endif}} - -{{endif}} -{{if 'CUstreamBatchMemOpType_enum' in found_types}} + ) class CUstreamBatchMemOpType(_FastEnum): """ Operations for :py:obj:`~.cuStreamBatchMemOp` """ - {{if 'CU_STREAM_MEM_OP_WAIT_VALUE_32' in found_values}} + CU_STREAM_MEM_OP_WAIT_VALUE_32 = ( cydriver.CUstreamBatchMemOpType_enum.CU_STREAM_MEM_OP_WAIT_VALUE_32, 'Represents a :py:obj:`~.cuStreamWaitValue32` operation\n' - ){{endif}} - {{if 'CU_STREAM_MEM_OP_WRITE_VALUE_32' in found_values}} + ) + CU_STREAM_MEM_OP_WRITE_VALUE_32 = ( cydriver.CUstreamBatchMemOpType_enum.CU_STREAM_MEM_OP_WRITE_VALUE_32, 'Represents a :py:obj:`~.cuStreamWriteValue32` operation\n' - ){{endif}} - {{if 'CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES' in found_values}} + ) + CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES = ( cydriver.CUstreamBatchMemOpType_enum.CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES, 'This has the same effect as :py:obj:`~.CU_STREAM_WAIT_VALUE_FLUSH`, but as\n' 'a standalone operation.\n' - ){{endif}} - {{if 'CU_STREAM_MEM_OP_WAIT_VALUE_64' in found_values}} + ) + CU_STREAM_MEM_OP_WAIT_VALUE_64 = ( cydriver.CUstreamBatchMemOpType_enum.CU_STREAM_MEM_OP_WAIT_VALUE_64, 'Represents a :py:obj:`~.cuStreamWaitValue64` operation\n' - ){{endif}} - {{if 'CU_STREAM_MEM_OP_WRITE_VALUE_64' in found_values}} + ) + CU_STREAM_MEM_OP_WRITE_VALUE_64 = ( cydriver.CUstreamBatchMemOpType_enum.CU_STREAM_MEM_OP_WRITE_VALUE_64, 'Represents a :py:obj:`~.cuStreamWriteValue64` operation\n' - ){{endif}} - {{if 'CU_STREAM_MEM_OP_BARRIER' in found_values}} + ) + CU_STREAM_MEM_OP_BARRIER = ( cydriver.CUstreamBatchMemOpType_enum.CU_STREAM_MEM_OP_BARRIER, 'Insert a memory barrier of the specified type\n' - ){{endif}} - {{if 'CU_STREAM_MEM_OP_ATOMIC_REDUCTION' in found_values}} + ) + CU_STREAM_MEM_OP_ATOMIC_REDUCTION = ( cydriver.CUstreamBatchMemOpType_enum.CU_STREAM_MEM_OP_ATOMIC_REDUCTION, 'Perform a atomic reduction. See\n' - ':py:obj:`~.CUstreamBatchMemOpParams`::atomicReduction\n' - ){{endif}} - -{{endif}} -{{if 'CUstreamMemoryBarrier_flags_enum' in found_types}} + ':py:obj:`~.CUstreamBatchMemOpParams.atomicReduction`\n' + ) class CUstreamMemoryBarrier_flags(_FastEnum): """ Flags for :py:obj:`~.CUstreamBatchMemOpParams.memoryBarrier` """ - {{if 'CU_STREAM_MEMORY_BARRIER_TYPE_SYS' in found_values}} + CU_STREAM_MEMORY_BARRIER_TYPE_SYS = ( cydriver.CUstreamMemoryBarrier_flags_enum.CU_STREAM_MEMORY_BARRIER_TYPE_SYS, 'System-wide memory barrier.\n' - ){{endif}} - {{if 'CU_STREAM_MEMORY_BARRIER_TYPE_GPU' in found_values}} + ) + CU_STREAM_MEMORY_BARRIER_TYPE_GPU = ( cydriver.CUstreamMemoryBarrier_flags_enum.CU_STREAM_MEMORY_BARRIER_TYPE_GPU, 'Limit memory barrier scope to the GPU.\n' - ){{endif}} - -{{endif}} -{{if 'CUstreamAtomicReductionOpType_enum' in found_types}} + ) class CUstreamAtomicReductionOpType(_FastEnum): """ Atomic reduction operation types for - :py:obj:`~.CUstreamBatchMemOpParams`::atomicReduction::reductionOp + :py:obj:`~.CUstreamBatchMemOpParams.atomicReduction.reductionOp` """ - {{if 'CU_STREAM_ATOMIC_REDUCTION_OP_ADD' in found_values}} + CU_STREAM_ATOMIC_REDUCTION_OP_ADD = ( cydriver.CUstreamAtomicReductionOpType_enum.CU_STREAM_ATOMIC_REDUCTION_OP_ADD, 'Performs an atomic ADD: *(address) = *(address) + value\n' - ){{endif}} - {{if 'CU_STREAM_ATOMIC_REDUCTION_OP_AND' in found_values}} + ) + CU_STREAM_ATOMIC_REDUCTION_OP_AND = ( cydriver.CUstreamAtomicReductionOpType_enum.CU_STREAM_ATOMIC_REDUCTION_OP_AND, 'Performs an atomic AND: *(address) = *(address) & value\n' - ){{endif}} - {{if 'CU_STREAM_ATOMIC_REDUCTION_OP_OR' in found_values}} + ) + CU_STREAM_ATOMIC_REDUCTION_OP_OR = ( cydriver.CUstreamAtomicReductionOpType_enum.CU_STREAM_ATOMIC_REDUCTION_OP_OR, 'Performs an atomic OR: *(address) = *(address) | value\n' - ){{endif}} - -{{endif}} -{{if 'CUstreamAtomicReductionDataType_enum' in found_types}} + ) class CUstreamAtomicReductionDataType(_FastEnum): """ Atomic reduction data types for - :py:obj:`~.CUstreamBatchMemOpParams`::atomicReduction::dataType + :py:obj:`~.CUstreamBatchMemOpParams.atomicReduction.dataType` """ - {{if 'CU_STREAM_ATOMIC_REDUCTION_UNSIGNED_32' in found_values}} - CU_STREAM_ATOMIC_REDUCTION_UNSIGNED_32 = cydriver.CUstreamAtomicReductionDataType_enum.CU_STREAM_ATOMIC_REDUCTION_UNSIGNED_32{{endif}} - {{if 'CU_STREAM_ATOMIC_REDUCTION_UNSIGNED_64' in found_values}} - CU_STREAM_ATOMIC_REDUCTION_UNSIGNED_64 = cydriver.CUstreamAtomicReductionDataType_enum.CU_STREAM_ATOMIC_REDUCTION_UNSIGNED_64{{endif}} -{{endif}} -{{if 'CUoccupancy_flags_enum' in found_types}} + CU_STREAM_ATOMIC_REDUCTION_UNSIGNED_32 = cydriver.CUstreamAtomicReductionDataType_enum.CU_STREAM_ATOMIC_REDUCTION_UNSIGNED_32 + + CU_STREAM_ATOMIC_REDUCTION_UNSIGNED_64 = cydriver.CUstreamAtomicReductionDataType_enum.CU_STREAM_ATOMIC_REDUCTION_UNSIGNED_64 class CUoccupancy_flags(_FastEnum): """ Occupancy calculator flag """ - {{if 'CU_OCCUPANCY_DEFAULT' in found_values}} + CU_OCCUPANCY_DEFAULT = ( cydriver.CUoccupancy_flags_enum.CU_OCCUPANCY_DEFAULT, 'Default behavior\n' - ){{endif}} - {{if 'CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE' in found_values}} + ) + CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE = ( cydriver.CUoccupancy_flags_enum.CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE, 'Assume global caching is enabled and cannot be automatically turned off\n' - ){{endif}} - -{{endif}} -{{if 'CUstreamUpdateCaptureDependencies_flags_enum' in found_types}} + ) class CUstreamUpdateCaptureDependencies_flags(_FastEnum): """ Flags for :py:obj:`~.cuStreamUpdateCaptureDependencies` """ - {{if 'CU_STREAM_ADD_CAPTURE_DEPENDENCIES' in found_values}} + CU_STREAM_ADD_CAPTURE_DEPENDENCIES = ( cydriver.CUstreamUpdateCaptureDependencies_flags_enum.CU_STREAM_ADD_CAPTURE_DEPENDENCIES, 'Add new nodes to the dependency set\n' - ){{endif}} - {{if 'CU_STREAM_SET_CAPTURE_DEPENDENCIES' in found_values}} + ) + CU_STREAM_SET_CAPTURE_DEPENDENCIES = ( cydriver.CUstreamUpdateCaptureDependencies_flags_enum.CU_STREAM_SET_CAPTURE_DEPENDENCIES, 'Replace the dependency set with the new nodes\n' - ){{endif}} - -{{endif}} -{{if 'CUasyncNotificationType_enum' in found_types}} + ) class CUasyncNotificationType(_FastEnum): """ Types of async notification that can be sent """ - {{if 'CU_ASYNC_NOTIFICATION_TYPE_OVER_BUDGET' in found_values}} + CU_ASYNC_NOTIFICATION_TYPE_OVER_BUDGET = ( cydriver.CUasyncNotificationType_enum.CU_ASYNC_NOTIFICATION_TYPE_OVER_BUDGET, 'Sent when the process has exceeded its device memory budget\n' - ){{endif}} - -{{endif}} -{{if 'CUarray_format_enum' in found_types}} + ) class CUarray_format(_FastEnum): """ Array formats """ - {{if 'CU_AD_FORMAT_UNSIGNED_INT8' in found_values}} + CU_AD_FORMAT_UNSIGNED_INT8 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT8, 'Unsigned 8-bit integers\n' - ){{endif}} - {{if 'CU_AD_FORMAT_UNSIGNED_INT16' in found_values}} + ) + CU_AD_FORMAT_UNSIGNED_INT16 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT16, 'Unsigned 16-bit integers\n' - ){{endif}} - {{if 'CU_AD_FORMAT_UNSIGNED_INT32' in found_values}} + ) + CU_AD_FORMAT_UNSIGNED_INT32 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_UNSIGNED_INT32, 'Unsigned 32-bit integers\n' - ){{endif}} - {{if 'CU_AD_FORMAT_SIGNED_INT8' in found_values}} + ) + CU_AD_FORMAT_SIGNED_INT8 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT8, 'Signed 8-bit integers\n' - ){{endif}} - {{if 'CU_AD_FORMAT_SIGNED_INT16' in found_values}} + ) + CU_AD_FORMAT_SIGNED_INT16 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT16, 'Signed 16-bit integers\n' - ){{endif}} - {{if 'CU_AD_FORMAT_SIGNED_INT32' in found_values}} + ) + CU_AD_FORMAT_SIGNED_INT32 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_SIGNED_INT32, 'Signed 32-bit integers\n' - ){{endif}} - {{if 'CU_AD_FORMAT_HALF' in found_values}} + ) + CU_AD_FORMAT_HALF = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_HALF, '16-bit floating point\n' - ){{endif}} - {{if 'CU_AD_FORMAT_FLOAT' in found_values}} + ) + CU_AD_FORMAT_FLOAT = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_FLOAT, '32-bit floating point\n' - ){{endif}} - {{if 'CU_AD_FORMAT_UNORM_INT_101010_2' in found_values}} + ) + CU_AD_FORMAT_UNORM_INT_101010_2 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_UNORM_INT_101010_2, '4 channel unorm R10G10B10A2 RGB format\n' - ){{endif}} - {{if 'CU_AD_FORMAT_UINT8_PACKED_422' in found_values}} + ) + CU_AD_FORMAT_UINT8_PACKED_422 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_UINT8_PACKED_422, '4 channel unsigned 8-bit YUV packed format, with 4:2:2 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_UINT8_PACKED_444' in found_values}} + ) + CU_AD_FORMAT_UINT8_PACKED_444 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_UINT8_PACKED_444, '4 channel unsigned 8-bit YUV packed format, with 4:4:4 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_UINT8_SEMIPLANAR_420' in found_values}} + ) + CU_AD_FORMAT_UINT8_SEMIPLANAR_420 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_UINT8_SEMIPLANAR_420, '3 channel unsigned 8-bit YUV semi-planar format, with 4:2:0 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_UINT16_SEMIPLANAR_420' in found_values}} + ) + CU_AD_FORMAT_UINT16_SEMIPLANAR_420 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_UINT16_SEMIPLANAR_420, '3 channel unsigned 16-bit YUV semi-planar format, with 4:2:0 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_UINT8_SEMIPLANAR_422' in found_values}} + ) + CU_AD_FORMAT_UINT8_SEMIPLANAR_422 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_UINT8_SEMIPLANAR_422, '3 channel unsigned 8-bit YUV semi-planar format, with 4:2:2 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_UINT16_SEMIPLANAR_422' in found_values}} + ) + CU_AD_FORMAT_UINT16_SEMIPLANAR_422 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_UINT16_SEMIPLANAR_422, '3 channel unsigned 16-bit YUV semi-planar format, with 4:2:2 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_UINT8_SEMIPLANAR_444' in found_values}} + ) + CU_AD_FORMAT_UINT8_SEMIPLANAR_444 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_UINT8_SEMIPLANAR_444, '3 channel unsigned 8-bit YUV semi-planar format, with 4:4:4 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_UINT16_SEMIPLANAR_444' in found_values}} + ) + CU_AD_FORMAT_UINT16_SEMIPLANAR_444 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_UINT16_SEMIPLANAR_444, '3 channel unsigned 16-bit YUV semi-planar format, with 4:4:4 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_UINT8_PLANAR_420' in found_values}} + ) + CU_AD_FORMAT_UINT8_PLANAR_420 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_UINT8_PLANAR_420, '3 channel unsigned 8-bit YUV planar format, with 4:2:0 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_UINT16_PLANAR_420' in found_values}} + ) + CU_AD_FORMAT_UINT16_PLANAR_420 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_UINT16_PLANAR_420, '3 channel unsigned 16-bit YUV planar format, with 4:2:0 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_UINT8_PLANAR_422' in found_values}} + ) + CU_AD_FORMAT_UINT8_PLANAR_422 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_UINT8_PLANAR_422, '3 channel unsigned 8-bit YUV planar format, with 4:2:2 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_UINT16_PLANAR_422' in found_values}} + ) + CU_AD_FORMAT_UINT16_PLANAR_422 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_UINT16_PLANAR_422, '3 channel unsigned 16-bit YUV planar format, with 4:2:2 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_UINT8_PLANAR_444' in found_values}} + ) + CU_AD_FORMAT_UINT8_PLANAR_444 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_UINT8_PLANAR_444, '3 channel unsigned 8-bit YUV planar format, with 4:4:4 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_UINT16_PLANAR_444' in found_values}} + ) + CU_AD_FORMAT_UINT16_PLANAR_444 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_UINT16_PLANAR_444, '3 channel unsigned 16-bit YUV planar format, with 4:4:4 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_BC1_UNORM' in found_values}} + ) + CU_AD_FORMAT_BC1_UNORM = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_BC1_UNORM, '4 channel unsigned normalized block-compressed (BC1 compression) format\n' - ){{endif}} - {{if 'CU_AD_FORMAT_BC1_UNORM_SRGB' in found_values}} + ) + CU_AD_FORMAT_BC1_UNORM_SRGB = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_BC1_UNORM_SRGB, '4 channel unsigned normalized block-compressed (BC1 compression) format\n' 'with sRGB encoding\n' - ){{endif}} - {{if 'CU_AD_FORMAT_BC2_UNORM' in found_values}} + ) + CU_AD_FORMAT_BC2_UNORM = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_BC2_UNORM, '4 channel unsigned normalized block-compressed (BC2 compression) format\n' - ){{endif}} - {{if 'CU_AD_FORMAT_BC2_UNORM_SRGB' in found_values}} + ) + CU_AD_FORMAT_BC2_UNORM_SRGB = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_BC2_UNORM_SRGB, '4 channel unsigned normalized block-compressed (BC2 compression) format\n' 'with sRGB encoding\n' - ){{endif}} - {{if 'CU_AD_FORMAT_BC3_UNORM' in found_values}} + ) + CU_AD_FORMAT_BC3_UNORM = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_BC3_UNORM, '4 channel unsigned normalized block-compressed (BC3 compression) format\n' - ){{endif}} - {{if 'CU_AD_FORMAT_BC3_UNORM_SRGB' in found_values}} + ) + CU_AD_FORMAT_BC3_UNORM_SRGB = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_BC3_UNORM_SRGB, '4 channel unsigned normalized block-compressed (BC3 compression) format\n' 'with sRGB encoding\n' - ){{endif}} - {{if 'CU_AD_FORMAT_BC4_UNORM' in found_values}} + ) + CU_AD_FORMAT_BC4_UNORM = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_BC4_UNORM, '1 channel unsigned normalized block-compressed (BC4 compression) format\n' - ){{endif}} - {{if 'CU_AD_FORMAT_BC4_SNORM' in found_values}} + ) + CU_AD_FORMAT_BC4_SNORM = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_BC4_SNORM, '1 channel signed normalized block-compressed (BC4 compression) format\n' - ){{endif}} - {{if 'CU_AD_FORMAT_BC5_UNORM' in found_values}} + ) + CU_AD_FORMAT_BC5_UNORM = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_BC5_UNORM, '2 channel unsigned normalized block-compressed (BC5 compression) format\n' - ){{endif}} - {{if 'CU_AD_FORMAT_BC5_SNORM' in found_values}} + ) + CU_AD_FORMAT_BC5_SNORM = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_BC5_SNORM, '2 channel signed normalized block-compressed (BC5 compression) format\n' - ){{endif}} - {{if 'CU_AD_FORMAT_BC6H_UF16' in found_values}} + ) + CU_AD_FORMAT_BC6H_UF16 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_BC6H_UF16, '3 channel unsigned half-float block-compressed (BC6H compression) format\n' - ){{endif}} - {{if 'CU_AD_FORMAT_BC6H_SF16' in found_values}} + ) + CU_AD_FORMAT_BC6H_SF16 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_BC6H_SF16, '3 channel signed half-float block-compressed (BC6H compression) format\n' - ){{endif}} - {{if 'CU_AD_FORMAT_BC7_UNORM' in found_values}} + ) + CU_AD_FORMAT_BC7_UNORM = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_BC7_UNORM, '4 channel unsigned normalized block-compressed (BC7 compression) format\n' - ){{endif}} - {{if 'CU_AD_FORMAT_BC7_UNORM_SRGB' in found_values}} + ) + CU_AD_FORMAT_BC7_UNORM_SRGB = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_BC7_UNORM_SRGB, '4 channel unsigned normalized block-compressed (BC7 compression) format\n' 'with sRGB encoding\n' - ){{endif}} - {{if 'CU_AD_FORMAT_P010' in found_values}} + ) + CU_AD_FORMAT_P010 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_P010, '10-bit YUV planar format, with 4:2:0 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_P016' in found_values}} + ) + CU_AD_FORMAT_P016 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_P016, '16-bit YUV planar format, with 4:2:0 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_NV16' in found_values}} + ) + CU_AD_FORMAT_NV16 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_NV16, '8-bit YUV planar format, with 4:2:2 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_P210' in found_values}} + ) + CU_AD_FORMAT_P210 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_P210, '10-bit YUV planar format, with 4:2:2 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_P216' in found_values}} + ) + CU_AD_FORMAT_P216 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_P216, '16-bit YUV planar format, with 4:2:2 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_YUY2' in found_values}} + ) + CU_AD_FORMAT_YUY2 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_YUY2, '2 channel, 8-bit YUV packed planar format, with 4:2:2 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_Y210' in found_values}} + ) + CU_AD_FORMAT_Y210 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_Y210, '2 channel, 10-bit YUV packed planar format, with 4:2:2 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_Y216' in found_values}} + ) + CU_AD_FORMAT_Y216 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_Y216, '2 channel, 16-bit YUV packed planar format, with 4:2:2 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_AYUV' in found_values}} + ) + CU_AD_FORMAT_AYUV = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_AYUV, '4 channel, 8-bit YUV packed planar format, with 4:4:4 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_Y410' in found_values}} + ) + CU_AD_FORMAT_Y410 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_Y410, '10-bit YUV packed planar format, with 4:4:4 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_NV12' in found_values}} + ) + CU_AD_FORMAT_NV12 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_NV12, '8-bit YUV planar format, with 4:2:0 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_Y416' in found_values}} + ) + CU_AD_FORMAT_Y416 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_Y416, '4 channel, 12-bit YUV packed planar format, with 4:4:4 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_Y444_PLANAR8' in found_values}} + ) + CU_AD_FORMAT_Y444_PLANAR8 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_Y444_PLANAR8, '3 channel 8-bit YUV planar format, with 4:4:4 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_Y444_PLANAR10' in found_values}} + ) + CU_AD_FORMAT_Y444_PLANAR10 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_Y444_PLANAR10, '3 channel 10-bit YUV planar format, with 4:4:4 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_YUV444_8bit_SemiPlanar' in found_values}} + ) + CU_AD_FORMAT_YUV444_8bit_SemiPlanar = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_YUV444_8bit_SemiPlanar, '3 channel 8-bit YUV semi-planar format, with 4:4:4 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_YUV444_16bit_SemiPlanar' in found_values}} + ) + CU_AD_FORMAT_YUV444_16bit_SemiPlanar = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_YUV444_16bit_SemiPlanar, '3 channel 16-bit YUV semi-planar format, with 4:4:4 sampling\n' - ){{endif}} - {{if 'CU_AD_FORMAT_UNORM_INT8X1' in found_values}} + ) + CU_AD_FORMAT_UNORM_INT8X1 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_UNORM_INT8X1, '1 channel unsigned 8-bit normalized integer\n' - ){{endif}} - {{if 'CU_AD_FORMAT_UNORM_INT8X2' in found_values}} + ) + CU_AD_FORMAT_UNORM_INT8X2 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_UNORM_INT8X2, '2 channel unsigned 8-bit normalized integer\n' - ){{endif}} - {{if 'CU_AD_FORMAT_UNORM_INT8X4' in found_values}} + ) + CU_AD_FORMAT_UNORM_INT8X4 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_UNORM_INT8X4, '4 channel unsigned 8-bit normalized integer\n' - ){{endif}} - {{if 'CU_AD_FORMAT_UNORM_INT16X1' in found_values}} + ) + CU_AD_FORMAT_UNORM_INT16X1 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_UNORM_INT16X1, '1 channel unsigned 16-bit normalized integer\n' - ){{endif}} - {{if 'CU_AD_FORMAT_UNORM_INT16X2' in found_values}} + ) + CU_AD_FORMAT_UNORM_INT16X2 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_UNORM_INT16X2, '2 channel unsigned 16-bit normalized integer\n' - ){{endif}} - {{if 'CU_AD_FORMAT_UNORM_INT16X4' in found_values}} + ) + CU_AD_FORMAT_UNORM_INT16X4 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_UNORM_INT16X4, '4 channel unsigned 16-bit normalized integer\n' - ){{endif}} - {{if 'CU_AD_FORMAT_SNORM_INT8X1' in found_values}} + ) + CU_AD_FORMAT_SNORM_INT8X1 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_SNORM_INT8X1, '1 channel signed 8-bit normalized integer\n' - ){{endif}} - {{if 'CU_AD_FORMAT_SNORM_INT8X2' in found_values}} + ) + CU_AD_FORMAT_SNORM_INT8X2 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_SNORM_INT8X2, '2 channel signed 8-bit normalized integer\n' - ){{endif}} - {{if 'CU_AD_FORMAT_SNORM_INT8X4' in found_values}} + ) + CU_AD_FORMAT_SNORM_INT8X4 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_SNORM_INT8X4, '4 channel signed 8-bit normalized integer\n' - ){{endif}} - {{if 'CU_AD_FORMAT_SNORM_INT16X1' in found_values}} + ) + CU_AD_FORMAT_SNORM_INT16X1 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_SNORM_INT16X1, '1 channel signed 16-bit normalized integer\n' - ){{endif}} - {{if 'CU_AD_FORMAT_SNORM_INT16X2' in found_values}} + ) + CU_AD_FORMAT_SNORM_INT16X2 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_SNORM_INT16X2, '2 channel signed 16-bit normalized integer\n' - ){{endif}} - {{if 'CU_AD_FORMAT_SNORM_INT16X4' in found_values}} + ) + CU_AD_FORMAT_SNORM_INT16X4 = ( cydriver.CUarray_format_enum.CU_AD_FORMAT_SNORM_INT16X4, '4 channel signed 16-bit normalized integer\n' - ){{endif}} - {{if 'CU_AD_FORMAT_MAX' in found_values}} - CU_AD_FORMAT_MAX = cydriver.CUarray_format_enum.CU_AD_FORMAT_MAX{{endif}} + ) -{{endif}} -{{if 'CUaddress_mode_enum' in found_types}} + CU_AD_FORMAT_MAX = cydriver.CUarray_format_enum.CU_AD_FORMAT_MAX class CUaddress_mode(_FastEnum): """ Texture reference addressing modes """ - {{if 'CU_TR_ADDRESS_MODE_WRAP' in found_values}} + CU_TR_ADDRESS_MODE_WRAP = ( cydriver.CUaddress_mode_enum.CU_TR_ADDRESS_MODE_WRAP, 'Wrapping address mode\n' - ){{endif}} - {{if 'CU_TR_ADDRESS_MODE_CLAMP' in found_values}} + ) + CU_TR_ADDRESS_MODE_CLAMP = ( cydriver.CUaddress_mode_enum.CU_TR_ADDRESS_MODE_CLAMP, 'Clamp to edge address mode\n' - ){{endif}} - {{if 'CU_TR_ADDRESS_MODE_MIRROR' in found_values}} + ) + CU_TR_ADDRESS_MODE_MIRROR = ( cydriver.CUaddress_mode_enum.CU_TR_ADDRESS_MODE_MIRROR, 'Mirror address mode\n' - ){{endif}} - {{if 'CU_TR_ADDRESS_MODE_BORDER' in found_values}} + ) + CU_TR_ADDRESS_MODE_BORDER = ( cydriver.CUaddress_mode_enum.CU_TR_ADDRESS_MODE_BORDER, 'Border address mode\n' - ){{endif}} - -{{endif}} -{{if 'CUfilter_mode_enum' in found_types}} + ) class CUfilter_mode(_FastEnum): """ Texture reference filtering modes """ - {{if 'CU_TR_FILTER_MODE_POINT' in found_values}} + CU_TR_FILTER_MODE_POINT = ( cydriver.CUfilter_mode_enum.CU_TR_FILTER_MODE_POINT, 'Point filter mode\n' - ){{endif}} - {{if 'CU_TR_FILTER_MODE_LINEAR' in found_values}} + ) + CU_TR_FILTER_MODE_LINEAR = ( cydriver.CUfilter_mode_enum.CU_TR_FILTER_MODE_LINEAR, 'Linear filter mode\n' - ){{endif}} - -{{endif}} -{{if 'CUdevice_attribute_enum' in found_types}} + ) class CUdevice_attribute(_FastEnum): """ Device properties """ - {{if 'CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK' in found_values}} + CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK, 'Maximum number of threads per block\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X, 'Maximum block dimension X\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y, 'Maximum block dimension Y\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z, 'Maximum block dimension Z\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X, 'Maximum grid dimension X\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y, 'Maximum grid dimension Y\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z, 'Maximum grid dimension Z\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK, 'Maximum shared memory available per block in bytes\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_SHARED_MEMORY_PER_BLOCK' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_SHARED_MEMORY_PER_BLOCK = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_SHARED_MEMORY_PER_BLOCK, 'Deprecated, use CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY, 'Memory available on device for constant variables in a CUDA C kernel in\n' 'bytes\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_WARP_SIZE' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_WARP_SIZE = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_WARP_SIZE, 'Warp size in threads\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAX_PITCH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAX_PITCH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_PITCH, 'Maximum pitch in bytes allowed by memory copies\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK, 'Maximum number of 32-bit registers available per block\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_REGISTERS_PER_BLOCK' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_REGISTERS_PER_BLOCK = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_REGISTERS_PER_BLOCK, 'Deprecated, use CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_CLOCK_RATE' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_CLOCK_RATE = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_CLOCK_RATE, 'Typical clock frequency in kilohertz\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT, 'Alignment requirement for textures\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_GPU_OVERLAP' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_GPU_OVERLAP = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_GPU_OVERLAP, 'Device can possibly copy memory and execute a kernel concurrently.\n' 'Deprecated. Use instead CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT, 'Number of multiprocessors on device\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, 'Specifies whether there is a run time limit on kernels\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_INTEGRATED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_INTEGRATED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_INTEGRATED, 'Device is integrated with host memory\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY, 'Device can map host memory into CUDA address space\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_COMPUTE_MODE' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_COMPUTE_MODE = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_COMPUTE_MODE, 'Compute mode (See :py:obj:`~.CUcomputemode` for details)\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH, 'Maximum 1D texture width\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH, 'Maximum 2D texture width\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT, 'Maximum 2D texture height\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH, 'Maximum 3D texture width\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT, 'Maximum 3D texture height\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH, 'Maximum 3D texture depth\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH, 'Maximum 2D layered texture width\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_WIDTH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_WIDTH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_WIDTH, 'Deprecated, use CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT, 'Maximum 2D layered texture height\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_HEIGHT' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_HEIGHT = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_HEIGHT, 'Deprecated, use CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS, 'Maximum layers in a 2D layered texture\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES, 'Deprecated, use CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT, 'Alignment requirement for surfaces\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS, 'Device can possibly execute multiple kernels concurrently\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_ECC_ENABLED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_ECC_ENABLED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_ECC_ENABLED, 'Device has ECC support enabled\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_PCI_BUS_ID' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_PCI_BUS_ID = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_PCI_BUS_ID, 'PCI bus ID of the device\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID, 'PCI device ID of the device\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_TCC_DRIVER' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_TCC_DRIVER = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_TCC_DRIVER, 'Device is using TCC driver model\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, 'Peak memory clock frequency in kilohertz\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH, 'Global memory bus width in bits\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE, 'Size of L2 cache in bytes\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR, 'Maximum resident threads per multiprocessor\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT, 'Number of asynchronous engines\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING, 'Device shares a unified address space with the host\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH, 'Maximum 1D layered texture width\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS, 'Maximum layers in a 1D layered texture\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_CAN_TEX2D_GATHER' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_CAN_TEX2D_GATHER = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_CAN_TEX2D_GATHER, 'Deprecated, do not use.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH, 'Maximum 2D texture width if CUDA_ARRAY3D_TEXTURE_GATHER is set\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT, 'Maximum 2D texture height if CUDA_ARRAY3D_TEXTURE_GATHER is set\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE, 'Alternate maximum 3D texture width\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE, 'Alternate maximum 3D texture height\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE, 'Alternate maximum 3D texture depth\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID, 'PCI domain ID of the device\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT, 'Pitch alignment requirement for textures\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH, 'Maximum cubemap texture width/height\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH, 'Maximum cubemap layered texture width/height\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS, 'Maximum layers in a cubemap layered texture\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH, 'Maximum 1D surface width\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH, 'Maximum 2D surface width\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT, 'Maximum 2D surface height\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH, 'Maximum 3D surface width\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT, 'Maximum 3D surface height\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH, 'Maximum 3D surface depth\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH, 'Maximum 1D layered surface width\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS, 'Maximum layers in a 1D layered surface\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH, 'Maximum 2D layered surface width\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT, 'Maximum 2D layered surface height\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS, 'Maximum layers in a 2D layered surface\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH, 'Maximum cubemap surface width\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH, 'Maximum cubemap layered surface width\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS, 'Maximum layers in a cubemap layered surface\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH, 'Deprecated, do not use. Use cudaDeviceGetTexture1DLinearMaxWidth() or\n' ':py:obj:`~.cuDeviceGetTexture1DLinearMaxWidth()` instead.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH, 'Maximum 2D linear texture width\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT, 'Maximum 2D linear texture height\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH, 'Maximum 2D linear texture pitch in bytes\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH, 'Maximum mipmapped 2D texture width\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT, 'Maximum mipmapped 2D texture height\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, 'Major compute capability version number\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, 'Minor compute capability version number\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH, 'Maximum mipmapped 1D texture width\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED, 'Device supports stream priorities\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED, 'Device supports caching globals in L1\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED, 'Device supports caching locals in L1\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR, 'Maximum shared memory available per multiprocessor in bytes\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR, 'Maximum number of 32-bit registers available per multiprocessor\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY, 'Device can allocate managed memory on this system\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD, 'Device is on a multi-GPU board\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID, 'Unique id for a group of devices on the same multi-GPU board\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED, 'Link between the device and the host supports all native atomic operations\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO, 'Ratio of single precision performance (in floating-point operations per\n' 'second) to double precision performance\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS, 'Device supports coherently accessing pageable memory without calling\n' 'cudaHostRegister on it\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS, 'Device can coherently access managed memory concurrently with the CPU\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED, 'Device supports compute preemption.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM, 'Device can access host registered memory at the same virtual address as the\n' 'CPU\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_MEM_OPS_V1' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_MEM_OPS_V1 = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_MEM_OPS_V1, 'Deprecated, along with v1 MemOps API, :py:obj:`~.cuStreamBatchMemOp` and\n' 'related APIs are supported.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS_V1' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS_V1 = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS_V1, 'Deprecated, along with v1 MemOps API, 64-bit operations are supported in\n' ':py:obj:`~.cuStreamBatchMemOp` and related APIs.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR_V1' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR_V1 = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR_V1, 'Deprecated, along with v1 MemOps API, :py:obj:`~.CU_STREAM_WAIT_VALUE_NOR`\n' 'is supported.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH, 'Device supports launching cooperative kernels via\n' ':py:obj:`~.cuLaunchCooperativeKernel`\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH, 'Deprecated, :py:obj:`~.cuLaunchCooperativeKernelMultiDevice` is deprecated.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN, - 'Maximum optin shared memory per block\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_CAN_FLUSH_REMOTE_WRITES' in found_values}} + 'Maximum optin shared memory per block. That is shared memory that is\n' + 'available for dynamic allocation or static allocation (including\n' + 'architecture specific static shared memory) on this device but is not\n' + 'guaranteed to be portable.\n' + ) + CU_DEVICE_ATTRIBUTE_CAN_FLUSH_REMOTE_WRITES = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_CAN_FLUSH_REMOTE_WRITES, 'The :py:obj:`~.CU_STREAM_WAIT_VALUE_FLUSH` flag and the\n' ':py:obj:`~.CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES` MemOp are supported on the\n' 'device. See :py:obj:`~.Stream Memory Operations` for additional details.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_HOST_REGISTER_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_HOST_REGISTER_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_HOST_REGISTER_SUPPORTED, 'Device supports host memory registration via :py:obj:`~.cudaHostRegister`.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES, "Device accesses pageable memory via the host's page tables.\n" - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST, 'The host can directly access managed memory on the device without\n' 'migration.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_VIRTUAL_ADDRESS_MANAGEMENT_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_VIRTUAL_ADDRESS_MANAGEMENT_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_VIRTUAL_ADDRESS_MANAGEMENT_SUPPORTED, 'Deprecated, Use CU_DEVICE_ATTRIBUTE_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED, 'Device supports virtual memory management APIs like\n' ':py:obj:`~.cuMemAddressReserve`, :py:obj:`~.cuMemCreate`,\n' ':py:obj:`~.cuMemMap` and related APIs\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR_SUPPORTED, 'Device supports exporting memory to a posix file descriptor with\n' ':py:obj:`~.cuMemExportToShareableHandle`, if requested via\n' ':py:obj:`~.cuMemCreate`\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_HANDLE_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_HANDLE_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_HANDLE_SUPPORTED, 'Device supports exporting memory to a Win32 NT handle with\n' ':py:obj:`~.cuMemExportToShareableHandle`, if requested via\n' ':py:obj:`~.cuMemCreate`\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_KMT_HANDLE_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_KMT_HANDLE_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_KMT_HANDLE_SUPPORTED, 'Device supports exporting memory to a Win32 KMT handle with\n' ':py:obj:`~.cuMemExportToShareableHandle`, if requested via\n' ':py:obj:`~.cuMemCreate`\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAX_BLOCKS_PER_MULTIPROCESSOR' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAX_BLOCKS_PER_MULTIPROCESSOR = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_BLOCKS_PER_MULTIPROCESSOR, 'Maximum number of blocks per multiprocessor\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_GENERIC_COMPRESSION_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_GENERIC_COMPRESSION_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_GENERIC_COMPRESSION_SUPPORTED, 'Device supports compression of memory\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAX_PERSISTING_L2_CACHE_SIZE' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAX_PERSISTING_L2_CACHE_SIZE = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_PERSISTING_L2_CACHE_SIZE, 'Maximum L2 persisting lines capacity setting in bytes.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE, 'Maximum value of :py:obj:`~.CUaccessPolicyWindow.num_bytes`.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_CUDA_VMM_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_CUDA_VMM_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_CUDA_VMM_SUPPORTED, 'Device supports specifying the GPUDirect RDMA flag with\n' ':py:obj:`~.cuMemCreate`\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_RESERVED_SHARED_MEMORY_PER_BLOCK' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_RESERVED_SHARED_MEMORY_PER_BLOCK = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_RESERVED_SHARED_MEMORY_PER_BLOCK, 'Shared memory reserved by CUDA driver per block in bytes\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_SPARSE_CUDA_ARRAY_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_SPARSE_CUDA_ARRAY_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_SPARSE_CUDA_ARRAY_SUPPORTED, 'Device supports sparse CUDA arrays and sparse CUDA mipmapped arrays\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_READ_ONLY_HOST_REGISTER_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_READ_ONLY_HOST_REGISTER_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_READ_ONLY_HOST_REGISTER_SUPPORTED, 'Device supports using the :py:obj:`~.cuMemHostRegister` flag\n' ':py:obj:`~.CU_MEMHOSTERGISTER_READ_ONLY` to register memory that must be\n' 'mapped as read-only to the GPU\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_TIMELINE_SEMAPHORE_INTEROP_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_TIMELINE_SEMAPHORE_INTEROP_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_TIMELINE_SEMAPHORE_INTEROP_SUPPORTED, 'External timeline semaphore interop is supported on the device\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MEMORY_POOLS_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MEMORY_POOLS_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MEMORY_POOLS_SUPPORTED, 'Device supports using the :py:obj:`~.cuMemAllocAsync` and\n' ':py:obj:`~.cuMemPool` family of APIs\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_SUPPORTED, 'Device supports GPUDirect RDMA APIs, like nvidia_p2p_get_pages (see\n' 'https://docs.nvidia.com/cuda/gpudirect-rdma for more information)\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_FLUSH_WRITES_OPTIONS' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_FLUSH_WRITES_OPTIONS = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_FLUSH_WRITES_OPTIONS, 'The returned attribute shall be interpreted as a bitmask, where the\n' 'individual bits are described by the\n' ':py:obj:`~.CUflushGPUDirectRDMAWritesOptions` enum\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WRITES_ORDERING' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WRITES_ORDERING = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WRITES_ORDERING, @@ -2204,390 +2132,421 @@ class CUdevice_attribute(_FastEnum): 'within the scope indicated by the returned attribute. See\n' ':py:obj:`~.CUGPUDirectRDMAWritesOrdering` for the numerical values returned\n' 'here.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MEMPOOL_SUPPORTED_HANDLE_TYPES' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MEMPOOL_SUPPORTED_HANDLE_TYPES = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MEMPOOL_SUPPORTED_HANDLE_TYPES, 'Handle types supported with mempool based IPC\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_CLUSTER_LAUNCH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_CLUSTER_LAUNCH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_CLUSTER_LAUNCH, 'Indicates device supports cluster launch\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_DEFERRED_MAPPING_CUDA_ARRAY_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_DEFERRED_MAPPING_CUDA_ARRAY_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_DEFERRED_MAPPING_CUDA_ARRAY_SUPPORTED, 'Device supports deferred mapping CUDA arrays and CUDA mipmapped arrays\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS, '64-bit operations are supported in :py:obj:`~.cuStreamBatchMemOp` and\n' 'related MemOp APIs.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR, ':py:obj:`~.CU_STREAM_WAIT_VALUE_NOR` is supported by MemOp APIs.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_DMA_BUF_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_DMA_BUF_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_DMA_BUF_SUPPORTED, 'Device supports buffer sharing with dma_buf mechanism.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED, 'Device supports IPC Events.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MEM_SYNC_DOMAIN_COUNT' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MEM_SYNC_DOMAIN_COUNT = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MEM_SYNC_DOMAIN_COUNT, 'Number of memory domains the device supports.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_TENSOR_MAP_ACCESS_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_TENSOR_MAP_ACCESS_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_TENSOR_MAP_ACCESS_SUPPORTED, 'Device supports accessing memory using Tensor Map.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_FABRIC_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_FABRIC_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_FABRIC_SUPPORTED, 'Device supports exporting memory to a fabric handle with\n' ':py:obj:`~.cuMemExportToShareableHandle()` or requested with\n' ':py:obj:`~.cuMemCreate()`\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_UNIFIED_FUNCTION_POINTERS' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_UNIFIED_FUNCTION_POINTERS = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_UNIFIED_FUNCTION_POINTERS, 'Device supports unified function pointers.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_NUMA_CONFIG' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_NUMA_CONFIG = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_NUMA_CONFIG, 'NUMA configuration of a device: value is of type\n' ':py:obj:`~.CUdeviceNumaConfig` enum\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_NUMA_ID' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_NUMA_ID = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_NUMA_ID, 'NUMA node ID of the GPU memory\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MULTICAST_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MULTICAST_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MULTICAST_SUPPORTED, 'Device supports switch multicast and reduction operations.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MPS_ENABLED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MPS_ENABLED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MPS_ENABLED, 'Indicates if contexts created on this device will be shared via MPS\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_HOST_NUMA_ID' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_HOST_NUMA_ID = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_HOST_NUMA_ID, 'NUMA ID of the host node closest to the device. Returns -1 when system does\n' 'not support NUMA.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_D3D12_CIG_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_D3D12_CIG_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_D3D12_CIG_SUPPORTED, 'Device supports CIG with D3D12.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_ALGORITHM_MASK' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_ALGORITHM_MASK = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_ALGORITHM_MASK, 'The returned valued shall be interpreted as a bitmask, where the individual\n' 'bits are described by the :py:obj:`~.CUmemDecompressAlgorithm` enum.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_MAXIMUM_LENGTH' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_MAXIMUM_LENGTH = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_MAXIMUM_LENGTH, 'The returned valued is the maximum length in bytes of a single decompress\n' 'operation that is allowed.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_VULKAN_CIG_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_VULKAN_CIG_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_VULKAN_CIG_SUPPORTED, 'Device supports CIG with Vulkan.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_GPU_PCI_DEVICE_ID' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_GPU_PCI_DEVICE_ID = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_GPU_PCI_DEVICE_ID, 'The combined 16-bit PCI device ID and 16-bit PCI vendor ID.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_GPU_PCI_SUBSYSTEM_ID' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_GPU_PCI_SUBSYSTEM_ID = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_GPU_PCI_SUBSYSTEM_ID, 'The combined 16-bit PCI subsystem ID and 16-bit PCI subsystem vendor ID.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_HOST_NUMA_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_HOST_NUMA_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_HOST_NUMA_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED, 'Device supports HOST_NUMA location with the virtual memory management APIs\n' 'like :py:obj:`~.cuMemCreate`, :py:obj:`~.cuMemMap` and related APIs\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_HOST_NUMA_MEMORY_POOLS_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_HOST_NUMA_MEMORY_POOLS_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_HOST_NUMA_MEMORY_POOLS_SUPPORTED, 'Device supports HOST_NUMA location with the :py:obj:`~.cuMemAllocAsync` and\n' ':py:obj:`~.cuMemPool` family of APIs\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_HOST_NUMA_MULTINODE_IPC_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_HOST_NUMA_MULTINODE_IPC_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_HOST_NUMA_MULTINODE_IPC_SUPPORTED, 'Device supports HOST_NUMA location IPC between nodes in a multi-node\n' 'system.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_HOST_MEMORY_POOLS_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_HOST_MEMORY_POOLS_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_HOST_MEMORY_POOLS_SUPPORTED, 'Device suports HOST location with the :py:obj:`~.cuMemAllocAsync` and\n' ':py:obj:`~.cuMemPool` family of APIs\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_HOST_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_HOST_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_HOST_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED, 'Device supports HOST location with the virtual memory management APIs like\n' ':py:obj:`~.cuMemCreate`, :py:obj:`~.cuMemMap` and related APIs\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_HOST_ALLOC_DMA_BUF_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_HOST_ALLOC_DMA_BUF_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_HOST_ALLOC_DMA_BUF_SUPPORTED, 'Device supports page-locked host memory buffer sharing with dma_buf\n' 'mechanism.\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_ONLY_PARTIAL_HOST_NATIVE_ATOMIC_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_ONLY_PARTIAL_HOST_NATIVE_ATOMIC_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_ONLY_PARTIAL_HOST_NATIVE_ATOMIC_SUPPORTED, 'Link between the device and the host supports only some native atomic\n' 'operations\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_ATOMIC_REDUCTION_SUPPORTED' in found_values}} + ) + CU_DEVICE_ATTRIBUTE_ATOMIC_REDUCTION_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_ATOMIC_REDUCTION_SUPPORTED, 'Device supports atomic reduction operations in stream batch memory\n' 'operations\n' - ){{endif}} - {{if 'CU_DEVICE_ATTRIBUTE_MAX' in found_values}} - CU_DEVICE_ATTRIBUTE_MAX = cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX{{endif}} + ) + + + CU_DEVICE_ATTRIBUTE_D3D12_CIG_STREAMS_SUPPORTED = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_D3D12_CIG_STREAMS_SUPPORTED, + 'Device supports CIG streams with D3D12\n' + ) + -{{endif}} -{{if 'CUpointer_attribute_enum' in found_types}} + CU_DEVICE_ATTRIBUTE_DMA_BUF_MMAP_SUPPORTED = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_DMA_BUF_MMAP_SUPPORTED, + 'Device supports mmap() of dmabuf file descriptors for CUDA device memory\n' + 'allocations\n' + ) + + + CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_UNICAST_SUPPORTED = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_UNICAST_SUPPORTED, + 'Device supports unicast logical endpoints\n' + ) + + + CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_MULTICAST_SUPPORTED = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_MULTICAST_SUPPORTED, + 'Device supports multicast logical endpoints\n' + ) + + + CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_COUNTED_OPS_SUPPORTED = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_COUNTED_OPS_SUPPORTED, + 'Device supports counted operations via logical endpoints\n' + ) + + + CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_UNICAST_ACCESS_ON_OWNER_DEVICE_SUPPORTED = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_UNICAST_ACCESS_ON_OWNER_DEVICE_SUPPORTED, + 'Device supports unicast logical endpoint access on the owner device\n' + ) + + CU_DEVICE_ATTRIBUTE_MAX = cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX class CUpointer_attribute(_FastEnum): """ Pointer information """ - {{if 'CU_POINTER_ATTRIBUTE_CONTEXT' in found_values}} + CU_POINTER_ATTRIBUTE_CONTEXT = ( cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_CONTEXT, 'The :py:obj:`~.CUcontext` on which a pointer was allocated or registered\n' - ){{endif}} - {{if 'CU_POINTER_ATTRIBUTE_MEMORY_TYPE' in found_values}} + ) + CU_POINTER_ATTRIBUTE_MEMORY_TYPE = ( cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMORY_TYPE, 'The :py:obj:`~.CUmemorytype` describing the physical location of a pointer\n' - ){{endif}} - {{if 'CU_POINTER_ATTRIBUTE_DEVICE_POINTER' in found_values}} + ) + CU_POINTER_ATTRIBUTE_DEVICE_POINTER = ( cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_POINTER, "The address at which a pointer's memory may be accessed on the device\n" - ){{endif}} - {{if 'CU_POINTER_ATTRIBUTE_HOST_POINTER' in found_values}} + ) + CU_POINTER_ATTRIBUTE_HOST_POINTER = ( cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_HOST_POINTER, "The address at which a pointer's memory may be accessed on the host\n" - ){{endif}} - {{if 'CU_POINTER_ATTRIBUTE_P2P_TOKENS' in found_values}} + ) + CU_POINTER_ATTRIBUTE_P2P_TOKENS = ( cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_P2P_TOKENS, 'A pair of tokens for use with the nv-p2p.h Linux kernel interface\n' - ){{endif}} - {{if 'CU_POINTER_ATTRIBUTE_SYNC_MEMOPS' in found_values}} + ) + CU_POINTER_ATTRIBUTE_SYNC_MEMOPS = ( cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_SYNC_MEMOPS, 'Synchronize every synchronous memory operation initiated on this region\n' - ){{endif}} - {{if 'CU_POINTER_ATTRIBUTE_BUFFER_ID' in found_values}} + ) + CU_POINTER_ATTRIBUTE_BUFFER_ID = ( cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_BUFFER_ID, 'A process-wide unique ID for an allocated memory region\n' - ){{endif}} - {{if 'CU_POINTER_ATTRIBUTE_IS_MANAGED' in found_values}} + ) + CU_POINTER_ATTRIBUTE_IS_MANAGED = ( cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_MANAGED, 'Indicates if the pointer points to managed memory\n' - ){{endif}} - {{if 'CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL' in found_values}} + ) + CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL = ( cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL, 'A device ordinal of a device on which a pointer was allocated or registered\n' - ){{endif}} - {{if 'CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE' in found_values}} + ) + CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE = ( cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE, '1 if this pointer maps to an allocation that is suitable for\n' ':py:obj:`~.cudaIpcGetMemHandle`, 0 otherwise\n' - ){{endif}} - {{if 'CU_POINTER_ATTRIBUTE_RANGE_START_ADDR' in found_values}} + ) + CU_POINTER_ATTRIBUTE_RANGE_START_ADDR = ( cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_RANGE_START_ADDR, 'Starting address for this requested pointer\n' - ){{endif}} - {{if 'CU_POINTER_ATTRIBUTE_RANGE_SIZE' in found_values}} + ) + CU_POINTER_ATTRIBUTE_RANGE_SIZE = ( cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_RANGE_SIZE, 'Size of the address range for this requested pointer\n' - ){{endif}} - {{if 'CU_POINTER_ATTRIBUTE_MAPPED' in found_values}} + ) + CU_POINTER_ATTRIBUTE_MAPPED = ( cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MAPPED, '1 if this pointer is in a valid address range that is mapped to a backing\n' 'allocation, 0 otherwise\n' - ){{endif}} - {{if 'CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES' in found_values}} + ) + CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES = ( cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES, 'Bitmask of allowed :py:obj:`~.CUmemAllocationHandleType` for this\n' 'allocation\n' - ){{endif}} - {{if 'CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE' in found_values}} + ) + CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE = ( cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE, '1 if the memory this pointer is referencing can be used with the GPUDirect\n' 'RDMA API\n' - ){{endif}} - {{if 'CU_POINTER_ATTRIBUTE_ACCESS_FLAGS' in found_values}} + ) + CU_POINTER_ATTRIBUTE_ACCESS_FLAGS = ( cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_ACCESS_FLAGS, 'Returns the access flags the device associated with the current context has\n' 'on the corresponding memory referenced by the pointer given\n' - ){{endif}} - {{if 'CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE' in found_values}} + ) + CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE = ( cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE, 'Returns the mempool handle for the allocation if it was allocated from a\n' 'mempool. Otherwise returns NULL.\n' - ){{endif}} - {{if 'CU_POINTER_ATTRIBUTE_MAPPING_SIZE' in found_values}} + ) + CU_POINTER_ATTRIBUTE_MAPPING_SIZE = ( cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MAPPING_SIZE, 'Size of the actual underlying mapping that the pointer belongs to\n' - ){{endif}} - {{if 'CU_POINTER_ATTRIBUTE_MAPPING_BASE_ADDR' in found_values}} + ) + CU_POINTER_ATTRIBUTE_MAPPING_BASE_ADDR = ( cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MAPPING_BASE_ADDR, 'The start address of the mapping that the pointer belongs to\n' - ){{endif}} - {{if 'CU_POINTER_ATTRIBUTE_MEMORY_BLOCK_ID' in found_values}} + ) + CU_POINTER_ATTRIBUTE_MEMORY_BLOCK_ID = ( cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMORY_BLOCK_ID, 'A process-wide unique id corresponding to the physical allocation the\n' 'pointer belongs to\n' - ){{endif}} - {{if 'CU_POINTER_ATTRIBUTE_IS_HW_DECOMPRESS_CAPABLE' in found_values}} + ) + CU_POINTER_ATTRIBUTE_IS_HW_DECOMPRESS_CAPABLE = ( cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_HW_DECOMPRESS_CAPABLE, 'Returns in `*data` a boolean that indicates whether the pointer points to\n' 'memory that is capable to be used for hardware accelerated decompression.\n' - ){{endif}} - -{{endif}} -{{if 'CUfunction_attribute_enum' in found_types}} + ) class CUfunction_attribute(_FastEnum): """ Function properties """ - {{if 'CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK' in found_values}} + CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK = ( cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK, 'The maximum number of threads per block, beyond which a launch of the\n' 'function would fail. This number depends on both the function and the\n' 'device on which the function is currently loaded.\n' - ){{endif}} - {{if 'CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES' in found_values}} + ) + CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES = ( cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES, 'The size in bytes of statically-allocated shared memory required by this\n' 'function. This does not include dynamically-allocated shared memory\n' 'requested by the user at runtime.\n' - ){{endif}} - {{if 'CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES' in found_values}} + ) + CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES = ( cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES, 'The size in bytes of user-allocated constant memory required by this\n' 'function.\n' - ){{endif}} - {{if 'CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES' in found_values}} + ) + CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES = ( cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES, 'The size in bytes of local memory used by each thread of this function.\n' - ){{endif}} - {{if 'CU_FUNC_ATTRIBUTE_NUM_REGS' in found_values}} + ) + CU_FUNC_ATTRIBUTE_NUM_REGS = ( cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_NUM_REGS, 'The number of registers used by each thread of this function.\n' - ){{endif}} - {{if 'CU_FUNC_ATTRIBUTE_PTX_VERSION' in found_values}} + ) + CU_FUNC_ATTRIBUTE_PTX_VERSION = ( cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_PTX_VERSION, @@ -2595,8 +2554,8 @@ class CUfunction_attribute(_FastEnum): 'This value is the major PTX version * 10 + the minor PTX version, so a PTX\n' 'version 1.3 function would return the value 13. Note that this may return\n' 'the undefined value of 0 for cubins compiled prior to CUDA 3.0.\n' - ){{endif}} - {{if 'CU_FUNC_ATTRIBUTE_BINARY_VERSION' in found_values}} + ) + CU_FUNC_ATTRIBUTE_BINARY_VERSION = ( cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_BINARY_VERSION, @@ -2605,15 +2564,15 @@ class CUfunction_attribute(_FastEnum): 'binary version 1.3 function would return the value 13. Note that this will\n' 'return a value of 10 for legacy cubins that do not have a properly-encoded\n' 'binary architecture version.\n' - ){{endif}} - {{if 'CU_FUNC_ATTRIBUTE_CACHE_MODE_CA' in found_values}} + ) + CU_FUNC_ATTRIBUTE_CACHE_MODE_CA = ( cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_CACHE_MODE_CA, 'The attribute to indicate whether the function has been compiled with user\n' 'specified option "-Xptxas --dlcm=ca" set .\n' - ){{endif}} - {{if 'CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES' in found_values}} + ) + CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES = ( cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES, @@ -2628,8 +2587,8 @@ class CUfunction_attribute(_FastEnum): ':py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN` -\n' ':py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES`. See\n' ':py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute`\n' - ){{endif}} - {{if 'CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT' in found_values}} + ) + CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT = ( cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT, @@ -2640,16 +2599,16 @@ class CUfunction_attribute(_FastEnum): 'is only a hint, and the driver can choose a different ratio if required to\n' 'execute the function. See :py:obj:`~.cuFuncSetAttribute`,\n' ':py:obj:`~.cuKernelSetAttribute`\n' - ){{endif}} - {{if 'CU_FUNC_ATTRIBUTE_CLUSTER_SIZE_MUST_BE_SET' in found_values}} + ) + CU_FUNC_ATTRIBUTE_CLUSTER_SIZE_MUST_BE_SET = ( cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_CLUSTER_SIZE_MUST_BE_SET, 'If this attribute is set, the kernel must launch with a valid cluster size\n' 'specified. See :py:obj:`~.cuFuncSetAttribute`,\n' ':py:obj:`~.cuKernelSetAttribute`\n' - ){{endif}} - {{if 'CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH' in found_values}} + ) + CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH = ( cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH, @@ -2659,8 +2618,8 @@ class CUfunction_attribute(_FastEnum): 'If the value is set during compile time, it cannot be set at runtime.\n' 'Setting it at runtime will return CUDA_ERROR_NOT_PERMITTED. See\n' ':py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute`\n' - ){{endif}} - {{if 'CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT' in found_values}} + ) + CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT = ( cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT, @@ -2670,8 +2629,8 @@ class CUfunction_attribute(_FastEnum): 'If the value is set during compile time, it cannot be set at runtime.\n' 'Setting it at runtime should return CUDA_ERROR_NOT_PERMITTED. See\n' ':py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute`\n' - ){{endif}} - {{if 'CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH' in found_values}} + ) + CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH = ( cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH, @@ -2681,8 +2640,8 @@ class CUfunction_attribute(_FastEnum): 'If the value is set during compile time, it cannot be set at runtime.\n' 'Setting it at runtime should return CUDA_ERROR_NOT_PERMITTED. See\n' ':py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute`\n' - ){{endif}} - {{if 'CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED' in found_values}} + ) + CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED = ( cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED, @@ -2700,282 +2659,265 @@ class CUfunction_attribute(_FastEnum): 'The specific hardware unit may support higher cluster sizes that’s not\n' 'guaranteed to be portable. See :py:obj:`~.cuFuncSetAttribute`,\n' ':py:obj:`~.cuKernelSetAttribute`\n' - ){{endif}} - {{if 'CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE' in found_values}} + ) + CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE = ( cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE, 'The block scheduling policy of a function. The value type is\n' - 'CUclusterSchedulingPolicy / cudaClusterSchedulingPolicy. See\n' + ':py:obj:`~.CUclusterSchedulingPolicy` / cudaClusterSchedulingPolicy. See\n' ':py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute`\n' - ){{endif}} - {{if 'CU_FUNC_ATTRIBUTE_MAX' in found_values}} - CU_FUNC_ATTRIBUTE_MAX = cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_MAX{{endif}} + ) + -{{endif}} -{{if 'CUfunc_cache_enum' in found_types}} + CU_FUNC_ATTRIBUTE_DEVICE_NODE_UPDATE_SUPPORTED = ( + cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_DEVICE_NODE_UPDATE_SUPPORTED, + 'Whether the function can be updated on device. 1 means device node update\n' + 'is supported, 0 is unsupported. See :py:obj:`~.cuFuncGetAttribute`.\n' + ) + + CU_FUNC_ATTRIBUTE_MAX = cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_MAX class CUfunc_cache(_FastEnum): """ Function cache configurations """ - {{if 'CU_FUNC_CACHE_PREFER_NONE' in found_values}} + CU_FUNC_CACHE_PREFER_NONE = ( cydriver.CUfunc_cache_enum.CU_FUNC_CACHE_PREFER_NONE, 'no preference for shared memory or L1 (default)\n' - ){{endif}} - {{if 'CU_FUNC_CACHE_PREFER_SHARED' in found_values}} + ) + CU_FUNC_CACHE_PREFER_SHARED = ( cydriver.CUfunc_cache_enum.CU_FUNC_CACHE_PREFER_SHARED, 'prefer larger shared memory and smaller L1 cache\n' - ){{endif}} - {{if 'CU_FUNC_CACHE_PREFER_L1' in found_values}} + ) + CU_FUNC_CACHE_PREFER_L1 = ( cydriver.CUfunc_cache_enum.CU_FUNC_CACHE_PREFER_L1, 'prefer larger L1 cache and smaller shared memory\n' - ){{endif}} - {{if 'CU_FUNC_CACHE_PREFER_EQUAL' in found_values}} + ) + CU_FUNC_CACHE_PREFER_EQUAL = ( cydriver.CUfunc_cache_enum.CU_FUNC_CACHE_PREFER_EQUAL, 'prefer equal sized L1 cache and shared memory\n' - ){{endif}} - -{{endif}} -{{if 'CUsharedconfig_enum' in found_types}} + ) class CUsharedconfig(_FastEnum): """ [Deprecated] Shared memory configurations """ - {{if 'CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE' in found_values}} + CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE = ( cydriver.CUsharedconfig_enum.CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE, 'set default shared memory bank size\n' - ){{endif}} - {{if 'CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE' in found_values}} + ) + CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE = ( cydriver.CUsharedconfig_enum.CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE, 'set shared memory bank width to four bytes\n' - ){{endif}} - {{if 'CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE' in found_values}} + ) + CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE = ( cydriver.CUsharedconfig_enum.CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE, 'set shared memory bank width to eight bytes\n' - ){{endif}} - -{{endif}} -{{if 'CUshared_carveout_enum' in found_types}} + ) class CUshared_carveout(_FastEnum): """ Shared memory carveout configurations. These may be passed to :py:obj:`~.cuFuncSetAttribute` or :py:obj:`~.cuKernelSetAttribute` """ - {{if 'CU_SHAREDMEM_CARVEOUT_DEFAULT' in found_values}} + CU_SHAREDMEM_CARVEOUT_DEFAULT = ( cydriver.CUshared_carveout_enum.CU_SHAREDMEM_CARVEOUT_DEFAULT, 'No preference for shared memory or L1 (default)\n' - ){{endif}} - {{if 'CU_SHAREDMEM_CARVEOUT_MAX_L1' in found_values}} + ) + CU_SHAREDMEM_CARVEOUT_MAX_L1 = ( cydriver.CUshared_carveout_enum.CU_SHAREDMEM_CARVEOUT_MAX_L1, 'Prefer maximum available L1 cache, minimum shared memory\n' - ){{endif}} - {{if 'CU_SHAREDMEM_CARVEOUT_MAX_SHARED' in found_values}} + ) + CU_SHAREDMEM_CARVEOUT_MAX_SHARED = ( cydriver.CUshared_carveout_enum.CU_SHAREDMEM_CARVEOUT_MAX_SHARED, 'Prefer maximum available shared memory, minimum L1 cache\n' - ){{endif}} - -{{endif}} -{{if 'CUmemorytype_enum' in found_types}} + ) class CUmemorytype(_FastEnum): """ Memory types """ - {{if 'CU_MEMORYTYPE_HOST' in found_values}} + CU_MEMORYTYPE_HOST = ( cydriver.CUmemorytype_enum.CU_MEMORYTYPE_HOST, 'Host memory\n' - ){{endif}} - {{if 'CU_MEMORYTYPE_DEVICE' in found_values}} + ) + CU_MEMORYTYPE_DEVICE = ( cydriver.CUmemorytype_enum.CU_MEMORYTYPE_DEVICE, 'Device memory\n' - ){{endif}} - {{if 'CU_MEMORYTYPE_ARRAY' in found_values}} + ) + CU_MEMORYTYPE_ARRAY = ( cydriver.CUmemorytype_enum.CU_MEMORYTYPE_ARRAY, 'Array memory\n' - ){{endif}} - {{if 'CU_MEMORYTYPE_UNIFIED' in found_values}} + ) + CU_MEMORYTYPE_UNIFIED = ( cydriver.CUmemorytype_enum.CU_MEMORYTYPE_UNIFIED, 'Unified device or host memory\n' - ){{endif}} - -{{endif}} -{{if 'CUcomputemode_enum' in found_types}} + ) class CUcomputemode(_FastEnum): """ Compute Modes """ - {{if 'CU_COMPUTEMODE_DEFAULT' in found_values}} + CU_COMPUTEMODE_DEFAULT = ( cydriver.CUcomputemode_enum.CU_COMPUTEMODE_DEFAULT, 'Default compute mode (Multiple contexts allowed per device)\n' - ){{endif}} - {{if 'CU_COMPUTEMODE_PROHIBITED' in found_values}} + ) + CU_COMPUTEMODE_PROHIBITED = ( cydriver.CUcomputemode_enum.CU_COMPUTEMODE_PROHIBITED, 'Compute-prohibited mode (No contexts can be created on this device at this\n' 'time)\n' - ){{endif}} - {{if 'CU_COMPUTEMODE_EXCLUSIVE_PROCESS' in found_values}} + ) + CU_COMPUTEMODE_EXCLUSIVE_PROCESS = ( cydriver.CUcomputemode_enum.CU_COMPUTEMODE_EXCLUSIVE_PROCESS, 'Compute-exclusive-process mode (Only one context used by a single process\n' 'can be present on this device at a time)\n' - ){{endif}} - -{{endif}} -{{if 'CUmem_advise_enum' in found_types}} + ) class CUmem_advise(_FastEnum): """ Memory advise values """ - {{if 'CU_MEM_ADVISE_SET_READ_MOSTLY' in found_values}} + CU_MEM_ADVISE_SET_READ_MOSTLY = ( cydriver.CUmem_advise_enum.CU_MEM_ADVISE_SET_READ_MOSTLY, 'Data will mostly be read and only occasionally be written to\n' - ){{endif}} - {{if 'CU_MEM_ADVISE_UNSET_READ_MOSTLY' in found_values}} + ) + CU_MEM_ADVISE_UNSET_READ_MOSTLY = ( cydriver.CUmem_advise_enum.CU_MEM_ADVISE_UNSET_READ_MOSTLY, 'Undo the effect of :py:obj:`~.CU_MEM_ADVISE_SET_READ_MOSTLY`\n' - ){{endif}} - {{if 'CU_MEM_ADVISE_SET_PREFERRED_LOCATION' in found_values}} + ) + CU_MEM_ADVISE_SET_PREFERRED_LOCATION = ( cydriver.CUmem_advise_enum.CU_MEM_ADVISE_SET_PREFERRED_LOCATION, 'Set the preferred location for the data as the specified device\n' - ){{endif}} - {{if 'CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION' in found_values}} + ) + CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION = ( cydriver.CUmem_advise_enum.CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION, 'Clear the preferred location for the data\n' - ){{endif}} - {{if 'CU_MEM_ADVISE_SET_ACCESSED_BY' in found_values}} + ) + CU_MEM_ADVISE_SET_ACCESSED_BY = ( cydriver.CUmem_advise_enum.CU_MEM_ADVISE_SET_ACCESSED_BY, 'Data will be accessed by the specified device, so prevent page faults as\n' 'much as possible\n' - ){{endif}} - {{if 'CU_MEM_ADVISE_UNSET_ACCESSED_BY' in found_values}} + ) + CU_MEM_ADVISE_UNSET_ACCESSED_BY = ( cydriver.CUmem_advise_enum.CU_MEM_ADVISE_UNSET_ACCESSED_BY, 'Let the Unified Memory subsystem decide on the page faulting policy for the\n' 'specified device\n' - ){{endif}} - -{{endif}} -{{if 'CUmem_range_attribute_enum' in found_types}} + ) class CUmem_range_attribute(_FastEnum): """ """ - {{if 'CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY' in found_values}} + CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY = ( cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY, 'Whether the range will mostly be read and only occasionally be written to\n' - ){{endif}} - {{if 'CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION' in found_values}} + ) + CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION = ( cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION, 'The preferred location of the range\n' - ){{endif}} - {{if 'CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY' in found_values}} + ) + CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY = ( cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY, 'Memory range has :py:obj:`~.CU_MEM_ADVISE_SET_ACCESSED_BY` set for\n' 'specified device\n' - ){{endif}} - {{if 'CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION' in found_values}} + ) + CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION = ( cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION, 'The last location to which the range was prefetched\n' - ){{endif}} - {{if 'CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_TYPE' in found_values}} + ) + CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_TYPE = ( cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_TYPE, 'The preferred location type of the range\n' - ){{endif}} - {{if 'CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_ID' in found_values}} + ) + CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_ID = ( cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_ID, 'The preferred location id of the range\n' - ){{endif}} - {{if 'CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_TYPE' in found_values}} + ) + CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_TYPE = ( cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_TYPE, 'The last location type to which the range was prefetched\n' - ){{endif}} - {{if 'CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_ID' in found_values}} + ) + CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_ID = ( cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_ID, 'The last location id to which the range was prefetched\n' - ){{endif}} - -{{endif}} -{{if 'CUjit_option_enum' in found_types}} + ) class CUjit_option(_FastEnum): """ Online compiler and linker options """ - {{if 'CU_JIT_MAX_REGISTERS' in found_values}} + CU_JIT_MAX_REGISTERS = ( cydriver.CUjit_option_enum.CU_JIT_MAX_REGISTERS, 'Max number of registers that a thread may use.\n' 'Option type: unsigned int\n' 'Applies to: compiler only\n' - ){{endif}} - {{if 'CU_JIT_THREADS_PER_BLOCK' in found_values}} + ) + CU_JIT_THREADS_PER_BLOCK = ( cydriver.CUjit_option_enum.CU_JIT_THREADS_PER_BLOCK, @@ -2989,8 +2931,8 @@ class CUjit_option(_FastEnum): 'Cannot be combined with :py:obj:`~.CU_JIT_TARGET`.\n' 'Option type: unsigned int\n' 'Applies to: compiler only\n' - ){{endif}} - {{if 'CU_JIT_WALL_TIME' in found_values}} + ) + CU_JIT_WALL_TIME = ( cydriver.CUjit_option_enum.CU_JIT_WALL_TIME, @@ -2998,8 +2940,8 @@ class CUjit_option(_FastEnum): 'milliseconds, spent in the compiler and linker\n' 'Option type: float\n' 'Applies to: compiler and linker\n' - ){{endif}} - {{if 'CU_JIT_INFO_LOG_BUFFER' in found_values}} + ) + CU_JIT_INFO_LOG_BUFFER = ( cydriver.CUjit_option_enum.CU_JIT_INFO_LOG_BUFFER, @@ -3008,8 +2950,8 @@ class CUjit_option(_FastEnum): ':py:obj:`~.CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES`)\n' 'Option type: char *\n' 'Applies to: compiler and linker\n' - ){{endif}} - {{if 'CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES' in found_values}} + ) + CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES = ( cydriver.CUjit_option_enum.CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES, @@ -3018,8 +2960,8 @@ class CUjit_option(_FastEnum): 'OUT: Amount of log buffer filled with messages\n' 'Option type: unsigned int\n' 'Applies to: compiler and linker\n' - ){{endif}} - {{if 'CU_JIT_ERROR_LOG_BUFFER' in found_values}} + ) + CU_JIT_ERROR_LOG_BUFFER = ( cydriver.CUjit_option_enum.CU_JIT_ERROR_LOG_BUFFER, @@ -3028,8 +2970,8 @@ class CUjit_option(_FastEnum): ':py:obj:`~.CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES`)\n' 'Option type: char *\n' 'Applies to: compiler and linker\n' - ){{endif}} - {{if 'CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES' in found_values}} + ) + CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES = ( cydriver.CUjit_option_enum.CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES, @@ -3038,8 +2980,8 @@ class CUjit_option(_FastEnum): 'OUT: Amount of log buffer filled with messages\n' 'Option type: unsigned int\n' 'Applies to: compiler and linker\n' - ){{endif}} - {{if 'CU_JIT_OPTIMIZATION_LEVEL' in found_values}} + ) + CU_JIT_OPTIMIZATION_LEVEL = ( cydriver.CUjit_option_enum.CU_JIT_OPTIMIZATION_LEVEL, @@ -3047,8 +2989,8 @@ class CUjit_option(_FastEnum): 'default and highest level of optimizations.\n' 'Option type: unsigned int\n' 'Applies to: compiler only\n' - ){{endif}} - {{if 'CU_JIT_TARGET_FROM_CUCONTEXT' in found_values}} + ) + CU_JIT_TARGET_FROM_CUCONTEXT = ( cydriver.CUjit_option_enum.CU_JIT_TARGET_FROM_CUCONTEXT, @@ -3056,8 +2998,8 @@ class CUjit_option(_FastEnum): 'attached context (default)\n' 'Option type: No option value needed\n' 'Applies to: compiler and linker\n' - ){{endif}} - {{if 'CU_JIT_TARGET' in found_values}} + ) + CU_JIT_TARGET = ( cydriver.CUjit_option_enum.CU_JIT_TARGET, @@ -3065,8 +3007,8 @@ class CUjit_option(_FastEnum): 'combined with :py:obj:`~.CU_JIT_THREADS_PER_BLOCK`.\n' 'Option type: unsigned int for enumerated type :py:obj:`~.CUjit_target`\n' 'Applies to: compiler and linker\n' - ){{endif}} - {{if 'CU_JIT_FALLBACK_STRATEGY' in found_values}} + ) + CU_JIT_FALLBACK_STRATEGY = ( cydriver.CUjit_option_enum.CU_JIT_FALLBACK_STRATEGY, @@ -3075,8 +3017,8 @@ class CUjit_option(_FastEnum): 'be used with cuLink* APIs as the linker requires exact matches.\n' 'Option type: unsigned int for enumerated type :py:obj:`~.CUjit_fallback`\n' 'Applies to: compiler only\n' - ){{endif}} - {{if 'CU_JIT_GENERATE_DEBUG_INFO' in found_values}} + ) + CU_JIT_GENERATE_DEBUG_INFO = ( cydriver.CUjit_option_enum.CU_JIT_GENERATE_DEBUG_INFO, @@ -3084,24 +3026,24 @@ class CUjit_option(_FastEnum): 'default)\n' 'Option type: int\n' 'Applies to: compiler and linker\n' - ){{endif}} - {{if 'CU_JIT_LOG_VERBOSE' in found_values}} + ) + CU_JIT_LOG_VERBOSE = ( cydriver.CUjit_option_enum.CU_JIT_LOG_VERBOSE, 'Generate verbose log messages (0: false, default)\n' 'Option type: int\n' 'Applies to: compiler and linker\n' - ){{endif}} - {{if 'CU_JIT_GENERATE_LINE_INFO' in found_values}} + ) + CU_JIT_GENERATE_LINE_INFO = ( cydriver.CUjit_option_enum.CU_JIT_GENERATE_LINE_INFO, 'Generate line number information (-lineinfo) (0: false, default)\n' 'Option type: int\n' 'Applies to: compiler only\n' - ){{endif}} - {{if 'CU_JIT_CACHE_MODE' in found_values}} + ) + CU_JIT_CACHE_MODE = ( cydriver.CUjit_option_enum.CU_JIT_CACHE_MODE, @@ -3110,20 +3052,20 @@ class CUjit_option(_FastEnum): 'Option type: unsigned int for enumerated type\n' ':py:obj:`~.CUjit_cacheMode_enum`\n' 'Applies to: compiler only\n' - ){{endif}} - {{if 'CU_JIT_NEW_SM3X_OPT' in found_values}} + ) + CU_JIT_NEW_SM3X_OPT = ( cydriver.CUjit_option_enum.CU_JIT_NEW_SM3X_OPT, '[Deprecated]\n' - ){{endif}} - {{if 'CU_JIT_FAST_COMPILE' in found_values}} + ) + CU_JIT_FAST_COMPILE = ( cydriver.CUjit_option_enum.CU_JIT_FAST_COMPILE, 'This jit option is used for internal purpose only.\n' - ){{endif}} - {{if 'CU_JIT_GLOBAL_SYMBOL_NAMES' in found_values}} + ) + CU_JIT_GLOBAL_SYMBOL_NAMES = ( cydriver.CUjit_option_enum.CU_JIT_GLOBAL_SYMBOL_NAMES, @@ -3137,8 +3079,8 @@ class CUjit_option(_FastEnum): 'It is illegal to register the same device symbol at multiple addresses.\n' 'Option type: const char **\n' 'Applies to: dynamic linker only\n' - ){{endif}} - {{if 'CU_JIT_GLOBAL_SYMBOL_ADDRESSES' in found_values}} + ) + CU_JIT_GLOBAL_SYMBOL_ADDRESSES = ( cydriver.CUjit_option_enum.CU_JIT_GLOBAL_SYMBOL_ADDRESSES, @@ -3147,8 +3089,8 @@ class CUjit_option(_FastEnum): 'Must contain :py:obj:`~.CU_JIT_GLOBAL_SYMBOL_COUNT` entries.\n' 'Option type: void **\n' 'Applies to: dynamic linker only\n' - ){{endif}} - {{if 'CU_JIT_GLOBAL_SYMBOL_COUNT' in found_values}} + ) + CU_JIT_GLOBAL_SYMBOL_COUNT = ( cydriver.CUjit_option_enum.CU_JIT_GLOBAL_SYMBOL_COUNT, @@ -3156,86 +3098,86 @@ class CUjit_option(_FastEnum): ':py:obj:`~.CU_JIT_GLOBAL_SYMBOL_ADDRESSES` arrays.\n' 'Option type: unsigned int\n' 'Applies to: dynamic linker only\n' - ){{endif}} - {{if 'CU_JIT_LTO' in found_values}} + ) + CU_JIT_LTO = ( cydriver.CUjit_option_enum.CU_JIT_LTO, '[Deprecated]\n' 'Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0\n' - ){{endif}} - {{if 'CU_JIT_FTZ' in found_values}} + ) + CU_JIT_FTZ = ( cydriver.CUjit_option_enum.CU_JIT_FTZ, '[Deprecated]\n' 'Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0\n' - ){{endif}} - {{if 'CU_JIT_PREC_DIV' in found_values}} + ) + CU_JIT_PREC_DIV = ( cydriver.CUjit_option_enum.CU_JIT_PREC_DIV, '[Deprecated]\n' 'Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0\n' - ){{endif}} - {{if 'CU_JIT_PREC_SQRT' in found_values}} + ) + CU_JIT_PREC_SQRT = ( cydriver.CUjit_option_enum.CU_JIT_PREC_SQRT, '[Deprecated]\n' 'Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0\n' - ){{endif}} - {{if 'CU_JIT_FMA' in found_values}} + ) + CU_JIT_FMA = ( cydriver.CUjit_option_enum.CU_JIT_FMA, '[Deprecated]\n' 'Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0\n' - ){{endif}} - {{if 'CU_JIT_REFERENCED_KERNEL_NAMES' in found_values}} + ) + CU_JIT_REFERENCED_KERNEL_NAMES = ( cydriver.CUjit_option_enum.CU_JIT_REFERENCED_KERNEL_NAMES, '[Deprecated]\n' 'Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0\n' - ){{endif}} - {{if 'CU_JIT_REFERENCED_KERNEL_COUNT' in found_values}} + ) + CU_JIT_REFERENCED_KERNEL_COUNT = ( cydriver.CUjit_option_enum.CU_JIT_REFERENCED_KERNEL_COUNT, '[Deprecated]\n' 'Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0\n' - ){{endif}} - {{if 'CU_JIT_REFERENCED_VARIABLE_NAMES' in found_values}} + ) + CU_JIT_REFERENCED_VARIABLE_NAMES = ( cydriver.CUjit_option_enum.CU_JIT_REFERENCED_VARIABLE_NAMES, '[Deprecated]\n' 'Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0\n' - ){{endif}} - {{if 'CU_JIT_REFERENCED_VARIABLE_COUNT' in found_values}} + ) + CU_JIT_REFERENCED_VARIABLE_COUNT = ( cydriver.CUjit_option_enum.CU_JIT_REFERENCED_VARIABLE_COUNT, '[Deprecated]\n' 'Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0\n' - ){{endif}} - {{if 'CU_JIT_OPTIMIZE_UNUSED_DEVICE_VARIABLES' in found_values}} + ) + CU_JIT_OPTIMIZE_UNUSED_DEVICE_VARIABLES = ( cydriver.CUjit_option_enum.CU_JIT_OPTIMIZE_UNUSED_DEVICE_VARIABLES, '[Deprecated]\n' 'Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0\n' - ){{endif}} - {{if 'CU_JIT_POSITION_INDEPENDENT_CODE' in found_values}} + ) + CU_JIT_POSITION_INDEPENDENT_CODE = ( cydriver.CUjit_option_enum.CU_JIT_POSITION_INDEPENDENT_CODE, 'Generate position independent code (0: false)\n' 'Option type: int\n' 'Applies to: compiler only\n' - ){{endif}} - {{if 'CU_JIT_MIN_CTA_PER_SM' in found_values}} + ) + CU_JIT_MIN_CTA_PER_SM = ( cydriver.CUjit_option_enum.CU_JIT_MIN_CTA_PER_SM, @@ -3249,8 +3191,8 @@ class CUjit_option(_FastEnum): 'this option take precedence over the PTX directive. Option type: unsigned\n' 'int\n' 'Applies to: compiler only\n' - ){{endif}} - {{if 'CU_JIT_MAX_THREADS_PER_BLOCK' in found_values}} + ) + CU_JIT_MAX_THREADS_PER_BLOCK = ( cydriver.CUjit_option_enum.CU_JIT_MAX_THREADS_PER_BLOCK, @@ -3262,8 +3204,8 @@ class CUjit_option(_FastEnum): 'be ignored by default. Use :py:obj:`~.CU_JIT_OVERRIDE_DIRECTIVE_VALUES` to\n' 'let this option take precedence over the PTX directive. Option type: int\n' 'Applies to: compiler only\n' - ){{endif}} - {{if 'CU_JIT_OVERRIDE_DIRECTIVE_VALUES' in found_values}} + ) + CU_JIT_OVERRIDE_DIRECTIVE_VALUES = ( cydriver.CUjit_option_enum.CU_JIT_OVERRIDE_DIRECTIVE_VALUES, @@ -3273,8 +3215,8 @@ class CUjit_option(_FastEnum): ':py:obj:`~.CU_JIT_MIN_CTA_PER_SM` take precedence over any PTX directives.\n' '(0: Disable, default; 1: Enable) Option type: int\n' 'Applies to: compiler only\n' - ){{endif}} - {{if 'CU_JIT_SPLIT_COMPILE' in found_values}} + ) + CU_JIT_SPLIT_COMPILE = ( cydriver.CUjit_option_enum.CU_JIT_SPLIT_COMPILE, @@ -3284,8 +3226,8 @@ class CUjit_option(_FastEnum): 'match the number of CPUs on the underlying machine. Otherwise, if the\n' 'option is N, then up to N threads will be used. Option type: unsigned int\n' 'Applies to: compiler only\n' - ){{endif}} - {{if 'CU_JIT_BINARY_LOADER_THREAD_COUNT' in found_values}} + ) + CU_JIT_BINARY_LOADER_THREAD_COUNT = ( cydriver.CUjit_option_enum.CU_JIT_BINARY_LOADER_THREAD_COUNT, @@ -3296,648 +3238,612 @@ class CUjit_option(_FastEnum): 'then up to N threads will be used. This option is ignored if the env var\n' 'CUDA_BINARY_LOADER_THREAD_COUNT is set. Option type: unsigned int\n' 'Applies to: compiler and linker\n' - ){{endif}} - {{if 'CU_JIT_NUM_OPTIONS' in found_values}} - CU_JIT_NUM_OPTIONS = cydriver.CUjit_option_enum.CU_JIT_NUM_OPTIONS{{endif}} + ) -{{endif}} -{{if 'CUjit_target_enum' in found_types}} + CU_JIT_NUM_OPTIONS = cydriver.CUjit_option_enum.CU_JIT_NUM_OPTIONS class CUjit_target(_FastEnum): """ Online compilation targets """ - {{if 'CU_TARGET_COMPUTE_30' in found_values}} + CU_TARGET_COMPUTE_30 = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_30, 'Compute device class 3.0\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_32' in found_values}} + ) + CU_TARGET_COMPUTE_32 = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_32, 'Compute device class 3.2\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_35' in found_values}} + ) + CU_TARGET_COMPUTE_35 = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_35, 'Compute device class 3.5\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_37' in found_values}} + ) + CU_TARGET_COMPUTE_37 = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_37, 'Compute device class 3.7\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_50' in found_values}} + ) + CU_TARGET_COMPUTE_50 = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_50, 'Compute device class 5.0\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_52' in found_values}} + ) + CU_TARGET_COMPUTE_52 = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_52, 'Compute device class 5.2\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_53' in found_values}} + ) + CU_TARGET_COMPUTE_53 = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_53, 'Compute device class 5.3\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_60' in found_values}} + ) + CU_TARGET_COMPUTE_60 = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_60, 'Compute device class 6.0.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_61' in found_values}} + ) + CU_TARGET_COMPUTE_61 = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_61, 'Compute device class 6.1.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_62' in found_values}} + ) + CU_TARGET_COMPUTE_62 = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_62, 'Compute device class 6.2.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_70' in found_values}} + ) + CU_TARGET_COMPUTE_70 = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_70, 'Compute device class 7.0.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_72' in found_values}} + ) + CU_TARGET_COMPUTE_72 = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_72, 'Compute device class 7.2.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_75' in found_values}} + ) + CU_TARGET_COMPUTE_75 = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_75, 'Compute device class 7.5.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_80' in found_values}} + ) + CU_TARGET_COMPUTE_80 = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_80, 'Compute device class 8.0.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_86' in found_values}} + ) + CU_TARGET_COMPUTE_86 = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_86, 'Compute device class 8.6.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_87' in found_values}} + ) + CU_TARGET_COMPUTE_87 = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_87, 'Compute device class 8.7.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_89' in found_values}} + ) + CU_TARGET_COMPUTE_89 = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_89, 'Compute device class 8.9.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_90' in found_values}} + ) + CU_TARGET_COMPUTE_90 = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_90, 'Compute device class 9.0.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_100' in found_values}} + ) + CU_TARGET_COMPUTE_100 = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_100, 'Compute device class 10.0.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_103' in found_values}} + ) + CU_TARGET_COMPUTE_103 = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_103, 'Compute device class 10.3.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_110' in found_values}} + ) + CU_TARGET_COMPUTE_110 = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_110, 'Compute device class 11.0.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_120' in found_values}} + ) + CU_TARGET_COMPUTE_120 = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_120, 'Compute device class 12.0.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_121' in found_values}} + ) + CU_TARGET_COMPUTE_121 = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_121, 'Compute device class 12.1. Compute device class 9.0. with accelerated\n' 'features.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_90A' in found_values}} + ) + CU_TARGET_COMPUTE_90A = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_90A, 'Compute device class 10.0. with accelerated features.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_100A' in found_values}} + ) + CU_TARGET_COMPUTE_100A = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_100A, 'Compute device class 11.0 with accelerated features.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_103A' in found_values}} + ) + CU_TARGET_COMPUTE_103A = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_103A, 'Compute device class 12.0. with accelerated features.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_110A' in found_values}} + ) + CU_TARGET_COMPUTE_110A = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_110A, 'Compute device class 10.3. with accelerated features.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_120A' in found_values}} + ) + CU_TARGET_COMPUTE_120A = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_120A, 'Compute device class 12.1. with accelerated features.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_121A' in found_values}} + ) + CU_TARGET_COMPUTE_121A = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_121A, 'Compute device class 10.x with family features.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_100F' in found_values}} + ) + CU_TARGET_COMPUTE_100F = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_100F, 'Compute device class 11.0 with family features.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_103F' in found_values}} + ) + CU_TARGET_COMPUTE_103F = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_103F, 'Compute device class 12.0. with family features.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_110F' in found_values}} + ) + CU_TARGET_COMPUTE_110F = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_110F, 'Compute device class 10.3. with family features.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_120F' in found_values}} + ) + CU_TARGET_COMPUTE_120F = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_120F, 'Compute device class 12.1. with family features.\n' - ){{endif}} - {{if 'CU_TARGET_COMPUTE_121F' in found_values}} - CU_TARGET_COMPUTE_121F = cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_121F{{endif}} + ) -{{endif}} -{{if 'CUjit_fallback_enum' in found_types}} + CU_TARGET_COMPUTE_121F = cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_121F class CUjit_fallback(_FastEnum): """ Cubin matching fallback strategies """ - {{if 'CU_PREFER_PTX' in found_values}} + CU_PREFER_PTX = ( cydriver.CUjit_fallback_enum.CU_PREFER_PTX, 'Prefer to compile ptx if exact binary match not found\n' - ){{endif}} - {{if 'CU_PREFER_BINARY' in found_values}} + ) + CU_PREFER_BINARY = ( cydriver.CUjit_fallback_enum.CU_PREFER_BINARY, 'Prefer to fall back to compatible binary code if exact match not found\n' - ){{endif}} - -{{endif}} -{{if 'CUjit_cacheMode_enum' in found_types}} + ) class CUjit_cacheMode(_FastEnum): """ Caching modes for dlcm """ - {{if 'CU_JIT_CACHE_OPTION_NONE' in found_values}} + CU_JIT_CACHE_OPTION_NONE = ( cydriver.CUjit_cacheMode_enum.CU_JIT_CACHE_OPTION_NONE, 'Compile with no -dlcm flag specified\n' - ){{endif}} - {{if 'CU_JIT_CACHE_OPTION_CG' in found_values}} + ) + CU_JIT_CACHE_OPTION_CG = ( cydriver.CUjit_cacheMode_enum.CU_JIT_CACHE_OPTION_CG, 'Compile with L1 cache disabled\n' - ){{endif}} - {{if 'CU_JIT_CACHE_OPTION_CA' in found_values}} + ) + CU_JIT_CACHE_OPTION_CA = ( cydriver.CUjit_cacheMode_enum.CU_JIT_CACHE_OPTION_CA, 'Compile with L1 cache enabled\n' - ){{endif}} - -{{endif}} -{{if 'CUjitInputType_enum' in found_types}} + ) class CUjitInputType(_FastEnum): """ Device code formats """ - {{if 'CU_JIT_INPUT_CUBIN' in found_values}} + CU_JIT_INPUT_CUBIN = ( cydriver.CUjitInputType_enum.CU_JIT_INPUT_CUBIN, 'Compiled device-class-specific device code\n' 'Applicable options: none\n' - ){{endif}} - {{if 'CU_JIT_INPUT_PTX' in found_values}} + ) + CU_JIT_INPUT_PTX = ( cydriver.CUjitInputType_enum.CU_JIT_INPUT_PTX, 'PTX source code\n' 'Applicable options: PTX compiler options\n' - ){{endif}} - {{if 'CU_JIT_INPUT_FATBINARY' in found_values}} + ) + CU_JIT_INPUT_FATBINARY = ( cydriver.CUjitInputType_enum.CU_JIT_INPUT_FATBINARY, 'Bundle of multiple cubins and/or PTX of some device code\n' 'Applicable options: PTX compiler options,\n' ':py:obj:`~.CU_JIT_FALLBACK_STRATEGY`\n' - ){{endif}} - {{if 'CU_JIT_INPUT_OBJECT' in found_values}} + ) + CU_JIT_INPUT_OBJECT = ( cydriver.CUjitInputType_enum.CU_JIT_INPUT_OBJECT, 'Host object with embedded device code\n' 'Applicable options: PTX compiler options,\n' ':py:obj:`~.CU_JIT_FALLBACK_STRATEGY`\n' - ){{endif}} - {{if 'CU_JIT_INPUT_LIBRARY' in found_values}} + ) + CU_JIT_INPUT_LIBRARY = ( cydriver.CUjitInputType_enum.CU_JIT_INPUT_LIBRARY, 'Archive of host objects with embedded device code\n' 'Applicable options: PTX compiler options,\n' ':py:obj:`~.CU_JIT_FALLBACK_STRATEGY`\n' - ){{endif}} - {{if 'CU_JIT_INPUT_NVVM' in found_values}} + ) + CU_JIT_INPUT_NVVM = ( cydriver.CUjitInputType_enum.CU_JIT_INPUT_NVVM, '[Deprecated]\n' 'Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0\n' - ){{endif}} - {{if 'CU_JIT_NUM_INPUT_TYPES' in found_values}} - CU_JIT_NUM_INPUT_TYPES = cydriver.CUjitInputType_enum.CU_JIT_NUM_INPUT_TYPES{{endif}} + ) -{{endif}} -{{if 'CUgraphicsRegisterFlags_enum' in found_types}} + CU_JIT_NUM_INPUT_TYPES = cydriver.CUjitInputType_enum.CU_JIT_NUM_INPUT_TYPES class CUgraphicsRegisterFlags(_FastEnum): """ Flags to register a graphics resource """ - {{if 'CU_GRAPHICS_REGISTER_FLAGS_NONE' in found_values}} - CU_GRAPHICS_REGISTER_FLAGS_NONE = cydriver.CUgraphicsRegisterFlags_enum.CU_GRAPHICS_REGISTER_FLAGS_NONE{{endif}} - {{if 'CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY' in found_values}} - CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY = cydriver.CUgraphicsRegisterFlags_enum.CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY{{endif}} - {{if 'CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD' in found_values}} - CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD = cydriver.CUgraphicsRegisterFlags_enum.CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD{{endif}} - {{if 'CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST' in found_values}} - CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST = cydriver.CUgraphicsRegisterFlags_enum.CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST{{endif}} - {{if 'CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER' in found_values}} - CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER = cydriver.CUgraphicsRegisterFlags_enum.CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER{{endif}} -{{endif}} -{{if 'CUgraphicsMapResourceFlags_enum' in found_types}} + CU_GRAPHICS_REGISTER_FLAGS_NONE = cydriver.CUgraphicsRegisterFlags_enum.CU_GRAPHICS_REGISTER_FLAGS_NONE + + CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY = cydriver.CUgraphicsRegisterFlags_enum.CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY + + CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD = cydriver.CUgraphicsRegisterFlags_enum.CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD + + CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST = cydriver.CUgraphicsRegisterFlags_enum.CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST + + CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER = cydriver.CUgraphicsRegisterFlags_enum.CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER class CUgraphicsMapResourceFlags(_FastEnum): """ Flags for mapping and unmapping interop resources """ - {{if 'CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE' in found_values}} - CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE = cydriver.CUgraphicsMapResourceFlags_enum.CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE{{endif}} - {{if 'CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY' in found_values}} - CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY = cydriver.CUgraphicsMapResourceFlags_enum.CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY{{endif}} - {{if 'CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD' in found_values}} - CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD = cydriver.CUgraphicsMapResourceFlags_enum.CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD{{endif}} -{{endif}} -{{if 'CUarray_cubemap_face_enum' in found_types}} + CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE = cydriver.CUgraphicsMapResourceFlags_enum.CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE + + CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY = cydriver.CUgraphicsMapResourceFlags_enum.CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY + + CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD = cydriver.CUgraphicsMapResourceFlags_enum.CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD class CUarray_cubemap_face(_FastEnum): """ Array indices for cube faces """ - {{if 'CU_CUBEMAP_FACE_POSITIVE_X' in found_values}} + CU_CUBEMAP_FACE_POSITIVE_X = ( cydriver.CUarray_cubemap_face_enum.CU_CUBEMAP_FACE_POSITIVE_X, 'Positive X face of cubemap\n' - ){{endif}} - {{if 'CU_CUBEMAP_FACE_NEGATIVE_X' in found_values}} + ) + CU_CUBEMAP_FACE_NEGATIVE_X = ( cydriver.CUarray_cubemap_face_enum.CU_CUBEMAP_FACE_NEGATIVE_X, 'Negative X face of cubemap\n' - ){{endif}} - {{if 'CU_CUBEMAP_FACE_POSITIVE_Y' in found_values}} + ) + CU_CUBEMAP_FACE_POSITIVE_Y = ( cydriver.CUarray_cubemap_face_enum.CU_CUBEMAP_FACE_POSITIVE_Y, 'Positive Y face of cubemap\n' - ){{endif}} - {{if 'CU_CUBEMAP_FACE_NEGATIVE_Y' in found_values}} + ) + CU_CUBEMAP_FACE_NEGATIVE_Y = ( cydriver.CUarray_cubemap_face_enum.CU_CUBEMAP_FACE_NEGATIVE_Y, 'Negative Y face of cubemap\n' - ){{endif}} - {{if 'CU_CUBEMAP_FACE_POSITIVE_Z' in found_values}} + ) + CU_CUBEMAP_FACE_POSITIVE_Z = ( cydriver.CUarray_cubemap_face_enum.CU_CUBEMAP_FACE_POSITIVE_Z, 'Positive Z face of cubemap\n' - ){{endif}} - {{if 'CU_CUBEMAP_FACE_NEGATIVE_Z' in found_values}} + ) + CU_CUBEMAP_FACE_NEGATIVE_Z = ( cydriver.CUarray_cubemap_face_enum.CU_CUBEMAP_FACE_NEGATIVE_Z, 'Negative Z face of cubemap\n' - ){{endif}} - -{{endif}} -{{if 'CUlimit_enum' in found_types}} + ) class CUlimit(_FastEnum): """ Limits """ - {{if 'CU_LIMIT_STACK_SIZE' in found_values}} + CU_LIMIT_STACK_SIZE = ( cydriver.CUlimit_enum.CU_LIMIT_STACK_SIZE, 'GPU thread stack size\n' - ){{endif}} - {{if 'CU_LIMIT_PRINTF_FIFO_SIZE' in found_values}} + ) + CU_LIMIT_PRINTF_FIFO_SIZE = ( cydriver.CUlimit_enum.CU_LIMIT_PRINTF_FIFO_SIZE, 'GPU printf FIFO size\n' - ){{endif}} - {{if 'CU_LIMIT_MALLOC_HEAP_SIZE' in found_values}} + ) + CU_LIMIT_MALLOC_HEAP_SIZE = ( cydriver.CUlimit_enum.CU_LIMIT_MALLOC_HEAP_SIZE, 'GPU malloc heap size\n' - ){{endif}} - {{if 'CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH' in found_values}} + ) + CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH = ( cydriver.CUlimit_enum.CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH, 'GPU device runtime launch synchronize depth\n' - ){{endif}} - {{if 'CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT' in found_values}} + ) + CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT = ( cydriver.CUlimit_enum.CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT, 'GPU device runtime pending launch count\n' - ){{endif}} - {{if 'CU_LIMIT_MAX_L2_FETCH_GRANULARITY' in found_values}} + ) + CU_LIMIT_MAX_L2_FETCH_GRANULARITY = ( cydriver.CUlimit_enum.CU_LIMIT_MAX_L2_FETCH_GRANULARITY, 'A value between 0 and 128 that indicates the maximum fetch granularity of\n' 'L2 (in Bytes). This is a hint\n' - ){{endif}} - {{if 'CU_LIMIT_PERSISTING_L2_CACHE_SIZE' in found_values}} + ) + CU_LIMIT_PERSISTING_L2_CACHE_SIZE = ( cydriver.CUlimit_enum.CU_LIMIT_PERSISTING_L2_CACHE_SIZE, 'A size in bytes for L2 persisting lines cache size\n' - ){{endif}} - {{if 'CU_LIMIT_SHMEM_SIZE' in found_values}} + ) + CU_LIMIT_SHMEM_SIZE = ( cydriver.CUlimit_enum.CU_LIMIT_SHMEM_SIZE, 'A maximum size in bytes of shared memory available to CUDA kernels on a CIG\n' 'context. Can only be queried, cannot be set\n' - ){{endif}} - {{if 'CU_LIMIT_CIG_ENABLED' in found_values}} + ) + CU_LIMIT_CIG_ENABLED = ( cydriver.CUlimit_enum.CU_LIMIT_CIG_ENABLED, 'A non-zero value indicates this CUDA context is a CIG-enabled context. Can\n' 'only be queried, cannot be set\n' - ){{endif}} - {{if 'CU_LIMIT_CIG_SHMEM_FALLBACK_ENABLED' in found_values}} + ) + CU_LIMIT_CIG_SHMEM_FALLBACK_ENABLED = ( cydriver.CUlimit_enum.CU_LIMIT_CIG_SHMEM_FALLBACK_ENABLED, 'When set to zero, CUDA will fail to launch a kernel on a CIG context,\n' 'instead of using the fallback path, if the kernel uses more shared memory\n' 'than available\n' - ){{endif}} - {{if 'CU_LIMIT_MAX' in found_values}} - CU_LIMIT_MAX = cydriver.CUlimit_enum.CU_LIMIT_MAX{{endif}} + ) -{{endif}} -{{if 'CUresourcetype_enum' in found_types}} + CU_LIMIT_MAX = cydriver.CUlimit_enum.CU_LIMIT_MAX class CUresourcetype(_FastEnum): """ Resource types """ - {{if 'CU_RESOURCE_TYPE_ARRAY' in found_values}} + CU_RESOURCE_TYPE_ARRAY = ( cydriver.CUresourcetype_enum.CU_RESOURCE_TYPE_ARRAY, 'Array resource\n' - ){{endif}} - {{if 'CU_RESOURCE_TYPE_MIPMAPPED_ARRAY' in found_values}} + ) + CU_RESOURCE_TYPE_MIPMAPPED_ARRAY = ( cydriver.CUresourcetype_enum.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY, 'Mipmapped array resource\n' - ){{endif}} - {{if 'CU_RESOURCE_TYPE_LINEAR' in found_values}} + ) + CU_RESOURCE_TYPE_LINEAR = ( cydriver.CUresourcetype_enum.CU_RESOURCE_TYPE_LINEAR, 'Linear resource\n' - ){{endif}} - {{if 'CU_RESOURCE_TYPE_PITCH2D' in found_values}} + ) + CU_RESOURCE_TYPE_PITCH2D = ( cydriver.CUresourcetype_enum.CU_RESOURCE_TYPE_PITCH2D, 'Pitch 2D resource\n' - ){{endif}} - -{{endif}} -{{if 'CUaccessProperty_enum' in found_types}} + ) class CUaccessProperty(_FastEnum): """ Specifies performance hint with :py:obj:`~.CUaccessPolicyWindow` for hitProp and missProp members. """ - {{if 'CU_ACCESS_PROPERTY_NORMAL' in found_values}} + CU_ACCESS_PROPERTY_NORMAL = ( cydriver.CUaccessProperty_enum.CU_ACCESS_PROPERTY_NORMAL, 'Normal cache persistence.\n' - ){{endif}} - {{if 'CU_ACCESS_PROPERTY_STREAMING' in found_values}} + ) + CU_ACCESS_PROPERTY_STREAMING = ( cydriver.CUaccessProperty_enum.CU_ACCESS_PROPERTY_STREAMING, 'Streaming access is less likely to persit from cache.\n' - ){{endif}} - {{if 'CU_ACCESS_PROPERTY_PERSISTING' in found_values}} + ) + CU_ACCESS_PROPERTY_PERSISTING = ( cydriver.CUaccessProperty_enum.CU_ACCESS_PROPERTY_PERSISTING, 'Persisting access is more likely to persist in cache.\n' - ){{endif}} - -{{endif}} -{{if 'CUgraphConditionalNodeType_enum' in found_types}} + ) class CUgraphConditionalNodeType(_FastEnum): """ Conditional node types """ - {{if 'CU_GRAPH_COND_TYPE_IF' in found_values}} + CU_GRAPH_COND_TYPE_IF = ( cydriver.CUgraphConditionalNodeType_enum.CU_GRAPH_COND_TYPE_IF, "Conditional 'if/else' Node. Body[0] executed if condition is non-zero. If\n" '`size` == 2, an optional ELSE graph is created and this is executed if the\n' 'condition is zero.\n' - ){{endif}} - {{if 'CU_GRAPH_COND_TYPE_WHILE' in found_values}} + ) + CU_GRAPH_COND_TYPE_WHILE = ( cydriver.CUgraphConditionalNodeType_enum.CU_GRAPH_COND_TYPE_WHILE, "Conditional 'while' Node. Body executed repeatedly while condition value is\n" 'non-zero.\n' - ){{endif}} - {{if 'CU_GRAPH_COND_TYPE_SWITCH' in found_values}} + ) + CU_GRAPH_COND_TYPE_SWITCH = ( cydriver.CUgraphConditionalNodeType_enum.CU_GRAPH_COND_TYPE_SWITCH, "Conditional 'switch' Node. Body[n] is executed once, where 'n' is the value\n" 'of the condition. If the condition does not match a body index, no body is\n' 'launched.\n' - ){{endif}} - -{{endif}} -{{if 'CUgraphNodeType_enum' in found_types}} + ) class CUgraphNodeType(_FastEnum): """ Graph node types """ - {{if 'CU_GRAPH_NODE_TYPE_KERNEL' in found_values}} + CU_GRAPH_NODE_TYPE_KERNEL = ( cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_KERNEL, 'GPU kernel node\n' - ){{endif}} - {{if 'CU_GRAPH_NODE_TYPE_MEMCPY' in found_values}} + ) + CU_GRAPH_NODE_TYPE_MEMCPY = ( cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEMCPY, 'Memcpy node\n' - ){{endif}} - {{if 'CU_GRAPH_NODE_TYPE_MEMSET' in found_values}} + ) + CU_GRAPH_NODE_TYPE_MEMSET = ( cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEMSET, 'Memset node\n' - ){{endif}} - {{if 'CU_GRAPH_NODE_TYPE_HOST' in found_values}} + ) + CU_GRAPH_NODE_TYPE_HOST = ( cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_HOST, 'Host (executable) node\n' - ){{endif}} - {{if 'CU_GRAPH_NODE_TYPE_GRAPH' in found_values}} + ) + CU_GRAPH_NODE_TYPE_GRAPH = ( cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_GRAPH, 'Node which executes an embedded graph\n' - ){{endif}} - {{if 'CU_GRAPH_NODE_TYPE_EMPTY' in found_values}} + ) + CU_GRAPH_NODE_TYPE_EMPTY = ( cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EMPTY, 'Empty (no-op) node\n' - ){{endif}} - {{if 'CU_GRAPH_NODE_TYPE_WAIT_EVENT' in found_values}} + ) + CU_GRAPH_NODE_TYPE_WAIT_EVENT = ( cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_WAIT_EVENT, 'External event wait node\n' - ){{endif}} - {{if 'CU_GRAPH_NODE_TYPE_EVENT_RECORD' in found_values}} + ) + CU_GRAPH_NODE_TYPE_EVENT_RECORD = ( cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EVENT_RECORD, 'External event record node\n' - ){{endif}} - {{if 'CU_GRAPH_NODE_TYPE_EXT_SEMAS_SIGNAL' in found_values}} + ) + CU_GRAPH_NODE_TYPE_EXT_SEMAS_SIGNAL = ( cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EXT_SEMAS_SIGNAL, 'External semaphore signal node\n' - ){{endif}} - {{if 'CU_GRAPH_NODE_TYPE_EXT_SEMAS_WAIT' in found_values}} + ) + CU_GRAPH_NODE_TYPE_EXT_SEMAS_WAIT = ( cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EXT_SEMAS_WAIT, 'External semaphore wait node\n' - ){{endif}} - {{if 'CU_GRAPH_NODE_TYPE_MEM_ALLOC' in found_values}} + ) + CU_GRAPH_NODE_TYPE_MEM_ALLOC = ( cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_ALLOC, 'Memory Allocation Node\n' - ){{endif}} - {{if 'CU_GRAPH_NODE_TYPE_MEM_FREE' in found_values}} + ) + CU_GRAPH_NODE_TYPE_MEM_FREE = ( cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_FREE, 'Memory Free Node\n' - ){{endif}} - {{if 'CU_GRAPH_NODE_TYPE_BATCH_MEM_OP' in found_values}} + ) + CU_GRAPH_NODE_TYPE_BATCH_MEM_OP = ( cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_BATCH_MEM_OP, 'Batch MemOp Node See :py:obj:`~.cuStreamBatchMemOp` and\n' ':py:obj:`~.CUstreamBatchMemOpType` for what these nodes can do.\n' - ){{endif}} - {{if 'CU_GRAPH_NODE_TYPE_CONDITIONAL' in found_values}} + ) + CU_GRAPH_NODE_TYPE_CONDITIONAL = ( cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_CONDITIONAL, @@ -3963,23 +3869,26 @@ class CUgraphNodeType(_FastEnum): 'default value when creating the handle and/or\n' ' call\n' ':py:obj:`~.cudaGraphSetConditional` from device code.\n' - ){{endif}} + ) + -{{endif}} -{{if 'CUgraphDependencyType_enum' in found_types}} + CU_GRAPH_NODE_TYPE_RESERVED_16 = ( + cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_RESERVED_16, + 'Reserved\n' + ) class CUgraphDependencyType(_FastEnum): """ Type annotations that can be applied to graph edges as part of :py:obj:`~.CUgraphEdgeData`. """ - {{if 'CU_GRAPH_DEPENDENCY_TYPE_DEFAULT' in found_values}} + CU_GRAPH_DEPENDENCY_TYPE_DEFAULT = ( cydriver.CUgraphDependencyType_enum.CU_GRAPH_DEPENDENCY_TYPE_DEFAULT, 'This is an ordinary dependency.\n' - ){{endif}} - {{if 'CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC' in found_values}} + ) + CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC = ( cydriver.CUgraphDependencyType_enum.CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC, @@ -3988,100 +3897,88 @@ class CUgraphDependencyType(_FastEnum): 'nodes, and must be used with either the\n' ':py:obj:`~.CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC` or\n' ':py:obj:`~.CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER` outgoing port.\n' - ){{endif}} - -{{endif}} -{{if 'CUgraphInstantiateResult_enum' in found_types}} + ) class CUgraphInstantiateResult(_FastEnum): """ Graph instantiation results """ - {{if 'CUDA_GRAPH_INSTANTIATE_SUCCESS' in found_values}} + CUDA_GRAPH_INSTANTIATE_SUCCESS = ( cydriver.CUgraphInstantiateResult_enum.CUDA_GRAPH_INSTANTIATE_SUCCESS, 'Instantiation succeeded\n' - ){{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_ERROR' in found_values}} + ) + CUDA_GRAPH_INSTANTIATE_ERROR = ( cydriver.CUgraphInstantiateResult_enum.CUDA_GRAPH_INSTANTIATE_ERROR, 'Instantiation failed for an unexpected reason which is described in the\n' 'return value of the function\n' - ){{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_INVALID_STRUCTURE' in found_values}} + ) + CUDA_GRAPH_INSTANTIATE_INVALID_STRUCTURE = ( cydriver.CUgraphInstantiateResult_enum.CUDA_GRAPH_INSTANTIATE_INVALID_STRUCTURE, 'Instantiation failed due to invalid structure, such as cycles\n' - ){{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_NODE_OPERATION_NOT_SUPPORTED' in found_values}} + ) + CUDA_GRAPH_INSTANTIATE_NODE_OPERATION_NOT_SUPPORTED = ( cydriver.CUgraphInstantiateResult_enum.CUDA_GRAPH_INSTANTIATE_NODE_OPERATION_NOT_SUPPORTED, 'Instantiation for device launch failed because the graph contained an\n' 'unsupported operation\n' - ){{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_MULTIPLE_CTXS_NOT_SUPPORTED' in found_values}} + ) + CUDA_GRAPH_INSTANTIATE_MULTIPLE_CTXS_NOT_SUPPORTED = ( cydriver.CUgraphInstantiateResult_enum.CUDA_GRAPH_INSTANTIATE_MULTIPLE_CTXS_NOT_SUPPORTED, 'Instantiation for device launch failed due to the nodes belonging to\n' 'different contexts\n' - ){{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_CONDITIONAL_HANDLE_UNUSED' in found_values}} + ) + CUDA_GRAPH_INSTANTIATE_CONDITIONAL_HANDLE_UNUSED = ( cydriver.CUgraphInstantiateResult_enum.CUDA_GRAPH_INSTANTIATE_CONDITIONAL_HANDLE_UNUSED, 'One or more conditional handles are not associated with conditional nodes\n' - ){{endif}} - -{{endif}} -{{if 'CUsynchronizationPolicy_enum' in found_types}} + ) class CUsynchronizationPolicy(_FastEnum): """ """ - {{if 'CU_SYNC_POLICY_AUTO' in found_values}} - CU_SYNC_POLICY_AUTO = cydriver.CUsynchronizationPolicy_enum.CU_SYNC_POLICY_AUTO{{endif}} - {{if 'CU_SYNC_POLICY_SPIN' in found_values}} - CU_SYNC_POLICY_SPIN = cydriver.CUsynchronizationPolicy_enum.CU_SYNC_POLICY_SPIN{{endif}} - {{if 'CU_SYNC_POLICY_YIELD' in found_values}} - CU_SYNC_POLICY_YIELD = cydriver.CUsynchronizationPolicy_enum.CU_SYNC_POLICY_YIELD{{endif}} - {{if 'CU_SYNC_POLICY_BLOCKING_SYNC' in found_values}} - CU_SYNC_POLICY_BLOCKING_SYNC = cydriver.CUsynchronizationPolicy_enum.CU_SYNC_POLICY_BLOCKING_SYNC{{endif}} -{{endif}} -{{if 'CUclusterSchedulingPolicy_enum' in found_types}} + CU_SYNC_POLICY_AUTO = cydriver.CUsynchronizationPolicy_enum.CU_SYNC_POLICY_AUTO + + CU_SYNC_POLICY_SPIN = cydriver.CUsynchronizationPolicy_enum.CU_SYNC_POLICY_SPIN + + CU_SYNC_POLICY_YIELD = cydriver.CUsynchronizationPolicy_enum.CU_SYNC_POLICY_YIELD + + CU_SYNC_POLICY_BLOCKING_SYNC = cydriver.CUsynchronizationPolicy_enum.CU_SYNC_POLICY_BLOCKING_SYNC class CUclusterSchedulingPolicy(_FastEnum): """ Cluster scheduling policies. These may be passed to :py:obj:`~.cuFuncSetAttribute` or :py:obj:`~.cuKernelSetAttribute` """ - {{if 'CU_CLUSTER_SCHEDULING_POLICY_DEFAULT' in found_values}} + CU_CLUSTER_SCHEDULING_POLICY_DEFAULT = ( cydriver.CUclusterSchedulingPolicy_enum.CU_CLUSTER_SCHEDULING_POLICY_DEFAULT, 'the default policy\n' - ){{endif}} - {{if 'CU_CLUSTER_SCHEDULING_POLICY_SPREAD' in found_values}} + ) + CU_CLUSTER_SCHEDULING_POLICY_SPREAD = ( cydriver.CUclusterSchedulingPolicy_enum.CU_CLUSTER_SCHEDULING_POLICY_SPREAD, 'spread the blocks within a cluster to the SMs\n' - ){{endif}} - {{if 'CU_CLUSTER_SCHEDULING_POLICY_LOAD_BALANCING' in found_values}} + ) + CU_CLUSTER_SCHEDULING_POLICY_LOAD_BALANCING = ( cydriver.CUclusterSchedulingPolicy_enum.CU_CLUSTER_SCHEDULING_POLICY_LOAD_BALANCING, 'allow the hardware to load-balance the blocks in a cluster to the SMs\n' - ){{endif}} - -{{endif}} -{{if 'CUlaunchMemSyncDomain_enum' in found_types}} + ) class CUlaunchMemSyncDomain(_FastEnum): """ @@ -4104,129 +4001,120 @@ class CUlaunchMemSyncDomain(_FastEnum): by kernels in another memory synchronization domain even if they are on the same GPU. """ - {{if 'CU_LAUNCH_MEM_SYNC_DOMAIN_DEFAULT' in found_values}} + CU_LAUNCH_MEM_SYNC_DOMAIN_DEFAULT = ( cydriver.CUlaunchMemSyncDomain_enum.CU_LAUNCH_MEM_SYNC_DOMAIN_DEFAULT, 'Launch kernels in the default domain\n' - ){{endif}} - {{if 'CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE' in found_values}} + ) + CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE = ( cydriver.CUlaunchMemSyncDomain_enum.CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE, 'Launch kernels in the remote domain\n' - ){{endif}} - -{{endif}} -{{if 'CUlaunchAttributePortableClusterMode_enum' in found_types}} + ) class CUlaunchAttributePortableClusterMode(_FastEnum): """ Enum for defining applicability of portable cluster size, used with :py:obj:`~.cuLaunchKernelEx` """ - {{if 'CU_LAUNCH_PORTABLE_CLUSTER_MODE_DEFAULT' in found_values}} + CU_LAUNCH_PORTABLE_CLUSTER_MODE_DEFAULT = ( cydriver.CUlaunchAttributePortableClusterMode_enum.CU_LAUNCH_PORTABLE_CLUSTER_MODE_DEFAULT, 'The default to use for allowing non-portable cluster size on launch - uses\n' 'current function attribute for\n' ':py:obj:`~.CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED`\n' - ){{endif}} - {{if 'CU_LAUNCH_PORTABLE_CLUSTER_MODE_REQUIRE_PORTABLE' in found_values}} + ) + CU_LAUNCH_PORTABLE_CLUSTER_MODE_REQUIRE_PORTABLE = ( cydriver.CUlaunchAttributePortableClusterMode_enum.CU_LAUNCH_PORTABLE_CLUSTER_MODE_REQUIRE_PORTABLE, 'Specifies that the cluster size requested must be a portable size\n' - ){{endif}} - {{if 'CU_LAUNCH_PORTABLE_CLUSTER_MODE_ALLOW_NON_PORTABLE' in found_values}} + ) + CU_LAUNCH_PORTABLE_CLUSTER_MODE_ALLOW_NON_PORTABLE = ( cydriver.CUlaunchAttributePortableClusterMode_enum.CU_LAUNCH_PORTABLE_CLUSTER_MODE_ALLOW_NON_PORTABLE, 'Specifies that the cluster size requested may be a non-portable size\n' - ){{endif}} - -{{endif}} -{{if 'CUsharedMemoryMode_enum' in found_types}} + ) class CUsharedMemoryMode(_FastEnum): """ Shared memory related attributes for use with :py:obj:`~.cuLaunchKernelEx` """ - {{if 'CU_SHARED_MEMORY_MODE_DEFAULT' in found_values}} + CU_SHARED_MEMORY_MODE_DEFAULT = ( cydriver.CUsharedMemoryMode_enum.CU_SHARED_MEMORY_MODE_DEFAULT, 'The default to use for shared memory on launch - uses current function\n' 'attribute for :py:obj:`~.CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES`\n' - ){{endif}} - {{if 'CU_SHARED_MEMORY_MODE_REQUIRE_PORTABLE' in found_values}} + ) + CU_SHARED_MEMORY_MODE_REQUIRE_PORTABLE = ( cydriver.CUsharedMemoryMode_enum.CU_SHARED_MEMORY_MODE_REQUIRE_PORTABLE, 'Specifies that the dynamic shared size bytes requested must be a portable\n' 'size within the bounds of\n' ':py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK`\n' - ){{endif}} - {{if 'CU_SHARED_MEMORY_MODE_ALLOW_NON_PORTABLE' in found_values}} + ) + CU_SHARED_MEMORY_MODE_ALLOW_NON_PORTABLE = ( cydriver.CUsharedMemoryMode_enum.CU_SHARED_MEMORY_MODE_ALLOW_NON_PORTABLE, 'Specifies that the dynamic shared size bytes requested may be a non-\n' 'portable size but still within the bounds of\n' ':py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN`\n' - ){{endif}} - -{{endif}} -{{if 'CUlaunchAttributeID_enum' in found_types}} + ) class CUlaunchAttributeID(_FastEnum): """ Launch attributes enum; used as id field of :py:obj:`~.CUlaunchAttribute` """ - {{if 'CU_LAUNCH_ATTRIBUTE_IGNORE' in found_values}} + CU_LAUNCH_ATTRIBUTE_IGNORE = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_IGNORE, 'Ignored entry, for convenient composition\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW, 'Valid for streams, graph nodes, launches. See\n' ':py:obj:`~.CUlaunchAttributeValue.accessPolicyWindow`.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_COOPERATIVE' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_COOPERATIVE = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_COOPERATIVE, 'Valid for graph nodes, launches. See\n' ':py:obj:`~.CUlaunchAttributeValue.cooperative`.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY, 'Valid for streams. See :py:obj:`~.CUlaunchAttributeValue.syncPolicy`.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION, 'Valid for graph nodes, launches. See\n' ':py:obj:`~.CUlaunchAttributeValue.clusterDim`.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE, 'Valid for graph nodes, launches. See\n' ':py:obj:`~.CUlaunchAttributeValue.clusterSchedulingPolicyPreference`.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION, @@ -4238,8 +4126,8 @@ class CUlaunchAttributeID(_FastEnum): 'that kernel requests the overlap. The dependent launches can choose to wait\n' 'on the dependency using the programmatic sync\n' '(cudaGridDependencySynchronize() or equivalent PTX instructions).\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT, @@ -4263,29 +4151,29 @@ class CUlaunchAttributeID(_FastEnum): ' The event supplied must not be an interprocess or interop event. The event\n' 'must disable timing (i.e. must be created with the\n' ':py:obj:`~.CU_EVENT_DISABLE_TIMING` flag set).\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_PRIORITY' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_PRIORITY = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PRIORITY, 'Valid for streams, graph nodes, launches. See\n' ':py:obj:`~.CUlaunchAttributeValue.priority`.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP, 'Valid for streams, graph nodes, launches. See\n' ':py:obj:`~.CUlaunchAttributeValue.memSyncDomainMap`.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN, 'Valid for streams, graph nodes, launches. See\n' ':py:obj:`~.CUlaunchAttributeValue.memSyncDomain`.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION, @@ -4318,8 +4206,8 @@ class CUlaunchAttributeID(_FastEnum): 'than the maximum value the driver can support. Otherwise, setting this\n' 'attribute to a value physically unable to fit on any particular device is\n' 'permitted.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT, @@ -4340,23 +4228,22 @@ class CUlaunchAttributeID(_FastEnum): ' The event supplied must not be an interprocess or interop event. The event\n' 'must disable timing (i.e. must be created with the\n' ':py:obj:`~.CU_EVENT_DISABLE_TIMING` flag set).\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE, 'Valid for graph nodes, launches. This attribute is graphs-only, and passing\n' 'it to a launch in a non-capturing stream will result in an error.\n' - ':py:obj:`~.CUlaunchAttributeValue`::deviceUpdatableKernelNode::deviceUpdatable\n' + ':py:obj:`~.CUlaunchAttributeValue.deviceUpdatableKernelNode.deviceUpdatable`\n' 'can only be set to 0 or 1. Setting the field to 1 indicates that the\n' 'corresponding kernel node should be device-updatable. On success, a handle\n' 'will be returned via\n' - ':py:obj:`~.CUlaunchAttributeValue`::deviceUpdatableKernelNode::devNode\n' - 'which can be passed to the various device-side update functions to update\n' - "the node's kernel parameters from within another kernel. For more\n" - 'information on the types of device updates that can be made, as well as the\n' - 'relevant limitations thereof, see\n' - ':py:obj:`~.cudaGraphKernelNodeUpdatesApply`.\n' + ':py:obj:`~.CUlaunchAttributeValue.deviceUpdatableKernelNode.devNode` which\n' + 'can be passed to the various device-side update functions to update the\n' + "node's kernel parameters from within another kernel. For more information\n" + 'on the types of device updates that can be made, as well as the relevant\n' + 'limitations thereof, see :py:obj:`~.cudaGraphKernelNodeUpdatesApply`.\n' ' Nodes which are device-updatable have additional restrictions compared to\n' 'regular kernel nodes. Firstly, device-updatable nodes cannot be removed\n' 'from their graph via :py:obj:`~.cuGraphDestroyNode`. Additionally, once\n' @@ -4372,8 +4259,8 @@ class CUlaunchAttributeID(_FastEnum): ':py:obj:`~.cuGraphUpload` before it is launched. For such a graph, if host-\n' 'side executable graph updates are made to the device-updatable nodes, the\n' 'graph must be uploaded before it is launched again.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT, @@ -4386,8 +4273,8 @@ class CUlaunchAttributeID(_FastEnum): ':py:obj:`~.CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT`. This is\n' 'only a hint, and the CUDA driver can choose a different configuration if\n' 'required for the launch.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING, @@ -4406,10 +4293,10 @@ class CUlaunchAttributeID(_FastEnum): 'not improve the performance of either the targeted kernel or the\n' 'encapsulating application.\n' ' Valid values for\n' - ':py:obj:`~.CUlaunchAttributeValue`::nvlinkUtilCentricScheduling are 0\n' + ':py:obj:`~.CUlaunchAttributeValue.nvlinkUtilCentricScheduling` are 0\n' '(disabled) and 1 (enabled).\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE, @@ -4418,45 +4305,39 @@ class CUlaunchAttributeID(_FastEnum): ':py:obj:`~.CUlaunchAttributeValue.portableClusterSizeMode` are described in\n' ':py:obj:`~.CUlaunchAttributePortableClusterMode`. Any other value will\n' 'return :py:obj:`~.CUDA_ERROR_INVALID_VALUE`\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE, 'Valid for graph nodes, launches. This indicates if the kernel is allowed to\n' 'use a non-portable dynamic shared memory mode.\n' - ){{endif}} - -{{endif}} -{{if 'CUstreamCaptureStatus_enum' in found_types}} + ) class CUstreamCaptureStatus(_FastEnum): """ Possible stream capture statuses returned by :py:obj:`~.cuStreamIsCapturing` """ - {{if 'CU_STREAM_CAPTURE_STATUS_NONE' in found_values}} + CU_STREAM_CAPTURE_STATUS_NONE = ( cydriver.CUstreamCaptureStatus_enum.CU_STREAM_CAPTURE_STATUS_NONE, 'Stream is not capturing\n' - ){{endif}} - {{if 'CU_STREAM_CAPTURE_STATUS_ACTIVE' in found_values}} + ) + CU_STREAM_CAPTURE_STATUS_ACTIVE = ( cydriver.CUstreamCaptureStatus_enum.CU_STREAM_CAPTURE_STATUS_ACTIVE, 'Stream is actively capturing\n' - ){{endif}} - {{if 'CU_STREAM_CAPTURE_STATUS_INVALIDATED' in found_values}} + ) + CU_STREAM_CAPTURE_STATUS_INVALIDATED = ( cydriver.CUstreamCaptureStatus_enum.CU_STREAM_CAPTURE_STATUS_INVALIDATED, 'Stream is part of a capture sequence that has been invalidated, but not\n' 'terminated\n' - ){{endif}} - -{{endif}} -{{if 'CUstreamCaptureMode_enum' in found_types}} + ) class CUstreamCaptureMode(_FastEnum): """ @@ -4464,119 +4345,101 @@ class CUstreamCaptureMode(_FastEnum): details see :py:obj:`~.cuStreamBeginCapture` and :py:obj:`~.cuThreadExchangeStreamCaptureMode` """ - {{if 'CU_STREAM_CAPTURE_MODE_GLOBAL' in found_values}} - CU_STREAM_CAPTURE_MODE_GLOBAL = cydriver.CUstreamCaptureMode_enum.CU_STREAM_CAPTURE_MODE_GLOBAL{{endif}} - {{if 'CU_STREAM_CAPTURE_MODE_THREAD_LOCAL' in found_values}} - CU_STREAM_CAPTURE_MODE_THREAD_LOCAL = cydriver.CUstreamCaptureMode_enum.CU_STREAM_CAPTURE_MODE_THREAD_LOCAL{{endif}} - {{if 'CU_STREAM_CAPTURE_MODE_RELAXED' in found_values}} - CU_STREAM_CAPTURE_MODE_RELAXED = cydriver.CUstreamCaptureMode_enum.CU_STREAM_CAPTURE_MODE_RELAXED{{endif}} -{{endif}} -{{if 'CUdriverProcAddress_flags_enum' in found_types}} + CU_STREAM_CAPTURE_MODE_GLOBAL = cydriver.CUstreamCaptureMode_enum.CU_STREAM_CAPTURE_MODE_GLOBAL + + CU_STREAM_CAPTURE_MODE_THREAD_LOCAL = cydriver.CUstreamCaptureMode_enum.CU_STREAM_CAPTURE_MODE_THREAD_LOCAL + + CU_STREAM_CAPTURE_MODE_RELAXED = cydriver.CUstreamCaptureMode_enum.CU_STREAM_CAPTURE_MODE_RELAXED class CUdriverProcAddress_flags(_FastEnum): """ Flags to specify search options. For more details see :py:obj:`~.cuGetProcAddress` """ - {{if 'CU_GET_PROC_ADDRESS_DEFAULT' in found_values}} + CU_GET_PROC_ADDRESS_DEFAULT = ( cydriver.CUdriverProcAddress_flags_enum.CU_GET_PROC_ADDRESS_DEFAULT, 'Default search mode for driver symbols.\n' - ){{endif}} - {{if 'CU_GET_PROC_ADDRESS_LEGACY_STREAM' in found_values}} + ) + CU_GET_PROC_ADDRESS_LEGACY_STREAM = ( cydriver.CUdriverProcAddress_flags_enum.CU_GET_PROC_ADDRESS_LEGACY_STREAM, 'Search for legacy versions of driver symbols.\n' - ){{endif}} - {{if 'CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM' in found_values}} + ) + CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM = ( cydriver.CUdriverProcAddress_flags_enum.CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, 'Search for per-thread versions of driver symbols.\n' - ){{endif}} - -{{endif}} -{{if 'CUdriverProcAddressQueryResult_enum' in found_types}} + ) class CUdriverProcAddressQueryResult(_FastEnum): """ Flags to indicate search status. For more details see :py:obj:`~.cuGetProcAddress` """ - {{if 'CU_GET_PROC_ADDRESS_SUCCESS' in found_values}} + CU_GET_PROC_ADDRESS_SUCCESS = ( cydriver.CUdriverProcAddressQueryResult_enum.CU_GET_PROC_ADDRESS_SUCCESS, 'Symbol was succesfully found\n' - ){{endif}} - {{if 'CU_GET_PROC_ADDRESS_SYMBOL_NOT_FOUND' in found_values}} + ) + CU_GET_PROC_ADDRESS_SYMBOL_NOT_FOUND = ( cydriver.CUdriverProcAddressQueryResult_enum.CU_GET_PROC_ADDRESS_SYMBOL_NOT_FOUND, 'Symbol was not found in search\n' - ){{endif}} - {{if 'CU_GET_PROC_ADDRESS_VERSION_NOT_SUFFICIENT' in found_values}} + ) + CU_GET_PROC_ADDRESS_VERSION_NOT_SUFFICIENT = ( cydriver.CUdriverProcAddressQueryResult_enum.CU_GET_PROC_ADDRESS_VERSION_NOT_SUFFICIENT, 'Symbol was found but version supplied was not sufficient\n' - ){{endif}} - -{{endif}} -{{if 'CUexecAffinityType_enum' in found_types}} + ) class CUexecAffinityType(_FastEnum): """ Execution Affinity Types """ - {{if 'CU_EXEC_AFFINITY_TYPE_SM_COUNT' in found_values}} + CU_EXEC_AFFINITY_TYPE_SM_COUNT = ( cydriver.CUexecAffinityType_enum.CU_EXEC_AFFINITY_TYPE_SM_COUNT, 'Create a context with limited SMs.\n' - ){{endif}} - {{if 'CU_EXEC_AFFINITY_TYPE_MAX' in found_values}} - CU_EXEC_AFFINITY_TYPE_MAX = cydriver.CUexecAffinityType_enum.CU_EXEC_AFFINITY_TYPE_MAX{{endif}} + ) -{{endif}} -{{if 'CUcigDataType_enum' in found_types}} + CU_EXEC_AFFINITY_TYPE_MAX = cydriver.CUexecAffinityType_enum.CU_EXEC_AFFINITY_TYPE_MAX class CUcigDataType(_FastEnum): """ """ - {{if 'CIG_DATA_TYPE_D3D12_COMMAND_QUEUE' in found_values}} + CIG_DATA_TYPE_D3D12_COMMAND_QUEUE = ( cydriver.CUcigDataType_enum.CIG_DATA_TYPE_D3D12_COMMAND_QUEUE, 'D3D12 Command Queue Handle\n' - ){{endif}} - {{if 'CIG_DATA_TYPE_NV_BLOB' in found_values}} + ) + CIG_DATA_TYPE_NV_BLOB = ( cydriver.CUcigDataType_enum.CIG_DATA_TYPE_NV_BLOB, 'Nvidia specific data blob used for Vulkan and other NV clients\n' - ){{endif}} - -{{endif}} -{{if 'CUstreamCigDataType_enum' in found_types}} + ) class CUstreamCigDataType(_FastEnum): """ """ - {{if 'STREAM_CIG_DATA_TYPE_D3D12_COMMAND_LIST' in found_values}} + STREAM_CIG_DATA_TYPE_D3D12_COMMAND_LIST = ( cydriver.CUstreamCigDataType_enum.STREAM_CIG_DATA_TYPE_D3D12_COMMAND_LIST, 'D3D12 Command List Handle\n' - ){{endif}} - -{{endif}} -{{if 'CUlibraryOption_enum' in found_types}} + ) class CUlibraryOption(_FastEnum): """ @@ -4584,9 +4447,9 @@ class CUlibraryOption(_FastEnum): :py:obj:`~.cuLibraryLoadData()` or :py:obj:`~.cuLibraryLoadFromFile()` """ - {{if 'CU_LIBRARY_HOST_UNIVERSAL_FUNCTION_AND_DATA_TABLE' in found_values}} - CU_LIBRARY_HOST_UNIVERSAL_FUNCTION_AND_DATA_TABLE = cydriver.CUlibraryOption_enum.CU_LIBRARY_HOST_UNIVERSAL_FUNCTION_AND_DATA_TABLE{{endif}} - {{if 'CU_LIBRARY_BINARY_IS_PRESERVED' in found_values}} + + CU_LIBRARY_HOST_UNIVERSAL_FUNCTION_AND_DATA_TABLE = cydriver.CUlibraryOption_enum.CU_LIBRARY_HOST_UNIVERSAL_FUNCTION_AND_DATA_TABLE + CU_LIBRARY_BINARY_IS_PRESERVED = ( cydriver.CUlibraryOption_enum.CU_LIBRARY_BINARY_IS_PRESERVED, @@ -4598,95 +4461,92 @@ class CUlibraryOption(_FastEnum): 'the driver can choose to ignore it if required. Specifying this option with\n' ':py:obj:`~.cuLibraryLoadFromFile()` is invalid and will return\n' ':py:obj:`~.CUDA_ERROR_INVALID_VALUE`.\n' - ){{endif}} - {{if 'CU_LIBRARY_NUM_OPTIONS' in found_values}} - CU_LIBRARY_NUM_OPTIONS = cydriver.CUlibraryOption_enum.CU_LIBRARY_NUM_OPTIONS{{endif}} + ) -{{endif}} -{{if 'cudaError_enum' in found_types}} + CU_LIBRARY_NUM_OPTIONS = cydriver.CUlibraryOption_enum.CU_LIBRARY_NUM_OPTIONS class CUresult(_FastEnum): """ Error codes """ - {{if 'CUDA_SUCCESS' in found_values}} + CUDA_SUCCESS = ( cydriver.cudaError_enum.CUDA_SUCCESS, 'The API call returned with no errors. In the case of query calls, this also\n' 'means that the operation being queried is complete (see\n' ':py:obj:`~.cuEventQuery()` and :py:obj:`~.cuStreamQuery()`).\n' - ){{endif}} - {{if 'CUDA_ERROR_INVALID_VALUE' in found_values}} + ) + CUDA_ERROR_INVALID_VALUE = ( cydriver.cudaError_enum.CUDA_ERROR_INVALID_VALUE, 'This indicates that one or more of the parameters passed to the API call is\n' 'not within an acceptable range of values.\n' - ){{endif}} - {{if 'CUDA_ERROR_OUT_OF_MEMORY' in found_values}} + ) + CUDA_ERROR_OUT_OF_MEMORY = ( cydriver.cudaError_enum.CUDA_ERROR_OUT_OF_MEMORY, 'The API call failed because it was unable to allocate enough memory or\n' 'other resources to perform the requested operation.\n' - ){{endif}} - {{if 'CUDA_ERROR_NOT_INITIALIZED' in found_values}} + ) + CUDA_ERROR_NOT_INITIALIZED = ( cydriver.cudaError_enum.CUDA_ERROR_NOT_INITIALIZED, 'This indicates that the CUDA driver has not been initialized with\n' ':py:obj:`~.cuInit()` or that initialization has failed.\n' - ){{endif}} - {{if 'CUDA_ERROR_DEINITIALIZED' in found_values}} + ) + CUDA_ERROR_DEINITIALIZED = ( cydriver.cudaError_enum.CUDA_ERROR_DEINITIALIZED, 'This indicates that the CUDA driver is in the process of shutting down.\n' - ){{endif}} - {{if 'CUDA_ERROR_PROFILER_DISABLED' in found_values}} + ) + CUDA_ERROR_PROFILER_DISABLED = ( cydriver.cudaError_enum.CUDA_ERROR_PROFILER_DISABLED, 'This indicates profiler is not initialized for this run. This can happen\n' 'when the application is running with external profiling tools like visual\n' 'profiler.\n' - ){{endif}} - {{if 'CUDA_ERROR_PROFILER_NOT_INITIALIZED' in found_values}} + ) + CUDA_ERROR_PROFILER_NOT_INITIALIZED = ( cydriver.cudaError_enum.CUDA_ERROR_PROFILER_NOT_INITIALIZED, '[Deprecated]\n' - ){{endif}} - {{if 'CUDA_ERROR_PROFILER_ALREADY_STARTED' in found_values}} + ) + CUDA_ERROR_PROFILER_ALREADY_STARTED = ( cydriver.cudaError_enum.CUDA_ERROR_PROFILER_ALREADY_STARTED, '[Deprecated]\n' - ){{endif}} - {{if 'CUDA_ERROR_PROFILER_ALREADY_STOPPED' in found_values}} + ) + CUDA_ERROR_PROFILER_ALREADY_STOPPED = ( cydriver.cudaError_enum.CUDA_ERROR_PROFILER_ALREADY_STOPPED, '[Deprecated]\n' - ){{endif}} - {{if 'CUDA_ERROR_STUB_LIBRARY' in found_values}} + ) + CUDA_ERROR_STUB_LIBRARY = ( cydriver.cudaError_enum.CUDA_ERROR_STUB_LIBRARY, 'This indicates that the CUDA driver that the application has loaded is a\n' 'stub library. Applications that run with the stub rather than a real driver\n' 'loaded will result in CUDA API returning this error.\n' - ){{endif}} - {{if 'CUDA_ERROR_CALL_REQUIRES_NEWER_DRIVER' in found_values}} + ) + CUDA_ERROR_CALL_REQUIRES_NEWER_DRIVER = ( cydriver.cudaError_enum.CUDA_ERROR_CALL_REQUIRES_NEWER_DRIVER, 'This indicates that the API call requires a newer CUDA driver than the one\n' 'currently installed. Users should install an updated NVIDIA CUDA driver to\n' 'allow the API call to succeed.\n' - ){{endif}} - {{if 'CUDA_ERROR_DEVICE_UNAVAILABLE' in found_values}} + ) + CUDA_ERROR_DEVICE_UNAVAILABLE = ( cydriver.cudaError_enum.CUDA_ERROR_DEVICE_UNAVAILABLE, @@ -4694,36 +4554,36 @@ class CUresult(_FastEnum): 'time. Devices are often unavailable due to use of\n' ':py:obj:`~.CU_COMPUTEMODE_EXCLUSIVE_PROCESS` or\n' ':py:obj:`~.CU_COMPUTEMODE_PROHIBITED`.\n' - ){{endif}} - {{if 'CUDA_ERROR_NO_DEVICE' in found_values}} + ) + CUDA_ERROR_NO_DEVICE = ( cydriver.cudaError_enum.CUDA_ERROR_NO_DEVICE, 'This indicates that no CUDA-capable devices were detected by the installed\n' 'CUDA driver.\n' - ){{endif}} - {{if 'CUDA_ERROR_INVALID_DEVICE' in found_values}} + ) + CUDA_ERROR_INVALID_DEVICE = ( cydriver.cudaError_enum.CUDA_ERROR_INVALID_DEVICE, 'This indicates that the device ordinal supplied by the user does not\n' 'correspond to a valid CUDA device or that the action requested is invalid\n' 'for the specified device.\n' - ){{endif}} - {{if 'CUDA_ERROR_DEVICE_NOT_LICENSED' in found_values}} + ) + CUDA_ERROR_DEVICE_NOT_LICENSED = ( cydriver.cudaError_enum.CUDA_ERROR_DEVICE_NOT_LICENSED, 'This error indicates that the Grid license is not applied.\n' - ){{endif}} - {{if 'CUDA_ERROR_INVALID_IMAGE' in found_values}} + ) + CUDA_ERROR_INVALID_IMAGE = ( cydriver.cudaError_enum.CUDA_ERROR_INVALID_IMAGE, 'This indicates that the device kernel image is invalid. This can also\n' 'indicate an invalid CUDA module.\n' - ){{endif}} - {{if 'CUDA_ERROR_INVALID_CONTEXT' in found_values}} + ) + CUDA_ERROR_INVALID_CONTEXT = ( cydriver.cudaError_enum.CUDA_ERROR_INVALID_CONTEXT, @@ -4735,40 +4595,41 @@ class CUresult(_FastEnum): 'See :py:obj:`~.cuCtxGetApiVersion()` for more details. This can also be\n' 'returned if the green context passed to an API call was not converted to a\n' ':py:obj:`~.CUcontext` using :py:obj:`~.cuCtxFromGreenCtx` API.\n' - ){{endif}} - {{if 'CUDA_ERROR_CONTEXT_ALREADY_CURRENT' in found_values}} + ) + CUDA_ERROR_CONTEXT_ALREADY_CURRENT = ( cydriver.cudaError_enum.CUDA_ERROR_CONTEXT_ALREADY_CURRENT, 'This indicated that the context being supplied as a parameter to the API\n' - 'call was already the active context. [Deprecated]\n' - ){{endif}} - {{if 'CUDA_ERROR_MAP_FAILED' in found_values}} + 'call was already the active context.\n' + '[Deprecated]\n' + ) + CUDA_ERROR_MAP_FAILED = ( cydriver.cudaError_enum.CUDA_ERROR_MAP_FAILED, 'This indicates that a map or register operation has failed.\n' - ){{endif}} - {{if 'CUDA_ERROR_UNMAP_FAILED' in found_values}} + ) + CUDA_ERROR_UNMAP_FAILED = ( cydriver.cudaError_enum.CUDA_ERROR_UNMAP_FAILED, 'This indicates that an unmap or unregister operation has failed.\n' - ){{endif}} - {{if 'CUDA_ERROR_ARRAY_IS_MAPPED' in found_values}} + ) + CUDA_ERROR_ARRAY_IS_MAPPED = ( cydriver.cudaError_enum.CUDA_ERROR_ARRAY_IS_MAPPED, 'This indicates that the specified array is currently mapped and thus cannot\n' 'be destroyed.\n' - ){{endif}} - {{if 'CUDA_ERROR_ALREADY_MAPPED' in found_values}} + ) + CUDA_ERROR_ALREADY_MAPPED = ( cydriver.cudaError_enum.CUDA_ERROR_ALREADY_MAPPED, 'This indicates that the resource is already mapped.\n' - ){{endif}} - {{if 'CUDA_ERROR_NO_BINARY_FOR_GPU' in found_values}} + ) + CUDA_ERROR_NO_BINARY_FOR_GPU = ( cydriver.cudaError_enum.CUDA_ERROR_NO_BINARY_FOR_GPU, @@ -4776,114 +4637,114 @@ class CUresult(_FastEnum): 'the device. This can occur when a user specifies code generation options\n' 'for a particular CUDA source file that do not include the corresponding\n' 'device configuration.\n' - ){{endif}} - {{if 'CUDA_ERROR_ALREADY_ACQUIRED' in found_values}} + ) + CUDA_ERROR_ALREADY_ACQUIRED = ( cydriver.cudaError_enum.CUDA_ERROR_ALREADY_ACQUIRED, 'This indicates that a resource has already been acquired.\n' - ){{endif}} - {{if 'CUDA_ERROR_NOT_MAPPED' in found_values}} + ) + CUDA_ERROR_NOT_MAPPED = ( cydriver.cudaError_enum.CUDA_ERROR_NOT_MAPPED, 'This indicates that a resource is not mapped.\n' - ){{endif}} - {{if 'CUDA_ERROR_NOT_MAPPED_AS_ARRAY' in found_values}} + ) + CUDA_ERROR_NOT_MAPPED_AS_ARRAY = ( cydriver.cudaError_enum.CUDA_ERROR_NOT_MAPPED_AS_ARRAY, 'This indicates that a mapped resource is not available for access as an\n' 'array.\n' - ){{endif}} - {{if 'CUDA_ERROR_NOT_MAPPED_AS_POINTER' in found_values}} + ) + CUDA_ERROR_NOT_MAPPED_AS_POINTER = ( cydriver.cudaError_enum.CUDA_ERROR_NOT_MAPPED_AS_POINTER, 'This indicates that a mapped resource is not available for access as a\n' 'pointer.\n' - ){{endif}} - {{if 'CUDA_ERROR_ECC_UNCORRECTABLE' in found_values}} + ) + CUDA_ERROR_ECC_UNCORRECTABLE = ( cydriver.cudaError_enum.CUDA_ERROR_ECC_UNCORRECTABLE, 'This indicates that an uncorrectable ECC error was detected during\n' 'execution.\n' - ){{endif}} - {{if 'CUDA_ERROR_UNSUPPORTED_LIMIT' in found_values}} + ) + CUDA_ERROR_UNSUPPORTED_LIMIT = ( cydriver.cudaError_enum.CUDA_ERROR_UNSUPPORTED_LIMIT, 'This indicates that the :py:obj:`~.CUlimit` passed to the API call is not\n' 'supported by the active device.\n' - ){{endif}} - {{if 'CUDA_ERROR_CONTEXT_ALREADY_IN_USE' in found_values}} + ) + CUDA_ERROR_CONTEXT_ALREADY_IN_USE = ( cydriver.cudaError_enum.CUDA_ERROR_CONTEXT_ALREADY_IN_USE, 'This indicates that the :py:obj:`~.CUcontext` passed to the API call can\n' 'only be bound to a single CPU thread at a time but is already bound to a\n' 'CPU thread.\n' - ){{endif}} - {{if 'CUDA_ERROR_PEER_ACCESS_UNSUPPORTED' in found_values}} + ) + CUDA_ERROR_PEER_ACCESS_UNSUPPORTED = ( cydriver.cudaError_enum.CUDA_ERROR_PEER_ACCESS_UNSUPPORTED, 'This indicates that peer access is not supported across the given devices.\n' - ){{endif}} - {{if 'CUDA_ERROR_INVALID_PTX' in found_values}} + ) + CUDA_ERROR_INVALID_PTX = ( cydriver.cudaError_enum.CUDA_ERROR_INVALID_PTX, 'This indicates that a PTX JIT compilation failed.\n' - ){{endif}} - {{if 'CUDA_ERROR_INVALID_GRAPHICS_CONTEXT' in found_values}} + ) + CUDA_ERROR_INVALID_GRAPHICS_CONTEXT = ( cydriver.cudaError_enum.CUDA_ERROR_INVALID_GRAPHICS_CONTEXT, 'This indicates an error with OpenGL or DirectX context.\n' - ){{endif}} - {{if 'CUDA_ERROR_NVLINK_UNCORRECTABLE' in found_values}} + ) + CUDA_ERROR_NVLINK_UNCORRECTABLE = ( cydriver.cudaError_enum.CUDA_ERROR_NVLINK_UNCORRECTABLE, 'This indicates that an uncorrectable NVLink error was detected during the\n' 'execution.\n' - ){{endif}} - {{if 'CUDA_ERROR_JIT_COMPILER_NOT_FOUND' in found_values}} + ) + CUDA_ERROR_JIT_COMPILER_NOT_FOUND = ( cydriver.cudaError_enum.CUDA_ERROR_JIT_COMPILER_NOT_FOUND, 'This indicates that the PTX JIT compiler library was not found.\n' - ){{endif}} - {{if 'CUDA_ERROR_UNSUPPORTED_PTX_VERSION' in found_values}} + ) + CUDA_ERROR_UNSUPPORTED_PTX_VERSION = ( cydriver.cudaError_enum.CUDA_ERROR_UNSUPPORTED_PTX_VERSION, 'This indicates that the provided PTX was compiled with an unsupported\n' 'toolchain.\n' - ){{endif}} - {{if 'CUDA_ERROR_JIT_COMPILATION_DISABLED' in found_values}} + ) + CUDA_ERROR_JIT_COMPILATION_DISABLED = ( cydriver.cudaError_enum.CUDA_ERROR_JIT_COMPILATION_DISABLED, 'This indicates that the PTX JIT compilation was disabled.\n' - ){{endif}} - {{if 'CUDA_ERROR_UNSUPPORTED_EXEC_AFFINITY' in found_values}} + ) + CUDA_ERROR_UNSUPPORTED_EXEC_AFFINITY = ( cydriver.cudaError_enum.CUDA_ERROR_UNSUPPORTED_EXEC_AFFINITY, 'This indicates that the :py:obj:`~.CUexecAffinityType` passed to the API\n' 'call is not supported by the active device.\n' - ){{endif}} - {{if 'CUDA_ERROR_UNSUPPORTED_DEVSIDE_SYNC' in found_values}} + ) + CUDA_ERROR_UNSUPPORTED_DEVSIDE_SYNC = ( cydriver.cudaError_enum.CUDA_ERROR_UNSUPPORTED_DEVSIDE_SYNC, 'This indicates that the code to be compiled by the PTX JIT contains\n' 'unsupported call to cudaDeviceSynchronize.\n' - ){{endif}} - {{if 'CUDA_ERROR_CONTAINED' in found_values}} + ) + CUDA_ERROR_CONTAINED = ( cydriver.cudaError_enum.CUDA_ERROR_CONTAINED, @@ -4893,54 +4754,54 @@ class CUresult(_FastEnum): 'classes of hardware errors This leaves the process in an inconsistent state\n' 'and any further CUDA work will return the same error. To continue using\n' 'CUDA, the process must be terminated and relaunched.\n' - ){{endif}} - {{if 'CUDA_ERROR_INVALID_SOURCE' in found_values}} + ) + CUDA_ERROR_INVALID_SOURCE = ( cydriver.cudaError_enum.CUDA_ERROR_INVALID_SOURCE, 'This indicates that the device kernel source is invalid. This includes\n' 'compilation/linker errors encountered in device code or user error.\n' - ){{endif}} - {{if 'CUDA_ERROR_FILE_NOT_FOUND' in found_values}} + ) + CUDA_ERROR_FILE_NOT_FOUND = ( cydriver.cudaError_enum.CUDA_ERROR_FILE_NOT_FOUND, 'This indicates that the file specified was not found.\n' - ){{endif}} - {{if 'CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND' in found_values}} + ) + CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND = ( cydriver.cudaError_enum.CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND, 'This indicates that a link to a shared object failed to resolve.\n' - ){{endif}} - {{if 'CUDA_ERROR_SHARED_OBJECT_INIT_FAILED' in found_values}} + ) + CUDA_ERROR_SHARED_OBJECT_INIT_FAILED = ( cydriver.cudaError_enum.CUDA_ERROR_SHARED_OBJECT_INIT_FAILED, 'This indicates that initialization of a shared object failed.\n' - ){{endif}} - {{if 'CUDA_ERROR_OPERATING_SYSTEM' in found_values}} + ) + CUDA_ERROR_OPERATING_SYSTEM = ( cydriver.cudaError_enum.CUDA_ERROR_OPERATING_SYSTEM, 'This indicates that an OS call failed.\n' - ){{endif}} - {{if 'CUDA_ERROR_INVALID_HANDLE' in found_values}} + ) + CUDA_ERROR_INVALID_HANDLE = ( cydriver.cudaError_enum.CUDA_ERROR_INVALID_HANDLE, 'This indicates that a resource handle passed to the API call was not valid.\n' 'Resource handles are opaque types like :py:obj:`~.CUstream` and\n' ':py:obj:`~.CUevent`.\n' - ){{endif}} - {{if 'CUDA_ERROR_ILLEGAL_STATE' in found_values}} + ) + CUDA_ERROR_ILLEGAL_STATE = ( cydriver.cudaError_enum.CUDA_ERROR_ILLEGAL_STATE, 'This indicates that a resource required by the API call is not in a valid\n' 'state to perform the requested operation.\n' - ){{endif}} - {{if 'CUDA_ERROR_LOSSY_QUERY' in found_values}} + ) + CUDA_ERROR_LOSSY_QUERY = ( cydriver.cudaError_enum.CUDA_ERROR_LOSSY_QUERY, @@ -4948,16 +4809,16 @@ class CUresult(_FastEnum): 'would discard semantically important information. This is either due to the\n' 'object using funtionality newer than the API version used to introspect it\n' 'or omission of optional return arguments.\n' - ){{endif}} - {{if 'CUDA_ERROR_NOT_FOUND' in found_values}} + ) + CUDA_ERROR_NOT_FOUND = ( cydriver.cudaError_enum.CUDA_ERROR_NOT_FOUND, 'This indicates that a named symbol was not found. Examples of symbols are\n' 'global/constant variable names, driver function names, texture names, and\n' 'surface names.\n' - ){{endif}} - {{if 'CUDA_ERROR_NOT_READY' in found_values}} + ) + CUDA_ERROR_NOT_READY = ( cydriver.cudaError_enum.CUDA_ERROR_NOT_READY, @@ -4966,8 +4827,8 @@ class CUresult(_FastEnum): 'differently than :py:obj:`~.CUDA_SUCCESS` (which indicates completion).\n' 'Calls that may return this value include :py:obj:`~.cuEventQuery()` and\n' ':py:obj:`~.cuStreamQuery()`.\n' - ){{endif}} - {{if 'CUDA_ERROR_ILLEGAL_ADDRESS' in found_values}} + ) + CUDA_ERROR_ILLEGAL_ADDRESS = ( cydriver.cudaError_enum.CUDA_ERROR_ILLEGAL_ADDRESS, @@ -4975,8 +4836,8 @@ class CUresult(_FastEnum): 'instruction on an invalid memory address. This leaves the process in an\n' 'inconsistent state and any further CUDA work will return the same error. To\n' 'continue using CUDA, the process must be terminated and relaunched.\n' - ){{endif}} - {{if 'CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES' in found_values}} + ) + CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES = ( cydriver.cudaError_enum.CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES, @@ -4987,8 +4848,8 @@ class CUresult(_FastEnum): 'arguments of the wrong size (i.e. a 64-bit pointer when a 32-bit int is\n' 'expected) is equivalent to passing too many arguments and can also result\n' 'in this error.\n' - ){{endif}} - {{if 'CUDA_ERROR_LAUNCH_TIMEOUT' in found_values}} + ) + CUDA_ERROR_LAUNCH_TIMEOUT = ( cydriver.cudaError_enum.CUDA_ERROR_LAUNCH_TIMEOUT, @@ -4998,46 +4859,46 @@ class CUresult(_FastEnum): 'This leaves the process in an inconsistent state and any further CUDA work\n' 'will return the same error. To continue using CUDA, the process must be\n' 'terminated and relaunched.\n' - ){{endif}} - {{if 'CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING' in found_values}} + ) + CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING = ( cydriver.cudaError_enum.CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING, 'This error indicates a kernel launch that uses an incompatible texturing\n' 'mode.\n' - ){{endif}} - {{if 'CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED' in found_values}} + ) + CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED = ( cydriver.cudaError_enum.CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED, 'This error indicates that a call to :py:obj:`~.cuCtxEnablePeerAccess()` is\n' 'trying to re-enable peer access to a context which has already had peer\n' 'access to it enabled.\n' - ){{endif}} - {{if 'CUDA_ERROR_PEER_ACCESS_NOT_ENABLED' in found_values}} + ) + CUDA_ERROR_PEER_ACCESS_NOT_ENABLED = ( cydriver.cudaError_enum.CUDA_ERROR_PEER_ACCESS_NOT_ENABLED, 'This error indicates that :py:obj:`~.cuCtxDisablePeerAccess()` is trying to\n' 'disable peer access which has not been enabled yet via\n' ':py:obj:`~.cuCtxEnablePeerAccess()`.\n' - ){{endif}} - {{if 'CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE' in found_values}} + ) + CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE = ( cydriver.cudaError_enum.CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE, 'This error indicates that the primary context for the specified device has\n' 'already been initialized.\n' - ){{endif}} - {{if 'CUDA_ERROR_CONTEXT_IS_DESTROYED' in found_values}} + ) + CUDA_ERROR_CONTEXT_IS_DESTROYED = ( cydriver.cudaError_enum.CUDA_ERROR_CONTEXT_IS_DESTROYED, 'This error indicates that the context current to the calling thread has\n' 'been destroyed using :py:obj:`~.cuCtxDestroy`, or is a primary context\n' 'which has not yet been initialized.\n' - ){{endif}} - {{if 'CUDA_ERROR_ASSERT' in found_values}} + ) + CUDA_ERROR_ASSERT = ( cydriver.cudaError_enum.CUDA_ERROR_ASSERT, @@ -5045,31 +4906,31 @@ class CUresult(_FastEnum): 'be used anymore, and must be destroyed. All existing device memory\n' 'allocations from this context are invalid and must be reconstructed if the\n' 'program is to continue using CUDA.\n' - ){{endif}} - {{if 'CUDA_ERROR_TOO_MANY_PEERS' in found_values}} + ) + CUDA_ERROR_TOO_MANY_PEERS = ( cydriver.cudaError_enum.CUDA_ERROR_TOO_MANY_PEERS, 'This error indicates that the hardware resources required to enable peer\n' 'access have been exhausted for one or more of the devices passed to\n' ':py:obj:`~.cuCtxEnablePeerAccess()`.\n' - ){{endif}} - {{if 'CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED' in found_values}} + ) + CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED = ( cydriver.cudaError_enum.CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED, 'This error indicates that the memory range passed to\n' ':py:obj:`~.cuMemHostRegister()` has already been registered.\n' - ){{endif}} - {{if 'CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED' in found_values}} + ) + CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED = ( cydriver.cudaError_enum.CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED, 'This error indicates that the pointer passed to\n' ':py:obj:`~.cuMemHostUnregister()` does not correspond to any currently\n' 'registered memory region.\n' - ){{endif}} - {{if 'CUDA_ERROR_HARDWARE_STACK_ERROR' in found_values}} + ) + CUDA_ERROR_HARDWARE_STACK_ERROR = ( cydriver.cudaError_enum.CUDA_ERROR_HARDWARE_STACK_ERROR, @@ -5078,8 +4939,8 @@ class CUresult(_FastEnum): 'process in an inconsistent state and any further CUDA work will return the\n' 'same error. To continue using CUDA, the process must be terminated and\n' 'relaunched.\n' - ){{endif}} - {{if 'CUDA_ERROR_ILLEGAL_INSTRUCTION' in found_values}} + ) + CUDA_ERROR_ILLEGAL_INSTRUCTION = ( cydriver.cudaError_enum.CUDA_ERROR_ILLEGAL_INSTRUCTION, @@ -5087,8 +4948,8 @@ class CUresult(_FastEnum): 'This leaves the process in an inconsistent state and any further CUDA work\n' 'will return the same error. To continue using CUDA, the process must be\n' 'terminated and relaunched.\n' - ){{endif}} - {{if 'CUDA_ERROR_MISALIGNED_ADDRESS' in found_values}} + ) + CUDA_ERROR_MISALIGNED_ADDRESS = ( cydriver.cudaError_enum.CUDA_ERROR_MISALIGNED_ADDRESS, @@ -5097,8 +4958,8 @@ class CUresult(_FastEnum): 'process in an inconsistent state and any further CUDA work will return the\n' 'same error. To continue using CUDA, the process must be terminated and\n' 'relaunched.\n' - ){{endif}} - {{if 'CUDA_ERROR_INVALID_ADDRESS_SPACE' in found_values}} + ) + CUDA_ERROR_INVALID_ADDRESS_SPACE = ( cydriver.cudaError_enum.CUDA_ERROR_INVALID_ADDRESS_SPACE, @@ -5108,8 +4969,8 @@ class CUresult(_FastEnum): 'address space. This leaves the process in an inconsistent state and any\n' 'further CUDA work will return the same error. To continue using CUDA, the\n' 'process must be terminated and relaunched.\n' - ){{endif}} - {{if 'CUDA_ERROR_INVALID_PC' in found_values}} + ) + CUDA_ERROR_INVALID_PC = ( cydriver.cudaError_enum.CUDA_ERROR_INVALID_PC, @@ -5117,8 +4978,8 @@ class CUresult(_FastEnum): 'space. This leaves the process in an inconsistent state and any further\n' 'CUDA work will return the same error. To continue using CUDA, the process\n' 'must be terminated and relaunched.\n' - ){{endif}} - {{if 'CUDA_ERROR_LAUNCH_FAILED' in found_values}} + ) + CUDA_ERROR_LAUNCH_FAILED = ( cydriver.cudaError_enum.CUDA_ERROR_LAUNCH_FAILED, @@ -5129,8 +4990,8 @@ class CUresult(_FastEnum): 'leaves the process in an inconsistent state and any further CUDA work will\n' 'return the same error. To continue using CUDA, the process must be\n' 'terminated and relaunched.\n' - ){{endif}} - {{if 'CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE' in found_values}} + ) + CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE = ( cydriver.cudaError_enum.CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE, @@ -5142,8 +5003,8 @@ class CUresult(_FastEnum): ':py:obj:`~.cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags` times the\n' 'number of multiprocessors as specified by the device attribute\n' ':py:obj:`~.CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT`.\n' - ){{endif}} - {{if 'CUDA_ERROR_TENSOR_MEMORY_LEAK' in found_values}} + ) + CUDA_ERROR_TENSOR_MEMORY_LEAK = ( cydriver.cudaError_enum.CUDA_ERROR_TENSOR_MEMORY_LEAK, @@ -5152,21 +5013,21 @@ class CUresult(_FastEnum): 'process in an inconsistent state and any further CUDA work will return the\n' 'same error. To continue using CUDA, the process must be terminated and\n' 'relaunched.\n' - ){{endif}} - {{if 'CUDA_ERROR_NOT_PERMITTED' in found_values}} + ) + CUDA_ERROR_NOT_PERMITTED = ( cydriver.cudaError_enum.CUDA_ERROR_NOT_PERMITTED, 'This error indicates that the attempted operation is not permitted.\n' - ){{endif}} - {{if 'CUDA_ERROR_NOT_SUPPORTED' in found_values}} + ) + CUDA_ERROR_NOT_SUPPORTED = ( cydriver.cudaError_enum.CUDA_ERROR_NOT_SUPPORTED, 'This error indicates that the attempted operation is not supported on the\n' 'current system or device.\n' - ){{endif}} - {{if 'CUDA_ERROR_SYSTEM_NOT_READY' in found_values}} + ) + CUDA_ERROR_SYSTEM_NOT_READY = ( cydriver.cudaError_enum.CUDA_ERROR_SYSTEM_NOT_READY, @@ -5175,16 +5036,16 @@ class CUresult(_FastEnum): 'state and all required driver daemons are actively running. More\n' 'information about this error can be found in the system specific user\n' 'guide.\n' - ){{endif}} - {{if 'CUDA_ERROR_SYSTEM_DRIVER_MISMATCH' in found_values}} + ) + CUDA_ERROR_SYSTEM_DRIVER_MISMATCH = ( cydriver.cudaError_enum.CUDA_ERROR_SYSTEM_DRIVER_MISMATCH, 'This error indicates that there is a mismatch between the versions of the\n' 'display driver and the CUDA driver. Refer to the compatibility\n' 'documentation for supported versions.\n' - ){{endif}} - {{if 'CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE' in found_values}} + ) + CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE = ( cydriver.cudaError_enum.CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE, @@ -5193,121 +5054,121 @@ class CUresult(_FastEnum): 'this configuration. Refer to the compatibility documentation for the\n' 'supported hardware matrix or ensure that only supported hardware is visible\n' 'during initialization via the CUDA_VISIBLE_DEVICES environment variable.\n' - ){{endif}} - {{if 'CUDA_ERROR_MPS_CONNECTION_FAILED' in found_values}} + ) + CUDA_ERROR_MPS_CONNECTION_FAILED = ( cydriver.cudaError_enum.CUDA_ERROR_MPS_CONNECTION_FAILED, 'This error indicates that the MPS client failed to connect to the MPS\n' 'control daemon or the MPS server.\n' - ){{endif}} - {{if 'CUDA_ERROR_MPS_RPC_FAILURE' in found_values}} + ) + CUDA_ERROR_MPS_RPC_FAILURE = ( cydriver.cudaError_enum.CUDA_ERROR_MPS_RPC_FAILURE, 'This error indicates that the remote procedural call between the MPS server\n' 'and the MPS client failed.\n' - ){{endif}} - {{if 'CUDA_ERROR_MPS_SERVER_NOT_READY' in found_values}} + ) + CUDA_ERROR_MPS_SERVER_NOT_READY = ( cydriver.cudaError_enum.CUDA_ERROR_MPS_SERVER_NOT_READY, 'This error indicates that the MPS server is not ready to accept new MPS\n' 'client requests. This error can be returned when the MPS server is in the\n' 'process of recovering from a fatal failure.\n' - ){{endif}} - {{if 'CUDA_ERROR_MPS_MAX_CLIENTS_REACHED' in found_values}} + ) + CUDA_ERROR_MPS_MAX_CLIENTS_REACHED = ( cydriver.cudaError_enum.CUDA_ERROR_MPS_MAX_CLIENTS_REACHED, 'This error indicates that the hardware resources required to create MPS\n' 'client have been exhausted.\n' - ){{endif}} - {{if 'CUDA_ERROR_MPS_MAX_CONNECTIONS_REACHED' in found_values}} + ) + CUDA_ERROR_MPS_MAX_CONNECTIONS_REACHED = ( cydriver.cudaError_enum.CUDA_ERROR_MPS_MAX_CONNECTIONS_REACHED, 'This error indicates the the hardware resources required to support device\n' 'connections have been exhausted.\n' - ){{endif}} - {{if 'CUDA_ERROR_MPS_CLIENT_TERMINATED' in found_values}} + ) + CUDA_ERROR_MPS_CLIENT_TERMINATED = ( cydriver.cudaError_enum.CUDA_ERROR_MPS_CLIENT_TERMINATED, 'This error indicates that the MPS client has been terminated by the server.\n' 'To continue using CUDA, the process must be terminated and relaunched.\n' - ){{endif}} - {{if 'CUDA_ERROR_CDP_NOT_SUPPORTED' in found_values}} + ) + CUDA_ERROR_CDP_NOT_SUPPORTED = ( cydriver.cudaError_enum.CUDA_ERROR_CDP_NOT_SUPPORTED, 'This error indicates that the module is using CUDA Dynamic Parallelism, but\n' 'the current configuration, like MPS, does not support it.\n' - ){{endif}} - {{if 'CUDA_ERROR_CDP_VERSION_MISMATCH' in found_values}} + ) + CUDA_ERROR_CDP_VERSION_MISMATCH = ( cydriver.cudaError_enum.CUDA_ERROR_CDP_VERSION_MISMATCH, 'This error indicates that a module contains an unsupported interaction\n' 'between different versions of CUDA Dynamic Parallelism.\n' - ){{endif}} - {{if 'CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED' in found_values}} + ) + CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED = ( cydriver.cudaError_enum.CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED, 'This error indicates that the operation is not permitted when the stream is\n' 'capturing.\n' - ){{endif}} - {{if 'CUDA_ERROR_STREAM_CAPTURE_INVALIDATED' in found_values}} + ) + CUDA_ERROR_STREAM_CAPTURE_INVALIDATED = ( cydriver.cudaError_enum.CUDA_ERROR_STREAM_CAPTURE_INVALIDATED, 'This error indicates that the current capture sequence on the stream has\n' 'been invalidated due to a previous error.\n' - ){{endif}} - {{if 'CUDA_ERROR_STREAM_CAPTURE_MERGE' in found_values}} + ) + CUDA_ERROR_STREAM_CAPTURE_MERGE = ( cydriver.cudaError_enum.CUDA_ERROR_STREAM_CAPTURE_MERGE, 'This error indicates that the operation would have resulted in a merge of\n' 'two independent capture sequences.\n' - ){{endif}} - {{if 'CUDA_ERROR_STREAM_CAPTURE_UNMATCHED' in found_values}} + ) + CUDA_ERROR_STREAM_CAPTURE_UNMATCHED = ( cydriver.cudaError_enum.CUDA_ERROR_STREAM_CAPTURE_UNMATCHED, 'This error indicates that the capture was not initiated in this stream.\n' - ){{endif}} - {{if 'CUDA_ERROR_STREAM_CAPTURE_UNJOINED' in found_values}} + ) + CUDA_ERROR_STREAM_CAPTURE_UNJOINED = ( cydriver.cudaError_enum.CUDA_ERROR_STREAM_CAPTURE_UNJOINED, 'This error indicates that the capture sequence contains a fork that was not\n' 'joined to the primary stream.\n' - ){{endif}} - {{if 'CUDA_ERROR_STREAM_CAPTURE_ISOLATION' in found_values}} + ) + CUDA_ERROR_STREAM_CAPTURE_ISOLATION = ( cydriver.cudaError_enum.CUDA_ERROR_STREAM_CAPTURE_ISOLATION, 'This error indicates that a dependency would have been created which\n' 'crosses the capture sequence boundary. Only implicit in-stream ordering\n' 'dependencies are allowed to cross the boundary.\n' - ){{endif}} - {{if 'CUDA_ERROR_STREAM_CAPTURE_IMPLICIT' in found_values}} + ) + CUDA_ERROR_STREAM_CAPTURE_IMPLICIT = ( cydriver.cudaError_enum.CUDA_ERROR_STREAM_CAPTURE_IMPLICIT, 'This error indicates a disallowed implicit dependency on a current capture\n' 'sequence from cudaStreamLegacy.\n' - ){{endif}} - {{if 'CUDA_ERROR_CAPTURED_EVENT' in found_values}} + ) + CUDA_ERROR_CAPTURED_EVENT = ( cydriver.cudaError_enum.CUDA_ERROR_CAPTURED_EVENT, 'This error indicates that the operation is not permitted on an event which\n' 'was last recorded in a capturing stream.\n' - ){{endif}} - {{if 'CUDA_ERROR_STREAM_CAPTURE_WRONG_THREAD' in found_values}} + ) + CUDA_ERROR_STREAM_CAPTURE_WRONG_THREAD = ( cydriver.cudaError_enum.CUDA_ERROR_STREAM_CAPTURE_WRONG_THREAD, @@ -5315,23 +5176,23 @@ class CUresult(_FastEnum): ':py:obj:`~.CU_STREAM_CAPTURE_MODE_RELAXED` argument to\n' ':py:obj:`~.cuStreamBeginCapture` was passed to\n' ':py:obj:`~.cuStreamEndCapture` in a different thread.\n' - ){{endif}} - {{if 'CUDA_ERROR_TIMEOUT' in found_values}} + ) + CUDA_ERROR_TIMEOUT = ( cydriver.cudaError_enum.CUDA_ERROR_TIMEOUT, 'This error indicates that the timeout specified for the wait operation has\n' 'lapsed.\n' - ){{endif}} - {{if 'CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE' in found_values}} + ) + CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE = ( cydriver.cudaError_enum.CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE, 'This error indicates that the graph update was not performed because it\n' 'included changes which violated constraints specific to instantiated graph\n' 'update.\n' - ){{endif}} - {{if 'CUDA_ERROR_EXTERNAL_DEVICE' in found_values}} + ) + CUDA_ERROR_EXTERNAL_DEVICE = ( cydriver.cudaError_enum.CUDA_ERROR_EXTERNAL_DEVICE, @@ -5345,42 +5206,42 @@ class CUresult(_FastEnum): 'process must be terminated and relaunched. In case of synchronous error, it\n' 'means that one or more external devices have encountered an error and\n' 'cannot complete the operation.\n' - ){{endif}} - {{if 'CUDA_ERROR_INVALID_CLUSTER_SIZE' in found_values}} + ) + CUDA_ERROR_INVALID_CLUSTER_SIZE = ( cydriver.cudaError_enum.CUDA_ERROR_INVALID_CLUSTER_SIZE, 'Indicates a kernel launch error due to cluster misconfiguration.\n' - ){{endif}} - {{if 'CUDA_ERROR_FUNCTION_NOT_LOADED' in found_values}} + ) + CUDA_ERROR_FUNCTION_NOT_LOADED = ( cydriver.cudaError_enum.CUDA_ERROR_FUNCTION_NOT_LOADED, 'Indiciates a function handle is not loaded when calling an API that\n' 'requires a loaded function.\n' - ){{endif}} - {{if 'CUDA_ERROR_INVALID_RESOURCE_TYPE' in found_values}} + ) + CUDA_ERROR_INVALID_RESOURCE_TYPE = ( cydriver.cudaError_enum.CUDA_ERROR_INVALID_RESOURCE_TYPE, 'This error indicates one or more resources passed in are not valid resource\n' 'types for the operation.\n' - ){{endif}} - {{if 'CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION' in found_values}} + ) + CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION = ( cydriver.cudaError_enum.CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION, 'This error indicates one or more resources are insufficient or non-\n' 'applicable for the operation.\n' - ){{endif}} - {{if 'CUDA_ERROR_KEY_ROTATION' in found_values}} + ) + CUDA_ERROR_KEY_ROTATION = ( cydriver.cudaError_enum.CUDA_ERROR_KEY_ROTATION, 'This error indicates that an error happened during the key rotation\n' 'sequence.\n' - ){{endif}} - {{if 'CUDA_ERROR_STREAM_DETACHED' in found_values}} + ) + CUDA_ERROR_STREAM_DETACHED = ( cydriver.cudaError_enum.CUDA_ERROR_STREAM_DETACHED, @@ -5388,891 +5249,824 @@ class CUresult(_FastEnum): 'the stream is in a detached state. This can occur if the green context\n' "associated with the stream has been destroyed, limiting the stream's\n" 'operational capabilities.\n' - ){{endif}} - {{if 'CUDA_ERROR_UNKNOWN' in found_values}} + ) + + + CUDA_ERROR_GRAPH_RECAPTURE_FAILURE = ( + cydriver.cudaError_enum.CUDA_ERROR_GRAPH_RECAPTURE_FAILURE, + 'This error indicates that a graph recapture failed and had to be\n' + 'terminated.\n' + ) + CUDA_ERROR_UNKNOWN = ( cydriver.cudaError_enum.CUDA_ERROR_UNKNOWN, 'This indicates that an unknown internal error has occurred.\n' - ){{endif}} - -{{endif}} -{{if 'CUdevice_P2PAttribute_enum' in found_types}} + ) class CUdevice_P2PAttribute(_FastEnum): """ P2P Attributes """ - {{if 'CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK' in found_values}} + CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK = ( cydriver.CUdevice_P2PAttribute_enum.CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK, 'A relative value indicating the performance of the link between two devices\n' - ){{endif}} - {{if 'CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED' in found_values}} + ) + CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED = ( cydriver.CUdevice_P2PAttribute_enum.CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED, 'P2P Access is enable\n' - ){{endif}} - {{if 'CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED' in found_values}} + ) + CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED = ( cydriver.CUdevice_P2PAttribute_enum.CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED, 'All CUDA-valid atomic operation over the link are supported\n' - ){{endif}} - {{if 'CU_DEVICE_P2P_ATTRIBUTE_ACCESS_ACCESS_SUPPORTED' in found_values}} + ) + CU_DEVICE_P2P_ATTRIBUTE_ACCESS_ACCESS_SUPPORTED = ( cydriver.CUdevice_P2PAttribute_enum.CU_DEVICE_P2P_ATTRIBUTE_ACCESS_ACCESS_SUPPORTED, '[Deprecated]\n' - ){{endif}} - {{if 'CU_DEVICE_P2P_ATTRIBUTE_CUDA_ARRAY_ACCESS_SUPPORTED' in found_values}} + ) + CU_DEVICE_P2P_ATTRIBUTE_CUDA_ARRAY_ACCESS_SUPPORTED = ( cydriver.CUdevice_P2PAttribute_enum.CU_DEVICE_P2P_ATTRIBUTE_CUDA_ARRAY_ACCESS_SUPPORTED, 'Accessing CUDA arrays over the link supported\n' - ){{endif}} - {{if 'CU_DEVICE_P2P_ATTRIBUTE_ONLY_PARTIAL_NATIVE_ATOMIC_SUPPORTED' in found_values}} + ) + CU_DEVICE_P2P_ATTRIBUTE_ONLY_PARTIAL_NATIVE_ATOMIC_SUPPORTED = ( cydriver.CUdevice_P2PAttribute_enum.CU_DEVICE_P2P_ATTRIBUTE_ONLY_PARTIAL_NATIVE_ATOMIC_SUPPORTED, 'Only some CUDA-valid atomic operations over the link are supported.\n' - ){{endif}} - -{{endif}} -{{if 'CUresourceViewFormat_enum' in found_types}} + ) class CUresourceViewFormat(_FastEnum): """ Resource view format """ - {{if 'CU_RES_VIEW_FORMAT_NONE' in found_values}} + CU_RES_VIEW_FORMAT_NONE = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_NONE, 'No resource view format (use underlying resource format)\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_UINT_1X8' in found_values}} + ) + CU_RES_VIEW_FORMAT_UINT_1X8 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UINT_1X8, '1 channel unsigned 8-bit integers\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_UINT_2X8' in found_values}} + ) + CU_RES_VIEW_FORMAT_UINT_2X8 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UINT_2X8, '2 channel unsigned 8-bit integers\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_UINT_4X8' in found_values}} + ) + CU_RES_VIEW_FORMAT_UINT_4X8 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UINT_4X8, '4 channel unsigned 8-bit integers\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_SINT_1X8' in found_values}} + ) + CU_RES_VIEW_FORMAT_SINT_1X8 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_SINT_1X8, '1 channel signed 8-bit integers\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_SINT_2X8' in found_values}} + ) + CU_RES_VIEW_FORMAT_SINT_2X8 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_SINT_2X8, '2 channel signed 8-bit integers\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_SINT_4X8' in found_values}} + ) + CU_RES_VIEW_FORMAT_SINT_4X8 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_SINT_4X8, '4 channel signed 8-bit integers\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_UINT_1X16' in found_values}} + ) + CU_RES_VIEW_FORMAT_UINT_1X16 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UINT_1X16, '1 channel unsigned 16-bit integers\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_UINT_2X16' in found_values}} + ) + CU_RES_VIEW_FORMAT_UINT_2X16 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UINT_2X16, '2 channel unsigned 16-bit integers\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_UINT_4X16' in found_values}} + ) + CU_RES_VIEW_FORMAT_UINT_4X16 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UINT_4X16, '4 channel unsigned 16-bit integers\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_SINT_1X16' in found_values}} + ) + CU_RES_VIEW_FORMAT_SINT_1X16 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_SINT_1X16, '1 channel signed 16-bit integers\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_SINT_2X16' in found_values}} + ) + CU_RES_VIEW_FORMAT_SINT_2X16 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_SINT_2X16, '2 channel signed 16-bit integers\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_SINT_4X16' in found_values}} + ) + CU_RES_VIEW_FORMAT_SINT_4X16 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_SINT_4X16, '4 channel signed 16-bit integers\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_UINT_1X32' in found_values}} + ) + CU_RES_VIEW_FORMAT_UINT_1X32 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UINT_1X32, '1 channel unsigned 32-bit integers\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_UINT_2X32' in found_values}} + ) + CU_RES_VIEW_FORMAT_UINT_2X32 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UINT_2X32, '2 channel unsigned 32-bit integers\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_UINT_4X32' in found_values}} + ) + CU_RES_VIEW_FORMAT_UINT_4X32 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UINT_4X32, '4 channel unsigned 32-bit integers\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_SINT_1X32' in found_values}} + ) + CU_RES_VIEW_FORMAT_SINT_1X32 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_SINT_1X32, '1 channel signed 32-bit integers\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_SINT_2X32' in found_values}} + ) + CU_RES_VIEW_FORMAT_SINT_2X32 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_SINT_2X32, '2 channel signed 32-bit integers\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_SINT_4X32' in found_values}} + ) + CU_RES_VIEW_FORMAT_SINT_4X32 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_SINT_4X32, '4 channel signed 32-bit integers\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_FLOAT_1X16' in found_values}} + ) + CU_RES_VIEW_FORMAT_FLOAT_1X16 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_FLOAT_1X16, '1 channel 16-bit floating point\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_FLOAT_2X16' in found_values}} + ) + CU_RES_VIEW_FORMAT_FLOAT_2X16 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_FLOAT_2X16, '2 channel 16-bit floating point\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_FLOAT_4X16' in found_values}} + ) + CU_RES_VIEW_FORMAT_FLOAT_4X16 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_FLOAT_4X16, '4 channel 16-bit floating point\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_FLOAT_1X32' in found_values}} + ) + CU_RES_VIEW_FORMAT_FLOAT_1X32 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_FLOAT_1X32, '1 channel 32-bit floating point\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_FLOAT_2X32' in found_values}} + ) + CU_RES_VIEW_FORMAT_FLOAT_2X32 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_FLOAT_2X32, '2 channel 32-bit floating point\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_FLOAT_4X32' in found_values}} + ) + CU_RES_VIEW_FORMAT_FLOAT_4X32 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_FLOAT_4X32, '4 channel 32-bit floating point\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_UNSIGNED_BC1' in found_values}} + ) + CU_RES_VIEW_FORMAT_UNSIGNED_BC1 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UNSIGNED_BC1, 'Block compressed 1\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_UNSIGNED_BC2' in found_values}} + ) + CU_RES_VIEW_FORMAT_UNSIGNED_BC2 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UNSIGNED_BC2, 'Block compressed 2\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_UNSIGNED_BC3' in found_values}} + ) + CU_RES_VIEW_FORMAT_UNSIGNED_BC3 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UNSIGNED_BC3, 'Block compressed 3\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_UNSIGNED_BC4' in found_values}} + ) + CU_RES_VIEW_FORMAT_UNSIGNED_BC4 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UNSIGNED_BC4, 'Block compressed 4 unsigned\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_SIGNED_BC4' in found_values}} + ) + CU_RES_VIEW_FORMAT_SIGNED_BC4 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_SIGNED_BC4, 'Block compressed 4 signed\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_UNSIGNED_BC5' in found_values}} + ) + CU_RES_VIEW_FORMAT_UNSIGNED_BC5 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UNSIGNED_BC5, 'Block compressed 5 unsigned\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_SIGNED_BC5' in found_values}} + ) + CU_RES_VIEW_FORMAT_SIGNED_BC5 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_SIGNED_BC5, 'Block compressed 5 signed\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_UNSIGNED_BC6H' in found_values}} + ) + CU_RES_VIEW_FORMAT_UNSIGNED_BC6H = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UNSIGNED_BC6H, 'Block compressed 6 unsigned half-float\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_SIGNED_BC6H' in found_values}} + ) + CU_RES_VIEW_FORMAT_SIGNED_BC6H = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_SIGNED_BC6H, 'Block compressed 6 signed half-float\n' - ){{endif}} - {{if 'CU_RES_VIEW_FORMAT_UNSIGNED_BC7' in found_values}} + ) + CU_RES_VIEW_FORMAT_UNSIGNED_BC7 = ( cydriver.CUresourceViewFormat_enum.CU_RES_VIEW_FORMAT_UNSIGNED_BC7, 'Block compressed 7\n' - ){{endif}} - -{{endif}} -{{if 'CUtensorMapDataType_enum' in found_types}} + ) class CUtensorMapDataType(_FastEnum): """ Tensor map data type """ - {{if 'CU_TENSOR_MAP_DATA_TYPE_UINT8' in found_values}} - CU_TENSOR_MAP_DATA_TYPE_UINT8 = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_UINT8{{endif}} - {{if 'CU_TENSOR_MAP_DATA_TYPE_UINT16' in found_values}} - CU_TENSOR_MAP_DATA_TYPE_UINT16 = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_UINT16{{endif}} - {{if 'CU_TENSOR_MAP_DATA_TYPE_UINT32' in found_values}} - CU_TENSOR_MAP_DATA_TYPE_UINT32 = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_UINT32{{endif}} - {{if 'CU_TENSOR_MAP_DATA_TYPE_INT32' in found_values}} - CU_TENSOR_MAP_DATA_TYPE_INT32 = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_INT32{{endif}} - {{if 'CU_TENSOR_MAP_DATA_TYPE_UINT64' in found_values}} - CU_TENSOR_MAP_DATA_TYPE_UINT64 = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_UINT64{{endif}} - {{if 'CU_TENSOR_MAP_DATA_TYPE_INT64' in found_values}} - CU_TENSOR_MAP_DATA_TYPE_INT64 = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_INT64{{endif}} - {{if 'CU_TENSOR_MAP_DATA_TYPE_FLOAT16' in found_values}} - CU_TENSOR_MAP_DATA_TYPE_FLOAT16 = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_FLOAT16{{endif}} - {{if 'CU_TENSOR_MAP_DATA_TYPE_FLOAT32' in found_values}} - CU_TENSOR_MAP_DATA_TYPE_FLOAT32 = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_FLOAT32{{endif}} - {{if 'CU_TENSOR_MAP_DATA_TYPE_FLOAT64' in found_values}} - CU_TENSOR_MAP_DATA_TYPE_FLOAT64 = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_FLOAT64{{endif}} - {{if 'CU_TENSOR_MAP_DATA_TYPE_BFLOAT16' in found_values}} - CU_TENSOR_MAP_DATA_TYPE_BFLOAT16 = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_BFLOAT16{{endif}} - {{if 'CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ' in found_values}} - CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ{{endif}} - {{if 'CU_TENSOR_MAP_DATA_TYPE_TFLOAT32' in found_values}} - CU_TENSOR_MAP_DATA_TYPE_TFLOAT32 = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_TFLOAT32{{endif}} - {{if 'CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ' in found_values}} - CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ{{endif}} - {{if 'CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B' in found_values}} - CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B{{endif}} - {{if 'CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B' in found_values}} - CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B{{endif}} - {{if 'CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B' in found_values}} - CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B{{endif}} - -{{endif}} -{{if 'CUtensorMapInterleave_enum' in found_types}} + + CU_TENSOR_MAP_DATA_TYPE_UINT8 = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_UINT8 + + CU_TENSOR_MAP_DATA_TYPE_UINT16 = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_UINT16 + + CU_TENSOR_MAP_DATA_TYPE_UINT32 = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_UINT32 + + CU_TENSOR_MAP_DATA_TYPE_INT32 = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_INT32 + + CU_TENSOR_MAP_DATA_TYPE_UINT64 = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_UINT64 + + CU_TENSOR_MAP_DATA_TYPE_INT64 = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_INT64 + + CU_TENSOR_MAP_DATA_TYPE_FLOAT16 = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_FLOAT16 + + CU_TENSOR_MAP_DATA_TYPE_FLOAT32 = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_FLOAT32 + + CU_TENSOR_MAP_DATA_TYPE_FLOAT64 = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_FLOAT64 + + CU_TENSOR_MAP_DATA_TYPE_BFLOAT16 = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_BFLOAT16 + + CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ + + CU_TENSOR_MAP_DATA_TYPE_TFLOAT32 = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_TFLOAT32 + + CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ + + CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B + + CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B + + CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B = cydriver.CUtensorMapDataType_enum.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B class CUtensorMapInterleave(_FastEnum): """ Tensor map interleave layout type """ - {{if 'CU_TENSOR_MAP_INTERLEAVE_NONE' in found_values}} - CU_TENSOR_MAP_INTERLEAVE_NONE = cydriver.CUtensorMapInterleave_enum.CU_TENSOR_MAP_INTERLEAVE_NONE{{endif}} - {{if 'CU_TENSOR_MAP_INTERLEAVE_16B' in found_values}} - CU_TENSOR_MAP_INTERLEAVE_16B = cydriver.CUtensorMapInterleave_enum.CU_TENSOR_MAP_INTERLEAVE_16B{{endif}} - {{if 'CU_TENSOR_MAP_INTERLEAVE_32B' in found_values}} - CU_TENSOR_MAP_INTERLEAVE_32B = cydriver.CUtensorMapInterleave_enum.CU_TENSOR_MAP_INTERLEAVE_32B{{endif}} -{{endif}} -{{if 'CUtensorMapSwizzle_enum' in found_types}} + CU_TENSOR_MAP_INTERLEAVE_NONE = cydriver.CUtensorMapInterleave_enum.CU_TENSOR_MAP_INTERLEAVE_NONE + + CU_TENSOR_MAP_INTERLEAVE_16B = cydriver.CUtensorMapInterleave_enum.CU_TENSOR_MAP_INTERLEAVE_16B + + CU_TENSOR_MAP_INTERLEAVE_32B = cydriver.CUtensorMapInterleave_enum.CU_TENSOR_MAP_INTERLEAVE_32B class CUtensorMapSwizzle(_FastEnum): """ Tensor map swizzling mode of shared memory banks """ - {{if 'CU_TENSOR_MAP_SWIZZLE_NONE' in found_values}} - CU_TENSOR_MAP_SWIZZLE_NONE = cydriver.CUtensorMapSwizzle_enum.CU_TENSOR_MAP_SWIZZLE_NONE{{endif}} - {{if 'CU_TENSOR_MAP_SWIZZLE_32B' in found_values}} - CU_TENSOR_MAP_SWIZZLE_32B = cydriver.CUtensorMapSwizzle_enum.CU_TENSOR_MAP_SWIZZLE_32B{{endif}} - {{if 'CU_TENSOR_MAP_SWIZZLE_64B' in found_values}} - CU_TENSOR_MAP_SWIZZLE_64B = cydriver.CUtensorMapSwizzle_enum.CU_TENSOR_MAP_SWIZZLE_64B{{endif}} - {{if 'CU_TENSOR_MAP_SWIZZLE_128B' in found_values}} - CU_TENSOR_MAP_SWIZZLE_128B = cydriver.CUtensorMapSwizzle_enum.CU_TENSOR_MAP_SWIZZLE_128B{{endif}} - {{if 'CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B' in found_values}} - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B = cydriver.CUtensorMapSwizzle_enum.CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B{{endif}} - {{if 'CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B_FLIP_8B' in found_values}} - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B_FLIP_8B = cydriver.CUtensorMapSwizzle_enum.CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B_FLIP_8B{{endif}} - {{if 'CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B' in found_values}} - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B = cydriver.CUtensorMapSwizzle_enum.CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B{{endif}} - -{{endif}} -{{if 'CUtensorMapL2promotion_enum' in found_types}} + + CU_TENSOR_MAP_SWIZZLE_NONE = cydriver.CUtensorMapSwizzle_enum.CU_TENSOR_MAP_SWIZZLE_NONE + + CU_TENSOR_MAP_SWIZZLE_32B = cydriver.CUtensorMapSwizzle_enum.CU_TENSOR_MAP_SWIZZLE_32B + + CU_TENSOR_MAP_SWIZZLE_64B = cydriver.CUtensorMapSwizzle_enum.CU_TENSOR_MAP_SWIZZLE_64B + + CU_TENSOR_MAP_SWIZZLE_128B = cydriver.CUtensorMapSwizzle_enum.CU_TENSOR_MAP_SWIZZLE_128B + + CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B = cydriver.CUtensorMapSwizzle_enum.CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B + + CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B_FLIP_8B = cydriver.CUtensorMapSwizzle_enum.CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B_FLIP_8B + + CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B = cydriver.CUtensorMapSwizzle_enum.CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B class CUtensorMapL2promotion(_FastEnum): """ Tensor map L2 promotion type """ - {{if 'CU_TENSOR_MAP_L2_PROMOTION_NONE' in found_values}} - CU_TENSOR_MAP_L2_PROMOTION_NONE = cydriver.CUtensorMapL2promotion_enum.CU_TENSOR_MAP_L2_PROMOTION_NONE{{endif}} - {{if 'CU_TENSOR_MAP_L2_PROMOTION_L2_64B' in found_values}} - CU_TENSOR_MAP_L2_PROMOTION_L2_64B = cydriver.CUtensorMapL2promotion_enum.CU_TENSOR_MAP_L2_PROMOTION_L2_64B{{endif}} - {{if 'CU_TENSOR_MAP_L2_PROMOTION_L2_128B' in found_values}} - CU_TENSOR_MAP_L2_PROMOTION_L2_128B = cydriver.CUtensorMapL2promotion_enum.CU_TENSOR_MAP_L2_PROMOTION_L2_128B{{endif}} - {{if 'CU_TENSOR_MAP_L2_PROMOTION_L2_256B' in found_values}} - CU_TENSOR_MAP_L2_PROMOTION_L2_256B = cydriver.CUtensorMapL2promotion_enum.CU_TENSOR_MAP_L2_PROMOTION_L2_256B{{endif}} -{{endif}} -{{if 'CUtensorMapFloatOOBfill_enum' in found_types}} + CU_TENSOR_MAP_L2_PROMOTION_NONE = cydriver.CUtensorMapL2promotion_enum.CU_TENSOR_MAP_L2_PROMOTION_NONE + + CU_TENSOR_MAP_L2_PROMOTION_L2_64B = cydriver.CUtensorMapL2promotion_enum.CU_TENSOR_MAP_L2_PROMOTION_L2_64B + + CU_TENSOR_MAP_L2_PROMOTION_L2_128B = cydriver.CUtensorMapL2promotion_enum.CU_TENSOR_MAP_L2_PROMOTION_L2_128B + + CU_TENSOR_MAP_L2_PROMOTION_L2_256B = cydriver.CUtensorMapL2promotion_enum.CU_TENSOR_MAP_L2_PROMOTION_L2_256B class CUtensorMapFloatOOBfill(_FastEnum): """ Tensor map out-of-bounds fill type """ - {{if 'CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE' in found_values}} - CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE = cydriver.CUtensorMapFloatOOBfill_enum.CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE{{endif}} - {{if 'CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA' in found_values}} - CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA = cydriver.CUtensorMapFloatOOBfill_enum.CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA{{endif}} -{{endif}} -{{if 'CUtensorMapIm2ColWideMode_enum' in found_types}} + CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE = cydriver.CUtensorMapFloatOOBfill_enum.CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE + + CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA = cydriver.CUtensorMapFloatOOBfill_enum.CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA class CUtensorMapIm2ColWideMode(_FastEnum): """ Tensor map Im2Col wide mode """ - {{if 'CU_TENSOR_MAP_IM2COL_WIDE_MODE_W' in found_values}} - CU_TENSOR_MAP_IM2COL_WIDE_MODE_W = cydriver.CUtensorMapIm2ColWideMode_enum.CU_TENSOR_MAP_IM2COL_WIDE_MODE_W{{endif}} - {{if 'CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128' in found_values}} - CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128 = cydriver.CUtensorMapIm2ColWideMode_enum.CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128{{endif}} -{{endif}} -{{if 'CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum' in found_types}} + CU_TENSOR_MAP_IM2COL_WIDE_MODE_W = cydriver.CUtensorMapIm2ColWideMode_enum.CU_TENSOR_MAP_IM2COL_WIDE_MODE_W + + CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128 = cydriver.CUtensorMapIm2ColWideMode_enum.CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128 class CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS(_FastEnum): """ Access flags that specify the level of access the current context's device has on the memory referenced. """ - {{if 'CU_POINTER_ATTRIBUTE_ACCESS_FLAG_NONE' in found_values}} + CU_POINTER_ATTRIBUTE_ACCESS_FLAG_NONE = ( cydriver.CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum.CU_POINTER_ATTRIBUTE_ACCESS_FLAG_NONE, 'No access, meaning the device cannot access this memory at all, thus must\n' 'be staged through accessible memory in order to complete certain operations\n' - ){{endif}} - {{if 'CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READ' in found_values}} + ) + CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READ = ( cydriver.CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum.CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READ, 'Read-only access, meaning writes to this memory are considered invalid\n' 'accesses and thus return error in that case.\n' - ){{endif}} - {{if 'CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READWRITE' in found_values}} + ) + CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READWRITE = ( cydriver.CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum.CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READWRITE, 'Read-write access, the device has full read-write access to the memory\n' - ){{endif}} - -{{endif}} -{{if 'CUexternalMemoryHandleType_enum' in found_types}} + ) class CUexternalMemoryHandleType(_FastEnum): """ External memory handle types """ - {{if 'CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD' in found_values}} + CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD = ( cydriver.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD, 'Handle is an opaque file descriptor\n' - ){{endif}} - {{if 'CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32' in found_values}} + ) + CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32 = ( cydriver.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32, 'Handle is an opaque shared NT handle\n' - ){{endif}} - {{if 'CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT' in found_values}} + ) + CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT = ( cydriver.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT, 'Handle is an opaque, globally shared handle\n' - ){{endif}} - {{if 'CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP' in found_values}} + ) + CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP = ( cydriver.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP, 'Handle is a D3D12 heap object\n' - ){{endif}} - {{if 'CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE' in found_values}} + ) + CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE = ( cydriver.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE, 'Handle is a D3D12 committed resource\n' - ){{endif}} - {{if 'CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE' in found_values}} + ) + CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE = ( cydriver.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE, 'Handle is a shared NT handle to a D3D11 resource\n' - ){{endif}} - {{if 'CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT' in found_values}} + ) + CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT = ( cydriver.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT, 'Handle is a globally shared handle to a D3D11 resource\n' - ){{endif}} - {{if 'CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF' in found_values}} + ) + CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF = ( cydriver.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF, 'Handle is an NvSciBuf object\n' - ){{endif}} - {{if 'CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD' in found_values}} + ) + CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD = ( cydriver.CUexternalMemoryHandleType_enum.CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD, 'Handle is a dma_buf file descriptor\n' - ){{endif}} - -{{endif}} -{{if 'CUexternalSemaphoreHandleType_enum' in found_types}} + ) class CUexternalSemaphoreHandleType(_FastEnum): """ External semaphore handle types """ - {{if 'CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD' in found_values}} + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD = ( cydriver.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD, 'Handle is an opaque file descriptor\n' - ){{endif}} - {{if 'CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32' in found_values}} + ) + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32 = ( cydriver.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32, 'Handle is an opaque shared NT handle\n' - ){{endif}} - {{if 'CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT' in found_values}} + ) + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT = ( cydriver.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT, 'Handle is an opaque, globally shared handle\n' - ){{endif}} - {{if 'CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE' in found_values}} + ) + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE = ( cydriver.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE, 'Handle is a shared NT handle referencing a D3D12 fence object\n' - ){{endif}} - {{if 'CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE' in found_values}} + ) + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE = ( cydriver.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE, 'Handle is a shared NT handle referencing a D3D11 fence object\n' - ){{endif}} - {{if 'CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC' in found_values}} + ) + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC = ( cydriver.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC, 'Opaque handle to NvSciSync Object\n' - ){{endif}} - {{if 'CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX' in found_values}} + ) + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX = ( cydriver.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX, 'Handle is a shared NT handle referencing a D3D11 keyed mutex object\n' - ){{endif}} - {{if 'CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT' in found_values}} + ) + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT = ( cydriver.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT, 'Handle is a globally shared handle referencing a D3D11 keyed mutex object\n' - ){{endif}} - {{if 'CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD' in found_values}} + ) + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD = ( cydriver.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD, 'Handle is an opaque file descriptor referencing a timeline semaphore\n' - ){{endif}} - {{if 'CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32' in found_values}} + ) + CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32 = ( cydriver.CUexternalSemaphoreHandleType_enum.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32, 'Handle is an opaque shared NT handle referencing a timeline semaphore\n' - ){{endif}} - -{{endif}} -{{if 'CUmemAllocationHandleType_enum' in found_types}} + ) class CUmemAllocationHandleType(_FastEnum): """ Flags for specifying particular handle types """ - {{if 'CU_MEM_HANDLE_TYPE_NONE' in found_values}} + CU_MEM_HANDLE_TYPE_NONE = ( cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_NONE, 'Does not allow any export mechanism. >\n' - ){{endif}} - {{if 'CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR' in found_values}} + ) + CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR = ( cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR, 'Allows a file descriptor to be used for exporting. Permitted only on POSIX\n' 'systems. (int)\n' - ){{endif}} - {{if 'CU_MEM_HANDLE_TYPE_WIN32' in found_values}} + ) + CU_MEM_HANDLE_TYPE_WIN32 = ( cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_WIN32, 'Allows a Win32 NT handle to be used for exporting. (HANDLE)\n' - ){{endif}} - {{if 'CU_MEM_HANDLE_TYPE_WIN32_KMT' in found_values}} + ) + CU_MEM_HANDLE_TYPE_WIN32_KMT = ( cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_WIN32_KMT, 'Allows a Win32 KMT handle to be used for exporting. (D3DKMT_HANDLE)\n' - ){{endif}} - {{if 'CU_MEM_HANDLE_TYPE_FABRIC' in found_values}} + ) + CU_MEM_HANDLE_TYPE_FABRIC = ( cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_FABRIC, - 'Allows a fabric handle to be used for exporting. (CUmemFabricHandle)\n' - ){{endif}} - {{if 'CU_MEM_HANDLE_TYPE_MAX' in found_values}} - CU_MEM_HANDLE_TYPE_MAX = cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_MAX{{endif}} + 'Allows a fabric handle to be used for exporting.\n' + '(:py:obj:`~.CUmemFabricHandle`)\n' + ) -{{endif}} -{{if 'CUmemAccess_flags_enum' in found_types}} + CU_MEM_HANDLE_TYPE_MAX = cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_MAX class CUmemAccess_flags(_FastEnum): """ Specifies the memory protection flags for mapping. """ - {{if 'CU_MEM_ACCESS_FLAGS_PROT_NONE' in found_values}} + CU_MEM_ACCESS_FLAGS_PROT_NONE = ( cydriver.CUmemAccess_flags_enum.CU_MEM_ACCESS_FLAGS_PROT_NONE, 'Default, make the address range not accessible\n' - ){{endif}} - {{if 'CU_MEM_ACCESS_FLAGS_PROT_READ' in found_values}} + ) + CU_MEM_ACCESS_FLAGS_PROT_READ = ( cydriver.CUmemAccess_flags_enum.CU_MEM_ACCESS_FLAGS_PROT_READ, 'Make the address range read accessible\n' - ){{endif}} - {{if 'CU_MEM_ACCESS_FLAGS_PROT_READWRITE' in found_values}} + ) + CU_MEM_ACCESS_FLAGS_PROT_READWRITE = ( cydriver.CUmemAccess_flags_enum.CU_MEM_ACCESS_FLAGS_PROT_READWRITE, 'Make the address range read-write accessible\n' - ){{endif}} - {{if 'CU_MEM_ACCESS_FLAGS_PROT_MAX' in found_values}} - CU_MEM_ACCESS_FLAGS_PROT_MAX = cydriver.CUmemAccess_flags_enum.CU_MEM_ACCESS_FLAGS_PROT_MAX{{endif}} + ) -{{endif}} -{{if 'CUmemLocationType_enum' in found_types}} + CU_MEM_ACCESS_FLAGS_PROT_MAX = cydriver.CUmemAccess_flags_enum.CU_MEM_ACCESS_FLAGS_PROT_MAX class CUmemLocationType(_FastEnum): """ Specifies the type of location """ - {{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}} + + CU_MEM_LOCATION_TYPE_INVALID = cydriver.CUmemLocationType_enum.CU_MEM_LOCATION_TYPE_INVALID + CU_MEM_LOCATION_TYPE_NONE = ( cydriver.CUmemLocationType_enum.CU_MEM_LOCATION_TYPE_NONE, 'Location is unspecified. This is used when creating a managed memory pool\n' 'to indicate no preferred location for the pool\n' - ){{endif}} - {{if 'CU_MEM_LOCATION_TYPE_DEVICE' in found_values}} + ) + CU_MEM_LOCATION_TYPE_DEVICE = ( cydriver.CUmemLocationType_enum.CU_MEM_LOCATION_TYPE_DEVICE, 'Location is a device location, thus id is a device ordinal\n' - ){{endif}} - {{if 'CU_MEM_LOCATION_TYPE_HOST' in found_values}} + ) + CU_MEM_LOCATION_TYPE_HOST = ( cydriver.CUmemLocationType_enum.CU_MEM_LOCATION_TYPE_HOST, 'Location is host, id is ignored\n' - ){{endif}} - {{if 'CU_MEM_LOCATION_TYPE_HOST_NUMA' in found_values}} + ) + CU_MEM_LOCATION_TYPE_HOST_NUMA = ( cydriver.CUmemLocationType_enum.CU_MEM_LOCATION_TYPE_HOST_NUMA, 'Location is a host NUMA node, thus id is a host NUMA node id\n' - ){{endif}} - {{if 'CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT' in found_values}} + ) + CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT = ( cydriver.CUmemLocationType_enum.CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT, 'Location is a host NUMA node of the current thread, id is ignored\n' - ){{endif}} - {{if 'CU_MEM_LOCATION_TYPE_INVISIBLE' in found_values}} + ) + CU_MEM_LOCATION_TYPE_INVISIBLE = ( cydriver.CUmemLocationType_enum.CU_MEM_LOCATION_TYPE_INVISIBLE, 'Location is not visible but device is accessible, id is always\n' 'CU_DEVICE_INVALID\n' - ){{endif}} - {{if 'CU_MEM_LOCATION_TYPE_MAX' in found_values}} - CU_MEM_LOCATION_TYPE_MAX = cydriver.CUmemLocationType_enum.CU_MEM_LOCATION_TYPE_MAX{{endif}} + ) -{{endif}} -{{if 'CUmemAllocationType_enum' in found_types}} + CU_MEM_LOCATION_TYPE_MAX = cydriver.CUmemLocationType_enum.CU_MEM_LOCATION_TYPE_MAX class CUmemAllocationType(_FastEnum): """ Defines the allocation types available """ - {{if 'CU_MEM_ALLOCATION_TYPE_INVALID' in found_values}} - CU_MEM_ALLOCATION_TYPE_INVALID = cydriver.CUmemAllocationType_enum.CU_MEM_ALLOCATION_TYPE_INVALID{{endif}} - {{if 'CU_MEM_ALLOCATION_TYPE_PINNED' in found_values}} + + CU_MEM_ALLOCATION_TYPE_INVALID = cydriver.CUmemAllocationType_enum.CU_MEM_ALLOCATION_TYPE_INVALID + CU_MEM_ALLOCATION_TYPE_PINNED = ( cydriver.CUmemAllocationType_enum.CU_MEM_ALLOCATION_TYPE_PINNED, "This allocation type is 'pinned', i.e. cannot migrate from its current\n" 'location while the application is actively using it\n' - ){{endif}} - {{if 'CU_MEM_ALLOCATION_TYPE_MANAGED' in found_values}} + ) + CU_MEM_ALLOCATION_TYPE_MANAGED = ( cydriver.CUmemAllocationType_enum.CU_MEM_ALLOCATION_TYPE_MANAGED, 'This allocation type is managed memory\n' - ){{endif}} - {{if 'CU_MEM_ALLOCATION_TYPE_MAX' in found_values}} - CU_MEM_ALLOCATION_TYPE_MAX = cydriver.CUmemAllocationType_enum.CU_MEM_ALLOCATION_TYPE_MAX{{endif}} + ) -{{endif}} -{{if 'CUmemAllocationGranularity_flags_enum' in found_types}} + CU_MEM_ALLOCATION_TYPE_MAX = cydriver.CUmemAllocationType_enum.CU_MEM_ALLOCATION_TYPE_MAX class CUmemAllocationGranularity_flags(_FastEnum): """ Flag for requesting different optimal and required granularities for an allocation. """ - {{if 'CU_MEM_ALLOC_GRANULARITY_MINIMUM' in found_values}} + CU_MEM_ALLOC_GRANULARITY_MINIMUM = ( cydriver.CUmemAllocationGranularity_flags_enum.CU_MEM_ALLOC_GRANULARITY_MINIMUM, 'Minimum required granularity for allocation\n' - ){{endif}} - {{if 'CU_MEM_ALLOC_GRANULARITY_RECOMMENDED' in found_values}} + ) + CU_MEM_ALLOC_GRANULARITY_RECOMMENDED = ( cydriver.CUmemAllocationGranularity_flags_enum.CU_MEM_ALLOC_GRANULARITY_RECOMMENDED, 'Recommended granularity for allocation for best performance\n' - ){{endif}} - -{{endif}} -{{if 'CUmemRangeHandleType_enum' in found_types}} + ) class CUmemRangeHandleType(_FastEnum): """ Specifies the handle type for address range """ - {{if 'CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD' in found_values}} - CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD = cydriver.CUmemRangeHandleType_enum.CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD{{endif}} - {{if 'CU_MEM_RANGE_HANDLE_TYPE_MAX' in found_values}} - CU_MEM_RANGE_HANDLE_TYPE_MAX = cydriver.CUmemRangeHandleType_enum.CU_MEM_RANGE_HANDLE_TYPE_MAX{{endif}} -{{endif}} -{{if 'CUmemRangeFlags_enum' in found_types}} + CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD = cydriver.CUmemRangeHandleType_enum.CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD + + CU_MEM_RANGE_HANDLE_TYPE_MAX = cydriver.CUmemRangeHandleType_enum.CU_MEM_RANGE_HANDLE_TYPE_MAX class CUmemRangeFlags(_FastEnum): """ Flag for requesting handle type for address range. """ - {{if 'CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE' in found_values}} + CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE = ( cydriver.CUmemRangeFlags_enum.CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE, 'Indicates that DMA_BUF handle should be mapped via PCIe BAR1\n' - ){{endif}} - -{{endif}} -{{if 'CUarraySparseSubresourceType_enum' in found_types}} + ) class CUarraySparseSubresourceType(_FastEnum): """ Sparse subresource types """ - {{if 'CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL' in found_values}} - CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL = cydriver.CUarraySparseSubresourceType_enum.CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL{{endif}} - {{if 'CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL' in found_values}} - CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL = cydriver.CUarraySparseSubresourceType_enum.CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL{{endif}} -{{endif}} -{{if 'CUmemOperationType_enum' in found_types}} + CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL = cydriver.CUarraySparseSubresourceType_enum.CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL + + CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL = cydriver.CUarraySparseSubresourceType_enum.CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL class CUmemOperationType(_FastEnum): """ Memory operation types """ - {{if 'CU_MEM_OPERATION_TYPE_MAP' in found_values}} - CU_MEM_OPERATION_TYPE_MAP = cydriver.CUmemOperationType_enum.CU_MEM_OPERATION_TYPE_MAP{{endif}} - {{if 'CU_MEM_OPERATION_TYPE_UNMAP' in found_values}} - CU_MEM_OPERATION_TYPE_UNMAP = cydriver.CUmemOperationType_enum.CU_MEM_OPERATION_TYPE_UNMAP{{endif}} -{{endif}} -{{if 'CUmemHandleType_enum' in found_types}} + CU_MEM_OPERATION_TYPE_MAP = cydriver.CUmemOperationType_enum.CU_MEM_OPERATION_TYPE_MAP + + CU_MEM_OPERATION_TYPE_UNMAP = cydriver.CUmemOperationType_enum.CU_MEM_OPERATION_TYPE_UNMAP class CUmemHandleType(_FastEnum): """ Memory handle types """ - {{if 'CU_MEM_HANDLE_TYPE_GENERIC' in found_values}} - CU_MEM_HANDLE_TYPE_GENERIC = cydriver.CUmemHandleType_enum.CU_MEM_HANDLE_TYPE_GENERIC{{endif}} -{{endif}} -{{if 'CUmemAllocationCompType_enum' in found_types}} + CU_MEM_HANDLE_TYPE_GENERIC = cydriver.CUmemHandleType_enum.CU_MEM_HANDLE_TYPE_GENERIC class CUmemAllocationCompType(_FastEnum): """ Specifies compression attribute for an allocation. """ - {{if 'CU_MEM_ALLOCATION_COMP_NONE' in found_values}} + CU_MEM_ALLOCATION_COMP_NONE = ( cydriver.CUmemAllocationCompType_enum.CU_MEM_ALLOCATION_COMP_NONE, 'Allocating non-compressible memory\n' - ){{endif}} - {{if 'CU_MEM_ALLOCATION_COMP_GENERIC' in found_values}} + ) + CU_MEM_ALLOCATION_COMP_GENERIC = ( cydriver.CUmemAllocationCompType_enum.CU_MEM_ALLOCATION_COMP_GENERIC, 'Allocating compressible memory\n' - ){{endif}} - -{{endif}} -{{if 'CUmulticastGranularity_flags_enum' in found_types}} + ) class CUmulticastGranularity_flags(_FastEnum): """ Flags for querying different granularities for a multicast object """ - {{if 'CU_MULTICAST_GRANULARITY_MINIMUM' in found_values}} + CU_MULTICAST_GRANULARITY_MINIMUM = ( cydriver.CUmulticastGranularity_flags_enum.CU_MULTICAST_GRANULARITY_MINIMUM, 'Minimum required granularity\n' - ){{endif}} - {{if 'CU_MULTICAST_GRANULARITY_RECOMMENDED' in found_values}} + ) + CU_MULTICAST_GRANULARITY_RECOMMENDED = ( cydriver.CUmulticastGranularity_flags_enum.CU_MULTICAST_GRANULARITY_RECOMMENDED, 'Recommended granularity for best performance\n' - ){{endif}} - -{{endif}} -{{if 'CUgraphExecUpdateResult_enum' in found_types}} + ) class CUgraphExecUpdateResult(_FastEnum): """ CUDA Graph Update error types """ - {{if 'CU_GRAPH_EXEC_UPDATE_SUCCESS' in found_values}} + CU_GRAPH_EXEC_UPDATE_SUCCESS = ( cydriver.CUgraphExecUpdateResult_enum.CU_GRAPH_EXEC_UPDATE_SUCCESS, 'The update succeeded\n' - ){{endif}} - {{if 'CU_GRAPH_EXEC_UPDATE_ERROR' in found_values}} + ) + CU_GRAPH_EXEC_UPDATE_ERROR = ( cydriver.CUgraphExecUpdateResult_enum.CU_GRAPH_EXEC_UPDATE_ERROR, 'The update failed for an unexpected reason which is described in the return\n' 'value of the function\n' - ){{endif}} - {{if 'CU_GRAPH_EXEC_UPDATE_ERROR_TOPOLOGY_CHANGED' in found_values}} + ) + CU_GRAPH_EXEC_UPDATE_ERROR_TOPOLOGY_CHANGED = ( cydriver.CUgraphExecUpdateResult_enum.CU_GRAPH_EXEC_UPDATE_ERROR_TOPOLOGY_CHANGED, 'The update failed because the topology changed\n' - ){{endif}} - {{if 'CU_GRAPH_EXEC_UPDATE_ERROR_NODE_TYPE_CHANGED' in found_values}} + ) + CU_GRAPH_EXEC_UPDATE_ERROR_NODE_TYPE_CHANGED = ( cydriver.CUgraphExecUpdateResult_enum.CU_GRAPH_EXEC_UPDATE_ERROR_NODE_TYPE_CHANGED, 'The update failed because a node type changed\n' - ){{endif}} - {{if 'CU_GRAPH_EXEC_UPDATE_ERROR_FUNCTION_CHANGED' in found_values}} + ) + CU_GRAPH_EXEC_UPDATE_ERROR_FUNCTION_CHANGED = ( cydriver.CUgraphExecUpdateResult_enum.CU_GRAPH_EXEC_UPDATE_ERROR_FUNCTION_CHANGED, 'The update failed because the function of a kernel node changed (CUDA\n' 'driver < 11.2)\n' - ){{endif}} - {{if 'CU_GRAPH_EXEC_UPDATE_ERROR_PARAMETERS_CHANGED' in found_values}} + ) + CU_GRAPH_EXEC_UPDATE_ERROR_PARAMETERS_CHANGED = ( cydriver.CUgraphExecUpdateResult_enum.CU_GRAPH_EXEC_UPDATE_ERROR_PARAMETERS_CHANGED, 'The update failed because the parameters changed in a way that is not\n' 'supported\n' - ){{endif}} - {{if 'CU_GRAPH_EXEC_UPDATE_ERROR_NOT_SUPPORTED' in found_values}} + ) + CU_GRAPH_EXEC_UPDATE_ERROR_NOT_SUPPORTED = ( cydriver.CUgraphExecUpdateResult_enum.CU_GRAPH_EXEC_UPDATE_ERROR_NOT_SUPPORTED, 'The update failed because something about the node is not supported\n' - ){{endif}} - {{if 'CU_GRAPH_EXEC_UPDATE_ERROR_UNSUPPORTED_FUNCTION_CHANGE' in found_values}} + ) + CU_GRAPH_EXEC_UPDATE_ERROR_UNSUPPORTED_FUNCTION_CHANGE = ( cydriver.CUgraphExecUpdateResult_enum.CU_GRAPH_EXEC_UPDATE_ERROR_UNSUPPORTED_FUNCTION_CHANGE, 'The update failed because the function of a kernel node changed in an\n' 'unsupported way\n' - ){{endif}} - {{if 'CU_GRAPH_EXEC_UPDATE_ERROR_ATTRIBUTES_CHANGED' in found_values}} + ) + CU_GRAPH_EXEC_UPDATE_ERROR_ATTRIBUTES_CHANGED = ( cydriver.CUgraphExecUpdateResult_enum.CU_GRAPH_EXEC_UPDATE_ERROR_ATTRIBUTES_CHANGED, 'The update failed because the node attributes changed in a way that is not\n' 'supported\n' - ){{endif}} - -{{endif}} -{{if 'CUmemPool_attribute_enum' in found_types}} + ) class CUmemPool_attribute(_FastEnum): """ CUDA memory pool attributes """ - {{if 'CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES' in found_values}} + CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES = ( cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES, @@ -6281,131 +6075,126 @@ class CUmemPool_attribute(_FastEnum): 'allocating stream on the free action exists. Cuda events and null stream\n' 'interactions can create the required stream ordered dependencies. (default\n' 'enabled)\n' - ){{endif}} - {{if 'CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC' in found_values}} + ) + CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC = ( cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC, '(value type = int) Allow reuse of already completed frees when there is no\n' 'dependency between the free and allocation. (default enabled)\n' - ){{endif}} - {{if 'CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES' in found_values}} + ) + CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES = ( cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES, '(value type = int) Allow cuMemAllocAsync to insert new stream dependencies\n' 'in order to establish the stream ordering required to reuse a piece of\n' 'memory released by cuMemFreeAsync (default enabled).\n' - ){{endif}} - {{if 'CU_MEMPOOL_ATTR_RELEASE_THRESHOLD' in found_values}} + ) + CU_MEMPOOL_ATTR_RELEASE_THRESHOLD = ( cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD, - '(value type = cuuint64_t) Amount of reserved memory in bytes to hold onto\n' - 'before trying to release memory back to the OS. When more than the release\n' - 'threshold bytes of memory are held by the memory pool, the allocator will\n' - 'try to release memory back to the OS on the next call to stream, event or\n' - 'context synchronize. (default 0)\n' - ){{endif}} - {{if 'CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT' in found_values}} + '(value type = :py:obj:`~.cuuint64_t`) Amount of reserved memory in bytes to\n' + 'hold onto before trying to release memory back to the OS. When more than\n' + 'the release threshold bytes of memory are held by the memory pool, the\n' + 'allocator will try to release memory back to the OS on the next call to\n' + 'stream, event or context synchronize. (default 0)\n' + ) + CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT = ( cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT, - '(value type = cuuint64_t) Amount of backing memory currently allocated for\n' - 'the mempool.\n' - ){{endif}} - {{if 'CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH' in found_values}} + '(value type = :py:obj:`~.cuuint64_t`) Amount of backing memory currently\n' + 'allocated for the mempool.\n' + ) + CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH = ( cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH, - '(value type = cuuint64_t) High watermark of backing memory allocated for\n' - 'the mempool since the last time it was reset. High watermark can only be\n' - 'reset to zero.\n' - ){{endif}} - {{if 'CU_MEMPOOL_ATTR_USED_MEM_CURRENT' in found_values}} + '(value type = :py:obj:`~.cuuint64_t`) High watermark of backing memory\n' + 'allocated for the mempool since the last time it was reset. High watermark\n' + 'can only be reset to zero.\n' + ) + CU_MEMPOOL_ATTR_USED_MEM_CURRENT = ( cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_USED_MEM_CURRENT, - '(value type = cuuint64_t) Amount of memory from the pool that is currently\n' - 'in use by the application.\n' - ){{endif}} - {{if 'CU_MEMPOOL_ATTR_USED_MEM_HIGH' in found_values}} + '(value type = :py:obj:`~.cuuint64_t`) Amount of memory from the pool that\n' + 'is currently in use by the application.\n' + ) + CU_MEMPOOL_ATTR_USED_MEM_HIGH = ( cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_USED_MEM_HIGH, - '(value type = cuuint64_t) High watermark of the amount of memory from the\n' - 'pool that was in use by the application since the last time it was reset.\n' - 'High watermark can only be reset to zero.\n' - ){{endif}} - {{if 'CU_MEMPOOL_ATTR_ALLOCATION_TYPE' in found_values}} + '(value type = :py:obj:`~.cuuint64_t`) High watermark of the amount of\n' + 'memory from the pool that was in use by the application since the last time\n' + 'it was reset. High watermark can only be reset to zero.\n' + ) + CU_MEMPOOL_ATTR_ALLOCATION_TYPE = ( cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_ALLOCATION_TYPE, - '(value type = CUmemAllocationType) The allocation type of the mempool\n' - ){{endif}} - {{if 'CU_MEMPOOL_ATTR_EXPORT_HANDLE_TYPES' in found_values}} + '(value type = :py:obj:`~.CUmemAllocationType`) The allocation type of the\n' + 'mempool\n' + ) + CU_MEMPOOL_ATTR_EXPORT_HANDLE_TYPES = ( cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_EXPORT_HANDLE_TYPES, - '(value type = CUmemAllocationHandleType) Available export handle types for\n' - 'the mempool. For imported pools this value is always\n' + '(value type = :py:obj:`~.CUmemAllocationHandleType`) Available export\n' + 'handle types for the mempool. For imported pools this value is always\n' 'CU_MEM_HANDLE_TYPE_NONE as an imported pool cannot be re-exported\n' - ){{endif}} - {{if 'CU_MEMPOOL_ATTR_LOCATION_ID' in found_values}} + ) + CU_MEMPOOL_ATTR_LOCATION_ID = ( cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_LOCATION_ID, '(value type = int) The location id for the mempool. If the location type\n' 'for this pool is CU_MEM_LOCATION_TYPE_INVISIBLE then ID will be\n' 'CU_DEVICE_INVALID.\n' - ){{endif}} - {{if 'CU_MEMPOOL_ATTR_LOCATION_TYPE' in found_values}} + ) + CU_MEMPOOL_ATTR_LOCATION_TYPE = ( cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_LOCATION_TYPE, - '(value type = CUmemLocationType) The location type for the mempool. For\n' - 'imported memory pools where the device is not directly visible to the\n' - 'importing process or pools imported via fabric handles across nodes this\n' - 'will be CU_MEM_LOCATION_TYPE_INVISIBLE.\n' - ){{endif}} - {{if 'CU_MEMPOOL_ATTR_MAX_POOL_SIZE' in found_values}} + '(value type = :py:obj:`~.CUmemLocationType`) The location type for the\n' + 'mempool. For imported memory pools where the device is not directly visible\n' + 'to the importing process or pools imported via fabric handles across nodes\n' + 'this will be CU_MEM_LOCATION_TYPE_INVISIBLE.\n' + ) + CU_MEMPOOL_ATTR_MAX_POOL_SIZE = ( cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_MAX_POOL_SIZE, - '(value type = cuuint64_t) Maximum size of the pool in bytes, this value may\n' - 'be higher than what was initially passed to cuMemPoolCreate due to\n' - 'alignment requirements. A value of 0 indicates no maximum size. For\n' + '(value type = :py:obj:`~.cuuint64_t`) Maximum size of the pool in bytes,\n' + 'this value may be higher than what was initially passed to cuMemPoolCreate\n' + 'due to alignment requirements. A value of 0 indicates no maximum size. For\n' 'CU_MEM_ALLOCATION_TYPE_MANAGED and IPC imported pools this value will be\n' 'system dependent.\n' - ){{endif}} - {{if 'CU_MEMPOOL_ATTR_HW_DECOMPRESS_ENABLED' in found_values}} + ) + CU_MEMPOOL_ATTR_HW_DECOMPRESS_ENABLED = ( cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_HW_DECOMPRESS_ENABLED, '(value type = int) Indicates whether the pool has hardware compresssion\n' 'enabled\n' - ){{endif}} - -{{endif}} -{{if 'CUmemcpyFlags_enum' in found_types}} + ) class CUmemcpyFlags(_FastEnum): """ Flags to specify for copies within a batch. For more details see :py:obj:`~.cuMemcpyBatchAsync`. """ - {{if 'CU_MEMCPY_FLAG_DEFAULT' in found_values}} - CU_MEMCPY_FLAG_DEFAULT = cydriver.CUmemcpyFlags_enum.CU_MEMCPY_FLAG_DEFAULT{{endif}} - {{if 'CU_MEMCPY_FLAG_PREFER_OVERLAP_WITH_COMPUTE' in found_values}} + + CU_MEMCPY_FLAG_DEFAULT = cydriver.CUmemcpyFlags_enum.CU_MEMCPY_FLAG_DEFAULT + CU_MEMCPY_FLAG_PREFER_OVERLAP_WITH_COMPUTE = ( cydriver.CUmemcpyFlags_enum.CU_MEMCPY_FLAG_PREFER_OVERLAP_WITH_COMPUTE, 'Hint to the driver to try and overlap the copy with compute work on the\n' 'SMs.\n' - ){{endif}} - -{{endif}} -{{if 'CUmemcpySrcAccessOrder_enum' in found_types}} + ) class CUmemcpySrcAccessOrder(_FastEnum): """ @@ -6413,19 +6202,19 @@ class CUmemcpySrcAccessOrder(_FastEnum): CUDA must maintain. The destination will always be accessed in stream order. """ - {{if 'CU_MEMCPY_SRC_ACCESS_ORDER_INVALID' in found_values}} + CU_MEMCPY_SRC_ACCESS_ORDER_INVALID = ( cydriver.CUmemcpySrcAccessOrder_enum.CU_MEMCPY_SRC_ACCESS_ORDER_INVALID, 'Default invalid.\n' - ){{endif}} - {{if 'CU_MEMCPY_SRC_ACCESS_ORDER_STREAM' in found_values}} + ) + CU_MEMCPY_SRC_ACCESS_ORDER_STREAM = ( cydriver.CUmemcpySrcAccessOrder_enum.CU_MEMCPY_SRC_ACCESS_ORDER_STREAM, 'Indicates that access to the source pointer must be in stream order.\n' - ){{endif}} - {{if 'CU_MEMCPY_SRC_ACCESS_ORDER_DURING_API_CALL' in found_values}} + ) + CU_MEMCPY_SRC_ACCESS_ORDER_DURING_API_CALL = ( cydriver.CUmemcpySrcAccessOrder_enum.CU_MEMCPY_SRC_ACCESS_ORDER_DURING_API_CALL, @@ -6437,8 +6226,8 @@ class CUmemcpySrcAccessOrder(_FastEnum): 'was declared in. Specifying this flag allows the driver to optimize the\n' 'copy and removes the need for the user to synchronize the stream after the\n' 'API call.\n' - ){{endif}} - {{if 'CU_MEMCPY_SRC_ACCESS_ORDER_ANY' in found_values}} + ) + CU_MEMCPY_SRC_ACCESS_ORDER_ANY = ( cydriver.CUmemcpySrcAccessOrder_enum.CU_MEMCPY_SRC_ACCESS_ORDER_ANY, @@ -6448,93 +6237,84 @@ class CUmemcpySrcAccessOrder(_FastEnum): 'known that no prior operations in the stream can be accessing the memory.\n' 'Specifying this flag allows the driver to optimize the copy on certain\n' 'platforms.\n' - ){{endif}} - {{if 'CU_MEMCPY_SRC_ACCESS_ORDER_MAX' in found_values}} - CU_MEMCPY_SRC_ACCESS_ORDER_MAX = cydriver.CUmemcpySrcAccessOrder_enum.CU_MEMCPY_SRC_ACCESS_ORDER_MAX{{endif}} + ) -{{endif}} -{{if 'CUmemcpy3DOperandType_enum' in found_types}} + CU_MEMCPY_SRC_ACCESS_ORDER_MAX = cydriver.CUmemcpySrcAccessOrder_enum.CU_MEMCPY_SRC_ACCESS_ORDER_MAX class CUmemcpy3DOperandType(_FastEnum): """ These flags allow applications to convey the operand type for individual copies specified in :py:obj:`~.cuMemcpy3DBatchAsync`. """ - {{if 'CU_MEMCPY_OPERAND_TYPE_POINTER' in found_values}} + CU_MEMCPY_OPERAND_TYPE_POINTER = ( cydriver.CUmemcpy3DOperandType_enum.CU_MEMCPY_OPERAND_TYPE_POINTER, 'Memcpy operand is a valid pointer.\n' - ){{endif}} - {{if 'CU_MEMCPY_OPERAND_TYPE_ARRAY' in found_values}} + ) + CU_MEMCPY_OPERAND_TYPE_ARRAY = ( cydriver.CUmemcpy3DOperandType_enum.CU_MEMCPY_OPERAND_TYPE_ARRAY, - 'Memcpy operand is a CUarray.\n' - ){{endif}} - {{if 'CU_MEMCPY_OPERAND_TYPE_MAX' in found_values}} - CU_MEMCPY_OPERAND_TYPE_MAX = cydriver.CUmemcpy3DOperandType_enum.CU_MEMCPY_OPERAND_TYPE_MAX{{endif}} + 'Memcpy operand is a :py:obj:`~.CUarray`.\n' + ) -{{endif}} -{{if 'CUgraphMem_attribute_enum' in found_types}} + CU_MEMCPY_OPERAND_TYPE_MAX = cydriver.CUmemcpy3DOperandType_enum.CU_MEMCPY_OPERAND_TYPE_MAX class CUgraphMem_attribute(_FastEnum): """ """ - {{if 'CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT' in found_values}} + CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT = ( cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT, - '(value type = cuuint64_t) Amount of memory, in bytes, currently associated\n' - 'with graphs\n' - ){{endif}} - {{if 'CU_GRAPH_MEM_ATTR_USED_MEM_HIGH' in found_values}} + '(value type = :py:obj:`~.cuuint64_t`) Amount of memory, in bytes, currently\n' + 'associated with graphs\n' + ) + CU_GRAPH_MEM_ATTR_USED_MEM_HIGH = ( cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_USED_MEM_HIGH, - '(value type = cuuint64_t) High watermark of memory, in bytes, associated\n' - 'with graphs since the last time it was reset. High watermark can only be\n' - 'reset to zero.\n' - ){{endif}} - {{if 'CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT' in found_values}} + '(value type = :py:obj:`~.cuuint64_t`) High watermark of memory, in bytes,\n' + 'associated with graphs since the last time it was reset. High watermark can\n' + 'only be reset to zero.\n' + ) + CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT = ( cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT, - '(value type = cuuint64_t) Amount of memory, in bytes, currently allocated\n' - 'for use by the CUDA graphs asynchronous allocator.\n' - ){{endif}} - {{if 'CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH' in found_values}} + '(value type = :py:obj:`~.cuuint64_t`) Amount of memory, in bytes, currently\n' + 'allocated for use by the CUDA graphs asynchronous allocator.\n' + ) + CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH = ( cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH, - '(value type = cuuint64_t) High watermark of memory, in bytes, currently\n' - 'allocated for use by the CUDA graphs asynchronous allocator.\n' - ){{endif}} - -{{endif}} -{{if 'CUgraphChildGraphNodeOwnership_enum' in found_types}} + '(value type = :py:obj:`~.cuuint64_t`) High watermark of memory, in bytes,\n' + 'currently allocated for use by the CUDA graphs asynchronous allocator.\n' + ) class CUgraphChildGraphNodeOwnership(_FastEnum): """ Child graph node ownership """ - {{if 'CU_GRAPH_CHILD_GRAPH_OWNERSHIP_INVALID' in found_values}} + CU_GRAPH_CHILD_GRAPH_OWNERSHIP_INVALID = ( cydriver.CUgraphChildGraphNodeOwnership_enum.CU_GRAPH_CHILD_GRAPH_OWNERSHIP_INVALID, 'Invalid ownership flag. Set when params are queried to prevent accidentally\n' 'reusing the driver-owned graph object\n' - ){{endif}} - {{if 'CU_GRAPH_CHILD_GRAPH_OWNERSHIP_CLONE' in found_values}} + ) + CU_GRAPH_CHILD_GRAPH_OWNERSHIP_CLONE = ( cydriver.CUgraphChildGraphNodeOwnership_enum.CU_GRAPH_CHILD_GRAPH_OWNERSHIP_CLONE, 'Default behavior for a child graph node. Child graph is cloned into the\n' "parent and memory allocation/free nodes can't be present in the child\n" 'graph.\n' - ){{endif}} - {{if 'CU_GRAPH_CHILD_GRAPH_OWNERSHIP_MOVE' in found_values}} + ) + CU_GRAPH_CHILD_GRAPH_OWNERSHIP_MOVE = ( cydriver.CUgraphChildGraphNodeOwnership_enum.CU_GRAPH_CHILD_GRAPH_OWNERSHIP_MOVE, @@ -6545,578 +6325,577 @@ class CUgraphChildGraphNodeOwnership(_FastEnum): 'as a child graph of a separate parent graph; Cannot be used as an argument\n' 'to cuGraphExecUpdate; Cannot have additional memory allocation or free\n' 'nodes added.\n' - ){{endif}} - -{{endif}} -{{if 'CUflushGPUDirectRDMAWritesOptions_enum' in found_types}} + ) class CUflushGPUDirectRDMAWritesOptions(_FastEnum): """ Bitmasks for :py:obj:`~.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_FLUSH_WRITES_OPTIONS` """ - {{if 'CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_HOST' in found_values}} + CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_HOST = ( cydriver.CUflushGPUDirectRDMAWritesOptions_enum.CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_HOST, ':py:obj:`~.cuFlushGPUDirectRDMAWrites()` and its CUDA Runtime API\n' 'counterpart are supported on the device.\n' - ){{endif}} - {{if 'CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_MEMOPS' in found_values}} + ) + CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_MEMOPS = ( cydriver.CUflushGPUDirectRDMAWritesOptions_enum.CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_MEMOPS, 'The :py:obj:`~.CU_STREAM_WAIT_VALUE_FLUSH` flag and the\n' ':py:obj:`~.CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES` MemOp are supported on the\n' 'device.\n' - ){{endif}} - -{{endif}} -{{if 'CUGPUDirectRDMAWritesOrdering_enum' in found_types}} + ) class CUGPUDirectRDMAWritesOrdering(_FastEnum): """ Platform native ordering for GPUDirect RDMA writes """ - {{if 'CU_GPU_DIRECT_RDMA_WRITES_ORDERING_NONE' in found_values}} + CU_GPU_DIRECT_RDMA_WRITES_ORDERING_NONE = ( cydriver.CUGPUDirectRDMAWritesOrdering_enum.CU_GPU_DIRECT_RDMA_WRITES_ORDERING_NONE, 'The device does not natively support ordering of remote writes.\n' ':py:obj:`~.cuFlushGPUDirectRDMAWrites()` can be leveraged if supported.\n' - ){{endif}} - {{if 'CU_GPU_DIRECT_RDMA_WRITES_ORDERING_OWNER' in found_values}} + ) + CU_GPU_DIRECT_RDMA_WRITES_ORDERING_OWNER = ( cydriver.CUGPUDirectRDMAWritesOrdering_enum.CU_GPU_DIRECT_RDMA_WRITES_ORDERING_OWNER, 'Natively, the device can consistently consume remote writes, although other\n' 'CUDA devices may not.\n' - ){{endif}} - {{if 'CU_GPU_DIRECT_RDMA_WRITES_ORDERING_ALL_DEVICES' in found_values}} + ) + CU_GPU_DIRECT_RDMA_WRITES_ORDERING_ALL_DEVICES = ( cydriver.CUGPUDirectRDMAWritesOrdering_enum.CU_GPU_DIRECT_RDMA_WRITES_ORDERING_ALL_DEVICES, 'Any CUDA device in the system can consistently consume remote writes to\n' 'this device.\n' - ){{endif}} - -{{endif}} -{{if 'CUflushGPUDirectRDMAWritesScope_enum' in found_types}} + ) class CUflushGPUDirectRDMAWritesScope(_FastEnum): """ The scopes for :py:obj:`~.cuFlushGPUDirectRDMAWrites` """ - {{if 'CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_OWNER' in found_values}} + CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_OWNER = ( cydriver.CUflushGPUDirectRDMAWritesScope_enum.CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_OWNER, 'Blocks until remote writes are visible to the CUDA device context owning\n' 'the data.\n' - ){{endif}} - {{if 'CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_ALL_DEVICES' in found_values}} + ) + CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_ALL_DEVICES = ( cydriver.CUflushGPUDirectRDMAWritesScope_enum.CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_ALL_DEVICES, 'Blocks until remote writes are visible to all CUDA device contexts.\n' - ){{endif}} - -{{endif}} -{{if 'CUflushGPUDirectRDMAWritesTarget_enum' in found_types}} + ) class CUflushGPUDirectRDMAWritesTarget(_FastEnum): """ The targets for :py:obj:`~.cuFlushGPUDirectRDMAWrites` """ - {{if 'CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TARGET_CURRENT_CTX' in found_values}} + CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TARGET_CURRENT_CTX = ( cydriver.CUflushGPUDirectRDMAWritesTarget_enum.CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TARGET_CURRENT_CTX, 'Sets the target for :py:obj:`~.cuFlushGPUDirectRDMAWrites()` to the\n' 'currently active CUDA device context.\n' - ){{endif}} - -{{endif}} -{{if 'CUgraphDebugDot_flags_enum' in found_types}} + ) class CUgraphDebugDot_flags(_FastEnum): """ The additional write options for :py:obj:`~.cuGraphDebugDotPrint` """ - {{if 'CU_GRAPH_DEBUG_DOT_FLAGS_VERBOSE' in found_values}} + CU_GRAPH_DEBUG_DOT_FLAGS_VERBOSE = ( cydriver.CUgraphDebugDot_flags_enum.CU_GRAPH_DEBUG_DOT_FLAGS_VERBOSE, 'Output all debug data as if every debug flag is enabled\n' - ){{endif}} - {{if 'CU_GRAPH_DEBUG_DOT_FLAGS_RUNTIME_TYPES' in found_values}} + ) + CU_GRAPH_DEBUG_DOT_FLAGS_RUNTIME_TYPES = ( cydriver.CUgraphDebugDot_flags_enum.CU_GRAPH_DEBUG_DOT_FLAGS_RUNTIME_TYPES, 'Use CUDA Runtime structures for output\n' - ){{endif}} - {{if 'CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_PARAMS' in found_values}} + ) + CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_PARAMS = ( cydriver.CUgraphDebugDot_flags_enum.CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_PARAMS, - 'Adds CUDA_KERNEL_NODE_PARAMS values to output\n' - ){{endif}} - {{if 'CU_GRAPH_DEBUG_DOT_FLAGS_MEMCPY_NODE_PARAMS' in found_values}} + 'Adds :py:obj:`~.CUDA_KERNEL_NODE_PARAMS` values to output\n' + ) + CU_GRAPH_DEBUG_DOT_FLAGS_MEMCPY_NODE_PARAMS = ( cydriver.CUgraphDebugDot_flags_enum.CU_GRAPH_DEBUG_DOT_FLAGS_MEMCPY_NODE_PARAMS, - 'Adds CUDA_MEMCPY3D values to output\n' - ){{endif}} - {{if 'CU_GRAPH_DEBUG_DOT_FLAGS_MEMSET_NODE_PARAMS' in found_values}} + 'Adds :py:obj:`~.CUDA_MEMCPY3D` values to output\n' + ) + CU_GRAPH_DEBUG_DOT_FLAGS_MEMSET_NODE_PARAMS = ( cydriver.CUgraphDebugDot_flags_enum.CU_GRAPH_DEBUG_DOT_FLAGS_MEMSET_NODE_PARAMS, - 'Adds CUDA_MEMSET_NODE_PARAMS values to output\n' - ){{endif}} - {{if 'CU_GRAPH_DEBUG_DOT_FLAGS_HOST_NODE_PARAMS' in found_values}} + 'Adds :py:obj:`~.CUDA_MEMSET_NODE_PARAMS` values to output\n' + ) + CU_GRAPH_DEBUG_DOT_FLAGS_HOST_NODE_PARAMS = ( cydriver.CUgraphDebugDot_flags_enum.CU_GRAPH_DEBUG_DOT_FLAGS_HOST_NODE_PARAMS, - 'Adds CUDA_HOST_NODE_PARAMS values to output\n' - ){{endif}} - {{if 'CU_GRAPH_DEBUG_DOT_FLAGS_EVENT_NODE_PARAMS' in found_values}} + 'Adds :py:obj:`~.CUDA_HOST_NODE_PARAMS` values to output\n' + ) + CU_GRAPH_DEBUG_DOT_FLAGS_EVENT_NODE_PARAMS = ( cydriver.CUgraphDebugDot_flags_enum.CU_GRAPH_DEBUG_DOT_FLAGS_EVENT_NODE_PARAMS, - 'Adds CUevent handle from record and wait nodes to output\n' - ){{endif}} - {{if 'CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_SIGNAL_NODE_PARAMS' in found_values}} + 'Adds :py:obj:`~.CUevent` handle from record and wait nodes to output\n' + ) + CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_SIGNAL_NODE_PARAMS = ( cydriver.CUgraphDebugDot_flags_enum.CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_SIGNAL_NODE_PARAMS, - 'Adds CUDA_EXT_SEM_SIGNAL_NODE_PARAMS values to output\n' - ){{endif}} - {{if 'CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_WAIT_NODE_PARAMS' in found_values}} + 'Adds :py:obj:`~.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS` values to output\n' + ) + CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_WAIT_NODE_PARAMS = ( cydriver.CUgraphDebugDot_flags_enum.CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_WAIT_NODE_PARAMS, - 'Adds CUDA_EXT_SEM_WAIT_NODE_PARAMS values to output\n' - ){{endif}} - {{if 'CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_ATTRIBUTES' in found_values}} + 'Adds :py:obj:`~.CUDA_EXT_SEM_WAIT_NODE_PARAMS` values to output\n' + ) + CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_ATTRIBUTES = ( cydriver.CUgraphDebugDot_flags_enum.CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_ATTRIBUTES, - 'Adds CUkernelNodeAttrValue values to output\n' - ){{endif}} - {{if 'CU_GRAPH_DEBUG_DOT_FLAGS_HANDLES' in found_values}} + 'Adds :py:obj:`~.CUkernelNodeAttrValue` values to output\n' + ) + CU_GRAPH_DEBUG_DOT_FLAGS_HANDLES = ( cydriver.CUgraphDebugDot_flags_enum.CU_GRAPH_DEBUG_DOT_FLAGS_HANDLES, 'Adds node handles and every kernel function handle to output\n' - ){{endif}} - {{if 'CU_GRAPH_DEBUG_DOT_FLAGS_MEM_ALLOC_NODE_PARAMS' in found_values}} + ) + CU_GRAPH_DEBUG_DOT_FLAGS_MEM_ALLOC_NODE_PARAMS = ( cydriver.CUgraphDebugDot_flags_enum.CU_GRAPH_DEBUG_DOT_FLAGS_MEM_ALLOC_NODE_PARAMS, 'Adds memory alloc node parameters to output\n' - ){{endif}} - {{if 'CU_GRAPH_DEBUG_DOT_FLAGS_MEM_FREE_NODE_PARAMS' in found_values}} + ) + CU_GRAPH_DEBUG_DOT_FLAGS_MEM_FREE_NODE_PARAMS = ( cydriver.CUgraphDebugDot_flags_enum.CU_GRAPH_DEBUG_DOT_FLAGS_MEM_FREE_NODE_PARAMS, 'Adds memory free node parameters to output\n' - ){{endif}} - {{if 'CU_GRAPH_DEBUG_DOT_FLAGS_BATCH_MEM_OP_NODE_PARAMS' in found_values}} + ) + CU_GRAPH_DEBUG_DOT_FLAGS_BATCH_MEM_OP_NODE_PARAMS = ( cydriver.CUgraphDebugDot_flags_enum.CU_GRAPH_DEBUG_DOT_FLAGS_BATCH_MEM_OP_NODE_PARAMS, 'Adds batch mem op node parameters to output\n' - ){{endif}} - {{if 'CU_GRAPH_DEBUG_DOT_FLAGS_EXTRA_TOPO_INFO' in found_values}} + ) + CU_GRAPH_DEBUG_DOT_FLAGS_EXTRA_TOPO_INFO = ( cydriver.CUgraphDebugDot_flags_enum.CU_GRAPH_DEBUG_DOT_FLAGS_EXTRA_TOPO_INFO, 'Adds edge numbering information\n' - ){{endif}} - {{if 'CU_GRAPH_DEBUG_DOT_FLAGS_CONDITIONAL_NODE_PARAMS' in found_values}} + ) + CU_GRAPH_DEBUG_DOT_FLAGS_CONDITIONAL_NODE_PARAMS = ( cydriver.CUgraphDebugDot_flags_enum.CU_GRAPH_DEBUG_DOT_FLAGS_CONDITIONAL_NODE_PARAMS, 'Adds conditional node parameters to output\n' - ){{endif}} - -{{endif}} -{{if 'CUuserObject_flags_enum' in found_types}} + ) class CUuserObject_flags(_FastEnum): """ Flags for user objects for graphs """ - {{if 'CU_USER_OBJECT_NO_DESTRUCTOR_SYNC' in found_values}} + CU_USER_OBJECT_NO_DESTRUCTOR_SYNC = ( cydriver.CUuserObject_flags_enum.CU_USER_OBJECT_NO_DESTRUCTOR_SYNC, 'Indicates the destructor execution is not synchronized by any CUDA handle.\n' - ){{endif}} - -{{endif}} -{{if 'CUuserObjectRetain_flags_enum' in found_types}} + ) class CUuserObjectRetain_flags(_FastEnum): """ Flags for retaining user object references for graphs """ - {{if 'CU_GRAPH_USER_OBJECT_MOVE' in found_values}} + CU_GRAPH_USER_OBJECT_MOVE = ( cydriver.CUuserObjectRetain_flags_enum.CU_GRAPH_USER_OBJECT_MOVE, 'Transfer references from the caller rather than creating new references.\n' - ){{endif}} - -{{endif}} -{{if 'CUgraphInstantiate_flags_enum' in found_types}} + ) class CUgraphInstantiate_flags(_FastEnum): """ Flags for instantiating a graph """ - {{if 'CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH' in found_values}} + CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH = ( cydriver.CUgraphInstantiate_flags_enum.CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH, 'Automatically free memory allocated in a graph before relaunching.\n' - ){{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_FLAG_UPLOAD' in found_values}} + ) + CUDA_GRAPH_INSTANTIATE_FLAG_UPLOAD = ( cydriver.CUgraphInstantiate_flags_enum.CUDA_GRAPH_INSTANTIATE_FLAG_UPLOAD, 'Automatically upload the graph after instantiation. Only supported by\n' ':py:obj:`~.cuGraphInstantiateWithParams`. The upload will be performed\n' 'using the stream provided in `instantiateParams`.\n' - ){{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_FLAG_DEVICE_LAUNCH' in found_values}} + ) + CUDA_GRAPH_INSTANTIATE_FLAG_DEVICE_LAUNCH = ( cydriver.CUgraphInstantiate_flags_enum.CUDA_GRAPH_INSTANTIATE_FLAG_DEVICE_LAUNCH, 'Instantiate the graph to be launchable from the device. This flag can only\n' 'be used on platforms which support unified addressing. This flag cannot be\n' 'used in conjunction with CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH.\n' - ){{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY' in found_values}} + ) + CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY = ( cydriver.CUgraphInstantiate_flags_enum.CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY, 'Run the graph using the per-node priority attributes rather than the\n' 'priority of the stream it is launched into.\n' - ){{endif}} - -{{endif}} -{{if 'CUdeviceNumaConfig_enum' in found_types}} + ) class CUdeviceNumaConfig(_FastEnum): """ CUDA device NUMA configuration """ - {{if 'CU_DEVICE_NUMA_CONFIG_NONE' in found_values}} + CU_DEVICE_NUMA_CONFIG_NONE = ( cydriver.CUdeviceNumaConfig_enum.CU_DEVICE_NUMA_CONFIG_NONE, 'The GPU is not a NUMA node\n' - ){{endif}} - {{if 'CU_DEVICE_NUMA_CONFIG_NUMA_NODE' in found_values}} + ) + CU_DEVICE_NUMA_CONFIG_NUMA_NODE = ( cydriver.CUdeviceNumaConfig_enum.CU_DEVICE_NUMA_CONFIG_NUMA_NODE, 'The GPU is a NUMA node, CU_DEVICE_ATTRIBUTE_NUMA_ID contains its NUMA ID\n' - ){{endif}} - -{{endif}} -{{if 'CUprocessState_enum' in found_types}} + ) class CUprocessState(_FastEnum): """ CUDA Process States """ - {{if 'CU_PROCESS_STATE_RUNNING' in found_values}} + CU_PROCESS_STATE_RUNNING = ( cydriver.CUprocessState_enum.CU_PROCESS_STATE_RUNNING, 'Default process state\n' - ){{endif}} - {{if 'CU_PROCESS_STATE_LOCKED' in found_values}} + ) + CU_PROCESS_STATE_LOCKED = ( cydriver.CUprocessState_enum.CU_PROCESS_STATE_LOCKED, 'CUDA API locks are taken so further CUDA API calls will block\n' - ){{endif}} - {{if 'CU_PROCESS_STATE_CHECKPOINTED' in found_values}} + ) + CU_PROCESS_STATE_CHECKPOINTED = ( cydriver.CUprocessState_enum.CU_PROCESS_STATE_CHECKPOINTED, 'Application memory contents have been checkpointed and underlying\n' 'allocations and device handles have been released\n' - ){{endif}} - {{if 'CU_PROCESS_STATE_FAILED' in found_values}} + ) + CU_PROCESS_STATE_FAILED = ( cydriver.CUprocessState_enum.CU_PROCESS_STATE_FAILED, 'Application entered an uncorrectable error during the checkpoint/restore\n' 'process\n' - ){{endif}} - -{{endif}} -{{if 'CUmoduleLoadingMode_enum' in found_types}} + ) class CUmoduleLoadingMode(_FastEnum): """ CUDA Lazy Loading status """ - {{if 'CU_MODULE_EAGER_LOADING' in found_values}} + CU_MODULE_EAGER_LOADING = ( cydriver.CUmoduleLoadingMode_enum.CU_MODULE_EAGER_LOADING, 'Lazy Kernel Loading is not enabled\n' - ){{endif}} - {{if 'CU_MODULE_LAZY_LOADING' in found_values}} + ) + CU_MODULE_LAZY_LOADING = ( cydriver.CUmoduleLoadingMode_enum.CU_MODULE_LAZY_LOADING, 'Lazy Kernel Loading is enabled\n' - ){{endif}} - -{{endif}} -{{if 'CUmemDecompressAlgorithm_enum' in found_types}} + ) class CUmemDecompressAlgorithm(_FastEnum): """ Bitmasks for CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_ALGORITHM_MASK. """ - {{if 'CU_MEM_DECOMPRESS_UNSUPPORTED' in found_values}} + CU_MEM_DECOMPRESS_UNSUPPORTED = ( cydriver.CUmemDecompressAlgorithm_enum.CU_MEM_DECOMPRESS_UNSUPPORTED, 'Decompression is unsupported.\n' - ){{endif}} - {{if 'CU_MEM_DECOMPRESS_ALGORITHM_DEFLATE' in found_values}} + ) + CU_MEM_DECOMPRESS_ALGORITHM_DEFLATE = ( cydriver.CUmemDecompressAlgorithm_enum.CU_MEM_DECOMPRESS_ALGORITHM_DEFLATE, 'Deflate is supported.\n' - ){{endif}} - {{if 'CU_MEM_DECOMPRESS_ALGORITHM_SNAPPY' in found_values}} + ) + CU_MEM_DECOMPRESS_ALGORITHM_SNAPPY = ( cydriver.CUmemDecompressAlgorithm_enum.CU_MEM_DECOMPRESS_ALGORITHM_SNAPPY, 'Snappy is supported.\n' - ){{endif}} - {{if 'CU_MEM_DECOMPRESS_ALGORITHM_LZ4' in found_values}} + ) + CU_MEM_DECOMPRESS_ALGORITHM_LZ4 = ( cydriver.CUmemDecompressAlgorithm_enum.CU_MEM_DECOMPRESS_ALGORITHM_LZ4, 'LZ4 is supported.\n' - ){{endif}} + ) + +class CUlogicalEndpointIpcHandleType(_FastEnum): + """ + IPC handle types that can be requested/queried for a given logical + endpoint + """ + + CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_NONE = cydriver.CUlogicalEndpointIpcHandleType_enum.CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_NONE + + CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_FABRIC = cydriver.CUlogicalEndpointIpcHandleType_enum.CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_FABRIC + +class CUlogicalEndpointType(_FastEnum): + """ + Logical endpoint type + """ + + CU_LOGICAL_ENDPOINT_TYPE_INVALID = cydriver.CUlogicalEndpointType_enum.CU_LOGICAL_ENDPOINT_TYPE_INVALID + + CU_LOGICAL_ENDPOINT_TYPE_UNICAST = cydriver.CUlogicalEndpointType_enum.CU_LOGICAL_ENDPOINT_TYPE_UNICAST + + CU_LOGICAL_ENDPOINT_TYPE_MULTICAST = cydriver.CUlogicalEndpointType_enum.CU_LOGICAL_ENDPOINT_TYPE_MULTICAST + +class CUlogicalEndpointFlag(_FastEnum): + """ + Flags for :py:obj:`~.CUlogicalEndpointProp` + """ + + + CU_LOGICAL_ENDPOINT_FLAG_NONE = ( + cydriver.CUlogicalEndpointFlag_enum.CU_LOGICAL_ENDPOINT_FLAG_NONE, + 'Default flag for logical endpoint construction\n' + ) + -{{endif}} -{{if 'CUfunctionLoadingState_enum' in found_types}} + CU_LOGICAL_ENDPOINT_FLAG_COUNTED_OPS = ( + cydriver.CUlogicalEndpointFlag_enum.CU_LOGICAL_ENDPOINT_FLAG_COUNTED_OPS, + "Indicate the programmer's intention to use counted operations with the\n" + 'logical endpoint\n' + ) + +class CUgraphRecaptureStatus(_FastEnum): + """ + + """ + + + CU_GRAPH_RECAPTURE_ELIGIBLE_FOR_UPDATE = ( + cydriver.CUgraphRecaptureStatus_enum.CU_GRAPH_RECAPTURE_ELIGIBLE_FOR_UPDATE, + 'Node is eligible for update in an instantiated graph.\n' + ) + + + CU_GRAPH_RECAPTURE_INELIGIBLE_FOR_UPDATE = ( + cydriver.CUgraphRecaptureStatus_enum.CU_GRAPH_RECAPTURE_INELIGIBLE_FOR_UPDATE, + 'Parameter changes in the node cannot be applied to an instantiated graph.\n' + ) + + + CU_GRAPH_RECAPTURE_ERROR = ( + cydriver.CUgraphRecaptureStatus_enum.CU_GRAPH_RECAPTURE_ERROR, + 'Error while attempting to recapture the node. The recapture will be ended\n' + 'regardless of the return value from the callback.\n' + ) class CUfunctionLoadingState(_FastEnum): """ """ - {{if 'CU_FUNCTION_LOADING_STATE_UNLOADED' in found_values}} - CU_FUNCTION_LOADING_STATE_UNLOADED = cydriver.CUfunctionLoadingState_enum.CU_FUNCTION_LOADING_STATE_UNLOADED{{endif}} - {{if 'CU_FUNCTION_LOADING_STATE_LOADED' in found_values}} - CU_FUNCTION_LOADING_STATE_LOADED = cydriver.CUfunctionLoadingState_enum.CU_FUNCTION_LOADING_STATE_LOADED{{endif}} - {{if 'CU_FUNCTION_LOADING_STATE_MAX' in found_values}} - CU_FUNCTION_LOADING_STATE_MAX = cydriver.CUfunctionLoadingState_enum.CU_FUNCTION_LOADING_STATE_MAX{{endif}} -{{endif}} -{{if 'CUcoredumpSettings_enum' in found_types}} + CU_FUNCTION_LOADING_STATE_UNLOADED = cydriver.CUfunctionLoadingState_enum.CU_FUNCTION_LOADING_STATE_UNLOADED + + CU_FUNCTION_LOADING_STATE_LOADED = cydriver.CUfunctionLoadingState_enum.CU_FUNCTION_LOADING_STATE_LOADED + + CU_FUNCTION_LOADING_STATE_MAX = cydriver.CUfunctionLoadingState_enum.CU_FUNCTION_LOADING_STATE_MAX class CUcoredumpSettings(_FastEnum): """ Flags for choosing a coredump attribute to get/set """ - {{if 'CU_COREDUMP_ENABLE_ON_EXCEPTION' in found_values}} - CU_COREDUMP_ENABLE_ON_EXCEPTION = cydriver.CUcoredumpSettings_enum.CU_COREDUMP_ENABLE_ON_EXCEPTION{{endif}} - {{if 'CU_COREDUMP_TRIGGER_HOST' in found_values}} - CU_COREDUMP_TRIGGER_HOST = cydriver.CUcoredumpSettings_enum.CU_COREDUMP_TRIGGER_HOST{{endif}} - {{if 'CU_COREDUMP_LIGHTWEIGHT' in found_values}} - CU_COREDUMP_LIGHTWEIGHT = cydriver.CUcoredumpSettings_enum.CU_COREDUMP_LIGHTWEIGHT{{endif}} - {{if 'CU_COREDUMP_ENABLE_USER_TRIGGER' in found_values}} - CU_COREDUMP_ENABLE_USER_TRIGGER = cydriver.CUcoredumpSettings_enum.CU_COREDUMP_ENABLE_USER_TRIGGER{{endif}} - {{if 'CU_COREDUMP_FILE' in found_values}} - CU_COREDUMP_FILE = cydriver.CUcoredumpSettings_enum.CU_COREDUMP_FILE{{endif}} - {{if 'CU_COREDUMP_PIPE' in found_values}} - CU_COREDUMP_PIPE = cydriver.CUcoredumpSettings_enum.CU_COREDUMP_PIPE{{endif}} - {{if 'CU_COREDUMP_GENERATION_FLAGS' in found_values}} - CU_COREDUMP_GENERATION_FLAGS = cydriver.CUcoredumpSettings_enum.CU_COREDUMP_GENERATION_FLAGS{{endif}} - {{if 'CU_COREDUMP_MAX' in found_values}} - CU_COREDUMP_MAX = cydriver.CUcoredumpSettings_enum.CU_COREDUMP_MAX{{endif}} - -{{endif}} -{{if 'CUCoredumpGenerationFlags' in found_types}} + + CU_COREDUMP_ENABLE_ON_EXCEPTION = cydriver.CUcoredumpSettings_enum.CU_COREDUMP_ENABLE_ON_EXCEPTION + + CU_COREDUMP_TRIGGER_HOST = cydriver.CUcoredumpSettings_enum.CU_COREDUMP_TRIGGER_HOST + + CU_COREDUMP_LIGHTWEIGHT = cydriver.CUcoredumpSettings_enum.CU_COREDUMP_LIGHTWEIGHT + + CU_COREDUMP_ENABLE_USER_TRIGGER = cydriver.CUcoredumpSettings_enum.CU_COREDUMP_ENABLE_USER_TRIGGER + + CU_COREDUMP_FILE = cydriver.CUcoredumpSettings_enum.CU_COREDUMP_FILE + + CU_COREDUMP_PIPE = cydriver.CUcoredumpSettings_enum.CU_COREDUMP_PIPE + + CU_COREDUMP_GENERATION_FLAGS = cydriver.CUcoredumpSettings_enum.CU_COREDUMP_GENERATION_FLAGS + + CU_COREDUMP_MAX = cydriver.CUcoredumpSettings_enum.CU_COREDUMP_MAX class CUCoredumpGenerationFlags(_FastEnum): """ Flags for controlling coredump contents """ - {{if 'CU_COREDUMP_DEFAULT_FLAGS' in found_values}} - CU_COREDUMP_DEFAULT_FLAGS = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_DEFAULT_FLAGS{{endif}} - {{if 'CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES' in found_values}} - CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES{{endif}} - {{if 'CU_COREDUMP_SKIP_GLOBAL_MEMORY' in found_values}} - CU_COREDUMP_SKIP_GLOBAL_MEMORY = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_SKIP_GLOBAL_MEMORY{{endif}} - {{if 'CU_COREDUMP_SKIP_SHARED_MEMORY' in found_values}} - CU_COREDUMP_SKIP_SHARED_MEMORY = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_SKIP_SHARED_MEMORY{{endif}} - {{if 'CU_COREDUMP_SKIP_LOCAL_MEMORY' in found_values}} - CU_COREDUMP_SKIP_LOCAL_MEMORY = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_SKIP_LOCAL_MEMORY{{endif}} - {{if 'CU_COREDUMP_SKIP_ABORT' in found_values}} - CU_COREDUMP_SKIP_ABORT = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_SKIP_ABORT{{endif}} - {{if 'CU_COREDUMP_SKIP_CONSTBANK_MEMORY' in found_values}} - CU_COREDUMP_SKIP_CONSTBANK_MEMORY = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_SKIP_CONSTBANK_MEMORY{{endif}} - {{if 'CU_COREDUMP_LIGHTWEIGHT_FLAGS' in found_values}} - CU_COREDUMP_LIGHTWEIGHT_FLAGS = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_LIGHTWEIGHT_FLAGS{{endif}} - {{if 'CU_COREDUMP_GZIP_COMPRESS' in found_values}} - CU_COREDUMP_GZIP_COMPRESS = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_GZIP_COMPRESS{{endif}} - -{{endif}} -{{if 'CUgreenCtxCreate_flags' in found_types}} + + CU_COREDUMP_DEFAULT_FLAGS = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_DEFAULT_FLAGS + + CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES + + CU_COREDUMP_SKIP_GLOBAL_MEMORY = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_SKIP_GLOBAL_MEMORY + + CU_COREDUMP_SKIP_SHARED_MEMORY = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_SKIP_SHARED_MEMORY + + CU_COREDUMP_SKIP_LOCAL_MEMORY = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_SKIP_LOCAL_MEMORY + + CU_COREDUMP_SKIP_ABORT = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_SKIP_ABORT + + CU_COREDUMP_SKIP_CONSTBANK_MEMORY = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_SKIP_CONSTBANK_MEMORY + + CU_COREDUMP_LIGHTWEIGHT_FLAGS = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_LIGHTWEIGHT_FLAGS + + CU_COREDUMP_GZIP_COMPRESS = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_GZIP_COMPRESS + + CU_COREDUMP_FAULTED_CONTEXTS_ONLY = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_FAULTED_CONTEXTS_ONLY + + CU_COREDUMP_NO_ERRBAR_AT_EXIT = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_NO_ERRBAR_AT_EXIT + + CU_COREDUMP_LOG_ONLY = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_LOG_ONLY class CUgreenCtxCreate_flags(_FastEnum): """ - + Flags for green context creation """ - {{if 'CU_GREEN_CTX_DEFAULT_STREAM' in found_values}} + + CU_GREEN_CTX_NONE = cydriver.CUgreenCtxCreate_flags.CU_GREEN_CTX_NONE + CU_GREEN_CTX_DEFAULT_STREAM = ( cydriver.CUgreenCtxCreate_flags.CU_GREEN_CTX_DEFAULT_STREAM, - 'Required. Creates a default stream to use inside the green context\n' - ){{endif}} - -{{endif}} -{{if 'CUdevSmResourceGroup_flags' in found_types}} + 'Creates a default stream to use inside the green context\n' + ) class CUdevSmResourceGroup_flags(_FastEnum): """ Flags for a :py:obj:`~.CUdevSmResource` group """ - {{if 'CU_DEV_SM_RESOURCE_GROUP_DEFAULT' in found_values}} - CU_DEV_SM_RESOURCE_GROUP_DEFAULT = cydriver.CUdevSmResourceGroup_flags.CU_DEV_SM_RESOURCE_GROUP_DEFAULT{{endif}} - {{if 'CU_DEV_SM_RESOURCE_GROUP_BACKFILL' in found_values}} - CU_DEV_SM_RESOURCE_GROUP_BACKFILL = cydriver.CUdevSmResourceGroup_flags.CU_DEV_SM_RESOURCE_GROUP_BACKFILL{{endif}} -{{endif}} -{{if 'CUdevSmResourceSplitByCount_flags' in found_types}} + CU_DEV_SM_RESOURCE_GROUP_DEFAULT = cydriver.CUdevSmResourceGroup_flags.CU_DEV_SM_RESOURCE_GROUP_DEFAULT + + CU_DEV_SM_RESOURCE_GROUP_BACKFILL = cydriver.CUdevSmResourceGroup_flags.CU_DEV_SM_RESOURCE_GROUP_BACKFILL class CUdevSmResourceSplitByCount_flags(_FastEnum): """ """ - {{if 'CU_DEV_SM_RESOURCE_SPLIT_IGNORE_SM_COSCHEDULING' in found_values}} - CU_DEV_SM_RESOURCE_SPLIT_IGNORE_SM_COSCHEDULING = cydriver.CUdevSmResourceSplitByCount_flags.CU_DEV_SM_RESOURCE_SPLIT_IGNORE_SM_COSCHEDULING{{endif}} - {{if 'CU_DEV_SM_RESOURCE_SPLIT_MAX_POTENTIAL_CLUSTER_SIZE' in found_values}} - CU_DEV_SM_RESOURCE_SPLIT_MAX_POTENTIAL_CLUSTER_SIZE = cydriver.CUdevSmResourceSplitByCount_flags.CU_DEV_SM_RESOURCE_SPLIT_MAX_POTENTIAL_CLUSTER_SIZE{{endif}} -{{endif}} -{{if 'CUdevResourceType' in found_types}} + CU_DEV_SM_RESOURCE_SPLIT_IGNORE_SM_COSCHEDULING = cydriver.CUdevSmResourceSplitByCount_flags.CU_DEV_SM_RESOURCE_SPLIT_IGNORE_SM_COSCHEDULING + + CU_DEV_SM_RESOURCE_SPLIT_MAX_POTENTIAL_CLUSTER_SIZE = cydriver.CUdevSmResourceSplitByCount_flags.CU_DEV_SM_RESOURCE_SPLIT_MAX_POTENTIAL_CLUSTER_SIZE class CUdevResourceType(_FastEnum): """ Type of resource """ - {{if 'CU_DEV_RESOURCE_TYPE_INVALID' in found_values}} - CU_DEV_RESOURCE_TYPE_INVALID = cydriver.CUdevResourceType.CU_DEV_RESOURCE_TYPE_INVALID{{endif}} - {{if 'CU_DEV_RESOURCE_TYPE_SM' in found_values}} + + CU_DEV_RESOURCE_TYPE_INVALID = cydriver.CUdevResourceType.CU_DEV_RESOURCE_TYPE_INVALID + CU_DEV_RESOURCE_TYPE_SM = ( cydriver.CUdevResourceType.CU_DEV_RESOURCE_TYPE_SM, 'Streaming multiprocessors related information\n' - ){{endif}} - {{if 'CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG' in found_values}} + ) + CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG = ( cydriver.CUdevResourceType.CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG, 'Workqueue configuration related information\n' - ){{endif}} - {{if 'CU_DEV_RESOURCE_TYPE_WORKQUEUE' in found_values}} + ) + CU_DEV_RESOURCE_TYPE_WORKQUEUE = ( cydriver.CUdevResourceType.CU_DEV_RESOURCE_TYPE_WORKQUEUE, 'Pre-existing workqueue related information\n' - ){{endif}} - -{{endif}} -{{if 'CUdevWorkqueueConfigScope' in found_types}} + ) class CUdevWorkqueueConfigScope(_FastEnum): """ Sharing scope for workqueues """ - {{if 'CU_WORKQUEUE_SCOPE_DEVICE_CTX' in found_values}} + CU_WORKQUEUE_SCOPE_DEVICE_CTX = ( cydriver.CUdevWorkqueueConfigScope.CU_WORKQUEUE_SCOPE_DEVICE_CTX, 'Use all shared workqueue resources across all contexts. Default driver\n' 'behaviour.\n' - ){{endif}} - {{if 'CU_WORKQUEUE_SCOPE_GREEN_CTX_BALANCED' in found_values}} + ) + CU_WORKQUEUE_SCOPE_GREEN_CTX_BALANCED = ( cydriver.CUdevWorkqueueConfigScope.CU_WORKQUEUE_SCOPE_GREEN_CTX_BALANCED, 'When possible, use non-overlapping workqueue resources with other balanced\n' 'green contexts.\n' - ){{endif}} - -{{endif}} -{{if 'CUlogLevel_enum' in found_types}} + ) class CUlogLevel(_FastEnum): """ """ - {{if 'CU_LOG_LEVEL_ERROR' in found_values}} - CU_LOG_LEVEL_ERROR = cydriver.CUlogLevel_enum.CU_LOG_LEVEL_ERROR{{endif}} - {{if 'CU_LOG_LEVEL_WARNING' in found_values}} - CU_LOG_LEVEL_WARNING = cydriver.CUlogLevel_enum.CU_LOG_LEVEL_WARNING{{endif}} -{{endif}} -{{if 'CUoutput_mode_enum' in found_types}} + CU_LOG_LEVEL_ERROR = cydriver.CUlogLevel_enum.CU_LOG_LEVEL_ERROR + + CU_LOG_LEVEL_WARNING = cydriver.CUlogLevel_enum.CU_LOG_LEVEL_WARNING class CUoutput_mode(_FastEnum): """ Profiler Output Modes """ - {{if 'CU_OUT_KEY_VALUE_PAIR' in found_values}} + CU_OUT_KEY_VALUE_PAIR = ( cydriver.CUoutput_mode_enum.CU_OUT_KEY_VALUE_PAIR, 'Output mode Key-Value pair format.\n' - ){{endif}} - {{if 'CU_OUT_CSV' in found_values}} + ) + CU_OUT_CSV = ( cydriver.CUoutput_mode_enum.CU_OUT_CSV, 'Output mode Comma separated values format.\n' - ){{endif}} - -{{endif}} -{{if True}} + ) class CUeglFrameType(_FastEnum): """ CUDA EglFrame type - array or pointer """ - {{if True}} + CU_EGL_FRAME_TYPE_ARRAY = ( cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY, 'Frame type CUDA array\n' - ){{endif}} - {{if True}} + ) + CU_EGL_FRAME_TYPE_PITCH = ( cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_PITCH, 'Frame type pointer\n' - ){{endif}} - -{{endif}} -{{if True}} + ) class CUeglResourceLocationFlags(_FastEnum): """ @@ -7132,21 +6911,18 @@ class CUeglResourceLocationFlags(_FastEnum): by CUDA. There may be an additional latency due to new allocation and data migration, if the frame is produced on a different memory. """ - {{if True}} + CU_EGL_RESOURCE_LOCATION_SYSMEM = ( cydriver.CUeglResourceLocationFlags_enum.CU_EGL_RESOURCE_LOCATION_SYSMEM, 'Resource location sysmem\n' - ){{endif}} - {{if True}} + ) + CU_EGL_RESOURCE_LOCATION_VIDMEM = ( cydriver.CUeglResourceLocationFlags_enum.CU_EGL_RESOURCE_LOCATION_VIDMEM, 'Resource location vidmem\n' - ){{endif}} - -{{endif}} -{{if True}} + ) class CUeglColorFormat(_FastEnum): """ @@ -7155,842 +6931,830 @@ class CUeglColorFormat(_FastEnum): formats are currently not supported for :py:obj:`~.CU_EGL_FRAME_TYPE_ARRAY` """ - {{if True}} + CU_EGL_COLOR_FORMAT_YUV420_PLANAR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR, 'Y, U, V in three surfaces, each in a separate surface, U/V width = 1/2 Y\n' 'width, U/V height = 1/2 Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR, 'Y, UV in two surfaces (UV as one surface) with VU byte ordering, width,\n' 'height ratio same as YUV420Planar.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YUV422_PLANAR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR, 'Y, U, V each in a separate surface, U/V width = 1/2 Y width, U/V height = Y\n' 'height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR, 'Y, UV in two surfaces with VU byte ordering, width, height ratio same as\n' 'YUV422Planar.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_RGB = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RGB, 'R/G/B three channels in one surface with BGR byte ordering. Only pitch\n' 'linear format supported.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BGR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BGR, 'R/G/B three channels in one surface with RGB byte ordering. Only pitch\n' 'linear format supported.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_ARGB = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ARGB, 'R/G/B/A four channels in one surface with BGRA byte ordering.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_RGBA = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RGBA, 'R/G/B/A four channels in one surface with ABGR byte ordering.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_L = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_L, 'single luminance channel in one surface.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_R = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_R, 'single color channel in one surface.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YUV444_PLANAR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR, 'Y, U, V in three surfaces, each in a separate surface, U/V width = Y width,\n' 'U/V height = Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR, 'Y, UV in two surfaces (UV as one surface) with VU byte ordering, width,\n' 'height ratio same as YUV444Planar.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YUYV_422 = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_422, 'Y, U, V in one surface, interleaved as UYVY in one channel.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_UYVY_422 = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_422, 'Y, U, V in one surface, interleaved as YUYV in one channel.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_ABGR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ABGR, 'R/G/B/A four channels in one surface with RGBA byte ordering.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BGRA = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BGRA, 'R/G/B/A four channels in one surface with ARGB byte ordering.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_A = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_A, 'Alpha color format - one channel in one surface.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_RG = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RG, 'R/G color format - two channels in one surface with GR byte ordering\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_AYUV = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV, 'Y, U, V, A four channels in one surface, interleaved as VUYA.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR, 'Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width\n' '= Y width, U/V height = Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR, 'Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width\n' '= 1/2 Y width, U/V height = Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR, 'Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width\n' '= 1/2 Y width, U/V height = 1/2 Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR, 'Y10, V10U10 in two surfaces (VU as one surface) with UV byte ordering, U/V\n' 'width = Y width, U/V height = Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR, 'Y10, V10U10 in two surfaces (VU as one surface) with UV byte ordering, U/V\n' 'width = 1/2 Y width, U/V height = 1/2 Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR, 'Y12, V12U12 in two surfaces (VU as one surface) with UV byte ordering, U/V\n' 'width = Y width, U/V height = Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR, 'Y12, V12U12 in two surfaces (VU as one surface) with UV byte ordering, U/V\n' 'width = 1/2 Y width, U/V height = 1/2 Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_VYUY_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY_ER, 'Extended Range Y, U, V in one surface, interleaved as YVYU in one channel.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_UYVY_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_ER, 'Extended Range Y, U, V in one surface, interleaved as YUYV in one channel.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YUYV_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_ER, 'Extended Range Y, U, V in one surface, interleaved as UYVY in one channel.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YVYU_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU_ER, 'Extended Range Y, U, V in one surface, interleaved as VYUY in one channel.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YUV_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV_ER, 'Extended Range Y, U, V three channels in one surface, interleaved as VUY.\n' 'Only pitch linear format supported.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YUVA_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA_ER, 'Extended Range Y, U, V, A four channels in one surface, interleaved as\n' 'AVUY.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_AYUV_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV_ER, 'Extended Range Y, U, V, A four channels in one surface, interleaved as\n' 'VUYA.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER, 'Extended Range Y, U, V in three surfaces, U/V width = Y width, U/V height =\n' 'Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER, 'Extended Range Y, U, V in three surfaces, U/V width = 1/2 Y width, U/V\n' 'height = Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER, 'Extended Range Y, U, V in three surfaces, U/V width = 1/2 Y width, U/V\n' 'height = 1/2 Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER, 'Extended Range Y, UV in two surfaces (UV as one surface) with VU byte\n' 'ordering, U/V width = Y width, U/V height = Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER, 'Extended Range Y, UV in two surfaces (UV as one surface) with VU byte\n' 'ordering, U/V width = 1/2 Y width, U/V height = Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER, 'Extended Range Y, UV in two surfaces (UV as one surface) with VU byte\n' 'ordering, U/V width = 1/2 Y width, U/V height = 1/2 Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER, 'Extended Range Y, V, U in three surfaces, U/V width = Y width, U/V height =\n' 'Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER, 'Extended Range Y, V, U in three surfaces, U/V width = 1/2 Y width, U/V\n' 'height = Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER, 'Extended Range Y, V, U in three surfaces, U/V width = 1/2 Y width, U/V\n' 'height = 1/2 Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER, 'Extended Range Y, VU in two surfaces (VU as one surface) with UV byte\n' 'ordering, U/V width = Y width, U/V height = Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER, 'Extended Range Y, VU in two surfaces (VU as one surface) with UV byte\n' 'ordering, U/V width = 1/2 Y width, U/V height = Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER, 'Extended Range Y, VU in two surfaces (VU as one surface) with UV byte\n' 'ordering, U/V width = 1/2 Y width, U/V height = 1/2 Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER_RGGB = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RGGB, 'Bayer format - one channel in one surface with interleaved RGGB ordering.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER_BGGR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BGGR, 'Bayer format - one channel in one surface with interleaved BGGR ordering.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER_GRBG = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GRBG, 'Bayer format - one channel in one surface with interleaved GRBG ordering.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER_GBRG = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GBRG, 'Bayer format - one channel in one surface with interleaved GBRG ordering.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER10_RGGB = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_RGGB, 'Bayer10 format - one channel in one surface with interleaved RGGB ordering.\n' 'Out of 16 bits, 10 bits used 6 bits No-op.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER10_BGGR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_BGGR, 'Bayer10 format - one channel in one surface with interleaved BGGR ordering.\n' 'Out of 16 bits, 10 bits used 6 bits No-op.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER10_GRBG = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GRBG, 'Bayer10 format - one channel in one surface with interleaved GRBG ordering.\n' 'Out of 16 bits, 10 bits used 6 bits No-op.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER10_GBRG = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GBRG, 'Bayer10 format - one channel in one surface with interleaved GBRG ordering.\n' 'Out of 16 bits, 10 bits used 6 bits No-op.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER12_RGGB = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RGGB, 'Bayer12 format - one channel in one surface with interleaved RGGB ordering.\n' 'Out of 16 bits, 12 bits used 4 bits No-op.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER12_BGGR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BGGR, 'Bayer12 format - one channel in one surface with interleaved BGGR ordering.\n' 'Out of 16 bits, 12 bits used 4 bits No-op.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER12_GRBG = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GRBG, 'Bayer12 format - one channel in one surface with interleaved GRBG ordering.\n' 'Out of 16 bits, 12 bits used 4 bits No-op.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER12_GBRG = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GBRG, 'Bayer12 format - one channel in one surface with interleaved GBRG ordering.\n' 'Out of 16 bits, 12 bits used 4 bits No-op.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER14_RGGB = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_RGGB, 'Bayer14 format - one channel in one surface with interleaved RGGB ordering.\n' 'Out of 16 bits, 14 bits used 2 bits No-op.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER14_BGGR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_BGGR, 'Bayer14 format - one channel in one surface with interleaved BGGR ordering.\n' 'Out of 16 bits, 14 bits used 2 bits No-op.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER14_GRBG = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GRBG, 'Bayer14 format - one channel in one surface with interleaved GRBG ordering.\n' 'Out of 16 bits, 14 bits used 2 bits No-op.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER14_GBRG = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GBRG, 'Bayer14 format - one channel in one surface with interleaved GBRG ordering.\n' 'Out of 16 bits, 14 bits used 2 bits No-op.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER20_RGGB = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_RGGB, 'Bayer20 format - one channel in one surface with interleaved RGGB ordering.\n' 'Out of 32 bits, 20 bits used 12 bits No-op.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER20_BGGR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_BGGR, 'Bayer20 format - one channel in one surface with interleaved BGGR ordering.\n' 'Out of 32 bits, 20 bits used 12 bits No-op.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER20_GRBG = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GRBG, 'Bayer20 format - one channel in one surface with interleaved GRBG ordering.\n' 'Out of 32 bits, 20 bits used 12 bits No-op.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER20_GBRG = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GBRG, 'Bayer20 format - one channel in one surface with interleaved GBRG ordering.\n' 'Out of 32 bits, 20 bits used 12 bits No-op.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YVU444_PLANAR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR, 'Y, V, U in three surfaces, each in a separate surface, U/V width = Y width,\n' 'U/V height = Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YVU422_PLANAR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR, 'Y, V, U in three surfaces, each in a separate surface, U/V width = 1/2 Y\n' 'width, U/V height = Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YVU420_PLANAR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR, 'Y, V, U in three surfaces, each in a separate surface, U/V width = 1/2 Y\n' 'width, U/V height = 1/2 Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB, 'Nvidia proprietary Bayer ISP format - one channel in one surface with\n' 'interleaved RGGB ordering and mapped to opaque integer datatype.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR, 'Nvidia proprietary Bayer ISP format - one channel in one surface with\n' 'interleaved BGGR ordering and mapped to opaque integer datatype.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG, 'Nvidia proprietary Bayer ISP format - one channel in one surface with\n' 'interleaved GRBG ordering and mapped to opaque integer datatype.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG, 'Nvidia proprietary Bayer ISP format - one channel in one surface with\n' 'interleaved GBRG ordering and mapped to opaque integer datatype.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER_BCCR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BCCR, 'Bayer format - one channel in one surface with interleaved BCCR ordering.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER_RCCB = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RCCB, 'Bayer format - one channel in one surface with interleaved RCCB ordering.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER_CRBC = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CRBC, 'Bayer format - one channel in one surface with interleaved CRBC ordering.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER_CBRC = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CBRC, 'Bayer format - one channel in one surface with interleaved CBRC ordering.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER10_CCCC = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_CCCC, 'Bayer10 format - one channel in one surface with interleaved CCCC ordering.\n' 'Out of 16 bits, 10 bits used 6 bits No-op.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER12_BCCR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BCCR, 'Bayer12 format - one channel in one surface with interleaved BCCR ordering.\n' 'Out of 16 bits, 12 bits used 4 bits No-op.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER12_RCCB = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RCCB, 'Bayer12 format - one channel in one surface with interleaved RCCB ordering.\n' 'Out of 16 bits, 12 bits used 4 bits No-op.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER12_CRBC = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CRBC, 'Bayer12 format - one channel in one surface with interleaved CRBC ordering.\n' 'Out of 16 bits, 12 bits used 4 bits No-op.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER12_CBRC = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CBRC, 'Bayer12 format - one channel in one surface with interleaved CBRC ordering.\n' 'Out of 16 bits, 12 bits used 4 bits No-op.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_BAYER12_CCCC = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CCCC, 'Bayer12 format - one channel in one surface with interleaved CCCC ordering.\n' 'Out of 16 bits, 12 bits used 4 bits No-op.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_Y = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y, 'Color format for single Y plane.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020 = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020, 'Y, UV in two surfaces (UV as one surface) U/V width = 1/2 Y width, U/V\n' 'height = 1/2 Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020 = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020, 'Y, VU in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V\n' 'height = 1/2 Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020 = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020, 'Y, U, V each in a separate surface, U/V width = 1/2 Y width, U/V height=\n' '1/2 Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020 = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020, 'Y, V, U each in a separate surface, U/V width = 1/2 Y width, U/V height =\n' '1/2 Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709 = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709, 'Y, UV in two surfaces (UV as one surface) U/V width = 1/2 Y width, U/V\n' 'height = 1/2 Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709 = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709, 'Y, VU in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V\n' 'height = 1/2 Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709 = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709, 'Y, U, V each in a separate surface, U/V width = 1/2 Y width, U/V height =\n' '1/2 Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709 = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709, 'Y, V, U each in a separate surface, U/V width = 1/2 Y width, U/V height =\n' '1/2 Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709, 'Y10, V10U10 in two surfaces (VU as one surface), U/V width = 1/2 Y width,\n' 'U/V height = 1/2 Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020, 'Y10, V10U10 in two surfaces (VU as one surface), U/V width = 1/2 Y width,\n' 'U/V height = 1/2 Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020, 'Y10, V10U10 in two surfaces(VU as one surface) U/V width = 1/2 Y width, U/V\n' 'height = Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR, 'Y10, V10U10 in two surfaces(VU as one surface) U/V width = 1/2 Y width, U/V\n' 'height = Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709 = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709, 'Y10, V10U10 in two surfaces(VU as one surface) U/V width = 1/2 Y width, U/V\n' 'height = Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_Y_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_ER, 'Extended Range Color format for single Y plane.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_Y_709_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_709_ER, 'Extended Range Color format for single Y plane.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_Y10_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_ER, 'Extended Range Color format for single Y10 plane.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_Y10_709_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_709_ER, 'Extended Range Color format for single Y10 plane.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_Y12_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_ER, 'Extended Range Color format for single Y12 plane.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_Y12_709_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_709_ER, 'Extended Range Color format for single Y12 plane.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YUVA = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA, 'Y, U, V, A four channels in one surface, interleaved as AVUY.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YUV = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV, 'Y, U, V three channels in one surface, interleaved as VUY. Only pitch\n' 'linear format supported.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_YVYU = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU, 'Y, U, V in one surface, interleaved as YVYU in one channel.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_VYUY = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY, 'Y, U, V in one surface, interleaved as VYUY in one channel.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER, 'Extended Range Y10, V10U10 in two surfaces(VU as one surface) U/V width =\n' '1/2 Y width, U/V height = 1/2 Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER, 'Extended Range Y10, V10U10 in two surfaces(VU as one surface) U/V width =\n' '1/2 Y width, U/V height = 1/2 Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER, 'Extended Range Y10, V10U10 in two surfaces (VU as one surface) U/V width =\n' 'Y width, U/V height = Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER, 'Extended Range Y10, V10U10 in two surfaces (VU as one surface) U/V width =\n' 'Y width, U/V height = Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER, 'Extended Range Y12, V12U12 in two surfaces (VU as one surface) U/V width =\n' '1/2 Y width, U/V height = 1/2 Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER, 'Extended Range Y12, V12U12 in two surfaces (VU as one surface) U/V width =\n' '1/2 Y width, U/V height = 1/2 Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER, 'Extended Range Y12, V12U12 in two surfaces (VU as one surface) U/V width =\n' 'Y width, U/V height = Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER, 'Extended Range Y12, V12U12 in two surfaces (VU as one surface) U/V width =\n' 'Y width, U/V height = Y height.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_UYVY_709 = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_709, 'Y, U, V in one surface, interleaved as UYVY in one channel.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_UYVY_709_ER = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_709_ER, 'Extended Range Y, U, V in one surface, interleaved as UYVY in one channel.\n' - ){{endif}} - {{if True}} + ) + CU_EGL_COLOR_FORMAT_UYVY_2020 = ( cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_2020, 'Y, U, V in one surface, interleaved as UYVY in one channel.\n' - ){{endif}} - {{if True}} - CU_EGL_COLOR_FORMAT_MAX = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_MAX{{endif}} + ) -{{endif}} -{{if True}} + CU_EGL_COLOR_FORMAT_MAX = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_MAX class CUGLDeviceList(_FastEnum): """ CUDA devices corresponding to an OpenGL device """ - {{if True}} + CU_GL_DEVICE_LIST_ALL = ( cydriver.CUGLDeviceList_enum.CU_GL_DEVICE_LIST_ALL, 'The CUDA devices for all GPUs used by the current OpenGL context\n' - ){{endif}} - {{if True}} + ) + CU_GL_DEVICE_LIST_CURRENT_FRAME = ( cydriver.CUGLDeviceList_enum.CU_GL_DEVICE_LIST_CURRENT_FRAME, 'The CUDA devices for the GPUs used by the current OpenGL context in its\n' 'currently rendering frame\n' - ){{endif}} - {{if True}} + ) + CU_GL_DEVICE_LIST_NEXT_FRAME = ( cydriver.CUGLDeviceList_enum.CU_GL_DEVICE_LIST_NEXT_FRAME, 'The CUDA devices for the GPUs to be used by the current OpenGL context in\n' 'the next frame\n' - ){{endif}} - -{{endif}} -{{if True}} + ) class CUGLmap_flags(_FastEnum): """ Flags to map or unmap a resource """ - {{if True}} - CU_GL_MAP_RESOURCE_FLAGS_NONE = cydriver.CUGLmap_flags_enum.CU_GL_MAP_RESOURCE_FLAGS_NONE{{endif}} - {{if True}} - CU_GL_MAP_RESOURCE_FLAGS_READ_ONLY = cydriver.CUGLmap_flags_enum.CU_GL_MAP_RESOURCE_FLAGS_READ_ONLY{{endif}} - {{if True}} - CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD = cydriver.CUGLmap_flags_enum.CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD{{endif}} -{{endif}} + CU_GL_MAP_RESOURCE_FLAGS_NONE = cydriver.CUGLmap_flags_enum.CU_GL_MAP_RESOURCE_FLAGS_NONE -cdef object _CUresult = CUresult -cdef object _CUresult_SUCCESS = CUresult.CUDA_SUCCESS + CU_GL_MAP_RESOURCE_FLAGS_READ_ONLY = cydriver.CUGLmap_flags_enum.CU_GL_MAP_RESOURCE_FLAGS_READ_ONLY + CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD = cydriver.CUGLmap_flags_enum.CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD - -{{if 'CUdeviceptr' in found_types}} +cdef object _CUresult = CUresult +cdef object _CUresult_SUCCESS = CUresult.CUDA_SUCCESS cdef class CUdeviceptr: """ @@ -8018,9 +7782,6 @@ cdef class CUdeviceptr: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUdevice' in found_types}} cdef class CUdevice: """ @@ -8048,9 +7809,6 @@ cdef class CUdevice: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUtexObject' in found_types}} cdef class CUtexObject: """ @@ -8078,9 +7836,6 @@ cdef class CUtexObject: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUsurfObject' in found_types}} cdef class CUsurfObject: """ @@ -8108,9 +7863,6 @@ cdef class CUsurfObject: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUgraphConditionalHandle' in found_types}} cdef class CUgraphConditionalHandle: """ @@ -8136,305 +7888,53 @@ cdef class CUgraphConditionalHandle: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUlaunchAttributeID_enum' in found_types}} class CUkernelNodeAttrID(_FastEnum): """ Launch attributes enum; used as id field of :py:obj:`~.CUlaunchAttribute` """ - {{if 'CU_LAUNCH_ATTRIBUTE_IGNORE' in found_values}} - - CU_LAUNCH_ATTRIBUTE_IGNORE = ( - cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_IGNORE, - 'Ignored entry, for convenient composition\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW' in found_values}} - - CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW = ( - cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW, - 'Valid for streams, graph nodes, launches. See\n' - ':py:obj:`~.CUlaunchAttributeValue.accessPolicyWindow`.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_COOPERATIVE' in found_values}} - - CU_LAUNCH_ATTRIBUTE_COOPERATIVE = ( - cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_COOPERATIVE, - 'Valid for graph nodes, launches. See\n' - ':py:obj:`~.CUlaunchAttributeValue.cooperative`.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY' in found_values}} - - CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY = ( - cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY, - 'Valid for streams. See :py:obj:`~.CUlaunchAttributeValue.syncPolicy`.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION' in found_values}} - - CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION = ( - cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION, - 'Valid for graph nodes, launches. See\n' - ':py:obj:`~.CUlaunchAttributeValue.clusterDim`.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE' in found_values}} - - CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE = ( - cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE, - 'Valid for graph nodes, launches. See\n' - ':py:obj:`~.CUlaunchAttributeValue.clusterSchedulingPolicyPreference`.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION' in found_values}} - - CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION = ( - cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION, - 'Valid for launches. Setting\n' - ':py:obj:`~.CUlaunchAttributeValue.programmaticStreamSerializationAllowed`\n' - 'to non-0 signals that the kernel will use programmatic means to resolve its\n' - 'stream dependency, so that the CUDA runtime should opportunistically allow\n' - "the grid's execution to overlap with the previous kernel in the stream, if\n" - 'that kernel requests the overlap. The dependent launches can choose to wait\n' - 'on the dependency using the programmatic sync\n' - '(cudaGridDependencySynchronize() or equivalent PTX instructions).\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT' in found_values}} - - CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT = ( - cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT, - 'Valid for launches. Set\n' - ':py:obj:`~.CUlaunchAttributeValue.programmaticEvent` to record the event.\n' - 'Event recorded through this launch attribute is guaranteed to only trigger\n' - 'after all block in the associated kernel trigger the event. A block can\n' - 'trigger the event through PTX launchdep.release or CUDA builtin function\n' - 'cudaTriggerProgrammaticLaunchCompletion(). A trigger can also be inserted\n' - "at the beginning of each block's execution if triggerAtBlockStart is set to\n" - 'non-0. The dependent launches can choose to wait on the dependency using\n' - 'the programmatic sync (cudaGridDependencySynchronize() or equivalent PTX\n' - 'instructions). Note that dependents (including the CPU thread calling\n' - ':py:obj:`~.cuEventSynchronize()`) are not guaranteed to observe the release\n' - 'precisely when it is released. For example,\n' - ':py:obj:`~.cuEventSynchronize()` may only observe the event trigger long\n' - 'after the associated kernel has completed. This recording type is primarily\n' - 'meant for establishing programmatic dependency between device tasks. Note\n' - 'also this type of dependency allows, but does not guarantee, concurrent\n' - 'execution of tasks.\n' - ' The event supplied must not be an interprocess or interop event. The event\n' - 'must disable timing (i.e. must be created with the\n' - ':py:obj:`~.CU_EVENT_DISABLE_TIMING` flag set).\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_PRIORITY' in found_values}} - - CU_LAUNCH_ATTRIBUTE_PRIORITY = ( - cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PRIORITY, - 'Valid for streams, graph nodes, launches. See\n' - ':py:obj:`~.CUlaunchAttributeValue.priority`.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP' in found_values}} - - CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP = ( - cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP, - 'Valid for streams, graph nodes, launches. See\n' - ':py:obj:`~.CUlaunchAttributeValue.memSyncDomainMap`.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN' in found_values}} - - CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN = ( - cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN, - 'Valid for streams, graph nodes, launches. See\n' - ':py:obj:`~.CUlaunchAttributeValue.memSyncDomain`.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION' in found_values}} - - CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION = ( - cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION, - 'Valid for graph nodes, launches. Set\n' - ':py:obj:`~.CUlaunchAttributeValue.preferredClusterDim` to allow the kernel\n' - 'launch to specify a preferred substitute cluster dimension. Blocks may be\n' - 'grouped according to either the dimensions specified with this attribute\n' - '(grouped into a "preferred substitute cluster"), or the one specified with\n' - ':py:obj:`~.CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION` attribute (grouped into a\n' - '"regular cluster"). The cluster dimensions of a "preferred substitute\n' - 'cluster" shall be an integer multiple greater than zero of the regular\n' - 'cluster dimensions. The device will attempt - on a best-effort basis - to\n' - 'group thread blocks into preferred clusters over grouping them into regular\n' - 'clusters. When it deems necessary (primarily when the device temporarily\n' - 'runs out of physical resources to launch the larger preferred clusters),\n' - 'the device may switch to launch the regular clusters instead to attempt to\n' - 'utilize as much of the physical device resources as possible.\n' - ' Each type of cluster will have its enumeration / coordinate setup as if\n' - 'the grid consists solely of its type of cluster. For example, if the\n' - 'preferred substitute cluster dimensions double the regular cluster\n' - 'dimensions, there might be simultaneously a regular cluster indexed at\n' - '(1,0,0), and a preferred cluster indexed at (1,0,0). In this example, the\n' - 'preferred substitute cluster (1,0,0) replaces regular clusters (2,0,0) and\n' - '(3,0,0) and groups their blocks.\n' - ' This attribute will only take effect when a regular cluster dimension has\n' - 'been specified. The preferred substitute cluster dimension must be an\n' - 'integer multiple greater than zero of the regular cluster dimension and\n' - 'must divide the grid. It must also be no more than `maxBlocksPerCluster`,\n' - "if it is set in the kernel's `__launch_bounds__`. Otherwise it must be less\n" - 'than the maximum value the driver can support. Otherwise, setting this\n' - 'attribute to a value physically unable to fit on any particular device is\n' - 'permitted.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT' in found_values}} - - CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT = ( - cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT, - 'Valid for launches. Set\n' - ':py:obj:`~.CUlaunchAttributeValue.launchCompletionEvent` to record the\n' - 'event.\n' - ' Nominally, the event is triggered once all blocks of the kernel have begun\n' - 'execution. Currently this is a best effort. If a kernel B has a launch\n' - 'completion dependency on a kernel A, B may wait until A is complete.\n' - 'Alternatively, blocks of B may begin before all blocks of A have begun, for\n' - 'example if B can claim execution resources unavailable to A (e.g. they run\n' - 'on different GPUs) or if B is a higher priority than A. Exercise caution if\n' - 'such an ordering inversion could lead to deadlock.\n' - ' A launch completion event is nominally similar to a programmatic event\n' - 'with `triggerAtBlockStart` set except that it is not visible to\n' - '`cudaGridDependencySynchronize()` and can be used with compute capability\n' - 'less than 9.0.\n' - ' The event supplied must not be an interprocess or interop event. The event\n' - 'must disable timing (i.e. must be created with the\n' - ':py:obj:`~.CU_EVENT_DISABLE_TIMING` flag set).\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE' in found_values}} - - CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE = ( - cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE, - 'Valid for graph nodes, launches. This attribute is graphs-only, and passing\n' - 'it to a launch in a non-capturing stream will result in an error.\n' - ':py:obj:`~.CUlaunchAttributeValue`::deviceUpdatableKernelNode::deviceUpdatable\n' - 'can only be set to 0 or 1. Setting the field to 1 indicates that the\n' - 'corresponding kernel node should be device-updatable. On success, a handle\n' - 'will be returned via\n' - ':py:obj:`~.CUlaunchAttributeValue`::deviceUpdatableKernelNode::devNode\n' - 'which can be passed to the various device-side update functions to update\n' - "the node's kernel parameters from within another kernel. For more\n" - 'information on the types of device updates that can be made, as well as the\n' - 'relevant limitations thereof, see\n' - ':py:obj:`~.cudaGraphKernelNodeUpdatesApply`.\n' - ' Nodes which are device-updatable have additional restrictions compared to\n' - 'regular kernel nodes. Firstly, device-updatable nodes cannot be removed\n' - 'from their graph via :py:obj:`~.cuGraphDestroyNode`. Additionally, once\n' - 'opted-in to this functionality, a node cannot opt out, and any attempt to\n' - 'set the deviceUpdatable attribute to 0 will result in an error. Device-\n' - 'updatable kernel nodes also cannot have their attributes copied to/from\n' - 'another kernel node via :py:obj:`~.cuGraphKernelNodeCopyAttributes`. Graphs\n' - 'containing one or more device-updatable nodes also do not allow multiple\n' - 'instantiation, and neither the graph nor its instantiated version can be\n' - 'passed to :py:obj:`~.cuGraphExecUpdate`.\n' - ' If a graph contains device-updatable nodes and updates those nodes from\n' - 'the device from within the graph, the graph must be uploaded with\n' - ':py:obj:`~.cuGraphUpload` before it is launched. For such a graph, if host-\n' - 'side executable graph updates are made to the device-updatable nodes, the\n' - 'graph must be uploaded before it is launched again.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT' in found_values}} - CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT = ( - cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT, - 'Valid for launches. On devices where the L1 cache and shared memory use the\n' - 'same hardware resources, setting\n' - ':py:obj:`~.CUlaunchAttributeValue.sharedMemCarveout` to a percentage\n' - 'between 0-100 signals the CUDA driver to set the shared memory carveout\n' - 'preference, in percent of the total shared memory for that kernel launch.\n' - 'This attribute takes precedence over\n' - ':py:obj:`~.CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT`. This is\n' - 'only a hint, and the CUDA driver can choose a different configuration if\n' - 'required for the launch.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING' in found_values}} - - CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING = ( - cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING, - 'Valid for streams, graph nodes, launches. This attribute is a hint to the\n' - 'CUDA runtime that the launch should attempt to make the kernel maximize its\n' - 'NVLINK utilization.\n' - ' When possible to honor this hint, CUDA will assume each block in the grid\n' - 'launch will carry out an even amount of NVLINK traffic, and make a best-\n' - 'effort attempt to adjust the kernel launch based on that assumption.\n' - ' This attribute is a hint only. CUDA makes no functional or performance\n' - 'guarantee. Its applicability can be affected by many different factors,\n' - "including driver version (i.e. CUDA doesn't guarantee the performance\n" - 'characteristics will be maintained between driver versions or a driver\n' - 'update could alter or regress previously observed perf characteristics.) It\n' - "also doesn't guarantee a successful result, i.e. applying the attribute may\n" - 'not improve the performance of either the targeted kernel or the\n' - 'encapsulating application.\n' - ' Valid values for\n' - ':py:obj:`~.CUlaunchAttributeValue`::nvlinkUtilCentricScheduling are 0\n' - '(disabled) and 1 (enabled).\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE' in found_values}} - - CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE = ( - cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE, - 'Valid for graph nodes, launches. This controls whether the kernel launch is\n' - 'allowed to use a non-portable cluster size. Valid values for\n' - ':py:obj:`~.CUlaunchAttributeValue.portableClusterSizeMode` are described in\n' - ':py:obj:`~.CUlaunchAttributePortableClusterMode`. Any other value will\n' - 'return :py:obj:`~.CUDA_ERROR_INVALID_VALUE`\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE' in found_values}} - - CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE = ( - cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE, - 'Valid for graph nodes, launches. This indicates if the kernel is allowed to\n' - 'use a non-portable dynamic shared memory mode.\n' - ){{endif}} - -{{endif}} -{{if 'CUlaunchAttributeID_enum' in found_types}} - -class CUstreamAttrID(_FastEnum): - """ - Launch attributes enum; used as id field of - :py:obj:`~.CUlaunchAttribute` - """ - {{if 'CU_LAUNCH_ATTRIBUTE_IGNORE' in found_values}} CU_LAUNCH_ATTRIBUTE_IGNORE = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_IGNORE, 'Ignored entry, for convenient composition\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW, 'Valid for streams, graph nodes, launches. See\n' ':py:obj:`~.CUlaunchAttributeValue.accessPolicyWindow`.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_COOPERATIVE' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_COOPERATIVE = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_COOPERATIVE, 'Valid for graph nodes, launches. See\n' ':py:obj:`~.CUlaunchAttributeValue.cooperative`.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY, 'Valid for streams. See :py:obj:`~.CUlaunchAttributeValue.syncPolicy`.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION, 'Valid for graph nodes, launches. See\n' ':py:obj:`~.CUlaunchAttributeValue.clusterDim`.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE, 'Valid for graph nodes, launches. See\n' ':py:obj:`~.CUlaunchAttributeValue.clusterSchedulingPolicyPreference`.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION, @@ -8446,8 +7946,8 @@ class CUstreamAttrID(_FastEnum): 'that kernel requests the overlap. The dependent launches can choose to wait\n' 'on the dependency using the programmatic sync\n' '(cudaGridDependencySynchronize() or equivalent PTX instructions).\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT, @@ -8471,29 +7971,29 @@ class CUstreamAttrID(_FastEnum): ' The event supplied must not be an interprocess or interop event. The event\n' 'must disable timing (i.e. must be created with the\n' ':py:obj:`~.CU_EVENT_DISABLE_TIMING` flag set).\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_PRIORITY' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_PRIORITY = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PRIORITY, 'Valid for streams, graph nodes, launches. See\n' ':py:obj:`~.CUlaunchAttributeValue.priority`.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP, 'Valid for streams, graph nodes, launches. See\n' ':py:obj:`~.CUlaunchAttributeValue.memSyncDomainMap`.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN, 'Valid for streams, graph nodes, launches. See\n' ':py:obj:`~.CUlaunchAttributeValue.memSyncDomain`.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION, @@ -8526,8 +8026,8 @@ class CUstreamAttrID(_FastEnum): 'than the maximum value the driver can support. Otherwise, setting this\n' 'attribute to a value physically unable to fit on any particular device is\n' 'permitted.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT, @@ -8548,23 +8048,22 @@ class CUstreamAttrID(_FastEnum): ' The event supplied must not be an interprocess or interop event. The event\n' 'must disable timing (i.e. must be created with the\n' ':py:obj:`~.CU_EVENT_DISABLE_TIMING` flag set).\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE, 'Valid for graph nodes, launches. This attribute is graphs-only, and passing\n' 'it to a launch in a non-capturing stream will result in an error.\n' - ':py:obj:`~.CUlaunchAttributeValue`::deviceUpdatableKernelNode::deviceUpdatable\n' + ':py:obj:`~.CUlaunchAttributeValue.deviceUpdatableKernelNode.deviceUpdatable`\n' 'can only be set to 0 or 1. Setting the field to 1 indicates that the\n' 'corresponding kernel node should be device-updatable. On success, a handle\n' 'will be returned via\n' - ':py:obj:`~.CUlaunchAttributeValue`::deviceUpdatableKernelNode::devNode\n' - 'which can be passed to the various device-side update functions to update\n' - "the node's kernel parameters from within another kernel. For more\n" - 'information on the types of device updates that can be made, as well as the\n' - 'relevant limitations thereof, see\n' - ':py:obj:`~.cudaGraphKernelNodeUpdatesApply`.\n' + ':py:obj:`~.CUlaunchAttributeValue.deviceUpdatableKernelNode.devNode` which\n' + 'can be passed to the various device-side update functions to update the\n' + "node's kernel parameters from within another kernel. For more information\n" + 'on the types of device updates that can be made, as well as the relevant\n' + 'limitations thereof, see :py:obj:`~.cudaGraphKernelNodeUpdatesApply`.\n' ' Nodes which are device-updatable have additional restrictions compared to\n' 'regular kernel nodes. Firstly, device-updatable nodes cannot be removed\n' 'from their graph via :py:obj:`~.cuGraphDestroyNode`. Additionally, once\n' @@ -8580,8 +8079,8 @@ class CUstreamAttrID(_FastEnum): ':py:obj:`~.cuGraphUpload` before it is launched. For such a graph, if host-\n' 'side executable graph updates are made to the device-updatable nodes, the\n' 'graph must be uploaded before it is launched again.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT, @@ -8594,8 +8093,8 @@ class CUstreamAttrID(_FastEnum): ':py:obj:`~.CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT`. This is\n' 'only a hint, and the CUDA driver can choose a different configuration if\n' 'required for the launch.\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING, @@ -8614,10 +8113,10 @@ class CUstreamAttrID(_FastEnum): 'not improve the performance of either the targeted kernel or the\n' 'encapsulating application.\n' ' Valid values for\n' - ':py:obj:`~.CUlaunchAttributeValue`::nvlinkUtilCentricScheduling are 0\n' + ':py:obj:`~.CUlaunchAttributeValue.nvlinkUtilCentricScheduling` are 0\n' '(disabled) and 1 (enabled).\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE, @@ -8626,17 +8125,259 @@ class CUstreamAttrID(_FastEnum): ':py:obj:`~.CUlaunchAttributeValue.portableClusterSizeMode` are described in\n' ':py:obj:`~.CUlaunchAttributePortableClusterMode`. Any other value will\n' 'return :py:obj:`~.CUDA_ERROR_INVALID_VALUE`\n' - ){{endif}} - {{if 'CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE' in found_values}} + ) + CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE, 'Valid for graph nodes, launches. This indicates if the kernel is allowed to\n' 'use a non-portable dynamic shared memory mode.\n' - ){{endif}} + ) + +class CUstreamAttrID(_FastEnum): + """ + Launch attributes enum; used as id field of + :py:obj:`~.CUlaunchAttribute` + """ + + + CU_LAUNCH_ATTRIBUTE_IGNORE = ( + cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_IGNORE, + 'Ignored entry, for convenient composition\n' + ) + + + CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW = ( + cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW, + 'Valid for streams, graph nodes, launches. See\n' + ':py:obj:`~.CUlaunchAttributeValue.accessPolicyWindow`.\n' + ) + + + CU_LAUNCH_ATTRIBUTE_COOPERATIVE = ( + cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_COOPERATIVE, + 'Valid for graph nodes, launches. See\n' + ':py:obj:`~.CUlaunchAttributeValue.cooperative`.\n' + ) + + + CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY = ( + cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY, + 'Valid for streams. See :py:obj:`~.CUlaunchAttributeValue.syncPolicy`.\n' + ) + + + CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION = ( + cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION, + 'Valid for graph nodes, launches. See\n' + ':py:obj:`~.CUlaunchAttributeValue.clusterDim`.\n' + ) + + + CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE = ( + cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE, + 'Valid for graph nodes, launches. See\n' + ':py:obj:`~.CUlaunchAttributeValue.clusterSchedulingPolicyPreference`.\n' + ) + + + CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION = ( + cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION, + 'Valid for launches. Setting\n' + ':py:obj:`~.CUlaunchAttributeValue.programmaticStreamSerializationAllowed`\n' + 'to non-0 signals that the kernel will use programmatic means to resolve its\n' + 'stream dependency, so that the CUDA runtime should opportunistically allow\n' + "the grid's execution to overlap with the previous kernel in the stream, if\n" + 'that kernel requests the overlap. The dependent launches can choose to wait\n' + 'on the dependency using the programmatic sync\n' + '(cudaGridDependencySynchronize() or equivalent PTX instructions).\n' + ) + + + CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT = ( + cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT, + 'Valid for launches. Set\n' + ':py:obj:`~.CUlaunchAttributeValue.programmaticEvent` to record the event.\n' + 'Event recorded through this launch attribute is guaranteed to only trigger\n' + 'after all block in the associated kernel trigger the event. A block can\n' + 'trigger the event through PTX launchdep.release or CUDA builtin function\n' + 'cudaTriggerProgrammaticLaunchCompletion(). A trigger can also be inserted\n' + "at the beginning of each block's execution if triggerAtBlockStart is set to\n" + 'non-0. The dependent launches can choose to wait on the dependency using\n' + 'the programmatic sync (cudaGridDependencySynchronize() or equivalent PTX\n' + 'instructions). Note that dependents (including the CPU thread calling\n' + ':py:obj:`~.cuEventSynchronize()`) are not guaranteed to observe the release\n' + 'precisely when it is released. For example,\n' + ':py:obj:`~.cuEventSynchronize()` may only observe the event trigger long\n' + 'after the associated kernel has completed. This recording type is primarily\n' + 'meant for establishing programmatic dependency between device tasks. Note\n' + 'also this type of dependency allows, but does not guarantee, concurrent\n' + 'execution of tasks.\n' + ' The event supplied must not be an interprocess or interop event. The event\n' + 'must disable timing (i.e. must be created with the\n' + ':py:obj:`~.CU_EVENT_DISABLE_TIMING` flag set).\n' + ) + + + CU_LAUNCH_ATTRIBUTE_PRIORITY = ( + cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PRIORITY, + 'Valid for streams, graph nodes, launches. See\n' + ':py:obj:`~.CUlaunchAttributeValue.priority`.\n' + ) + + + CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP = ( + cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP, + 'Valid for streams, graph nodes, launches. See\n' + ':py:obj:`~.CUlaunchAttributeValue.memSyncDomainMap`.\n' + ) + + + CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN = ( + cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN, + 'Valid for streams, graph nodes, launches. See\n' + ':py:obj:`~.CUlaunchAttributeValue.memSyncDomain`.\n' + ) + + + CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION = ( + cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION, + 'Valid for graph nodes, launches. Set\n' + ':py:obj:`~.CUlaunchAttributeValue.preferredClusterDim` to allow the kernel\n' + 'launch to specify a preferred substitute cluster dimension. Blocks may be\n' + 'grouped according to either the dimensions specified with this attribute\n' + '(grouped into a "preferred substitute cluster"), or the one specified with\n' + ':py:obj:`~.CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION` attribute (grouped into a\n' + '"regular cluster"). The cluster dimensions of a "preferred substitute\n' + 'cluster" shall be an integer multiple greater than zero of the regular\n' + 'cluster dimensions. The device will attempt - on a best-effort basis - to\n' + 'group thread blocks into preferred clusters over grouping them into regular\n' + 'clusters. When it deems necessary (primarily when the device temporarily\n' + 'runs out of physical resources to launch the larger preferred clusters),\n' + 'the device may switch to launch the regular clusters instead to attempt to\n' + 'utilize as much of the physical device resources as possible.\n' + ' Each type of cluster will have its enumeration / coordinate setup as if\n' + 'the grid consists solely of its type of cluster. For example, if the\n' + 'preferred substitute cluster dimensions double the regular cluster\n' + 'dimensions, there might be simultaneously a regular cluster indexed at\n' + '(1,0,0), and a preferred cluster indexed at (1,0,0). In this example, the\n' + 'preferred substitute cluster (1,0,0) replaces regular clusters (2,0,0) and\n' + '(3,0,0) and groups their blocks.\n' + ' This attribute will only take effect when a regular cluster dimension has\n' + 'been specified. The preferred substitute cluster dimension must be an\n' + 'integer multiple greater than zero of the regular cluster dimension and\n' + 'must divide the grid. It must also be no more than `maxBlocksPerCluster`,\n' + "if it is set in the kernel's `__launch_bounds__`. Otherwise it must be less\n" + 'than the maximum value the driver can support. Otherwise, setting this\n' + 'attribute to a value physically unable to fit on any particular device is\n' + 'permitted.\n' + ) + + + CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT = ( + cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT, + 'Valid for launches. Set\n' + ':py:obj:`~.CUlaunchAttributeValue.launchCompletionEvent` to record the\n' + 'event.\n' + ' Nominally, the event is triggered once all blocks of the kernel have begun\n' + 'execution. Currently this is a best effort. If a kernel B has a launch\n' + 'completion dependency on a kernel A, B may wait until A is complete.\n' + 'Alternatively, blocks of B may begin before all blocks of A have begun, for\n' + 'example if B can claim execution resources unavailable to A (e.g. they run\n' + 'on different GPUs) or if B is a higher priority than A. Exercise caution if\n' + 'such an ordering inversion could lead to deadlock.\n' + ' A launch completion event is nominally similar to a programmatic event\n' + 'with `triggerAtBlockStart` set except that it is not visible to\n' + '`cudaGridDependencySynchronize()` and can be used with compute capability\n' + 'less than 9.0.\n' + ' The event supplied must not be an interprocess or interop event. The event\n' + 'must disable timing (i.e. must be created with the\n' + ':py:obj:`~.CU_EVENT_DISABLE_TIMING` flag set).\n' + ) + + + CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE = ( + cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE, + 'Valid for graph nodes, launches. This attribute is graphs-only, and passing\n' + 'it to a launch in a non-capturing stream will result in an error.\n' + ':py:obj:`~.CUlaunchAttributeValue.deviceUpdatableKernelNode.deviceUpdatable`\n' + 'can only be set to 0 or 1. Setting the field to 1 indicates that the\n' + 'corresponding kernel node should be device-updatable. On success, a handle\n' + 'will be returned via\n' + ':py:obj:`~.CUlaunchAttributeValue.deviceUpdatableKernelNode.devNode` which\n' + 'can be passed to the various device-side update functions to update the\n' + "node's kernel parameters from within another kernel. For more information\n" + 'on the types of device updates that can be made, as well as the relevant\n' + 'limitations thereof, see :py:obj:`~.cudaGraphKernelNodeUpdatesApply`.\n' + ' Nodes which are device-updatable have additional restrictions compared to\n' + 'regular kernel nodes. Firstly, device-updatable nodes cannot be removed\n' + 'from their graph via :py:obj:`~.cuGraphDestroyNode`. Additionally, once\n' + 'opted-in to this functionality, a node cannot opt out, and any attempt to\n' + 'set the deviceUpdatable attribute to 0 will result in an error. Device-\n' + 'updatable kernel nodes also cannot have their attributes copied to/from\n' + 'another kernel node via :py:obj:`~.cuGraphKernelNodeCopyAttributes`. Graphs\n' + 'containing one or more device-updatable nodes also do not allow multiple\n' + 'instantiation, and neither the graph nor its instantiated version can be\n' + 'passed to :py:obj:`~.cuGraphExecUpdate`.\n' + ' If a graph contains device-updatable nodes and updates those nodes from\n' + 'the device from within the graph, the graph must be uploaded with\n' + ':py:obj:`~.cuGraphUpload` before it is launched. For such a graph, if host-\n' + 'side executable graph updates are made to the device-updatable nodes, the\n' + 'graph must be uploaded before it is launched again.\n' + ) + + + CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT = ( + cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT, + 'Valid for launches. On devices where the L1 cache and shared memory use the\n' + 'same hardware resources, setting\n' + ':py:obj:`~.CUlaunchAttributeValue.sharedMemCarveout` to a percentage\n' + 'between 0-100 signals the CUDA driver to set the shared memory carveout\n' + 'preference, in percent of the total shared memory for that kernel launch.\n' + 'This attribute takes precedence over\n' + ':py:obj:`~.CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT`. This is\n' + 'only a hint, and the CUDA driver can choose a different configuration if\n' + 'required for the launch.\n' + ) -{{endif}} -{{if 'CUmemGenericAllocationHandle' in found_types}} + + CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING = ( + cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING, + 'Valid for streams, graph nodes, launches. This attribute is a hint to the\n' + 'CUDA runtime that the launch should attempt to make the kernel maximize its\n' + 'NVLINK utilization.\n' + ' When possible to honor this hint, CUDA will assume each block in the grid\n' + 'launch will carry out an even amount of NVLINK traffic, and make a best-\n' + 'effort attempt to adjust the kernel launch based on that assumption.\n' + ' This attribute is a hint only. CUDA makes no functional or performance\n' + 'guarantee. Its applicability can be affected by many different factors,\n' + "including driver version (i.e. CUDA doesn't guarantee the performance\n" + 'characteristics will be maintained between driver versions or a driver\n' + 'update could alter or regress previously observed perf characteristics.) It\n' + "also doesn't guarantee a successful result, i.e. applying the attribute may\n" + 'not improve the performance of either the targeted kernel or the\n' + 'encapsulating application.\n' + ' Valid values for\n' + ':py:obj:`~.CUlaunchAttributeValue.nvlinkUtilCentricScheduling` are 0\n' + '(disabled) and 1 (enabled).\n' + ) + + + CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE = ( + cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE, + 'Valid for graph nodes, launches. This controls whether the kernel launch is\n' + 'allowed to use a non-portable cluster size. Valid values for\n' + ':py:obj:`~.CUlaunchAttributeValue.portableClusterSizeMode` are described in\n' + ':py:obj:`~.CUlaunchAttributePortableClusterMode`. Any other value will\n' + 'return :py:obj:`~.CUDA_ERROR_INVALID_VALUE`\n' + ) + + + CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE = ( + cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE, + 'Valid for graph nodes, launches. This indicates if the kernel is allowed to\n' + 'use a non-portable dynamic shared memory mode.\n' + ) cdef class CUmemGenericAllocationHandle: """ @@ -8662,9 +8403,31 @@ cdef class CUmemGenericAllocationHandle: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} -{{if 'CUcontext' in found_types}} +cdef class CUlogicalEndpointId: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, uint32_t 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 cdef class CUcontext: """ @@ -8699,9 +8462,6 @@ cdef class CUcontext: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUmodule' in found_types}} cdef class CUmodule: """ @@ -8736,9 +8496,6 @@ cdef class CUmodule: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUfunction' in found_types}} cdef class CUfunction: """ @@ -8773,9 +8530,6 @@ cdef class CUfunction: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUlibrary' in found_types}} cdef class CUlibrary: """ @@ -8810,9 +8564,6 @@ cdef class CUlibrary: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUkernel' in found_types}} cdef class CUkernel: """ @@ -8847,9 +8598,6 @@ cdef class CUkernel: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUarray' in found_types}} cdef class CUarray: """ @@ -8884,9 +8632,6 @@ cdef class CUarray: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUmipmappedArray' in found_types}} cdef class CUmipmappedArray: """ @@ -8921,9 +8666,6 @@ cdef class CUmipmappedArray: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUtexref' in found_types}} cdef class CUtexref: """ @@ -8958,9 +8700,6 @@ cdef class CUtexref: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUsurfref' in found_types}} cdef class CUsurfref: """ @@ -8995,9 +8734,6 @@ cdef class CUsurfref: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUevent' in found_types}} cdef class CUevent: """ @@ -9032,9 +8768,6 @@ cdef class CUevent: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUstream' in found_types}} cdef class CUstream: """ @@ -9071,10 +8804,6 @@ cdef class CUstream: return self._pvt_ptr def __cuda_stream__(self): return (0, (self._pvt_ptr[0])) -{{endif}} - - -{{if 'CUgraphicsResource' in found_types}} cdef class CUgraphicsResource: """ @@ -9109,9 +8838,6 @@ cdef class CUgraphicsResource: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUexternalMemory' in found_types}} cdef class CUexternalMemory: """ @@ -9146,9 +8872,6 @@ cdef class CUexternalMemory: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUexternalSemaphore' in found_types}} cdef class CUexternalSemaphore: """ @@ -9183,9 +8906,6 @@ cdef class CUexternalSemaphore: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUgraph' in found_types}} cdef class CUgraph: """ @@ -9220,9 +8940,6 @@ cdef class CUgraph: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUgraphNode' in found_types}} cdef class CUgraphNode: """ @@ -9257,9 +8974,6 @@ cdef class CUgraphNode: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUgraphExec' in found_types}} cdef class CUgraphExec: """ @@ -9294,9 +9008,6 @@ cdef class CUgraphExec: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUmemoryPool' in found_types}} cdef class CUmemoryPool: """ @@ -9331,9 +9042,6 @@ cdef class CUmemoryPool: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUuserObject' in found_types}} cdef class CUuserObject: """ @@ -9368,9 +9076,6 @@ cdef class CUuserObject: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUgraphDeviceNode' in found_types}} cdef class CUgraphDeviceNode: """ @@ -9405,9 +9110,6 @@ cdef class CUgraphDeviceNode: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUasyncCallbackHandle' in found_types}} cdef class CUasyncCallbackHandle: """ @@ -9442,9 +9144,6 @@ cdef class CUasyncCallbackHandle: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUgreenCtx' in found_types}} cdef class CUgreenCtx: """ @@ -9479,9 +9178,6 @@ cdef class CUgreenCtx: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUlinkState' in found_types}} cdef class CUlinkState: """ @@ -9514,9 +9210,6 @@ cdef class CUlinkState: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUcoredumpCallbackHandle' in found_types}} cdef class CUcoredumpCallbackHandle: """ Opaque handle representing a registered coredump status callback. @@ -9551,9 +9244,6 @@ cdef class CUcoredumpCallbackHandle: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUdevResourceDesc' in found_types}} cdef class CUdevResourceDesc: """ @@ -9588,9 +9278,6 @@ cdef class CUdevResourceDesc: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUlogsCallbackHandle' in found_types}} cdef class CUlogsCallbackHandle: """ @@ -9623,9 +9310,6 @@ cdef class CUlogsCallbackHandle: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if True}} cdef class CUeglStreamConnection: """ @@ -9660,9 +9344,6 @@ cdef class CUeglStreamConnection: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if True}} cdef class EGLImageKHR: """ @@ -9695,9 +9376,6 @@ cdef class EGLImageKHR: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if True}} cdef class EGLStreamKHR: """ @@ -9730,9 +9408,6 @@ cdef class EGLStreamKHR: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if True}} cdef class EGLSyncKHR: """ @@ -9765,9 +9440,6 @@ cdef class EGLSyncKHR: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUasyncCallback' in found_types}} cdef class CUasyncCallback: """ @@ -9794,9 +9466,6 @@ cdef class CUasyncCallback: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUhostFn' in found_types}} cdef class CUhostFn: """ @@ -9823,9 +9492,6 @@ cdef class CUhostFn: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUstreamCallback' in found_types}} cdef class CUstreamCallback: """ @@ -9852,9 +9518,6 @@ cdef class CUstreamCallback: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUoccupancyB2DSize' in found_types}} cdef class CUoccupancyB2DSize: """ @@ -9881,9 +9544,32 @@ cdef class CUoccupancyB2DSize: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} -{{if 'CUcoredumpStatusCallback' in found_types}} +cdef class CUgraphRecaptureCallback: + """ + + 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 cdef class CUcoredumpStatusCallback: """ @@ -9910,9 +9596,6 @@ cdef class CUcoredumpStatusCallback: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUlogsCallback' in found_types}} cdef class CUlogsCallback: """ @@ -9939,18 +9622,15 @@ cdef class CUlogsCallback: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUuuid_st' in found_struct}} cdef class CUuuid_st: """ Attributes ---------- - {{if 'CUuuid_st.bytes' in found_struct}} + bytes : bytes < CUDA definition of UUID - {{endif}} + Methods ------- @@ -9971,22 +9651,20 @@ cdef class CUuuid_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUuuid_st.bytes' in found_struct}} + try: str_list += ['bytes : ' + str(self.bytes.hex())] except ValueError: str_list += ['bytes : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUuuid_st.bytes' in found_struct}} + @property def bytes(self): return PyBytes_FromStringAndSize(self._pvt_ptr[0].bytes, 16) - {{endif}} -{{endif}} -{{if 'CUmemFabricHandle_st' in found_struct}} + cdef class CUmemFabricHandle_st: """ @@ -9997,10 +9675,10 @@ cdef class CUmemFabricHandle_st: Attributes ---------- - {{if 'CUmemFabricHandle_st.data' in found_struct}} + data : bytes - {{endif}} + Methods ------- @@ -10021,16 +9699,16 @@ cdef class CUmemFabricHandle_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUmemFabricHandle_st.data' in found_struct}} + try: str_list += ['data : ' + str(self.data)] except ValueError: str_list += ['data : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUmemFabricHandle_st.data' in found_struct}} + @property def data(self): return PyBytes_FromStringAndSize(self._pvt_ptr[0].data, 64) @@ -10040,9 +9718,7 @@ cdef class CUmemFabricHandle_st: raise ValueError("data length must be 64, is " + str(len(data))) for i, b in enumerate(data): self._pvt_ptr[0].data[i] = b - {{endif}} -{{endif}} -{{if 'CUipcEventHandle_st' in found_struct}} + cdef class CUipcEventHandle_st: """ @@ -10050,10 +9726,10 @@ cdef class CUipcEventHandle_st: Attributes ---------- - {{if 'CUipcEventHandle_st.reserved' in found_struct}} + reserved : bytes - {{endif}} + Methods ------- @@ -10074,16 +9750,16 @@ cdef class CUipcEventHandle_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUipcEventHandle_st.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 'CUipcEventHandle_st.reserved' in found_struct}} + @property def reserved(self): return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 64) @@ -10101,9 +9777,7 @@ cdef class CUipcEventHandle_st: if b > 127 and b < 256: b = b - 256 self._pvt_ptr[0].reserved[i] = b - {{endif}} -{{endif}} -{{if 'CUipcMemHandle_st' in found_struct}} + cdef class CUipcMemHandle_st: """ @@ -10111,10 +9785,10 @@ cdef class CUipcMemHandle_st: Attributes ---------- - {{if 'CUipcMemHandle_st.reserved' in found_struct}} + reserved : bytes - {{endif}} + Methods ------- @@ -10135,16 +9809,16 @@ cdef class CUipcMemHandle_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUipcMemHandle_st.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 'CUipcMemHandle_st.reserved' in found_struct}} + @property def reserved(self): return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 64) @@ -10162,38 +9836,36 @@ cdef class CUipcMemHandle_st: if b > 127 and b < 256: b = b - 256 self._pvt_ptr[0].reserved[i] = b - {{endif}} -{{endif}} -{{if 'CUstreamBatchMemOpParams_union.waitValue' in found_struct}} + cdef class CUstreamMemOpWaitValueParams_st: """ Attributes ---------- - {{if 'CUstreamBatchMemOpParams_union.waitValue.operation' in found_struct}} + operation : CUstreamBatchMemOpType - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.waitValue.address' in found_struct}} + + address : CUdeviceptr - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.waitValue.value' in found_struct}} + + value : cuuint32_t - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.waitValue.value64' in found_struct}} + + value64 : cuuint64_t - {{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 For driver internal use. Initial value is unimportant. - {{endif}} + Methods ------- @@ -10205,18 +9877,18 @@ cdef class CUstreamMemOpWaitValueParams_st: def __init__(self, void_ptr _ptr): pass - {{if 'CUstreamBatchMemOpParams_union.waitValue.address' in found_struct}} + self._address = CUdeviceptr(_ptr=&self._pvt_ptr[0].waitValue.address) - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.waitValue.value' in found_struct}} + + self._value = cuuint32_t(_ptr=&self._pvt_ptr[0].waitValue.value) - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.waitValue.value64' in found_struct}} + + self._value64 = cuuint64_t(_ptr=&self._pvt_ptr[0].waitValue.value64) - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.waitValue.alias' in found_struct}} + + self._alias = CUdeviceptr(_ptr=&self._pvt_ptr[0].waitValue.alias) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -10224,54 +9896,54 @@ cdef class CUstreamMemOpWaitValueParams_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUstreamBatchMemOpParams_union.waitValue.operation' in found_struct}} + try: str_list += ['operation : ' + str(self.operation)] except ValueError: str_list += ['operation : '] - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.waitValue.address' in found_struct}} + + try: str_list += ['address : ' + str(self.address)] except ValueError: str_list += ['address : '] - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.waitValue.value' in found_struct}} + + try: str_list += ['value : ' + str(self.value)] except ValueError: str_list += ['value : '] - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.waitValue.value64' in found_struct}} + + try: str_list += ['value64 : ' + str(self.value64)] except ValueError: str_list += ['value64 : '] - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.waitValue.flags' in found_struct}} + + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.waitValue.alias' in found_struct}} + + try: str_list += ['alias : ' + str(self.alias)] except ValueError: str_list += ['alias : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUstreamBatchMemOpParams_union.waitValue.operation' in found_struct}} + @property def operation(self): return CUstreamBatchMemOpType(self._pvt_ptr[0].waitValue.operation) @operation.setter def operation(self, operation not None : CUstreamBatchMemOpType): self._pvt_ptr[0].waitValue.operation = int(operation) - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.waitValue.address' in found_struct}} + + @property def address(self): return self._address @@ -10288,8 +9960,8 @@ cdef class CUstreamMemOpWaitValueParams_st: cyaddress = paddress self._address._pvt_ptr[0] = cyaddress - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.waitValue.value' in found_struct}} + + @property def value(self): return self._value @@ -10306,8 +9978,8 @@ cdef class CUstreamMemOpWaitValueParams_st: cyvalue = pvalue self._value._pvt_ptr[0] = cyvalue - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.waitValue.value64' in found_struct}} + + @property def value64(self): return self._value64 @@ -10324,16 +9996,16 @@ cdef class CUstreamMemOpWaitValueParams_st: cyvalue64 = pvalue64 self._value64._pvt_ptr[0] = cyvalue64 - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.waitValue.flags' in found_struct}} + + @property def flags(self): return self._pvt_ptr[0].waitValue.flags @flags.setter def flags(self, unsigned int flags): self._pvt_ptr[0].waitValue.flags = flags - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.waitValue.alias' in found_struct}} + + @property def alias(self): return self._alias @@ -10350,38 +10022,36 @@ cdef class CUstreamMemOpWaitValueParams_st: cyalias = palias self._alias._pvt_ptr[0] = cyalias - {{endif}} -{{endif}} -{{if 'CUstreamBatchMemOpParams_union.writeValue' in found_struct}} + cdef class CUstreamMemOpWriteValueParams_st: """ Attributes ---------- - {{if 'CUstreamBatchMemOpParams_union.writeValue.operation' in found_struct}} + operation : CUstreamBatchMemOpType - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue.address' in found_struct}} + + address : CUdeviceptr - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue.value' in found_struct}} + + value : cuuint32_t - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue.value64' in found_struct}} + + value64 : cuuint64_t - {{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 For driver internal use. Initial value is unimportant. - {{endif}} + Methods ------- @@ -10393,18 +10063,18 @@ cdef class CUstreamMemOpWriteValueParams_st: def __init__(self, void_ptr _ptr): pass - {{if 'CUstreamBatchMemOpParams_union.writeValue.address' in found_struct}} + self._address = CUdeviceptr(_ptr=&self._pvt_ptr[0].writeValue.address) - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue.value' in found_struct}} + + self._value = cuuint32_t(_ptr=&self._pvt_ptr[0].writeValue.value) - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue.value64' in found_struct}} + + self._value64 = cuuint64_t(_ptr=&self._pvt_ptr[0].writeValue.value64) - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue.alias' in found_struct}} + + self._alias = CUdeviceptr(_ptr=&self._pvt_ptr[0].writeValue.alias) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -10412,54 +10082,54 @@ cdef class CUstreamMemOpWriteValueParams_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUstreamBatchMemOpParams_union.writeValue.operation' in found_struct}} + try: str_list += ['operation : ' + str(self.operation)] except ValueError: str_list += ['operation : '] - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue.address' in found_struct}} + + try: str_list += ['address : ' + str(self.address)] except ValueError: str_list += ['address : '] - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue.value' in found_struct}} + + try: str_list += ['value : ' + str(self.value)] except ValueError: str_list += ['value : '] - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue.value64' in found_struct}} + + try: str_list += ['value64 : ' + str(self.value64)] except ValueError: str_list += ['value64 : '] - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue.flags' in found_struct}} + + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue.alias' in found_struct}} + + try: str_list += ['alias : ' + str(self.alias)] except ValueError: str_list += ['alias : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUstreamBatchMemOpParams_union.writeValue.operation' in found_struct}} + @property def operation(self): return CUstreamBatchMemOpType(self._pvt_ptr[0].writeValue.operation) @operation.setter def operation(self, operation not None : CUstreamBatchMemOpType): self._pvt_ptr[0].writeValue.operation = int(operation) - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue.address' in found_struct}} + + @property def address(self): return self._address @@ -10476,8 +10146,8 @@ cdef class CUstreamMemOpWriteValueParams_st: cyaddress = paddress self._address._pvt_ptr[0] = cyaddress - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue.value' in found_struct}} + + @property def value(self): return self._value @@ -10494,8 +10164,8 @@ cdef class CUstreamMemOpWriteValueParams_st: cyvalue = pvalue self._value._pvt_ptr[0] = cyvalue - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue.value64' in found_struct}} + + @property def value64(self): return self._value64 @@ -10512,16 +10182,16 @@ cdef class CUstreamMemOpWriteValueParams_st: cyvalue64 = pvalue64 self._value64._pvt_ptr[0] = cyvalue64 - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue.flags' in found_struct}} + + @property def flags(self): return self._pvt_ptr[0].writeValue.flags @flags.setter def flags(self, unsigned int flags): self._pvt_ptr[0].writeValue.flags = flags - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue.alias' in found_struct}} + + @property def alias(self): return self._alias @@ -10538,22 +10208,20 @@ cdef class CUstreamMemOpWriteValueParams_st: cyalias = palias self._alias._pvt_ptr[0] = cyalias - {{endif}} -{{endif}} -{{if 'CUstreamBatchMemOpParams_union.flushRemoteWrites' in found_struct}} + cdef class CUstreamMemOpFlushRemoteWritesParams_st: """ Attributes ---------- - {{if 'CUstreamBatchMemOpParams_union.flushRemoteWrites.operation' in found_struct}} + operation : CUstreamBatchMemOpType - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.flushRemoteWrites.flags' in found_struct}} + + flags : unsigned int Must be 0. - {{endif}} + Methods ------- @@ -10572,52 +10240,50 @@ cdef class CUstreamMemOpFlushRemoteWritesParams_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUstreamBatchMemOpParams_union.flushRemoteWrites.operation' in found_struct}} + try: str_list += ['operation : ' + str(self.operation)] except ValueError: str_list += ['operation : '] - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.flushRemoteWrites.flags' in found_struct}} + + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUstreamBatchMemOpParams_union.flushRemoteWrites.operation' in found_struct}} + @property def operation(self): return CUstreamBatchMemOpType(self._pvt_ptr[0].flushRemoteWrites.operation) @operation.setter def operation(self, operation not None : CUstreamBatchMemOpType): self._pvt_ptr[0].flushRemoteWrites.operation = int(operation) - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.flushRemoteWrites.flags' in found_struct}} + + @property def flags(self): return self._pvt_ptr[0].flushRemoteWrites.flags @flags.setter def flags(self, unsigned int flags): self._pvt_ptr[0].flushRemoteWrites.flags = flags - {{endif}} -{{endif}} -{{if 'CUstreamBatchMemOpParams_union.memoryBarrier' in found_struct}} + cdef class CUstreamMemOpMemoryBarrierParams_st: """ Attributes ---------- - {{if 'CUstreamBatchMemOpParams_union.memoryBarrier.operation' in found_struct}} + operation : CUstreamBatchMemOpType < Only supported in the _v2 API - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.memoryBarrier.flags' in found_struct}} + + flags : unsigned int See CUstreamMemoryBarrier_flags - {{endif}} + Methods ------- @@ -10636,72 +10302,70 @@ cdef class CUstreamMemOpMemoryBarrierParams_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUstreamBatchMemOpParams_union.memoryBarrier.operation' in found_struct}} + try: str_list += ['operation : ' + str(self.operation)] except ValueError: str_list += ['operation : '] - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.memoryBarrier.flags' in found_struct}} + + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUstreamBatchMemOpParams_union.memoryBarrier.operation' in found_struct}} + @property def operation(self): return CUstreamBatchMemOpType(self._pvt_ptr[0].memoryBarrier.operation) @operation.setter def operation(self, operation not None : CUstreamBatchMemOpType): self._pvt_ptr[0].memoryBarrier.operation = int(operation) - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.memoryBarrier.flags' in found_struct}} + + @property def flags(self): return self._pvt_ptr[0].memoryBarrier.flags @flags.setter def flags(self, unsigned int flags): self._pvt_ptr[0].memoryBarrier.flags = flags - {{endif}} -{{endif}} -{{if 'CUstreamBatchMemOpParams_union.atomicReduction' in found_struct}} + cdef class CUstreamMemOpAtomicReductionParams_st: """ Attributes ---------- - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.operation' in found_struct}} + operation : CUstreamBatchMemOpType - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.flags' in found_struct}} + + flags : unsigned int Must be 0 - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.reductionOp' in found_struct}} + + reductionOp : CUstreamAtomicReductionOpType See CUstreamAtomicReductionOpType - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.dataType' in found_struct}} + + dataType : CUstreamAtomicReductionDataType See CUstreamAtomicReductionDataType - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.address' in found_struct}} + + address : CUdeviceptr The address the atomic operation will be operated on - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.value' in found_struct}} + + value : cuuint64_t The operand value the atomic operation will operate with - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.alias' in found_struct}} + + alias : CUdeviceptr For driver internal use. Initial value is unimportant. - {{endif}} + Methods ------- @@ -10713,15 +10377,15 @@ cdef class CUstreamMemOpAtomicReductionParams_st: def __init__(self, void_ptr _ptr): pass - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.address' in found_struct}} + self._address = CUdeviceptr(_ptr=&self._pvt_ptr[0].atomicReduction.address) - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.value' in found_struct}} + + self._value = cuuint64_t(_ptr=&self._pvt_ptr[0].atomicReduction.value) - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.alias' in found_struct}} + + self._alias = CUdeviceptr(_ptr=&self._pvt_ptr[0].atomicReduction.alias) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -10729,84 +10393,84 @@ cdef class CUstreamMemOpAtomicReductionParams_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.operation' in found_struct}} + try: str_list += ['operation : ' + str(self.operation)] except ValueError: str_list += ['operation : '] - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.flags' in found_struct}} + + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.reductionOp' in found_struct}} + + try: str_list += ['reductionOp : ' + str(self.reductionOp)] except ValueError: str_list += ['reductionOp : '] - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.dataType' in found_struct}} + + try: str_list += ['dataType : ' + str(self.dataType)] except ValueError: str_list += ['dataType : '] - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.address' in found_struct}} + + try: str_list += ['address : ' + str(self.address)] except ValueError: str_list += ['address : '] - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.value' in found_struct}} + + try: str_list += ['value : ' + str(self.value)] except ValueError: str_list += ['value : '] - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.alias' in found_struct}} + + try: str_list += ['alias : ' + str(self.alias)] except ValueError: str_list += ['alias : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.operation' in found_struct}} + @property def operation(self): return CUstreamBatchMemOpType(self._pvt_ptr[0].atomicReduction.operation) @operation.setter def operation(self, operation not None : CUstreamBatchMemOpType): self._pvt_ptr[0].atomicReduction.operation = int(operation) - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.flags' in found_struct}} + + @property def flags(self): return self._pvt_ptr[0].atomicReduction.flags @flags.setter def flags(self, unsigned int flags): self._pvt_ptr[0].atomicReduction.flags = flags - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.reductionOp' in found_struct}} + + @property def reductionOp(self): return CUstreamAtomicReductionOpType(self._pvt_ptr[0].atomicReduction.reductionOp) @reductionOp.setter def reductionOp(self, reductionOp not None : CUstreamAtomicReductionOpType): self._pvt_ptr[0].atomicReduction.reductionOp = int(reductionOp) - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.dataType' in found_struct}} + + @property def dataType(self): return CUstreamAtomicReductionDataType(self._pvt_ptr[0].atomicReduction.dataType) @dataType.setter def dataType(self, dataType not None : CUstreamAtomicReductionDataType): self._pvt_ptr[0].atomicReduction.dataType = int(dataType) - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.address' in found_struct}} + + @property def address(self): return self._address @@ -10823,8 +10487,8 @@ cdef class CUstreamMemOpAtomicReductionParams_st: cyaddress = paddress self._address._pvt_ptr[0] = cyaddress - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.value' in found_struct}} + + @property def value(self): return self._value @@ -10841,8 +10505,8 @@ cdef class CUstreamMemOpAtomicReductionParams_st: cyvalue = pvalue self._value._pvt_ptr[0] = cyvalue - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction.alias' in found_struct}} + + @property def alias(self): return self._alias @@ -10859,9 +10523,7 @@ cdef class CUstreamMemOpAtomicReductionParams_st: cyalias = palias self._alias._pvt_ptr[0] = cyalias - {{endif}} -{{endif}} -{{if 'CUstreamBatchMemOpParams_union' in found_struct}} + cdef class CUstreamBatchMemOpParams_union: """ @@ -10869,37 +10531,37 @@ cdef class CUstreamBatchMemOpParams_union: Attributes ---------- - {{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.atomicReduction' in found_struct}} + + atomicReduction : CUstreamMemOpAtomicReductionParams_st - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.pad' in found_struct}} + + pad : list[cuuint64_t] - {{endif}} + Methods ------- @@ -10913,21 +10575,21 @@ cdef class CUstreamBatchMemOpParams_union: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUstreamBatchMemOpParams_union.waitValue' in found_struct}} + self._waitValue = CUstreamMemOpWaitValueParams_st(_ptr=self._pvt_ptr) - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue' in found_struct}} + + self._writeValue = CUstreamMemOpWriteValueParams_st(_ptr=self._pvt_ptr) - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.flushRemoteWrites' in found_struct}} + + self._flushRemoteWrites = CUstreamMemOpFlushRemoteWritesParams_st(_ptr=self._pvt_ptr) - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.memoryBarrier' in found_struct}} + + self._memoryBarrier = CUstreamMemOpMemoryBarrierParams_st(_ptr=self._pvt_ptr) - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction' in found_struct}} + + self._atomicReduction = CUstreamMemOpAtomicReductionParams_st(_ptr=self._pvt_ptr) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -10935,100 +10597,100 @@ cdef class CUstreamBatchMemOpParams_union: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUstreamBatchMemOpParams_union.operation' in found_struct}} + try: str_list += ['operation : ' + str(self.operation)] except ValueError: str_list += ['operation : '] - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.waitValue' in found_struct}} + + try: str_list += ['waitValue :\n' + '\n'.join([' ' + line for line in str(self.waitValue).splitlines()])] except ValueError: str_list += ['waitValue : '] - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue' in found_struct}} + + try: str_list += ['writeValue :\n' + '\n'.join([' ' + line for line in str(self.writeValue).splitlines()])] except ValueError: str_list += ['writeValue : '] - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.flushRemoteWrites' in found_struct}} + + try: str_list += ['flushRemoteWrites :\n' + '\n'.join([' ' + line for line in str(self.flushRemoteWrites).splitlines()])] except ValueError: str_list += ['flushRemoteWrites : '] - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.memoryBarrier' in found_struct}} + + try: str_list += ['memoryBarrier :\n' + '\n'.join([' ' + line for line in str(self.memoryBarrier).splitlines()])] except ValueError: str_list += ['memoryBarrier : '] - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction' in found_struct}} + + try: str_list += ['atomicReduction :\n' + '\n'.join([' ' + line for line in str(self.atomicReduction).splitlines()])] except ValueError: str_list += ['atomicReduction : '] - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.pad' in found_struct}} + + try: str_list += ['pad : ' + str(self.pad)] except ValueError: str_list += ['pad : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUstreamBatchMemOpParams_union.operation' in found_struct}} + @property def operation(self): return CUstreamBatchMemOpType(self._pvt_ptr[0].operation) @operation.setter def operation(self, operation not None : CUstreamBatchMemOpType): self._pvt_ptr[0].operation = int(operation) - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.waitValue' in found_struct}} + + @property def waitValue(self): return self._waitValue @waitValue.setter def waitValue(self, waitValue not None : CUstreamMemOpWaitValueParams_st): - string.memcpy(&self._pvt_ptr[0].waitValue, waitValue.getPtr(), sizeof(self._pvt_ptr[0].waitValue)) - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.writeValue' in found_struct}} + string.memcpy(&self._pvt_ptr[0].waitValue, waitValue.getPtr(), sizeof(self._pvt_ptr[0].waitValue)) + + @property def writeValue(self): return self._writeValue @writeValue.setter def writeValue(self, writeValue not None : CUstreamMemOpWriteValueParams_st): - string.memcpy(&self._pvt_ptr[0].writeValue, writeValue.getPtr(), sizeof(self._pvt_ptr[0].writeValue)) - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.flushRemoteWrites' in found_struct}} + string.memcpy(&self._pvt_ptr[0].writeValue, writeValue.getPtr(), sizeof(self._pvt_ptr[0].writeValue)) + + @property def flushRemoteWrites(self): return self._flushRemoteWrites @flushRemoteWrites.setter def flushRemoteWrites(self, flushRemoteWrites not None : CUstreamMemOpFlushRemoteWritesParams_st): - string.memcpy(&self._pvt_ptr[0].flushRemoteWrites, flushRemoteWrites.getPtr(), sizeof(self._pvt_ptr[0].flushRemoteWrites)) - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.memoryBarrier' in found_struct}} + string.memcpy(&self._pvt_ptr[0].flushRemoteWrites, flushRemoteWrites.getPtr(), sizeof(self._pvt_ptr[0].flushRemoteWrites)) + + @property def memoryBarrier(self): return self._memoryBarrier @memoryBarrier.setter def memoryBarrier(self, memoryBarrier not None : CUstreamMemOpMemoryBarrierParams_st): - string.memcpy(&self._pvt_ptr[0].memoryBarrier, memoryBarrier.getPtr(), sizeof(self._pvt_ptr[0].memoryBarrier)) - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.atomicReduction' in found_struct}} + string.memcpy(&self._pvt_ptr[0].memoryBarrier, memoryBarrier.getPtr(), sizeof(self._pvt_ptr[0].memoryBarrier)) + + @property def atomicReduction(self): return self._atomicReduction @atomicReduction.setter def atomicReduction(self, atomicReduction not None : CUstreamMemOpAtomicReductionParams_st): - string.memcpy(&self._pvt_ptr[0].atomicReduction, atomicReduction.getPtr(), sizeof(self._pvt_ptr[0].atomicReduction)) - {{endif}} - {{if 'CUstreamBatchMemOpParams_union.pad' in found_struct}} + string.memcpy(&self._pvt_ptr[0].atomicReduction, atomicReduction.getPtr(), sizeof(self._pvt_ptr[0].atomicReduction)) + + @property def pad(self): return [cuuint64_t(init_value=_pad) for _pad in self._pvt_ptr[0].pad] @@ -11036,9 +10698,7 @@ cdef class CUstreamBatchMemOpParams_union: def pad(self, pad): self._pvt_ptr[0].pad = pad - {{endif}} -{{endif}} -{{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st' in found_struct}} + cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st: """ @@ -11047,22 +10707,22 @@ cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st: Attributes ---------- - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.ctx' in found_struct}} + ctx : CUcontext - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.count' in found_struct}} + + count : unsigned int - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.paramArray' in found_struct}} + + paramArray : CUstreamBatchMemOpParams - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.flags' in found_struct}} + + flags : unsigned int - {{endif}} + Methods ------- @@ -11076,48 +10736,49 @@ cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.ctx' in found_struct}} + self._ctx = CUcontext(_ptr=&self._pvt_ptr[0].ctx) - {{endif}} + def __dealloc__(self): pass - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.paramArray' in found_struct}} + if self._paramArray is not NULL: free(self._paramArray) - {{endif}} + self._pvt_ptr[0].paramArray = NULL + def getPtr(self): return self._pvt_ptr def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.ctx' in found_struct}} + try: str_list += ['ctx : ' + str(self.ctx)] except ValueError: str_list += ['ctx : '] - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.count' in found_struct}} + + try: str_list += ['count : ' + str(self.count)] except ValueError: str_list += ['count : '] - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.paramArray' in found_struct}} + + try: str_list += ['paramArray : ' + str(self.paramArray)] except ValueError: str_list += ['paramArray : '] - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.flags' in found_struct}} + + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.ctx' in found_struct}} + @property def ctx(self): return self._ctx @@ -11133,16 +10794,16 @@ cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st: pctx = int(CUcontext(ctx)) cyctx = pctx self._ctx._pvt_ptr[0] = cyctx - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.count' in found_struct}} + + @property def count(self): return self._pvt_ptr[0].count @count.setter def count(self, unsigned int count): self._pvt_ptr[0].count = count - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.paramArray' in found_struct}} + + @property def paramArray(self): arrs = [self._pvt_ptr[0].paramArray + x*sizeof(cydriver.CUstreamBatchMemOpParams) for x in range(self._paramArray_length)] @@ -11151,6 +10812,7 @@ cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st: def paramArray(self, val): if len(val) == 0: free(self._paramArray) + self._paramArray = NULL self._paramArray_length = 0 self._pvt_ptr[0].paramArray = NULL else: @@ -11164,17 +10826,15 @@ cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st: for idx in range(len(val)): string.memcpy(&self._paramArray[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUstreamBatchMemOpParams)) - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st.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 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st' in found_struct}} + cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st: """ @@ -11182,22 +10842,22 @@ cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st: Attributes ---------- - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st.ctx' in found_struct}} + ctx : CUcontext Context to use for the operations. - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st.count' in found_struct}} + + count : unsigned int Number of operations in paramArray. - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st.paramArray' in found_struct}} + + paramArray : CUstreamBatchMemOpParams Array of batch memory operations. - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st.flags' in found_struct}} + + flags : unsigned int Flags to control the node. - {{endif}} + Methods ------- @@ -11211,48 +10871,49 @@ cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st.ctx' in found_struct}} + self._ctx = CUcontext(_ptr=&self._pvt_ptr[0].ctx) - {{endif}} + def __dealloc__(self): pass - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st.paramArray' in found_struct}} + if self._paramArray is not NULL: free(self._paramArray) - {{endif}} + self._pvt_ptr[0].paramArray = NULL + def getPtr(self): return self._pvt_ptr def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st.ctx' in found_struct}} + try: str_list += ['ctx : ' + str(self.ctx)] except ValueError: str_list += ['ctx : '] - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st.count' in found_struct}} + + try: str_list += ['count : ' + str(self.count)] except ValueError: str_list += ['count : '] - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st.paramArray' in found_struct}} + + try: str_list += ['paramArray : ' + str(self.paramArray)] except ValueError: str_list += ['paramArray : '] - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st.flags' in found_struct}} + + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st.ctx' in found_struct}} + @property def ctx(self): return self._ctx @@ -11268,16 +10929,16 @@ cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st: pctx = int(CUcontext(ctx)) cyctx = pctx self._ctx._pvt_ptr[0] = cyctx - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st.count' in found_struct}} + + @property def count(self): return self._pvt_ptr[0].count @count.setter def count(self, unsigned int count): self._pvt_ptr[0].count = count - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st.paramArray' in found_struct}} + + @property def paramArray(self): arrs = [self._pvt_ptr[0].paramArray + x*sizeof(cydriver.CUstreamBatchMemOpParams) for x in range(self._paramArray_length)] @@ -11286,6 +10947,7 @@ cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st: def paramArray(self, val): if len(val) == 0: free(self._paramArray) + self._paramArray = NULL self._paramArray_length = 0 self._pvt_ptr[0].paramArray = NULL else: @@ -11299,26 +10961,24 @@ cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st: for idx in range(len(val)): string.memcpy(&self._paramArray[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUstreamBatchMemOpParams)) - {{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st.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 'CUasyncNotificationInfo_st.info.overBudget' in found_struct}} + cdef class anon_struct0: """ Attributes ---------- - {{if 'CUasyncNotificationInfo_st.info.overBudget.bytesOverBudget' in found_struct}} + bytesOverBudget : unsigned long long - {{endif}} + Methods ------- @@ -11337,34 +10997,32 @@ cdef class anon_struct0: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUasyncNotificationInfo_st.info.overBudget.bytesOverBudget' in found_struct}} + try: str_list += ['bytesOverBudget : ' + str(self.bytesOverBudget)] except ValueError: str_list += ['bytesOverBudget : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUasyncNotificationInfo_st.info.overBudget.bytesOverBudget' in found_struct}} + @property def bytesOverBudget(self): return self._pvt_ptr[0].info.overBudget.bytesOverBudget @bytesOverBudget.setter def bytesOverBudget(self, unsigned long long bytesOverBudget): self._pvt_ptr[0].info.overBudget.bytesOverBudget = bytesOverBudget - {{endif}} -{{endif}} -{{if 'CUasyncNotificationInfo_st.info' in found_struct}} + cdef class anon_union2: """ Attributes ---------- - {{if 'CUasyncNotificationInfo_st.info.overBudget' in found_struct}} + overBudget : anon_struct0 - {{endif}} + Methods ------- @@ -11376,9 +11034,9 @@ cdef class anon_union2: def __init__(self, void_ptr _ptr): pass - {{if 'CUasyncNotificationInfo_st.info.overBudget' in found_struct}} + self._overBudget = anon_struct0(_ptr=self._pvt_ptr) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -11386,25 +11044,23 @@ cdef class anon_union2: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUasyncNotificationInfo_st.info.overBudget' in found_struct}} + try: str_list += ['overBudget :\n' + '\n'.join([' ' + line for line in str(self.overBudget).splitlines()])] except ValueError: str_list += ['overBudget : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUasyncNotificationInfo_st.info.overBudget' in found_struct}} + @property def overBudget(self): return self._overBudget @overBudget.setter def overBudget(self, overBudget not None : anon_struct0): - string.memcpy(&self._pvt_ptr[0].info.overBudget, overBudget.getPtr(), sizeof(self._pvt_ptr[0].info.overBudget)) - {{endif}} -{{endif}} -{{if 'CUasyncNotificationInfo_st' in found_struct}} + string.memcpy(&self._pvt_ptr[0].info.overBudget, overBudget.getPtr(), sizeof(self._pvt_ptr[0].info.overBudget)) + cdef class CUasyncNotificationInfo_st: """ @@ -11412,15 +11068,15 @@ cdef class CUasyncNotificationInfo_st: Attributes ---------- - {{if 'CUasyncNotificationInfo_st.type' in found_struct}} + type : CUasyncNotificationType The type of notification being sent - {{endif}} - {{if 'CUasyncNotificationInfo_st.info' in found_struct}} + + info : anon_union2 Information about the notification. `typename` must be checked in order to interpret this field. - {{endif}} + Methods ------- @@ -11435,9 +11091,9 @@ cdef class CUasyncNotificationInfo_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUasyncNotificationInfo_st.info' in found_struct}} + self._info = anon_union2(_ptr=self._pvt_ptr) - {{endif}} + def __dealloc__(self): if self._val_ptr is not NULL: free(self._val_ptr) @@ -11446,39 +11102,37 @@ cdef class CUasyncNotificationInfo_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUasyncNotificationInfo_st.type' in found_struct}} + try: str_list += ['type : ' + str(self.type)] except ValueError: str_list += ['type : '] - {{endif}} - {{if 'CUasyncNotificationInfo_st.info' in found_struct}} + + try: str_list += ['info :\n' + '\n'.join([' ' + line for line in str(self.info).splitlines()])] except ValueError: str_list += ['info : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUasyncNotificationInfo_st.type' in found_struct}} + @property def type(self): return CUasyncNotificationType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : CUasyncNotificationType): self._pvt_ptr[0].type = int(type) - {{endif}} - {{if 'CUasyncNotificationInfo_st.info' in found_struct}} + + @property def info(self): return self._info @info.setter def info(self, info not None : anon_union2): - string.memcpy(&self._pvt_ptr[0].info, info.getPtr(), sizeof(self._pvt_ptr[0].info)) - {{endif}} -{{endif}} -{{if 'CUdevprop_st' in found_struct}} + string.memcpy(&self._pvt_ptr[0].info, info.getPtr(), sizeof(self._pvt_ptr[0].info)) + cdef class CUdevprop_st: """ @@ -11486,46 +11140,46 @@ cdef class CUdevprop_st: Attributes ---------- - {{if 'CUdevprop_st.maxThreadsPerBlock' in found_struct}} + maxThreadsPerBlock : int Maximum number of threads per block - {{endif}} - {{if 'CUdevprop_st.maxThreadsDim' in found_struct}} + + maxThreadsDim : list[int] Maximum size of each dimension of a block - {{endif}} - {{if 'CUdevprop_st.maxGridSize' in found_struct}} + + maxGridSize : list[int] Maximum size of each dimension of a grid - {{endif}} - {{if 'CUdevprop_st.sharedMemPerBlock' in found_struct}} + + sharedMemPerBlock : int Shared memory available per block in bytes - {{endif}} - {{if 'CUdevprop_st.totalConstantMemory' in found_struct}} + + totalConstantMemory : int Constant memory available on device in bytes - {{endif}} - {{if 'CUdevprop_st.SIMDWidth' in found_struct}} + + SIMDWidth : int Warp size in threads - {{endif}} - {{if 'CUdevprop_st.memPitch' in found_struct}} + + memPitch : int Maximum pitch in bytes allowed by memory copies - {{endif}} - {{if 'CUdevprop_st.regsPerBlock' in found_struct}} + + regsPerBlock : int 32-bit registers available per block - {{endif}} - {{if 'CUdevprop_st.clockRate' in found_struct}} + + clockRate : int Clock frequency in kilohertz - {{endif}} - {{if 'CUdevprop_st.textureAlign' in found_struct}} + + textureAlign : int Alignment requirement for textures - {{endif}} + Methods ------- @@ -11546,151 +11200,149 @@ cdef class CUdevprop_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUdevprop_st.maxThreadsPerBlock' in found_struct}} + try: str_list += ['maxThreadsPerBlock : ' + str(self.maxThreadsPerBlock)] except ValueError: str_list += ['maxThreadsPerBlock : '] - {{endif}} - {{if 'CUdevprop_st.maxThreadsDim' in found_struct}} + + try: str_list += ['maxThreadsDim : ' + str(self.maxThreadsDim)] except ValueError: str_list += ['maxThreadsDim : '] - {{endif}} - {{if 'CUdevprop_st.maxGridSize' in found_struct}} + + try: str_list += ['maxGridSize : ' + str(self.maxGridSize)] except ValueError: str_list += ['maxGridSize : '] - {{endif}} - {{if 'CUdevprop_st.sharedMemPerBlock' in found_struct}} + + try: str_list += ['sharedMemPerBlock : ' + str(self.sharedMemPerBlock)] except ValueError: str_list += ['sharedMemPerBlock : '] - {{endif}} - {{if 'CUdevprop_st.totalConstantMemory' in found_struct}} + + try: str_list += ['totalConstantMemory : ' + str(self.totalConstantMemory)] except ValueError: str_list += ['totalConstantMemory : '] - {{endif}} - {{if 'CUdevprop_st.SIMDWidth' in found_struct}} + + try: str_list += ['SIMDWidth : ' + str(self.SIMDWidth)] except ValueError: str_list += ['SIMDWidth : '] - {{endif}} - {{if 'CUdevprop_st.memPitch' in found_struct}} + + try: str_list += ['memPitch : ' + str(self.memPitch)] except ValueError: str_list += ['memPitch : '] - {{endif}} - {{if 'CUdevprop_st.regsPerBlock' in found_struct}} + + try: str_list += ['regsPerBlock : ' + str(self.regsPerBlock)] except ValueError: str_list += ['regsPerBlock : '] - {{endif}} - {{if 'CUdevprop_st.clockRate' in found_struct}} + + try: str_list += ['clockRate : ' + str(self.clockRate)] except ValueError: str_list += ['clockRate : '] - {{endif}} - {{if 'CUdevprop_st.textureAlign' in found_struct}} + + try: str_list += ['textureAlign : ' + str(self.textureAlign)] except ValueError: str_list += ['textureAlign : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUdevprop_st.maxThreadsPerBlock' in found_struct}} + @property def maxThreadsPerBlock(self): return self._pvt_ptr[0].maxThreadsPerBlock @maxThreadsPerBlock.setter def maxThreadsPerBlock(self, int maxThreadsPerBlock): self._pvt_ptr[0].maxThreadsPerBlock = maxThreadsPerBlock - {{endif}} - {{if 'CUdevprop_st.maxThreadsDim' in found_struct}} + + @property def maxThreadsDim(self): return self._pvt_ptr[0].maxThreadsDim @maxThreadsDim.setter def maxThreadsDim(self, maxThreadsDim): self._pvt_ptr[0].maxThreadsDim = maxThreadsDim - {{endif}} - {{if 'CUdevprop_st.maxGridSize' in found_struct}} + + @property def maxGridSize(self): return self._pvt_ptr[0].maxGridSize @maxGridSize.setter def maxGridSize(self, maxGridSize): self._pvt_ptr[0].maxGridSize = maxGridSize - {{endif}} - {{if 'CUdevprop_st.sharedMemPerBlock' in found_struct}} + + @property def sharedMemPerBlock(self): return self._pvt_ptr[0].sharedMemPerBlock @sharedMemPerBlock.setter def sharedMemPerBlock(self, int sharedMemPerBlock): self._pvt_ptr[0].sharedMemPerBlock = sharedMemPerBlock - {{endif}} - {{if 'CUdevprop_st.totalConstantMemory' in found_struct}} + + @property def totalConstantMemory(self): return self._pvt_ptr[0].totalConstantMemory @totalConstantMemory.setter def totalConstantMemory(self, int totalConstantMemory): self._pvt_ptr[0].totalConstantMemory = totalConstantMemory - {{endif}} - {{if 'CUdevprop_st.SIMDWidth' in found_struct}} + + @property def SIMDWidth(self): return self._pvt_ptr[0].SIMDWidth @SIMDWidth.setter def SIMDWidth(self, int SIMDWidth): self._pvt_ptr[0].SIMDWidth = SIMDWidth - {{endif}} - {{if 'CUdevprop_st.memPitch' in found_struct}} + + @property def memPitch(self): return self._pvt_ptr[0].memPitch @memPitch.setter def memPitch(self, int memPitch): self._pvt_ptr[0].memPitch = memPitch - {{endif}} - {{if 'CUdevprop_st.regsPerBlock' in found_struct}} + + @property def regsPerBlock(self): return self._pvt_ptr[0].regsPerBlock @regsPerBlock.setter def regsPerBlock(self, int regsPerBlock): self._pvt_ptr[0].regsPerBlock = regsPerBlock - {{endif}} - {{if 'CUdevprop_st.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 'CUdevprop_st.textureAlign' in found_struct}} + + @property def textureAlign(self): return self._pvt_ptr[0].textureAlign @textureAlign.setter def textureAlign(self, int textureAlign): self._pvt_ptr[0].textureAlign = textureAlign - {{endif}} -{{endif}} -{{if 'CUaccessPolicyWindow_st' in found_struct}} + cdef class CUaccessPolicyWindow_st: """ @@ -11707,29 +11359,29 @@ cdef class CUaccessPolicyWindow_st: Attributes ---------- - {{if 'CUaccessPolicyWindow_st.base_ptr' in found_struct}} + base_ptr : Any Starting address of the access policy window. CUDA driver may align it. - {{endif}} - {{if 'CUaccessPolicyWindow_st.num_bytes' in found_struct}} + + num_bytes : size_t Size in bytes of the window policy. CUDA driver may restrict the maximum size and alignment. - {{endif}} - {{if 'CUaccessPolicyWindow_st.hitRatio' in found_struct}} + + hitRatio : float hitRatio specifies percentage of lines assigned hitProp, rest are assigned missProp. - {{endif}} - {{if 'CUaccessPolicyWindow_st.hitProp' in found_struct}} + + hitProp : CUaccessProperty CUaccessProperty set for hit. - {{endif}} - {{if 'CUaccessPolicyWindow_st.missProp' in found_struct}} + + missProp : CUaccessProperty CUaccessProperty set for miss. Must be either NORMAL or STREAMING - {{endif}} + Methods ------- @@ -11750,40 +11402,40 @@ cdef class CUaccessPolicyWindow_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUaccessPolicyWindow_st.base_ptr' in found_struct}} + try: str_list += ['base_ptr : ' + hex(self.base_ptr)] except ValueError: str_list += ['base_ptr : '] - {{endif}} - {{if 'CUaccessPolicyWindow_st.num_bytes' in found_struct}} + + try: str_list += ['num_bytes : ' + str(self.num_bytes)] except ValueError: str_list += ['num_bytes : '] - {{endif}} - {{if 'CUaccessPolicyWindow_st.hitRatio' in found_struct}} + + try: str_list += ['hitRatio : ' + str(self.hitRatio)] except ValueError: str_list += ['hitRatio : '] - {{endif}} - {{if 'CUaccessPolicyWindow_st.hitProp' in found_struct}} + + try: str_list += ['hitProp : ' + str(self.hitProp)] except ValueError: str_list += ['hitProp : '] - {{endif}} - {{if 'CUaccessPolicyWindow_st.missProp' in found_struct}} + + try: str_list += ['missProp : ' + str(self.missProp)] except ValueError: str_list += ['missProp : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUaccessPolicyWindow_st.base_ptr' in found_struct}} + @property def base_ptr(self): return self._pvt_ptr[0].base_ptr @@ -11791,41 +11443,39 @@ cdef class CUaccessPolicyWindow_st: def base_ptr(self, base_ptr): self._cybase_ptr = _HelperInputVoidPtr(base_ptr) self._pvt_ptr[0].base_ptr = self._cybase_ptr.cptr - {{endif}} - {{if 'CUaccessPolicyWindow_st.num_bytes' in found_struct}} + + @property def num_bytes(self): return self._pvt_ptr[0].num_bytes @num_bytes.setter def num_bytes(self, size_t num_bytes): self._pvt_ptr[0].num_bytes = num_bytes - {{endif}} - {{if 'CUaccessPolicyWindow_st.hitRatio' in found_struct}} + + @property def hitRatio(self): return self._pvt_ptr[0].hitRatio @hitRatio.setter def hitRatio(self, float hitRatio): self._pvt_ptr[0].hitRatio = hitRatio - {{endif}} - {{if 'CUaccessPolicyWindow_st.hitProp' in found_struct}} + + @property def hitProp(self): return CUaccessProperty(self._pvt_ptr[0].hitProp) @hitProp.setter def hitProp(self, hitProp not None : CUaccessProperty): self._pvt_ptr[0].hitProp = int(hitProp) - {{endif}} - {{if 'CUaccessPolicyWindow_st.missProp' in found_struct}} + + @property def missProp(self): return CUaccessProperty(self._pvt_ptr[0].missProp) @missProp.setter def missProp(self, missProp not None : CUaccessProperty): self._pvt_ptr[0].missProp = int(missProp) - {{endif}} -{{endif}} -{{if 'CUDA_KERNEL_NODE_PARAMS_st' in found_struct}} + cdef class CUDA_KERNEL_NODE_PARAMS_st: """ @@ -11833,46 +11483,46 @@ cdef class CUDA_KERNEL_NODE_PARAMS_st: Attributes ---------- - {{if 'CUDA_KERNEL_NODE_PARAMS_st.func' in found_struct}} + func : CUfunction Kernel to launch - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.gridDimX' in found_struct}} + + gridDimX : unsigned int Width of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.gridDimY' in found_struct}} + + gridDimY : unsigned int Height of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.gridDimZ' in found_struct}} + + gridDimZ : unsigned int Depth of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.blockDimX' in found_struct}} + + blockDimX : unsigned int X dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.blockDimY' in found_struct}} + + blockDimY : unsigned int Y dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.blockDimZ' in found_struct}} + + blockDimZ : unsigned int Z dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.sharedMemBytes' in found_struct}} + + sharedMemBytes : unsigned int Dynamic shared-memory size per thread block in bytes - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.kernelParams' in found_struct}} + + kernelParams : Any Array of pointers to kernel parameters - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.extra' in found_struct}} + + extra : Any Extra options - {{endif}} + Methods ------- @@ -11886,9 +11536,9 @@ cdef class CUDA_KERNEL_NODE_PARAMS_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_KERNEL_NODE_PARAMS_st.func' in found_struct}} + self._func = CUfunction(_ptr=&self._pvt_ptr[0].func) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -11896,70 +11546,70 @@ cdef class CUDA_KERNEL_NODE_PARAMS_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_KERNEL_NODE_PARAMS_st.func' in found_struct}} + try: str_list += ['func : ' + str(self.func)] except ValueError: str_list += ['func : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.gridDimX' in found_struct}} + + try: str_list += ['gridDimX : ' + str(self.gridDimX)] except ValueError: str_list += ['gridDimX : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.gridDimY' in found_struct}} + + try: str_list += ['gridDimY : ' + str(self.gridDimY)] except ValueError: str_list += ['gridDimY : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.gridDimZ' in found_struct}} + + try: str_list += ['gridDimZ : ' + str(self.gridDimZ)] except ValueError: str_list += ['gridDimZ : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.blockDimX' in found_struct}} + + try: str_list += ['blockDimX : ' + str(self.blockDimX)] except ValueError: str_list += ['blockDimX : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.blockDimY' in found_struct}} + + try: str_list += ['blockDimY : ' + str(self.blockDimY)] except ValueError: str_list += ['blockDimY : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.blockDimZ' in found_struct}} + + try: str_list += ['blockDimZ : ' + str(self.blockDimZ)] except ValueError: str_list += ['blockDimZ : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.sharedMemBytes' in found_struct}} + + try: str_list += ['sharedMemBytes : ' + str(self.sharedMemBytes)] except ValueError: str_list += ['sharedMemBytes : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.kernelParams' in found_struct}} + + try: str_list += ['kernelParams : ' + str(self.kernelParams)] except ValueError: str_list += ['kernelParams : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.extra' in found_struct}} + + try: str_list += ['extra : ' + str(self.extra)] except ValueError: str_list += ['extra : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_KERNEL_NODE_PARAMS_st.func' in found_struct}} + @property def func(self): return self._func @@ -11975,64 +11625,64 @@ cdef class CUDA_KERNEL_NODE_PARAMS_st: pfunc = int(CUfunction(func)) cyfunc = pfunc self._func._pvt_ptr[0] = cyfunc - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.gridDimX' in found_struct}} + + @property def gridDimX(self): return self._pvt_ptr[0].gridDimX @gridDimX.setter def gridDimX(self, unsigned int gridDimX): self._pvt_ptr[0].gridDimX = gridDimX - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.gridDimY' in found_struct}} + + @property def gridDimY(self): return self._pvt_ptr[0].gridDimY @gridDimY.setter def gridDimY(self, unsigned int gridDimY): self._pvt_ptr[0].gridDimY = gridDimY - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.gridDimZ' in found_struct}} + + @property def gridDimZ(self): return self._pvt_ptr[0].gridDimZ @gridDimZ.setter def gridDimZ(self, unsigned int gridDimZ): self._pvt_ptr[0].gridDimZ = gridDimZ - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.blockDimX' in found_struct}} + + @property def blockDimX(self): return self._pvt_ptr[0].blockDimX @blockDimX.setter def blockDimX(self, unsigned int blockDimX): self._pvt_ptr[0].blockDimX = blockDimX - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.blockDimY' in found_struct}} + + @property def blockDimY(self): return self._pvt_ptr[0].blockDimY @blockDimY.setter def blockDimY(self, unsigned int blockDimY): self._pvt_ptr[0].blockDimY = blockDimY - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.blockDimZ' in found_struct}} + + @property def blockDimZ(self): return self._pvt_ptr[0].blockDimZ @blockDimZ.setter def blockDimZ(self, unsigned int blockDimZ): self._pvt_ptr[0].blockDimZ = blockDimZ - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.sharedMemBytes' in found_struct}} + + @property def sharedMemBytes(self): return self._pvt_ptr[0].sharedMemBytes @sharedMemBytes.setter def sharedMemBytes(self, unsigned int sharedMemBytes): self._pvt_ptr[0].sharedMemBytes = sharedMemBytes - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.kernelParams' in found_struct}} + + @property def kernelParams(self): return self._pvt_ptr[0].kernelParams @@ -12040,17 +11690,15 @@ cdef class CUDA_KERNEL_NODE_PARAMS_st: def kernelParams(self, kernelParams): self._cykernelParams = _HelperKernelParams(kernelParams) self._pvt_ptr[0].kernelParams = self._cykernelParams.ckernelParams - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st.extra' in found_struct}} + + @property def extra(self): return self._pvt_ptr[0].extra @extra.setter def extra(self, void_ptr extra): self._pvt_ptr[0].extra = extra - {{endif}} -{{endif}} -{{if 'CUDA_KERNEL_NODE_PARAMS_v2_st' in found_struct}} + cdef class CUDA_KERNEL_NODE_PARAMS_v2_st: """ @@ -12058,56 +11706,56 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v2_st: Attributes ---------- - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.func' in found_struct}} + func : CUfunction Kernel to launch - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.gridDimX' in found_struct}} + + gridDimX : unsigned int Width of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.gridDimY' in found_struct}} + + gridDimY : unsigned int Height of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.gridDimZ' in found_struct}} + + gridDimZ : unsigned int Depth of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.blockDimX' in found_struct}} + + blockDimX : unsigned int X dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.blockDimY' in found_struct}} + + blockDimY : unsigned int Y dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.blockDimZ' in found_struct}} + + blockDimZ : unsigned int Z dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.sharedMemBytes' in found_struct}} + + sharedMemBytes : unsigned int Dynamic shared-memory size per thread block in bytes - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.kernelParams' in found_struct}} + + kernelParams : Any Array of pointers to kernel parameters - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.extra' in found_struct}} + + extra : Any Extra options - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.kern' in found_struct}} + + kern : CUkernel Kernel to launch, will only be referenced if func is NULL - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.ctx' in found_struct}} + + ctx : CUcontext Context for the kernel task to run in. The value NULL will indicate the current context should be used by the api. This field is ignored if func is set. - {{endif}} + Methods ------- @@ -12121,15 +11769,15 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v2_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.func' in found_struct}} + self._func = CUfunction(_ptr=&self._pvt_ptr[0].func) - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.kern' in found_struct}} + + self._kern = CUkernel(_ptr=&self._pvt_ptr[0].kern) - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.ctx' in found_struct}} + + self._ctx = CUcontext(_ptr=&self._pvt_ptr[0].ctx) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -12137,82 +11785,82 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v2_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.func' in found_struct}} + try: str_list += ['func : ' + str(self.func)] except ValueError: str_list += ['func : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.gridDimX' in found_struct}} + + try: str_list += ['gridDimX : ' + str(self.gridDimX)] except ValueError: str_list += ['gridDimX : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.gridDimY' in found_struct}} + + try: str_list += ['gridDimY : ' + str(self.gridDimY)] except ValueError: str_list += ['gridDimY : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.gridDimZ' in found_struct}} + + try: str_list += ['gridDimZ : ' + str(self.gridDimZ)] except ValueError: str_list += ['gridDimZ : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.blockDimX' in found_struct}} + + try: str_list += ['blockDimX : ' + str(self.blockDimX)] except ValueError: str_list += ['blockDimX : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.blockDimY' in found_struct}} + + try: str_list += ['blockDimY : ' + str(self.blockDimY)] except ValueError: str_list += ['blockDimY : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.blockDimZ' in found_struct}} + + try: str_list += ['blockDimZ : ' + str(self.blockDimZ)] except ValueError: str_list += ['blockDimZ : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.sharedMemBytes' in found_struct}} + + try: str_list += ['sharedMemBytes : ' + str(self.sharedMemBytes)] except ValueError: str_list += ['sharedMemBytes : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.kernelParams' in found_struct}} + + try: str_list += ['kernelParams : ' + str(self.kernelParams)] except ValueError: str_list += ['kernelParams : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.extra' in found_struct}} + + try: str_list += ['extra : ' + str(self.extra)] except ValueError: str_list += ['extra : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.kern' in found_struct}} + + try: str_list += ['kern : ' + str(self.kern)] except ValueError: str_list += ['kern : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.ctx' in found_struct}} + + try: str_list += ['ctx : ' + str(self.ctx)] except ValueError: str_list += ['ctx : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.func' in found_struct}} + @property def func(self): return self._func @@ -12228,64 +11876,64 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v2_st: pfunc = int(CUfunction(func)) cyfunc = pfunc self._func._pvt_ptr[0] = cyfunc - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.gridDimX' in found_struct}} + + @property def gridDimX(self): return self._pvt_ptr[0].gridDimX @gridDimX.setter def gridDimX(self, unsigned int gridDimX): self._pvt_ptr[0].gridDimX = gridDimX - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.gridDimY' in found_struct}} + + @property def gridDimY(self): return self._pvt_ptr[0].gridDimY @gridDimY.setter def gridDimY(self, unsigned int gridDimY): self._pvt_ptr[0].gridDimY = gridDimY - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.gridDimZ' in found_struct}} + + @property def gridDimZ(self): return self._pvt_ptr[0].gridDimZ @gridDimZ.setter def gridDimZ(self, unsigned int gridDimZ): self._pvt_ptr[0].gridDimZ = gridDimZ - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.blockDimX' in found_struct}} + + @property def blockDimX(self): return self._pvt_ptr[0].blockDimX @blockDimX.setter def blockDimX(self, unsigned int blockDimX): self._pvt_ptr[0].blockDimX = blockDimX - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.blockDimY' in found_struct}} + + @property def blockDimY(self): return self._pvt_ptr[0].blockDimY @blockDimY.setter def blockDimY(self, unsigned int blockDimY): self._pvt_ptr[0].blockDimY = blockDimY - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.blockDimZ' in found_struct}} + + @property def blockDimZ(self): return self._pvt_ptr[0].blockDimZ @blockDimZ.setter def blockDimZ(self, unsigned int blockDimZ): self._pvt_ptr[0].blockDimZ = blockDimZ - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.sharedMemBytes' in found_struct}} + + @property def sharedMemBytes(self): return self._pvt_ptr[0].sharedMemBytes @sharedMemBytes.setter def sharedMemBytes(self, unsigned int sharedMemBytes): self._pvt_ptr[0].sharedMemBytes = sharedMemBytes - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.kernelParams' in found_struct}} + + @property def kernelParams(self): return self._pvt_ptr[0].kernelParams @@ -12293,16 +11941,16 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v2_st: def kernelParams(self, 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}} + + @property def extra(self): return self._pvt_ptr[0].extra @extra.setter def extra(self, void_ptr extra): self._pvt_ptr[0].extra = extra - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.kern' in found_struct}} + + @property def kern(self): return self._kern @@ -12318,8 +11966,8 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v2_st: pkern = int(CUkernel(kern)) cykern = pkern self._kern._pvt_ptr[0] = cykern - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.ctx' in found_struct}} + + @property def ctx(self): return self._ctx @@ -12335,9 +11983,7 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v2_st: pctx = int(CUcontext(ctx)) cyctx = pctx self._ctx._pvt_ptr[0] = cyctx - {{endif}} -{{endif}} -{{if 'CUDA_KERNEL_NODE_PARAMS_v3_st' in found_struct}} + cdef class CUDA_KERNEL_NODE_PARAMS_v3_st: """ @@ -12345,56 +11991,56 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v3_st: Attributes ---------- - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.func' in found_struct}} + func : CUfunction Kernel to launch - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.gridDimX' in found_struct}} + + gridDimX : unsigned int Width of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.gridDimY' in found_struct}} + + gridDimY : unsigned int Height of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.gridDimZ' in found_struct}} + + gridDimZ : unsigned int Depth of grid in blocks - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.blockDimX' in found_struct}} + + blockDimX : unsigned int X dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.blockDimY' in found_struct}} + + blockDimY : unsigned int Y dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.blockDimZ' in found_struct}} + + blockDimZ : unsigned int Z dimension of each thread block - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.sharedMemBytes' in found_struct}} + + sharedMemBytes : unsigned int Dynamic shared-memory size per thread block in bytes - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.kernelParams' in found_struct}} + + kernelParams : Any Array of pointers to kernel parameters - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.extra' in found_struct}} + + extra : Any Extra options - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.kern' in found_struct}} + + kern : CUkernel Kernel to launch, will only be referenced if func is NULL - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.ctx' in found_struct}} + + ctx : CUcontext Context for the kernel task to run in. The value NULL will indicate the current context should be used by the api. This field is ignored if func is set. - {{endif}} + Methods ------- @@ -12408,15 +12054,15 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v3_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.func' in found_struct}} + self._func = CUfunction(_ptr=&self._pvt_ptr[0].func) - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.kern' in found_struct}} + + self._kern = CUkernel(_ptr=&self._pvt_ptr[0].kern) - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.ctx' in found_struct}} + + self._ctx = CUcontext(_ptr=&self._pvt_ptr[0].ctx) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -12424,82 +12070,82 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v3_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.func' in found_struct}} + try: str_list += ['func : ' + str(self.func)] except ValueError: str_list += ['func : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.gridDimX' in found_struct}} + + try: str_list += ['gridDimX : ' + str(self.gridDimX)] except ValueError: str_list += ['gridDimX : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.gridDimY' in found_struct}} + + try: str_list += ['gridDimY : ' + str(self.gridDimY)] except ValueError: str_list += ['gridDimY : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.gridDimZ' in found_struct}} + + try: str_list += ['gridDimZ : ' + str(self.gridDimZ)] except ValueError: str_list += ['gridDimZ : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.blockDimX' in found_struct}} + + try: str_list += ['blockDimX : ' + str(self.blockDimX)] except ValueError: str_list += ['blockDimX : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.blockDimY' in found_struct}} + + try: str_list += ['blockDimY : ' + str(self.blockDimY)] except ValueError: str_list += ['blockDimY : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.blockDimZ' in found_struct}} + + try: str_list += ['blockDimZ : ' + str(self.blockDimZ)] except ValueError: str_list += ['blockDimZ : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.sharedMemBytes' in found_struct}} + + try: str_list += ['sharedMemBytes : ' + str(self.sharedMemBytes)] except ValueError: str_list += ['sharedMemBytes : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.kernelParams' in found_struct}} + + try: str_list += ['kernelParams : ' + str(self.kernelParams)] except ValueError: str_list += ['kernelParams : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.extra' in found_struct}} + + try: str_list += ['extra : ' + str(self.extra)] except ValueError: str_list += ['extra : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.kern' in found_struct}} + + try: str_list += ['kern : ' + str(self.kern)] except ValueError: str_list += ['kern : '] - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.ctx' in found_struct}} + + try: str_list += ['ctx : ' + str(self.ctx)] except ValueError: str_list += ['ctx : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.func' in found_struct}} + @property def func(self): return self._func @@ -12515,64 +12161,64 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v3_st: pfunc = int(CUfunction(func)) cyfunc = pfunc self._func._pvt_ptr[0] = cyfunc - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.gridDimX' in found_struct}} + + @property def gridDimX(self): return self._pvt_ptr[0].gridDimX @gridDimX.setter def gridDimX(self, unsigned int gridDimX): self._pvt_ptr[0].gridDimX = gridDimX - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.gridDimY' in found_struct}} + + @property def gridDimY(self): return self._pvt_ptr[0].gridDimY @gridDimY.setter def gridDimY(self, unsigned int gridDimY): self._pvt_ptr[0].gridDimY = gridDimY - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.gridDimZ' in found_struct}} + + @property def gridDimZ(self): return self._pvt_ptr[0].gridDimZ @gridDimZ.setter def gridDimZ(self, unsigned int gridDimZ): self._pvt_ptr[0].gridDimZ = gridDimZ - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.blockDimX' in found_struct}} + + @property def blockDimX(self): return self._pvt_ptr[0].blockDimX @blockDimX.setter def blockDimX(self, unsigned int blockDimX): self._pvt_ptr[0].blockDimX = blockDimX - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.blockDimY' in found_struct}} + + @property def blockDimY(self): return self._pvt_ptr[0].blockDimY @blockDimY.setter def blockDimY(self, unsigned int blockDimY): self._pvt_ptr[0].blockDimY = blockDimY - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.blockDimZ' in found_struct}} + + @property def blockDimZ(self): return self._pvt_ptr[0].blockDimZ @blockDimZ.setter def blockDimZ(self, unsigned int blockDimZ): self._pvt_ptr[0].blockDimZ = blockDimZ - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.sharedMemBytes' in found_struct}} + + @property def sharedMemBytes(self): return self._pvt_ptr[0].sharedMemBytes @sharedMemBytes.setter def sharedMemBytes(self, unsigned int sharedMemBytes): self._pvt_ptr[0].sharedMemBytes = sharedMemBytes - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.kernelParams' in found_struct}} + + @property def kernelParams(self): return self._pvt_ptr[0].kernelParams @@ -12580,16 +12226,16 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v3_st: def kernelParams(self, 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}} + + @property def extra(self): return self._pvt_ptr[0].extra @extra.setter def extra(self, void_ptr extra): self._pvt_ptr[0].extra = extra - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.kern' in found_struct}} + + @property def kern(self): return self._kern @@ -12605,8 +12251,8 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v3_st: pkern = int(CUkernel(kern)) cykern = pkern self._kern._pvt_ptr[0] = cykern - {{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.ctx' in found_struct}} + + @property def ctx(self): return self._ctx @@ -12622,9 +12268,7 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v3_st: pctx = int(CUcontext(ctx)) cyctx = pctx self._ctx._pvt_ptr[0] = cyctx - {{endif}} -{{endif}} -{{if 'CUDA_MEMSET_NODE_PARAMS_st' in found_struct}} + cdef class CUDA_MEMSET_NODE_PARAMS_st: """ @@ -12632,30 +12276,30 @@ cdef class CUDA_MEMSET_NODE_PARAMS_st: Attributes ---------- - {{if 'CUDA_MEMSET_NODE_PARAMS_st.dst' in found_struct}} + dst : CUdeviceptr Destination device pointer - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.pitch' in found_struct}} + + pitch : size_t Pitch of destination device pointer. Unused if height is 1 - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.value' in found_struct}} + + value : unsigned int Value to be set - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.elementSize' in found_struct}} + + elementSize : unsigned int Size of each element in bytes. Must be 1, 2, or 4. - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.width' in found_struct}} + + width : size_t Width of the row in elements - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.height' in found_struct}} + + height : size_t Number of rows - {{endif}} + Methods ------- @@ -12669,9 +12313,9 @@ cdef class CUDA_MEMSET_NODE_PARAMS_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_MEMSET_NODE_PARAMS_st.dst' in found_struct}} + self._dst = CUdeviceptr(_ptr=&self._pvt_ptr[0].dst) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -12679,46 +12323,46 @@ cdef class CUDA_MEMSET_NODE_PARAMS_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_MEMSET_NODE_PARAMS_st.dst' in found_struct}} + try: str_list += ['dst : ' + str(self.dst)] except ValueError: str_list += ['dst : '] - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.pitch' in found_struct}} + + try: str_list += ['pitch : ' + str(self.pitch)] except ValueError: str_list += ['pitch : '] - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.value' in found_struct}} + + try: str_list += ['value : ' + str(self.value)] except ValueError: str_list += ['value : '] - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.elementSize' in found_struct}} + + try: str_list += ['elementSize : ' + str(self.elementSize)] except ValueError: str_list += ['elementSize : '] - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.width' in found_struct}} + + try: str_list += ['width : ' + str(self.width)] except ValueError: str_list += ['width : '] - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.height' in found_struct}} + + try: str_list += ['height : ' + str(self.height)] except ValueError: str_list += ['height : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_MEMSET_NODE_PARAMS_st.dst' in found_struct}} + @property def dst(self): return self._dst @@ -12735,49 +12379,47 @@ cdef class CUDA_MEMSET_NODE_PARAMS_st: cydst = pdst self._dst._pvt_ptr[0] = cydst - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.pitch' in found_struct}} + + @property def pitch(self): return self._pvt_ptr[0].pitch @pitch.setter def pitch(self, size_t pitch): self._pvt_ptr[0].pitch = pitch - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.value' in found_struct}} + + @property def value(self): return self._pvt_ptr[0].value @value.setter def value(self, unsigned int value): self._pvt_ptr[0].value = value - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.elementSize' in found_struct}} + + @property def elementSize(self): return self._pvt_ptr[0].elementSize @elementSize.setter def elementSize(self, unsigned int elementSize): self._pvt_ptr[0].elementSize = elementSize - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.width' in found_struct}} + + @property def width(self): return self._pvt_ptr[0].width @width.setter def width(self, size_t width): self._pvt_ptr[0].width = width - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st.height' in found_struct}} + + @property def height(self): return self._pvt_ptr[0].height @height.setter def height(self, size_t height): self._pvt_ptr[0].height = height - {{endif}} -{{endif}} -{{if 'CUDA_MEMSET_NODE_PARAMS_v2_st' in found_struct}} + cdef class CUDA_MEMSET_NODE_PARAMS_v2_st: """ @@ -12785,34 +12427,34 @@ cdef class CUDA_MEMSET_NODE_PARAMS_v2_st: Attributes ---------- - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.dst' in found_struct}} + dst : CUdeviceptr Destination device pointer - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.pitch' in found_struct}} + + pitch : size_t Pitch of destination device pointer. Unused if height is 1 - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.value' in found_struct}} + + value : unsigned int Value to be set - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.elementSize' in found_struct}} + + elementSize : unsigned int Size of each element in bytes. Must be 1, 2, or 4. - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.width' in found_struct}} + + width : size_t Width of the row in elements - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.height' in found_struct}} + + height : size_t Number of rows - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.ctx' in found_struct}} + + ctx : CUcontext Context on which to run the node - {{endif}} + Methods ------- @@ -12826,12 +12468,12 @@ cdef class CUDA_MEMSET_NODE_PARAMS_v2_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.dst' in found_struct}} + self._dst = CUdeviceptr(_ptr=&self._pvt_ptr[0].dst) - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.ctx' in found_struct}} + + self._ctx = CUcontext(_ptr=&self._pvt_ptr[0].ctx) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -12839,52 +12481,52 @@ cdef class CUDA_MEMSET_NODE_PARAMS_v2_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.dst' in found_struct}} + try: str_list += ['dst : ' + str(self.dst)] except ValueError: str_list += ['dst : '] - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.pitch' in found_struct}} + + try: str_list += ['pitch : ' + str(self.pitch)] except ValueError: str_list += ['pitch : '] - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.value' in found_struct}} + + try: str_list += ['value : ' + str(self.value)] except ValueError: str_list += ['value : '] - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.elementSize' in found_struct}} + + try: str_list += ['elementSize : ' + str(self.elementSize)] except ValueError: str_list += ['elementSize : '] - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.width' in found_struct}} + + try: str_list += ['width : ' + str(self.width)] except ValueError: str_list += ['width : '] - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.height' in found_struct}} + + try: str_list += ['height : ' + str(self.height)] except ValueError: str_list += ['height : '] - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.ctx' in found_struct}} + + try: str_list += ['ctx : ' + str(self.ctx)] except ValueError: str_list += ['ctx : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.dst' in found_struct}} + @property def dst(self): return self._dst @@ -12901,48 +12543,48 @@ cdef class CUDA_MEMSET_NODE_PARAMS_v2_st: cydst = pdst self._dst._pvt_ptr[0] = cydst - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.pitch' in found_struct}} + + @property def pitch(self): return self._pvt_ptr[0].pitch @pitch.setter def pitch(self, size_t pitch): self._pvt_ptr[0].pitch = pitch - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.value' in found_struct}} + + @property def value(self): return self._pvt_ptr[0].value @value.setter def value(self, unsigned int value): self._pvt_ptr[0].value = value - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.elementSize' in found_struct}} + + @property def elementSize(self): return self._pvt_ptr[0].elementSize @elementSize.setter def elementSize(self, unsigned int elementSize): self._pvt_ptr[0].elementSize = elementSize - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.width' in found_struct}} + + @property def width(self): return self._pvt_ptr[0].width @width.setter def width(self, size_t width): self._pvt_ptr[0].width = width - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.height' in found_struct}} + + @property def height(self): return self._pvt_ptr[0].height @height.setter def height(self, size_t height): self._pvt_ptr[0].height = height - {{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st.ctx' in found_struct}} + + @property def ctx(self): return self._ctx @@ -12958,9 +12600,7 @@ cdef class CUDA_MEMSET_NODE_PARAMS_v2_st: pctx = int(CUcontext(ctx)) cyctx = pctx self._ctx._pvt_ptr[0] = cyctx - {{endif}} -{{endif}} -{{if 'CUDA_HOST_NODE_PARAMS_st' in found_struct}} + cdef class CUDA_HOST_NODE_PARAMS_st: """ @@ -12968,14 +12608,14 @@ cdef class CUDA_HOST_NODE_PARAMS_st: Attributes ---------- - {{if 'CUDA_HOST_NODE_PARAMS_st.fn' in found_struct}} + fn : CUhostFn The function to call when the node executes - {{endif}} - {{if 'CUDA_HOST_NODE_PARAMS_st.userData' in found_struct}} + + userData : Any Argument to pass to the function - {{endif}} + Methods ------- @@ -12989,9 +12629,9 @@ cdef class CUDA_HOST_NODE_PARAMS_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_HOST_NODE_PARAMS_st.fn' in found_struct}} + self._fn = CUhostFn(_ptr=&self._pvt_ptr[0].fn) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -12999,22 +12639,22 @@ cdef class CUDA_HOST_NODE_PARAMS_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_HOST_NODE_PARAMS_st.fn' in found_struct}} + try: str_list += ['fn : ' + str(self.fn)] except ValueError: str_list += ['fn : '] - {{endif}} - {{if 'CUDA_HOST_NODE_PARAMS_st.userData' in found_struct}} + + try: str_list += ['userData : ' + hex(self.userData)] except ValueError: str_list += ['userData : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_HOST_NODE_PARAMS_st.fn' in found_struct}} + @property def fn(self): return self._fn @@ -13030,8 +12670,8 @@ cdef class CUDA_HOST_NODE_PARAMS_st: pfn = int(CUhostFn(fn)) cyfn = pfn self._fn._pvt_ptr[0] = cyfn - {{endif}} - {{if 'CUDA_HOST_NODE_PARAMS_st.userData' in found_struct}} + + @property def userData(self): return self._pvt_ptr[0].userData @@ -13039,9 +12679,7 @@ cdef class CUDA_HOST_NODE_PARAMS_st: def userData(self, userData): self._cyuserData = _HelperInputVoidPtr(userData) self._pvt_ptr[0].userData = self._cyuserData.cptr - {{endif}} -{{endif}} -{{if 'CUDA_HOST_NODE_PARAMS_v2_st' in found_struct}} + cdef class CUDA_HOST_NODE_PARAMS_v2_st: """ @@ -13049,18 +12687,18 @@ cdef class CUDA_HOST_NODE_PARAMS_v2_st: Attributes ---------- - {{if 'CUDA_HOST_NODE_PARAMS_v2_st.fn' in found_struct}} + fn : CUhostFn The function to call when the node executes - {{endif}} - {{if 'CUDA_HOST_NODE_PARAMS_v2_st.userData' in found_struct}} + + userData : Any Argument to pass to the function - {{endif}} - {{if 'CUDA_HOST_NODE_PARAMS_v2_st.syncMode' in found_struct}} + + syncMode : unsigned int The sync mode to use for the host task - {{endif}} + Methods ------- @@ -13074,9 +12712,9 @@ cdef class CUDA_HOST_NODE_PARAMS_v2_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_HOST_NODE_PARAMS_v2_st.fn' in found_struct}} + self._fn = CUhostFn(_ptr=&self._pvt_ptr[0].fn) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -13084,28 +12722,28 @@ cdef class CUDA_HOST_NODE_PARAMS_v2_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_HOST_NODE_PARAMS_v2_st.fn' in found_struct}} + try: str_list += ['fn : ' + str(self.fn)] except ValueError: str_list += ['fn : '] - {{endif}} - {{if 'CUDA_HOST_NODE_PARAMS_v2_st.userData' in found_struct}} + + try: str_list += ['userData : ' + hex(self.userData)] except ValueError: str_list += ['userData : '] - {{endif}} - {{if 'CUDA_HOST_NODE_PARAMS_v2_st.syncMode' in found_struct}} + + try: str_list += ['syncMode : ' + str(self.syncMode)] except ValueError: str_list += ['syncMode : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_HOST_NODE_PARAMS_v2_st.fn' in found_struct}} + @property def fn(self): return self._fn @@ -13121,8 +12759,8 @@ cdef class CUDA_HOST_NODE_PARAMS_v2_st: pfn = int(CUhostFn(fn)) cyfn = pfn self._fn._pvt_ptr[0] = cyfn - {{endif}} - {{if 'CUDA_HOST_NODE_PARAMS_v2_st.userData' in found_struct}} + + @property def userData(self): return self._pvt_ptr[0].userData @@ -13130,17 +12768,15 @@ cdef class CUDA_HOST_NODE_PARAMS_v2_st: def userData(self, userData): self._cyuserData = _HelperInputVoidPtr(userData) self._pvt_ptr[0].userData = self._cyuserData.cptr - {{endif}} - {{if 'CUDA_HOST_NODE_PARAMS_v2_st.syncMode' in found_struct}} + + @property def syncMode(self): return self._pvt_ptr[0].syncMode @syncMode.setter def syncMode(self, unsigned int syncMode): self._pvt_ptr[0].syncMode = syncMode - {{endif}} -{{endif}} -{{if 'CUDA_CONDITIONAL_NODE_PARAMS' in found_struct}} + cdef class CUDA_CONDITIONAL_NODE_PARAMS: """ @@ -13148,22 +12784,22 @@ cdef class CUDA_CONDITIONAL_NODE_PARAMS: Attributes ---------- - {{if 'CUDA_CONDITIONAL_NODE_PARAMS.handle' in found_struct}} + handle : CUgraphConditionalHandle Conditional node handle. Handles must be created in advance of creating the node using cuGraphConditionalHandleCreate. - {{endif}} - {{if 'CUDA_CONDITIONAL_NODE_PARAMS.type' in found_struct}} + + type : CUgraphConditionalNodeType Type of conditional node. - {{endif}} - {{if 'CUDA_CONDITIONAL_NODE_PARAMS.size' in found_struct}} + + size : unsigned int Size of graph output array. Allowed values are 1 for CU_GRAPH_COND_TYPE_WHILE, 1 or 2 for CU_GRAPH_COND_TYPE_IF, or any value greater than zero for CU_GRAPH_COND_TYPE_SWITCH. - {{endif}} - {{if 'CUDA_CONDITIONAL_NODE_PARAMS.phGraph_out' in found_struct}} + + phGraph_out : CUgraph CUDA-owned array populated with conditional node child graphs during creation of the node. Valid for the lifetime of the @@ -13181,12 +12817,12 @@ cdef class CUDA_CONDITIONAL_NODE_PARAMS: condition is non-zero. CU_GRAPH_COND_TYPE_SWITCH: phGraph_out[n] is executed when the condition is equal to n. If the condition >= `size`, no body graph is executed. - {{endif}} - {{if 'CUDA_CONDITIONAL_NODE_PARAMS.ctx' in found_struct}} + + ctx : CUcontext Context on which to run the node. Must match context used to create the handle and all body nodes. - {{endif}} + Methods ------- @@ -13200,12 +12836,12 @@ cdef class CUDA_CONDITIONAL_NODE_PARAMS: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_CONDITIONAL_NODE_PARAMS.handle' in found_struct}} + self._handle = CUgraphConditionalHandle(_ptr=&self._pvt_ptr[0].handle) - {{endif}} - {{if 'CUDA_CONDITIONAL_NODE_PARAMS.ctx' in found_struct}} + + self._ctx = CUcontext(_ptr=&self._pvt_ptr[0].ctx) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -13213,40 +12849,40 @@ cdef class CUDA_CONDITIONAL_NODE_PARAMS: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_CONDITIONAL_NODE_PARAMS.handle' in found_struct}} + try: str_list += ['handle : ' + str(self.handle)] except ValueError: str_list += ['handle : '] - {{endif}} - {{if 'CUDA_CONDITIONAL_NODE_PARAMS.type' in found_struct}} + + try: str_list += ['type : ' + str(self.type)] except ValueError: str_list += ['type : '] - {{endif}} - {{if 'CUDA_CONDITIONAL_NODE_PARAMS.size' in found_struct}} + + try: str_list += ['size : ' + str(self.size)] except ValueError: str_list += ['size : '] - {{endif}} - {{if 'CUDA_CONDITIONAL_NODE_PARAMS.phGraph_out' in found_struct}} + + try: str_list += ['phGraph_out : ' + str(self.phGraph_out)] except ValueError: str_list += ['phGraph_out : '] - {{endif}} - {{if 'CUDA_CONDITIONAL_NODE_PARAMS.ctx' in found_struct}} + + try: str_list += ['ctx : ' + str(self.ctx)] except ValueError: str_list += ['ctx : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_CONDITIONAL_NODE_PARAMS.handle' in found_struct}} + @property def handle(self): return self._handle @@ -13263,30 +12899,30 @@ cdef class CUDA_CONDITIONAL_NODE_PARAMS: cyhandle = phandle self._handle._pvt_ptr[0] = cyhandle - {{endif}} - {{if 'CUDA_CONDITIONAL_NODE_PARAMS.type' in found_struct}} - @property + + + @property def type(self): return CUgraphConditionalNodeType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : CUgraphConditionalNodeType): self._pvt_ptr[0].type = int(type) - {{endif}} - {{if 'CUDA_CONDITIONAL_NODE_PARAMS.size' in found_struct}} + + @property def size(self): return self._pvt_ptr[0].size @size.setter def size(self, unsigned int size): self._pvt_ptr[0].size = size - {{endif}} - {{if 'CUDA_CONDITIONAL_NODE_PARAMS.phGraph_out' in found_struct}} + + @property def phGraph_out(self): arrs = [self._pvt_ptr[0].phGraph_out + x*sizeof(cydriver.CUgraph) for x in range(self.size)] return [CUgraph(_ptr=arr) for arr in arrs] - {{endif}} - {{if 'CUDA_CONDITIONAL_NODE_PARAMS.ctx' in found_struct}} + + @property def ctx(self): return self._ctx @@ -13302,9 +12938,7 @@ cdef class CUDA_CONDITIONAL_NODE_PARAMS: pctx = int(CUcontext(ctx)) cyctx = pctx self._ctx._pvt_ptr[0] = cyctx - {{endif}} -{{endif}} -{{if 'CUgraphEdgeData_st' in found_struct}} + cdef class CUgraphEdgeData_st: """ @@ -13315,7 +12949,7 @@ cdef class CUgraphEdgeData_st: Attributes ---------- - {{if 'CUgraphEdgeData_st.from_port' in found_struct}} + from_port : bytes This indicates when the dependency is triggered from the upstream node on the edge. The meaning is specfic to the node type. A value @@ -13326,8 +12960,8 @@ cdef class CUgraphEdgeData_st: CU_GRAPH_KERNEL_NODE_PORT_DEFAULT, CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC, or CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER. - {{endif}} - {{if 'CUgraphEdgeData_st.to_port' in found_struct}} + + to_port : bytes This indicates what portion of the downstream node is dependent on the upstream node or portion thereof (indicated by `from_port`). @@ -13335,18 +12969,18 @@ cdef class CUgraphEdgeData_st: means the entirety of the downstream node is dependent on the upstream work. Currently no node types define non-zero ports. Accordingly, this field must be set to zero. - {{endif}} - {{if 'CUgraphEdgeData_st.type' in found_struct}} + + type : bytes This should be populated with a value from CUgraphDependencyType. (It is typed as char due to compiler-specific layout of bitfields.) See CUgraphDependencyType. - {{endif}} - {{if 'CUgraphEdgeData_st.reserved' in found_struct}} + + reserved : bytes These bytes are unused and must be zeroed. This ensures compatibility if additional fields are added in the future. - {{endif}} + Methods ------- @@ -13367,58 +13001,58 @@ cdef class CUgraphEdgeData_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUgraphEdgeData_st.from_port' in found_struct}} + try: str_list += ['from_port : ' + str(self.from_port)] except ValueError: str_list += ['from_port : '] - {{endif}} - {{if 'CUgraphEdgeData_st.to_port' in found_struct}} + + try: str_list += ['to_port : ' + str(self.to_port)] except ValueError: str_list += ['to_port : '] - {{endif}} - {{if 'CUgraphEdgeData_st.type' in found_struct}} + + try: str_list += ['type : ' + str(self.type)] except ValueError: str_list += ['type : '] - {{endif}} - {{if 'CUgraphEdgeData_st.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 'CUgraphEdgeData_st.from_port' in found_struct}} + @property def from_port(self): return self._pvt_ptr[0].from_port @from_port.setter def from_port(self, unsigned char from_port): self._pvt_ptr[0].from_port = from_port - {{endif}} - {{if 'CUgraphEdgeData_st.to_port' in found_struct}} + + @property def to_port(self): return self._pvt_ptr[0].to_port @to_port.setter def to_port(self, unsigned char to_port): self._pvt_ptr[0].to_port = to_port - {{endif}} - {{if 'CUgraphEdgeData_st.type' in found_struct}} + + @property def type(self): return self._pvt_ptr[0].type @type.setter def type(self, unsigned char type): self._pvt_ptr[0].type = type - {{endif}} - {{if 'CUgraphEdgeData_st.reserved' in found_struct}} + + @property def reserved(self): return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 5) @@ -13428,9 +13062,7 @@ cdef class CUgraphEdgeData_st: raise ValueError("reserved length must be 5, is " + str(len(reserved))) for i, b in enumerate(reserved): self._pvt_ptr[0].reserved[i] = b - {{endif}} -{{endif}} -{{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st' in found_struct}} + cdef class CUDA_GRAPH_INSTANTIATE_PARAMS_st: """ @@ -13438,22 +13070,22 @@ cdef class CUDA_GRAPH_INSTANTIATE_PARAMS_st: Attributes ---------- - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.flags' in found_struct}} + flags : cuuint64_t Instantiation flags - {{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.hUploadStream' in found_struct}} + + hUploadStream : CUstream Upload stream - {{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.hErrNode_out' in found_struct}} + + hErrNode_out : CUgraphNode The node which caused instantiation to fail, if any - {{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.result_out' in found_struct}} + + result_out : CUgraphInstantiateResult Whether instantiation was successful. If it failed, the reason why - {{endif}} + Methods ------- @@ -13467,15 +13099,15 @@ cdef class CUDA_GRAPH_INSTANTIATE_PARAMS_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.flags' in found_struct}} + self._flags = cuuint64_t(_ptr=&self._pvt_ptr[0].flags) - {{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.hUploadStream' in found_struct}} + + self._hUploadStream = CUstream(_ptr=&self._pvt_ptr[0].hUploadStream) - {{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.hErrNode_out' in found_struct}} + + self._hErrNode_out = CUgraphNode(_ptr=&self._pvt_ptr[0].hErrNode_out) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -13483,34 +13115,34 @@ cdef class CUDA_GRAPH_INSTANTIATE_PARAMS_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.flags' in found_struct}} + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.hUploadStream' in found_struct}} + + try: str_list += ['hUploadStream : ' + str(self.hUploadStream)] except ValueError: str_list += ['hUploadStream : '] - {{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.hErrNode_out' in found_struct}} + + try: str_list += ['hErrNode_out : ' + str(self.hErrNode_out)] except ValueError: str_list += ['hErrNode_out : '] - {{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.result_out' in found_struct}} + + try: str_list += ['result_out : ' + str(self.result_out)] except ValueError: str_list += ['result_out : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.flags' in found_struct}} + @property def flags(self): return self._flags @@ -13527,8 +13159,8 @@ cdef class CUDA_GRAPH_INSTANTIATE_PARAMS_st: cyflags = pflags self._flags._pvt_ptr[0] = cyflags - {{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.hUploadStream' in found_struct}} + + @property def hUploadStream(self): return self._hUploadStream @@ -13544,8 +13176,8 @@ cdef class CUDA_GRAPH_INSTANTIATE_PARAMS_st: phUploadStream = int(CUstream(hUploadStream)) cyhUploadStream = phUploadStream self._hUploadStream._pvt_ptr[0] = cyhUploadStream - {{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.hErrNode_out' in found_struct}} + + @property def hErrNode_out(self): return self._hErrNode_out @@ -13561,17 +13193,15 @@ cdef class CUDA_GRAPH_INSTANTIATE_PARAMS_st: phErrNode_out = int(CUgraphNode(hErrNode_out)) cyhErrNode_out = phErrNode_out self._hErrNode_out._pvt_ptr[0] = cyhErrNode_out - {{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st.result_out' in found_struct}} + + @property def result_out(self): return CUgraphInstantiateResult(self._pvt_ptr[0].result_out) @result_out.setter def result_out(self, result_out not None : CUgraphInstantiateResult): self._pvt_ptr[0].result_out = int(result_out) - {{endif}} -{{endif}} -{{if 'CUlaunchMemSyncDomainMap_st' in found_struct}} + cdef class CUlaunchMemSyncDomainMap_st: """ @@ -13585,14 +13215,14 @@ cdef class CUlaunchMemSyncDomainMap_st: Attributes ---------- - {{if 'CUlaunchMemSyncDomainMap_st.default_' in found_struct}} + default_ : bytes The default domain ID to use for designated kernels - {{endif}} - {{if 'CUlaunchMemSyncDomainMap_st.remote' in found_struct}} + + remote : bytes The remote domain ID to use for designated kernels - {{endif}} + Methods ------- @@ -13613,56 +13243,54 @@ cdef class CUlaunchMemSyncDomainMap_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUlaunchMemSyncDomainMap_st.default_' in found_struct}} + try: str_list += ['default_ : ' + str(self.default_)] except ValueError: str_list += ['default_ : '] - {{endif}} - {{if 'CUlaunchMemSyncDomainMap_st.remote' in found_struct}} + + try: str_list += ['remote : ' + str(self.remote)] except ValueError: str_list += ['remote : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUlaunchMemSyncDomainMap_st.default_' in found_struct}} + @property def default_(self): return self._pvt_ptr[0].default_ @default_.setter def default_(self, unsigned char default_): self._pvt_ptr[0].default_ = default_ - {{endif}} - {{if 'CUlaunchMemSyncDomainMap_st.remote' in found_struct}} + + @property def remote(self): return self._pvt_ptr[0].remote @remote.setter def remote(self, unsigned char remote): self._pvt_ptr[0].remote = remote - {{endif}} -{{endif}} -{{if 'CUlaunchAttributeValue_union.clusterDim' in found_struct}} + cdef class anon_struct1: """ Attributes ---------- - {{if 'CUlaunchAttributeValue_union.clusterDim.x' in found_struct}} + x : unsigned int - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterDim.y' in found_struct}} + + y : unsigned int - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterDim.z' in found_struct}} + + z : unsigned int - {{endif}} + Methods ------- @@ -13681,70 +13309,68 @@ cdef class anon_struct1: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUlaunchAttributeValue_union.clusterDim.x' in found_struct}} + try: str_list += ['x : ' + str(self.x)] except ValueError: str_list += ['x : '] - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterDim.y' in found_struct}} + + try: str_list += ['y : ' + str(self.y)] except ValueError: str_list += ['y : '] - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterDim.z' in found_struct}} + + try: str_list += ['z : ' + str(self.z)] except ValueError: str_list += ['z : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUlaunchAttributeValue_union.clusterDim.x' in found_struct}} + @property def x(self): return self._pvt_ptr[0].clusterDim.x @x.setter def x(self, unsigned int x): self._pvt_ptr[0].clusterDim.x = x - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterDim.y' in found_struct}} + + @property def y(self): return self._pvt_ptr[0].clusterDim.y @y.setter def y(self, unsigned int y): self._pvt_ptr[0].clusterDim.y = y - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterDim.z' in found_struct}} + + @property def z(self): return self._pvt_ptr[0].clusterDim.z @z.setter def z(self, unsigned int z): self._pvt_ptr[0].clusterDim.z = z - {{endif}} -{{endif}} -{{if 'CUlaunchAttributeValue_union.programmaticEvent' in found_struct}} + cdef class anon_struct2: """ Attributes ---------- - {{if 'CUlaunchAttributeValue_union.programmaticEvent.event' in found_struct}} + event : CUevent - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticEvent.flags' in found_struct}} + + flags : int - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticEvent.triggerAtBlockStart' in found_struct}} + + triggerAtBlockStart : int - {{endif}} + Methods ------- @@ -13756,9 +13382,9 @@ cdef class anon_struct2: def __init__(self, void_ptr _ptr): pass - {{if 'CUlaunchAttributeValue_union.programmaticEvent.event' in found_struct}} + self._event = CUevent(_ptr=&self._pvt_ptr[0].programmaticEvent.event) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -13766,28 +13392,28 @@ cdef class anon_struct2: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUlaunchAttributeValue_union.programmaticEvent.event' in found_struct}} + try: str_list += ['event : ' + str(self.event)] except ValueError: str_list += ['event : '] - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticEvent.flags' in found_struct}} + + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticEvent.triggerAtBlockStart' in found_struct}} + + try: str_list += ['triggerAtBlockStart : ' + str(self.triggerAtBlockStart)] except ValueError: str_list += ['triggerAtBlockStart : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUlaunchAttributeValue_union.programmaticEvent.event' in found_struct}} + @property def event(self): return self._event @@ -13803,38 +13429,36 @@ cdef class anon_struct2: pevent = int(CUevent(event)) cyevent = pevent self._event._pvt_ptr[0] = cyevent - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticEvent.flags' in found_struct}} + + @property def flags(self): return self._pvt_ptr[0].programmaticEvent.flags @flags.setter def flags(self, int flags): self._pvt_ptr[0].programmaticEvent.flags = flags - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticEvent.triggerAtBlockStart' in found_struct}} + + @property def triggerAtBlockStart(self): return self._pvt_ptr[0].programmaticEvent.triggerAtBlockStart @triggerAtBlockStart.setter def triggerAtBlockStart(self, int triggerAtBlockStart): self._pvt_ptr[0].programmaticEvent.triggerAtBlockStart = triggerAtBlockStart - {{endif}} -{{endif}} -{{if 'CUlaunchAttributeValue_union.launchCompletionEvent' in found_struct}} + cdef class anon_struct3: """ Attributes ---------- - {{if 'CUlaunchAttributeValue_union.launchCompletionEvent.event' in found_struct}} + event : CUevent - {{endif}} - {{if 'CUlaunchAttributeValue_union.launchCompletionEvent.flags' in found_struct}} + + flags : int - {{endif}} + Methods ------- @@ -13846,9 +13470,9 @@ cdef class anon_struct3: def __init__(self, void_ptr _ptr): pass - {{if 'CUlaunchAttributeValue_union.launchCompletionEvent.event' in found_struct}} + self._event = CUevent(_ptr=&self._pvt_ptr[0].launchCompletionEvent.event) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -13856,22 +13480,22 @@ cdef class anon_struct3: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUlaunchAttributeValue_union.launchCompletionEvent.event' in found_struct}} + try: str_list += ['event : ' + str(self.event)] except ValueError: str_list += ['event : '] - {{endif}} - {{if 'CUlaunchAttributeValue_union.launchCompletionEvent.flags' in found_struct}} + + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUlaunchAttributeValue_union.launchCompletionEvent.event' in found_struct}} + @property def event(self): return self._event @@ -13887,34 +13511,32 @@ cdef class anon_struct3: pevent = int(CUevent(event)) cyevent = pevent self._event._pvt_ptr[0] = cyevent - {{endif}} - {{if 'CUlaunchAttributeValue_union.launchCompletionEvent.flags' in found_struct}} + + @property def flags(self): return self._pvt_ptr[0].launchCompletionEvent.flags @flags.setter def flags(self, int flags): self._pvt_ptr[0].launchCompletionEvent.flags = flags - {{endif}} -{{endif}} -{{if 'CUlaunchAttributeValue_union.preferredClusterDim' in found_struct}} + cdef class anon_struct4: """ Attributes ---------- - {{if 'CUlaunchAttributeValue_union.preferredClusterDim.x' in found_struct}} + x : unsigned int - {{endif}} - {{if 'CUlaunchAttributeValue_union.preferredClusterDim.y' in found_struct}} + + y : unsigned int - {{endif}} - {{if 'CUlaunchAttributeValue_union.preferredClusterDim.z' in found_struct}} + + z : unsigned int - {{endif}} + Methods ------- @@ -13933,66 +13555,64 @@ cdef class anon_struct4: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUlaunchAttributeValue_union.preferredClusterDim.x' in found_struct}} + try: str_list += ['x : ' + str(self.x)] except ValueError: str_list += ['x : '] - {{endif}} - {{if 'CUlaunchAttributeValue_union.preferredClusterDim.y' in found_struct}} + + try: str_list += ['y : ' + str(self.y)] except ValueError: str_list += ['y : '] - {{endif}} - {{if 'CUlaunchAttributeValue_union.preferredClusterDim.z' in found_struct}} + + try: str_list += ['z : ' + str(self.z)] except ValueError: str_list += ['z : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUlaunchAttributeValue_union.preferredClusterDim.x' in found_struct}} + @property def x(self): return self._pvt_ptr[0].preferredClusterDim.x @x.setter def x(self, unsigned int x): self._pvt_ptr[0].preferredClusterDim.x = x - {{endif}} - {{if 'CUlaunchAttributeValue_union.preferredClusterDim.y' in found_struct}} + + @property def y(self): return self._pvt_ptr[0].preferredClusterDim.y @y.setter def y(self, unsigned int y): self._pvt_ptr[0].preferredClusterDim.y = y - {{endif}} - {{if 'CUlaunchAttributeValue_union.preferredClusterDim.z' in found_struct}} + + @property def z(self): return self._pvt_ptr[0].preferredClusterDim.z @z.setter def z(self, unsigned int z): self._pvt_ptr[0].preferredClusterDim.z = z - {{endif}} -{{endif}} -{{if 'CUlaunchAttributeValue_union.deviceUpdatableKernelNode' in found_struct}} + cdef class anon_struct5: """ Attributes ---------- - {{if 'CUlaunchAttributeValue_union.deviceUpdatableKernelNode.deviceUpdatable' in found_struct}} + deviceUpdatable : int - {{endif}} - {{if 'CUlaunchAttributeValue_union.deviceUpdatableKernelNode.devNode' in found_struct}} + + devNode : CUgraphDeviceNode - {{endif}} + Methods ------- @@ -14004,9 +13624,9 @@ cdef class anon_struct5: def __init__(self, void_ptr _ptr): pass - {{if 'CUlaunchAttributeValue_union.deviceUpdatableKernelNode.devNode' in found_struct}} + self._devNode = CUgraphDeviceNode(_ptr=&self._pvt_ptr[0].deviceUpdatableKernelNode.devNode) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -14014,30 +13634,30 @@ cdef class anon_struct5: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUlaunchAttributeValue_union.deviceUpdatableKernelNode.deviceUpdatable' in found_struct}} + try: str_list += ['deviceUpdatable : ' + str(self.deviceUpdatable)] except ValueError: str_list += ['deviceUpdatable : '] - {{endif}} - {{if 'CUlaunchAttributeValue_union.deviceUpdatableKernelNode.devNode' in found_struct}} + + try: str_list += ['devNode : ' + str(self.devNode)] except ValueError: str_list += ['devNode : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUlaunchAttributeValue_union.deviceUpdatableKernelNode.deviceUpdatable' in found_struct}} + @property def deviceUpdatable(self): return self._pvt_ptr[0].deviceUpdatableKernelNode.deviceUpdatable @deviceUpdatable.setter def deviceUpdatable(self, int deviceUpdatable): self._pvt_ptr[0].deviceUpdatableKernelNode.deviceUpdatable = deviceUpdatable - {{endif}} - {{if 'CUlaunchAttributeValue_union.deviceUpdatableKernelNode.devNode' in found_struct}} + + @property def devNode(self): return self._devNode @@ -14053,9 +13673,7 @@ cdef class anon_struct5: pdevNode = int(CUgraphDeviceNode(devNode)) cydevNode = pdevNode self._devNode._pvt_ptr[0] = cydevNode - {{endif}} -{{endif}} -{{if 'CUlaunchAttributeValue_union' in found_struct}} + cdef class CUlaunchAttributeValue_union: """ @@ -14063,26 +13681,26 @@ cdef class CUlaunchAttributeValue_union: Attributes ---------- - {{if 'CUlaunchAttributeValue_union.pad' in found_struct}} + pad : bytes - {{endif}} - {{if 'CUlaunchAttributeValue_union.accessPolicyWindow' in found_struct}} + + accessPolicyWindow : CUaccessPolicyWindow Value of launch attribute CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW. - {{endif}} - {{if 'CUlaunchAttributeValue_union.cooperative' in found_struct}} + + cooperative : int Value of launch attribute CU_LAUNCH_ATTRIBUTE_COOPERATIVE. Nonzero indicates a cooperative kernel (see cuLaunchCooperativeKernel). - {{endif}} - {{if 'CUlaunchAttributeValue_union.syncPolicy' in found_struct}} + + syncPolicy : CUsynchronizationPolicy Value of launch attribute - CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY. - ::CUsynchronizationPolicy for work queued up in this stream - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterDim' in found_struct}} + CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY. CUsynchronizationPolicy + for work queued up in this stream + + clusterDim : anon_struct1 Value of launch attribute CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION that represents the desired cluster dimensions for the kernel. @@ -14091,19 +13709,19 @@ cdef class CUlaunchAttributeValue_union: - `y` - The Y dimension of the cluster, in blocks. Must be a divisor of the grid Y dimension. - `z` - The Z dimension of the cluster, in blocks. Must be a divisor of the grid Z dimension. - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterSchedulingPolicyPreference' in found_struct}} + + clusterSchedulingPolicyPreference : CUclusterSchedulingPolicy Value of launch attribute CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE. Cluster scheduling policy preference for the kernel. - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticStreamSerializationAllowed' in found_struct}} + + programmaticStreamSerializationAllowed : int Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION. - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticEvent' in found_struct}} + + programmaticEvent : anon_struct2 Value of launch attribute CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT with the following fields: - `CUevent` event - Event to fire when @@ -14111,31 +13729,31 @@ cdef class CUlaunchAttributeValue_union: cuEventRecordWithFlags. Does not accept :CU_EVENT_RECORD_EXTERNAL. - `triggerAtBlockStart` - If this is set to non-0, each block launch will automatically trigger the event. - {{endif}} - {{if 'CUlaunchAttributeValue_union.launchCompletionEvent' in found_struct}} + + launchCompletionEvent : anon_struct3 Value of launch attribute CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT with the following fields: - `CUevent` event - Event to fire when the last block launches - `int` flags; - Event record flags, see cuEventRecordWithFlags. Does not accept CU_EVENT_RECORD_EXTERNAL. - {{endif}} - {{if 'CUlaunchAttributeValue_union.priority' in found_struct}} + + priority : int Value of launch attribute CU_LAUNCH_ATTRIBUTE_PRIORITY. Execution priority of the kernel. - {{endif}} - {{if 'CUlaunchAttributeValue_union.memSyncDomainMap' in found_struct}} + + memSyncDomainMap : CUlaunchMemSyncDomainMap Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP. See CUlaunchMemSyncDomainMap. - {{endif}} - {{if 'CUlaunchAttributeValue_union.memSyncDomain' in found_struct}} + + memSyncDomain : CUlaunchMemSyncDomain Value of launch attribute CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN. See::CUlaunchMemSyncDomain - {{endif}} - {{if 'CUlaunchAttributeValue_union.preferredClusterDim' in found_struct}} + + preferredClusterDim : anon_struct4 Value of launch attribute CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION that represents the @@ -14149,8 +13767,8 @@ cdef class CUlaunchAttributeValue_union: CUlaunchAttributeValue::clusterDim. - `z` - The Z dimension of the preferred cluster, in blocks. Must be equal to the `z` field of CUlaunchAttributeValue::clusterDim. - {{endif}} - {{if 'CUlaunchAttributeValue_union.deviceUpdatableKernelNode' in found_struct}} + + deviceUpdatableKernelNode : anon_struct5 Value of launch attribute CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE. with the @@ -14158,26 +13776,26 @@ cdef class CUlaunchAttributeValue_union: resulting kernel node should be device-updatable. - `CUgraphDeviceNode` devNode - Returns a handle to pass to the various device-side update functions. - {{endif}} - {{if 'CUlaunchAttributeValue_union.sharedMemCarveout' in found_struct}} + + sharedMemCarveout : unsigned int Value of launch attribute CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. - {{endif}} - {{if 'CUlaunchAttributeValue_union.nvlinkUtilCentricScheduling' in found_struct}} + + nvlinkUtilCentricScheduling : unsigned int - {{endif}} - {{if 'CUlaunchAttributeValue_union.portableClusterSizeMode' in found_struct}} + + portableClusterSizeMode : CUlaunchAttributePortableClusterMode Value of launch attribute CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE. - {{endif}} - {{if 'CUlaunchAttributeValue_union.sharedMemoryMode' in found_struct}} + + sharedMemoryMode : CUsharedMemoryMode Value of launch attribute CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE. See CUsharedMemoryMode for acceptable values. - {{endif}} + Methods ------- @@ -14191,27 +13809,27 @@ cdef class CUlaunchAttributeValue_union: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUlaunchAttributeValue_union.accessPolicyWindow' in found_struct}} + self._accessPolicyWindow = CUaccessPolicyWindow(_ptr=&self._pvt_ptr[0].accessPolicyWindow) - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterDim' in found_struct}} + + self._clusterDim = anon_struct1(_ptr=self._pvt_ptr) - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticEvent' in found_struct}} + + self._programmaticEvent = anon_struct2(_ptr=self._pvt_ptr) - {{endif}} - {{if 'CUlaunchAttributeValue_union.launchCompletionEvent' in found_struct}} + + self._launchCompletionEvent = anon_struct3(_ptr=self._pvt_ptr) - {{endif}} - {{if 'CUlaunchAttributeValue_union.memSyncDomainMap' in found_struct}} + + self._memSyncDomainMap = CUlaunchMemSyncDomainMap(_ptr=&self._pvt_ptr[0].memSyncDomainMap) - {{endif}} - {{if 'CUlaunchAttributeValue_union.preferredClusterDim' in found_struct}} + + self._preferredClusterDim = anon_struct4(_ptr=self._pvt_ptr) - {{endif}} - {{if 'CUlaunchAttributeValue_union.deviceUpdatableKernelNode' in found_struct}} + + self._deviceUpdatableKernelNode = anon_struct5(_ptr=self._pvt_ptr) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -14219,118 +13837,118 @@ cdef class CUlaunchAttributeValue_union: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUlaunchAttributeValue_union.pad' in found_struct}} + try: str_list += ['pad : ' + str(self.pad)] except ValueError: str_list += ['pad : '] - {{endif}} - {{if 'CUlaunchAttributeValue_union.accessPolicyWindow' in found_struct}} + + try: str_list += ['accessPolicyWindow :\n' + '\n'.join([' ' + line for line in str(self.accessPolicyWindow).splitlines()])] except ValueError: str_list += ['accessPolicyWindow : '] - {{endif}} - {{if 'CUlaunchAttributeValue_union.cooperative' in found_struct}} + + try: str_list += ['cooperative : ' + str(self.cooperative)] except ValueError: str_list += ['cooperative : '] - {{endif}} - {{if 'CUlaunchAttributeValue_union.syncPolicy' in found_struct}} + + try: str_list += ['syncPolicy : ' + str(self.syncPolicy)] except ValueError: str_list += ['syncPolicy : '] - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterDim' in found_struct}} + + try: str_list += ['clusterDim :\n' + '\n'.join([' ' + line for line in str(self.clusterDim).splitlines()])] except ValueError: str_list += ['clusterDim : '] - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterSchedulingPolicyPreference' in found_struct}} + + try: str_list += ['clusterSchedulingPolicyPreference : ' + str(self.clusterSchedulingPolicyPreference)] except ValueError: str_list += ['clusterSchedulingPolicyPreference : '] - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticStreamSerializationAllowed' in found_struct}} + + try: str_list += ['programmaticStreamSerializationAllowed : ' + str(self.programmaticStreamSerializationAllowed)] except ValueError: str_list += ['programmaticStreamSerializationAllowed : '] - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticEvent' in found_struct}} + + try: str_list += ['programmaticEvent :\n' + '\n'.join([' ' + line for line in str(self.programmaticEvent).splitlines()])] except ValueError: str_list += ['programmaticEvent : '] - {{endif}} - {{if 'CUlaunchAttributeValue_union.launchCompletionEvent' in found_struct}} + + try: str_list += ['launchCompletionEvent :\n' + '\n'.join([' ' + line for line in str(self.launchCompletionEvent).splitlines()])] except ValueError: str_list += ['launchCompletionEvent : '] - {{endif}} - {{if 'CUlaunchAttributeValue_union.priority' in found_struct}} + + try: str_list += ['priority : ' + str(self.priority)] except ValueError: str_list += ['priority : '] - {{endif}} - {{if 'CUlaunchAttributeValue_union.memSyncDomainMap' in found_struct}} + + try: str_list += ['memSyncDomainMap :\n' + '\n'.join([' ' + line for line in str(self.memSyncDomainMap).splitlines()])] except ValueError: str_list += ['memSyncDomainMap : '] - {{endif}} - {{if 'CUlaunchAttributeValue_union.memSyncDomain' in found_struct}} + + try: str_list += ['memSyncDomain : ' + str(self.memSyncDomain)] except ValueError: str_list += ['memSyncDomain : '] - {{endif}} - {{if 'CUlaunchAttributeValue_union.preferredClusterDim' in found_struct}} + + try: str_list += ['preferredClusterDim :\n' + '\n'.join([' ' + line for line in str(self.preferredClusterDim).splitlines()])] except ValueError: str_list += ['preferredClusterDim : '] - {{endif}} - {{if 'CUlaunchAttributeValue_union.deviceUpdatableKernelNode' in found_struct}} + + try: str_list += ['deviceUpdatableKernelNode :\n' + '\n'.join([' ' + line for line in str(self.deviceUpdatableKernelNode).splitlines()])] except ValueError: str_list += ['deviceUpdatableKernelNode : '] - {{endif}} - {{if 'CUlaunchAttributeValue_union.sharedMemCarveout' in found_struct}} + + try: str_list += ['sharedMemCarveout : ' + str(self.sharedMemCarveout)] 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}} - {{if 'CUlaunchAttributeValue_union.portableClusterSizeMode' in found_struct}} + + try: str_list += ['portableClusterSizeMode : ' + str(self.portableClusterSizeMode)] except ValueError: str_list += ['portableClusterSizeMode : '] - {{endif}} - {{if 'CUlaunchAttributeValue_union.sharedMemoryMode' in found_struct}} + + try: str_list += ['sharedMemoryMode : ' + str(self.sharedMemoryMode)] except ValueError: str_list += ['sharedMemoryMode : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUlaunchAttributeValue_union.pad' in found_struct}} + @property def pad(self): return PyBytes_FromStringAndSize(self._pvt_ptr[0].pad, 64) @@ -14348,145 +13966,143 @@ cdef class CUlaunchAttributeValue_union: if b > 127 and b < 256: b = b - 256 self._pvt_ptr[0].pad[i] = b - {{endif}} - {{if 'CUlaunchAttributeValue_union.accessPolicyWindow' in found_struct}} + + @property def accessPolicyWindow(self): return self._accessPolicyWindow @accessPolicyWindow.setter def accessPolicyWindow(self, accessPolicyWindow not None : CUaccessPolicyWindow): - string.memcpy(&self._pvt_ptr[0].accessPolicyWindow, accessPolicyWindow.getPtr(), sizeof(self._pvt_ptr[0].accessPolicyWindow)) - {{endif}} - {{if 'CUlaunchAttributeValue_union.cooperative' in found_struct}} + string.memcpy(&self._pvt_ptr[0].accessPolicyWindow, accessPolicyWindow.getPtr(), sizeof(self._pvt_ptr[0].accessPolicyWindow)) + + @property def cooperative(self): return self._pvt_ptr[0].cooperative @cooperative.setter def cooperative(self, int cooperative): self._pvt_ptr[0].cooperative = cooperative - {{endif}} - {{if 'CUlaunchAttributeValue_union.syncPolicy' in found_struct}} + + @property def syncPolicy(self): return CUsynchronizationPolicy(self._pvt_ptr[0].syncPolicy) @syncPolicy.setter def syncPolicy(self, syncPolicy not None : CUsynchronizationPolicy): self._pvt_ptr[0].syncPolicy = int(syncPolicy) - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterDim' in found_struct}} + + @property def clusterDim(self): return self._clusterDim @clusterDim.setter def clusterDim(self, clusterDim not None : anon_struct1): - string.memcpy(&self._pvt_ptr[0].clusterDim, clusterDim.getPtr(), sizeof(self._pvt_ptr[0].clusterDim)) - {{endif}} - {{if 'CUlaunchAttributeValue_union.clusterSchedulingPolicyPreference' in found_struct}} + string.memcpy(&self._pvt_ptr[0].clusterDim, clusterDim.getPtr(), sizeof(self._pvt_ptr[0].clusterDim)) + + @property def clusterSchedulingPolicyPreference(self): return CUclusterSchedulingPolicy(self._pvt_ptr[0].clusterSchedulingPolicyPreference) @clusterSchedulingPolicyPreference.setter def clusterSchedulingPolicyPreference(self, clusterSchedulingPolicyPreference not None : CUclusterSchedulingPolicy): self._pvt_ptr[0].clusterSchedulingPolicyPreference = int(clusterSchedulingPolicyPreference) - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticStreamSerializationAllowed' in found_struct}} + + @property def programmaticStreamSerializationAllowed(self): return self._pvt_ptr[0].programmaticStreamSerializationAllowed @programmaticStreamSerializationAllowed.setter def programmaticStreamSerializationAllowed(self, int programmaticStreamSerializationAllowed): self._pvt_ptr[0].programmaticStreamSerializationAllowed = programmaticStreamSerializationAllowed - {{endif}} - {{if 'CUlaunchAttributeValue_union.programmaticEvent' in found_struct}} + + @property def programmaticEvent(self): return self._programmaticEvent @programmaticEvent.setter def programmaticEvent(self, programmaticEvent not None : anon_struct2): - string.memcpy(&self._pvt_ptr[0].programmaticEvent, programmaticEvent.getPtr(), sizeof(self._pvt_ptr[0].programmaticEvent)) - {{endif}} - {{if 'CUlaunchAttributeValue_union.launchCompletionEvent' in found_struct}} + string.memcpy(&self._pvt_ptr[0].programmaticEvent, programmaticEvent.getPtr(), sizeof(self._pvt_ptr[0].programmaticEvent)) + + @property def launchCompletionEvent(self): return self._launchCompletionEvent @launchCompletionEvent.setter def launchCompletionEvent(self, launchCompletionEvent not None : anon_struct3): - string.memcpy(&self._pvt_ptr[0].launchCompletionEvent, launchCompletionEvent.getPtr(), sizeof(self._pvt_ptr[0].launchCompletionEvent)) - {{endif}} - {{if 'CUlaunchAttributeValue_union.priority' in found_struct}} + string.memcpy(&self._pvt_ptr[0].launchCompletionEvent, launchCompletionEvent.getPtr(), sizeof(self._pvt_ptr[0].launchCompletionEvent)) + + @property def priority(self): return self._pvt_ptr[0].priority @priority.setter def priority(self, int priority): self._pvt_ptr[0].priority = priority - {{endif}} - {{if 'CUlaunchAttributeValue_union.memSyncDomainMap' in found_struct}} + + @property def memSyncDomainMap(self): return self._memSyncDomainMap @memSyncDomainMap.setter def memSyncDomainMap(self, memSyncDomainMap not None : CUlaunchMemSyncDomainMap): - string.memcpy(&self._pvt_ptr[0].memSyncDomainMap, memSyncDomainMap.getPtr(), sizeof(self._pvt_ptr[0].memSyncDomainMap)) - {{endif}} - {{if 'CUlaunchAttributeValue_union.memSyncDomain' in found_struct}} + string.memcpy(&self._pvt_ptr[0].memSyncDomainMap, memSyncDomainMap.getPtr(), sizeof(self._pvt_ptr[0].memSyncDomainMap)) + + @property def memSyncDomain(self): return CUlaunchMemSyncDomain(self._pvt_ptr[0].memSyncDomain) @memSyncDomain.setter def memSyncDomain(self, memSyncDomain not None : CUlaunchMemSyncDomain): self._pvt_ptr[0].memSyncDomain = int(memSyncDomain) - {{endif}} - {{if 'CUlaunchAttributeValue_union.preferredClusterDim' in found_struct}} + + @property def preferredClusterDim(self): return self._preferredClusterDim @preferredClusterDim.setter def preferredClusterDim(self, preferredClusterDim not None : anon_struct4): - string.memcpy(&self._pvt_ptr[0].preferredClusterDim, preferredClusterDim.getPtr(), sizeof(self._pvt_ptr[0].preferredClusterDim)) - {{endif}} - {{if 'CUlaunchAttributeValue_union.deviceUpdatableKernelNode' in found_struct}} + string.memcpy(&self._pvt_ptr[0].preferredClusterDim, preferredClusterDim.getPtr(), sizeof(self._pvt_ptr[0].preferredClusterDim)) + + @property def deviceUpdatableKernelNode(self): return self._deviceUpdatableKernelNode @deviceUpdatableKernelNode.setter def deviceUpdatableKernelNode(self, deviceUpdatableKernelNode not None : anon_struct5): - string.memcpy(&self._pvt_ptr[0].deviceUpdatableKernelNode, deviceUpdatableKernelNode.getPtr(), sizeof(self._pvt_ptr[0].deviceUpdatableKernelNode)) - {{endif}} - {{if 'CUlaunchAttributeValue_union.sharedMemCarveout' in found_struct}} + string.memcpy(&self._pvt_ptr[0].deviceUpdatableKernelNode, deviceUpdatableKernelNode.getPtr(), sizeof(self._pvt_ptr[0].deviceUpdatableKernelNode)) + + @property def sharedMemCarveout(self): return self._pvt_ptr[0].sharedMemCarveout @sharedMemCarveout.setter 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}} - {{if 'CUlaunchAttributeValue_union.portableClusterSizeMode' in found_struct}} + + @property def portableClusterSizeMode(self): return CUlaunchAttributePortableClusterMode(self._pvt_ptr[0].portableClusterSizeMode) @portableClusterSizeMode.setter def portableClusterSizeMode(self, portableClusterSizeMode not None : CUlaunchAttributePortableClusterMode): self._pvt_ptr[0].portableClusterSizeMode = int(portableClusterSizeMode) - {{endif}} - {{if 'CUlaunchAttributeValue_union.sharedMemoryMode' in found_struct}} + + @property def sharedMemoryMode(self): return CUsharedMemoryMode(self._pvt_ptr[0].sharedMemoryMode) @sharedMemoryMode.setter def sharedMemoryMode(self, sharedMemoryMode not None : CUsharedMemoryMode): self._pvt_ptr[0].sharedMemoryMode = int(sharedMemoryMode) - {{endif}} -{{endif}} -{{if 'CUlaunchAttribute_st' in found_struct}} + cdef class CUlaunchAttribute_st: """ @@ -14494,14 +14110,14 @@ cdef class CUlaunchAttribute_st: Attributes ---------- - {{if 'CUlaunchAttribute_st.id' in found_struct}} + id : CUlaunchAttributeID Attribute to set - {{endif}} - {{if 'CUlaunchAttribute_st.value' in found_struct}} + + value : CUlaunchAttributeValue Value of the attribute - {{endif}} + Methods ------- @@ -14515,9 +14131,9 @@ cdef class CUlaunchAttribute_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUlaunchAttribute_st.value' in found_struct}} + self._value = CUlaunchAttributeValue(_ptr=&self._pvt_ptr[0].value) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -14525,39 +14141,37 @@ cdef class CUlaunchAttribute_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUlaunchAttribute_st.id' in found_struct}} + try: str_list += ['id : ' + str(self.id)] except ValueError: str_list += ['id : '] - {{endif}} - {{if 'CUlaunchAttribute_st.value' in found_struct}} + + try: str_list += ['value :\n' + '\n'.join([' ' + line for line in str(self.value).splitlines()])] except ValueError: str_list += ['value : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUlaunchAttribute_st.id' in found_struct}} + @property def id(self): return CUlaunchAttributeID(self._pvt_ptr[0].id) @id.setter def id(self, id not None : CUlaunchAttributeID): self._pvt_ptr[0].id = int(id) - {{endif}} - {{if 'CUlaunchAttribute_st.value' in found_struct}} + + @property def value(self): return self._value @value.setter def value(self, value not None : CUlaunchAttributeValue): - string.memcpy(&self._pvt_ptr[0].value, value.getPtr(), sizeof(self._pvt_ptr[0].value)) - {{endif}} -{{endif}} -{{if 'CUlaunchConfig_st' in found_struct}} + string.memcpy(&self._pvt_ptr[0].value, value.getPtr(), sizeof(self._pvt_ptr[0].value)) + cdef class CUlaunchConfig_st: """ @@ -14565,46 +14179,46 @@ cdef class CUlaunchConfig_st: Attributes ---------- - {{if 'CUlaunchConfig_st.gridDimX' in found_struct}} + gridDimX : unsigned int Width of grid in blocks - {{endif}} - {{if 'CUlaunchConfig_st.gridDimY' in found_struct}} + + gridDimY : unsigned int Height of grid in blocks - {{endif}} - {{if 'CUlaunchConfig_st.gridDimZ' in found_struct}} + + gridDimZ : unsigned int Depth of grid in blocks - {{endif}} - {{if 'CUlaunchConfig_st.blockDimX' in found_struct}} + + blockDimX : unsigned int X dimension of each thread block - {{endif}} - {{if 'CUlaunchConfig_st.blockDimY' in found_struct}} + + blockDimY : unsigned int Y dimension of each thread block - {{endif}} - {{if 'CUlaunchConfig_st.blockDimZ' in found_struct}} + + blockDimZ : unsigned int Z dimension of each thread block - {{endif}} - {{if 'CUlaunchConfig_st.sharedMemBytes' in found_struct}} + + sharedMemBytes : unsigned int Dynamic shared-memory size per thread block in bytes - {{endif}} - {{if 'CUlaunchConfig_st.hStream' in found_struct}} + + hStream : CUstream Stream identifier - {{endif}} - {{if 'CUlaunchConfig_st.attrs' in found_struct}} + + attrs : CUlaunchAttribute List of attributes; nullable if CUlaunchConfig::numAttrs == 0 - {{endif}} - {{if 'CUlaunchConfig_st.numAttrs' in found_struct}} + + numAttrs : unsigned int Number of attributes populated in CUlaunchConfig::attrs - {{endif}} + Methods ------- @@ -14618,140 +14232,141 @@ cdef class CUlaunchConfig_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUlaunchConfig_st.hStream' in found_struct}} + self._hStream = CUstream(_ptr=&self._pvt_ptr[0].hStream) - {{endif}} + def __dealloc__(self): pass - {{if 'CUlaunchConfig_st.attrs' in found_struct}} + if self._attrs is not NULL: free(self._attrs) - {{endif}} + self._pvt_ptr[0].attrs = NULL + def getPtr(self): return self._pvt_ptr def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUlaunchConfig_st.gridDimX' in found_struct}} + try: str_list += ['gridDimX : ' + str(self.gridDimX)] except ValueError: str_list += ['gridDimX : '] - {{endif}} - {{if 'CUlaunchConfig_st.gridDimY' in found_struct}} + + try: str_list += ['gridDimY : ' + str(self.gridDimY)] except ValueError: str_list += ['gridDimY : '] - {{endif}} - {{if 'CUlaunchConfig_st.gridDimZ' in found_struct}} + + try: str_list += ['gridDimZ : ' + str(self.gridDimZ)] except ValueError: str_list += ['gridDimZ : '] - {{endif}} - {{if 'CUlaunchConfig_st.blockDimX' in found_struct}} + + try: str_list += ['blockDimX : ' + str(self.blockDimX)] except ValueError: str_list += ['blockDimX : '] - {{endif}} - {{if 'CUlaunchConfig_st.blockDimY' in found_struct}} + + try: str_list += ['blockDimY : ' + str(self.blockDimY)] except ValueError: str_list += ['blockDimY : '] - {{endif}} - {{if 'CUlaunchConfig_st.blockDimZ' in found_struct}} + + try: str_list += ['blockDimZ : ' + str(self.blockDimZ)] except ValueError: str_list += ['blockDimZ : '] - {{endif}} - {{if 'CUlaunchConfig_st.sharedMemBytes' in found_struct}} + + try: str_list += ['sharedMemBytes : ' + str(self.sharedMemBytes)] except ValueError: str_list += ['sharedMemBytes : '] - {{endif}} - {{if 'CUlaunchConfig_st.hStream' in found_struct}} + + try: str_list += ['hStream : ' + str(self.hStream)] except ValueError: str_list += ['hStream : '] - {{endif}} - {{if 'CUlaunchConfig_st.attrs' in found_struct}} + + try: str_list += ['attrs : ' + str(self.attrs)] except ValueError: str_list += ['attrs : '] - {{endif}} - {{if 'CUlaunchConfig_st.numAttrs' in found_struct}} + + try: str_list += ['numAttrs : ' + str(self.numAttrs)] except ValueError: str_list += ['numAttrs : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUlaunchConfig_st.gridDimX' in found_struct}} + @property def gridDimX(self): return self._pvt_ptr[0].gridDimX @gridDimX.setter def gridDimX(self, unsigned int gridDimX): self._pvt_ptr[0].gridDimX = gridDimX - {{endif}} - {{if 'CUlaunchConfig_st.gridDimY' in found_struct}} + + @property def gridDimY(self): return self._pvt_ptr[0].gridDimY @gridDimY.setter def gridDimY(self, unsigned int gridDimY): self._pvt_ptr[0].gridDimY = gridDimY - {{endif}} - {{if 'CUlaunchConfig_st.gridDimZ' in found_struct}} + + @property def gridDimZ(self): return self._pvt_ptr[0].gridDimZ @gridDimZ.setter def gridDimZ(self, unsigned int gridDimZ): self._pvt_ptr[0].gridDimZ = gridDimZ - {{endif}} - {{if 'CUlaunchConfig_st.blockDimX' in found_struct}} + + @property def blockDimX(self): return self._pvt_ptr[0].blockDimX @blockDimX.setter def blockDimX(self, unsigned int blockDimX): self._pvt_ptr[0].blockDimX = blockDimX - {{endif}} - {{if 'CUlaunchConfig_st.blockDimY' in found_struct}} + + @property def blockDimY(self): return self._pvt_ptr[0].blockDimY @blockDimY.setter def blockDimY(self, unsigned int blockDimY): self._pvt_ptr[0].blockDimY = blockDimY - {{endif}} - {{if 'CUlaunchConfig_st.blockDimZ' in found_struct}} + + @property def blockDimZ(self): return self._pvt_ptr[0].blockDimZ @blockDimZ.setter def blockDimZ(self, unsigned int blockDimZ): self._pvt_ptr[0].blockDimZ = blockDimZ - {{endif}} - {{if 'CUlaunchConfig_st.sharedMemBytes' in found_struct}} + + @property def sharedMemBytes(self): return self._pvt_ptr[0].sharedMemBytes @sharedMemBytes.setter def sharedMemBytes(self, unsigned int sharedMemBytes): self._pvt_ptr[0].sharedMemBytes = sharedMemBytes - {{endif}} - {{if 'CUlaunchConfig_st.hStream' in found_struct}} + + @property def hStream(self): return self._hStream @@ -14767,8 +14382,8 @@ cdef class CUlaunchConfig_st: phStream = int(CUstream(hStream)) cyhStream = phStream self._hStream._pvt_ptr[0] = cyhStream - {{endif}} - {{if 'CUlaunchConfig_st.attrs' in found_struct}} + + @property def attrs(self): arrs = [self._pvt_ptr[0].attrs + x*sizeof(cydriver.CUlaunchAttribute) for x in range(self._attrs_length)] @@ -14777,6 +14392,7 @@ cdef class CUlaunchConfig_st: def attrs(self, val): if len(val) == 0: free(self._attrs) + self._attrs = NULL self._attrs_length = 0 self._pvt_ptr[0].attrs = NULL else: @@ -14790,17 +14406,15 @@ cdef class CUlaunchConfig_st: for idx in range(len(val)): string.memcpy(&self._attrs[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUlaunchAttribute)) - {{endif}} - {{if 'CUlaunchConfig_st.numAttrs' in found_struct}} + + @property def numAttrs(self): return self._pvt_ptr[0].numAttrs @numAttrs.setter def numAttrs(self, unsigned int numAttrs): self._pvt_ptr[0].numAttrs = numAttrs - {{endif}} -{{endif}} -{{if 'CUexecAffinitySmCount_st' in found_struct}} + cdef class CUexecAffinitySmCount_st: """ @@ -14808,10 +14422,10 @@ cdef class CUexecAffinitySmCount_st: Attributes ---------- - {{if 'CUexecAffinitySmCount_st.val' in found_struct}} + val : unsigned int The number of SMs the context is limited to use. - {{endif}} + Methods ------- @@ -14832,34 +14446,32 @@ cdef class CUexecAffinitySmCount_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUexecAffinitySmCount_st.val' in found_struct}} + try: str_list += ['val : ' + str(self.val)] except ValueError: str_list += ['val : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUexecAffinitySmCount_st.val' in found_struct}} + @property def val(self): return self._pvt_ptr[0].val @val.setter def val(self, unsigned int val): self._pvt_ptr[0].val = val - {{endif}} -{{endif}} -{{if 'CUexecAffinityParam_st.param' in found_struct}} + cdef class anon_union3: """ Attributes ---------- - {{if 'CUexecAffinityParam_st.param.smCount' in found_struct}} + smCount : CUexecAffinitySmCount - {{endif}} + Methods ------- @@ -14871,9 +14483,9 @@ cdef class anon_union3: def __init__(self, void_ptr _ptr): pass - {{if 'CUexecAffinityParam_st.param.smCount' in found_struct}} + self._smCount = CUexecAffinitySmCount(_ptr=&self._pvt_ptr[0].param.smCount) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -14881,25 +14493,23 @@ cdef class anon_union3: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUexecAffinityParam_st.param.smCount' in found_struct}} + try: str_list += ['smCount :\n' + '\n'.join([' ' + line for line in str(self.smCount).splitlines()])] except ValueError: str_list += ['smCount : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUexecAffinityParam_st.param.smCount' in found_struct}} + @property def smCount(self): return self._smCount @smCount.setter def smCount(self, smCount not None : CUexecAffinitySmCount): - string.memcpy(&self._pvt_ptr[0].param.smCount, smCount.getPtr(), sizeof(self._pvt_ptr[0].param.smCount)) - {{endif}} -{{endif}} -{{if 'CUexecAffinityParam_st' in found_struct}} + string.memcpy(&self._pvt_ptr[0].param.smCount, smCount.getPtr(), sizeof(self._pvt_ptr[0].param.smCount)) + cdef class CUexecAffinityParam_st: """ @@ -14907,14 +14517,14 @@ cdef class CUexecAffinityParam_st: Attributes ---------- - {{if 'CUexecAffinityParam_st.type' in found_struct}} + type : CUexecAffinityType Type of execution affinity. - {{endif}} - {{if 'CUexecAffinityParam_st.param' in found_struct}} + + param : anon_union3 - {{endif}} + Methods ------- @@ -14929,9 +14539,9 @@ cdef class CUexecAffinityParam_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUexecAffinityParam_st.param' in found_struct}} + self._param = anon_union3(_ptr=self._pvt_ptr) - {{endif}} + def __dealloc__(self): if self._val_ptr is not NULL: free(self._val_ptr) @@ -14940,39 +14550,37 @@ cdef class CUexecAffinityParam_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUexecAffinityParam_st.type' in found_struct}} + try: str_list += ['type : ' + str(self.type)] except ValueError: str_list += ['type : '] - {{endif}} - {{if 'CUexecAffinityParam_st.param' in found_struct}} + + try: str_list += ['param :\n' + '\n'.join([' ' + line for line in str(self.param).splitlines()])] except ValueError: str_list += ['param : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUexecAffinityParam_st.type' in found_struct}} + @property def type(self): return CUexecAffinityType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : CUexecAffinityType): self._pvt_ptr[0].type = int(type) - {{endif}} - {{if 'CUexecAffinityParam_st.param' in found_struct}} + + @property def param(self): return self._param @param.setter def param(self, param not None : anon_union3): - string.memcpy(&self._pvt_ptr[0].param, param.getPtr(), sizeof(self._pvt_ptr[0].param)) - {{endif}} -{{endif}} -{{if 'CUctxCigParam_st' in found_struct}} + string.memcpy(&self._pvt_ptr[0].param, param.getPtr(), sizeof(self._pvt_ptr[0].param)) + cdef class CUctxCigParam_st: """ @@ -14980,15 +14588,15 @@ cdef class CUctxCigParam_st: Attributes ---------- - {{if 'CUctxCigParam_st.sharedDataType' in found_struct}} + sharedDataType : CUcigDataType Type of shared data from graphics client (D3D12 or Vulkan). - {{endif}} - {{if 'CUctxCigParam_st.sharedData' in found_struct}} + + sharedData : Any Graphics client data handle (ID3D12CommandQueue or Nvidia specific data blob). - {{endif}} + Methods ------- @@ -15009,30 +14617,30 @@ cdef class CUctxCigParam_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUctxCigParam_st.sharedDataType' in found_struct}} + try: str_list += ['sharedDataType : ' + str(self.sharedDataType)] except ValueError: str_list += ['sharedDataType : '] - {{endif}} - {{if 'CUctxCigParam_st.sharedData' in found_struct}} + + try: str_list += ['sharedData : ' + hex(self.sharedData)] except ValueError: str_list += ['sharedData : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUctxCigParam_st.sharedDataType' in found_struct}} + @property def sharedDataType(self): return CUcigDataType(self._pvt_ptr[0].sharedDataType) @sharedDataType.setter def sharedDataType(self, sharedDataType not None : CUcigDataType): self._pvt_ptr[0].sharedDataType = int(sharedDataType) - {{endif}} - {{if 'CUctxCigParam_st.sharedData' in found_struct}} + + @property def sharedData(self): return self._pvt_ptr[0].sharedData @@ -15040,9 +14648,7 @@ cdef class CUctxCigParam_st: def sharedData(self, sharedData): self._cysharedData = _HelperInputVoidPtr(sharedData) self._pvt_ptr[0].sharedData = self._cysharedData.cptr - {{endif}} -{{endif}} -{{if 'CUctxCreateParams_st' in found_struct}} + cdef class CUctxCreateParams_st: """ @@ -15052,23 +14658,23 @@ cdef class CUctxCreateParams_st: Attributes ---------- - {{if 'CUctxCreateParams_st.execAffinityParams' in found_struct}} + execAffinityParams : CUexecAffinityParam Array of execution affinity parameters to limit context resources (e.g., SM count). Only supported Volta+ MPS. Mutually exclusive with cigParams. - {{endif}} - {{if 'CUctxCreateParams_st.numExecAffinityParams' in found_struct}} + + numExecAffinityParams : int Number of elements in execAffinityParams array. Must be 0 if execAffinityParams is NULL. - {{endif}} - {{if 'CUctxCreateParams_st.cigParams' in found_struct}} + + cigParams : CUctxCigParam CIG (CUDA in Graphics) parameters for sharing data from D3D12/Vulkan graphics clients. Mutually exclusive with execAffinityParams. - {{endif}} + Methods ------- @@ -15084,41 +14690,43 @@ cdef class CUctxCreateParams_st: pass def __dealloc__(self): pass - {{if 'CUctxCreateParams_st.execAffinityParams' in found_struct}} + if self._execAffinityParams is not NULL: free(self._execAffinityParams) - {{endif}} - {{if 'CUctxCreateParams_st.cigParams' in found_struct}} + self._pvt_ptr[0].execAffinityParams = NULL + + if self._cigParams is not NULL: free(self._cigParams) - {{endif}} + self._pvt_ptr[0].cigParams = NULL + def getPtr(self): return self._pvt_ptr def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUctxCreateParams_st.execAffinityParams' in found_struct}} + try: str_list += ['execAffinityParams : ' + str(self.execAffinityParams)] except ValueError: str_list += ['execAffinityParams : '] - {{endif}} - {{if 'CUctxCreateParams_st.numExecAffinityParams' in found_struct}} + + try: str_list += ['numExecAffinityParams : ' + str(self.numExecAffinityParams)] except ValueError: str_list += ['numExecAffinityParams : '] - {{endif}} - {{if 'CUctxCreateParams_st.cigParams' in found_struct}} + + try: str_list += ['cigParams : ' + str(self.cigParams)] except ValueError: str_list += ['cigParams : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUctxCreateParams_st.execAffinityParams' in found_struct}} + @property def execAffinityParams(self): arrs = [self._pvt_ptr[0].execAffinityParams + x*sizeof(cydriver.CUexecAffinityParam) for x in range(self._execAffinityParams_length)] @@ -15127,6 +14735,7 @@ cdef class CUctxCreateParams_st: def execAffinityParams(self, val): if len(val) == 0: free(self._execAffinityParams) + self._execAffinityParams = NULL self._execAffinityParams_length = 0 self._pvt_ptr[0].execAffinityParams = NULL else: @@ -15140,16 +14749,16 @@ cdef class CUctxCreateParams_st: for idx in range(len(val)): string.memcpy(&self._execAffinityParams[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUexecAffinityParam)) - {{endif}} - {{if 'CUctxCreateParams_st.numExecAffinityParams' in found_struct}} + + @property def numExecAffinityParams(self): return self._pvt_ptr[0].numExecAffinityParams @numExecAffinityParams.setter def numExecAffinityParams(self, int numExecAffinityParams): self._pvt_ptr[0].numExecAffinityParams = numExecAffinityParams - {{endif}} - {{if 'CUctxCreateParams_st.cigParams' in found_struct}} + + @property def cigParams(self): arrs = [self._pvt_ptr[0].cigParams + x*sizeof(cydriver.CUctxCigParam) for x in range(self._cigParams_length)] @@ -15158,6 +14767,7 @@ cdef class CUctxCreateParams_st: def cigParams(self, val): if len(val) == 0: free(self._cigParams) + self._cigParams = NULL self._cigParams_length = 0 self._pvt_ptr[0].cigParams = NULL else: @@ -15171,9 +14781,7 @@ cdef class CUctxCreateParams_st: for idx in range(len(val)): string.memcpy(&self._cigParams[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUctxCigParam)) - {{endif}} -{{endif}} -{{if 'CUstreamCigParam_st' in found_struct}} + cdef class CUstreamCigParam_st: """ @@ -15181,15 +14789,15 @@ cdef class CUstreamCigParam_st: Attributes ---------- - {{if 'CUstreamCigParam_st.streamSharedDataType' in found_struct}} + streamSharedDataType : CUstreamCigDataType Type of shared data from graphics client (D3D12). - {{endif}} - {{if 'CUstreamCigParam_st.streamSharedData' in found_struct}} + + streamSharedData : Any Graphics client data handle (ID3D12CommandList/ID3D12GraphicsCommandList). - {{endif}} + Methods ------- @@ -15210,30 +14818,30 @@ cdef class CUstreamCigParam_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUstreamCigParam_st.streamSharedDataType' in found_struct}} + try: str_list += ['streamSharedDataType : ' + str(self.streamSharedDataType)] except ValueError: str_list += ['streamSharedDataType : '] - {{endif}} - {{if 'CUstreamCigParam_st.streamSharedData' in found_struct}} + + try: str_list += ['streamSharedData : ' + hex(self.streamSharedData)] except ValueError: str_list += ['streamSharedData : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUstreamCigParam_st.streamSharedDataType' in found_struct}} + @property def streamSharedDataType(self): return CUstreamCigDataType(self._pvt_ptr[0].streamSharedDataType) @streamSharedDataType.setter def streamSharedDataType(self, streamSharedDataType not None : CUstreamCigDataType): self._pvt_ptr[0].streamSharedDataType = int(streamSharedDataType) - {{endif}} - {{if 'CUstreamCigParam_st.streamSharedData' in found_struct}} + + @property def streamSharedData(self): return self._pvt_ptr[0].streamSharedData @@ -15241,9 +14849,7 @@ cdef class CUstreamCigParam_st: def streamSharedData(self, streamSharedData): self._cystreamSharedData = _HelperInputVoidPtr(streamSharedData) self._pvt_ptr[0].streamSharedData = self._cystreamSharedData.cptr - {{endif}} -{{endif}} -{{if 'CUstreamCigCaptureParams_st' in found_struct}} + cdef class CUstreamCigCaptureParams_st: """ @@ -15252,11 +14858,11 @@ cdef class CUstreamCigCaptureParams_st: Attributes ---------- - {{if 'CUstreamCigCaptureParams_st.streamCigParams' in found_struct}} + streamCigParams : CUstreamCigParam CIG (CUDA in Graphics) parameters for sharing command list data from D3D12 graphics clients. - {{endif}} + Methods ------- @@ -15272,25 +14878,26 @@ cdef class CUstreamCigCaptureParams_st: pass def __dealloc__(self): pass - {{if 'CUstreamCigCaptureParams_st.streamCigParams' in found_struct}} + if self._streamCigParams is not NULL: free(self._streamCigParams) - {{endif}} + self._pvt_ptr[0].streamCigParams = NULL + def getPtr(self): return self._pvt_ptr def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUstreamCigCaptureParams_st.streamCigParams' in found_struct}} + try: str_list += ['streamCigParams : ' + str(self.streamCigParams)] except ValueError: str_list += ['streamCigParams : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUstreamCigCaptureParams_st.streamCigParams' in found_struct}} + @property def streamCigParams(self): arrs = [self._pvt_ptr[0].streamCigParams + x*sizeof(cydriver.CUstreamCigParam) for x in range(self._streamCigParams_length)] @@ -15299,6 +14906,7 @@ cdef class CUstreamCigCaptureParams_st: def streamCigParams(self, val): if len(val) == 0: free(self._streamCigParams) + self._streamCigParams = NULL self._streamCigParams_length = 0 self._pvt_ptr[0].streamCigParams = NULL else: @@ -15312,30 +14920,28 @@ cdef class CUstreamCigCaptureParams_st: for idx in range(len(val)): string.memcpy(&self._streamCigParams[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUstreamCigParam)) - {{endif}} -{{endif}} -{{if 'CUlibraryHostUniversalFunctionAndDataTable_st' in found_struct}} + cdef class CUlibraryHostUniversalFunctionAndDataTable_st: """ Attributes ---------- - {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.functionTable' in found_struct}} + functionTable : Any - {{endif}} - {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.functionWindowSize' in found_struct}} + + functionWindowSize : size_t - {{endif}} - {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.dataTable' in found_struct}} + + dataTable : Any - {{endif}} - {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.dataWindowSize' in found_struct}} + + dataWindowSize : size_t - {{endif}} + Methods ------- @@ -15356,34 +14962,34 @@ cdef class CUlibraryHostUniversalFunctionAndDataTable_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.functionTable' in found_struct}} + try: str_list += ['functionTable : ' + hex(self.functionTable)] except ValueError: str_list += ['functionTable : '] - {{endif}} - {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.functionWindowSize' in found_struct}} + + try: str_list += ['functionWindowSize : ' + str(self.functionWindowSize)] except ValueError: str_list += ['functionWindowSize : '] - {{endif}} - {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.dataTable' in found_struct}} + + try: str_list += ['dataTable : ' + hex(self.dataTable)] except ValueError: str_list += ['dataTable : '] - {{endif}} - {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.dataWindowSize' in found_struct}} + + try: str_list += ['dataWindowSize : ' + str(self.dataWindowSize)] except ValueError: str_list += ['dataWindowSize : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.functionTable' in found_struct}} + @property def functionTable(self): return self._pvt_ptr[0].functionTable @@ -15391,16 +14997,16 @@ cdef class CUlibraryHostUniversalFunctionAndDataTable_st: def functionTable(self, functionTable): self._cyfunctionTable = _HelperInputVoidPtr(functionTable) self._pvt_ptr[0].functionTable = self._cyfunctionTable.cptr - {{endif}} - {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.functionWindowSize' in found_struct}} + + @property def functionWindowSize(self): return self._pvt_ptr[0].functionWindowSize @functionWindowSize.setter def functionWindowSize(self, size_t functionWindowSize): self._pvt_ptr[0].functionWindowSize = functionWindowSize - {{endif}} - {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.dataTable' in found_struct}} + + @property def dataTable(self): return self._pvt_ptr[0].dataTable @@ -15408,17 +15014,15 @@ cdef class CUlibraryHostUniversalFunctionAndDataTable_st: def dataTable(self, dataTable): self._cydataTable = _HelperInputVoidPtr(dataTable) self._pvt_ptr[0].dataTable = self._cydataTable.cptr - {{endif}} - {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.dataWindowSize' in found_struct}} + + @property def dataWindowSize(self): return self._pvt_ptr[0].dataWindowSize @dataWindowSize.setter def dataWindowSize(self, size_t dataWindowSize): self._pvt_ptr[0].dataWindowSize = dataWindowSize - {{endif}} -{{endif}} -{{if 'CUDA_MEMCPY2D_st' in found_struct}} + cdef class CUDA_MEMCPY2D_st: """ @@ -15426,70 +15030,70 @@ cdef class CUDA_MEMCPY2D_st: Attributes ---------- - {{if 'CUDA_MEMCPY2D_st.srcXInBytes' in found_struct}} + srcXInBytes : size_t Source X in bytes - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcY' in found_struct}} + + srcY : size_t Source Y - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcMemoryType' in found_struct}} + + srcMemoryType : CUmemorytype Source memory type (host, device, array) - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcHost' in found_struct}} + + srcHost : Any Source host pointer - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcDevice' in found_struct}} + + srcDevice : CUdeviceptr Source device pointer - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcArray' in found_struct}} + + srcArray : CUarray Source array reference - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcPitch' in found_struct}} + + srcPitch : size_t Source pitch (ignored when src is array) - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstXInBytes' in found_struct}} + + dstXInBytes : size_t Destination X in bytes - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstY' in found_struct}} + + dstY : size_t Destination Y - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstMemoryType' in found_struct}} + + dstMemoryType : CUmemorytype Destination memory type (host, device, array) - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstHost' in found_struct}} + + dstHost : Any Destination host pointer - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstDevice' in found_struct}} + + dstDevice : CUdeviceptr Destination device pointer - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstArray' in found_struct}} + + dstArray : CUarray Destination array reference - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstPitch' in found_struct}} + + dstPitch : size_t Destination pitch (ignored when dst is array) - {{endif}} - {{if 'CUDA_MEMCPY2D_st.WidthInBytes' in found_struct}} + + WidthInBytes : size_t Width of 2D memory copy in bytes - {{endif}} - {{if 'CUDA_MEMCPY2D_st.Height' in found_struct}} + + Height : size_t Height of 2D memory copy - {{endif}} + Methods ------- @@ -15503,18 +15107,18 @@ cdef class CUDA_MEMCPY2D_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_MEMCPY2D_st.srcDevice' in found_struct}} + self._srcDevice = CUdeviceptr(_ptr=&self._pvt_ptr[0].srcDevice) - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcArray' in found_struct}} + + self._srcArray = CUarray(_ptr=&self._pvt_ptr[0].srcArray) - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstDevice' in found_struct}} + + self._dstDevice = CUdeviceptr(_ptr=&self._pvt_ptr[0].dstDevice) - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstArray' in found_struct}} + + self._dstArray = CUarray(_ptr=&self._pvt_ptr[0].dstArray) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -15522,130 +15126,130 @@ cdef class CUDA_MEMCPY2D_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_MEMCPY2D_st.srcXInBytes' in found_struct}} + try: str_list += ['srcXInBytes : ' + str(self.srcXInBytes)] except ValueError: str_list += ['srcXInBytes : '] - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcY' in found_struct}} + + try: str_list += ['srcY : ' + str(self.srcY)] except ValueError: str_list += ['srcY : '] - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcMemoryType' in found_struct}} + + try: str_list += ['srcMemoryType : ' + str(self.srcMemoryType)] except ValueError: str_list += ['srcMemoryType : '] - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcHost' in found_struct}} + + try: str_list += ['srcHost : ' + hex(self.srcHost)] except ValueError: str_list += ['srcHost : '] - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcDevice' in found_struct}} + + try: str_list += ['srcDevice : ' + str(self.srcDevice)] except ValueError: str_list += ['srcDevice : '] - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcArray' in found_struct}} + + try: str_list += ['srcArray : ' + str(self.srcArray)] except ValueError: str_list += ['srcArray : '] - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcPitch' in found_struct}} + + try: str_list += ['srcPitch : ' + str(self.srcPitch)] except ValueError: str_list += ['srcPitch : '] - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstXInBytes' in found_struct}} + + try: str_list += ['dstXInBytes : ' + str(self.dstXInBytes)] except ValueError: str_list += ['dstXInBytes : '] - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstY' in found_struct}} + + try: str_list += ['dstY : ' + str(self.dstY)] except ValueError: str_list += ['dstY : '] - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstMemoryType' in found_struct}} + + try: str_list += ['dstMemoryType : ' + str(self.dstMemoryType)] except ValueError: str_list += ['dstMemoryType : '] - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstHost' in found_struct}} + + try: str_list += ['dstHost : ' + hex(self.dstHost)] except ValueError: str_list += ['dstHost : '] - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstDevice' in found_struct}} + + try: str_list += ['dstDevice : ' + str(self.dstDevice)] except ValueError: str_list += ['dstDevice : '] - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstArray' in found_struct}} + + try: str_list += ['dstArray : ' + str(self.dstArray)] except ValueError: str_list += ['dstArray : '] - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstPitch' in found_struct}} + + try: str_list += ['dstPitch : ' + str(self.dstPitch)] except ValueError: str_list += ['dstPitch : '] - {{endif}} - {{if 'CUDA_MEMCPY2D_st.WidthInBytes' in found_struct}} + + try: str_list += ['WidthInBytes : ' + str(self.WidthInBytes)] except ValueError: str_list += ['WidthInBytes : '] - {{endif}} - {{if 'CUDA_MEMCPY2D_st.Height' in found_struct}} + + try: str_list += ['Height : ' + str(self.Height)] except ValueError: str_list += ['Height : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_MEMCPY2D_st.srcXInBytes' in found_struct}} + @property def srcXInBytes(self): return self._pvt_ptr[0].srcXInBytes @srcXInBytes.setter def srcXInBytes(self, size_t srcXInBytes): self._pvt_ptr[0].srcXInBytes = srcXInBytes - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcY' in found_struct}} + + @property def srcY(self): return self._pvt_ptr[0].srcY @srcY.setter def srcY(self, size_t srcY): self._pvt_ptr[0].srcY = srcY - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcMemoryType' in found_struct}} + + @property def srcMemoryType(self): return CUmemorytype(self._pvt_ptr[0].srcMemoryType) @srcMemoryType.setter def srcMemoryType(self, srcMemoryType not None : CUmemorytype): self._pvt_ptr[0].srcMemoryType = int(srcMemoryType) - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcHost' in found_struct}} + + @property def srcHost(self): return self._pvt_ptr[0].srcHost @@ -15653,8 +15257,8 @@ cdef class CUDA_MEMCPY2D_st: def srcHost(self, srcHost): self._cysrcHost = _HelperInputVoidPtr(srcHost) self._pvt_ptr[0].srcHost = self._cysrcHost.cptr - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcDevice' in found_struct}} + + @property def srcDevice(self): return self._srcDevice @@ -15671,8 +15275,8 @@ cdef class CUDA_MEMCPY2D_st: cysrcDevice = psrcDevice self._srcDevice._pvt_ptr[0] = cysrcDevice - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcArray' in found_struct}} + + @property def srcArray(self): return self._srcArray @@ -15688,40 +15292,40 @@ cdef class CUDA_MEMCPY2D_st: psrcArray = int(CUarray(srcArray)) cysrcArray = psrcArray self._srcArray._pvt_ptr[0] = cysrcArray - {{endif}} - {{if 'CUDA_MEMCPY2D_st.srcPitch' in found_struct}} + + @property def srcPitch(self): return self._pvt_ptr[0].srcPitch @srcPitch.setter def srcPitch(self, size_t srcPitch): self._pvt_ptr[0].srcPitch = srcPitch - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstXInBytes' in found_struct}} + + @property def dstXInBytes(self): return self._pvt_ptr[0].dstXInBytes @dstXInBytes.setter def dstXInBytes(self, size_t dstXInBytes): self._pvt_ptr[0].dstXInBytes = dstXInBytes - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstY' in found_struct}} + + @property def dstY(self): return self._pvt_ptr[0].dstY @dstY.setter def dstY(self, size_t dstY): self._pvt_ptr[0].dstY = dstY - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstMemoryType' in found_struct}} + + @property def dstMemoryType(self): return CUmemorytype(self._pvt_ptr[0].dstMemoryType) @dstMemoryType.setter def dstMemoryType(self, dstMemoryType not None : CUmemorytype): self._pvt_ptr[0].dstMemoryType = int(dstMemoryType) - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstHost' in found_struct}} + + @property def dstHost(self): return self._pvt_ptr[0].dstHost @@ -15729,8 +15333,8 @@ cdef class CUDA_MEMCPY2D_st: def dstHost(self, dstHost): self._cydstHost = _HelperInputVoidPtr(dstHost) self._pvt_ptr[0].dstHost = self._cydstHost.cptr - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstDevice' in found_struct}} + + @property def dstDevice(self): return self._dstDevice @@ -15747,8 +15351,8 @@ cdef class CUDA_MEMCPY2D_st: cydstDevice = pdstDevice self._dstDevice._pvt_ptr[0] = cydstDevice - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstArray' in found_struct}} + + @property def dstArray(self): return self._dstArray @@ -15764,33 +15368,31 @@ cdef class CUDA_MEMCPY2D_st: pdstArray = int(CUarray(dstArray)) cydstArray = pdstArray self._dstArray._pvt_ptr[0] = cydstArray - {{endif}} - {{if 'CUDA_MEMCPY2D_st.dstPitch' in found_struct}} + + @property def dstPitch(self): return self._pvt_ptr[0].dstPitch @dstPitch.setter def dstPitch(self, size_t dstPitch): self._pvt_ptr[0].dstPitch = dstPitch - {{endif}} - {{if 'CUDA_MEMCPY2D_st.WidthInBytes' in found_struct}} + + @property def WidthInBytes(self): return self._pvt_ptr[0].WidthInBytes @WidthInBytes.setter def WidthInBytes(self, size_t WidthInBytes): self._pvt_ptr[0].WidthInBytes = WidthInBytes - {{endif}} - {{if 'CUDA_MEMCPY2D_st.Height' in found_struct}} + + @property def Height(self): return self._pvt_ptr[0].Height @Height.setter def Height(self, size_t Height): self._pvt_ptr[0].Height = Height - {{endif}} -{{endif}} -{{if 'CUDA_MEMCPY3D_st' in found_struct}} + cdef class CUDA_MEMCPY3D_st: """ @@ -15798,107 +15400,107 @@ cdef class CUDA_MEMCPY3D_st: Attributes ---------- - {{if 'CUDA_MEMCPY3D_st.srcXInBytes' in found_struct}} + srcXInBytes : size_t Source X in bytes - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcY' in found_struct}} + + srcY : size_t Source Y - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcZ' in found_struct}} + + srcZ : size_t Source Z - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcLOD' in found_struct}} + + srcLOD : size_t Source LOD - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcMemoryType' in found_struct}} + + srcMemoryType : CUmemorytype Source memory type (host, device, array) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcHost' in found_struct}} + + srcHost : Any Source host pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcDevice' in found_struct}} + + srcDevice : CUdeviceptr Source device pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcArray' in found_struct}} + + srcArray : CUarray Source array reference - {{endif}} - {{if 'CUDA_MEMCPY3D_st.reserved0' in found_struct}} + + reserved0 : Any Must be NULL - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcPitch' in found_struct}} + + srcPitch : size_t Source pitch (ignored when src is array) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcHeight' in found_struct}} + + srcHeight : size_t Source height (ignored when src is array; may be 0 if Depth==1) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstXInBytes' in found_struct}} + + dstXInBytes : size_t Destination X in bytes - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstY' in found_struct}} + + dstY : size_t Destination Y - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstZ' in found_struct}} + + dstZ : size_t Destination Z - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstLOD' in found_struct}} + + dstLOD : size_t Destination LOD - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstMemoryType' in found_struct}} + + dstMemoryType : CUmemorytype Destination memory type (host, device, array) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstHost' in found_struct}} + + dstHost : Any Destination host pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstDevice' in found_struct}} + + dstDevice : CUdeviceptr Destination device pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstArray' in found_struct}} + + dstArray : CUarray Destination array reference - {{endif}} - {{if 'CUDA_MEMCPY3D_st.reserved1' in found_struct}} + + reserved1 : Any Must be NULL - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstPitch' in found_struct}} + + dstPitch : size_t Destination pitch (ignored when dst is array) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstHeight' in found_struct}} + + dstHeight : size_t Destination height (ignored when dst is array; may be 0 if Depth==1) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.WidthInBytes' in found_struct}} + + WidthInBytes : size_t Width of 3D memory copy in bytes - {{endif}} - {{if 'CUDA_MEMCPY3D_st.Height' in found_struct}} + + Height : size_t Height of 3D memory copy - {{endif}} - {{if 'CUDA_MEMCPY3D_st.Depth' in found_struct}} + + Depth : size_t Depth of 3D memory copy - {{endif}} + Methods ------- @@ -15912,18 +15514,18 @@ cdef class CUDA_MEMCPY3D_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_MEMCPY3D_st.srcDevice' in found_struct}} + self._srcDevice = CUdeviceptr(_ptr=&self._pvt_ptr[0].srcDevice) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcArray' in found_struct}} + + self._srcArray = CUarray(_ptr=&self._pvt_ptr[0].srcArray) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstDevice' in found_struct}} + + self._dstDevice = CUdeviceptr(_ptr=&self._pvt_ptr[0].dstDevice) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstArray' in found_struct}} + + self._dstArray = CUarray(_ptr=&self._pvt_ptr[0].dstArray) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -15931,200 +15533,200 @@ cdef class CUDA_MEMCPY3D_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_MEMCPY3D_st.srcXInBytes' in found_struct}} + try: str_list += ['srcXInBytes : ' + str(self.srcXInBytes)] except ValueError: str_list += ['srcXInBytes : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcY' in found_struct}} + + try: str_list += ['srcY : ' + str(self.srcY)] except ValueError: str_list += ['srcY : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcZ' in found_struct}} + + try: str_list += ['srcZ : ' + str(self.srcZ)] except ValueError: str_list += ['srcZ : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcLOD' in found_struct}} + + try: str_list += ['srcLOD : ' + str(self.srcLOD)] except ValueError: str_list += ['srcLOD : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcMemoryType' in found_struct}} + + try: str_list += ['srcMemoryType : ' + str(self.srcMemoryType)] except ValueError: str_list += ['srcMemoryType : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcHost' in found_struct}} + + try: str_list += ['srcHost : ' + hex(self.srcHost)] except ValueError: str_list += ['srcHost : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcDevice' in found_struct}} + + try: str_list += ['srcDevice : ' + str(self.srcDevice)] except ValueError: str_list += ['srcDevice : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcArray' in found_struct}} + + try: str_list += ['srcArray : ' + str(self.srcArray)] except ValueError: str_list += ['srcArray : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_st.reserved0' in found_struct}} + + try: str_list += ['reserved0 : ' + hex(self.reserved0)] except ValueError: str_list += ['reserved0 : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcPitch' in found_struct}} + + try: str_list += ['srcPitch : ' + str(self.srcPitch)] except ValueError: str_list += ['srcPitch : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcHeight' in found_struct}} + + try: str_list += ['srcHeight : ' + str(self.srcHeight)] except ValueError: str_list += ['srcHeight : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstXInBytes' in found_struct}} + + try: str_list += ['dstXInBytes : ' + str(self.dstXInBytes)] except ValueError: str_list += ['dstXInBytes : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstY' in found_struct}} + + try: str_list += ['dstY : ' + str(self.dstY)] except ValueError: str_list += ['dstY : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstZ' in found_struct}} + + try: str_list += ['dstZ : ' + str(self.dstZ)] except ValueError: str_list += ['dstZ : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstLOD' in found_struct}} + + try: str_list += ['dstLOD : ' + str(self.dstLOD)] except ValueError: str_list += ['dstLOD : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstMemoryType' in found_struct}} + + try: str_list += ['dstMemoryType : ' + str(self.dstMemoryType)] except ValueError: str_list += ['dstMemoryType : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstHost' in found_struct}} + + try: str_list += ['dstHost : ' + hex(self.dstHost)] except ValueError: str_list += ['dstHost : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstDevice' in found_struct}} + + try: str_list += ['dstDevice : ' + str(self.dstDevice)] except ValueError: str_list += ['dstDevice : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstArray' in found_struct}} + + try: str_list += ['dstArray : ' + str(self.dstArray)] except ValueError: str_list += ['dstArray : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_st.reserved1' in found_struct}} + + try: str_list += ['reserved1 : ' + hex(self.reserved1)] except ValueError: str_list += ['reserved1 : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstPitch' in found_struct}} + + try: str_list += ['dstPitch : ' + str(self.dstPitch)] except ValueError: str_list += ['dstPitch : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstHeight' in found_struct}} + + try: str_list += ['dstHeight : ' + str(self.dstHeight)] except ValueError: str_list += ['dstHeight : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_st.WidthInBytes' in found_struct}} + + try: str_list += ['WidthInBytes : ' + str(self.WidthInBytes)] except ValueError: str_list += ['WidthInBytes : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_st.Height' in found_struct}} + + try: str_list += ['Height : ' + str(self.Height)] except ValueError: str_list += ['Height : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_st.Depth' in found_struct}} + + try: str_list += ['Depth : ' + str(self.Depth)] except ValueError: str_list += ['Depth : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_MEMCPY3D_st.srcXInBytes' in found_struct}} + @property def srcXInBytes(self): return self._pvt_ptr[0].srcXInBytes @srcXInBytes.setter def srcXInBytes(self, size_t srcXInBytes): self._pvt_ptr[0].srcXInBytes = srcXInBytes - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcY' in found_struct}} + + @property def srcY(self): return self._pvt_ptr[0].srcY @srcY.setter def srcY(self, size_t srcY): self._pvt_ptr[0].srcY = srcY - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcZ' in found_struct}} + + @property def srcZ(self): return self._pvt_ptr[0].srcZ @srcZ.setter def srcZ(self, size_t srcZ): self._pvt_ptr[0].srcZ = srcZ - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcLOD' in found_struct}} + + @property def srcLOD(self): return self._pvt_ptr[0].srcLOD @srcLOD.setter def srcLOD(self, size_t srcLOD): self._pvt_ptr[0].srcLOD = srcLOD - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcMemoryType' in found_struct}} + + @property def srcMemoryType(self): return CUmemorytype(self._pvt_ptr[0].srcMemoryType) @srcMemoryType.setter def srcMemoryType(self, srcMemoryType not None : CUmemorytype): self._pvt_ptr[0].srcMemoryType = int(srcMemoryType) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcHost' in found_struct}} + + @property def srcHost(self): return self._pvt_ptr[0].srcHost @@ -16132,8 +15734,8 @@ cdef class CUDA_MEMCPY3D_st: def srcHost(self, srcHost): self._cysrcHost = _HelperInputVoidPtr(srcHost) self._pvt_ptr[0].srcHost = self._cysrcHost.cptr - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcDevice' in found_struct}} + + @property def srcDevice(self): return self._srcDevice @@ -16150,8 +15752,8 @@ cdef class CUDA_MEMCPY3D_st: cysrcDevice = psrcDevice self._srcDevice._pvt_ptr[0] = cysrcDevice - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcArray' in found_struct}} + + @property def srcArray(self): return self._srcArray @@ -16167,8 +15769,8 @@ cdef class CUDA_MEMCPY3D_st: psrcArray = int(CUarray(srcArray)) cysrcArray = psrcArray self._srcArray._pvt_ptr[0] = cysrcArray - {{endif}} - {{if 'CUDA_MEMCPY3D_st.reserved0' in found_struct}} + + @property def reserved0(self): return self._pvt_ptr[0].reserved0 @@ -16176,64 +15778,64 @@ cdef class CUDA_MEMCPY3D_st: def reserved0(self, reserved0): self._cyreserved0 = _HelperInputVoidPtr(reserved0) self._pvt_ptr[0].reserved0 = self._cyreserved0.cptr - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcPitch' in found_struct}} + + @property def srcPitch(self): return self._pvt_ptr[0].srcPitch @srcPitch.setter def srcPitch(self, size_t srcPitch): self._pvt_ptr[0].srcPitch = srcPitch - {{endif}} - {{if 'CUDA_MEMCPY3D_st.srcHeight' in found_struct}} + + @property def srcHeight(self): return self._pvt_ptr[0].srcHeight @srcHeight.setter def srcHeight(self, size_t srcHeight): self._pvt_ptr[0].srcHeight = srcHeight - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstXInBytes' in found_struct}} + + @property def dstXInBytes(self): return self._pvt_ptr[0].dstXInBytes @dstXInBytes.setter def dstXInBytes(self, size_t dstXInBytes): self._pvt_ptr[0].dstXInBytes = dstXInBytes - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstY' in found_struct}} + + @property def dstY(self): return self._pvt_ptr[0].dstY @dstY.setter def dstY(self, size_t dstY): self._pvt_ptr[0].dstY = dstY - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstZ' in found_struct}} + + @property def dstZ(self): return self._pvt_ptr[0].dstZ @dstZ.setter def dstZ(self, size_t dstZ): self._pvt_ptr[0].dstZ = dstZ - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstLOD' in found_struct}} + + @property def dstLOD(self): return self._pvt_ptr[0].dstLOD @dstLOD.setter def dstLOD(self, size_t dstLOD): self._pvt_ptr[0].dstLOD = dstLOD - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstMemoryType' in found_struct}} + + @property def dstMemoryType(self): return CUmemorytype(self._pvt_ptr[0].dstMemoryType) @dstMemoryType.setter def dstMemoryType(self, dstMemoryType not None : CUmemorytype): self._pvt_ptr[0].dstMemoryType = int(dstMemoryType) - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstHost' in found_struct}} + + @property def dstHost(self): return self._pvt_ptr[0].dstHost @@ -16241,8 +15843,8 @@ cdef class CUDA_MEMCPY3D_st: def dstHost(self, dstHost): self._cydstHost = _HelperInputVoidPtr(dstHost) self._pvt_ptr[0].dstHost = self._cydstHost.cptr - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstDevice' in found_struct}} + + @property def dstDevice(self): return self._dstDevice @@ -16259,8 +15861,8 @@ cdef class CUDA_MEMCPY3D_st: cydstDevice = pdstDevice self._dstDevice._pvt_ptr[0] = cydstDevice - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstArray' in found_struct}} + + @property def dstArray(self): return self._dstArray @@ -16276,8 +15878,8 @@ cdef class CUDA_MEMCPY3D_st: pdstArray = int(CUarray(dstArray)) cydstArray = pdstArray self._dstArray._pvt_ptr[0] = cydstArray - {{endif}} - {{if 'CUDA_MEMCPY3D_st.reserved1' in found_struct}} + + @property def reserved1(self): return self._pvt_ptr[0].reserved1 @@ -16285,49 +15887,47 @@ cdef class CUDA_MEMCPY3D_st: def reserved1(self, reserved1): self._cyreserved1 = _HelperInputVoidPtr(reserved1) self._pvt_ptr[0].reserved1 = self._cyreserved1.cptr - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstPitch' in found_struct}} + + @property def dstPitch(self): return self._pvt_ptr[0].dstPitch @dstPitch.setter def dstPitch(self, size_t dstPitch): self._pvt_ptr[0].dstPitch = dstPitch - {{endif}} - {{if 'CUDA_MEMCPY3D_st.dstHeight' in found_struct}} + + @property def dstHeight(self): return self._pvt_ptr[0].dstHeight @dstHeight.setter def dstHeight(self, size_t dstHeight): self._pvt_ptr[0].dstHeight = dstHeight - {{endif}} - {{if 'CUDA_MEMCPY3D_st.WidthInBytes' in found_struct}} + + @property def WidthInBytes(self): return self._pvt_ptr[0].WidthInBytes @WidthInBytes.setter def WidthInBytes(self, size_t WidthInBytes): self._pvt_ptr[0].WidthInBytes = WidthInBytes - {{endif}} - {{if 'CUDA_MEMCPY3D_st.Height' in found_struct}} + + @property def Height(self): return self._pvt_ptr[0].Height @Height.setter def Height(self, size_t Height): self._pvt_ptr[0].Height = Height - {{endif}} - {{if 'CUDA_MEMCPY3D_st.Depth' in found_struct}} + + @property def Depth(self): return self._pvt_ptr[0].Depth @Depth.setter def Depth(self, size_t Depth): self._pvt_ptr[0].Depth = Depth - {{endif}} -{{endif}} -{{if 'CUDA_MEMCPY3D_PEER_st' in found_struct}} + cdef class CUDA_MEMCPY3D_PEER_st: """ @@ -16335,108 +15935,108 @@ cdef class CUDA_MEMCPY3D_PEER_st: Attributes ---------- - {{if 'CUDA_MEMCPY3D_PEER_st.srcXInBytes' in found_struct}} + srcXInBytes : size_t Source X in bytes - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcY' in found_struct}} + + srcY : size_t Source Y - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcZ' in found_struct}} + + srcZ : size_t Source Z - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcLOD' in found_struct}} + + srcLOD : size_t Source LOD - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcMemoryType' in found_struct}} + + srcMemoryType : CUmemorytype Source memory type (host, device, array) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcHost' in found_struct}} + + srcHost : Any Source host pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcDevice' in found_struct}} + + srcDevice : CUdeviceptr Source device pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcArray' in found_struct}} + + srcArray : CUarray Source array reference - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcContext' in found_struct}} + + srcContext : CUcontext Source context (ignored with srcMemoryType is CU_MEMORYTYPE_ARRAY) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcPitch' in found_struct}} + + srcPitch : size_t Source pitch (ignored when src is array) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcHeight' in found_struct}} + + srcHeight : size_t Source height (ignored when src is array; may be 0 if Depth==1) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstXInBytes' in found_struct}} + + dstXInBytes : size_t Destination X in bytes - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstY' in found_struct}} + + dstY : size_t Destination Y - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstZ' in found_struct}} + + dstZ : size_t Destination Z - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstLOD' in found_struct}} + + dstLOD : size_t Destination LOD - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstMemoryType' in found_struct}} + + dstMemoryType : CUmemorytype Destination memory type (host, device, array) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstHost' in found_struct}} + + dstHost : Any Destination host pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstDevice' in found_struct}} + + dstDevice : CUdeviceptr Destination device pointer - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstArray' in found_struct}} + + dstArray : CUarray Destination array reference - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstContext' in found_struct}} + + dstContext : CUcontext Destination context (ignored with dstMemoryType is CU_MEMORYTYPE_ARRAY) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstPitch' in found_struct}} + + dstPitch : size_t Destination pitch (ignored when dst is array) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstHeight' in found_struct}} + + dstHeight : size_t Destination height (ignored when dst is array; may be 0 if Depth==1) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.WidthInBytes' in found_struct}} + + WidthInBytes : size_t Width of 3D memory copy in bytes - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.Height' in found_struct}} + + Height : size_t Height of 3D memory copy - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.Depth' in found_struct}} + + Depth : size_t Depth of 3D memory copy - {{endif}} + Methods ------- @@ -16450,24 +16050,24 @@ cdef class CUDA_MEMCPY3D_PEER_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_MEMCPY3D_PEER_st.srcDevice' in found_struct}} + self._srcDevice = CUdeviceptr(_ptr=&self._pvt_ptr[0].srcDevice) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcArray' in found_struct}} + + self._srcArray = CUarray(_ptr=&self._pvt_ptr[0].srcArray) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcContext' in found_struct}} + + self._srcContext = CUcontext(_ptr=&self._pvt_ptr[0].srcContext) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstDevice' in found_struct}} + + self._dstDevice = CUdeviceptr(_ptr=&self._pvt_ptr[0].dstDevice) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstArray' in found_struct}} + + self._dstArray = CUarray(_ptr=&self._pvt_ptr[0].dstArray) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstContext' in found_struct}} + + self._dstContext = CUcontext(_ptr=&self._pvt_ptr[0].dstContext) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -16475,200 +16075,200 @@ cdef class CUDA_MEMCPY3D_PEER_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_MEMCPY3D_PEER_st.srcXInBytes' in found_struct}} + try: str_list += ['srcXInBytes : ' + str(self.srcXInBytes)] except ValueError: str_list += ['srcXInBytes : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcY' in found_struct}} + + try: str_list += ['srcY : ' + str(self.srcY)] except ValueError: str_list += ['srcY : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcZ' in found_struct}} + + try: str_list += ['srcZ : ' + str(self.srcZ)] except ValueError: str_list += ['srcZ : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcLOD' in found_struct}} + + try: str_list += ['srcLOD : ' + str(self.srcLOD)] except ValueError: str_list += ['srcLOD : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcMemoryType' in found_struct}} + + try: str_list += ['srcMemoryType : ' + str(self.srcMemoryType)] except ValueError: str_list += ['srcMemoryType : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcHost' in found_struct}} + + try: str_list += ['srcHost : ' + hex(self.srcHost)] except ValueError: str_list += ['srcHost : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcDevice' in found_struct}} + + try: str_list += ['srcDevice : ' + str(self.srcDevice)] except ValueError: str_list += ['srcDevice : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcArray' in found_struct}} + + try: str_list += ['srcArray : ' + str(self.srcArray)] except ValueError: str_list += ['srcArray : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcContext' in found_struct}} + + try: str_list += ['srcContext : ' + str(self.srcContext)] except ValueError: str_list += ['srcContext : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcPitch' in found_struct}} + + try: str_list += ['srcPitch : ' + str(self.srcPitch)] except ValueError: str_list += ['srcPitch : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcHeight' in found_struct}} + + try: str_list += ['srcHeight : ' + str(self.srcHeight)] except ValueError: str_list += ['srcHeight : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstXInBytes' in found_struct}} + + try: str_list += ['dstXInBytes : ' + str(self.dstXInBytes)] except ValueError: str_list += ['dstXInBytes : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstY' in found_struct}} + + try: str_list += ['dstY : ' + str(self.dstY)] except ValueError: str_list += ['dstY : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstZ' in found_struct}} + + try: str_list += ['dstZ : ' + str(self.dstZ)] except ValueError: str_list += ['dstZ : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstLOD' in found_struct}} + + try: str_list += ['dstLOD : ' + str(self.dstLOD)] except ValueError: str_list += ['dstLOD : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstMemoryType' in found_struct}} + + try: str_list += ['dstMemoryType : ' + str(self.dstMemoryType)] except ValueError: str_list += ['dstMemoryType : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstHost' in found_struct}} + + try: str_list += ['dstHost : ' + hex(self.dstHost)] except ValueError: str_list += ['dstHost : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstDevice' in found_struct}} + + try: str_list += ['dstDevice : ' + str(self.dstDevice)] except ValueError: str_list += ['dstDevice : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstArray' in found_struct}} + + try: str_list += ['dstArray : ' + str(self.dstArray)] except ValueError: str_list += ['dstArray : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstContext' in found_struct}} + + try: str_list += ['dstContext : ' + str(self.dstContext)] except ValueError: str_list += ['dstContext : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstPitch' in found_struct}} + + try: str_list += ['dstPitch : ' + str(self.dstPitch)] except ValueError: str_list += ['dstPitch : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstHeight' in found_struct}} + + try: str_list += ['dstHeight : ' + str(self.dstHeight)] except ValueError: str_list += ['dstHeight : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.WidthInBytes' in found_struct}} + + try: str_list += ['WidthInBytes : ' + str(self.WidthInBytes)] except ValueError: str_list += ['WidthInBytes : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.Height' in found_struct}} + + try: str_list += ['Height : ' + str(self.Height)] except ValueError: str_list += ['Height : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.Depth' in found_struct}} + + try: str_list += ['Depth : ' + str(self.Depth)] except ValueError: str_list += ['Depth : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_MEMCPY3D_PEER_st.srcXInBytes' in found_struct}} + @property def srcXInBytes(self): return self._pvt_ptr[0].srcXInBytes @srcXInBytes.setter def srcXInBytes(self, size_t srcXInBytes): self._pvt_ptr[0].srcXInBytes = srcXInBytes - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcY' in found_struct}} + + @property def srcY(self): return self._pvt_ptr[0].srcY @srcY.setter def srcY(self, size_t srcY): self._pvt_ptr[0].srcY = srcY - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcZ' in found_struct}} + + @property def srcZ(self): return self._pvt_ptr[0].srcZ @srcZ.setter def srcZ(self, size_t srcZ): self._pvt_ptr[0].srcZ = srcZ - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcLOD' in found_struct}} + + @property def srcLOD(self): return self._pvt_ptr[0].srcLOD @srcLOD.setter def srcLOD(self, size_t srcLOD): self._pvt_ptr[0].srcLOD = srcLOD - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcMemoryType' in found_struct}} + + @property def srcMemoryType(self): return CUmemorytype(self._pvt_ptr[0].srcMemoryType) @srcMemoryType.setter def srcMemoryType(self, srcMemoryType not None : CUmemorytype): self._pvt_ptr[0].srcMemoryType = int(srcMemoryType) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcHost' in found_struct}} + + @property def srcHost(self): return self._pvt_ptr[0].srcHost @@ -16676,8 +16276,8 @@ cdef class CUDA_MEMCPY3D_PEER_st: def srcHost(self, srcHost): self._cysrcHost = _HelperInputVoidPtr(srcHost) self._pvt_ptr[0].srcHost = self._cysrcHost.cptr - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcDevice' in found_struct}} + + @property def srcDevice(self): return self._srcDevice @@ -16694,8 +16294,8 @@ cdef class CUDA_MEMCPY3D_PEER_st: cysrcDevice = psrcDevice self._srcDevice._pvt_ptr[0] = cysrcDevice - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcArray' in found_struct}} + + @property def srcArray(self): return self._srcArray @@ -16711,8 +16311,8 @@ cdef class CUDA_MEMCPY3D_PEER_st: psrcArray = int(CUarray(srcArray)) cysrcArray = psrcArray self._srcArray._pvt_ptr[0] = cysrcArray - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcContext' in found_struct}} + + @property def srcContext(self): return self._srcContext @@ -16728,64 +16328,64 @@ cdef class CUDA_MEMCPY3D_PEER_st: psrcContext = int(CUcontext(srcContext)) cysrcContext = psrcContext self._srcContext._pvt_ptr[0] = cysrcContext - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcPitch' in found_struct}} + + @property def srcPitch(self): return self._pvt_ptr[0].srcPitch @srcPitch.setter def srcPitch(self, size_t srcPitch): self._pvt_ptr[0].srcPitch = srcPitch - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.srcHeight' in found_struct}} + + @property def srcHeight(self): return self._pvt_ptr[0].srcHeight @srcHeight.setter def srcHeight(self, size_t srcHeight): self._pvt_ptr[0].srcHeight = srcHeight - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstXInBytes' in found_struct}} + + @property def dstXInBytes(self): return self._pvt_ptr[0].dstXInBytes @dstXInBytes.setter def dstXInBytes(self, size_t dstXInBytes): self._pvt_ptr[0].dstXInBytes = dstXInBytes - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstY' in found_struct}} + + @property def dstY(self): return self._pvt_ptr[0].dstY @dstY.setter def dstY(self, size_t dstY): self._pvt_ptr[0].dstY = dstY - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstZ' in found_struct}} - @property + + + @property def dstZ(self): return self._pvt_ptr[0].dstZ @dstZ.setter def dstZ(self, size_t dstZ): self._pvt_ptr[0].dstZ = dstZ - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstLOD' in found_struct}} + + @property def dstLOD(self): return self._pvt_ptr[0].dstLOD @dstLOD.setter def dstLOD(self, size_t dstLOD): self._pvt_ptr[0].dstLOD = dstLOD - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstMemoryType' in found_struct}} + + @property def dstMemoryType(self): return CUmemorytype(self._pvt_ptr[0].dstMemoryType) @dstMemoryType.setter def dstMemoryType(self, dstMemoryType not None : CUmemorytype): self._pvt_ptr[0].dstMemoryType = int(dstMemoryType) - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstHost' in found_struct}} + + @property def dstHost(self): return self._pvt_ptr[0].dstHost @@ -16793,8 +16393,8 @@ cdef class CUDA_MEMCPY3D_PEER_st: def dstHost(self, dstHost): self._cydstHost = _HelperInputVoidPtr(dstHost) self._pvt_ptr[0].dstHost = self._cydstHost.cptr - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstDevice' in found_struct}} + + @property def dstDevice(self): return self._dstDevice @@ -16811,8 +16411,8 @@ cdef class CUDA_MEMCPY3D_PEER_st: cydstDevice = pdstDevice self._dstDevice._pvt_ptr[0] = cydstDevice - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstArray' in found_struct}} + + @property def dstArray(self): return self._dstArray @@ -16828,8 +16428,8 @@ cdef class CUDA_MEMCPY3D_PEER_st: pdstArray = int(CUarray(dstArray)) cydstArray = pdstArray self._dstArray._pvt_ptr[0] = cydstArray - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstContext' in found_struct}} + + @property def dstContext(self): return self._dstContext @@ -16845,49 +16445,47 @@ cdef class CUDA_MEMCPY3D_PEER_st: pdstContext = int(CUcontext(dstContext)) cydstContext = pdstContext self._dstContext._pvt_ptr[0] = cydstContext - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstPitch' in found_struct}} + + @property def dstPitch(self): return self._pvt_ptr[0].dstPitch @dstPitch.setter def dstPitch(self, size_t dstPitch): self._pvt_ptr[0].dstPitch = dstPitch - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.dstHeight' in found_struct}} + + @property def dstHeight(self): return self._pvt_ptr[0].dstHeight @dstHeight.setter def dstHeight(self, size_t dstHeight): self._pvt_ptr[0].dstHeight = dstHeight - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.WidthInBytes' in found_struct}} + + @property def WidthInBytes(self): return self._pvt_ptr[0].WidthInBytes @WidthInBytes.setter def WidthInBytes(self, size_t WidthInBytes): self._pvt_ptr[0].WidthInBytes = WidthInBytes - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.Height' in found_struct}} + + @property def Height(self): return self._pvt_ptr[0].Height @Height.setter def Height(self, size_t Height): self._pvt_ptr[0].Height = Height - {{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st.Depth' in found_struct}} + + @property def Depth(self): return self._pvt_ptr[0].Depth @Depth.setter def Depth(self, size_t Depth): self._pvt_ptr[0].Depth = Depth - {{endif}} -{{endif}} -{{if 'CUDA_MEMCPY_NODE_PARAMS_st' in found_struct}} + cdef class CUDA_MEMCPY_NODE_PARAMS_st: """ @@ -16895,22 +16493,22 @@ cdef class CUDA_MEMCPY_NODE_PARAMS_st: Attributes ---------- - {{if 'CUDA_MEMCPY_NODE_PARAMS_st.flags' in found_struct}} + flags : int Must be zero - {{endif}} - {{if 'CUDA_MEMCPY_NODE_PARAMS_st.reserved' in found_struct}} + + reserved : int Must be zero - {{endif}} - {{if 'CUDA_MEMCPY_NODE_PARAMS_st.copyCtx' in found_struct}} + + copyCtx : CUcontext Context on which to run the node - {{endif}} - {{if 'CUDA_MEMCPY_NODE_PARAMS_st.copyParams' in found_struct}} + + copyParams : CUDA_MEMCPY3D Parameters for the memory copy - {{endif}} + Methods ------- @@ -16924,12 +16522,12 @@ cdef class CUDA_MEMCPY_NODE_PARAMS_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_MEMCPY_NODE_PARAMS_st.copyCtx' in found_struct}} + self._copyCtx = CUcontext(_ptr=&self._pvt_ptr[0].copyCtx) - {{endif}} - {{if 'CUDA_MEMCPY_NODE_PARAMS_st.copyParams' in found_struct}} + + self._copyParams = CUDA_MEMCPY3D(_ptr=&self._pvt_ptr[0].copyParams) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -16937,50 +16535,50 @@ cdef class CUDA_MEMCPY_NODE_PARAMS_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_MEMCPY_NODE_PARAMS_st.flags' in found_struct}} + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} - {{if 'CUDA_MEMCPY_NODE_PARAMS_st.reserved' in found_struct}} + + try: str_list += ['reserved : ' + str(self.reserved)] except ValueError: str_list += ['reserved : '] - {{endif}} - {{if 'CUDA_MEMCPY_NODE_PARAMS_st.copyCtx' in found_struct}} + + try: str_list += ['copyCtx : ' + str(self.copyCtx)] except ValueError: str_list += ['copyCtx : '] - {{endif}} - {{if 'CUDA_MEMCPY_NODE_PARAMS_st.copyParams' in found_struct}} + + try: str_list += ['copyParams :\n' + '\n'.join([' ' + line for line in str(self.copyParams).splitlines()])] except ValueError: str_list += ['copyParams : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_MEMCPY_NODE_PARAMS_st.flags' in found_struct}} + @property def flags(self): return self._pvt_ptr[0].flags @flags.setter def flags(self, int flags): self._pvt_ptr[0].flags = flags - {{endif}} - {{if 'CUDA_MEMCPY_NODE_PARAMS_st.reserved' in found_struct}} + + @property def reserved(self): return self._pvt_ptr[0].reserved @reserved.setter def reserved(self, int reserved): self._pvt_ptr[0].reserved = reserved - {{endif}} - {{if 'CUDA_MEMCPY_NODE_PARAMS_st.copyCtx' in found_struct}} + + @property def copyCtx(self): return self._copyCtx @@ -16996,17 +16594,15 @@ cdef class CUDA_MEMCPY_NODE_PARAMS_st: pcopyCtx = int(CUcontext(copyCtx)) cycopyCtx = pcopyCtx self._copyCtx._pvt_ptr[0] = cycopyCtx - {{endif}} - {{if 'CUDA_MEMCPY_NODE_PARAMS_st.copyParams' in found_struct}} + + @property def copyParams(self): return self._copyParams @copyParams.setter def copyParams(self, copyParams not None : CUDA_MEMCPY3D): - string.memcpy(&self._pvt_ptr[0].copyParams, copyParams.getPtr(), sizeof(self._pvt_ptr[0].copyParams)) - {{endif}} -{{endif}} -{{if 'CUDA_ARRAY_DESCRIPTOR_st' in found_struct}} + string.memcpy(&self._pvt_ptr[0].copyParams, copyParams.getPtr(), sizeof(self._pvt_ptr[0].copyParams)) + cdef class CUDA_ARRAY_DESCRIPTOR_st: """ @@ -17014,22 +16610,22 @@ cdef class CUDA_ARRAY_DESCRIPTOR_st: Attributes ---------- - {{if 'CUDA_ARRAY_DESCRIPTOR_st.Width' in found_struct}} + Width : size_t Width of array - {{endif}} - {{if 'CUDA_ARRAY_DESCRIPTOR_st.Height' in found_struct}} + + Height : size_t Height of array - {{endif}} - {{if 'CUDA_ARRAY_DESCRIPTOR_st.Format' in found_struct}} + + Format : CUarray_format Array format - {{endif}} - {{if 'CUDA_ARRAY_DESCRIPTOR_st.NumChannels' in found_struct}} + + NumChannels : unsigned int Channels per array element - {{endif}} + Methods ------- @@ -17050,67 +16646,65 @@ cdef class CUDA_ARRAY_DESCRIPTOR_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_ARRAY_DESCRIPTOR_st.Width' in found_struct}} + try: str_list += ['Width : ' + str(self.Width)] except ValueError: str_list += ['Width : '] - {{endif}} - {{if 'CUDA_ARRAY_DESCRIPTOR_st.Height' in found_struct}} + + try: str_list += ['Height : ' + str(self.Height)] except ValueError: str_list += ['Height : '] - {{endif}} - {{if 'CUDA_ARRAY_DESCRIPTOR_st.Format' in found_struct}} + + try: str_list += ['Format : ' + str(self.Format)] except ValueError: str_list += ['Format : '] - {{endif}} - {{if 'CUDA_ARRAY_DESCRIPTOR_st.NumChannels' in found_struct}} + + try: str_list += ['NumChannels : ' + str(self.NumChannels)] except ValueError: str_list += ['NumChannels : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_ARRAY_DESCRIPTOR_st.Width' in found_struct}} + @property def Width(self): return self._pvt_ptr[0].Width @Width.setter def Width(self, size_t Width): self._pvt_ptr[0].Width = Width - {{endif}} - {{if 'CUDA_ARRAY_DESCRIPTOR_st.Height' in found_struct}} + + @property def Height(self): return self._pvt_ptr[0].Height @Height.setter def Height(self, size_t Height): self._pvt_ptr[0].Height = Height - {{endif}} - {{if 'CUDA_ARRAY_DESCRIPTOR_st.Format' in found_struct}} + + @property def Format(self): return CUarray_format(self._pvt_ptr[0].Format) @Format.setter def Format(self, Format not None : CUarray_format): self._pvt_ptr[0].Format = int(Format) - {{endif}} - {{if 'CUDA_ARRAY_DESCRIPTOR_st.NumChannels' in found_struct}} + + @property def NumChannels(self): return self._pvt_ptr[0].NumChannels @NumChannels.setter def NumChannels(self, unsigned int NumChannels): self._pvt_ptr[0].NumChannels = NumChannels - {{endif}} -{{endif}} -{{if 'CUDA_ARRAY3D_DESCRIPTOR_st' in found_struct}} + cdef class CUDA_ARRAY3D_DESCRIPTOR_st: """ @@ -17118,30 +16712,30 @@ cdef class CUDA_ARRAY3D_DESCRIPTOR_st: Attributes ---------- - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Width' in found_struct}} + Width : size_t Width of 3D array - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Height' in found_struct}} + + Height : size_t Height of 3D array - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Depth' in found_struct}} + + Depth : size_t Depth of 3D array - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Format' in found_struct}} + + Format : CUarray_format Array format - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.NumChannels' in found_struct}} + + NumChannels : unsigned int Channels per array element - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Flags' in found_struct}} + + Flags : unsigned int Flags - {{endif}} + Methods ------- @@ -17162,112 +16756,110 @@ cdef class CUDA_ARRAY3D_DESCRIPTOR_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Width' in found_struct}} + try: str_list += ['Width : ' + str(self.Width)] except ValueError: str_list += ['Width : '] - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Height' in found_struct}} + + try: str_list += ['Height : ' + str(self.Height)] except ValueError: str_list += ['Height : '] - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Depth' in found_struct}} + + try: str_list += ['Depth : ' + str(self.Depth)] except ValueError: str_list += ['Depth : '] - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Format' in found_struct}} + + try: str_list += ['Format : ' + str(self.Format)] except ValueError: str_list += ['Format : '] - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.NumChannels' in found_struct}} + + try: str_list += ['NumChannels : ' + str(self.NumChannels)] except ValueError: str_list += ['NumChannels : '] - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Flags' in found_struct}} + + try: str_list += ['Flags : ' + str(self.Flags)] except ValueError: str_list += ['Flags : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Width' in found_struct}} + @property def Width(self): return self._pvt_ptr[0].Width @Width.setter def Width(self, size_t Width): self._pvt_ptr[0].Width = Width - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Height' in found_struct}} + + @property def Height(self): return self._pvt_ptr[0].Height @Height.setter def Height(self, size_t Height): self._pvt_ptr[0].Height = Height - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Depth' in found_struct}} + + @property def Depth(self): return self._pvt_ptr[0].Depth @Depth.setter def Depth(self, size_t Depth): self._pvt_ptr[0].Depth = Depth - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.Format' in found_struct}} + + @property def Format(self): return CUarray_format(self._pvt_ptr[0].Format) @Format.setter def Format(self, Format not None : CUarray_format): self._pvt_ptr[0].Format = int(Format) - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.NumChannels' in found_struct}} + + @property def NumChannels(self): return self._pvt_ptr[0].NumChannels @NumChannels.setter def NumChannels(self, unsigned int NumChannels): self._pvt_ptr[0].NumChannels = NumChannels - {{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st.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 'CUDA_ARRAY_SPARSE_PROPERTIES_st.tileExtent' in found_struct}} + cdef class anon_struct6: """ Attributes ---------- - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.tileExtent.width' in found_struct}} + width : unsigned int - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.tileExtent.height' in found_struct}} + + height : unsigned int - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.tileExtent.depth' in found_struct}} + + depth : unsigned int - {{endif}} + Methods ------- @@ -17286,53 +16878,51 @@ cdef class anon_struct6: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.tileExtent.width' in found_struct}} + try: str_list += ['width : ' + str(self.width)] except ValueError: str_list += ['width : '] - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.tileExtent.height' in found_struct}} + + try: str_list += ['height : ' + str(self.height)] except ValueError: str_list += ['height : '] - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.tileExtent.depth' in found_struct}} + + try: str_list += ['depth : ' + str(self.depth)] except ValueError: str_list += ['depth : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.tileExtent.width' in found_struct}} + @property def width(self): return self._pvt_ptr[0].tileExtent.width @width.setter def width(self, unsigned int width): self._pvt_ptr[0].tileExtent.width = width - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.tileExtent.height' in found_struct}} + + @property def height(self): return self._pvt_ptr[0].tileExtent.height @height.setter def height(self, unsigned int height): self._pvt_ptr[0].tileExtent.height = height - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.tileExtent.depth' in found_struct}} + + @property def depth(self): return self._pvt_ptr[0].tileExtent.depth @depth.setter def depth(self, unsigned int depth): self._pvt_ptr[0].tileExtent.depth = depth - {{endif}} -{{endif}} -{{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st' in found_struct}} + cdef class CUDA_ARRAY_SPARSE_PROPERTIES_st: """ @@ -17340,27 +16930,27 @@ cdef class CUDA_ARRAY_SPARSE_PROPERTIES_st: Attributes ---------- - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.tileExtent' in found_struct}} + tileExtent : anon_struct6 - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.miptailFirstLevel' in found_struct}} + + miptailFirstLevel : unsigned int First mip level at which the mip tail begins. - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.miptailSize' in found_struct}} + + miptailSize : unsigned long long Total size of the mip tail. - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.flags' in found_struct}} + + flags : unsigned int Flags will either be zero or CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -17374,9 +16964,9 @@ cdef class CUDA_ARRAY_SPARSE_PROPERTIES_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.tileExtent' in found_struct}} + self._tileExtent = anon_struct6(_ptr=self._pvt_ptr) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -17384,81 +16974,79 @@ cdef class CUDA_ARRAY_SPARSE_PROPERTIES_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.tileExtent' in found_struct}} + try: str_list += ['tileExtent :\n' + '\n'.join([' ' + line for line in str(self.tileExtent).splitlines()])] except ValueError: str_list += ['tileExtent : '] - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.miptailFirstLevel' in found_struct}} + + try: str_list += ['miptailFirstLevel : ' + str(self.miptailFirstLevel)] except ValueError: str_list += ['miptailFirstLevel : '] - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.miptailSize' in found_struct}} + + try: str_list += ['miptailSize : ' + str(self.miptailSize)] except ValueError: str_list += ['miptailSize : '] - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.flags' in found_struct}} + + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.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 'CUDA_ARRAY_SPARSE_PROPERTIES_st.tileExtent' in found_struct}} + @property def tileExtent(self): return self._tileExtent @tileExtent.setter def tileExtent(self, tileExtent not None : anon_struct6): - string.memcpy(&self._pvt_ptr[0].tileExtent, tileExtent.getPtr(), sizeof(self._pvt_ptr[0].tileExtent)) - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.miptailFirstLevel' in found_struct}} + string.memcpy(&self._pvt_ptr[0].tileExtent, tileExtent.getPtr(), sizeof(self._pvt_ptr[0].tileExtent)) + + @property def miptailFirstLevel(self): return self._pvt_ptr[0].miptailFirstLevel @miptailFirstLevel.setter def miptailFirstLevel(self, unsigned int miptailFirstLevel): self._pvt_ptr[0].miptailFirstLevel = miptailFirstLevel - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.miptailSize' in found_struct}} + + @property def miptailSize(self): return self._pvt_ptr[0].miptailSize @miptailSize.setter def miptailSize(self, unsigned long long miptailSize): self._pvt_ptr[0].miptailSize = miptailSize - {{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.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}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.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 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st' in found_struct}} + cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS_st: """ @@ -17466,18 +17054,18 @@ cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS_st: Attributes ---------- - {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.size' in found_struct}} + size : size_t Total required memory size - {{endif}} - {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.alignment' in found_struct}} + + alignment : size_t alignment requirement - {{endif}} - {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -17498,62 +17086,60 @@ cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.size' in found_struct}} + try: str_list += ['size : ' + str(self.size)] except ValueError: str_list += ['size : '] - {{endif}} - {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.alignment' in found_struct}} + + try: str_list += ['alignment : ' + str(self.alignment)] except ValueError: str_list += ['alignment : '] - {{endif}} - {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.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 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.size' in found_struct}} + @property def size(self): return self._pvt_ptr[0].size @size.setter def size(self, size_t size): self._pvt_ptr[0].size = size - {{endif}} - {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.alignment' in found_struct}} + + @property def alignment(self): return self._pvt_ptr[0].alignment @alignment.setter def alignment(self, size_t alignment): self._pvt_ptr[0].alignment = alignment - {{endif}} - {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.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 'CUDA_RESOURCE_DESC_st.res.array' in found_struct}} + cdef class anon_struct7: """ Attributes ---------- - {{if 'CUDA_RESOURCE_DESC_st.res.array.hArray' in found_struct}} + hArray : CUarray - {{endif}} + Methods ------- @@ -17565,9 +17151,9 @@ cdef class anon_struct7: def __init__(self, void_ptr _ptr): pass - {{if 'CUDA_RESOURCE_DESC_st.res.array.hArray' in found_struct}} + self._hArray = CUarray(_ptr=&self._pvt_ptr[0].res.array.hArray) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -17575,16 +17161,16 @@ cdef class anon_struct7: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_RESOURCE_DESC_st.res.array.hArray' in found_struct}} + try: str_list += ['hArray : ' + str(self.hArray)] except ValueError: str_list += ['hArray : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_RESOURCE_DESC_st.res.array.hArray' in found_struct}} + @property def hArray(self): return self._hArray @@ -17600,18 +17186,16 @@ cdef class anon_struct7: phArray = int(CUarray(hArray)) cyhArray = phArray self._hArray._pvt_ptr[0] = cyhArray - {{endif}} -{{endif}} -{{if 'CUDA_RESOURCE_DESC_st.res.mipmap' in found_struct}} + cdef class anon_struct8: """ Attributes ---------- - {{if 'CUDA_RESOURCE_DESC_st.res.mipmap.hMipmappedArray' in found_struct}} + hMipmappedArray : CUmipmappedArray - {{endif}} + Methods ------- @@ -17623,9 +17207,9 @@ cdef class anon_struct8: def __init__(self, void_ptr _ptr): pass - {{if 'CUDA_RESOURCE_DESC_st.res.mipmap.hMipmappedArray' in found_struct}} + self._hMipmappedArray = CUmipmappedArray(_ptr=&self._pvt_ptr[0].res.mipmap.hMipmappedArray) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -17633,16 +17217,16 @@ cdef class anon_struct8: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_RESOURCE_DESC_st.res.mipmap.hMipmappedArray' in found_struct}} + try: str_list += ['hMipmappedArray : ' + str(self.hMipmappedArray)] except ValueError: str_list += ['hMipmappedArray : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_RESOURCE_DESC_st.res.mipmap.hMipmappedArray' in found_struct}} + @property def hMipmappedArray(self): return self._hMipmappedArray @@ -17658,30 +17242,28 @@ cdef class anon_struct8: phMipmappedArray = int(CUmipmappedArray(hMipmappedArray)) cyhMipmappedArray = phMipmappedArray self._hMipmappedArray._pvt_ptr[0] = cyhMipmappedArray - {{endif}} -{{endif}} -{{if 'CUDA_RESOURCE_DESC_st.res.linear' in found_struct}} + cdef class anon_struct9: """ Attributes ---------- - {{if 'CUDA_RESOURCE_DESC_st.res.linear.devPtr' in found_struct}} + devPtr : CUdeviceptr - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.linear.format' in found_struct}} + + format : CUarray_format - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.linear.numChannels' in found_struct}} + + numChannels : unsigned int - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.linear.sizeInBytes' in found_struct}} + + sizeInBytes : size_t - {{endif}} + Methods ------- @@ -17693,9 +17275,9 @@ cdef class anon_struct9: def __init__(self, void_ptr _ptr): pass - {{if 'CUDA_RESOURCE_DESC_st.res.linear.devPtr' in found_struct}} + self._devPtr = CUdeviceptr(_ptr=&self._pvt_ptr[0].res.linear.devPtr) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -17703,34 +17285,34 @@ cdef class anon_struct9: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_RESOURCE_DESC_st.res.linear.devPtr' in found_struct}} + try: str_list += ['devPtr : ' + str(self.devPtr)] except ValueError: str_list += ['devPtr : '] - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.linear.format' in found_struct}} + + try: str_list += ['format : ' + str(self.format)] except ValueError: str_list += ['format : '] - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.linear.numChannels' in found_struct}} + + try: str_list += ['numChannels : ' + str(self.numChannels)] except ValueError: str_list += ['numChannels : '] - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.linear.sizeInBytes' in found_struct}} + + try: str_list += ['sizeInBytes : ' + str(self.sizeInBytes)] except ValueError: str_list += ['sizeInBytes : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_RESOURCE_DESC_st.res.linear.devPtr' in found_struct}} + @property def devPtr(self): return self._devPtr @@ -17747,62 +17329,60 @@ cdef class anon_struct9: cydevPtr = pdevPtr self._devPtr._pvt_ptr[0] = cydevPtr - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.linear.format' in found_struct}} + + @property def format(self): return CUarray_format(self._pvt_ptr[0].res.linear.format) @format.setter def format(self, format not None : CUarray_format): self._pvt_ptr[0].res.linear.format = int(format) - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.linear.numChannels' in found_struct}} + + @property def numChannels(self): return self._pvt_ptr[0].res.linear.numChannels @numChannels.setter def numChannels(self, unsigned int numChannels): self._pvt_ptr[0].res.linear.numChannels = numChannels - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.linear.sizeInBytes' in found_struct}} + + @property def sizeInBytes(self): return self._pvt_ptr[0].res.linear.sizeInBytes @sizeInBytes.setter def sizeInBytes(self, size_t sizeInBytes): self._pvt_ptr[0].res.linear.sizeInBytes = sizeInBytes - {{endif}} -{{endif}} -{{if 'CUDA_RESOURCE_DESC_st.res.pitch2D' in found_struct}} + cdef class anon_struct10: """ Attributes ---------- - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.devPtr' in found_struct}} + devPtr : CUdeviceptr - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.format' in found_struct}} + + format : CUarray_format - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.numChannels' in found_struct}} + + numChannels : unsigned int - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.width' in found_struct}} + + width : size_t - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.height' in found_struct}} + + height : size_t - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.pitchInBytes' in found_struct}} + + pitchInBytes : size_t - {{endif}} + Methods ------- @@ -17814,9 +17394,9 @@ cdef class anon_struct10: def __init__(self, void_ptr _ptr): pass - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.devPtr' in found_struct}} + self._devPtr = CUdeviceptr(_ptr=&self._pvt_ptr[0].res.pitch2D.devPtr) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -17824,46 +17404,46 @@ cdef class anon_struct10: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.devPtr' in found_struct}} + try: str_list += ['devPtr : ' + str(self.devPtr)] except ValueError: str_list += ['devPtr : '] - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.format' in found_struct}} + + try: str_list += ['format : ' + str(self.format)] except ValueError: str_list += ['format : '] - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.numChannels' in found_struct}} + + try: str_list += ['numChannels : ' + str(self.numChannels)] except ValueError: str_list += ['numChannels : '] - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.width' in found_struct}} + + try: str_list += ['width : ' + str(self.width)] except ValueError: str_list += ['width : '] - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.height' in found_struct}} + + try: str_list += ['height : ' + str(self.height)] except ValueError: str_list += ['height : '] - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.pitchInBytes' in found_struct}} + + try: str_list += ['pitchInBytes : ' + str(self.pitchInBytes)] except ValueError: str_list += ['pitchInBytes : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.devPtr' in found_struct}} + @property def devPtr(self): return self._devPtr @@ -17880,58 +17460,56 @@ cdef class anon_struct10: cydevPtr = pdevPtr self._devPtr._pvt_ptr[0] = cydevPtr - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.format' in found_struct}} + + @property def format(self): return CUarray_format(self._pvt_ptr[0].res.pitch2D.format) @format.setter def format(self, format not None : CUarray_format): self._pvt_ptr[0].res.pitch2D.format = int(format) - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.numChannels' in found_struct}} + + @property def numChannels(self): return self._pvt_ptr[0].res.pitch2D.numChannels @numChannels.setter def numChannels(self, unsigned int numChannels): self._pvt_ptr[0].res.pitch2D.numChannels = numChannels - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.width' in found_struct}} + + @property def width(self): return self._pvt_ptr[0].res.pitch2D.width @width.setter def width(self, size_t width): self._pvt_ptr[0].res.pitch2D.width = width - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.height' in found_struct}} + + @property def height(self): return self._pvt_ptr[0].res.pitch2D.height @height.setter def height(self, size_t height): self._pvt_ptr[0].res.pitch2D.height = height - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D.pitchInBytes' in found_struct}} + + @property def pitchInBytes(self): return self._pvt_ptr[0].res.pitch2D.pitchInBytes @pitchInBytes.setter def pitchInBytes(self, size_t pitchInBytes): self._pvt_ptr[0].res.pitch2D.pitchInBytes = pitchInBytes - {{endif}} -{{endif}} -{{if 'CUDA_RESOURCE_DESC_st.res.reserved' in found_struct}} + cdef class anon_struct11: """ Attributes ---------- - {{if 'CUDA_RESOURCE_DESC_st.res.reserved.reserved' in found_struct}} + reserved : list[int] - {{endif}} + Methods ------- @@ -17950,50 +17528,48 @@ cdef class anon_struct11: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_RESOURCE_DESC_st.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 'CUDA_RESOURCE_DESC_st.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 'CUDA_RESOURCE_DESC_st.res' in found_struct}} + cdef class anon_union4: """ Attributes ---------- - {{if 'CUDA_RESOURCE_DESC_st.res.array' in found_struct}} + array : anon_struct7 - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.mipmap' in found_struct}} + + mipmap : anon_struct8 - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.linear' in found_struct}} + + linear : anon_struct9 - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D' in found_struct}} + + pitch2D : anon_struct10 - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.reserved' in found_struct}} + + reserved : anon_struct11 - {{endif}} + Methods ------- @@ -18005,21 +17581,21 @@ cdef class anon_union4: def __init__(self, void_ptr _ptr): pass - {{if 'CUDA_RESOURCE_DESC_st.res.array' in found_struct}} + self._array = anon_struct7(_ptr=self._pvt_ptr) - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.mipmap' in found_struct}} + + self._mipmap = anon_struct8(_ptr=self._pvt_ptr) - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.linear' in found_struct}} + + self._linear = anon_struct9(_ptr=self._pvt_ptr) - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D' in found_struct}} + + self._pitch2D = anon_struct10(_ptr=self._pvt_ptr) - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.reserved' in found_struct}} + + self._reserved = anon_struct11(_ptr=self._pvt_ptr) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -18027,81 +17603,79 @@ cdef class anon_union4: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_RESOURCE_DESC_st.res.array' in found_struct}} + try: str_list += ['array :\n' + '\n'.join([' ' + line for line in str(self.array).splitlines()])] except ValueError: str_list += ['array : '] - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.mipmap' in found_struct}} + + try: str_list += ['mipmap :\n' + '\n'.join([' ' + line for line in str(self.mipmap).splitlines()])] except ValueError: str_list += ['mipmap : '] - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.linear' in found_struct}} + + try: str_list += ['linear :\n' + '\n'.join([' ' + line for line in str(self.linear).splitlines()])] except ValueError: str_list += ['linear : '] - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D' in found_struct}} + + try: str_list += ['pitch2D :\n' + '\n'.join([' ' + line for line in str(self.pitch2D).splitlines()])] except ValueError: str_list += ['pitch2D : '] - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.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 '' - {{if 'CUDA_RESOURCE_DESC_st.res.array' in found_struct}} + @property def array(self): return self._array @array.setter def array(self, array not None : anon_struct7): - string.memcpy(&self._pvt_ptr[0].res.array, array.getPtr(), sizeof(self._pvt_ptr[0].res.array)) - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.mipmap' in found_struct}} + string.memcpy(&self._pvt_ptr[0].res.array, array.getPtr(), sizeof(self._pvt_ptr[0].res.array)) + + @property def mipmap(self): return self._mipmap @mipmap.setter def mipmap(self, mipmap not None : anon_struct8): - string.memcpy(&self._pvt_ptr[0].res.mipmap, mipmap.getPtr(), sizeof(self._pvt_ptr[0].res.mipmap)) - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.linear' in found_struct}} + string.memcpy(&self._pvt_ptr[0].res.mipmap, mipmap.getPtr(), sizeof(self._pvt_ptr[0].res.mipmap)) + + @property def linear(self): return self._linear @linear.setter def linear(self, linear not None : anon_struct9): - string.memcpy(&self._pvt_ptr[0].res.linear, linear.getPtr(), sizeof(self._pvt_ptr[0].res.linear)) - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.pitch2D' in found_struct}} + string.memcpy(&self._pvt_ptr[0].res.linear, linear.getPtr(), sizeof(self._pvt_ptr[0].res.linear)) + + @property def pitch2D(self): return self._pitch2D @pitch2D.setter def pitch2D(self, pitch2D not None : anon_struct10): - string.memcpy(&self._pvt_ptr[0].res.pitch2D, pitch2D.getPtr(), sizeof(self._pvt_ptr[0].res.pitch2D)) - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res.reserved' in found_struct}} + string.memcpy(&self._pvt_ptr[0].res.pitch2D, pitch2D.getPtr(), sizeof(self._pvt_ptr[0].res.pitch2D)) + + @property def reserved(self): return self._reserved @reserved.setter def reserved(self, reserved not None : anon_struct11): - string.memcpy(&self._pvt_ptr[0].res.reserved, reserved.getPtr(), sizeof(self._pvt_ptr[0].res.reserved)) - {{endif}} -{{endif}} -{{if 'CUDA_RESOURCE_DESC_st' in found_struct}} + string.memcpy(&self._pvt_ptr[0].res.reserved, reserved.getPtr(), sizeof(self._pvt_ptr[0].res.reserved)) + cdef class CUDA_RESOURCE_DESC_st: """ @@ -18109,18 +17683,18 @@ cdef class CUDA_RESOURCE_DESC_st: Attributes ---------- - {{if 'CUDA_RESOURCE_DESC_st.resType' in found_struct}} + resType : CUresourcetype Resource type - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res' in found_struct}} + + res : anon_union4 - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.flags' in found_struct}} + + flags : unsigned int Flags (must be zero) - {{endif}} + Methods ------- @@ -18135,9 +17709,9 @@ cdef class CUDA_RESOURCE_DESC_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_RESOURCE_DESC_st.res' in found_struct}} + self._res = anon_union4(_ptr=self._pvt_ptr) - {{endif}} + def __dealloc__(self): if self._val_ptr is not NULL: free(self._val_ptr) @@ -18146,53 +17720,51 @@ cdef class CUDA_RESOURCE_DESC_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_RESOURCE_DESC_st.resType' in found_struct}} + try: str_list += ['resType : ' + str(self.resType)] except ValueError: str_list += ['resType : '] - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res' in found_struct}} + + try: str_list += ['res :\n' + '\n'.join([' ' + line for line in str(self.res).splitlines()])] except ValueError: str_list += ['res : '] - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.flags' in found_struct}} + + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_RESOURCE_DESC_st.resType' in found_struct}} + @property def resType(self): return CUresourcetype(self._pvt_ptr[0].resType) @resType.setter def resType(self, resType not None : CUresourcetype): self._pvt_ptr[0].resType = int(resType) - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.res' in found_struct}} + + @property def res(self): return self._res @res.setter def res(self, res not None : anon_union4): - string.memcpy(&self._pvt_ptr[0].res, res.getPtr(), sizeof(self._pvt_ptr[0].res)) - {{endif}} - {{if 'CUDA_RESOURCE_DESC_st.flags' in found_struct}} + string.memcpy(&self._pvt_ptr[0].res, res.getPtr(), sizeof(self._pvt_ptr[0].res)) + + @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 'CUDA_TEXTURE_DESC_st' in found_struct}} + cdef class CUDA_TEXTURE_DESC_st: """ @@ -18200,46 +17772,46 @@ cdef class CUDA_TEXTURE_DESC_st: Attributes ---------- - {{if 'CUDA_TEXTURE_DESC_st.addressMode' in found_struct}} + addressMode : list[CUaddress_mode] Address modes - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.filterMode' in found_struct}} + + filterMode : CUfilter_mode Filter mode - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.flags' in found_struct}} + + flags : unsigned int Flags - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.maxAnisotropy' in found_struct}} + + maxAnisotropy : unsigned int Maximum anisotropy ratio - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.mipmapFilterMode' in found_struct}} + + mipmapFilterMode : CUfilter_mode Mipmap filter mode - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.mipmapLevelBias' in found_struct}} + + mipmapLevelBias : float Mipmap level bias - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.minMipmapLevelClamp' in found_struct}} + + minMipmapLevelClamp : float Mipmap minimum level clamp - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.maxMipmapLevelClamp' in found_struct}} + + maxMipmapLevelClamp : float Mipmap maximum level clamp - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.borderColor' in found_struct}} + + borderColor : list[float] Border Color - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.reserved' in found_struct}} + + reserved : list[int] - {{endif}} + Methods ------- @@ -18260,151 +17832,149 @@ cdef class CUDA_TEXTURE_DESC_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_TEXTURE_DESC_st.addressMode' in found_struct}} + try: str_list += ['addressMode : ' + str(self.addressMode)] except ValueError: str_list += ['addressMode : '] - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.filterMode' in found_struct}} + + try: str_list += ['filterMode : ' + str(self.filterMode)] except ValueError: str_list += ['filterMode : '] - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.flags' in found_struct}} + + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.maxAnisotropy' in found_struct}} + + try: str_list += ['maxAnisotropy : ' + str(self.maxAnisotropy)] except ValueError: str_list += ['maxAnisotropy : '] - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.mipmapFilterMode' in found_struct}} + + try: str_list += ['mipmapFilterMode : ' + str(self.mipmapFilterMode)] except ValueError: str_list += ['mipmapFilterMode : '] - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.mipmapLevelBias' in found_struct}} + + try: str_list += ['mipmapLevelBias : ' + str(self.mipmapLevelBias)] except ValueError: str_list += ['mipmapLevelBias : '] - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.minMipmapLevelClamp' in found_struct}} + + try: str_list += ['minMipmapLevelClamp : ' + str(self.minMipmapLevelClamp)] except ValueError: str_list += ['minMipmapLevelClamp : '] - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.maxMipmapLevelClamp' in found_struct}} + + try: str_list += ['maxMipmapLevelClamp : ' + str(self.maxMipmapLevelClamp)] except ValueError: str_list += ['maxMipmapLevelClamp : '] - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.borderColor' in found_struct}} + + try: str_list += ['borderColor : ' + str(self.borderColor)] except ValueError: str_list += ['borderColor : '] - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.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 'CUDA_TEXTURE_DESC_st.addressMode' in found_struct}} + @property def addressMode(self): return [CUaddress_mode(_x) for _x in list(self._pvt_ptr[0].addressMode)] @addressMode.setter def addressMode(self, addressMode): self._pvt_ptr[0].addressMode = [int(_x) for _x in addressMode] - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.filterMode' in found_struct}} + + @property def filterMode(self): return CUfilter_mode(self._pvt_ptr[0].filterMode) @filterMode.setter def filterMode(self, filterMode not None : CUfilter_mode): self._pvt_ptr[0].filterMode = int(filterMode) - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.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}} - {{if 'CUDA_TEXTURE_DESC_st.maxAnisotropy' in found_struct}} + + @property def maxAnisotropy(self): return self._pvt_ptr[0].maxAnisotropy @maxAnisotropy.setter def maxAnisotropy(self, unsigned int maxAnisotropy): self._pvt_ptr[0].maxAnisotropy = maxAnisotropy - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.mipmapFilterMode' in found_struct}} + + @property def mipmapFilterMode(self): return CUfilter_mode(self._pvt_ptr[0].mipmapFilterMode) @mipmapFilterMode.setter def mipmapFilterMode(self, mipmapFilterMode not None : CUfilter_mode): self._pvt_ptr[0].mipmapFilterMode = int(mipmapFilterMode) - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.mipmapLevelBias' in found_struct}} + + @property def mipmapLevelBias(self): return self._pvt_ptr[0].mipmapLevelBias @mipmapLevelBias.setter def mipmapLevelBias(self, float mipmapLevelBias): self._pvt_ptr[0].mipmapLevelBias = mipmapLevelBias - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.minMipmapLevelClamp' in found_struct}} + + @property def minMipmapLevelClamp(self): return self._pvt_ptr[0].minMipmapLevelClamp @minMipmapLevelClamp.setter def minMipmapLevelClamp(self, float minMipmapLevelClamp): self._pvt_ptr[0].minMipmapLevelClamp = minMipmapLevelClamp - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.maxMipmapLevelClamp' in found_struct}} + + @property def maxMipmapLevelClamp(self): return self._pvt_ptr[0].maxMipmapLevelClamp @maxMipmapLevelClamp.setter def maxMipmapLevelClamp(self, float maxMipmapLevelClamp): self._pvt_ptr[0].maxMipmapLevelClamp = maxMipmapLevelClamp - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.borderColor' in found_struct}} + + @property def borderColor(self): return self._pvt_ptr[0].borderColor @borderColor.setter def borderColor(self, borderColor): self._pvt_ptr[0].borderColor = borderColor - {{endif}} - {{if 'CUDA_TEXTURE_DESC_st.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 'CUDA_RESOURCE_VIEW_DESC_st' in found_struct}} + cdef class CUDA_RESOURCE_VIEW_DESC_st: """ @@ -18412,42 +17982,42 @@ cdef class CUDA_RESOURCE_VIEW_DESC_st: Attributes ---------- - {{if 'CUDA_RESOURCE_VIEW_DESC_st.format' in found_struct}} + format : CUresourceViewFormat Resource view format - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.width' in found_struct}} + + width : size_t Width of the resource view - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.height' in found_struct}} + + height : size_t Height of the resource view - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.depth' in found_struct}} + + depth : size_t Depth of the resource view - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.firstMipmapLevel' in found_struct}} + + firstMipmapLevel : unsigned int First defined mipmap level - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.lastMipmapLevel' in found_struct}} + + lastMipmapLevel : unsigned int Last defined mipmap level - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.firstLayer' in found_struct}} + + firstLayer : unsigned int First layer index - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.lastLayer' in found_struct}} + + lastLayer : unsigned int Last layer index - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -18468,137 +18038,135 @@ cdef class CUDA_RESOURCE_VIEW_DESC_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_RESOURCE_VIEW_DESC_st.format' in found_struct}} + try: str_list += ['format : ' + str(self.format)] except ValueError: str_list += ['format : '] - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.width' in found_struct}} + + try: str_list += ['width : ' + str(self.width)] except ValueError: str_list += ['width : '] - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.height' in found_struct}} + + try: str_list += ['height : ' + str(self.height)] except ValueError: str_list += ['height : '] - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.depth' in found_struct}} + + try: str_list += ['depth : ' + str(self.depth)] except ValueError: str_list += ['depth : '] - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.firstMipmapLevel' in found_struct}} + + try: str_list += ['firstMipmapLevel : ' + str(self.firstMipmapLevel)] except ValueError: str_list += ['firstMipmapLevel : '] - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.lastMipmapLevel' in found_struct}} + + try: str_list += ['lastMipmapLevel : ' + str(self.lastMipmapLevel)] except ValueError: str_list += ['lastMipmapLevel : '] - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.firstLayer' in found_struct}} + + try: str_list += ['firstLayer : ' + str(self.firstLayer)] except ValueError: str_list += ['firstLayer : '] - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.lastLayer' in found_struct}} + + try: str_list += ['lastLayer : ' + str(self.lastLayer)] except ValueError: str_list += ['lastLayer : '] - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.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 'CUDA_RESOURCE_VIEW_DESC_st.format' in found_struct}} + @property def format(self): return CUresourceViewFormat(self._pvt_ptr[0].format) @format.setter def format(self, format not None : CUresourceViewFormat): self._pvt_ptr[0].format = int(format) - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.width' in found_struct}} + + @property def width(self): return self._pvt_ptr[0].width @width.setter def width(self, size_t width): self._pvt_ptr[0].width = width - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.height' in found_struct}} + + @property def height(self): return self._pvt_ptr[0].height @height.setter def height(self, size_t height): self._pvt_ptr[0].height = height - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.depth' in found_struct}} + + @property def depth(self): return self._pvt_ptr[0].depth @depth.setter def depth(self, size_t depth): self._pvt_ptr[0].depth = depth - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.firstMipmapLevel' in found_struct}} + + @property def firstMipmapLevel(self): return self._pvt_ptr[0].firstMipmapLevel @firstMipmapLevel.setter def firstMipmapLevel(self, unsigned int firstMipmapLevel): self._pvt_ptr[0].firstMipmapLevel = firstMipmapLevel - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.lastMipmapLevel' in found_struct}} + + @property def lastMipmapLevel(self): return self._pvt_ptr[0].lastMipmapLevel @lastMipmapLevel.setter def lastMipmapLevel(self, unsigned int lastMipmapLevel): self._pvt_ptr[0].lastMipmapLevel = lastMipmapLevel - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.firstLayer' in found_struct}} + + @property def firstLayer(self): return self._pvt_ptr[0].firstLayer @firstLayer.setter def firstLayer(self, unsigned int firstLayer): self._pvt_ptr[0].firstLayer = firstLayer - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.lastLayer' in found_struct}} + + @property def lastLayer(self): return self._pvt_ptr[0].lastLayer @lastLayer.setter def lastLayer(self, unsigned int lastLayer): self._pvt_ptr[0].lastLayer = lastLayer - {{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st.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 'CUtensorMap_st' in found_struct}} + cdef class CUtensorMap_st: """ @@ -18607,10 +18175,10 @@ cdef class CUtensorMap_st: Attributes ---------- - {{if 'CUtensorMap_st.opaque' in found_struct}} + opaque : list[cuuint64_t] - {{endif}} + Methods ------- @@ -18631,16 +18199,16 @@ cdef class CUtensorMap_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUtensorMap_st.opaque' in found_struct}} + try: str_list += ['opaque : ' + str(self.opaque)] except ValueError: str_list += ['opaque : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUtensorMap_st.opaque' in found_struct}} + @property def opaque(self): return [cuuint64_t(init_value=_opaque) for _opaque in self._pvt_ptr[0].opaque] @@ -18648,9 +18216,7 @@ cdef class CUtensorMap_st: def opaque(self, opaque): self._pvt_ptr[0].opaque = opaque - {{endif}} -{{endif}} -{{if 'CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st' in found_struct}} + cdef class CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st: """ @@ -18658,14 +18224,14 @@ cdef class CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st: Attributes ---------- - {{if 'CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st.p2pToken' in found_struct}} + p2pToken : unsigned long long - {{endif}} - {{if 'CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st.vaSpaceToken' in found_struct}} + + vaSpaceToken : unsigned int - {{endif}} + Methods ------- @@ -18686,39 +18252,37 @@ cdef class CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st.p2pToken' in found_struct}} + try: str_list += ['p2pToken : ' + str(self.p2pToken)] except ValueError: str_list += ['p2pToken : '] - {{endif}} - {{if 'CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st.vaSpaceToken' in found_struct}} + + try: str_list += ['vaSpaceToken : ' + str(self.vaSpaceToken)] except ValueError: str_list += ['vaSpaceToken : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st.p2pToken' in found_struct}} + @property def p2pToken(self): return self._pvt_ptr[0].p2pToken @p2pToken.setter def p2pToken(self, unsigned long long p2pToken): self._pvt_ptr[0].p2pToken = p2pToken - {{endif}} - {{if 'CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st.vaSpaceToken' in found_struct}} + + @property def vaSpaceToken(self): return self._pvt_ptr[0].vaSpaceToken @vaSpaceToken.setter def vaSpaceToken(self, unsigned int vaSpaceToken): self._pvt_ptr[0].vaSpaceToken = vaSpaceToken - {{endif}} -{{endif}} -{{if 'CUDA_LAUNCH_PARAMS_st' in found_struct}} + cdef class CUDA_LAUNCH_PARAMS_st: """ @@ -18726,46 +18290,46 @@ cdef class CUDA_LAUNCH_PARAMS_st: Attributes ---------- - {{if 'CUDA_LAUNCH_PARAMS_st.function' in found_struct}} + function : CUfunction Kernel to launch - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.gridDimX' in found_struct}} + + gridDimX : unsigned int Width of grid in blocks - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.gridDimY' in found_struct}} + + gridDimY : unsigned int Height of grid in blocks - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.gridDimZ' in found_struct}} + + gridDimZ : unsigned int Depth of grid in blocks - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.blockDimX' in found_struct}} + + blockDimX : unsigned int X dimension of each thread block - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.blockDimY' in found_struct}} + + blockDimY : unsigned int Y dimension of each thread block - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.blockDimZ' in found_struct}} + + blockDimZ : unsigned int Z dimension of each thread block - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.sharedMemBytes' in found_struct}} + + sharedMemBytes : unsigned int Dynamic shared-memory size per thread block in bytes - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.hStream' in found_struct}} + + hStream : CUstream Stream identifier - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.kernelParams' in found_struct}} + + kernelParams : Any Array of pointers to kernel parameters - {{endif}} + Methods ------- @@ -18779,12 +18343,12 @@ cdef class CUDA_LAUNCH_PARAMS_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_LAUNCH_PARAMS_st.function' in found_struct}} + self._function = CUfunction(_ptr=&self._pvt_ptr[0].function) - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.hStream' in found_struct}} + + self._hStream = CUstream(_ptr=&self._pvt_ptr[0].hStream) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -18792,70 +18356,70 @@ cdef class CUDA_LAUNCH_PARAMS_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_LAUNCH_PARAMS_st.function' in found_struct}} + try: str_list += ['function : ' + str(self.function)] except ValueError: str_list += ['function : '] - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.gridDimX' in found_struct}} + + try: str_list += ['gridDimX : ' + str(self.gridDimX)] except ValueError: str_list += ['gridDimX : '] - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.gridDimY' in found_struct}} + + try: str_list += ['gridDimY : ' + str(self.gridDimY)] except ValueError: str_list += ['gridDimY : '] - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.gridDimZ' in found_struct}} + + try: str_list += ['gridDimZ : ' + str(self.gridDimZ)] except ValueError: str_list += ['gridDimZ : '] - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.blockDimX' in found_struct}} + + try: str_list += ['blockDimX : ' + str(self.blockDimX)] except ValueError: str_list += ['blockDimX : '] - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.blockDimY' in found_struct}} + + try: str_list += ['blockDimY : ' + str(self.blockDimY)] except ValueError: str_list += ['blockDimY : '] - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.blockDimZ' in found_struct}} + + try: str_list += ['blockDimZ : ' + str(self.blockDimZ)] except ValueError: str_list += ['blockDimZ : '] - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.sharedMemBytes' in found_struct}} + + try: str_list += ['sharedMemBytes : ' + str(self.sharedMemBytes)] except ValueError: str_list += ['sharedMemBytes : '] - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.hStream' in found_struct}} + + try: str_list += ['hStream : ' + str(self.hStream)] except ValueError: str_list += ['hStream : '] - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.kernelParams' in found_struct}} + + try: str_list += ['kernelParams : ' + str(self.kernelParams)] except ValueError: str_list += ['kernelParams : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_LAUNCH_PARAMS_st.function' in found_struct}} + @property def function(self): return self._function @@ -18871,64 +18435,64 @@ cdef class CUDA_LAUNCH_PARAMS_st: pfunction = int(CUfunction(function)) cyfunction = pfunction self._function._pvt_ptr[0] = cyfunction - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.gridDimX' in found_struct}} + + @property def gridDimX(self): return self._pvt_ptr[0].gridDimX @gridDimX.setter def gridDimX(self, unsigned int gridDimX): self._pvt_ptr[0].gridDimX = gridDimX - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.gridDimY' in found_struct}} + + @property def gridDimY(self): return self._pvt_ptr[0].gridDimY @gridDimY.setter def gridDimY(self, unsigned int gridDimY): self._pvt_ptr[0].gridDimY = gridDimY - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.gridDimZ' in found_struct}} + + @property def gridDimZ(self): return self._pvt_ptr[0].gridDimZ @gridDimZ.setter def gridDimZ(self, unsigned int gridDimZ): self._pvt_ptr[0].gridDimZ = gridDimZ - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.blockDimX' in found_struct}} - @property + + + @property def blockDimX(self): return self._pvt_ptr[0].blockDimX @blockDimX.setter def blockDimX(self, unsigned int blockDimX): self._pvt_ptr[0].blockDimX = blockDimX - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.blockDimY' in found_struct}} + + @property def blockDimY(self): return self._pvt_ptr[0].blockDimY @blockDimY.setter def blockDimY(self, unsigned int blockDimY): self._pvt_ptr[0].blockDimY = blockDimY - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.blockDimZ' in found_struct}} + + @property def blockDimZ(self): return self._pvt_ptr[0].blockDimZ @blockDimZ.setter def blockDimZ(self, unsigned int blockDimZ): self._pvt_ptr[0].blockDimZ = blockDimZ - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.sharedMemBytes' in found_struct}} + + @property def sharedMemBytes(self): return self._pvt_ptr[0].sharedMemBytes @sharedMemBytes.setter def sharedMemBytes(self, unsigned int sharedMemBytes): self._pvt_ptr[0].sharedMemBytes = sharedMemBytes - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.hStream' in found_struct}} + + @property def hStream(self): return self._hStream @@ -18944,8 +18508,8 @@ cdef class CUDA_LAUNCH_PARAMS_st: phStream = int(CUstream(hStream)) cyhStream = phStream self._hStream._pvt_ptr[0] = cyhStream - {{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st.kernelParams' in found_struct}} + + @property def kernelParams(self): return self._pvt_ptr[0].kernelParams @@ -18953,22 +18517,20 @@ cdef class CUDA_LAUNCH_PARAMS_st: def kernelParams(self, kernelParams): self._cykernelParams = _HelperKernelParams(kernelParams) self._pvt_ptr[0].kernelParams = self._cykernelParams.ckernelParams - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.win32' in found_struct}} + cdef class anon_struct12: """ Attributes ---------- - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.win32.handle' in found_struct}} + handle : Any - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.win32.name' in found_struct}} + + name : Any - {{endif}} + Methods ------- @@ -18987,22 +18549,22 @@ cdef class anon_struct12: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.win32.handle' in found_struct}} + try: str_list += ['handle : ' + hex(self.handle)] except ValueError: str_list += ['handle : '] - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.win32.name' in found_struct}} + + try: str_list += ['name : ' + hex(self.name)] except ValueError: str_list += ['name : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.win32.handle' in found_struct}} + @property def handle(self): return self._pvt_ptr[0].handle.win32.handle @@ -19010,8 +18572,8 @@ cdef class anon_struct12: def handle(self, handle): self._cyhandle = _HelperInputVoidPtr(handle) self._pvt_ptr[0].handle.win32.handle = self._cyhandle.cptr - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.win32.name' in found_struct}} + + @property def name(self): return self._pvt_ptr[0].handle.win32.name @@ -19019,26 +18581,24 @@ cdef class anon_struct12: def name(self, name): self._cyname = _HelperInputVoidPtr(name) self._pvt_ptr[0].handle.win32.name = self._cyname.cptr - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle' in found_struct}} + cdef class anon_union5: """ Attributes ---------- - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.fd' in found_struct}} + fd : int - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.win32' in found_struct}} + + win32 : anon_struct12 - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.nvSciBufObject' in found_struct}} + + nvSciBufObject : Any - {{endif}} + Methods ------- @@ -19050,9 +18610,9 @@ cdef class anon_union5: def __init__(self, void_ptr _ptr): pass - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.win32' in found_struct}} + self._win32 = anon_struct12(_ptr=self._pvt_ptr) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -19060,44 +18620,44 @@ cdef class anon_union5: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.fd' in found_struct}} + try: str_list += ['fd : ' + str(self.fd)] except ValueError: str_list += ['fd : '] - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.win32' in found_struct}} + + try: str_list += ['win32 :\n' + '\n'.join([' ' + line for line in str(self.win32).splitlines()])] except ValueError: str_list += ['win32 : '] - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.nvSciBufObject' in found_struct}} + + try: str_list += ['nvSciBufObject : ' + hex(self.nvSciBufObject)] except ValueError: str_list += ['nvSciBufObject : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.fd' in found_struct}} + @property def fd(self): return self._pvt_ptr[0].handle.fd @fd.setter def fd(self, int fd): self._pvt_ptr[0].handle.fd = fd - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.win32' in found_struct}} + + @property def win32(self): return self._win32 @win32.setter def win32(self, win32 not None : anon_struct12): - string.memcpy(&self._pvt_ptr[0].handle.win32, win32.getPtr(), sizeof(self._pvt_ptr[0].handle.win32)) - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.nvSciBufObject' in found_struct}} + string.memcpy(&self._pvt_ptr[0].handle.win32, win32.getPtr(), sizeof(self._pvt_ptr[0].handle.win32)) + + @property def nvSciBufObject(self): return self._pvt_ptr[0].handle.nvSciBufObject @@ -19105,9 +18665,7 @@ cdef class anon_union5: def nvSciBufObject(self, nvSciBufObject): self._cynvSciBufObject = _HelperInputVoidPtr(nvSciBufObject) self._pvt_ptr[0].handle.nvSciBufObject = self._cynvSciBufObject.cptr - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st' in found_struct}} + cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: """ @@ -19115,26 +18673,26 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: Attributes ---------- - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.type' in found_struct}} + type : CUexternalMemoryHandleType Type of the handle - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle' in found_struct}} + + handle : anon_union5 - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.size' in found_struct}} + + size : unsigned long long Size of the memory allocation - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.flags' in found_struct}} + + flags : unsigned int 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] - {{endif}} + Methods ------- @@ -19149,9 +18707,9 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle' in found_struct}} + self._handle = anon_union5(_ptr=self._pvt_ptr) - {{endif}} + def __dealloc__(self): if self._val_ptr is not NULL: free(self._val_ptr) @@ -19160,81 +18718,79 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.type' in found_struct}} + try: str_list += ['type : ' + str(self.type)] except ValueError: str_list += ['type : '] - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle' in found_struct}} + + try: str_list += ['handle :\n' + '\n'.join([' ' + line for line in str(self.handle).splitlines()])] except ValueError: str_list += ['handle : '] - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.size' in found_struct}} + + try: str_list += ['size : ' + str(self.size)] except ValueError: str_list += ['size : '] - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.flags' in found_struct}} + + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.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 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.type' in found_struct}} + @property def type(self): return CUexternalMemoryHandleType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : CUexternalMemoryHandleType): self._pvt_ptr[0].type = int(type) - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle' in found_struct}} + + @property def handle(self): return self._handle @handle.setter def handle(self, handle not None : anon_union5): - string.memcpy(&self._pvt_ptr[0].handle, handle.getPtr(), sizeof(self._pvt_ptr[0].handle)) - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.size' in found_struct}} + string.memcpy(&self._pvt_ptr[0].handle, handle.getPtr(), sizeof(self._pvt_ptr[0].handle)) + + @property def size(self): return self._pvt_ptr[0].size @size.setter def size(self, unsigned long long size): self._pvt_ptr[0].size = size - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.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}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.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 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st' in found_struct}} + cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st: """ @@ -19242,22 +18798,22 @@ cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st: Attributes ---------- - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.offset' in found_struct}} + offset : unsigned long long Offset into the memory object where the buffer's base is - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.size' in found_struct}} + + size : unsigned long long Size of the buffer - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.flags' in found_struct}} + + flags : unsigned int Flags reserved for future use. Must be zero. - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -19278,67 +18834,65 @@ cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.offset' in found_struct}} + try: str_list += ['offset : ' + str(self.offset)] except ValueError: str_list += ['offset : '] - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.size' in found_struct}} + + try: str_list += ['size : ' + str(self.size)] except ValueError: str_list += ['size : '] - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.flags' in found_struct}} + + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.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 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.offset' in found_struct}} + @property def offset(self): return self._pvt_ptr[0].offset @offset.setter def offset(self, unsigned long long offset): self._pvt_ptr[0].offset = offset - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.size' in found_struct}} + + @property def size(self): return self._pvt_ptr[0].size @size.setter def size(self, unsigned long long size): self._pvt_ptr[0].size = size - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.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}} - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.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 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st' in found_struct}} + cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st: """ @@ -19346,23 +18900,23 @@ cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st: Attributes ---------- - {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.offset' in found_struct}} + offset : unsigned long long Offset into the memory object where the base level of the mipmap chain is. - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.arrayDesc' in found_struct}} + + arrayDesc : CUDA_ARRAY3D_DESCRIPTOR Format, dimension and type of base level of the mipmap chain - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.numLevels' in found_struct}} + + numLevels : unsigned int 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] - {{endif}} + Methods ------- @@ -19376,9 +18930,9 @@ cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.arrayDesc' in found_struct}} + self._arrayDesc = CUDA_ARRAY3D_DESCRIPTOR(_ptr=&self._pvt_ptr[0].arrayDesc) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -19386,80 +18940,78 @@ cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.offset' in found_struct}} + try: str_list += ['offset : ' + str(self.offset)] except ValueError: str_list += ['offset : '] - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.arrayDesc' in found_struct}} + + try: str_list += ['arrayDesc :\n' + '\n'.join([' ' + line for line in str(self.arrayDesc).splitlines()])] except ValueError: str_list += ['arrayDesc : '] - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.numLevels' in found_struct}} + + try: str_list += ['numLevels : ' + str(self.numLevels)] except ValueError: str_list += ['numLevels : '] - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.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 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.offset' in found_struct}} + @property def offset(self): return self._pvt_ptr[0].offset @offset.setter def offset(self, unsigned long long offset): self._pvt_ptr[0].offset = offset - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.arrayDesc' in found_struct}} + + @property def arrayDesc(self): return self._arrayDesc @arrayDesc.setter def arrayDesc(self, arrayDesc not None : CUDA_ARRAY3D_DESCRIPTOR): - string.memcpy(&self._pvt_ptr[0].arrayDesc, arrayDesc.getPtr(), sizeof(self._pvt_ptr[0].arrayDesc)) - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.numLevels' in found_struct}} + string.memcpy(&self._pvt_ptr[0].arrayDesc, arrayDesc.getPtr(), sizeof(self._pvt_ptr[0].arrayDesc)) + + @property def numLevels(self): return self._pvt_ptr[0].numLevels @numLevels.setter def numLevels(self, unsigned int numLevels): self._pvt_ptr[0].numLevels = numLevels - {{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.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 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.win32' in found_struct}} + cdef class anon_struct13: """ Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.win32.handle' in found_struct}} + handle : Any - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.win32.name' in found_struct}} + + name : Any - {{endif}} + Methods ------- @@ -19478,22 +19030,22 @@ cdef class anon_struct13: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.win32.handle' in found_struct}} + try: str_list += ['handle : ' + hex(self.handle)] except ValueError: str_list += ['handle : '] - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.win32.name' in found_struct}} + + try: str_list += ['name : ' + hex(self.name)] except ValueError: str_list += ['name : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.win32.handle' in found_struct}} + @property def handle(self): return self._pvt_ptr[0].handle.win32.handle @@ -19501,8 +19053,8 @@ cdef class anon_struct13: def handle(self, handle): self._cyhandle = _HelperInputVoidPtr(handle) self._pvt_ptr[0].handle.win32.handle = self._cyhandle.cptr - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.win32.name' in found_struct}} + + @property def name(self): return self._pvt_ptr[0].handle.win32.name @@ -19510,26 +19062,24 @@ cdef class anon_struct13: def name(self, name): self._cyname = _HelperInputVoidPtr(name) self._pvt_ptr[0].handle.win32.name = self._cyname.cptr - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle' in found_struct}} + cdef class anon_union6: """ Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.fd' in found_struct}} + fd : int - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.win32' in found_struct}} + + win32 : anon_struct13 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.nvSciSyncObj' in found_struct}} + + nvSciSyncObj : Any - {{endif}} + Methods ------- @@ -19541,9 +19091,9 @@ cdef class anon_union6: def __init__(self, void_ptr _ptr): pass - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.win32' in found_struct}} + self._win32 = anon_struct13(_ptr=self._pvt_ptr) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -19551,44 +19101,44 @@ cdef class anon_union6: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.fd' in found_struct}} + try: str_list += ['fd : ' + str(self.fd)] except ValueError: str_list += ['fd : '] - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.win32' in found_struct}} + + try: str_list += ['win32 :\n' + '\n'.join([' ' + line for line in str(self.win32).splitlines()])] except ValueError: str_list += ['win32 : '] - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.nvSciSyncObj' in found_struct}} + + try: str_list += ['nvSciSyncObj : ' + hex(self.nvSciSyncObj)] except ValueError: str_list += ['nvSciSyncObj : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.fd' in found_struct}} + @property def fd(self): return self._pvt_ptr[0].handle.fd @fd.setter def fd(self, int fd): self._pvt_ptr[0].handle.fd = fd - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.win32' in found_struct}} + + @property def win32(self): return self._win32 @win32.setter def win32(self, win32 not None : anon_struct13): - string.memcpy(&self._pvt_ptr[0].handle.win32, win32.getPtr(), sizeof(self._pvt_ptr[0].handle.win32)) - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.nvSciSyncObj' in found_struct}} + string.memcpy(&self._pvt_ptr[0].handle.win32, win32.getPtr(), sizeof(self._pvt_ptr[0].handle.win32)) + + @property def nvSciSyncObj(self): return self._pvt_ptr[0].handle.nvSciSyncObj @@ -19596,9 +19146,7 @@ cdef class anon_union6: def nvSciSyncObj(self, nvSciSyncObj): self._cynvSciSyncObj = _HelperInputVoidPtr(nvSciSyncObj) self._pvt_ptr[0].handle.nvSciSyncObj = self._cynvSciSyncObj.cptr - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st' in found_struct}} + cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: """ @@ -19606,22 +19154,22 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.type' in found_struct}} + type : CUexternalSemaphoreHandleType Type of the handle - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle' in found_struct}} + + handle : anon_union6 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.flags' in found_struct}} + + flags : unsigned int Flags reserved for the future. Must be zero. - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -19636,9 +19184,9 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle' in found_struct}} + self._handle = anon_union6(_ptr=self._pvt_ptr) - {{endif}} + def __dealloc__(self): if self._val_ptr is not NULL: free(self._val_ptr) @@ -19647,76 +19195,74 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.type' in found_struct}} + try: str_list += ['type : ' + str(self.type)] except ValueError: str_list += ['type : '] - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle' in found_struct}} + + try: str_list += ['handle :\n' + '\n'.join([' ' + line for line in str(self.handle).splitlines()])] except ValueError: str_list += ['handle : '] - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.flags' in found_struct}} + + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.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 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.type' in found_struct}} + @property def type(self): return CUexternalSemaphoreHandleType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : CUexternalSemaphoreHandleType): self._pvt_ptr[0].type = int(type) - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle' in found_struct}} + + @property def handle(self): return self._handle @handle.setter def handle(self, handle not None : anon_union6): - string.memcpy(&self._pvt_ptr[0].handle, handle.getPtr(), sizeof(self._pvt_ptr[0].handle)) - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.flags' in found_struct}} + string.memcpy(&self._pvt_ptr[0].handle, handle.getPtr(), sizeof(self._pvt_ptr[0].handle)) + + @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}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.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 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.fence' in found_struct}} + cdef class anon_struct14: """ Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.fence.value' in found_struct}} + value : unsigned long long - {{endif}} + Methods ------- @@ -19735,38 +19281,36 @@ cdef class anon_struct14: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.fence.value' in found_struct}} + try: str_list += ['value : ' + str(self.value)] except ValueError: str_list += ['value : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.fence.value' in found_struct}} + @property def value(self): return self._pvt_ptr[0].params.fence.value @value.setter def value(self, unsigned long long value): self._pvt_ptr[0].params.fence.value = value - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.nvSciSync' in found_struct}} + cdef class anon_union7: """ Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.nvSciSync.fence' in found_struct}} + fence : Any - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.nvSciSync.reserved' in found_struct}} + + reserved : unsigned long long - {{endif}} + Methods ------- @@ -19785,22 +19329,22 @@ cdef class anon_union7: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.nvSciSync.fence' in found_struct}} + try: str_list += ['fence : ' + hex(self.fence)] except ValueError: str_list += ['fence : '] - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.nvSciSync.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 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.nvSciSync.fence' in found_struct}} + @property def fence(self): return self._pvt_ptr[0].params.nvSciSync.fence @@ -19808,26 +19352,24 @@ cdef class anon_union7: def fence(self, fence): self._cyfence = _HelperInputVoidPtr(fence) self._pvt_ptr[0].params.nvSciSync.fence = self._cyfence.cptr - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.nvSciSync.reserved' in found_struct}} + + @property def reserved(self): return self._pvt_ptr[0].params.nvSciSync.reserved @reserved.setter def reserved(self, unsigned long long reserved): self._pvt_ptr[0].params.nvSciSync.reserved = reserved - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.keyedMutex' in found_struct}} + cdef class anon_struct15: """ Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.keyedMutex.key' in found_struct}} + key : unsigned long long - {{endif}} + Methods ------- @@ -19846,46 +19388,44 @@ cdef class anon_struct15: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.keyedMutex.key' in found_struct}} + try: str_list += ['key : ' + str(self.key)] except ValueError: str_list += ['key : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.keyedMutex.key' in found_struct}} + @property def key(self): return self._pvt_ptr[0].params.keyedMutex.key @key.setter def key(self, unsigned long long key): self._pvt_ptr[0].params.keyedMutex.key = key - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params' in found_struct}} + cdef class anon_struct16: """ Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.fence' in found_struct}} + fence : anon_struct14 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.nvSciSync' in found_struct}} + + nvSciSync : anon_union7 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.keyedMutex' in found_struct}} + + keyedMutex : anon_struct15 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -19897,15 +19437,15 @@ cdef class anon_struct16: def __init__(self, void_ptr _ptr): pass - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.fence' in found_struct}} + self._fence = anon_struct14(_ptr=self._pvt_ptr) - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.nvSciSync' in found_struct}} + + self._nvSciSync = anon_union7(_ptr=self._pvt_ptr) - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.keyedMutex' in found_struct}} + + self._keyedMutex = anon_struct15(_ptr=self._pvt_ptr) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -19913,67 +19453,65 @@ cdef class anon_struct16: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.fence' in found_struct}} + try: str_list += ['fence :\n' + '\n'.join([' ' + line for line in str(self.fence).splitlines()])] except ValueError: str_list += ['fence : '] - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.nvSciSync' in found_struct}} + + try: str_list += ['nvSciSync :\n' + '\n'.join([' ' + line for line in str(self.nvSciSync).splitlines()])] except ValueError: str_list += ['nvSciSync : '] - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.keyedMutex' in found_struct}} + + try: str_list += ['keyedMutex :\n' + '\n'.join([' ' + line for line in str(self.keyedMutex).splitlines()])] except ValueError: str_list += ['keyedMutex : '] - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.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 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.fence' in found_struct}} + @property def fence(self): return self._fence @fence.setter def fence(self, fence not None : anon_struct14): - string.memcpy(&self._pvt_ptr[0].params.fence, fence.getPtr(), sizeof(self._pvt_ptr[0].params.fence)) - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.nvSciSync' in found_struct}} + string.memcpy(&self._pvt_ptr[0].params.fence, fence.getPtr(), sizeof(self._pvt_ptr[0].params.fence)) + + @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)) - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.keyedMutex' in found_struct}} + string.memcpy(&self._pvt_ptr[0].params.nvSciSync, nvSciSync.getPtr(), sizeof(self._pvt_ptr[0].params.nvSciSync)) + + @property def keyedMutex(self): return self._keyedMutex @keyedMutex.setter def keyedMutex(self, keyedMutex not None : anon_struct15): - string.memcpy(&self._pvt_ptr[0].params.keyedMutex, keyedMutex.getPtr(), sizeof(self._pvt_ptr[0].params.keyedMutex)) - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.reserved' in found_struct}} + string.memcpy(&self._pvt_ptr[0].params.keyedMutex, keyedMutex.getPtr(), sizeof(self._pvt_ptr[0].params.keyedMutex)) + + @property def reserved(self): return self._pvt_ptr[0].params.reserved @reserved.setter def reserved(self, reserved): self._pvt_ptr[0].params.reserved = reserved - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st' in found_struct}} + cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st: """ @@ -19981,25 +19519,25 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st: Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params' in found_struct}} + params : anon_struct16 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.flags' in found_struct}} + + flags : unsigned int - Only when ::CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS is used to signal - a CUexternalSemaphore of type + Only when CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS is used to signal a + CUexternalSemaphore of type CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC, the valid flag is CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC which indicates that while signaling the CUexternalSemaphore, no memory synchronization operations should be performed for any external memory object imported as CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF. 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] - {{endif}} + Methods ------- @@ -20013,9 +19551,9 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params' in found_struct}} + self._params = anon_struct16(_ptr=self._pvt_ptr) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -20023,62 +19561,60 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params' in found_struct}} + try: str_list += ['params :\n' + '\n'.join([' ' + line for line in str(self.params).splitlines()])] except ValueError: str_list += ['params : '] - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.flags' in found_struct}} + + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.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 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params' in found_struct}} + @property def params(self): return self._params @params.setter def params(self, params not None : anon_struct16): - string.memcpy(&self._pvt_ptr[0].params, params.getPtr(), sizeof(self._pvt_ptr[0].params)) - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.flags' in found_struct}} + string.memcpy(&self._pvt_ptr[0].params, params.getPtr(), sizeof(self._pvt_ptr[0].params)) + + @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}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.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 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.fence' in found_struct}} + cdef class anon_struct17: """ Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.fence.value' in found_struct}} + value : unsigned long long - {{endif}} + Methods ------- @@ -20097,38 +19633,36 @@ cdef class anon_struct17: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.fence.value' in found_struct}} + try: str_list += ['value : ' + str(self.value)] except ValueError: str_list += ['value : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.fence.value' in found_struct}} + @property def value(self): return self._pvt_ptr[0].params.fence.value @value.setter def value(self, unsigned long long value): self._pvt_ptr[0].params.fence.value = value - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.nvSciSync' in found_struct}} + cdef class anon_union8: """ Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.nvSciSync.fence' in found_struct}} + fence : Any - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.nvSciSync.reserved' in found_struct}} + + reserved : unsigned long long - {{endif}} + Methods ------- @@ -20147,22 +19681,22 @@ cdef class anon_union8: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.nvSciSync.fence' in found_struct}} + try: str_list += ['fence : ' + hex(self.fence)] except ValueError: str_list += ['fence : '] - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.nvSciSync.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 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.nvSciSync.fence' in found_struct}} + @property def fence(self): return self._pvt_ptr[0].params.nvSciSync.fence @@ -20170,30 +19704,28 @@ cdef class anon_union8: def fence(self, fence): self._cyfence = _HelperInputVoidPtr(fence) self._pvt_ptr[0].params.nvSciSync.fence = self._cyfence.cptr - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.nvSciSync.reserved' in found_struct}} + + @property def reserved(self): return self._pvt_ptr[0].params.nvSciSync.reserved @reserved.setter def reserved(self, unsigned long long reserved): self._pvt_ptr[0].params.nvSciSync.reserved = reserved - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.keyedMutex' in found_struct}} + cdef class anon_struct18: """ Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.keyedMutex.key' in found_struct}} + key : unsigned long long - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.keyedMutex.timeoutMs' in found_struct}} + + timeoutMs : unsigned int - {{endif}} + Methods ------- @@ -20212,60 +19744,58 @@ cdef class anon_struct18: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.keyedMutex.key' in found_struct}} + try: str_list += ['key : ' + str(self.key)] except ValueError: str_list += ['key : '] - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.keyedMutex.timeoutMs' in found_struct}} + + try: str_list += ['timeoutMs : ' + str(self.timeoutMs)] except ValueError: str_list += ['timeoutMs : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.keyedMutex.key' in found_struct}} + @property def key(self): return self._pvt_ptr[0].params.keyedMutex.key @key.setter def key(self, unsigned long long key): self._pvt_ptr[0].params.keyedMutex.key = key - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.keyedMutex.timeoutMs' in found_struct}} + + @property def timeoutMs(self): return self._pvt_ptr[0].params.keyedMutex.timeoutMs @timeoutMs.setter def timeoutMs(self, unsigned int timeoutMs): self._pvt_ptr[0].params.keyedMutex.timeoutMs = timeoutMs - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params' in found_struct}} + cdef class anon_struct19: """ Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.fence' in found_struct}} + fence : anon_struct17 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.nvSciSync' in found_struct}} + + nvSciSync : anon_union8 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.keyedMutex' in found_struct}} + + keyedMutex : anon_struct18 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -20277,15 +19807,15 @@ cdef class anon_struct19: def __init__(self, void_ptr _ptr): pass - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.fence' in found_struct}} + self._fence = anon_struct17(_ptr=self._pvt_ptr) - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.nvSciSync' in found_struct}} + + self._nvSciSync = anon_union8(_ptr=self._pvt_ptr) - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.keyedMutex' in found_struct}} + + self._keyedMutex = anon_struct18(_ptr=self._pvt_ptr) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -20293,67 +19823,65 @@ cdef class anon_struct19: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.fence' in found_struct}} + try: str_list += ['fence :\n' + '\n'.join([' ' + line for line in str(self.fence).splitlines()])] except ValueError: str_list += ['fence : '] - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.nvSciSync' in found_struct}} + + try: str_list += ['nvSciSync :\n' + '\n'.join([' ' + line for line in str(self.nvSciSync).splitlines()])] except ValueError: str_list += ['nvSciSync : '] - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.keyedMutex' in found_struct}} + + try: str_list += ['keyedMutex :\n' + '\n'.join([' ' + line for line in str(self.keyedMutex).splitlines()])] except ValueError: str_list += ['keyedMutex : '] - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.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 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.fence' in found_struct}} + @property def fence(self): return self._fence @fence.setter def fence(self, fence not None : anon_struct17): - string.memcpy(&self._pvt_ptr[0].params.fence, fence.getPtr(), sizeof(self._pvt_ptr[0].params.fence)) - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.nvSciSync' in found_struct}} + string.memcpy(&self._pvt_ptr[0].params.fence, fence.getPtr(), sizeof(self._pvt_ptr[0].params.fence)) + + @property def nvSciSync(self): return self._nvSciSync @nvSciSync.setter def nvSciSync(self, nvSciSync not None : anon_union8): - string.memcpy(&self._pvt_ptr[0].params.nvSciSync, nvSciSync.getPtr(), sizeof(self._pvt_ptr[0].params.nvSciSync)) - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.keyedMutex' in found_struct}} + string.memcpy(&self._pvt_ptr[0].params.nvSciSync, nvSciSync.getPtr(), sizeof(self._pvt_ptr[0].params.nvSciSync)) + + @property def keyedMutex(self): return self._keyedMutex @keyedMutex.setter def keyedMutex(self, keyedMutex not None : anon_struct18): - string.memcpy(&self._pvt_ptr[0].params.keyedMutex, keyedMutex.getPtr(), sizeof(self._pvt_ptr[0].params.keyedMutex)) - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.reserved' in found_struct}} + string.memcpy(&self._pvt_ptr[0].params.keyedMutex, keyedMutex.getPtr(), sizeof(self._pvt_ptr[0].params.keyedMutex)) + + @property def reserved(self): return self._pvt_ptr[0].params.reserved @reserved.setter def reserved(self, reserved): self._pvt_ptr[0].params.reserved = reserved - {{endif}} -{{endif}} -{{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st' in found_struct}} + cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st: """ @@ -20361,25 +19889,25 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st: Attributes ---------- - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params' in found_struct}} + params : anon_struct19 - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.flags' in found_struct}} + + flags : unsigned int - Only when ::CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS is used to wait on - a CUexternalSemaphore of type + Only when CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS is used to wait on a + CUexternalSemaphore of type CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC, the valid flag is CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC which indicates that while waiting for the CUexternalSemaphore, no memory synchronization operations should be performed for any external memory object imported as CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF. 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] - {{endif}} + Methods ------- @@ -20393,9 +19921,9 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params' in found_struct}} + self._params = anon_struct19(_ptr=self._pvt_ptr) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -20403,53 +19931,51 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params' in found_struct}} + try: str_list += ['params :\n' + '\n'.join([' ' + line for line in str(self.params).splitlines()])] except ValueError: str_list += ['params : '] - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.flags' in found_struct}} + + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.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 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params' in found_struct}} + @property def params(self): return self._params @params.setter def params(self, params not None : anon_struct19): - string.memcpy(&self._pvt_ptr[0].params, params.getPtr(), sizeof(self._pvt_ptr[0].params)) - {{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.flags' in found_struct}} + string.memcpy(&self._pvt_ptr[0].params, params.getPtr(), sizeof(self._pvt_ptr[0].params)) + + @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}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.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 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st' in found_struct}} + cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st: """ @@ -20457,19 +19983,19 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st: Attributes ---------- - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st.extSemArray' in found_struct}} + extSemArray : CUexternalSemaphore Array of external semaphore handles. - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st.paramsArray' in found_struct}} + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS Array of external semaphore signal parameters. - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st.numExtSems' in found_struct}} + + numExtSems : unsigned int Number of handles and parameters supplied in extSemArray and paramsArray. - {{endif}} + Methods ------- @@ -20485,41 +20011,43 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st: pass def __dealloc__(self): pass - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st.extSemArray' in found_struct}} + if self._extSemArray is not NULL: free(self._extSemArray) - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st.paramsArray' in found_struct}} + self._pvt_ptr[0].extSemArray = NULL + + if self._paramsArray is not NULL: free(self._paramsArray) - {{endif}} + self._pvt_ptr[0].paramsArray = NULL + def getPtr(self): return self._pvt_ptr def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st.extSemArray' in found_struct}} + try: str_list += ['extSemArray : ' + str(self.extSemArray)] except ValueError: str_list += ['extSemArray : '] - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st.paramsArray' in found_struct}} + + try: str_list += ['paramsArray : ' + str(self.paramsArray)] except ValueError: str_list += ['paramsArray : '] - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st.numExtSems' in found_struct}} + + try: str_list += ['numExtSems : ' + str(self.numExtSems)] except ValueError: str_list += ['numExtSems : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st.extSemArray' in found_struct}} + @property def extSemArray(self): arrs = [self._pvt_ptr[0].extSemArray + x*sizeof(cydriver.CUexternalSemaphore) for x in range(self._extSemArray_length)] @@ -20528,6 +20056,7 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st: def extSemArray(self, val): if len(val) == 0: free(self._extSemArray) + self._extSemArray = NULL self._extSemArray_length = 0 self._pvt_ptr[0].extSemArray = NULL else: @@ -20541,8 +20070,8 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st: for idx in range(len(val)): self._extSemArray[idx] = (val[idx])._pvt_ptr[0] - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st.paramsArray' in found_struct}} + + @property def paramsArray(self): arrs = [self._pvt_ptr[0].paramsArray + x*sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS) for x in range(self._paramsArray_length)] @@ -20551,6 +20080,7 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st: def paramsArray(self, val): if len(val) == 0: free(self._paramsArray) + self._paramsArray = NULL self._paramsArray_length = 0 self._pvt_ptr[0].paramsArray = NULL else: @@ -20564,17 +20094,15 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st: for idx in range(len(val)): string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS)) - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st.numExtSems' in found_struct}} + + @property def numExtSems(self): return self._pvt_ptr[0].numExtSems @numExtSems.setter def numExtSems(self, unsigned int numExtSems): self._pvt_ptr[0].numExtSems = numExtSems - {{endif}} -{{endif}} -{{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st' in found_struct}} + cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: """ @@ -20582,19 +20110,19 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: Attributes ---------- - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st.extSemArray' in found_struct}} + extSemArray : CUexternalSemaphore Array of external semaphore handles. - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st.paramsArray' in found_struct}} + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS Array of external semaphore signal parameters. - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st.numExtSems' in found_struct}} + + numExtSems : unsigned int Number of handles and parameters supplied in extSemArray and paramsArray. - {{endif}} + Methods ------- @@ -20610,41 +20138,43 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: pass def __dealloc__(self): pass - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st.extSemArray' in found_struct}} + if self._extSemArray is not NULL: free(self._extSemArray) - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st.paramsArray' in found_struct}} + self._pvt_ptr[0].extSemArray = NULL + + if self._paramsArray is not NULL: free(self._paramsArray) - {{endif}} + self._pvt_ptr[0].paramsArray = NULL + def getPtr(self): return self._pvt_ptr def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st.extSemArray' in found_struct}} + try: str_list += ['extSemArray : ' + str(self.extSemArray)] except ValueError: str_list += ['extSemArray : '] - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st.paramsArray' in found_struct}} + + try: str_list += ['paramsArray : ' + str(self.paramsArray)] except ValueError: str_list += ['paramsArray : '] - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st.numExtSems' in found_struct}} + + try: str_list += ['numExtSems : ' + str(self.numExtSems)] except ValueError: str_list += ['numExtSems : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st.extSemArray' in found_struct}} + @property def extSemArray(self): arrs = [self._pvt_ptr[0].extSemArray + x*sizeof(cydriver.CUexternalSemaphore) for x in range(self._extSemArray_length)] @@ -20653,6 +20183,7 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: def extSemArray(self, val): if len(val) == 0: free(self._extSemArray) + self._extSemArray = NULL self._extSemArray_length = 0 self._pvt_ptr[0].extSemArray = NULL else: @@ -20666,8 +20197,8 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: for idx in range(len(val)): self._extSemArray[idx] = (val[idx])._pvt_ptr[0] - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st.paramsArray' in found_struct}} + + @property def paramsArray(self): arrs = [self._pvt_ptr[0].paramsArray + x*sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS) for x in range(self._paramsArray_length)] @@ -20676,6 +20207,7 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: def paramsArray(self, val): if len(val) == 0: free(self._paramsArray) + self._paramsArray = NULL self._paramsArray_length = 0 self._pvt_ptr[0].paramsArray = NULL else: @@ -20689,17 +20221,15 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: for idx in range(len(val)): string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS)) - {{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st.numExtSems' in found_struct}} + + @property def numExtSems(self): return self._pvt_ptr[0].numExtSems @numExtSems.setter def numExtSems(self, unsigned int numExtSems): self._pvt_ptr[0].numExtSems = numExtSems - {{endif}} -{{endif}} -{{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_st' in found_struct}} + cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_st: """ @@ -20707,19 +20237,19 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_st: Attributes ---------- - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_st.extSemArray' in found_struct}} + extSemArray : CUexternalSemaphore Array of external semaphore handles. - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_st.paramsArray' in found_struct}} + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS Array of external semaphore wait parameters. - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_st.numExtSems' in found_struct}} + + numExtSems : unsigned int Number of handles and parameters supplied in extSemArray and paramsArray. - {{endif}} + Methods ------- @@ -20735,41 +20265,43 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_st: pass def __dealloc__(self): pass - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_st.extSemArray' in found_struct}} + if self._extSemArray is not NULL: free(self._extSemArray) - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_st.paramsArray' in found_struct}} + self._pvt_ptr[0].extSemArray = NULL + + if self._paramsArray is not NULL: free(self._paramsArray) - {{endif}} + self._pvt_ptr[0].paramsArray = NULL + def getPtr(self): return self._pvt_ptr def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_st.extSemArray' in found_struct}} + try: str_list += ['extSemArray : ' + str(self.extSemArray)] except ValueError: str_list += ['extSemArray : '] - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_st.paramsArray' in found_struct}} + + try: str_list += ['paramsArray : ' + str(self.paramsArray)] except ValueError: str_list += ['paramsArray : '] - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_st.numExtSems' in found_struct}} + + try: str_list += ['numExtSems : ' + str(self.numExtSems)] except ValueError: str_list += ['numExtSems : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_st.extSemArray' in found_struct}} + @property def extSemArray(self): arrs = [self._pvt_ptr[0].extSemArray + x*sizeof(cydriver.CUexternalSemaphore) for x in range(self._extSemArray_length)] @@ -20778,6 +20310,7 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_st: def extSemArray(self, val): if len(val) == 0: free(self._extSemArray) + self._extSemArray = NULL self._extSemArray_length = 0 self._pvt_ptr[0].extSemArray = NULL else: @@ -20791,8 +20324,8 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_st: for idx in range(len(val)): self._extSemArray[idx] = (val[idx])._pvt_ptr[0] - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_st.paramsArray' in found_struct}} + + @property def paramsArray(self): arrs = [self._pvt_ptr[0].paramsArray + x*sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS) for x in range(self._paramsArray_length)] @@ -20801,6 +20334,7 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_st: def paramsArray(self, val): if len(val) == 0: free(self._paramsArray) + self._paramsArray = NULL self._paramsArray_length = 0 self._pvt_ptr[0].paramsArray = NULL else: @@ -20814,17 +20348,15 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_st: for idx in range(len(val)): string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS)) - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_st.numExtSems' in found_struct}} + + @property def numExtSems(self): return self._pvt_ptr[0].numExtSems @numExtSems.setter def numExtSems(self, unsigned int numExtSems): self._pvt_ptr[0].numExtSems = numExtSems - {{endif}} -{{endif}} -{{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st' in found_struct}} + cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st: """ @@ -20832,19 +20364,19 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st: Attributes ---------- - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st.extSemArray' in found_struct}} + extSemArray : CUexternalSemaphore Array of external semaphore handles. - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st.paramsArray' in found_struct}} + + paramsArray : CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS Array of external semaphore wait parameters. - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st.numExtSems' in found_struct}} + + numExtSems : unsigned int Number of handles and parameters supplied in extSemArray and paramsArray. - {{endif}} + Methods ------- @@ -20860,41 +20392,43 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st: pass def __dealloc__(self): pass - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st.extSemArray' in found_struct}} + if self._extSemArray is not NULL: free(self._extSemArray) - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st.paramsArray' in found_struct}} + self._pvt_ptr[0].extSemArray = NULL + + if self._paramsArray is not NULL: free(self._paramsArray) - {{endif}} + self._pvt_ptr[0].paramsArray = NULL + def getPtr(self): return self._pvt_ptr def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st.extSemArray' in found_struct}} + try: str_list += ['extSemArray : ' + str(self.extSemArray)] except ValueError: str_list += ['extSemArray : '] - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st.paramsArray' in found_struct}} + + try: str_list += ['paramsArray : ' + str(self.paramsArray)] except ValueError: str_list += ['paramsArray : '] - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st.numExtSems' in found_struct}} + + try: str_list += ['numExtSems : ' + str(self.numExtSems)] except ValueError: str_list += ['numExtSems : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st.extSemArray' in found_struct}} + @property def extSemArray(self): arrs = [self._pvt_ptr[0].extSemArray + x*sizeof(cydriver.CUexternalSemaphore) for x in range(self._extSemArray_length)] @@ -20903,6 +20437,7 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st: def extSemArray(self, val): if len(val) == 0: free(self._extSemArray) + self._extSemArray = NULL self._extSemArray_length = 0 self._pvt_ptr[0].extSemArray = NULL else: @@ -20916,8 +20451,8 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st: for idx in range(len(val)): self._extSemArray[idx] = (val[idx])._pvt_ptr[0] - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st.paramsArray' in found_struct}} + + @property def paramsArray(self): arrs = [self._pvt_ptr[0].paramsArray + x*sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS) for x in range(self._paramsArray_length)] @@ -20926,6 +20461,7 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st: def paramsArray(self, val): if len(val) == 0: free(self._paramsArray) + self._paramsArray = NULL self._paramsArray_length = 0 self._pvt_ptr[0].paramsArray = NULL else: @@ -20939,30 +20475,28 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st: for idx in range(len(val)): string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS)) - {{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st.numExtSems' in found_struct}} + + @property def numExtSems(self): return self._pvt_ptr[0].numExtSems @numExtSems.setter def numExtSems(self, unsigned int numExtSems): self._pvt_ptr[0].numExtSems = numExtSems - {{endif}} -{{endif}} -{{if 'CUarrayMapInfo_st.resource' in found_struct}} + cdef class anon_union9: """ Attributes ---------- - {{if 'CUarrayMapInfo_st.resource.mipmap' in found_struct}} + mipmap : CUmipmappedArray - {{endif}} - {{if 'CUarrayMapInfo_st.resource.array' in found_struct}} + + array : CUarray - {{endif}} + Methods ------- @@ -20974,12 +20508,12 @@ cdef class anon_union9: def __init__(self, void_ptr _ptr): pass - {{if 'CUarrayMapInfo_st.resource.mipmap' in found_struct}} + self._mipmap = CUmipmappedArray(_ptr=&self._pvt_ptr[0].resource.mipmap) - {{endif}} - {{if 'CUarrayMapInfo_st.resource.array' in found_struct}} + + self._array = CUarray(_ptr=&self._pvt_ptr[0].resource.array) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -20987,22 +20521,22 @@ cdef class anon_union9: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUarrayMapInfo_st.resource.mipmap' in found_struct}} + try: str_list += ['mipmap : ' + str(self.mipmap)] except ValueError: str_list += ['mipmap : '] - {{endif}} - {{if 'CUarrayMapInfo_st.resource.array' in found_struct}} + + try: str_list += ['array : ' + str(self.array)] except ValueError: str_list += ['array : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUarrayMapInfo_st.resource.mipmap' in found_struct}} + @property def mipmap(self): return self._mipmap @@ -21018,8 +20552,8 @@ cdef class anon_union9: pmipmap = int(CUmipmappedArray(mipmap)) cymipmap = pmipmap self._mipmap._pvt_ptr[0] = cymipmap - {{endif}} - {{if 'CUarrayMapInfo_st.resource.array' in found_struct}} + + @property def array(self): return self._array @@ -21035,46 +20569,44 @@ cdef class anon_union9: parray = int(CUarray(array)) cyarray = parray self._array._pvt_ptr[0] = cyarray - {{endif}} -{{endif}} -{{if 'CUarrayMapInfo_st.subresource.sparseLevel' in found_struct}} + cdef class anon_struct20: """ Attributes ---------- - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.level' in found_struct}} + level : unsigned int - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.layer' in found_struct}} + + layer : unsigned int - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.offsetX' in found_struct}} + + offsetX : unsigned int - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.offsetY' in found_struct}} + + offsetY : unsigned int - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.offsetZ' in found_struct}} + + offsetZ : unsigned int - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.extentWidth' in found_struct}} + + extentWidth : unsigned int - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.extentHeight' in found_struct}} + + extentHeight : unsigned int - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.extentDepth' in found_struct}} + + extentDepth : unsigned int - {{endif}} + Methods ------- @@ -21093,140 +20625,138 @@ cdef class anon_struct20: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.level' in found_struct}} + try: str_list += ['level : ' + str(self.level)] except ValueError: str_list += ['level : '] - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.layer' in found_struct}} + + try: str_list += ['layer : ' + str(self.layer)] except ValueError: str_list += ['layer : '] - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.offsetX' in found_struct}} + + try: str_list += ['offsetX : ' + str(self.offsetX)] except ValueError: str_list += ['offsetX : '] - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.offsetY' in found_struct}} + + try: str_list += ['offsetY : ' + str(self.offsetY)] except ValueError: str_list += ['offsetY : '] - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.offsetZ' in found_struct}} + + try: str_list += ['offsetZ : ' + str(self.offsetZ)] except ValueError: str_list += ['offsetZ : '] - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.extentWidth' in found_struct}} + + try: str_list += ['extentWidth : ' + str(self.extentWidth)] except ValueError: str_list += ['extentWidth : '] - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.extentHeight' in found_struct}} + + try: str_list += ['extentHeight : ' + str(self.extentHeight)] except ValueError: str_list += ['extentHeight : '] - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.extentDepth' in found_struct}} + + try: str_list += ['extentDepth : ' + str(self.extentDepth)] except ValueError: str_list += ['extentDepth : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.level' in found_struct}} + @property def level(self): return self._pvt_ptr[0].subresource.sparseLevel.level @level.setter def level(self, unsigned int level): self._pvt_ptr[0].subresource.sparseLevel.level = level - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.layer' in found_struct}} + + @property def layer(self): return self._pvt_ptr[0].subresource.sparseLevel.layer @layer.setter def layer(self, unsigned int layer): self._pvt_ptr[0].subresource.sparseLevel.layer = layer - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.offsetX' in found_struct}} + + @property def offsetX(self): return self._pvt_ptr[0].subresource.sparseLevel.offsetX @offsetX.setter def offsetX(self, unsigned int offsetX): self._pvt_ptr[0].subresource.sparseLevel.offsetX = offsetX - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.offsetY' in found_struct}} + + @property def offsetY(self): return self._pvt_ptr[0].subresource.sparseLevel.offsetY @offsetY.setter def offsetY(self, unsigned int offsetY): self._pvt_ptr[0].subresource.sparseLevel.offsetY = offsetY - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.offsetZ' in found_struct}} + + @property def offsetZ(self): return self._pvt_ptr[0].subresource.sparseLevel.offsetZ @offsetZ.setter def offsetZ(self, unsigned int offsetZ): self._pvt_ptr[0].subresource.sparseLevel.offsetZ = offsetZ - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.extentWidth' in found_struct}} + + @property def extentWidth(self): return self._pvt_ptr[0].subresource.sparseLevel.extentWidth @extentWidth.setter def extentWidth(self, unsigned int extentWidth): self._pvt_ptr[0].subresource.sparseLevel.extentWidth = extentWidth - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.extentHeight' in found_struct}} + + @property def extentHeight(self): return self._pvt_ptr[0].subresource.sparseLevel.extentHeight @extentHeight.setter def extentHeight(self, unsigned int extentHeight): self._pvt_ptr[0].subresource.sparseLevel.extentHeight = extentHeight - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.sparseLevel.extentDepth' in found_struct}} + + @property def extentDepth(self): return self._pvt_ptr[0].subresource.sparseLevel.extentDepth @extentDepth.setter def extentDepth(self, unsigned int extentDepth): self._pvt_ptr[0].subresource.sparseLevel.extentDepth = extentDepth - {{endif}} -{{endif}} -{{if 'CUarrayMapInfo_st.subresource.miptail' in found_struct}} + cdef class anon_struct21: """ Attributes ---------- - {{if 'CUarrayMapInfo_st.subresource.miptail.layer' in found_struct}} + layer : unsigned int - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.miptail.offset' in found_struct}} + + offset : unsigned long long - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.miptail.size' in found_struct}} + + size : unsigned long long - {{endif}} + Methods ------- @@ -21245,66 +20775,64 @@ cdef class anon_struct21: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUarrayMapInfo_st.subresource.miptail.layer' in found_struct}} + try: str_list += ['layer : ' + str(self.layer)] except ValueError: str_list += ['layer : '] - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.miptail.offset' in found_struct}} + + try: str_list += ['offset : ' + str(self.offset)] except ValueError: str_list += ['offset : '] - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.miptail.size' in found_struct}} + + try: str_list += ['size : ' + str(self.size)] except ValueError: str_list += ['size : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUarrayMapInfo_st.subresource.miptail.layer' in found_struct}} + @property def layer(self): return self._pvt_ptr[0].subresource.miptail.layer @layer.setter def layer(self, unsigned int layer): self._pvt_ptr[0].subresource.miptail.layer = layer - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.miptail.offset' in found_struct}} + + @property def offset(self): return self._pvt_ptr[0].subresource.miptail.offset @offset.setter def offset(self, unsigned long long offset): self._pvt_ptr[0].subresource.miptail.offset = offset - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.miptail.size' in found_struct}} + + @property def size(self): return self._pvt_ptr[0].subresource.miptail.size @size.setter def size(self, unsigned long long size): self._pvt_ptr[0].subresource.miptail.size = size - {{endif}} -{{endif}} -{{if 'CUarrayMapInfo_st.subresource' in found_struct}} + cdef class anon_union10: """ Attributes ---------- - {{if 'CUarrayMapInfo_st.subresource.sparseLevel' in found_struct}} + sparseLevel : anon_struct20 - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.miptail' in found_struct}} + + miptail : anon_struct21 - {{endif}} + Methods ------- @@ -21316,12 +20844,12 @@ cdef class anon_union10: def __init__(self, void_ptr _ptr): pass - {{if 'CUarrayMapInfo_st.subresource.sparseLevel' in found_struct}} + self._sparseLevel = anon_struct20(_ptr=self._pvt_ptr) - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.miptail' in found_struct}} + + self._miptail = anon_struct21(_ptr=self._pvt_ptr) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -21329,48 +20857,46 @@ cdef class anon_union10: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUarrayMapInfo_st.subresource.sparseLevel' in found_struct}} + try: str_list += ['sparseLevel :\n' + '\n'.join([' ' + line for line in str(self.sparseLevel).splitlines()])] except ValueError: str_list += ['sparseLevel : '] - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.miptail' in found_struct}} + + try: str_list += ['miptail :\n' + '\n'.join([' ' + line for line in str(self.miptail).splitlines()])] except ValueError: str_list += ['miptail : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUarrayMapInfo_st.subresource.sparseLevel' in found_struct}} + @property def sparseLevel(self): return self._sparseLevel @sparseLevel.setter def sparseLevel(self, sparseLevel not None : anon_struct20): - string.memcpy(&self._pvt_ptr[0].subresource.sparseLevel, sparseLevel.getPtr(), sizeof(self._pvt_ptr[0].subresource.sparseLevel)) - {{endif}} - {{if 'CUarrayMapInfo_st.subresource.miptail' in found_struct}} + string.memcpy(&self._pvt_ptr[0].subresource.sparseLevel, sparseLevel.getPtr(), sizeof(self._pvt_ptr[0].subresource.sparseLevel)) + + @property def miptail(self): return self._miptail @miptail.setter def miptail(self, miptail not None : anon_struct21): - string.memcpy(&self._pvt_ptr[0].subresource.miptail, miptail.getPtr(), sizeof(self._pvt_ptr[0].subresource.miptail)) - {{endif}} -{{endif}} -{{if 'CUarrayMapInfo_st.memHandle' in found_struct}} + string.memcpy(&self._pvt_ptr[0].subresource.miptail, miptail.getPtr(), sizeof(self._pvt_ptr[0].subresource.miptail)) + cdef class anon_union11: """ Attributes ---------- - {{if 'CUarrayMapInfo_st.memHandle.memHandle' in found_struct}} + memHandle : CUmemGenericAllocationHandle - {{endif}} + Methods ------- @@ -21382,9 +20908,9 @@ cdef class anon_union11: def __init__(self, void_ptr _ptr): pass - {{if 'CUarrayMapInfo_st.memHandle.memHandle' in found_struct}} + self._memHandle = CUmemGenericAllocationHandle(_ptr=&self._pvt_ptr[0].memHandle.memHandle) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -21392,16 +20918,16 @@ cdef class anon_union11: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUarrayMapInfo_st.memHandle.memHandle' in found_struct}} + try: str_list += ['memHandle : ' + str(self.memHandle)] except ValueError: str_list += ['memHandle : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUarrayMapInfo_st.memHandle.memHandle' in found_struct}} + @property def memHandle(self): return self._memHandle @@ -21418,9 +20944,7 @@ cdef class anon_union11: cymemHandle = pmemHandle self._memHandle._pvt_ptr[0] = cymemHandle - {{endif}} -{{endif}} -{{if 'CUarrayMapInfo_st' in found_struct}} + cdef class CUarrayMapInfo_st: """ @@ -21429,50 +20953,50 @@ cdef class CUarrayMapInfo_st: Attributes ---------- - {{if 'CUarrayMapInfo_st.resourceType' in found_struct}} + resourceType : CUresourcetype Resource type - {{endif}} - {{if 'CUarrayMapInfo_st.resource' in found_struct}} + + resource : anon_union9 - {{endif}} - {{if 'CUarrayMapInfo_st.subresourceType' in found_struct}} + + subresourceType : CUarraySparseSubresourceType Sparse subresource type - {{endif}} - {{if 'CUarrayMapInfo_st.subresource' in found_struct}} + + subresource : anon_union10 - {{endif}} - {{if 'CUarrayMapInfo_st.memOperationType' in found_struct}} + + memOperationType : CUmemOperationType Memory operation type - {{endif}} - {{if 'CUarrayMapInfo_st.memHandleType' in found_struct}} + + memHandleType : CUmemHandleType Memory handle type - {{endif}} - {{if 'CUarrayMapInfo_st.memHandle' in found_struct}} + + memHandle : anon_union11 - {{endif}} - {{if 'CUarrayMapInfo_st.offset' in found_struct}} + + offset : unsigned long long Offset within mip tail Offset within the memory - {{endif}} - {{if 'CUarrayMapInfo_st.deviceBitMask' in found_struct}} + + deviceBitMask : unsigned int Device ordinal bit mask - {{endif}} - {{if 'CUarrayMapInfo_st.flags' in found_struct}} + + flags : unsigned int flags for future use, must be zero now. - {{endif}} - {{if 'CUarrayMapInfo_st.reserved' in found_struct}} + + reserved : list[unsigned int] Reserved for future use, must be zero now. - {{endif}} + Methods ------- @@ -21487,15 +21011,15 @@ cdef class CUarrayMapInfo_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUarrayMapInfo_st.resource' in found_struct}} + self._resource = anon_union9(_ptr=self._pvt_ptr) - {{endif}} - {{if 'CUarrayMapInfo_st.subresource' in found_struct}} + + self._subresource = anon_union10(_ptr=self._pvt_ptr) - {{endif}} - {{if 'CUarrayMapInfo_st.memHandle' in found_struct}} + + self._memHandle = anon_union11(_ptr=self._pvt_ptr) - {{endif}} + def __dealloc__(self): if self._val_ptr is not NULL: free(self._val_ptr) @@ -21504,165 +21028,163 @@ cdef class CUarrayMapInfo_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUarrayMapInfo_st.resourceType' in found_struct}} + try: str_list += ['resourceType : ' + str(self.resourceType)] except ValueError: str_list += ['resourceType : '] - {{endif}} - {{if 'CUarrayMapInfo_st.resource' in found_struct}} + + try: str_list += ['resource :\n' + '\n'.join([' ' + line for line in str(self.resource).splitlines()])] except ValueError: str_list += ['resource : '] - {{endif}} - {{if 'CUarrayMapInfo_st.subresourceType' in found_struct}} + + try: str_list += ['subresourceType : ' + str(self.subresourceType)] except ValueError: str_list += ['subresourceType : '] - {{endif}} - {{if 'CUarrayMapInfo_st.subresource' in found_struct}} + + try: str_list += ['subresource :\n' + '\n'.join([' ' + line for line in str(self.subresource).splitlines()])] except ValueError: str_list += ['subresource : '] - {{endif}} - {{if 'CUarrayMapInfo_st.memOperationType' in found_struct}} + + try: str_list += ['memOperationType : ' + str(self.memOperationType)] except ValueError: str_list += ['memOperationType : '] - {{endif}} - {{if 'CUarrayMapInfo_st.memHandleType' in found_struct}} + + try: str_list += ['memHandleType : ' + str(self.memHandleType)] except ValueError: str_list += ['memHandleType : '] - {{endif}} - {{if 'CUarrayMapInfo_st.memHandle' in found_struct}} + + try: str_list += ['memHandle :\n' + '\n'.join([' ' + line for line in str(self.memHandle).splitlines()])] except ValueError: str_list += ['memHandle : '] - {{endif}} - {{if 'CUarrayMapInfo_st.offset' in found_struct}} + + try: str_list += ['offset : ' + str(self.offset)] except ValueError: str_list += ['offset : '] - {{endif}} - {{if 'CUarrayMapInfo_st.deviceBitMask' in found_struct}} + + try: str_list += ['deviceBitMask : ' + str(self.deviceBitMask)] except ValueError: str_list += ['deviceBitMask : '] - {{endif}} - {{if 'CUarrayMapInfo_st.flags' in found_struct}} + + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} - {{if 'CUarrayMapInfo_st.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 'CUarrayMapInfo_st.resourceType' in found_struct}} + @property def resourceType(self): return CUresourcetype(self._pvt_ptr[0].resourceType) @resourceType.setter def resourceType(self, resourceType not None : CUresourcetype): self._pvt_ptr[0].resourceType = int(resourceType) - {{endif}} - {{if 'CUarrayMapInfo_st.resource' in found_struct}} + + @property def resource(self): return self._resource @resource.setter def resource(self, resource not None : anon_union9): - string.memcpy(&self._pvt_ptr[0].resource, resource.getPtr(), sizeof(self._pvt_ptr[0].resource)) - {{endif}} - {{if 'CUarrayMapInfo_st.subresourceType' in found_struct}} + string.memcpy(&self._pvt_ptr[0].resource, resource.getPtr(), sizeof(self._pvt_ptr[0].resource)) + + @property def subresourceType(self): return CUarraySparseSubresourceType(self._pvt_ptr[0].subresourceType) @subresourceType.setter def subresourceType(self, subresourceType not None : CUarraySparseSubresourceType): self._pvt_ptr[0].subresourceType = int(subresourceType) - {{endif}} - {{if 'CUarrayMapInfo_st.subresource' in found_struct}} + + @property def subresource(self): return self._subresource @subresource.setter def subresource(self, subresource not None : anon_union10): - string.memcpy(&self._pvt_ptr[0].subresource, subresource.getPtr(), sizeof(self._pvt_ptr[0].subresource)) - {{endif}} - {{if 'CUarrayMapInfo_st.memOperationType' in found_struct}} + string.memcpy(&self._pvt_ptr[0].subresource, subresource.getPtr(), sizeof(self._pvt_ptr[0].subresource)) + + @property def memOperationType(self): return CUmemOperationType(self._pvt_ptr[0].memOperationType) @memOperationType.setter def memOperationType(self, memOperationType not None : CUmemOperationType): self._pvt_ptr[0].memOperationType = int(memOperationType) - {{endif}} - {{if 'CUarrayMapInfo_st.memHandleType' in found_struct}} + + @property def memHandleType(self): return CUmemHandleType(self._pvt_ptr[0].memHandleType) @memHandleType.setter def memHandleType(self, memHandleType not None : CUmemHandleType): self._pvt_ptr[0].memHandleType = int(memHandleType) - {{endif}} - {{if 'CUarrayMapInfo_st.memHandle' in found_struct}} + + @property def memHandle(self): return self._memHandle @memHandle.setter def memHandle(self, memHandle not None : anon_union11): - string.memcpy(&self._pvt_ptr[0].memHandle, memHandle.getPtr(), sizeof(self._pvt_ptr[0].memHandle)) - {{endif}} - {{if 'CUarrayMapInfo_st.offset' in found_struct}} + string.memcpy(&self._pvt_ptr[0].memHandle, memHandle.getPtr(), sizeof(self._pvt_ptr[0].memHandle)) + + @property def offset(self): return self._pvt_ptr[0].offset @offset.setter def offset(self, unsigned long long offset): self._pvt_ptr[0].offset = offset - {{endif}} - {{if 'CUarrayMapInfo_st.deviceBitMask' in found_struct}} + + @property def deviceBitMask(self): return self._pvt_ptr[0].deviceBitMask @deviceBitMask.setter def deviceBitMask(self, unsigned int deviceBitMask): self._pvt_ptr[0].deviceBitMask = deviceBitMask - {{endif}} - {{if 'CUarrayMapInfo_st.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}} - {{if 'CUarrayMapInfo_st.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 'CUmemLocation_st' in found_struct}} + cdef class CUmemLocation_st: """ @@ -21670,14 +21192,16 @@ cdef class CUmemLocation_st: Attributes ---------- - {{if 'CUmemLocation_st.type' in found_struct}} + type : CUmemLocationType Specifies the location type, which modifies the meaning of id. - {{endif}} - {{if 'CUmemLocation_st.id' in found_struct}} + + id : int + Identifier for CUmemLocationType::CU_MEM_LOCATION_TYPE_DEVICE, + CUmemLocationType::CU_MEM_LOCATION_TYPE_HOST, + CUmemLocationType::CU_MEM_LOCATION_TYPE_HOST_NUMA. - {{endif}} Methods ------- @@ -21700,60 +21224,58 @@ cdef class CUmemLocation_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUmemLocation_st.type' in found_struct}} + try: str_list += ['type : ' + str(self.type)] except ValueError: str_list += ['type : '] - {{endif}} - {{if 'CUmemLocation_st.id' in found_struct}} + + try: str_list += ['id : ' + str(self.id)] except ValueError: str_list += ['id : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUmemLocation_st.type' in found_struct}} + @property def type(self): return CUmemLocationType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : CUmemLocationType): self._pvt_ptr[0].type = int(type) - {{endif}} - {{if 'CUmemLocation_st.id' in found_struct}} + + @property def id(self): return self._pvt_ptr[0].id @id.setter def id(self, int id): self._pvt_ptr[0].id = id - {{endif}} -{{endif}} -{{if 'CUmemAllocationProp_st.allocFlags' in found_struct}} + cdef class anon_struct22: """ Attributes ---------- - {{if 'CUmemAllocationProp_st.allocFlags.compressionType' in found_struct}} + compressionType : bytes - {{endif}} - {{if 'CUmemAllocationProp_st.allocFlags.gpuDirectRDMACapable' in found_struct}} + + gpuDirectRDMACapable : bytes - {{endif}} - {{if 'CUmemAllocationProp_st.allocFlags.usage' in found_struct}} + + usage : unsigned short - {{endif}} - {{if 'CUmemAllocationProp_st.allocFlags.reserved' in found_struct}} + + reserved : bytes - {{endif}} + Methods ------- @@ -21772,58 +21294,58 @@ cdef class anon_struct22: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUmemAllocationProp_st.allocFlags.compressionType' in found_struct}} + try: str_list += ['compressionType : ' + str(self.compressionType)] except ValueError: str_list += ['compressionType : '] - {{endif}} - {{if 'CUmemAllocationProp_st.allocFlags.gpuDirectRDMACapable' in found_struct}} + + try: str_list += ['gpuDirectRDMACapable : ' + str(self.gpuDirectRDMACapable)] except ValueError: str_list += ['gpuDirectRDMACapable : '] - {{endif}} - {{if 'CUmemAllocationProp_st.allocFlags.usage' in found_struct}} + + try: str_list += ['usage : ' + str(self.usage)] except ValueError: str_list += ['usage : '] - {{endif}} - {{if 'CUmemAllocationProp_st.allocFlags.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 'CUmemAllocationProp_st.allocFlags.compressionType' in found_struct}} + @property def compressionType(self): return self._pvt_ptr[0].allocFlags.compressionType @compressionType.setter def compressionType(self, unsigned char compressionType): self._pvt_ptr[0].allocFlags.compressionType = compressionType - {{endif}} - {{if 'CUmemAllocationProp_st.allocFlags.gpuDirectRDMACapable' in found_struct}} + + @property def gpuDirectRDMACapable(self): return self._pvt_ptr[0].allocFlags.gpuDirectRDMACapable @gpuDirectRDMACapable.setter def gpuDirectRDMACapable(self, unsigned char gpuDirectRDMACapable): self._pvt_ptr[0].allocFlags.gpuDirectRDMACapable = gpuDirectRDMACapable - {{endif}} - {{if 'CUmemAllocationProp_st.allocFlags.usage' in found_struct}} + + @property def usage(self): return self._pvt_ptr[0].allocFlags.usage @usage.setter def usage(self, unsigned short usage): self._pvt_ptr[0].allocFlags.usage = usage - {{endif}} - {{if 'CUmemAllocationProp_st.allocFlags.reserved' in found_struct}} + + @property def reserved(self): return PyBytes_FromStringAndSize(self._pvt_ptr[0].allocFlags.reserved, 4) @@ -21833,9 +21355,7 @@ cdef class anon_struct22: raise ValueError("reserved length must be 4, is " + str(len(reserved))) for i, b in enumerate(reserved): self._pvt_ptr[0].allocFlags.reserved[i] = b - {{endif}} -{{endif}} -{{if 'CUmemAllocationProp_st' in found_struct}} + cdef class CUmemAllocationProp_st: """ @@ -21843,30 +21363,30 @@ cdef class CUmemAllocationProp_st: Attributes ---------- - {{if 'CUmemAllocationProp_st.type' in found_struct}} + type : CUmemAllocationType Allocation type - {{endif}} - {{if 'CUmemAllocationProp_st.requestedHandleTypes' in found_struct}} + + requestedHandleTypes : CUmemAllocationHandleType requested CUmemAllocationHandleType - {{endif}} - {{if 'CUmemAllocationProp_st.location' in found_struct}} + + location : CUmemLocation Location of allocation - {{endif}} - {{if 'CUmemAllocationProp_st.win32HandleMetaData' in found_struct}} + + win32HandleMetaData : Any Windows-specific POBJECT_ATTRIBUTES required when CU_MEM_HANDLE_TYPE_WIN32 is specified. This object attributes structure includes security attributes that define the scope of which exported allocations may be transferred to other processes. In all other cases, this field is required to be zero. - {{endif}} - {{if 'CUmemAllocationProp_st.allocFlags' in found_struct}} + + allocFlags : anon_struct22 - {{endif}} + Methods ------- @@ -21880,12 +21400,12 @@ cdef class CUmemAllocationProp_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUmemAllocationProp_st.location' in found_struct}} + self._location = CUmemLocation(_ptr=&self._pvt_ptr[0].location) - {{endif}} - {{if 'CUmemAllocationProp_st.allocFlags' in found_struct}} + + self._allocFlags = anon_struct22(_ptr=self._pvt_ptr) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -21893,64 +21413,64 @@ cdef class CUmemAllocationProp_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUmemAllocationProp_st.type' in found_struct}} + try: str_list += ['type : ' + str(self.type)] except ValueError: str_list += ['type : '] - {{endif}} - {{if 'CUmemAllocationProp_st.requestedHandleTypes' in found_struct}} + + try: str_list += ['requestedHandleTypes : ' + str(self.requestedHandleTypes)] except ValueError: str_list += ['requestedHandleTypes : '] - {{endif}} - {{if 'CUmemAllocationProp_st.location' in found_struct}} + + try: str_list += ['location :\n' + '\n'.join([' ' + line for line in str(self.location).splitlines()])] except ValueError: str_list += ['location : '] - {{endif}} - {{if 'CUmemAllocationProp_st.win32HandleMetaData' in found_struct}} + + try: str_list += ['win32HandleMetaData : ' + hex(self.win32HandleMetaData)] except ValueError: str_list += ['win32HandleMetaData : '] - {{endif}} - {{if 'CUmemAllocationProp_st.allocFlags' in found_struct}} + + try: str_list += ['allocFlags :\n' + '\n'.join([' ' + line for line in str(self.allocFlags).splitlines()])] except ValueError: str_list += ['allocFlags : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUmemAllocationProp_st.type' in found_struct}} + @property def type(self): return CUmemAllocationType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : CUmemAllocationType): self._pvt_ptr[0].type = int(type) - {{endif}} - {{if 'CUmemAllocationProp_st.requestedHandleTypes' in found_struct}} + + @property def requestedHandleTypes(self): return CUmemAllocationHandleType(self._pvt_ptr[0].requestedHandleTypes) @requestedHandleTypes.setter def requestedHandleTypes(self, requestedHandleTypes not None : CUmemAllocationHandleType): self._pvt_ptr[0].requestedHandleTypes = int(requestedHandleTypes) - {{endif}} - {{if 'CUmemAllocationProp_st.location' in found_struct}} + + @property def location(self): return self._location @location.setter def location(self, location not None : CUmemLocation): - string.memcpy(&self._pvt_ptr[0].location, location.getPtr(), sizeof(self._pvt_ptr[0].location)) - {{endif}} - {{if 'CUmemAllocationProp_st.win32HandleMetaData' in found_struct}} + string.memcpy(&self._pvt_ptr[0].location, location.getPtr(), sizeof(self._pvt_ptr[0].location)) + + @property def win32HandleMetaData(self): return self._pvt_ptr[0].win32HandleMetaData @@ -21958,17 +21478,15 @@ cdef class CUmemAllocationProp_st: def win32HandleMetaData(self, win32HandleMetaData): self._cywin32HandleMetaData = _HelperInputVoidPtr(win32HandleMetaData) self._pvt_ptr[0].win32HandleMetaData = self._cywin32HandleMetaData.cptr - {{endif}} - {{if 'CUmemAllocationProp_st.allocFlags' in found_struct}} + + @property def allocFlags(self): return self._allocFlags @allocFlags.setter def allocFlags(self, allocFlags not None : anon_struct22): - string.memcpy(&self._pvt_ptr[0].allocFlags, allocFlags.getPtr(), sizeof(self._pvt_ptr[0].allocFlags)) - {{endif}} -{{endif}} -{{if 'CUmulticastObjectProp_st' in found_struct}} + string.memcpy(&self._pvt_ptr[0].allocFlags, allocFlags.getPtr(), sizeof(self._pvt_ptr[0].allocFlags)) + cdef class CUmulticastObjectProp_st: """ @@ -21976,25 +21494,25 @@ cdef class CUmulticastObjectProp_st: Attributes ---------- - {{if 'CUmulticastObjectProp_st.numDevices' in found_struct}} + numDevices : unsigned int The number of devices in the multicast team that will bind memory to this object - {{endif}} - {{if 'CUmulticastObjectProp_st.size' in found_struct}} + + size : size_t The maximum amount of memory that can be bound to this multicast object per device - {{endif}} - {{if 'CUmulticastObjectProp_st.handleTypes' in found_struct}} + + handleTypes : unsigned long long Bitmask of exportable handle types (see CUmemAllocationHandleType) for this object - {{endif}} - {{if 'CUmulticastObjectProp_st.flags' in found_struct}} + + flags : unsigned long long Flags for future use, must be zero now - {{endif}} + Methods ------- @@ -22015,67 +21533,65 @@ cdef class CUmulticastObjectProp_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUmulticastObjectProp_st.numDevices' in found_struct}} + try: str_list += ['numDevices : ' + str(self.numDevices)] except ValueError: str_list += ['numDevices : '] - {{endif}} - {{if 'CUmulticastObjectProp_st.size' in found_struct}} + + try: str_list += ['size : ' + str(self.size)] except ValueError: str_list += ['size : '] - {{endif}} - {{if 'CUmulticastObjectProp_st.handleTypes' in found_struct}} + + try: str_list += ['handleTypes : ' + str(self.handleTypes)] except ValueError: str_list += ['handleTypes : '] - {{endif}} - {{if 'CUmulticastObjectProp_st.flags' in found_struct}} + + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUmulticastObjectProp_st.numDevices' in found_struct}} + @property def numDevices(self): return self._pvt_ptr[0].numDevices @numDevices.setter def numDevices(self, unsigned int numDevices): self._pvt_ptr[0].numDevices = numDevices - {{endif}} - {{if 'CUmulticastObjectProp_st.size' in found_struct}} + + @property def size(self): return self._pvt_ptr[0].size @size.setter def size(self, size_t size): self._pvt_ptr[0].size = size - {{endif}} - {{if 'CUmulticastObjectProp_st.handleTypes' in found_struct}} + + @property def handleTypes(self): return self._pvt_ptr[0].handleTypes @handleTypes.setter def handleTypes(self, unsigned long long handleTypes): self._pvt_ptr[0].handleTypes = handleTypes - {{endif}} - {{if 'CUmulticastObjectProp_st.flags' in found_struct}} + + @property def flags(self): return self._pvt_ptr[0].flags @flags.setter def flags(self, unsigned long long flags): self._pvt_ptr[0].flags = flags - {{endif}} -{{endif}} -{{if 'CUmemAccessDesc_st' in found_struct}} + cdef class CUmemAccessDesc_st: """ @@ -22083,14 +21599,14 @@ cdef class CUmemAccessDesc_st: Attributes ---------- - {{if 'CUmemAccessDesc_st.location' in found_struct}} + location : CUmemLocation Location on which the request is to change it's accessibility - {{endif}} - {{if 'CUmemAccessDesc_st.flags' in found_struct}} + + flags : CUmemAccess_flags ::CUmemProt accessibility flags to set on the request - {{endif}} + Methods ------- @@ -22104,9 +21620,9 @@ cdef class CUmemAccessDesc_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUmemAccessDesc_st.location' in found_struct}} + self._location = CUmemLocation(_ptr=&self._pvt_ptr[0].location) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -22114,39 +21630,37 @@ cdef class CUmemAccessDesc_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUmemAccessDesc_st.location' in found_struct}} + try: str_list += ['location :\n' + '\n'.join([' ' + line for line in str(self.location).splitlines()])] except ValueError: str_list += ['location : '] - {{endif}} - {{if 'CUmemAccessDesc_st.flags' in found_struct}} + + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUmemAccessDesc_st.location' in found_struct}} + @property def location(self): return self._location @location.setter def location(self, location not None : CUmemLocation): - string.memcpy(&self._pvt_ptr[0].location, location.getPtr(), sizeof(self._pvt_ptr[0].location)) - {{endif}} - {{if 'CUmemAccessDesc_st.flags' in found_struct}} + string.memcpy(&self._pvt_ptr[0].location, location.getPtr(), sizeof(self._pvt_ptr[0].location)) + + @property def flags(self): return CUmemAccess_flags(self._pvt_ptr[0].flags) @flags.setter def flags(self, flags not None : CUmemAccess_flags): self._pvt_ptr[0].flags = int(flags) - {{endif}} -{{endif}} -{{if 'CUgraphExecUpdateResultInfo_st' in found_struct}} + cdef class CUgraphExecUpdateResultInfo_st: """ @@ -22154,21 +21668,21 @@ cdef class CUgraphExecUpdateResultInfo_st: Attributes ---------- - {{if 'CUgraphExecUpdateResultInfo_st.result' in found_struct}} + result : CUgraphExecUpdateResult Gives more specific detail when a cuda graph update fails. - {{endif}} - {{if 'CUgraphExecUpdateResultInfo_st.errorNode' in found_struct}} + + errorNode : CUgraphNode The "to node" of the error edge when the topologies do not match. The error node when the error is associated with a specific node. NULL when the error is generic. - {{endif}} - {{if 'CUgraphExecUpdateResultInfo_st.errorFromNode' in found_struct}} + + errorFromNode : CUgraphNode The from node of error edge when the topologies do not match. Otherwise NULL. - {{endif}} + Methods ------- @@ -22182,12 +21696,12 @@ cdef class CUgraphExecUpdateResultInfo_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUgraphExecUpdateResultInfo_st.errorNode' in found_struct}} + self._errorNode = CUgraphNode(_ptr=&self._pvt_ptr[0].errorNode) - {{endif}} - {{if 'CUgraphExecUpdateResultInfo_st.errorFromNode' in found_struct}} + + self._errorFromNode = CUgraphNode(_ptr=&self._pvt_ptr[0].errorFromNode) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -22195,36 +21709,36 @@ cdef class CUgraphExecUpdateResultInfo_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUgraphExecUpdateResultInfo_st.result' in found_struct}} + try: str_list += ['result : ' + str(self.result)] except ValueError: str_list += ['result : '] - {{endif}} - {{if 'CUgraphExecUpdateResultInfo_st.errorNode' in found_struct}} + + try: str_list += ['errorNode : ' + str(self.errorNode)] except ValueError: str_list += ['errorNode : '] - {{endif}} - {{if 'CUgraphExecUpdateResultInfo_st.errorFromNode' in found_struct}} + + try: str_list += ['errorFromNode : ' + str(self.errorFromNode)] except ValueError: str_list += ['errorFromNode : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUgraphExecUpdateResultInfo_st.result' in found_struct}} + @property def result(self): return CUgraphExecUpdateResult(self._pvt_ptr[0].result) @result.setter def result(self, result not None : CUgraphExecUpdateResult): self._pvt_ptr[0].result = int(result) - {{endif}} - {{if 'CUgraphExecUpdateResultInfo_st.errorNode' in found_struct}} + + @property def errorNode(self): return self._errorNode @@ -22240,8 +21754,8 @@ cdef class CUgraphExecUpdateResultInfo_st: perrorNode = int(CUgraphNode(errorNode)) cyerrorNode = perrorNode self._errorNode._pvt_ptr[0] = cyerrorNode - {{endif}} - {{if 'CUgraphExecUpdateResultInfo_st.errorFromNode' in found_struct}} + + @property def errorFromNode(self): return self._errorFromNode @@ -22257,9 +21771,7 @@ cdef class CUgraphExecUpdateResultInfo_st: perrorFromNode = int(CUgraphNode(errorFromNode)) cyerrorFromNode = perrorFromNode self._errorFromNode._pvt_ptr[0] = cyerrorFromNode - {{endif}} -{{endif}} -{{if 'CUmemPoolProps_st' in found_struct}} + cdef class CUmemPoolProps_st: """ @@ -22267,40 +21779,40 @@ cdef class CUmemPoolProps_st: Attributes ---------- - {{if 'CUmemPoolProps_st.allocType' in found_struct}} + allocType : CUmemAllocationType Allocation type. Currently must be specified as CU_MEM_ALLOCATION_TYPE_PINNED - {{endif}} - {{if 'CUmemPoolProps_st.handleTypes' in found_struct}} + + handleTypes : CUmemAllocationHandleType Handle types that will be supported by allocations from the pool. - {{endif}} - {{if 'CUmemPoolProps_st.location' in found_struct}} + + location : CUmemLocation Location where allocations should reside. - {{endif}} - {{if 'CUmemPoolProps_st.win32SecurityAttributes' in found_struct}} + + win32SecurityAttributes : Any Windows-specific LPSECURITYATTRIBUTES required when CU_MEM_HANDLE_TYPE_WIN32 is specified. This security attribute defines the scope of which exported allocations may be transferred to other processes. In all other cases, this field is required to be zero. - {{endif}} - {{if 'CUmemPoolProps_st.maxSize' in found_struct}} + + maxSize : size_t Maximum pool size. When set to 0, defaults to a system dependent value. - {{endif}} - {{if 'CUmemPoolProps_st.usage' in found_struct}} + + usage : unsigned short Bitmask indicating intended usage for the pool. - {{endif}} - {{if 'CUmemPoolProps_st.reserved' in found_struct}} + + reserved : bytes reserved for future use, must be 0 - {{endif}} + Methods ------- @@ -22314,9 +21826,9 @@ cdef class CUmemPoolProps_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUmemPoolProps_st.location' in found_struct}} + self._location = CUmemLocation(_ptr=&self._pvt_ptr[0].location) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -22324,76 +21836,76 @@ cdef class CUmemPoolProps_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUmemPoolProps_st.allocType' in found_struct}} + try: str_list += ['allocType : ' + str(self.allocType)] except ValueError: str_list += ['allocType : '] - {{endif}} - {{if 'CUmemPoolProps_st.handleTypes' in found_struct}} + + try: str_list += ['handleTypes : ' + str(self.handleTypes)] except ValueError: str_list += ['handleTypes : '] - {{endif}} - {{if 'CUmemPoolProps_st.location' in found_struct}} + + try: str_list += ['location :\n' + '\n'.join([' ' + line for line in str(self.location).splitlines()])] except ValueError: str_list += ['location : '] - {{endif}} - {{if 'CUmemPoolProps_st.win32SecurityAttributes' in found_struct}} + + try: str_list += ['win32SecurityAttributes : ' + hex(self.win32SecurityAttributes)] except ValueError: str_list += ['win32SecurityAttributes : '] - {{endif}} - {{if 'CUmemPoolProps_st.maxSize' in found_struct}} + + try: str_list += ['maxSize : ' + str(self.maxSize)] except ValueError: str_list += ['maxSize : '] - {{endif}} - {{if 'CUmemPoolProps_st.usage' in found_struct}} + + try: str_list += ['usage : ' + str(self.usage)] except ValueError: str_list += ['usage : '] - {{endif}} - {{if 'CUmemPoolProps_st.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 'CUmemPoolProps_st.allocType' in found_struct}} + @property def allocType(self): return CUmemAllocationType(self._pvt_ptr[0].allocType) @allocType.setter def allocType(self, allocType not None : CUmemAllocationType): self._pvt_ptr[0].allocType = int(allocType) - {{endif}} - {{if 'CUmemPoolProps_st.handleTypes' in found_struct}} + + @property def handleTypes(self): return CUmemAllocationHandleType(self._pvt_ptr[0].handleTypes) @handleTypes.setter def handleTypes(self, handleTypes not None : CUmemAllocationHandleType): self._pvt_ptr[0].handleTypes = int(handleTypes) - {{endif}} - {{if 'CUmemPoolProps_st.location' in found_struct}} + + @property def location(self): return self._location @location.setter def location(self, location not None : CUmemLocation): - string.memcpy(&self._pvt_ptr[0].location, location.getPtr(), sizeof(self._pvt_ptr[0].location)) - {{endif}} - {{if 'CUmemPoolProps_st.win32SecurityAttributes' in found_struct}} + string.memcpy(&self._pvt_ptr[0].location, location.getPtr(), sizeof(self._pvt_ptr[0].location)) + + @property def win32SecurityAttributes(self): return self._pvt_ptr[0].win32SecurityAttributes @@ -22401,24 +21913,24 @@ cdef class CUmemPoolProps_st: def win32SecurityAttributes(self, win32SecurityAttributes): self._cywin32SecurityAttributes = _HelperInputVoidPtr(win32SecurityAttributes) self._pvt_ptr[0].win32SecurityAttributes = self._cywin32SecurityAttributes.cptr - {{endif}} - {{if 'CUmemPoolProps_st.maxSize' in found_struct}} + + @property def maxSize(self): return self._pvt_ptr[0].maxSize @maxSize.setter def maxSize(self, size_t maxSize): self._pvt_ptr[0].maxSize = maxSize - {{endif}} - {{if 'CUmemPoolProps_st.usage' in found_struct}} + + @property def usage(self): return self._pvt_ptr[0].usage @usage.setter def usage(self, unsigned short usage): self._pvt_ptr[0].usage = usage - {{endif}} - {{if 'CUmemPoolProps_st.reserved' in found_struct}} + + @property def reserved(self): return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 54) @@ -22428,9 +21940,7 @@ cdef class CUmemPoolProps_st: raise ValueError("reserved length must be 54, is " + str(len(reserved))) for i, b in enumerate(reserved): self._pvt_ptr[0].reserved[i] = b - {{endif}} -{{endif}} -{{if 'CUmemPoolPtrExportData_st' in found_struct}} + cdef class CUmemPoolPtrExportData_st: """ @@ -22438,10 +21948,10 @@ cdef class CUmemPoolPtrExportData_st: Attributes ---------- - {{if 'CUmemPoolPtrExportData_st.reserved' in found_struct}} + reserved : bytes - {{endif}} + Methods ------- @@ -22462,16 +21972,16 @@ cdef class CUmemPoolPtrExportData_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUmemPoolPtrExportData_st.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 'CUmemPoolPtrExportData_st.reserved' in found_struct}} + @property def reserved(self): return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 64) @@ -22481,9 +21991,7 @@ cdef class CUmemPoolPtrExportData_st: raise ValueError("reserved length must be 64, is " + str(len(reserved))) for i, b in enumerate(reserved): self._pvt_ptr[0].reserved[i] = b - {{endif}} -{{endif}} -{{if 'CUmemcpyAttributes_st' in found_struct}} + cdef class CUmemcpyAttributes_st: """ @@ -22492,25 +22000,25 @@ cdef class CUmemcpyAttributes_st: Attributes ---------- - {{if 'CUmemcpyAttributes_st.srcAccessOrder' in found_struct}} + srcAccessOrder : CUmemcpySrcAccessOrder Source access ordering to be observed for copies with this attribute. - {{endif}} - {{if 'CUmemcpyAttributes_st.srcLocHint' in found_struct}} + + srcLocHint : CUmemLocation Hint location for the source operand. Ignored when the pointers are not managed memory or memory allocated outside CUDA. - {{endif}} - {{if 'CUmemcpyAttributes_st.dstLocHint' in found_struct}} + + dstLocHint : CUmemLocation Hint location for the destination operand. Ignored when the pointers are not managed memory or memory allocated outside CUDA. - {{endif}} - {{if 'CUmemcpyAttributes_st.flags' in found_struct}} + + flags : unsigned int Additional flags for copies with this attribute. See CUmemcpyFlags - {{endif}} + Methods ------- @@ -22524,12 +22032,12 @@ cdef class CUmemcpyAttributes_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUmemcpyAttributes_st.srcLocHint' in found_struct}} + self._srcLocHint = CUmemLocation(_ptr=&self._pvt_ptr[0].srcLocHint) - {{endif}} - {{if 'CUmemcpyAttributes_st.dstLocHint' in found_struct}} + + self._dstLocHint = CUmemLocation(_ptr=&self._pvt_ptr[0].dstLocHint) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -22537,67 +22045,65 @@ cdef class CUmemcpyAttributes_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUmemcpyAttributes_st.srcAccessOrder' in found_struct}} + try: str_list += ['srcAccessOrder : ' + str(self.srcAccessOrder)] except ValueError: str_list += ['srcAccessOrder : '] - {{endif}} - {{if 'CUmemcpyAttributes_st.srcLocHint' in found_struct}} + + try: str_list += ['srcLocHint :\n' + '\n'.join([' ' + line for line in str(self.srcLocHint).splitlines()])] except ValueError: str_list += ['srcLocHint : '] - {{endif}} - {{if 'CUmemcpyAttributes_st.dstLocHint' in found_struct}} + + try: str_list += ['dstLocHint :\n' + '\n'.join([' ' + line for line in str(self.dstLocHint).splitlines()])] except ValueError: str_list += ['dstLocHint : '] - {{endif}} - {{if 'CUmemcpyAttributes_st.flags' in found_struct}} + + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUmemcpyAttributes_st.srcAccessOrder' in found_struct}} + @property def srcAccessOrder(self): return CUmemcpySrcAccessOrder(self._pvt_ptr[0].srcAccessOrder) @srcAccessOrder.setter def srcAccessOrder(self, srcAccessOrder not None : CUmemcpySrcAccessOrder): self._pvt_ptr[0].srcAccessOrder = int(srcAccessOrder) - {{endif}} - {{if 'CUmemcpyAttributes_st.srcLocHint' in found_struct}} + + @property def srcLocHint(self): return self._srcLocHint @srcLocHint.setter def srcLocHint(self, srcLocHint not None : CUmemLocation): - string.memcpy(&self._pvt_ptr[0].srcLocHint, srcLocHint.getPtr(), sizeof(self._pvt_ptr[0].srcLocHint)) - {{endif}} - {{if 'CUmemcpyAttributes_st.dstLocHint' in found_struct}} + string.memcpy(&self._pvt_ptr[0].srcLocHint, srcLocHint.getPtr(), sizeof(self._pvt_ptr[0].srcLocHint)) + + @property def dstLocHint(self): return self._dstLocHint @dstLocHint.setter def dstLocHint(self, dstLocHint not None : CUmemLocation): - string.memcpy(&self._pvt_ptr[0].dstLocHint, dstLocHint.getPtr(), sizeof(self._pvt_ptr[0].dstLocHint)) - {{endif}} - {{if 'CUmemcpyAttributes_st.flags' in found_struct}} + string.memcpy(&self._pvt_ptr[0].dstLocHint, dstLocHint.getPtr(), sizeof(self._pvt_ptr[0].dstLocHint)) + + @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 'CUoffset3D_st' in found_struct}} + cdef class CUoffset3D_st: """ @@ -22605,18 +22111,18 @@ cdef class CUoffset3D_st: Attributes ---------- - {{if 'CUoffset3D_st.x' in found_struct}} + x : size_t - {{endif}} - {{if 'CUoffset3D_st.y' in found_struct}} + + y : size_t - {{endif}} - {{if 'CUoffset3D_st.z' in found_struct}} + + z : size_t - {{endif}} + Methods ------- @@ -22637,53 +22143,51 @@ cdef class CUoffset3D_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUoffset3D_st.x' in found_struct}} + try: str_list += ['x : ' + str(self.x)] except ValueError: str_list += ['x : '] - {{endif}} - {{if 'CUoffset3D_st.y' in found_struct}} + + try: str_list += ['y : ' + str(self.y)] except ValueError: str_list += ['y : '] - {{endif}} - {{if 'CUoffset3D_st.z' in found_struct}} + + try: str_list += ['z : ' + str(self.z)] except ValueError: str_list += ['z : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUoffset3D_st.x' in found_struct}} + @property def x(self): return self._pvt_ptr[0].x @x.setter def x(self, size_t x): self._pvt_ptr[0].x = x - {{endif}} - {{if 'CUoffset3D_st.y' in found_struct}} + + @property def y(self): return self._pvt_ptr[0].y @y.setter def y(self, size_t y): self._pvt_ptr[0].y = y - {{endif}} - {{if 'CUoffset3D_st.z' in found_struct}} + + @property def z(self): return self._pvt_ptr[0].z @z.setter def z(self, size_t z): self._pvt_ptr[0].z = z - {{endif}} -{{endif}} -{{if 'CUextent3D_st' in found_struct}} + cdef class CUextent3D_st: """ @@ -22691,18 +22195,18 @@ cdef class CUextent3D_st: Attributes ---------- - {{if 'CUextent3D_st.width' in found_struct}} + width : size_t - {{endif}} - {{if 'CUextent3D_st.height' in found_struct}} + + height : size_t - {{endif}} - {{if 'CUextent3D_st.depth' in found_struct}} + + depth : size_t - {{endif}} + Methods ------- @@ -22723,74 +22227,72 @@ cdef class CUextent3D_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUextent3D_st.width' in found_struct}} + try: str_list += ['width : ' + str(self.width)] except ValueError: str_list += ['width : '] - {{endif}} - {{if 'CUextent3D_st.height' in found_struct}} + + try: str_list += ['height : ' + str(self.height)] except ValueError: str_list += ['height : '] - {{endif}} - {{if 'CUextent3D_st.depth' in found_struct}} + + try: str_list += ['depth : ' + str(self.depth)] except ValueError: str_list += ['depth : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUextent3D_st.width' in found_struct}} + @property def width(self): return self._pvt_ptr[0].width @width.setter def width(self, size_t width): self._pvt_ptr[0].width = width - {{endif}} - {{if 'CUextent3D_st.height' in found_struct}} + + @property def height(self): return self._pvt_ptr[0].height @height.setter def height(self, size_t height): self._pvt_ptr[0].height = height - {{endif}} - {{if 'CUextent3D_st.depth' in found_struct}} + + @property def depth(self): return self._pvt_ptr[0].depth @depth.setter def depth(self, size_t depth): self._pvt_ptr[0].depth = depth - {{endif}} -{{endif}} -{{if 'CUmemcpy3DOperand_st.op.ptr' in found_struct}} + cdef class anon_struct23: """ Attributes ---------- - {{if 'CUmemcpy3DOperand_st.op.ptr.ptr' in found_struct}} + ptr : CUdeviceptr - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.ptr.rowLength' in found_struct}} + + rowLength : size_t - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.ptr.layerHeight' in found_struct}} + + layerHeight : size_t - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.ptr.locHint' in found_struct}} + + locHint : CUmemLocation - {{endif}} + Methods ------- @@ -22802,12 +22304,12 @@ cdef class anon_struct23: def __init__(self, void_ptr _ptr): pass - {{if 'CUmemcpy3DOperand_st.op.ptr.ptr' in found_struct}} + self._ptr = CUdeviceptr(_ptr=&self._pvt_ptr[0].op.ptr.ptr) - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.ptr.locHint' in found_struct}} + + self._locHint = CUmemLocation(_ptr=&self._pvt_ptr[0].op.ptr.locHint) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -22815,34 +22317,34 @@ cdef class anon_struct23: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUmemcpy3DOperand_st.op.ptr.ptr' in found_struct}} + try: str_list += ['ptr : ' + str(self.ptr)] except ValueError: str_list += ['ptr : '] - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.ptr.rowLength' in found_struct}} + + try: str_list += ['rowLength : ' + str(self.rowLength)] except ValueError: str_list += ['rowLength : '] - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.ptr.layerHeight' in found_struct}} + + try: str_list += ['layerHeight : ' + str(self.layerHeight)] except ValueError: str_list += ['layerHeight : '] - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.ptr.locHint' in found_struct}} + + try: str_list += ['locHint :\n' + '\n'.join([' ' + line for line in str(self.locHint).splitlines()])] except ValueError: str_list += ['locHint : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUmemcpy3DOperand_st.op.ptr.ptr' in found_struct}} + @property def ptr(self): return self._ptr @@ -22859,46 +22361,44 @@ cdef class anon_struct23: cyptr = pptr self._ptr._pvt_ptr[0] = cyptr - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.ptr.rowLength' in found_struct}} + + @property def rowLength(self): return self._pvt_ptr[0].op.ptr.rowLength @rowLength.setter def rowLength(self, size_t rowLength): self._pvt_ptr[0].op.ptr.rowLength = rowLength - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.ptr.layerHeight' in found_struct}} + + @property def layerHeight(self): return self._pvt_ptr[0].op.ptr.layerHeight @layerHeight.setter def layerHeight(self, size_t layerHeight): self._pvt_ptr[0].op.ptr.layerHeight = layerHeight - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.ptr.locHint' in found_struct}} + + @property def locHint(self): return self._locHint @locHint.setter def locHint(self, locHint not None : CUmemLocation): - string.memcpy(&self._pvt_ptr[0].op.ptr.locHint, locHint.getPtr(), sizeof(self._pvt_ptr[0].op.ptr.locHint)) - {{endif}} -{{endif}} -{{if 'CUmemcpy3DOperand_st.op.array' in found_struct}} + string.memcpy(&self._pvt_ptr[0].op.ptr.locHint, locHint.getPtr(), sizeof(self._pvt_ptr[0].op.ptr.locHint)) + cdef class anon_struct24: """ Attributes ---------- - {{if 'CUmemcpy3DOperand_st.op.array.array' in found_struct}} + array : CUarray - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.array.offset' in found_struct}} + + offset : CUoffset3D - {{endif}} + Methods ------- @@ -22910,12 +22410,12 @@ cdef class anon_struct24: def __init__(self, void_ptr _ptr): pass - {{if 'CUmemcpy3DOperand_st.op.array.array' in found_struct}} + self._array = CUarray(_ptr=&self._pvt_ptr[0].op.array.array) - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.array.offset' in found_struct}} + + self._offset = CUoffset3D(_ptr=&self._pvt_ptr[0].op.array.offset) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -22923,22 +22423,22 @@ cdef class anon_struct24: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUmemcpy3DOperand_st.op.array.array' in found_struct}} + try: str_list += ['array : ' + str(self.array)] except ValueError: str_list += ['array : '] - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.array.offset' in found_struct}} + + try: str_list += ['offset :\n' + '\n'.join([' ' + line for line in str(self.offset).splitlines()])] except ValueError: str_list += ['offset : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUmemcpy3DOperand_st.op.array.array' in found_struct}} + @property def array(self): return self._array @@ -22954,30 +22454,28 @@ cdef class anon_struct24: parray = int(CUarray(array)) cyarray = parray self._array._pvt_ptr[0] = cyarray - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.array.offset' in found_struct}} + + @property def offset(self): return self._offset @offset.setter def offset(self, offset not None : CUoffset3D): - string.memcpy(&self._pvt_ptr[0].op.array.offset, offset.getPtr(), sizeof(self._pvt_ptr[0].op.array.offset)) - {{endif}} -{{endif}} -{{if 'CUmemcpy3DOperand_st.op' in found_struct}} + string.memcpy(&self._pvt_ptr[0].op.array.offset, offset.getPtr(), sizeof(self._pvt_ptr[0].op.array.offset)) + cdef class anon_union13: """ Attributes ---------- - {{if 'CUmemcpy3DOperand_st.op.ptr' in found_struct}} + ptr : anon_struct23 - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.array' in found_struct}} + + array : anon_struct24 - {{endif}} + Methods ------- @@ -22989,12 +22487,12 @@ cdef class anon_union13: def __init__(self, void_ptr _ptr): pass - {{if 'CUmemcpy3DOperand_st.op.ptr' in found_struct}} + self._ptr = anon_struct23(_ptr=self._pvt_ptr) - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.array' in found_struct}} + + self._array = anon_struct24(_ptr=self._pvt_ptr) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -23002,39 +22500,37 @@ cdef class anon_union13: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUmemcpy3DOperand_st.op.ptr' in found_struct}} + try: str_list += ['ptr :\n' + '\n'.join([' ' + line for line in str(self.ptr).splitlines()])] except ValueError: str_list += ['ptr : '] - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.array' in found_struct}} + + try: str_list += ['array :\n' + '\n'.join([' ' + line for line in str(self.array).splitlines()])] except ValueError: str_list += ['array : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUmemcpy3DOperand_st.op.ptr' in found_struct}} + @property def ptr(self): return self._ptr @ptr.setter def ptr(self, ptr not None : anon_struct23): - string.memcpy(&self._pvt_ptr[0].op.ptr, ptr.getPtr(), sizeof(self._pvt_ptr[0].op.ptr)) - {{endif}} - {{if 'CUmemcpy3DOperand_st.op.array' in found_struct}} + string.memcpy(&self._pvt_ptr[0].op.ptr, ptr.getPtr(), sizeof(self._pvt_ptr[0].op.ptr)) + + @property def array(self): return self._array @array.setter def array(self, array not None : anon_struct24): - string.memcpy(&self._pvt_ptr[0].op.array, array.getPtr(), sizeof(self._pvt_ptr[0].op.array)) - {{endif}} -{{endif}} -{{if 'CUmemcpy3DOperand_st' in found_struct}} + string.memcpy(&self._pvt_ptr[0].op.array, array.getPtr(), sizeof(self._pvt_ptr[0].op.array)) + cdef class CUmemcpy3DOperand_st: """ @@ -23042,14 +22538,14 @@ cdef class CUmemcpy3DOperand_st: Attributes ---------- - {{if 'CUmemcpy3DOperand_st.type' in found_struct}} + type : CUmemcpy3DOperandType - {{endif}} - {{if 'CUmemcpy3DOperand_st.op' in found_struct}} + + op : anon_union13 - {{endif}} + Methods ------- @@ -23064,9 +22560,9 @@ cdef class CUmemcpy3DOperand_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUmemcpy3DOperand_st.op' in found_struct}} + self._op = anon_union13(_ptr=self._pvt_ptr) - {{endif}} + def __dealloc__(self): if self._val_ptr is not NULL: free(self._val_ptr) @@ -23075,65 +22571,63 @@ cdef class CUmemcpy3DOperand_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUmemcpy3DOperand_st.type' in found_struct}} + try: str_list += ['type : ' + str(self.type)] except ValueError: str_list += ['type : '] - {{endif}} - {{if 'CUmemcpy3DOperand_st.op' in found_struct}} + + try: str_list += ['op :\n' + '\n'.join([' ' + line for line in str(self.op).splitlines()])] except ValueError: str_list += ['op : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUmemcpy3DOperand_st.type' in found_struct}} + @property def type(self): return CUmemcpy3DOperandType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : CUmemcpy3DOperandType): self._pvt_ptr[0].type = int(type) - {{endif}} - {{if 'CUmemcpy3DOperand_st.op' in found_struct}} + + @property def op(self): return self._op @op.setter def op(self, op not None : anon_union13): - string.memcpy(&self._pvt_ptr[0].op, op.getPtr(), sizeof(self._pvt_ptr[0].op)) - {{endif}} -{{endif}} -{{if 'CUDA_MEMCPY3D_BATCH_OP_st' in found_struct}} + string.memcpy(&self._pvt_ptr[0].op, op.getPtr(), sizeof(self._pvt_ptr[0].op)) + cdef class CUDA_MEMCPY3D_BATCH_OP_st: """ Attributes ---------- - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.src' in found_struct}} + src : CUmemcpy3DOperand Source memcpy operand. - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.dst' in found_struct}} + + dst : CUmemcpy3DOperand Destination memcpy operand. - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.extent' in found_struct}} + + extent : CUextent3D Extents of the memcpy between src and dst. The width, height and depth components must not be 0. - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.srcAccessOrder' in found_struct}} + + srcAccessOrder : CUmemcpySrcAccessOrder Source access ordering to be observed for copy from src to dst. - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.flags' in found_struct}} + + flags : unsigned int Additional flags for copies with this attribute. See CUmemcpyFlags - {{endif}} + Methods ------- @@ -23147,15 +22641,15 @@ cdef class CUDA_MEMCPY3D_BATCH_OP_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.src' in found_struct}} + self._src = CUmemcpy3DOperand(_ptr=&self._pvt_ptr[0].src) - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.dst' in found_struct}} + + self._dst = CUmemcpy3DOperand(_ptr=&self._pvt_ptr[0].dst) - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.extent' in found_struct}} + + self._extent = CUextent3D(_ptr=&self._pvt_ptr[0].extent) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -23163,81 +22657,79 @@ cdef class CUDA_MEMCPY3D_BATCH_OP_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.src' in found_struct}} + try: str_list += ['src :\n' + '\n'.join([' ' + line for line in str(self.src).splitlines()])] except ValueError: str_list += ['src : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.dst' in found_struct}} + + try: str_list += ['dst :\n' + '\n'.join([' ' + line for line in str(self.dst).splitlines()])] except ValueError: str_list += ['dst : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.extent' in found_struct}} + + try: str_list += ['extent :\n' + '\n'.join([' ' + line for line in str(self.extent).splitlines()])] except ValueError: str_list += ['extent : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.srcAccessOrder' in found_struct}} + + try: str_list += ['srcAccessOrder : ' + str(self.srcAccessOrder)] except ValueError: str_list += ['srcAccessOrder : '] - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.flags' in found_struct}} + + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.src' in found_struct}} + @property def src(self): return self._src @src.setter def src(self, src not None : CUmemcpy3DOperand): - string.memcpy(&self._pvt_ptr[0].src, src.getPtr(), sizeof(self._pvt_ptr[0].src)) - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.dst' in found_struct}} + string.memcpy(&self._pvt_ptr[0].src, src.getPtr(), sizeof(self._pvt_ptr[0].src)) + + @property def dst(self): return self._dst @dst.setter def dst(self, dst not None : CUmemcpy3DOperand): - string.memcpy(&self._pvt_ptr[0].dst, dst.getPtr(), sizeof(self._pvt_ptr[0].dst)) - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.extent' in found_struct}} + string.memcpy(&self._pvt_ptr[0].dst, dst.getPtr(), sizeof(self._pvt_ptr[0].dst)) + + @property def extent(self): return self._extent @extent.setter def extent(self, extent not None : CUextent3D): - string.memcpy(&self._pvt_ptr[0].extent, extent.getPtr(), sizeof(self._pvt_ptr[0].extent)) - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.srcAccessOrder' in found_struct}} + string.memcpy(&self._pvt_ptr[0].extent, extent.getPtr(), sizeof(self._pvt_ptr[0].extent)) + + @property def srcAccessOrder(self): return CUmemcpySrcAccessOrder(self._pvt_ptr[0].srcAccessOrder) @srcAccessOrder.setter def srcAccessOrder(self, srcAccessOrder not None : CUmemcpySrcAccessOrder): self._pvt_ptr[0].srcAccessOrder = int(srcAccessOrder) - {{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st.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 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st' in found_struct}} + cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v1_st: """ @@ -23245,30 +22737,30 @@ cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v1_st: Attributes ---------- - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.poolProps' in found_struct}} + poolProps : CUmemPoolProps in: location where the allocation should reside (specified in ::location). ::handleTypes must be CU_MEM_HANDLE_TYPE_NONE. IPC is not supported. - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.accessDescs' in found_struct}} + + accessDescs : CUmemAccessDesc in: array of memory access descriptors. Used to describe peer GPU access - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.accessDescCount' in found_struct}} + + accessDescCount : size_t in: number of memory access descriptors. Must not exceed the number of GPUs. - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.bytesize' in found_struct}} + + bytesize : size_t in: size in bytes of the requested allocation - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.dptr' in found_struct}} + + dptr : CUdeviceptr out: address of the allocation returned by CUDA - {{endif}} + Methods ------- @@ -23282,65 +22774,66 @@ cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v1_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.poolProps' in found_struct}} + self._poolProps = CUmemPoolProps(_ptr=&self._pvt_ptr[0].poolProps) - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.dptr' in found_struct}} + + self._dptr = CUdeviceptr(_ptr=&self._pvt_ptr[0].dptr) - {{endif}} + def __dealloc__(self): pass - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.accessDescs' in found_struct}} + if self._accessDescs is not NULL: free(self._accessDescs) - {{endif}} + self._pvt_ptr[0].accessDescs = NULL + def getPtr(self): return self._pvt_ptr def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.poolProps' in found_struct}} + try: str_list += ['poolProps :\n' + '\n'.join([' ' + line for line in str(self.poolProps).splitlines()])] except ValueError: str_list += ['poolProps : '] - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.accessDescs' in found_struct}} + + try: str_list += ['accessDescs : ' + str(self.accessDescs)] except ValueError: str_list += ['accessDescs : '] - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.accessDescCount' in found_struct}} + + try: str_list += ['accessDescCount : ' + str(self.accessDescCount)] except ValueError: str_list += ['accessDescCount : '] - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.bytesize' in found_struct}} + + try: str_list += ['bytesize : ' + str(self.bytesize)] except ValueError: str_list += ['bytesize : '] - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.dptr' in found_struct}} + + try: str_list += ['dptr : ' + str(self.dptr)] except ValueError: str_list += ['dptr : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.poolProps' in found_struct}} + @property def poolProps(self): return self._poolProps @poolProps.setter def poolProps(self, poolProps not None : CUmemPoolProps): - string.memcpy(&self._pvt_ptr[0].poolProps, poolProps.getPtr(), sizeof(self._pvt_ptr[0].poolProps)) - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.accessDescs' in found_struct}} + string.memcpy(&self._pvt_ptr[0].poolProps, poolProps.getPtr(), sizeof(self._pvt_ptr[0].poolProps)) + + @property def accessDescs(self): arrs = [self._pvt_ptr[0].accessDescs + x*sizeof(cydriver.CUmemAccessDesc) for x in range(self._accessDescs_length)] @@ -23349,6 +22842,7 @@ cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v1_st: def accessDescs(self, val): if len(val) == 0: free(self._accessDescs) + self._accessDescs = NULL self._accessDescs_length = 0 self._pvt_ptr[0].accessDescs = NULL else: @@ -23362,24 +22856,24 @@ cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v1_st: for idx in range(len(val)): string.memcpy(&self._accessDescs[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUmemAccessDesc)) - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.accessDescCount' in found_struct}} + + @property def accessDescCount(self): return self._pvt_ptr[0].accessDescCount @accessDescCount.setter def accessDescCount(self, size_t accessDescCount): self._pvt_ptr[0].accessDescCount = accessDescCount - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.bytesize' in found_struct}} + + @property def bytesize(self): return self._pvt_ptr[0].bytesize @bytesize.setter def bytesize(self, size_t bytesize): self._pvt_ptr[0].bytesize = bytesize - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st.dptr' in found_struct}} + + @property def dptr(self): return self._dptr @@ -23396,9 +22890,7 @@ cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v1_st: cydptr = pdptr self._dptr._pvt_ptr[0] = cydptr - {{endif}} -{{endif}} -{{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st' in found_struct}} + cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v2_st: """ @@ -23406,30 +22898,30 @@ cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v2_st: Attributes ---------- - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.poolProps' in found_struct}} + poolProps : CUmemPoolProps in: location where the allocation should reside (specified in ::location). ::handleTypes must be CU_MEM_HANDLE_TYPE_NONE. IPC is not supported. - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.accessDescs' in found_struct}} + + accessDescs : CUmemAccessDesc in: array of memory access descriptors. Used to describe peer GPU access - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.accessDescCount' in found_struct}} + + accessDescCount : size_t in: number of memory access descriptors. Must not exceed the number of GPUs. - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.bytesize' in found_struct}} + + bytesize : size_t in: size in bytes of the requested allocation - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.dptr' in found_struct}} + + dptr : CUdeviceptr out: address of the allocation returned by CUDA - {{endif}} + Methods ------- @@ -23443,65 +22935,66 @@ cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v2_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.poolProps' in found_struct}} + self._poolProps = CUmemPoolProps(_ptr=&self._pvt_ptr[0].poolProps) - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.dptr' in found_struct}} + + self._dptr = CUdeviceptr(_ptr=&self._pvt_ptr[0].dptr) - {{endif}} + def __dealloc__(self): pass - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.accessDescs' in found_struct}} + if self._accessDescs is not NULL: free(self._accessDescs) - {{endif}} + self._pvt_ptr[0].accessDescs = NULL + def getPtr(self): return self._pvt_ptr def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.poolProps' in found_struct}} + try: str_list += ['poolProps :\n' + '\n'.join([' ' + line for line in str(self.poolProps).splitlines()])] except ValueError: str_list += ['poolProps : '] - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.accessDescs' in found_struct}} + + try: str_list += ['accessDescs : ' + str(self.accessDescs)] except ValueError: str_list += ['accessDescs : '] - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.accessDescCount' in found_struct}} + + try: str_list += ['accessDescCount : ' + str(self.accessDescCount)] except ValueError: str_list += ['accessDescCount : '] - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.bytesize' in found_struct}} + + try: str_list += ['bytesize : ' + str(self.bytesize)] except ValueError: str_list += ['bytesize : '] - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.dptr' in found_struct}} + + try: str_list += ['dptr : ' + str(self.dptr)] except ValueError: str_list += ['dptr : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.poolProps' in found_struct}} + @property def poolProps(self): return self._poolProps @poolProps.setter def poolProps(self, poolProps not None : CUmemPoolProps): - string.memcpy(&self._pvt_ptr[0].poolProps, poolProps.getPtr(), sizeof(self._pvt_ptr[0].poolProps)) - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.accessDescs' in found_struct}} + string.memcpy(&self._pvt_ptr[0].poolProps, poolProps.getPtr(), sizeof(self._pvt_ptr[0].poolProps)) + + @property def accessDescs(self): arrs = [self._pvt_ptr[0].accessDescs + x*sizeof(cydriver.CUmemAccessDesc) for x in range(self._accessDescs_length)] @@ -23510,6 +23003,7 @@ cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v2_st: def accessDescs(self, val): if len(val) == 0: free(self._accessDescs) + self._accessDescs = NULL self._accessDescs_length = 0 self._pvt_ptr[0].accessDescs = NULL else: @@ -23523,24 +23017,24 @@ cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v2_st: for idx in range(len(val)): string.memcpy(&self._accessDescs[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUmemAccessDesc)) - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.accessDescCount' in found_struct}} + + @property def accessDescCount(self): return self._pvt_ptr[0].accessDescCount @accessDescCount.setter def accessDescCount(self, size_t accessDescCount): self._pvt_ptr[0].accessDescCount = accessDescCount - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.bytesize' in found_struct}} + + @property def bytesize(self): return self._pvt_ptr[0].bytesize @bytesize.setter def bytesize(self, size_t bytesize): self._pvt_ptr[0].bytesize = bytesize - {{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st.dptr' in found_struct}} + + @property def dptr(self): return self._dptr @@ -23557,9 +23051,7 @@ cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v2_st: cydptr = pdptr self._dptr._pvt_ptr[0] = cydptr - {{endif}} -{{endif}} -{{if 'CUDA_MEM_FREE_NODE_PARAMS_st' in found_struct}} + cdef class CUDA_MEM_FREE_NODE_PARAMS_st: """ @@ -23567,10 +23059,10 @@ cdef class CUDA_MEM_FREE_NODE_PARAMS_st: Attributes ---------- - {{if 'CUDA_MEM_FREE_NODE_PARAMS_st.dptr' in found_struct}} + dptr : CUdeviceptr in: the pointer to free - {{endif}} + Methods ------- @@ -23584,9 +23076,9 @@ cdef class CUDA_MEM_FREE_NODE_PARAMS_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_MEM_FREE_NODE_PARAMS_st.dptr' in found_struct}} + self._dptr = CUdeviceptr(_ptr=&self._pvt_ptr[0].dptr) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -23594,16 +23086,16 @@ cdef class CUDA_MEM_FREE_NODE_PARAMS_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_MEM_FREE_NODE_PARAMS_st.dptr' in found_struct}} + try: str_list += ['dptr : ' + str(self.dptr)] except ValueError: str_list += ['dptr : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_MEM_FREE_NODE_PARAMS_st.dptr' in found_struct}} + @property def dptr(self): return self._dptr @@ -23620,9 +23112,7 @@ cdef class CUDA_MEM_FREE_NODE_PARAMS_st: cydptr = pdptr self._dptr._pvt_ptr[0] = cydptr - {{endif}} -{{endif}} -{{if 'CUDA_CHILD_GRAPH_NODE_PARAMS_st' in found_struct}} + cdef class CUDA_CHILD_GRAPH_NODE_PARAMS_st: """ @@ -23630,18 +23120,18 @@ cdef class CUDA_CHILD_GRAPH_NODE_PARAMS_st: Attributes ---------- - {{if 'CUDA_CHILD_GRAPH_NODE_PARAMS_st.graph' in found_struct}} + graph : CUgraph The child graph to clone into the node for node creation, or a handle to the graph owned by the node for node query. The graph must not contain conditional nodes. Graphs containing memory allocation or memory free nodes must set the ownership to be moved to the parent. - {{endif}} - {{if 'CUDA_CHILD_GRAPH_NODE_PARAMS_st.ownership' in found_struct}} + + ownership : CUgraphChildGraphNodeOwnership The ownership relationship of the child graph node. - {{endif}} + Methods ------- @@ -23655,9 +23145,9 @@ cdef class CUDA_CHILD_GRAPH_NODE_PARAMS_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_CHILD_GRAPH_NODE_PARAMS_st.graph' in found_struct}} + self._graph = CUgraph(_ptr=&self._pvt_ptr[0].graph) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -23665,22 +23155,22 @@ cdef class CUDA_CHILD_GRAPH_NODE_PARAMS_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_CHILD_GRAPH_NODE_PARAMS_st.graph' in found_struct}} + try: str_list += ['graph : ' + str(self.graph)] except ValueError: str_list += ['graph : '] - {{endif}} - {{if 'CUDA_CHILD_GRAPH_NODE_PARAMS_st.ownership' in found_struct}} + + try: str_list += ['ownership : ' + str(self.ownership)] except ValueError: str_list += ['ownership : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_CHILD_GRAPH_NODE_PARAMS_st.graph' in found_struct}} + @property def graph(self): return self._graph @@ -23696,17 +23186,15 @@ cdef class CUDA_CHILD_GRAPH_NODE_PARAMS_st: pgraph = int(CUgraph(graph)) cygraph = pgraph self._graph._pvt_ptr[0] = cygraph - {{endif}} - {{if 'CUDA_CHILD_GRAPH_NODE_PARAMS_st.ownership' in found_struct}} + + @property def ownership(self): return CUgraphChildGraphNodeOwnership(self._pvt_ptr[0].ownership) @ownership.setter def ownership(self, ownership not None : CUgraphChildGraphNodeOwnership): self._pvt_ptr[0].ownership = int(ownership) - {{endif}} -{{endif}} -{{if 'CUDA_EVENT_RECORD_NODE_PARAMS_st' in found_struct}} + cdef class CUDA_EVENT_RECORD_NODE_PARAMS_st: """ @@ -23714,10 +23202,10 @@ cdef class CUDA_EVENT_RECORD_NODE_PARAMS_st: Attributes ---------- - {{if 'CUDA_EVENT_RECORD_NODE_PARAMS_st.event' in found_struct}} + event : CUevent The event to record when the node executes - {{endif}} + Methods ------- @@ -23731,9 +23219,9 @@ cdef class CUDA_EVENT_RECORD_NODE_PARAMS_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_EVENT_RECORD_NODE_PARAMS_st.event' in found_struct}} + self._event = CUevent(_ptr=&self._pvt_ptr[0].event) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -23741,16 +23229,16 @@ cdef class CUDA_EVENT_RECORD_NODE_PARAMS_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_EVENT_RECORD_NODE_PARAMS_st.event' in found_struct}} + try: str_list += ['event : ' + str(self.event)] except ValueError: str_list += ['event : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_EVENT_RECORD_NODE_PARAMS_st.event' in found_struct}} + @property def event(self): return self._event @@ -23766,9 +23254,7 @@ cdef class CUDA_EVENT_RECORD_NODE_PARAMS_st: pevent = int(CUevent(event)) cyevent = pevent self._event._pvt_ptr[0] = cyevent - {{endif}} -{{endif}} -{{if 'CUDA_EVENT_WAIT_NODE_PARAMS_st' in found_struct}} + cdef class CUDA_EVENT_WAIT_NODE_PARAMS_st: """ @@ -23776,10 +23262,10 @@ cdef class CUDA_EVENT_WAIT_NODE_PARAMS_st: Attributes ---------- - {{if 'CUDA_EVENT_WAIT_NODE_PARAMS_st.event' in found_struct}} + event : CUevent The event to wait on from the node - {{endif}} + Methods ------- @@ -23793,9 +23279,9 @@ cdef class CUDA_EVENT_WAIT_NODE_PARAMS_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUDA_EVENT_WAIT_NODE_PARAMS_st.event' in found_struct}} + self._event = CUevent(_ptr=&self._pvt_ptr[0].event) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -23803,16 +23289,16 @@ cdef class CUDA_EVENT_WAIT_NODE_PARAMS_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUDA_EVENT_WAIT_NODE_PARAMS_st.event' in found_struct}} + try: str_list += ['event : ' + str(self.event)] except ValueError: str_list += ['event : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUDA_EVENT_WAIT_NODE_PARAMS_st.event' in found_struct}} + @property def event(self): return self._event @@ -23828,9 +23314,7 @@ cdef class CUDA_EVENT_WAIT_NODE_PARAMS_st: pevent = int(CUevent(event)) cyevent = pevent self._event._pvt_ptr[0] = cyevent - {{endif}} -{{endif}} -{{if 'CUgraphNodeParams_st' in found_struct}} + cdef class CUgraphNodeParams_st: """ @@ -23838,74 +23322,78 @@ cdef class CUgraphNodeParams_st: Attributes ---------- - {{if 'CUgraphNodeParams_st.type' in found_struct}} + type : CUgraphNodeType Type of the node - {{endif}} - {{if 'CUgraphNodeParams_st.reserved0' in found_struct}} + + reserved0 : list[int] Reserved. Must be zero. - {{endif}} - {{if 'CUgraphNodeParams_st.reserved1' in found_struct}} + + reserved1 : list[long long] Padding. Unused bytes must be zero. - {{endif}} - {{if 'CUgraphNodeParams_st.kernel' in found_struct}} + + kernel : CUDA_KERNEL_NODE_PARAMS_v3 Kernel node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.memcpy' in found_struct}} + + memcpy : CUDA_MEMCPY_NODE_PARAMS Memcpy node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.memset' in found_struct}} + + memset : CUDA_MEMSET_NODE_PARAMS_v2 Memset node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.host' in found_struct}} + + host : CUDA_HOST_NODE_PARAMS_v2 Host node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.graph' in found_struct}} + + graph : CUDA_CHILD_GRAPH_NODE_PARAMS Child graph node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.eventWait' in found_struct}} + + eventWait : CUDA_EVENT_WAIT_NODE_PARAMS Event wait node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.eventRecord' in found_struct}} + + eventRecord : CUDA_EVENT_RECORD_NODE_PARAMS Event record node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.extSemSignal' in found_struct}} + + extSemSignal : CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 External semaphore signal node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.extSemWait' in found_struct}} + + extSemWait : CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 External semaphore wait node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.alloc' in found_struct}} + + alloc : CUDA_MEM_ALLOC_NODE_PARAMS_v2 Memory allocation node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.free' in found_struct}} + + free : CUDA_MEM_FREE_NODE_PARAMS Memory free node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.memOp' in found_struct}} + + memOp : CUDA_BATCH_MEM_OP_NODE_PARAMS_v2 MemOp node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.conditional' in found_struct}} + + conditional : CUDA_CONDITIONAL_NODE_PARAMS Conditional node parameters. - {{endif}} - {{if 'CUgraphNodeParams_st.reserved2' in found_struct}} + + + asBytes : bytes + Padding as bytes + + reserved2 : long long Reserved bytes. Must be zero. - {{endif}} + Methods ------- @@ -23920,45 +23408,45 @@ cdef class CUgraphNodeParams_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUgraphNodeParams_st.kernel' in found_struct}} + self._kernel = CUDA_KERNEL_NODE_PARAMS_v3(_ptr=&self._pvt_ptr[0].kernel) - {{endif}} - {{if 'CUgraphNodeParams_st.memcpy' in found_struct}} + + self._memcpy = CUDA_MEMCPY_NODE_PARAMS(_ptr=&self._pvt_ptr[0].memcpy) - {{endif}} - {{if 'CUgraphNodeParams_st.memset' in found_struct}} + + self._memset = CUDA_MEMSET_NODE_PARAMS_v2(_ptr=&self._pvt_ptr[0].memset) - {{endif}} - {{if 'CUgraphNodeParams_st.host' in found_struct}} + + self._host = CUDA_HOST_NODE_PARAMS_v2(_ptr=&self._pvt_ptr[0].host) - {{endif}} - {{if 'CUgraphNodeParams_st.graph' in found_struct}} + + self._graph = CUDA_CHILD_GRAPH_NODE_PARAMS(_ptr=&self._pvt_ptr[0].graph) - {{endif}} - {{if 'CUgraphNodeParams_st.eventWait' in found_struct}} + + self._eventWait = CUDA_EVENT_WAIT_NODE_PARAMS(_ptr=&self._pvt_ptr[0].eventWait) - {{endif}} - {{if 'CUgraphNodeParams_st.eventRecord' in found_struct}} + + self._eventRecord = CUDA_EVENT_RECORD_NODE_PARAMS(_ptr=&self._pvt_ptr[0].eventRecord) - {{endif}} - {{if 'CUgraphNodeParams_st.extSemSignal' in found_struct}} + + self._extSemSignal = CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2(_ptr=&self._pvt_ptr[0].extSemSignal) - {{endif}} - {{if 'CUgraphNodeParams_st.extSemWait' in found_struct}} + + self._extSemWait = CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2(_ptr=&self._pvt_ptr[0].extSemWait) - {{endif}} - {{if 'CUgraphNodeParams_st.alloc' in found_struct}} + + self._alloc = CUDA_MEM_ALLOC_NODE_PARAMS_v2(_ptr=&self._pvt_ptr[0].alloc) - {{endif}} - {{if 'CUgraphNodeParams_st.free' in found_struct}} + + self._free = CUDA_MEM_FREE_NODE_PARAMS(_ptr=&self._pvt_ptr[0].free) - {{endif}} - {{if 'CUgraphNodeParams_st.memOp' in found_struct}} + + self._memOp = CUDA_BATCH_MEM_OP_NODE_PARAMS_v2(_ptr=&self._pvt_ptr[0].memOp) - {{endif}} - {{if 'CUgraphNodeParams_st.conditional' in found_struct}} + + self._conditional = CUDA_CONDITIONAL_NODE_PARAMS(_ptr=&self._pvt_ptr[0].conditional) - {{endif}} + def __dealloc__(self): if self._val_ptr is not NULL: free(self._val_ptr) @@ -23967,249 +23455,272 @@ cdef class CUgraphNodeParams_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUgraphNodeParams_st.type' in found_struct}} + try: str_list += ['type : ' + str(self.type)] except ValueError: str_list += ['type : '] - {{endif}} - {{if 'CUgraphNodeParams_st.reserved0' in found_struct}} + + try: str_list += ['reserved0 : ' + str(self.reserved0)] except ValueError: str_list += ['reserved0 : '] - {{endif}} - {{if 'CUgraphNodeParams_st.reserved1' in found_struct}} + + try: str_list += ['reserved1 : ' + str(self.reserved1)] except ValueError: str_list += ['reserved1 : '] - {{endif}} - {{if 'CUgraphNodeParams_st.kernel' in found_struct}} + + try: str_list += ['kernel :\n' + '\n'.join([' ' + line for line in str(self.kernel).splitlines()])] except ValueError: str_list += ['kernel : '] - {{endif}} - {{if 'CUgraphNodeParams_st.memcpy' in found_struct}} + + try: str_list += ['memcpy :\n' + '\n'.join([' ' + line for line in str(self.memcpy).splitlines()])] except ValueError: str_list += ['memcpy : '] - {{endif}} - {{if 'CUgraphNodeParams_st.memset' in found_struct}} + + try: str_list += ['memset :\n' + '\n'.join([' ' + line for line in str(self.memset).splitlines()])] except ValueError: str_list += ['memset : '] - {{endif}} - {{if 'CUgraphNodeParams_st.host' in found_struct}} + + try: str_list += ['host :\n' + '\n'.join([' ' + line for line in str(self.host).splitlines()])] except ValueError: str_list += ['host : '] - {{endif}} - {{if 'CUgraphNodeParams_st.graph' in found_struct}} + + try: str_list += ['graph :\n' + '\n'.join([' ' + line for line in str(self.graph).splitlines()])] except ValueError: str_list += ['graph : '] - {{endif}} - {{if 'CUgraphNodeParams_st.eventWait' in found_struct}} + + try: str_list += ['eventWait :\n' + '\n'.join([' ' + line for line in str(self.eventWait).splitlines()])] except ValueError: str_list += ['eventWait : '] - {{endif}} - {{if 'CUgraphNodeParams_st.eventRecord' in found_struct}} + + try: str_list += ['eventRecord :\n' + '\n'.join([' ' + line for line in str(self.eventRecord).splitlines()])] except ValueError: str_list += ['eventRecord : '] - {{endif}} - {{if 'CUgraphNodeParams_st.extSemSignal' in found_struct}} + + try: str_list += ['extSemSignal :\n' + '\n'.join([' ' + line for line in str(self.extSemSignal).splitlines()])] except ValueError: str_list += ['extSemSignal : '] - {{endif}} - {{if 'CUgraphNodeParams_st.extSemWait' in found_struct}} + + try: str_list += ['extSemWait :\n' + '\n'.join([' ' + line for line in str(self.extSemWait).splitlines()])] except ValueError: str_list += ['extSemWait : '] - {{endif}} - {{if 'CUgraphNodeParams_st.alloc' in found_struct}} + + try: str_list += ['alloc :\n' + '\n'.join([' ' + line for line in str(self.alloc).splitlines()])] except ValueError: str_list += ['alloc : '] - {{endif}} - {{if 'CUgraphNodeParams_st.free' in found_struct}} + + try: str_list += ['free :\n' + '\n'.join([' ' + line for line in str(self.free).splitlines()])] except ValueError: str_list += ['free : '] - {{endif}} - {{if 'CUgraphNodeParams_st.memOp' in found_struct}} + + try: str_list += ['memOp :\n' + '\n'.join([' ' + line for line in str(self.memOp).splitlines()])] except ValueError: str_list += ['memOp : '] - {{endif}} - {{if 'CUgraphNodeParams_st.conditional' in found_struct}} + + try: str_list += ['conditional :\n' + '\n'.join([' ' + line for line in str(self.conditional).splitlines()])] except ValueError: str_list += ['conditional : '] - {{endif}} - {{if 'CUgraphNodeParams_st.reserved2' in found_struct}} + + + try: + str_list += ['asBytes : ' + str(self.asBytes)] + except ValueError: + str_list += ['asBytes : '] + + try: str_list += ['reserved2 : ' + str(self.reserved2)] except ValueError: str_list += ['reserved2 : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUgraphNodeParams_st.type' in found_struct}} + @property def type(self): return CUgraphNodeType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : CUgraphNodeType): self._pvt_ptr[0].type = int(type) - {{endif}} - {{if 'CUgraphNodeParams_st.reserved0' in found_struct}} + + @property def reserved0(self): return self._pvt_ptr[0].reserved0 @reserved0.setter def reserved0(self, reserved0): self._pvt_ptr[0].reserved0 = reserved0 - {{endif}} - {{if 'CUgraphNodeParams_st.reserved1' in found_struct}} + + @property def reserved1(self): return self._pvt_ptr[0].reserved1 @reserved1.setter def reserved1(self, reserved1): self._pvt_ptr[0].reserved1 = reserved1 - {{endif}} - {{if 'CUgraphNodeParams_st.kernel' in found_struct}} + + @property def kernel(self): return self._kernel @kernel.setter def kernel(self, kernel not None : CUDA_KERNEL_NODE_PARAMS_v3): - string.memcpy(&self._pvt_ptr[0].kernel, kernel.getPtr(), sizeof(self._pvt_ptr[0].kernel)) - {{endif}} - {{if 'CUgraphNodeParams_st.memcpy' in found_struct}} + string.memcpy(&self._pvt_ptr[0].kernel, kernel.getPtr(), sizeof(self._pvt_ptr[0].kernel)) + + @property def memcpy(self): return self._memcpy @memcpy.setter def memcpy(self, memcpy not None : CUDA_MEMCPY_NODE_PARAMS): - string.memcpy(&self._pvt_ptr[0].memcpy, memcpy.getPtr(), sizeof(self._pvt_ptr[0].memcpy)) - {{endif}} - {{if 'CUgraphNodeParams_st.memset' in found_struct}} + string.memcpy(&self._pvt_ptr[0].memcpy, memcpy.getPtr(), sizeof(self._pvt_ptr[0].memcpy)) + + @property def memset(self): return self._memset @memset.setter def memset(self, memset not None : CUDA_MEMSET_NODE_PARAMS_v2): - string.memcpy(&self._pvt_ptr[0].memset, memset.getPtr(), sizeof(self._pvt_ptr[0].memset)) - {{endif}} - {{if 'CUgraphNodeParams_st.host' in found_struct}} + string.memcpy(&self._pvt_ptr[0].memset, memset.getPtr(), sizeof(self._pvt_ptr[0].memset)) + + @property def host(self): return self._host @host.setter def host(self, host not None : CUDA_HOST_NODE_PARAMS_v2): - string.memcpy(&self._pvt_ptr[0].host, host.getPtr(), sizeof(self._pvt_ptr[0].host)) - {{endif}} - {{if 'CUgraphNodeParams_st.graph' in found_struct}} + string.memcpy(&self._pvt_ptr[0].host, host.getPtr(), sizeof(self._pvt_ptr[0].host)) + + @property def graph(self): return self._graph @graph.setter def graph(self, graph not None : CUDA_CHILD_GRAPH_NODE_PARAMS): - string.memcpy(&self._pvt_ptr[0].graph, graph.getPtr(), sizeof(self._pvt_ptr[0].graph)) - {{endif}} - {{if 'CUgraphNodeParams_st.eventWait' in found_struct}} + string.memcpy(&self._pvt_ptr[0].graph, graph.getPtr(), sizeof(self._pvt_ptr[0].graph)) + + @property def eventWait(self): return self._eventWait @eventWait.setter def eventWait(self, eventWait not None : CUDA_EVENT_WAIT_NODE_PARAMS): - string.memcpy(&self._pvt_ptr[0].eventWait, eventWait.getPtr(), sizeof(self._pvt_ptr[0].eventWait)) - {{endif}} - {{if 'CUgraphNodeParams_st.eventRecord' in found_struct}} + string.memcpy(&self._pvt_ptr[0].eventWait, eventWait.getPtr(), sizeof(self._pvt_ptr[0].eventWait)) + + @property def eventRecord(self): return self._eventRecord @eventRecord.setter def eventRecord(self, eventRecord not None : CUDA_EVENT_RECORD_NODE_PARAMS): - string.memcpy(&self._pvt_ptr[0].eventRecord, eventRecord.getPtr(), sizeof(self._pvt_ptr[0].eventRecord)) - {{endif}} - {{if 'CUgraphNodeParams_st.extSemSignal' in found_struct}} + string.memcpy(&self._pvt_ptr[0].eventRecord, eventRecord.getPtr(), sizeof(self._pvt_ptr[0].eventRecord)) + + @property def extSemSignal(self): return self._extSemSignal @extSemSignal.setter def extSemSignal(self, extSemSignal not None : CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2): - string.memcpy(&self._pvt_ptr[0].extSemSignal, extSemSignal.getPtr(), sizeof(self._pvt_ptr[0].extSemSignal)) - {{endif}} - {{if 'CUgraphNodeParams_st.extSemWait' in found_struct}} + string.memcpy(&self._pvt_ptr[0].extSemSignal, extSemSignal.getPtr(), sizeof(self._pvt_ptr[0].extSemSignal)) + + @property def extSemWait(self): return self._extSemWait @extSemWait.setter def extSemWait(self, extSemWait not None : CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2): - string.memcpy(&self._pvt_ptr[0].extSemWait, extSemWait.getPtr(), sizeof(self._pvt_ptr[0].extSemWait)) - {{endif}} - {{if 'CUgraphNodeParams_st.alloc' in found_struct}} + string.memcpy(&self._pvt_ptr[0].extSemWait, extSemWait.getPtr(), sizeof(self._pvt_ptr[0].extSemWait)) + + @property def alloc(self): return self._alloc @alloc.setter def alloc(self, alloc not None : CUDA_MEM_ALLOC_NODE_PARAMS_v2): - string.memcpy(&self._pvt_ptr[0].alloc, alloc.getPtr(), sizeof(self._pvt_ptr[0].alloc)) - {{endif}} - {{if 'CUgraphNodeParams_st.free' in found_struct}} + string.memcpy(&self._pvt_ptr[0].alloc, alloc.getPtr(), sizeof(self._pvt_ptr[0].alloc)) + + @property def free(self): return self._free @free.setter def free(self, free not None : CUDA_MEM_FREE_NODE_PARAMS): - string.memcpy(&self._pvt_ptr[0].free, free.getPtr(), sizeof(self._pvt_ptr[0].free)) - {{endif}} - {{if 'CUgraphNodeParams_st.memOp' in found_struct}} + string.memcpy(&self._pvt_ptr[0].free, free.getPtr(), sizeof(self._pvt_ptr[0].free)) + + @property def memOp(self): return self._memOp @memOp.setter def memOp(self, memOp not None : CUDA_BATCH_MEM_OP_NODE_PARAMS_v2): - string.memcpy(&self._pvt_ptr[0].memOp, memOp.getPtr(), sizeof(self._pvt_ptr[0].memOp)) - {{endif}} - {{if 'CUgraphNodeParams_st.conditional' in found_struct}} + string.memcpy(&self._pvt_ptr[0].memOp, memOp.getPtr(), sizeof(self._pvt_ptr[0].memOp)) + + @property def conditional(self): return self._conditional @conditional.setter def conditional(self, conditional not None : CUDA_CONDITIONAL_NODE_PARAMS): - string.memcpy(&self._pvt_ptr[0].conditional, conditional.getPtr(), sizeof(self._pvt_ptr[0].conditional)) - {{endif}} - {{if 'CUgraphNodeParams_st.reserved2' in found_struct}} + string.memcpy(&self._pvt_ptr[0].conditional, conditional.getPtr(), sizeof(self._pvt_ptr[0].conditional)) + + + @property + def asBytes(self): + return PyBytes_FromStringAndSize(self._pvt_ptr[0].asBytes, 232) + @asBytes.setter + def asBytes(self, asBytes): + if len(asBytes) != 232: + raise ValueError("asBytes length must be 232, is " + str(len(asBytes))) + if CHAR_MIN == 0: + for i, b in enumerate(asBytes): + if b < 0 and b > -129: + b = b + 256 + self._pvt_ptr[0].asBytes[i] = b + else: + for i, b in enumerate(asBytes): + if b > 127 and b < 256: + b = b - 256 + self._pvt_ptr[0].asBytes[i] = b + + @property def reserved2(self): return self._pvt_ptr[0].reserved2 @reserved2.setter def reserved2(self, long long reserved2): self._pvt_ptr[0].reserved2 = reserved2 - {{endif}} -{{endif}} -{{if 'CUcheckpointLockArgs_st' in found_struct}} + cdef class CUcheckpointLockArgs_st: """ @@ -24217,19 +23728,19 @@ cdef class CUcheckpointLockArgs_st: Attributes ---------- - {{if 'CUcheckpointLockArgs_st.timeoutMs' in found_struct}} + timeoutMs : unsigned int Timeout in milliseconds to attempt to lock the process, 0 indicates no timeout - {{endif}} - {{if 'CUcheckpointLockArgs_st.reserved0' in found_struct}} + + reserved0 : unsigned int Reserved for future use, must be zero - {{endif}} - {{if 'CUcheckpointLockArgs_st.reserved1' in found_struct}} + + reserved1 : list[cuuint64_t] Reserved for future use, must be zeroed - {{endif}} + Methods ------- @@ -24250,44 +23761,44 @@ cdef class CUcheckpointLockArgs_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUcheckpointLockArgs_st.timeoutMs' in found_struct}} + try: str_list += ['timeoutMs : ' + str(self.timeoutMs)] except ValueError: str_list += ['timeoutMs : '] - {{endif}} - {{if 'CUcheckpointLockArgs_st.reserved0' in found_struct}} + + try: str_list += ['reserved0 : ' + str(self.reserved0)] except ValueError: str_list += ['reserved0 : '] - {{endif}} - {{if 'CUcheckpointLockArgs_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 'CUcheckpointLockArgs_st.timeoutMs' in found_struct}} + @property def timeoutMs(self): return self._pvt_ptr[0].timeoutMs @timeoutMs.setter def timeoutMs(self, unsigned int timeoutMs): self._pvt_ptr[0].timeoutMs = timeoutMs - {{endif}} - {{if 'CUcheckpointLockArgs_st.reserved0' in found_struct}} + + @property def reserved0(self): return self._pvt_ptr[0].reserved0 @reserved0.setter def reserved0(self, unsigned int reserved0): self._pvt_ptr[0].reserved0 = reserved0 - {{endif}} - {{if 'CUcheckpointLockArgs_st.reserved1' in found_struct}} + + @property def reserved1(self): return [cuuint64_t(init_value=_reserved1) for _reserved1 in self._pvt_ptr[0].reserved1] @@ -24295,9 +23806,7 @@ cdef class CUcheckpointLockArgs_st: def reserved1(self, reserved1): self._pvt_ptr[0].reserved1 = reserved1 - {{endif}} -{{endif}} -{{if 'CUcheckpointCheckpointArgs_st' in found_struct}} + cdef class CUcheckpointCheckpointArgs_st: """ @@ -24305,10 +23814,10 @@ cdef class CUcheckpointCheckpointArgs_st: Attributes ---------- - {{if 'CUcheckpointCheckpointArgs_st.reserved' in found_struct}} + reserved : list[cuuint64_t] Reserved for future use, must be zeroed - {{endif}} + Methods ------- @@ -24329,16 +23838,16 @@ cdef class CUcheckpointCheckpointArgs_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUcheckpointCheckpointArgs_st.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 'CUcheckpointCheckpointArgs_st.reserved' in found_struct}} + @property def reserved(self): return [cuuint64_t(init_value=_reserved) for _reserved in self._pvt_ptr[0].reserved] @@ -24346,9 +23855,7 @@ cdef class CUcheckpointCheckpointArgs_st: def reserved(self, reserved): self._pvt_ptr[0].reserved = reserved - {{endif}} -{{endif}} -{{if 'CUcheckpointGpuPair_st' in found_struct}} + cdef class CUcheckpointGpuPair_st: """ @@ -24356,14 +23863,14 @@ cdef class CUcheckpointGpuPair_st: Attributes ---------- - {{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 ------- @@ -24377,12 +23884,12 @@ cdef class CUcheckpointGpuPair_st: 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): @@ -24390,39 +23897,37 @@ cdef class CUcheckpointGpuPair_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUcheckpointGpuPair_st.oldUuid' in found_struct}} + try: str_list += ['oldUuid :\n' + '\n'.join([' ' + line for line in str(self.oldUuid).splitlines()])] except ValueError: 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 'CUcheckpointGpuPair_st.oldUuid' in found_struct}} + @property 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}} + string.memcpy(&self._pvt_ptr[0].oldUuid, oldUuid.getPtr(), sizeof(self._pvt_ptr[0].oldUuid)) + + @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 'CUcheckpointRestoreArgs_st' in found_struct}} + string.memcpy(&self._pvt_ptr[0].newUuid, newUuid.getPtr(), sizeof(self._pvt_ptr[0].newUuid)) + cdef class CUcheckpointRestoreArgs_st: """ @@ -24430,23 +23935,23 @@ cdef class CUcheckpointRestoreArgs_st: 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 : list[cuuint64_t] Reserved for future use, must be zeroed - {{endif}} + Methods ------- @@ -24460,48 +23965,40 @@ cdef class CUcheckpointRestoreArgs_st: 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}} + self._pvt_ptr[0].gpuPairs = NULL + 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)] @@ -24510,6 +24007,7 @@ cdef class CUcheckpointRestoreArgs_st: def gpuPairs(self, val): if len(val) == 0: free(self._gpuPairs) + self._gpuPairs = NULL self._gpuPairs_length = 0 self._pvt_ptr[0].gpuPairs = NULL else: @@ -24523,23 +24021,23 @@ cdef class CUcheckpointRestoreArgs_st: 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) + return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, {{struct_field_array_lengths['CUcheckpointRestoreArgs_st.reserved']}}) @reserved.setter def reserved(self, reserved): - if len(reserved) != 44: - raise ValueError("reserved length must be 44, is " + str(len(reserved))) + if len(reserved) != {{struct_field_array_lengths['CUcheckpointRestoreArgs_st.reserved']}}: + raise ValueError("reserved length must be {{struct_field_array_lengths['CUcheckpointRestoreArgs_st.reserved']}}, is " + str(len(reserved))) if CHAR_MIN == 0: for i, b in enumerate(reserved): if b < 0 and b > -129: @@ -24550,27 +24048,16 @@ cdef class CUcheckpointRestoreArgs_st: 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 + 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 + - {{endif}} -{{endif}} -{{if 'CUcheckpointUnlockArgs_st' in found_struct}} cdef class CUcheckpointUnlockArgs_st: """ @@ -24578,10 +24065,10 @@ cdef class CUcheckpointUnlockArgs_st: Attributes ---------- - {{if 'CUcheckpointUnlockArgs_st.reserved' in found_struct}} + reserved : list[cuuint64_t] Reserved for future use, must be zeroed - {{endif}} + Methods ------- @@ -24602,16 +24089,16 @@ cdef class CUcheckpointUnlockArgs_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUcheckpointUnlockArgs_st.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 'CUcheckpointUnlockArgs_st.reserved' in found_struct}} + @property def reserved(self): return [cuuint64_t(init_value=_reserved) for _reserved in self._pvt_ptr[0].reserved] @@ -24619,9 +24106,7 @@ cdef class CUcheckpointUnlockArgs_st: def reserved(self, reserved): self._pvt_ptr[0].reserved = reserved - {{endif}} -{{endif}} -{{if 'CUmemDecompressParams_st' in found_struct}} + cdef class CUmemDecompressParams_st: """ @@ -24630,43 +24115,43 @@ cdef class CUmemDecompressParams_st: Attributes ---------- - {{if 'CUmemDecompressParams_st.srcNumBytes' in found_struct}} + srcNumBytes : size_t The number of bytes to be read and decompressed from CUmemDecompressParams_st.src. - {{endif}} - {{if 'CUmemDecompressParams_st.dstNumBytes' in found_struct}} + + dstNumBytes : size_t The number of bytes that the decompression operation will be expected to write to CUmemDecompressParams_st.dst. This value is optional; if present, it may be used by the CUDA driver as a heuristic for scheduling the individual decompression operations. - {{endif}} - {{if 'CUmemDecompressParams_st.dstActBytes' in found_struct}} + + dstActBytes : cuuint32_t After the decompression operation has completed, the actual number of bytes written to CUmemDecompressParams.dst will be recorded as a 32-bit unsigned integer in the memory at this address. - {{endif}} - {{if 'CUmemDecompressParams_st.src' in found_struct}} + + src : Any Pointer to a buffer of at least CUmemDecompressParams_st.srcNumBytes compressed bytes. - {{endif}} - {{if 'CUmemDecompressParams_st.dst' in found_struct}} + + dst : Any Pointer to a buffer where the decompressed data will be written. The number of bytes written to this location will be recorded in the memory pointed to by CUmemDecompressParams_st.dstActBytes - {{endif}} - {{if 'CUmemDecompressParams_st.algo' in found_struct}} + + algo : CUmemDecompressAlgorithm The decompression algorithm to use. - {{endif}} - {{if 'CUmemDecompressParams_st.padding' in found_struct}} + + padding : bytes - {{endif}} + Methods ------- @@ -24687,73 +24172,73 @@ cdef class CUmemDecompressParams_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUmemDecompressParams_st.srcNumBytes' in found_struct}} + try: str_list += ['srcNumBytes : ' + str(self.srcNumBytes)] except ValueError: str_list += ['srcNumBytes : '] - {{endif}} - {{if 'CUmemDecompressParams_st.dstNumBytes' in found_struct}} + + try: str_list += ['dstNumBytes : ' + str(self.dstNumBytes)] except ValueError: str_list += ['dstNumBytes : '] - {{endif}} - {{if 'CUmemDecompressParams_st.dstActBytes' in found_struct}} + + try: str_list += ['dstActBytes : ' + str(self.dstActBytes)] except ValueError: str_list += ['dstActBytes : '] - {{endif}} - {{if 'CUmemDecompressParams_st.src' in found_struct}} + + try: str_list += ['src : ' + hex(self.src)] except ValueError: str_list += ['src : '] - {{endif}} - {{if 'CUmemDecompressParams_st.dst' in found_struct}} + + try: str_list += ['dst : ' + hex(self.dst)] except ValueError: str_list += ['dst : '] - {{endif}} - {{if 'CUmemDecompressParams_st.algo' in found_struct}} + + try: str_list += ['algo : ' + str(self.algo)] except ValueError: str_list += ['algo : '] - {{endif}} - {{if 'CUmemDecompressParams_st.padding' in found_struct}} + + try: str_list += ['padding : ' + str(self.padding)] except ValueError: str_list += ['padding : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUmemDecompressParams_st.srcNumBytes' in found_struct}} + @property def srcNumBytes(self): return self._pvt_ptr[0].srcNumBytes @srcNumBytes.setter def srcNumBytes(self, size_t srcNumBytes): self._pvt_ptr[0].srcNumBytes = srcNumBytes - {{endif}} - {{if 'CUmemDecompressParams_st.dstNumBytes' in found_struct}} + + @property def dstNumBytes(self): return self._pvt_ptr[0].dstNumBytes @dstNumBytes.setter def dstNumBytes(self, size_t dstNumBytes): self._pvt_ptr[0].dstNumBytes = dstNumBytes - {{endif}} - {{if 'CUmemDecompressParams_st.dstActBytes' in found_struct}} + + @property def dstActBytes(self): return cuuint32_t(_ptr=self._pvt_ptr[0].dstActBytes) - {{endif}} - {{if 'CUmemDecompressParams_st.src' in found_struct}} + + @property def src(self): return self._pvt_ptr[0].src @@ -24761,8 +24246,8 @@ cdef class CUmemDecompressParams_st: def src(self, src): self._cysrc = _HelperInputVoidPtr(src) self._pvt_ptr[0].src = self._cysrc.cptr - {{endif}} - {{if 'CUmemDecompressParams_st.dst' in found_struct}} + + @property def dst(self): return self._pvt_ptr[0].dst @@ -24770,16 +24255,16 @@ cdef class CUmemDecompressParams_st: def dst(self, dst): self._cydst = _HelperInputVoidPtr(dst) self._pvt_ptr[0].dst = self._cydst.cptr - {{endif}} - {{if 'CUmemDecompressParams_st.algo' in found_struct}} + + @property def algo(self): return CUmemDecompressAlgorithm(self._pvt_ptr[0].algo) @algo.setter def algo(self, algo not None : CUmemDecompressAlgorithm): self._pvt_ptr[0].algo = int(algo) - {{endif}} - {{if 'CUmemDecompressParams_st.padding' in found_struct}} + + @property def padding(self): return PyBytes_FromStringAndSize(self._pvt_ptr[0].padding, 20) @@ -24789,35 +24274,332 @@ cdef class CUmemDecompressParams_st: raise ValueError("padding length must be 20, is " + str(len(padding))) for i, b in enumerate(padding): self._pvt_ptr[0].padding[i] = b - {{endif}} -{{endif}} -{{if 'CUdevSmResource_st' in found_struct}} + + +cdef class CUlogicalEndpointFabricHandle_st: + """ + Fabric handle for a logical endpoint + + Attributes + ---------- + + data : bytes + + + + 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 + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['data : ' + str(self.data)] + except ValueError: + str_list += ['data : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def data(self): + return PyBytes_FromStringAndSize(self._pvt_ptr[0].data, 64) + @data.setter + def data(self, data): + if len(data) != 64: + raise ValueError("data length must be 64, is " + str(len(data))) + for i, b in enumerate(data): + self._pvt_ptr[0].data[i] = b + + +cdef class anon_struct25: + """ + Attributes + ---------- + + device : CUdevice + + + + 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 + + self._device = CUdevice(_ptr=&self._pvt_ptr[0].unicast.device) + + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].unicast + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['device : ' + str(self.device)] + except ValueError: + str_list += ['device : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def device(self): + return self._device + @device.setter + def device(self, device): + cdef cydriver.CUdevice cydevice + if device is None: + cydevice = 0 + elif isinstance(device, (CUdevice)): + pdevice = int(device) + cydevice = pdevice + else: + pdevice = int(CUdevice(device)) + cydevice = pdevice + self._device._pvt_ptr[0] = cydevice + + + +cdef class anon_struct26: + """ + Attributes + ---------- + + numDevices : unsigned int + + + + 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].multicast + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['numDevices : ' + str(self.numDevices)] + except ValueError: + str_list += ['numDevices : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def numDevices(self): + return self._pvt_ptr[0].multicast.numDevices + @numDevices.setter + def numDevices(self, unsigned int numDevices): + self._pvt_ptr[0].multicast.numDevices = numDevices + + +cdef class CUlogicalEndpointProp_struct: + """ + Properties of a logical endpoint construction + + Attributes + ---------- + + type : CUlogicalEndpointType + Type of the logical endpoint defined in CUlogicalEndpointType + + + unicast : anon_struct25 + + + + multicast : anon_struct26 + + + + size : unsigned long long + Size of the logical endpoint + + + ipcHandleTypes : unsigned int + A bitmask of IPC handle types defined in + CUlogicalEndpointIpcHandleType + + + flags : unsigned int + A bitmask of flags defined in CUlogicalEndpointFlag + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr = 0): + if _ptr == 0: + self._val_ptr = calloc(1, sizeof(cydriver.CUlogicalEndpointProp_struct)) + self._pvt_ptr = self._val_ptr + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + pass + + self._unicast = anon_struct25(_ptr=self._pvt_ptr) + + + self._multicast = anon_struct26(_ptr=self._pvt_ptr) + + def __dealloc__(self): + if self._val_ptr is not NULL: + free(self._val_ptr) + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['type : ' + str(self.type)] + except ValueError: + str_list += ['type : '] + + + try: + str_list += ['unicast :\n' + '\n'.join([' ' + line for line in str(self.unicast).splitlines()])] + except ValueError: + str_list += ['unicast : '] + + + try: + str_list += ['multicast :\n' + '\n'.join([' ' + line for line in str(self.multicast).splitlines()])] + except ValueError: + str_list += ['multicast : '] + + + try: + str_list += ['size : ' + str(self.size)] + except ValueError: + str_list += ['size : '] + + + try: + str_list += ['ipcHandleTypes : ' + str(self.ipcHandleTypes)] + except ValueError: + str_list += ['ipcHandleTypes : '] + + + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def type(self): + return CUlogicalEndpointType(self._pvt_ptr[0].type) + @type.setter + def type(self, type not None : CUlogicalEndpointType): + self._pvt_ptr[0].type = int(type) + + + @property + def unicast(self): + return self._unicast + @unicast.setter + def unicast(self, unicast not None : anon_struct25): + string.memcpy(&self._pvt_ptr[0].unicast, unicast.getPtr(), sizeof(self._pvt_ptr[0].unicast)) + + + @property + def multicast(self): + return self._multicast + @multicast.setter + def multicast(self, multicast not None : anon_struct26): + string.memcpy(&self._pvt_ptr[0].multicast, multicast.getPtr(), sizeof(self._pvt_ptr[0].multicast)) + + + @property + def size(self): + return self._pvt_ptr[0].size + @size.setter + def size(self, unsigned long long size): + self._pvt_ptr[0].size = size + + + @property + def ipcHandleTypes(self): + return self._pvt_ptr[0].ipcHandleTypes + @ipcHandleTypes.setter + def ipcHandleTypes(self, unsigned int ipcHandleTypes): + self._pvt_ptr[0].ipcHandleTypes = ipcHandleTypes + + + @property + def flags(self): + return self._pvt_ptr[0].flags + @flags.setter + def flags(self, unsigned int flags): + self._pvt_ptr[0].flags = flags + cdef class CUdevSmResource_st: """ Attributes ---------- - {{if 'CUdevSmResource_st.smCount' in found_struct}} + smCount : unsigned int The amount of streaming multiprocessors available in this resource. - {{endif}} - {{if 'CUdevSmResource_st.minSmPartitionSize' in found_struct}} + + minSmPartitionSize : unsigned int The minimum number of streaming multiprocessors required to partition this resource. - {{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 will be a multiple of this value, unless the backfill flag is set. - {{endif}} - {{if 'CUdevSmResource_st.flags' in found_struct}} + + flags : unsigned int The flags set on this SM resource. For possible values see CUdevSmResourceGroup_flags. - {{endif}} + Methods ------- @@ -24838,84 +24620,82 @@ cdef class CUdevSmResource_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUdevSmResource_st.smCount' in found_struct}} + try: str_list += ['smCount : ' + str(self.smCount)] 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}} - {{if 'CUdevSmResource_st.flags' in found_struct}} + + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUdevSmResource_st.smCount' in found_struct}} + @property def smCount(self): return self._pvt_ptr[0].smCount @smCount.setter 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}} - {{if 'CUdevSmResource_st.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 'CUdevWorkqueueConfigResource_st' in found_struct}} + cdef class CUdevWorkqueueConfigResource_st: """ Attributes ---------- - {{if 'CUdevWorkqueueConfigResource_st.device' in found_struct}} + device : CUdevice The device on which the workqueue resources are available - {{endif}} - {{if 'CUdevWorkqueueConfigResource_st.wqConcurrencyLimit' in found_struct}} + + wqConcurrencyLimit : unsigned int The expected maximum number of concurrent stream-ordered workloads - {{endif}} - {{if 'CUdevWorkqueueConfigResource_st.sharingScope' in found_struct}} + + sharingScope : CUdevWorkqueueConfigScope The sharing scope for the workqueue resources - {{endif}} + Methods ------- @@ -24929,9 +24709,9 @@ cdef class CUdevWorkqueueConfigResource_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUdevWorkqueueConfigResource_st.device' in found_struct}} + self._device = CUdevice(_ptr=&self._pvt_ptr[0].device) - {{endif}} + def __dealloc__(self): pass def getPtr(self): @@ -24939,28 +24719,28 @@ cdef class CUdevWorkqueueConfigResource_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUdevWorkqueueConfigResource_st.device' in found_struct}} + try: str_list += ['device : ' + str(self.device)] except ValueError: str_list += ['device : '] - {{endif}} - {{if 'CUdevWorkqueueConfigResource_st.wqConcurrencyLimit' in found_struct}} + + try: str_list += ['wqConcurrencyLimit : ' + str(self.wqConcurrencyLimit)] except ValueError: str_list += ['wqConcurrencyLimit : '] - {{endif}} - {{if 'CUdevWorkqueueConfigResource_st.sharingScope' in found_struct}} + + try: str_list += ['sharingScope : ' + str(self.sharingScope)] except ValueError: str_list += ['sharingScope : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUdevWorkqueueConfigResource_st.device' in found_struct}} + @property def device(self): return self._device @@ -24977,34 +24757,32 @@ cdef class CUdevWorkqueueConfigResource_st: cydevice = pdevice self._device._pvt_ptr[0] = cydevice - {{endif}} - {{if 'CUdevWorkqueueConfigResource_st.wqConcurrencyLimit' in found_struct}} + + @property def wqConcurrencyLimit(self): return self._pvt_ptr[0].wqConcurrencyLimit @wqConcurrencyLimit.setter def wqConcurrencyLimit(self, unsigned int wqConcurrencyLimit): self._pvt_ptr[0].wqConcurrencyLimit = wqConcurrencyLimit - {{endif}} - {{if 'CUdevWorkqueueConfigResource_st.sharingScope' in found_struct}} + + @property def sharingScope(self): return CUdevWorkqueueConfigScope(self._pvt_ptr[0].sharingScope) @sharingScope.setter def sharingScope(self, sharingScope not None : CUdevWorkqueueConfigScope): self._pvt_ptr[0].sharingScope = int(sharingScope) - {{endif}} -{{endif}} -{{if 'CUdevWorkqueueResource_st' in found_struct}} + cdef class CUdevWorkqueueResource_st: """ Attributes ---------- - {{if 'CUdevWorkqueueResource_st.reserved' in found_struct}} + reserved : bytes Reserved for future use - {{endif}} + Methods ------- @@ -25025,16 +24803,16 @@ cdef class CUdevWorkqueueResource_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUdevWorkqueueResource_st.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 'CUdevWorkqueueResource_st.reserved' in found_struct}} + @property def reserved(self): return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 40) @@ -25044,37 +24822,35 @@ cdef class CUdevWorkqueueResource_st: raise ValueError("reserved length must be 40, is " + str(len(reserved))) for i, b in enumerate(reserved): self._pvt_ptr[0].reserved[i] = b - {{endif}} -{{endif}} -{{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st' in found_struct}} + cdef class CU_DEV_SM_RESOURCE_GROUP_PARAMS_st: """ Attributes ---------- - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st.smCount' in found_struct}} + smCount : unsigned int The amount of SMs available in this resource. - {{endif}} - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st.coscheduledSmCount' in found_struct}} + + coscheduledSmCount : unsigned int The amount of co-scheduled SMs grouped together for locality purposes. - {{endif}} - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st.preferredCoscheduledSmCount' in found_struct}} + + preferredCoscheduledSmCount : unsigned int When possible, combine co-scheduled groups together into larger groups of this size. - {{endif}} - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st.flags' in found_struct}} + + flags : unsigned int The flags set on this SM resource group. For possible values see CUdevSmResourceGroup_flags. - {{endif}} - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st.reserved' in found_struct}} + + reserved : list[unsigned int] - {{endif}} + Methods ------- @@ -25095,116 +24871,114 @@ cdef class CU_DEV_SM_RESOURCE_GROUP_PARAMS_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st.smCount' in found_struct}} + try: str_list += ['smCount : ' + str(self.smCount)] except ValueError: str_list += ['smCount : '] - {{endif}} - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st.coscheduledSmCount' in found_struct}} + + try: str_list += ['coscheduledSmCount : ' + str(self.coscheduledSmCount)] except ValueError: str_list += ['coscheduledSmCount : '] - {{endif}} - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st.preferredCoscheduledSmCount' in found_struct}} + + try: str_list += ['preferredCoscheduledSmCount : ' + str(self.preferredCoscheduledSmCount)] except ValueError: str_list += ['preferredCoscheduledSmCount : '] - {{endif}} - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st.flags' in found_struct}} + + try: str_list += ['flags : ' + str(self.flags)] except ValueError: str_list += ['flags : '] - {{endif}} - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st.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 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st.smCount' in found_struct}} + @property def smCount(self): return self._pvt_ptr[0].smCount @smCount.setter def smCount(self, unsigned int smCount): self._pvt_ptr[0].smCount = smCount - {{endif}} - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st.coscheduledSmCount' in found_struct}} + + @property def coscheduledSmCount(self): return self._pvt_ptr[0].coscheduledSmCount @coscheduledSmCount.setter def coscheduledSmCount(self, unsigned int coscheduledSmCount): self._pvt_ptr[0].coscheduledSmCount = coscheduledSmCount - {{endif}} - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st.preferredCoscheduledSmCount' in found_struct}} + + @property def preferredCoscheduledSmCount(self): return self._pvt_ptr[0].preferredCoscheduledSmCount @preferredCoscheduledSmCount.setter def preferredCoscheduledSmCount(self, unsigned int preferredCoscheduledSmCount): self._pvt_ptr[0].preferredCoscheduledSmCount = preferredCoscheduledSmCount - {{endif}} - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st.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}} - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st.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 'CUdevResource_st' in found_struct}} + cdef class CUdevResource_st: """ Attributes ---------- - {{if 'CUdevResource_st.type' in found_struct}} + type : CUdevResourceType Type of resource, dictates which union field was last set - {{endif}} - {{if 'CUdevResource_st._internal_padding' in found_struct}} + + _internal_padding : bytes - {{endif}} - {{if 'CUdevResource_st.sm' in found_struct}} + + sm : CUdevSmResource Resource corresponding to CU_DEV_RESOURCE_TYPE_SM `typename`. - {{endif}} - {{if 'CUdevResource_st.wqConfig' in found_struct}} + + wqConfig : CUdevWorkqueueConfigResource Resource corresponding to CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG `typename`. - {{endif}} - {{if 'CUdevResource_st.wq' in found_struct}} + + wq : CUdevWorkqueueResource Resource corresponding to CU_DEV_RESOURCE_TYPE_WORKQUEUE `typename`. - {{endif}} - {{if 'CUdevResource_st._oversize' in found_struct}} + + _oversize : bytes - {{endif}} - {{if 'CUdevResource_st.nextResource' in found_struct}} + + nextResource : CUdevResource_st - {{endif}} + Methods ------- @@ -25219,81 +24993,82 @@ cdef class CUdevResource_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if 'CUdevResource_st.sm' in found_struct}} + self._sm = CUdevSmResource(_ptr=&self._pvt_ptr[0].sm) - {{endif}} - {{if 'CUdevResource_st.wqConfig' in found_struct}} + + self._wqConfig = CUdevWorkqueueConfigResource(_ptr=&self._pvt_ptr[0].wqConfig) - {{endif}} - {{if 'CUdevResource_st.wq' in found_struct}} + + self._wq = CUdevWorkqueueResource(_ptr=&self._pvt_ptr[0].wq) - {{endif}} + def __dealloc__(self): if self._val_ptr is not NULL: free(self._val_ptr) - {{if 'CUdevResource_st.nextResource' in found_struct}} + if self._nextResource is not NULL: free(self._nextResource) - {{endif}} + self._pvt_ptr[0].nextResource = NULL + def getPtr(self): return self._pvt_ptr def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if 'CUdevResource_st.type' in found_struct}} + try: str_list += ['type : ' + str(self.type)] except ValueError: str_list += ['type : '] - {{endif}} - {{if 'CUdevResource_st._internal_padding' in found_struct}} + + try: str_list += ['_internal_padding : ' + str(self._internal_padding)] except ValueError: str_list += ['_internal_padding : '] - {{endif}} - {{if 'CUdevResource_st.sm' in found_struct}} + + try: str_list += ['sm :\n' + '\n'.join([' ' + line for line in str(self.sm).splitlines()])] except ValueError: str_list += ['sm : '] - {{endif}} - {{if 'CUdevResource_st.wqConfig' in found_struct}} + + try: str_list += ['wqConfig :\n' + '\n'.join([' ' + line for line in str(self.wqConfig).splitlines()])] except ValueError: str_list += ['wqConfig : '] - {{endif}} - {{if 'CUdevResource_st.wq' in found_struct}} + + try: str_list += ['wq :\n' + '\n'.join([' ' + line for line in str(self.wq).splitlines()])] except ValueError: str_list += ['wq : '] - {{endif}} - {{if 'CUdevResource_st._oversize' in found_struct}} + + try: str_list += ['_oversize : ' + str(self._oversize)] except ValueError: str_list += ['_oversize : '] - {{endif}} - {{if 'CUdevResource_st.nextResource' in found_struct}} + + try: str_list += ['nextResource : ' + str(self.nextResource)] except ValueError: str_list += ['nextResource : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if 'CUdevResource_st.type' in found_struct}} + @property def type(self): return CUdevResourceType(self._pvt_ptr[0].type) @type.setter def type(self, type not None : CUdevResourceType): self._pvt_ptr[0].type = int(type) - {{endif}} - {{if 'CUdevResource_st._internal_padding' in found_struct}} + + @property def _internal_padding(self): return PyBytes_FromStringAndSize(self._pvt_ptr[0]._internal_padding, 92) @@ -25303,32 +25078,32 @@ cdef class CUdevResource_st: raise ValueError("_internal_padding length must be 92, is " + str(len(_internal_padding))) for i, b in enumerate(_internal_padding): self._pvt_ptr[0]._internal_padding[i] = b - {{endif}} - {{if 'CUdevResource_st.sm' in found_struct}} + + @property def sm(self): return self._sm @sm.setter def sm(self, sm not None : CUdevSmResource): - string.memcpy(&self._pvt_ptr[0].sm, sm.getPtr(), sizeof(self._pvt_ptr[0].sm)) - {{endif}} - {{if 'CUdevResource_st.wqConfig' in found_struct}} + string.memcpy(&self._pvt_ptr[0].sm, sm.getPtr(), sizeof(self._pvt_ptr[0].sm)) + + @property def wqConfig(self): return self._wqConfig @wqConfig.setter def wqConfig(self, wqConfig not None : CUdevWorkqueueConfigResource): - string.memcpy(&self._pvt_ptr[0].wqConfig, wqConfig.getPtr(), sizeof(self._pvt_ptr[0].wqConfig)) - {{endif}} - {{if 'CUdevResource_st.wq' in found_struct}} + string.memcpy(&self._pvt_ptr[0].wqConfig, wqConfig.getPtr(), sizeof(self._pvt_ptr[0].wqConfig)) + + @property def wq(self): return self._wq @wq.setter def wq(self, wq not None : CUdevWorkqueueResource): - string.memcpy(&self._pvt_ptr[0].wq, wq.getPtr(), sizeof(self._pvt_ptr[0].wq)) - {{endif}} - {{if 'CUdevResource_st._oversize' in found_struct}} + string.memcpy(&self._pvt_ptr[0].wq, wq.getPtr(), sizeof(self._pvt_ptr[0].wq)) + + @property def _oversize(self): return PyBytes_FromStringAndSize(self._pvt_ptr[0]._oversize, 40) @@ -25338,8 +25113,8 @@ cdef class CUdevResource_st: raise ValueError("_oversize length must be 40, is " + str(len(_oversize))) for i, b in enumerate(_oversize): self._pvt_ptr[0]._oversize[i] = b - {{endif}} - {{if 'CUdevResource_st.nextResource' in found_struct}} + + @property def nextResource(self): arrs = [self._pvt_ptr[0].nextResource + x*sizeof(cydriver.CUdevResource_st) for x in range(self._nextResource_length)] @@ -25348,6 +25123,7 @@ cdef class CUdevResource_st: def nextResource(self, val): if len(val) == 0: free(self._nextResource) + self._nextResource = NULL self._nextResource_length = 0 self._pvt_ptr[0].nextResource = NULL else: @@ -25361,22 +25137,20 @@ cdef class CUdevResource_st: for idx in range(len(val)): string.memcpy(&self._nextResource[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUdevResource_st)) - {{endif}} -{{endif}} -{{if True}} -cdef class anon_union16: + +cdef class anon_union17: """ Attributes ---------- - {{if True}} + pArray : list[CUarray] - {{endif}} - {{if True}} + + pPitch : list[Any] - {{endif}} + Methods ------- @@ -25395,22 +25169,22 @@ cdef class anon_union16: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if True}} + try: str_list += ['pArray : ' + str(self.pArray)] except ValueError: str_list += ['pArray : '] - {{endif}} - {{if True}} + + try: str_list += ['pPitch : ' + hex(self.pPitch)] except ValueError: str_list += ['pPitch : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if True}} + @property def pArray(self): return [CUarray(init_value=_pArray) for _pArray in self._pvt_ptr[0].frame.pArray] @@ -25422,8 +25196,8 @@ cdef class anon_union16: for _idx, _pArray in enumerate(pArray): self._pvt_ptr[0].frame.pArray[_idx] = _pArray - {{endif}} - {{if True}} + + @property def pPitch(self): return [_pPitch for _pPitch in self._pvt_ptr[0].frame.pPitch] @@ -25434,9 +25208,7 @@ cdef class anon_union16: pPitch = [_pPitch for _pPitch in pPitch] for _idx, _pPitch in enumerate(pPitch): self._pvt_ptr[0].frame.pPitch[_idx] = _pPitch - {{endif}} -{{endif}} -{{if True}} + cdef class CUeglFrame_st: """ @@ -25446,46 +25218,46 @@ cdef class CUeglFrame_st: Attributes ---------- - {{if True}} - frame : anon_union16 - {{endif}} - {{if True}} + frame : anon_union17 + + + width : unsigned int Width of first plane - {{endif}} - {{if True}} + + height : unsigned int Height of first plane - {{endif}} - {{if True}} + + depth : unsigned int Depth of first plane - {{endif}} - {{if True}} + + pitch : unsigned int Pitch of first plane - {{endif}} - {{if True}} + + planeCount : unsigned int Number of planes - {{endif}} - {{if True}} + + numChannels : unsigned int Number of channels for the plane - {{endif}} - {{if True}} + + frameType : CUeglFrameType Array or Pitch - {{endif}} - {{if True}} + + eglColorFormat : CUeglColorFormat CUDA EGL Color Format - {{endif}} - {{if True}} + + cuFormat : CUarray_format CUDA Array Format - {{endif}} + Methods ------- @@ -25500,9 +25272,9 @@ cdef class CUeglFrame_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass - {{if True}} - self._frame = anon_union16(_ptr=self._pvt_ptr) - {{endif}} + + self._frame = anon_union17(_ptr=self._pvt_ptr) + def __dealloc__(self): if self._val_ptr is not NULL: free(self._val_ptr) @@ -25511,151 +25283,149 @@ cdef class CUeglFrame_st: def __repr__(self): if self._pvt_ptr is not NULL: str_list = [] - {{if True}} + try: str_list += ['frame :\n' + '\n'.join([' ' + line for line in str(self.frame).splitlines()])] except ValueError: str_list += ['frame : '] - {{endif}} - {{if True}} + + try: str_list += ['width : ' + str(self.width)] except ValueError: str_list += ['width : '] - {{endif}} - {{if True}} + + try: str_list += ['height : ' + str(self.height)] except ValueError: str_list += ['height : '] - {{endif}} - {{if True}} + + try: str_list += ['depth : ' + str(self.depth)] except ValueError: str_list += ['depth : '] - {{endif}} - {{if True}} + + try: str_list += ['pitch : ' + str(self.pitch)] except ValueError: str_list += ['pitch : '] - {{endif}} - {{if True}} + + try: str_list += ['planeCount : ' + str(self.planeCount)] except ValueError: str_list += ['planeCount : '] - {{endif}} - {{if True}} + + try: str_list += ['numChannels : ' + str(self.numChannels)] except ValueError: str_list += ['numChannels : '] - {{endif}} - {{if True}} + + try: str_list += ['frameType : ' + str(self.frameType)] except ValueError: str_list += ['frameType : '] - {{endif}} - {{if True}} + + try: str_list += ['eglColorFormat : ' + str(self.eglColorFormat)] except ValueError: str_list += ['eglColorFormat : '] - {{endif}} - {{if True}} + + try: str_list += ['cuFormat : ' + str(self.cuFormat)] except ValueError: str_list += ['cuFormat : '] - {{endif}} + return '\n'.join(str_list) else: return '' - {{if True}} + @property def frame(self): return self._frame @frame.setter - def frame(self, frame not None : anon_union16): - string.memcpy(&self._pvt_ptr[0].frame, frame.getPtr(), sizeof(self._pvt_ptr[0].frame)) - {{endif}} - {{if True}} + def frame(self, frame not None : anon_union17): + string.memcpy(&self._pvt_ptr[0].frame, frame.getPtr(), sizeof(self._pvt_ptr[0].frame)) + + @property def width(self): return self._pvt_ptr[0].width @width.setter def width(self, unsigned int width): self._pvt_ptr[0].width = width - {{endif}} - {{if True}} + + @property def height(self): return self._pvt_ptr[0].height @height.setter def height(self, unsigned int height): self._pvt_ptr[0].height = height - {{endif}} - {{if True}} + + @property def depth(self): return self._pvt_ptr[0].depth @depth.setter def depth(self, unsigned int depth): self._pvt_ptr[0].depth = depth - {{endif}} - {{if True}} + + @property def pitch(self): return self._pvt_ptr[0].pitch @pitch.setter def pitch(self, unsigned int pitch): self._pvt_ptr[0].pitch = pitch - {{endif}} - {{if True}} + + @property def planeCount(self): return self._pvt_ptr[0].planeCount @planeCount.setter def planeCount(self, unsigned int planeCount): self._pvt_ptr[0].planeCount = planeCount - {{endif}} - {{if True}} + + @property def numChannels(self): return self._pvt_ptr[0].numChannels @numChannels.setter def numChannels(self, unsigned int numChannels): self._pvt_ptr[0].numChannels = numChannels - {{endif}} - {{if True}} + + @property def frameType(self): return CUeglFrameType(self._pvt_ptr[0].frameType) @frameType.setter def frameType(self, frameType not None : CUeglFrameType): self._pvt_ptr[0].frameType = int(frameType) - {{endif}} - {{if True}} + + @property def eglColorFormat(self): return CUeglColorFormat(self._pvt_ptr[0].eglColorFormat) @eglColorFormat.setter def eglColorFormat(self, eglColorFormat not None : CUeglColorFormat): self._pvt_ptr[0].eglColorFormat = int(eglColorFormat) - {{endif}} - {{if True}} + + @property def cuFormat(self): return CUarray_format(self._pvt_ptr[0].cuFormat) @cuFormat.setter def cuFormat(self, cuFormat not None : CUarray_format): self._pvt_ptr[0].cuFormat = int(cuFormat) - {{endif}} -{{endif}} -{{if 'cuuint32_t' in found_types}} + cdef class cuuint32_t: """ @@ -25681,9 +25451,6 @@ cdef class cuuint32_t: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'cuuint64_t' in found_types}} cdef class cuuint64_t: """ @@ -25709,9 +25476,6 @@ cdef class cuuint64_t: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUdeviceptr_v2' in found_types}} cdef class CUdeviceptr_v2: """ @@ -25739,9 +25503,6 @@ cdef class CUdeviceptr_v2: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUdevice_v1' in found_types}} cdef class CUdevice_v1: """ @@ -25769,9 +25530,6 @@ cdef class CUdevice_v1: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUtexObject_v1' in found_types}} cdef class CUtexObject_v1: """ @@ -25799,9 +25557,6 @@ cdef class CUtexObject_v1: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUsurfObject_v1' in found_types}} cdef class CUsurfObject_v1: """ @@ -25829,9 +25584,6 @@ cdef class CUsurfObject_v1: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUmemGenericAllocationHandle_v1' in found_types}} cdef class CUmemGenericAllocationHandle_v1: """ @@ -25857,9 +25609,6 @@ cdef class CUmemGenericAllocationHandle_v1: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'CUlogIterator' in found_types}} cdef class CUlogIterator: """ @@ -25885,9 +25634,6 @@ cdef class CUlogIterator: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if True}} cdef class GLenum: """ @@ -25913,9 +25659,6 @@ cdef class GLenum: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if True}} cdef class GLuint: """ @@ -25941,9 +25684,6 @@ cdef class GLuint: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if True}} cdef class EGLint: """ @@ -25969,9 +25709,6 @@ cdef class EGLint: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if True}} cdef class VdpDevice: """ @@ -25997,9 +25734,6 @@ cdef class VdpDevice: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if True}} cdef class VdpGetProcAddress: """ @@ -26025,9 +25759,6 @@ cdef class VdpGetProcAddress: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if True}} cdef class VdpVideoSurface: """ @@ -26053,9 +25784,6 @@ cdef class VdpVideoSurface: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if True}} cdef class VdpOutputSurface: """ @@ -26081,9 +25809,6 @@ cdef class VdpOutputSurface: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} - -{{if 'cuGetErrorString' in found_functions}} @cython.embedsignature(True) def cuGetErrorString(error not None : CUresult): @@ -26117,9 +25842,6 @@ def cuGetErrorString(error not None : CUresult): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pStr if pStr != NULL else None) -{{endif}} - -{{if 'cuGetErrorName' in found_functions}} @cython.embedsignature(True) def cuGetErrorName(error not None : CUresult): @@ -26153,9 +25875,6 @@ def cuGetErrorName(error not None : CUresult): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pStr if pStr != NULL else None) -{{endif}} - -{{if 'cuInit' in found_functions}} @cython.embedsignature(True) def cuInit(unsigned int Flags): @@ -26180,9 +25899,6 @@ def cuInit(unsigned int Flags): with nogil: err = cydriver.cuInit(Flags) return (_CUresult(err),) -{{endif}} - -{{if 'cuDriverGetVersion' in found_functions}} @cython.embedsignature(True) def cuDriverGetVersion(): @@ -26212,9 +25928,6 @@ def cuDriverGetVersion(): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, driverVersion) -{{endif}} - -{{if 'cuDeviceGet' in found_functions}} @cython.embedsignature(True) def cuDeviceGet(int ordinal): @@ -26245,9 +25958,6 @@ def cuDeviceGet(int ordinal): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, device) -{{endif}} - -{{if 'cuDeviceGetCount' in found_functions}} @cython.embedsignature(True) def cuDeviceGetCount(): @@ -26274,9 +25984,6 @@ def cuDeviceGetCount(): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, count) -{{endif}} - -{{if 'cuDeviceGetName' in found_functions}} @cython.embedsignature(True) def cuDeviceGetName(int length, dev): @@ -26320,9 +26027,6 @@ def cuDeviceGetName(int length, dev): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pyname) -{{endif}} - -{{if 'cuDeviceGetUuid_v2' in found_functions}} @cython.embedsignature(True) def cuDeviceGetUuid(dev): @@ -26362,9 +26066,6 @@ def cuDeviceGetUuid(dev): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, uuid) -{{endif}} - -{{if 'cuDeviceGetLuid' in found_functions}} @cython.embedsignature(True) def cuDeviceGetLuid(dev): @@ -26406,9 +26107,6 @@ def cuDeviceGetLuid(dev): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None) return (_CUresult_SUCCESS, luid, deviceNodeMask) -{{endif}} - -{{if 'cuDeviceTotalMem_v2' in found_functions}} @cython.embedsignature(True) def cuDeviceTotalMem(dev): @@ -26447,9 +26145,6 @@ def cuDeviceTotalMem(dev): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, numbytes) -{{endif}} - -{{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}} @cython.embedsignature(True) def cuDeviceGetTexture1DLinearMaxWidth(pformat not None : CUarray_format, unsigned numChannels, dev): @@ -26495,9 +26190,6 @@ def cuDeviceGetTexture1DLinearMaxWidth(pformat not None : CUarray_format, unsign if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, maxWidthInElements) -{{endif}} - -{{if 'cuDeviceGetAttribute' in found_functions}} @cython.embedsignature(True) def cuDeviceGetAttribute(attrib not None : CUdevice_attribute, dev): @@ -26539,9 +26231,6 @@ def cuDeviceGetAttribute(attrib not None : CUdevice_attribute, dev): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pi) -{{endif}} - -{{if 'cuDeviceGetHostAtomicCapabilities' in found_functions}} @cython.embedsignature(True) def cuDeviceGetHostAtomicCapabilities(operations : Optional[tuple[CUatomicOperation] | list[CUatomicOperation]], unsigned int count, dev): @@ -26610,9 +26299,6 @@ def cuDeviceGetHostAtomicCapabilities(operations : Optional[tuple[CUatomicOperat if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pycapabilities) -{{endif}} - -{{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} @cython.embedsignature(True) def cuDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, dev, int flags): @@ -26690,7 +26376,6 @@ def cuDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, dev, int flags): ------- CUresult - See Also -------- :py:obj:`~.cuImportExternalSemaphore`, :py:obj:`~.cuDestroyExternalSemaphore`, :py:obj:`~.cuSignalExternalSemaphoresAsync`, :py:obj:`~.cuWaitExternalSemaphoresAsync` @@ -26709,9 +26394,6 @@ def cuDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, dev, int flags): err = cydriver.cuDeviceGetNvSciSyncAttributes(cynvSciSyncAttrList, cydev, flags) _helper_input_void_ptr_free(&cynvSciSyncAttrListHelper) return (_CUresult(err),) -{{endif}} - -{{if 'cuDeviceSetMemPool' in found_functions}} @cython.embedsignature(True) def cuDeviceSetMemPool(dev, pool): @@ -26761,9 +26443,6 @@ def cuDeviceSetMemPool(dev, pool): with nogil: err = cydriver.cuDeviceSetMemPool(cydev, cypool) return (_CUresult(err),) -{{endif}} - -{{if 'cuDeviceGetMemPool' in found_functions}} @cython.embedsignature(True) def cuDeviceGetMemPool(dev): @@ -26805,9 +26484,6 @@ def cuDeviceGetMemPool(dev): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pool) -{{endif}} - -{{if 'cuDeviceGetDefaultMemPool' in found_functions}} @cython.embedsignature(True) def cuDeviceGetDefaultMemPool(dev): @@ -26846,9 +26522,6 @@ def cuDeviceGetDefaultMemPool(dev): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pool_out) -{{endif}} - -{{if 'cuDeviceGetExecAffinitySupport' in found_functions}} @cython.embedsignature(True) def cuDeviceGetExecAffinitySupport(typename not None : CUexecAffinityType, dev): @@ -26894,9 +26567,6 @@ def cuDeviceGetExecAffinitySupport(typename not None : CUexecAffinityType, dev): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pi) -{{endif}} - -{{if 'cuFlushGPUDirectRDMAWrites' in found_functions}} @cython.embedsignature(True) def cuFlushGPUDirectRDMAWrites(target not None : CUflushGPUDirectRDMAWritesTarget, scope not None : CUflushGPUDirectRDMAWritesScope): @@ -26945,9 +26615,6 @@ def cuFlushGPUDirectRDMAWrites(target not None : CUflushGPUDirectRDMAWritesTarge with nogil: err = cydriver.cuFlushGPUDirectRDMAWrites(cytarget, cyscope) return (_CUresult(err),) -{{endif}} - -{{if 'cuDeviceGetProperties' in found_functions}} @cython.embedsignature(True) def cuDeviceGetProperties(dev): @@ -27025,9 +26692,6 @@ def cuDeviceGetProperties(dev): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, prop) -{{endif}} - -{{if 'cuDeviceComputeCapability' in found_functions}} @cython.embedsignature(True) def cuDeviceComputeCapability(dev): @@ -27074,9 +26738,6 @@ def cuDeviceComputeCapability(dev): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None) return (_CUresult_SUCCESS, major, minor) -{{endif}} - -{{if 'cuDevicePrimaryCtxRetain' in found_functions}} @cython.embedsignature(True) def cuDevicePrimaryCtxRetain(dev): @@ -27132,9 +26793,6 @@ def cuDevicePrimaryCtxRetain(dev): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pctx) -{{endif}} - -{{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}} @cython.embedsignature(True) def cuDevicePrimaryCtxRelease(dev): @@ -27178,9 +26836,6 @@ def cuDevicePrimaryCtxRelease(dev): with nogil: err = cydriver.cuDevicePrimaryCtxRelease(cydev) return (_CUresult(err),) -{{endif}} - -{{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}} @cython.embedsignature(True) def cuDevicePrimaryCtxSetFlags(dev, unsigned int flags): @@ -27292,9 +26947,6 @@ def cuDevicePrimaryCtxSetFlags(dev, unsigned int flags): with nogil: err = cydriver.cuDevicePrimaryCtxSetFlags(cydev, flags) return (_CUresult(err),) -{{endif}} - -{{if 'cuDevicePrimaryCtxGetState' in found_functions}} @cython.embedsignature(True) def cuDevicePrimaryCtxGetState(dev): @@ -27337,9 +26989,6 @@ def cuDevicePrimaryCtxGetState(dev): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None) return (_CUresult_SUCCESS, flags, active) -{{endif}} - -{{if 'cuDevicePrimaryCtxReset_v2' in found_functions}} @cython.embedsignature(True) def cuDevicePrimaryCtxReset(dev): @@ -27382,9 +27031,6 @@ def cuDevicePrimaryCtxReset(dev): with nogil: err = cydriver.cuDevicePrimaryCtxReset(cydev) return (_CUresult(err),) -{{endif}} - -{{if 'cuCtxCreate_v4' in found_functions}} @cython.embedsignature(True) def cuCtxCreate(ctxCreateParams : Optional[CUctxCreateParams], unsigned int flags, dev): @@ -27565,15 +27211,12 @@ 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 is not 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: return (_CUresult(err), None) return (_CUresult_SUCCESS, pctx) -{{endif}} - -{{if 'cuCtxDestroy_v2' in found_functions}} @cython.embedsignature(True) def cuCtxDestroy(ctx): @@ -27634,9 +27277,6 @@ def cuCtxDestroy(ctx): with nogil: err = cydriver.cuCtxDestroy(cyctx) return (_CUresult(err),) -{{endif}} - -{{if 'cuCtxPushCurrent_v2' in found_functions}} @cython.embedsignature(True) def cuCtxPushCurrent(ctx): @@ -27675,9 +27315,6 @@ def cuCtxPushCurrent(ctx): with nogil: err = cydriver.cuCtxPushCurrent(cyctx) return (_CUresult(err),) -{{endif}} - -{{if 'cuCtxPopCurrent_v2' in found_functions}} @cython.embedsignature(True) def cuCtxPopCurrent(): @@ -27708,9 +27345,6 @@ def cuCtxPopCurrent(): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pctx) -{{endif}} - -{{if 'cuCtxSetCurrent' in found_functions}} @cython.embedsignature(True) def cuCtxSetCurrent(ctx): @@ -27751,9 +27385,6 @@ def cuCtxSetCurrent(ctx): with nogil: err = cydriver.cuCtxSetCurrent(cyctx) return (_CUresult(err),) -{{endif}} - -{{if 'cuCtxGetCurrent' in found_functions}} @cython.embedsignature(True) def cuCtxGetCurrent(): @@ -27780,9 +27411,6 @@ def cuCtxGetCurrent(): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pctx) -{{endif}} - -{{if 'cuCtxGetDevice' in found_functions}} @cython.embedsignature(True) def cuCtxGetDevice(): @@ -27807,9 +27435,6 @@ def cuCtxGetDevice(): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, device) -{{endif}} - -{{if 'cuCtxGetDevice_v2' in found_functions}} @cython.embedsignature(True) def cuCtxGetDevice_v2(ctx): @@ -27849,9 +27474,6 @@ def cuCtxGetDevice_v2(ctx): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, device) -{{endif}} - -{{if 'cuCtxGetFlags' in found_functions}} @cython.embedsignature(True) def cuCtxGetFlags(): @@ -27877,9 +27499,6 @@ def cuCtxGetFlags(): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, flags) -{{endif}} - -{{if 'cuCtxSetFlags' in found_functions}} @cython.embedsignature(True) def cuCtxSetFlags(unsigned int flags): @@ -27905,9 +27524,6 @@ def cuCtxSetFlags(unsigned int flags): with nogil: err = cydriver.cuCtxSetFlags(flags) return (_CUresult(err),) -{{endif}} - -{{if 'cuCtxGetId' in found_functions}} @cython.embedsignature(True) def cuCtxGetId(ctx): @@ -27948,9 +27564,6 @@ def cuCtxGetId(ctx): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, ctxId) -{{endif}} - -{{if 'cuCtxSynchronize' in found_functions}} @cython.embedsignature(True) def cuCtxSynchronize(): @@ -27976,9 +27589,6 @@ def cuCtxSynchronize(): with nogil: err = cydriver.cuCtxSynchronize() return (_CUresult(err),) -{{endif}} - -{{if 'cuCtxSynchronize_v2' in found_functions}} @cython.embedsignature(True) def cuCtxSynchronize_v2(ctx): @@ -28021,9 +27631,6 @@ def cuCtxSynchronize_v2(ctx): with nogil: err = cydriver.cuCtxSynchronize_v2(cyctx) return (_CUresult(err),) -{{endif}} - -{{if 'cuCtxSetLimit' in found_functions}} @cython.embedsignature(True) def cuCtxSetLimit(limit not None : CUlimit, size_t value): @@ -28128,9 +27735,6 @@ def cuCtxSetLimit(limit not None : CUlimit, size_t value): with nogil: err = cydriver.cuCtxSetLimit(cylimit, value) return (_CUresult(err),) -{{endif}} - -{{if 'cuCtxGetLimit' in found_functions}} @cython.embedsignature(True) def cuCtxGetLimit(limit not None : CUlimit): @@ -28167,18 +27771,14 @@ def cuCtxGetLimit(limit not None : CUlimit): Parameters ---------- limit : :py:obj:`~.CUlimit` - Limit to query + None Returns ------- CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_UNSUPPORTED_LIMIT` - pvalue : int - Returned size of limit - See Also - -------- - :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuCtxDestroy`, :py:obj:`~.cuCtxGetApiVersion`, :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxPopCurrent`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuCtxSetLimit`, :py:obj:`~.cuCtxSynchronize`, :py:obj:`~.cudaDeviceGetLimit` + pvalue : int + None """ cdef size_t pvalue = 0 cdef cydriver.CUlimit cylimit = int(limit) @@ -28187,9 +27787,6 @@ def cuCtxGetLimit(limit not None : CUlimit): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pvalue) -{{endif}} - -{{if 'cuCtxGetCacheConfig' in found_functions}} @cython.embedsignature(True) def cuCtxGetCacheConfig(): @@ -28235,9 +27832,6 @@ def cuCtxGetCacheConfig(): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, CUfunc_cache(pconfig)) -{{endif}} - -{{if 'cuCtxSetCacheConfig' in found_functions}} @cython.embedsignature(True) def cuCtxSetCacheConfig(config not None : CUfunc_cache): @@ -28293,9 +27887,6 @@ def cuCtxSetCacheConfig(config not None : CUfunc_cache): with nogil: err = cydriver.cuCtxSetCacheConfig(cyconfig) return (_CUresult(err),) -{{endif}} - -{{if 'cuCtxGetApiVersion' in found_functions}} @cython.embedsignature(True) def cuCtxGetApiVersion(ctx): @@ -28341,9 +27932,6 @@ def cuCtxGetApiVersion(ctx): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, version) -{{endif}} - -{{if 'cuCtxGetStreamPriorityRange' in found_functions}} @cython.embedsignature(True) def cuCtxGetStreamPriorityRange(): @@ -28387,9 +27975,6 @@ def cuCtxGetStreamPriorityRange(): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None) return (_CUresult_SUCCESS, leastPriority, greatestPriority) -{{endif}} - -{{if 'cuCtxResetPersistingL2Cache' in found_functions}} @cython.embedsignature(True) def cuCtxResetPersistingL2Cache(): @@ -28410,9 +27995,6 @@ def cuCtxResetPersistingL2Cache(): with nogil: err = cydriver.cuCtxResetPersistingL2Cache() return (_CUresult(err),) -{{endif}} - -{{if 'cuCtxGetExecAffinity' in found_functions}} @cython.embedsignature(True) def cuCtxGetExecAffinity(typename not None : CUexecAffinityType): @@ -28447,9 +28029,6 @@ def cuCtxGetExecAffinity(typename not None : CUexecAffinityType): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pExecAffinity) -{{endif}} - -{{if 'cuCtxRecordEvent' in found_functions}} @cython.embedsignature(True) def cuCtxRecordEvent(hCtx, hEvent): @@ -28507,9 +28086,6 @@ def cuCtxRecordEvent(hCtx, hEvent): with nogil: err = cydriver.cuCtxRecordEvent(cyhCtx, cyhEvent) return (_CUresult(err),) -{{endif}} - -{{if 'cuCtxWaitEvent' in found_functions}} @cython.embedsignature(True) def cuCtxWaitEvent(hCtx, hEvent): @@ -28566,9 +28142,6 @@ def cuCtxWaitEvent(hCtx, hEvent): with nogil: err = cydriver.cuCtxWaitEvent(cyhCtx, cyhEvent) return (_CUresult(err),) -{{endif}} - -{{if 'cuCtxAttach' in found_functions}} @cython.embedsignature(True) def cuCtxAttach(unsigned int flags): @@ -28607,9 +28180,6 @@ def cuCtxAttach(unsigned int flags): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pctx) -{{endif}} - -{{if 'cuCtxDetach' in found_functions}} @cython.embedsignature(True) def cuCtxDetach(ctx): @@ -28649,9 +28219,6 @@ def cuCtxDetach(ctx): with nogil: err = cydriver.cuCtxDetach(cyctx) return (_CUresult(err),) -{{endif}} - -{{if 'cuCtxGetSharedMemConfig' in found_functions}} @cython.embedsignature(True) def cuCtxGetSharedMemConfig(): @@ -28692,9 +28259,6 @@ def cuCtxGetSharedMemConfig(): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, CUsharedconfig(pConfig)) -{{endif}} - -{{if 'cuCtxSetSharedMemConfig' in found_functions}} @cython.embedsignature(True) def cuCtxSetSharedMemConfig(config not None : CUsharedconfig): @@ -28747,9 +28311,6 @@ def cuCtxSetSharedMemConfig(config not None : CUsharedconfig): with nogil: err = cydriver.cuCtxSetSharedMemConfig(cyconfig) return (_CUresult(err),) -{{endif}} - -{{if 'cuModuleLoad' in found_functions}} @cython.embedsignature(True) def cuModuleLoad(char* fname): @@ -28786,9 +28347,6 @@ def cuModuleLoad(char* fname): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, module) -{{endif}} - -{{if 'cuModuleLoadData' in found_functions}} @cython.embedsignature(True) def cuModuleLoadData(image): @@ -28824,9 +28382,6 @@ def cuModuleLoadData(image): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, module) -{{endif}} - -{{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]]): @@ -28878,9 +28433,6 @@ def cuModuleLoadDataEx(image, unsigned int numOptions, options : Optional[tuple[ if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, module) -{{endif}} - -{{if 'cuModuleLoadFatBinary' in found_functions}} @cython.embedsignature(True) def cuModuleLoadFatBinary(fatCubin): @@ -28922,9 +28474,6 @@ def cuModuleLoadFatBinary(fatCubin): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, module) -{{endif}} - -{{if 'cuModuleUnload' in found_functions}} @cython.embedsignature(True) def cuModuleUnload(hmod): @@ -28960,9 +28509,6 @@ def cuModuleUnload(hmod): with nogil: err = cydriver.cuModuleUnload(cyhmod) return (_CUresult(err),) -{{endif}} - -{{if 'cuModuleGetLoadingMode' in found_functions}} @cython.embedsignature(True) def cuModuleGetLoadingMode(): @@ -28988,9 +28534,6 @@ def cuModuleGetLoadingMode(): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, CUmoduleLoadingMode(mode)) -{{endif}} - -{{if 'cuModuleGetFunction' in found_functions}} @cython.embedsignature(True) def cuModuleGetFunction(hmod, char* name): @@ -29033,9 +28576,6 @@ def cuModuleGetFunction(hmod, char* name): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, hfunc) -{{endif}} - -{{if 'cuModuleGetFunctionCount' in found_functions}} @cython.embedsignature(True) def cuModuleGetFunctionCount(mod): @@ -29069,9 +28609,6 @@ def cuModuleGetFunctionCount(mod): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, count) -{{endif}} - -{{if 'cuModuleEnumerateFunctions' in found_functions}} @cython.embedsignature(True) def cuModuleEnumerateFunctions(unsigned int numFunctions, mod): @@ -29128,9 +28665,6 @@ def cuModuleEnumerateFunctions(unsigned int numFunctions, mod): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pyfunctions) -{{endif}} - -{{if 'cuModuleGetGlobal_v2' in found_functions}} @cython.embedsignature(True) def cuModuleGetGlobal(hmod, char* name): @@ -29177,25 +28711,22 @@ def cuModuleGetGlobal(hmod, char* name): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None) return (_CUresult_SUCCESS, dptr, numbytes) -{{endif}} - -{{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]]): """ Creates a pending JIT linker invocation. - If the call is successful, the caller owns the returned CUlinkState, - which should eventually be destroyed with :py:obj:`~.cuLinkDestroy`. - The device code machine size (32 or 64 bit) will match the calling - application. + If the call is successful, the caller owns the returned + :py:obj:`~.CUlinkState`, which should eventually be destroyed with + :py:obj:`~.cuLinkDestroy`. The device code machine size (32 or 64 bit) + will match the calling application. Both linker and compiler options may be specified. Compiler options will be applied to inputs to this linker action which must be compiled from PTX. The options :py:obj:`~.CU_JIT_WALL_TIME`, :py:obj:`~.CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES`, and :py:obj:`~.CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES` will accumulate data - until the CUlinkState is destroyed. + until the :py:obj:`~.CUlinkState` is destroyed. The data passed in via :py:obj:`~.cuLinkAddData` and :py:obj:`~.cuLinkAddFile` will be treated as relocatable (-rdc=true to @@ -29203,9 +28734,9 @@ def cuLinkCreate(unsigned int numOptions, options : Optional[tuple[CUjit_option] and will have similar consequences as offline relocatable device code linking. - `optionValues` must remain valid for the life of the CUlinkState if - output options are used. No other references to inputs are maintained - after this call returns. + `optionValues` must remain valid for the life of the + :py:obj:`~.CUlinkState` if output options are used. No other references + to inputs are maintained after this call returns. Parameters ---------- @@ -29221,8 +28752,8 @@ def cuLinkCreate(unsigned int numOptions, options : Optional[tuple[CUjit_option] 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`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_JIT_COMPILER_NOT_FOUND` stateOut : :py:obj:`~.CUlinkState` - On success, this will contain a CUlinkState to specify and complete - this action + On success, this will contain a :py:obj:`~.CUlinkState` to specify + and complete this action See Also -------- @@ -29251,9 +28782,6 @@ def cuLinkCreate(unsigned int numOptions, options : Optional[tuple[CUjit_option] if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, stateOut) -{{endif}} - -{{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]]): @@ -29326,9 +28854,6 @@ def cuLinkAddData(state, typename not None : CUjitInputType, data, size_t size, err = cydriver.cuLinkAddData(cystate, cytypename, cydata, size, name, numOptions, cyoptions.data(), cyoptionValues_ptr) _helper_input_void_ptr_free(&cydataHelper) return (_CUresult(err),) -{{endif}} - -{{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]]): @@ -29396,9 +28921,6 @@ def cuLinkAddFile(state, typename not None : CUjitInputType, char* path, unsigne with nogil: err = cydriver.cuLinkAddFile(cystate, cytypename, path, numOptions, cyoptions.data(), cyoptionValues_ptr) return (_CUresult(err),) -{{endif}} - -{{if 'cuLinkComplete' in found_functions}} @cython.embedsignature(True) def cuLinkComplete(state): @@ -29443,9 +28965,6 @@ def cuLinkComplete(state): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None) return (_CUresult_SUCCESS, cubinOut, sizeOut) -{{endif}} - -{{if 'cuLinkDestroy' in found_functions}} @cython.embedsignature(True) def cuLinkDestroy(state): @@ -29476,9 +28995,6 @@ def cuLinkDestroy(state): with nogil: err = cydriver.cuLinkDestroy(cystate) return (_CUresult(err),) -{{endif}} - -{{if 'cuModuleGetTexRef' in found_functions}} @cython.embedsignature(True) def cuModuleGetTexRef(hmod, char* name): @@ -29525,9 +29041,6 @@ def cuModuleGetTexRef(hmod, char* name): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pTexRef) -{{endif}} - -{{if 'cuModuleGetSurfRef' in found_functions}} @cython.embedsignature(True) def cuModuleGetSurfRef(hmod, char* name): @@ -29572,9 +29085,6 @@ def cuModuleGetSurfRef(hmod, char* name): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pSurfRef) -{{endif}} - -{{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): @@ -29672,9 +29182,6 @@ def cuLibraryLoadData(code, jitOptions : Optional[tuple[CUjit_option] | list[CUj if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, library) -{{endif}} - -{{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): @@ -29769,9 +29276,6 @@ def cuLibraryLoadFromFile(char* fileName, jitOptions : Optional[tuple[CUjit_opti if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, library) -{{endif}} - -{{if 'cuLibraryUnload' in found_functions}} @cython.embedsignature(True) def cuLibraryUnload(library): @@ -29804,9 +29308,6 @@ def cuLibraryUnload(library): with nogil: err = cydriver.cuLibraryUnload(cylibrary) return (_CUresult(err),) -{{endif}} - -{{if 'cuLibraryGetKernel' in found_functions}} @cython.embedsignature(True) def cuLibraryGetKernel(library, char* name): @@ -29848,9 +29349,6 @@ def cuLibraryGetKernel(library, char* name): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pKernel) -{{endif}} - -{{if 'cuLibraryGetKernelCount' in found_functions}} @cython.embedsignature(True) def cuLibraryGetKernelCount(lib): @@ -29884,9 +29382,6 @@ def cuLibraryGetKernelCount(lib): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, count) -{{endif}} - -{{if 'cuLibraryEnumerateKernels' in found_functions}} @cython.embedsignature(True) def cuLibraryEnumerateKernels(unsigned int numKernels, lib): @@ -29937,9 +29432,6 @@ def cuLibraryEnumerateKernels(unsigned int numKernels, lib): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pykernels) -{{endif}} - -{{if 'cuLibraryGetModule' in found_functions}} @cython.embedsignature(True) def cuLibraryGetModule(library): @@ -29979,9 +29471,6 @@ def cuLibraryGetModule(library): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pMod) -{{endif}} - -{{if 'cuKernelGetFunction' in found_functions}} @cython.embedsignature(True) def cuKernelGetFunction(kernel): @@ -30021,9 +29510,6 @@ def cuKernelGetFunction(kernel): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pFunc) -{{endif}} - -{{if 'cuKernelGetLibrary' in found_functions}} @cython.embedsignature(True) def cuKernelGetLibrary(kernel): @@ -30062,9 +29548,6 @@ def cuKernelGetLibrary(kernel): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pLib) -{{endif}} - -{{if 'cuLibraryGetGlobal' in found_functions}} @cython.embedsignature(True) def cuLibraryGetGlobal(library, char* name): @@ -30111,9 +29594,6 @@ def cuLibraryGetGlobal(library, char* name): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None) return (_CUresult_SUCCESS, dptr, numbytes) -{{endif}} - -{{if 'cuLibraryGetManaged' in found_functions}} @cython.embedsignature(True) def cuLibraryGetManaged(library, char* name): @@ -30162,9 +29642,6 @@ def cuLibraryGetManaged(library, char* name): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None) return (_CUresult_SUCCESS, dptr, numbytes) -{{endif}} - -{{if 'cuLibraryGetUnifiedFunction' in found_functions}} @cython.embedsignature(True) def cuLibraryGetUnifiedFunction(library, char* symbol): @@ -30209,9 +29686,6 @@ def cuLibraryGetUnifiedFunction(library, char* symbol): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, fptr) -{{endif}} - -{{if 'cuKernelGetAttribute' in found_functions}} @cython.embedsignature(True) def cuKernelGetAttribute(attrib not None : CUfunction_attribute, kernel, dev): @@ -30295,7 +29769,7 @@ def cuKernelGetAttribute(attrib not None : CUfunction_attribute, kernel, dev): - :py:obj:`~.CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE`: The block scheduling policy of a function. The value type is - CUclusterSchedulingPolicy. + :py:obj:`~.CUclusterSchedulingPolicy`. Parameters ---------- @@ -30344,9 +29818,6 @@ def cuKernelGetAttribute(attrib not None : CUfunction_attribute, kernel, dev): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pi) -{{endif}} - -{{if 'cuKernelSetAttribute' in found_functions}} @cython.embedsignature(True) def cuKernelSetAttribute(attrib not None : CUfunction_attribute, int val, kernel, dev): @@ -30413,7 +29884,7 @@ def cuKernelSetAttribute(attrib not None : CUfunction_attribute, int val, kernel - :py:obj:`~.CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE`: The block scheduling policy of a function. The value type is - CUclusterSchedulingPolicy. + :py:obj:`~.CUclusterSchedulingPolicy`. Parameters ---------- @@ -30459,9 +29930,6 @@ def cuKernelSetAttribute(attrib not None : CUfunction_attribute, int val, kernel with nogil: err = cydriver.cuKernelSetAttribute(cyattrib, val, cykernel, cydev) return (_CUresult(err),) -{{endif}} - -{{if 'cuKernelSetCacheConfig' in found_functions}} @cython.embedsignature(True) def cuKernelSetCacheConfig(kernel, config not None : CUfunc_cache, dev): @@ -30543,9 +30011,6 @@ def cuKernelSetCacheConfig(kernel, config not None : CUfunc_cache, dev): with nogil: err = cydriver.cuKernelSetCacheConfig(cykernel, cyconfig, cydev) return (_CUresult(err),) -{{endif}} - -{{if 'cuKernelGetName' in found_functions}} @cython.embedsignature(True) def cuKernelGetName(hfunc): @@ -30585,9 +30050,6 @@ def cuKernelGetName(hfunc): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, name if name != NULL else None) -{{endif}} - -{{if 'cuKernelGetParamInfo' in found_functions}} @cython.embedsignature(True) def cuKernelGetParamInfo(kernel, size_t paramIndex): @@ -30640,9 +30102,6 @@ def cuKernelGetParamInfo(kernel, size_t paramIndex): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None) return (_CUresult_SUCCESS, paramOffset, paramSize) -{{endif}} - -{{if 'cuKernelGetParamCount' in found_functions}} @cython.embedsignature(True) def cuKernelGetParamCount(kernel): @@ -30681,9 +30140,6 @@ def cuKernelGetParamCount(kernel): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, paramCount) -{{endif}} - -{{if 'cuMemGetInfo_v2' in found_functions}} @cython.embedsignature(True) def cuMemGetInfo(): @@ -30726,9 +30182,6 @@ def cuMemGetInfo(): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None) return (_CUresult_SUCCESS, free, total) -{{endif}} - -{{if 'cuMemAlloc_v2' in found_functions}} @cython.embedsignature(True) def cuMemAlloc(size_t bytesize): @@ -30762,9 +30215,6 @@ def cuMemAlloc(size_t bytesize): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, dptr) -{{endif}} - -{{if 'cuMemAllocPitch_v2' in found_functions}} @cython.embedsignature(True) def cuMemAllocPitch(size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes): @@ -30831,9 +30281,6 @@ def cuMemAllocPitch(size_t WidthInBytes, size_t Height, unsigned int ElementSize if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None) return (_CUresult_SUCCESS, dptr, pPitch) -{{endif}} - -{{if 'cuMemFree_v2' in found_functions}} @cython.embedsignature(True) def cuMemFree(dptr): @@ -30879,9 +30326,6 @@ def cuMemFree(dptr): with nogil: err = cydriver.cuMemFree(cydptr) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemGetAddressRange_v2' in found_functions}} @cython.embedsignature(True) def cuMemGetAddressRange(dptr): @@ -30925,9 +30369,6 @@ def cuMemGetAddressRange(dptr): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None) return (_CUresult_SUCCESS, pbase, psize) -{{endif}} - -{{if 'cuMemAllocHost_v2' in found_functions}} @cython.embedsignature(True) def cuMemAllocHost(size_t bytesize): @@ -30982,9 +30423,6 @@ def cuMemAllocHost(size_t bytesize): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pp) -{{endif}} - -{{if 'cuMemFreeHost' in found_functions}} @cython.embedsignature(True) def cuMemFreeHost(p): @@ -31013,9 +30451,6 @@ def cuMemFreeHost(p): err = cydriver.cuMemFreeHost(cyp) _helper_input_void_ptr_free(&cypHelper) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemHostAlloc' in found_functions}} @cython.embedsignature(True) def cuMemHostAlloc(size_t bytesize, unsigned int Flags): @@ -31106,9 +30541,6 @@ def cuMemHostAlloc(size_t bytesize, unsigned int Flags): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pp) -{{endif}} - -{{if 'cuMemHostGetDevicePointer_v2' in found_functions}} @cython.embedsignature(True) def cuMemHostGetDevicePointer(p, unsigned int Flags): @@ -31170,9 +30602,6 @@ def cuMemHostGetDevicePointer(p, unsigned int Flags): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pdptr) -{{endif}} - -{{if 'cuMemHostGetFlags' in found_functions}} @cython.embedsignature(True) def cuMemHostGetFlags(p): @@ -31210,9 +30639,6 @@ def cuMemHostGetFlags(p): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pFlags) -{{endif}} - -{{if 'cuMemAllocManaged' in found_functions}} @cython.embedsignature(True) def cuMemAllocManaged(size_t bytesize, unsigned int flags): @@ -31347,9 +30773,6 @@ def cuMemAllocManaged(size_t bytesize, unsigned int flags): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, dptr) -{{endif}} - -{{if 'cuDeviceRegisterAsyncNotification' in found_functions}} ctypedef struct cuAsyncCallbackData_st: cydriver.CUasyncCallback callback @@ -31443,9 +30866,6 @@ def cuDeviceRegisterAsyncNotification(device, callbackFunc, userData): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, callback) -{{endif}} - -{{if 'cuDeviceUnregisterAsyncNotification' in found_functions}} @cython.embedsignature(True) def cuDeviceUnregisterAsyncNotification(device, callback): @@ -31493,9 +30913,6 @@ def cuDeviceUnregisterAsyncNotification(device, callback): free(m_global._allocated[pcallback]) m_global._allocated.erase(pcallback) return (_CUresult(err),) -{{endif}} - -{{if 'cuDeviceGetByPCIBusId' in found_functions}} @cython.embedsignature(True) def cuDeviceGetByPCIBusId(char* pciBusId): @@ -31528,9 +30945,6 @@ def cuDeviceGetByPCIBusId(char* pciBusId): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, dev) -{{endif}} - -{{if 'cuDeviceGetPCIBusId' in found_functions}} @cython.embedsignature(True) def cuDeviceGetPCIBusId(int length, dev): @@ -31577,9 +30991,6 @@ def cuDeviceGetPCIBusId(int length, dev): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pypciBusId) -{{endif}} - -{{if 'cuIpcGetEventHandle' in found_functions}} @cython.embedsignature(True) def cuIpcGetEventHandle(event): @@ -31617,8 +31028,8 @@ def cuIpcGetEventHandle(event): CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_MAP_FAILED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` pHandle : :py:obj:`~.CUipcEventHandle` - Pointer to a user allocated CUipcEventHandle in which to return the - opaque event handle + Pointer to a user allocated :py:obj:`~.CUipcEventHandle` in which + to return the opaque event handle See Also -------- @@ -31638,9 +31049,6 @@ def cuIpcGetEventHandle(event): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pHandle) -{{endif}} - -{{if 'cuIpcOpenEventHandle' in found_functions}} @cython.embedsignature(True) def cuIpcOpenEventHandle(handle not None : CUipcEventHandle): @@ -31685,9 +31093,6 @@ def cuIpcOpenEventHandle(handle not None : CUipcEventHandle): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phEvent) -{{endif}} - -{{if 'cuIpcGetMemHandle' in found_functions}} @cython.embedsignature(True) def cuIpcGetMemHandle(dptr): @@ -31741,9 +31146,6 @@ def cuIpcGetMemHandle(dptr): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pHandle) -{{endif}} - -{{if 'cuIpcOpenMemHandle_v2' in found_functions}} @cython.embedsignature(True) def cuIpcOpenMemHandle(handle not None : CUipcMemHandle, unsigned int Flags): @@ -31810,9 +31212,6 @@ def cuIpcOpenMemHandle(handle not None : CUipcMemHandle, unsigned int Flags): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pdptr) -{{endif}} - -{{if 'cuIpcCloseMemHandle' in found_functions}} @cython.embedsignature(True) def cuIpcCloseMemHandle(dptr): @@ -31859,9 +31258,6 @@ def cuIpcCloseMemHandle(dptr): with nogil: err = cydriver.cuIpcCloseMemHandle(cydptr) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemHostRegister_v2' in found_functions}} @cython.embedsignature(True) def cuMemHostRegister(p, size_t bytesize, unsigned int Flags): @@ -31965,9 +31361,6 @@ def cuMemHostRegister(p, size_t bytesize, unsigned int Flags): err = cydriver.cuMemHostRegister(cyp, bytesize, Flags) _helper_input_void_ptr_free(&cypHelper) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemHostUnregister' in found_functions}} @cython.embedsignature(True) def cuMemHostUnregister(p): @@ -31999,9 +31392,6 @@ def cuMemHostUnregister(p): err = cydriver.cuMemHostUnregister(cyp) _helper_input_void_ptr_free(&cypHelper) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpy' in found_functions}} @cython.embedsignature(True) def cuMemcpy(dst, src, size_t ByteCount): @@ -32051,9 +31441,6 @@ def cuMemcpy(dst, src, size_t ByteCount): with nogil: err = cydriver.cuMemcpy(cydst, cysrc, ByteCount) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpyPeer' in found_functions}} @cython.embedsignature(True) def cuMemcpyPeer(dstDevice, dstContext, srcDevice, srcContext, size_t ByteCount): @@ -32122,9 +31509,6 @@ def cuMemcpyPeer(dstDevice, dstContext, srcDevice, srcContext, size_t ByteCount) with nogil: err = cydriver.cuMemcpyPeer(cydstDevice, cydstContext, cysrcDevice, cysrcContext, ByteCount) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpyHtoD_v2' in found_functions}} @cython.embedsignature(True) def cuMemcpyHtoD(dstDevice, srcHost, size_t ByteCount): @@ -32166,9 +31550,6 @@ def cuMemcpyHtoD(dstDevice, srcHost, size_t ByteCount): err = cydriver.cuMemcpyHtoD(cydstDevice, cysrcHost, ByteCount) _helper_input_void_ptr_free(&cysrcHostHelper) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpyDtoH_v2' in found_functions}} @cython.embedsignature(True) def cuMemcpyDtoH(dstHost, srcDevice, size_t ByteCount): @@ -32210,9 +31591,6 @@ def cuMemcpyDtoH(dstHost, srcDevice, size_t ByteCount): err = cydriver.cuMemcpyDtoH(cydstHost, cysrcDevice, ByteCount) _helper_input_void_ptr_free(&cydstHostHelper) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpyDtoD_v2' in found_functions}} @cython.embedsignature(True) def cuMemcpyDtoD(dstDevice, srcDevice, size_t ByteCount): @@ -32259,9 +31637,6 @@ def cuMemcpyDtoD(dstDevice, srcDevice, size_t ByteCount): with nogil: err = cydriver.cuMemcpyDtoD(cydstDevice, cysrcDevice, ByteCount) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpyDtoA_v2' in found_functions}} @cython.embedsignature(True) def cuMemcpyDtoA(dstArray, size_t dstOffset, srcDevice, size_t ByteCount): @@ -32311,9 +31686,6 @@ def cuMemcpyDtoA(dstArray, size_t dstOffset, srcDevice, size_t ByteCount): with nogil: err = cydriver.cuMemcpyDtoA(cydstArray, dstOffset, cysrcDevice, ByteCount) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpyAtoD_v2' in found_functions}} @cython.embedsignature(True) def cuMemcpyAtoD(dstDevice, srcArray, size_t srcOffset, size_t ByteCount): @@ -32365,9 +31737,6 @@ def cuMemcpyAtoD(dstDevice, srcArray, size_t srcOffset, size_t ByteCount): with nogil: err = cydriver.cuMemcpyAtoD(cydstDevice, cysrcArray, srcOffset, ByteCount) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpyHtoA_v2' in found_functions}} @cython.embedsignature(True) def cuMemcpyHtoA(dstArray, size_t dstOffset, srcHost, size_t ByteCount): @@ -32412,9 +31781,6 @@ def cuMemcpyHtoA(dstArray, size_t dstOffset, srcHost, size_t ByteCount): err = cydriver.cuMemcpyHtoA(cydstArray, dstOffset, cysrcHost, ByteCount) _helper_input_void_ptr_free(&cysrcHostHelper) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpyAtoH_v2' in found_functions}} @cython.embedsignature(True) def cuMemcpyAtoH(dstHost, srcArray, size_t srcOffset, size_t ByteCount): @@ -32459,9 +31825,6 @@ def cuMemcpyAtoH(dstHost, srcArray, size_t srcOffset, size_t ByteCount): err = cydriver.cuMemcpyAtoH(cydstHost, cysrcArray, srcOffset, ByteCount) _helper_input_void_ptr_free(&cydstHostHelper) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpyAtoA_v2' in found_functions}} @cython.embedsignature(True) def cuMemcpyAtoA(dstArray, size_t dstOffset, srcArray, size_t srcOffset, size_t ByteCount): @@ -32516,9 +31879,6 @@ def cuMemcpyAtoA(dstArray, size_t dstOffset, srcArray, size_t srcOffset, size_t with nogil: err = cydriver.cuMemcpyAtoA(cydstArray, dstOffset, cysrcArray, srcOffset, ByteCount) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpy2D_v2' in found_functions}} @cython.embedsignature(True) def cuMemcpy2D(pCopy : Optional[CUDA_MEMCPY2D]): @@ -32639,13 +31999,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpy2DUnaligned_v2' in found_functions}} @cython.embedsignature(True) def cuMemcpy2DUnaligned(pCopy : Optional[CUDA_MEMCPY2D]): @@ -32766,13 +32123,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpy3D_v2' in found_functions}} @cython.embedsignature(True) def cuMemcpy3D(pCopy : Optional[CUDA_MEMCPY3D]): @@ -32896,13 +32250,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpy3DPeer' in found_functions}} @cython.embedsignature(True) def cuMemcpy3DPeer(pCopy : Optional[CUDA_MEMCPY3D_PEER]): @@ -32926,13 +32277,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpyAsync' in found_functions}} @cython.embedsignature(True) def cuMemcpyAsync(dst, src, size_t ByteCount, hStream): @@ -32992,9 +32340,6 @@ def cuMemcpyAsync(dst, src, size_t ByteCount, hStream): with nogil: err = cydriver.cuMemcpyAsync(cydst, cysrc, ByteCount, cyhStream) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpyPeerAsync' in found_functions}} @cython.embedsignature(True) def cuMemcpyPeerAsync(dstDevice, dstContext, srcDevice, srcContext, size_t ByteCount, hStream): @@ -33073,9 +32418,6 @@ def cuMemcpyPeerAsync(dstDevice, dstContext, srcDevice, srcContext, size_t ByteC with nogil: err = cydriver.cuMemcpyPeerAsync(cydstDevice, cydstContext, cysrcDevice, cysrcContext, ByteCount, cyhStream) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpyHtoDAsync_v2' in found_functions}} @cython.embedsignature(True) def cuMemcpyHtoDAsync(dstDevice, srcHost, size_t ByteCount, hStream): @@ -33127,9 +32469,6 @@ def cuMemcpyHtoDAsync(dstDevice, srcHost, size_t ByteCount, hStream): err = cydriver.cuMemcpyHtoDAsync(cydstDevice, cysrcHost, ByteCount, cyhStream) _helper_input_void_ptr_free(&cysrcHostHelper) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpyDtoHAsync_v2' in found_functions}} @cython.embedsignature(True) def cuMemcpyDtoHAsync(dstHost, srcDevice, size_t ByteCount, hStream): @@ -33181,9 +32520,6 @@ def cuMemcpyDtoHAsync(dstHost, srcDevice, size_t ByteCount, hStream): err = cydriver.cuMemcpyDtoHAsync(cydstHost, cysrcDevice, ByteCount, cyhStream) _helper_input_void_ptr_free(&cydstHostHelper) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpyDtoDAsync_v2' in found_functions}} @cython.embedsignature(True) def cuMemcpyDtoDAsync(dstDevice, srcDevice, size_t ByteCount, hStream): @@ -33240,9 +32576,6 @@ def cuMemcpyDtoDAsync(dstDevice, srcDevice, size_t ByteCount, hStream): with nogil: err = cydriver.cuMemcpyDtoDAsync(cydstDevice, cysrcDevice, ByteCount, cyhStream) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpyHtoAAsync_v2' in found_functions}} @cython.embedsignature(True) def cuMemcpyHtoAAsync(dstArray, size_t dstOffset, srcHost, size_t ByteCount, hStream): @@ -33297,9 +32630,6 @@ def cuMemcpyHtoAAsync(dstArray, size_t dstOffset, srcHost, size_t ByteCount, hSt err = cydriver.cuMemcpyHtoAAsync(cydstArray, dstOffset, cysrcHost, ByteCount, cyhStream) _helper_input_void_ptr_free(&cysrcHostHelper) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpyAtoHAsync_v2' in found_functions}} @cython.embedsignature(True) def cuMemcpyAtoHAsync(dstHost, srcArray, size_t srcOffset, size_t ByteCount, hStream): @@ -33354,9 +32684,6 @@ def cuMemcpyAtoHAsync(dstHost, srcArray, size_t srcOffset, size_t ByteCount, hSt err = cydriver.cuMemcpyAtoHAsync(cydstHost, cysrcArray, srcOffset, ByteCount, cyhStream) _helper_input_void_ptr_free(&cydstHostHelper) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpy2DAsync_v2' in found_functions}} @cython.embedsignature(True) def cuMemcpy2DAsync(pCopy : Optional[CUDA_MEMCPY2D], hStream): @@ -33494,13 +32821,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpy3DAsync_v2' in found_functions}} @cython.embedsignature(True) def cuMemcpy3DAsync(pCopy : Optional[CUDA_MEMCPY3D], hStream): @@ -33634,13 +32958,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpy3DPeerAsync' in found_functions}} @cython.embedsignature(True) def cuMemcpy3DPeerAsync(pCopy : Optional[CUDA_MEMCPY3D_PEER], hStream): @@ -33674,13 +32995,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{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): @@ -33850,9 +33168,6 @@ def cuMemcpyBatchAsync(dsts : Optional[tuple[CUdeviceptr] | list[CUdeviceptr]], if len(attrs) > 1 and cyattrs is not NULL: free(cyattrs) return (_CUresult(err),) -{{endif}} - -{{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): @@ -33878,34 +33193,33 @@ def cuMemcpy3DBatchAsync(size_t numOps, opList : Optional[tuple[CUDA_MEMCPY3D_BA the CUDA array. For CUDA array to CUDA array copies, the element size of the two CUDA arrays must match. - For a given operand, if :py:obj:`~.CUmemcpy3DOperand`::type is - specified as :py:obj:`~.CU_MEMCPY_OPERAND_TYPE_POINTER`, then - :py:obj:`~.CUmemcpy3DOperand`::op::ptr will be used. The - :py:obj:`~.CUmemcpy3DOperand`::op::ptr::ptr field must contain the - pointer where the copy should begin. The - :py:obj:`~.CUmemcpy3DOperand`::op::ptr::rowLength field specifies the + For a given operand, if :py:obj:`~.CUmemcpy3DOperand.type` is specified + as :py:obj:`~.CU_MEMCPY_OPERAND_TYPE_POINTER`, then + :py:obj:`~.CUmemcpy3DOperand.op.ptr` will be used. The + :py:obj:`~.CUmemcpy3DOperand.op.ptr.ptr` field must contain the pointer + where the copy should begin. The + :py:obj:`~.CUmemcpy3DOperand.op.ptr.rowLength` field specifies the length of each row in elements and must either be zero or be greater than or equal to the width of the copy specified in - :py:obj:`~.CUDA_MEMCPY3D_BATCH_OP`::extent::width. The - :py:obj:`~.CUmemcpy3DOperand`::op::ptr::layerHeight field specifies the + :py:obj:`~.CUDA_MEMCPY3D_BATCH_OP.extent.width`. The + :py:obj:`~.CUmemcpy3DOperand.op.ptr.layerHeight` field specifies the height of each layer and must either be zero or be greater than or equal to the height of the copy specified in - :py:obj:`~.CUDA_MEMCPY3D_BATCH_OP`::extent::height. When either of - these values is zero, that aspect of the operand is considered to be - tightly packed according to the copy extent. For managed memory - pointers on devices where - :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS` is true or - system-allocated pageable memory on devices where + :py:obj:`~.CUDA_MEMCPY3D_BATCH_OP.extent.height`. When either of these + values is zero, that aspect of the operand is considered to be tightly + packed according to the copy extent. For managed memory pointers on + devices where :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS` + is true or system-allocated pageable memory on devices where :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS` is true, the - :py:obj:`~.CUmemcpy3DOperand`::op::ptr::locHint field can be used to - hint the location of the operand. + :py:obj:`~.CUmemcpy3DOperand.op.ptr.locHint` field can be used to hint + the location of the operand. If an operand's type is specified as :py:obj:`~.CU_MEMCPY_OPERAND_TYPE_ARRAY`, then - :py:obj:`~.CUmemcpy3DOperand`::op::array will be used. The - :py:obj:`~.CUmemcpy3DOperand`::op::array::array field specifies the - CUDA array and :py:obj:`~.CUmemcpy3DOperand`::op::array::offset - specifies the 3D offset into that array where the copy begins. + :py:obj:`~.CUmemcpy3DOperand.op.array` will be used. The + :py:obj:`~.CUmemcpy3DOperand.op.array.array` field specifies the CUDA + array and :py:obj:`~.CUmemcpy3DOperand.op.array.offset` specifies the + 3D offset into that array where the copy begins. The :py:obj:`~.CUmemcpyAttributes.srcAccessOrder` indicates the source access ordering to be observed for copies associated with the @@ -33981,13 +33295,10 @@ def cuMemcpy3DBatchAsync(size_t numOps, opList : Optional[tuple[CUDA_MEMCPY3D_BA if len(opList) > 1 and cyopList is not NULL: free(cyopList) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpyWithAttributesAsync' in found_functions}} @cython.embedsignature(True) def cuMemcpyWithAttributesAsync(dst, src, size_t size, attr : Optional[CUmemcpyAttributes], hStream): - """ + """ Performs asynchronous memory copy operation with the specified attributes. @@ -34047,17 +33358,14 @@ def cuMemcpyWithAttributesAsync(dst, src, size_t size, attr : Optional[CUmemcpyA else: pdst = int(CUdeviceptr(dst)) cydst = pdst - cdef cydriver.CUmemcpyAttributes* cyattr_ptr = attr._pvt_ptr if attr is not None else NULL + cdef cydriver.CUmemcpyAttributes* cyattr_ptr = attr._pvt_ptr if attr is not None else NULL with nogil: err = cydriver.cuMemcpyWithAttributesAsync(cydst, cysrc, size, cyattr_ptr, cyhStream) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemcpy3DWithAttributesAsync' in found_functions}} @cython.embedsignature(True) def cuMemcpy3DWithAttributesAsync(op : Optional[CUDA_MEMCPY3D_BATCH_OP], unsigned long long flags, hStream): - """ + """ Performs 3D memory copy with attributes asynchronously @@ -34095,13 +33403,10 @@ def cuMemcpy3DWithAttributesAsync(op : Optional[CUDA_MEMCPY3D_BATCH_OP], unsigne else: phStream = int(CUstream(hStream)) cyhStream = phStream - cdef cydriver.CUDA_MEMCPY3D_BATCH_OP* cyop_ptr = op._pvt_ptr if op is not None else NULL + cdef cydriver.CUDA_MEMCPY3D_BATCH_OP* cyop_ptr = op._pvt_ptr if op is not None else NULL with nogil: err = cydriver.cuMemcpy3DWithAttributesAsync(cyop_ptr, flags, cyhStream) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemsetD8_v2' in found_functions}} @cython.embedsignature(True) def cuMemsetD8(dstDevice, unsigned char uc, size_t N): @@ -34138,9 +33443,6 @@ def cuMemsetD8(dstDevice, unsigned char uc, size_t N): with nogil: err = cydriver.cuMemsetD8(cydstDevice, uc, N) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemsetD16_v2' in found_functions}} @cython.embedsignature(True) def cuMemsetD16(dstDevice, unsigned short us, size_t N): @@ -34178,9 +33480,6 @@ def cuMemsetD16(dstDevice, unsigned short us, size_t N): with nogil: err = cydriver.cuMemsetD16(cydstDevice, us, N) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemsetD32_v2' in found_functions}} @cython.embedsignature(True) def cuMemsetD32(dstDevice, unsigned int ui, size_t N): @@ -34218,9 +33517,6 @@ def cuMemsetD32(dstDevice, unsigned int ui, size_t N): with nogil: err = cydriver.cuMemsetD32(cydstDevice, ui, N) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemsetD2D8_v2' in found_functions}} @cython.embedsignature(True) def cuMemsetD2D8(dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height): @@ -34265,9 +33561,6 @@ def cuMemsetD2D8(dstDevice, size_t dstPitch, unsigned char uc, size_t Width, siz with nogil: err = cydriver.cuMemsetD2D8(cydstDevice, dstPitch, uc, Width, Height) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemsetD2D16_v2' in found_functions}} @cython.embedsignature(True) def cuMemsetD2D16(dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height): @@ -34313,9 +33606,6 @@ def cuMemsetD2D16(dstDevice, size_t dstPitch, unsigned short us, size_t Width, s with nogil: err = cydriver.cuMemsetD2D16(cydstDevice, dstPitch, us, Width, Height) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemsetD2D32_v2' in found_functions}} @cython.embedsignature(True) def cuMemsetD2D32(dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height): @@ -34361,9 +33651,6 @@ def cuMemsetD2D32(dstDevice, size_t dstPitch, unsigned int ui, size_t Width, siz with nogil: err = cydriver.cuMemsetD2D32(cydstDevice, dstPitch, ui, Width, Height) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemsetD8Async' in found_functions}} @cython.embedsignature(True) def cuMemsetD8Async(dstDevice, unsigned char uc, size_t N, hStream): @@ -34410,9 +33697,6 @@ def cuMemsetD8Async(dstDevice, unsigned char uc, size_t N, hStream): with nogil: err = cydriver.cuMemsetD8Async(cydstDevice, uc, N, cyhStream) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemsetD16Async' in found_functions}} @cython.embedsignature(True) def cuMemsetD16Async(dstDevice, unsigned short us, size_t N, hStream): @@ -34460,9 +33744,6 @@ def cuMemsetD16Async(dstDevice, unsigned short us, size_t N, hStream): with nogil: err = cydriver.cuMemsetD16Async(cydstDevice, us, N, cyhStream) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemsetD32Async' in found_functions}} @cython.embedsignature(True) def cuMemsetD32Async(dstDevice, unsigned int ui, size_t N, hStream): @@ -34510,9 +33791,6 @@ def cuMemsetD32Async(dstDevice, unsigned int ui, size_t N, hStream): with nogil: err = cydriver.cuMemsetD32Async(cydstDevice, ui, N, cyhStream) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemsetD2D8Async' in found_functions}} @cython.embedsignature(True) def cuMemsetD2D8Async(dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height, hStream): @@ -34567,9 +33845,6 @@ def cuMemsetD2D8Async(dstDevice, size_t dstPitch, unsigned char uc, size_t Width with nogil: err = cydriver.cuMemsetD2D8Async(cydstDevice, dstPitch, uc, Width, Height, cyhStream) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemsetD2D16Async' in found_functions}} @cython.embedsignature(True) def cuMemsetD2D16Async(dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height, hStream): @@ -34625,9 +33900,6 @@ def cuMemsetD2D16Async(dstDevice, size_t dstPitch, unsigned short us, size_t Wid with nogil: err = cydriver.cuMemsetD2D16Async(cydstDevice, dstPitch, us, Width, Height, cyhStream) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemsetD2D32Async' in found_functions}} @cython.embedsignature(True) def cuMemsetD2D32Async(dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height, hStream): @@ -34683,9 +33955,6 @@ def cuMemsetD2D32Async(dstDevice, size_t dstPitch, unsigned int ui, size_t Width with nogil: err = cydriver.cuMemsetD2D32Async(cydstDevice, dstPitch, ui, Width, Height, cyhStream) return (_CUresult(err),) -{{endif}} - -{{if 'cuArrayCreate_v2' in found_functions}} @cython.embedsignature(True) def cuArrayCreate(pAllocateArray : Optional[CUDA_ARRAY_DESCRIPTOR]): @@ -34748,15 +34017,12 @@ 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 is not 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: return (_CUresult(err), None) return (_CUresult_SUCCESS, pHandle) -{{endif}} - -{{if 'cuArrayGetDescriptor_v2' in found_functions}} @cython.embedsignature(True) def cuArrayGetDescriptor(hArray): @@ -34797,9 +34063,6 @@ def cuArrayGetDescriptor(hArray): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pArrayDescriptor) -{{endif}} - -{{if 'cuArrayGetSparseProperties' in found_functions}} @cython.embedsignature(True) def cuArrayGetSparseProperties(array): @@ -34853,9 +34116,6 @@ def cuArrayGetSparseProperties(array): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, sparseProperties) -{{endif}} - -{{if 'cuMipmappedArrayGetSparseProperties' in found_functions}} @cython.embedsignature(True) def cuMipmappedArrayGetSparseProperties(mipmap): @@ -34911,9 +34171,6 @@ def cuMipmappedArrayGetSparseProperties(mipmap): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, sparseProperties) -{{endif}} - -{{if 'cuArrayGetMemoryRequirements' in found_functions}} @cython.embedsignature(True) def cuArrayGetMemoryRequirements(array, device): @@ -34969,9 +34226,6 @@ def cuArrayGetMemoryRequirements(array, device): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, memoryRequirements) -{{endif}} - -{{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}} @cython.embedsignature(True) def cuMipmappedArrayGetMemoryRequirements(mipmap, device): @@ -35028,9 +34282,6 @@ def cuMipmappedArrayGetMemoryRequirements(mipmap, device): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, memoryRequirements) -{{endif}} - -{{if 'cuArrayGetPlane' in found_functions}} @cython.embedsignature(True) def cuArrayGetPlane(hArray, unsigned int planeIdx): @@ -35084,9 +34335,6 @@ def cuArrayGetPlane(hArray, unsigned int planeIdx): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pPlaneArray) -{{endif}} - -{{if 'cuArrayDestroy' in found_functions}} @cython.embedsignature(True) def cuArrayDestroy(hArray): @@ -35119,9 +34367,6 @@ def cuArrayDestroy(hArray): with nogil: err = cydriver.cuArrayDestroy(cyhArray) return (_CUresult(err),) -{{endif}} - -{{if 'cuArray3DCreate_v2' in found_functions}} @cython.embedsignature(True) def cuArray3DCreate(pAllocateArray : Optional[CUDA_ARRAY3D_DESCRIPTOR]): @@ -35248,15 +34493,12 @@ 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 is not 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: return (_CUresult(err), None) return (_CUresult_SUCCESS, pHandle) -{{endif}} - -{{if 'cuArray3DGetDescriptor_v2' in found_functions}} @cython.embedsignature(True) def cuArray3DGetDescriptor(hArray): @@ -35301,9 +34543,6 @@ def cuArray3DGetDescriptor(hArray): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pArrayDescriptor) -{{endif}} - -{{if 'cuMipmappedArrayCreate' in found_functions}} @cython.embedsignature(True) def cuMipmappedArrayCreate(pMipmappedArrayDesc : Optional[CUDA_ARRAY3D_DESCRIPTOR], unsigned int numMipmapLevels): @@ -35418,15 +34657,12 @@ 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 is not 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: return (_CUresult(err), None) return (_CUresult_SUCCESS, pHandle) -{{endif}} - -{{if 'cuMipmappedArrayGetLevel' in found_functions}} @cython.embedsignature(True) def cuMipmappedArrayGetLevel(hMipmappedArray, unsigned int level): @@ -35470,9 +34706,6 @@ def cuMipmappedArrayGetLevel(hMipmappedArray, unsigned int level): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pLevelArray) -{{endif}} - -{{if 'cuMipmappedArrayDestroy' in found_functions}} @cython.embedsignature(True) def cuMipmappedArrayDestroy(hMipmappedArray): @@ -35505,9 +34738,6 @@ def cuMipmappedArrayDestroy(hMipmappedArray): with nogil: err = cydriver.cuMipmappedArrayDestroy(cyhMipmappedArray) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemGetHandleForAddressRange' in found_functions}} @cython.embedsignature(True) def cuMemGetHandleForAddressRange(dptr, size_t size, handleType not None : CUmemRangeHandleType, unsigned long long flags): @@ -35548,6 +34778,16 @@ def cuMemGetHandleForAddressRange(dptr, size_t size, handleType not None : CUmem on a supported platform, will give a DMA_BUF handle mapped via PCIE BAR1 or will return an error otherwise. + If the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_DMA_BUF_MMAP_SUPPORTED` is set and a + CUmemRangeHandleType::CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD is requested + for a device memory range then the returned dmabuf file descriptor may + be passed as the file descriptor argument to the mmap() system call. + + For device memory on x86 systems the mapping will be a write combined + mapping. On coherent ARM platforms these mappings will be regular + cached memory. On all other platforms these mappings will be uncached. + Parameters ---------- dptr : :py:obj:`~.CUdeviceptr` @@ -35587,9 +34827,6 @@ def cuMemGetHandleForAddressRange(dptr, size_t size, handleType not None : CUmem if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, handle) -{{endif}} - -{{if 'cuMemBatchDecompressAsync' in found_functions}} @cython.embedsignature(True) def cuMemBatchDecompressAsync(paramsArray : Optional[CUmemDecompressParams], size_t count, unsigned int flags, stream): @@ -35665,16 +34902,13 @@ def cuMemBatchDecompressAsync(paramsArray : Optional[CUmemDecompressParams], siz else: pstream = int(CUstream(stream)) cystream = pstream - cdef cydriver.CUmemDecompressParams* cyparamsArray_ptr = paramsArray._pvt_ptr if paramsArray is not 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) if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, errorIndex) -{{endif}} - -{{if 'cuMemAddressReserve' in found_functions}} @cython.embedsignature(True) def cuMemAddressReserve(size_t size, size_t alignment, addr, unsigned long long flags): @@ -35725,9 +34959,6 @@ def cuMemAddressReserve(size_t size, size_t alignment, addr, unsigned long long if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, ptr) -{{endif}} - -{{if 'cuMemAddressFree' in found_functions}} @cython.embedsignature(True) def cuMemAddressFree(ptr, size_t size): @@ -35764,9 +34995,6 @@ def cuMemAddressFree(ptr, size_t size): with nogil: err = cydriver.cuMemAddressFree(cyptr, size) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemCreate' in found_functions}} @cython.embedsignature(True) def cuMemCreate(size_t size, prop : Optional[CUmemAllocationProp], unsigned long long flags): @@ -35786,19 +35014,19 @@ def cuMemCreate(size_t size, prop : Optional[CUmemAllocationProp], unsigned long :py:obj:`~.cuMemGetAllocationGranularity` with the :py:obj:`~.CU_MEM_ALLOC_GRANULARITY_MINIMUM` flag. To create a CPU allocation that doesn't target any specific NUMA nodes, applications - must set :py:obj:`~.CUmemAllocationProp`::CUmemLocation::type to + must set :py:obj:`~.CUmemAllocationProp.CUmemLocation.type` to :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST`. - :py:obj:`~.CUmemAllocationProp`::CUmemLocation::id is ignored for 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:`~.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. + :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` as the :py:obj:`~.CUmemLocation.type` will result in :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. @@ -35823,7 +35051,7 @@ def cuMemCreate(size_t size, prop : Optional[CUmemAllocationProp], unsigned long /proc/devices users can execute the following command: `mknod /dev/nvidia-caps-imex-channels/channel0 c 0` - If :py:obj:`~.CUmemAllocationProp`::allocFlags::usage contains + If :py:obj:`~.CUmemAllocationProp.allocFlags.usage` contains :py:obj:`~.CU_MEM_CREATE_USAGE_TILE_POOL` flag then the memory allocation is intended only to be used as backing tile pool for sparse CUDA arrays and sparse CUDA mipmapped arrays. (see @@ -35851,15 +35079,12 @@ 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 is not 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: return (_CUresult(err), None) return (_CUresult_SUCCESS, handle) -{{endif}} - -{{if 'cuMemRelease' in found_functions}} @cython.embedsignature(True) def cuMemRelease(handle): @@ -35901,9 +35126,6 @@ def cuMemRelease(handle): with nogil: err = cydriver.cuMemRelease(cyhandle) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemMap' in found_functions}} @cython.embedsignature(True) def cuMemMap(ptr, size_t size, size_t offset, handle, unsigned long long flags): @@ -35984,9 +35206,6 @@ def cuMemMap(ptr, size_t size, size_t offset, handle, unsigned long long flags): with nogil: err = cydriver.cuMemMap(cyptr, size, offset, cyhandle, flags) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemMapArrayAsync' in found_functions}} @cython.embedsignature(True) def cuMemMapArrayAsync(mapInfoList : Optional[tuple[CUarrayMapInfo] | list[CUarrayMapInfo]], unsigned int count, hStream): @@ -36001,18 +35220,18 @@ def cuMemMapArrayAsync(mapInfoList : Optional[tuple[CUarrayMapInfo] | list[CUarr where :py:obj:`~.CUarrayMapInfo.resourceType` specifies the type of resource to be operated on. If :py:obj:`~.CUarrayMapInfo.resourceType` - is set to :py:obj:`~.CUresourcetype`::CU_RESOURCE_TYPE_ARRAY then - :py:obj:`~.CUarrayMapInfo`::resource::array must be set to a valid - sparse CUDA array handle. The CUDA array must be either a 2D, 2D - layered or 3D CUDA array and must have been allocated using - :py:obj:`~.cuArrayCreate` or :py:obj:`~.cuArray3DCreate` with the flag + is set to :py:obj:`~.CUresourcetype.CU_RESOURCE_TYPE_ARRAY` then + :py:obj:`~.CUarrayMapInfo.resource.array` must be set to a valid sparse + CUDA array handle. The CUDA array must be either a 2D, 2D layered or 3D + CUDA array and must have been allocated using :py:obj:`~.cuArrayCreate` + or :py:obj:`~.cuArray3DCreate` with the flag :py:obj:`~.CUDA_ARRAY3D_SPARSE` or :py:obj:`~.CUDA_ARRAY3D_DEFERRED_MAPPING`. For CUDA arrays obtained using :py:obj:`~.cuMipmappedArrayGetLevel`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` will be returned. If :py:obj:`~.CUarrayMapInfo.resourceType` is set to - :py:obj:`~.CUresourcetype`::CU_RESOURCE_TYPE_MIPMAPPED_ARRAY then - :py:obj:`~.CUarrayMapInfo`::resource::mipmap must be set to a valid + :py:obj:`~.CUresourcetype.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY` then + :py:obj:`~.CUarrayMapInfo.resource.mipmap` must be set to a valid sparse CUDA mipmapped array handle. The CUDA mipmapped array must be either a 2D, 2D layered or 3D CUDA mipmapped array and must have been allocated using :py:obj:`~.cuMipmappedArrayCreate` with the flag @@ -36026,60 +35245,59 @@ def cuMemMapArrayAsync(mapInfoList : Optional[tuple[CUarrayMapInfo] | list[CUarr **View CUDA Toolkit Documentation for a C++ code example** where - :py:obj:`~.CUarraySparseSubresourceType`::CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL + :py:obj:`~.CUarraySparseSubresourceType.CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL` indicates a sparse-miplevel which spans at least one tile in every dimension. The remaining miplevels which are too small to span at least one tile in any dimension constitute the mip tail region as indicated by - :py:obj:`~.CUarraySparseSubresourceType`::CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL + :py:obj:`~.CUarraySparseSubresourceType.CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL` subresource type. If :py:obj:`~.CUarrayMapInfo.subresourceType` is set to - :py:obj:`~.CUarraySparseSubresourceType`::CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL - then :py:obj:`~.CUarrayMapInfo`::subresource::sparseLevel struct must + :py:obj:`~.CUarraySparseSubresourceType.CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL` + then :py:obj:`~.CUarrayMapInfo.subresource.sparseLevel` struct must contain valid array subregion offsets and extents. The - :py:obj:`~.CUarrayMapInfo`::subresource::sparseLevel::offsetX, - :py:obj:`~.CUarrayMapInfo`::subresource::sparseLevel::offsetY and - :py:obj:`~.CUarrayMapInfo`::subresource::sparseLevel::offsetZ must - specify valid X, Y and Z offsets respectively. The - :py:obj:`~.CUarrayMapInfo`::subresource::sparseLevel::extentWidth, - :py:obj:`~.CUarrayMapInfo`::subresource::sparseLevel::extentHeight and - :py:obj:`~.CUarrayMapInfo`::subresource::sparseLevel::extentDepth must + :py:obj:`~.CUarrayMapInfo.subresource.sparseLevel.offsetX`, + :py:obj:`~.CUarrayMapInfo.subresource.sparseLevel.offsetY` and + :py:obj:`~.CUarrayMapInfo.subresource.sparseLevel.offsetZ` must specify + valid X, Y and Z offsets respectively. The + :py:obj:`~.CUarrayMapInfo.subresource.sparseLevel.extentWidth`, + :py:obj:`~.CUarrayMapInfo.subresource.sparseLevel.extentHeight` and + :py:obj:`~.CUarrayMapInfo.subresource.sparseLevel.extentDepth` must specify valid width, height and depth extents respectively. These offsets and extents must be aligned to the corresponding tile dimension. For CUDA mipmapped arrays - :py:obj:`~.CUarrayMapInfo`::subresource::sparseLevel::level must - specify a valid mip level index. Otherwise, must be zero. For layered - CUDA arrays and layered CUDA mipmapped arrays - :py:obj:`~.CUarrayMapInfo`::subresource::sparseLevel::layer must - specify a valid layer index. Otherwise, must be zero. - :py:obj:`~.CUarrayMapInfo`::subresource::sparseLevel::offsetZ must be - zero and - :py:obj:`~.CUarrayMapInfo`::subresource::sparseLevel::extentDepth must + :py:obj:`~.CUarrayMapInfo.subresource.sparseLevel.level` must specify a + valid mip level index. Otherwise, must be zero. For layered CUDA arrays + and layered CUDA mipmapped arrays + :py:obj:`~.CUarrayMapInfo.subresource.sparseLevel.layer` must specify a + valid layer index. Otherwise, must be zero. + :py:obj:`~.CUarrayMapInfo.subresource.sparseLevel.offsetZ` must be zero + and :py:obj:`~.CUarrayMapInfo.subresource.sparseLevel.extentDepth` must be set to 1 for 2D and 2D layered CUDA arrays and CUDA mipmapped arrays. Tile extents can be obtained by calling :py:obj:`~.cuArrayGetSparseProperties` and :py:obj:`~.cuMipmappedArrayGetSparseProperties` If :py:obj:`~.CUarrayMapInfo.subresourceType` is set to - :py:obj:`~.CUarraySparseSubresourceType`::CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL - then :py:obj:`~.CUarrayMapInfo`::subresource::miptail struct must - contain valid mip tail offset in - :py:obj:`~.CUarrayMapInfo`::subresource::miptail::offset and size in - :py:obj:`~.CUarrayMapInfo`::subresource::miptail::size. Both, mip tail + :py:obj:`~.CUarraySparseSubresourceType.CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL` + then :py:obj:`~.CUarrayMapInfo.subresource.miptail` struct must contain + valid mip tail offset in + :py:obj:`~.CUarrayMapInfo.subresource.miptail.offset` and size in + :py:obj:`~.CUarrayMapInfo.subresource.miptail.size`. Both, mip tail offset and mip tail size must be aligned to the tile size. For layered CUDA mipmapped arrays which don't have the flag :py:obj:`~.CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL` set in :py:obj:`~.CUDA_ARRAY_SPARSE_PROPERTIES.flags` as returned by :py:obj:`~.cuMipmappedArrayGetSparseProperties`, - :py:obj:`~.CUarrayMapInfo`::subresource::miptail::layer must specify a + :py:obj:`~.CUarrayMapInfo.subresource.miptail.layer` must specify a valid layer index. Otherwise, must be zero. - If :py:obj:`~.CUarrayMapInfo`::resource::array or - :py:obj:`~.CUarrayMapInfo`::resource::mipmap was created with + If :py:obj:`~.CUarrayMapInfo.resource.array` or + :py:obj:`~.CUarrayMapInfo.resource.mipmap` was created with :py:obj:`~.CUDA_ARRAY3D_DEFERRED_MAPPING` flag set the :py:obj:`~.CUarrayMapInfo.subresourceType` and the contents of - :py:obj:`~.CUarrayMapInfo`::subresource will be ignored. + :py:obj:`~.CUarrayMapInfo.subresource` will be ignored. :py:obj:`~.CUarrayMapInfo.memOperationType` specifies the type of operation. :py:obj:`~.CUmemOperationType` is defined as: @@ -36087,18 +35305,18 @@ def cuMemMapArrayAsync(mapInfoList : Optional[tuple[CUarrayMapInfo] | list[CUarr **View CUDA Toolkit Documentation for a C++ code example** If :py:obj:`~.CUarrayMapInfo.memOperationType` is set to - :py:obj:`~.CUmemOperationType`::CU_MEM_OPERATION_TYPE_MAP then the + :py:obj:`~.CUmemOperationType.CU_MEM_OPERATION_TYPE_MAP` then the subresource will be mapped onto the tile pool memory specified by - :py:obj:`~.CUarrayMapInfo`::memHandle at offset + :py:obj:`~.CUarrayMapInfo.memHandle` at offset :py:obj:`~.CUarrayMapInfo.offset`. The tile pool allocation has to be created by specifying the :py:obj:`~.CU_MEM_CREATE_USAGE_TILE_POOL` flag when calling :py:obj:`~.cuMemCreate`. Also, :py:obj:`~.CUarrayMapInfo.memHandleType` must be set to - :py:obj:`~.CUmemHandleType`::CU_MEM_HANDLE_TYPE_GENERIC. + :py:obj:`~.CUmemHandleType.CU_MEM_HANDLE_TYPE_GENERIC`. If :py:obj:`~.CUarrayMapInfo.memOperationType` is set to - :py:obj:`~.CUmemOperationType`::CU_MEM_OPERATION_TYPE_UNMAP then an - unmapping operation is performed. :py:obj:`~.CUarrayMapInfo`::memHandle + :py:obj:`~.CUmemOperationType.CU_MEM_OPERATION_TYPE_UNMAP` then an + unmapping operation is performed. :py:obj:`~.CUarrayMapInfo.memHandle` must be NULL. :py:obj:`~.CUarrayMapInfo.deviceBitMask` specifies the list of devices @@ -36106,9 +35324,9 @@ def cuMemMapArrayAsync(mapInfoList : Optional[tuple[CUarrayMapInfo] | list[CUarr exactly one bit set, and the corresponding device must match the device associated with the stream. If :py:obj:`~.CUarrayMapInfo.memOperationType` is set to - :py:obj:`~.CUmemOperationType`::CU_MEM_OPERATION_TYPE_MAP, the device + :py:obj:`~.CUmemOperationType.CU_MEM_OPERATION_TYPE_MAP`, the device must also match the device associated with the tile pool memory - allocation as specified by :py:obj:`~.CUarrayMapInfo`::memHandle. + allocation as specified by :py:obj:`~.CUarrayMapInfo.memHandle`. :py:obj:`~.CUarrayMapInfo.flags` and :py:obj:`~.CUarrayMapInfo.reserved`[] are unused and must be set to @@ -36158,9 +35376,6 @@ def cuMemMapArrayAsync(mapInfoList : Optional[tuple[CUarrayMapInfo] | list[CUarr if len(mapInfoList) > 1 and cymapInfoList is not NULL: free(cymapInfoList) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemUnmap' in found_functions}} @cython.embedsignature(True) def cuMemUnmap(ptr, size_t size): @@ -36206,9 +35421,6 @@ def cuMemUnmap(ptr, size_t size): with nogil: err = cydriver.cuMemUnmap(cyptr, size) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemSetAccess' in found_functions}} @cython.embedsignature(True) def cuMemSetAccess(ptr, size_t size, desc : Optional[tuple[CUmemAccessDesc] | list[CUmemAccessDesc]], size_t count): @@ -36221,9 +35433,9 @@ def cuMemSetAccess(ptr, size_t size, desc : Optional[tuple[CUmemAccessDesc] | li :py:obj:`~.cuMemCreate`. Users cannot specify :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA` accessibility for allocations created on with other location types. Note: When - :py:obj:`~.CUmemAccessDesc`::CUmemLocation::type is + :py:obj:`~.CUmemAccessDesc.CUmemLocation.type` is :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA`, - :py:obj:`~.CUmemAccessDesc`::CUmemLocation::id is ignored. When setting + :py:obj:`~.CUmemAccessDesc.CUmemLocation.id` is ignored. When setting the access flags for a virtual address range mapping a multicast object, `ptr` and `size` must be aligned to the value returned by :py:obj:`~.cuMulticastGetGranularity` with the flag @@ -36279,9 +35491,6 @@ def cuMemSetAccess(ptr, size_t size, desc : Optional[tuple[CUmemAccessDesc] | li if len(desc) > 1 and cydesc is not NULL: free(cydesc) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemGetAccess' in found_functions}} @cython.embedsignature(True) def cuMemGetAccess(location : Optional[CUmemLocation], ptr): @@ -36314,15 +35523,12 @@ 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 is not 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: return (_CUresult(err), None) return (_CUresult_SUCCESS, flags) -{{endif}} - -{{if 'cuMemExportToShareableHandle' in found_functions}} @cython.embedsignature(True) def cuMemExportToShareableHandle(handle, handleType not None : CUmemAllocationHandleType, unsigned long long flags): @@ -36380,9 +35586,6 @@ def cuMemExportToShareableHandle(handle, handleType not None : CUmemAllocationHa if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, cyshareableHandle.pyObj()) -{{endif}} - -{{if 'cuMemImportFromShareableHandle' in found_functions}} @cython.embedsignature(True) def cuMemImportFromShareableHandle(osHandle, shHandleType not None : CUmemAllocationHandleType): @@ -36431,9 +35634,6 @@ def cuMemImportFromShareableHandle(osHandle, shHandleType not None : CUmemAlloca if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, handle) -{{endif}} - -{{if 'cuMemGetAllocationGranularity' in found_functions}} @cython.embedsignature(True) def cuMemGetAllocationGranularity(prop : Optional[CUmemAllocationProp], option not None : CUmemAllocationGranularity_flags): @@ -36463,16 +35663,13 @@ 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 is not None else NULL + cdef cydriver.CUmemAllocationProp* cyprop_ptr = prop._pvt_ptr if prop is not None else NULL cdef cydriver.CUmemAllocationGranularity_flags cyoption = int(option) with nogil: err = cydriver.cuMemGetAllocationGranularity(&granularity, cyprop_ptr, cyoption) if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, granularity) -{{endif}} - -{{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}} @cython.embedsignature(True) def cuMemGetAllocationPropertiesFromHandle(handle): @@ -36509,9 +35706,6 @@ def cuMemGetAllocationPropertiesFromHandle(handle): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, prop) -{{endif}} - -{{if 'cuMemRetainAllocationHandle' in found_functions}} @cython.embedsignature(True) def cuMemRetainAllocationHandle(addr): @@ -36551,9 +35745,6 @@ def cuMemRetainAllocationHandle(addr): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, handle) -{{endif}} - -{{if 'cuMemFreeAsync' in found_functions}} @cython.embedsignature(True) def cuMemFreeAsync(dptr, hStream): @@ -36599,9 +35790,6 @@ def cuMemFreeAsync(dptr, hStream): with nogil: err = cydriver.cuMemFreeAsync(cydptr, cyhStream) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemAllocAsync' in found_functions}} @cython.embedsignature(True) def cuMemAllocAsync(size_t bytesize, hStream): @@ -36653,9 +35841,6 @@ def cuMemAllocAsync(size_t bytesize, hStream): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, dptr) -{{endif}} - -{{if 'cuMemPoolTrimTo' in found_functions}} @cython.embedsignature(True) def cuMemPoolTrimTo(pool, size_t minBytesToKeep): @@ -36703,9 +35888,6 @@ def cuMemPoolTrimTo(pool, size_t minBytesToKeep): with nogil: err = cydriver.cuMemPoolTrimTo(cypool, minBytesToKeep) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemPoolSetAttribute' in found_functions}} @cython.embedsignature(True) def cuMemPoolSetAttribute(pool, attr not None : CUmemPool_attribute, value): @@ -36714,11 +35896,11 @@ def cuMemPoolSetAttribute(pool, attr not None : CUmemPool_attribute, value): Supported attributes are: - :py:obj:`~.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD`: (value type = - cuuint64_t) Amount of reserved memory in bytes to hold onto before - trying to release memory back to the OS. When more than the release - threshold bytes of memory are held by the memory pool, the allocator - will try to release memory back to the OS on the next call to stream, - event or context synchronize. (default 0) + :py:obj:`~.cuuint64_t`) Amount of reserved memory in bytes to hold + onto before trying to release memory back to the OS. When more than + the release threshold bytes of memory are held by the memory pool, + the allocator will try to release memory back to the OS on the next + call to stream, event or context synchronize. (default 0) - :py:obj:`~.CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES`: (value type = int) Allow :py:obj:`~.cuMemAllocAsync` to use memory @@ -36738,13 +35920,13 @@ def cuMemPoolSetAttribute(pool, attr not None : CUmemPool_attribute, value): (default enabled). - :py:obj:`~.CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH`: (value type = - cuuint64_t) Reset the high watermark that tracks the amount of - backing memory that was allocated for the memory pool. It is illegal - to set this attribute to a non-zero value. + :py:obj:`~.cuuint64_t`) Reset the high watermark that tracks the + amount of backing memory that was allocated for the memory pool. It + is illegal to set this attribute to a non-zero value. - - :py:obj:`~.CU_MEMPOOL_ATTR_USED_MEM_HIGH`: (value type = cuuint64_t) - Reset the high watermark that tracks the amount of used memory that - was allocated for the memory pool. + - :py:obj:`~.CU_MEMPOOL_ATTR_USED_MEM_HIGH`: (value type = + :py:obj:`~.cuuint64_t`) Reset the high watermark that tracks the + amount of used memory that was allocated for the memory pool. Parameters ---------- @@ -36778,9 +35960,6 @@ def cuMemPoolSetAttribute(pool, attr not None : CUmemPool_attribute, value): with nogil: err = cydriver.cuMemPoolSetAttribute(cypool, cyattr, cyvalue_ptr) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemPoolGetAttribute' in found_functions}} @cython.embedsignature(True) def cuMemPoolGetAttribute(pool, attr not None : CUmemPool_attribute): @@ -36789,11 +35968,11 @@ def cuMemPoolGetAttribute(pool, attr not None : CUmemPool_attribute): Supported attributes are: - :py:obj:`~.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD`: (value type = - cuuint64_t) Amount of reserved memory in bytes to hold onto before - trying to release memory back to the OS. When more than the release - threshold bytes of memory are held by the memory pool, the allocator - will try to release memory back to the OS on the next call to stream, - event or context synchronize. (default 0) + :py:obj:`~.cuuint64_t`) Amount of reserved memory in bytes to hold + onto before trying to release memory back to the OS. When more than + the release threshold bytes of memory are held by the memory pool, + the allocator will try to release memory back to the OS on the next + call to stream, event or context synchronize. (default 0) - :py:obj:`~.CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES`: (value type = int) Allow :py:obj:`~.cuMemAllocAsync` to use memory @@ -36813,30 +35992,30 @@ def cuMemPoolGetAttribute(pool, attr not None : CUmemPool_attribute): (default enabled). - :py:obj:`~.CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT`: (value type = - cuuint64_t) Amount of backing memory currently allocated for the - mempool + :py:obj:`~.cuuint64_t`) Amount of backing memory currently allocated + for the mempool - :py:obj:`~.CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH`: (value type = - cuuint64_t) High watermark of backing memory allocated for the - mempool since the last time it was reset. + :py:obj:`~.cuuint64_t`) High watermark of backing memory allocated + for the mempool since the last time it was reset. - :py:obj:`~.CU_MEMPOOL_ATTR_USED_MEM_CURRENT`: (value type = - cuuint64_t) Amount of memory from the pool that is currently in use - by the application. + :py:obj:`~.cuuint64_t`) Amount of memory from the pool that is + currently in use by the application. - - :py:obj:`~.CU_MEMPOOL_ATTR_USED_MEM_HIGH`: (value type = cuuint64_t) - High watermark of the amount of memory from the pool that was in use - by the application. + - :py:obj:`~.CU_MEMPOOL_ATTR_USED_MEM_HIGH`: (value type = + :py:obj:`~.cuuint64_t`) High watermark of the amount of memory from + the pool that was in use by the application. The following properties can be also be queried on imported and default pools: - :py:obj:`~.CU_MEMPOOL_ATTR_ALLOCATION_TYPE`: (value type = - CUmemAllocationType) The allocation type of the mempool + :py:obj:`~.CUmemAllocationType`) The allocation type of the mempool - :py:obj:`~.CU_MEMPOOL_ATTR_EXPORT_HANDLE_TYPES`: (value type = - CUmemAllocationHandleType) Available export handle types for the - mempool. For imported pools this value is always + :py:obj:`~.CUmemAllocationHandleType`) Available export handle types + for the mempool. For imported pools this value is always CU_MEM_HANDLE_TYPE_NONE as an imported pool cannot be re-exported - :py:obj:`~.CU_MEMPOOL_ATTR_LOCATION_ID`: (value type = int) The @@ -36844,16 +36023,16 @@ def cuMemPoolGetAttribute(pool, attr not None : CUmemPool_attribute): CU_MEM_LOCATION_TYPE_INVISIBLE then ID will be CU_DEVICE_INVALID. - :py:obj:`~.CU_MEMPOOL_ATTR_LOCATION_TYPE`: (value type = - CUmemLocationType) The location type for the mempool. For imported - memory pools where the device is not directly visible to the + :py:obj:`~.CUmemLocationType`) The location type for the mempool. For + imported memory pools where the device is not directly visible to the importing process or pools imported via fabric handles across nodes this will be CU_MEM_LOCATION_TYPE_INVISIBLE. - - :py:obj:`~.CU_MEMPOOL_ATTR_MAX_POOL_SIZE`: (value type = cuuint64_t) - Maximum size of the pool in bytes, this value may be higher than what - was initially passed to cuMemPoolCreate due to alignment - requirements. A value of 0 indicates no maximum size. For - CU__MEM_ALLOCATION_TYPE_MANAGED and IPC imported pools this value + - :py:obj:`~.CU_MEMPOOL_ATTR_MAX_POOL_SIZE`: (value type = + :py:obj:`~.cuuint64_t`) Maximum size of the pool in bytes, this value + may be higher than what was initially passed to cuMemPoolCreate due + to alignment requirements. A value of 0 indicates no maximum size. + For CU__MEM_ALLOCATION_TYPE_MANAGED and IPC imported pools this value will be system dependent. - :py:obj:`~.CU_MEMPOOL_ATTR_HW_DECOMPRESS_ENABLED`: (value type = int) @@ -36889,9 +36068,6 @@ def cuMemPoolGetAttribute(pool, attr not None : CUmemPool_attribute): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, cyvalue.pyObj()) -{{endif}} - -{{if 'cuMemPoolSetAccess' in found_functions}} @cython.embedsignature(True) def cuMemPoolSetAccess(pool, map : Optional[tuple[CUmemAccessDesc] | list[CUmemAccessDesc]], size_t count): @@ -36942,9 +36118,6 @@ def cuMemPoolSetAccess(pool, map : Optional[tuple[CUmemAccessDesc] | list[CUmemA if len(map) > 1 and cymap is not NULL: free(cymap) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemPoolGetAccess' in found_functions}} @cython.embedsignature(True) def cuMemPoolGetAccess(memPool, location : Optional[CUmemLocation]): @@ -36980,15 +36153,12 @@ 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 is not 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: return (_CUresult(err), None) return (_CUresult_SUCCESS, CUmemAccess_flags(flags)) -{{endif}} - -{{if 'cuMemPoolCreate' in found_functions}} @cython.embedsignature(True) def cuMemPoolCreate(poolProps : Optional[CUmemPoolProps]): @@ -37000,23 +36170,24 @@ def cuMemPoolCreate(poolProps : Optional[CUmemPoolProps]): 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:`~.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:`~.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:`~.CUmemPoolProps.CUmemLocation.id` must specify the NUMA ID of + the host memory node. Specifying :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` or + :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` 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 @@ -37044,11 +36215,11 @@ def cuMemPoolCreate(poolProps : Optional[CUmemPoolProps]): /dev/nvidia-caps-imex-channels/channel0 c 0` To create a managed memory pool, applications must set - :py:obj:`~.CUmemPoolProps`::CUmemAllocationType to + :py:obj:`~.CUmemPoolProps.CUmemAllocationType` to CU_MEM_ALLOCATION_TYPE_MANAGED. - :py:obj:`~.CUmemPoolProps`::CUmemAllocationHandleType must also be set + :py:obj:`~.CUmemPoolProps.CUmemAllocationHandleType` must also be set to CU_MEM_HANDLE_TYPE_NONE since IPC is not supported. For managed - memory pools, :py:obj:`~.CUmemPoolProps`::CUmemLocation will be treated + memory pools, :py:obj:`~.CUmemPoolProps.CUmemLocation` will be treated as the preferred location for all allocations created from the pool. An application can also set CU_MEM_LOCATION_TYPE_NONE to indicate no preferred location. :py:obj:`~.CUmemPoolProps.maxSize` must be set to @@ -37079,15 +36250,12 @@ 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 is not 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: return (_CUresult(err), None) return (_CUresult_SUCCESS, pool) -{{endif}} - -{{if 'cuMemPoolDestroy' in found_functions}} @cython.embedsignature(True) def cuMemPoolDestroy(pool): @@ -37131,9 +36299,6 @@ def cuMemPoolDestroy(pool): with nogil: err = cydriver.cuMemPoolDestroy(cypool) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemGetDefaultMemPool' in found_functions}} @cython.embedsignature(True) def cuMemGetDefaultMemPool(location : Optional[CUmemLocation], typename not None : CUmemAllocationType): @@ -37141,14 +36306,13 @@ def cuMemGetDefaultMemPool(location : Optional[CUmemLocation], typename not None 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`, 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`. + location for the managed memory pool. Parameters ---------- @@ -37169,16 +36333,13 @@ 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 is not None else NULL + cdef cydriver.CUmemLocation* cylocation_ptr = location._pvt_ptr if location is not None else NULL cdef cydriver.CUmemAllocationType cytypename = int(typename) with nogil: err = cydriver.cuMemGetDefaultMemPool(pool_out._pvt_ptr, cylocation_ptr, cytypename) if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pool_out) -{{endif}} - -{{if 'cuMemGetMemPool' in found_functions}} @cython.embedsignature(True) def cuMemGetMemPool(location : Optional[CUmemLocation], typename not None : CUmemAllocationType): @@ -37187,6 +36348,7 @@ def cuMemGetMemPool(location : Optional[CUmemLocation], typename not None : CUme 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`, 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 @@ -37222,16 +36384,13 @@ 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 is not None else NULL + cdef cydriver.CUmemLocation* cylocation_ptr = location._pvt_ptr if location is not None else NULL cdef cydriver.CUmemAllocationType cytypename = int(typename) with nogil: err = cydriver.cuMemGetMemPool(pool._pvt_ptr, cylocation_ptr, cytypename) if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pool) -{{endif}} - -{{if 'cuMemSetMemPool' in found_functions}} @cython.embedsignature(True) def cuMemSetMemPool(location : Optional[CUmemLocation], typename not None : CUmemAllocationType, pool): @@ -37239,14 +36398,16 @@ def cuMemSetMemPool(location : Optional[CUmemLocation], typename not None : CUme 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` or 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`. + location for the managed memory pool. + :py:obj:`~.CU_MEM_ALLOCATION_TYPE_MANAGED` can not be used with + :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE_MEMORY_NODE`. 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 @@ -37290,14 +36451,11 @@ 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 is not None else NULL + cdef cydriver.CUmemLocation* cylocation_ptr = location._pvt_ptr if location is not None else NULL cdef cydriver.CUmemAllocationType cytypename = int(typename) with nogil: err = cydriver.cuMemSetMemPool(cylocation_ptr, cytypename, cypool) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemAllocFromPoolAsync' in found_functions}} @cython.embedsignature(True) def cuMemAllocFromPoolAsync(size_t bytesize, pool, hStream): @@ -37354,9 +36512,6 @@ def cuMemAllocFromPoolAsync(size_t bytesize, pool, hStream): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, dptr) -{{endif}} - -{{if 'cuMemPoolExportToShareableHandle' in found_functions}} @cython.embedsignature(True) def cuMemPoolExportToShareableHandle(pool, handleType not None : CUmemAllocationHandleType, unsigned long long flags): @@ -37393,7 +36548,7 @@ def cuMemPoolExportToShareableHandle(pool, handleType not None : CUmemAllocation Notes ----- - : To create an IPC capable mempool, create a mempool with a CUmemAllocationHandleType other than CU_MEM_HANDLE_TYPE_NONE. + : To create an IPC capable mempool, create a mempool with a :py:obj:`~.CUmemAllocationHandleType` other than CU_MEM_HANDLE_TYPE_NONE. """ cdef cydriver.CUmemoryPool cypool if pool is None: @@ -37411,9 +36566,6 @@ def cuMemPoolExportToShareableHandle(pool, handleType not None : CUmemAllocation if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, cyhandle_out.pyObj()) -{{endif}} - -{{if 'cuMemPoolImportFromShareableHandle' in found_functions}} @cython.embedsignature(True) def cuMemPoolImportFromShareableHandle(handle, handleType not None : CUmemAllocationHandleType, unsigned long long flags): @@ -37461,9 +36613,6 @@ def cuMemPoolImportFromShareableHandle(handle, handleType not None : CUmemAlloca if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pool_out) -{{endif}} - -{{if 'cuMemPoolExportPointer' in found_functions}} @cython.embedsignature(True) def cuMemPoolExportPointer(ptr): @@ -37504,9 +36653,6 @@ def cuMemPoolExportPointer(ptr): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, shareData_out) -{{endif}} - -{{if 'cuMemPoolImportPointer' in found_functions}} @cython.embedsignature(True) def cuMemPoolImportPointer(pool, shareData : Optional[CUmemPoolPtrExportData]): @@ -37551,15 +36697,12 @@ 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 is not 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: return (_CUresult(err), None) return (_CUresult_SUCCESS, ptr_out) -{{endif}} - -{{if 'cuMulticastCreate' in found_functions}} @cython.embedsignature(True) def cuMulticastCreate(prop : Optional[CUmulticastObjectProp]): @@ -37614,15 +36757,12 @@ def cuMulticastCreate(prop : Optional[CUmulticastObjectProp]): :py:obj:`~.cuMulticastBindAddr_v2`, :py:obj:`~.cuMulticastBindMem_v2` """ cdef CUmemGenericAllocationHandle mcHandle = CUmemGenericAllocationHandle() - cdef cydriver.CUmulticastObjectProp* cyprop_ptr = prop._pvt_ptr if prop is not 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: return (_CUresult(err), None) return (_CUresult_SUCCESS, mcHandle) -{{endif}} - -{{if 'cuMulticastAddDevice' in found_functions}} @cython.embedsignature(True) def cuMulticastAddDevice(mcHandle, dev): @@ -37677,9 +36817,6 @@ def cuMulticastAddDevice(mcHandle, dev): with nogil: err = cydriver.cuMulticastAddDevice(cymcHandle, cydev) return (_CUresult(err),) -{{endif}} - -{{if 'cuMulticastBindMem' in found_functions}} @cython.embedsignature(True) def cuMulticastBindMem(mcHandle, size_t mcOffset, memHandle, size_t memOffset, size_t size, unsigned long long flags): @@ -37761,9 +36898,6 @@ def cuMulticastBindMem(mcHandle, size_t mcOffset, memHandle, size_t memOffset, s with nogil: err = cydriver.cuMulticastBindMem(cymcHandle, mcOffset, cymemHandle, memOffset, size, flags) return (_CUresult(err),) -{{endif}} - -{{if 'cuMulticastBindMem_v2' in found_functions}} @cython.embedsignature(True) def cuMulticastBindMem_v2(mcHandle, dev, size_t mcOffset, memHandle, size_t memOffset, size_t size, unsigned long long flags): @@ -37864,9 +36998,6 @@ def cuMulticastBindMem_v2(mcHandle, dev, size_t mcOffset, memHandle, size_t memO with nogil: err = cydriver.cuMulticastBindMem_v2(cymcHandle, cydev, mcOffset, cymemHandle, memOffset, size, flags) return (_CUresult(err),) -{{endif}} - -{{if 'cuMulticastBindAddr' in found_functions}} @cython.embedsignature(True) def cuMulticastBindAddr(mcHandle, size_t mcOffset, memptr, size_t size, unsigned long long flags): @@ -37944,9 +37075,6 @@ def cuMulticastBindAddr(mcHandle, size_t mcOffset, memptr, size_t size, unsigned with nogil: err = cydriver.cuMulticastBindAddr(cymcHandle, mcOffset, cymemptr, size, flags) return (_CUresult(err),) -{{endif}} - -{{if 'cuMulticastBindAddr_v2' in found_functions}} @cython.embedsignature(True) def cuMulticastBindAddr_v2(mcHandle, dev, size_t mcOffset, memptr, size_t size, unsigned long long flags): @@ -38041,9 +37169,6 @@ def cuMulticastBindAddr_v2(mcHandle, dev, size_t mcOffset, memptr, size_t size, with nogil: err = cydriver.cuMulticastBindAddr_v2(cymcHandle, cydev, mcOffset, cymemptr, size, flags) return (_CUresult(err),) -{{endif}} - -{{if 'cuMulticastUnbind' in found_functions}} @cython.embedsignature(True) def cuMulticastUnbind(mcHandle, dev, size_t mcOffset, size_t size): @@ -38102,9 +37227,6 @@ def cuMulticastUnbind(mcHandle, dev, size_t mcOffset, size_t size): with nogil: err = cydriver.cuMulticastUnbind(cymcHandle, cydev, mcOffset, size) return (_CUresult(err),) -{{endif}} - -{{if 'cuMulticastGetGranularity' in found_functions}} @cython.embedsignature(True) def cuMulticastGetGranularity(prop : Optional[CUmulticastObjectProp], option not None : CUmulticastGranularity_flags): @@ -38136,16 +37258,756 @@ def cuMulticastGetGranularity(prop : Optional[CUmulticastObjectProp], option not :py:obj:`~.cuMulticastBindMem_v2`, :py:obj:`~.cuMulticastBindAddr_v2` """ cdef size_t granularity = 0 - cdef cydriver.CUmulticastObjectProp* cyprop_ptr = prop._pvt_ptr if prop is not None else NULL + cdef cydriver.CUmulticastObjectProp* cyprop_ptr = prop._pvt_ptr if prop is not None else NULL cdef cydriver.CUmulticastGranularity_flags cyoption = int(option) with nogil: err = cydriver.cuMulticastGetGranularity(&granularity, cyprop_ptr, cyoption) if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, granularity) -{{endif}} -{{if 'cuPointerGetAttribute' in found_functions}} +@cython.embedsignature(True) +def cuLogicalEndpointIdReserve(count): + """ Reserves a range of logical endpoint ids. + + Reserves a range of logical endpoint ids starting at `*baseLeId` and + extending for `count`. The reserved ids can be used to create or import + logical endpoints via :py:obj:`~.cuLogicalEndpointCreate` or + :py:obj:`~.cuLogicalEndpointImport` respectively. + + Parameters + ---------- + count : Any + The number of logical endpoint ids to reserve. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, + baseLeId : :py:obj:`~.CUlogicalEndpointId` + If :py:obj:`~.cuLogicalEndpointIdReserve` returns CUDA_SUCCESS, + *baseLeId contains the base logical endpoint id of the reserved + logical endpoint id range. + + See Also + -------- + :py:obj:`~.cuLogicalEndpointCreate`, :py:obj:`~.cuLogicalEndpointAddDevice`, :py:obj:`~.cuLogicalEndpointDestroy`, :py:obj:`~.cuLogicalEndpointBindAddr`, :py:obj:`~.cuLogicalEndpointBindMem`, :py:obj:`~.cuLogicalEndpointUnbind`, :py:obj:`~.cuLogicalEndpointExport`, :py:obj:`~.cuLogicalEndpointImport`, :py:obj:`~.cuLogicalEndpointGetLimits`, :py:obj:`~.cuLogicalEndpointQuery` + """ + cdef cydriver.cuuint32_t cycount + if count is None: + pcount = 0 + elif isinstance(count, (cuuint32_t,)): + pcount = int(count) + else: + pcount = int(cuuint32_t(count)) + cycount = pcount + cdef CUlogicalEndpointId baseLeId = CUlogicalEndpointId() + with nogil: + err = cydriver.cuLogicalEndpointIdReserve(baseLeId._pvt_ptr, cycount) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, baseLeId) + +@cython.embedsignature(True) +def cuLogicalEndpointIdRelease(baseLeId, count): + """ Releases a range of logical endpoint ids. + + Releases up to `count` logical endpoint ids starting at `baseLeId`. The + range of ids represented by [`baseLeId`, `baseLeId` + `count`) must all + be previously reserved. All logical endpoints in the range must be + destroyed before they can be released. + + Parameters + ---------- + baseLeId : :py:obj:`~.CUlogicalEndpointId` + First logical endpoint id to be released back to the system. + count : Any + Number of logical endpoint ids to release back to the system. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, + + See Also + -------- + :py:obj:`~.cuLogicalEndpointCreate`, :py:obj:`~.cuLogicalEndpointAddDevice`, :py:obj:`~.cuLogicalEndpointDestroy`, :py:obj:`~.cuLogicalEndpointBindAddr`, :py:obj:`~.cuLogicalEndpointBindMem`, :py:obj:`~.cuLogicalEndpointUnbind`, :py:obj:`~.cuLogicalEndpointExport`, :py:obj:`~.cuLogicalEndpointImport`, :py:obj:`~.cuLogicalEndpointGetLimits`, :py:obj:`~.cuLogicalEndpointQuery` + """ + cdef cydriver.cuuint32_t cycount + if count is None: + pcount = 0 + elif isinstance(count, (cuuint32_t,)): + pcount = int(count) + else: + pcount = int(cuuint32_t(count)) + cycount = pcount + cdef cydriver.CUlogicalEndpointId cybaseLeId + if baseLeId is None: + pbaseLeId = 0 + elif isinstance(baseLeId, (CUlogicalEndpointId,)): + pbaseLeId = int(baseLeId) + else: + pbaseLeId = int(CUlogicalEndpointId(baseLeId)) + cybaseLeId = pbaseLeId + with nogil: + err = cydriver.cuLogicalEndpointIdRelease(cybaseLeId, cycount) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuLogicalEndpointCreate(leId, prop : Optional[CUlogicalEndpointProp]): + """ Creates a logical endpoint with the requested properties and associates it with the logical endpoint id. + + This creates a logical endpoint as described by `prop`. The number of + participating devices is determined by the + :py:obj:`~.CUlogicalEndpointProp.type`. If the type is + :py:obj:`~.CU_LOGICAL_ENDPOINT_TYPE_UNICAST` then + :py:obj:`~.CUlogicalEndpointProp.unicast.device` specifies the owner + device of the unicast logical endpoint. If the type is + :py:obj:`~.CU_LOGICAL_ENDPOINT_TYPE_MULTICAST` then + :py:obj:`~.CUlogicalEndpointProp.multicast.numDevices` specifies the + number of devices in the multicast logical endpoint team. + + Devices can be added to a multicast logical endpoint via + :py:obj:`~.cuLogicalEndpointAddDevice`. After all the participating + devices have been added, a call to :py:obj:`~.cuLogicalEndpointQuery` + must be made to ensure that the logical endpoint is ready for memory + binding and access. + + A unicast logical endpoint does not have a notion of adding devices via + :py:obj:`~.cuLogicalEndpointAddDevice`. However, a call to + :py:obj:`~.cuLogicalEndpointQuery` must still be made to ensure that + the logical endpoint is ready for memory binding and access. + + Memory is bound to the logical endpoint via either + :py:obj:`~.cuLogicalEndpointBindAddr` or + :py:obj:`~.cuLogicalEndpointBindMem`, and can be unbound via + :py:obj:`~.cuLogicalEndpointUnbind`. The total amount of memory that + can be bound per device is specified by + :py:obj:`~.CUlogicalEndpointProp.size`. This size must be a multiple of + the value for `bindAlignment` as returned by + :py:obj:`~.cuLogicalEndpointGetLimits`. The maximum size for the + logical endpoint cannot exceed the value for `maxSize` as returned by + :py:obj:`~.cuLogicalEndpointGetLimits`. The bind alignment and maximum + size depend on the properties of the logical endpoint. + + Parameters + ---------- + leId : :py:obj:`~.CUlogicalEndpointId` + Logical endpoint id that will be associated with the newly created + logical endpoint. + prop : :py:obj:`~.CUlogicalEndpointProp` + Properties of the logical endpoint to create. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, + + See Also + -------- + :py:obj:`~.cuLogicalEndpointIdReserve`, :py:obj:`~.cuLogicalEndpointIdRelease`, :py:obj:`~.cuLogicalEndpointAddDevice`, :py:obj:`~.cuLogicalEndpointDestroy`, :py:obj:`~.cuLogicalEndpointBindAddr`, :py:obj:`~.cuLogicalEndpointBindMem`, :py:obj:`~.cuLogicalEndpointUnbind`, :py:obj:`~.cuLogicalEndpointExport`, :py:obj:`~.cuLogicalEndpointImport`, :py:obj:`~.cuLogicalEndpointGetLimits`, :py:obj:`~.cuLogicalEndpointQuery` + """ + cdef cydriver.CUlogicalEndpointId cyleId + if leId is None: + pleId = 0 + elif isinstance(leId, (CUlogicalEndpointId,)): + pleId = int(leId) + else: + pleId = int(CUlogicalEndpointId(leId)) + cyleId = pleId + cdef cydriver.CUlogicalEndpointProp* cyprop_ptr = prop._pvt_ptr if prop is not None else NULL + with nogil: + err = cydriver.cuLogicalEndpointCreate(cyleId, cyprop_ptr) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuLogicalEndpointAddDevice(leId, dev): + """ Associates a device to a multicast logical endpoint. + + Associates a device to a logical endpoint. The type of the logical + endpoint must be :py:obj:`~.CU_LOGICAL_ENDPOINT_TYPE_MULTICAST`. The + added device will be a part of the multicast team of size specified by + :py:obj:`~.CUlogicalEndpointProp.multicast.numDevices` during + :py:obj:`~.cuLogicalEndpointCreate`. The association of the device to + the multicast logical endpoint is permanent during the life time of the + multicast logical endpoint. All devices must be added to the multicast + logical endpoint before any memory can be bound to any device in the + team. A multicast logical endpoint will not be ready for use until all + devices have been added. User can query whether the logical endpoint is + ready for use via :py:obj:`~.cuLogicalEndpointQuery`. + + Parameters + ---------- + leId : :py:obj:`~.CUlogicalEndpointId` + Logical endpoint id representing a multicast logical endpoint. + dev : :py:obj:`~.CUdevice` + Device that will be associated with the multicast logical endpoint. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, + + See Also + -------- + :py:obj:`~.cuLogicalEndpointCreate`, :py:obj:`~.cuLogicalEndpointIdReserve`, :py:obj:`~.cuLogicalEndpointIdRelease`, :py:obj:`~.cuLogicalEndpointDestroy`, :py:obj:`~.cuLogicalEndpointBindAddr`, :py:obj:`~.cuLogicalEndpointBindMem`, :py:obj:`~.cuLogicalEndpointUnbind`, :py:obj:`~.cuLogicalEndpointExport`, :py:obj:`~.cuLogicalEndpointImport`, :py:obj:`~.cuLogicalEndpointGetLimits`, :py:obj:`~.cuLogicalEndpointQuery` + """ + 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 cydriver.CUlogicalEndpointId cyleId + if leId is None: + pleId = 0 + elif isinstance(leId, (CUlogicalEndpointId,)): + pleId = int(leId) + else: + pleId = int(CUlogicalEndpointId(leId)) + cyleId = pleId + with nogil: + err = cydriver.cuLogicalEndpointAddDevice(cyleId, cydev) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuLogicalEndpointDestroy(leId): + """ Removes the association of the logical endpoint from the logical endpoint id. + + Removes the association between the logical endpoint id and the logical + endpoint resources. Any memory bound by this process to any device + associated with the logical endpoint will be unbound. If this was the + last reference to the logical endpoint, all associated resources will + be destroyed. + + Parameters + ---------- + leId : :py:obj:`~.CUlogicalEndpointId` + Logical endpoint id of the logical endpoint to be destroyed. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, + + See Also + -------- + :py:obj:`~.cuLogicalEndpointCreate`, :py:obj:`~.cuLogicalEndpointIdReserve`, :py:obj:`~.cuLogicalEndpointIdRelease`, :py:obj:`~.cuLogicalEndpointAddDevice`, :py:obj:`~.cuLogicalEndpointBindAddr`, :py:obj:`~.cuLogicalEndpointBindMem`, :py:obj:`~.cuLogicalEndpointUnbind`, :py:obj:`~.cuLogicalEndpointExport`, :py:obj:`~.cuLogicalEndpointImport`, :py:obj:`~.cuLogicalEndpointGetLimits`, :py:obj:`~.cuLogicalEndpointQuery` + """ + cdef cydriver.CUlogicalEndpointId cyleId + if leId is None: + pleId = 0 + elif isinstance(leId, (CUlogicalEndpointId,)): + pleId = int(leId) + else: + pleId = int(CUlogicalEndpointId(leId)) + cyleId = pleId + with nogil: + err = cydriver.cuLogicalEndpointDestroy(cyleId) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuLogicalEndpointBindAddr(leId, dev, offset, ptr, size, unsigned long long flags): + """ Bind a memory allocation represented by a virtual address to a logical endpoint. + + Binds the memory allocation specified by its mapped address `ptr` to a + logical endpoint represented by `leId` at the offset `offset`. The + memory must have been allocated via :py:obj:`~.cuMemCreate` or + :py:obj:`~.cudaMallocAsync`. The intended `size` of the bind, the + `offset` in the logical endpoint range and `ptr` must be multiples of + the value for `bindAlignment` as returned by + :py:obj:`~.cuLogicalEndpointGetLimits`. + + The `size` cannot be larger than the size of the allocated memory. + Similarly the `size` + `offset` cannot be larger than the total size of + the logical endpoint. + + For device memory, i.e., type :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE`, + the memory allocation must have been created on the device specified by + `dev`. For host NUMA memory, i.e., type + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA`, the memory allocation must + have been created on the CPU NUMA node closest to `dev`. That is, the + value returned when querying + :py:obj:`~.CU_DEVICE_ATTRIBUTE_HOST_NUMA_ID` for `dev`, must be the CPU + NUMA node where the memory was allocated. + + For multicast endpoints, the device named by `dev` must have been added + to the multicast team via :py:obj:`~.cuLogicalEndpointAddDevice`. + + For unicast endpoints the device named by `dev` must be the owner + device specified during :py:obj:`~.cuLogicalEndpointCreate` via + :py:obj:`~.CUlogicalEndpointProp.unicast.device`. + + Externally shareable as well as imported multicast endpoints can be + bound only to externally shareable memory. Imported unicast endpoints + cannot be bound to any memory. + + This call will return :py:obj:`~.CUDA_ERROR_INVALID_VALUE` if + :py:obj:`~.cuLogicalEndpointQuery` has not been called for the logical + endpoint to ensure that the endpoint is ready for memory binding. + + Note that this call will return :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` if + there are insufficient resources required to perform the bind. This + call may also return :py:obj:`~.CUDA_ERROR_SYSTEM_NOT_READY` if the + necessary system software is not initialized or running. This call may + return :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` if the system configuration + is in an illegal state. In such cases, to continue using logical + endpoints, verify that the system configuration is in a valid state and + all required driver daemons are running properly. + + Parameters + ---------- + leId : :py:obj:`~.CUlogicalEndpointId` + Logical endpoint to which memory will be associated. + dev : :py:obj:`~.CUdevice` + Device on which the memory will be bound to the logical endpoint + offset : Any + Offset into the logical endpoint space. + ptr : Any + Virtual address of the memory allocation. + size : Any + Size of memory that will be bound to the logical endpoint. + flags : unsigned long long + Flags for future use, must be zero for now. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_SYSTEM_NOT_READY`, :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` + + See Also + -------- + :py:obj:`~.cuLogicalEndpointCreate`, :py:obj:`~.cuLogicalEndpointIdReserve`, :py:obj:`~.cuLogicalEndpointIdRelease`, :py:obj:`~.cuLogicalEndpointAddDevice`, :py:obj:`~.cuLogicalEndpointDestroy`, :py:obj:`~.cuLogicalEndpointBindMem`, :py:obj:`~.cuLogicalEndpointUnbind`, :py:obj:`~.cuLogicalEndpointExport`, :py:obj:`~.cuLogicalEndpointImport`, :py:obj:`~.cuLogicalEndpointGetLimits`, :py:obj:`~.cuLogicalEndpointQuery` + """ + cdef cydriver.cuuint64_t cysize + if size is None: + psize = 0 + elif isinstance(size, (cuuint64_t,)): + psize = int(size) + else: + psize = int(cuuint64_t(size)) + cysize = psize + cdef cydriver.cuuint64_t cyoffset + if offset is None: + poffset = 0 + elif isinstance(offset, (cuuint64_t,)): + poffset = int(offset) + else: + poffset = int(cuuint64_t(offset)) + cyoffset = poffset + 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 cydriver.CUlogicalEndpointId cyleId + if leId is None: + pleId = 0 + elif isinstance(leId, (CUlogicalEndpointId,)): + pleId = int(leId) + else: + pleId = int(CUlogicalEndpointId(leId)) + cyleId = pleId + cdef _HelperInputVoidPtrStruct cyptrHelper + cdef void* cyptr = _helper_input_void_ptr(ptr, &cyptrHelper) + with nogil: + err = cydriver.cuLogicalEndpointBindAddr(cyleId, cydev, cyoffset, cyptr, cysize, flags) + _helper_input_void_ptr_free(&cyptrHelper) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuLogicalEndpointBindMem(leId, dev, offset, memHandle, memOffset, size, unsigned long long flags): + """ Binds memory object represented by a handle to the logical endpoint. + + Binds the memory allocation specified by `memHandle` to a logical + endpoint represented by `leId` at the offset `offset`. The memory must + have been allocated via :py:obj:`~.cuMemCreate`. The intended `size` of + the bind, the offset in the logical endpoint range `offset` and the + offset in the memory handle `memOffset` must be multiples of the value + for `bindAlignment` as returned by + :py:obj:`~.cuLogicalEndpointGetLimits`. + + The `size` + `memOffset` cannot be larger than the size of the + allocated memory. Similarly the `size` + `offset` cannot be larger than + the total size of the logical endpoint. + + For device memory, i.e., type :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE`, + the memory allocation must have been created on the device specified by + `dev`. For host NUMA memory, i.e., type + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA`, the memory allocation must + have been created on the CPU NUMA node closest to `dev`. That is, the + value returned when querying + :py:obj:`~.CU_DEVICE_ATTRIBUTE_HOST_NUMA_ID` for `dev`, must be the CPU + NUMA node where the memory was allocated. + + For multicast endpoints, the device named by `dev` must have been added + to the multicast team via :py:obj:`~.cuLogicalEndpointAddDevice`. + + For unicast endpoints the device named by `dev` must be the owner + device specified during :py:obj:`~.cuLogicalEndpointCreate` via + :py:obj:`~.CUlogicalEndpointProp.unicast.device`. + + Externally shareable as well as imported multicast endpoints can be + bound only to externally shareable memory. Imported unicast endpoints + cannot be bound to any memory. + + This call will return :py:obj:`~.CUDA_ERROR_INVALID_VALUE` if + :py:obj:`~.cuLogicalEndpointQuery` has not been called for the logical + endpoint to ensure that the endpoint is ready for memory binding. + + Note that this call will return :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` if + there are insufficient resources required to perform the bind. This + call may also return :py:obj:`~.CUDA_ERROR_SYSTEM_NOT_READY` if the + necessary system software is not initialized or running. This call may + return :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` if the system configuration + is in an illegal state. In such cases, to continue using logical + endpoints, verify that the system configuration is in a valid state and + all required driver daemons are running properly. + + Parameters + ---------- + leId : :py:obj:`~.CUlogicalEndpointId` + Logical endpoint to which memory will be associated. + dev : :py:obj:`~.CUdevice` + Device on which the memory will be bound to the logical endpoint + offset : Any + Offset into the logical endpoint space. + memHandle : :py:obj:`~.CUmemGenericAllocationHandle` + Handle representing a memory allocation. + memOffset : Any + Offset into the memory for the attachment + size : Any + Size of memory that will be bound to the logical endpoint. + flags : unsigned long long + Flags for future use, must be zero for now. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_SYSTEM_NOT_READY`, :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` + + See Also + -------- + :py:obj:`~.cuLogicalEndpointCreate`, :py:obj:`~.cuLogicalEndpointIdReserve`, :py:obj:`~.cuLogicalEndpointIdRelease`, :py:obj:`~.cuLogicalEndpointAddDevice`, :py:obj:`~.cuLogicalEndpointDestroy`, :py:obj:`~.cuLogicalEndpointBindAddr`, :py:obj:`~.cuLogicalEndpointUnbind`, :py:obj:`~.cuLogicalEndpointExport`, :py:obj:`~.cuLogicalEndpointImport`, :py:obj:`~.cuLogicalEndpointGetLimits`, :py:obj:`~.cuLogicalEndpointQuery` + """ + cdef cydriver.cuuint64_t cysize + if size is None: + psize = 0 + elif isinstance(size, (cuuint64_t,)): + psize = int(size) + else: + psize = int(cuuint64_t(size)) + cysize = psize + cdef cydriver.cuuint64_t cymemOffset + if memOffset is None: + pmemOffset = 0 + elif isinstance(memOffset, (cuuint64_t,)): + pmemOffset = int(memOffset) + else: + pmemOffset = int(cuuint64_t(memOffset)) + cymemOffset = pmemOffset + cdef cydriver.CUmemGenericAllocationHandle cymemHandle + if memHandle is None: + pmemHandle = 0 + elif isinstance(memHandle, (CUmemGenericAllocationHandle,)): + pmemHandle = int(memHandle) + else: + pmemHandle = int(CUmemGenericAllocationHandle(memHandle)) + cymemHandle = pmemHandle + cdef cydriver.cuuint64_t cyoffset + if offset is None: + poffset = 0 + elif isinstance(offset, (cuuint64_t,)): + poffset = int(offset) + else: + poffset = int(cuuint64_t(offset)) + cyoffset = poffset + 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 cydriver.CUlogicalEndpointId cyleId + if leId is None: + pleId = 0 + elif isinstance(leId, (CUlogicalEndpointId,)): + pleId = int(leId) + else: + pleId = int(CUlogicalEndpointId(leId)) + cyleId = pleId + with nogil: + err = cydriver.cuLogicalEndpointBindMem(cyleId, cydev, cyoffset, cymemHandle, cymemOffset, cysize, flags) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuLogicalEndpointUnbind(leId, dev, offset, size): + """ Unbinds any binding at offset from the logical endpoint. + + Unbinds any memory allocations bound to the logical endpoint on `dev` + at `offset` and up to the given `size`. The intended `size` of the + unbind and the offset in the logical endpoint range `offset` must be + multiples of the value for `bindAlignment` as returned by + :py:obj:`~.cuLogicalEndpointGetLimits`. + + Parameters + ---------- + leId : :py:obj:`~.CUlogicalEndpointId` + Logical endpoint id representing a logical endpoint. + dev : :py:obj:`~.CUdevice` + Device on which the memory is bound to the logical endpoint + offset : Any + Offset into the logical endpoint. + size : Any + Desired size to unbind. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_SYSTEM_NOT_READY`, :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` + + See Also + -------- + :py:obj:`~.cuLogicalEndpointCreate`, :py:obj:`~.cuLogicalEndpointIdReserve`, :py:obj:`~.cuLogicalEndpointIdRelease`, :py:obj:`~.cuLogicalEndpointAddDevice`, :py:obj:`~.cuLogicalEndpointDestroy`, :py:obj:`~.cuLogicalEndpointBindAddr`, :py:obj:`~.cuLogicalEndpointBindMem`, :py:obj:`~.cuLogicalEndpointExport`, :py:obj:`~.cuLogicalEndpointImport`, :py:obj:`~.cuLogicalEndpointGetLimits`, :py:obj:`~.cuLogicalEndpointQuery` + + Notes + ----- + The `offset` must correspond to a value specified during a bind call. The `size` must either match the bind call of the offset or be the combined `size` of multiple bind calls. The `size` + `offset` must fully enclose all bindings that are covered. + """ + cdef cydriver.cuuint64_t cysize + if size is None: + psize = 0 + elif isinstance(size, (cuuint64_t,)): + psize = int(size) + else: + psize = int(cuuint64_t(size)) + cysize = psize + cdef cydriver.cuuint64_t cyoffset + if offset is None: + poffset = 0 + elif isinstance(offset, (cuuint64_t,)): + poffset = int(offset) + else: + poffset = int(cuuint64_t(offset)) + cyoffset = poffset + 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 cydriver.CUlogicalEndpointId cyleId + if leId is None: + pleId = 0 + elif isinstance(leId, (CUlogicalEndpointId,)): + pleId = int(leId) + else: + pleId = int(CUlogicalEndpointId(leId)) + cyleId = pleId + with nogil: + err = cydriver.cuLogicalEndpointUnbind(cyleId, cydev, cyoffset, cysize) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuLogicalEndpointExport(leId, handleType not None : CUlogicalEndpointIpcHandleType): + """ Exports a logical endpoint associated with leId to an IPC handle. + + Given a logical endpoint id `leId`, create a shareable handle `handle` + that can be used to share the logical endpoint with other processes. + The recipient process can convert the shareable handle back into a + logical endpoint id using :py:obj:`~.cuLogicalEndpointImport`. The + implementation of what this `handle` is and how it can be transfered is + defined by the requested handle type in `handletype`. + + Parameters + ---------- + leId : :py:obj:`~.CUlogicalEndpointId` + Logical endpoint id of logical endpoint. + handleType : :py:obj:`~.CUlogicalEndpointIpcHandleType` + Type of shareable handle requested. Defines type and size of the + handle output parameter. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, + handle : Any + Pointer to the location in which to store the requested handle + type. + + See Also + -------- + :py:obj:`~.cuLogicalEndpointCreate`, :py:obj:`~.cuLogicalEndpointIdReserve`, :py:obj:`~.cuLogicalEndpointIdRelease`, :py:obj:`~.cuLogicalEndpointAddDevice`, :py:obj:`~.cuLogicalEndpointDestroy`, :py:obj:`~.cuLogicalEndpointBindAddr`, :py:obj:`~.cuLogicalEndpointBindMem`, :py:obj:`~.cuLogicalEndpointUnbind`, :py:obj:`~.cuLogicalEndpointImport`, :py:obj:`~.cuLogicalEndpointGetLimits`, :py:obj:`~.cuLogicalEndpointQuery` + """ + cdef cydriver.CUlogicalEndpointId cyleId + if leId is None: + pleId = 0 + elif isinstance(leId, (CUlogicalEndpointId,)): + pleId = int(leId) + else: + pleId = int(CUlogicalEndpointId(leId)) + cyleId = pleId + cdef CUlogicalEndpointFabricHandle handle = CUlogicalEndpointFabricHandle() + cdef cydriver.CUlogicalEndpointIpcHandleType cyhandleType = int(handleType) + with nogil: + err = cydriver.cuLogicalEndpointExport(handle._pvt_ptr, cyleId, cyhandleType) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, handle) + +@cython.embedsignature(True) +def cuLogicalEndpointImport(leId, handle, handleType not None : CUlogicalEndpointIpcHandleType): + """ Imports a logical endpoint from the given IPC handle and associates it with a logical endpoint id. + + Imports a logical endpoint from the given IPC `handle` and associates + it with the logical endpoint id specified by `leId`. + + If the current process cannot support the logical endpoint described by + the shareable handle, this API will error as + :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`. If `handle` is of type + :py:obj:`~.CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_FABRIC` and the importer + process does not have access permissions, then + :py:obj:`~.CUDA_ERROR_NOT_PERMITTED` will be returned + + Parameters + ---------- + leId : :py:obj:`~.CUlogicalEndpointId` + Logical endpoint id that will be used to access the exported + logical endpoint. + handle : Any + Shareable handle representing the logical endpoint that is to be + imported. + handleType : :py:obj:`~.CUlogicalEndpointIpcHandleType` + Handle type of the exported handle + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, + + See Also + -------- + :py:obj:`~.cuLogicalEndpointCreate`, :py:obj:`~.cuLogicalEndpointIdReserve`, :py:obj:`~.cuLogicalEndpointIdRelease`, :py:obj:`~.cuLogicalEndpointAddDevice`, :py:obj:`~.cuLogicalEndpointDestroy`, :py:obj:`~.cuLogicalEndpointBindAddr`, :py:obj:`~.cuLogicalEndpointBindMem`, :py:obj:`~.cuLogicalEndpointUnbind`, :py:obj:`~.cuLogicalEndpointExport`, :py:obj:`~.cuLogicalEndpointGetLimits`, :py:obj:`~.cuLogicalEndpointQuery` + """ + cdef cydriver.CUlogicalEndpointId cyleId + if leId is None: + pleId = 0 + elif isinstance(leId, (CUlogicalEndpointId,)): + pleId = int(leId) + else: + pleId = int(CUlogicalEndpointId(leId)) + cyleId = pleId + cdef _HelperInputVoidPtrStruct cyhandleHelper + cdef void* cyhandle = _helper_input_void_ptr(handle, &cyhandleHelper) + cdef cydriver.CUlogicalEndpointIpcHandleType cyhandleType = int(handleType) + with nogil: + err = cydriver.cuLogicalEndpointImport(cyleId, cyhandle, cyhandleType) + _helper_input_void_ptr_free(&cyhandleHelper) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuLogicalEndpointGetLimits(prop : Optional[CUlogicalEndpointProp]): + """ Calculates the minimum alignment and the maximum size for the given logical endpoint properties. + + The `bindAlignment` can be used as a multiple for size and bind offset + values. The `maxSize` is the maximum size of the logical endpoint. If + `maxSize` is less than :py:obj:`~.CUlogicalEndpointProp`:size the user + must adjust the request to the smaller value. + + Parameters + ---------- + prop : :py:obj:`~.CUlogicalEndpointProp` + Properties of the logical endpoint. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_SYSTEM_NOT_READY`, :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` + bindAlignment : :py:obj:`~.cuuint64_t` + Minimum alignment granularity of the proposed logical endpoint. + maxSize : :py:obj:`~.cuuint64_t` + Maximum size of the logical endpoint. + + See Also + -------- + :py:obj:`~.cuLogicalEndpointCreate`, :py:obj:`~.cuLogicalEndpointIdReserve`, :py:obj:`~.cuLogicalEndpointIdRelease`, :py:obj:`~.cuLogicalEndpointAddDevice`, :py:obj:`~.cuLogicalEndpointDestroy`, :py:obj:`~.cuLogicalEndpointBindAddr`, :py:obj:`~.cuLogicalEndpointBindMem`, :py:obj:`~.cuLogicalEndpointUnbind`, :py:obj:`~.cuLogicalEndpointExport`, :py:obj:`~.cuLogicalEndpointImport`, :py:obj:`~.cuLogicalEndpointQuery` + """ + cdef cuuint64_t bindAlignment = cuuint64_t() + cdef cuuint64_t maxSize = cuuint64_t() + cdef cydriver.CUlogicalEndpointProp* cyprop_ptr = prop._pvt_ptr if prop is not None else NULL + with nogil: + err = cydriver.cuLogicalEndpointGetLimits(bindAlignment._pvt_ptr, maxSize._pvt_ptr, cyprop_ptr) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, bindAlignment, maxSize) + +@cython.embedsignature(True) +def cuLogicalEndpointQuery(leId, count): + """ Determines if all logical endpoints in the range have been successfully constructed. + + Queries the driver to determine if all logical endpoints in the given + range starting at `leId` and extending for `count` have been + successfully constructed. + + Provides a mechanism to ensure that it is safe to begin using a logical + endpoint ID. Using a logical endpoint ID before verifying that it is + fully constructed can result in undefined behavior. + + This is not a blocking API, it returns immediately with a `queryStatus` + of 0 if any logical endpoint ID in the given range is not fully + constructed, and a non-zero value otherwise. + + Parameters + ---------- + leId : :py:obj:`~.CUlogicalEndpointId` + First logical endpoint ID to be queried. + count : Any + Number of logical endpoints IDs to be queried. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_SYSTEM_NOT_READY`, :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` + queryStatus : int + Status of the logical endpoints. Returns 0 if any logical endpoint + in the given range is not fully constructed, and non-zero if all + logical endpoints in the given range are fully constructed. + + See Also + -------- + :py:obj:`~.cuLogicalEndpointCreate`, :py:obj:`~.cuLogicalEndpointIdReserve`, :py:obj:`~.cuLogicalEndpointIdRelease`, :py:obj:`~.cuLogicalEndpointAddDevice`, :py:obj:`~.cuLogicalEndpointDestroy`, :py:obj:`~.cuLogicalEndpointBindAddr`, :py:obj:`~.cuLogicalEndpointBindMem`, :py:obj:`~.cuLogicalEndpointUnbind`, :py:obj:`~.cuLogicalEndpointExport`, :py:obj:`~.cuLogicalEndpointImport`, :py:obj:`~.cuLogicalEndpointGetLimits` + """ + cdef cydriver.cuuint32_t cycount + if count is None: + pcount = 0 + elif isinstance(count, (cuuint32_t,)): + pcount = int(count) + else: + pcount = int(cuuint32_t(count)) + cycount = pcount + cdef cydriver.CUlogicalEndpointId cyleId + if leId is None: + pleId = 0 + elif isinstance(leId, (CUlogicalEndpointId,)): + pleId = int(leId) + else: + pleId = int(CUlogicalEndpointId(leId)) + cyleId = pleId + cdef int queryStatus = 0 + with nogil: + err = cydriver.cuLogicalEndpointQuery(cyleId, cycount, &queryStatus) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, queryStatus) @cython.embedsignature(True) def cuPointerGetAttribute(attribute not None : CUpointer_attribute, ptr): @@ -38189,7 +38051,7 @@ def cuPointerGetAttribute(attribute not None : CUpointer_attribute, ptr): - Returns in `*data` the device pointer value through which `ptr` may be accessed by kernels running in the current :py:obj:`~.CUcontext`. - The type of `data` must be CUdeviceptr *. + The type of `data` must be :py:obj:`~.CUdeviceptr` *. - If there exists no device pointer value through which kernels running in the current :py:obj:`~.CUcontext` may access `ptr` then @@ -38216,7 +38078,7 @@ def cuPointerGetAttribute(attribute not None : CUpointer_attribute, ptr): - Returns in `*data` two tokens for use with the nv-p2p.h Linux kernel interface. `data` must be a struct of type - CUDA_POINTER_ATTRIBUTE_P2P_TOKENS. + :py:obj:`~.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS`. - `ptr` must be a pointer to memory obtained from :py:obj:`~.py`:obj:`~.cuMemAlloc()`. Note that p2pToken and @@ -38356,9 +38218,6 @@ def cuPointerGetAttribute(attribute not None : CUpointer_attribute, ptr): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, cydata.pyObj()) -{{endif}} - -{{if 'cuMemPrefetchAsync_v2' in found_functions}} @cython.embedsignature(True) def cuMemPrefetchAsync(devPtr, size_t count, location not None : CUmemLocation, unsigned int flags, hStream): @@ -38374,7 +38233,7 @@ def cuMemPrefetchAsync(devPtr, size_t count, location not None : CUmemLocation, Specifying :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE` for :py:obj:`~.CUmemLocation.type` will prefetch memory to GPU specified by - device ordinal :py:obj:`~.CUmemLocation`::id which must have non-zero + device ordinal :py:obj:`~.CUmemLocation.id` which must have non-zero value for the device attribute :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`. Additionally, `hStream` must be associated with a device that has a @@ -38385,14 +38244,14 @@ def cuMemPrefetchAsync(devPtr, size_t count, location not None : CUmemLocation, memory to a specific host NUMA node by specifying :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA` for :py:obj:`~.CUmemLocation.type` and a valid host NUMA node id in - :py:obj:`~.CUmemLocation`::id Users can also request prefetching memory + :py:obj:`~.CUmemLocation.id` Users can also request prefetching memory to the host NUMA node closest to the current thread's CPU by specifying :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT` for :py:obj:`~.CUmemLocation.type`. Note when :py:obj:`~.CUmemLocation.type` is etiher :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST` OR :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT`, - :py:obj:`~.CUmemLocation`::id will be ignored. + :py:obj:`~.CUmemLocation.id` will be ignored. 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 @@ -38479,9 +38338,6 @@ def cuMemPrefetchAsync(devPtr, size_t count, location not None : CUmemLocation, with nogil: err = cydriver.cuMemPrefetchAsync(cydevPtr, count, location._pvt_ptr[0], flags, cyhStream) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemAdvise_v2' in found_functions}} @cython.embedsignature(True) def cuMemAdvise(devPtr, size_t count, advice not None : CUmem_advise, location not None : CUmemLocation): @@ -38545,19 +38401,19 @@ def cuMemAdvise(devPtr, size_t count, advice not None : CUmem_advise, location n - :py:obj:`~.CU_MEM_ADVISE_SET_PREFERRED_LOCATION`: This advice sets the preferred location for the data to be the memory belonging to `location`. When :py:obj:`~.CUmemLocation.type` is - :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST`, :py:obj:`~.CUmemLocation`::id + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST`, :py:obj:`~.CUmemLocation.id` is ignored and the preferred location is set to be host memory. To set the preferred location to a specific host NUMA node, applications must set :py:obj:`~.CUmemLocation.type` to :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA` and - :py:obj:`~.CUmemLocation`::id must specify the NUMA ID of the host + :py:obj:`~.CUmemLocation.id` must specify the NUMA ID of the host NUMA node. If :py:obj:`~.CUmemLocation.type` is set to :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT`, - :py:obj:`~.CUmemLocation`::id will be ignored and the the host NUMA + :py:obj:`~.CUmemLocation.id` will be ignored and the the host NUMA node closest to the calling thread's CPU will be used as the preferred location. If :py:obj:`~.CUmemLocation.type` is a :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE`, then - :py:obj:`~.CUmemLocation`::id must be a valid device ordinal and the + :py:obj:`~.CUmemLocation.id` must be a valid device ordinal and the device 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 @@ -38584,7 +38440,7 @@ def cuMemAdvise(devPtr, size_t count, advice not None : CUmem_advise, location n :py:obj:`~.CU_MEM_ADVISE_SET_READ_MOSTLY`. If the memory region refers to valid system-allocated pageable memory, and :py:obj:`~.CUmemLocation.type` is CU_MEM_LOCATION_TYPE_DEVICE then - :py:obj:`~.CUmemLocation`::id must be a valid device that has a non- + :py:obj:`~.CUmemLocation.id` must be a valid device that has a non- zero alue for the device attribute :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`. @@ -38597,11 +38453,11 @@ def cuMemAdvise(devPtr, size_t count, advice not None : CUmem_advise, location n the data will be accessed by processor `location`. The :py:obj:`~.CUmemLocation.type` must be either :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE` with - :py:obj:`~.CUmemLocation`::id representing a valid device ordinal or + :py:obj:`~.CUmemLocation.id` representing a valid device ordinal or :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST` and - :py:obj:`~.CUmemLocation`::id will be ignored. All other location - types are invalid. If :py:obj:`~.CUmemLocation`::id is a GPU, then - the device attribute + :py:obj:`~.CUmemLocation.id` will be ignored. All other location + types are invalid. If :py:obj:`~.CUmemLocation.id` 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 @@ -38630,10 +38486,10 @@ def cuMemAdvise(devPtr, size_t count, advice not None : CUmem_advise, location n policies of this advice. If the memory region refers to valid system- allocated pageable memory, and :py:obj:`~.CUmemLocation.type` is :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE` then device in - :py:obj:`~.CUmemLocation`::id must have a non-zero value for the + :py:obj:`~.CUmemLocation.id` must have a non-zero value for the device attribute :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`. Additionally, - if :py:obj:`~.CUmemLocation`::id has a non-zero value for the device + if :py:obj:`~.CUmemLocation.id` 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. @@ -38644,10 +38500,10 @@ def cuMemAdvise(devPtr, size_t count, advice not None : CUmem_advise, location n in non-fatal page faults. If the memory region refers to valid system-allocated pageable memory, and :py:obj:`~.CUmemLocation.type` is :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE` then device in - :py:obj:`~.CUmemLocation`::id must have a non-zero value for the + :py:obj:`~.CUmemLocation.id` must have a non-zero value for the device attribute :py:obj:`~.CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`. Additionally, - if :py:obj:`~.CUmemLocation`::id has a non-zero value for the device + if :py:obj:`~.CUmemLocation.id` 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. @@ -38684,9 +38540,6 @@ def cuMemAdvise(devPtr, size_t count, advice not None : CUmem_advise, location n with nogil: err = cydriver.cuMemAdvise(cydevPtr, count, cyadvice, location._pvt_ptr[0]) return (_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): @@ -38804,9 +38657,6 @@ def cuMemPrefetchBatchAsync(dptrs : Optional[tuple[CUdeviceptr] | list[CUdevicep if len(prefetchLocs) > 1 and cyprefetchLocs is not NULL: free(cyprefetchLocs) return (_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): @@ -38889,9 +38739,6 @@ def cuMemDiscardBatchAsync(dptrs : Optional[tuple[CUdeviceptr] | list[CUdevicept if len(dptrs) > 1 and cydptrs is not NULL: free(cydptrs) return (_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): @@ -39017,9 +38864,6 @@ def cuMemDiscardAndPrefetchBatchAsync(dptrs : Optional[tuple[CUdeviceptr] | list if len(prefetchLocs) > 1 and cyprefetchLocs is not NULL: free(cyprefetchLocs) return (_CUresult(err),) -{{endif}} - -{{if 'cuMemRangeGetAttribute' in found_functions}} @cython.embedsignature(True) def cuMemRangeGetAttribute(size_t dataSize, attribute not None : CUmem_range_attribute, devPtr, size_t count): @@ -39175,9 +39019,6 @@ def cuMemRangeGetAttribute(size_t dataSize, attribute not None : CUmem_range_att if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, cydata.pyObj()) -{{endif}} - -{{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): @@ -39262,9 +39103,6 @@ def cuMemRangeGetAttributes(dataSizes : tuple[int] | list[int], attributes : Opt if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, [obj.pyObj() for obj in pylist]) -{{endif}} - -{{if 'cuPointerSetAttribute' in found_functions}} @cython.embedsignature(True) def cuPointerSetAttribute(value, attribute not None : CUpointer_attribute, ptr): @@ -39318,9 +39156,6 @@ def cuPointerSetAttribute(value, attribute not None : CUpointer_attribute, ptr): with nogil: err = cydriver.cuPointerSetAttribute(cyvalue_ptr, cyattribute, cyptr) return (_CUresult(err),) -{{endif}} - -{{if 'cuPointerGetAttributes' in found_functions}} @cython.embedsignature(True) def cuPointerGetAttributes(unsigned int numAttributes, attributes : Optional[tuple[CUpointer_attribute] | list[CUpointer_attribute]], ptr): @@ -39412,9 +39247,6 @@ def cuPointerGetAttributes(unsigned int numAttributes, attributes : Optional[tup if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, [obj.pyObj() for obj in pylist]) -{{endif}} - -{{if 'cuStreamCreate' in found_functions}} @cython.embedsignature(True) def cuStreamCreate(unsigned int Flags): @@ -39454,9 +39286,6 @@ def cuStreamCreate(unsigned int Flags): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phStream) -{{endif}} - -{{if 'cuStreamCreateWithPriority' in found_functions}} @cython.embedsignature(True) def cuStreamCreateWithPriority(unsigned int flags, int priority): @@ -39509,14 +39338,15 @@ def cuStreamCreateWithPriority(unsigned int flags, int priority): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phStream) -{{endif}} - -{{if 'cuStreamBeginCaptureToCig' in found_functions}} @cython.embedsignature(True) def cuStreamBeginCaptureToCig(hStream, streamCigCaptureParams : Optional[CUstreamCigCaptureParams]): """ Begins capture to CIG on a stream. + Support for CIG streams with D3D12 can be determined using + :py:obj:`~.cuDeviceGetAttribute()` with + :py:obj:`~.CU_DEVICE_ATTRIBUTE_D3D12_CIG_STREAMS_SUPPORTED`. + Begin CIG (CUDA in Graphics) capture on `hStream` for the graphics API as provided in `streamCigCaptureParams`. When a stream is in CIG capture mode, all operations pushed into the stream will not be @@ -39593,13 +39423,10 @@ def cuStreamBeginCaptureToCig(hStream, streamCigCaptureParams : Optional[CUstrea else: phStream = int(CUstream(hStream)) cyhStream = phStream - cdef cydriver.CUstreamCigCaptureParams* cystreamCigCaptureParams_ptr = streamCigCaptureParams._pvt_ptr if streamCigCaptureParams is not None else NULL + cdef cydriver.CUstreamCigCaptureParams* cystreamCigCaptureParams_ptr = streamCigCaptureParams._pvt_ptr if streamCigCaptureParams is not None else NULL with nogil: err = cydriver.cuStreamBeginCaptureToCig(cyhStream, cystreamCigCaptureParams_ptr) return (_CUresult(err),) -{{endif}} - -{{if 'cuStreamEndCaptureToCig' in found_functions}} @cython.embedsignature(True) def cuStreamEndCaptureToCig(hStream): @@ -39642,9 +39469,6 @@ def cuStreamEndCaptureToCig(hStream): with nogil: err = cydriver.cuStreamEndCaptureToCig(cyhStream) return (_CUresult(err),) -{{endif}} - -{{if 'cuStreamGetPriority' in found_functions}} @cython.embedsignature(True) def cuStreamGetPriority(hStream): @@ -39690,9 +39514,6 @@ def cuStreamGetPriority(hStream): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, priority) -{{endif}} - -{{if 'cuStreamGetDevice' in found_functions}} @cython.embedsignature(True) def cuStreamGetDevice(hStream): @@ -39730,9 +39551,6 @@ def cuStreamGetDevice(hStream): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, device) -{{endif}} - -{{if 'cuStreamGetFlags' in found_functions}} @cython.embedsignature(True) def cuStreamGetFlags(hStream): @@ -39775,9 +39593,6 @@ def cuStreamGetFlags(hStream): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, flags) -{{endif}} - -{{if 'cuStreamGetId' in found_functions}} @cython.embedsignature(True) def cuStreamGetId(hStream): @@ -39832,9 +39647,6 @@ def cuStreamGetId(hStream): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, streamId) -{{endif}} - -{{if 'cuStreamGetCtx' in found_functions}} @cython.embedsignature(True) def cuStreamGetCtx(hStream): @@ -39897,9 +39709,6 @@ def cuStreamGetCtx(hStream): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pctx) -{{endif}} - -{{if 'cuStreamGetCtx_v2' in found_functions}} @cython.embedsignature(True) def cuStreamGetCtx_v2(hStream): @@ -39975,9 +39784,6 @@ def cuStreamGetCtx_v2(hStream): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None) return (_CUresult_SUCCESS, pCtx, pGreenCtx) -{{endif}} - -{{if 'cuStreamWaitEvent' in found_functions}} @cython.embedsignature(True) def cuStreamWaitEvent(hStream, hEvent, unsigned int Flags): @@ -40034,9 +39840,6 @@ def cuStreamWaitEvent(hStream, hEvent, unsigned int Flags): with nogil: err = cydriver.cuStreamWaitEvent(cyhStream, cyhEvent, Flags) return (_CUresult(err),) -{{endif}} - -{{if 'cuStreamAddCallback' in found_functions}} ctypedef struct cuStreamCallbackData_st: cydriver.CUstreamCallback callback @@ -40152,9 +39955,6 @@ def cuStreamAddCallback(hStream, callback, userData, unsigned int flags): free(cbData) _helper_input_void_ptr_free(&cyuserDataHelper) return (_CUresult(err),) -{{endif}} - -{{if 'cuStreamBeginCapture_v2' in found_functions}} @cython.embedsignature(True) def cuStreamBeginCapture(hStream, mode not None : CUstreamCaptureMode): @@ -40208,9 +40008,92 @@ def cuStreamBeginCapture(hStream, mode not None : CUstreamCaptureMode): with nogil: err = cydriver.cuStreamBeginCapture(cyhStream, cymode) return (_CUresult(err),) -{{endif}} -{{if 'cuStreamBeginCaptureToGraph' in found_functions}} +@cython.embedsignature(True) +def cuStreamBeginRecaptureToGraph(hStream, mode not None : CUstreamCaptureMode, hGraph, callbackFunc, userData): + """ Begin graph capture on a stream to an existing graph. + + Begin graph capture on `hStream` to the existing `hGraph`. The node + creation order while recapturing the graph must be identical to the + original graph. The recapture will fail immediately for: + + - Topology mismatches between the existing graph and the recaptured + graph + + - Parameter mismatches for memory allocation or free nodes + + Any other node parameter mismatches during recapture can be configured + to call the function provided in `callbackFunc`. The recapture will + fail immediately if the callback returns anything other than + CUDA_SUCCESS. + + If the recapture fails for any reason, the `graph` will be in an + undefined state and should be destroyed. + + See cuStreamBeginCapture for additional detail on beginning the + capture. + + Parameters + ---------- + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream in which to initiate capture + mode : :py:obj:`~.CUstreamCaptureMode` + Controls the interaction of this capture sequence with other API + calls that are potentially unsafe. For more details see + :py:obj:`~.cuThreadExchangeStreamCaptureMode`. + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Existing CUDA graph to be captured into + callbackFunc : :py:obj:`~.CUgraphRecaptureCallback` + Function that will be called for all parameter mismatches from the + original graph + userData : Any + A generic pointer to user data that is passed into the callback + function + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, + + See Also + -------- + :py:obj:`~.cuStreamCreate`, :py:obj:`~.cuStreamBeginCapture`, :py:obj:`~.cuStreamIsCapturing`, :py:obj:`~.cuStreamEndCapture`, :py:obj:`~.cuThreadExchangeStreamCaptureMode` + + Notes + ----- + Any user objects associated with `graph` will be released prior to the recapture. + """ + cdef cydriver.CUgraphRecaptureCallback cycallbackFunc + if callbackFunc is None: + pcallbackFunc = 0 + elif isinstance(callbackFunc, (CUgraphRecaptureCallback,)): + pcallbackFunc = int(callbackFunc) + else: + pcallbackFunc = int(CUgraphRecaptureCallback(callbackFunc)) + cycallbackFunc = pcallbackFunc + 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.CUstream cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (CUstream,)): + phStream = int(hStream) + else: + phStream = int(CUstream(hStream)) + cyhStream = phStream + cdef cydriver.CUstreamCaptureMode cymode = int(mode) + cdef _HelperInputVoidPtrStruct cyuserDataHelper + cdef void* cyuserData = _helper_input_void_ptr(userData, &cyuserDataHelper) + with nogil: + err = cydriver.cuStreamBeginRecaptureToGraph(cyhStream, cymode, cyhGraph, cycallbackFunc, cyuserData) + _helper_input_void_ptr_free(&cyuserDataHelper) + return (_CUresult(err),) @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): @@ -40314,9 +40197,6 @@ def cuStreamBeginCaptureToGraph(hStream, hGraph, dependencies : Optional[tuple[C if len(dependencyData) > 1 and cydependencyData is not NULL: free(cydependencyData) return (_CUresult(err),) -{{endif}} - -{{if 'cuThreadExchangeStreamCaptureMode' in found_functions}} @cython.embedsignature(True) def cuThreadExchangeStreamCaptureMode(mode not None : CUstreamCaptureMode): @@ -40388,9 +40268,6 @@ def cuThreadExchangeStreamCaptureMode(mode not None : CUstreamCaptureMode): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, CUstreamCaptureMode(cymode)) -{{endif}} - -{{if 'cuStreamEndCapture' in found_functions}} @cython.embedsignature(True) def cuStreamEndCapture(hStream): @@ -40436,9 +40313,6 @@ def cuStreamEndCapture(hStream): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phGraph) -{{endif}} - -{{if 'cuStreamIsCapturing' in found_functions}} @cython.embedsignature(True) def cuStreamIsCapturing(hStream): @@ -40499,9 +40373,6 @@ def cuStreamIsCapturing(hStream): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, CUstreamCaptureStatus(captureStatus)) -{{endif}} - -{{if 'cuStreamGetCaptureInfo_v3' in found_functions}} @cython.embedsignature(True) def cuStreamGetCaptureInfo(hStream): @@ -40593,15 +40464,16 @@ def cuStreamGetCaptureInfo(hStream): with nogil: 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)] + pydependencies_out = [CUgraphNode() for _ in range(numDependencies_out)] + for idx in range(numDependencies_out): + (pydependencies_out[idx])._pvt_ptr[0] = cydependencies_out[idx] if CUresult(err) == CUresult(0): - pyedgeData_out = [CUgraphEdgeData(_ptr=&cyedgeData_out[idx]) for idx in range(numDependencies_out)] + pyedgeData_out = [CUgraphEdgeData() for _ in range(numDependencies_out)] + for idx in range(numDependencies_out): + (pyedgeData_out[idx])._pvt_ptr[0] = cyedgeData_out[idx] if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None, None, None, None, None) return (_CUresult_SUCCESS, CUstreamCaptureStatus(captureStatus_out), id_out, graph_out, pydependencies_out, pyedgeData_out, numDependencies_out) -{{endif}} - -{{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): @@ -40686,9 +40558,6 @@ def cuStreamUpdateCaptureDependencies(hStream, dependencies : Optional[tuple[CUg if len(dependencyData) > 1 and cydependencyData is not NULL: free(cydependencyData) return (_CUresult(err),) -{{endif}} - -{{if 'cuStreamAttachMemAsync' in found_functions}} @cython.embedsignature(True) def cuStreamAttachMemAsync(hStream, dptr, size_t length, unsigned int flags): @@ -40799,9 +40668,6 @@ def cuStreamAttachMemAsync(hStream, dptr, size_t length, unsigned int flags): with nogil: err = cydriver.cuStreamAttachMemAsync(cyhStream, cydptr, length, flags) return (_CUresult(err),) -{{endif}} - -{{if 'cuStreamQuery' in found_functions}} @cython.embedsignature(True) def cuStreamQuery(hStream): @@ -40840,9 +40706,6 @@ def cuStreamQuery(hStream): with nogil: err = cydriver.cuStreamQuery(cyhStream) return (_CUresult(err),) -{{endif}} - -{{if 'cuStreamSynchronize' in found_functions}} @cython.embedsignature(True) def cuStreamSynchronize(hStream): @@ -40880,9 +40743,6 @@ def cuStreamSynchronize(hStream): with nogil: err = cydriver.cuStreamSynchronize(cyhStream) return (_CUresult(err),) -{{endif}} - -{{if 'cuStreamDestroy_v2' in found_functions}} @cython.embedsignature(True) def cuStreamDestroy(hStream): @@ -40921,9 +40781,6 @@ def cuStreamDestroy(hStream): with nogil: err = cydriver.cuStreamDestroy(cyhStream) return (_CUresult(err),) -{{endif}} - -{{if 'cuStreamCopyAttributes' in found_functions}} @cython.embedsignature(True) def cuStreamCopyAttributes(dst, src): @@ -40967,9 +40824,6 @@ def cuStreamCopyAttributes(dst, src): with nogil: err = cydriver.cuStreamCopyAttributes(cydst, cysrc) return (_CUresult(err),) -{{endif}} - -{{if 'cuStreamGetAttribute' in found_functions}} @cython.embedsignature(True) def cuStreamGetAttribute(hStream, attr not None : CUstreamAttrID): @@ -40984,14 +40838,12 @@ def cuStreamGetAttribute(hStream, attr not None : CUstreamAttrID): attr : :py:obj:`~.CUstreamAttrID` - Returns ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` value_out : :py:obj:`~.CUstreamAttrValue` - See Also -------- :py:obj:`~.CUaccessPolicyWindow` @@ -41011,9 +40863,6 @@ def cuStreamGetAttribute(hStream, attr not None : CUstreamAttrID): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, value_out) -{{endif}} - -{{if 'cuStreamSetAttribute' in found_functions}} @cython.embedsignature(True) def cuStreamSetAttribute(hStream, attr not None : CUstreamAttrID, value : Optional[CUstreamAttrValue]): @@ -41031,7 +40880,6 @@ def cuStreamSetAttribute(hStream, attr not None : CUstreamAttrID, value : Option value : :py:obj:`~.CUstreamAttrValue` - Returns ------- CUresult @@ -41050,13 +40898,10 @@ def cuStreamSetAttribute(hStream, attr not None : CUstreamAttrID, value : Option phStream = int(CUstream(hStream)) cyhStream = phStream cdef cydriver.CUstreamAttrID cyattr = int(attr) - cdef cydriver.CUstreamAttrValue* cyvalue_ptr = value._pvt_ptr if value is not 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 (_CUresult(err),) -{{endif}} - -{{if 'cuEventCreate' in found_functions}} @cython.embedsignature(True) def cuEventCreate(unsigned int Flags): @@ -41105,9 +40950,6 @@ def cuEventCreate(unsigned int Flags): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phEvent) -{{endif}} - -{{if 'cuEventRecord' in found_functions}} @cython.embedsignature(True) def cuEventRecord(hEvent, hStream): @@ -41165,9 +41007,6 @@ def cuEventRecord(hEvent, hStream): with nogil: err = cydriver.cuEventRecord(cyhEvent, cyhStream) return (_CUresult(err),) -{{endif}} - -{{if 'cuEventRecordWithFlags' in found_functions}} @cython.embedsignature(True) def cuEventRecordWithFlags(hEvent, hStream, unsigned int flags): @@ -41235,9 +41074,6 @@ def cuEventRecordWithFlags(hEvent, hStream, unsigned int flags): with nogil: err = cydriver.cuEventRecordWithFlags(cyhEvent, cyhStream, flags) return (_CUresult(err),) -{{endif}} - -{{if 'cuEventQuery' in found_functions}} @cython.embedsignature(True) def cuEventQuery(hEvent): @@ -41280,9 +41116,6 @@ def cuEventQuery(hEvent): with nogil: err = cydriver.cuEventQuery(cyhEvent) return (_CUresult(err),) -{{endif}} - -{{if 'cuEventSynchronize' in found_functions}} @cython.embedsignature(True) def cuEventSynchronize(hEvent): @@ -41324,9 +41157,6 @@ def cuEventSynchronize(hEvent): with nogil: err = cydriver.cuEventSynchronize(cyhEvent) return (_CUresult(err),) -{{endif}} - -{{if 'cuEventDestroy_v2' in found_functions}} @cython.embedsignature(True) def cuEventDestroy(hEvent): @@ -41365,9 +41195,6 @@ def cuEventDestroy(hEvent): with nogil: err = cydriver.cuEventDestroy(cyhEvent) return (_CUresult(err),) -{{endif}} - -{{if 'cuEventElapsedTime_v2' in found_functions}} @cython.embedsignature(True) def cuEventElapsedTime(hStart, hEnd): @@ -41438,9 +41265,6 @@ def cuEventElapsedTime(hStart, hEnd): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pMilliseconds) -{{endif}} - -{{if 'cuImportExternalMemory' in found_functions}} @cython.embedsignature(True) def cuImportExternalMemory(memHandleDesc : Optional[CUDA_EXTERNAL_MEMORY_HANDLE_DESC]): @@ -41463,89 +41287,84 @@ def cuImportExternalMemory(memHandleDesc : Optional[CUDA_EXTERNAL_MEMORY_HANDLE_ If :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.type` is :py:obj:`~.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD`, then - :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC`::handle::fd must be a - valid file descriptor referencing a memory object. Ownership of the - file descriptor is transferred to the CUDA driver when the handle is + :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.handle.fd` must be a valid + file descriptor referencing a memory object. Ownership of the file + descriptor is transferred to the CUDA driver when the handle is imported successfully. Performing any operations on the file descriptor after it is imported results in undefined behavior. If :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.type` is :py:obj:`~.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32`, then exactly - one of - :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC`::handle::win32::handle and - :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC`::handle::win32::name must + one of :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.handle.win32.handle` + and :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.handle.win32.name` must not be NULL. If - :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC`::handle::win32::handle is - not NULL, then it must represent a valid shared NT handle that - references a memory object. Ownership of this handle is not transferred - to CUDA after the import operation, so the application must release the - handle using the appropriate system call. If - :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC`::handle::win32::name is - not NULL, then it must point to a NULL-terminated array of UTF-16 + :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.handle.win32.handle` is not + NULL, then it must represent a valid shared NT handle that references a + memory object. Ownership of this handle is not transferred to CUDA + after the import operation, so the application must release the handle + using the appropriate system call. If + :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.handle.win32.name` is not + NULL, then it must point to a NULL-terminated array of UTF-16 characters that refers to a memory object. If :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.type` is :py:obj:`~.CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT`, then - :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC`::handle::win32::handle - must be non-NULL and - :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC`::handle::win32::name must - be NULL. The handle specified must be a globally shared KMT handle. - This handle does not hold a reference to the underlying object, and - thus will be invalid when all references to the memory object are - destroyed. + :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.handle.win32.handle` must + be non-NULL and + :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.handle.win32.name` must be + NULL. The handle specified must be a globally shared KMT handle. This + handle does not hold a reference to the underlying object, and thus + will be invalid when all references to the memory object are destroyed. If :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.type` is :py:obj:`~.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP`, then exactly one - of :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC`::handle::win32::handle - and :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC`::handle::win32::name - must not be NULL. If - :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC`::handle::win32::handle is - not NULL, then it must represent a valid shared NT handle that is - returned by ID3D12Device::CreateSharedHandle when referring to a - ID3D12Heap object. This handle holds a reference to the underlying - object. If - :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC`::handle::win32::name is - not NULL, then it must point to a NULL-terminated array of UTF-16 + of :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.handle.win32.handle` and + :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.handle.win32.name` must not + be NULL. If + :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.handle.win32.handle` is not + NULL, then it must represent a valid shared NT handle that is returned + by ID3D12Device::CreateSharedHandle when referring to a ID3D12Heap + object. This handle holds a reference to the underlying object. If + :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.handle.win32.name` is not + NULL, then it must point to a NULL-terminated array of UTF-16 characters that refers to a ID3D12Heap object. If :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.type` is :py:obj:`~.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE`, then exactly - one of - :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC`::handle::win32::handle and - :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC`::handle::win32::name must + one of :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.handle.win32.handle` + and :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.handle.win32.name` must not be NULL. If - :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC`::handle::win32::handle is - not NULL, then it must represent a valid shared NT handle that is - returned by ID3D12Device::CreateSharedHandle when referring to a - ID3D12Resource object. This handle holds a reference to the underlying - object. If - :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC`::handle::win32::name is - not NULL, then it must point to a NULL-terminated array of UTF-16 + :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.handle.win32.handle` is not + NULL, then it must represent a valid shared NT handle that is returned + by ID3D12Device::CreateSharedHandle when referring to a ID3D12Resource + object. This handle holds a reference to the underlying object. If + :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.handle.win32.name` is not + NULL, then it must point to a NULL-terminated array of UTF-16 characters that refers to a ID3D12Resource object. If :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.type` is :py:obj:`~.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE`, then - :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC`::handle::win32::handle - must represent a valid shared NT handle that is returned by + :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.handle.win32.handle` must + represent a valid shared NT handle that is returned by IDXGIResource1::CreateSharedHandle when referring to a ID3D11Resource object. If - :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC`::handle::win32::name is - not NULL, then it must point to a NULL-terminated array of UTF-16 + :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.handle.win32.name` is not + NULL, then it must point to a NULL-terminated array of UTF-16 characters that refers to a ID3D11Resource object. If :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.type` is :py:obj:`~.CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT`, then - :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC`::handle::win32::handle - must represent a valid shared KMT handle that is returned by + :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.handle.win32.handle` must + represent a valid shared KMT handle that is returned by IDXGIResource::GetSharedHandle when referring to a ID3D11Resource object and - :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC`::handle::win32::name must - be NULL. + :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.handle.win32.name` must be + NULL. If :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.type` is :py:obj:`~.CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF`, then - :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC`::handle::nvSciBufObject - must be non-NULL and reference a valid NvSciBuf object. If the NvSciBuf + :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.handle.nvSciBufObject` must + be non-NULL and reference a valid NvSciBuf object. If the NvSciBuf object imported into CUDA is also mapped by other drivers, then the application must use :py:obj:`~.cuWaitExternalSemaphoresAsync` or :py:obj:`~.cuSignalExternalSemaphoresAsync` as appropriate barriers to @@ -41556,8 +41375,8 @@ def cuImportExternalMemory(memHandleDesc : Optional[CUDA_EXTERNAL_MEMORY_HANDLE_ 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.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 @@ -41598,15 +41417,12 @@ 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 is not 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: return (_CUresult(err), None) return (_CUresult_SUCCESS, extMem_out) -{{endif}} - -{{if 'cuExternalMemoryGetMappedBuffer' in found_functions}} @cython.embedsignature(True) def cuExternalMemoryGetMappedBuffer(extMem, bufferDesc : Optional[CUDA_EXTERNAL_MEMORY_BUFFER_DESC]): @@ -41668,15 +41484,12 @@ 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 is not 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: return (_CUresult(err), None) return (_CUresult_SUCCESS, devPtr) -{{endif}} - -{{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}} @cython.embedsignature(True) def cuExternalMemoryGetMappedMipmappedArray(extMem, mipmapDesc : Optional[CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC]): @@ -41702,7 +41515,7 @@ def cuExternalMemoryGetMappedMipmappedArray(extMem, mipmapDesc : Optional[CUDA_E the mipmapped array is bound as a color target in the graphics API, then the flag :py:obj:`~.CUDA_ARRAY3D_COLOR_ATTACHMENT` must be specified in - :py:obj:`~.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC`::arrayDesc::Flags. + :py:obj:`~.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC.arrayDesc.Flags`. :py:obj:`~.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC.numLevels` specifies the total number of levels in the mipmap chain. @@ -41744,15 +41557,12 @@ 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 is not 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: return (_CUresult(err), None) return (_CUresult_SUCCESS, mipmap) -{{endif}} - -{{if 'cuDestroyExternalMemory' in found_functions}} @cython.embedsignature(True) def cuDestroyExternalMemory(extMem): @@ -41788,9 +41598,6 @@ def cuDestroyExternalMemory(extMem): with nogil: err = cydriver.cuDestroyExternalMemory(cyextMem) return (_CUresult(err),) -{{endif}} - -{{if 'cuImportExternalSemaphore' in found_functions}} @cython.embedsignature(True) def cuImportExternalSemaphore(semHandleDesc : Optional[CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC]): @@ -41813,7 +41620,7 @@ def cuImportExternalSemaphore(semHandleDesc : Optional[CUDA_EXTERNAL_SEMAPHORE_H If :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.type` is :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD`, then - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC`::handle::fd must be a + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.handle.fd` must be a valid file descriptor referencing a synchronization object. Ownership of the file descriptor is transferred to the CUDA driver when the handle is imported successfully. Performing any operations on the file @@ -41822,98 +41629,95 @@ def cuImportExternalSemaphore(semHandleDesc : Optional[CUDA_EXTERNAL_SEMAPHORE_H If :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.type` is :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32`, then exactly one of - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC`::handle::win32::handle - and - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC`::handle::win32::name - must not be NULL. If - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC`::handle::win32::handle - is not NULL, then it must represent a valid shared NT handle that + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.handle.win32.handle` and + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.handle.win32.name` must + not be NULL. If + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.handle.win32.handle` is + not NULL, then it must represent a valid shared NT handle that references a synchronization object. Ownership of this handle is not transferred to CUDA after the import operation, so the application must release the handle using the appropriate system call. If - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC`::handle::win32::name is + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.handle.win32.name` is not NULL, then it must name a valid synchronization object. If :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.type` is :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT`, then - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC`::handle::win32::handle + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.handle.win32.handle` must be non-NULL and - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC`::handle::win32::name - must be NULL. The handle specified must be a globally shared KMT - handle. This handle does not hold a reference to the underlying object, - and thus will be invalid when all references to the synchronization - object are destroyed. + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.handle.win32.name` must + be NULL. The handle specified must be a globally shared KMT handle. + This handle does not hold a reference to the underlying object, and + thus will be invalid when all references to the synchronization object + are destroyed. If :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.type` is :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE`, then exactly one of - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC`::handle::win32::handle - and - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC`::handle::win32::name - must not be NULL. If - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC`::handle::win32::handle - is not NULL, then it must represent a valid shared NT handle that is + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.handle.win32.handle` and + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.handle.win32.name` must + not be NULL. If + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.handle.win32.handle` is + not NULL, then it must represent a valid shared NT handle that is returned by ID3D12Device::CreateSharedHandle when referring to a ID3D12Fence object. This handle holds a reference to the underlying object. If - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC`::handle::win32::name is + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.handle.win32.name` is not NULL, then it must name a valid synchronization object that refers to a valid ID3D12Fence object. If :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.type` is :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE`, then - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC`::handle::win32::handle + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.handle.win32.handle` represents a valid shared NT handle that is returned by ID3D11Fence::CreateSharedHandle. If - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC`::handle::win32::name is + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.handle.win32.name` is not NULL, then it must name a valid synchronization object that refers to a valid ID3D11Fence object. If :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.type` is :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC`, then - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC`::handle::nvSciSyncObj + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.handle.nvSciSyncObj` represents a valid NvSciSyncObj. :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX`, then - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC`::handle::win32::handle + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.handle.win32.handle` represents a valid shared NT handle that is returned by IDXGIResource1::CreateSharedHandle when referring to a IDXGIKeyedMutex object. If - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC`::handle::win32::name is + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.handle.win32.name` is not NULL, then it must name a valid synchronization object that refers to a valid IDXGIKeyedMutex object. If :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.type` is :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT`, then - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC`::handle::win32::handle + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.handle.win32.handle` represents a valid shared KMT handle that is returned by IDXGIResource::GetSharedHandle when referring to a IDXGIKeyedMutex object and - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC`::handle::win32::name - must be NULL. + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.handle.win32.name` must + be NULL. If :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.type` is :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD`, - then :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC`::handle::fd must - be a valid file descriptor referencing a synchronization object. - Ownership of the file descriptor is transferred to the CUDA driver when - the handle is imported successfully. Performing any operations on the - file descriptor after it is imported results in undefined behavior. + then :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.handle.fd` must be + a valid file descriptor referencing a synchronization object. Ownership + of the file descriptor is transferred to the CUDA driver when the + handle is imported successfully. Performing any operations on the file + descriptor after it is imported results in undefined behavior. If :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.type` is :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32`, then exactly one of - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC`::handle::win32::handle - and - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC`::handle::win32::name - must not be NULL. If - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC`::handle::win32::handle - is not NULL, then it must represent a valid shared NT handle that + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.handle.win32.handle` and + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.handle.win32.name` must + not be NULL. If + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.handle.win32.handle` is + not NULL, then it must represent a valid shared NT handle that references a synchronization object. Ownership of this handle is not transferred to CUDA after the import operation, so the application must release the handle using the appropriate system call. If - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC`::handle::win32::name is + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC.handle.win32.name` is not NULL, then it must name a valid synchronization object. Parameters @@ -41933,15 +41737,12 @@ 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 is not 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: return (_CUresult(err), None) return (_CUresult_SUCCESS, extSem_out) -{{endif}} - -{{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): @@ -41966,15 +41767,15 @@ def cuSignalExternalSemaphoresAsync(extSemArray : Optional[tuple[CUexternalSemap :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD`, :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32` then the semaphore will be set to the value specified in - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS`::params::fence::value. + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS.params.fence.value`. If the semaphore object is of the type :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC` this API sets - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS`::params::nvSciSync::fence + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS.params.nvSciSync.fence` to a value that can be used by subsequent waiters of the same NvSciSync object to order operations with those currently submitted in `stream`. Such an update will overwrite previous contents of - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS`::params::nvSciSync::fence. + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS.params.nvSciSync.fence`. By default, signaling such an external semaphore object causes appropriate memory synchronization operations to be performed over all external memory objects that are imported as @@ -42028,7 +41829,7 @@ def cuSignalExternalSemaphoresAsync(extSemArray : Optional[tuple[CUexternalSemap :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX`, :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT` then the keyed mutex will be released with the key specified in - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_PARAMS`::params::keyedmutex::key. + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_PARAMS.params.keyedmutex.key`. Parameters ---------- @@ -42092,9 +41893,6 @@ def cuSignalExternalSemaphoresAsync(extSemArray : Optional[tuple[CUexternalSemap if len(paramsArray) > 1 and cyparamsArray is not NULL: free(cyparamsArray) return (_CUresult(err),) -{{endif}} - -{{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): @@ -42123,12 +41921,12 @@ def cuWaitExternalSemaphoresAsync(extSemArray : Optional[tuple[CUexternalSemapho :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32` then waiting on the semaphore will wait until the value of the semaphore is greater than or equal to - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS`::params::fence::value. + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS.params.fence.value`. If the semaphore object is of the type :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC` then, waiting on the semaphore will wait until the - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS`::params::nvSciSync::fence + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS.params.nvSciSync.fence` is signaled by the signaler of the NvSciSyncObj that was associated with this semaphore object. By default, waiting on such an external semaphore object causes appropriate memory synchronization operations @@ -42152,9 +41950,9 @@ def cuWaitExternalSemaphoresAsync(extSemArray : Optional[tuple[CUexternalSemapho :py:obj:`~.CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT` then the keyed mutex will be acquired when it is released with the key specified in - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS`::params::keyedmutex::key + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS.params.keyedmutex.key` or until the timeout specified by - :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS`::params::keyedmutex::timeoutMs + :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS.params.keyedmutex.timeoutMs` has lapsed. The timeout interval can either be a finite value specified in milliseconds or an infinite value. In case an infinite value is specified the timeout never elapses. The windows INFINITE macro must be @@ -42222,9 +42020,6 @@ def cuWaitExternalSemaphoresAsync(extSemArray : Optional[tuple[CUexternalSemapho if len(paramsArray) > 1 and cyparamsArray is not NULL: free(cyparamsArray) return (_CUresult(err),) -{{endif}} - -{{if 'cuDestroyExternalSemaphore' in found_functions}} @cython.embedsignature(True) def cuDestroyExternalSemaphore(extSem): @@ -42259,9 +42054,6 @@ def cuDestroyExternalSemaphore(extSem): with nogil: err = cydriver.cuDestroyExternalSemaphore(cyextSem) return (_CUresult(err),) -{{endif}} - -{{if 'cuStreamWaitValue32_v2' in found_functions}} @cython.embedsignature(True) def cuStreamWaitValue32(stream, addr, value, unsigned int flags): @@ -42333,9 +42125,6 @@ def cuStreamWaitValue32(stream, addr, value, unsigned int flags): with nogil: err = cydriver.cuStreamWaitValue32(cystream, cyaddr, cyvalue, flags) return (_CUresult(err),) -{{endif}} - -{{if 'cuStreamWaitValue64_v2' in found_functions}} @cython.embedsignature(True) def cuStreamWaitValue64(stream, addr, value, unsigned int flags): @@ -42405,9 +42194,6 @@ def cuStreamWaitValue64(stream, addr, value, unsigned int flags): with nogil: err = cydriver.cuStreamWaitValue64(cystream, cyaddr, cyvalue, flags) return (_CUresult(err),) -{{endif}} - -{{if 'cuStreamWriteValue32_v2' in found_functions}} @cython.embedsignature(True) def cuStreamWriteValue32(stream, addr, value, unsigned int flags): @@ -42467,9 +42253,6 @@ def cuStreamWriteValue32(stream, addr, value, unsigned int flags): with nogil: err = cydriver.cuStreamWriteValue32(cystream, cyaddr, cyvalue, flags) return (_CUresult(err),) -{{endif}} - -{{if 'cuStreamWriteValue64_v2' in found_functions}} @cython.embedsignature(True) def cuStreamWriteValue64(stream, addr, value, unsigned int flags): @@ -42531,9 +42314,6 @@ def cuStreamWriteValue64(stream, addr, value, unsigned int flags): with nogil: err = cydriver.cuStreamWriteValue64(cystream, cyaddr, cyvalue, flags) return (_CUresult(err),) -{{endif}} - -{{if 'cuStreamBatchMemOp_v2' in found_functions}} @cython.embedsignature(True) def cuStreamBatchMemOp(stream, unsigned int count, paramArray : Optional[tuple[CUstreamBatchMemOpParams] | list[CUstreamBatchMemOpParams]], unsigned int flags): @@ -42604,9 +42384,6 @@ def cuStreamBatchMemOp(stream, unsigned int count, paramArray : Optional[tuple[C if len(paramArray) > 1 and cyparamArray is not NULL: free(cyparamArray) return (_CUresult(err),) -{{endif}} - -{{if 'cuFuncGetAttribute' in found_functions}} @cython.embedsignature(True) def cuFuncGetAttribute(attrib not None : CUfunction_attribute, hfunc): @@ -42689,7 +42466,7 @@ def cuFuncGetAttribute(attrib not None : CUfunction_attribute, hfunc): - :py:obj:`~.CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE`: The block scheduling policy of a function. The value type is - CUclusterSchedulingPolicy. + :py:obj:`~.CUclusterSchedulingPolicy`. With a few execeptions, function attributes may also be queried on unloaded function handles returned from @@ -42740,9 +42517,6 @@ def cuFuncGetAttribute(attrib not None : CUfunction_attribute, hfunc): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pi) -{{endif}} - -{{if 'cuFuncSetAttribute' in found_functions}} @cython.embedsignature(True) def cuFuncSetAttribute(hfunc, attrib not None : CUfunction_attribute, int value): @@ -42802,7 +42576,7 @@ def cuFuncSetAttribute(hfunc, attrib not None : CUfunction_attribute, int value) - :py:obj:`~.CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE`: The block scheduling policy of a function. The value type is - CUclusterSchedulingPolicy. + :py:obj:`~.CUclusterSchedulingPolicy`. Parameters ---------- @@ -42834,9 +42608,6 @@ def cuFuncSetAttribute(hfunc, attrib not None : CUfunction_attribute, int value) with nogil: err = cydriver.cuFuncSetAttribute(cyhfunc, cyattrib, value) return (_CUresult(err),) -{{endif}} - -{{if 'cuFuncSetCacheConfig' in found_functions}} @cython.embedsignature(True) def cuFuncSetCacheConfig(hfunc, config not None : CUfunc_cache): @@ -42900,9 +42671,6 @@ def cuFuncSetCacheConfig(hfunc, config not None : CUfunc_cache): with nogil: err = cydriver.cuFuncSetCacheConfig(cyhfunc, cyconfig) return (_CUresult(err),) -{{endif}} - -{{if 'cuFuncGetModule' in found_functions}} @cython.embedsignature(True) def cuFuncGetModule(hfunc): @@ -42944,9 +42712,6 @@ def cuFuncGetModule(hfunc): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, hmod) -{{endif}} - -{{if 'cuFuncGetName' in found_functions}} @cython.embedsignature(True) def cuFuncGetName(hfunc): @@ -42986,9 +42751,6 @@ def cuFuncGetName(hfunc): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, name if name != NULL else None) -{{endif}} - -{{if 'cuFuncGetParamInfo' in found_functions}} @cython.embedsignature(True) def cuFuncGetParamInfo(func, size_t paramIndex): @@ -43041,9 +42803,6 @@ def cuFuncGetParamInfo(func, size_t paramIndex): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None) return (_CUresult_SUCCESS, paramOffset, paramSize) -{{endif}} - -{{if 'cuFuncGetParamCount' in found_functions}} @cython.embedsignature(True) def cuFuncGetParamCount(func): @@ -43082,9 +42841,6 @@ def cuFuncGetParamCount(func): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, paramCount) -{{endif}} - -{{if 'cuFuncIsLoaded' in found_functions}} @cython.embedsignature(True) def cuFuncIsLoaded(function): @@ -43122,9 +42878,6 @@ def cuFuncIsLoaded(function): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, CUfunctionLoadingState(state)) -{{endif}} - -{{if 'cuFuncLoad' in found_functions}} @cython.embedsignature(True) def cuFuncLoad(function): @@ -43158,9 +42911,6 @@ def cuFuncLoad(function): with nogil: err = cydriver.cuFuncLoad(cyfunction) return (_CUresult(err),) -{{endif}} - -{{if 'cuLaunchKernel' in found_functions}} @cython.embedsignature(True) def cuLaunchKernel(f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, hStream, kernelParams, void_ptr extra): @@ -43291,9 +43041,6 @@ def cuLaunchKernel(f, unsigned int gridDimX, unsigned int gridDimY, unsigned int with nogil: err = cydriver.cuLaunchKernel(cyf, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, cyhStream, cykernelParams_ptr, extra) return (_CUresult(err),) -{{endif}} - -{{if 'cuLaunchKernelEx' in found_functions}} @cython.embedsignature(True) def cuLaunchKernelEx(config : Optional[CUlaunchConfig], f, kernelParams, void_ptr extra): @@ -43424,7 +43171,7 @@ def cuLaunchKernelEx(config : Optional[CUlaunchConfig], f, kernelParams, void_pt other than 0 or 1 is not allowed. On success, a handle will be returned via - :py:obj:`~.CUlaunchAttributeValue`::deviceUpdatableKernelNode::devNode + :py:obj:`~.CUlaunchAttributeValue.deviceUpdatableKernelNode.devNode` which can be passed to the various device-side update functions to update the node's kernel parameters from within another kernel. For more information on the types of device updates that can be made, as @@ -43526,15 +43273,12 @@ 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 is not 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: err = cydriver.cuLaunchKernelEx(cyconfig_ptr, cyf, cykernelParams_ptr, extra) return (_CUresult(err),) -{{endif}} - -{{if 'cuLaunchCooperativeKernel' in found_functions}} @cython.embedsignature(True) def cuLaunchCooperativeKernel(f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, hStream, kernelParams): @@ -43645,183 +43389,6 @@ def cuLaunchCooperativeKernel(f, unsigned int gridDimX, unsigned int gridDimY, u with nogil: err = cydriver.cuLaunchCooperativeKernel(cyf, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, cyhStream, cykernelParams_ptr) return (_CUresult(err),) -{{endif}} - -{{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): - """ Launches CUDA functions on multiple devices where thread blocks can cooperate and synchronize as they execute. - - [Deprecated] - - Invokes kernels as specified in the `launchParamsList` array where each - element of the array specifies all the parameters required to perform a - single kernel launch. These kernels can cooperate and synchronize as - they execute. The size of the array is specified by `numDevices`. - - No two kernels can be launched on the same device. All the devices - targeted by this multi-device launch must be identical. All devices - must have a non-zero value for the device attribute - :py:obj:`~.CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH`. - - All kernels launched must be identical with respect to the compiled - code. Note that any device, constant or managed variables present in - the module that owns the kernel launched on each device, are - independently instantiated on every device. It is the application's - responsibility to ensure these variables are initialized and used - appropriately. - - The size of the grids as specified in blocks, the size of the blocks - themselves and the amount of shared memory used by each thread block - must also match across all launched kernels. - - The streams used to launch these kernels must have been created via - either :py:obj:`~.cuStreamCreate` or - :py:obj:`~.cuStreamCreateWithPriority`. The NULL stream or - :py:obj:`~.CU_STREAM_LEGACY` or :py:obj:`~.CU_STREAM_PER_THREAD` cannot - be used. - - The total number of blocks launched per kernel cannot exceed the - maximum number of blocks per multiprocessor as returned by - :py:obj:`~.cuOccupancyMaxActiveBlocksPerMultiprocessor` (or - :py:obj:`~.cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags`) times - the number of multiprocessors as specified by the device attribute - :py:obj:`~.CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT`. Since the total - number of blocks launched per device has to match across all devices, - the maximum number of blocks that can be launched per device will be - limited by the device with the least number of multiprocessors. - - The kernels cannot make use of CUDA dynamic parallelism. - - The :py:obj:`~.CUDA_LAUNCH_PARAMS` structure is defined as: - - **View CUDA Toolkit Documentation for a C++ code example** - - where: - - - :py:obj:`~.CUDA_LAUNCH_PARAMS.function` specifies the kernel to be - launched. All functions must be identical with respect to the - compiled code. Note that you can also specify context-less kernel - :py:obj:`~.CUkernel` by querying the handle using - :py:obj:`~.cuLibraryGetKernel()` and then casting to - :py:obj:`~.CUfunction`. In this case, the context to launch the - kernel on be taken from the specified stream - :py:obj:`~.CUDA_LAUNCH_PARAMS.hStream`. - - - :py:obj:`~.CUDA_LAUNCH_PARAMS.gridDimX` is the width of the grid in - blocks. This must match across all kernels launched. - - - :py:obj:`~.CUDA_LAUNCH_PARAMS.gridDimY` is the height of the grid in - blocks. This must match across all kernels launched. - - - :py:obj:`~.CUDA_LAUNCH_PARAMS.gridDimZ` is the depth of the grid in - blocks. This must match across all kernels launched. - - - :py:obj:`~.CUDA_LAUNCH_PARAMS.blockDimX` is the X dimension of each - thread block. This must match across all kernels launched. - - - :py:obj:`~.CUDA_LAUNCH_PARAMS.blockDimX` is the Y dimension of each - thread block. This must match across all kernels launched. - - - :py:obj:`~.CUDA_LAUNCH_PARAMS.blockDimZ` is the Z dimension of each - thread block. This must match across all kernels launched. - - - :py:obj:`~.CUDA_LAUNCH_PARAMS.sharedMemBytes` is the dynamic shared- - memory size per thread block in bytes. This must match across all - kernels launched. - - - :py:obj:`~.CUDA_LAUNCH_PARAMS.hStream` is the handle to the stream to - perform the launch in. This cannot be the NULL stream or - :py:obj:`~.CU_STREAM_LEGACY` or :py:obj:`~.CU_STREAM_PER_THREAD`. The - CUDA context associated with this stream must match that associated - with :py:obj:`~.CUDA_LAUNCH_PARAMS.function`. - - - :py:obj:`~.CUDA_LAUNCH_PARAMS.kernelParams` is an array of pointers - to kernel parameters. If :py:obj:`~.CUDA_LAUNCH_PARAMS.function` has - N parameters, then :py:obj:`~.CUDA_LAUNCH_PARAMS.kernelParams` needs - to be an array of N pointers. Each of - :py:obj:`~.CUDA_LAUNCH_PARAMS.kernelParams`[0] through - :py:obj:`~.CUDA_LAUNCH_PARAMS.kernelParams`[N-1] must point to a - region of memory from which the actual kernel parameter will be - copied. The number of kernel parameters and their offsets and sizes - do not need to be specified as that information is retrieved directly - from the kernel's image. - - By default, the kernel won't begin execution on any GPU until all prior - work in all the specified streams has completed. This behavior can be - overridden by specifying the flag - :py:obj:`~.CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC`. - When this flag is specified, each kernel will only wait for prior work - in the stream corresponding to that GPU to complete before it begins - execution. - - Similarly, by default, any subsequent work pushed in any of the - specified streams will not begin execution until the kernels on all - GPUs have completed. This behavior can be overridden by specifying the - flag - :py:obj:`~.CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC`. - When this flag is specified, any subsequent work pushed in any of the - specified streams will only wait for the kernel launched on the GPU - corresponding to that stream to complete before it begins execution. - - Calling :py:obj:`~.cuLaunchCooperativeKernelMultiDevice()` sets - persistent function state that is the same as function state set - through :py:obj:`~.cuLaunchKernel` API when called individually for - each element in `launchParamsList`. - - When kernels are launched via - :py:obj:`~.cuLaunchCooperativeKernelMultiDevice()`, the previous block - shape, shared size and parameter info associated with each - :py:obj:`~.CUDA_LAUNCH_PARAMS.function` in `launchParamsList` is - overwritten. - - Note that to use :py:obj:`~.cuLaunchCooperativeKernelMultiDevice()`, - the kernels must either have been compiled with toolchain version 3.2 - or later so that it will contain kernel parameter information, or have - no kernel parameters. If either of these conditions is not met, then - :py:obj:`~.cuLaunchCooperativeKernelMultiDevice()` will return - :py:obj:`~.CUDA_ERROR_INVALID_IMAGE`. - - Parameters - ---------- - launchParamsList : list[:py:obj:`~.CUDA_LAUNCH_PARAMS`] - List of launch parameters, one per device - numDevices : unsigned int - Size of the `launchParamsList` array - flags : unsigned int - Flags to control launch behavior - - 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_INVALID_IMAGE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_LAUNCH_FAILED`, :py:obj:`~.CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES`, :py:obj:`~.CUDA_ERROR_LAUNCH_TIMEOUT`, :py:obj:`~.CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING`, :py:obj:`~.CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE`, :py:obj:`~.CUDA_ERROR_SHARED_OBJECT_INIT_FAILED` - - See Also - -------- - :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuFuncSetCacheConfig`, :py:obj:`~.cuFuncGetAttribute`, :py:obj:`~.cuLaunchCooperativeKernel`, :py:obj:`~.cudaLaunchCooperativeKernelMultiDevice` - """ - 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,]") - cdef cydriver.CUDA_LAUNCH_PARAMS* cylaunchParamsList = NULL - if len(launchParamsList) > 1: - cylaunchParamsList = calloc(len(launchParamsList), sizeof(cydriver.CUDA_LAUNCH_PARAMS)) - if cylaunchParamsList is NULL: - raise MemoryError('Failed to allocate length x size memory: ' + str(len(launchParamsList)) + 'x' + str(sizeof(cydriver.CUDA_LAUNCH_PARAMS))) - for idx in range(len(launchParamsList)): - string.memcpy(&cylaunchParamsList[idx], (launchParamsList[idx])._pvt_ptr, sizeof(cydriver.CUDA_LAUNCH_PARAMS)) - elif len(launchParamsList) == 1: - cylaunchParamsList = (launchParamsList[0])._pvt_ptr - if numDevices > len(launchParamsList): raise RuntimeError("List is too small: " + str(len(launchParamsList)) + " < " + str(numDevices)) - with nogil: - err = cydriver.cuLaunchCooperativeKernelMultiDevice(cylaunchParamsList, numDevices, flags) - if len(launchParamsList) > 1 and cylaunchParamsList is not NULL: - free(cylaunchParamsList) - return (_CUresult(err),) -{{endif}} - -{{if 'cuLaunchHostFunc' in found_functions}} ctypedef struct cuHostCallbackData_st: cydriver.CUhostFn callback @@ -43929,9 +43496,6 @@ def cuLaunchHostFunc(hStream, fn, userData): free(cbData) _helper_input_void_ptr_free(&cyuserDataHelper) return (_CUresult(err),) -{{endif}} - -{{if 'cuLaunchHostFunc_v2' in found_functions}} @cython.embedsignature(True) def cuLaunchHostFunc_v2(hStream, fn, userData, unsigned int syncMode): @@ -44018,9 +43582,6 @@ def cuLaunchHostFunc_v2(hStream, fn, userData, unsigned int syncMode): err = cydriver.cuLaunchHostFunc_v2(cyhStream, cyfn, cyuserData, syncMode) _helper_input_void_ptr_free(&cyuserDataHelper) return (_CUresult(err),) -{{endif}} - -{{if 'cuFuncSetBlockShape' in found_functions}} @cython.embedsignature(True) def cuFuncSetBlockShape(hfunc, int x, int y, int z): @@ -44062,9 +43623,6 @@ def cuFuncSetBlockShape(hfunc, int x, int y, int z): with nogil: err = cydriver.cuFuncSetBlockShape(cyhfunc, x, y, z) return (_CUresult(err),) -{{endif}} - -{{if 'cuFuncSetSharedSize' in found_functions}} @cython.embedsignature(True) def cuFuncSetSharedSize(hfunc, unsigned int numbytes): @@ -44103,9 +43661,6 @@ def cuFuncSetSharedSize(hfunc, unsigned int numbytes): with nogil: err = cydriver.cuFuncSetSharedSize(cyhfunc, numbytes) return (_CUresult(err),) -{{endif}} - -{{if 'cuParamSetSize' in found_functions}} @cython.embedsignature(True) def cuParamSetSize(hfunc, unsigned int numbytes): @@ -44143,9 +43698,6 @@ def cuParamSetSize(hfunc, unsigned int numbytes): with nogil: err = cydriver.cuParamSetSize(cyhfunc, numbytes) return (_CUresult(err),) -{{endif}} - -{{if 'cuParamSeti' in found_functions}} @cython.embedsignature(True) def cuParamSeti(hfunc, int offset, unsigned int value): @@ -44186,9 +43738,6 @@ def cuParamSeti(hfunc, int offset, unsigned int value): with nogil: err = cydriver.cuParamSeti(cyhfunc, offset, value) return (_CUresult(err),) -{{endif}} - -{{if 'cuParamSetf' in found_functions}} @cython.embedsignature(True) def cuParamSetf(hfunc, int offset, float value): @@ -44229,9 +43778,6 @@ def cuParamSetf(hfunc, int offset, float value): with nogil: err = cydriver.cuParamSetf(cyhfunc, offset, value) return (_CUresult(err),) -{{endif}} - -{{if 'cuParamSetv' in found_functions}} @cython.embedsignature(True) def cuParamSetv(hfunc, int offset, ptr, unsigned int numbytes): @@ -44277,9 +43823,6 @@ def cuParamSetv(hfunc, int offset, ptr, unsigned int numbytes): err = cydriver.cuParamSetv(cyhfunc, offset, cyptr, numbytes) _helper_input_void_ptr_free(&cyptrHelper) return (_CUresult(err),) -{{endif}} - -{{if 'cuLaunch' in found_functions}} @cython.embedsignature(True) def cuLaunch(f): @@ -44328,9 +43871,6 @@ def cuLaunch(f): with nogil: err = cydriver.cuLaunch(cyf) return (_CUresult(err),) -{{endif}} - -{{if 'cuLaunchGrid' in found_functions}} @cython.embedsignature(True) def cuLaunchGrid(f, int grid_width, int grid_height): @@ -44383,9 +43923,6 @@ def cuLaunchGrid(f, int grid_width, int grid_height): with nogil: err = cydriver.cuLaunchGrid(cyf, grid_width, grid_height) return (_CUresult(err),) -{{endif}} - -{{if 'cuLaunchGridAsync' in found_functions}} @cython.embedsignature(True) def cuLaunchGridAsync(f, int grid_width, int grid_height, hStream): @@ -44433,7 +43970,7 @@ def cuLaunchGridAsync(f, int grid_width, int grid_height, hStream): Notes ----- - In certain cases where cubins are created with no ABI (i.e., using `ptxas` `None` `no`), this function may serialize kernel launches. The CUDA driver retains asynchronous behavior by growing the per-thread stack as needed per launch and not shrinking it afterwards. + In certain cases where cubins are created with no ABI (i.e., using `ptxas` `--abi-compile` `no`), this function may serialize kernel launches. The CUDA driver retains asynchronous behavior by growing the per-thread stack as needed per launch and not shrinking it afterwards. """ cdef cydriver.CUstream cyhStream if hStream is None: @@ -44454,9 +43991,177 @@ def cuLaunchGridAsync(f, int grid_width, int grid_height, hStream): with nogil: err = cydriver.cuLaunchGridAsync(cyf, grid_width, grid_height, cyhStream) return (_CUresult(err),) -{{endif}} -{{if 'cuParamSetTexRef' in found_functions}} +@cython.embedsignature(True) +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] + + Invokes kernels as specified in the `launchParamsList` array where each + element of the array specifies all the parameters required to perform a + single kernel launch. These kernels can cooperate and synchronize as + they execute. The size of the array is specified by `numDevices`. + + No two kernels can be launched on the same device. All the devices + targeted by this multi-device launch must be identical. All devices + must have a non-zero value for the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH`. + + All kernels launched must be identical with respect to the compiled + code. Note that any device, constant or managed variables present in + the module that owns the kernel launched on each device, are + independently instantiated on every device. It is the application's + responsibility to ensure these variables are initialized and used + appropriately. + + The size of the grids as specified in blocks, the size of the blocks + themselves and the amount of shared memory used by each thread block + must also match across all launched kernels. + + The streams used to launch these kernels must have been created via + either :py:obj:`~.cuStreamCreate` or + :py:obj:`~.cuStreamCreateWithPriority`. The NULL stream or + :py:obj:`~.CU_STREAM_LEGACY` or :py:obj:`~.CU_STREAM_PER_THREAD` cannot + be used. + + The total number of blocks launched per kernel cannot exceed the + maximum number of blocks per multiprocessor as returned by + :py:obj:`~.cuOccupancyMaxActiveBlocksPerMultiprocessor` (or + :py:obj:`~.cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags`) times + the number of multiprocessors as specified by the device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT`. Since the total + number of blocks launched per device has to match across all devices, + the maximum number of blocks that can be launched per device will be + limited by the device with the least number of multiprocessors. + + The kernels cannot make use of CUDA dynamic parallelism. + + The :py:obj:`~.CUDA_LAUNCH_PARAMS` structure is defined as: + + **View CUDA Toolkit Documentation for a C++ code example** + + where: + + - :py:obj:`~.CUDA_LAUNCH_PARAMS.function` specifies the kernel to be + launched. All functions must be identical with respect to the + compiled code. Note that you can also specify context-less kernel + :py:obj:`~.CUkernel` by querying the handle using + :py:obj:`~.cuLibraryGetKernel()` and then casting to + :py:obj:`~.CUfunction`. In this case, the context to launch the + kernel on be taken from the specified stream + :py:obj:`~.CUDA_LAUNCH_PARAMS.hStream`. + + - :py:obj:`~.CUDA_LAUNCH_PARAMS.gridDimX` is the width of the grid in + blocks. This must match across all kernels launched. + + - :py:obj:`~.CUDA_LAUNCH_PARAMS.gridDimY` is the height of the grid in + blocks. This must match across all kernels launched. + + - :py:obj:`~.CUDA_LAUNCH_PARAMS.gridDimZ` is the depth of the grid in + blocks. This must match across all kernels launched. + + - :py:obj:`~.CUDA_LAUNCH_PARAMS.blockDimX` is the X dimension of each + thread block. This must match across all kernels launched. + + - :py:obj:`~.CUDA_LAUNCH_PARAMS.blockDimX` is the Y dimension of each + thread block. This must match across all kernels launched. + + - :py:obj:`~.CUDA_LAUNCH_PARAMS.blockDimZ` is the Z dimension of each + thread block. This must match across all kernels launched. + + - :py:obj:`~.CUDA_LAUNCH_PARAMS.sharedMemBytes` is the dynamic shared- + memory size per thread block in bytes. This must match across all + kernels launched. + + - :py:obj:`~.CUDA_LAUNCH_PARAMS.hStream` is the handle to the stream to + perform the launch in. This cannot be the NULL stream or + :py:obj:`~.CU_STREAM_LEGACY` or :py:obj:`~.CU_STREAM_PER_THREAD`. The + CUDA context associated with this stream must match that associated + with :py:obj:`~.CUDA_LAUNCH_PARAMS.function`. + + - :py:obj:`~.CUDA_LAUNCH_PARAMS.kernelParams` is an array of pointers + to kernel parameters. If :py:obj:`~.CUDA_LAUNCH_PARAMS.function` has + N parameters, then :py:obj:`~.CUDA_LAUNCH_PARAMS.kernelParams` needs + to be an array of N pointers. Each of + :py:obj:`~.CUDA_LAUNCH_PARAMS.kernelParams`[0] through + :py:obj:`~.CUDA_LAUNCH_PARAMS.kernelParams`[N-1] must point to a + region of memory from which the actual kernel parameter will be + copied. The number of kernel parameters and their offsets and sizes + do not need to be specified as that information is retrieved directly + from the kernel's image. + + By default, the kernel won't begin execution on any GPU until all prior + work in all the specified streams has completed. This behavior can be + overridden by specifying the flag + :py:obj:`~.CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC`. + When this flag is specified, each kernel will only wait for prior work + in the stream corresponding to that GPU to complete before it begins + execution. + + Similarly, by default, any subsequent work pushed in any of the + specified streams will not begin execution until the kernels on all + GPUs have completed. This behavior can be overridden by specifying the + flag + :py:obj:`~.CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC`. + When this flag is specified, any subsequent work pushed in any of the + specified streams will only wait for the kernel launched on the GPU + corresponding to that stream to complete before it begins execution. + + Calling :py:obj:`~.cuLaunchCooperativeKernelMultiDevice()` sets + persistent function state that is the same as function state set + through :py:obj:`~.cuLaunchKernel` API when called individually for + each element in `launchParamsList`. + + When kernels are launched via + :py:obj:`~.cuLaunchCooperativeKernelMultiDevice()`, the previous block + shape, shared size and parameter info associated with each + :py:obj:`~.CUDA_LAUNCH_PARAMS.function` in `launchParamsList` is + overwritten. + + Note that to use :py:obj:`~.cuLaunchCooperativeKernelMultiDevice()`, + the kernels must either have been compiled with toolchain version 3.2 + or later so that it will contain kernel parameter information, or have + no kernel parameters. If either of these conditions is not met, then + :py:obj:`~.cuLaunchCooperativeKernelMultiDevice()` will return + :py:obj:`~.CUDA_ERROR_INVALID_IMAGE`. + + Parameters + ---------- + launchParamsList : list[:py:obj:`~.CUDA_LAUNCH_PARAMS`] + List of launch parameters, one per device + numDevices : unsigned int + Size of the `launchParamsList` array + flags : unsigned int + Flags to control launch behavior + + 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_INVALID_IMAGE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_LAUNCH_FAILED`, :py:obj:`~.CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES`, :py:obj:`~.CUDA_ERROR_LAUNCH_TIMEOUT`, :py:obj:`~.CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING`, :py:obj:`~.CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE`, :py:obj:`~.CUDA_ERROR_SHARED_OBJECT_INIT_FAILED` + + See Also + -------- + :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuFuncSetCacheConfig`, :py:obj:`~.cuFuncGetAttribute`, :py:obj:`~.cuLaunchCooperativeKernel`, :py:obj:`~.cudaLaunchCooperativeKernelMultiDevice` + """ + 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,]") + cdef cydriver.CUDA_LAUNCH_PARAMS* cylaunchParamsList = NULL + if len(launchParamsList) > 1: + cylaunchParamsList = calloc(len(launchParamsList), sizeof(cydriver.CUDA_LAUNCH_PARAMS)) + if cylaunchParamsList is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(launchParamsList)) + 'x' + str(sizeof(cydriver.CUDA_LAUNCH_PARAMS))) + for idx in range(len(launchParamsList)): + string.memcpy(&cylaunchParamsList[idx], (launchParamsList[idx])._pvt_ptr, sizeof(cydriver.CUDA_LAUNCH_PARAMS)) + elif len(launchParamsList) == 1: + cylaunchParamsList = (launchParamsList[0])._pvt_ptr + if numDevices > len(launchParamsList): raise RuntimeError("List is too small: " + str(len(launchParamsList)) + " < " + str(numDevices)) + with nogil: + err = cydriver.cuLaunchCooperativeKernelMultiDevice(cylaunchParamsList, numDevices, flags) + if len(launchParamsList) > 1 and cylaunchParamsList is not NULL: + free(cylaunchParamsList) + return (_CUresult(err),) @cython.embedsignature(True) def cuParamSetTexRef(hfunc, int texunit, hTexRef): @@ -44503,9 +44208,6 @@ def cuParamSetTexRef(hfunc, int texunit, hTexRef): with nogil: err = cydriver.cuParamSetTexRef(cyhfunc, texunit, cyhTexRef) return (_CUresult(err),) -{{endif}} - -{{if 'cuFuncSetSharedMemConfig' in found_functions}} @cython.embedsignature(True) def cuFuncSetSharedMemConfig(hfunc, config not None : CUsharedconfig): @@ -44576,9 +44278,6 @@ def cuFuncSetSharedMemConfig(hfunc, config not None : CUsharedconfig): with nogil: err = cydriver.cuFuncSetSharedMemConfig(cyhfunc, cyconfig) return (_CUresult(err),) -{{endif}} - -{{if 'cuGraphCreate' in found_functions}} @cython.embedsignature(True) def cuGraphCreate(unsigned int flags): @@ -44608,9 +44307,6 @@ def cuGraphCreate(unsigned int flags): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phGraph) -{{endif}} - -{{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]): @@ -44623,7 +44319,7 @@ def cuGraphAddKernelNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | li root of the graph. `dependencies` may not have any duplicate entries. A handle to the new node will be returned in `phGraphNode`. - The CUDA_KERNEL_NODE_PARAMS structure is defined as: + The :py:obj:`~.CUDA_KERNEL_NODE_PARAMS` structure is defined as: **View CUDA Toolkit Documentation for a C++ code example** @@ -44724,7 +44420,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 is not 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: @@ -44732,9 +44428,6 @@ def cuGraphAddKernelNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | li if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phGraphNode) -{{endif}} - -{{if 'cuGraphKernelNodeGetParams_v2' in found_functions}} @cython.embedsignature(True) def cuGraphKernelNodeGetParams(hNode): @@ -44781,9 +44474,6 @@ def cuGraphKernelNodeGetParams(hNode): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, nodeParams) -{{endif}} - -{{if 'cuGraphKernelNodeSetParams_v2' in found_functions}} @cython.embedsignature(True) def cuGraphKernelNodeSetParams(hNode, nodeParams : Optional[CUDA_KERNEL_NODE_PARAMS]): @@ -44815,13 +44505,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{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): @@ -44902,7 +44589,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 is not 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: @@ -44910,9 +44597,6 @@ def cuGraphAddMemcpyNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | li if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phGraphNode) -{{endif}} - -{{if 'cuGraphMemcpyNodeGetParams' in found_functions}} @cython.embedsignature(True) def cuGraphMemcpyNodeGetParams(hNode): @@ -44950,9 +44634,6 @@ def cuGraphMemcpyNodeGetParams(hNode): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, nodeParams) -{{endif}} - -{{if 'cuGraphMemcpyNodeSetParams' in found_functions}} @cython.embedsignature(True) def cuGraphMemcpyNodeSetParams(hNode, nodeParams : Optional[CUDA_MEMCPY3D]): @@ -44984,13 +44665,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{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): @@ -45061,7 +44739,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 is not 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: @@ -45069,9 +44747,6 @@ def cuGraphAddMemsetNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | li if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phGraphNode) -{{endif}} - -{{if 'cuGraphMemsetNodeGetParams' in found_functions}} @cython.embedsignature(True) def cuGraphMemsetNodeGetParams(hNode): @@ -45109,9 +44784,6 @@ def cuGraphMemsetNodeGetParams(hNode): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, nodeParams) -{{endif}} - -{{if 'cuGraphMemsetNodeSetParams' in found_functions}} @cython.embedsignature(True) def cuGraphMemsetNodeSetParams(hNode, nodeParams : Optional[CUDA_MEMSET_NODE_PARAMS]): @@ -45143,13 +44815,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{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]): @@ -45210,7 +44879,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 is not 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: @@ -45218,9 +44887,6 @@ def cuGraphAddHostNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phGraphNode) -{{endif}} - -{{if 'cuGraphHostNodeGetParams' in found_functions}} @cython.embedsignature(True) def cuGraphHostNodeGetParams(hNode): @@ -45258,9 +44924,6 @@ def cuGraphHostNodeGetParams(hNode): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, nodeParams) -{{endif}} - -{{if 'cuGraphHostNodeSetParams' in found_functions}} @cython.embedsignature(True) def cuGraphHostNodeSetParams(hNode, nodeParams : Optional[CUDA_HOST_NODE_PARAMS]): @@ -45292,13 +44955,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{if 'cuGraphAddChildGraphNode' in found_functions}} @cython.embedsignature(True) def cuGraphAddChildGraphNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, childGraph): @@ -45377,9 +45037,6 @@ def cuGraphAddChildGraphNode(hGraph, dependencies : Optional[tuple[CUgraphNode] if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phGraphNode) -{{endif}} - -{{if 'cuGraphChildGraphNodeGetGraph' in found_functions}} @cython.embedsignature(True) def cuGraphChildGraphNodeGetGraph(hNode): @@ -45422,9 +45079,6 @@ def cuGraphChildGraphNodeGetGraph(hNode): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phGraph) -{{endif}} - -{{if 'cuGraphAddEmptyNode' in found_functions}} @cython.embedsignature(True) def cuGraphAddEmptyNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies): @@ -45493,9 +45147,6 @@ def cuGraphAddEmptyNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | lis if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phGraphNode) -{{endif}} - -{{if 'cuGraphAddEventRecordNode' in found_functions}} @cython.embedsignature(True) def cuGraphAddEventRecordNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, event): @@ -45571,9 +45222,6 @@ def cuGraphAddEventRecordNode(hGraph, dependencies : Optional[tuple[CUgraphNode] if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phGraphNode) -{{endif}} - -{{if 'cuGraphEventRecordNodeGetEvent' in found_functions}} @cython.embedsignature(True) def cuGraphEventRecordNodeGetEvent(hNode): @@ -45611,9 +45259,6 @@ def cuGraphEventRecordNodeGetEvent(hNode): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, event_out) -{{endif}} - -{{if 'cuGraphEventRecordNodeSetEvent' in found_functions}} @cython.embedsignature(True) def cuGraphEventRecordNodeSetEvent(hNode, event): @@ -45656,9 +45301,6 @@ def cuGraphEventRecordNodeSetEvent(hNode, event): with nogil: err = cydriver.cuGraphEventRecordNodeSetEvent(cyhNode, cyevent) return (_CUresult(err),) -{{endif}} - -{{if 'cuGraphAddEventWaitNode' in found_functions}} @cython.embedsignature(True) def cuGraphAddEventWaitNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, event): @@ -45736,9 +45378,6 @@ def cuGraphAddEventWaitNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phGraphNode) -{{endif}} - -{{if 'cuGraphEventWaitNodeGetEvent' in found_functions}} @cython.embedsignature(True) def cuGraphEventWaitNodeGetEvent(hNode): @@ -45776,9 +45415,6 @@ def cuGraphEventWaitNodeGetEvent(hNode): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, event_out) -{{endif}} - -{{if 'cuGraphEventWaitNodeSetEvent' in found_functions}} @cython.embedsignature(True) def cuGraphEventWaitNodeSetEvent(hNode, event): @@ -45821,9 +45457,6 @@ def cuGraphEventWaitNodeSetEvent(hNode, event): with nogil: err = cydriver.cuGraphEventWaitNodeSetEvent(cyhNode, cyevent) return (_CUresult(err),) -{{endif}} - -{{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]): @@ -45885,7 +45518,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 is not 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: @@ -45893,9 +45526,6 @@ def cuGraphAddExternalSemaphoresSignalNode(hGraph, dependencies : Optional[tuple if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phGraphNode) -{{endif}} - -{{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} @cython.embedsignature(True) def cuGraphExternalSemaphoresSignalNodeGetParams(hNode): @@ -45939,9 +45569,6 @@ def cuGraphExternalSemaphoresSignalNodeGetParams(hNode): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, params_out) -{{endif}} - -{{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} @cython.embedsignature(True) def cuGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams : Optional[CUDA_EXT_SEM_SIGNAL_NODE_PARAMS]): @@ -45974,13 +45601,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{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]): @@ -46042,7 +45666,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 is not 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: @@ -46050,9 +45674,6 @@ def cuGraphAddExternalSemaphoresWaitNode(hGraph, dependencies : Optional[tuple[C if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phGraphNode) -{{endif}} - -{{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} @cython.embedsignature(True) def cuGraphExternalSemaphoresWaitNodeGetParams(hNode): @@ -46096,9 +45717,6 @@ def cuGraphExternalSemaphoresWaitNodeGetParams(hNode): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, params_out) -{{endif}} - -{{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} @cython.embedsignature(True) def cuGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams : Optional[CUDA_EXT_SEM_WAIT_NODE_PARAMS]): @@ -46131,13 +45749,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{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]): @@ -46202,7 +45817,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 is not 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: @@ -46210,9 +45825,6 @@ def cuGraphAddBatchMemOpNode(hGraph, dependencies : Optional[tuple[CUgraphNode] if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phGraphNode) -{{endif}} - -{{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}} @cython.embedsignature(True) def cuGraphBatchMemOpNodeGetParams(hNode): @@ -46255,9 +45867,6 @@ def cuGraphBatchMemOpNodeGetParams(hNode): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, nodeParams_out) -{{endif}} - -{{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}} @cython.embedsignature(True) def cuGraphBatchMemOpNodeSetParams(hNode, nodeParams : Optional[CUDA_BATCH_MEM_OP_NODE_PARAMS]): @@ -46292,13 +45901,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}} @cython.embedsignature(True) def cuGraphExecBatchMemOpNodeSetParams(hGraphExec, hNode, nodeParams : Optional[CUDA_BATCH_MEM_OP_NODE_PARAMS]): @@ -46363,13 +45969,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{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]): @@ -46471,7 +46074,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 is not 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: @@ -46479,9 +46082,6 @@ def cuGraphAddMemAllocNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phGraphNode) -{{endif}} - -{{if 'cuGraphMemAllocNodeGetParams' in found_functions}} @cython.embedsignature(True) def cuGraphMemAllocNodeGetParams(hNode): @@ -46522,9 +46122,6 @@ def cuGraphMemAllocNodeGetParams(hNode): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, params_out) -{{endif}} - -{{if 'cuGraphAddMemFreeNode' in found_functions}} @cython.embedsignature(True) def cuGraphAddMemFreeNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, dptr): @@ -46618,9 +46215,6 @@ def cuGraphAddMemFreeNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | l if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phGraphNode) -{{endif}} - -{{if 'cuGraphMemFreeNodeGetParams' in found_functions}} @cython.embedsignature(True) def cuGraphMemFreeNodeGetParams(hNode): @@ -46658,9 +46252,6 @@ def cuGraphMemFreeNodeGetParams(hNode): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, dptr_out) -{{endif}} - -{{if 'cuDeviceGraphMemTrim' in found_functions}} @cython.embedsignature(True) def cuDeviceGraphMemTrim(device): @@ -46695,9 +46286,6 @@ def cuDeviceGraphMemTrim(device): with nogil: err = cydriver.cuDeviceGraphMemTrim(cydevice) return (_CUresult(err),) -{{endif}} - -{{if 'cuDeviceGetGraphMemAttribute' in found_functions}} @cython.embedsignature(True) def cuDeviceGetGraphMemAttribute(device, attr not None : CUgraphMem_attribute): @@ -46754,9 +46342,6 @@ def cuDeviceGetGraphMemAttribute(device, attr not None : CUgraphMem_attribute): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, cyvalue.pyObj()) -{{endif}} - -{{if 'cuDeviceSetGraphMemAttribute' in found_functions}} @cython.embedsignature(True) def cuDeviceSetGraphMemAttribute(device, attr not None : CUgraphMem_attribute, value): @@ -46804,9 +46389,6 @@ def cuDeviceSetGraphMemAttribute(device, attr not None : CUgraphMem_attribute, v with nogil: err = cydriver.cuDeviceSetGraphMemAttribute(cydevice, cyattr, cyvalue_ptr) return (_CUresult(err),) -{{endif}} - -{{if 'cuGraphClone' in found_functions}} @cython.embedsignature(True) def cuGraphClone(originalGraph): @@ -46854,9 +46436,6 @@ def cuGraphClone(originalGraph): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phGraphClone) -{{endif}} - -{{if 'cuGraphNodeFindInClone' in found_functions}} @cython.embedsignature(True) def cuGraphNodeFindInClone(hOriginalNode, hClonedGraph): @@ -46911,9 +46490,6 @@ def cuGraphNodeFindInClone(hOriginalNode, hClonedGraph): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phNode) -{{endif}} - -{{if 'cuGraphNodeGetType' in found_functions}} @cython.embedsignature(True) def cuGraphNodeGetType(hNode): @@ -46951,9 +46527,6 @@ def cuGraphNodeGetType(hNode): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, CUgraphNodeType(typename)) -{{endif}} - -{{if 'cuGraphNodeGetContainingGraph' in found_functions}} @cython.embedsignature(True) def cuGraphNodeGetContainingGraph(hNode): @@ -46992,9 +46565,6 @@ def cuGraphNodeGetContainingGraph(hNode): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phGraph) -{{endif}} - -{{if 'cuGraphNodeGetLocalId' in found_functions}} @cython.embedsignature(True) def cuGraphNodeGetLocalId(hNode): @@ -47034,9 +46604,6 @@ def cuGraphNodeGetLocalId(hNode): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, nodeId) -{{endif}} - -{{if 'cuGraphNodeGetToolsId' in found_functions}} @cython.embedsignature(True) def cuGraphNodeGetToolsId(hNode): @@ -47072,9 +46639,6 @@ def cuGraphNodeGetToolsId(hNode): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, toolsNodeId) -{{endif}} - -{{if 'cuGraphGetId' in found_functions}} @cython.embedsignature(True) def cuGraphGetId(hGraph): @@ -47113,9 +46677,6 @@ def cuGraphGetId(hGraph): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, graphId) -{{endif}} - -{{if 'cuGraphExecGetId' in found_functions}} @cython.embedsignature(True) def cuGraphExecGetId(hGraphExec): @@ -47154,9 +46715,6 @@ def cuGraphExecGetId(hGraphExec): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, graphId) -{{endif}} - -{{if 'cuGraphGetNodes' in found_functions}} @cython.embedsignature(True) def cuGraphGetNodes(hGraph, size_t numNodes = 0): @@ -47207,15 +46765,14 @@ def cuGraphGetNodes(hGraph, size_t numNodes = 0): with nogil: err = cydriver.cuGraphGetNodes(cyhGraph, cynodes, &numNodes) if CUresult(err) == CUresult(0): - pynodes = [CUgraphNode(init_value=cynodes[idx]) for idx in range(_graph_length)] + pynodes = [CUgraphNode() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pynodes[idx])._pvt_ptr[0] = cynodes[idx] if cynodes is not NULL: free(cynodes) if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None) return (_CUresult_SUCCESS, pynodes, numNodes) -{{endif}} - -{{if 'cuGraphGetRootNodes' in found_functions}} @cython.embedsignature(True) def cuGraphGetRootNodes(hGraph, size_t numRootNodes = 0): @@ -47266,15 +46823,14 @@ def cuGraphGetRootNodes(hGraph, size_t numRootNodes = 0): with nogil: err = cydriver.cuGraphGetRootNodes(cyhGraph, cyrootNodes, &numRootNodes) if CUresult(err) == CUresult(0): - pyrootNodes = [CUgraphNode(init_value=cyrootNodes[idx]) for idx in range(_graph_length)] + pyrootNodes = [CUgraphNode() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyrootNodes[idx])._pvt_ptr[0] = cyrootNodes[idx] if cyrootNodes is not NULL: free(cyrootNodes) if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None) return (_CUresult_SUCCESS, pyrootNodes, numRootNodes) -{{endif}} - -{{if 'cuGraphGetEdges_v2' in found_functions}} @cython.embedsignature(True) def cuGraphGetEdges(hGraph, size_t numEdges = 0): @@ -47348,23 +46904,26 @@ def cuGraphGetEdges(hGraph, size_t numEdges = 0): with nogil: 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)] + pyfrom_ = [CUgraphNode() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyfrom_[idx])._pvt_ptr[0] = cyfrom_[idx] if cyfrom_ is not NULL: free(cyfrom_) if CUresult(err) == CUresult(0): - pyto = [CUgraphNode(init_value=cyto[idx]) for idx in range(_graph_length)] + pyto = [CUgraphNode() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyto[idx])._pvt_ptr[0] = cyto[idx] if cyto is not NULL: free(cyto) if CUresult(err) == CUresult(0): - pyedgeData = [CUgraphEdgeData(_ptr=&cyedgeData[idx]) for idx in range(_graph_length)] + pyedgeData = [CUgraphEdgeData() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyedgeData[idx])._pvt_ptr[0] = cyedgeData[idx] if cyedgeData is not NULL: free(cyedgeData) if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None, None, None) return (_CUresult_SUCCESS, pyfrom_, pyto, pyedgeData, numEdges) -{{endif}} - -{{if 'cuGraphNodeGetDependencies_v2' in found_functions}} @cython.embedsignature(True) def cuGraphNodeGetDependencies(hNode, size_t numDependencies = 0): @@ -47429,19 +46988,20 @@ def cuGraphNodeGetDependencies(hNode, size_t numDependencies = 0): with nogil: err = cydriver.cuGraphNodeGetDependencies(cyhNode, cydependencies, cyedgeData, &numDependencies) if CUresult(err) == CUresult(0): - pydependencies = [CUgraphNode(init_value=cydependencies[idx]) for idx in range(_graph_length)] + pydependencies = [CUgraphNode() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pydependencies[idx])._pvt_ptr[0] = cydependencies[idx] if cydependencies is not NULL: free(cydependencies) if CUresult(err) == CUresult(0): - pyedgeData = [CUgraphEdgeData(_ptr=&cyedgeData[idx]) for idx in range(_graph_length)] + pyedgeData = [CUgraphEdgeData() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyedgeData[idx])._pvt_ptr[0] = cyedgeData[idx] if cyedgeData is not NULL: free(cyedgeData) if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None, None) return (_CUresult_SUCCESS, pydependencies, pyedgeData, numDependencies) -{{endif}} - -{{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} @cython.embedsignature(True) def cuGraphNodeGetDependentNodes(hNode, size_t numDependentNodes = 0): @@ -47506,19 +47066,20 @@ def cuGraphNodeGetDependentNodes(hNode, size_t numDependentNodes = 0): with nogil: err = cydriver.cuGraphNodeGetDependentNodes(cyhNode, cydependentNodes, cyedgeData, &numDependentNodes) if CUresult(err) == CUresult(0): - pydependentNodes = [CUgraphNode(init_value=cydependentNodes[idx]) for idx in range(_graph_length)] + pydependentNodes = [CUgraphNode() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pydependentNodes[idx])._pvt_ptr[0] = cydependentNodes[idx] if cydependentNodes is not NULL: free(cydependentNodes) if CUresult(err) == CUresult(0): - pyedgeData = [CUgraphEdgeData(_ptr=&cyedgeData[idx]) for idx in range(_graph_length)] + pyedgeData = [CUgraphEdgeData() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyedgeData[idx])._pvt_ptr[0] = cyedgeData[idx] if cyedgeData is not NULL: free(cyedgeData) if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None, None) return (_CUresult_SUCCESS, pydependentNodes, pyedgeData, numDependentNodes) -{{endif}} - -{{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): @@ -47609,9 +47170,6 @@ def cuGraphAddDependencies(hGraph, from_ : Optional[tuple[CUgraphNode] | list[CU if len(edgeData) > 1 and cyedgeData is not NULL: free(cyedgeData) return (_CUresult(err),) -{{endif}} - -{{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): @@ -47708,9 +47266,6 @@ def cuGraphRemoveDependencies(hGraph, from_ : Optional[tuple[CUgraphNode] | list if len(edgeData) > 1 and cyedgeData is not NULL: free(cyedgeData) return (_CUresult(err),) -{{endif}} - -{{if 'cuGraphDestroyNode' in found_functions}} @cython.embedsignature(True) def cuGraphDestroyNode(hNode): @@ -47747,9 +47302,6 @@ def cuGraphDestroyNode(hNode): with nogil: err = cydriver.cuGraphDestroyNode(cyhNode) return (_CUresult(err),) -{{endif}} - -{{if 'cuGraphInstantiateWithFlags' in found_functions}} @cython.embedsignature(True) def cuGraphInstantiate(hGraph, unsigned long long flags): @@ -47852,9 +47404,6 @@ def cuGraphInstantiate(hGraph, unsigned long long flags): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phGraphExec) -{{endif}} - -{{if 'cuGraphInstantiateWithParams' in found_functions}} @cython.embedsignature(True) def cuGraphInstantiateWithParams(hGraph, instantiateParams : Optional[CUDA_GRAPH_INSTANTIATE_PARAMS]): @@ -47992,15 +47541,12 @@ 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 is not 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: return (_CUresult(err), None) return (_CUresult_SUCCESS, phGraphExec) -{{endif}} - -{{if 'cuGraphExecGetFlags' in found_functions}} @cython.embedsignature(True) def cuGraphExecGetFlags(hGraphExec): @@ -48041,9 +47587,6 @@ def cuGraphExecGetFlags(hGraphExec): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, flags) -{{endif}} - -{{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}} @cython.embedsignature(True) def cuGraphExecKernelNodeSetParams(hGraphExec, hNode, nodeParams : Optional[CUDA_KERNEL_NODE_PARAMS]): @@ -48118,13 +47661,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}} @cython.embedsignature(True) def cuGraphExecMemcpyNodeSetParams(hGraphExec, hNode, copyParams : Optional[CUDA_MEMCPY3D], ctx): @@ -48193,13 +47733,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{if 'cuGraphExecMemsetNodeSetParams' in found_functions}} @cython.embedsignature(True) def cuGraphExecMemsetNodeSetParams(hGraphExec, hNode, memsetParams : Optional[CUDA_MEMSET_NODE_PARAMS], ctx): @@ -48273,13 +47810,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{if 'cuGraphExecHostNodeSetParams' in found_functions}} @cython.embedsignature(True) def cuGraphExecHostNodeSetParams(hGraphExec, hNode, nodeParams : Optional[CUDA_HOST_NODE_PARAMS]): @@ -48328,13 +47862,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}} @cython.embedsignature(True) def cuGraphExecChildGraphNodeSetParams(hGraphExec, hNode, childGraph): @@ -48402,9 +47933,6 @@ def cuGraphExecChildGraphNodeSetParams(hGraphExec, hNode, childGraph): with nogil: err = cydriver.cuGraphExecChildGraphNodeSetParams(cyhGraphExec, cyhNode, cychildGraph) return (_CUresult(err),) -{{endif}} - -{{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}} @cython.embedsignature(True) def cuGraphExecEventRecordNodeSetEvent(hGraphExec, hNode, event): @@ -48465,9 +47993,6 @@ def cuGraphExecEventRecordNodeSetEvent(hGraphExec, hNode, event): with nogil: err = cydriver.cuGraphExecEventRecordNodeSetEvent(cyhGraphExec, cyhNode, cyevent) return (_CUresult(err),) -{{endif}} - -{{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}} @cython.embedsignature(True) def cuGraphExecEventWaitNodeSetEvent(hGraphExec, hNode, event): @@ -48528,9 +48053,6 @@ def cuGraphExecEventWaitNodeSetEvent(hGraphExec, hNode, event): with nogil: err = cydriver.cuGraphExecEventWaitNodeSetEvent(cyhGraphExec, cyhNode, cyevent) return (_CUresult(err),) -{{endif}} - -{{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} @cython.embedsignature(True) def cuGraphExecExternalSemaphoresSignalNodeSetParams(hGraphExec, hNode, nodeParams : Optional[CUDA_EXT_SEM_SIGNAL_NODE_PARAMS]): @@ -48584,13 +48106,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} @cython.embedsignature(True) def cuGraphExecExternalSemaphoresWaitNodeSetParams(hGraphExec, hNode, nodeParams : Optional[CUDA_EXT_SEM_WAIT_NODE_PARAMS]): @@ -48644,13 +48163,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{if 'cuGraphNodeSetEnabled' in found_functions}} @cython.embedsignature(True) def cuGraphNodeSetEnabled(hGraphExec, hNode, unsigned int isEnabled): @@ -48717,9 +48233,6 @@ def cuGraphNodeSetEnabled(hGraphExec, hNode, unsigned int isEnabled): with nogil: err = cydriver.cuGraphNodeSetEnabled(cyhGraphExec, cyhNode, isEnabled) return (_CUresult(err),) -{{endif}} - -{{if 'cuGraphNodeGetEnabled' in found_functions}} @cython.embedsignature(True) def cuGraphNodeGetEnabled(hGraphExec, hNode): @@ -48778,9 +48291,6 @@ def cuGraphNodeGetEnabled(hGraphExec, hNode): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, isEnabled) -{{endif}} - -{{if 'cuGraphUpload' in found_functions}} @cython.embedsignature(True) def cuGraphUpload(hGraphExec, hStream): @@ -48827,9 +48337,6 @@ def cuGraphUpload(hGraphExec, hStream): with nogil: err = cydriver.cuGraphUpload(cyhGraphExec, cyhStream) return (_CUresult(err),) -{{endif}} - -{{if 'cuGraphLaunch' in found_functions}} @cython.embedsignature(True) def cuGraphLaunch(hGraphExec, hStream): @@ -48881,9 +48388,6 @@ def cuGraphLaunch(hGraphExec, hStream): with nogil: err = cydriver.cuGraphLaunch(cyhGraphExec, cyhStream) return (_CUresult(err),) -{{endif}} - -{{if 'cuGraphExecDestroy' in found_functions}} @cython.embedsignature(True) def cuGraphExecDestroy(hGraphExec): @@ -48918,9 +48422,6 @@ def cuGraphExecDestroy(hGraphExec): with nogil: err = cydriver.cuGraphExecDestroy(cyhGraphExec) return (_CUresult(err),) -{{endif}} - -{{if 'cuGraphDestroy' in found_functions}} @cython.embedsignature(True) def cuGraphDestroy(hGraph): @@ -48953,9 +48454,6 @@ def cuGraphDestroy(hGraph): with nogil: err = cydriver.cuGraphDestroy(cyhGraph) return (_CUresult(err),) -{{endif}} - -{{if 'cuGraphExecUpdate_v2' in found_functions}} @cython.embedsignature(True) def cuGraphExecUpdate(hGraphExec, hGraph): @@ -49133,9 +48631,6 @@ def cuGraphExecUpdate(hGraphExec, hGraph): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, resultInfo) -{{endif}} - -{{if 'cuGraphKernelNodeCopyAttributes' in found_functions}} @cython.embedsignature(True) def cuGraphKernelNodeCopyAttributes(dst, src): @@ -49180,9 +48675,6 @@ def cuGraphKernelNodeCopyAttributes(dst, src): with nogil: err = cydriver.cuGraphKernelNodeCopyAttributes(cydst, cysrc) return (_CUresult(err),) -{{endif}} - -{{if 'cuGraphKernelNodeGetAttribute' in found_functions}} @cython.embedsignature(True) def cuGraphKernelNodeGetAttribute(hNode, attr not None : CUkernelNodeAttrID): @@ -49197,14 +48689,12 @@ def cuGraphKernelNodeGetAttribute(hNode, attr not None : CUkernelNodeAttrID): attr : :py:obj:`~.CUkernelNodeAttrID` - Returns ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` value_out : :py:obj:`~.CUkernelNodeAttrValue` - See Also -------- :py:obj:`~.CUaccessPolicyWindow` @@ -49224,9 +48714,6 @@ def cuGraphKernelNodeGetAttribute(hNode, attr not None : CUkernelNodeAttrID): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, value_out) -{{endif}} - -{{if 'cuGraphKernelNodeSetAttribute' in found_functions}} @cython.embedsignature(True) def cuGraphKernelNodeSetAttribute(hNode, attr not None : CUkernelNodeAttrID, value : Optional[CUkernelNodeAttrValue]): @@ -49243,7 +48730,6 @@ def cuGraphKernelNodeSetAttribute(hNode, attr not None : CUkernelNodeAttrID, val value : :py:obj:`~.CUkernelNodeAttrValue` - Returns ------- CUresult @@ -49262,13 +48748,10 @@ def cuGraphKernelNodeSetAttribute(hNode, attr not None : CUkernelNodeAttrID, val phNode = int(CUgraphNode(hNode)) cyhNode = phNode cdef cydriver.CUkernelNodeAttrID cyattr = int(attr) - cdef cydriver.CUkernelNodeAttrValue* cyvalue_ptr = value._pvt_ptr if value is not 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 (_CUresult(err),) -{{endif}} - -{{if 'cuGraphDebugDotPrint' in found_functions}} @cython.embedsignature(True) def cuGraphDebugDotPrint(hGraph, char* path, unsigned int flags): @@ -49287,8 +48770,8 @@ def cuGraphDebugDotPrint(hGraph, char* path, unsigned int flags): path : bytes The path to write the DOT file to flags : unsigned int - Flags from CUgraphDebugDot_flags for specifying which additional - node information to write + Flags from :py:obj:`~.CUgraphDebugDot_flags` for specifying which + additional node information to write Returns ------- @@ -49306,9 +48789,6 @@ def cuGraphDebugDotPrint(hGraph, char* path, unsigned int flags): with nogil: err = cydriver.cuGraphDebugDotPrint(cyhGraph, path, flags) return (_CUresult(err),) -{{endif}} - -{{if 'cuUserObjectCreate' in found_functions}} @cython.embedsignature(True) def cuUserObjectCreate(ptr, destroy, unsigned int initialRefcount, unsigned int flags): @@ -49369,9 +48849,6 @@ def cuUserObjectCreate(ptr, destroy, unsigned int initialRefcount, unsigned int if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, object_out) -{{endif}} - -{{if 'cuUserObjectRetain' in found_functions}} @cython.embedsignature(True) def cuUserObjectRetain(object, unsigned int count): @@ -49411,9 +48888,6 @@ def cuUserObjectRetain(object, unsigned int count): with nogil: err = cydriver.cuUserObjectRetain(cyobject, count) return (_CUresult(err),) -{{endif}} - -{{if 'cuUserObjectRelease' in found_functions}} @cython.embedsignature(True) def cuUserObjectRelease(object, unsigned int count): @@ -49456,9 +48930,6 @@ def cuUserObjectRelease(object, unsigned int count): with nogil: err = cydriver.cuUserObjectRelease(cyobject, count) return (_CUresult(err),) -{{endif}} - -{{if 'cuGraphRetainUserObject' in found_functions}} @cython.embedsignature(True) def cuGraphRetainUserObject(graph, object, unsigned int count, unsigned int flags): @@ -49512,9 +48983,6 @@ def cuGraphRetainUserObject(graph, object, unsigned int count, unsigned int flag with nogil: err = cydriver.cuGraphRetainUserObject(cygraph, cyobject, count, flags) return (_CUresult(err),) -{{endif}} - -{{if 'cuGraphReleaseUserObject' in found_functions}} @cython.embedsignature(True) def cuGraphReleaseUserObject(graph, object, unsigned int count): @@ -49563,9 +49031,6 @@ def cuGraphReleaseUserObject(graph, object, unsigned int count): with nogil: err = cydriver.cuGraphReleaseUserObject(cygraph, cyobject, count) return (_CUresult(err),) -{{endif}} - -{{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]): @@ -49649,7 +49114,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 is not 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: @@ -49659,9 +49124,6 @@ def cuGraphAddNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUg if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phGraphNode) -{{endif}} - -{{if 'cuGraphNodeSetParams' in found_functions}} @cython.embedsignature(True) def cuGraphNodeSetParams(hNode, nodeParams : Optional[CUgraphNodeParams]): @@ -49699,13 +49161,10 @@ def cuGraphNodeSetParams(hNode, nodeParams : Optional[CUgraphNodeParams]): else: phNode = int(CUgraphNode(hNode)) cyhNode = phNode - cdef cydriver.CUgraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not 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 (_CUresult(err),) -{{endif}} - -{{if 'cuGraphNodeGetParams' in found_functions}} @cython.embedsignature(True) def cuGraphNodeGetParams(hNode): @@ -49756,9 +49215,6 @@ def cuGraphNodeGetParams(hNode): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, nodeParams) -{{endif}} - -{{if 'cuGraphExecNodeSetParams' in found_functions}} @cython.embedsignature(True) def cuGraphExecNodeSetParams(hGraphExec, hNode, nodeParams : Optional[CUgraphNodeParams]): @@ -49812,13 +49268,10 @@ def cuGraphExecNodeSetParams(hGraphExec, hNode, nodeParams : Optional[CUgraphNod else: phGraphExec = int(CUgraphExec(hGraphExec)) cyhGraphExec = phGraphExec - cdef cydriver.CUgraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not 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 (_CUresult(err),) -{{endif}} - -{{if 'cuGraphConditionalHandleCreate' in found_functions}} @cython.embedsignature(True) def cuGraphConditionalHandleCreate(hGraph, ctx, unsigned int defaultLaunchValue, unsigned int flags): @@ -49881,9 +49334,6 @@ def cuGraphConditionalHandleCreate(hGraph, ctx, unsigned int defaultLaunchValue, if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pHandle_out) -{{endif}} - -{{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} @cython.embedsignature(True) def cuOccupancyMaxActiveBlocksPerMultiprocessor(func, int blockSize, size_t dynamicSMemSize): @@ -49932,9 +49382,6 @@ def cuOccupancyMaxActiveBlocksPerMultiprocessor(func, int blockSize, size_t dyna if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, numBlocks) -{{endif}} - -{{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} @cython.embedsignature(True) def cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(func, int blockSize, size_t dynamicSMemSize, unsigned int flags): @@ -50001,9 +49448,6 @@ def cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(func, int blockSize, si if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, numBlocks) -{{endif}} - -{{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}} @cython.embedsignature(True) def cuOccupancyMaxPotentialBlockSize(func, blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit): @@ -50088,9 +49532,6 @@ def cuOccupancyMaxPotentialBlockSize(func, blockSizeToDynamicSMemSize, size_t dy if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None) return (_CUresult_SUCCESS, minGridSize, blockSize) -{{endif}} - -{{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}} @cython.embedsignature(True) def cuOccupancyMaxPotentialBlockSizeWithFlags(func, blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit, unsigned int flags): @@ -50174,9 +49615,6 @@ def cuOccupancyMaxPotentialBlockSizeWithFlags(func, blockSizeToDynamicSMemSize, if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None) return (_CUresult_SUCCESS, minGridSize, blockSize) -{{endif}} - -{{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}} @cython.embedsignature(True) def cuOccupancyAvailableDynamicSMemPerBlock(func, int numBlocks, int blockSize): @@ -50221,9 +49659,6 @@ def cuOccupancyAvailableDynamicSMemPerBlock(func, int numBlocks, int blockSize): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, dynamicSmemSize) -{{endif}} - -{{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}} @cython.embedsignature(True) def cuOccupancyMaxPotentialClusterSize(func, config : Optional[CUlaunchConfig]): @@ -50275,15 +49710,12 @@ 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 is not 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: return (_CUresult(err), None) return (_CUresult_SUCCESS, clusterSize) -{{endif}} - -{{if 'cuOccupancyMaxActiveClusters' in found_functions}} @cython.embedsignature(True) def cuOccupancyMaxActiveClusters(func, config : Optional[CUlaunchConfig]): @@ -50335,15 +49767,12 @@ 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 is not 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: return (_CUresult(err), None) return (_CUresult_SUCCESS, numClusters) -{{endif}} - -{{if 'cuTexRefSetArray' in found_functions}} @cython.embedsignature(True) def cuTexRefSetArray(hTexRef, hArray, unsigned int Flags): @@ -50394,9 +49823,6 @@ def cuTexRefSetArray(hTexRef, hArray, unsigned int Flags): with nogil: err = cydriver.cuTexRefSetArray(cyhTexRef, cyhArray, Flags) return (_CUresult(err),) -{{endif}} - -{{if 'cuTexRefSetMipmappedArray' in found_functions}} @cython.embedsignature(True) def cuTexRefSetMipmappedArray(hTexRef, hMipmappedArray, unsigned int Flags): @@ -50447,9 +49873,6 @@ def cuTexRefSetMipmappedArray(hTexRef, hMipmappedArray, unsigned int Flags): with nogil: err = cydriver.cuTexRefSetMipmappedArray(cyhTexRef, cyhMipmappedArray, Flags) return (_CUresult(err),) -{{endif}} - -{{if 'cuTexRefSetAddress_v2' in found_functions}} @cython.embedsignature(True) def cuTexRefSetAddress(hTexRef, dptr, size_t numbytes): @@ -50522,9 +49945,6 @@ def cuTexRefSetAddress(hTexRef, dptr, size_t numbytes): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, ByteOffset) -{{endif}} - -{{if 'cuTexRefSetAddress2D_v3' in found_functions}} @cython.embedsignature(True) def cuTexRefSetAddress2D(hTexRef, desc : Optional[CUDA_ARRAY_DESCRIPTOR], dptr, size_t Pitch): @@ -50599,13 +50019,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{if 'cuTexRefSetFormat' in found_functions}} @cython.embedsignature(True) def cuTexRefSetFormat(hTexRef, fmt not None : CUarray_format, int NumPackedComponents): @@ -50649,9 +50066,6 @@ def cuTexRefSetFormat(hTexRef, fmt not None : CUarray_format, int NumPackedCompo with nogil: err = cydriver.cuTexRefSetFormat(cyhTexRef, cyfmt, NumPackedComponents) return (_CUresult(err),) -{{endif}} - -{{if 'cuTexRefSetAddressMode' in found_functions}} @cython.embedsignature(True) def cuTexRefSetAddressMode(hTexRef, int dim, am not None : CUaddress_mode): @@ -50702,9 +50116,6 @@ def cuTexRefSetAddressMode(hTexRef, int dim, am not None : CUaddress_mode): with nogil: err = cydriver.cuTexRefSetAddressMode(cyhTexRef, dim, cyam) return (_CUresult(err),) -{{endif}} - -{{if 'cuTexRefSetFilterMode' in found_functions}} @cython.embedsignature(True) def cuTexRefSetFilterMode(hTexRef, fm not None : CUfilter_mode): @@ -50749,9 +50160,6 @@ def cuTexRefSetFilterMode(hTexRef, fm not None : CUfilter_mode): with nogil: err = cydriver.cuTexRefSetFilterMode(cyhTexRef, cyfm) return (_CUresult(err),) -{{endif}} - -{{if 'cuTexRefSetMipmapFilterMode' in found_functions}} @cython.embedsignature(True) def cuTexRefSetMipmapFilterMode(hTexRef, fm not None : CUfilter_mode): @@ -50796,9 +50204,6 @@ def cuTexRefSetMipmapFilterMode(hTexRef, fm not None : CUfilter_mode): with nogil: err = cydriver.cuTexRefSetMipmapFilterMode(cyhTexRef, cyfm) return (_CUresult(err),) -{{endif}} - -{{if 'cuTexRefSetMipmapLevelBias' in found_functions}} @cython.embedsignature(True) def cuTexRefSetMipmapLevelBias(hTexRef, float bias): @@ -50840,9 +50245,6 @@ def cuTexRefSetMipmapLevelBias(hTexRef, float bias): with nogil: err = cydriver.cuTexRefSetMipmapLevelBias(cyhTexRef, bias) return (_CUresult(err),) -{{endif}} - -{{if 'cuTexRefSetMipmapLevelClamp' in found_functions}} @cython.embedsignature(True) def cuTexRefSetMipmapLevelClamp(hTexRef, float minMipmapLevelClamp, float maxMipmapLevelClamp): @@ -50886,9 +50288,6 @@ def cuTexRefSetMipmapLevelClamp(hTexRef, float minMipmapLevelClamp, float maxMip with nogil: err = cydriver.cuTexRefSetMipmapLevelClamp(cyhTexRef, minMipmapLevelClamp, maxMipmapLevelClamp) return (_CUresult(err),) -{{endif}} - -{{if 'cuTexRefSetMaxAnisotropy' in found_functions}} @cython.embedsignature(True) def cuTexRefSetMaxAnisotropy(hTexRef, unsigned int maxAniso): @@ -50929,9 +50328,6 @@ def cuTexRefSetMaxAnisotropy(hTexRef, unsigned int maxAniso): with nogil: err = cydriver.cuTexRefSetMaxAnisotropy(cyhTexRef, maxAniso) return (_CUresult(err),) -{{endif}} - -{{if 'cuTexRefSetBorderColor' in found_functions}} @cython.embedsignature(True) def cuTexRefSetBorderColor(hTexRef, float pBorderColor): @@ -50977,9 +50373,6 @@ def cuTexRefSetBorderColor(hTexRef, float pBorderColor): with nogil: err = cydriver.cuTexRefSetBorderColor(cyhTexRef, &pBorderColor) return (_CUresult(err),) -{{endif}} - -{{if 'cuTexRefSetFlags' in found_functions}} @cython.embedsignature(True) def cuTexRefSetFlags(hTexRef, unsigned int Flags): @@ -51035,9 +50428,6 @@ def cuTexRefSetFlags(hTexRef, unsigned int Flags): with nogil: err = cydriver.cuTexRefSetFlags(cyhTexRef, Flags) return (_CUresult(err),) -{{endif}} - -{{if 'cuTexRefGetAddress_v2' in found_functions}} @cython.embedsignature(True) def cuTexRefGetAddress(hTexRef): @@ -51079,9 +50469,6 @@ def cuTexRefGetAddress(hTexRef): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pdptr) -{{endif}} - -{{if 'cuTexRefGetArray' in found_functions}} @cython.embedsignature(True) def cuTexRefGetArray(hTexRef): @@ -51123,9 +50510,6 @@ def cuTexRefGetArray(hTexRef): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phArray) -{{endif}} - -{{if 'cuTexRefGetMipmappedArray' in found_functions}} @cython.embedsignature(True) def cuTexRefGetMipmappedArray(hTexRef): @@ -51168,9 +50552,6 @@ def cuTexRefGetMipmappedArray(hTexRef): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phMipmappedArray) -{{endif}} - -{{if 'cuTexRefGetAddressMode' in found_functions}} @cython.embedsignature(True) def cuTexRefGetAddressMode(hTexRef, int dim): @@ -51214,9 +50595,6 @@ def cuTexRefGetAddressMode(hTexRef, int dim): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, CUaddress_mode(pam)) -{{endif}} - -{{if 'cuTexRefGetFilterMode' in found_functions}} @cython.embedsignature(True) def cuTexRefGetFilterMode(hTexRef): @@ -51257,9 +50635,6 @@ def cuTexRefGetFilterMode(hTexRef): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, CUfilter_mode(pfm)) -{{endif}} - -{{if 'cuTexRefGetFormat' in found_functions}} @cython.embedsignature(True) def cuTexRefGetFormat(hTexRef): @@ -51304,9 +50679,6 @@ def cuTexRefGetFormat(hTexRef): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None) return (_CUresult_SUCCESS, CUarray_format(pFormat), pNumChannels) -{{endif}} - -{{if 'cuTexRefGetMipmapFilterMode' in found_functions}} @cython.embedsignature(True) def cuTexRefGetMipmapFilterMode(hTexRef): @@ -51347,9 +50719,6 @@ def cuTexRefGetMipmapFilterMode(hTexRef): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, CUfilter_mode(pfm)) -{{endif}} - -{{if 'cuTexRefGetMipmapLevelBias' in found_functions}} @cython.embedsignature(True) def cuTexRefGetMipmapLevelBias(hTexRef): @@ -51391,9 +50760,6 @@ def cuTexRefGetMipmapLevelBias(hTexRef): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pbias) -{{endif}} - -{{if 'cuTexRefGetMipmapLevelClamp' in found_functions}} @cython.embedsignature(True) def cuTexRefGetMipmapLevelClamp(hTexRef): @@ -51438,9 +50804,6 @@ def cuTexRefGetMipmapLevelClamp(hTexRef): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None) return (_CUresult_SUCCESS, pminMipmapLevelClamp, pmaxMipmapLevelClamp) -{{endif}} - -{{if 'cuTexRefGetMaxAnisotropy' in found_functions}} @cython.embedsignature(True) def cuTexRefGetMaxAnisotropy(hTexRef): @@ -51481,9 +50844,6 @@ def cuTexRefGetMaxAnisotropy(hTexRef): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pmaxAniso) -{{endif}} - -{{if 'cuTexRefGetBorderColor' in found_functions}} @cython.embedsignature(True) def cuTexRefGetBorderColor(hTexRef): @@ -51527,9 +50887,6 @@ def cuTexRefGetBorderColor(hTexRef): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pBorderColor) -{{endif}} - -{{if 'cuTexRefGetFlags' in found_functions}} @cython.embedsignature(True) def cuTexRefGetFlags(hTexRef): @@ -51569,9 +50926,6 @@ def cuTexRefGetFlags(hTexRef): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pFlags) -{{endif}} - -{{if 'cuTexRefCreate' in found_functions}} @cython.embedsignature(True) def cuTexRefCreate(): @@ -51603,9 +50957,6 @@ def cuTexRefCreate(): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pTexRef) -{{endif}} - -{{if 'cuTexRefDestroy' in found_functions}} @cython.embedsignature(True) def cuTexRefDestroy(hTexRef): @@ -51640,9 +50991,6 @@ def cuTexRefDestroy(hTexRef): with nogil: err = cydriver.cuTexRefDestroy(cyhTexRef) return (_CUresult(err),) -{{endif}} - -{{if 'cuSurfRefSetArray' in found_functions}} @cython.embedsignature(True) def cuSurfRefSetArray(hSurfRef, hArray, unsigned int Flags): @@ -51694,9 +51042,6 @@ def cuSurfRefSetArray(hSurfRef, hArray, unsigned int Flags): with nogil: err = cydriver.cuSurfRefSetArray(cyhSurfRef, cyhArray, Flags) return (_CUresult(err),) -{{endif}} - -{{if 'cuSurfRefGetArray' in found_functions}} @cython.embedsignature(True) def cuSurfRefGetArray(hSurfRef): @@ -51738,9 +51083,6 @@ def cuSurfRefGetArray(hSurfRef): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phArray) -{{endif}} - -{{if 'cuTexObjectCreate' in found_functions}} @cython.embedsignature(True) def cuTexObjectCreate(pResDesc : Optional[CUDA_RESOURCE_DESC], pTexDesc : Optional[CUDA_TEXTURE_DESC], pResViewDesc : Optional[CUDA_RESOURCE_VIEW_DESC]): @@ -51772,23 +51114,23 @@ def cuTexObjectCreate(pResDesc : Optional[CUDA_RESOURCE_DESC], pTexDesc : Option If :py:obj:`~.CUDA_RESOURCE_DESC.resType` is set to :py:obj:`~.CU_RESOURCE_TYPE_ARRAY`, - :py:obj:`~.CUDA_RESOURCE_DESC`::res::array::hArray must be set to a - valid CUDA array handle. + :py:obj:`~.CUDA_RESOURCE_DESC.res.array.hArray` must be set to a valid + CUDA array handle. If :py:obj:`~.CUDA_RESOURCE_DESC.resType` is set to :py:obj:`~.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY`, - :py:obj:`~.CUDA_RESOURCE_DESC`::res::mipmap::hMipmappedArray must be - set to a valid CUDA mipmapped array handle. + :py:obj:`~.CUDA_RESOURCE_DESC.res.mipmap.hMipmappedArray` must be set + to a valid CUDA mipmapped array handle. If :py:obj:`~.CUDA_RESOURCE_DESC.resType` is set to :py:obj:`~.CU_RESOURCE_TYPE_LINEAR`, - :py:obj:`~.CUDA_RESOURCE_DESC`::res::linear::devPtr must be set to a - valid device pointer, that is aligned to + :py:obj:`~.CUDA_RESOURCE_DESC.res.linear.devPtr` must be set to a valid + device pointer, that is aligned to :py:obj:`~.CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT`. - :py:obj:`~.CUDA_RESOURCE_DESC`::res::linear::format and - :py:obj:`~.CUDA_RESOURCE_DESC`::res::linear::numChannels describe the + :py:obj:`~.CUDA_RESOURCE_DESC.res.linear.format` and + :py:obj:`~.CUDA_RESOURCE_DESC.res.linear.numChannels` describe the format of each component and the number of components per array - element. :py:obj:`~.CUDA_RESOURCE_DESC`::res::linear::sizeInBytes + element. :py:obj:`~.CUDA_RESOURCE_DESC.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:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH`. The @@ -51797,20 +51139,19 @@ def cuTexObjectCreate(pResDesc : Optional[CUDA_RESOURCE_DESC], pTexDesc : Option If :py:obj:`~.CUDA_RESOURCE_DESC.resType` is set to :py:obj:`~.CU_RESOURCE_TYPE_PITCH2D`, - :py:obj:`~.CUDA_RESOURCE_DESC`::res::pitch2D::devPtr must be set to a + :py:obj:`~.CUDA_RESOURCE_DESC.res.pitch2D.devPtr` must be set to a valid device pointer, that is aligned to :py:obj:`~.CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT`. - :py:obj:`~.CUDA_RESOURCE_DESC`::res::pitch2D::format and - :py:obj:`~.CUDA_RESOURCE_DESC`::res::pitch2D::numChannels describe the + :py:obj:`~.CUDA_RESOURCE_DESC.res.pitch2D.format` and + :py:obj:`~.CUDA_RESOURCE_DESC.res.pitch2D.numChannels` describe the format of each component and the number of components per array - element. :py:obj:`~.CUDA_RESOURCE_DESC`::res::pitch2D::width and - :py:obj:`~.CUDA_RESOURCE_DESC`::res::pitch2D::height specify the width - and height of the array in elements, and cannot exceed + element. :py:obj:`~.CUDA_RESOURCE_DESC.res.pitch2D.width` and + :py:obj:`~.CUDA_RESOURCE_DESC.res.pitch2D.height` specify the width and + height of the array in elements, and cannot exceed :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH` and :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT` - respectively. - :py:obj:`~.CUDA_RESOURCE_DESC`::res::pitch2D::pitchInBytes specifies - the pitch between two rows in bytes and has to be aligned to + respectively. :py:obj:`~.CUDA_RESOURCE_DESC.res.pitch2D.pitchInBytes` + specifies the pitch between two rows in bytes and has to be aligned to :py:obj:`~.CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT`. Pitch cannot exceed :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH`. @@ -51834,8 +51175,8 @@ def cuTexObjectCreate(pResDesc : Optional[CUDA_RESOURCE_DESC], pTexDesc : Option supported address mode is :py:obj:`~.CU_TR_ADDRESS_MODE_CLAMP`. - :py:obj:`~.CUDA_TEXTURE_DESC.filterMode` specifies the filtering mode - to be used when fetching from the texture. CUfilter_mode is defined - as: + to be used when fetching from the texture. :py:obj:`~.CUfilter_mode` + is defined as: - **View CUDA Toolkit Documentation for a C++ code example** @@ -51970,17 +51311,14 @@ 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 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 + 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: return (_CUresult(err), None) return (_CUresult_SUCCESS, pTexObject) -{{endif}} - -{{if 'cuTexObjectDestroy' in found_functions}} @cython.embedsignature(True) def cuTexObjectDestroy(texObject): @@ -52013,9 +51351,6 @@ def cuTexObjectDestroy(texObject): with nogil: err = cydriver.cuTexObjectDestroy(cytexObject) return (_CUresult(err),) -{{endif}} - -{{if 'cuTexObjectGetResourceDesc' in found_functions}} @cython.embedsignature(True) def cuTexObjectGetResourceDesc(texObject): @@ -52054,9 +51389,6 @@ def cuTexObjectGetResourceDesc(texObject): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pResDesc) -{{endif}} - -{{if 'cuTexObjectGetTextureDesc' in found_functions}} @cython.embedsignature(True) def cuTexObjectGetTextureDesc(texObject): @@ -52095,9 +51427,6 @@ def cuTexObjectGetTextureDesc(texObject): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pTexDesc) -{{endif}} - -{{if 'cuTexObjectGetResourceViewDesc' in found_functions}} @cython.embedsignature(True) def cuTexObjectGetResourceViewDesc(texObject): @@ -52137,9 +51466,6 @@ def cuTexObjectGetResourceViewDesc(texObject): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pResViewDesc) -{{endif}} - -{{if 'cuSurfObjectCreate' in found_functions}} @cython.embedsignature(True) def cuSurfObjectCreate(pResDesc : Optional[CUDA_RESOURCE_DESC]): @@ -52149,9 +51475,9 @@ def cuSurfObjectCreate(pResDesc : Optional[CUDA_RESOURCE_DESC]): describes the data to perform surface load/stores on. :py:obj:`~.CUDA_RESOURCE_DESC.resType` must be :py:obj:`~.CU_RESOURCE_TYPE_ARRAY` and - :py:obj:`~.CUDA_RESOURCE_DESC`::res::array::hArray must be set to a - valid CUDA array handle. :py:obj:`~.CUDA_RESOURCE_DESC.flags` must be - set to zero. + :py:obj:`~.CUDA_RESOURCE_DESC.res.array.hArray` must be set to a valid + CUDA array handle. :py:obj:`~.CUDA_RESOURCE_DESC.flags` must be set to + zero. Surface objects are only supported on devices of compute capability 3.0 or higher. Additionally, a surface object is an opaque value, and, as @@ -52174,15 +51500,12 @@ 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 is not 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: return (_CUresult(err), None) return (_CUresult_SUCCESS, pSurfObject) -{{endif}} - -{{if 'cuSurfObjectDestroy' in found_functions}} @cython.embedsignature(True) def cuSurfObjectDestroy(surfObject): @@ -52215,9 +51538,6 @@ def cuSurfObjectDestroy(surfObject): with nogil: err = cydriver.cuSurfObjectDestroy(cysurfObject) return (_CUresult(err),) -{{endif}} - -{{if 'cuSurfObjectGetResourceDesc' in found_functions}} @cython.embedsignature(True) def cuSurfObjectGetResourceDesc(surfObject): @@ -52256,9 +51576,6 @@ def cuSurfObjectGetResourceDesc(surfObject): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pResDesc) -{{endif}} - -{{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): @@ -52564,9 +51881,6 @@ def cuTensorMapEncodeTiled(tensorDataType not None : CUtensorMapDataType, tensor if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, tensorMap) -{{endif}} - -{{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): @@ -52909,9 +52223,6 @@ def cuTensorMapEncodeIm2col(tensorDataType not None : CUtensorMapDataType, tenso if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, tensorMap) -{{endif}} - -{{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): @@ -53239,9 +52550,6 @@ def cuTensorMapEncodeIm2colWide(tensorDataType not None : CUtensorMapDataType, t if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, tensorMap) -{{endif}} - -{{if 'cuTensorMapReplaceAddress' in found_functions}} @cython.embedsignature(True) def cuTensorMapReplaceAddress(tensorMap : Optional[CUtensorMap], globalAddress): @@ -53271,16 +52579,13 @@ 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 is not None else NULL + cdef cydriver.CUtensorMap* cytensorMap_ptr = tensorMap._pvt_ptr if tensorMap is not None else NULL cdef _HelperInputVoidPtrStruct cyglobalAddressHelper cdef void* cyglobalAddress = _helper_input_void_ptr(globalAddress, &cyglobalAddressHelper) with nogil: err = cydriver.cuTensorMapReplaceAddress(cytensorMap_ptr, cyglobalAddress) _helper_input_void_ptr_free(&cyglobalAddressHelper) return (_CUresult(err),) -{{endif}} - -{{if 'cuDeviceCanAccessPeer' in found_functions}} @cython.embedsignature(True) def cuDeviceCanAccessPeer(dev, peerDev): @@ -53334,9 +52639,6 @@ def cuDeviceCanAccessPeer(dev, peerDev): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, canAccessPeer) -{{endif}} - -{{if 'cuCtxEnablePeerAccess' in found_functions}} @cython.embedsignature(True) def cuCtxEnablePeerAccess(peerContext, unsigned int Flags): @@ -53404,9 +52706,6 @@ def cuCtxEnablePeerAccess(peerContext, unsigned int Flags): with nogil: err = cydriver.cuCtxEnablePeerAccess(cypeerContext, Flags) return (_CUresult(err),) -{{endif}} - -{{if 'cuCtxDisablePeerAccess' in found_functions}} @cython.embedsignature(True) def cuCtxDisablePeerAccess(peerContext): @@ -53444,9 +52743,6 @@ def cuCtxDisablePeerAccess(peerContext): with nogil: err = cydriver.cuCtxDisablePeerAccess(cypeerContext) return (_CUresult(err),) -{{endif}} - -{{if 'cuDeviceGetP2PAttribute' in found_functions}} @cython.embedsignature(True) def cuDeviceGetP2PAttribute(attrib not None : CUdevice_P2PAttribute, srcDevice, dstDevice): @@ -53523,9 +52819,6 @@ def cuDeviceGetP2PAttribute(attrib not None : CUdevice_P2PAttribute, srcDevice, if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, value) -{{endif}} - -{{if 'cuDeviceGetP2PAtomicCapabilities' in found_functions}} @cython.embedsignature(True) def cuDeviceGetP2PAtomicCapabilities(operations : Optional[tuple[CUatomicOperation] | list[CUatomicOperation]], unsigned int count, srcDevice, dstDevice): @@ -53606,9 +52899,6 @@ def cuDeviceGetP2PAtomicCapabilities(operations : Optional[tuple[CUatomicOperati if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pycapabilities) -{{endif}} - -{{if 'cuGraphicsUnregisterResource' in found_functions}} @cython.embedsignature(True) def cuGraphicsUnregisterResource(resource): @@ -53645,9 +52935,6 @@ def cuGraphicsUnregisterResource(resource): with nogil: err = cydriver.cuGraphicsUnregisterResource(cyresource) return (_CUresult(err),) -{{endif}} - -{{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}} @cython.embedsignature(True) def cuGraphicsSubResourceGetMappedArray(resource, unsigned int arrayIndex, unsigned int mipLevel): @@ -53703,9 +52990,6 @@ def cuGraphicsSubResourceGetMappedArray(resource, unsigned int arrayIndex, unsig if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pArray) -{{endif}} - -{{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}} @cython.embedsignature(True) def cuGraphicsResourceGetMappedMipmappedArray(resource): @@ -53750,9 +53034,6 @@ def cuGraphicsResourceGetMappedMipmappedArray(resource): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pMipmappedArray) -{{endif}} - -{{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}} @cython.embedsignature(True) def cuGraphicsResourceGetMappedPointer(resource): @@ -53797,9 +53078,6 @@ def cuGraphicsResourceGetMappedPointer(resource): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None) return (_CUresult_SUCCESS, pDevPtr, pSize) -{{endif}} - -{{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}} @cython.embedsignature(True) def cuGraphicsResourceSetMapFlags(resource, unsigned int flags): @@ -53856,9 +53134,6 @@ def cuGraphicsResourceSetMapFlags(resource, unsigned int flags): with nogil: err = cydriver.cuGraphicsResourceSetMapFlags(cyresource, flags) return (_CUresult(err),) -{{endif}} - -{{if 'cuGraphicsMapResources' in found_functions}} @cython.embedsignature(True) def cuGraphicsMapResources(unsigned int count, resources, hStream): @@ -53919,9 +53194,6 @@ def cuGraphicsMapResources(unsigned int count, resources, hStream): with nogil: err = cydriver.cuGraphicsMapResources(count, cyresources, cyhStream) return (_CUresult(err),) -{{endif}} - -{{if 'cuGraphicsUnmapResources' in found_functions}} @cython.embedsignature(True) def cuGraphicsUnmapResources(unsigned int count, resources, hStream): @@ -53980,9 +53252,6 @@ def cuGraphicsUnmapResources(unsigned int count, resources, hStream): with nogil: err = cydriver.cuGraphicsUnmapResources(count, cyresources, cyhStream) return (_CUresult(err),) -{{endif}} - -{{if 'cuGetProcAddress_v2' in found_functions}} @cython.embedsignature(True) def cuGetProcAddress(char* symbol, int cudaVersion, flags): @@ -54086,9 +53355,6 @@ def cuGetProcAddress(char* symbol, int cudaVersion, flags): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None) return (_CUresult_SUCCESS, pfn, CUdriverProcAddressQueryResult(symbolStatus)) -{{endif}} - -{{if 'cuCoredumpGetAttribute' in found_functions}} @cython.embedsignature(True) def cuCoredumpGetAttribute(attrib not None : CUcoredumpSettings): @@ -54177,6 +53443,28 @@ def cuCoredumpGetAttribute(attrib not None : CUcoredumpSettings): as :py:obj:`~.CU_COREDUMP_TRIGGER_HOST` but better reflects the default behavior. + - :py:obj:`~.CU_COREDUMP_SKIP_CONSTBANK_MEMORY` - Coredump will not + include constbank memory. + + - :py:obj:`~.CU_COREDUMP_GZIP_COMPRESS` - The generated coredump will + be compressed with gzip, and .gz suffix will be appended to the + filename, if it's not a part of it already. + + - :py:obj:`~.CU_COREDUMP_FAULTED_CONTEXTS_ONLY` - The coredump will + only include contexts that have encountered an exception or a trap. + + - :py:obj:`~.CU_COREDUMP_NO_ERRBAR_AT_EXIT` - By default, when + coredumps are requested, the GPU will ensure memory faults and + other errors prevent warps from exiting, if possible. This can + potentially affect the performance of the application. Setting this + flag will disable this functionality, making it possible for + faulted warps to exit, but also avoiding the potential performance + hit. + + - :py:obj:`~.CU_COREDUMP_LOG_ONLY` - Setting this flag will disable + actual generation of the coredump file, but exception details will + still be logged. + Parameters ---------- attrib : :py:obj:`~.CUcoredumpSettings` @@ -54206,9 +53494,6 @@ def cuCoredumpGetAttribute(attrib not None : CUcoredumpSettings): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, cyvalue.pyObj()) -{{endif}} - -{{if 'cuCoredumpGetAttributeGlobal' in found_functions}} @cython.embedsignature(True) def cuCoredumpGetAttributeGlobal(attrib not None : CUcoredumpSettings): @@ -54256,7 +53541,298 @@ def cuCoredumpGetAttributeGlobal(attrib not None : CUcoredumpSettings): - :py:obj:`~.CU_COREDUMP_PIPE`: String of up to 1023 characters that defines the name of the pipe that will be monitored if user-triggered - coredumps are enabled. The default value is + coredumps are enabled. The default value is + :py:obj:`~.corepipe`.cuda.HOSTNAME.PID where :py:obj:`~.HOSTNAME` is + the host name of the machine running the CUDA application and + :py:obj:`~.PID` is the process ID of the CUDA application. + + - :py:obj:`~.CU_COREDUMP_GENERATION_FLAGS`: An integer with values to + allow granular control the data contained in a coredump specified as + a bitwise OR combination of the following values: + + - :py:obj:`~.CU_COREDUMP_DEFAULT_FLAGS` - if set by itself, coredump + generation returns to its default settings of including all memory + regions that it is able to access + + - :py:obj:`~.CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES` - Coredump + will not include the data from CUDA source modules that are not + relocated at runtime. + + - :py:obj:`~.CU_COREDUMP_SKIP_GLOBAL_MEMORY` - Coredump will not + include device-side global data that does not belong to any + context. + + - :py:obj:`~.CU_COREDUMP_SKIP_SHARED_MEMORY` - Coredump will not + include grid-scale shared memory for the warp that the dumped + kernel belonged to. + + - :py:obj:`~.CU_COREDUMP_SKIP_LOCAL_MEMORY` - Coredump will not + include local memory from the kernel. + + - :py:obj:`~.CU_COREDUMP_LIGHTWEIGHT_FLAGS` - Enables all of the + above options. Equiavlent to setting the + :py:obj:`~.CU_COREDUMP_LIGHTWEIGHT` attribute to :py:obj:`~.true`. + + - :py:obj:`~.CU_COREDUMP_SKIP_ABORT` - If set, GPU exceptions will + not raise an abort() in the host CPU process. Same functional goal + as :py:obj:`~.CU_COREDUMP_TRIGGER_HOST` but better reflects the + default behavior. + + - :py:obj:`~.CU_COREDUMP_SKIP_CONSTBANK_MEMORY` - Coredump will not + include constbank memory. + + - :py:obj:`~.CU_COREDUMP_GZIP_COMPRESS` - The generated coredump will + be compressed with gzip, and .gz suffix will be appended to the + filename, if it's not a part of it already. + + - :py:obj:`~.CU_COREDUMP_FAULTED_CONTEXTS_ONLY` - The coredump will + only include contexts that have encountered an exception or a trap. + + - :py:obj:`~.CU_COREDUMP_NO_ERRBAR_AT_EXIT` - By default, when + coredumps are requested, the GPU will ensure memory faults and + other errors prevent warps from exiting, if possible. This can + potentially affect the performance of the application. Setting this + flag will disable this functionality, making it possible for + faulted warps to exit, but also avoiding the potential performance + hit. + + - :py:obj:`~.CU_COREDUMP_LOG_ONLY` - Setting this flag will disable + actual generation of the coredump file, but exception details will + still be logged. + + Parameters + ---------- + attrib : :py:obj:`~.CUcoredumpSettings` + The enum defining which value to fetch. + size : int + The size of the memory region `value` points to. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + value : Any + void* containing the requested data. + size : int + The size of the memory region `value` points to. + + See Also + -------- + :py:obj:`~.cuCoredumpGetAttribute`, :py:obj:`~.cuCoredumpSetAttribute`, :py:obj:`~.cuCoredumpSetAttributeGlobal` + """ + cdef cydriver.CUcoredumpSettings cyattrib = int(attrib) + cdef _HelperCUcoredumpSettings cyvalue = _HelperCUcoredumpSettings(attrib, 0, is_getter=True) + cdef void* cyvalue_ptr = cyvalue.cptr + cdef size_t size = cyvalue.size() + with nogil: + err = cydriver.cuCoredumpGetAttributeGlobal(cyattrib, cyvalue_ptr, &size) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, cyvalue.pyObj()) + +@cython.embedsignature(True) +def cuCoredumpSetAttribute(attrib not None : CUcoredumpSettings, value): + """ Allows caller to set a coredump attribute value for the current context. + + This function should be considered an alternate interface to the CUDA- + GDB environment variables defined in this document: + https://docs.nvidia.com/cuda/cuda-gdb/index.html#gpu-coredump + + An important design decision to note is that any coredump environment + variable values set before CUDA initializes will take permanent + precedence over any values set with this function. This decision was + made to ensure no change in behavior for any users that may be + currently using these variables to get coredumps. + + `*value` shall contain the requested value specified by `set`. It is up + to the caller to ensure that the data type and size of `*value` matches + the request. + + If the caller calls this function with `*value` equal to NULL, the size + of the memory region (in bytes) expected for `set` will be placed in + `size`. + + /note This function will return :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` if + the caller attempts to set :py:obj:`~.CU_COREDUMP_ENABLE_ON_EXCEPTION` + on a GPU of with Compute Capability < 6.0. + :py:obj:`~.cuCoredumpSetAttributeGlobal` works on those platforms as an + alternative. + + /note :py:obj:`~.CU_COREDUMP_ENABLE_USER_TRIGGER` and + :py:obj:`~.CU_COREDUMP_PIPE` cannot be set on a per-context basis. + + The supported attributes are: + + - :py:obj:`~.CU_COREDUMP_ENABLE_ON_EXCEPTION`: Bool where + :py:obj:`~.true` means that GPU exceptions from this context will + create a coredump at the location specified by + :py:obj:`~.CU_COREDUMP_FILE`. The default value is :py:obj:`~.false`. + + - :py:obj:`~.CU_COREDUMP_TRIGGER_HOST`: Bool where :py:obj:`~.true` + means that the host CPU will also create a coredump. The default + value is :py:obj:`~.true` unless set to :py:obj:`~.false` globally or + or locally. This value is deprecated as of CUDA 12.5 - raise the + :py:obj:`~.CU_COREDUMP_SKIP_ABORT` flag to disable host device + abort() if needed. + + - :py:obj:`~.CU_COREDUMP_LIGHTWEIGHT`: Bool where :py:obj:`~.true` + means that any resulting coredumps will not have a dump of GPU memory + or non-reloc ELF images. The default value is :py:obj:`~.false`. This + attribute is deprecated as of CUDA 12.5, please use + :py:obj:`~.CU_COREDUMP_GENERATION_FLAGS` instead. + + - :py:obj:`~.CU_COREDUMP_FILE`: String of up to 1023 characters that + defines the location where any coredumps generated by this context + will be written. The default value is + :py:obj:`~.core`.cuda.HOSTNAME.PID where :py:obj:`~.HOSTNAME` is the + host name of the machine running the CUDA applications and + :py:obj:`~.PID` is the process ID of the CUDA application. + + - :py:obj:`~.CU_COREDUMP_GENERATION_FLAGS`: An integer with values to + allow granular control the data contained in a coredump specified as + a bitwise OR combination of the following values: + + - :py:obj:`~.CU_COREDUMP_DEFAULT_FLAGS` - if set by itself, coredump + generation returns to its default settings of including all memory + regions that it is able to access + + - :py:obj:`~.CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES` - Coredump + will not include the data from CUDA source modules that are not + relocated at runtime. + + - :py:obj:`~.CU_COREDUMP_SKIP_GLOBAL_MEMORY` - Coredump will not + include device-side global data that does not belong to any + context. + + - :py:obj:`~.CU_COREDUMP_SKIP_SHARED_MEMORY` - Coredump will not + include grid-scale shared memory for the warp that the dumped + kernel belonged to. + + - :py:obj:`~.CU_COREDUMP_SKIP_LOCAL_MEMORY` - Coredump will not + include local memory from the kernel. + + - :py:obj:`~.CU_COREDUMP_LIGHTWEIGHT_FLAGS` - Enables all of the + above options. Equiavlent to setting the + :py:obj:`~.CU_COREDUMP_LIGHTWEIGHT` attribute to :py:obj:`~.true`. + + - :py:obj:`~.CU_COREDUMP_SKIP_ABORT` - If set, GPU exceptions will + not raise an abort() in the host CPU process. Same functional goal + as :py:obj:`~.CU_COREDUMP_TRIGGER_HOST` but better reflects the + default behavior. + + - :py:obj:`~.CU_COREDUMP_SKIP_CONSTBANK_MEMORY` - Coredump will not + include constbank memory. + + - :py:obj:`~.CU_COREDUMP_GZIP_COMPRESS` - The generated coredump will + be compressed with gzip, and .gz suffix will be appended to the + filename, if it's not a part of it already. + + - :py:obj:`~.CU_COREDUMP_FAULTED_CONTEXTS_ONLY` - The coredump will + only include contexts that have encountered an exception or a trap. + + - :py:obj:`~.CU_COREDUMP_NO_ERRBAR_AT_EXIT` - By default, when + coredumps are requested, the GPU will ensure memory faults and + other errors prevent warps from exiting, if possible. This can + potentially affect the performance of the application. Setting this + flag will disable this functionality, making it possible for + faulted warps to exit, but also avoiding the potential performance + hit. + + - :py:obj:`~.CU_COREDUMP_LOG_ONLY` - Setting this flag will disable + actual generation of the coredump file, but exception details will + still be logged. + + Parameters + ---------- + attrib : :py:obj:`~.CUcoredumpSettings` + The enum defining which value to set. + value : Any + void* containing the requested data. + size : int + The size of the memory region `value` points to. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_CONTEXT_IS_DESTROYED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + size : int + The size of the memory region `value` points to. + + See Also + -------- + :py:obj:`~.cuCoredumpGetAttributeGlobal`, :py:obj:`~.cuCoredumpGetAttribute`, :py:obj:`~.cuCoredumpSetAttributeGlobal` + + Notes + ----- + :py:obj:`~.CU_COREDUMP_GENERATION_FLAGS` replaces all previously set coredump flags. Mixing :py:obj:`~.CU_COREDUMP_GENERATION_FLAGS` with the deprecated boolean attributes (:py:obj:`~.CU_COREDUMP_TRIGGER_HOST`, :py:obj:`~.CU_COREDUMP_LIGHTWEIGHT`) can result in undefined behavior. To avoid issues, either use only :py:obj:`~.CU_COREDUMP_GENERATION_FLAGS` or combine all desired flag bits (including :py:obj:`~.CU_COREDUMP_SKIP_ABORT`) in a single call. + """ + cdef cydriver.CUcoredumpSettings cyattrib = int(attrib) + cdef _HelperCUcoredumpSettings cyvalue = _HelperCUcoredumpSettings(attrib, value, is_getter=False) + cdef void* cyvalue_ptr = cyvalue.cptr + cdef size_t size = cyvalue.size() + with nogil: + err = cydriver.cuCoredumpSetAttribute(cyattrib, cyvalue_ptr, &size) + return (_CUresult(err),) + +@cython.embedsignature(True) +def cuCoredumpSetAttributeGlobal(attrib not None : CUcoredumpSettings, value): + """ Allows caller to set a coredump attribute value globally. + + This function should be considered an alternate interface to the CUDA- + GDB environment variables defined in this document: + https://docs.nvidia.com/cuda/cuda-gdb/index.html#gpu-coredump + + An important design decision to note is that any coredump environment + variable values set before CUDA initializes will take permanent + precedence over any values set with this function. This decision was + made to ensure no change in behavior for any users that may be + currently using these variables to get coredumps. + + `*value` shall contain the requested value specified by `set`. It is up + to the caller to ensure that the data type and size of `*value` matches + the request. + + If the caller calls this function with `*value` equal to NULL, the size + of the memory region (in bytes) expected for `set` will be placed in + `size`. + + The supported attributes are: + + - :py:obj:`~.CU_COREDUMP_ENABLE_ON_EXCEPTION`: Bool where + :py:obj:`~.true` means that GPU exceptions from this context will + create a coredump at the location specified by + :py:obj:`~.CU_COREDUMP_FILE`. The default value is :py:obj:`~.false`. + + - :py:obj:`~.CU_COREDUMP_TRIGGER_HOST`: Bool where :py:obj:`~.true` + means that the host CPU will also create a coredump. The default + value is :py:obj:`~.true` unless set to :py:obj:`~.false` globally or + or locally. This value is deprecated as of CUDA 12.5 - raise the + :py:obj:`~.CU_COREDUMP_SKIP_ABORT` flag to disable host device + abort() if needed. + + - :py:obj:`~.CU_COREDUMP_LIGHTWEIGHT`: Bool where :py:obj:`~.true` + means that any resulting coredumps will not have a dump of GPU memory + or non-reloc ELF images. The default value is :py:obj:`~.false`. This + attribute is deprecated as of CUDA 12.5, please use + :py:obj:`~.CU_COREDUMP_GENERATION_FLAGS` instead. + + - :py:obj:`~.CU_COREDUMP_ENABLE_USER_TRIGGER`: Bool where + :py:obj:`~.true` means that a coredump can be created by writing to + the system pipe specified by :py:obj:`~.CU_COREDUMP_PIPE`. The + default value is :py:obj:`~.false`. + + - :py:obj:`~.CU_COREDUMP_FILE`: String of up to 1023 characters that + defines the location where any coredumps generated by this context + will be written. The default value is + :py:obj:`~.core`.cuda.HOSTNAME.PID where :py:obj:`~.HOSTNAME` is the + host name of the machine running the CUDA applications and + :py:obj:`~.PID` is the process ID of the CUDA application. + + - :py:obj:`~.CU_COREDUMP_PIPE`: String of up to 1023 characters that + defines the name of the pipe that will be monitored if user-triggered + coredumps are enabled. This value may not be changed after + :py:obj:`~.CU_COREDUMP_ENABLE_USER_TRIGGER` is set to + :py:obj:`~.true`. The default value is :py:obj:`~.corepipe`.cuda.HOSTNAME.PID where :py:obj:`~.HOSTNAME` is the host name of the machine running the CUDA application and :py:obj:`~.PID` is the process ID of the CUDA application. @@ -54293,254 +53869,27 @@ def cuCoredumpGetAttributeGlobal(attrib not None : CUcoredumpSettings): as :py:obj:`~.CU_COREDUMP_TRIGGER_HOST` but better reflects the default behavior. - Parameters - ---------- - attrib : :py:obj:`~.CUcoredumpSettings` - The enum defining which value to fetch. - size : int - The size of the memory region `value` points to. - - Returns - ------- - CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - value : Any - void* containing the requested data. - size : int - The size of the memory region `value` points to. - - See Also - -------- - :py:obj:`~.cuCoredumpGetAttribute`, :py:obj:`~.cuCoredumpSetAttribute`, :py:obj:`~.cuCoredumpSetAttributeGlobal` - """ - cdef cydriver.CUcoredumpSettings cyattrib = int(attrib) - cdef _HelperCUcoredumpSettings cyvalue = _HelperCUcoredumpSettings(attrib, 0, is_getter=True) - cdef void* cyvalue_ptr = cyvalue.cptr - cdef size_t size = cyvalue.size() - with nogil: - err = cydriver.cuCoredumpGetAttributeGlobal(cyattrib, cyvalue_ptr, &size) - if err != cydriver.CUDA_SUCCESS: - return (_CUresult(err), None) - return (_CUresult_SUCCESS, cyvalue.pyObj()) -{{endif}} - -{{if 'cuCoredumpSetAttribute' in found_functions}} - -@cython.embedsignature(True) -def cuCoredumpSetAttribute(attrib not None : CUcoredumpSettings, value): - """ Allows caller to set a coredump attribute value for the current context. - - This function should be considered an alternate interface to the CUDA- - GDB environment variables defined in this document: - https://docs.nvidia.com/cuda/cuda-gdb/index.html#gpu-coredump - - An important design decision to note is that any coredump environment - variable values set before CUDA initializes will take permanent - precedence over any values set with this function. This decision was - made to ensure no change in behavior for any users that may be - currently using these variables to get coredumps. - - `*value` shall contain the requested value specified by `set`. It is up - to the caller to ensure that the data type and size of `*value` matches - the request. - - If the caller calls this function with `*value` equal to NULL, the size - of the memory region (in bytes) expected for `set` will be placed in - `size`. - - /note This function will return :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` if - the caller attempts to set :py:obj:`~.CU_COREDUMP_ENABLE_ON_EXCEPTION` - on a GPU of with Compute Capability < 6.0. - :py:obj:`~.cuCoredumpSetAttributeGlobal` works on those platforms as an - alternative. + - :py:obj:`~.CU_COREDUMP_SKIP_CONSTBANK_MEMORY` - Coredump will not + include constbank memory. - /note :py:obj:`~.CU_COREDUMP_ENABLE_USER_TRIGGER` and - :py:obj:`~.CU_COREDUMP_PIPE` cannot be set on a per-context basis. + - :py:obj:`~.CU_COREDUMP_GZIP_COMPRESS` - The generated coredump will + be compressed with gzip, and .gz suffix will be appended to the + filename, if it's not a part of it already. - The supported attributes are: + - :py:obj:`~.CU_COREDUMP_FAULTED_CONTEXTS_ONLY` - The coredump will + only include contexts that have encountered an exception or a trap. - - :py:obj:`~.CU_COREDUMP_ENABLE_ON_EXCEPTION`: Bool where - :py:obj:`~.true` means that GPU exceptions from this context will - create a coredump at the location specified by - :py:obj:`~.CU_COREDUMP_FILE`. The default value is :py:obj:`~.false`. + - :py:obj:`~.CU_COREDUMP_NO_ERRBAR_AT_EXIT` - By default, when + coredumps are requested, the GPU will ensure memory faults and + other errors prevent warps from exiting, if possible. This can + potentially affect the performance of the application. Setting this + flag will disable this functionality, making it possible for + faulted warps to exit, but also avoiding the potential performance + hit. - - :py:obj:`~.CU_COREDUMP_TRIGGER_HOST`: Bool where :py:obj:`~.true` - means that the host CPU will also create a coredump. The default - value is :py:obj:`~.true` unless set to :py:obj:`~.false` globally or - or locally. This value is deprecated as of CUDA 12.5 - raise the - :py:obj:`~.CU_COREDUMP_SKIP_ABORT` flag to disable host device - abort() if needed. - - - :py:obj:`~.CU_COREDUMP_LIGHTWEIGHT`: Bool where :py:obj:`~.true` - means that any resulting coredumps will not have a dump of GPU memory - or non-reloc ELF images. The default value is :py:obj:`~.false`. This - attribute is deprecated as of CUDA 12.5, please use - :py:obj:`~.CU_COREDUMP_GENERATION_FLAGS` instead. - - - :py:obj:`~.CU_COREDUMP_FILE`: String of up to 1023 characters that - defines the location where any coredumps generated by this context - will be written. The default value is - :py:obj:`~.core`.cuda.HOSTNAME.PID where :py:obj:`~.HOSTNAME` is the - host name of the machine running the CUDA applications and - :py:obj:`~.PID` is the process ID of the CUDA application. - - - :py:obj:`~.CU_COREDUMP_GENERATION_FLAGS`: An integer with values to - allow granular control the data contained in a coredump specified as - a bitwise OR combination of the following values: - - - :py:obj:`~.CU_COREDUMP_DEFAULT_FLAGS` - if set by itself, coredump - generation returns to its default settings of including all memory - regions that it is able to access - - - :py:obj:`~.CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES` - Coredump - will not include the data from CUDA source modules that are not - relocated at runtime. - - - :py:obj:`~.CU_COREDUMP_SKIP_GLOBAL_MEMORY` - Coredump will not - include device-side global data that does not belong to any - context. - - - :py:obj:`~.CU_COREDUMP_SKIP_SHARED_MEMORY` - Coredump will not - include grid-scale shared memory for the warp that the dumped - kernel belonged to. - - - :py:obj:`~.CU_COREDUMP_SKIP_LOCAL_MEMORY` - Coredump will not - include local memory from the kernel. - - - :py:obj:`~.CU_COREDUMP_LIGHTWEIGHT_FLAGS` - Enables all of the - above options. Equiavlent to setting the - :py:obj:`~.CU_COREDUMP_LIGHTWEIGHT` attribute to :py:obj:`~.true`. - - - :py:obj:`~.CU_COREDUMP_SKIP_ABORT` - If set, GPU exceptions will - not raise an abort() in the host CPU process. Same functional goal - as :py:obj:`~.CU_COREDUMP_TRIGGER_HOST` but better reflects the - default behavior. - - Parameters - ---------- - attrib : :py:obj:`~.CUcoredumpSettings` - The enum defining which value to set. - value : Any - void* containing the requested data. - size : int - The size of the memory region `value` points to. - - Returns - ------- - CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_CONTEXT_IS_DESTROYED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` - size : int - The size of the memory region `value` points to. - - See Also - -------- - :py:obj:`~.cuCoredumpGetAttributeGlobal`, :py:obj:`~.cuCoredumpGetAttribute`, :py:obj:`~.cuCoredumpSetAttributeGlobal` - """ - cdef cydriver.CUcoredumpSettings cyattrib = int(attrib) - cdef _HelperCUcoredumpSettings cyvalue = _HelperCUcoredumpSettings(attrib, value, is_getter=False) - cdef void* cyvalue_ptr = cyvalue.cptr - cdef size_t size = cyvalue.size() - with nogil: - err = cydriver.cuCoredumpSetAttribute(cyattrib, cyvalue_ptr, &size) - return (_CUresult(err),) -{{endif}} - -{{if 'cuCoredumpSetAttributeGlobal' in found_functions}} - -@cython.embedsignature(True) -def cuCoredumpSetAttributeGlobal(attrib not None : CUcoredumpSettings, value): - """ Allows caller to set a coredump attribute value globally. - - This function should be considered an alternate interface to the CUDA- - GDB environment variables defined in this document: - https://docs.nvidia.com/cuda/cuda-gdb/index.html#gpu-coredump - - An important design decision to note is that any coredump environment - variable values set before CUDA initializes will take permanent - precedence over any values set with this function. This decision was - made to ensure no change in behavior for any users that may be - currently using these variables to get coredumps. - - `*value` shall contain the requested value specified by `set`. It is up - to the caller to ensure that the data type and size of `*value` matches - the request. - - If the caller calls this function with `*value` equal to NULL, the size - of the memory region (in bytes) expected for `set` will be placed in - `size`. - - The supported attributes are: - - - :py:obj:`~.CU_COREDUMP_ENABLE_ON_EXCEPTION`: Bool where - :py:obj:`~.true` means that GPU exceptions from this context will - create a coredump at the location specified by - :py:obj:`~.CU_COREDUMP_FILE`. The default value is :py:obj:`~.false`. - - - :py:obj:`~.CU_COREDUMP_TRIGGER_HOST`: Bool where :py:obj:`~.true` - means that the host CPU will also create a coredump. The default - value is :py:obj:`~.true` unless set to :py:obj:`~.false` globally or - or locally. This value is deprecated as of CUDA 12.5 - raise the - :py:obj:`~.CU_COREDUMP_SKIP_ABORT` flag to disable host device - abort() if needed. - - - :py:obj:`~.CU_COREDUMP_LIGHTWEIGHT`: Bool where :py:obj:`~.true` - means that any resulting coredumps will not have a dump of GPU memory - or non-reloc ELF images. The default value is :py:obj:`~.false`. This - attribute is deprecated as of CUDA 12.5, please use - :py:obj:`~.CU_COREDUMP_GENERATION_FLAGS` instead. - - - :py:obj:`~.CU_COREDUMP_ENABLE_USER_TRIGGER`: Bool where - :py:obj:`~.true` means that a coredump can be created by writing to - the system pipe specified by :py:obj:`~.CU_COREDUMP_PIPE`. The - default value is :py:obj:`~.false`. - - - :py:obj:`~.CU_COREDUMP_FILE`: String of up to 1023 characters that - defines the location where any coredumps generated by this context - will be written. The default value is - :py:obj:`~.core`.cuda.HOSTNAME.PID where :py:obj:`~.HOSTNAME` is the - host name of the machine running the CUDA applications and - :py:obj:`~.PID` is the process ID of the CUDA application. - - - :py:obj:`~.CU_COREDUMP_PIPE`: String of up to 1023 characters that - defines the name of the pipe that will be monitored if user-triggered - coredumps are enabled. This value may not be changed after - :py:obj:`~.CU_COREDUMP_ENABLE_USER_TRIGGER` is set to - :py:obj:`~.true`. The default value is - :py:obj:`~.corepipe`.cuda.HOSTNAME.PID where :py:obj:`~.HOSTNAME` is - the host name of the machine running the CUDA application and - :py:obj:`~.PID` is the process ID of the CUDA application. - - - :py:obj:`~.CU_COREDUMP_GENERATION_FLAGS`: An integer with values to - allow granular control the data contained in a coredump specified as - a bitwise OR combination of the following values: - - - :py:obj:`~.CU_COREDUMP_DEFAULT_FLAGS` - if set by itself, coredump - generation returns to its default settings of including all memory - regions that it is able to access - - - :py:obj:`~.CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES` - Coredump - will not include the data from CUDA source modules that are not - relocated at runtime. - - - :py:obj:`~.CU_COREDUMP_SKIP_GLOBAL_MEMORY` - Coredump will not - include device-side global data that does not belong to any - context. - - - :py:obj:`~.CU_COREDUMP_SKIP_SHARED_MEMORY` - Coredump will not - include grid-scale shared memory for the warp that the dumped - kernel belonged to. - - - :py:obj:`~.CU_COREDUMP_SKIP_LOCAL_MEMORY` - Coredump will not - include local memory from the kernel. - - - :py:obj:`~.CU_COREDUMP_LIGHTWEIGHT_FLAGS` - Enables all of the - above options. Equiavlent to setting the - :py:obj:`~.CU_COREDUMP_LIGHTWEIGHT` attribute to :py:obj:`~.true`. - - - :py:obj:`~.CU_COREDUMP_SKIP_ABORT` - If set, GPU exceptions will - not raise an abort() in the host CPU process. Same functional goal - as :py:obj:`~.CU_COREDUMP_TRIGGER_HOST` but better reflects the - default behavior. + - :py:obj:`~.CU_COREDUMP_LOG_ONLY` - Setting this flag will disable + actual generation of the coredump file, but exception details will + still be logged. Parameters ---------- @@ -54561,6 +53910,10 @@ def cuCoredumpSetAttributeGlobal(attrib not None : CUcoredumpSettings, value): See Also -------- :py:obj:`~.cuCoredumpGetAttribute`, :py:obj:`~.cuCoredumpGetAttributeGlobal`, :py:obj:`~.cuCoredumpSetAttribute` + + Notes + ----- + :py:obj:`~.CU_COREDUMP_GENERATION_FLAGS` replaces all previously set coredump flags. Mixing :py:obj:`~.CU_COREDUMP_GENERATION_FLAGS` with the deprecated boolean attributes (:py:obj:`~.CU_COREDUMP_TRIGGER_HOST`, :py:obj:`~.CU_COREDUMP_LIGHTWEIGHT`) can result in undefined behavior. To avoid issues, either use only :py:obj:`~.CU_COREDUMP_GENERATION_FLAGS` or combine all desired flag bits (including :py:obj:`~.CU_COREDUMP_SKIP_ABORT`) in a single call. """ cdef cydriver.CUcoredumpSettings cyattrib = int(attrib) cdef _HelperCUcoredumpSettings cyvalue = _HelperCUcoredumpSettings(attrib, value, is_getter=False) @@ -54569,9 +53922,6 @@ def cuCoredumpSetAttributeGlobal(attrib not None : CUcoredumpSettings, value): with nogil: err = cydriver.cuCoredumpSetAttributeGlobal(cyattrib, cyvalue_ptr, &size) return (_CUresult(err),) -{{endif}} - -{{if 'cuCoredumpRegisterStartCallback' in found_functions}} @cython.embedsignature(True) def cuCoredumpRegisterStartCallback(callback, userData): @@ -54622,9 +53972,6 @@ def cuCoredumpRegisterStartCallback(callback, userData): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, callbackOut) -{{endif}} - -{{if 'cuCoredumpRegisterCompleteCallback' in found_functions}} @cython.embedsignature(True) def cuCoredumpRegisterCompleteCallback(callback, userData): @@ -54675,9 +54022,6 @@ def cuCoredumpRegisterCompleteCallback(callback, userData): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, callbackOut) -{{endif}} - -{{if 'cuCoredumpDeregisterStartCallback' in found_functions}} @cython.embedsignature(True) def cuCoredumpDeregisterStartCallback(callback): @@ -54716,9 +54060,6 @@ def cuCoredumpDeregisterStartCallback(callback): with nogil: err = cydriver.cuCoredumpDeregisterStartCallback(cycallback) return (_CUresult(err),) -{{endif}} - -{{if 'cuCoredumpDeregisterCompleteCallback' in found_functions}} @cython.embedsignature(True) def cuCoredumpDeregisterCompleteCallback(callback): @@ -54757,13 +54098,10 @@ def cuCoredumpDeregisterCompleteCallback(callback): with nogil: err = cydriver.cuCoredumpDeregisterCompleteCallback(cycallback) return (_CUresult(err),) -{{endif}} - -{{if 'cuGetExportTable' in found_functions}} @cython.embedsignature(True) def cuGetExportTable(pExportTableId : Optional[CUuuid]): - """ + """ Parameters ---------- @@ -54778,15 +54116,12 @@ def cuGetExportTable(pExportTableId : Optional[CUuuid]): None """ cdef void_ptr ppExportTable = 0 - cdef cydriver.CUuuid* cypExportTableId_ptr = pExportTableId._pvt_ptr if pExportTableId is not 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: return (_CUresult(err), None) return (_CUresult_SUCCESS, ppExportTable) -{{endif}} - -{{if 'cuGreenCtxCreate' in found_functions}} @cython.embedsignature(True) def cuGreenCtxCreate(desc, dev, unsigned int flags): @@ -54802,19 +54137,21 @@ def cuGreenCtxCreate(desc, dev, unsigned int flags): The API does not set the green context current. In order to set it current, you need to explicitly set it current by first converting the - green context to a CUcontext using :py:obj:`~.cuCtxFromGreenCtx` and - subsequently calling :py:obj:`~.cuCtxSetCurrent` / - :py:obj:`~.cuCtxPushCurrent`. It should be noted that a green context - can be current to only one thread at a time. There is no internal - synchronization to make API calls accessing the same green context from - multiple threads work. + green context to a :py:obj:`~.CUcontext` using + :py:obj:`~.cuCtxFromGreenCtx` and subsequently calling + :py:obj:`~.cuCtxSetCurrent` / :py:obj:`~.cuCtxPushCurrent`. It should + be noted that a green context can be current to only one thread at a + time. There is no internal synchronization to make API calls accessing + the same green context from multiple threads work. Note: The API is not supported on 32-bit platforms. The supported flags are: + - `CU_GREEN_CTX_NONE` : Default behavior. + - `CU_GREEN_CTX_DEFAULT_STREAM` : Creates a default stream to use - inside the green context. Required. + inside the green context. Parameters ---------- @@ -54825,7 +54162,6 @@ def cuGreenCtxCreate(desc, dev, unsigned int flags): Device on which to create the green context. flags : unsigned int One of the supported green context creation flags. - `CU_GREEN_CTX_DEFAULT_STREAM` is required. Returns ------- @@ -54860,9 +54196,6 @@ def cuGreenCtxCreate(desc, dev, unsigned int flags): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phCtx) -{{endif}} - -{{if 'cuGreenCtxDestroy' in found_functions}} @cython.embedsignature(True) def cuGreenCtxDestroy(hCtx): @@ -54910,24 +54243,40 @@ def cuGreenCtxDestroy(hCtx): with nogil: err = cydriver.cuGreenCtxDestroy(cyhCtx) return (_CUresult(err),) -{{endif}} - -{{if 'cuCtxFromGreenCtx' in found_functions}} @cython.embedsignature(True) def cuCtxFromGreenCtx(hCtx): - """ Converts a green context into the primary context. + """ Returns a :py:obj:`~.CUcontext` handle for a green context. + + This API returns in `pContext` a :py:obj:`~.CUcontext` handle that + represents the specified green context `hCtx`. The returned handle can + be passed to CUDA APIs that accept a :py:obj:`~.CUcontext` and will be + treated as if it were a primary context, while still honoring the + resources and configuration associated with `hCtx` as applicable. + + Applications that wish to use a green context with CUDA APIs that + require a :py:obj:`~.CUcontext` must use this API to obtain a handle to + a :py:obj:`~.CUcontext` representing the green context. Otherwise, + passing a green context to such APIs will fail with + :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`. - The API converts a green context into the primary context returned in - `pContext`. It is important to note that the converted context - `pContext` is a normal primary context but with the resources of the - specified green context `hCtx`. Once converted, it can then be used to - set the context current with :py:obj:`~.cuCtxSetCurrent` or with any of - the CUDA APIs that accept a CUcontext parameter. + The :py:obj:`~.CUcontext` returned by :py:obj:`~.cuCtxFromGreenCtx` may + be passed to CUDA Driver APIs that accept a :py:obj:`~.CUcontext`. - Users are expected to call this API before calling any CUDA APIs that - accept a CUcontext. Failing to do so will result in the APIs returning - :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`. + - For APIs whose semantics are independent of green context resources, + the operation is performed identically to how it would perform with a + primary context. + + - For APIs whose behavior depends on green context resources (for + example, kernel launch), the operation is performed using the + resources and configuration of the specified green context `hCtx`. + + This call does not create a new independent context and does not change + the underlying context lifetime. The validity of the returned + `pContext` is tied to `hCtx`, and no additional destruction or release + is required beyond correctly managing `hCtx` with the green context + APIs. Destroying `pContext` via :py:obj:`~.cuCtxDestroy` is undefined + behavior. Parameters ---------- @@ -54939,7 +54288,7 @@ def cuCtxFromGreenCtx(hCtx): 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` pContext : :py:obj:`~.CUcontext` - Returned primary context with green context resources + Returned :py:obj:`~.CUcontext` with green context resources See Also -------- @@ -54959,9 +54308,6 @@ def cuCtxFromGreenCtx(hCtx): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pContext) -{{endif}} - -{{if 'cuDeviceGetDevResource' in found_functions}} @cython.embedsignature(True) def cuDeviceGetDevResource(device, typename not None : CUdevResourceType): @@ -55006,9 +54352,6 @@ def cuDeviceGetDevResource(device, typename not None : CUdevResourceType): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, resource) -{{endif}} - -{{if 'cuCtxGetDevResource' in found_functions}} @cython.embedsignature(True) def cuCtxGetDevResource(hCtx, typename not None : CUdevResourceType): @@ -55050,9 +54393,6 @@ def cuCtxGetDevResource(hCtx, typename not None : CUdevResourceType): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, resource) -{{endif}} - -{{if 'cuGreenCtxGetDevResource' in found_functions}} @cython.embedsignature(True) def cuGreenCtxGetDevResource(hCtx, typename not None : CUdevResourceType): @@ -55094,9 +54434,6 @@ def cuGreenCtxGetDevResource(hCtx, typename not None : CUdevResourceType): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, resource) -{{endif}} - -{{if 'cuDevSmResourceSplitByCount' in found_functions}} @cython.embedsignature(True) def cuDevSmResourceSplitByCount(unsigned int nbGroups, input_ : Optional[CUdevResource], unsigned int flags, unsigned int minCount): @@ -55185,8 +54522,8 @@ 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`] - Output array of `None` resources. Can be NULL to query the number - of groups. + Output array of `CUdevResource` resources. Can be NULL to query the + number of groups. nbGroups : unsigned int This is a pointer, specifying the number of groups that would be or should be created as described below. @@ -55206,7 +54543,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_ is not None else NULL + cdef cydriver.CUdevResource* cyinput__ptr = input_._pvt_ptr if input_ is not None else NULL cdef CUdevResource remainder = CUdevResource() with nogil: err = cydriver.cuDevSmResourceSplitByCount(cyresult, &cynbGroups, cyinput__ptr, remainder._pvt_ptr, flags, minCount) @@ -55218,9 +54555,6 @@ def cuDevSmResourceSplitByCount(unsigned int nbGroups, input_ : Optional[CUdevRe if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None, None) return (_CUresult_SUCCESS, pyresult, cynbGroups, remainder) -{{endif}} - -{{if 'cuDevSmResourceSplit' in found_functions}} @cython.embedsignature(True) def cuDevSmResourceSplit(unsigned int nbGroups, input_ : Optional[CUdevResource], unsigned int flags, groupParams : Optional[tuple[CU_DEV_SM_RESOURCE_GROUP_PARAMS] | list[CU_DEV_SM_RESOURCE_GROUP_PARAMS]]): @@ -55258,8 +54592,8 @@ def cuDevSmResourceSplit(unsigned int nbGroups, input_ : Optional[CUdevResource] For a valid call: - - `result` should point to a `None` array of size `nbGroups`, or - alternatively, may be NULL, if the developer wishes for only the + - `result` should point to a `CUdevResource` array of size `nbGroups`, + or alternatively, may be NULL, if the developer wishes for only the groupParams entries to be updated - `input` should be a valid :py:obj:`~.CU_DEV_RESOURCE_TYPE_SM` @@ -55350,8 +54684,8 @@ def cuDevSmResourceSplit(unsigned int nbGroups, input_ : Optional[CUdevResource] 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`] - Output array of `None` resources. Can be NULL, alongside an smCount - of 0, for discovery purpose. + Output array of `CUdevResource` resources. Can be NULL, alongside + an smCount of 0, for discovery purpose. remainder : :py:obj:`~.CUdevResource` If splitting the input resource leaves any SMs, the remainder is placed in here. @@ -55369,7 +54703,7 @@ def cuDevSmResourceSplit(unsigned int nbGroups, input_ : Optional[CUdevResource] cyresult = calloc(nbGroups, sizeof(cydriver.CUdevResource)) if cyresult is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(nbGroups) + 'x' + str(sizeof(cydriver.CUdevResource))) - cdef cydriver.CUdevResource* cyinput__ptr = input_._pvt_ptr if input_ is not None else NULL + cdef cydriver.CUdevResource* cyinput__ptr = input_._pvt_ptr if input_ is not None else NULL cdef CUdevResource remainder = CUdevResource() cdef cydriver.CU_DEV_SM_RESOURCE_GROUP_PARAMS* cygroupParams = NULL if len(groupParams) > 1: @@ -55392,9 +54726,6 @@ def cuDevSmResourceSplit(unsigned int nbGroups, input_ : Optional[CUdevResource] if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None) return (_CUresult_SUCCESS, pyresult, remainder) -{{endif}} - -{{if 'cuDevResourceGenerateDesc' in found_functions}} @cython.embedsignature(True) def cuDevResourceGenerateDesc(resources : Optional[tuple[CUdevResource] | list[CUdevResource]], unsigned int nbResources): @@ -55460,9 +54791,6 @@ def cuDevResourceGenerateDesc(resources : Optional[tuple[CUdevResource] | list[C if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phDesc) -{{endif}} - -{{if 'cuGreenCtxRecordEvent' in found_functions}} @cython.embedsignature(True) def cuGreenCtxRecordEvent(hCtx, hEvent): @@ -55515,9 +54843,6 @@ def cuGreenCtxRecordEvent(hCtx, hEvent): with nogil: err = cydriver.cuGreenCtxRecordEvent(cyhCtx, cyhEvent) return (_CUresult(err),) -{{endif}} - -{{if 'cuGreenCtxWaitEvent' in found_functions}} @cython.embedsignature(True) def cuGreenCtxWaitEvent(hCtx, hEvent): @@ -55570,9 +54895,6 @@ def cuGreenCtxWaitEvent(hCtx, hEvent): with nogil: err = cydriver.cuGreenCtxWaitEvent(cyhCtx, cyhEvent) return (_CUresult(err),) -{{endif}} - -{{if 'cuStreamGetGreenCtx' in found_functions}} @cython.embedsignature(True) def cuStreamGetGreenCtx(hStream): @@ -55630,9 +54952,6 @@ def cuStreamGetGreenCtx(hStream): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phCtx) -{{endif}} - -{{if 'cuGreenCtxStreamCreate' in found_functions}} @cython.embedsignature(True) def cuGreenCtxStreamCreate(greenCtx, unsigned int flags, int priority): @@ -55705,9 +55024,6 @@ def cuGreenCtxStreamCreate(greenCtx, unsigned int flags, int priority): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phStream) -{{endif}} - -{{if 'cuGreenCtxGetId' in found_functions}} @cython.embedsignature(True) def cuGreenCtxGetId(greenCtx): @@ -55749,9 +55065,6 @@ def cuGreenCtxGetId(greenCtx): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, greenCtxId) -{{endif}} - -{{if 'cuStreamGetDevResource' in found_functions}} @cython.embedsignature(True) def cuStreamGetDevResource(hStream, typename not None : CUdevResourceType): @@ -55797,9 +55110,6 @@ def cuStreamGetDevResource(hStream, typename not None : CUdevResourceType): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, resource) -{{endif}} - -{{if 'cuLogsRegisterCallback' in found_functions}} ctypedef struct cuLogsCallbackData_st: cydriver.CUlogsCallback callback @@ -55862,9 +55172,6 @@ def cuLogsRegisterCallback(callbackFunc, userData): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, callback_out) -{{endif}} - -{{if 'cuLogsUnregisterCallback' in found_functions}} @cython.embedsignature(True) def cuLogsUnregisterCallback(callback): @@ -55894,9 +55201,6 @@ def cuLogsUnregisterCallback(callback): free(m_global._allocated[pcallback]) m_global._allocated.erase(pcallback) return (_CUresult(err),) -{{endif}} - -{{if 'cuLogsCurrent' in found_functions}} @cython.embedsignature(True) def cuLogsCurrent(unsigned int flags): @@ -55920,9 +55224,6 @@ def cuLogsCurrent(unsigned int flags): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, iterator_out) -{{endif}} - -{{if 'cuLogsDumpToFile' in found_functions}} @cython.embedsignature(True) def cuLogsDumpToFile(iterator : Optional[CUlogIterator], char* pathToFile, unsigned int flags): @@ -55964,9 +55265,6 @@ def cuLogsDumpToFile(iterator : Optional[CUlogIterator], char* pathToFile, unsig if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, iterator) -{{endif}} - -{{if 'cuLogsDumpToMemory' in found_functions}} @cython.embedsignature(True) def cuLogsDumpToMemory(iterator : Optional[CUlogIterator], char* buffer, size_t size, unsigned int flags): @@ -56022,9 +55320,6 @@ def cuLogsDumpToMemory(iterator : Optional[CUlogIterator], char* buffer, size_t if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None) return (_CUresult_SUCCESS, iterator, size) -{{endif}} - -{{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}} @cython.embedsignature(True) def cuCheckpointProcessGetRestoreThreadId(int pid): @@ -56051,9 +55346,6 @@ def cuCheckpointProcessGetRestoreThreadId(int pid): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, tid) -{{endif}} - -{{if 'cuCheckpointProcessGetState' in found_functions}} @cython.embedsignature(True) def cuCheckpointProcessGetState(int pid): @@ -56080,9 +55372,6 @@ def cuCheckpointProcessGetState(int pid): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, CUprocessState(state)) -{{endif}} - -{{if 'cuCheckpointProcessLock' in found_functions}} @cython.embedsignature(True) def cuCheckpointProcessLock(int pid, args : Optional[CUcheckpointLockArgs]): @@ -56108,13 +55397,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{if 'cuCheckpointProcessCheckpoint' in found_functions}} @cython.embedsignature(True) def cuCheckpointProcessCheckpoint(int pid, args : Optional[CUcheckpointCheckpointArgs]): @@ -56139,13 +55425,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{if 'cuCheckpointProcessRestore' in found_functions}} @cython.embedsignature(True) def cuCheckpointProcessRestore(int pid, args : Optional[CUcheckpointRestoreArgs]): @@ -56180,13 +55463,10 @@ def cuCheckpointProcessRestore(int pid, args : Optional[CUcheckpointRestoreArgs] -------- :py:obj:`~.cuInit` """ - cdef cydriver.CUcheckpointRestoreArgs* cyargs_ptr = args._pvt_ptr if args is not None else NULL + cdef cydriver.CUcheckpointRestoreArgs* cyargs_ptr = args._pvt_ptr if args is not None else NULL with nogil: err = cydriver.cuCheckpointProcessRestore(pid, cyargs_ptr) return (_CUresult(err),) -{{endif}} - -{{if 'cuCheckpointProcessUnlock' in found_functions}} @cython.embedsignature(True) def cuCheckpointProcessUnlock(int pid, args : Optional[CUcheckpointUnlockArgs]): @@ -56209,13 +55489,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{if 'cuProfilerStart' in found_functions}} @cython.embedsignature(True) def cuProfilerStart(): @@ -56241,9 +55518,6 @@ def cuProfilerStart(): with nogil: err = cydriver.cuProfilerStart() return (_CUresult(err),) -{{endif}} - -{{if 'cuProfilerStop' in found_functions}} @cython.embedsignature(True) def cuProfilerStop(): @@ -56269,19 +55543,16 @@ def cuProfilerStop(): with nogil: err = cydriver.cuProfilerStop() return (_CUresult(err),) -{{endif}} - -{{if True}} @cython.embedsignature(True) def cuGraphicsEGLRegisterImage(image, unsigned int flags): """ Registers an EGL image. - Registers the EGLImageKHR specified by `image` for access by CUDA. A - handle to the registered object is returned as `pCudaResource`. - Additional Mapping/Unmapping is not required for the registered - resource and :py:obj:`~.cuGraphicsResourceGetMappedEglFrame` can be - directly called on the `pCudaResource`. + Registers the :py:obj:`~.EGLImageKHR` specified by `image` for access + by CUDA. A handle to the registered object is returned as + `pCudaResource`. Additional Mapping/Unmapping is not required for the + registered resource and :py:obj:`~.cuGraphicsResourceGetMappedEglFrame` + can be directly called on the `pCudaResource`. The application will be responsible for synchronizing access to shared objects. The application must ensure that any pending operation which @@ -56309,14 +55580,15 @@ def cuGraphicsEGLRegisterImage(image, unsigned int flags): entire contents of the resource, so none of the data previously stored in the resource will be preserved. - The EGLImageKHR is an object which can be used to create EGLImage - target resource. It is defined as a void pointer. typedef void* - EGLImageKHR + The :py:obj:`~.EGLImageKHR` is an object which can be used to create + EGLImage target resource. It is defined as a void pointer. typedef + void* :py:obj:`~.EGLImageKHR` Parameters ---------- image : :py:obj:`~.EGLImageKHR` - An EGLImageKHR image which can be used to create target resource. + An :py:obj:`~.EGLImageKHR` image which can be used to create target + resource. flags : unsigned int Map flags @@ -56345,23 +55617,21 @@ def cuGraphicsEGLRegisterImage(image, unsigned int flags): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pCudaResource) -{{endif}} - -{{if True}} @cython.embedsignature(True) def cuEGLStreamConsumerConnect(stream): """ Connect CUDA to EGLStream as a consumer. - Connect CUDA as a consumer to EGLStreamKHR specified by `stream`. + Connect CUDA as a consumer to :py:obj:`~.EGLStreamKHR` specified by + `stream`. - The EGLStreamKHR is an EGL object that transfers a sequence of image - frames from one API to another. + The :py:obj:`~.EGLStreamKHR` is an EGL object that transfers a sequence + of image frames from one API to another. Parameters ---------- stream : :py:obj:`~.EGLStreamKHR` - EGLStreamKHR handle + :py:obj:`~.EGLStreamKHR` handle Returns ------- @@ -56388,16 +55658,14 @@ def cuEGLStreamConsumerConnect(stream): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, conn) -{{endif}} - -{{if True}} @cython.embedsignature(True) def cuEGLStreamConsumerConnectWithFlags(stream, unsigned int flags): """ Connect CUDA to EGLStream as a consumer with given flags. - Connect CUDA as a consumer to EGLStreamKHR specified by `stream` with - specified `flags` defined by CUeglResourceLocationFlags. + Connect CUDA as a consumer to :py:obj:`~.EGLStreamKHR` specified by + `stream` with specified `flags` defined by + :py:obj:`~.CUeglResourceLocationFlags`. The flags specify whether the consumer wants to access frames from system memory or video memory. Default is @@ -56406,7 +55674,7 @@ def cuEGLStreamConsumerConnectWithFlags(stream, unsigned int flags): Parameters ---------- stream : :py:obj:`~.EGLStreamKHR` - EGLStreamKHR handle + :py:obj:`~.EGLStreamKHR` handle flags : unsigned int Flags denote intended location - system or video. @@ -56435,15 +55703,12 @@ def cuEGLStreamConsumerConnectWithFlags(stream, unsigned int flags): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, conn) -{{endif}} - -{{if True}} @cython.embedsignature(True) def cuEGLStreamConsumerDisconnect(conn): """ Disconnect CUDA as a consumer to EGLStream . - Disconnect CUDA as a consumer to EGLStreamKHR. + Disconnect CUDA as a consumer to :py:obj:`~.EGLStreamKHR`. Parameters ---------- @@ -56472,20 +55737,17 @@ def cuEGLStreamConsumerDisconnect(conn): with nogil: err = cydriver.cuEGLStreamConsumerDisconnect(cyconn) return (_CUresult(err),) -{{endif}} - -{{if True}} @cython.embedsignature(True) def cuEGLStreamConsumerAcquireFrame(conn, pCudaResource, pStream, unsigned int timeout): """ Acquire an image frame from the EGLStream with CUDA as a consumer. - Acquire an image frame from EGLStreamKHR. This API can also acquire an - old frame presented by the producer unless explicitly disabled by - setting EGL_SUPPORT_REUSE_NV flag to EGL_FALSE during stream - initialization. By default, EGLStream is created with this flag set to - EGL_TRUE. :py:obj:`~.cuGraphicsResourceGetMappedEglFrame` can be called - on `pCudaResource` to get :py:obj:`~.CUeglFrame`. + Acquire an image frame from :py:obj:`~.EGLStreamKHR`. This API can also + acquire an old frame presented by the producer unless explicitly + disabled by setting EGL_SUPPORT_REUSE_NV flag to EGL_FALSE during + stream initialization. By default, EGLStream is created with this flag + set to EGL_TRUE. :py:obj:`~.cuGraphicsResourceGetMappedEglFrame` can be + called on `pCudaResource` to get :py:obj:`~.CUeglFrame`. Parameters ---------- @@ -56544,19 +55806,16 @@ def cuEGLStreamConsumerAcquireFrame(conn, pCudaResource, pStream, unsigned int t with nogil: err = cydriver.cuEGLStreamConsumerAcquireFrame(cyconn, cypCudaResource, cypStream, timeout) return (_CUresult(err),) -{{endif}} - -{{if True}} @cython.embedsignature(True) def cuEGLStreamConsumerReleaseFrame(conn, pCudaResource, pStream): """ Releases the last frame acquired from the EGLStream. Release the acquired image frame specified by `pCudaResource` to - EGLStreamKHR. If EGL_SUPPORT_REUSE_NV flag is set to EGL_TRUE, at the - time of EGL creation this API doesn't release the last frame acquired - on the EGLStream. By default, EGLStream is created with this flag set - to EGL_TRUE. + :py:obj:`~.EGLStreamKHR`. If EGL_SUPPORT_REUSE_NV flag is set to + EGL_TRUE, at the time of EGL creation this API doesn't release the last + frame acquired on the EGLStream. By default, EGLStream is created with + this flag set to EGL_TRUE. Parameters ---------- @@ -56607,23 +55866,21 @@ def cuEGLStreamConsumerReleaseFrame(conn, pCudaResource, pStream): with nogil: err = cydriver.cuEGLStreamConsumerReleaseFrame(cyconn, cypCudaResource, cypStream) return (_CUresult(err),) -{{endif}} - -{{if True}} @cython.embedsignature(True) def cuEGLStreamProducerConnect(stream, width, height): """ Connect CUDA to EGLStream as a producer. - Connect CUDA as a producer to EGLStreamKHR specified by `stream`. + Connect CUDA as a producer to :py:obj:`~.EGLStreamKHR` specified by + `stream`. - The EGLStreamKHR is an EGL object that transfers a sequence of image - frames from one API to another. + The :py:obj:`~.EGLStreamKHR` is an EGL object that transfers a sequence + of image frames from one API to another. Parameters ---------- stream : :py:obj:`~.EGLStreamKHR` - EGLStreamKHR handle + :py:obj:`~.EGLStreamKHR` handle width : :py:obj:`~.EGLint` width of the image to be submitted to the stream height : :py:obj:`~.EGLint` @@ -56670,15 +55927,12 @@ def cuEGLStreamProducerConnect(stream, width, height): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, conn) -{{endif}} - -{{if True}} @cython.embedsignature(True) def cuEGLStreamProducerDisconnect(conn): """ Disconnect CUDA as a producer to EGLStream . - Disconnect CUDA as a producer to EGLStreamKHR. + Disconnect CUDA as a producer to :py:obj:`~.EGLStreamKHR`. Parameters ---------- @@ -56707,9 +55961,6 @@ def cuEGLStreamProducerDisconnect(conn): with nogil: err = cydriver.cuEGLStreamProducerDisconnect(cyconn) return (_CUresult(err),) -{{endif}} - -{{if True}} @cython.embedsignature(True) def cuEGLStreamProducerPresentFrame(conn, eglframe not None : CUeglFrame, pStream): @@ -56777,9 +56028,6 @@ def cuEGLStreamProducerPresentFrame(conn, eglframe not None : CUeglFrame, pStrea with nogil: err = cydriver.cuEGLStreamProducerPresentFrame(cyconn, eglframe._pvt_ptr[0], cypStream) return (_CUresult(err),) -{{endif}} - -{{if True}} @cython.embedsignature(True) def cuEGLStreamProducerReturnFrame(conn, eglframe : Optional[CUeglFrame], pStream): @@ -56828,13 +56076,10 @@ 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 is not 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 (_CUresult(err),) -{{endif}} - -{{if True}} @cython.embedsignature(True) def cuGraphicsResourceGetMappedEglFrame(resource, unsigned int index, unsigned int mipLevel): @@ -56881,16 +56126,13 @@ def cuGraphicsResourceGetMappedEglFrame(resource, unsigned int index, unsigned i if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, eglFrame) -{{endif}} - -{{if True}} @cython.embedsignature(True) def cuEventCreateFromEGLSync(eglSync, unsigned int flags): """ Creates an event from EGLSync object. - Creates an event *phEvent from an EGLSyncKHR eglSync with the flags - specified via `flags`. Valid flags include: + Creates an event *phEvent from an :py:obj:`~.EGLSyncKHR` eglSync with + the flags specified via `flags`. Valid flags include: - :py:obj:`~.CU_EVENT_DEFAULT`: Default event creation flag. @@ -56905,8 +56147,8 @@ def cuEventCreateFromEGLSync(eglSync, unsigned int flags): :py:obj:`~.cuEventRecord` and TimingData are not supported for events created from EGLSync. - The EGLSyncKHR is an opaque handle to an EGL sync object. typedef void* - EGLSyncKHR + The :py:obj:`~.EGLSyncKHR` is an opaque handle to an EGL sync object. + typedef void* :py:obj:`~.EGLSyncKHR` Parameters ---------- @@ -56940,9 +56182,6 @@ def cuEventCreateFromEGLSync(eglSync, unsigned int flags): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, phEvent) -{{endif}} - -{{if True}} @cython.embedsignature(True) def cuGraphicsGLRegisterBuffer(buffer, unsigned int Flags): @@ -56997,9 +56236,6 @@ def cuGraphicsGLRegisterBuffer(buffer, unsigned int Flags): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pCudaResource) -{{endif}} - -{{if True}} @cython.embedsignature(True) def cuGraphicsGLRegisterImage(image, target, unsigned int Flags): @@ -57097,9 +56333,6 @@ def cuGraphicsGLRegisterImage(image, target, unsigned int Flags): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pCudaResource) -{{endif}} - -{{if True}} @cython.embedsignature(True) def cuGLGetDevices(unsigned int cudaDeviceCount, deviceList not None : CUGLDeviceList): @@ -57166,9 +56399,6 @@ def cuGLGetDevices(unsigned int cudaDeviceCount, deviceList not None : CUGLDevic if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None, None) return (_CUresult_SUCCESS, pCudaDeviceCount, pypCudaDevices) -{{endif}} - -{{if True}} @cython.embedsignature(True) def cuVDPAUGetDevice(vdpDevice, vdpGetProcAddress): @@ -57180,9 +56410,9 @@ def cuVDPAUGetDevice(vdpDevice, vdpGetProcAddress): Parameters ---------- vdpDevice : :py:obj:`~.VdpDevice` - A VdpDevice handle + A :py:obj:`~.VdpDevice` handle vdpGetProcAddress : :py:obj:`~.VdpGetProcAddress` - VDPAU's VdpGetProcAddress function pointer + VDPAU's :py:obj:`~.VdpGetProcAddress` function pointer Returns ------- @@ -57219,9 +56449,6 @@ def cuVDPAUGetDevice(vdpDevice, vdpGetProcAddress): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pDevice) -{{endif}} - -{{if True}} @cython.embedsignature(True) def cuVDPAUCtxCreate(unsigned int flags, device, vdpDevice, vdpGetProcAddress): @@ -57240,9 +56467,9 @@ def cuVDPAUCtxCreate(unsigned int flags, device, vdpDevice, vdpGetProcAddress): device : :py:obj:`~.CUdevice` Device on which to create the context vdpDevice : :py:obj:`~.VdpDevice` - The VdpDevice to interop with + The :py:obj:`~.VdpDevice` to interop with vdpGetProcAddress : :py:obj:`~.VdpGetProcAddress` - VDPAU's VdpGetProcAddress function pointer + VDPAU's :py:obj:`~.VdpGetProcAddress` function pointer Returns ------- @@ -57287,17 +56514,15 @@ def cuVDPAUCtxCreate(unsigned int flags, device, vdpDevice, vdpGetProcAddress): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pCtx) -{{endif}} - -{{if True}} @cython.embedsignature(True) def cuGraphicsVDPAURegisterVideoSurface(vdpSurface, unsigned int flags): - """ Registers a VDPAU VdpVideoSurface object. + """ Registers a VDPAU :py:obj:`~.VdpVideoSurface` object. - Registers the VdpVideoSurface specified by `vdpSurface` for access by - CUDA. A handle to the registered object is returned as `pCudaResource`. - The surface's intended usage is specified using `flags`, as follows: + Registers the :py:obj:`~.VdpVideoSurface` specified by `vdpSurface` for + access by CUDA. A handle to the registered object is returned as + `pCudaResource`. The surface's intended usage is specified using + `flags`, as follows: - :py:obj:`~.CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE`: Specifies no hints about how this resource will be used. It is therefore assumed that @@ -57312,8 +56537,8 @@ def cuGraphicsVDPAURegisterVideoSurface(vdpSurface, unsigned int flags): entire contents of the resource, so none of the data previously stored in the resource will be preserved. - The VdpVideoSurface is presented as an array of subresources that may - be accessed using pointers returned by + The :py:obj:`~.VdpVideoSurface` is presented as an array of + subresources that may be accessed using pointers returned by :py:obj:`~.cuGraphicsSubResourceGetMappedArray`. The exact number of valid `arrayIndex` values depends on the VDPAU surface format. The mapping is shown in the table below. `mipLevel` must be 0. @@ -57321,7 +56546,7 @@ def cuGraphicsVDPAURegisterVideoSurface(vdpSurface, unsigned int flags): Parameters ---------- vdpSurface : :py:obj:`~.VdpVideoSurface` - The VdpVideoSurface to be registered + The :py:obj:`~.VdpVideoSurface` to be registered flags : unsigned int Map flags @@ -57350,17 +56575,15 @@ def cuGraphicsVDPAURegisterVideoSurface(vdpSurface, unsigned int flags): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pCudaResource) -{{endif}} - -{{if True}} @cython.embedsignature(True) def cuGraphicsVDPAURegisterOutputSurface(vdpSurface, unsigned int flags): - """ Registers a VDPAU VdpOutputSurface object. + """ Registers a VDPAU :py:obj:`~.VdpOutputSurface` object. - Registers the VdpOutputSurface specified by `vdpSurface` for access by - CUDA. A handle to the registered object is returned as `pCudaResource`. - The surface's intended usage is specified using `flags`, as follows: + Registers the :py:obj:`~.VdpOutputSurface` specified by `vdpSurface` + for access by CUDA. A handle to the registered object is returned as + `pCudaResource`. The surface's intended usage is specified using + `flags`, as follows: - :py:obj:`~.CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE`: Specifies no hints about how this resource will be used. It is therefore assumed that @@ -57375,8 +56598,8 @@ def cuGraphicsVDPAURegisterOutputSurface(vdpSurface, unsigned int flags): entire contents of the resource, so none of the data previously stored in the resource will be preserved. - The VdpOutputSurface is presented as an array of subresources that may - be accessed using pointers returned by + The :py:obj:`~.VdpOutputSurface` is presented as an array of + subresources that may be accessed using pointers returned by :py:obj:`~.cuGraphicsSubResourceGetMappedArray`. The exact number of valid `arrayIndex` values depends on the VDPAU surface format. The mapping is shown in the table below. `mipLevel` must be 0. @@ -57384,7 +56607,7 @@ def cuGraphicsVDPAURegisterOutputSurface(vdpSurface, unsigned int flags): Parameters ---------- vdpSurface : :py:obj:`~.VdpOutputSurface` - The VdpOutputSurface to be registered + The :py:obj:`~.VdpOutputSurface` to be registered flags : unsigned int Map flags @@ -57413,8 +56636,6 @@ def cuGraphicsVDPAURegisterOutputSurface(vdpSurface, unsigned int flags): if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, pCudaResource) -{{endif}} - cdef class cudaBindingsDriverGlobal: cdef map[void_ptr, void*] _allocated @@ -57426,7 +56647,6 @@ cdef class cudaBindingsDriverGlobal: cdef cudaBindingsDriverGlobal m_global = cudaBindingsDriverGlobal() - @cython.embedsignature(True) def sizeof(objType): """ Returns the size of provided CUDA Python structure in bytes @@ -57441,976 +56661,993 @@ def sizeof(objType): lowered_name : int The size of `objType` in bytes """ - {{if 'cuuint32_t' in found_types}} + if objType == cuuint32_t: - return sizeof(cydriver.cuuint32_t){{endif}} - {{if 'cuuint64_t' in found_types}} + return sizeof(cydriver.cuuint32_t) + if objType == cuuint64_t: - return sizeof(cydriver.cuuint64_t){{endif}} - {{if 'CUdeviceptr_v2' in found_types}} + return sizeof(cydriver.cuuint64_t) + if objType == CUdeviceptr_v2: - return sizeof(cydriver.CUdeviceptr_v2){{endif}} - {{if 'CUdeviceptr' in found_types}} + return sizeof(cydriver.CUdeviceptr_v2) + if objType == CUdeviceptr: - return sizeof(cydriver.CUdeviceptr){{endif}} - {{if 'CUdevice_v1' in found_types}} + return sizeof(cydriver.CUdeviceptr) + if objType == CUdevice_v1: - return sizeof(cydriver.CUdevice_v1){{endif}} - {{if 'CUdevice' in found_types}} + return sizeof(cydriver.CUdevice_v1) + if objType == CUdevice: - return sizeof(cydriver.CUdevice){{endif}} - {{if 'CUcontext' in found_types}} + return sizeof(cydriver.CUdevice) + if objType == CUcontext: - return sizeof(cydriver.CUcontext){{endif}} - {{if 'CUmodule' in found_types}} + return sizeof(cydriver.CUcontext) + if objType == CUmodule: - return sizeof(cydriver.CUmodule){{endif}} - {{if 'CUfunction' in found_types}} + return sizeof(cydriver.CUmodule) + if objType == CUfunction: - return sizeof(cydriver.CUfunction){{endif}} - {{if 'CUlibrary' in found_types}} + return sizeof(cydriver.CUfunction) + if objType == CUlibrary: - return sizeof(cydriver.CUlibrary){{endif}} - {{if 'CUkernel' in found_types}} + return sizeof(cydriver.CUlibrary) + if objType == CUkernel: - return sizeof(cydriver.CUkernel){{endif}} - {{if 'CUarray' in found_types}} + return sizeof(cydriver.CUkernel) + if objType == CUarray: - return sizeof(cydriver.CUarray){{endif}} - {{if 'CUmipmappedArray' in found_types}} + return sizeof(cydriver.CUarray) + if objType == CUmipmappedArray: - return sizeof(cydriver.CUmipmappedArray){{endif}} - {{if 'CUtexref' in found_types}} + return sizeof(cydriver.CUmipmappedArray) + if objType == CUtexref: - return sizeof(cydriver.CUtexref){{endif}} - {{if 'CUsurfref' in found_types}} + return sizeof(cydriver.CUtexref) + if objType == CUsurfref: - return sizeof(cydriver.CUsurfref){{endif}} - {{if 'CUevent' in found_types}} + return sizeof(cydriver.CUsurfref) + if objType == CUevent: - return sizeof(cydriver.CUevent){{endif}} - {{if 'CUstream' in found_types}} + return sizeof(cydriver.CUevent) + if objType == CUstream: - return sizeof(cydriver.CUstream){{endif}} - {{if 'CUgraphicsResource' in found_types}} + return sizeof(cydriver.CUstream) + if objType == CUgraphicsResource: - return sizeof(cydriver.CUgraphicsResource){{endif}} - {{if 'CUtexObject_v1' in found_types}} + return sizeof(cydriver.CUgraphicsResource) + if objType == CUtexObject_v1: - return sizeof(cydriver.CUtexObject_v1){{endif}} - {{if 'CUtexObject' in found_types}} + return sizeof(cydriver.CUtexObject_v1) + if objType == CUtexObject: - return sizeof(cydriver.CUtexObject){{endif}} - {{if 'CUsurfObject_v1' in found_types}} + return sizeof(cydriver.CUtexObject) + if objType == CUsurfObject_v1: - return sizeof(cydriver.CUsurfObject_v1){{endif}} - {{if 'CUsurfObject' in found_types}} + return sizeof(cydriver.CUsurfObject_v1) + if objType == CUsurfObject: - return sizeof(cydriver.CUsurfObject){{endif}} - {{if 'CUexternalMemory' in found_types}} + return sizeof(cydriver.CUsurfObject) + if objType == CUexternalMemory: - return sizeof(cydriver.CUexternalMemory){{endif}} - {{if 'CUexternalSemaphore' in found_types}} + return sizeof(cydriver.CUexternalMemory) + if objType == CUexternalSemaphore: - return sizeof(cydriver.CUexternalSemaphore){{endif}} - {{if 'CUgraph' in found_types}} + return sizeof(cydriver.CUexternalSemaphore) + if objType == CUgraph: - return sizeof(cydriver.CUgraph){{endif}} - {{if 'CUgraphNode' in found_types}} + return sizeof(cydriver.CUgraph) + if objType == CUgraphNode: - return sizeof(cydriver.CUgraphNode){{endif}} - {{if 'CUgraphExec' in found_types}} + return sizeof(cydriver.CUgraphNode) + if objType == CUgraphExec: - return sizeof(cydriver.CUgraphExec){{endif}} - {{if 'CUmemoryPool' in found_types}} + return sizeof(cydriver.CUgraphExec) + if objType == CUmemoryPool: - return sizeof(cydriver.CUmemoryPool){{endif}} - {{if 'CUuserObject' in found_types}} + return sizeof(cydriver.CUmemoryPool) + if objType == CUuserObject: - return sizeof(cydriver.CUuserObject){{endif}} - {{if 'CUgraphConditionalHandle' in found_types}} + return sizeof(cydriver.CUuserObject) + if objType == CUgraphConditionalHandle: - return sizeof(cydriver.CUgraphConditionalHandle){{endif}} - {{if 'CUgraphDeviceNode' in found_types}} + return sizeof(cydriver.CUgraphConditionalHandle) + if objType == CUgraphDeviceNode: - return sizeof(cydriver.CUgraphDeviceNode){{endif}} - {{if 'CUasyncCallbackHandle' in found_types}} + return sizeof(cydriver.CUgraphDeviceNode) + if objType == CUasyncCallbackHandle: - return sizeof(cydriver.CUasyncCallbackHandle){{endif}} - {{if 'CUgreenCtx' in found_types}} + return sizeof(cydriver.CUasyncCallbackHandle) + if objType == CUgreenCtx: - return sizeof(cydriver.CUgreenCtx){{endif}} - {{if 'CUuuid_st' in found_struct}} + return sizeof(cydriver.CUgreenCtx) + if objType == CUuuid_st: - return sizeof(cydriver.CUuuid_st){{endif}} - {{if 'CUuuid' in found_types}} + return sizeof(cydriver.CUuuid_st) + if objType == CUuuid: - return sizeof(cydriver.CUuuid){{endif}} - {{if 'CUmemFabricHandle_st' in found_struct}} + return sizeof(cydriver.CUuuid) + if objType == CUmemFabricHandle_st: - return sizeof(cydriver.CUmemFabricHandle_st){{endif}} - {{if 'CUmemFabricHandle_v1' in found_types}} + return sizeof(cydriver.CUmemFabricHandle_st) + if objType == CUmemFabricHandle_v1: - return sizeof(cydriver.CUmemFabricHandle_v1){{endif}} - {{if 'CUmemFabricHandle' in found_types}} + return sizeof(cydriver.CUmemFabricHandle_v1) + if objType == CUmemFabricHandle: - return sizeof(cydriver.CUmemFabricHandle){{endif}} - {{if 'CUipcEventHandle_st' in found_struct}} + return sizeof(cydriver.CUmemFabricHandle) + if objType == CUipcEventHandle_st: - return sizeof(cydriver.CUipcEventHandle_st){{endif}} - {{if 'CUipcEventHandle_v1' in found_types}} + return sizeof(cydriver.CUipcEventHandle_st) + if objType == CUipcEventHandle_v1: - return sizeof(cydriver.CUipcEventHandle_v1){{endif}} - {{if 'CUipcEventHandle' in found_types}} + return sizeof(cydriver.CUipcEventHandle_v1) + if objType == CUipcEventHandle: - return sizeof(cydriver.CUipcEventHandle){{endif}} - {{if 'CUipcMemHandle_st' in found_struct}} + return sizeof(cydriver.CUipcEventHandle) + if objType == CUipcMemHandle_st: - return sizeof(cydriver.CUipcMemHandle_st){{endif}} - {{if 'CUipcMemHandle_v1' in found_types}} + return sizeof(cydriver.CUipcMemHandle_st) + if objType == CUipcMemHandle_v1: - return sizeof(cydriver.CUipcMemHandle_v1){{endif}} - {{if 'CUipcMemHandle' in found_types}} + return sizeof(cydriver.CUipcMemHandle_v1) + if objType == CUipcMemHandle: - return sizeof(cydriver.CUipcMemHandle){{endif}} - {{if 'CUstreamBatchMemOpParams_union' in found_struct}} + return sizeof(cydriver.CUipcMemHandle) + if objType == CUstreamBatchMemOpParams_union: - return sizeof(cydriver.CUstreamBatchMemOpParams_union){{endif}} - {{if 'CUstreamBatchMemOpParams_v1' in found_types}} + return sizeof(cydriver.CUstreamBatchMemOpParams_union) + if objType == CUstreamBatchMemOpParams_v1: - return sizeof(cydriver.CUstreamBatchMemOpParams_v1){{endif}} - {{if 'CUstreamBatchMemOpParams' in found_types}} + return sizeof(cydriver.CUstreamBatchMemOpParams_v1) + if objType == CUstreamBatchMemOpParams: - return sizeof(cydriver.CUstreamBatchMemOpParams){{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st' in found_struct}} + return sizeof(cydriver.CUstreamBatchMemOpParams) + if objType == CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st: - return sizeof(cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st){{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v1' in found_types}} + return sizeof(cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st) + if objType == CUDA_BATCH_MEM_OP_NODE_PARAMS_v1: - return sizeof(cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS_v1){{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS' in found_types}} + return sizeof(cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS_v1) + if objType == CUDA_BATCH_MEM_OP_NODE_PARAMS: - return sizeof(cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS){{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st' in found_struct}} + return sizeof(cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS) + if objType == CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st: - return sizeof(cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st){{endif}} - {{if 'CUDA_BATCH_MEM_OP_NODE_PARAMS_v2' in found_types}} + return sizeof(cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st) + if objType == CUDA_BATCH_MEM_OP_NODE_PARAMS_v2: - return sizeof(cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS_v2){{endif}} - {{if 'CUasyncNotificationInfo_st' in found_struct}} + return sizeof(cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS_v2) + if objType == CUasyncNotificationInfo_st: - return sizeof(cydriver.CUasyncNotificationInfo_st){{endif}} - {{if 'CUasyncNotificationInfo' in found_types}} + return sizeof(cydriver.CUasyncNotificationInfo_st) + if objType == CUasyncNotificationInfo: - return sizeof(cydriver.CUasyncNotificationInfo){{endif}} - {{if 'CUasyncCallback' in found_types}} + return sizeof(cydriver.CUasyncNotificationInfo) + if objType == CUasyncCallback: - return sizeof(cydriver.CUasyncCallback){{endif}} - {{if 'CUdevprop_st' in found_struct}} + return sizeof(cydriver.CUasyncCallback) + if objType == CUdevprop_st: - return sizeof(cydriver.CUdevprop_st){{endif}} - {{if 'CUdevprop_v1' in found_types}} + return sizeof(cydriver.CUdevprop_st) + if objType == CUdevprop_v1: - return sizeof(cydriver.CUdevprop_v1){{endif}} - {{if 'CUdevprop' in found_types}} + return sizeof(cydriver.CUdevprop_v1) + if objType == CUdevprop: - return sizeof(cydriver.CUdevprop){{endif}} - {{if 'CUlinkState' in found_types}} + return sizeof(cydriver.CUdevprop) + if objType == CUlinkState: - return sizeof(cydriver.CUlinkState){{endif}} - {{if 'CUhostFn' in found_types}} + return sizeof(cydriver.CUlinkState) + if objType == CUhostFn: - return sizeof(cydriver.CUhostFn){{endif}} - {{if 'CUaccessPolicyWindow_st' in found_struct}} + return sizeof(cydriver.CUhostFn) + if objType == CUaccessPolicyWindow_st: - return sizeof(cydriver.CUaccessPolicyWindow_st){{endif}} - {{if 'CUaccessPolicyWindow_v1' in found_types}} + return sizeof(cydriver.CUaccessPolicyWindow_st) + if objType == CUaccessPolicyWindow_v1: - return sizeof(cydriver.CUaccessPolicyWindow_v1){{endif}} - {{if 'CUaccessPolicyWindow' in found_types}} + return sizeof(cydriver.CUaccessPolicyWindow_v1) + if objType == CUaccessPolicyWindow: - return sizeof(cydriver.CUaccessPolicyWindow){{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_st' in found_struct}} + return sizeof(cydriver.CUaccessPolicyWindow) + if objType == CUDA_KERNEL_NODE_PARAMS_st: - return sizeof(cydriver.CUDA_KERNEL_NODE_PARAMS_st){{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v1' in found_types}} + return sizeof(cydriver.CUDA_KERNEL_NODE_PARAMS_st) + if objType == CUDA_KERNEL_NODE_PARAMS_v1: - return sizeof(cydriver.CUDA_KERNEL_NODE_PARAMS_v1){{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st' in found_struct}} + return sizeof(cydriver.CUDA_KERNEL_NODE_PARAMS_v1) + if objType == CUDA_KERNEL_NODE_PARAMS_v2_st: - return sizeof(cydriver.CUDA_KERNEL_NODE_PARAMS_v2_st){{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v2' in found_types}} + return sizeof(cydriver.CUDA_KERNEL_NODE_PARAMS_v2_st) + if objType == CUDA_KERNEL_NODE_PARAMS_v2: - return sizeof(cydriver.CUDA_KERNEL_NODE_PARAMS_v2){{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS' in found_types}} + return sizeof(cydriver.CUDA_KERNEL_NODE_PARAMS_v2) + if objType == CUDA_KERNEL_NODE_PARAMS: - return sizeof(cydriver.CUDA_KERNEL_NODE_PARAMS){{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st' in found_struct}} + return sizeof(cydriver.CUDA_KERNEL_NODE_PARAMS) + if objType == CUDA_KERNEL_NODE_PARAMS_v3_st: - return sizeof(cydriver.CUDA_KERNEL_NODE_PARAMS_v3_st){{endif}} - {{if 'CUDA_KERNEL_NODE_PARAMS_v3' in found_types}} + return sizeof(cydriver.CUDA_KERNEL_NODE_PARAMS_v3_st) + if objType == CUDA_KERNEL_NODE_PARAMS_v3: - return sizeof(cydriver.CUDA_KERNEL_NODE_PARAMS_v3){{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_st' in found_struct}} + return sizeof(cydriver.CUDA_KERNEL_NODE_PARAMS_v3) + if objType == CUDA_MEMSET_NODE_PARAMS_st: - return sizeof(cydriver.CUDA_MEMSET_NODE_PARAMS_st){{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v1' in found_types}} + return sizeof(cydriver.CUDA_MEMSET_NODE_PARAMS_st) + if objType == CUDA_MEMSET_NODE_PARAMS_v1: - return sizeof(cydriver.CUDA_MEMSET_NODE_PARAMS_v1){{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS' in found_types}} + return sizeof(cydriver.CUDA_MEMSET_NODE_PARAMS_v1) + if objType == CUDA_MEMSET_NODE_PARAMS: - return sizeof(cydriver.CUDA_MEMSET_NODE_PARAMS){{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2_st' in found_struct}} + return sizeof(cydriver.CUDA_MEMSET_NODE_PARAMS) + if objType == CUDA_MEMSET_NODE_PARAMS_v2_st: - return sizeof(cydriver.CUDA_MEMSET_NODE_PARAMS_v2_st){{endif}} - {{if 'CUDA_MEMSET_NODE_PARAMS_v2' in found_types}} + return sizeof(cydriver.CUDA_MEMSET_NODE_PARAMS_v2_st) + if objType == CUDA_MEMSET_NODE_PARAMS_v2: - return sizeof(cydriver.CUDA_MEMSET_NODE_PARAMS_v2){{endif}} - {{if 'CUDA_HOST_NODE_PARAMS_st' in found_struct}} + return sizeof(cydriver.CUDA_MEMSET_NODE_PARAMS_v2) + if objType == CUDA_HOST_NODE_PARAMS_st: - return sizeof(cydriver.CUDA_HOST_NODE_PARAMS_st){{endif}} - {{if 'CUDA_HOST_NODE_PARAMS_v1' in found_types}} + return sizeof(cydriver.CUDA_HOST_NODE_PARAMS_st) + if objType == CUDA_HOST_NODE_PARAMS_v1: - return sizeof(cydriver.CUDA_HOST_NODE_PARAMS_v1){{endif}} - {{if 'CUDA_HOST_NODE_PARAMS' in found_types}} + return sizeof(cydriver.CUDA_HOST_NODE_PARAMS_v1) + if objType == CUDA_HOST_NODE_PARAMS: - return sizeof(cydriver.CUDA_HOST_NODE_PARAMS){{endif}} - {{if 'CUDA_HOST_NODE_PARAMS_v2_st' in found_struct}} + return sizeof(cydriver.CUDA_HOST_NODE_PARAMS) + if objType == CUDA_HOST_NODE_PARAMS_v2_st: - return sizeof(cydriver.CUDA_HOST_NODE_PARAMS_v2_st){{endif}} - {{if 'CUDA_HOST_NODE_PARAMS_v2' in found_types}} + return sizeof(cydriver.CUDA_HOST_NODE_PARAMS_v2_st) + if objType == CUDA_HOST_NODE_PARAMS_v2: - return sizeof(cydriver.CUDA_HOST_NODE_PARAMS_v2){{endif}} - {{if 'CUDA_CONDITIONAL_NODE_PARAMS' in found_struct}} + return sizeof(cydriver.CUDA_HOST_NODE_PARAMS_v2) + if objType == CUDA_CONDITIONAL_NODE_PARAMS: - return sizeof(cydriver.CUDA_CONDITIONAL_NODE_PARAMS){{endif}} - {{if 'CUgraphEdgeData_st' in found_struct}} + return sizeof(cydriver.CUDA_CONDITIONAL_NODE_PARAMS) + if objType == CUgraphEdgeData_st: - return sizeof(cydriver.CUgraphEdgeData_st){{endif}} - {{if 'CUgraphEdgeData' in found_types}} + return sizeof(cydriver.CUgraphEdgeData_st) + if objType == CUgraphEdgeData: - return sizeof(cydriver.CUgraphEdgeData){{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS_st' in found_struct}} + return sizeof(cydriver.CUgraphEdgeData) + if objType == CUDA_GRAPH_INSTANTIATE_PARAMS_st: - return sizeof(cydriver.CUDA_GRAPH_INSTANTIATE_PARAMS_st){{endif}} - {{if 'CUDA_GRAPH_INSTANTIATE_PARAMS' in found_types}} + return sizeof(cydriver.CUDA_GRAPH_INSTANTIATE_PARAMS_st) + if objType == CUDA_GRAPH_INSTANTIATE_PARAMS: - return sizeof(cydriver.CUDA_GRAPH_INSTANTIATE_PARAMS){{endif}} - {{if 'CUlaunchMemSyncDomainMap_st' in found_struct}} + return sizeof(cydriver.CUDA_GRAPH_INSTANTIATE_PARAMS) + if objType == CUlaunchMemSyncDomainMap_st: - return sizeof(cydriver.CUlaunchMemSyncDomainMap_st){{endif}} - {{if 'CUlaunchMemSyncDomainMap' in found_types}} + return sizeof(cydriver.CUlaunchMemSyncDomainMap_st) + if objType == CUlaunchMemSyncDomainMap: - return sizeof(cydriver.CUlaunchMemSyncDomainMap){{endif}} - {{if 'CUlaunchAttributeValue_union' in found_struct}} + return sizeof(cydriver.CUlaunchMemSyncDomainMap) + if objType == CUlaunchAttributeValue_union: - return sizeof(cydriver.CUlaunchAttributeValue_union){{endif}} - {{if 'CUlaunchAttributeValue' in found_types}} + return sizeof(cydriver.CUlaunchAttributeValue_union) + if objType == CUlaunchAttributeValue: - return sizeof(cydriver.CUlaunchAttributeValue){{endif}} - {{if 'CUlaunchAttribute_st' in found_struct}} + return sizeof(cydriver.CUlaunchAttributeValue) + if objType == CUlaunchAttribute_st: - return sizeof(cydriver.CUlaunchAttribute_st){{endif}} - {{if 'CUlaunchAttribute' in found_types}} + return sizeof(cydriver.CUlaunchAttribute_st) + if objType == CUlaunchAttribute: - return sizeof(cydriver.CUlaunchAttribute){{endif}} - {{if 'CUlaunchConfig_st' in found_struct}} + return sizeof(cydriver.CUlaunchAttribute) + if objType == CUlaunchConfig_st: - return sizeof(cydriver.CUlaunchConfig_st){{endif}} - {{if 'CUlaunchConfig' in found_types}} + return sizeof(cydriver.CUlaunchConfig_st) + if objType == CUlaunchConfig: - return sizeof(cydriver.CUlaunchConfig){{endif}} - {{if 'CUkernelNodeAttrValue_v1' in found_types}} + return sizeof(cydriver.CUlaunchConfig) + if objType == CUkernelNodeAttrValue_v1: - return sizeof(cydriver.CUkernelNodeAttrValue_v1){{endif}} - {{if 'CUkernelNodeAttrValue' in found_types}} + return sizeof(cydriver.CUkernelNodeAttrValue_v1) + if objType == CUkernelNodeAttrValue: - return sizeof(cydriver.CUkernelNodeAttrValue){{endif}} - {{if 'CUstreamAttrValue_v1' in found_types}} + return sizeof(cydriver.CUkernelNodeAttrValue) + if objType == CUstreamAttrValue_v1: - return sizeof(cydriver.CUstreamAttrValue_v1){{endif}} - {{if 'CUstreamAttrValue' in found_types}} + return sizeof(cydriver.CUstreamAttrValue_v1) + if objType == CUstreamAttrValue: - return sizeof(cydriver.CUstreamAttrValue){{endif}} - {{if 'CUexecAffinitySmCount_st' in found_struct}} + return sizeof(cydriver.CUstreamAttrValue) + if objType == CUexecAffinitySmCount_st: - return sizeof(cydriver.CUexecAffinitySmCount_st){{endif}} - {{if 'CUexecAffinitySmCount_v1' in found_types}} + return sizeof(cydriver.CUexecAffinitySmCount_st) + if objType == CUexecAffinitySmCount_v1: - return sizeof(cydriver.CUexecAffinitySmCount_v1){{endif}} - {{if 'CUexecAffinitySmCount' in found_types}} + return sizeof(cydriver.CUexecAffinitySmCount_v1) + if objType == CUexecAffinitySmCount: - return sizeof(cydriver.CUexecAffinitySmCount){{endif}} - {{if 'CUexecAffinityParam_st' in found_struct}} + return sizeof(cydriver.CUexecAffinitySmCount) + if objType == CUexecAffinityParam_st: - return sizeof(cydriver.CUexecAffinityParam_st){{endif}} - {{if 'CUexecAffinityParam_v1' in found_types}} + return sizeof(cydriver.CUexecAffinityParam_st) + if objType == CUexecAffinityParam_v1: - return sizeof(cydriver.CUexecAffinityParam_v1){{endif}} - {{if 'CUexecAffinityParam' in found_types}} + return sizeof(cydriver.CUexecAffinityParam_v1) + if objType == CUexecAffinityParam: - return sizeof(cydriver.CUexecAffinityParam){{endif}} - {{if 'CUctxCigParam_st' in found_struct}} + return sizeof(cydriver.CUexecAffinityParam) + if objType == CUctxCigParam_st: - return sizeof(cydriver.CUctxCigParam_st){{endif}} - {{if 'CUctxCigParam' in found_types}} + return sizeof(cydriver.CUctxCigParam_st) + if objType == CUctxCigParam: - return sizeof(cydriver.CUctxCigParam){{endif}} - {{if 'CUctxCreateParams_st' in found_struct}} + return sizeof(cydriver.CUctxCigParam) + if objType == CUctxCreateParams_st: - return sizeof(cydriver.CUctxCreateParams_st){{endif}} - {{if 'CUctxCreateParams' in found_types}} + return sizeof(cydriver.CUctxCreateParams_st) + if objType == CUctxCreateParams: - return sizeof(cydriver.CUctxCreateParams){{endif}} - {{if 'CUstreamCigParam_st' in found_struct}} + return sizeof(cydriver.CUctxCreateParams) + if objType == CUstreamCigParam_st: - return sizeof(cydriver.CUstreamCigParam_st){{endif}} - {{if 'CUstreamCigParam' in found_types}} + return sizeof(cydriver.CUstreamCigParam_st) + if objType == CUstreamCigParam: - return sizeof(cydriver.CUstreamCigParam){{endif}} - {{if 'CUstreamCigCaptureParams_st' in found_struct}} + return sizeof(cydriver.CUstreamCigParam) + if objType == CUstreamCigCaptureParams_st: - return sizeof(cydriver.CUstreamCigCaptureParams_st){{endif}} - {{if 'CUstreamCigCaptureParams' in found_types}} + return sizeof(cydriver.CUstreamCigCaptureParams_st) + if objType == CUstreamCigCaptureParams: - return sizeof(cydriver.CUstreamCigCaptureParams){{endif}} - {{if 'CUlibraryHostUniversalFunctionAndDataTable_st' in found_struct}} + return sizeof(cydriver.CUstreamCigCaptureParams) + if objType == CUlibraryHostUniversalFunctionAndDataTable_st: - return sizeof(cydriver.CUlibraryHostUniversalFunctionAndDataTable_st){{endif}} - {{if 'CUlibraryHostUniversalFunctionAndDataTable' in found_types}} + return sizeof(cydriver.CUlibraryHostUniversalFunctionAndDataTable_st) + if objType == CUlibraryHostUniversalFunctionAndDataTable: - return sizeof(cydriver.CUlibraryHostUniversalFunctionAndDataTable){{endif}} - {{if 'CUstreamCallback' in found_types}} + return sizeof(cydriver.CUlibraryHostUniversalFunctionAndDataTable) + if objType == CUstreamCallback: - return sizeof(cydriver.CUstreamCallback){{endif}} - {{if 'CUoccupancyB2DSize' in found_types}} + return sizeof(cydriver.CUstreamCallback) + if objType == CUoccupancyB2DSize: - return sizeof(cydriver.CUoccupancyB2DSize){{endif}} - {{if 'CUDA_MEMCPY2D_st' in found_struct}} + return sizeof(cydriver.CUoccupancyB2DSize) + if objType == CUDA_MEMCPY2D_st: - return sizeof(cydriver.CUDA_MEMCPY2D_st){{endif}} - {{if 'CUDA_MEMCPY2D_v2' in found_types}} + return sizeof(cydriver.CUDA_MEMCPY2D_st) + if objType == CUDA_MEMCPY2D_v2: - return sizeof(cydriver.CUDA_MEMCPY2D_v2){{endif}} - {{if 'CUDA_MEMCPY2D' in found_types}} + return sizeof(cydriver.CUDA_MEMCPY2D_v2) + if objType == CUDA_MEMCPY2D: - return sizeof(cydriver.CUDA_MEMCPY2D){{endif}} - {{if 'CUDA_MEMCPY3D_st' in found_struct}} + return sizeof(cydriver.CUDA_MEMCPY2D) + if objType == CUDA_MEMCPY3D_st: - return sizeof(cydriver.CUDA_MEMCPY3D_st){{endif}} - {{if 'CUDA_MEMCPY3D_v2' in found_types}} + return sizeof(cydriver.CUDA_MEMCPY3D_st) + if objType == CUDA_MEMCPY3D_v2: - return sizeof(cydriver.CUDA_MEMCPY3D_v2){{endif}} - {{if 'CUDA_MEMCPY3D' in found_types}} + return sizeof(cydriver.CUDA_MEMCPY3D_v2) + if objType == CUDA_MEMCPY3D: - return sizeof(cydriver.CUDA_MEMCPY3D){{endif}} - {{if 'CUDA_MEMCPY3D_PEER_st' in found_struct}} + return sizeof(cydriver.CUDA_MEMCPY3D) + if objType == CUDA_MEMCPY3D_PEER_st: - return sizeof(cydriver.CUDA_MEMCPY3D_PEER_st){{endif}} - {{if 'CUDA_MEMCPY3D_PEER_v1' in found_types}} + return sizeof(cydriver.CUDA_MEMCPY3D_PEER_st) + if objType == CUDA_MEMCPY3D_PEER_v1: - return sizeof(cydriver.CUDA_MEMCPY3D_PEER_v1){{endif}} - {{if 'CUDA_MEMCPY3D_PEER' in found_types}} + return sizeof(cydriver.CUDA_MEMCPY3D_PEER_v1) + if objType == CUDA_MEMCPY3D_PEER: - return sizeof(cydriver.CUDA_MEMCPY3D_PEER){{endif}} - {{if 'CUDA_MEMCPY_NODE_PARAMS_st' in found_struct}} + return sizeof(cydriver.CUDA_MEMCPY3D_PEER) + if objType == CUDA_MEMCPY_NODE_PARAMS_st: - return sizeof(cydriver.CUDA_MEMCPY_NODE_PARAMS_st){{endif}} - {{if 'CUDA_MEMCPY_NODE_PARAMS' in found_types}} + return sizeof(cydriver.CUDA_MEMCPY_NODE_PARAMS_st) + if objType == CUDA_MEMCPY_NODE_PARAMS: - return sizeof(cydriver.CUDA_MEMCPY_NODE_PARAMS){{endif}} - {{if 'CUDA_ARRAY_DESCRIPTOR_st' in found_struct}} + return sizeof(cydriver.CUDA_MEMCPY_NODE_PARAMS) + if objType == CUDA_ARRAY_DESCRIPTOR_st: - return sizeof(cydriver.CUDA_ARRAY_DESCRIPTOR_st){{endif}} - {{if 'CUDA_ARRAY_DESCRIPTOR_v2' in found_types}} + return sizeof(cydriver.CUDA_ARRAY_DESCRIPTOR_st) + if objType == CUDA_ARRAY_DESCRIPTOR_v2: - return sizeof(cydriver.CUDA_ARRAY_DESCRIPTOR_v2){{endif}} - {{if 'CUDA_ARRAY_DESCRIPTOR' in found_types}} + return sizeof(cydriver.CUDA_ARRAY_DESCRIPTOR_v2) + if objType == CUDA_ARRAY_DESCRIPTOR: - return sizeof(cydriver.CUDA_ARRAY_DESCRIPTOR){{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_st' in found_struct}} + return sizeof(cydriver.CUDA_ARRAY_DESCRIPTOR) + if objType == CUDA_ARRAY3D_DESCRIPTOR_st: - return sizeof(cydriver.CUDA_ARRAY3D_DESCRIPTOR_st){{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR_v2' in found_types}} + return sizeof(cydriver.CUDA_ARRAY3D_DESCRIPTOR_st) + if objType == CUDA_ARRAY3D_DESCRIPTOR_v2: - return sizeof(cydriver.CUDA_ARRAY3D_DESCRIPTOR_v2){{endif}} - {{if 'CUDA_ARRAY3D_DESCRIPTOR' in found_types}} + return sizeof(cydriver.CUDA_ARRAY3D_DESCRIPTOR_v2) + if objType == CUDA_ARRAY3D_DESCRIPTOR: - return sizeof(cydriver.CUDA_ARRAY3D_DESCRIPTOR){{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st' in found_struct}} + return sizeof(cydriver.CUDA_ARRAY3D_DESCRIPTOR) + if objType == CUDA_ARRAY_SPARSE_PROPERTIES_st: - return sizeof(cydriver.CUDA_ARRAY_SPARSE_PROPERTIES_st){{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_v1' in found_types}} + return sizeof(cydriver.CUDA_ARRAY_SPARSE_PROPERTIES_st) + if objType == CUDA_ARRAY_SPARSE_PROPERTIES_v1: - return sizeof(cydriver.CUDA_ARRAY_SPARSE_PROPERTIES_v1){{endif}} - {{if 'CUDA_ARRAY_SPARSE_PROPERTIES' in found_types}} + return sizeof(cydriver.CUDA_ARRAY_SPARSE_PROPERTIES_v1) + if objType == CUDA_ARRAY_SPARSE_PROPERTIES: - return sizeof(cydriver.CUDA_ARRAY_SPARSE_PROPERTIES){{endif}} - {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st' in found_struct}} + return sizeof(cydriver.CUDA_ARRAY_SPARSE_PROPERTIES) + if objType == CUDA_ARRAY_MEMORY_REQUIREMENTS_st: - return sizeof(cydriver.CUDA_ARRAY_MEMORY_REQUIREMENTS_st){{endif}} - {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_v1' in found_types}} + return sizeof(cydriver.CUDA_ARRAY_MEMORY_REQUIREMENTS_st) + if objType == CUDA_ARRAY_MEMORY_REQUIREMENTS_v1: - return sizeof(cydriver.CUDA_ARRAY_MEMORY_REQUIREMENTS_v1){{endif}} - {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS' in found_types}} + return sizeof(cydriver.CUDA_ARRAY_MEMORY_REQUIREMENTS_v1) + if objType == CUDA_ARRAY_MEMORY_REQUIREMENTS: - return sizeof(cydriver.CUDA_ARRAY_MEMORY_REQUIREMENTS){{endif}} - {{if 'CUDA_RESOURCE_DESC_st' in found_struct}} + return sizeof(cydriver.CUDA_ARRAY_MEMORY_REQUIREMENTS) + if objType == CUDA_RESOURCE_DESC_st: - return sizeof(cydriver.CUDA_RESOURCE_DESC_st){{endif}} - {{if 'CUDA_RESOURCE_DESC_v1' in found_types}} + return sizeof(cydriver.CUDA_RESOURCE_DESC_st) + if objType == CUDA_RESOURCE_DESC_v1: - return sizeof(cydriver.CUDA_RESOURCE_DESC_v1){{endif}} - {{if 'CUDA_RESOURCE_DESC' in found_types}} + return sizeof(cydriver.CUDA_RESOURCE_DESC_v1) + if objType == CUDA_RESOURCE_DESC: - return sizeof(cydriver.CUDA_RESOURCE_DESC){{endif}} - {{if 'CUDA_TEXTURE_DESC_st' in found_struct}} + return sizeof(cydriver.CUDA_RESOURCE_DESC) + if objType == CUDA_TEXTURE_DESC_st: - return sizeof(cydriver.CUDA_TEXTURE_DESC_st){{endif}} - {{if 'CUDA_TEXTURE_DESC_v1' in found_types}} + return sizeof(cydriver.CUDA_TEXTURE_DESC_st) + if objType == CUDA_TEXTURE_DESC_v1: - return sizeof(cydriver.CUDA_TEXTURE_DESC_v1){{endif}} - {{if 'CUDA_TEXTURE_DESC' in found_types}} + return sizeof(cydriver.CUDA_TEXTURE_DESC_v1) + if objType == CUDA_TEXTURE_DESC: - return sizeof(cydriver.CUDA_TEXTURE_DESC){{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_st' in found_struct}} + return sizeof(cydriver.CUDA_TEXTURE_DESC) + if objType == CUDA_RESOURCE_VIEW_DESC_st: - return sizeof(cydriver.CUDA_RESOURCE_VIEW_DESC_st){{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC_v1' in found_types}} + return sizeof(cydriver.CUDA_RESOURCE_VIEW_DESC_st) + if objType == CUDA_RESOURCE_VIEW_DESC_v1: - return sizeof(cydriver.CUDA_RESOURCE_VIEW_DESC_v1){{endif}} - {{if 'CUDA_RESOURCE_VIEW_DESC' in found_types}} + return sizeof(cydriver.CUDA_RESOURCE_VIEW_DESC_v1) + if objType == CUDA_RESOURCE_VIEW_DESC: - return sizeof(cydriver.CUDA_RESOURCE_VIEW_DESC){{endif}} - {{if 'CUtensorMap_st' in found_struct}} + return sizeof(cydriver.CUDA_RESOURCE_VIEW_DESC) + if objType == CUtensorMap_st: - return sizeof(cydriver.CUtensorMap_st){{endif}} - {{if 'CUtensorMap' in found_types}} + return sizeof(cydriver.CUtensorMap_st) + if objType == CUtensorMap: - return sizeof(cydriver.CUtensorMap){{endif}} - {{if 'CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st' in found_struct}} + return sizeof(cydriver.CUtensorMap) + if objType == CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st: - return sizeof(cydriver.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st){{endif}} - {{if 'CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1' in found_types}} + return sizeof(cydriver.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st) + if objType == CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1: - return sizeof(cydriver.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1){{endif}} - {{if 'CUDA_POINTER_ATTRIBUTE_P2P_TOKENS' in found_types}} + return sizeof(cydriver.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1) + if objType == CUDA_POINTER_ATTRIBUTE_P2P_TOKENS: - return sizeof(cydriver.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS){{endif}} - {{if 'CUDA_LAUNCH_PARAMS_st' in found_struct}} + return sizeof(cydriver.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS) + if objType == CUDA_LAUNCH_PARAMS_st: - return sizeof(cydriver.CUDA_LAUNCH_PARAMS_st){{endif}} - {{if 'CUDA_LAUNCH_PARAMS_v1' in found_types}} + return sizeof(cydriver.CUDA_LAUNCH_PARAMS_st) + if objType == CUDA_LAUNCH_PARAMS_v1: - return sizeof(cydriver.CUDA_LAUNCH_PARAMS_v1){{endif}} - {{if 'CUDA_LAUNCH_PARAMS' in found_types}} + return sizeof(cydriver.CUDA_LAUNCH_PARAMS_v1) + if objType == CUDA_LAUNCH_PARAMS: - return sizeof(cydriver.CUDA_LAUNCH_PARAMS){{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st' in found_struct}} + return sizeof(cydriver.CUDA_LAUNCH_PARAMS) + if objType == CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: - return sizeof(cydriver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st){{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1' in found_types}} + return sizeof(cydriver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st) + if objType == CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1: - return sizeof(cydriver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1){{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC' in found_types}} + return sizeof(cydriver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1) + if objType == CUDA_EXTERNAL_MEMORY_HANDLE_DESC: - return sizeof(cydriver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC){{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st' in found_struct}} + return sizeof(cydriver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC) + if objType == CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st: - return sizeof(cydriver.CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st){{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1' in found_types}} + return sizeof(cydriver.CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st) + if objType == CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1: - return sizeof(cydriver.CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1){{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC' in found_types}} + return sizeof(cydriver.CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1) + if objType == CUDA_EXTERNAL_MEMORY_BUFFER_DESC: - return sizeof(cydriver.CUDA_EXTERNAL_MEMORY_BUFFER_DESC){{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st' in found_struct}} + return sizeof(cydriver.CUDA_EXTERNAL_MEMORY_BUFFER_DESC) + if objType == CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st: - return sizeof(cydriver.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st){{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1' in found_types}} + return sizeof(cydriver.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st) + if objType == CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1: - return sizeof(cydriver.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1){{endif}} - {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC' in found_types}} + return sizeof(cydriver.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1) + if objType == CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC: - return sizeof(cydriver.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC){{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st' in found_struct}} + return sizeof(cydriver.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC) + if objType == CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: - return sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st){{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1' in found_types}} + return sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st) + if objType == CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1: - return sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1){{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC' in found_types}} + return sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1) + if objType == CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC: - return sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC){{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st' in found_struct}} + return sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC) + if objType == CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st: - return sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st){{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1' in found_types}} + return sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st) + if objType == CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1: - return sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1){{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS' in found_types}} + return sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1) + if objType == CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS: - return sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS){{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st' in found_struct}} + return sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS) + if objType == CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st: - return sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st){{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1' in found_types}} + return sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st) + if objType == CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1: - return sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1){{endif}} - {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS' in found_types}} + return sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1) + if objType == CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS: - return sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS){{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st' in found_struct}} + return sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS) + if objType == CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st: - return sizeof(cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st){{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1' in found_types}} + return sizeof(cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st) + if objType == CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1: - return sizeof(cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1){{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS' in found_types}} + return sizeof(cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1) + if objType == CUDA_EXT_SEM_SIGNAL_NODE_PARAMS: - return sizeof(cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS){{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st' in found_struct}} + return sizeof(cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS) + if objType == CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: - return sizeof(cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st){{endif}} - {{if 'CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2' in found_types}} + return sizeof(cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st) + if objType == CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2: - return sizeof(cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2){{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_st' in found_struct}} + return sizeof(cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2) + if objType == CUDA_EXT_SEM_WAIT_NODE_PARAMS_st: - return sizeof(cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_st){{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1' in found_types}} + return sizeof(cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_st) + if objType == CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1: - return sizeof(cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1){{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS' in found_types}} + return sizeof(cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1) + if objType == CUDA_EXT_SEM_WAIT_NODE_PARAMS: - return sizeof(cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS){{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st' in found_struct}} + return sizeof(cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS) + if objType == CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st: - return sizeof(cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st){{endif}} - {{if 'CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2' in found_types}} + return sizeof(cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st) + if objType == CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2: - return sizeof(cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2){{endif}} - {{if 'CUmemGenericAllocationHandle_v1' in found_types}} + return sizeof(cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2) + if objType == CUmemGenericAllocationHandle_v1: - return sizeof(cydriver.CUmemGenericAllocationHandle_v1){{endif}} - {{if 'CUmemGenericAllocationHandle' in found_types}} + return sizeof(cydriver.CUmemGenericAllocationHandle_v1) + if objType == CUmemGenericAllocationHandle: - return sizeof(cydriver.CUmemGenericAllocationHandle){{endif}} - {{if 'CUarrayMapInfo_st' in found_struct}} + return sizeof(cydriver.CUmemGenericAllocationHandle) + if objType == CUarrayMapInfo_st: - return sizeof(cydriver.CUarrayMapInfo_st){{endif}} - {{if 'CUarrayMapInfo_v1' in found_types}} + return sizeof(cydriver.CUarrayMapInfo_st) + if objType == CUarrayMapInfo_v1: - return sizeof(cydriver.CUarrayMapInfo_v1){{endif}} - {{if 'CUarrayMapInfo' in found_types}} + return sizeof(cydriver.CUarrayMapInfo_v1) + if objType == CUarrayMapInfo: - return sizeof(cydriver.CUarrayMapInfo){{endif}} - {{if 'CUmemLocation_st' in found_struct}} + return sizeof(cydriver.CUarrayMapInfo) + if objType == CUmemLocation_st: - return sizeof(cydriver.CUmemLocation_st){{endif}} - {{if 'CUmemLocation_v1' in found_types}} + return sizeof(cydriver.CUmemLocation_st) + if objType == CUmemLocation_v1: - return sizeof(cydriver.CUmemLocation_v1){{endif}} - {{if 'CUmemLocation' in found_types}} + return sizeof(cydriver.CUmemLocation_v1) + if objType == CUmemLocation: - return sizeof(cydriver.CUmemLocation){{endif}} - {{if 'CUmemAllocationProp_st' in found_struct}} + return sizeof(cydriver.CUmemLocation) + if objType == CUmemAllocationProp_st: - return sizeof(cydriver.CUmemAllocationProp_st){{endif}} - {{if 'CUmemAllocationProp_v1' in found_types}} + return sizeof(cydriver.CUmemAllocationProp_st) + if objType == CUmemAllocationProp_v1: - return sizeof(cydriver.CUmemAllocationProp_v1){{endif}} - {{if 'CUmemAllocationProp' in found_types}} + return sizeof(cydriver.CUmemAllocationProp_v1) + if objType == CUmemAllocationProp: - return sizeof(cydriver.CUmemAllocationProp){{endif}} - {{if 'CUmulticastObjectProp_st' in found_struct}} + return sizeof(cydriver.CUmemAllocationProp) + if objType == CUmulticastObjectProp_st: - return sizeof(cydriver.CUmulticastObjectProp_st){{endif}} - {{if 'CUmulticastObjectProp_v1' in found_types}} + return sizeof(cydriver.CUmulticastObjectProp_st) + if objType == CUmulticastObjectProp_v1: - return sizeof(cydriver.CUmulticastObjectProp_v1){{endif}} - {{if 'CUmulticastObjectProp' in found_types}} + return sizeof(cydriver.CUmulticastObjectProp_v1) + if objType == CUmulticastObjectProp: - return sizeof(cydriver.CUmulticastObjectProp){{endif}} - {{if 'CUmemAccessDesc_st' in found_struct}} + return sizeof(cydriver.CUmulticastObjectProp) + if objType == CUmemAccessDesc_st: - return sizeof(cydriver.CUmemAccessDesc_st){{endif}} - {{if 'CUmemAccessDesc_v1' in found_types}} + return sizeof(cydriver.CUmemAccessDesc_st) + if objType == CUmemAccessDesc_v1: - return sizeof(cydriver.CUmemAccessDesc_v1){{endif}} - {{if 'CUmemAccessDesc' in found_types}} + return sizeof(cydriver.CUmemAccessDesc_v1) + if objType == CUmemAccessDesc: - return sizeof(cydriver.CUmemAccessDesc){{endif}} - {{if 'CUgraphExecUpdateResultInfo_st' in found_struct}} + return sizeof(cydriver.CUmemAccessDesc) + if objType == CUgraphExecUpdateResultInfo_st: - return sizeof(cydriver.CUgraphExecUpdateResultInfo_st){{endif}} - {{if 'CUgraphExecUpdateResultInfo_v1' in found_types}} + return sizeof(cydriver.CUgraphExecUpdateResultInfo_st) + if objType == CUgraphExecUpdateResultInfo_v1: - return sizeof(cydriver.CUgraphExecUpdateResultInfo_v1){{endif}} - {{if 'CUgraphExecUpdateResultInfo' in found_types}} + return sizeof(cydriver.CUgraphExecUpdateResultInfo_v1) + if objType == CUgraphExecUpdateResultInfo: - return sizeof(cydriver.CUgraphExecUpdateResultInfo){{endif}} - {{if 'CUmemPoolProps_st' in found_struct}} + return sizeof(cydriver.CUgraphExecUpdateResultInfo) + if objType == CUmemPoolProps_st: - return sizeof(cydriver.CUmemPoolProps_st){{endif}} - {{if 'CUmemPoolProps_v1' in found_types}} + return sizeof(cydriver.CUmemPoolProps_st) + if objType == CUmemPoolProps_v1: - return sizeof(cydriver.CUmemPoolProps_v1){{endif}} - {{if 'CUmemPoolProps' in found_types}} + return sizeof(cydriver.CUmemPoolProps_v1) + if objType == CUmemPoolProps: - return sizeof(cydriver.CUmemPoolProps){{endif}} - {{if 'CUmemPoolPtrExportData_st' in found_struct}} + return sizeof(cydriver.CUmemPoolProps) + if objType == CUmemPoolPtrExportData_st: - return sizeof(cydriver.CUmemPoolPtrExportData_st){{endif}} - {{if 'CUmemPoolPtrExportData_v1' in found_types}} + return sizeof(cydriver.CUmemPoolPtrExportData_st) + if objType == CUmemPoolPtrExportData_v1: - return sizeof(cydriver.CUmemPoolPtrExportData_v1){{endif}} - {{if 'CUmemPoolPtrExportData' in found_types}} + return sizeof(cydriver.CUmemPoolPtrExportData_v1) + if objType == CUmemPoolPtrExportData: - return sizeof(cydriver.CUmemPoolPtrExportData){{endif}} - {{if 'CUmemcpyAttributes_st' in found_struct}} + return sizeof(cydriver.CUmemPoolPtrExportData) + if objType == CUmemcpyAttributes_st: - return sizeof(cydriver.CUmemcpyAttributes_st){{endif}} - {{if 'CUmemcpyAttributes_v1' in found_types}} + return sizeof(cydriver.CUmemcpyAttributes_st) + if objType == CUmemcpyAttributes_v1: - return sizeof(cydriver.CUmemcpyAttributes_v1){{endif}} - {{if 'CUmemcpyAttributes' in found_types}} + return sizeof(cydriver.CUmemcpyAttributes_v1) + if objType == CUmemcpyAttributes: - return sizeof(cydriver.CUmemcpyAttributes){{endif}} - {{if 'CUoffset3D_st' in found_struct}} + return sizeof(cydriver.CUmemcpyAttributes) + if objType == CUoffset3D_st: - return sizeof(cydriver.CUoffset3D_st){{endif}} - {{if 'CUoffset3D_v1' in found_types}} + return sizeof(cydriver.CUoffset3D_st) + if objType == CUoffset3D_v1: - return sizeof(cydriver.CUoffset3D_v1){{endif}} - {{if 'CUoffset3D' in found_types}} + return sizeof(cydriver.CUoffset3D_v1) + if objType == CUoffset3D: - return sizeof(cydriver.CUoffset3D){{endif}} - {{if 'CUextent3D_st' in found_struct}} + return sizeof(cydriver.CUoffset3D) + if objType == CUextent3D_st: - return sizeof(cydriver.CUextent3D_st){{endif}} - {{if 'CUextent3D_v1' in found_types}} + return sizeof(cydriver.CUextent3D_st) + if objType == CUextent3D_v1: - return sizeof(cydriver.CUextent3D_v1){{endif}} - {{if 'CUextent3D' in found_types}} + return sizeof(cydriver.CUextent3D_v1) + if objType == CUextent3D: - return sizeof(cydriver.CUextent3D){{endif}} - {{if 'CUmemcpy3DOperand_st' in found_struct}} + return sizeof(cydriver.CUextent3D) + if objType == CUmemcpy3DOperand_st: - return sizeof(cydriver.CUmemcpy3DOperand_st){{endif}} - {{if 'CUmemcpy3DOperand_v1' in found_types}} + return sizeof(cydriver.CUmemcpy3DOperand_st) + if objType == CUmemcpy3DOperand_v1: - return sizeof(cydriver.CUmemcpy3DOperand_v1){{endif}} - {{if 'CUmemcpy3DOperand' in found_types}} + return sizeof(cydriver.CUmemcpy3DOperand_v1) + if objType == CUmemcpy3DOperand: - return sizeof(cydriver.CUmemcpy3DOperand){{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_st' in found_struct}} + return sizeof(cydriver.CUmemcpy3DOperand) + if objType == CUDA_MEMCPY3D_BATCH_OP_st: - return sizeof(cydriver.CUDA_MEMCPY3D_BATCH_OP_st){{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP_v1' in found_types}} + return sizeof(cydriver.CUDA_MEMCPY3D_BATCH_OP_st) + if objType == CUDA_MEMCPY3D_BATCH_OP_v1: - return sizeof(cydriver.CUDA_MEMCPY3D_BATCH_OP_v1){{endif}} - {{if 'CUDA_MEMCPY3D_BATCH_OP' in found_types}} + return sizeof(cydriver.CUDA_MEMCPY3D_BATCH_OP_v1) + if objType == CUDA_MEMCPY3D_BATCH_OP: - return sizeof(cydriver.CUDA_MEMCPY3D_BATCH_OP){{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1_st' in found_struct}} + return sizeof(cydriver.CUDA_MEMCPY3D_BATCH_OP) + if objType == CUDA_MEM_ALLOC_NODE_PARAMS_v1_st: - return sizeof(cydriver.CUDA_MEM_ALLOC_NODE_PARAMS_v1_st){{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v1' in found_types}} + return sizeof(cydriver.CUDA_MEM_ALLOC_NODE_PARAMS_v1_st) + if objType == CUDA_MEM_ALLOC_NODE_PARAMS_v1: - return sizeof(cydriver.CUDA_MEM_ALLOC_NODE_PARAMS_v1){{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS' in found_types}} + return sizeof(cydriver.CUDA_MEM_ALLOC_NODE_PARAMS_v1) + if objType == CUDA_MEM_ALLOC_NODE_PARAMS: - return sizeof(cydriver.CUDA_MEM_ALLOC_NODE_PARAMS){{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2_st' in found_struct}} + return sizeof(cydriver.CUDA_MEM_ALLOC_NODE_PARAMS) + if objType == CUDA_MEM_ALLOC_NODE_PARAMS_v2_st: - return sizeof(cydriver.CUDA_MEM_ALLOC_NODE_PARAMS_v2_st){{endif}} - {{if 'CUDA_MEM_ALLOC_NODE_PARAMS_v2' in found_types}} + return sizeof(cydriver.CUDA_MEM_ALLOC_NODE_PARAMS_v2_st) + if objType == CUDA_MEM_ALLOC_NODE_PARAMS_v2: - return sizeof(cydriver.CUDA_MEM_ALLOC_NODE_PARAMS_v2){{endif}} - {{if 'CUDA_MEM_FREE_NODE_PARAMS_st' in found_struct}} + return sizeof(cydriver.CUDA_MEM_ALLOC_NODE_PARAMS_v2) + if objType == CUDA_MEM_FREE_NODE_PARAMS_st: - return sizeof(cydriver.CUDA_MEM_FREE_NODE_PARAMS_st){{endif}} - {{if 'CUDA_MEM_FREE_NODE_PARAMS' in found_types}} + return sizeof(cydriver.CUDA_MEM_FREE_NODE_PARAMS_st) + if objType == CUDA_MEM_FREE_NODE_PARAMS: - return sizeof(cydriver.CUDA_MEM_FREE_NODE_PARAMS){{endif}} - {{if 'CUDA_CHILD_GRAPH_NODE_PARAMS_st' in found_struct}} + return sizeof(cydriver.CUDA_MEM_FREE_NODE_PARAMS) + if objType == CUDA_CHILD_GRAPH_NODE_PARAMS_st: - return sizeof(cydriver.CUDA_CHILD_GRAPH_NODE_PARAMS_st){{endif}} - {{if 'CUDA_CHILD_GRAPH_NODE_PARAMS' in found_types}} + return sizeof(cydriver.CUDA_CHILD_GRAPH_NODE_PARAMS_st) + if objType == CUDA_CHILD_GRAPH_NODE_PARAMS: - return sizeof(cydriver.CUDA_CHILD_GRAPH_NODE_PARAMS){{endif}} - {{if 'CUDA_EVENT_RECORD_NODE_PARAMS_st' in found_struct}} + return sizeof(cydriver.CUDA_CHILD_GRAPH_NODE_PARAMS) + if objType == CUDA_EVENT_RECORD_NODE_PARAMS_st: - return sizeof(cydriver.CUDA_EVENT_RECORD_NODE_PARAMS_st){{endif}} - {{if 'CUDA_EVENT_RECORD_NODE_PARAMS' in found_types}} + return sizeof(cydriver.CUDA_EVENT_RECORD_NODE_PARAMS_st) + if objType == CUDA_EVENT_RECORD_NODE_PARAMS: - return sizeof(cydriver.CUDA_EVENT_RECORD_NODE_PARAMS){{endif}} - {{if 'CUDA_EVENT_WAIT_NODE_PARAMS_st' in found_struct}} + return sizeof(cydriver.CUDA_EVENT_RECORD_NODE_PARAMS) + if objType == CUDA_EVENT_WAIT_NODE_PARAMS_st: - return sizeof(cydriver.CUDA_EVENT_WAIT_NODE_PARAMS_st){{endif}} - {{if 'CUDA_EVENT_WAIT_NODE_PARAMS' in found_types}} + return sizeof(cydriver.CUDA_EVENT_WAIT_NODE_PARAMS_st) + if objType == CUDA_EVENT_WAIT_NODE_PARAMS: - return sizeof(cydriver.CUDA_EVENT_WAIT_NODE_PARAMS){{endif}} - {{if 'CUgraphNodeParams_st' in found_struct}} + return sizeof(cydriver.CUDA_EVENT_WAIT_NODE_PARAMS) + if objType == CUgraphNodeParams_st: - return sizeof(cydriver.CUgraphNodeParams_st){{endif}} - {{if 'CUgraphNodeParams' in found_types}} + return sizeof(cydriver.CUgraphNodeParams_st) + if objType == CUgraphNodeParams: - return sizeof(cydriver.CUgraphNodeParams){{endif}} - {{if 'CUcheckpointLockArgs_st' in found_struct}} + return sizeof(cydriver.CUgraphNodeParams) + if objType == CUcheckpointLockArgs_st: - return sizeof(cydriver.CUcheckpointLockArgs_st){{endif}} - {{if 'CUcheckpointLockArgs' in found_types}} + return sizeof(cydriver.CUcheckpointLockArgs_st) + if objType == CUcheckpointLockArgs: - return sizeof(cydriver.CUcheckpointLockArgs){{endif}} - {{if 'CUcheckpointCheckpointArgs_st' in found_struct}} + return sizeof(cydriver.CUcheckpointLockArgs) + if objType == CUcheckpointCheckpointArgs_st: - return sizeof(cydriver.CUcheckpointCheckpointArgs_st){{endif}} - {{if 'CUcheckpointCheckpointArgs' in found_types}} + return sizeof(cydriver.CUcheckpointCheckpointArgs_st) + if objType == CUcheckpointCheckpointArgs: - return sizeof(cydriver.CUcheckpointCheckpointArgs){{endif}} - {{if 'CUcheckpointGpuPair_st' in found_struct}} + return sizeof(cydriver.CUcheckpointCheckpointArgs) + if objType == CUcheckpointGpuPair_st: - return sizeof(cydriver.CUcheckpointGpuPair_st){{endif}} - {{if 'CUcheckpointGpuPair' in found_types}} + return sizeof(cydriver.CUcheckpointGpuPair_st) + if objType == CUcheckpointGpuPair: - return sizeof(cydriver.CUcheckpointGpuPair){{endif}} - {{if 'CUcheckpointRestoreArgs_st' in found_struct}} + return sizeof(cydriver.CUcheckpointGpuPair) + if objType == CUcheckpointRestoreArgs_st: - return sizeof(cydriver.CUcheckpointRestoreArgs_st){{endif}} - {{if 'CUcheckpointRestoreArgs' in found_types}} + return sizeof(cydriver.CUcheckpointRestoreArgs_st) + if objType == CUcheckpointRestoreArgs: - return sizeof(cydriver.CUcheckpointRestoreArgs){{endif}} - {{if 'CUcheckpointUnlockArgs_st' in found_struct}} + return sizeof(cydriver.CUcheckpointRestoreArgs) + if objType == CUcheckpointUnlockArgs_st: - return sizeof(cydriver.CUcheckpointUnlockArgs_st){{endif}} - {{if 'CUcheckpointUnlockArgs' in found_types}} + return sizeof(cydriver.CUcheckpointUnlockArgs_st) + if objType == CUcheckpointUnlockArgs: - return sizeof(cydriver.CUcheckpointUnlockArgs){{endif}} - {{if 'CUmemDecompressParams_st' in found_struct}} + return sizeof(cydriver.CUcheckpointUnlockArgs) + if objType == CUmemDecompressParams_st: - return sizeof(cydriver.CUmemDecompressParams_st){{endif}} - {{if 'CUmemDecompressParams' in found_types}} + return sizeof(cydriver.CUmemDecompressParams_st) + if objType == CUmemDecompressParams: - return sizeof(cydriver.CUmemDecompressParams){{endif}} - {{if 'CUcoredumpCallbackHandle' in found_types}} + return sizeof(cydriver.CUmemDecompressParams) + + if objType == CUlogicalEndpointId: + return sizeof(cydriver.CUlogicalEndpointId) + + if objType == CUlogicalEndpointFabricHandle_st: + return sizeof(cydriver.CUlogicalEndpointFabricHandle_st) + + if objType == CUlogicalEndpointFabricHandle: + return sizeof(cydriver.CUlogicalEndpointFabricHandle) + + if objType == CUlogicalEndpointProp_struct: + return sizeof(cydriver.CUlogicalEndpointProp_struct) + + if objType == CUlogicalEndpointProp: + return sizeof(cydriver.CUlogicalEndpointProp) + + if objType == CUgraphRecaptureCallback: + return sizeof(cydriver.CUgraphRecaptureCallback) + if objType == CUcoredumpCallbackHandle: - return sizeof(cydriver.CUcoredumpCallbackHandle){{endif}} - {{if 'CUcoredumpStatusCallback' in found_types}} + return sizeof(cydriver.CUcoredumpCallbackHandle) + if objType == CUcoredumpStatusCallback: - return sizeof(cydriver.CUcoredumpStatusCallback){{endif}} - {{if 'CUdevResourceDesc' in found_types}} + return sizeof(cydriver.CUcoredumpStatusCallback) + if objType == CUdevResourceDesc: - return sizeof(cydriver.CUdevResourceDesc){{endif}} - {{if 'CUdevSmResource_st' in found_struct}} + return sizeof(cydriver.CUdevResourceDesc) + if objType == CUdevSmResource_st: - return sizeof(cydriver.CUdevSmResource_st){{endif}} - {{if 'CUdevSmResource' in found_types}} + return sizeof(cydriver.CUdevSmResource_st) + if objType == CUdevSmResource: - return sizeof(cydriver.CUdevSmResource){{endif}} - {{if 'CUdevWorkqueueConfigResource_st' in found_struct}} + return sizeof(cydriver.CUdevSmResource) + if objType == CUdevWorkqueueConfigResource_st: - return sizeof(cydriver.CUdevWorkqueueConfigResource_st){{endif}} - {{if 'CUdevWorkqueueConfigResource' in found_types}} + return sizeof(cydriver.CUdevWorkqueueConfigResource_st) + if objType == CUdevWorkqueueConfigResource: - return sizeof(cydriver.CUdevWorkqueueConfigResource){{endif}} - {{if 'CUdevWorkqueueResource_st' in found_struct}} + return sizeof(cydriver.CUdevWorkqueueConfigResource) + if objType == CUdevWorkqueueResource_st: - return sizeof(cydriver.CUdevWorkqueueResource_st){{endif}} - {{if 'CUdevWorkqueueResource' in found_types}} + return sizeof(cydriver.CUdevWorkqueueResource_st) + if objType == CUdevWorkqueueResource: - return sizeof(cydriver.CUdevWorkqueueResource){{endif}} - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS_st' in found_struct}} + return sizeof(cydriver.CUdevWorkqueueResource) + if objType == CU_DEV_SM_RESOURCE_GROUP_PARAMS_st: - return sizeof(cydriver.CU_DEV_SM_RESOURCE_GROUP_PARAMS_st){{endif}} - {{if 'CU_DEV_SM_RESOURCE_GROUP_PARAMS' in found_types}} + return sizeof(cydriver.CU_DEV_SM_RESOURCE_GROUP_PARAMS_st) + if objType == CU_DEV_SM_RESOURCE_GROUP_PARAMS: - return sizeof(cydriver.CU_DEV_SM_RESOURCE_GROUP_PARAMS){{endif}} - {{if 'CUdevResource_st' in found_struct}} + return sizeof(cydriver.CU_DEV_SM_RESOURCE_GROUP_PARAMS) + if objType == CUdevResource_st: - return sizeof(cydriver.CUdevResource_st){{endif}} - {{if 'struct CUdevResource_st' in found_types}} + return sizeof(cydriver.CUdevResource_st) + if objType == CUdevResource_v1: - return sizeof(cydriver.CUdevResource_v1){{endif}} - {{if 'struct CUdevResource_st' in found_types}} + return sizeof(cydriver.CUdevResource_v1) + if objType == CUdevResource: - return sizeof(cydriver.CUdevResource){{endif}} - {{if 'CUlogsCallbackHandle' in found_types}} + return sizeof(cydriver.CUdevResource) + if objType == CUlogsCallbackHandle: - return sizeof(cydriver.CUlogsCallbackHandle){{endif}} - {{if 'CUlogsCallback' in found_types}} + return sizeof(cydriver.CUlogsCallbackHandle) + if objType == CUlogsCallback: - return sizeof(cydriver.CUlogsCallback){{endif}} - {{if 'CUlogIterator' in found_types}} + return sizeof(cydriver.CUlogsCallback) + if objType == CUlogIterator: - return sizeof(cydriver.CUlogIterator){{endif}} - {{if True}} + return sizeof(cydriver.CUlogIterator) + if objType == CUeglFrame_st: - return sizeof(cydriver.CUeglFrame_st){{endif}} - {{if True}} + return sizeof(cydriver.CUeglFrame_st) + if objType == CUeglFrame_v1: - return sizeof(cydriver.CUeglFrame_v1){{endif}} - {{if True}} + return sizeof(cydriver.CUeglFrame_v1) + if objType == CUeglFrame: - return sizeof(cydriver.CUeglFrame){{endif}} - {{if True}} + return sizeof(cydriver.CUeglFrame) + if objType == CUeglStreamConnection: - return sizeof(cydriver.CUeglStreamConnection){{endif}} - {{if True}} + return sizeof(cydriver.CUeglStreamConnection) + if objType == GLenum: - return sizeof(cydriver.GLenum){{endif}} - {{if True}} + return sizeof(cydriver.GLenum) + if objType == GLuint: - return sizeof(cydriver.GLuint){{endif}} - {{if True}} + return sizeof(cydriver.GLuint) + if objType == EGLImageKHR: - return sizeof(cydriver.EGLImageKHR){{endif}} - {{if True}} + return sizeof(cydriver.EGLImageKHR) + if objType == EGLStreamKHR: - return sizeof(cydriver.EGLStreamKHR){{endif}} - {{if True}} + return sizeof(cydriver.EGLStreamKHR) + if objType == EGLint: - return sizeof(cydriver.EGLint){{endif}} - {{if True}} + return sizeof(cydriver.EGLint) + if objType == EGLSyncKHR: - return sizeof(cydriver.EGLSyncKHR){{endif}} - {{if True}} + return sizeof(cydriver.EGLSyncKHR) + if objType == VdpDevice: - return sizeof(cydriver.VdpDevice){{endif}} - {{if True}} + return sizeof(cydriver.VdpDevice) + if objType == VdpGetProcAddress: - return sizeof(cydriver.VdpGetProcAddress){{endif}} - {{if True}} + return sizeof(cydriver.VdpGetProcAddress) + if objType == VdpVideoSurface: - return sizeof(cydriver.VdpVideoSurface){{endif}} - {{if True}} + return sizeof(cydriver.VdpVideoSurface) + if objType == VdpOutputSurface: - return sizeof(cydriver.VdpOutputSurface){{endif}} + return sizeof(cydriver.VdpOutputSurface) 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 'CUcoredumpCallbackHandle' in found_types}} + + def CUcoredumpCallbackHandle_getter(CUcoredumpCallbackHandle x): return (x._pvt_ptr[0]) _add_cuda_native_handle_getter(CUcoredumpCallbackHandle, CUcoredumpCallbackHandle_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/nvfatbin.pxd b/cuda_bindings/cuda/bindings/nvfatbin.pxd index b117da600cf..facc2dfeeb4 100644 --- a/cuda_bindings/cuda/bindings/nvfatbin.pxd +++ b/cuda_bindings/cuda/bindings/nvfatbin.pxd @@ -1,9 +1,10 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.4.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.4.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=c9d5a4b06ca92f766674f286b75dfc83dff952b5987eb88cdb2773bb28f1ea6a from libc.stdint cimport intptr_t, uint32_t from .cynvfatbin cimport * @@ -34,5 +35,6 @@ cpdef add_ltoir(intptr_t handle, code, size_t size, arch, identifier, options_cm cpdef size_t size(intptr_t handle) except? 0 cpdef get(intptr_t handle, buffer) cpdef tuple version() +cpdef add_index(intptr_t handle, code, size_t size, identifier) cpdef add_reloc(intptr_t handle, code, size_t size) cpdef add_tile_ir(intptr_t handle, code, size_t size, identifier, options_cmd_line) diff --git a/cuda_bindings/cuda/bindings/nvfatbin.pyx b/cuda_bindings/cuda/bindings/nvfatbin.pyx index d11f7378749..f1bdb927a5f 100644 --- a/cuda_bindings/cuda/bindings/nvfatbin.pyx +++ b/cuda_bindings/cuda/bindings/nvfatbin.pyx @@ -1,15 +1,22 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.4.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.4.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=d5a4eb978220598892471233ffd8b7caa8cee7b6b0c27d2d9c458f1d91979f8b + +# <<<< PREAMBLE CONTENT >>>> + +from cuda.bindings._internal._fast_enum import FastEnum as _cyb_FastEnum + +# <<<< END OF PREAMBLE CONTENT >>>> + cimport cython # NOQA from ._internal.utils cimport (get_resource_ptr, get_nested_resource_ptr, nested_resource, nullable_unique_ptr, get_buffer_pointer, get_resource_ptrs) -from cuda.bindings._internal._fast_enum import FastEnum as _IntEnum from libcpp.vector cimport vector @@ -17,10 +24,10 @@ from libcpp.vector cimport vector # Enum ############################################################################### -class Result(_IntEnum): +class Result(_cyb_FastEnum): """ - The enumerated type nvFatbinResult defines API call result codes. - nvFatbin APIs return nvFatbinResult codes to indicate the result. + The enumerated type `nvFatbinResult` defines API call result codes. + nvFatbin APIs return `nvFatbinResult` codes to indicate the result. See `nvFatbinResult`. """ @@ -272,6 +279,17 @@ cpdef tuple version(): return (major, minor) +cpdef add_index(intptr_t handle, code, size_t size, identifier): + cdef void* _code_ = get_buffer_pointer(code, size, readonly=True) + if not isinstance(identifier, str): + raise TypeError("identifier must be a Python str") + cdef bytes _temp_identifier_ = (identifier).encode() + cdef char* _identifier_ = _temp_identifier_ + with nogil: + __status__ = nvFatbinAddIndex(handle, _code_, size, _identifier_) + check_status(__status__) + + cpdef add_reloc(intptr_t handle, code, size_t size): """nvFatbinAddReloc adds relocatable PTX entries from a host object to the fatbinary. @@ -312,3 +330,4 @@ cpdef add_tile_ir(intptr_t handle, code, size_t size, identifier, options_cmd_li with nogil: __status__ = nvFatbinAddTileIR(handle, _code_, size, _identifier_, _options_cmd_line_) check_status(__status__) +del _cyb_FastEnum diff --git a/cuda_bindings/cuda/bindings/nvjitlink.pxd b/cuda_bindings/cuda/bindings/nvjitlink.pxd index e9090a66872..ac697049088 100644 --- a/cuda_bindings/cuda/bindings/nvjitlink.pxd +++ b/cuda_bindings/cuda/bindings/nvjitlink.pxd @@ -1,9 +1,10 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b847666247321f33f1f6b4c5fa92d6ee5d1022389e32eceb03c7458c45ff44ed from libc.stdint cimport intptr_t, uint32_t from .cynvjitlink cimport * @@ -41,3 +42,5 @@ cpdef get_error_log(intptr_t handle, log) cpdef size_t get_info_log_size(intptr_t handle) except? 0 cpdef get_info_log(intptr_t handle, log) cpdef tuple version() +cpdef size_t get_linked_ltoir_size(intptr_t handle) except? 0 +cpdef get_linked_ltoir(intptr_t handle, ltoir) diff --git a/cuda_bindings/cuda/bindings/nvjitlink.pyx b/cuda_bindings/cuda/bindings/nvjitlink.pyx index 9466b41c9bb..89dea49e4ad 100644 --- a/cuda_bindings/cuda/bindings/nvjitlink.pyx +++ b/cuda_bindings/cuda/bindings/nvjitlink.pyx @@ -1,15 +1,22 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=18cc1af125a513c3867c6f2bd8e97f4b0b2d2e58565a8980223a419ae5f23b74 + +# <<<< PREAMBLE CONTENT >>>> + +from cuda.bindings._internal._fast_enum import FastEnum as _cyb_FastEnum + +# <<<< END OF PREAMBLE CONTENT >>>> + cimport cython # NOQA from ._internal.utils cimport (get_resource_ptr, get_nested_resource_ptr, nested_resource, nullable_unique_ptr, get_buffer_pointer, get_resource_ptrs) -from cuda.bindings._internal._fast_enum import FastEnum as _FastEnum from libcpp.vector cimport vector @@ -17,10 +24,10 @@ from libcpp.vector cimport vector # Enum ############################################################################### -class Result(_FastEnum): +class Result(_cyb_FastEnum): """ - The enumerated type nvJitLinkResult defines API call result codes. - nvJitLink APIs return nvJitLinkResult codes to indicate the result. + The enumerated type `nvJitLinkResult` defines API call result codes. + nvJitLink APIs return `nvJitLinkResult` codes to indicate the result. See `nvJitLinkResult`. """ @@ -44,10 +51,10 @@ class Result(_FastEnum): ERROR_UNSUPPORTED_ARCH = (NVJITLINK_ERROR_UNSUPPORTED_ARCH, 'Unsupported -arch value') ERROR_LTO_NOT_ENABLED = (NVJITLINK_ERROR_LTO_NOT_ENABLED, 'Requires -lto') -class InputType(_FastEnum): +class InputType(_cyb_FastEnum): """ - The enumerated type nvJitLinkInputType defines the kind of inputs that - can be passed to nvJitLinkAdd* APIs. + The enumerated type `nvJitLinkInputType` defines the kind of inputs + that can be passed to nvJitLinkAdd* APIs. See `nvJitLinkInputType`. """ @@ -105,7 +112,7 @@ cpdef destroy(intptr_t handle): cpdef intptr_t create(uint32_t num_options, options) except -1: - """nvJitLinkCreate creates an instance of nvJitLinkHandle with the given input options, and sets the output parameter ``handle``. + """nvJitLinkCreate creates an instance of ``nvJitLinkHandle`` with the given input options, and sets the output parameter ``handle``. Args: num_options (uint32_t): Number of options passed. @@ -334,3 +341,37 @@ cpdef tuple version(): __status__ = nvJitLinkVersion(&major, &minor) check_status(__status__) return (major, minor) + + +cpdef size_t get_linked_ltoir_size(intptr_t handle) except? 0: + """nvJitLinkGetLinkedLTOIRSize gets the size of the linked LTOIR. + + Args: + handle (intptr_t): nvJitLink handle. + + Returns: + size_t: Size of the linked LTOIR. + + .. seealso:: `nvJitLinkGetLinkedLTOIRSize` + """ + cdef size_t size + with nogil: + __status__ = nvJitLinkGetLinkedLTOIRSize(handle, &size) + check_status(__status__) + return size + + +cpdef get_linked_ltoir(intptr_t handle, ltoir): + """nvJitLinkGetLinkedLTOIR gets the linked LTOIR. + + Args: + handle (intptr_t): nvJitLink handle. + ltoir (bytes): The linked LTOIR in Container format. + + .. seealso:: `nvJitLinkGetLinkedLTOIR` + """ + cdef void* _ltoir_ = get_buffer_pointer(ltoir, -1, readonly=False) + with nogil: + __status__ = nvJitLinkGetLinkedLTOIR(handle, _ltoir_) + check_status(__status__) +del _cyb_FastEnum diff --git a/cuda_bindings/cuda/bindings/nvml.pxd b/cuda_bindings/cuda/bindings/nvml.pxd index 3dc3f58e5d1..acc9900f069 100644 --- a/cuda_bindings/cuda/bindings/nvml.pxd +++ b/cuda_bindings/cuda/bindings/nvml.pxd @@ -1,9 +1,10 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.9.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=eb901f46ca6b6930935726541c32b3ea04f7f46b6090c4c2ad9cb62386c2028b from libc.stdint cimport intptr_t from .cynvml cimport * @@ -52,13 +53,14 @@ ctypedef nvmlMask255_t Mask255 ctypedef nvmlHostname_v1_t Hostname_v1 ctypedef nvmlUnrepairableMemoryStatus_v1_t UnrepairableMemoryStatus_v1 ctypedef nvmlRusdSettings_v1_t RusdSettings_v1 -ctypedef nvmlVgpuSchedulerStateInfo_v2_t VgpuSchedulerStateInfo_v2 -ctypedef nvmlVgpuSchedulerLogEntry_v2_t VgpuSchedulerLogEntry_v2 -ctypedef nvmlVgpuSchedulerState_v2_t VgpuSchedulerState_v2 +ctypedef nvmlBBXTimeData_v1_t BBXTimeData_v1 +ctypedef nvmlRemappedRowsInfo_v2_t RemappedRowsInfo_v2 +ctypedef nvmlAccountingStats_v2_t AccountingStats_v2 ctypedef nvmlPowerValue_v2_t PowerValue_v2 ctypedef nvmlVgpuTypeMaxInstance_v1_t VgpuTypeMaxInstance_v1 ctypedef nvmlVgpuProcessUtilizationSample_t VgpuProcessUtilizationSample ctypedef nvmlGpuFabricInfo_t GpuFabricInfo +ctypedef nvmlCPERCursor_v1_t CPERCursor_v1 ctypedef nvmlSystemEventSetCreateRequest_v1_t SystemEventSetCreateRequest_v1 ctypedef nvmlSystemEventSetFreeRequest_v1_t SystemEventSetFreeRequest_v1 ctypedef nvmlSystemRegisterEventRequest_v1_t SystemRegisterEventRequest_v1 @@ -70,7 +72,7 @@ ctypedef nvmlWorkloadPowerProfileCurrentProfiles_v1_t WorkloadPowerProfileCurren ctypedef nvmlWorkloadPowerProfileRequestedProfiles_v1_t WorkloadPowerProfileRequestedProfiles_v1 ctypedef nvmlWorkloadPowerProfileUpdateProfiles_v1_t WorkloadPowerProfileUpdateProfiles_v1 ctypedef nvmlPRMTLV_v1_t PRMTLV_v1 -ctypedef nvmlVgpuSchedulerLogInfo_v2_t VgpuSchedulerLogInfo_v2 +ctypedef nvmlGetCPER_v1_t GetCPER_v1 ctypedef nvmlVgpuSchedulerSetState_t VgpuSchedulerSetState ctypedef nvmlGpmMetricsGet_t GpmMetricsGet ctypedef nvmlPRMCounterList_v1_t PRMCounterList_v1 @@ -141,6 +143,8 @@ ctypedef nvmlPowerProfileType_t _PowerProfileType ctypedef nvmlDeviceAddressingModeType_t _DeviceAddressingModeType ctypedef nvmlPRMCounterId_t _PRMCounterId ctypedef nvmlPowerProfileOperation_t _PowerProfileOperation +ctypedef nvmlProcessMode_t _ProcessMode +ctypedef nvmlCPERType_t _CPERType ############################################################################### @@ -158,7 +162,7 @@ cpdef int system_get_cuda_driver_version_v2() except 0 cpdef str system_get_process_name(unsigned int pid) cpdef object system_get_hic_version() cpdef unsigned int unit_get_count() except? 0 -cpdef intptr_t unit_get_handle_by_index(unsigned int ind_ex) except? 0 +cpdef intptr_t unit_get_handle_by_index(unsigned int index) except? 0 cpdef object unit_get_unit_info(intptr_t unit) cpdef object unit_get_led_state(intptr_t unit) cpdef object unit_get_psu_info(intptr_t unit) @@ -166,7 +170,7 @@ cpdef unsigned int unit_get_temperature(intptr_t unit, unsigned int type) except cpdef object unit_get_fan_speed_info(intptr_t unit) cpdef unsigned int device_get_count_v2() except? 0 cpdef object device_get_attributes_v2(intptr_t device) -cpdef intptr_t device_get_handle_by_index_v2(unsigned int ind_ex) except? 0 +cpdef intptr_t device_get_handle_by_index_v2(unsigned int index) except? 0 cpdef intptr_t device_get_handle_by_serial(serial) except? 0 cpdef intptr_t device_get_handle_by_uuid(uuid) except? 0 cpdef intptr_t device_get_handle_by_pci_bus_id_v2(pci_bus_id) except? 0 @@ -183,7 +187,7 @@ cpdef device_set_cpu_affinity(intptr_t device) cpdef device_clear_cpu_affinity(intptr_t device) cpdef unsigned int device_get_numa_node_id(intptr_t device) except? 0 cpdef int device_get_topology_common_ancestor(intptr_t device1, intptr_t device2) except? -1 -cpdef int device_get_p2p_status(intptr_t device1, intptr_t device2, int p2p_ind_ex) except? -1 +cpdef int device_get_p2p_status(intptr_t device1, intptr_t device2, int p2p_index) except? -1 cpdef str device_get_uuid(intptr_t device) cpdef unsigned int device_get_minor_number(intptr_t device) except? 0 cpdef str device_get_board_part_number(intptr_t device) @@ -220,7 +224,7 @@ cpdef unsigned int device_get_fan_control_policy_v2(intptr_t device, unsigned in cpdef unsigned int device_get_num_fans(intptr_t device) except? 0 cpdef object device_get_cooler_info(intptr_t device) cpdef unsigned int device_get_temperature_threshold(intptr_t device, int threshold_type) except? 0 -cpdef object device_get_thermal_settings(intptr_t device, unsigned int sensor_ind_ex) +cpdef object device_get_thermal_settings(intptr_t device, unsigned int sensor_index) cpdef int device_get_performance_state(intptr_t device) except? -1 cpdef unsigned long long device_get_current_clocks_event_reasons(intptr_t device) except? 0 cpdef unsigned long long device_get_supported_clocks_event_reasons(intptr_t device) except? 0 @@ -261,6 +265,7 @@ cpdef tuple device_get_driver_model_v2(intptr_t device) cpdef str device_get_vbios_version(intptr_t device) cpdef object device_get_bridge_chip_info(intptr_t device) cpdef object device_get_compute_running_processes_v3(intptr_t device) +cpdef object device_get_graphics_running_processes_v3(intptr_t device) cpdef object device_get_mps_compute_running_processes_v3(intptr_t device) cpdef int device_on_same_board(intptr_t device1, intptr_t device2) except? 0 cpdef int device_get_api_restriction(intptr_t device, int api_type) except? -1 @@ -350,7 +355,7 @@ cpdef unsigned int vgpu_type_get_gpu_instance_profile_id(unsigned int vgpu_type_ cpdef tuple vgpu_type_get_device_id(unsigned int vgpu_type_id) cpdef unsigned long long vgpu_type_get_framebuffer_size(unsigned int vgpu_type_id) except? 0 cpdef unsigned int vgpu_type_get_num_display_heads(unsigned int vgpu_type_id) except? 0 -cpdef tuple vgpu_type_get_resolution(unsigned int vgpu_type_id, unsigned int display_ind_ex) +cpdef tuple vgpu_type_get_resolution(unsigned int vgpu_type_id, unsigned int display_index) cpdef str vgpu_type_get_license(unsigned int vgpu_type_id) cpdef unsigned int vgpu_type_get_frame_rate_limit(unsigned int vgpu_type_id) except? 0 cpdef unsigned int vgpu_type_get_max_instances(intptr_t device, unsigned int vgpu_type_id) except? 0 @@ -389,7 +394,7 @@ cpdef object vgpu_instance_get_accounting_stats(unsigned int vgpu_instance, unsi cpdef vgpu_instance_clear_accounting_pids(unsigned int vgpu_instance) cpdef object vgpu_instance_get_license_info_v2(unsigned int vgpu_instance) cpdef unsigned int get_excluded_device_count() except? 0 -cpdef object get_excluded_device_info_by_index(unsigned int ind_ex) +cpdef object get_excluded_device_info_by_index(unsigned int index) cpdef int device_set_mig_mode(intptr_t device, unsigned int mode) except? -1 cpdef tuple device_get_mig_mode(intptr_t device) cpdef object device_get_gpu_instance_possible_placements_v2(intptr_t device, unsigned int profile_id) @@ -411,7 +416,7 @@ cpdef unsigned int device_is_mig_device_handle(intptr_t device) except? 0 cpdef unsigned int device_get_gpu_instance_id(intptr_t device) except? 0 cpdef unsigned int device_get_compute_instance_id(intptr_t device) except? 0 cpdef unsigned int device_get_max_mig_device_count(intptr_t device) except? 0 -cpdef intptr_t device_get_mig_device_handle_by_index(intptr_t device, unsigned int ind_ex) except? 0 +cpdef intptr_t device_get_mig_device_handle_by_index(intptr_t device, unsigned int index) except? 0 cpdef intptr_t device_get_device_handle_from_mig_device_handle(intptr_t mig_device) except? 0 cpdef device_power_smoothing_activate_preset_profile(intptr_t device, intptr_t profile) cpdef device_power_smoothing_update_preset_profile_param(intptr_t device, intptr_t profile) @@ -420,3 +425,10 @@ cpdef object device_get_addressing_mode(intptr_t device) cpdef object device_get_repair_status(intptr_t device) cpdef object device_get_power_mizer_mode_v1(intptr_t device) cpdef device_set_power_mizer_mode_v1(intptr_t device, intptr_t power_mizer_mode) +cpdef device_vgpu_force_gsp_unload(intptr_t device) +cpdef object device_get_vgpu_scheduler_state_v2(intptr_t device) +cpdef object gpu_instance_get_vgpu_scheduler_state_v2(intptr_t gpu_instance) +cpdef object device_get_vgpu_scheduler_log_v2(intptr_t device) +cpdef object gpu_instance_get_vgpu_scheduler_log_v2(intptr_t gpu_instance) +cpdef device_set_vgpu_scheduler_state_v2(intptr_t device, intptr_t p_scheduler_state) +cpdef gpu_instance_set_vgpu_scheduler_state_v2(intptr_t gpu_instance, intptr_t p_scheduler_state) diff --git a/cuda_bindings/cuda/bindings/nvml.pyx b/cuda_bindings/cuda/bindings/nvml.pyx index 0661379a689..26b63f1f6a7 100644 --- a/cuda_bindings/cuda/bindings/nvml.pyx +++ b/cuda_bindings/cuda/bindings/nvml.pyx @@ -1,29 +1,55 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. - -cimport cython # NOQA - -from ._internal.utils cimport (get_buffer_pointer, get_nested_resource_ptr, - nested_resource) - -from cuda.bindings._internal._fast_enum import FastEnum as _FastEnum - -from cuda.bindings.cydriver cimport CUDA_VERSION - - -from libc.stdlib cimport calloc, free, malloc -from cython cimport view -cimport cpython.buffer -cimport cpython.memoryview -cimport cpython -from libc.string cimport memcmp, memcpy +# This code was automatically generated across versions from 12.9.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=52642c2c289dbd93191f019468630c0c7935bf99bc15c9c7c0de3797a109e8b0 + +# <<<< PREAMBLE CONTENT >>>> + +cimport cpython as _cyb_cpython +cimport cpython.buffer as _cyb_cpython_buffer +cimport cpython.memoryview as _cyb_cpython_memoryview +from cython cimport view as _cyb_view +from libc.stdlib cimport ( + calloc as _cyb_calloc, + free as _cyb_free, + malloc as _cyb_malloc, +) +from libc.string cimport ( + memcmp as _cyb_memcmp, + memcpy as _cyb_memcpy, +) +from cuda.bindings._internal._fast_enum import FastEnum as _cyb_FastEnum import numpy as _numpy +cdef _cyb___getbuffer(object self, _cyb_cpython.Py_buffer *buffer, void *ptr, int size, bint readonly): + buffer.buf = ptr + buffer.format = 'b' + buffer.internal = NULL + buffer.itemsize = 1 + buffer.len = size + buffer.ndim = 1 + buffer.obj = self + buffer.readonly = readonly + buffer.shape = &buffer.len + buffer.strides = &buffer.itemsize + buffer.suboffsets = NULL + +cdef _cyb_from_buffer(buffer, size, lowpp_type): + cdef _cyb_cpython.Py_buffer view + if _cyb_cpython.PyObject_GetBuffer(buffer, &view, _cyb_cpython_buffer.PyBUF_SIMPLE) != 0: + raise TypeError("buffer argument does not support the buffer protocol") + try: + if view.itemsize != 1: + raise ValueError("buffer itemsize must be 1 byte") + if view.len != size: + raise ValueError(f"buffer length must be {size} bytes") + return lowpp_type.from_ptr(view.buf, not view.readonly, buffer) + finally: + _cyb_cpython.PyBuffer_Release(&view) -cdef __from_data(data, dtype_name, expected_dtype, lowpp_type): +cdef _cyb_from_data(data, dtype_name, expected_dtype, lowpp_type): # _numpy.recarray is a subclass of _numpy.ndarray, so implicitly handled here. if isinstance(data, lowpp_type): return data @@ -35,33 +61,20 @@ cdef __from_data(data, dtype_name, expected_dtype, lowpp_type): raise ValueError(f"data array must be of dtype {dtype_name}") return lowpp_type.from_ptr(data.ctypes.data, not data.flags.writeable, data) +# <<<< END OF PREAMBLE CONTENT >>>> -cdef __from_buffer(buffer, size, lowpp_type): - cdef Py_buffer view - if cpython.PyObject_GetBuffer(buffer, &view, cpython.PyBUF_SIMPLE) != 0: - raise TypeError("buffer argument does not support the buffer protocol") - try: - if view.itemsize != 1: - raise ValueError("buffer itemsize must be 1 byte") - if view.len != size: - raise ValueError(f"buffer length must be {size} bytes") - return lowpp_type.from_ptr(view.buf, not view.readonly, buffer) - finally: - cpython.PyBuffer_Release(&view) +cimport cython # NOQA +from cython cimport view +cimport cpython +from libc.string cimport memcpy -cdef __getbuffer(object self, cpython.Py_buffer *buffer, void *ptr, int size, bint readonly): - buffer.buf = ptr - buffer.format = 'b' - buffer.internal = NULL - buffer.itemsize = 1 - buffer.len = size - buffer.ndim = 1 - buffer.obj = self - buffer.readonly = readonly - buffer.shape = &buffer.len - buffer.strides = &buffer.itemsize - buffer.suboffsets = NULL +from ._internal.utils cimport (get_buffer_pointer, get_nested_resource_ptr, + nested_resource) + +from cuda.bindings._internal._fast_enum import FastEnum as _FastEnum + +from cuda.bindings.cydriver cimport CUDA_VERSION cdef inline unsigned int NVML_VERSION_STRUCT(const unsigned int size, const unsigned int ver) nogil: @@ -72,7 +85,7 @@ cdef inline unsigned int NVML_VERSION_STRUCT(const unsigned int size, const unsi # Enum ############################################################################### -class BridgeChipType(_FastEnum): +class BridgeChipType(_cyb_FastEnum): """ Enum to represent type of bridge chip @@ -81,7 +94,7 @@ class BridgeChipType(_FastEnum): BRIDGE_CHIP_PLX = NVML_BRIDGE_CHIP_PLX BRIDGE_CHIP_BRO4 = NVML_BRIDGE_CHIP_BRO4 -class NvLinkUtilizationCountUnits(_FastEnum): +class NvLinkUtilizationCountUnits(_cyb_FastEnum): """ Enum to represent the NvLink utilization counter packet units @@ -93,11 +106,11 @@ class NvLinkUtilizationCountUnits(_FastEnum): NVLINK_COUNTER_UNIT_RESERVED = NVML_NVLINK_COUNTER_UNIT_RESERVED NVLINK_COUNTER_UNIT_COUNT = NVML_NVLINK_COUNTER_UNIT_COUNT -class NvLinkUtilizationCountPktTypes(_FastEnum): +class NvLinkUtilizationCountPktTypes(_cyb_FastEnum): """ Enum to represent the NvLink utilization counter packet types to count ** this is ONLY applicable with the units as packets or bytes ** as - specified in `nvmlNvLinkUtilizationCountUnits_t` ** all packet filter + specified in ``nvmlNvLinkUtilizationCountUnits_t`` ** all packet filter descriptions are target GPU centric ** these can be "OR'd" together See `nvmlNvLinkUtilizationCountPktTypes_t`. @@ -112,7 +125,7 @@ class NvLinkUtilizationCountPktTypes(_FastEnum): NVLINK_COUNTER_PKTFILTER_RESPNODATA = NVML_NVLINK_COUNTER_PKTFILTER_RESPNODATA NVLINK_COUNTER_PKTFILTER_ALL = NVML_NVLINK_COUNTER_PKTFILTER_ALL -class NvLinkCapability(_FastEnum): +class NvLinkCapability(_cyb_FastEnum): """ Enum to represent NvLink queryable capabilities @@ -126,7 +139,7 @@ class NvLinkCapability(_FastEnum): NVLINK_CAP_VALID = NVML_NVLINK_CAP_VALID NVLINK_CAP_COUNT = NVML_NVLINK_CAP_COUNT -class NvLinkErrorCounter(_FastEnum): +class NvLinkErrorCounter(_cyb_FastEnum): """ Enum to represent NvLink queryable error counters @@ -139,7 +152,7 @@ class NvLinkErrorCounter(_FastEnum): NVLINK_ERROR_DL_ECC_DATA = NVML_NVLINK_ERROR_DL_ECC_DATA NVLINK_ERROR_COUNT = NVML_NVLINK_ERROR_COUNT -class IntNvLinkDeviceType(_FastEnum): +class IntNvLinkDeviceType(_cyb_FastEnum): """ Enum to represent NvLink's remote device type @@ -150,7 +163,7 @@ class IntNvLinkDeviceType(_FastEnum): NVLINK_DEVICE_TYPE_SWITCH = NVML_NVLINK_DEVICE_TYPE_SWITCH NVLINK_DEVICE_TYPE_UNKNOWN = NVML_NVLINK_DEVICE_TYPE_UNKNOWN -class GpuTopologyLevel(_FastEnum): +class GpuTopologyLevel(_cyb_FastEnum): """ Represents level relationships within a system between two GPUs The enums are spaced to allow for future relationships @@ -164,7 +177,7 @@ class GpuTopologyLevel(_FastEnum): TOPOLOGY_NODE = NVML_TOPOLOGY_NODE TOPOLOGY_SYSTEM = NVML_TOPOLOGY_SYSTEM -class GpuP2PStatus(_FastEnum): +class GpuP2PStatus(_cyb_FastEnum): """ See `nvmlGpuP2PStatus_t`. """ @@ -177,7 +190,7 @@ class GpuP2PStatus(_FastEnum): P2P_STATUS_NOT_SUPPORTED = NVML_P2P_STATUS_NOT_SUPPORTED P2P_STATUS_UNKNOWN = NVML_P2P_STATUS_UNKNOWN -class GpuP2PCapsIndex(_FastEnum): +class GpuP2PCapsIndex(_cyb_FastEnum): """ See `nvmlGpuP2PCapsIndex_t`. """ @@ -189,7 +202,7 @@ class GpuP2PCapsIndex(_FastEnum): P2P_CAPS_INDEX_PROP = NVML_P2P_CAPS_INDEX_PROP P2P_CAPS_INDEX_UNKNOWN = NVML_P2P_CAPS_INDEX_UNKNOWN -class SamplingType(_FastEnum): +class SamplingType(_cyb_FastEnum): """ Represents Type of Sampling Event @@ -207,7 +220,7 @@ class SamplingType(_FastEnum): OFA_UTILIZATION_SAMPLES = (NVML_OFA_UTILIZATION_SAMPLES, 'To represent percent of time during which NVOFA remains busy.') SAMPLINGTYPE_COUNT = NVML_SAMPLINGTYPE_COUNT -class PcieUtilCounter(_FastEnum): +class PcieUtilCounter(_cyb_FastEnum): """ Represents the queryable PCIe utilization counters @@ -217,7 +230,7 @@ class PcieUtilCounter(_FastEnum): PCIE_UTIL_RX_BYTES = NVML_PCIE_UTIL_RX_BYTES PCIE_UTIL_COUNT = NVML_PCIE_UTIL_COUNT -class ValueType(_FastEnum): +class ValueType(_cyb_FastEnum): """ Represents the type for sample value returned @@ -232,7 +245,7 @@ class ValueType(_FastEnum): UNSIGNED_SHORT = NVML_VALUE_TYPE_UNSIGNED_SHORT COUNT = NVML_VALUE_TYPE_COUNT -class PerfPolicyType(_FastEnum): +class PerfPolicyType(_cyb_FastEnum): """ Represents type of perf policy for which violation times can be queried @@ -244,11 +257,11 @@ class PerfPolicyType(_FastEnum): PERF_POLICY_BOARD_LIMIT = (NVML_PERF_POLICY_BOARD_LIMIT, 'How long did the board limit cause the GPU to be below application clocks.') PERF_POLICY_LOW_UTILIZATION = (NVML_PERF_POLICY_LOW_UTILIZATION, 'How long did low utilization cause the GPU to be below application clocks.') PERF_POLICY_RELIABILITY = (NVML_PERF_POLICY_RELIABILITY, 'How long did the board reliability limit cause the GPU to be below application clocks.') - PERF_POLICY_TOTAL_APP_CLOCKS = (NVML_PERF_POLICY_TOTAL_APP_CLOCKS, 'Total time the GPU was held below application clocks by any limiter (0 - 5 above)') + PERF_POLICY_TOTAL_APP_CLOCKS = (NVML_PERF_POLICY_TOTAL_APP_CLOCKS, 'Total time the GPU was held below application clocks by any limiter (0 - 5 above).') PERF_POLICY_TOTAL_BASE_CLOCKS = (NVML_PERF_POLICY_TOTAL_BASE_CLOCKS, 'Total time the GPU was held below base clocks.') PERF_POLICY_COUNT = NVML_PERF_POLICY_COUNT -class ThermalTarget(_FastEnum): +class ThermalTarget(_cyb_FastEnum): """ Represents the thermal sensor targets @@ -265,7 +278,7 @@ class ThermalTarget(_FastEnum): ALL = NVML_THERMAL_TARGET_ALL UNKNOWN = NVML_THERMAL_TARGET_UNKNOWN -class ThermalController(_FastEnum): +class ThermalController(_cyb_FastEnum): """ Represents the thermal sensor controllers @@ -291,7 +304,7 @@ class ThermalController(_FastEnum): ADT7473S = NVML_THERMAL_CONTROLLER_ADT7473S UNKNOWN = NVML_THERMAL_CONTROLLER_UNKNOWN -class CoolerControl(_FastEnum): +class CoolerControl(_cyb_FastEnum): """ Cooler control type @@ -302,7 +315,7 @@ class CoolerControl(_FastEnum): THERMAL_COOLER_SIGNAL_VARIABLE = (NVML_THERMAL_COOLER_SIGNAL_VARIABLE, "This cooler's level can be adjusted from some minimum to some maximum (eg a knob).") THERMAL_COOLER_SIGNAL_COUNT = NVML_THERMAL_COOLER_SIGNAL_COUNT -class CoolerTarget(_FastEnum): +class CoolerTarget(_cyb_FastEnum): """ Cooler's target @@ -314,7 +327,7 @@ class CoolerTarget(_FastEnum): THERMAL_POWER_SUPPLY = (NVML_THERMAL_COOLER_TARGET_POWER_SUPPLY, 'This cooler can cool the power supply.') THERMAL_GPU_RELATED = (NVML_THERMAL_COOLER_TARGET_GPU_RELATED, 'This cooler cools all of the components related to its target gpu. GPU_RELATED = GPU | MEMORY | POWER_SUPPLY.') -class UUIDType(_FastEnum): +class UUIDType(_cyb_FastEnum): """ Enum to represent different UUID types @@ -324,7 +337,7 @@ class UUIDType(_FastEnum): ASCII = (NVML_UUID_TYPE_ASCII, 'ASCII format type.') BINARY = (NVML_UUID_TYPE_BINARY, 'Binary format type.') -class EnableState(_FastEnum): +class EnableState(_cyb_FastEnum): """ Generic enable/disable enum. @@ -333,7 +346,7 @@ class EnableState(_FastEnum): FEATURE_DISABLED = (NVML_FEATURE_DISABLED, 'Feature disabled.') FEATURE_ENABLED = (NVML_FEATURE_ENABLED, 'Feature enabled.') -class BrandType(_FastEnum): +class BrandType(_cyb_FastEnum): """ - The Brand of the GPU @@ -359,7 +372,7 @@ class BrandType(_FastEnum): BRAND_TITAN_RTX = NVML_BRAND_TITAN_RTX BRAND_COUNT = NVML_BRAND_COUNT -class TemperatureThresholds(_FastEnum): +class TemperatureThresholds(_cyb_FastEnum): """ Temperature thresholds. @@ -375,7 +388,7 @@ class TemperatureThresholds(_FastEnum): TEMPERATURE_THRESHOLD_GPS_CURR = NVML_TEMPERATURE_THRESHOLD_GPS_CURR TEMPERATURE_THRESHOLD_COUNT = NVML_TEMPERATURE_THRESHOLD_COUNT -class TemperatureSensors(_FastEnum): +class TemperatureSensors(_cyb_FastEnum): """ Temperature sensors. @@ -384,7 +397,7 @@ class TemperatureSensors(_FastEnum): TEMPERATURE_GPU = (NVML_TEMPERATURE_GPU, 'Temperature sensor for the GPU die.') TEMPERATURE_COUNT = NVML_TEMPERATURE_COUNT -class ComputeMode(_FastEnum): +class ComputeMode(_cyb_FastEnum): """ Compute mode. NVML_COMPUTEMODE_EXCLUSIVE_PROCESS was added in CUDA 4.0. Earlier CUDA versions supported a single exclusive mode, which is @@ -398,7 +411,7 @@ class ComputeMode(_FastEnum): COMPUTEMODE_EXCLUSIVE_PROCESS = (NVML_COMPUTEMODE_EXCLUSIVE_PROCESS, 'Compute-exclusive-process mode -- only one context per device, usable from multiple threads at a time.') COMPUTEMODE_COUNT = NVML_COMPUTEMODE_COUNT -class MemoryErrorType(_FastEnum): +class MemoryErrorType(_cyb_FastEnum): """ Memory error types @@ -408,7 +421,7 @@ class MemoryErrorType(_FastEnum): UNCORRECTED = (NVML_MEMORY_ERROR_TYPE_UNCORRECTED, 'A memory error that was not corrected For ECC errors, these are double bit errors For Texture memory, these are errors where the resend fails') COUNT = (NVML_MEMORY_ERROR_TYPE_COUNT, 'Count of memory error types.') -class NvlinkVersion(_FastEnum): +class NvlinkVersion(_cyb_FastEnum): """ Represents Nvlink Version @@ -422,8 +435,9 @@ class NvlinkVersion(_FastEnum): VERSION_3_1 = (NVML_NVLINK_VERSION_3_1, 'NVLink Version 3.1.') VERSION_4_0 = (NVML_NVLINK_VERSION_4_0, 'NVLink Version 4.0.') VERSION_5_0 = (NVML_NVLINK_VERSION_5_0, 'NVLink Version 5.0.') + VERSION_6_0 = (NVML_NVLINK_VERSION_6_0, 'NVLink Version 6.0.') -class EccCounterType(_FastEnum): +class EccCounterType(_cyb_FastEnum): """ ECC counter types. Note: Volatile counts are reset each time the driver loads. On Windows this is once per boot. On Linux this can be @@ -435,10 +449,10 @@ class EccCounterType(_FastEnum): See `nvmlEccCounterType_t`. """ VOLATILE_ECC = (NVML_VOLATILE_ECC, 'Volatile counts are reset each time the driver loads.') - AGGREGATE_ECC = (NVML_AGGREGATE_ECC, 'Aggregate counts persist across reboots (i.e. for the lifetime of the device)') + AGGREGATE_ECC = (NVML_AGGREGATE_ECC, 'Aggregate counts persist across reboots (i.e. for the lifetime of the device).') COUNT = (NVML_ECC_COUNTER_TYPE_COUNT, 'Count of memory counter types.') -class ClockType(_FastEnum): +class ClockType(_cyb_FastEnum): """ Clock types. All speeds are in Mhz. @@ -450,9 +464,9 @@ class ClockType(_FastEnum): CLOCK_VIDEO = (NVML_CLOCK_VIDEO, 'Video encoder/decoder clock domain.') CLOCK_COUNT = (NVML_CLOCK_COUNT, 'Count of clock types.') -class ClockId(_FastEnum): +class ClockId(_cyb_FastEnum): """ - Clock Ids. These are used in combination with nvmlClockType_t to + Clock Ids. These are used in combination with `nvmlClockType_t` to specify a single clock value. See `nvmlClockId_t`. @@ -463,7 +477,7 @@ class ClockId(_FastEnum): CUSTOMER_BOOST_MAX = (NVML_CLOCK_ID_CUSTOMER_BOOST_MAX, 'OEM-defined maximum clock rate.') COUNT = (NVML_CLOCK_ID_COUNT, 'Count of Clock Ids.') -class DriverModel(_FastEnum): +class DriverModel(_cyb_FastEnum): """ Driver models. Windows only. @@ -473,7 +487,7 @@ class DriverModel(_FastEnum): DRIVER_WDM = (NVML_DRIVER_WDM, 'WDM (TCC) model (deprecated) -- GPU treated as a generic compute device.') DRIVER_MCDM = (NVML_DRIVER_MCDM, 'MCDM driver model -- GPU treated as a Microsoft compute device.') -class Pstates(_FastEnum): +class Pstates(_cyb_FastEnum): """ Allowed PStates. @@ -497,7 +511,7 @@ class Pstates(_FastEnum): PSTATE_15 = (NVML_PSTATE_15, 'Performance state 15 -- Minimum Performance.') PSTATE_UNKNOWN = (NVML_PSTATE_UNKNOWN, 'Unknown performance state.') -class GpuOperationMode(_FastEnum): +class GpuOperationMode(_cyb_FastEnum): """ GPU Operation Mode GOM allows to reduce power usage and optimize GPU throughput by disabling GPU features. Each GOM is designed to meet @@ -509,7 +523,7 @@ class GpuOperationMode(_FastEnum): GOM_COMPUTE = (NVML_GOM_COMPUTE, 'Designed for running only compute tasks. Graphics operations are not allowed') GOM_LOW_DP = (NVML_GOM_LOW_DP, "Designed for running graphics applications that don't require high bandwidth double precision") -class InforomObject(_FastEnum): +class InforomObject(_cyb_FastEnum): """ Available infoROM objects. @@ -521,14 +535,14 @@ class InforomObject(_FastEnum): INFOROM_DEN = (NVML_INFOROM_DEN, 'DRAM Encryption object.') INFOROM_COUNT = (NVML_INFOROM_COUNT, 'This counts the number of infoROM objects the driver knows about.') -class Return(_FastEnum): +class Return(_cyb_FastEnum): """ Return values for NVML API calls. See `nvmlReturn_t`. """ SUCCESS = (NVML_SUCCESS, 'The operation was successful.') - ERROR_UNINITIALIZED = (NVML_ERROR_UNINITIALIZED, 'NVML was not first initialized with nvmlInit()') + ERROR_UNINITIALIZED = (NVML_ERROR_UNINITIALIZED, 'NVML was not first initialized with `nvmlInit()`.') ERROR_INVALID_ARGUMENT = (NVML_ERROR_INVALID_ARGUMENT, 'A supplied argument is invalid.') ERROR_NOT_SUPPORTED = (NVML_ERROR_NOT_SUPPORTED, 'The requested operation is not available on target device.') ERROR_NO_PERMISSION = (NVML_ERROR_NO_PERMISSION, 'The current user does not have permission for operation.') @@ -560,7 +574,7 @@ class Return(_FastEnum): ERROR_RESET_TYPE_NOT_SUPPORTED = (NVML_ERROR_RESET_TYPE_NOT_SUPPORTED, 'Reset not supported for given device/parameters.') ERROR_UNKNOWN = (NVML_ERROR_UNKNOWN, 'An internal driver error occurred.') -class MemoryLocation(_FastEnum): +class MemoryLocation(_cyb_FastEnum): """ See `nvmlDeviceGetMemoryErrorCounter` @@ -577,7 +591,7 @@ class MemoryLocation(_FastEnum): SRAM = (NVML_MEMORY_LOCATION_SRAM, 'Turing+ SRAM.') COUNT = (NVML_MEMORY_LOCATION_COUNT, 'This counts the number of memory locations the driver knows about.') -class PageRetirementCause(_FastEnum): +class PageRetirementCause(_cyb_FastEnum): """ Causes for page retirement @@ -587,7 +601,7 @@ class PageRetirementCause(_FastEnum): DOUBLE_BIT_ECC_ERROR = (NVML_PAGE_RETIREMENT_CAUSE_DOUBLE_BIT_ECC_ERROR, 'Page was retired due to double bit ECC error.') COUNT = NVML_PAGE_RETIREMENT_CAUSE_COUNT -class RestrictedAPI(_FastEnum): +class RestrictedAPI(_cyb_FastEnum): """ API types that allow changes to default permission restrictions @@ -597,7 +611,7 @@ class RestrictedAPI(_FastEnum): SET_AUTO_BOOSTED_CLOCKS = (NVML_RESTRICTED_API_SET_AUTO_BOOSTED_CLOCKS, 'APIs that enable/disable Auto Boosted clocks see nvmlDeviceSetAutoBoostedClocksEnabled') COUNT = NVML_RESTRICTED_API_COUNT -class GpuUtilizationDomainId(_FastEnum): +class GpuUtilizationDomainId(_cyb_FastEnum): """ Represents the GPU utilization domains @@ -608,7 +622,7 @@ class GpuUtilizationDomainId(_FastEnum): GPU_UTILIZATION_DOMAIN_VID = (NVML_GPU_UTILIZATION_DOMAIN_VID, 'Video engine domain.') GPU_UTILIZATION_DOMAIN_BUS = (NVML_GPU_UTILIZATION_DOMAIN_BUS, 'Bus interface domain.') -class GpuVirtualizationMode(_FastEnum): +class GpuVirtualizationMode(_cyb_FastEnum): """ GPU virtualization mode types. @@ -620,7 +634,7 @@ class GpuVirtualizationMode(_FastEnum): HOST_VGPU = (NVML_GPU_VIRTUALIZATION_MODE_HOST_VGPU, 'Device is associated with VGX hypervisor in vGPU mode.') HOST_VSGA = (NVML_GPU_VIRTUALIZATION_MODE_HOST_VSGA, 'Device is associated with VGX hypervisor in vSGA mode.') -class HostVgpuMode(_FastEnum): +class HostVgpuMode(_cyb_FastEnum): """ Host vGPU modes @@ -629,7 +643,7 @@ class HostVgpuMode(_FastEnum): NON_SRIOV = (NVML_HOST_VGPU_MODE_NON_SRIOV, 'Non SR-IOV mode.') SRIOV = (NVML_HOST_VGPU_MODE_SRIOV, 'SR-IOV mode.') -class VgpuVmIdType(_FastEnum): +class VgpuVmIdType(_cyb_FastEnum): """ Types of VM identifiers @@ -638,7 +652,7 @@ class VgpuVmIdType(_FastEnum): VGPU_VM_ID_DOMAIN_ID = (NVML_VGPU_VM_ID_DOMAIN_ID, 'VM ID represents DOMAIN ID.') VGPU_VM_ID_UUID = (NVML_VGPU_VM_ID_UUID, 'VM ID represents UUID.') -class VgpuGuestInfoState(_FastEnum): +class VgpuGuestInfoState(_cyb_FastEnum): """ vGPU GUEST info state @@ -647,7 +661,7 @@ class VgpuGuestInfoState(_FastEnum): VGPU_INSTANCE_GUEST_INFO_STATE_UNINITIALIZED = (NVML_VGPU_INSTANCE_GUEST_INFO_STATE_UNINITIALIZED, 'Guest-dependent fields uninitialized.') VGPU_INSTANCE_GUEST_INFO_STATE_INITIALIZED = (NVML_VGPU_INSTANCE_GUEST_INFO_STATE_INITIALIZED, 'Guest-dependent fields initialized.') -class GridLicenseFeatureCode(_FastEnum): +class GridLicenseFeatureCode(_cyb_FastEnum): """ vGPU software licensable features @@ -660,7 +674,7 @@ class GridLicenseFeatureCode(_FastEnum): GAMING = (NVML_GRID_LICENSE_FEATURE_CODE_GAMING, 'Gaming.') COMPUTE = (NVML_GRID_LICENSE_FEATURE_CODE_COMPUTE, 'Compute.') -class VgpuCapability(_FastEnum): +class VgpuCapability(_cyb_FastEnum): """ vGPU queryable capabilities @@ -673,7 +687,7 @@ class VgpuCapability(_FastEnum): VGPU_CAP_EXCLUSIVE_SIZE = (NVML_VGPU_CAP_EXCLUSIVE_SIZE, 'vGPU profile cannot run on a GPU alongside other profiles of different size') VGPU_CAP_COUNT = NVML_VGPU_CAP_COUNT -class VgpuDriverCapability(_FastEnum): +class VgpuDriverCapability(_cyb_FastEnum): """ vGPU driver queryable capabilities @@ -683,7 +697,7 @@ class VgpuDriverCapability(_FastEnum): VGPU_DRIVER_CAP_WARM_UPDATE = (NVML_VGPU_DRIVER_CAP_WARM_UPDATE, 'Supports FSR and warm update of vGPU host driver without terminating the running guest VM.') VGPU_DRIVER_CAP_COUNT = NVML_VGPU_DRIVER_CAP_COUNT -class DeviceVgpuCapability(_FastEnum): +class DeviceVgpuCapability(_cyb_FastEnum): """ Device vGPU queryable capabilities @@ -703,7 +717,7 @@ class DeviceVgpuCapability(_FastEnum): DEVICE_VGPU_CAP_MIG_TIMESLICING_ENABLED = (NVML_DEVICE_VGPU_CAP_MIG_TIMESLICING_ENABLED, 'Set/Get MIG timesliced mode reporting, without impacting the underlying functionality.') DEVICE_VGPU_CAP_COUNT = NVML_DEVICE_VGPU_CAP_COUNT -class DeviceGpuRecoveryAction(_FastEnum): +class DeviceGpuRecoveryAction(_cyb_FastEnum): """ Enum describing the GPU Recovery Action @@ -714,8 +728,9 @@ class DeviceGpuRecoveryAction(_FastEnum): GPU_RECOVERY_ACTION_NODE_REBOOT = (NVML_GPU_RECOVERY_ACTION_NODE_REBOOT, 'Reboot Node.') GPU_RECOVERY_ACTION_DRAIN_P2P = (NVML_GPU_RECOVERY_ACTION_DRAIN_P2P, 'Drain P2P.') GPU_RECOVERY_ACTION_DRAIN_AND_RESET = (NVML_GPU_RECOVERY_ACTION_DRAIN_AND_RESET, 'Drain P2P and Reset Gpu.') + GPU_RECOVERY_ACTION_RECOVER_IMEX_DOMAIN = (NVML_GPU_RECOVERY_ACTION_RECOVER_IMEX_DOMAIN, 'Recover IMEX Domain.') -class FanState(_FastEnum): +class FanState(_cyb_FastEnum): """ Fan state enum. @@ -724,7 +739,7 @@ class FanState(_FastEnum): FAN_NORMAL = (NVML_FAN_NORMAL, 'Fan is working properly.') FAN_FAILED = (NVML_FAN_FAILED, 'Fan has failed.') -class LedColor(_FastEnum): +class LedColor(_cyb_FastEnum): """ Led color enum. @@ -733,7 +748,7 @@ class LedColor(_FastEnum): GREEN = (NVML_LED_COLOR_GREEN, 'GREEN, indicates good health.') AMBER = (NVML_LED_COLOR_AMBER, 'AMBER, indicates problem.') -class EncoderType(_FastEnum): +class EncoderType(_cyb_FastEnum): """ Represents type of encoder for capacity can be queried @@ -744,7 +759,7 @@ class EncoderType(_FastEnum): ENCODER_QUERY_AV1 = (NVML_ENCODER_QUERY_AV1, 'AV1 encoder.') ENCODER_QUERY_UNKNOWN = (NVML_ENCODER_QUERY_UNKNOWN, 'Unknown encoder.') -class FBCSessionType(_FastEnum): +class FBCSessionType(_cyb_FastEnum): """ Represents frame buffer capture session type @@ -756,26 +771,26 @@ class FBCSessionType(_FastEnum): VID = (NVML_FBC_SESSION_TYPE_VID, 'Vid.') HWENC = (NVML_FBC_SESSION_TYPE_HWENC, 'HEnc.') -class DetachGpuState(_FastEnum): +class DetachGpuState(_cyb_FastEnum): """ Is the GPU device to be removed from the kernel by - nvmlDeviceRemoveGpu() + `nvmlDeviceRemoveGpu()` See `nvmlDetachGpuState_t`. """ DETACH_GPU_KEEP = NVML_DETACH_GPU_KEEP DETACH_GPU_REMOVE = NVML_DETACH_GPU_REMOVE -class PcieLinkState(_FastEnum): +class PcieLinkState(_cyb_FastEnum): """ - Parent bridge PCIe link state requested by nvmlDeviceRemoveGpu() + Parent bridge PCIe link state requested by `nvmlDeviceRemoveGpu()` See `nvmlPcieLinkState_t`. """ PCIE_LINK_KEEP = NVML_PCIE_LINK_KEEP PCIE_LINK_SHUT_DOWN = NVML_PCIE_LINK_SHUT_DOWN -class ClockLimitId(_FastEnum): +class ClockLimitId(_cyb_FastEnum): """ See `nvmlClockLimitId_t`. """ @@ -783,7 +798,7 @@ class ClockLimitId(_FastEnum): TDP = NVML_CLOCK_LIMIT_ID_TDP UNLIMITED = NVML_CLOCK_LIMIT_ID_UNLIMITED -class VgpuVmCompatibility(_FastEnum): +class VgpuVmCompatibility(_cyb_FastEnum): """ vGPU VM compatibility codes @@ -795,7 +810,7 @@ class VgpuVmCompatibility(_FastEnum): SLEEP = (NVML_VGPU_VM_COMPATIBILITY_SLEEP, 'vGPU is runnable from a sleeped state (ACPI S3)') LIVE = (NVML_VGPU_VM_COMPATIBILITY_LIVE, 'vGPU is runnable from a live/paused (ACPI S0)') -class VgpuPgpuCompatibilityLimitCode(_FastEnum): +class VgpuPgpuCompatibilityLimitCode(_cyb_FastEnum): """ vGPU-pGPU compatibility limit codes @@ -807,7 +822,7 @@ class VgpuPgpuCompatibilityLimitCode(_FastEnum): VGPU_COMPATIBILITY_LIMIT_GPU = (NVML_VGPU_COMPATIBILITY_LIMIT_GPU, 'Compatibility is limited by GPU hardware.') VGPU_COMPATIBILITY_LIMIT_OTHER = (NVML_VGPU_COMPATIBILITY_LIMIT_OTHER, 'Compatibility is limited by an undefined factor.') -class GpmMetricId(_FastEnum): +class GpmMetricId(_cyb_FastEnum): """ GPM Metric Identifiers @@ -994,6 +1009,42 @@ class GpmMetricId(_FastEnum): GPM_METRIC_GR7_CTXSW_REQUESTS = NVML_GPM_METRIC_GR7_CTXSW_REQUESTS GPM_METRIC_GR7_CTXSW_CYCLES_PER_REQ = NVML_GPM_METRIC_GR7_CTXSW_CYCLES_PER_REQ GPM_METRIC_GR7_CTXSW_ACTIVE_PCT = NVML_GPM_METRIC_GR7_CTXSW_ACTIVE_PCT + GPM_METRIC_NVLINK_L18_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L18_RX_PER_SEC + GPM_METRIC_NVLINK_L18_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L18_TX_PER_SEC + GPM_METRIC_NVLINK_L19_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L19_RX_PER_SEC + GPM_METRIC_NVLINK_L19_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L19_TX_PER_SEC + GPM_METRIC_NVLINK_L20_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L20_RX_PER_SEC + GPM_METRIC_NVLINK_L20_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L20_TX_PER_SEC + GPM_METRIC_NVLINK_L21_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L21_RX_PER_SEC + GPM_METRIC_NVLINK_L21_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L21_TX_PER_SEC + GPM_METRIC_NVLINK_L22_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L22_RX_PER_SEC + GPM_METRIC_NVLINK_L22_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L22_TX_PER_SEC + GPM_METRIC_NVLINK_L23_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L23_RX_PER_SEC + GPM_METRIC_NVLINK_L23_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L23_TX_PER_SEC + GPM_METRIC_NVLINK_L24_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L24_RX_PER_SEC + GPM_METRIC_NVLINK_L24_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L24_TX_PER_SEC + GPM_METRIC_NVLINK_L25_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L25_RX_PER_SEC + GPM_METRIC_NVLINK_L25_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L25_TX_PER_SEC + GPM_METRIC_NVLINK_L26_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L26_RX_PER_SEC + GPM_METRIC_NVLINK_L26_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L26_TX_PER_SEC + GPM_METRIC_NVLINK_L27_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L27_RX_PER_SEC + GPM_METRIC_NVLINK_L27_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L27_TX_PER_SEC + GPM_METRIC_NVLINK_L28_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L28_RX_PER_SEC + GPM_METRIC_NVLINK_L28_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L28_TX_PER_SEC + GPM_METRIC_NVLINK_L29_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L29_RX_PER_SEC + GPM_METRIC_NVLINK_L29_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L29_TX_PER_SEC + GPM_METRIC_NVLINK_L30_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L30_RX_PER_SEC + GPM_METRIC_NVLINK_L30_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L30_TX_PER_SEC + GPM_METRIC_NVLINK_L31_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L31_RX_PER_SEC + GPM_METRIC_NVLINK_L31_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L31_TX_PER_SEC + GPM_METRIC_NVLINK_L32_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L32_RX_PER_SEC + GPM_METRIC_NVLINK_L32_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L32_TX_PER_SEC + GPM_METRIC_NVLINK_L33_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L33_RX_PER_SEC + GPM_METRIC_NVLINK_L33_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L33_TX_PER_SEC + GPM_METRIC_NVLINK_L34_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L34_RX_PER_SEC + GPM_METRIC_NVLINK_L34_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L34_TX_PER_SEC + GPM_METRIC_NVLINK_L35_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L35_RX_PER_SEC + GPM_METRIC_NVLINK_L35_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L35_TX_PER_SEC GPM_METRIC_SM_CYCLES_ELAPSED = (NVML_GPM_METRIC_SM_CYCLES_ELAPSED, "The GPU's SM cycles elapsed since reboot.") GPM_METRIC_SM_CYCLES_ACTIVE = (NVML_GPM_METRIC_SM_CYCLES_ACTIVE, "The GPU's SM activity since reboot.") GPM_METRIC_MMA_CYCLES_ACTIVE = (NVML_GPM_METRIC_MMA_CYCLES_ACTIVE, "The GPU's SM MMA tensor activity since reboot.") @@ -1043,9 +1094,45 @@ class GpmMetricId(_FastEnum): GPM_METRIC_NVLINK_L16_TX = (NVML_GPM_METRIC_NVLINK_L16_TX, 'NvLink write for link 16 in bytes since reboot.') GPM_METRIC_NVLINK_L17_RX = (NVML_GPM_METRIC_NVLINK_L17_RX, 'NvLink read for link 17 in bytes since reboot.') GPM_METRIC_NVLINK_L17_TX = (NVML_GPM_METRIC_NVLINK_L17_TX, 'NvLink write for link 17 in bytes since reboot.') + GPM_METRIC_NVLINK_L18_RX = (NVML_GPM_METRIC_NVLINK_L18_RX, 'NvLink read for link 18 in bytes since reboot.') + GPM_METRIC_NVLINK_L18_TX = (NVML_GPM_METRIC_NVLINK_L18_TX, 'NvLink write for link 18 in bytes since reboot.') + GPM_METRIC_NVLINK_L19_RX = (NVML_GPM_METRIC_NVLINK_L19_RX, 'NvLink read for link 19 in bytes since reboot.') + GPM_METRIC_NVLINK_L19_TX = (NVML_GPM_METRIC_NVLINK_L19_TX, 'NvLink write for link 19 in bytes since reboot.') + GPM_METRIC_NVLINK_L20_RX = (NVML_GPM_METRIC_NVLINK_L20_RX, 'NvLink read for link 20 in bytes since reboot.') + GPM_METRIC_NVLINK_L20_TX = (NVML_GPM_METRIC_NVLINK_L20_TX, 'NvLink write for link 20 in bytes since reboot.') + GPM_METRIC_NVLINK_L21_RX = (NVML_GPM_METRIC_NVLINK_L21_RX, 'NvLink read for link 21 in bytes since reboot.') + GPM_METRIC_NVLINK_L21_TX = (NVML_GPM_METRIC_NVLINK_L21_TX, 'NvLink write for link 21 in bytes since reboot.') + GPM_METRIC_NVLINK_L22_RX = (NVML_GPM_METRIC_NVLINK_L22_RX, 'NvLink read for link 22 in bytes since reboot.') + GPM_METRIC_NVLINK_L22_TX = (NVML_GPM_METRIC_NVLINK_L22_TX, 'NvLink write for link 22 in bytes since reboot.') + GPM_METRIC_NVLINK_L23_RX = (NVML_GPM_METRIC_NVLINK_L23_RX, 'NvLink read for link 23 in bytes since reboot.') + GPM_METRIC_NVLINK_L23_TX = (NVML_GPM_METRIC_NVLINK_L23_TX, 'NvLink write for link 23 in bytes since reboot.') + GPM_METRIC_NVLINK_L24_RX = (NVML_GPM_METRIC_NVLINK_L24_RX, 'NvLink read for link 24 in bytes since reboot.') + GPM_METRIC_NVLINK_L24_TX = (NVML_GPM_METRIC_NVLINK_L24_TX, 'NvLink write for link 24 in bytes since reboot.') + GPM_METRIC_NVLINK_L25_RX = (NVML_GPM_METRIC_NVLINK_L25_RX, 'NvLink read for link 25 in bytes since reboot.') + GPM_METRIC_NVLINK_L25_TX = (NVML_GPM_METRIC_NVLINK_L25_TX, 'NvLink write for link 25 in bytes since reboot.') + GPM_METRIC_NVLINK_L26_RX = (NVML_GPM_METRIC_NVLINK_L26_RX, 'NvLink read for link 26 in bytes since reboot.') + GPM_METRIC_NVLINK_L26_TX = (NVML_GPM_METRIC_NVLINK_L26_TX, 'NvLink write for link 26 in bytes since reboot.') + GPM_METRIC_NVLINK_L27_RX = (NVML_GPM_METRIC_NVLINK_L27_RX, 'NvLink read for link 27 in bytes since reboot.') + GPM_METRIC_NVLINK_L27_TX = (NVML_GPM_METRIC_NVLINK_L27_TX, 'NvLink write for link 27 in bytes since reboot.') + GPM_METRIC_NVLINK_L28_RX = (NVML_GPM_METRIC_NVLINK_L28_RX, 'NvLink read for link 28 in bytes since reboot.') + GPM_METRIC_NVLINK_L28_TX = (NVML_GPM_METRIC_NVLINK_L28_TX, 'NvLink write for link 28 in bytes since reboot.') + GPM_METRIC_NVLINK_L29_RX = (NVML_GPM_METRIC_NVLINK_L29_RX, 'NvLink read for link 29 in bytes since reboot.') + GPM_METRIC_NVLINK_L29_TX = (NVML_GPM_METRIC_NVLINK_L29_TX, 'NvLink write for link 29 in bytes since reboot.') + GPM_METRIC_NVLINK_L30_RX = (NVML_GPM_METRIC_NVLINK_L30_RX, 'NvLink read for link 30 in bytes since reboot.') + GPM_METRIC_NVLINK_L30_TX = (NVML_GPM_METRIC_NVLINK_L30_TX, 'NvLink write for link 30 in bytes since reboot.') + GPM_METRIC_NVLINK_L31_RX = (NVML_GPM_METRIC_NVLINK_L31_RX, 'NvLink read for link 31 in bytes since reboot.') + GPM_METRIC_NVLINK_L31_TX = (NVML_GPM_METRIC_NVLINK_L31_TX, 'NvLink write for link 31 in bytes since reboot.') + GPM_METRIC_NVLINK_L32_RX = (NVML_GPM_METRIC_NVLINK_L32_RX, 'NvLink read for link 32 in bytes since reboot.') + GPM_METRIC_NVLINK_L32_TX = (NVML_GPM_METRIC_NVLINK_L32_TX, 'NvLink write for link 32 in bytes since reboot.') + GPM_METRIC_NVLINK_L33_RX = (NVML_GPM_METRIC_NVLINK_L33_RX, 'NvLink read for link 33 in bytes since reboot.') + GPM_METRIC_NVLINK_L33_TX = (NVML_GPM_METRIC_NVLINK_L33_TX, 'NvLink write for link 33 in bytes since reboot.') + GPM_METRIC_NVLINK_L34_RX = (NVML_GPM_METRIC_NVLINK_L34_RX, 'NvLink read for link 34 in bytes since reboot.') + GPM_METRIC_NVLINK_L34_TX = (NVML_GPM_METRIC_NVLINK_L34_TX, 'NvLink write for link 34 in bytes since reboot.') + GPM_METRIC_NVLINK_L35_RX = (NVML_GPM_METRIC_NVLINK_L35_RX, 'NvLink read for link 35 in bytes since reboot.') + GPM_METRIC_NVLINK_L35_TX = (NVML_GPM_METRIC_NVLINK_L35_TX, 'NvLink write for link 35 in bytes since reboot.') GPM_METRIC_MAX = (NVML_GPM_METRIC_MAX, 'Maximum value above +1.') -class PowerProfileType(_FastEnum): +class PowerProfileType(_cyb_FastEnum): """ See `nvmlPowerProfileType_t`. """ @@ -1066,7 +1153,7 @@ class PowerProfileType(_FastEnum): POWER_PROFILE_MIG = NVML_POWER_PROFILE_MIG POWER_PROFILE_MAX = NVML_POWER_PROFILE_MAX -class DeviceAddressingModeType(_FastEnum): +class DeviceAddressingModeType(_cyb_FastEnum): """ Enum to represent device addressing mode values @@ -1076,7 +1163,7 @@ class DeviceAddressingModeType(_FastEnum): DEVICE_ADDRESSING_MODE_HMM = (NVML_DEVICE_ADDRESSING_MODE_HMM, 'Heterogeneous Memory Management mode.') DEVICE_ADDRESSING_MODE_ATS = (NVML_DEVICE_ADDRESSING_MODE_ATS, 'Address Translation Services mode.') -class PRMCounterId(_FastEnum): +class PRMCounterId(_cyb_FastEnum): """ PRM Counter IDs @@ -1098,7 +1185,7 @@ class PRMCounterId(_FastEnum): PPCNT_PLR_SYNC_EVENTS = NVML_PRM_COUNTER_ID_PPCNT_PLR_SYNC_EVENTS PPRM_OPER_RECOVERY = NVML_PRM_COUNTER_ID_PPRM_OPER_RECOVERY -class PowerProfileOperation(_FastEnum): +class PowerProfileOperation(_cyb_FastEnum): """ Enum for operation to perform on the requested profiles @@ -1109,6 +1196,27 @@ class PowerProfileOperation(_FastEnum): SET_AND_OVERWRITE = (NVML_POWER_PROFILE_OPERATION_SET_AND_OVERWRITE, 'Overwrite the existing list of requested profiles with just the requested profiles.') MAX = (NVML_POWER_PROFILE_OPERATION_MAX, 'Max value above +1.') +class ProcessMode(_cyb_FastEnum): + """ + Enum to represent process mode. + + See `nvmlProcessMode_t`. + """ + COMPUTE = (NVML_PROCESS_MODE_COMPUTE, 'Processes with a compute context.') + GRAPHICS = (NVML_PROCESS_MODE_GRAPHICS, 'Processes with a graphics context.') + MPS = (NVML_PROCESS_MODE_MPS, 'Processes with a MPS (Multi-Process Service) compute context.') + ALL = (NVML_PROCESS_MODE_ALL, 'All processes running on the GPU (compute, graphics, MPS, and other types).') + MAX = (NVML_PROCESS_MODE_MAX, 'Maximum value for bounds checking.') + +class CPERType(_cyb_FastEnum): + """ + Bitmask of CPER record types. Multiple values may be combined to + request records from several sources in one call. + + See `nvmlCPERType_t`. + """ + CPER_ACCESS_TYPE_GPU = (NVML_CPER_ACCESS_TYPE_GPU, 'Access GPU CPER records.') + class AffinityScope(_FastEnum): NODE = (0, "Scope of NUMA node for affinity queries") @@ -1903,97 +2011,66 @@ class NvmlError(Exception): class UninitializedError(NvmlError): pass - class InvalidArgumentError(NvmlError): pass - class NotSupportedError(NvmlError): pass - class NoPermissionError(NvmlError): pass - class AlreadyInitializedError(NvmlError): pass - class NotFoundError(NvmlError): pass - class InsufficientSizeError(NvmlError): pass - class InsufficientPowerError(NvmlError): pass - class DriverNotLoadedError(NvmlError): pass - class TimeoutError(NvmlError): pass - class IrqIssueError(NvmlError): pass - class LibraryNotFoundError(NvmlError): pass - class FunctionNotFoundError(NvmlError): pass - class CorruptedInforomError(NvmlError): pass - class GpuIsLostError(NvmlError): pass - class ResetRequiredError(NvmlError): pass - class OperatingSystemError(NvmlError): pass - class LibRmVersionMismatchError(NvmlError): pass - class InUseError(NvmlError): pass - class MemoryError(NvmlError): pass - class NoDataError(NvmlError): pass - class VgpuEccNotSupportedError(NvmlError): pass - class InsufficientResourcesError(NvmlError): pass - class FreqNotSupportedError(NvmlError): pass - class ArgumentVersionMismatchError(NvmlError): pass - class DeprecatedError(NvmlError): pass - class NotReadyError(NvmlError): pass - class GpuNotFoundError(NvmlError): pass - class InvalidStateError(NvmlError): pass - class ResetTypeNotSupportedError(NvmlError): pass - class UnknownError(NvmlError): pass - cdef object _nvml_error_factory(int status): cdef object pystatus = status if status == 1: @@ -2061,7 +2138,6 @@ cdef object _nvml_error_factory(int status): return NvmlError(status) - @cython.profile(False) cpdef int check_status(int status) except 1 nogil: if status != 0: @@ -2083,7 +2159,7 @@ cpdef int check_status_size(int status) except 1 nogil: cdef _get_pci_info_ext_v1_dtype_offsets(): - cdef nvmlPciInfoExt_v1_t pod = nvmlPciInfoExt_v1_t() + cdef nvmlPciInfoExt_v1_t pod return _numpy.dtype({ 'names': ['version', 'domain', 'bus', 'device_', 'pci_device_id', 'pci_sub_system_id', 'base_class', 'sub_class', 'bus_id'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.int8, 32)], @@ -2116,7 +2192,7 @@ cdef class PciInfoExt_v1: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlPciInfoExt_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlPciInfoExt_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating PciInfoExt_v1") self._owner = None @@ -2128,7 +2204,7 @@ cdef class PciInfoExt_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.PciInfoExt_v1 object at {hex(id(self))}>" @@ -2149,20 +2225,20 @@ cdef class PciInfoExt_v1: if not isinstance(other, PciInfoExt_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlPciInfoExt_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlPciInfoExt_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlPciInfoExt_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlPciInfoExt_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlPciInfoExt_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlPciInfoExt_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating PciInfoExt_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlPciInfoExt_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlPciInfoExt_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -2259,8 +2335,8 @@ cdef class PciInfoExt_v1: @property def bus_id(self): - """~_numpy.int8: (array of length 32).The tuple domain:bus:device.function PCI identifier (& NULL terminator)""" - return cpython.PyUnicode_FromString(self._ptr[0].busId) + """~_numpy.int8: (array of length 32).The tuple domain:bus:device.function PCI identifier (& NULL terminator).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].busId) @bus_id.setter def bus_id(self, val): @@ -2270,12 +2346,12 @@ cdef class PciInfoExt_v1: if len(buf) >= 32: raise ValueError("String too long for field bus_id, max length is 31") cdef char *ptr = buf - memcpy((self._ptr[0].busId), ptr, 32) + _cyb_memcpy((self._ptr[0].busId), ptr, 32) @staticmethod def from_buffer(buffer): """Create an PciInfoExt_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlPciInfoExt_v1_t), PciInfoExt_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlPciInfoExt_v1_t), PciInfoExt_v1) @staticmethod def from_data(data): @@ -2284,7 +2360,7 @@ cdef class PciInfoExt_v1: Args: data (_numpy.ndarray): a single-element array of dtype `pci_info_ext_v1_dtype` holding the data. """ - return __from_data(data, "pci_info_ext_v1_dtype", pci_info_ext_v1_dtype, PciInfoExt_v1) + return _cyb_from_data(data, "pci_info_ext_v1_dtype", pci_info_ext_v1_dtype, PciInfoExt_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -2299,10 +2375,10 @@ cdef class PciInfoExt_v1: raise ValueError("ptr must not be null (0)") cdef PciInfoExt_v1 obj = PciInfoExt_v1.__new__(PciInfoExt_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlPciInfoExt_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlPciInfoExt_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating PciInfoExt_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlPciInfoExt_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlPciInfoExt_v1_t)) obj._owner = None obj._owned = True else: @@ -2314,7 +2390,7 @@ cdef class PciInfoExt_v1: cdef _get_pci_info_dtype_offsets(): - cdef nvmlPciInfo_t pod = nvmlPciInfo_t() + cdef nvmlPciInfo_t pod return _numpy.dtype({ 'names': ['bus_id_legacy', 'domain', 'bus', 'device_', 'pci_device_id', 'pci_sub_system_id', 'bus_id'], 'formats': [(_numpy.int8, 16), _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.int8, 32)], @@ -2345,7 +2421,7 @@ cdef class PciInfo: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlPciInfo_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlPciInfo_t)) if self._ptr == NULL: raise MemoryError("Error allocating PciInfo") self._owner = None @@ -2357,7 +2433,7 @@ cdef class PciInfo: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.PciInfo object at {hex(id(self))}>" @@ -2378,20 +2454,20 @@ cdef class PciInfo: if not isinstance(other, PciInfo): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlPciInfo_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlPciInfo_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlPciInfo_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlPciInfo_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlPciInfo_t)) + self._ptr = _cyb_malloc(sizeof(nvmlPciInfo_t)) if self._ptr == NULL: raise MemoryError("Error allocating PciInfo") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlPciInfo_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlPciInfo_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -2401,7 +2477,7 @@ cdef class PciInfo: @property def bus_id_legacy(self): """~_numpy.int8: (array of length 16).""" - return cpython.PyUnicode_FromString(self._ptr[0].busIdLegacy) + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].busIdLegacy) @bus_id_legacy.setter def bus_id_legacy(self, val): @@ -2411,7 +2487,7 @@ cdef class PciInfo: if len(buf) >= 16: raise ValueError("String too long for field bus_id_legacy, max length is 15") cdef char *ptr = buf - memcpy((self._ptr[0].busIdLegacy), ptr, 16) + _cyb_memcpy((self._ptr[0].busIdLegacy), ptr, 16) @property def domain(self): @@ -2471,7 +2547,7 @@ cdef class PciInfo: @property def bus_id(self): """~_numpy.int8: (array of length 32).""" - return cpython.PyUnicode_FromString(self._ptr[0].busId) + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].busId) @bus_id.setter def bus_id(self, val): @@ -2481,12 +2557,12 @@ cdef class PciInfo: if len(buf) >= 32: raise ValueError("String too long for field bus_id, max length is 31") cdef char *ptr = buf - memcpy((self._ptr[0].busId), ptr, 32) + _cyb_memcpy((self._ptr[0].busId), ptr, 32) @staticmethod def from_buffer(buffer): """Create an PciInfo instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlPciInfo_t), PciInfo) + return _cyb_from_buffer(buffer, sizeof(nvmlPciInfo_t), PciInfo) @staticmethod def from_data(data): @@ -2495,7 +2571,7 @@ cdef class PciInfo: Args: data (_numpy.ndarray): a single-element array of dtype `pci_info_dtype` holding the data. """ - return __from_data(data, "pci_info_dtype", pci_info_dtype, PciInfo) + return _cyb_from_data(data, "pci_info_dtype", pci_info_dtype, PciInfo) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -2510,10 +2586,10 @@ cdef class PciInfo: raise ValueError("ptr must not be null (0)") cdef PciInfo obj = PciInfo.__new__(PciInfo) if owner is None: - obj._ptr = malloc(sizeof(nvmlPciInfo_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlPciInfo_t)) if obj._ptr == NULL: raise MemoryError("Error allocating PciInfo") - memcpy((obj._ptr), ptr, sizeof(nvmlPciInfo_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlPciInfo_t)) obj._owner = None obj._owned = True else: @@ -2525,7 +2601,7 @@ cdef class PciInfo: cdef _get_utilization_dtype_offsets(): - cdef nvmlUtilization_t pod = nvmlUtilization_t() + cdef nvmlUtilization_t pod return _numpy.dtype({ 'names': ['gpu', 'memory'], 'formats': [_numpy.uint32, _numpy.uint32], @@ -2551,7 +2627,7 @@ cdef class Utilization: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlUtilization_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlUtilization_t)) if self._ptr == NULL: raise MemoryError("Error allocating Utilization") self._owner = None @@ -2563,7 +2639,7 @@ cdef class Utilization: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.Utilization object at {hex(id(self))}>" @@ -2584,20 +2660,20 @@ cdef class Utilization: if not isinstance(other, Utilization): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlUtilization_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlUtilization_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlUtilization_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlUtilization_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlUtilization_t)) + self._ptr = _cyb_malloc(sizeof(nvmlUtilization_t)) if self._ptr == NULL: raise MemoryError("Error allocating Utilization") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlUtilization_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlUtilization_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -2629,7 +2705,7 @@ cdef class Utilization: @staticmethod def from_buffer(buffer): """Create an Utilization instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlUtilization_t), Utilization) + return _cyb_from_buffer(buffer, sizeof(nvmlUtilization_t), Utilization) @staticmethod def from_data(data): @@ -2638,7 +2714,7 @@ cdef class Utilization: Args: data (_numpy.ndarray): a single-element array of dtype `utilization_dtype` holding the data. """ - return __from_data(data, "utilization_dtype", utilization_dtype, Utilization) + return _cyb_from_data(data, "utilization_dtype", utilization_dtype, Utilization) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -2653,10 +2729,10 @@ cdef class Utilization: raise ValueError("ptr must not be null (0)") cdef Utilization obj = Utilization.__new__(Utilization) if owner is None: - obj._ptr = malloc(sizeof(nvmlUtilization_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlUtilization_t)) if obj._ptr == NULL: raise MemoryError("Error allocating Utilization") - memcpy((obj._ptr), ptr, sizeof(nvmlUtilization_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlUtilization_t)) obj._owner = None obj._owned = True else: @@ -2668,7 +2744,7 @@ cdef class Utilization: cdef _get_memory_dtype_offsets(): - cdef nvmlMemory_t pod = nvmlMemory_t() + cdef nvmlMemory_t pod return _numpy.dtype({ 'names': ['total', 'free', 'used'], 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64], @@ -2695,7 +2771,7 @@ cdef class Memory: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlMemory_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlMemory_t)) if self._ptr == NULL: raise MemoryError("Error allocating Memory") self._owner = None @@ -2707,7 +2783,7 @@ cdef class Memory: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.Memory object at {hex(id(self))}>" @@ -2728,20 +2804,20 @@ cdef class Memory: if not isinstance(other, Memory): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlMemory_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlMemory_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlMemory_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlMemory_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlMemory_t)) + self._ptr = _cyb_malloc(sizeof(nvmlMemory_t)) if self._ptr == NULL: raise MemoryError("Error allocating Memory") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlMemory_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlMemory_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -2784,7 +2860,7 @@ cdef class Memory: @staticmethod def from_buffer(buffer): """Create an Memory instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlMemory_t), Memory) + return _cyb_from_buffer(buffer, sizeof(nvmlMemory_t), Memory) @staticmethod def from_data(data): @@ -2793,7 +2869,7 @@ cdef class Memory: Args: data (_numpy.ndarray): a single-element array of dtype `memory_dtype` holding the data. """ - return __from_data(data, "memory_dtype", memory_dtype, Memory) + return _cyb_from_data(data, "memory_dtype", memory_dtype, Memory) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -2808,10 +2884,10 @@ cdef class Memory: raise ValueError("ptr must not be null (0)") cdef Memory obj = Memory.__new__(Memory) if owner is None: - obj._ptr = malloc(sizeof(nvmlMemory_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlMemory_t)) if obj._ptr == NULL: raise MemoryError("Error allocating Memory") - memcpy((obj._ptr), ptr, sizeof(nvmlMemory_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlMemory_t)) obj._owner = None obj._owned = True else: @@ -2823,7 +2899,7 @@ cdef class Memory: cdef _get_memory_v2_dtype_offsets(): - cdef nvmlMemory_v2_t pod = nvmlMemory_v2_t() + cdef nvmlMemory_v2_t pod return _numpy.dtype({ 'names': ['version', 'total', 'reserved', 'free', 'used'], 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64], @@ -2852,7 +2928,7 @@ cdef class Memory_v2: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlMemory_v2_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlMemory_v2_t)) if self._ptr == NULL: raise MemoryError("Error allocating Memory_v2") self._owner = None @@ -2864,7 +2940,7 @@ cdef class Memory_v2: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.Memory_v2 object at {hex(id(self))}>" @@ -2885,20 +2961,20 @@ cdef class Memory_v2: if not isinstance(other, Memory_v2): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlMemory_v2_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlMemory_v2_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlMemory_v2_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlMemory_v2_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlMemory_v2_t)) + self._ptr = _cyb_malloc(sizeof(nvmlMemory_v2_t)) if self._ptr == NULL: raise MemoryError("Error allocating Memory_v2") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlMemory_v2_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlMemory_v2_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -2963,7 +3039,7 @@ cdef class Memory_v2: @staticmethod def from_buffer(buffer): """Create an Memory_v2 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlMemory_v2_t), Memory_v2) + return _cyb_from_buffer(buffer, sizeof(nvmlMemory_v2_t), Memory_v2) @staticmethod def from_data(data): @@ -2972,7 +3048,7 @@ cdef class Memory_v2: Args: data (_numpy.ndarray): a single-element array of dtype `memory_v2_dtype` holding the data. """ - return __from_data(data, "memory_v2_dtype", memory_v2_dtype, Memory_v2) + return _cyb_from_data(data, "memory_v2_dtype", memory_v2_dtype, Memory_v2) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -2987,10 +3063,10 @@ cdef class Memory_v2: raise ValueError("ptr must not be null (0)") cdef Memory_v2 obj = Memory_v2.__new__(Memory_v2) if owner is None: - obj._ptr = malloc(sizeof(nvmlMemory_v2_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlMemory_v2_t)) if obj._ptr == NULL: raise MemoryError("Error allocating Memory_v2") - memcpy((obj._ptr), ptr, sizeof(nvmlMemory_v2_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlMemory_v2_t)) obj._owner = None obj._owned = True else: @@ -3002,7 +3078,7 @@ cdef class Memory_v2: cdef _get_ba_r1memory_dtype_offsets(): - cdef nvmlBAR1Memory_t pod = nvmlBAR1Memory_t() + cdef nvmlBAR1Memory_t pod return _numpy.dtype({ 'names': ['bar1_total', 'bar1_free', 'bar1_used'], 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64], @@ -3029,7 +3105,7 @@ cdef class BAR1Memory: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlBAR1Memory_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlBAR1Memory_t)) if self._ptr == NULL: raise MemoryError("Error allocating BAR1Memory") self._owner = None @@ -3041,7 +3117,7 @@ cdef class BAR1Memory: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.BAR1Memory object at {hex(id(self))}>" @@ -3062,20 +3138,20 @@ cdef class BAR1Memory: if not isinstance(other, BAR1Memory): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlBAR1Memory_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlBAR1Memory_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlBAR1Memory_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlBAR1Memory_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlBAR1Memory_t)) + self._ptr = _cyb_malloc(sizeof(nvmlBAR1Memory_t)) if self._ptr == NULL: raise MemoryError("Error allocating BAR1Memory") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlBAR1Memory_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlBAR1Memory_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -3118,7 +3194,7 @@ cdef class BAR1Memory: @staticmethod def from_buffer(buffer): """Create an BAR1Memory instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlBAR1Memory_t), BAR1Memory) + return _cyb_from_buffer(buffer, sizeof(nvmlBAR1Memory_t), BAR1Memory) @staticmethod def from_data(data): @@ -3127,7 +3203,7 @@ cdef class BAR1Memory: Args: data (_numpy.ndarray): a single-element array of dtype `ba_r1memory_dtype` holding the data. """ - return __from_data(data, "ba_r1memory_dtype", ba_r1memory_dtype, BAR1Memory) + return _cyb_from_data(data, "ba_r1memory_dtype", ba_r1memory_dtype, BAR1Memory) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -3142,10 +3218,10 @@ cdef class BAR1Memory: raise ValueError("ptr must not be null (0)") cdef BAR1Memory obj = BAR1Memory.__new__(BAR1Memory) if owner is None: - obj._ptr = malloc(sizeof(nvmlBAR1Memory_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlBAR1Memory_t)) if obj._ptr == NULL: raise MemoryError("Error allocating BAR1Memory") - memcpy((obj._ptr), ptr, sizeof(nvmlBAR1Memory_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlBAR1Memory_t)) obj._owner = None obj._owned = True else: @@ -3157,7 +3233,7 @@ cdef class BAR1Memory: cdef _get_process_info_dtype_offsets(): - cdef nvmlProcessInfo_t pod = nvmlProcessInfo_t() + cdef nvmlProcessInfo_t pod return _numpy.dtype({ 'names': ['pid', 'used_gpu_memory', 'gpu_instance_id', 'compute_instance_id'], 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint32, _numpy.uint32], @@ -3174,21 +3250,17 @@ process_info_dtype = _get_process_info_dtype_offsets() cdef class ProcessInfo: """Empty-initialize an array of `nvmlProcessInfo_t`. - The resulting object is of length `size` and of dtype `process_info_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlProcessInfo_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=process_info_dtype) self._data = arr.view(_numpy.recarray) @@ -3225,10 +3297,10 @@ cdef class ProcessInfo: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def pid(self): @@ -3328,8 +3400,8 @@ cdef class ProcessInfo: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef ProcessInfo obj = ProcessInfo.__new__(ProcessInfo) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(nvmlProcessInfo_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=process_info_dtype) obj._data = data.view(_numpy.recarray) @@ -3338,7 +3410,7 @@ cdef class ProcessInfo: cdef _get_process_detail_v1_dtype_offsets(): - cdef nvmlProcessDetail_v1_t pod = nvmlProcessDetail_v1_t() + cdef nvmlProcessDetail_v1_t pod return _numpy.dtype({ 'names': ['pid', 'used_gpu_memory', 'gpu_instance_id', 'compute_instance_id', 'used_gpu_cc_protected_memory'], 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint64], @@ -3356,21 +3428,17 @@ process_detail_v1_dtype = _get_process_detail_v1_dtype_offsets() cdef class ProcessDetail_v1: """Empty-initialize an array of `nvmlProcessDetail_v1_t`. - The resulting object is of length `size` and of dtype `process_detail_v1_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlProcessDetail_v1_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=process_detail_v1_dtype) self._data = arr.view(_numpy.recarray) @@ -3407,10 +3475,10 @@ cdef class ProcessDetail_v1: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def pid(self): @@ -3521,8 +3589,8 @@ cdef class ProcessDetail_v1: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef ProcessDetail_v1 obj = ProcessDetail_v1.__new__(ProcessDetail_v1) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(nvmlProcessDetail_v1_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=process_detail_v1_dtype) obj._data = data.view(_numpy.recarray) @@ -3531,7 +3599,7 @@ cdef class ProcessDetail_v1: cdef _get_device_attributes_dtype_offsets(): - cdef nvmlDeviceAttributes_t pod = nvmlDeviceAttributes_t() + cdef nvmlDeviceAttributes_t pod return _numpy.dtype({ 'names': ['multiprocessor_count', 'shared_copy_engine_count', 'shared_decoder_count', 'shared_encoder_count', 'shared_jpeg_count', 'shared_ofa_count', 'gpu_instance_slice_count', 'compute_instance_slice_count', 'memory_size_mb'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint64], @@ -3564,7 +3632,7 @@ cdef class DeviceAttributes: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlDeviceAttributes_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlDeviceAttributes_t)) if self._ptr == NULL: raise MemoryError("Error allocating DeviceAttributes") self._owner = None @@ -3576,7 +3644,7 @@ cdef class DeviceAttributes: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.DeviceAttributes object at {hex(id(self))}>" @@ -3597,20 +3665,20 @@ cdef class DeviceAttributes: if not isinstance(other, DeviceAttributes): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlDeviceAttributes_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlDeviceAttributes_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlDeviceAttributes_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlDeviceAttributes_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlDeviceAttributes_t)) + self._ptr = _cyb_malloc(sizeof(nvmlDeviceAttributes_t)) if self._ptr == NULL: raise MemoryError("Error allocating DeviceAttributes") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlDeviceAttributes_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlDeviceAttributes_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -3719,7 +3787,7 @@ cdef class DeviceAttributes: @staticmethod def from_buffer(buffer): """Create an DeviceAttributes instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlDeviceAttributes_t), DeviceAttributes) + return _cyb_from_buffer(buffer, sizeof(nvmlDeviceAttributes_t), DeviceAttributes) @staticmethod def from_data(data): @@ -3728,7 +3796,7 @@ cdef class DeviceAttributes: Args: data (_numpy.ndarray): a single-element array of dtype `device_attributes_dtype` holding the data. """ - return __from_data(data, "device_attributes_dtype", device_attributes_dtype, DeviceAttributes) + return _cyb_from_data(data, "device_attributes_dtype", device_attributes_dtype, DeviceAttributes) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -3743,10 +3811,10 @@ cdef class DeviceAttributes: raise ValueError("ptr must not be null (0)") cdef DeviceAttributes obj = DeviceAttributes.__new__(DeviceAttributes) if owner is None: - obj._ptr = malloc(sizeof(nvmlDeviceAttributes_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlDeviceAttributes_t)) if obj._ptr == NULL: raise MemoryError("Error allocating DeviceAttributes") - memcpy((obj._ptr), ptr, sizeof(nvmlDeviceAttributes_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlDeviceAttributes_t)) obj._owner = None obj._owned = True else: @@ -3758,7 +3826,7 @@ cdef class DeviceAttributes: cdef _get_c2c_mode_info_v1_dtype_offsets(): - cdef nvmlC2cModeInfo_v1_t pod = nvmlC2cModeInfo_v1_t() + cdef nvmlC2cModeInfo_v1_t pod return _numpy.dtype({ 'names': ['is_c2c_enabled'], 'formats': [_numpy.uint32], @@ -3783,7 +3851,7 @@ cdef class C2cModeInfo_v1: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlC2cModeInfo_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlC2cModeInfo_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating C2cModeInfo_v1") self._owner = None @@ -3795,7 +3863,7 @@ cdef class C2cModeInfo_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.C2cModeInfo_v1 object at {hex(id(self))}>" @@ -3816,20 +3884,20 @@ cdef class C2cModeInfo_v1: if not isinstance(other, C2cModeInfo_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlC2cModeInfo_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlC2cModeInfo_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlC2cModeInfo_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlC2cModeInfo_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlC2cModeInfo_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlC2cModeInfo_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating C2cModeInfo_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlC2cModeInfo_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlC2cModeInfo_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -3850,7 +3918,7 @@ cdef class C2cModeInfo_v1: @staticmethod def from_buffer(buffer): """Create an C2cModeInfo_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlC2cModeInfo_v1_t), C2cModeInfo_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlC2cModeInfo_v1_t), C2cModeInfo_v1) @staticmethod def from_data(data): @@ -3859,7 +3927,7 @@ cdef class C2cModeInfo_v1: Args: data (_numpy.ndarray): a single-element array of dtype `c2c_mode_info_v1_dtype` holding the data. """ - return __from_data(data, "c2c_mode_info_v1_dtype", c2c_mode_info_v1_dtype, C2cModeInfo_v1) + return _cyb_from_data(data, "c2c_mode_info_v1_dtype", c2c_mode_info_v1_dtype, C2cModeInfo_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -3874,10 +3942,10 @@ cdef class C2cModeInfo_v1: raise ValueError("ptr must not be null (0)") cdef C2cModeInfo_v1 obj = C2cModeInfo_v1.__new__(C2cModeInfo_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlC2cModeInfo_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlC2cModeInfo_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating C2cModeInfo_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlC2cModeInfo_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlC2cModeInfo_v1_t)) obj._owner = None obj._owned = True else: @@ -3889,7 +3957,7 @@ cdef class C2cModeInfo_v1: cdef _get_row_remapper_histogram_values_dtype_offsets(): - cdef nvmlRowRemapperHistogramValues_t pod = nvmlRowRemapperHistogramValues_t() + cdef nvmlRowRemapperHistogramValues_t pod return _numpy.dtype({ 'names': ['max_', 'high', 'partial', 'low', 'none'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], @@ -3918,7 +3986,7 @@ cdef class RowRemapperHistogramValues: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlRowRemapperHistogramValues_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlRowRemapperHistogramValues_t)) if self._ptr == NULL: raise MemoryError("Error allocating RowRemapperHistogramValues") self._owner = None @@ -3930,7 +3998,7 @@ cdef class RowRemapperHistogramValues: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.RowRemapperHistogramValues object at {hex(id(self))}>" @@ -3951,20 +4019,20 @@ cdef class RowRemapperHistogramValues: if not isinstance(other, RowRemapperHistogramValues): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlRowRemapperHistogramValues_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlRowRemapperHistogramValues_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlRowRemapperHistogramValues_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlRowRemapperHistogramValues_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlRowRemapperHistogramValues_t)) + self._ptr = _cyb_malloc(sizeof(nvmlRowRemapperHistogramValues_t)) if self._ptr == NULL: raise MemoryError("Error allocating RowRemapperHistogramValues") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlRowRemapperHistogramValues_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlRowRemapperHistogramValues_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -4029,7 +4097,7 @@ cdef class RowRemapperHistogramValues: @staticmethod def from_buffer(buffer): """Create an RowRemapperHistogramValues instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlRowRemapperHistogramValues_t), RowRemapperHistogramValues) + return _cyb_from_buffer(buffer, sizeof(nvmlRowRemapperHistogramValues_t), RowRemapperHistogramValues) @staticmethod def from_data(data): @@ -4038,7 +4106,7 @@ cdef class RowRemapperHistogramValues: Args: data (_numpy.ndarray): a single-element array of dtype `row_remapper_histogram_values_dtype` holding the data. """ - return __from_data(data, "row_remapper_histogram_values_dtype", row_remapper_histogram_values_dtype, RowRemapperHistogramValues) + return _cyb_from_data(data, "row_remapper_histogram_values_dtype", row_remapper_histogram_values_dtype, RowRemapperHistogramValues) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -4053,10 +4121,10 @@ cdef class RowRemapperHistogramValues: raise ValueError("ptr must not be null (0)") cdef RowRemapperHistogramValues obj = RowRemapperHistogramValues.__new__(RowRemapperHistogramValues) if owner is None: - obj._ptr = malloc(sizeof(nvmlRowRemapperHistogramValues_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlRowRemapperHistogramValues_t)) if obj._ptr == NULL: raise MemoryError("Error allocating RowRemapperHistogramValues") - memcpy((obj._ptr), ptr, sizeof(nvmlRowRemapperHistogramValues_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlRowRemapperHistogramValues_t)) obj._owner = None obj._owned = True else: @@ -4068,7 +4136,7 @@ cdef class RowRemapperHistogramValues: cdef _get_bridge_chip_info_dtype_offsets(): - cdef nvmlBridgeChipInfo_t pod = nvmlBridgeChipInfo_t() + cdef nvmlBridgeChipInfo_t pod return _numpy.dtype({ 'names': ['type', 'fw_version'], 'formats': [_numpy.int32, _numpy.uint32], @@ -4083,21 +4151,17 @@ bridge_chip_info_dtype = _get_bridge_chip_info_dtype_offsets() cdef class BridgeChipInfo: """Empty-initialize an array of `nvmlBridgeChipInfo_t`. - The resulting object is of length `size` and of dtype `bridge_chip_info_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlBridgeChipInfo_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=bridge_chip_info_dtype) self._data = arr.view(_numpy.recarray) @@ -4134,10 +4198,10 @@ cdef class BridgeChipInfo: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def type(self): @@ -4215,8 +4279,8 @@ cdef class BridgeChipInfo: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef BridgeChipInfo obj = BridgeChipInfo.__new__(BridgeChipInfo) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(nvmlBridgeChipInfo_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=bridge_chip_info_dtype) obj._data = data.view(_numpy.recarray) @@ -4237,7 +4301,6 @@ value_dtype = _numpy.dtype(( } )) - cdef class Value: """Empty-initialize an instance of `nvmlValue_t`. @@ -4251,7 +4314,7 @@ cdef class Value: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlValue_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlValue_t)) if self._ptr == NULL: raise MemoryError("Error allocating Value") self._owner = None @@ -4263,7 +4326,7 @@ cdef class Value: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.Value object at {hex(id(self))}>" @@ -4284,20 +4347,20 @@ cdef class Value: if not isinstance(other, Value): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlValue_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlValue_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlValue_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlValue_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlValue_t)) + self._ptr = _cyb_malloc(sizeof(nvmlValue_t)) if self._ptr == NULL: raise MemoryError("Error allocating Value") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlValue_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlValue_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -4384,7 +4447,7 @@ cdef class Value: @staticmethod def from_buffer(buffer): """Create an Value instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlValue_t), Value) + return _cyb_from_buffer(buffer, sizeof(nvmlValue_t), Value) @staticmethod def from_data(data): @@ -4393,7 +4456,7 @@ cdef class Value: Args: data (_numpy.ndarray): a single-element array of dtype `value_dtype` holding the data. """ - return __from_data(data, "value_dtype", value_dtype, Value) + return _cyb_from_data(data, "value_dtype", value_dtype, Value) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -4408,10 +4471,10 @@ cdef class Value: raise ValueError("ptr must not be null (0)") cdef Value obj = Value.__new__(Value) if owner is None: - obj._ptr = malloc(sizeof(nvmlValue_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlValue_t)) if obj._ptr == NULL: raise MemoryError("Error allocating Value") - memcpy((obj._ptr), ptr, sizeof(nvmlValue_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlValue_t)) obj._owner = None obj._owned = True else: @@ -4423,7 +4486,7 @@ cdef class Value: cdef _get__py_anon_pod0_dtype_offsets(): - cdef _anon_pod0 pod = _anon_pod0() + cdef cuda_bindings_nvml__anon_pod0 pod return _numpy.dtype({ 'names': ['controller', 'default_min_temp', 'default_max_temp', 'current_temp', 'target'], 'formats': [_numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32], @@ -4434,25 +4497,25 @@ cdef _get__py_anon_pod0_dtype_offsets(): (&(pod.currentTemp)) - (&pod), (&(pod.target)) - (&pod), ], - 'itemsize': sizeof(_anon_pod0), + 'itemsize': sizeof(cuda_bindings_nvml__anon_pod0), }) _py_anon_pod0_dtype = _get__py_anon_pod0_dtype_offsets() cdef class _py_anon_pod0: - """Empty-initialize an instance of `_anon_pod0`. + """Empty-initialize an instance of `cuda_bindings_nvml__anon_pod0`. - .. seealso:: `_anon_pod0` + .. seealso:: `cuda_bindings_nvml__anon_pod0` """ cdef: - _anon_pod0 *_ptr + cuda_bindings_nvml__anon_pod0 *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = <_anon_pod0 *>calloc(1, sizeof(_anon_pod0)) + self._ptr = _cyb_calloc(1, sizeof(cuda_bindings_nvml__anon_pod0)) if self._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod0") self._owner = None @@ -4460,11 +4523,11 @@ cdef class _py_anon_pod0: self._readonly = False def __dealloc__(self): - cdef _anon_pod0 *ptr + cdef cuda_bindings_nvml__anon_pod0 *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}._py_anon_pod0 object at {hex(id(self))}>" @@ -4485,20 +4548,20 @@ cdef class _py_anon_pod0: if not isinstance(other, _py_anon_pod0): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(_anon_pod0)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(cuda_bindings_nvml__anon_pod0)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(_anon_pod0), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(cuda_bindings_nvml__anon_pod0), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = <_anon_pod0 *>malloc(sizeof(_anon_pod0)) + self._ptr = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod0)) if self._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod0") - memcpy(self._ptr, val.ctypes.data, sizeof(_anon_pod0)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(cuda_bindings_nvml__anon_pod0)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -4563,7 +4626,7 @@ cdef class _py_anon_pod0: @staticmethod def from_buffer(buffer): """Create an _py_anon_pod0 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(_anon_pod0), _py_anon_pod0) + return _cyb_from_buffer(buffer, sizeof(cuda_bindings_nvml__anon_pod0), _py_anon_pod0) @staticmethod def from_data(data): @@ -4572,7 +4635,7 @@ cdef class _py_anon_pod0: Args: data (_numpy.ndarray): a single-element array of dtype `_py_anon_pod0_dtype` holding the data. """ - return __from_data(data, "_py_anon_pod0_dtype", _py_anon_pod0_dtype, _py_anon_pod0) + return _cyb_from_data(data, "_py_anon_pod0_dtype", _py_anon_pod0_dtype, _py_anon_pod0) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -4587,14 +4650,14 @@ cdef class _py_anon_pod0: raise ValueError("ptr must not be null (0)") cdef _py_anon_pod0 obj = _py_anon_pod0.__new__(_py_anon_pod0) if owner is None: - obj._ptr = <_anon_pod0 *>malloc(sizeof(_anon_pod0)) + obj._ptr = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod0)) if obj._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod0") - memcpy((obj._ptr), ptr, sizeof(_anon_pod0)) + _cyb_memcpy((obj._ptr), ptr, sizeof(cuda_bindings_nvml__anon_pod0)) obj._owner = None obj._owned = True else: - obj._ptr = <_anon_pod0 *>ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly @@ -4602,9 +4665,9 @@ cdef class _py_anon_pod0: cdef _get_cooler_info_v1_dtype_offsets(): - cdef nvmlCoolerInfo_v1_t pod = nvmlCoolerInfo_v1_t() + cdef nvmlCoolerInfo_v1_t pod return _numpy.dtype({ - 'names': ['version', 'ind_ex', 'signal_type', 'target'], + 'names': ['version', 'index', 'signal_type', 'target'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.int32, _numpy.int32], 'offsets': [ (&(pod.version)) - (&pod), @@ -4630,7 +4693,7 @@ cdef class CoolerInfo_v1: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlCoolerInfo_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlCoolerInfo_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating CoolerInfo_v1") self._owner = None @@ -4642,7 +4705,7 @@ cdef class CoolerInfo_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.CoolerInfo_v1 object at {hex(id(self))}>" @@ -4663,20 +4726,20 @@ cdef class CoolerInfo_v1: if not isinstance(other, CoolerInfo_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlCoolerInfo_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlCoolerInfo_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlCoolerInfo_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlCoolerInfo_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlCoolerInfo_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlCoolerInfo_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating CoolerInfo_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlCoolerInfo_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlCoolerInfo_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -4695,12 +4758,12 @@ cdef class CoolerInfo_v1: self._ptr[0].version = val @property - def ind_ex(self): + def index(self): """int: the cooler index""" return self._ptr[0].index - @ind_ex.setter - def ind_ex(self, val): + @index.setter + def index(self, val): if self._readonly: raise ValueError("This CoolerInfo_v1 instance is read-only") self._ptr[0].index = val @@ -4730,7 +4793,7 @@ cdef class CoolerInfo_v1: @staticmethod def from_buffer(buffer): """Create an CoolerInfo_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlCoolerInfo_v1_t), CoolerInfo_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlCoolerInfo_v1_t), CoolerInfo_v1) @staticmethod def from_data(data): @@ -4739,7 +4802,7 @@ cdef class CoolerInfo_v1: Args: data (_numpy.ndarray): a single-element array of dtype `cooler_info_v1_dtype` holding the data. """ - return __from_data(data, "cooler_info_v1_dtype", cooler_info_v1_dtype, CoolerInfo_v1) + return _cyb_from_data(data, "cooler_info_v1_dtype", cooler_info_v1_dtype, CoolerInfo_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -4754,10 +4817,10 @@ cdef class CoolerInfo_v1: raise ValueError("ptr must not be null (0)") cdef CoolerInfo_v1 obj = CoolerInfo_v1.__new__(CoolerInfo_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlCoolerInfo_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlCoolerInfo_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating CoolerInfo_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlCoolerInfo_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlCoolerInfo_v1_t)) obj._owner = None obj._owned = True else: @@ -4769,7 +4832,7 @@ cdef class CoolerInfo_v1: cdef _get_clk_mon_fault_info_dtype_offsets(): - cdef nvmlClkMonFaultInfo_t pod = nvmlClkMonFaultInfo_t() + cdef nvmlClkMonFaultInfo_t pod return _numpy.dtype({ 'names': ['clk_api_domain', 'clk_domain_fault_mask'], 'formats': [_numpy.uint32, _numpy.uint32], @@ -4784,21 +4847,17 @@ clk_mon_fault_info_dtype = _get_clk_mon_fault_info_dtype_offsets() cdef class ClkMonFaultInfo: """Empty-initialize an array of `nvmlClkMonFaultInfo_t`. - The resulting object is of length `size` and of dtype `clk_mon_fault_info_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlClkMonFaultInfo_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=clk_mon_fault_info_dtype) self._data = arr.view(_numpy.recarray) @@ -4835,10 +4894,10 @@ cdef class ClkMonFaultInfo: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def clk_api_domain(self): @@ -4916,8 +4975,8 @@ cdef class ClkMonFaultInfo: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef ClkMonFaultInfo obj = ClkMonFaultInfo.__new__(ClkMonFaultInfo) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(nvmlClkMonFaultInfo_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=clk_mon_fault_info_dtype) obj._data = data.view(_numpy.recarray) @@ -4926,7 +4985,7 @@ cdef class ClkMonFaultInfo: cdef _get_clock_offset_v1_dtype_offsets(): - cdef nvmlClockOffset_v1_t pod = nvmlClockOffset_v1_t() + cdef nvmlClockOffset_v1_t pod return _numpy.dtype({ 'names': ['version', 'type', 'pstate', 'clock_offset_m_hz', 'min_clock_offset_m_hz', 'max_clock_offset_m_hz'], 'formats': [_numpy.uint32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32], @@ -4956,7 +5015,7 @@ cdef class ClockOffset_v1: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlClockOffset_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlClockOffset_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating ClockOffset_v1") self._owner = None @@ -4968,7 +5027,7 @@ cdef class ClockOffset_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.ClockOffset_v1 object at {hex(id(self))}>" @@ -4989,20 +5048,20 @@ cdef class ClockOffset_v1: if not isinstance(other, ClockOffset_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlClockOffset_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlClockOffset_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlClockOffset_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlClockOffset_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlClockOffset_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlClockOffset_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating ClockOffset_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlClockOffset_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlClockOffset_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -5078,7 +5137,7 @@ cdef class ClockOffset_v1: @staticmethod def from_buffer(buffer): """Create an ClockOffset_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlClockOffset_v1_t), ClockOffset_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlClockOffset_v1_t), ClockOffset_v1) @staticmethod def from_data(data): @@ -5087,7 +5146,7 @@ cdef class ClockOffset_v1: Args: data (_numpy.ndarray): a single-element array of dtype `clock_offset_v1_dtype` holding the data. """ - return __from_data(data, "clock_offset_v1_dtype", clock_offset_v1_dtype, ClockOffset_v1) + return _cyb_from_data(data, "clock_offset_v1_dtype", clock_offset_v1_dtype, ClockOffset_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -5102,10 +5161,10 @@ cdef class ClockOffset_v1: raise ValueError("ptr must not be null (0)") cdef ClockOffset_v1 obj = ClockOffset_v1.__new__(ClockOffset_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlClockOffset_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlClockOffset_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating ClockOffset_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlClockOffset_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlClockOffset_v1_t)) obj._owner = None obj._owned = True else: @@ -5117,7 +5176,7 @@ cdef class ClockOffset_v1: cdef _get_process_utilization_sample_dtype_offsets(): - cdef nvmlProcessUtilizationSample_t pod = nvmlProcessUtilizationSample_t() + cdef nvmlProcessUtilizationSample_t pod return _numpy.dtype({ 'names': ['pid', 'time_stamp', 'sm_util', 'mem_util', 'enc_util', 'dec_util'], 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], @@ -5136,21 +5195,17 @@ process_utilization_sample_dtype = _get_process_utilization_sample_dtype_offsets cdef class ProcessUtilizationSample: """Empty-initialize an array of `nvmlProcessUtilizationSample_t`. - The resulting object is of length `size` and of dtype `process_utilization_sample_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlProcessUtilizationSample_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=process_utilization_sample_dtype) self._data = arr.view(_numpy.recarray) @@ -5187,10 +5242,10 @@ cdef class ProcessUtilizationSample: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def pid(self): @@ -5312,8 +5367,8 @@ cdef class ProcessUtilizationSample: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef ProcessUtilizationSample obj = ProcessUtilizationSample.__new__(ProcessUtilizationSample) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(nvmlProcessUtilizationSample_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=process_utilization_sample_dtype) obj._data = data.view(_numpy.recarray) @@ -5322,7 +5377,7 @@ cdef class ProcessUtilizationSample: cdef _get_process_utilization_info_v1_dtype_offsets(): - cdef nvmlProcessUtilizationInfo_v1_t pod = nvmlProcessUtilizationInfo_v1_t() + cdef nvmlProcessUtilizationInfo_v1_t pod return _numpy.dtype({ 'names': ['time_stamp', 'pid', 'sm_util', 'mem_util', 'enc_util', 'dec_util', 'jpg_util', 'ofa_util'], 'formats': [_numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], @@ -5343,21 +5398,17 @@ process_utilization_info_v1_dtype = _get_process_utilization_info_v1_dtype_offse cdef class ProcessUtilizationInfo_v1: """Empty-initialize an array of `nvmlProcessUtilizationInfo_v1_t`. - The resulting object is of length `size` and of dtype `process_utilization_info_v1_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlProcessUtilizationInfo_v1_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=process_utilization_info_v1_dtype) self._data = arr.view(_numpy.recarray) @@ -5394,10 +5445,10 @@ cdef class ProcessUtilizationInfo_v1: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def time_stamp(self): @@ -5541,8 +5592,8 @@ cdef class ProcessUtilizationInfo_v1: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef ProcessUtilizationInfo_v1 obj = ProcessUtilizationInfo_v1.__new__(ProcessUtilizationInfo_v1) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(nvmlProcessUtilizationInfo_v1_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=process_utilization_info_v1_dtype) obj._data = data.view(_numpy.recarray) @@ -5551,7 +5602,7 @@ cdef class ProcessUtilizationInfo_v1: cdef _get_ecc_sram_error_status_v1_dtype_offsets(): - cdef nvmlEccSramErrorStatus_v1_t pod = nvmlEccSramErrorStatus_v1_t() + cdef nvmlEccSramErrorStatus_v1_t pod return _numpy.dtype({ 'names': ['version', 'aggregate_unc_parity', 'aggregate_unc_sec_ded', 'aggregate_cor', 'volatile_unc_parity', 'volatile_unc_sec_ded', 'volatile_cor', 'aggregate_unc_bucket_l2', 'aggregate_unc_bucket_sm', 'aggregate_unc_bucket_pcie', 'aggregate_unc_bucket_mcu', 'aggregate_unc_bucket_other', 'b_threshold_exceeded'], 'formats': [_numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32], @@ -5588,7 +5639,7 @@ cdef class EccSramErrorStatus_v1: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlEccSramErrorStatus_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlEccSramErrorStatus_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating EccSramErrorStatus_v1") self._owner = None @@ -5600,7 +5651,7 @@ cdef class EccSramErrorStatus_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.EccSramErrorStatus_v1 object at {hex(id(self))}>" @@ -5621,20 +5672,20 @@ cdef class EccSramErrorStatus_v1: if not isinstance(other, EccSramErrorStatus_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlEccSramErrorStatus_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlEccSramErrorStatus_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlEccSramErrorStatus_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlEccSramErrorStatus_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlEccSramErrorStatus_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlEccSramErrorStatus_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating EccSramErrorStatus_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlEccSramErrorStatus_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlEccSramErrorStatus_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -5787,7 +5838,7 @@ cdef class EccSramErrorStatus_v1: @staticmethod def from_buffer(buffer): """Create an EccSramErrorStatus_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlEccSramErrorStatus_v1_t), EccSramErrorStatus_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlEccSramErrorStatus_v1_t), EccSramErrorStatus_v1) @staticmethod def from_data(data): @@ -5796,7 +5847,7 @@ cdef class EccSramErrorStatus_v1: Args: data (_numpy.ndarray): a single-element array of dtype `ecc_sram_error_status_v1_dtype` holding the data. """ - return __from_data(data, "ecc_sram_error_status_v1_dtype", ecc_sram_error_status_v1_dtype, EccSramErrorStatus_v1) + return _cyb_from_data(data, "ecc_sram_error_status_v1_dtype", ecc_sram_error_status_v1_dtype, EccSramErrorStatus_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -5811,10 +5862,10 @@ cdef class EccSramErrorStatus_v1: raise ValueError("ptr must not be null (0)") cdef EccSramErrorStatus_v1 obj = EccSramErrorStatus_v1.__new__(EccSramErrorStatus_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlEccSramErrorStatus_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlEccSramErrorStatus_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating EccSramErrorStatus_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlEccSramErrorStatus_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlEccSramErrorStatus_v1_t)) obj._owner = None obj._owned = True else: @@ -5826,9 +5877,9 @@ cdef class EccSramErrorStatus_v1: cdef _get_platform_info_v1_dtype_offsets(): - cdef nvmlPlatformInfo_v1_t pod = nvmlPlatformInfo_v1_t() + cdef nvmlPlatformInfo_v1_t pod return _numpy.dtype({ - 'names': ['version', 'ib_guid', 'rack_guid', 'chassis_physical_slot_number', 'compute_slot_ind_ex', 'node_ind_ex', 'peer_type', 'module_id'], + 'names': ['version', 'ib_guid', 'rack_guid', 'chassis_physical_slot_number', 'compute_slot_index', 'node_index', 'peer_type', 'module_id'], 'formats': [_numpy.uint32, (_numpy.uint8, 16), (_numpy.uint8, 16), _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8], 'offsets': [ (&(pod.version)) - (&pod), @@ -5858,7 +5909,7 @@ cdef class PlatformInfo_v1: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlPlatformInfo_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlPlatformInfo_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating PlatformInfo_v1") self._owner = None @@ -5870,7 +5921,7 @@ cdef class PlatformInfo_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.PlatformInfo_v1 object at {hex(id(self))}>" @@ -5891,20 +5942,20 @@ cdef class PlatformInfo_v1: if not isinstance(other, PlatformInfo_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlPlatformInfo_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlPlatformInfo_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlPlatformInfo_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlPlatformInfo_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlPlatformInfo_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlPlatformInfo_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating PlatformInfo_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlPlatformInfo_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlPlatformInfo_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -5924,8 +5975,8 @@ cdef class PlatformInfo_v1: @property def ib_guid(self): - """~_numpy.uint8: (array of length 16).Infiniband GUID reported by platform (for Blackwell, ibGuid is 8 bytes so indices 8-15 are zero)""" - cdef view.array arr = view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) + """~_numpy.uint8: (array of length 16).Infiniband GUID reported by platform (for Blackwell, ibGuid is 8 bytes so indices 8-15 are zero).""" + cdef _cyb_view.array arr = _cyb_view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) arr.data = (&(self._ptr[0].ibGuid)) return _numpy.asarray(arr) @@ -5935,14 +5986,14 @@ cdef class PlatformInfo_v1: raise ValueError("This PlatformInfo_v1 instance is read-only") if len(val) != 16: raise ValueError(f"Expected length { 16 } for field ib_guid, got {len(val)}") - cdef view.array arr = view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c") + cdef _cyb_view.array arr = _cyb_view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c") arr[:] = _numpy.asarray(val, dtype=_numpy.uint8) - memcpy((&(self._ptr[0].ibGuid)), (arr.data), sizeof(unsigned char) * len(val)) + _cyb_memcpy((&(self._ptr[0].ibGuid)), (arr.data), sizeof(unsigned char) * len(val)) @property def rack_guid(self): - """~_numpy.uint8: (array of length 16).GUID of the rack containing this GPU (for Blackwell rackGuid is 13 bytes so indices 13-15 are zero)""" - cdef view.array arr = view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) + """~_numpy.uint8: (array of length 16).GUID of the rack containing this GPU (for Blackwell rackGuid is 13 bytes so indices 13-15 are zero).""" + cdef _cyb_view.array arr = _cyb_view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) arr.data = (&(self._ptr[0].rackGuid)) return _numpy.asarray(arr) @@ -5952,13 +6003,13 @@ cdef class PlatformInfo_v1: raise ValueError("This PlatformInfo_v1 instance is read-only") if len(val) != 16: raise ValueError(f"Expected length { 16 } for field rack_guid, got {len(val)}") - cdef view.array arr = view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c") + cdef _cyb_view.array arr = _cyb_view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c") arr[:] = _numpy.asarray(val, dtype=_numpy.uint8) - memcpy((&(self._ptr[0].rackGuid)), (arr.data), sizeof(unsigned char) * len(val)) + _cyb_memcpy((&(self._ptr[0].rackGuid)), (arr.data), sizeof(unsigned char) * len(val)) @property def chassis_physical_slot_number(self): - """int: The slot number in the rack containing this GPU (includes switches)""" + """int: The slot number in the rack containing this GPU (includes switches).""" return self._ptr[0].chassisPhysicalSlotNumber @chassis_physical_slot_number.setter @@ -5968,30 +6019,30 @@ cdef class PlatformInfo_v1: self._ptr[0].chassisPhysicalSlotNumber = val @property - def compute_slot_ind_ex(self): - """int: The index within the compute slots in the rack containing this GPU (does not include switches)""" + def compute_slot_index(self): + """int: The index within the compute slots in the rack containing this GPU (does not include switches).""" return self._ptr[0].computeSlotIndex - @compute_slot_ind_ex.setter - def compute_slot_ind_ex(self, val): + @compute_slot_index.setter + def compute_slot_index(self, val): if self._readonly: raise ValueError("This PlatformInfo_v1 instance is read-only") self._ptr[0].computeSlotIndex = val @property - def node_ind_ex(self): + def node_index(self): """int: Index of the node within the slot containing this GPU.""" return self._ptr[0].nodeIndex - @node_ind_ex.setter - def node_ind_ex(self, val): + @node_index.setter + def node_index(self, val): if self._readonly: raise ValueError("This PlatformInfo_v1 instance is read-only") self._ptr[0].nodeIndex = val @property def peer_type(self): - """int: Platform indicated NVLink-peer type (e.g. switch present or not)""" + """int: Platform indicated NVLink-peer type (e.g. switch present or not).""" return self._ptr[0].peerType @peer_type.setter @@ -6014,7 +6065,7 @@ cdef class PlatformInfo_v1: @staticmethod def from_buffer(buffer): """Create an PlatformInfo_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlPlatformInfo_v1_t), PlatformInfo_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlPlatformInfo_v1_t), PlatformInfo_v1) @staticmethod def from_data(data): @@ -6023,7 +6074,7 @@ cdef class PlatformInfo_v1: Args: data (_numpy.ndarray): a single-element array of dtype `platform_info_v1_dtype` holding the data. """ - return __from_data(data, "platform_info_v1_dtype", platform_info_v1_dtype, PlatformInfo_v1) + return _cyb_from_data(data, "platform_info_v1_dtype", platform_info_v1_dtype, PlatformInfo_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -6038,10 +6089,10 @@ cdef class PlatformInfo_v1: raise ValueError("ptr must not be null (0)") cdef PlatformInfo_v1 obj = PlatformInfo_v1.__new__(PlatformInfo_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlPlatformInfo_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlPlatformInfo_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating PlatformInfo_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlPlatformInfo_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlPlatformInfo_v1_t)) obj._owner = None obj._owned = True else: @@ -6053,9 +6104,9 @@ cdef class PlatformInfo_v1: cdef _get_platform_info_v2_dtype_offsets(): - cdef nvmlPlatformInfo_v2_t pod = nvmlPlatformInfo_v2_t() + cdef nvmlPlatformInfo_v2_t pod return _numpy.dtype({ - 'names': ['version', 'ib_guid', 'chassis_serial_number', 'slot_number', 'tray_ind_ex', 'host_id', 'peer_type', 'module_id'], + 'names': ['version', 'ib_guid', 'chassis_serial_number', 'slot_number', 'tray_index', 'host_id', 'peer_type', 'module_id'], 'formats': [_numpy.uint32, (_numpy.uint8, 16), (_numpy.uint8, 16), _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8, _numpy.uint8], 'offsets': [ (&(pod.version)) - (&pod), @@ -6085,7 +6136,7 @@ cdef class PlatformInfo_v2: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlPlatformInfo_v2_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlPlatformInfo_v2_t)) if self._ptr == NULL: raise MemoryError("Error allocating PlatformInfo_v2") self._owner = None @@ -6097,7 +6148,7 @@ cdef class PlatformInfo_v2: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.PlatformInfo_v2 object at {hex(id(self))}>" @@ -6118,20 +6169,20 @@ cdef class PlatformInfo_v2: if not isinstance(other, PlatformInfo_v2): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlPlatformInfo_v2_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlPlatformInfo_v2_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlPlatformInfo_v2_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlPlatformInfo_v2_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlPlatformInfo_v2_t)) + self._ptr = _cyb_malloc(sizeof(nvmlPlatformInfo_v2_t)) if self._ptr == NULL: raise MemoryError("Error allocating PlatformInfo_v2") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlPlatformInfo_v2_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlPlatformInfo_v2_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -6151,8 +6202,8 @@ cdef class PlatformInfo_v2: @property def ib_guid(self): - """~_numpy.uint8: (array of length 16).Infiniband GUID reported by platform (for Blackwell, ibGuid is 8 bytes so indices 8-15 are zero)""" - cdef view.array arr = view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) + """~_numpy.uint8: (array of length 16).Infiniband GUID reported by platform (for Blackwell, ibGuid is 8 bytes so indices 8-15 are zero).""" + cdef _cyb_view.array arr = _cyb_view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) arr.data = (&(self._ptr[0].ibGuid)) return _numpy.asarray(arr) @@ -6162,14 +6213,14 @@ cdef class PlatformInfo_v2: raise ValueError("This PlatformInfo_v2 instance is read-only") if len(val) != 16: raise ValueError(f"Expected length { 16 } for field ib_guid, got {len(val)}") - cdef view.array arr = view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c") + cdef _cyb_view.array arr = _cyb_view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c") arr[:] = _numpy.asarray(val, dtype=_numpy.uint8) - memcpy((&(self._ptr[0].ibGuid)), (arr.data), sizeof(unsigned char) * len(val)) + _cyb_memcpy((&(self._ptr[0].ibGuid)), (arr.data), sizeof(unsigned char) * len(val)) @property def chassis_serial_number(self): - """~_numpy.uint8: (array of length 16).Serial number of the chassis containing this GPU (for Blackwell it is 13 bytes so indices 13-15 are zero)""" - cdef view.array arr = view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) + """~_numpy.uint8: (array of length 16).Serial number of the chassis containing this GPU (for Blackwell it is 13 bytes so indices 13-15 are zero).""" + cdef _cyb_view.array arr = _cyb_view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) arr.data = (&(self._ptr[0].chassisSerialNumber)) return _numpy.asarray(arr) @@ -6179,13 +6230,13 @@ cdef class PlatformInfo_v2: raise ValueError("This PlatformInfo_v2 instance is read-only") if len(val) != 16: raise ValueError(f"Expected length { 16 } for field chassis_serial_number, got {len(val)}") - cdef view.array arr = view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c") + cdef _cyb_view.array arr = _cyb_view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c") arr[:] = _numpy.asarray(val, dtype=_numpy.uint8) - memcpy((&(self._ptr[0].chassisSerialNumber)), (arr.data), sizeof(unsigned char) * len(val)) + _cyb_memcpy((&(self._ptr[0].chassisSerialNumber)), (arr.data), sizeof(unsigned char) * len(val)) @property def slot_number(self): - """int: The slot number in the chassis containing this GPU (includes switches)""" + """int: The slot number in the chassis containing this GPU (includes switches).""" return self._ptr[0].slotNumber @slot_number.setter @@ -6195,12 +6246,12 @@ cdef class PlatformInfo_v2: self._ptr[0].slotNumber = val @property - def tray_ind_ex(self): - """int: The tray index within the compute slots in the chassis containing this GPU (does not include switches)""" + def tray_index(self): + """int: The tray index within the compute slots in the chassis containing this GPU (does not include switches).""" return self._ptr[0].trayIndex - @tray_ind_ex.setter - def tray_ind_ex(self, val): + @tray_index.setter + def tray_index(self, val): if self._readonly: raise ValueError("This PlatformInfo_v2 instance is read-only") self._ptr[0].trayIndex = val @@ -6218,7 +6269,7 @@ cdef class PlatformInfo_v2: @property def peer_type(self): - """int: Platform indicated NVLink-peer type (e.g. switch present or not)""" + """int: Platform indicated NVLink-peer type (e.g. switch present or not).""" return self._ptr[0].peerType @peer_type.setter @@ -6241,7 +6292,7 @@ cdef class PlatformInfo_v2: @staticmethod def from_buffer(buffer): """Create an PlatformInfo_v2 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlPlatformInfo_v2_t), PlatformInfo_v2) + return _cyb_from_buffer(buffer, sizeof(nvmlPlatformInfo_v2_t), PlatformInfo_v2) @staticmethod def from_data(data): @@ -6250,7 +6301,7 @@ cdef class PlatformInfo_v2: Args: data (_numpy.ndarray): a single-element array of dtype `platform_info_v2_dtype` holding the data. """ - return __from_data(data, "platform_info_v2_dtype", platform_info_v2_dtype, PlatformInfo_v2) + return _cyb_from_data(data, "platform_info_v2_dtype", platform_info_v2_dtype, PlatformInfo_v2) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -6265,10 +6316,10 @@ cdef class PlatformInfo_v2: raise ValueError("ptr must not be null (0)") cdef PlatformInfo_v2 obj = PlatformInfo_v2.__new__(PlatformInfo_v2) if owner is None: - obj._ptr = malloc(sizeof(nvmlPlatformInfo_v2_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlPlatformInfo_v2_t)) if obj._ptr == NULL: raise MemoryError("Error allocating PlatformInfo_v2") - memcpy((obj._ptr), ptr, sizeof(nvmlPlatformInfo_v2_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlPlatformInfo_v2_t)) obj._owner = None obj._owned = True else: @@ -6280,7 +6331,7 @@ cdef class PlatformInfo_v2: cdef _get__py_anon_pod1_dtype_offsets(): - cdef _anon_pod1 pod = _anon_pod1() + cdef cuda_bindings_nvml__anon_pod1 pod return _numpy.dtype({ 'names': ['b_is_present', 'percentage', 'inc_threshold', 'dec_threshold'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], @@ -6290,25 +6341,25 @@ cdef _get__py_anon_pod1_dtype_offsets(): (&(pod.incThreshold)) - (&pod), (&(pod.decThreshold)) - (&pod), ], - 'itemsize': sizeof(_anon_pod1), + 'itemsize': sizeof(cuda_bindings_nvml__anon_pod1), }) _py_anon_pod1_dtype = _get__py_anon_pod1_dtype_offsets() cdef class _py_anon_pod1: - """Empty-initialize an instance of `_anon_pod1`. + """Empty-initialize an instance of `cuda_bindings_nvml__anon_pod1`. - .. seealso:: `_anon_pod1` + .. seealso:: `cuda_bindings_nvml__anon_pod1` """ cdef: - _anon_pod1 *_ptr + cuda_bindings_nvml__anon_pod1 *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = <_anon_pod1 *>calloc(1, sizeof(_anon_pod1)) + self._ptr = _cyb_calloc(1, sizeof(cuda_bindings_nvml__anon_pod1)) if self._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod1") self._owner = None @@ -6316,11 +6367,11 @@ cdef class _py_anon_pod1: self._readonly = False def __dealloc__(self): - cdef _anon_pod1 *ptr + cdef cuda_bindings_nvml__anon_pod1 *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}._py_anon_pod1 object at {hex(id(self))}>" @@ -6341,20 +6392,20 @@ cdef class _py_anon_pod1: if not isinstance(other, _py_anon_pod1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(_anon_pod1)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(cuda_bindings_nvml__anon_pod1)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(_anon_pod1), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(cuda_bindings_nvml__anon_pod1), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = <_anon_pod1 *>malloc(sizeof(_anon_pod1)) + self._ptr = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod1)) if self._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod1") - memcpy(self._ptr, val.ctypes.data, sizeof(_anon_pod1)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(cuda_bindings_nvml__anon_pod1)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -6408,7 +6459,7 @@ cdef class _py_anon_pod1: @staticmethod def from_buffer(buffer): """Create an _py_anon_pod1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(_anon_pod1), _py_anon_pod1) + return _cyb_from_buffer(buffer, sizeof(cuda_bindings_nvml__anon_pod1), _py_anon_pod1) @staticmethod def from_data(data): @@ -6417,7 +6468,7 @@ cdef class _py_anon_pod1: Args: data (_numpy.ndarray): a single-element array of dtype `_py_anon_pod1_dtype` holding the data. """ - return __from_data(data, "_py_anon_pod1_dtype", _py_anon_pod1_dtype, _py_anon_pod1) + return _cyb_from_data(data, "_py_anon_pod1_dtype", _py_anon_pod1_dtype, _py_anon_pod1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -6432,14 +6483,14 @@ cdef class _py_anon_pod1: raise ValueError("ptr must not be null (0)") cdef _py_anon_pod1 obj = _py_anon_pod1.__new__(_py_anon_pod1) if owner is None: - obj._ptr = <_anon_pod1 *>malloc(sizeof(_anon_pod1)) + obj._ptr = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod1)) if obj._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod1") - memcpy((obj._ptr), ptr, sizeof(_anon_pod1)) + _cyb_memcpy((obj._ptr), ptr, sizeof(cuda_bindings_nvml__anon_pod1)) obj._owner = None obj._owned = True else: - obj._ptr = <_anon_pod1 *>ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly @@ -6447,7 +6498,7 @@ cdef class _py_anon_pod1: cdef _get_vgpu_placement_list_v2_dtype_offsets(): - cdef nvmlVgpuPlacementList_v2_t pod = nvmlVgpuPlacementList_v2_t() + cdef nvmlVgpuPlacementList_v2_t pod return _numpy.dtype({ 'names': ['version', 'placement_size', 'count', 'placement_ids', 'mode'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.uint32], @@ -6477,7 +6528,7 @@ cdef class VgpuPlacementList_v2: dict _refs def __init__(self): - self._ptr = calloc(1, sizeof(nvmlVgpuPlacementList_v2_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuPlacementList_v2_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuPlacementList_v2") self._owner = None @@ -6490,7 +6541,7 @@ cdef class VgpuPlacementList_v2: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.VgpuPlacementList_v2 object at {hex(id(self))}>" @@ -6511,20 +6562,20 @@ cdef class VgpuPlacementList_v2: if not isinstance(other, VgpuPlacementList_v2): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuPlacementList_v2_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuPlacementList_v2_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuPlacementList_v2_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuPlacementList_v2_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlVgpuPlacementList_v2_t)) + self._ptr = _cyb_malloc(sizeof(nvmlVgpuPlacementList_v2_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuPlacementList_v2") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuPlacementList_v2_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuPlacementList_v2_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -6558,7 +6609,7 @@ cdef class VgpuPlacementList_v2: """int: IN/OUT: Placement IDs for the vGPU type.""" if self._ptr[0].placementIds == NULL: return [] - cdef view.array arr = view.array(shape=(self._ptr[0].count,), itemsize=sizeof(unsigned int), format="I", mode="c", allocate_buffer=False) + cdef _cyb_view.array arr = _cyb_view.array(shape=(self._ptr[0].count,), itemsize=sizeof(unsigned int), format="I", mode="c", allocate_buffer=False) arr.data = (self._ptr[0].placementIds) return _numpy.asarray(arr) @@ -6566,7 +6617,7 @@ cdef class VgpuPlacementList_v2: def placement_ids(self, val): if self._readonly: raise ValueError("This VgpuPlacementList_v2 instance is read-only") - cdef view.array arr = view.array(shape=(len(val),), itemsize=sizeof(unsigned int), format="I", mode="c") + cdef _cyb_view.array arr = _cyb_view.array(shape=(len(val),), itemsize=sizeof(unsigned int), format="I", mode="c") arr[:] = _numpy.asarray(val, dtype=_numpy.uint32) self._ptr[0].placementIds = (arr.data) self._ptr[0].count = len(val) @@ -6586,7 +6637,7 @@ cdef class VgpuPlacementList_v2: @staticmethod def from_buffer(buffer): """Create an VgpuPlacementList_v2 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlVgpuPlacementList_v2_t), VgpuPlacementList_v2) + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuPlacementList_v2_t), VgpuPlacementList_v2) @staticmethod def from_data(data): @@ -6595,7 +6646,7 @@ cdef class VgpuPlacementList_v2: Args: data (_numpy.ndarray): a single-element array of dtype `vgpu_placement_list_v2_dtype` holding the data. """ - return __from_data(data, "vgpu_placement_list_v2_dtype", vgpu_placement_list_v2_dtype, VgpuPlacementList_v2) + return _cyb_from_data(data, "vgpu_placement_list_v2_dtype", vgpu_placement_list_v2_dtype, VgpuPlacementList_v2) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -6610,10 +6661,10 @@ cdef class VgpuPlacementList_v2: raise ValueError("ptr must not be null (0)") cdef VgpuPlacementList_v2 obj = VgpuPlacementList_v2.__new__(VgpuPlacementList_v2) if owner is None: - obj._ptr = malloc(sizeof(nvmlVgpuPlacementList_v2_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuPlacementList_v2_t)) if obj._ptr == NULL: raise MemoryError("Error allocating VgpuPlacementList_v2") - memcpy((obj._ptr), ptr, sizeof(nvmlVgpuPlacementList_v2_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuPlacementList_v2_t)) obj._owner = None obj._owned = True else: @@ -6626,7 +6677,7 @@ cdef class VgpuPlacementList_v2: cdef _get_vgpu_type_bar1info_v1_dtype_offsets(): - cdef nvmlVgpuTypeBar1Info_v1_t pod = nvmlVgpuTypeBar1Info_v1_t() + cdef nvmlVgpuTypeBar1Info_v1_t pod return _numpy.dtype({ 'names': ['version', 'bar1size'], 'formats': [_numpy.uint32, _numpy.uint64], @@ -6652,7 +6703,7 @@ cdef class VgpuTypeBar1Info_v1: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlVgpuTypeBar1Info_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuTypeBar1Info_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuTypeBar1Info_v1") self._owner = None @@ -6664,7 +6715,7 @@ cdef class VgpuTypeBar1Info_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.VgpuTypeBar1Info_v1 object at {hex(id(self))}>" @@ -6685,20 +6736,20 @@ cdef class VgpuTypeBar1Info_v1: if not isinstance(other, VgpuTypeBar1Info_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuTypeBar1Info_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuTypeBar1Info_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuTypeBar1Info_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuTypeBar1Info_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlVgpuTypeBar1Info_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlVgpuTypeBar1Info_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuTypeBar1Info_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuTypeBar1Info_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuTypeBar1Info_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -6730,7 +6781,7 @@ cdef class VgpuTypeBar1Info_v1: @staticmethod def from_buffer(buffer): """Create an VgpuTypeBar1Info_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlVgpuTypeBar1Info_v1_t), VgpuTypeBar1Info_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuTypeBar1Info_v1_t), VgpuTypeBar1Info_v1) @staticmethod def from_data(data): @@ -6739,7 +6790,7 @@ cdef class VgpuTypeBar1Info_v1: Args: data (_numpy.ndarray): a single-element array of dtype `vgpu_type_bar1info_v1_dtype` holding the data. """ - return __from_data(data, "vgpu_type_bar1info_v1_dtype", vgpu_type_bar1info_v1_dtype, VgpuTypeBar1Info_v1) + return _cyb_from_data(data, "vgpu_type_bar1info_v1_dtype", vgpu_type_bar1info_v1_dtype, VgpuTypeBar1Info_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -6754,10 +6805,10 @@ cdef class VgpuTypeBar1Info_v1: raise ValueError("ptr must not be null (0)") cdef VgpuTypeBar1Info_v1 obj = VgpuTypeBar1Info_v1.__new__(VgpuTypeBar1Info_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlVgpuTypeBar1Info_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuTypeBar1Info_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating VgpuTypeBar1Info_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlVgpuTypeBar1Info_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuTypeBar1Info_v1_t)) obj._owner = None obj._owned = True else: @@ -6769,7 +6820,7 @@ cdef class VgpuTypeBar1Info_v1: cdef _get_vgpu_process_utilization_info_v1_dtype_offsets(): - cdef nvmlVgpuProcessUtilizationInfo_v1_t pod = nvmlVgpuProcessUtilizationInfo_v1_t() + cdef nvmlVgpuProcessUtilizationInfo_v1_t pod return _numpy.dtype({ 'names': ['process_name', 'time_stamp', 'vgpu_instance', 'pid', 'sm_util', 'mem_util', 'enc_util', 'dec_util', 'jpg_util', 'ofa_util'], 'formats': [(_numpy.int8, 64), _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], @@ -6792,21 +6843,17 @@ vgpu_process_utilization_info_v1_dtype = _get_vgpu_process_utilization_info_v1_d cdef class VgpuProcessUtilizationInfo_v1: """Empty-initialize an array of `nvmlVgpuProcessUtilizationInfo_v1_t`. - The resulting object is of length `size` and of dtype `vgpu_process_utilization_info_v1_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlVgpuProcessUtilizationInfo_v1_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=vgpu_process_utilization_info_v1_dtype) self._data = arr.view(_numpy.recarray) @@ -6843,10 +6890,10 @@ cdef class VgpuProcessUtilizationInfo_v1: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def process_name(self): @@ -7010,8 +7057,8 @@ cdef class VgpuProcessUtilizationInfo_v1: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef VgpuProcessUtilizationInfo_v1 obj = VgpuProcessUtilizationInfo_v1.__new__(VgpuProcessUtilizationInfo_v1) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(nvmlVgpuProcessUtilizationInfo_v1_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=vgpu_process_utilization_info_v1_dtype) obj._data = data.view(_numpy.recarray) @@ -7020,7 +7067,7 @@ cdef class VgpuProcessUtilizationInfo_v1: cdef _get__py_anon_pod2_dtype_offsets(): - cdef _anon_pod2 pod = _anon_pod2() + cdef cuda_bindings_nvml__anon_pod2 pod return _numpy.dtype({ 'names': ['avg_factor', 'timeslice'], 'formats': [_numpy.uint32, _numpy.uint32], @@ -7028,25 +7075,25 @@ cdef _get__py_anon_pod2_dtype_offsets(): (&(pod.avgFactor)) - (&pod), (&(pod.timeslice)) - (&pod), ], - 'itemsize': sizeof(_anon_pod2), + 'itemsize': sizeof(cuda_bindings_nvml__anon_pod2), }) _py_anon_pod2_dtype = _get__py_anon_pod2_dtype_offsets() cdef class _py_anon_pod2: - """Empty-initialize an instance of `_anon_pod2`. + """Empty-initialize an instance of `cuda_bindings_nvml__anon_pod2`. - .. seealso:: `_anon_pod2` + .. seealso:: `cuda_bindings_nvml__anon_pod2` """ cdef: - _anon_pod2 *_ptr + cuda_bindings_nvml__anon_pod2 *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = <_anon_pod2 *>calloc(1, sizeof(_anon_pod2)) + self._ptr = _cyb_calloc(1, sizeof(cuda_bindings_nvml__anon_pod2)) if self._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod2") self._owner = None @@ -7054,11 +7101,11 @@ cdef class _py_anon_pod2: self._readonly = False def __dealloc__(self): - cdef _anon_pod2 *ptr + cdef cuda_bindings_nvml__anon_pod2 *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}._py_anon_pod2 object at {hex(id(self))}>" @@ -7079,20 +7126,20 @@ cdef class _py_anon_pod2: if not isinstance(other, _py_anon_pod2): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(_anon_pod2)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(cuda_bindings_nvml__anon_pod2)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(_anon_pod2), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(cuda_bindings_nvml__anon_pod2), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = <_anon_pod2 *>malloc(sizeof(_anon_pod2)) + self._ptr = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod2)) if self._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod2") - memcpy(self._ptr, val.ctypes.data, sizeof(_anon_pod2)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(cuda_bindings_nvml__anon_pod2)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -7124,7 +7171,7 @@ cdef class _py_anon_pod2: @staticmethod def from_buffer(buffer): """Create an _py_anon_pod2 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(_anon_pod2), _py_anon_pod2) + return _cyb_from_buffer(buffer, sizeof(cuda_bindings_nvml__anon_pod2), _py_anon_pod2) @staticmethod def from_data(data): @@ -7133,7 +7180,7 @@ cdef class _py_anon_pod2: Args: data (_numpy.ndarray): a single-element array of dtype `_py_anon_pod2_dtype` holding the data. """ - return __from_data(data, "_py_anon_pod2_dtype", _py_anon_pod2_dtype, _py_anon_pod2) + return _cyb_from_data(data, "_py_anon_pod2_dtype", _py_anon_pod2_dtype, _py_anon_pod2) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -7148,14 +7195,14 @@ cdef class _py_anon_pod2: raise ValueError("ptr must not be null (0)") cdef _py_anon_pod2 obj = _py_anon_pod2.__new__(_py_anon_pod2) if owner is None: - obj._ptr = <_anon_pod2 *>malloc(sizeof(_anon_pod2)) + obj._ptr = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod2)) if obj._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod2") - memcpy((obj._ptr), ptr, sizeof(_anon_pod2)) + _cyb_memcpy((obj._ptr), ptr, sizeof(cuda_bindings_nvml__anon_pod2)) obj._owner = None obj._owned = True else: - obj._ptr = <_anon_pod2 *>ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly @@ -7163,32 +7210,32 @@ cdef class _py_anon_pod2: cdef _get__py_anon_pod3_dtype_offsets(): - cdef _anon_pod3 pod = _anon_pod3() + cdef cuda_bindings_nvml__anon_pod3 pod return _numpy.dtype({ 'names': ['timeslice'], 'formats': [_numpy.uint32], 'offsets': [ (&(pod.timeslice)) - (&pod), ], - 'itemsize': sizeof(_anon_pod3), + 'itemsize': sizeof(cuda_bindings_nvml__anon_pod3), }) _py_anon_pod3_dtype = _get__py_anon_pod3_dtype_offsets() cdef class _py_anon_pod3: - """Empty-initialize an instance of `_anon_pod3`. + """Empty-initialize an instance of `cuda_bindings_nvml__anon_pod3`. - .. seealso:: `_anon_pod3` + .. seealso:: `cuda_bindings_nvml__anon_pod3` """ cdef: - _anon_pod3 *_ptr + cuda_bindings_nvml__anon_pod3 *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = <_anon_pod3 *>calloc(1, sizeof(_anon_pod3)) + self._ptr = _cyb_calloc(1, sizeof(cuda_bindings_nvml__anon_pod3)) if self._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod3") self._owner = None @@ -7196,11 +7243,11 @@ cdef class _py_anon_pod3: self._readonly = False def __dealloc__(self): - cdef _anon_pod3 *ptr + cdef cuda_bindings_nvml__anon_pod3 *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}._py_anon_pod3 object at {hex(id(self))}>" @@ -7221,20 +7268,20 @@ cdef class _py_anon_pod3: if not isinstance(other, _py_anon_pod3): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(_anon_pod3)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(cuda_bindings_nvml__anon_pod3)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(_anon_pod3), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(cuda_bindings_nvml__anon_pod3), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = <_anon_pod3 *>malloc(sizeof(_anon_pod3)) + self._ptr = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod3)) if self._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod3") - memcpy(self._ptr, val.ctypes.data, sizeof(_anon_pod3)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(cuda_bindings_nvml__anon_pod3)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -7255,7 +7302,7 @@ cdef class _py_anon_pod3: @staticmethod def from_buffer(buffer): """Create an _py_anon_pod3 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(_anon_pod3), _py_anon_pod3) + return _cyb_from_buffer(buffer, sizeof(cuda_bindings_nvml__anon_pod3), _py_anon_pod3) @staticmethod def from_data(data): @@ -7264,7 +7311,7 @@ cdef class _py_anon_pod3: Args: data (_numpy.ndarray): a single-element array of dtype `_py_anon_pod3_dtype` holding the data. """ - return __from_data(data, "_py_anon_pod3_dtype", _py_anon_pod3_dtype, _py_anon_pod3) + return _cyb_from_data(data, "_py_anon_pod3_dtype", _py_anon_pod3_dtype, _py_anon_pod3) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -7279,14 +7326,14 @@ cdef class _py_anon_pod3: raise ValueError("ptr must not be null (0)") cdef _py_anon_pod3 obj = _py_anon_pod3.__new__(_py_anon_pod3) if owner is None: - obj._ptr = <_anon_pod3 *>malloc(sizeof(_anon_pod3)) + obj._ptr = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod3)) if obj._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod3") - memcpy((obj._ptr), ptr, sizeof(_anon_pod3)) + _cyb_memcpy((obj._ptr), ptr, sizeof(cuda_bindings_nvml__anon_pod3)) obj._owner = None obj._owned = True else: - obj._ptr = <_anon_pod3 *>ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly @@ -7294,7 +7341,7 @@ cdef class _py_anon_pod3: cdef _get_vgpu_scheduler_log_entry_dtype_offsets(): - cdef nvmlVgpuSchedulerLogEntry_t pod = nvmlVgpuSchedulerLogEntry_t() + cdef nvmlVgpuSchedulerLogEntry_t pod return _numpy.dtype({ 'names': ['timestamp', 'time_run_total', 'time_run', 'sw_runlist_id', 'target_time_slice', 'cumulative_preemption_time'], 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint64, _numpy.uint64], @@ -7313,21 +7360,17 @@ vgpu_scheduler_log_entry_dtype = _get_vgpu_scheduler_log_entry_dtype_offsets() cdef class VgpuSchedulerLogEntry: """Empty-initialize an array of `nvmlVgpuSchedulerLogEntry_t`. - The resulting object is of length `size` and of dtype `vgpu_scheduler_log_entry_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlVgpuSchedulerLogEntry_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=vgpu_scheduler_log_entry_dtype) self._data = arr.view(_numpy.recarray) @@ -7364,10 +7407,10 @@ cdef class VgpuSchedulerLogEntry: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def timestamp(self): @@ -7489,8 +7532,8 @@ cdef class VgpuSchedulerLogEntry: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef VgpuSchedulerLogEntry obj = VgpuSchedulerLogEntry.__new__(VgpuSchedulerLogEntry) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(nvmlVgpuSchedulerLogEntry_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=vgpu_scheduler_log_entry_dtype) obj._data = data.view(_numpy.recarray) @@ -7499,7 +7542,7 @@ cdef class VgpuSchedulerLogEntry: cdef _get__py_anon_pod4_dtype_offsets(): - cdef _anon_pod4 pod = _anon_pod4() + cdef cuda_bindings_nvml__anon_pod4 pod return _numpy.dtype({ 'names': ['avg_factor', 'frequency'], 'formats': [_numpy.uint32, _numpy.uint32], @@ -7507,25 +7550,25 @@ cdef _get__py_anon_pod4_dtype_offsets(): (&(pod.avgFactor)) - (&pod), (&(pod.frequency)) - (&pod), ], - 'itemsize': sizeof(_anon_pod4), + 'itemsize': sizeof(cuda_bindings_nvml__anon_pod4), }) _py_anon_pod4_dtype = _get__py_anon_pod4_dtype_offsets() cdef class _py_anon_pod4: - """Empty-initialize an instance of `_anon_pod4`. + """Empty-initialize an instance of `cuda_bindings_nvml__anon_pod4`. - .. seealso:: `_anon_pod4` + .. seealso:: `cuda_bindings_nvml__anon_pod4` """ cdef: - _anon_pod4 *_ptr + cuda_bindings_nvml__anon_pod4 *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = <_anon_pod4 *>calloc(1, sizeof(_anon_pod4)) + self._ptr = _cyb_calloc(1, sizeof(cuda_bindings_nvml__anon_pod4)) if self._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod4") self._owner = None @@ -7533,11 +7576,11 @@ cdef class _py_anon_pod4: self._readonly = False def __dealloc__(self): - cdef _anon_pod4 *ptr + cdef cuda_bindings_nvml__anon_pod4 *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}._py_anon_pod4 object at {hex(id(self))}>" @@ -7558,20 +7601,20 @@ cdef class _py_anon_pod4: if not isinstance(other, _py_anon_pod4): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(_anon_pod4)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(cuda_bindings_nvml__anon_pod4)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(_anon_pod4), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(cuda_bindings_nvml__anon_pod4), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = <_anon_pod4 *>malloc(sizeof(_anon_pod4)) + self._ptr = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod4)) if self._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod4") - memcpy(self._ptr, val.ctypes.data, sizeof(_anon_pod4)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(cuda_bindings_nvml__anon_pod4)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -7603,7 +7646,7 @@ cdef class _py_anon_pod4: @staticmethod def from_buffer(buffer): """Create an _py_anon_pod4 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(_anon_pod4), _py_anon_pod4) + return _cyb_from_buffer(buffer, sizeof(cuda_bindings_nvml__anon_pod4), _py_anon_pod4) @staticmethod def from_data(data): @@ -7612,7 +7655,7 @@ cdef class _py_anon_pod4: Args: data (_numpy.ndarray): a single-element array of dtype `_py_anon_pod4_dtype` holding the data. """ - return __from_data(data, "_py_anon_pod4_dtype", _py_anon_pod4_dtype, _py_anon_pod4) + return _cyb_from_data(data, "_py_anon_pod4_dtype", _py_anon_pod4_dtype, _py_anon_pod4) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -7627,14 +7670,14 @@ cdef class _py_anon_pod4: raise ValueError("ptr must not be null (0)") cdef _py_anon_pod4 obj = _py_anon_pod4.__new__(_py_anon_pod4) if owner is None: - obj._ptr = <_anon_pod4 *>malloc(sizeof(_anon_pod4)) + obj._ptr = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod4)) if obj._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod4") - memcpy((obj._ptr), ptr, sizeof(_anon_pod4)) + _cyb_memcpy((obj._ptr), ptr, sizeof(cuda_bindings_nvml__anon_pod4)) obj._owner = None obj._owned = True else: - obj._ptr = <_anon_pod4 *>ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly @@ -7642,32 +7685,32 @@ cdef class _py_anon_pod4: cdef _get__py_anon_pod5_dtype_offsets(): - cdef _anon_pod5 pod = _anon_pod5() + cdef cuda_bindings_nvml__anon_pod5 pod return _numpy.dtype({ 'names': ['timeslice'], 'formats': [_numpy.uint32], 'offsets': [ (&(pod.timeslice)) - (&pod), ], - 'itemsize': sizeof(_anon_pod5), + 'itemsize': sizeof(cuda_bindings_nvml__anon_pod5), }) _py_anon_pod5_dtype = _get__py_anon_pod5_dtype_offsets() cdef class _py_anon_pod5: - """Empty-initialize an instance of `_anon_pod5`. + """Empty-initialize an instance of `cuda_bindings_nvml__anon_pod5`. - .. seealso:: `_anon_pod5` + .. seealso:: `cuda_bindings_nvml__anon_pod5` """ cdef: - _anon_pod5 *_ptr + cuda_bindings_nvml__anon_pod5 *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = <_anon_pod5 *>calloc(1, sizeof(_anon_pod5)) + self._ptr = _cyb_calloc(1, sizeof(cuda_bindings_nvml__anon_pod5)) if self._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod5") self._owner = None @@ -7675,11 +7718,11 @@ cdef class _py_anon_pod5: self._readonly = False def __dealloc__(self): - cdef _anon_pod5 *ptr + cdef cuda_bindings_nvml__anon_pod5 *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}._py_anon_pod5 object at {hex(id(self))}>" @@ -7700,20 +7743,20 @@ cdef class _py_anon_pod5: if not isinstance(other, _py_anon_pod5): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(_anon_pod5)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(cuda_bindings_nvml__anon_pod5)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(_anon_pod5), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(cuda_bindings_nvml__anon_pod5), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = <_anon_pod5 *>malloc(sizeof(_anon_pod5)) + self._ptr = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod5)) if self._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod5") - memcpy(self._ptr, val.ctypes.data, sizeof(_anon_pod5)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(cuda_bindings_nvml__anon_pod5)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -7734,7 +7777,7 @@ cdef class _py_anon_pod5: @staticmethod def from_buffer(buffer): """Create an _py_anon_pod5 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(_anon_pod5), _py_anon_pod5) + return _cyb_from_buffer(buffer, sizeof(cuda_bindings_nvml__anon_pod5), _py_anon_pod5) @staticmethod def from_data(data): @@ -7743,7 +7786,7 @@ cdef class _py_anon_pod5: Args: data (_numpy.ndarray): a single-element array of dtype `_py_anon_pod5_dtype` holding the data. """ - return __from_data(data, "_py_anon_pod5_dtype", _py_anon_pod5_dtype, _py_anon_pod5) + return _cyb_from_data(data, "_py_anon_pod5_dtype", _py_anon_pod5_dtype, _py_anon_pod5) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -7758,14 +7801,14 @@ cdef class _py_anon_pod5: raise ValueError("ptr must not be null (0)") cdef _py_anon_pod5 obj = _py_anon_pod5.__new__(_py_anon_pod5) if owner is None: - obj._ptr = <_anon_pod5 *>malloc(sizeof(_anon_pod5)) + obj._ptr = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod5)) if obj._ptr == NULL: raise MemoryError("Error allocating _py_anon_pod5") - memcpy((obj._ptr), ptr, sizeof(_anon_pod5)) + _cyb_memcpy((obj._ptr), ptr, sizeof(cuda_bindings_nvml__anon_pod5)) obj._owner = None obj._owned = True else: - obj._ptr = <_anon_pod5 *>ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly @@ -7773,7 +7816,7 @@ cdef class _py_anon_pod5: cdef _get_vgpu_scheduler_capabilities_dtype_offsets(): - cdef nvmlVgpuSchedulerCapabilities_t pod = nvmlVgpuSchedulerCapabilities_t() + cdef nvmlVgpuSchedulerCapabilities_t pod return _numpy.dtype({ 'names': ['supported_schedulers', 'max_timeslice', 'min_timeslice', 'is_arr_mode_supported', 'max_frequency_for_arr', 'min_frequency_for_arr', 'max_avg_factor_for_arr', 'min_avg_factor_for_arr'], 'formats': [(_numpy.uint32, 3), _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], @@ -7805,7 +7848,7 @@ cdef class VgpuSchedulerCapabilities: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlVgpuSchedulerCapabilities_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerCapabilities_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuSchedulerCapabilities") self._owner = None @@ -7817,7 +7860,7 @@ cdef class VgpuSchedulerCapabilities: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.VgpuSchedulerCapabilities object at {hex(id(self))}>" @@ -7838,20 +7881,20 @@ cdef class VgpuSchedulerCapabilities: if not isinstance(other, VgpuSchedulerCapabilities): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerCapabilities_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerCapabilities_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerCapabilities_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerCapabilities_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlVgpuSchedulerCapabilities_t)) + self._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerCapabilities_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuSchedulerCapabilities") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerCapabilities_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerCapabilities_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -7861,7 +7904,7 @@ cdef class VgpuSchedulerCapabilities: @property def supported_schedulers(self): """~_numpy.uint32: (array of length 3).""" - cdef view.array arr = view.array(shape=(3,), itemsize=sizeof(unsigned int), format="I", mode="c", allocate_buffer=False) + cdef _cyb_view.array arr = _cyb_view.array(shape=(3,), itemsize=sizeof(unsigned int), format="I", mode="c", allocate_buffer=False) arr.data = (&(self._ptr[0].supportedSchedulers)) return _numpy.asarray(arr) @@ -7871,9 +7914,9 @@ cdef class VgpuSchedulerCapabilities: raise ValueError("This VgpuSchedulerCapabilities instance is read-only") if len(val) != 3: raise ValueError(f"Expected length { 3 } for field supported_schedulers, got {len(val)}") - cdef view.array arr = view.array(shape=(3,), itemsize=sizeof(unsigned int), format="I", mode="c") + cdef _cyb_view.array arr = _cyb_view.array(shape=(3,), itemsize=sizeof(unsigned int), format="I", mode="c") arr[:] = _numpy.asarray(val, dtype=_numpy.uint32) - memcpy((&(self._ptr[0].supportedSchedulers)), (arr.data), sizeof(unsigned int) * len(val)) + _cyb_memcpy((&(self._ptr[0].supportedSchedulers)), (arr.data), sizeof(unsigned int) * len(val)) @property def max_timeslice(self): @@ -7955,7 +7998,7 @@ cdef class VgpuSchedulerCapabilities: @staticmethod def from_buffer(buffer): """Create an VgpuSchedulerCapabilities instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlVgpuSchedulerCapabilities_t), VgpuSchedulerCapabilities) + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerCapabilities_t), VgpuSchedulerCapabilities) @staticmethod def from_data(data): @@ -7964,7 +8007,7 @@ cdef class VgpuSchedulerCapabilities: Args: data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_capabilities_dtype` holding the data. """ - return __from_data(data, "vgpu_scheduler_capabilities_dtype", vgpu_scheduler_capabilities_dtype, VgpuSchedulerCapabilities) + return _cyb_from_data(data, "vgpu_scheduler_capabilities_dtype", vgpu_scheduler_capabilities_dtype, VgpuSchedulerCapabilities) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -7979,10 +8022,10 @@ cdef class VgpuSchedulerCapabilities: raise ValueError("ptr must not be null (0)") cdef VgpuSchedulerCapabilities obj = VgpuSchedulerCapabilities.__new__(VgpuSchedulerCapabilities) if owner is None: - obj._ptr = malloc(sizeof(nvmlVgpuSchedulerCapabilities_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerCapabilities_t)) if obj._ptr == NULL: raise MemoryError("Error allocating VgpuSchedulerCapabilities") - memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerCapabilities_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerCapabilities_t)) obj._owner = None obj._owned = True else: @@ -7994,7 +8037,7 @@ cdef class VgpuSchedulerCapabilities: cdef _get_vgpu_license_expiry_dtype_offsets(): - cdef nvmlVgpuLicenseExpiry_t pod = nvmlVgpuLicenseExpiry_t() + cdef nvmlVgpuLicenseExpiry_t pod return _numpy.dtype({ 'names': ['year', 'month', 'day', 'hour', 'min_', 'sec', 'status'], 'formats': [_numpy.uint32, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint8], @@ -8025,7 +8068,7 @@ cdef class VgpuLicenseExpiry: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlVgpuLicenseExpiry_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuLicenseExpiry_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuLicenseExpiry") self._owner = None @@ -8037,7 +8080,7 @@ cdef class VgpuLicenseExpiry: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.VgpuLicenseExpiry object at {hex(id(self))}>" @@ -8058,20 +8101,20 @@ cdef class VgpuLicenseExpiry: if not isinstance(other, VgpuLicenseExpiry): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuLicenseExpiry_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuLicenseExpiry_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuLicenseExpiry_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuLicenseExpiry_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlVgpuLicenseExpiry_t)) + self._ptr = _cyb_malloc(sizeof(nvmlVgpuLicenseExpiry_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuLicenseExpiry") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuLicenseExpiry_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuLicenseExpiry_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -8158,7 +8201,7 @@ cdef class VgpuLicenseExpiry: @staticmethod def from_buffer(buffer): """Create an VgpuLicenseExpiry instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlVgpuLicenseExpiry_t), VgpuLicenseExpiry) + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuLicenseExpiry_t), VgpuLicenseExpiry) @staticmethod def from_data(data): @@ -8167,7 +8210,7 @@ cdef class VgpuLicenseExpiry: Args: data (_numpy.ndarray): a single-element array of dtype `vgpu_license_expiry_dtype` holding the data. """ - return __from_data(data, "vgpu_license_expiry_dtype", vgpu_license_expiry_dtype, VgpuLicenseExpiry) + return _cyb_from_data(data, "vgpu_license_expiry_dtype", vgpu_license_expiry_dtype, VgpuLicenseExpiry) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -8182,10 +8225,10 @@ cdef class VgpuLicenseExpiry: raise ValueError("ptr must not be null (0)") cdef VgpuLicenseExpiry obj = VgpuLicenseExpiry.__new__(VgpuLicenseExpiry) if owner is None: - obj._ptr = malloc(sizeof(nvmlVgpuLicenseExpiry_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuLicenseExpiry_t)) if obj._ptr == NULL: raise MemoryError("Error allocating VgpuLicenseExpiry") - memcpy((obj._ptr), ptr, sizeof(nvmlVgpuLicenseExpiry_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuLicenseExpiry_t)) obj._owner = None obj._owned = True else: @@ -8197,7 +8240,7 @@ cdef class VgpuLicenseExpiry: cdef _get_grid_license_expiry_dtype_offsets(): - cdef nvmlGridLicenseExpiry_t pod = nvmlGridLicenseExpiry_t() + cdef nvmlGridLicenseExpiry_t pod return _numpy.dtype({ 'names': ['year', 'month', 'day', 'hour', 'min_', 'sec', 'status'], 'formats': [_numpy.uint32, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint16, _numpy.uint8], @@ -8228,7 +8271,7 @@ cdef class GridLicenseExpiry: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlGridLicenseExpiry_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlGridLicenseExpiry_t)) if self._ptr == NULL: raise MemoryError("Error allocating GridLicenseExpiry") self._owner = None @@ -8240,7 +8283,7 @@ cdef class GridLicenseExpiry: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.GridLicenseExpiry object at {hex(id(self))}>" @@ -8261,20 +8304,20 @@ cdef class GridLicenseExpiry: if not isinstance(other, GridLicenseExpiry): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlGridLicenseExpiry_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGridLicenseExpiry_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlGridLicenseExpiry_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlGridLicenseExpiry_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlGridLicenseExpiry_t)) + self._ptr = _cyb_malloc(sizeof(nvmlGridLicenseExpiry_t)) if self._ptr == NULL: raise MemoryError("Error allocating GridLicenseExpiry") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGridLicenseExpiry_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGridLicenseExpiry_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -8361,7 +8404,7 @@ cdef class GridLicenseExpiry: @staticmethod def from_buffer(buffer): """Create an GridLicenseExpiry instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlGridLicenseExpiry_t), GridLicenseExpiry) + return _cyb_from_buffer(buffer, sizeof(nvmlGridLicenseExpiry_t), GridLicenseExpiry) @staticmethod def from_data(data): @@ -8370,7 +8413,7 @@ cdef class GridLicenseExpiry: Args: data (_numpy.ndarray): a single-element array of dtype `grid_license_expiry_dtype` holding the data. """ - return __from_data(data, "grid_license_expiry_dtype", grid_license_expiry_dtype, GridLicenseExpiry) + return _cyb_from_data(data, "grid_license_expiry_dtype", grid_license_expiry_dtype, GridLicenseExpiry) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -8385,10 +8428,10 @@ cdef class GridLicenseExpiry: raise ValueError("ptr must not be null (0)") cdef GridLicenseExpiry obj = GridLicenseExpiry.__new__(GridLicenseExpiry) if owner is None: - obj._ptr = malloc(sizeof(nvmlGridLicenseExpiry_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlGridLicenseExpiry_t)) if obj._ptr == NULL: raise MemoryError("Error allocating GridLicenseExpiry") - memcpy((obj._ptr), ptr, sizeof(nvmlGridLicenseExpiry_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGridLicenseExpiry_t)) obj._owner = None obj._owned = True else: @@ -8400,7 +8443,7 @@ cdef class GridLicenseExpiry: cdef _get_vgpu_type_id_info_v1_dtype_offsets(): - cdef nvmlVgpuTypeIdInfo_v1_t pod = nvmlVgpuTypeIdInfo_v1_t() + cdef nvmlVgpuTypeIdInfo_v1_t pod return _numpy.dtype({ 'names': ['version', 'vgpu_count', 'vgpu_type_ids'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.intp], @@ -8425,21 +8468,23 @@ cdef class VgpuTypeIdInfo_v1: object _owner bint _owned bint _readonly + dict _refs def __init__(self): - self._ptr = calloc(1, sizeof(nvmlVgpuTypeIdInfo_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuTypeIdInfo_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuTypeIdInfo_v1") self._owner = None self._owned = True self._readonly = False + self._refs = {} def __dealloc__(self): cdef nvmlVgpuTypeIdInfo_v1_t *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.VgpuTypeIdInfo_v1 object at {hex(id(self))}>" @@ -8460,20 +8505,20 @@ cdef class VgpuTypeIdInfo_v1: if not isinstance(other, VgpuTypeIdInfo_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuTypeIdInfo_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuTypeIdInfo_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuTypeIdInfo_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuTypeIdInfo_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlVgpuTypeIdInfo_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlVgpuTypeIdInfo_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuTypeIdInfo_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuTypeIdInfo_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuTypeIdInfo_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -8496,7 +8541,7 @@ cdef class VgpuTypeIdInfo_v1: """int: OUT: List of vGPU type IDs.""" if self._ptr[0].vgpuTypeIds == NULL: return [] - cdef view.array arr = view.array(shape=(self._ptr[0].vgpuCount,), itemsize=sizeof(unsigned int), format="I", mode="c", allocate_buffer=False) + cdef _cyb_view.array arr = _cyb_view.array(shape=(self._ptr[0].vgpuCount,), itemsize=sizeof(unsigned int), format="I", mode="c", allocate_buffer=False) arr.data = (self._ptr[0].vgpuTypeIds) return _numpy.asarray(arr) @@ -8504,7 +8549,7 @@ cdef class VgpuTypeIdInfo_v1: def vgpu_type_ids(self, val): if self._readonly: raise ValueError("This VgpuTypeIdInfo_v1 instance is read-only") - cdef view.array arr = view.array(shape=(len(val),), itemsize=sizeof(unsigned int), format="I", mode="c") + cdef _cyb_view.array arr = _cyb_view.array(shape=(len(val),), itemsize=sizeof(unsigned int), format="I", mode="c") arr[:] = _numpy.asarray(val, dtype=_numpy.uint32) self._ptr[0].vgpuTypeIds = (arr.data) self._ptr[0].vgpuCount = len(val) @@ -8513,7 +8558,7 @@ cdef class VgpuTypeIdInfo_v1: @staticmethod def from_buffer(buffer): """Create an VgpuTypeIdInfo_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlVgpuTypeIdInfo_v1_t), VgpuTypeIdInfo_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuTypeIdInfo_v1_t), VgpuTypeIdInfo_v1) @staticmethod def from_data(data): @@ -8522,7 +8567,7 @@ cdef class VgpuTypeIdInfo_v1: Args: data (_numpy.ndarray): a single-element array of dtype `vgpu_type_id_info_v1_dtype` holding the data. """ - return __from_data(data, "vgpu_type_id_info_v1_dtype", vgpu_type_id_info_v1_dtype, VgpuTypeIdInfo_v1) + return _cyb_from_data(data, "vgpu_type_id_info_v1_dtype", vgpu_type_id_info_v1_dtype, VgpuTypeIdInfo_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -8537,10 +8582,10 @@ cdef class VgpuTypeIdInfo_v1: raise ValueError("ptr must not be null (0)") cdef VgpuTypeIdInfo_v1 obj = VgpuTypeIdInfo_v1.__new__(VgpuTypeIdInfo_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlVgpuTypeIdInfo_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuTypeIdInfo_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating VgpuTypeIdInfo_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlVgpuTypeIdInfo_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuTypeIdInfo_v1_t)) obj._owner = None obj._owned = True else: @@ -8548,11 +8593,12 @@ cdef class VgpuTypeIdInfo_v1: obj._owner = owner obj._owned = False obj._readonly = readonly + obj._refs = {} return obj cdef _get_active_vgpu_instance_info_v1_dtype_offsets(): - cdef nvmlActiveVgpuInstanceInfo_v1_t pod = nvmlActiveVgpuInstanceInfo_v1_t() + cdef nvmlActiveVgpuInstanceInfo_v1_t pod return _numpy.dtype({ 'names': ['version', 'vgpu_count', 'vgpu_instances'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.intp], @@ -8577,21 +8623,23 @@ cdef class ActiveVgpuInstanceInfo_v1: object _owner bint _owned bint _readonly + dict _refs def __init__(self): - self._ptr = calloc(1, sizeof(nvmlActiveVgpuInstanceInfo_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlActiveVgpuInstanceInfo_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating ActiveVgpuInstanceInfo_v1") self._owner = None self._owned = True self._readonly = False + self._refs = {} def __dealloc__(self): cdef nvmlActiveVgpuInstanceInfo_v1_t *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.ActiveVgpuInstanceInfo_v1 object at {hex(id(self))}>" @@ -8612,20 +8660,20 @@ cdef class ActiveVgpuInstanceInfo_v1: if not isinstance(other, ActiveVgpuInstanceInfo_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlActiveVgpuInstanceInfo_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlActiveVgpuInstanceInfo_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlActiveVgpuInstanceInfo_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlActiveVgpuInstanceInfo_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlActiveVgpuInstanceInfo_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlActiveVgpuInstanceInfo_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating ActiveVgpuInstanceInfo_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlActiveVgpuInstanceInfo_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlActiveVgpuInstanceInfo_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -8648,7 +8696,7 @@ cdef class ActiveVgpuInstanceInfo_v1: """int: IN/OUT: list of active vGPU instances.""" if self._ptr[0].vgpuInstances == NULL: return [] - cdef view.array arr = view.array(shape=(self._ptr[0].vgpuCount,), itemsize=sizeof(unsigned int), format="I", mode="c", allocate_buffer=False) + cdef _cyb_view.array arr = _cyb_view.array(shape=(self._ptr[0].vgpuCount,), itemsize=sizeof(unsigned int), format="I", mode="c", allocate_buffer=False) arr.data = (self._ptr[0].vgpuInstances) return _numpy.asarray(arr) @@ -8656,7 +8704,7 @@ cdef class ActiveVgpuInstanceInfo_v1: def vgpu_instances(self, val): if self._readonly: raise ValueError("This ActiveVgpuInstanceInfo_v1 instance is read-only") - cdef view.array arr = view.array(shape=(len(val),), itemsize=sizeof(unsigned int), format="I", mode="c") + cdef _cyb_view.array arr = _cyb_view.array(shape=(len(val),), itemsize=sizeof(unsigned int), format="I", mode="c") arr[:] = _numpy.asarray(val, dtype=_numpy.uint32) self._ptr[0].vgpuInstances = (arr.data) self._ptr[0].vgpuCount = len(val) @@ -8665,7 +8713,7 @@ cdef class ActiveVgpuInstanceInfo_v1: @staticmethod def from_buffer(buffer): """Create an ActiveVgpuInstanceInfo_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlActiveVgpuInstanceInfo_v1_t), ActiveVgpuInstanceInfo_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlActiveVgpuInstanceInfo_v1_t), ActiveVgpuInstanceInfo_v1) @staticmethod def from_data(data): @@ -8674,7 +8722,7 @@ cdef class ActiveVgpuInstanceInfo_v1: Args: data (_numpy.ndarray): a single-element array of dtype `active_vgpu_instance_info_v1_dtype` holding the data. """ - return __from_data(data, "active_vgpu_instance_info_v1_dtype", active_vgpu_instance_info_v1_dtype, ActiveVgpuInstanceInfo_v1) + return _cyb_from_data(data, "active_vgpu_instance_info_v1_dtype", active_vgpu_instance_info_v1_dtype, ActiveVgpuInstanceInfo_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -8689,10 +8737,10 @@ cdef class ActiveVgpuInstanceInfo_v1: raise ValueError("ptr must not be null (0)") cdef ActiveVgpuInstanceInfo_v1 obj = ActiveVgpuInstanceInfo_v1.__new__(ActiveVgpuInstanceInfo_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlActiveVgpuInstanceInfo_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlActiveVgpuInstanceInfo_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating ActiveVgpuInstanceInfo_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlActiveVgpuInstanceInfo_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlActiveVgpuInstanceInfo_v1_t)) obj._owner = None obj._owned = True else: @@ -8700,11 +8748,12 @@ cdef class ActiveVgpuInstanceInfo_v1: obj._owner = owner obj._owned = False obj._readonly = readonly + obj._refs = {} return obj cdef _get_vgpu_creatable_placement_info_v1_dtype_offsets(): - cdef nvmlVgpuCreatablePlacementInfo_v1_t pod = nvmlVgpuCreatablePlacementInfo_v1_t() + cdef nvmlVgpuCreatablePlacementInfo_v1_t pod return _numpy.dtype({ 'names': ['version', 'vgpu_type_id', 'count', 'placement_ids', 'placement_size'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.uint32], @@ -8734,7 +8783,7 @@ cdef class VgpuCreatablePlacementInfo_v1: dict _refs def __init__(self): - self._ptr = calloc(1, sizeof(nvmlVgpuCreatablePlacementInfo_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuCreatablePlacementInfo_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuCreatablePlacementInfo_v1") self._owner = None @@ -8747,7 +8796,7 @@ cdef class VgpuCreatablePlacementInfo_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.VgpuCreatablePlacementInfo_v1 object at {hex(id(self))}>" @@ -8768,20 +8817,20 @@ cdef class VgpuCreatablePlacementInfo_v1: if not isinstance(other, VgpuCreatablePlacementInfo_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuCreatablePlacementInfo_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuCreatablePlacementInfo_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuCreatablePlacementInfo_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuCreatablePlacementInfo_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlVgpuCreatablePlacementInfo_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlVgpuCreatablePlacementInfo_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuCreatablePlacementInfo_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuCreatablePlacementInfo_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuCreatablePlacementInfo_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -8826,7 +8875,7 @@ cdef class VgpuCreatablePlacementInfo_v1: """int: IN/OUT: Placement IDs for the vGPU type.""" if self._ptr[0].placementIds == NULL: return [] - cdef view.array arr = view.array(shape=(self._ptr[0].placementSize,), itemsize=sizeof(unsigned int), format="I", mode="c", allocate_buffer=False) + cdef _cyb_view.array arr = _cyb_view.array(shape=(self._ptr[0].placementSize,), itemsize=sizeof(unsigned int), format="I", mode="c", allocate_buffer=False) arr.data = (self._ptr[0].placementIds) return _numpy.asarray(arr) @@ -8834,7 +8883,7 @@ cdef class VgpuCreatablePlacementInfo_v1: def placement_ids(self, val): if self._readonly: raise ValueError("This VgpuCreatablePlacementInfo_v1 instance is read-only") - cdef view.array arr = view.array(shape=(len(val),), itemsize=sizeof(unsigned int), format="I", mode="c") + cdef _cyb_view.array arr = _cyb_view.array(shape=(len(val),), itemsize=sizeof(unsigned int), format="I", mode="c") arr[:] = _numpy.asarray(val, dtype=_numpy.uint32) self._ptr[0].placementIds = (arr.data) self._ptr[0].placementSize = len(val) @@ -8843,7 +8892,7 @@ cdef class VgpuCreatablePlacementInfo_v1: @staticmethod def from_buffer(buffer): """Create an VgpuCreatablePlacementInfo_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlVgpuCreatablePlacementInfo_v1_t), VgpuCreatablePlacementInfo_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuCreatablePlacementInfo_v1_t), VgpuCreatablePlacementInfo_v1) @staticmethod def from_data(data): @@ -8852,7 +8901,7 @@ cdef class VgpuCreatablePlacementInfo_v1: Args: data (_numpy.ndarray): a single-element array of dtype `vgpu_creatable_placement_info_v1_dtype` holding the data. """ - return __from_data(data, "vgpu_creatable_placement_info_v1_dtype", vgpu_creatable_placement_info_v1_dtype, VgpuCreatablePlacementInfo_v1) + return _cyb_from_data(data, "vgpu_creatable_placement_info_v1_dtype", vgpu_creatable_placement_info_v1_dtype, VgpuCreatablePlacementInfo_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -8867,10 +8916,10 @@ cdef class VgpuCreatablePlacementInfo_v1: raise ValueError("ptr must not be null (0)") cdef VgpuCreatablePlacementInfo_v1 obj = VgpuCreatablePlacementInfo_v1.__new__(VgpuCreatablePlacementInfo_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlVgpuCreatablePlacementInfo_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuCreatablePlacementInfo_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating VgpuCreatablePlacementInfo_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlVgpuCreatablePlacementInfo_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuCreatablePlacementInfo_v1_t)) obj._owner = None obj._owned = True else: @@ -8883,7 +8932,7 @@ cdef class VgpuCreatablePlacementInfo_v1: cdef _get_hwbc_entry_dtype_offsets(): - cdef nvmlHwbcEntry_t pod = nvmlHwbcEntry_t() + cdef nvmlHwbcEntry_t pod return _numpy.dtype({ 'names': ['hwbc_id', 'firmware_version'], 'formats': [_numpy.uint32, (_numpy.int8, 32)], @@ -8898,21 +8947,17 @@ hwbc_entry_dtype = _get_hwbc_entry_dtype_offsets() cdef class HwbcEntry: """Empty-initialize an array of `nvmlHwbcEntry_t`. - The resulting object is of length `size` and of dtype `hwbc_entry_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlHwbcEntry_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=hwbc_entry_dtype) self._data = arr.view(_numpy.recarray) @@ -8949,10 +8994,10 @@ cdef class HwbcEntry: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def hwbc_id(self): @@ -9028,8 +9073,8 @@ cdef class HwbcEntry: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef HwbcEntry obj = HwbcEntry.__new__(HwbcEntry) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(nvmlHwbcEntry_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=hwbc_entry_dtype) obj._data = data.view(_numpy.recarray) @@ -9038,7 +9083,7 @@ cdef class HwbcEntry: cdef _get_led_state_dtype_offsets(): - cdef nvmlLedState_t pod = nvmlLedState_t() + cdef nvmlLedState_t pod return _numpy.dtype({ 'names': ['cause', 'color'], 'formats': [(_numpy.int8, 256), _numpy.int32], @@ -9064,7 +9109,7 @@ cdef class LedState: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlLedState_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlLedState_t)) if self._ptr == NULL: raise MemoryError("Error allocating LedState") self._owner = None @@ -9076,7 +9121,7 @@ cdef class LedState: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.LedState object at {hex(id(self))}>" @@ -9097,20 +9142,20 @@ cdef class LedState: if not isinstance(other, LedState): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlLedState_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlLedState_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlLedState_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlLedState_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlLedState_t)) + self._ptr = _cyb_malloc(sizeof(nvmlLedState_t)) if self._ptr == NULL: raise MemoryError("Error allocating LedState") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlLedState_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlLedState_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -9120,7 +9165,7 @@ cdef class LedState: @property def cause(self): """~_numpy.int8: (array of length 256).""" - return cpython.PyUnicode_FromString(self._ptr[0].cause) + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].cause) @cause.setter def cause(self, val): @@ -9130,7 +9175,7 @@ cdef class LedState: if len(buf) >= 256: raise ValueError("String too long for field cause, max length is 255") cdef char *ptr = buf - memcpy((self._ptr[0].cause), ptr, 256) + _cyb_memcpy((self._ptr[0].cause), ptr, 256) @property def color(self): @@ -9146,7 +9191,7 @@ cdef class LedState: @staticmethod def from_buffer(buffer): """Create an LedState instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlLedState_t), LedState) + return _cyb_from_buffer(buffer, sizeof(nvmlLedState_t), LedState) @staticmethod def from_data(data): @@ -9155,7 +9200,7 @@ cdef class LedState: Args: data (_numpy.ndarray): a single-element array of dtype `led_state_dtype` holding the data. """ - return __from_data(data, "led_state_dtype", led_state_dtype, LedState) + return _cyb_from_data(data, "led_state_dtype", led_state_dtype, LedState) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -9170,10 +9215,10 @@ cdef class LedState: raise ValueError("ptr must not be null (0)") cdef LedState obj = LedState.__new__(LedState) if owner is None: - obj._ptr = malloc(sizeof(nvmlLedState_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlLedState_t)) if obj._ptr == NULL: raise MemoryError("Error allocating LedState") - memcpy((obj._ptr), ptr, sizeof(nvmlLedState_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlLedState_t)) obj._owner = None obj._owned = True else: @@ -9185,7 +9230,7 @@ cdef class LedState: cdef _get_unit_info_dtype_offsets(): - cdef nvmlUnitInfo_t pod = nvmlUnitInfo_t() + cdef nvmlUnitInfo_t pod return _numpy.dtype({ 'names': ['name', 'id', 'serial', 'firmware_version'], 'formats': [(_numpy.int8, 96), (_numpy.int8, 96), (_numpy.int8, 96), (_numpy.int8, 96)], @@ -9213,7 +9258,7 @@ cdef class UnitInfo: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlUnitInfo_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlUnitInfo_t)) if self._ptr == NULL: raise MemoryError("Error allocating UnitInfo") self._owner = None @@ -9225,7 +9270,7 @@ cdef class UnitInfo: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.UnitInfo object at {hex(id(self))}>" @@ -9246,20 +9291,20 @@ cdef class UnitInfo: if not isinstance(other, UnitInfo): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlUnitInfo_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlUnitInfo_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlUnitInfo_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlUnitInfo_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlUnitInfo_t)) + self._ptr = _cyb_malloc(sizeof(nvmlUnitInfo_t)) if self._ptr == NULL: raise MemoryError("Error allocating UnitInfo") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlUnitInfo_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlUnitInfo_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -9269,7 +9314,7 @@ cdef class UnitInfo: @property def name(self): """~_numpy.int8: (array of length 96).""" - return cpython.PyUnicode_FromString(self._ptr[0].name) + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].name) @name.setter def name(self, val): @@ -9279,12 +9324,12 @@ cdef class UnitInfo: if len(buf) >= 96: raise ValueError("String too long for field name, max length is 95") cdef char *ptr = buf - memcpy((self._ptr[0].name), ptr, 96) + _cyb_memcpy((self._ptr[0].name), ptr, 96) @property def id(self): """~_numpy.int8: (array of length 96).""" - return cpython.PyUnicode_FromString(self._ptr[0].id) + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].id) @id.setter def id(self, val): @@ -9294,12 +9339,12 @@ cdef class UnitInfo: if len(buf) >= 96: raise ValueError("String too long for field id, max length is 95") cdef char *ptr = buf - memcpy((self._ptr[0].id), ptr, 96) + _cyb_memcpy((self._ptr[0].id), ptr, 96) @property def serial(self): """~_numpy.int8: (array of length 96).""" - return cpython.PyUnicode_FromString(self._ptr[0].serial) + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].serial) @serial.setter def serial(self, val): @@ -9309,12 +9354,12 @@ cdef class UnitInfo: if len(buf) >= 96: raise ValueError("String too long for field serial, max length is 95") cdef char *ptr = buf - memcpy((self._ptr[0].serial), ptr, 96) + _cyb_memcpy((self._ptr[0].serial), ptr, 96) @property def firmware_version(self): """~_numpy.int8: (array of length 96).""" - return cpython.PyUnicode_FromString(self._ptr[0].firmwareVersion) + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].firmwareVersion) @firmware_version.setter def firmware_version(self, val): @@ -9324,12 +9369,12 @@ cdef class UnitInfo: if len(buf) >= 96: raise ValueError("String too long for field firmware_version, max length is 95") cdef char *ptr = buf - memcpy((self._ptr[0].firmwareVersion), ptr, 96) + _cyb_memcpy((self._ptr[0].firmwareVersion), ptr, 96) @staticmethod def from_buffer(buffer): """Create an UnitInfo instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlUnitInfo_t), UnitInfo) + return _cyb_from_buffer(buffer, sizeof(nvmlUnitInfo_t), UnitInfo) @staticmethod def from_data(data): @@ -9338,7 +9383,7 @@ cdef class UnitInfo: Args: data (_numpy.ndarray): a single-element array of dtype `unit_info_dtype` holding the data. """ - return __from_data(data, "unit_info_dtype", unit_info_dtype, UnitInfo) + return _cyb_from_data(data, "unit_info_dtype", unit_info_dtype, UnitInfo) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -9353,10 +9398,10 @@ cdef class UnitInfo: raise ValueError("ptr must not be null (0)") cdef UnitInfo obj = UnitInfo.__new__(UnitInfo) if owner is None: - obj._ptr = malloc(sizeof(nvmlUnitInfo_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlUnitInfo_t)) if obj._ptr == NULL: raise MemoryError("Error allocating UnitInfo") - memcpy((obj._ptr), ptr, sizeof(nvmlUnitInfo_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlUnitInfo_t)) obj._owner = None obj._owned = True else: @@ -9368,7 +9413,7 @@ cdef class UnitInfo: cdef _get_psu_info_dtype_offsets(): - cdef nvmlPSUInfo_t pod = nvmlPSUInfo_t() + cdef nvmlPSUInfo_t pod return _numpy.dtype({ 'names': ['state', 'current', 'voltage', 'power'], 'formats': [(_numpy.int8, 256), _numpy.uint32, _numpy.uint32, _numpy.uint32], @@ -9396,7 +9441,7 @@ cdef class PSUInfo: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlPSUInfo_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlPSUInfo_t)) if self._ptr == NULL: raise MemoryError("Error allocating PSUInfo") self._owner = None @@ -9408,7 +9453,7 @@ cdef class PSUInfo: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.PSUInfo object at {hex(id(self))}>" @@ -9429,20 +9474,20 @@ cdef class PSUInfo: if not isinstance(other, PSUInfo): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlPSUInfo_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlPSUInfo_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlPSUInfo_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlPSUInfo_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlPSUInfo_t)) + self._ptr = _cyb_malloc(sizeof(nvmlPSUInfo_t)) if self._ptr == NULL: raise MemoryError("Error allocating PSUInfo") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlPSUInfo_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlPSUInfo_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -9452,7 +9497,7 @@ cdef class PSUInfo: @property def state(self): """~_numpy.int8: (array of length 256).""" - return cpython.PyUnicode_FromString(self._ptr[0].state) + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].state) @state.setter def state(self, val): @@ -9462,7 +9507,7 @@ cdef class PSUInfo: if len(buf) >= 256: raise ValueError("String too long for field state, max length is 255") cdef char *ptr = buf - memcpy((self._ptr[0].state), ptr, 256) + _cyb_memcpy((self._ptr[0].state), ptr, 256) @property def current(self): @@ -9500,7 +9545,7 @@ cdef class PSUInfo: @staticmethod def from_buffer(buffer): """Create an PSUInfo instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlPSUInfo_t), PSUInfo) + return _cyb_from_buffer(buffer, sizeof(nvmlPSUInfo_t), PSUInfo) @staticmethod def from_data(data): @@ -9509,7 +9554,7 @@ cdef class PSUInfo: Args: data (_numpy.ndarray): a single-element array of dtype `psu_info_dtype` holding the data. """ - return __from_data(data, "psu_info_dtype", psu_info_dtype, PSUInfo) + return _cyb_from_data(data, "psu_info_dtype", psu_info_dtype, PSUInfo) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -9524,10 +9569,10 @@ cdef class PSUInfo: raise ValueError("ptr must not be null (0)") cdef PSUInfo obj = PSUInfo.__new__(PSUInfo) if owner is None: - obj._ptr = malloc(sizeof(nvmlPSUInfo_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlPSUInfo_t)) if obj._ptr == NULL: raise MemoryError("Error allocating PSUInfo") - memcpy((obj._ptr), ptr, sizeof(nvmlPSUInfo_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlPSUInfo_t)) obj._owner = None obj._owned = True else: @@ -9539,7 +9584,7 @@ cdef class PSUInfo: cdef _get_unit_fan_info_dtype_offsets(): - cdef nvmlUnitFanInfo_t pod = nvmlUnitFanInfo_t() + cdef nvmlUnitFanInfo_t pod return _numpy.dtype({ 'names': ['speed', 'state'], 'formats': [_numpy.uint32, _numpy.int32], @@ -9554,21 +9599,17 @@ unit_fan_info_dtype = _get_unit_fan_info_dtype_offsets() cdef class UnitFanInfo: """Empty-initialize an array of `nvmlUnitFanInfo_t`. - The resulting object is of length `size` and of dtype `unit_fan_info_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlUnitFanInfo_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=unit_fan_info_dtype) self._data = arr.view(_numpy.recarray) @@ -9605,10 +9646,10 @@ cdef class UnitFanInfo: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def speed(self): @@ -9686,8 +9727,8 @@ cdef class UnitFanInfo: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef UnitFanInfo obj = UnitFanInfo.__new__(UnitFanInfo) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(nvmlUnitFanInfo_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=unit_fan_info_dtype) obj._data = data.view(_numpy.recarray) @@ -9696,7 +9737,7 @@ cdef class UnitFanInfo: cdef _get_event_data_dtype_offsets(): - cdef nvmlEventData_t pod = nvmlEventData_t() + cdef nvmlEventData_t pod return _numpy.dtype({ 'names': ['device_', 'event_type', 'event_data', 'gpu_instance_id', 'compute_instance_id'], 'formats': [_numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint32], @@ -9725,7 +9766,7 @@ cdef class EventData: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlEventData_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlEventData_t)) if self._ptr == NULL: raise MemoryError("Error allocating EventData") self._owner = None @@ -9737,7 +9778,7 @@ cdef class EventData: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.EventData object at {hex(id(self))}>" @@ -9758,20 +9799,20 @@ cdef class EventData: if not isinstance(other, EventData): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlEventData_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlEventData_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlEventData_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlEventData_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlEventData_t)) + self._ptr = _cyb_malloc(sizeof(nvmlEventData_t)) if self._ptr == NULL: raise MemoryError("Error allocating EventData") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlEventData_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlEventData_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -9836,7 +9877,7 @@ cdef class EventData: @staticmethod def from_buffer(buffer): """Create an EventData instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlEventData_t), EventData) + return _cyb_from_buffer(buffer, sizeof(nvmlEventData_t), EventData) @staticmethod def from_data(data): @@ -9845,7 +9886,7 @@ cdef class EventData: Args: data (_numpy.ndarray): a single-element array of dtype `event_data_dtype` holding the data. """ - return __from_data(data, "event_data_dtype", event_data_dtype, EventData) + return _cyb_from_data(data, "event_data_dtype", event_data_dtype, EventData) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -9860,10 +9901,10 @@ cdef class EventData: raise ValueError("ptr must not be null (0)") cdef EventData obj = EventData.__new__(EventData) if owner is None: - obj._ptr = malloc(sizeof(nvmlEventData_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlEventData_t)) if obj._ptr == NULL: raise MemoryError("Error allocating EventData") - memcpy((obj._ptr), ptr, sizeof(nvmlEventData_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlEventData_t)) obj._owner = None obj._owned = True else: @@ -9875,7 +9916,7 @@ cdef class EventData: cdef _get_system_event_data_v1_dtype_offsets(): - cdef nvmlSystemEventData_v1_t pod = nvmlSystemEventData_v1_t() + cdef nvmlSystemEventData_v1_t pod return _numpy.dtype({ 'names': ['event_type', 'gpu_id'], 'formats': [_numpy.uint64, _numpy.uint32], @@ -9890,21 +9931,17 @@ system_event_data_v1_dtype = _get_system_event_data_v1_dtype_offsets() cdef class SystemEventData_v1: """Empty-initialize an array of `nvmlSystemEventData_v1_t`. - The resulting object is of length `size` and of dtype `system_event_data_v1_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlSystemEventData_v1_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=system_event_data_v1_dtype) self._data = arr.view(_numpy.recarray) @@ -9941,10 +9978,10 @@ cdef class SystemEventData_v1: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def event_type(self): @@ -10022,8 +10059,8 @@ cdef class SystemEventData_v1: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef SystemEventData_v1 obj = SystemEventData_v1.__new__(SystemEventData_v1) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(nvmlSystemEventData_v1_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=system_event_data_v1_dtype) obj._data = data.view(_numpy.recarray) @@ -10032,7 +10069,7 @@ cdef class SystemEventData_v1: cdef _get_accounting_stats_dtype_offsets(): - cdef nvmlAccountingStats_t pod = nvmlAccountingStats_t() + cdef nvmlAccountingStats_t pod return _numpy.dtype({ 'names': ['gpu_utilization', 'memory_utilization', 'max_memory_usage', 'time', 'start_time', 'is_running', 'reserved'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32, (_numpy.uint32, 5)], @@ -10063,7 +10100,7 @@ cdef class AccountingStats: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlAccountingStats_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlAccountingStats_t)) if self._ptr == NULL: raise MemoryError("Error allocating AccountingStats") self._owner = None @@ -10075,7 +10112,7 @@ cdef class AccountingStats: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.AccountingStats object at {hex(id(self))}>" @@ -10096,20 +10133,20 @@ cdef class AccountingStats: if not isinstance(other, AccountingStats): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlAccountingStats_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlAccountingStats_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlAccountingStats_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlAccountingStats_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlAccountingStats_t)) + self._ptr = _cyb_malloc(sizeof(nvmlAccountingStats_t)) if self._ptr == NULL: raise MemoryError("Error allocating AccountingStats") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlAccountingStats_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlAccountingStats_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -10185,7 +10222,7 @@ cdef class AccountingStats: @staticmethod def from_buffer(buffer): """Create an AccountingStats instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlAccountingStats_t), AccountingStats) + return _cyb_from_buffer(buffer, sizeof(nvmlAccountingStats_t), AccountingStats) @staticmethod def from_data(data): @@ -10194,7 +10231,7 @@ cdef class AccountingStats: Args: data (_numpy.ndarray): a single-element array of dtype `accounting_stats_dtype` holding the data. """ - return __from_data(data, "accounting_stats_dtype", accounting_stats_dtype, AccountingStats) + return _cyb_from_data(data, "accounting_stats_dtype", accounting_stats_dtype, AccountingStats) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -10209,10 +10246,10 @@ cdef class AccountingStats: raise ValueError("ptr must not be null (0)") cdef AccountingStats obj = AccountingStats.__new__(AccountingStats) if owner is None: - obj._ptr = malloc(sizeof(nvmlAccountingStats_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlAccountingStats_t)) if obj._ptr == NULL: raise MemoryError("Error allocating AccountingStats") - memcpy((obj._ptr), ptr, sizeof(nvmlAccountingStats_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlAccountingStats_t)) obj._owner = None obj._owned = True else: @@ -10224,7 +10261,7 @@ cdef class AccountingStats: cdef _get_encoder_session_info_dtype_offsets(): - cdef nvmlEncoderSessionInfo_t pod = nvmlEncoderSessionInfo_t() + cdef nvmlEncoderSessionInfo_t pod return _numpy.dtype({ 'names': ['session_id', 'pid', 'vgpu_instance', 'codec_type', 'h_resolution', 'v_resolution', 'average_fps', 'average_latency'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.int32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], @@ -10245,21 +10282,17 @@ encoder_session_info_dtype = _get_encoder_session_info_dtype_offsets() cdef class EncoderSessionInfo: """Empty-initialize an array of `nvmlEncoderSessionInfo_t`. - The resulting object is of length `size` and of dtype `encoder_session_info_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlEncoderSessionInfo_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=encoder_session_info_dtype) self._data = arr.view(_numpy.recarray) @@ -10296,10 +10329,10 @@ cdef class EncoderSessionInfo: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def session_id(self): @@ -10443,8 +10476,8 @@ cdef class EncoderSessionInfo: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef EncoderSessionInfo obj = EncoderSessionInfo.__new__(EncoderSessionInfo) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(nvmlEncoderSessionInfo_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=encoder_session_info_dtype) obj._data = data.view(_numpy.recarray) @@ -10453,7 +10486,7 @@ cdef class EncoderSessionInfo: cdef _get_fbc_stats_dtype_offsets(): - cdef nvmlFBCStats_t pod = nvmlFBCStats_t() + cdef nvmlFBCStats_t pod return _numpy.dtype({ 'names': ['sessions_count', 'average_fps', 'average_latency'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], @@ -10480,7 +10513,7 @@ cdef class FBCStats: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlFBCStats_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlFBCStats_t)) if self._ptr == NULL: raise MemoryError("Error allocating FBCStats") self._owner = None @@ -10492,7 +10525,7 @@ cdef class FBCStats: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.FBCStats object at {hex(id(self))}>" @@ -10513,20 +10546,20 @@ cdef class FBCStats: if not isinstance(other, FBCStats): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlFBCStats_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlFBCStats_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlFBCStats_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlFBCStats_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlFBCStats_t)) + self._ptr = _cyb_malloc(sizeof(nvmlFBCStats_t)) if self._ptr == NULL: raise MemoryError("Error allocating FBCStats") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlFBCStats_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlFBCStats_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -10569,7 +10602,7 @@ cdef class FBCStats: @staticmethod def from_buffer(buffer): """Create an FBCStats instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlFBCStats_t), FBCStats) + return _cyb_from_buffer(buffer, sizeof(nvmlFBCStats_t), FBCStats) @staticmethod def from_data(data): @@ -10578,7 +10611,7 @@ cdef class FBCStats: Args: data (_numpy.ndarray): a single-element array of dtype `fbc_stats_dtype` holding the data. """ - return __from_data(data, "fbc_stats_dtype", fbc_stats_dtype, FBCStats) + return _cyb_from_data(data, "fbc_stats_dtype", fbc_stats_dtype, FBCStats) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -10593,10 +10626,10 @@ cdef class FBCStats: raise ValueError("ptr must not be null (0)") cdef FBCStats obj = FBCStats.__new__(FBCStats) if owner is None: - obj._ptr = malloc(sizeof(nvmlFBCStats_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlFBCStats_t)) if obj._ptr == NULL: raise MemoryError("Error allocating FBCStats") - memcpy((obj._ptr), ptr, sizeof(nvmlFBCStats_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlFBCStats_t)) obj._owner = None obj._owned = True else: @@ -10608,7 +10641,7 @@ cdef class FBCStats: cdef _get_fbc_session_info_dtype_offsets(): - cdef nvmlFBCSessionInfo_t pod = nvmlFBCSessionInfo_t() + cdef nvmlFBCSessionInfo_t pod return _numpy.dtype({ 'names': ['session_id', 'pid', 'vgpu_instance', 'display_ordinal', 'session_type', 'session_flags', 'h_max_resolution', 'v_max_resolution', 'h_resolution', 'v_resolution', 'average_fps', 'average_latency'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.int32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], @@ -10633,21 +10666,17 @@ fbc_session_info_dtype = _get_fbc_session_info_dtype_offsets() cdef class FBCSessionInfo: """Empty-initialize an array of `nvmlFBCSessionInfo_t`. - The resulting object is of length `size` and of dtype `fbc_session_info_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlFBCSessionInfo_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=fbc_session_info_dtype) self._data = arr.view(_numpy.recarray) @@ -10684,10 +10713,10 @@ cdef class FBCSessionInfo: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def session_id(self): @@ -10875,8 +10904,8 @@ cdef class FBCSessionInfo: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef FBCSessionInfo obj = FBCSessionInfo.__new__(FBCSessionInfo) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(nvmlFBCSessionInfo_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=fbc_session_info_dtype) obj._data = data.view(_numpy.recarray) @@ -10885,7 +10914,7 @@ cdef class FBCSessionInfo: cdef _get_conf_compute_system_caps_dtype_offsets(): - cdef nvmlConfComputeSystemCaps_t pod = nvmlConfComputeSystemCaps_t() + cdef nvmlConfComputeSystemCaps_t pod return _numpy.dtype({ 'names': ['cpu_caps', 'gpus_caps'], 'formats': [_numpy.uint32, _numpy.uint32], @@ -10911,7 +10940,7 @@ cdef class ConfComputeSystemCaps: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlConfComputeSystemCaps_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlConfComputeSystemCaps_t)) if self._ptr == NULL: raise MemoryError("Error allocating ConfComputeSystemCaps") self._owner = None @@ -10923,7 +10952,7 @@ cdef class ConfComputeSystemCaps: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.ConfComputeSystemCaps object at {hex(id(self))}>" @@ -10944,20 +10973,20 @@ cdef class ConfComputeSystemCaps: if not isinstance(other, ConfComputeSystemCaps): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlConfComputeSystemCaps_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlConfComputeSystemCaps_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlConfComputeSystemCaps_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlConfComputeSystemCaps_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlConfComputeSystemCaps_t)) + self._ptr = _cyb_malloc(sizeof(nvmlConfComputeSystemCaps_t)) if self._ptr == NULL: raise MemoryError("Error allocating ConfComputeSystemCaps") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlConfComputeSystemCaps_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlConfComputeSystemCaps_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -10989,7 +11018,7 @@ cdef class ConfComputeSystemCaps: @staticmethod def from_buffer(buffer): """Create an ConfComputeSystemCaps instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlConfComputeSystemCaps_t), ConfComputeSystemCaps) + return _cyb_from_buffer(buffer, sizeof(nvmlConfComputeSystemCaps_t), ConfComputeSystemCaps) @staticmethod def from_data(data): @@ -10998,7 +11027,7 @@ cdef class ConfComputeSystemCaps: Args: data (_numpy.ndarray): a single-element array of dtype `conf_compute_system_caps_dtype` holding the data. """ - return __from_data(data, "conf_compute_system_caps_dtype", conf_compute_system_caps_dtype, ConfComputeSystemCaps) + return _cyb_from_data(data, "conf_compute_system_caps_dtype", conf_compute_system_caps_dtype, ConfComputeSystemCaps) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -11013,10 +11042,10 @@ cdef class ConfComputeSystemCaps: raise ValueError("ptr must not be null (0)") cdef ConfComputeSystemCaps obj = ConfComputeSystemCaps.__new__(ConfComputeSystemCaps) if owner is None: - obj._ptr = malloc(sizeof(nvmlConfComputeSystemCaps_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlConfComputeSystemCaps_t)) if obj._ptr == NULL: raise MemoryError("Error allocating ConfComputeSystemCaps") - memcpy((obj._ptr), ptr, sizeof(nvmlConfComputeSystemCaps_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlConfComputeSystemCaps_t)) obj._owner = None obj._owned = True else: @@ -11028,7 +11057,7 @@ cdef class ConfComputeSystemCaps: cdef _get_conf_compute_system_state_dtype_offsets(): - cdef nvmlConfComputeSystemState_t pod = nvmlConfComputeSystemState_t() + cdef nvmlConfComputeSystemState_t pod return _numpy.dtype({ 'names': ['environment', 'cc_feature', 'dev_tools_mode'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], @@ -11055,7 +11084,7 @@ cdef class ConfComputeSystemState: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlConfComputeSystemState_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlConfComputeSystemState_t)) if self._ptr == NULL: raise MemoryError("Error allocating ConfComputeSystemState") self._owner = None @@ -11067,7 +11096,7 @@ cdef class ConfComputeSystemState: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.ConfComputeSystemState object at {hex(id(self))}>" @@ -11088,20 +11117,20 @@ cdef class ConfComputeSystemState: if not isinstance(other, ConfComputeSystemState): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlConfComputeSystemState_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlConfComputeSystemState_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlConfComputeSystemState_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlConfComputeSystemState_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlConfComputeSystemState_t)) + self._ptr = _cyb_malloc(sizeof(nvmlConfComputeSystemState_t)) if self._ptr == NULL: raise MemoryError("Error allocating ConfComputeSystemState") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlConfComputeSystemState_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlConfComputeSystemState_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -11144,7 +11173,7 @@ cdef class ConfComputeSystemState: @staticmethod def from_buffer(buffer): """Create an ConfComputeSystemState instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlConfComputeSystemState_t), ConfComputeSystemState) + return _cyb_from_buffer(buffer, sizeof(nvmlConfComputeSystemState_t), ConfComputeSystemState) @staticmethod def from_data(data): @@ -11153,7 +11182,7 @@ cdef class ConfComputeSystemState: Args: data (_numpy.ndarray): a single-element array of dtype `conf_compute_system_state_dtype` holding the data. """ - return __from_data(data, "conf_compute_system_state_dtype", conf_compute_system_state_dtype, ConfComputeSystemState) + return _cyb_from_data(data, "conf_compute_system_state_dtype", conf_compute_system_state_dtype, ConfComputeSystemState) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -11168,10 +11197,10 @@ cdef class ConfComputeSystemState: raise ValueError("ptr must not be null (0)") cdef ConfComputeSystemState obj = ConfComputeSystemState.__new__(ConfComputeSystemState) if owner is None: - obj._ptr = malloc(sizeof(nvmlConfComputeSystemState_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlConfComputeSystemState_t)) if obj._ptr == NULL: raise MemoryError("Error allocating ConfComputeSystemState") - memcpy((obj._ptr), ptr, sizeof(nvmlConfComputeSystemState_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlConfComputeSystemState_t)) obj._owner = None obj._owned = True else: @@ -11183,7 +11212,7 @@ cdef class ConfComputeSystemState: cdef _get_system_conf_compute_settings_v1_dtype_offsets(): - cdef nvmlSystemConfComputeSettings_v1_t pod = nvmlSystemConfComputeSettings_v1_t() + cdef nvmlSystemConfComputeSettings_v1_t pod return _numpy.dtype({ 'names': ['version', 'environment', 'cc_feature', 'dev_tools_mode', 'multi_gpu_mode'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], @@ -11212,7 +11241,7 @@ cdef class SystemConfComputeSettings_v1: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlSystemConfComputeSettings_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlSystemConfComputeSettings_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating SystemConfComputeSettings_v1") self._owner = None @@ -11224,7 +11253,7 @@ cdef class SystemConfComputeSettings_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.SystemConfComputeSettings_v1 object at {hex(id(self))}>" @@ -11245,20 +11274,20 @@ cdef class SystemConfComputeSettings_v1: if not isinstance(other, SystemConfComputeSettings_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlSystemConfComputeSettings_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlSystemConfComputeSettings_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlSystemConfComputeSettings_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlSystemConfComputeSettings_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlSystemConfComputeSettings_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlSystemConfComputeSettings_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating SystemConfComputeSettings_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlSystemConfComputeSettings_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlSystemConfComputeSettings_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -11323,7 +11352,7 @@ cdef class SystemConfComputeSettings_v1: @staticmethod def from_buffer(buffer): """Create an SystemConfComputeSettings_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlSystemConfComputeSettings_v1_t), SystemConfComputeSettings_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlSystemConfComputeSettings_v1_t), SystemConfComputeSettings_v1) @staticmethod def from_data(data): @@ -11332,7 +11361,7 @@ cdef class SystemConfComputeSettings_v1: Args: data (_numpy.ndarray): a single-element array of dtype `system_conf_compute_settings_v1_dtype` holding the data. """ - return __from_data(data, "system_conf_compute_settings_v1_dtype", system_conf_compute_settings_v1_dtype, SystemConfComputeSettings_v1) + return _cyb_from_data(data, "system_conf_compute_settings_v1_dtype", system_conf_compute_settings_v1_dtype, SystemConfComputeSettings_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -11347,10 +11376,10 @@ cdef class SystemConfComputeSettings_v1: raise ValueError("ptr must not be null (0)") cdef SystemConfComputeSettings_v1 obj = SystemConfComputeSettings_v1.__new__(SystemConfComputeSettings_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlSystemConfComputeSettings_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlSystemConfComputeSettings_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating SystemConfComputeSettings_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlSystemConfComputeSettings_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlSystemConfComputeSettings_v1_t)) obj._owner = None obj._owned = True else: @@ -11362,7 +11391,7 @@ cdef class SystemConfComputeSettings_v1: cdef _get_conf_compute_mem_size_info_dtype_offsets(): - cdef nvmlConfComputeMemSizeInfo_t pod = nvmlConfComputeMemSizeInfo_t() + cdef nvmlConfComputeMemSizeInfo_t pod return _numpy.dtype({ 'names': ['protected_mem_size_kib', 'unprotected_mem_size_kib'], 'formats': [_numpy.uint64, _numpy.uint64], @@ -11388,7 +11417,7 @@ cdef class ConfComputeMemSizeInfo: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlConfComputeMemSizeInfo_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlConfComputeMemSizeInfo_t)) if self._ptr == NULL: raise MemoryError("Error allocating ConfComputeMemSizeInfo") self._owner = None @@ -11400,7 +11429,7 @@ cdef class ConfComputeMemSizeInfo: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.ConfComputeMemSizeInfo object at {hex(id(self))}>" @@ -11421,20 +11450,20 @@ cdef class ConfComputeMemSizeInfo: if not isinstance(other, ConfComputeMemSizeInfo): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlConfComputeMemSizeInfo_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlConfComputeMemSizeInfo_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlConfComputeMemSizeInfo_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlConfComputeMemSizeInfo_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlConfComputeMemSizeInfo_t)) + self._ptr = _cyb_malloc(sizeof(nvmlConfComputeMemSizeInfo_t)) if self._ptr == NULL: raise MemoryError("Error allocating ConfComputeMemSizeInfo") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlConfComputeMemSizeInfo_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlConfComputeMemSizeInfo_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -11466,7 +11495,7 @@ cdef class ConfComputeMemSizeInfo: @staticmethod def from_buffer(buffer): """Create an ConfComputeMemSizeInfo instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlConfComputeMemSizeInfo_t), ConfComputeMemSizeInfo) + return _cyb_from_buffer(buffer, sizeof(nvmlConfComputeMemSizeInfo_t), ConfComputeMemSizeInfo) @staticmethod def from_data(data): @@ -11475,7 +11504,7 @@ cdef class ConfComputeMemSizeInfo: Args: data (_numpy.ndarray): a single-element array of dtype `conf_compute_mem_size_info_dtype` holding the data. """ - return __from_data(data, "conf_compute_mem_size_info_dtype", conf_compute_mem_size_info_dtype, ConfComputeMemSizeInfo) + return _cyb_from_data(data, "conf_compute_mem_size_info_dtype", conf_compute_mem_size_info_dtype, ConfComputeMemSizeInfo) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -11490,10 +11519,10 @@ cdef class ConfComputeMemSizeInfo: raise ValueError("ptr must not be null (0)") cdef ConfComputeMemSizeInfo obj = ConfComputeMemSizeInfo.__new__(ConfComputeMemSizeInfo) if owner is None: - obj._ptr = malloc(sizeof(nvmlConfComputeMemSizeInfo_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlConfComputeMemSizeInfo_t)) if obj._ptr == NULL: raise MemoryError("Error allocating ConfComputeMemSizeInfo") - memcpy((obj._ptr), ptr, sizeof(nvmlConfComputeMemSizeInfo_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlConfComputeMemSizeInfo_t)) obj._owner = None obj._owned = True else: @@ -11505,7 +11534,7 @@ cdef class ConfComputeMemSizeInfo: cdef _get_conf_compute_gpu_certificate_dtype_offsets(): - cdef nvmlConfComputeGpuCertificate_t pod = nvmlConfComputeGpuCertificate_t() + cdef nvmlConfComputeGpuCertificate_t pod return _numpy.dtype({ 'names': ['cert_chain_size', 'attestation_cert_chain_size', 'cert_chain', 'attestation_cert_chain'], 'formats': [_numpy.uint32, _numpy.uint32, (_numpy.uint8, 4096), (_numpy.uint8, 5120)], @@ -11533,7 +11562,7 @@ cdef class ConfComputeGpuCertificate: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlConfComputeGpuCertificate_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlConfComputeGpuCertificate_t)) if self._ptr == NULL: raise MemoryError("Error allocating ConfComputeGpuCertificate") self._owner = None @@ -11545,7 +11574,7 @@ cdef class ConfComputeGpuCertificate: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.ConfComputeGpuCertificate object at {hex(id(self))}>" @@ -11566,20 +11595,20 @@ cdef class ConfComputeGpuCertificate: if not isinstance(other, ConfComputeGpuCertificate): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlConfComputeGpuCertificate_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlConfComputeGpuCertificate_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlConfComputeGpuCertificate_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlConfComputeGpuCertificate_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlConfComputeGpuCertificate_t)) + self._ptr = _cyb_malloc(sizeof(nvmlConfComputeGpuCertificate_t)) if self._ptr == NULL: raise MemoryError("Error allocating ConfComputeGpuCertificate") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlConfComputeGpuCertificate_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlConfComputeGpuCertificate_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -11591,7 +11620,7 @@ cdef class ConfComputeGpuCertificate: """~_numpy.uint8: (array of length 4096).""" if self._ptr[0].certChainSize == 0: return _numpy.array([]) - cdef view.array arr = view.array(shape=(self._ptr[0].certChainSize,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) + cdef _cyb_view.array arr = _cyb_view.array(shape=(self._ptr[0].certChainSize,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) arr.data = (&(self._ptr[0].certChain)) return _numpy.asarray(arr) @@ -11604,16 +11633,16 @@ cdef class ConfComputeGpuCertificate: self._ptr[0].certChainSize = len(val) if len(val) == 0: return - cdef view.array arr = view.array(shape=(self._ptr[0].certChainSize,), itemsize=sizeof(unsigned char), format="B", mode="c") + cdef _cyb_view.array arr = _cyb_view.array(shape=(self._ptr[0].certChainSize,), itemsize=sizeof(unsigned char), format="B", mode="c") arr[:] = _numpy.asarray(val, dtype=_numpy.uint8) - memcpy((&(self._ptr[0].certChain)), (arr.data), sizeof(unsigned char) * len(val)) + _cyb_memcpy((&(self._ptr[0].certChain)), (arr.data), sizeof(unsigned char) * len(val)) @property def attestation_cert_chain(self): """~_numpy.uint8: (array of length 5120).""" if self._ptr[0].attestationCertChainSize == 0: return _numpy.array([]) - cdef view.array arr = view.array(shape=(self._ptr[0].attestationCertChainSize,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) + cdef _cyb_view.array arr = _cyb_view.array(shape=(self._ptr[0].attestationCertChainSize,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) arr.data = (&(self._ptr[0].attestationCertChain)) return _numpy.asarray(arr) @@ -11626,14 +11655,14 @@ cdef class ConfComputeGpuCertificate: self._ptr[0].attestationCertChainSize = len(val) if len(val) == 0: return - cdef view.array arr = view.array(shape=(self._ptr[0].attestationCertChainSize,), itemsize=sizeof(unsigned char), format="B", mode="c") + cdef _cyb_view.array arr = _cyb_view.array(shape=(self._ptr[0].attestationCertChainSize,), itemsize=sizeof(unsigned char), format="B", mode="c") arr[:] = _numpy.asarray(val, dtype=_numpy.uint8) - memcpy((&(self._ptr[0].attestationCertChain)), (arr.data), sizeof(unsigned char) * len(val)) + _cyb_memcpy((&(self._ptr[0].attestationCertChain)), (arr.data), sizeof(unsigned char) * len(val)) @staticmethod def from_buffer(buffer): """Create an ConfComputeGpuCertificate instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlConfComputeGpuCertificate_t), ConfComputeGpuCertificate) + return _cyb_from_buffer(buffer, sizeof(nvmlConfComputeGpuCertificate_t), ConfComputeGpuCertificate) @staticmethod def from_data(data): @@ -11642,7 +11671,7 @@ cdef class ConfComputeGpuCertificate: Args: data (_numpy.ndarray): a single-element array of dtype `conf_compute_gpu_certificate_dtype` holding the data. """ - return __from_data(data, "conf_compute_gpu_certificate_dtype", conf_compute_gpu_certificate_dtype, ConfComputeGpuCertificate) + return _cyb_from_data(data, "conf_compute_gpu_certificate_dtype", conf_compute_gpu_certificate_dtype, ConfComputeGpuCertificate) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -11657,10 +11686,10 @@ cdef class ConfComputeGpuCertificate: raise ValueError("ptr must not be null (0)") cdef ConfComputeGpuCertificate obj = ConfComputeGpuCertificate.__new__(ConfComputeGpuCertificate) if owner is None: - obj._ptr = malloc(sizeof(nvmlConfComputeGpuCertificate_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlConfComputeGpuCertificate_t)) if obj._ptr == NULL: raise MemoryError("Error allocating ConfComputeGpuCertificate") - memcpy((obj._ptr), ptr, sizeof(nvmlConfComputeGpuCertificate_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlConfComputeGpuCertificate_t)) obj._owner = None obj._owned = True else: @@ -11672,7 +11701,7 @@ cdef class ConfComputeGpuCertificate: cdef _get_conf_compute_gpu_attestation_report_dtype_offsets(): - cdef nvmlConfComputeGpuAttestationReport_t pod = nvmlConfComputeGpuAttestationReport_t() + cdef nvmlConfComputeGpuAttestationReport_t pod return _numpy.dtype({ 'names': ['is_cec_attestation_report_present', 'attestation_report_size', 'cec_attestation_report_size', 'nonce', 'attestation_report', 'cec_attestation_report'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.uint8, 32), (_numpy.uint8, 8192), (_numpy.uint8, 4096)], @@ -11702,7 +11731,7 @@ cdef class ConfComputeGpuAttestationReport: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlConfComputeGpuAttestationReport_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlConfComputeGpuAttestationReport_t)) if self._ptr == NULL: raise MemoryError("Error allocating ConfComputeGpuAttestationReport") self._owner = None @@ -11714,7 +11743,7 @@ cdef class ConfComputeGpuAttestationReport: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.ConfComputeGpuAttestationReport object at {hex(id(self))}>" @@ -11735,20 +11764,20 @@ cdef class ConfComputeGpuAttestationReport: if not isinstance(other, ConfComputeGpuAttestationReport): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlConfComputeGpuAttestationReport_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlConfComputeGpuAttestationReport_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlConfComputeGpuAttestationReport_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlConfComputeGpuAttestationReport_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlConfComputeGpuAttestationReport_t)) + self._ptr = _cyb_malloc(sizeof(nvmlConfComputeGpuAttestationReport_t)) if self._ptr == NULL: raise MemoryError("Error allocating ConfComputeGpuAttestationReport") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlConfComputeGpuAttestationReport_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlConfComputeGpuAttestationReport_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -11769,7 +11798,7 @@ cdef class ConfComputeGpuAttestationReport: @property def nonce(self): """~_numpy.uint8: (array of length 32).""" - cdef view.array arr = view.array(shape=(32,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) + cdef _cyb_view.array arr = _cyb_view.array(shape=(32,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) arr.data = (&(self._ptr[0].nonce)) return _numpy.asarray(arr) @@ -11779,16 +11808,16 @@ cdef class ConfComputeGpuAttestationReport: raise ValueError("This ConfComputeGpuAttestationReport instance is read-only") if len(val) != 32: raise ValueError(f"Expected length { 32 } for field nonce, got {len(val)}") - cdef view.array arr = view.array(shape=(32,), itemsize=sizeof(unsigned char), format="B", mode="c") + cdef _cyb_view.array arr = _cyb_view.array(shape=(32,), itemsize=sizeof(unsigned char), format="B", mode="c") arr[:] = _numpy.asarray(val, dtype=_numpy.uint8) - memcpy((&(self._ptr[0].nonce)), (arr.data), sizeof(unsigned char) * len(val)) + _cyb_memcpy((&(self._ptr[0].nonce)), (arr.data), sizeof(unsigned char) * len(val)) @property def attestation_report(self): """~_numpy.uint8: (array of length 8192).""" if self._ptr[0].attestationReportSize == 0: return _numpy.array([]) - cdef view.array arr = view.array(shape=(self._ptr[0].attestationReportSize,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) + cdef _cyb_view.array arr = _cyb_view.array(shape=(self._ptr[0].attestationReportSize,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) arr.data = (&(self._ptr[0].attestationReport)) return _numpy.asarray(arr) @@ -11801,16 +11830,16 @@ cdef class ConfComputeGpuAttestationReport: self._ptr[0].attestationReportSize = len(val) if len(val) == 0: return - cdef view.array arr = view.array(shape=(self._ptr[0].attestationReportSize,), itemsize=sizeof(unsigned char), format="B", mode="c") + cdef _cyb_view.array arr = _cyb_view.array(shape=(self._ptr[0].attestationReportSize,), itemsize=sizeof(unsigned char), format="B", mode="c") arr[:] = _numpy.asarray(val, dtype=_numpy.uint8) - memcpy((&(self._ptr[0].attestationReport)), (arr.data), sizeof(unsigned char) * len(val)) + _cyb_memcpy((&(self._ptr[0].attestationReport)), (arr.data), sizeof(unsigned char) * len(val)) @property def cec_attestation_report(self): """~_numpy.uint8: (array of length 4096).""" if self._ptr[0].cecAttestationReportSize == 0: return _numpy.array([]) - cdef view.array arr = view.array(shape=(self._ptr[0].cecAttestationReportSize,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) + cdef _cyb_view.array arr = _cyb_view.array(shape=(self._ptr[0].cecAttestationReportSize,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) arr.data = (&(self._ptr[0].cecAttestationReport)) return _numpy.asarray(arr) @@ -11823,14 +11852,14 @@ cdef class ConfComputeGpuAttestationReport: self._ptr[0].cecAttestationReportSize = len(val) if len(val) == 0: return - cdef view.array arr = view.array(shape=(self._ptr[0].cecAttestationReportSize,), itemsize=sizeof(unsigned char), format="B", mode="c") + cdef _cyb_view.array arr = _cyb_view.array(shape=(self._ptr[0].cecAttestationReportSize,), itemsize=sizeof(unsigned char), format="B", mode="c") arr[:] = _numpy.asarray(val, dtype=_numpy.uint8) - memcpy((&(self._ptr[0].cecAttestationReport)), (arr.data), sizeof(unsigned char) * len(val)) + _cyb_memcpy((&(self._ptr[0].cecAttestationReport)), (arr.data), sizeof(unsigned char) * len(val)) @staticmethod def from_buffer(buffer): """Create an ConfComputeGpuAttestationReport instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlConfComputeGpuAttestationReport_t), ConfComputeGpuAttestationReport) + return _cyb_from_buffer(buffer, sizeof(nvmlConfComputeGpuAttestationReport_t), ConfComputeGpuAttestationReport) @staticmethod def from_data(data): @@ -11839,7 +11868,7 @@ cdef class ConfComputeGpuAttestationReport: Args: data (_numpy.ndarray): a single-element array of dtype `conf_compute_gpu_attestation_report_dtype` holding the data. """ - return __from_data(data, "conf_compute_gpu_attestation_report_dtype", conf_compute_gpu_attestation_report_dtype, ConfComputeGpuAttestationReport) + return _cyb_from_data(data, "conf_compute_gpu_attestation_report_dtype", conf_compute_gpu_attestation_report_dtype, ConfComputeGpuAttestationReport) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -11854,10 +11883,10 @@ cdef class ConfComputeGpuAttestationReport: raise ValueError("ptr must not be null (0)") cdef ConfComputeGpuAttestationReport obj = ConfComputeGpuAttestationReport.__new__(ConfComputeGpuAttestationReport) if owner is None: - obj._ptr = malloc(sizeof(nvmlConfComputeGpuAttestationReport_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlConfComputeGpuAttestationReport_t)) if obj._ptr == NULL: raise MemoryError("Error allocating ConfComputeGpuAttestationReport") - memcpy((obj._ptr), ptr, sizeof(nvmlConfComputeGpuAttestationReport_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlConfComputeGpuAttestationReport_t)) obj._owner = None obj._owned = True else: @@ -11869,7 +11898,7 @@ cdef class ConfComputeGpuAttestationReport: cdef _get_gpu_fabric_info_v2_dtype_offsets(): - cdef nvmlGpuFabricInfo_v2_t pod = nvmlGpuFabricInfo_v2_t() + cdef nvmlGpuFabricInfo_v2_t pod return _numpy.dtype({ 'names': ['version', 'cluster_uuid', 'status', 'clique_id', 'state', 'health_mask'], 'formats': [_numpy.uint32, (_numpy.uint8, 16), _numpy.int32, _numpy.uint32, _numpy.uint8, _numpy.uint32], @@ -11899,7 +11928,7 @@ cdef class GpuFabricInfo_v2: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlGpuFabricInfo_v2_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlGpuFabricInfo_v2_t)) if self._ptr == NULL: raise MemoryError("Error allocating GpuFabricInfo_v2") self._owner = None @@ -11911,7 +11940,7 @@ cdef class GpuFabricInfo_v2: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.GpuFabricInfo_v2 object at {hex(id(self))}>" @@ -11932,20 +11961,20 @@ cdef class GpuFabricInfo_v2: if not isinstance(other, GpuFabricInfo_v2): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuFabricInfo_v2_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuFabricInfo_v2_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlGpuFabricInfo_v2_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlGpuFabricInfo_v2_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlGpuFabricInfo_v2_t)) + self._ptr = _cyb_malloc(sizeof(nvmlGpuFabricInfo_v2_t)) if self._ptr == NULL: raise MemoryError("Error allocating GpuFabricInfo_v2") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuFabricInfo_v2_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuFabricInfo_v2_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -11954,7 +11983,7 @@ cdef class GpuFabricInfo_v2: @property def version(self): - """int: Structure version identifier (set to nvmlGpuFabricInfo_v2)""" + """int: Structure version identifier (set to nvmlGpuFabricInfo_v2).""" return self._ptr[0].version @version.setter @@ -11966,7 +11995,7 @@ cdef class GpuFabricInfo_v2: @property def cluster_uuid(self): """~_numpy.uint8: (array of length 16).Uuid of the cluster to which this GPU belongs.""" - cdef view.array arr = view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) + cdef _cyb_view.array arr = _cyb_view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) arr.data = (&(self._ptr[0].clusterUuid)) return _numpy.asarray(arr) @@ -11976,9 +12005,9 @@ cdef class GpuFabricInfo_v2: raise ValueError("This GpuFabricInfo_v2 instance is read-only") if len(val) != 16: raise ValueError(f"Expected length { 16 } for field cluster_uuid, got {len(val)}") - cdef view.array arr = view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c") + cdef _cyb_view.array arr = _cyb_view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c") arr[:] = _numpy.asarray(val, dtype=_numpy.uint8) - memcpy((&(self._ptr[0].clusterUuid)), (arr.data), sizeof(unsigned char) * len(val)) + _cyb_memcpy((&(self._ptr[0].clusterUuid)), (arr.data), sizeof(unsigned char) * len(val)) @property def status(self): @@ -12027,7 +12056,7 @@ cdef class GpuFabricInfo_v2: @staticmethod def from_buffer(buffer): """Create an GpuFabricInfo_v2 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlGpuFabricInfo_v2_t), GpuFabricInfo_v2) + return _cyb_from_buffer(buffer, sizeof(nvmlGpuFabricInfo_v2_t), GpuFabricInfo_v2) @staticmethod def from_data(data): @@ -12036,7 +12065,7 @@ cdef class GpuFabricInfo_v2: Args: data (_numpy.ndarray): a single-element array of dtype `gpu_fabric_info_v2_dtype` holding the data. """ - return __from_data(data, "gpu_fabric_info_v2_dtype", gpu_fabric_info_v2_dtype, GpuFabricInfo_v2) + return _cyb_from_data(data, "gpu_fabric_info_v2_dtype", gpu_fabric_info_v2_dtype, GpuFabricInfo_v2) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -12051,10 +12080,10 @@ cdef class GpuFabricInfo_v2: raise ValueError("ptr must not be null (0)") cdef GpuFabricInfo_v2 obj = GpuFabricInfo_v2.__new__(GpuFabricInfo_v2) if owner is None: - obj._ptr = malloc(sizeof(nvmlGpuFabricInfo_v2_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlGpuFabricInfo_v2_t)) if obj._ptr == NULL: raise MemoryError("Error allocating GpuFabricInfo_v2") - memcpy((obj._ptr), ptr, sizeof(nvmlGpuFabricInfo_v2_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGpuFabricInfo_v2_t)) obj._owner = None obj._owned = True else: @@ -12066,7 +12095,7 @@ cdef class GpuFabricInfo_v2: cdef _get_nvlink_supported_bw_modes_v1_dtype_offsets(): - cdef nvmlNvlinkSupportedBwModes_v1_t pod = nvmlNvlinkSupportedBwModes_v1_t() + cdef nvmlNvlinkSupportedBwModes_v1_t pod return _numpy.dtype({ 'names': ['version', 'bw_modes', 'total_bw_modes'], 'formats': [_numpy.uint32, (_numpy.uint8, 23), _numpy.uint8], @@ -12093,7 +12122,7 @@ cdef class NvlinkSupportedBwModes_v1: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlNvlinkSupportedBwModes_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlNvlinkSupportedBwModes_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating NvlinkSupportedBwModes_v1") self._owner = None @@ -12105,7 +12134,7 @@ cdef class NvlinkSupportedBwModes_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.NvlinkSupportedBwModes_v1 object at {hex(id(self))}>" @@ -12126,20 +12155,20 @@ cdef class NvlinkSupportedBwModes_v1: if not isinstance(other, NvlinkSupportedBwModes_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvlinkSupportedBwModes_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvlinkSupportedBwModes_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlNvlinkSupportedBwModes_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlNvlinkSupportedBwModes_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlNvlinkSupportedBwModes_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlNvlinkSupportedBwModes_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating NvlinkSupportedBwModes_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvlinkSupportedBwModes_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvlinkSupportedBwModes_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -12162,7 +12191,7 @@ cdef class NvlinkSupportedBwModes_v1: """~_numpy.uint8: (array of length 23).""" if self._ptr[0].totalBwModes == 0: return _numpy.array([]) - cdef view.array arr = view.array(shape=(self._ptr[0].totalBwModes,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) + cdef _cyb_view.array arr = _cyb_view.array(shape=(self._ptr[0].totalBwModes,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) arr.data = (&(self._ptr[0].bwModes)) return _numpy.asarray(arr) @@ -12175,14 +12204,14 @@ cdef class NvlinkSupportedBwModes_v1: self._ptr[0].totalBwModes = len(val) if len(val) == 0: return - cdef view.array arr = view.array(shape=(self._ptr[0].totalBwModes,), itemsize=sizeof(unsigned char), format="B", mode="c") + cdef _cyb_view.array arr = _cyb_view.array(shape=(self._ptr[0].totalBwModes,), itemsize=sizeof(unsigned char), format="B", mode="c") arr[:] = _numpy.asarray(val, dtype=_numpy.uint8) - memcpy((&(self._ptr[0].bwModes)), (arr.data), sizeof(unsigned char) * len(val)) + _cyb_memcpy((&(self._ptr[0].bwModes)), (arr.data), sizeof(unsigned char) * len(val)) @staticmethod def from_buffer(buffer): """Create an NvlinkSupportedBwModes_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlNvlinkSupportedBwModes_v1_t), NvlinkSupportedBwModes_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlNvlinkSupportedBwModes_v1_t), NvlinkSupportedBwModes_v1) @staticmethod def from_data(data): @@ -12191,7 +12220,7 @@ cdef class NvlinkSupportedBwModes_v1: Args: data (_numpy.ndarray): a single-element array of dtype `nvlink_supported_bw_modes_v1_dtype` holding the data. """ - return __from_data(data, "nvlink_supported_bw_modes_v1_dtype", nvlink_supported_bw_modes_v1_dtype, NvlinkSupportedBwModes_v1) + return _cyb_from_data(data, "nvlink_supported_bw_modes_v1_dtype", nvlink_supported_bw_modes_v1_dtype, NvlinkSupportedBwModes_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -12206,10 +12235,10 @@ cdef class NvlinkSupportedBwModes_v1: raise ValueError("ptr must not be null (0)") cdef NvlinkSupportedBwModes_v1 obj = NvlinkSupportedBwModes_v1.__new__(NvlinkSupportedBwModes_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlNvlinkSupportedBwModes_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlNvlinkSupportedBwModes_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating NvlinkSupportedBwModes_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlNvlinkSupportedBwModes_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlNvlinkSupportedBwModes_v1_t)) obj._owner = None obj._owned = True else: @@ -12221,7 +12250,7 @@ cdef class NvlinkSupportedBwModes_v1: cdef _get_nvlink_get_bw_mode_v1_dtype_offsets(): - cdef nvmlNvlinkGetBwMode_v1_t pod = nvmlNvlinkGetBwMode_v1_t() + cdef nvmlNvlinkGetBwMode_v1_t pod return _numpy.dtype({ 'names': ['version', 'b_is_best', 'bw_mode'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint8], @@ -12248,7 +12277,7 @@ cdef class NvlinkGetBwMode_v1: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlNvlinkGetBwMode_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlNvlinkGetBwMode_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating NvlinkGetBwMode_v1") self._owner = None @@ -12260,7 +12289,7 @@ cdef class NvlinkGetBwMode_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.NvlinkGetBwMode_v1 object at {hex(id(self))}>" @@ -12281,20 +12310,20 @@ cdef class NvlinkGetBwMode_v1: if not isinstance(other, NvlinkGetBwMode_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvlinkGetBwMode_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvlinkGetBwMode_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlNvlinkGetBwMode_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlNvlinkGetBwMode_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlNvlinkGetBwMode_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlNvlinkGetBwMode_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating NvlinkGetBwMode_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvlinkGetBwMode_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvlinkGetBwMode_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -12337,7 +12366,7 @@ cdef class NvlinkGetBwMode_v1: @staticmethod def from_buffer(buffer): """Create an NvlinkGetBwMode_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlNvlinkGetBwMode_v1_t), NvlinkGetBwMode_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlNvlinkGetBwMode_v1_t), NvlinkGetBwMode_v1) @staticmethod def from_data(data): @@ -12346,7 +12375,7 @@ cdef class NvlinkGetBwMode_v1: Args: data (_numpy.ndarray): a single-element array of dtype `nvlink_get_bw_mode_v1_dtype` holding the data. """ - return __from_data(data, "nvlink_get_bw_mode_v1_dtype", nvlink_get_bw_mode_v1_dtype, NvlinkGetBwMode_v1) + return _cyb_from_data(data, "nvlink_get_bw_mode_v1_dtype", nvlink_get_bw_mode_v1_dtype, NvlinkGetBwMode_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -12361,10 +12390,10 @@ cdef class NvlinkGetBwMode_v1: raise ValueError("ptr must not be null (0)") cdef NvlinkGetBwMode_v1 obj = NvlinkGetBwMode_v1.__new__(NvlinkGetBwMode_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlNvlinkGetBwMode_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlNvlinkGetBwMode_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating NvlinkGetBwMode_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlNvlinkGetBwMode_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlNvlinkGetBwMode_v1_t)) obj._owner = None obj._owned = True else: @@ -12376,7 +12405,7 @@ cdef class NvlinkGetBwMode_v1: cdef _get_nvlink_set_bw_mode_v1_dtype_offsets(): - cdef nvmlNvlinkSetBwMode_v1_t pod = nvmlNvlinkSetBwMode_v1_t() + cdef nvmlNvlinkSetBwMode_v1_t pod return _numpy.dtype({ 'names': ['version', 'b_set_best', 'bw_mode'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint8], @@ -12403,7 +12432,7 @@ cdef class NvlinkSetBwMode_v1: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlNvlinkSetBwMode_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlNvlinkSetBwMode_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating NvlinkSetBwMode_v1") self._owner = None @@ -12415,7 +12444,7 @@ cdef class NvlinkSetBwMode_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.NvlinkSetBwMode_v1 object at {hex(id(self))}>" @@ -12436,20 +12465,20 @@ cdef class NvlinkSetBwMode_v1: if not isinstance(other, NvlinkSetBwMode_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvlinkSetBwMode_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvlinkSetBwMode_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlNvlinkSetBwMode_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlNvlinkSetBwMode_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlNvlinkSetBwMode_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlNvlinkSetBwMode_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating NvlinkSetBwMode_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvlinkSetBwMode_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvlinkSetBwMode_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -12492,7 +12521,7 @@ cdef class NvlinkSetBwMode_v1: @staticmethod def from_buffer(buffer): """Create an NvlinkSetBwMode_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlNvlinkSetBwMode_v1_t), NvlinkSetBwMode_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlNvlinkSetBwMode_v1_t), NvlinkSetBwMode_v1) @staticmethod def from_data(data): @@ -12501,7 +12530,7 @@ cdef class NvlinkSetBwMode_v1: Args: data (_numpy.ndarray): a single-element array of dtype `nvlink_set_bw_mode_v1_dtype` holding the data. """ - return __from_data(data, "nvlink_set_bw_mode_v1_dtype", nvlink_set_bw_mode_v1_dtype, NvlinkSetBwMode_v1) + return _cyb_from_data(data, "nvlink_set_bw_mode_v1_dtype", nvlink_set_bw_mode_v1_dtype, NvlinkSetBwMode_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -12516,10 +12545,10 @@ cdef class NvlinkSetBwMode_v1: raise ValueError("ptr must not be null (0)") cdef NvlinkSetBwMode_v1 obj = NvlinkSetBwMode_v1.__new__(NvlinkSetBwMode_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlNvlinkSetBwMode_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlNvlinkSetBwMode_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating NvlinkSetBwMode_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlNvlinkSetBwMode_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlNvlinkSetBwMode_v1_t)) obj._owner = None obj._owned = True else: @@ -12531,7 +12560,7 @@ cdef class NvlinkSetBwMode_v1: cdef _get_vgpu_version_dtype_offsets(): - cdef nvmlVgpuVersion_t pod = nvmlVgpuVersion_t() + cdef nvmlVgpuVersion_t pod return _numpy.dtype({ 'names': ['min_version', 'max_version'], 'formats': [_numpy.uint32, _numpy.uint32], @@ -12557,7 +12586,7 @@ cdef class VgpuVersion: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlVgpuVersion_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuVersion_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuVersion") self._owner = None @@ -12569,7 +12598,7 @@ cdef class VgpuVersion: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.VgpuVersion object at {hex(id(self))}>" @@ -12590,20 +12619,20 @@ cdef class VgpuVersion: if not isinstance(other, VgpuVersion): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuVersion_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuVersion_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuVersion_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuVersion_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlVgpuVersion_t)) + self._ptr = _cyb_malloc(sizeof(nvmlVgpuVersion_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuVersion") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuVersion_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuVersion_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -12635,7 +12664,7 @@ cdef class VgpuVersion: @staticmethod def from_buffer(buffer): """Create an VgpuVersion instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlVgpuVersion_t), VgpuVersion) + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuVersion_t), VgpuVersion) @staticmethod def from_data(data): @@ -12644,7 +12673,7 @@ cdef class VgpuVersion: Args: data (_numpy.ndarray): a single-element array of dtype `vgpu_version_dtype` holding the data. """ - return __from_data(data, "vgpu_version_dtype", vgpu_version_dtype, VgpuVersion) + return _cyb_from_data(data, "vgpu_version_dtype", vgpu_version_dtype, VgpuVersion) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -12659,10 +12688,10 @@ cdef class VgpuVersion: raise ValueError("ptr must not be null (0)") cdef VgpuVersion obj = VgpuVersion.__new__(VgpuVersion) if owner is None: - obj._ptr = malloc(sizeof(nvmlVgpuVersion_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuVersion_t)) if obj._ptr == NULL: raise MemoryError("Error allocating VgpuVersion") - memcpy((obj._ptr), ptr, sizeof(nvmlVgpuVersion_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuVersion_t)) obj._owner = None obj._owned = True else: @@ -12674,7 +12703,7 @@ cdef class VgpuVersion: cdef _get_vgpu_metadata_dtype_offsets(): - cdef nvmlVgpuMetadata_t pod = nvmlVgpuMetadata_t() + cdef nvmlVgpuMetadata_t pod return _numpy.dtype({ 'names': ['version', 'revision', 'guest_info_state', 'guest_driver_version', 'host_driver_version', 'reserved', 'vgpu_virtualization_caps', 'guest_vgpu_version', 'opaque_data_size', 'opaque_data'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.int32, (_numpy.int8, 80), (_numpy.int8, 80), (_numpy.uint32, 6), _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.int8, 4)], @@ -12708,7 +12737,7 @@ cdef class VgpuMetadata: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlVgpuMetadata_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuMetadata_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuMetadata") self._owner = None @@ -12720,7 +12749,7 @@ cdef class VgpuMetadata: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.VgpuMetadata object at {hex(id(self))}>" @@ -12741,20 +12770,20 @@ cdef class VgpuMetadata: if not isinstance(other, VgpuMetadata): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuMetadata_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuMetadata_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuMetadata_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuMetadata_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlVgpuMetadata_t)) + self._ptr = _cyb_malloc(sizeof(nvmlVgpuMetadata_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuMetadata") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuMetadata_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuMetadata_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -12797,7 +12826,7 @@ cdef class VgpuMetadata: @property def guest_driver_version(self): """~_numpy.int8: (array of length 80).""" - return cpython.PyUnicode_FromString(self._ptr[0].guestDriverVersion) + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].guestDriverVersion) @guest_driver_version.setter def guest_driver_version(self, val): @@ -12807,12 +12836,12 @@ cdef class VgpuMetadata: if len(buf) >= 80: raise ValueError("String too long for field guest_driver_version, max length is 79") cdef char *ptr = buf - memcpy((self._ptr[0].guestDriverVersion), ptr, 80) + _cyb_memcpy((self._ptr[0].guestDriverVersion), ptr, 80) @property def host_driver_version(self): """~_numpy.int8: (array of length 80).""" - return cpython.PyUnicode_FromString(self._ptr[0].hostDriverVersion) + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].hostDriverVersion) @host_driver_version.setter def host_driver_version(self, val): @@ -12822,7 +12851,7 @@ cdef class VgpuMetadata: if len(buf) >= 80: raise ValueError("String too long for field host_driver_version, max length is 79") cdef char *ptr = buf - memcpy((self._ptr[0].hostDriverVersion), ptr, 80) + _cyb_memcpy((self._ptr[0].hostDriverVersion), ptr, 80) @property def vgpu_virtualization_caps(self): @@ -12860,7 +12889,7 @@ cdef class VgpuMetadata: @property def opaque_data(self): """~_numpy.int8: (array of length 4).""" - return cpython.PyUnicode_FromString(self._ptr[0].opaqueData) + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].opaqueData) @opaque_data.setter def opaque_data(self, val): @@ -12870,12 +12899,12 @@ cdef class VgpuMetadata: if len(buf) >= 4: raise ValueError("String too long for field opaque_data, max length is 3") cdef char *ptr = buf - memcpy((self._ptr[0].opaqueData), ptr, 4) + _cyb_memcpy((self._ptr[0].opaqueData), ptr, 4) @staticmethod def from_buffer(buffer): """Create an VgpuMetadata instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlVgpuMetadata_t), VgpuMetadata) + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuMetadata_t), VgpuMetadata) @staticmethod def from_data(data): @@ -12884,7 +12913,7 @@ cdef class VgpuMetadata: Args: data (_numpy.ndarray): a single-element array of dtype `vgpu_metadata_dtype` holding the data. """ - return __from_data(data, "vgpu_metadata_dtype", vgpu_metadata_dtype, VgpuMetadata) + return _cyb_from_data(data, "vgpu_metadata_dtype", vgpu_metadata_dtype, VgpuMetadata) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -12899,10 +12928,10 @@ cdef class VgpuMetadata: raise ValueError("ptr must not be null (0)") cdef VgpuMetadata obj = VgpuMetadata.__new__(VgpuMetadata) if owner is None: - obj._ptr = malloc(sizeof(nvmlVgpuMetadata_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuMetadata_t)) if obj._ptr == NULL: raise MemoryError("Error allocating VgpuMetadata") - memcpy((obj._ptr), ptr, sizeof(nvmlVgpuMetadata_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuMetadata_t)) obj._owner = None obj._owned = True else: @@ -12914,7 +12943,7 @@ cdef class VgpuMetadata: cdef _get_vgpu_pgpu_compatibility_dtype_offsets(): - cdef nvmlVgpuPgpuCompatibility_t pod = nvmlVgpuPgpuCompatibility_t() + cdef nvmlVgpuPgpuCompatibility_t pod return _numpy.dtype({ 'names': ['vgpu_vm_compatibility', 'compatibility_limit_code'], 'formats': [_numpy.int32, _numpy.int32], @@ -12940,7 +12969,7 @@ cdef class VgpuPgpuCompatibility: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlVgpuPgpuCompatibility_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuPgpuCompatibility_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuPgpuCompatibility") self._owner = None @@ -12952,7 +12981,7 @@ cdef class VgpuPgpuCompatibility: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.VgpuPgpuCompatibility object at {hex(id(self))}>" @@ -12973,20 +13002,20 @@ cdef class VgpuPgpuCompatibility: if not isinstance(other, VgpuPgpuCompatibility): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuPgpuCompatibility_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuPgpuCompatibility_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuPgpuCompatibility_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuPgpuCompatibility_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlVgpuPgpuCompatibility_t)) + self._ptr = _cyb_malloc(sizeof(nvmlVgpuPgpuCompatibility_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuPgpuCompatibility") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuPgpuCompatibility_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuPgpuCompatibility_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -13018,7 +13047,7 @@ cdef class VgpuPgpuCompatibility: @staticmethod def from_buffer(buffer): """Create an VgpuPgpuCompatibility instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlVgpuPgpuCompatibility_t), VgpuPgpuCompatibility) + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuPgpuCompatibility_t), VgpuPgpuCompatibility) @staticmethod def from_data(data): @@ -13027,7 +13056,7 @@ cdef class VgpuPgpuCompatibility: Args: data (_numpy.ndarray): a single-element array of dtype `vgpu_pgpu_compatibility_dtype` holding the data. """ - return __from_data(data, "vgpu_pgpu_compatibility_dtype", vgpu_pgpu_compatibility_dtype, VgpuPgpuCompatibility) + return _cyb_from_data(data, "vgpu_pgpu_compatibility_dtype", vgpu_pgpu_compatibility_dtype, VgpuPgpuCompatibility) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -13042,10 +13071,10 @@ cdef class VgpuPgpuCompatibility: raise ValueError("ptr must not be null (0)") cdef VgpuPgpuCompatibility obj = VgpuPgpuCompatibility.__new__(VgpuPgpuCompatibility) if owner is None: - obj._ptr = malloc(sizeof(nvmlVgpuPgpuCompatibility_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuPgpuCompatibility_t)) if obj._ptr == NULL: raise MemoryError("Error allocating VgpuPgpuCompatibility") - memcpy((obj._ptr), ptr, sizeof(nvmlVgpuPgpuCompatibility_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuPgpuCompatibility_t)) obj._owner = None obj._owned = True else: @@ -13057,7 +13086,7 @@ cdef class VgpuPgpuCompatibility: cdef _get_gpu_instance_placement_dtype_offsets(): - cdef nvmlGpuInstancePlacement_t pod = nvmlGpuInstancePlacement_t() + cdef nvmlGpuInstancePlacement_t pod return _numpy.dtype({ 'names': ['start', 'size_'], 'formats': [_numpy.uint32, _numpy.uint32], @@ -13072,21 +13101,17 @@ gpu_instance_placement_dtype = _get_gpu_instance_placement_dtype_offsets() cdef class GpuInstancePlacement: """Empty-initialize an array of `nvmlGpuInstancePlacement_t`. - The resulting object is of length `size` and of dtype `gpu_instance_placement_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlGpuInstancePlacement_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=gpu_instance_placement_dtype) self._data = arr.view(_numpy.recarray) @@ -13123,10 +13148,10 @@ cdef class GpuInstancePlacement: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def start(self): @@ -13204,8 +13229,8 @@ cdef class GpuInstancePlacement: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef GpuInstancePlacement obj = GpuInstancePlacement.__new__(GpuInstancePlacement) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(nvmlGpuInstancePlacement_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=gpu_instance_placement_dtype) obj._data = data.view(_numpy.recarray) @@ -13214,7 +13239,7 @@ cdef class GpuInstancePlacement: cdef _get_gpu_instance_profile_info_v3_dtype_offsets(): - cdef nvmlGpuInstanceProfileInfo_v3_t pod = nvmlGpuInstanceProfileInfo_v3_t() + cdef nvmlGpuInstanceProfileInfo_v3_t pod return _numpy.dtype({ 'names': ['version', 'id', 'slice_count', 'instance_count', 'multiprocessor_count', 'copy_engine_count', 'decoder_count', 'encoder_count', 'jpeg_count', 'ofa_count', 'memory_size_mb', 'name', 'capabilities'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint64, (_numpy.int8, 96), _numpy.uint32], @@ -13251,7 +13276,7 @@ cdef class GpuInstanceProfileInfo_v3: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlGpuInstanceProfileInfo_v3_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlGpuInstanceProfileInfo_v3_t)) if self._ptr == NULL: raise MemoryError("Error allocating GpuInstanceProfileInfo_v3") self._owner = None @@ -13263,7 +13288,7 @@ cdef class GpuInstanceProfileInfo_v3: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.GpuInstanceProfileInfo_v3 object at {hex(id(self))}>" @@ -13284,20 +13309,20 @@ cdef class GpuInstanceProfileInfo_v3: if not isinstance(other, GpuInstanceProfileInfo_v3): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuInstanceProfileInfo_v3_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuInstanceProfileInfo_v3_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlGpuInstanceProfileInfo_v3_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlGpuInstanceProfileInfo_v3_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlGpuInstanceProfileInfo_v3_t)) + self._ptr = _cyb_malloc(sizeof(nvmlGpuInstanceProfileInfo_v3_t)) if self._ptr == NULL: raise MemoryError("Error allocating GpuInstanceProfileInfo_v3") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuInstanceProfileInfo_v3_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuInstanceProfileInfo_v3_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -13428,7 +13453,7 @@ cdef class GpuInstanceProfileInfo_v3: @property def name(self): """~_numpy.int8: (array of length 96).""" - return cpython.PyUnicode_FromString(self._ptr[0].name) + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].name) @name.setter def name(self, val): @@ -13438,7 +13463,7 @@ cdef class GpuInstanceProfileInfo_v3: if len(buf) >= 96: raise ValueError("String too long for field name, max length is 95") cdef char *ptr = buf - memcpy((self._ptr[0].name), ptr, 96) + _cyb_memcpy((self._ptr[0].name), ptr, 96) @property def capabilities(self): @@ -13454,7 +13479,7 @@ cdef class GpuInstanceProfileInfo_v3: @staticmethod def from_buffer(buffer): """Create an GpuInstanceProfileInfo_v3 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlGpuInstanceProfileInfo_v3_t), GpuInstanceProfileInfo_v3) + return _cyb_from_buffer(buffer, sizeof(nvmlGpuInstanceProfileInfo_v3_t), GpuInstanceProfileInfo_v3) @staticmethod def from_data(data): @@ -13463,7 +13488,7 @@ cdef class GpuInstanceProfileInfo_v3: Args: data (_numpy.ndarray): a single-element array of dtype `gpu_instance_profile_info_v3_dtype` holding the data. """ - return __from_data(data, "gpu_instance_profile_info_v3_dtype", gpu_instance_profile_info_v3_dtype, GpuInstanceProfileInfo_v3) + return _cyb_from_data(data, "gpu_instance_profile_info_v3_dtype", gpu_instance_profile_info_v3_dtype, GpuInstanceProfileInfo_v3) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -13478,10 +13503,10 @@ cdef class GpuInstanceProfileInfo_v3: raise ValueError("ptr must not be null (0)") cdef GpuInstanceProfileInfo_v3 obj = GpuInstanceProfileInfo_v3.__new__(GpuInstanceProfileInfo_v3) if owner is None: - obj._ptr = malloc(sizeof(nvmlGpuInstanceProfileInfo_v3_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlGpuInstanceProfileInfo_v3_t)) if obj._ptr == NULL: raise MemoryError("Error allocating GpuInstanceProfileInfo_v3") - memcpy((obj._ptr), ptr, sizeof(nvmlGpuInstanceProfileInfo_v3_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGpuInstanceProfileInfo_v3_t)) obj._owner = None obj._owned = True else: @@ -13493,7 +13518,7 @@ cdef class GpuInstanceProfileInfo_v3: cdef _get_compute_instance_placement_dtype_offsets(): - cdef nvmlComputeInstancePlacement_t pod = nvmlComputeInstancePlacement_t() + cdef nvmlComputeInstancePlacement_t pod return _numpy.dtype({ 'names': ['start', 'size_'], 'formats': [_numpy.uint32, _numpy.uint32], @@ -13508,21 +13533,17 @@ compute_instance_placement_dtype = _get_compute_instance_placement_dtype_offsets cdef class ComputeInstancePlacement: """Empty-initialize an array of `nvmlComputeInstancePlacement_t`. - The resulting object is of length `size` and of dtype `compute_instance_placement_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlComputeInstancePlacement_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=compute_instance_placement_dtype) self._data = arr.view(_numpy.recarray) @@ -13559,10 +13580,10 @@ cdef class ComputeInstancePlacement: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def start(self): @@ -13640,8 +13661,8 @@ cdef class ComputeInstancePlacement: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef ComputeInstancePlacement obj = ComputeInstancePlacement.__new__(ComputeInstancePlacement) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(nvmlComputeInstancePlacement_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=compute_instance_placement_dtype) obj._data = data.view(_numpy.recarray) @@ -13650,7 +13671,7 @@ cdef class ComputeInstancePlacement: cdef _get_compute_instance_profile_info_v2_dtype_offsets(): - cdef nvmlComputeInstanceProfileInfo_v2_t pod = nvmlComputeInstanceProfileInfo_v2_t() + cdef nvmlComputeInstanceProfileInfo_v2_t pod return _numpy.dtype({ 'names': ['version', 'id', 'slice_count', 'instance_count', 'multiprocessor_count', 'shared_copy_engine_count', 'shared_decoder_count', 'shared_encoder_count', 'shared_jpeg_count', 'shared_ofa_count', 'name'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.int8, 96)], @@ -13685,7 +13706,7 @@ cdef class ComputeInstanceProfileInfo_v2: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlComputeInstanceProfileInfo_v2_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlComputeInstanceProfileInfo_v2_t)) if self._ptr == NULL: raise MemoryError("Error allocating ComputeInstanceProfileInfo_v2") self._owner = None @@ -13697,7 +13718,7 @@ cdef class ComputeInstanceProfileInfo_v2: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.ComputeInstanceProfileInfo_v2 object at {hex(id(self))}>" @@ -13718,20 +13739,20 @@ cdef class ComputeInstanceProfileInfo_v2: if not isinstance(other, ComputeInstanceProfileInfo_v2): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlComputeInstanceProfileInfo_v2_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlComputeInstanceProfileInfo_v2_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlComputeInstanceProfileInfo_v2_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlComputeInstanceProfileInfo_v2_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlComputeInstanceProfileInfo_v2_t)) + self._ptr = _cyb_malloc(sizeof(nvmlComputeInstanceProfileInfo_v2_t)) if self._ptr == NULL: raise MemoryError("Error allocating ComputeInstanceProfileInfo_v2") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlComputeInstanceProfileInfo_v2_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlComputeInstanceProfileInfo_v2_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -13851,7 +13872,7 @@ cdef class ComputeInstanceProfileInfo_v2: @property def name(self): """~_numpy.int8: (array of length 96).""" - return cpython.PyUnicode_FromString(self._ptr[0].name) + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].name) @name.setter def name(self, val): @@ -13861,12 +13882,12 @@ cdef class ComputeInstanceProfileInfo_v2: if len(buf) >= 96: raise ValueError("String too long for field name, max length is 95") cdef char *ptr = buf - memcpy((self._ptr[0].name), ptr, 96) + _cyb_memcpy((self._ptr[0].name), ptr, 96) @staticmethod def from_buffer(buffer): """Create an ComputeInstanceProfileInfo_v2 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlComputeInstanceProfileInfo_v2_t), ComputeInstanceProfileInfo_v2) + return _cyb_from_buffer(buffer, sizeof(nvmlComputeInstanceProfileInfo_v2_t), ComputeInstanceProfileInfo_v2) @staticmethod def from_data(data): @@ -13875,7 +13896,7 @@ cdef class ComputeInstanceProfileInfo_v2: Args: data (_numpy.ndarray): a single-element array of dtype `compute_instance_profile_info_v2_dtype` holding the data. """ - return __from_data(data, "compute_instance_profile_info_v2_dtype", compute_instance_profile_info_v2_dtype, ComputeInstanceProfileInfo_v2) + return _cyb_from_data(data, "compute_instance_profile_info_v2_dtype", compute_instance_profile_info_v2_dtype, ComputeInstanceProfileInfo_v2) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -13890,10 +13911,10 @@ cdef class ComputeInstanceProfileInfo_v2: raise ValueError("ptr must not be null (0)") cdef ComputeInstanceProfileInfo_v2 obj = ComputeInstanceProfileInfo_v2.__new__(ComputeInstanceProfileInfo_v2) if owner is None: - obj._ptr = malloc(sizeof(nvmlComputeInstanceProfileInfo_v2_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlComputeInstanceProfileInfo_v2_t)) if obj._ptr == NULL: raise MemoryError("Error allocating ComputeInstanceProfileInfo_v2") - memcpy((obj._ptr), ptr, sizeof(nvmlComputeInstanceProfileInfo_v2_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlComputeInstanceProfileInfo_v2_t)) obj._owner = None obj._owned = True else: @@ -13905,7 +13926,7 @@ cdef class ComputeInstanceProfileInfo_v2: cdef _get_compute_instance_profile_info_v3_dtype_offsets(): - cdef nvmlComputeInstanceProfileInfo_v3_t pod = nvmlComputeInstanceProfileInfo_v3_t() + cdef nvmlComputeInstanceProfileInfo_v3_t pod return _numpy.dtype({ 'names': ['version', 'id', 'slice_count', 'instance_count', 'multiprocessor_count', 'shared_copy_engine_count', 'shared_decoder_count', 'shared_encoder_count', 'shared_jpeg_count', 'shared_ofa_count', 'name', 'capabilities'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (_numpy.int8, 96), _numpy.uint32], @@ -13941,7 +13962,7 @@ cdef class ComputeInstanceProfileInfo_v3: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlComputeInstanceProfileInfo_v3_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlComputeInstanceProfileInfo_v3_t)) if self._ptr == NULL: raise MemoryError("Error allocating ComputeInstanceProfileInfo_v3") self._owner = None @@ -13953,7 +13974,7 @@ cdef class ComputeInstanceProfileInfo_v3: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.ComputeInstanceProfileInfo_v3 object at {hex(id(self))}>" @@ -13974,20 +13995,20 @@ cdef class ComputeInstanceProfileInfo_v3: if not isinstance(other, ComputeInstanceProfileInfo_v3): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlComputeInstanceProfileInfo_v3_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlComputeInstanceProfileInfo_v3_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlComputeInstanceProfileInfo_v3_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlComputeInstanceProfileInfo_v3_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlComputeInstanceProfileInfo_v3_t)) + self._ptr = _cyb_malloc(sizeof(nvmlComputeInstanceProfileInfo_v3_t)) if self._ptr == NULL: raise MemoryError("Error allocating ComputeInstanceProfileInfo_v3") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlComputeInstanceProfileInfo_v3_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlComputeInstanceProfileInfo_v3_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -14107,7 +14128,7 @@ cdef class ComputeInstanceProfileInfo_v3: @property def name(self): """~_numpy.int8: (array of length 96).""" - return cpython.PyUnicode_FromString(self._ptr[0].name) + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].name) @name.setter def name(self, val): @@ -14117,7 +14138,7 @@ cdef class ComputeInstanceProfileInfo_v3: if len(buf) >= 96: raise ValueError("String too long for field name, max length is 95") cdef char *ptr = buf - memcpy((self._ptr[0].name), ptr, 96) + _cyb_memcpy((self._ptr[0].name), ptr, 96) @property def capabilities(self): @@ -14133,7 +14154,7 @@ cdef class ComputeInstanceProfileInfo_v3: @staticmethod def from_buffer(buffer): """Create an ComputeInstanceProfileInfo_v3 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlComputeInstanceProfileInfo_v3_t), ComputeInstanceProfileInfo_v3) + return _cyb_from_buffer(buffer, sizeof(nvmlComputeInstanceProfileInfo_v3_t), ComputeInstanceProfileInfo_v3) @staticmethod def from_data(data): @@ -14142,7 +14163,7 @@ cdef class ComputeInstanceProfileInfo_v3: Args: data (_numpy.ndarray): a single-element array of dtype `compute_instance_profile_info_v3_dtype` holding the data. """ - return __from_data(data, "compute_instance_profile_info_v3_dtype", compute_instance_profile_info_v3_dtype, ComputeInstanceProfileInfo_v3) + return _cyb_from_data(data, "compute_instance_profile_info_v3_dtype", compute_instance_profile_info_v3_dtype, ComputeInstanceProfileInfo_v3) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -14157,10 +14178,10 @@ cdef class ComputeInstanceProfileInfo_v3: raise ValueError("ptr must not be null (0)") cdef ComputeInstanceProfileInfo_v3 obj = ComputeInstanceProfileInfo_v3.__new__(ComputeInstanceProfileInfo_v3) if owner is None: - obj._ptr = malloc(sizeof(nvmlComputeInstanceProfileInfo_v3_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlComputeInstanceProfileInfo_v3_t)) if obj._ptr == NULL: raise MemoryError("Error allocating ComputeInstanceProfileInfo_v3") - memcpy((obj._ptr), ptr, sizeof(nvmlComputeInstanceProfileInfo_v3_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlComputeInstanceProfileInfo_v3_t)) obj._owner = None obj._owned = True else: @@ -14172,7 +14193,7 @@ cdef class ComputeInstanceProfileInfo_v3: cdef _get_device_addressing_mode_v1_dtype_offsets(): - cdef nvmlDeviceAddressingMode_v1_t pod = nvmlDeviceAddressingMode_v1_t() + cdef nvmlDeviceAddressingMode_v1_t pod return _numpy.dtype({ 'names': ['version', 'value'], 'formats': [_numpy.uint32, _numpy.uint32], @@ -14198,7 +14219,7 @@ cdef class DeviceAddressingMode_v1: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlDeviceAddressingMode_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlDeviceAddressingMode_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating DeviceAddressingMode_v1") self._owner = None @@ -14210,7 +14231,7 @@ cdef class DeviceAddressingMode_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.DeviceAddressingMode_v1 object at {hex(id(self))}>" @@ -14231,20 +14252,20 @@ cdef class DeviceAddressingMode_v1: if not isinstance(other, DeviceAddressingMode_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlDeviceAddressingMode_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlDeviceAddressingMode_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlDeviceAddressingMode_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlDeviceAddressingMode_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlDeviceAddressingMode_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlDeviceAddressingMode_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating DeviceAddressingMode_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlDeviceAddressingMode_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlDeviceAddressingMode_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -14276,7 +14297,7 @@ cdef class DeviceAddressingMode_v1: @staticmethod def from_buffer(buffer): """Create an DeviceAddressingMode_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlDeviceAddressingMode_v1_t), DeviceAddressingMode_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlDeviceAddressingMode_v1_t), DeviceAddressingMode_v1) @staticmethod def from_data(data): @@ -14285,7 +14306,7 @@ cdef class DeviceAddressingMode_v1: Args: data (_numpy.ndarray): a single-element array of dtype `device_addressing_mode_v1_dtype` holding the data. """ - return __from_data(data, "device_addressing_mode_v1_dtype", device_addressing_mode_v1_dtype, DeviceAddressingMode_v1) + return _cyb_from_data(data, "device_addressing_mode_v1_dtype", device_addressing_mode_v1_dtype, DeviceAddressingMode_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -14300,10 +14321,10 @@ cdef class DeviceAddressingMode_v1: raise ValueError("ptr must not be null (0)") cdef DeviceAddressingMode_v1 obj = DeviceAddressingMode_v1.__new__(DeviceAddressingMode_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlDeviceAddressingMode_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlDeviceAddressingMode_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating DeviceAddressingMode_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlDeviceAddressingMode_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlDeviceAddressingMode_v1_t)) obj._owner = None obj._owned = True else: @@ -14315,7 +14336,7 @@ cdef class DeviceAddressingMode_v1: cdef _get_repair_status_v1_dtype_offsets(): - cdef nvmlRepairStatus_v1_t pod = nvmlRepairStatus_v1_t() + cdef nvmlRepairStatus_v1_t pod return _numpy.dtype({ 'names': ['version', 'b_channel_repair_pending', 'b_tpc_repair_pending'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], @@ -14342,7 +14363,7 @@ cdef class RepairStatus_v1: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlRepairStatus_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlRepairStatus_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating RepairStatus_v1") self._owner = None @@ -14354,7 +14375,7 @@ cdef class RepairStatus_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.RepairStatus_v1 object at {hex(id(self))}>" @@ -14375,20 +14396,20 @@ cdef class RepairStatus_v1: if not isinstance(other, RepairStatus_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlRepairStatus_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlRepairStatus_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlRepairStatus_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlRepairStatus_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlRepairStatus_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlRepairStatus_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating RepairStatus_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlRepairStatus_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlRepairStatus_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -14431,7 +14452,7 @@ cdef class RepairStatus_v1: @staticmethod def from_buffer(buffer): """Create an RepairStatus_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlRepairStatus_v1_t), RepairStatus_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlRepairStatus_v1_t), RepairStatus_v1) @staticmethod def from_data(data): @@ -14440,7 +14461,7 @@ cdef class RepairStatus_v1: Args: data (_numpy.ndarray): a single-element array of dtype `repair_status_v1_dtype` holding the data. """ - return __from_data(data, "repair_status_v1_dtype", repair_status_v1_dtype, RepairStatus_v1) + return _cyb_from_data(data, "repair_status_v1_dtype", repair_status_v1_dtype, RepairStatus_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -14455,10 +14476,10 @@ cdef class RepairStatus_v1: raise ValueError("ptr must not be null (0)") cdef RepairStatus_v1 obj = RepairStatus_v1.__new__(RepairStatus_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlRepairStatus_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlRepairStatus_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating RepairStatus_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlRepairStatus_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlRepairStatus_v1_t)) obj._owner = None obj._owned = True else: @@ -14470,7 +14491,7 @@ cdef class RepairStatus_v1: cdef _get_device_power_mizer_modes_v1_dtype_offsets(): - cdef nvmlDevicePowerMizerModes_v1_t pod = nvmlDevicePowerMizerModes_v1_t() + cdef nvmlDevicePowerMizerModes_v1_t pod return _numpy.dtype({ 'names': ['current_mode', 'mode', 'supported_power_mizer_modes'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], @@ -14497,7 +14518,7 @@ cdef class DevicePowerMizerModes_v1: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlDevicePowerMizerModes_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlDevicePowerMizerModes_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating DevicePowerMizerModes_v1") self._owner = None @@ -14509,7 +14530,7 @@ cdef class DevicePowerMizerModes_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.DevicePowerMizerModes_v1 object at {hex(id(self))}>" @@ -14530,20 +14551,20 @@ cdef class DevicePowerMizerModes_v1: if not isinstance(other, DevicePowerMizerModes_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlDevicePowerMizerModes_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlDevicePowerMizerModes_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlDevicePowerMizerModes_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlDevicePowerMizerModes_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlDevicePowerMizerModes_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlDevicePowerMizerModes_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating DevicePowerMizerModes_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlDevicePowerMizerModes_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlDevicePowerMizerModes_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -14586,7 +14607,7 @@ cdef class DevicePowerMizerModes_v1: @staticmethod def from_buffer(buffer): """Create an DevicePowerMizerModes_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlDevicePowerMizerModes_v1_t), DevicePowerMizerModes_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlDevicePowerMizerModes_v1_t), DevicePowerMizerModes_v1) @staticmethod def from_data(data): @@ -14595,7 +14616,7 @@ cdef class DevicePowerMizerModes_v1: Args: data (_numpy.ndarray): a single-element array of dtype `device_power_mizer_modes_v1_dtype` holding the data. """ - return __from_data(data, "device_power_mizer_modes_v1_dtype", device_power_mizer_modes_v1_dtype, DevicePowerMizerModes_v1) + return _cyb_from_data(data, "device_power_mizer_modes_v1_dtype", device_power_mizer_modes_v1_dtype, DevicePowerMizerModes_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -14610,10 +14631,10 @@ cdef class DevicePowerMizerModes_v1: raise ValueError("ptr must not be null (0)") cdef DevicePowerMizerModes_v1 obj = DevicePowerMizerModes_v1.__new__(DevicePowerMizerModes_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlDevicePowerMizerModes_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlDevicePowerMizerModes_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating DevicePowerMizerModes_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlDevicePowerMizerModes_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlDevicePowerMizerModes_v1_t)) obj._owner = None obj._owned = True else: @@ -14625,7 +14646,7 @@ cdef class DevicePowerMizerModes_v1: cdef _get_ecc_sram_unique_uncorrected_error_entry_v1_dtype_offsets(): - cdef nvmlEccSramUniqueUncorrectedErrorEntry_v1_t pod = nvmlEccSramUniqueUncorrectedErrorEntry_v1_t() + cdef nvmlEccSramUniqueUncorrectedErrorEntry_v1_t pod return _numpy.dtype({ 'names': ['unit', 'location', 'sublocation', 'extlocation', 'address', 'is_parity', 'count'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], @@ -14645,21 +14666,17 @@ ecc_sram_unique_uncorrected_error_entry_v1_dtype = _get_ecc_sram_unique_uncorrec cdef class EccSramUniqueUncorrectedErrorEntry_v1: """Empty-initialize an array of `nvmlEccSramUniqueUncorrectedErrorEntry_v1_t`. - The resulting object is of length `size` and of dtype `ecc_sram_unique_uncorrected_error_entry_v1_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlEccSramUniqueUncorrectedErrorEntry_v1_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=ecc_sram_unique_uncorrected_error_entry_v1_dtype) self._data = arr.view(_numpy.recarray) @@ -14696,10 +14713,10 @@ cdef class EccSramUniqueUncorrectedErrorEntry_v1: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def unit(self): @@ -14832,8 +14849,8 @@ cdef class EccSramUniqueUncorrectedErrorEntry_v1: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef EccSramUniqueUncorrectedErrorEntry_v1 obj = EccSramUniqueUncorrectedErrorEntry_v1.__new__(EccSramUniqueUncorrectedErrorEntry_v1) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(nvmlEccSramUniqueUncorrectedErrorEntry_v1_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=ecc_sram_unique_uncorrected_error_entry_v1_dtype) obj._data = data.view(_numpy.recarray) @@ -14842,7 +14859,7 @@ cdef class EccSramUniqueUncorrectedErrorEntry_v1: cdef _get_gpu_fabric_info_v3_dtype_offsets(): - cdef nvmlGpuFabricInfo_v3_t pod = nvmlGpuFabricInfo_v3_t() + cdef nvmlGpuFabricInfo_v3_t pod return _numpy.dtype({ 'names': ['version', 'cluster_uuid', 'status', 'clique_id', 'state', 'health_mask', 'health_summary'], 'formats': [_numpy.uint32, (_numpy.uint8, 16), _numpy.int32, _numpy.uint32, _numpy.uint8, _numpy.uint32, _numpy.uint8], @@ -14873,7 +14890,7 @@ cdef class GpuFabricInfo_v3: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlGpuFabricInfo_v3_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlGpuFabricInfo_v3_t)) if self._ptr == NULL: raise MemoryError("Error allocating GpuFabricInfo_v3") self._owner = None @@ -14885,7 +14902,7 @@ cdef class GpuFabricInfo_v3: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.GpuFabricInfo_v3 object at {hex(id(self))}>" @@ -14906,20 +14923,20 @@ cdef class GpuFabricInfo_v3: if not isinstance(other, GpuFabricInfo_v3): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuFabricInfo_v3_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuFabricInfo_v3_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlGpuFabricInfo_v3_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlGpuFabricInfo_v3_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlGpuFabricInfo_v3_t)) + self._ptr = _cyb_malloc(sizeof(nvmlGpuFabricInfo_v3_t)) if self._ptr == NULL: raise MemoryError("Error allocating GpuFabricInfo_v3") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuFabricInfo_v3_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuFabricInfo_v3_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -14928,7 +14945,7 @@ cdef class GpuFabricInfo_v3: @property def version(self): - """int: Structure version identifier (set to nvmlGpuFabricInfo_v2)""" + """int: Structure version identifier (set to nvmlGpuFabricInfo_v2).""" return self._ptr[0].version @version.setter @@ -14940,7 +14957,7 @@ cdef class GpuFabricInfo_v3: @property def cluster_uuid(self): """~_numpy.uint8: (array of length 16).Uuid of the cluster to which this GPU belongs.""" - cdef view.array arr = view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) + cdef _cyb_view.array arr = _cyb_view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) arr.data = (&(self._ptr[0].clusterUuid)) return _numpy.asarray(arr) @@ -14950,9 +14967,9 @@ cdef class GpuFabricInfo_v3: raise ValueError("This GpuFabricInfo_v3 instance is read-only") if len(val) != 16: raise ValueError(f"Expected length { 16 } for field cluster_uuid, got {len(val)}") - cdef view.array arr = view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c") + cdef _cyb_view.array arr = _cyb_view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c") arr[:] = _numpy.asarray(val, dtype=_numpy.uint8) - memcpy((&(self._ptr[0].clusterUuid)), (arr.data), sizeof(unsigned char) * len(val)) + _cyb_memcpy((&(self._ptr[0].clusterUuid)), (arr.data), sizeof(unsigned char) * len(val)) @property def status(self): @@ -15012,7 +15029,7 @@ cdef class GpuFabricInfo_v3: @staticmethod def from_buffer(buffer): """Create an GpuFabricInfo_v3 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlGpuFabricInfo_v3_t), GpuFabricInfo_v3) + return _cyb_from_buffer(buffer, sizeof(nvmlGpuFabricInfo_v3_t), GpuFabricInfo_v3) @staticmethod def from_data(data): @@ -15021,7 +15038,7 @@ cdef class GpuFabricInfo_v3: Args: data (_numpy.ndarray): a single-element array of dtype `gpu_fabric_info_v3_dtype` holding the data. """ - return __from_data(data, "gpu_fabric_info_v3_dtype", gpu_fabric_info_v3_dtype, GpuFabricInfo_v3) + return _cyb_from_data(data, "gpu_fabric_info_v3_dtype", gpu_fabric_info_v3_dtype, GpuFabricInfo_v3) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -15036,10 +15053,10 @@ cdef class GpuFabricInfo_v3: raise ValueError("ptr must not be null (0)") cdef GpuFabricInfo_v3 obj = GpuFabricInfo_v3.__new__(GpuFabricInfo_v3) if owner is None: - obj._ptr = malloc(sizeof(nvmlGpuFabricInfo_v3_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlGpuFabricInfo_v3_t)) if obj._ptr == NULL: raise MemoryError("Error allocating GpuFabricInfo_v3") - memcpy((obj._ptr), ptr, sizeof(nvmlGpuFabricInfo_v3_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGpuFabricInfo_v3_t)) obj._owner = None obj._owned = True else: @@ -15051,7 +15068,7 @@ cdef class GpuFabricInfo_v3: cdef _get_nv_link_info_v1_dtype_offsets(): - cdef nvmlNvLinkInfo_v1_t pod = nvmlNvLinkInfo_v1_t() + cdef nvmlNvLinkInfo_v1_t pod return _numpy.dtype({ 'names': ['version', 'is_nvle_enabled'], 'formats': [_numpy.uint32, _numpy.uint32], @@ -15077,7 +15094,7 @@ cdef class NvLinkInfo_v1: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlNvLinkInfo_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlNvLinkInfo_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating NvLinkInfo_v1") self._owner = None @@ -15089,7 +15106,7 @@ cdef class NvLinkInfo_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.NvLinkInfo_v1 object at {hex(id(self))}>" @@ -15110,20 +15127,20 @@ cdef class NvLinkInfo_v1: if not isinstance(other, NvLinkInfo_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvLinkInfo_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvLinkInfo_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlNvLinkInfo_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlNvLinkInfo_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlNvLinkInfo_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlNvLinkInfo_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating NvLinkInfo_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvLinkInfo_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvLinkInfo_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -15155,7 +15172,7 @@ cdef class NvLinkInfo_v1: @staticmethod def from_buffer(buffer): """Create an NvLinkInfo_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlNvLinkInfo_v1_t), NvLinkInfo_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlNvLinkInfo_v1_t), NvLinkInfo_v1) @staticmethod def from_data(data): @@ -15164,7 +15181,7 @@ cdef class NvLinkInfo_v1: Args: data (_numpy.ndarray): a single-element array of dtype `nv_link_info_v1_dtype` holding the data. """ - return __from_data(data, "nv_link_info_v1_dtype", nv_link_info_v1_dtype, NvLinkInfo_v1) + return _cyb_from_data(data, "nv_link_info_v1_dtype", nv_link_info_v1_dtype, NvLinkInfo_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -15179,10 +15196,10 @@ cdef class NvLinkInfo_v1: raise ValueError("ptr must not be null (0)") cdef NvLinkInfo_v1 obj = NvLinkInfo_v1.__new__(NvLinkInfo_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlNvLinkInfo_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlNvLinkInfo_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating NvLinkInfo_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlNvLinkInfo_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlNvLinkInfo_v1_t)) obj._owner = None obj._owned = True else: @@ -15194,7 +15211,7 @@ cdef class NvLinkInfo_v1: cdef _get_nvlink_firmware_version_dtype_offsets(): - cdef nvmlNvlinkFirmwareVersion_t pod = nvmlNvlinkFirmwareVersion_t() + cdef nvmlNvlinkFirmwareVersion_t pod return _numpy.dtype({ 'names': ['ucode_type', 'major', 'minor', 'sub_minor'], 'formats': [_numpy.uint8, _numpy.uint32, _numpy.uint32, _numpy.uint32], @@ -15222,7 +15239,7 @@ cdef class NvlinkFirmwareVersion: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlNvlinkFirmwareVersion_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlNvlinkFirmwareVersion_t)) if self._ptr == NULL: raise MemoryError("Error allocating NvlinkFirmwareVersion") self._owner = None @@ -15234,7 +15251,7 @@ cdef class NvlinkFirmwareVersion: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.NvlinkFirmwareVersion object at {hex(id(self))}>" @@ -15255,20 +15272,20 @@ cdef class NvlinkFirmwareVersion: if not isinstance(other, NvlinkFirmwareVersion): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvlinkFirmwareVersion_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvlinkFirmwareVersion_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlNvlinkFirmwareVersion_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlNvlinkFirmwareVersion_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlNvlinkFirmwareVersion_t)) + self._ptr = _cyb_malloc(sizeof(nvmlNvlinkFirmwareVersion_t)) if self._ptr == NULL: raise MemoryError("Error allocating NvlinkFirmwareVersion") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvlinkFirmwareVersion_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvlinkFirmwareVersion_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -15322,7 +15339,7 @@ cdef class NvlinkFirmwareVersion: @staticmethod def from_buffer(buffer): """Create an NvlinkFirmwareVersion instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlNvlinkFirmwareVersion_t), NvlinkFirmwareVersion) + return _cyb_from_buffer(buffer, sizeof(nvmlNvlinkFirmwareVersion_t), NvlinkFirmwareVersion) @staticmethod def from_data(data): @@ -15331,7 +15348,7 @@ cdef class NvlinkFirmwareVersion: Args: data (_numpy.ndarray): a single-element array of dtype `nvlink_firmware_version_dtype` holding the data. """ - return __from_data(data, "nvlink_firmware_version_dtype", nvlink_firmware_version_dtype, NvlinkFirmwareVersion) + return _cyb_from_data(data, "nvlink_firmware_version_dtype", nvlink_firmware_version_dtype, NvlinkFirmwareVersion) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -15346,10 +15363,10 @@ cdef class NvlinkFirmwareVersion: raise ValueError("ptr must not be null (0)") cdef NvlinkFirmwareVersion obj = NvlinkFirmwareVersion.__new__(NvlinkFirmwareVersion) if owner is None: - obj._ptr = malloc(sizeof(nvmlNvlinkFirmwareVersion_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlNvlinkFirmwareVersion_t)) if obj._ptr == NULL: raise MemoryError("Error allocating NvlinkFirmwareVersion") - memcpy((obj._ptr), ptr, sizeof(nvmlNvlinkFirmwareVersion_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlNvlinkFirmwareVersion_t)) obj._owner = None obj._owned = True else: @@ -15361,7 +15378,7 @@ cdef class NvlinkFirmwareVersion: cdef _get_prm_counter_input_v1_dtype_offsets(): - cdef nvmlPRMCounterInput_v1_t pod = nvmlPRMCounterInput_v1_t() + cdef nvmlPRMCounterInput_v1_t pod return _numpy.dtype({ 'names': ['local_port'], 'formats': [_numpy.uint32], @@ -15386,7 +15403,7 @@ cdef class PRMCounterInput_v1: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlPRMCounterInput_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlPRMCounterInput_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating PRMCounterInput_v1") self._owner = None @@ -15398,7 +15415,7 @@ cdef class PRMCounterInput_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.PRMCounterInput_v1 object at {hex(id(self))}>" @@ -15419,20 +15436,20 @@ cdef class PRMCounterInput_v1: if not isinstance(other, PRMCounterInput_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlPRMCounterInput_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlPRMCounterInput_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlPRMCounterInput_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlPRMCounterInput_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlPRMCounterInput_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlPRMCounterInput_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating PRMCounterInput_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlPRMCounterInput_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlPRMCounterInput_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -15453,7 +15470,7 @@ cdef class PRMCounterInput_v1: @staticmethod def from_buffer(buffer): """Create an PRMCounterInput_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlPRMCounterInput_v1_t), PRMCounterInput_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlPRMCounterInput_v1_t), PRMCounterInput_v1) @staticmethod def from_data(data): @@ -15462,7 +15479,7 @@ cdef class PRMCounterInput_v1: Args: data (_numpy.ndarray): a single-element array of dtype `prm_counter_input_v1_dtype` holding the data. """ - return __from_data(data, "prm_counter_input_v1_dtype", prm_counter_input_v1_dtype, PRMCounterInput_v1) + return _cyb_from_data(data, "prm_counter_input_v1_dtype", prm_counter_input_v1_dtype, PRMCounterInput_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -15477,10 +15494,10 @@ cdef class PRMCounterInput_v1: raise ValueError("ptr must not be null (0)") cdef PRMCounterInput_v1 obj = PRMCounterInput_v1.__new__(PRMCounterInput_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlPRMCounterInput_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlPRMCounterInput_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating PRMCounterInput_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlPRMCounterInput_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlPRMCounterInput_v1_t)) obj._owner = None obj._owned = True else: @@ -15491,49 +15508,51 @@ cdef class PRMCounterInput_v1: return obj -cdef _get_excluded_device_info_dtype_offsets(): - cdef nvmlExcludedDeviceInfo_t pod = nvmlExcludedDeviceInfo_t() +cdef _get_vgpu_scheduler_state_info_v2_dtype_offsets(): + cdef nvmlVgpuSchedulerStateInfo_v2_t pod return _numpy.dtype({ - 'names': ['pci_info', 'uuid'], - 'formats': [pci_info_dtype, (_numpy.int8, 80)], + 'names': ['engine_id', 'scheduler_policy', 'avg_factor', 'timeslice'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], 'offsets': [ - (&(pod.pciInfo)) - (&pod), - (&(pod.uuid)) - (&pod), + (&(pod.engineId)) - (&pod), + (&(pod.schedulerPolicy)) - (&pod), + (&(pod.avgFactor)) - (&pod), + (&(pod.timeslice)) - (&pod), ], - 'itemsize': sizeof(nvmlExcludedDeviceInfo_t), + 'itemsize': sizeof(nvmlVgpuSchedulerStateInfo_v2_t), }) -excluded_device_info_dtype = _get_excluded_device_info_dtype_offsets() +vgpu_scheduler_state_info_v2_dtype = _get_vgpu_scheduler_state_info_v2_dtype_offsets() -cdef class ExcludedDeviceInfo: - """Empty-initialize an instance of `nvmlExcludedDeviceInfo_t`. +cdef class VgpuSchedulerStateInfo_v2: + """Empty-initialize an instance of `nvmlVgpuSchedulerStateInfo_v2_t`. - .. seealso:: `nvmlExcludedDeviceInfo_t` + .. seealso:: `nvmlVgpuSchedulerStateInfo_v2_t` """ cdef: - nvmlExcludedDeviceInfo_t *_ptr + nvmlVgpuSchedulerStateInfo_v2_t *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlExcludedDeviceInfo_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerStateInfo_v2_t)) if self._ptr == NULL: - raise MemoryError("Error allocating ExcludedDeviceInfo") + raise MemoryError("Error allocating VgpuSchedulerStateInfo_v2") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlExcludedDeviceInfo_t *ptr + cdef nvmlVgpuSchedulerStateInfo_v2_t *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): - return f"<{__name__}.ExcludedDeviceInfo object at {hex(id(self))}>" + return f"<{__name__}.VgpuSchedulerStateInfo_v2 object at {hex(id(self))}>" @property def ptr(self): @@ -15547,24 +15566,24 @@ cdef class ExcludedDeviceInfo: return (self._ptr) def __eq__(self, other): - cdef ExcludedDeviceInfo other_ - if not isinstance(other, ExcludedDeviceInfo): + cdef VgpuSchedulerStateInfo_v2 other_ + if not isinstance(other, VgpuSchedulerStateInfo_v2): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlExcludedDeviceInfo_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerStateInfo_v2_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlExcludedDeviceInfo_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerStateInfo_v2_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlExcludedDeviceInfo_t)) + self._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerStateInfo_v2_t)) if self._ptr == NULL: - raise MemoryError("Error allocating ExcludedDeviceInfo") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlExcludedDeviceInfo_t)) + raise MemoryError("Error allocating VgpuSchedulerStateInfo_v2") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerStateInfo_v2_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -15572,21 +15591,566 @@ cdef class ExcludedDeviceInfo: setattr(self, key, val) @property - def pci_info(self): - """PciInfo: """ - return PciInfo.from_ptr(&(self._ptr[0].pciInfo), self._readonly, self) + def engine_id(self): + """int: IN: Engine whose software scheduler state info is fetched. One of NVML_VGPU_SCHEDULER_ENGINE_TYPE_*.""" + return self._ptr[0].engineId + + @engine_id.setter + def engine_id(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerStateInfo_v2 instance is read-only") + self._ptr[0].engineId = val + + @property + def scheduler_policy(self): + """int: OUT: Scheduler policy.""" + return self._ptr[0].schedulerPolicy + + @scheduler_policy.setter + def scheduler_policy(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerStateInfo_v2 instance is read-only") + self._ptr[0].schedulerPolicy = val + + @property + def avg_factor(self): + """int: OUT: Average factor in compensating the timeslice for Adaptive Round Robin mode. 0 when there is no active scheduling.""" + return self._ptr[0].avgFactor + + @avg_factor.setter + def avg_factor(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerStateInfo_v2 instance is read-only") + self._ptr[0].avgFactor = val + + @property + def timeslice(self): + """int: OUT: The timeslice in ns for each software run list as configured, or the default value otherwise. 0 when there is no active scheduling.""" + return self._ptr[0].timeslice + + @timeslice.setter + def timeslice(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerStateInfo_v2 instance is read-only") + self._ptr[0].timeslice = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuSchedulerStateInfo_v2 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerStateInfo_v2_t), VgpuSchedulerStateInfo_v2) + + @staticmethod + def from_data(data): + """Create an VgpuSchedulerStateInfo_v2 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_state_info_v2_dtype` holding the data. + """ + return _cyb_from_data(data, "vgpu_scheduler_state_info_v2_dtype", vgpu_scheduler_state_info_v2_dtype, VgpuSchedulerStateInfo_v2) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an VgpuSchedulerStateInfo_v2 instance wrapping the given pointer. + + Args: + ptr (intptr_t): pointer address as Python :class:`int` to the data. + owner (object): The Python object that owns the pointer. If not provided, data will be copied. + readonly (bool): whether the data is read-only (to the user). default is `False`. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef VgpuSchedulerStateInfo_v2 obj = VgpuSchedulerStateInfo_v2.__new__(VgpuSchedulerStateInfo_v2) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerStateInfo_v2_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerStateInfo_v2") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerStateInfo_v2_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_vgpu_scheduler_log_entry_v2_dtype_offsets(): + cdef nvmlVgpuSchedulerLogEntry_v2_t pod + return _numpy.dtype({ + 'names': ['timestamp', 'time_run_total', 'time_run', 'sw_runlist_id', 'target_time_slice', 'cumulative_preemption_time', 'weight'], + 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint32], + 'offsets': [ + (&(pod.timestamp)) - (&pod), + (&(pod.timeRunTotal)) - (&pod), + (&(pod.timeRun)) - (&pod), + (&(pod.swRunlistId)) - (&pod), + (&(pod.targetTimeSlice)) - (&pod), + (&(pod.cumulativePreemptionTime)) - (&pod), + (&(pod.weight)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerLogEntry_v2_t), + }) + +vgpu_scheduler_log_entry_v2_dtype = _get_vgpu_scheduler_log_entry_v2_dtype_offsets() + +cdef class VgpuSchedulerLogEntry_v2: + """Empty-initialize an array of `nvmlVgpuSchedulerLogEntry_v2_t`. + The resulting object is of length `size` and of dtype `vgpu_scheduler_log_entry_v2_dtype`. + If default-constructed, the instance represents a single struct. + + Args: + size (int): number of structs, default=1. + + .. seealso:: `nvmlVgpuSchedulerLogEntry_v2_t` + """ + cdef: + readonly object _data + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=vgpu_scheduler_log_entry_v2_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlVgpuSchedulerLogEntry_v2_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlVgpuSchedulerLogEntry_v2_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.VgpuSchedulerLogEntry_v2_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.VgpuSchedulerLogEntry_v2 object at {hex(id(self))}>" + + @property + def ptr(self): + """Get the pointer address to the data as Python :class:`int`.""" + return self._data.ctypes.data + + cdef intptr_t _get_ptr(self): + return self._data.ctypes.data + + def __int__(self): + if self._data.size > 1: + raise TypeError("int() argument must be a bytes-like object of size 1. " + "To get the pointer address of an array, use .ptr") + return self._data.ctypes.data + + def __len__(self): + return self._data.size + + def __eq__(self, other): + cdef object self_data = self._data + if (not isinstance(other, VgpuSchedulerLogEntry_v2)) or self_data.size != other._data.size or self_data.dtype != other._data.dtype: + return False + return bool((self_data == other._data).all()) + + def __getbuffer__(self, Py_buffer *buffer, int flags): + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) + + def __releasebuffer__(self, Py_buffer *buffer): + _cyb_cpython.PyBuffer_Release(buffer) + + @property + def timestamp(self): + """Union[~_numpy.uint64, int]: OUT: Timestamp in ns when this software runlist was preeempted.""" + if self._data.size == 1: + return int(self._data.timestamp[0]) + return self._data.timestamp + + @timestamp.setter + def timestamp(self, val): + self._data.timestamp = val + + @property + def time_run_total(self): + """Union[~_numpy.uint64, int]: OUT: Total time in ns this software runlist has run.""" + if self._data.size == 1: + return int(self._data.time_run_total[0]) + return self._data.time_run_total + + @time_run_total.setter + def time_run_total(self, val): + self._data.time_run_total = val + + @property + def time_run(self): + """Union[~_numpy.uint64, int]: OUT: Time in ns this software runlist ran before preemption.""" + if self._data.size == 1: + return int(self._data.time_run[0]) + return self._data.time_run + + @time_run.setter + def time_run(self, val): + self._data.time_run = val + + @property + def sw_runlist_id(self): + """Union[~_numpy.uint32, int]: OUT: Software runlist Id.""" + if self._data.size == 1: + return int(self._data.sw_runlist_id[0]) + return self._data.sw_runlist_id + + @sw_runlist_id.setter + def sw_runlist_id(self, val): + self._data.sw_runlist_id = val + + @property + def target_time_slice(self): + """Union[~_numpy.uint64, int]: OUT: The actual timeslice after deduction.""" + if self._data.size == 1: + return int(self._data.target_time_slice[0]) + return self._data.target_time_slice + + @target_time_slice.setter + def target_time_slice(self, val): + self._data.target_time_slice = val + + @property + def cumulative_preemption_time(self): + """Union[~_numpy.uint64, int]: OUT: Preemption time in ns for this SW runlist.""" + if self._data.size == 1: + return int(self._data.cumulative_preemption_time[0]) + return self._data.cumulative_preemption_time + + @cumulative_preemption_time.setter + def cumulative_preemption_time(self, val): + self._data.cumulative_preemption_time = val + + @property + def weight(self): + """Union[~_numpy.uint32, int]: OUT: Current weight of this SW runlist.""" + if self._data.size == 1: + return int(self._data.weight[0]) + return self._data.weight + + @weight.setter + def weight(self, val): + self._data.weight = val + + def __getitem__(self, key): + cdef ssize_t key_ + cdef ssize_t size + if isinstance(key, int): + key_ = key + size = self._data.size + if key_ >= size or key_ <= -(size+1): + raise IndexError("index is out of bounds") + if key_ < 0: + key_ += size + return VgpuSchedulerLogEntry_v2.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == vgpu_scheduler_log_entry_v2_dtype: + return VgpuSchedulerLogEntry_v2.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuSchedulerLogEntry_v2 instance with the memory from the given buffer.""" + return VgpuSchedulerLogEntry_v2.from_data(_numpy.frombuffer(buffer, dtype=vgpu_scheduler_log_entry_v2_dtype)) + + @staticmethod + def from_data(data): + """Create an VgpuSchedulerLogEntry_v2 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `vgpu_scheduler_log_entry_v2_dtype` holding the data. + """ + cdef VgpuSchedulerLogEntry_v2 obj = VgpuSchedulerLogEntry_v2.__new__(VgpuSchedulerLogEntry_v2) + if not isinstance(data, _numpy.ndarray): + raise TypeError("data argument must be a NumPy ndarray") + if data.ndim != 1: + raise ValueError("data array must be 1D") + if data.dtype != vgpu_scheduler_log_entry_v2_dtype: + raise ValueError("data array must be of dtype vgpu_scheduler_log_entry_v2_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): + """Create an VgpuSchedulerLogEntry_v2 instance wrapping the given pointer. + + Args: + ptr (intptr_t): pointer address as Python :class:`int` to the data. + size (int): number of structs, default=1. + readonly (bool): whether the data is read-only (to the user). default is `False`. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef VgpuSchedulerLogEntry_v2 obj = VgpuSchedulerLogEntry_v2.__new__(VgpuSchedulerLogEntry_v2) + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( + ptr, sizeof(nvmlVgpuSchedulerLogEntry_v2_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=vgpu_scheduler_log_entry_v2_dtype) + obj._data = data.view(_numpy.recarray) + + return obj + + +cdef _get_vgpu_scheduler_state_v2_dtype_offsets(): + cdef nvmlVgpuSchedulerState_v2_t pod + return _numpy.dtype({ + 'names': ['engine_id', 'scheduler_policy', 'avg_factor', 'frequency'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.engineId)) - (&pod), + (&(pod.schedulerPolicy)) - (&pod), + (&(pod.avgFactor)) - (&pod), + (&(pod.frequency)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerState_v2_t), + }) + +vgpu_scheduler_state_v2_dtype = _get_vgpu_scheduler_state_v2_dtype_offsets() + +cdef class VgpuSchedulerState_v2: + """Empty-initialize an instance of `nvmlVgpuSchedulerState_v2_t`. + + + .. seealso:: `nvmlVgpuSchedulerState_v2_t` + """ + cdef: + nvmlVgpuSchedulerState_v2_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerState_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerState_v2") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuSchedulerState_v2_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuSchedulerState_v2 object at {hex(id(self))}>" + + @property + def ptr(self): + """Get the pointer address to the data as Python :class:`int`.""" + return (self._ptr) + + cdef intptr_t _get_ptr(self): + return (self._ptr) + + def __int__(self): + return (self._ptr) + + def __eq__(self, other): + cdef VgpuSchedulerState_v2 other_ + if not isinstance(other, VgpuSchedulerState_v2): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerState_v2_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerState_v2_t), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + if key == 0 and isinstance(val, _numpy.ndarray): + self._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerState_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerState_v2") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerState_v2_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def engine_id(self): + """int: IN: One of NVML_VGPU_SCHEDULER_ENGINE_TYPE_*.""" + return self._ptr[0].engineId + + @engine_id.setter + def engine_id(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerState_v2 instance is read-only") + self._ptr[0].engineId = val + + @property + def scheduler_policy(self): + """int: IN: Scheduler policy.""" + return self._ptr[0].schedulerPolicy + + @scheduler_policy.setter + def scheduler_policy(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerState_v2 instance is read-only") + self._ptr[0].schedulerPolicy = val + + @property + def avg_factor(self): + """int: IN: Average factor in compensating the timeslice for Adaptive Round Robin mode. 0 or unspecified uses default.""" + return self._ptr[0].avgFactor + + @avg_factor.setter + def avg_factor(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerState_v2 instance is read-only") + self._ptr[0].avgFactor = val + + @property + def frequency(self): + """int: IN: Frequency for Adaptive Round Robin mode. 0 or unspecified uses default.""" + return self._ptr[0].frequency + + @frequency.setter + def frequency(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerState_v2 instance is read-only") + self._ptr[0].frequency = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuSchedulerState_v2 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerState_v2_t), VgpuSchedulerState_v2) + + @staticmethod + def from_data(data): + """Create an VgpuSchedulerState_v2 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_state_v2_dtype` holding the data. + """ + return _cyb_from_data(data, "vgpu_scheduler_state_v2_dtype", vgpu_scheduler_state_v2_dtype, VgpuSchedulerState_v2) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an VgpuSchedulerState_v2 instance wrapping the given pointer. + + Args: + ptr (intptr_t): pointer address as Python :class:`int` to the data. + owner (object): The Python object that owns the pointer. If not provided, data will be copied. + readonly (bool): whether the data is read-only (to the user). default is `False`. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef VgpuSchedulerState_v2 obj = VgpuSchedulerState_v2.__new__(VgpuSchedulerState_v2) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerState_v2_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerState_v2") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerState_v2_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_excluded_device_info_dtype_offsets(): + cdef nvmlExcludedDeviceInfo_t pod + return _numpy.dtype({ + 'names': ['pci_info', 'uuid'], + 'formats': [pci_info_dtype, (_numpy.int8, 80)], + 'offsets': [ + (&(pod.pciInfo)) - (&pod), + (&(pod.uuid)) - (&pod), + ], + 'itemsize': sizeof(nvmlExcludedDeviceInfo_t), + }) + +excluded_device_info_dtype = _get_excluded_device_info_dtype_offsets() + +cdef class ExcludedDeviceInfo: + """Empty-initialize an instance of `nvmlExcludedDeviceInfo_t`. + + + .. seealso:: `nvmlExcludedDeviceInfo_t` + """ + cdef: + nvmlExcludedDeviceInfo_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlExcludedDeviceInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ExcludedDeviceInfo") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlExcludedDeviceInfo_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.ExcludedDeviceInfo object at {hex(id(self))}>" + + @property + def ptr(self): + """Get the pointer address to the data as Python :class:`int`.""" + return (self._ptr) + + cdef intptr_t _get_ptr(self): + return (self._ptr) + + def __int__(self): + return (self._ptr) + + def __eq__(self, other): + cdef ExcludedDeviceInfo other_ + if not isinstance(other, ExcludedDeviceInfo): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlExcludedDeviceInfo_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlExcludedDeviceInfo_t), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + if key == 0 and isinstance(val, _numpy.ndarray): + self._ptr = _cyb_malloc(sizeof(nvmlExcludedDeviceInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ExcludedDeviceInfo") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlExcludedDeviceInfo_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def pci_info(self): + """PciInfo: """ + return PciInfo.from_ptr(&(self._ptr[0].pciInfo), self._readonly, self) @pci_info.setter def pci_info(self, val): if self._readonly: raise ValueError("This ExcludedDeviceInfo instance is read-only") cdef PciInfo val_ = val - memcpy(&(self._ptr[0].pciInfo), (val_._get_ptr()), sizeof(nvmlPciInfo_t) * 1) + _cyb_memcpy(&(self._ptr[0].pciInfo), (val_._get_ptr()), sizeof(nvmlPciInfo_t) * 1) @property def uuid(self): """~_numpy.int8: (array of length 80).""" - return cpython.PyUnicode_FromString(self._ptr[0].uuid) + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].uuid) @uuid.setter def uuid(self, val): @@ -15596,12 +16160,12 @@ cdef class ExcludedDeviceInfo: if len(buf) >= 80: raise ValueError("String too long for field uuid, max length is 79") cdef char *ptr = buf - memcpy((self._ptr[0].uuid), ptr, 80) + _cyb_memcpy((self._ptr[0].uuid), ptr, 80) @staticmethod def from_buffer(buffer): """Create an ExcludedDeviceInfo instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlExcludedDeviceInfo_t), ExcludedDeviceInfo) + return _cyb_from_buffer(buffer, sizeof(nvmlExcludedDeviceInfo_t), ExcludedDeviceInfo) @staticmethod def from_data(data): @@ -15610,7 +16174,7 @@ cdef class ExcludedDeviceInfo: Args: data (_numpy.ndarray): a single-element array of dtype `excluded_device_info_dtype` holding the data. """ - return __from_data(data, "excluded_device_info_dtype", excluded_device_info_dtype, ExcludedDeviceInfo) + return _cyb_from_data(data, "excluded_device_info_dtype", excluded_device_info_dtype, ExcludedDeviceInfo) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -15625,10 +16189,10 @@ cdef class ExcludedDeviceInfo: raise ValueError("ptr must not be null (0)") cdef ExcludedDeviceInfo obj = ExcludedDeviceInfo.__new__(ExcludedDeviceInfo) if owner is None: - obj._ptr = malloc(sizeof(nvmlExcludedDeviceInfo_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlExcludedDeviceInfo_t)) if obj._ptr == NULL: raise MemoryError("Error allocating ExcludedDeviceInfo") - memcpy((obj._ptr), ptr, sizeof(nvmlExcludedDeviceInfo_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlExcludedDeviceInfo_t)) obj._owner = None obj._owned = True else: @@ -15640,7 +16204,7 @@ cdef class ExcludedDeviceInfo: cdef _get_process_detail_list_v1_dtype_offsets(): - cdef nvmlProcessDetailList_v1_t pod = nvmlProcessDetailList_v1_t() + cdef nvmlProcessDetailList_v1_t pod return _numpy.dtype({ 'names': ['version', 'mode', 'num_proc_array_entries', 'proc_array'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp], @@ -15669,7 +16233,7 @@ cdef class ProcessDetailList_v1: dict _refs def __init__(self): - self._ptr = calloc(1, sizeof(nvmlProcessDetailList_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlProcessDetailList_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating ProcessDetailList_v1") self._owner = None @@ -15682,7 +16246,7 @@ cdef class ProcessDetailList_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.ProcessDetailList_v1 object at {hex(id(self))}>" @@ -15703,20 +16267,20 @@ cdef class ProcessDetailList_v1: if not isinstance(other, ProcessDetailList_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlProcessDetailList_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlProcessDetailList_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlProcessDetailList_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlProcessDetailList_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlProcessDetailList_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlProcessDetailList_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating ProcessDetailList_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlProcessDetailList_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlProcessDetailList_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -15736,7 +16300,7 @@ cdef class ProcessDetailList_v1: @property def mode(self): - """int: Process mode(Compute/Graphics/MPSCompute)""" + """int: Process mode, One of `nvmlProcessMode_t`.""" return self._ptr[0].mode @mode.setter @@ -15764,7 +16328,7 @@ cdef class ProcessDetailList_v1: @staticmethod def from_buffer(buffer): """Create an ProcessDetailList_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlProcessDetailList_v1_t), ProcessDetailList_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlProcessDetailList_v1_t), ProcessDetailList_v1) @staticmethod def from_data(data): @@ -15773,7 +16337,7 @@ cdef class ProcessDetailList_v1: Args: data (_numpy.ndarray): a single-element array of dtype `process_detail_list_v1_dtype` holding the data. """ - return __from_data(data, "process_detail_list_v1_dtype", process_detail_list_v1_dtype, ProcessDetailList_v1) + return _cyb_from_data(data, "process_detail_list_v1_dtype", process_detail_list_v1_dtype, ProcessDetailList_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -15788,10 +16352,10 @@ cdef class ProcessDetailList_v1: raise ValueError("ptr must not be null (0)") cdef ProcessDetailList_v1 obj = ProcessDetailList_v1.__new__(ProcessDetailList_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlProcessDetailList_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlProcessDetailList_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating ProcessDetailList_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlProcessDetailList_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlProcessDetailList_v1_t)) obj._owner = None obj._owned = True else: @@ -15804,7 +16368,7 @@ cdef class ProcessDetailList_v1: cdef _get_bridge_chip_hierarchy_dtype_offsets(): - cdef nvmlBridgeChipHierarchy_t pod = nvmlBridgeChipHierarchy_t() + cdef nvmlBridgeChipHierarchy_t pod return _numpy.dtype({ 'names': ['bridge_count', 'bridge_chip_info'], 'formats': [_numpy.uint8, (bridge_chip_info_dtype, 128)], @@ -15830,7 +16394,7 @@ cdef class BridgeChipHierarchy: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlBridgeChipHierarchy_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlBridgeChipHierarchy_t)) if self._ptr == NULL: raise MemoryError("Error allocating BridgeChipHierarchy") self._owner = None @@ -15842,7 +16406,7 @@ cdef class BridgeChipHierarchy: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.BridgeChipHierarchy object at {hex(id(self))}>" @@ -15863,20 +16427,20 @@ cdef class BridgeChipHierarchy: if not isinstance(other, BridgeChipHierarchy): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlBridgeChipHierarchy_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlBridgeChipHierarchy_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlBridgeChipHierarchy_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlBridgeChipHierarchy_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlBridgeChipHierarchy_t)) + self._ptr = _cyb_malloc(sizeof(nvmlBridgeChipHierarchy_t)) if self._ptr == NULL: raise MemoryError("Error allocating BridgeChipHierarchy") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlBridgeChipHierarchy_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlBridgeChipHierarchy_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -15898,12 +16462,12 @@ cdef class BridgeChipHierarchy: self._ptr[0].bridgeCount = len(val) if len(val) == 0: return - memcpy(&(self._ptr[0].bridgeChipInfo), (val_._get_ptr()), sizeof(nvmlBridgeChipInfo_t) * self._ptr[0].bridgeCount) + _cyb_memcpy(&(self._ptr[0].bridgeChipInfo), (val_._get_ptr()), sizeof(nvmlBridgeChipInfo_t) * self._ptr[0].bridgeCount) @staticmethod def from_buffer(buffer): """Create an BridgeChipHierarchy instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlBridgeChipHierarchy_t), BridgeChipHierarchy) + return _cyb_from_buffer(buffer, sizeof(nvmlBridgeChipHierarchy_t), BridgeChipHierarchy) @staticmethod def from_data(data): @@ -15912,7 +16476,7 @@ cdef class BridgeChipHierarchy: Args: data (_numpy.ndarray): a single-element array of dtype `bridge_chip_hierarchy_dtype` holding the data. """ - return __from_data(data, "bridge_chip_hierarchy_dtype", bridge_chip_hierarchy_dtype, BridgeChipHierarchy) + return _cyb_from_data(data, "bridge_chip_hierarchy_dtype", bridge_chip_hierarchy_dtype, BridgeChipHierarchy) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -15927,10 +16491,10 @@ cdef class BridgeChipHierarchy: raise ValueError("ptr must not be null (0)") cdef BridgeChipHierarchy obj = BridgeChipHierarchy.__new__(BridgeChipHierarchy) if owner is None: - obj._ptr = malloc(sizeof(nvmlBridgeChipHierarchy_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlBridgeChipHierarchy_t)) if obj._ptr == NULL: raise MemoryError("Error allocating BridgeChipHierarchy") - memcpy((obj._ptr), ptr, sizeof(nvmlBridgeChipHierarchy_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlBridgeChipHierarchy_t)) obj._owner = None obj._owned = True else: @@ -15942,7 +16506,7 @@ cdef class BridgeChipHierarchy: cdef _get_sample_dtype_offsets(): - cdef nvmlSample_t pod = nvmlSample_t() + cdef nvmlSample_t pod return _numpy.dtype({ 'names': ['time_stamp', 'sample_value'], 'formats': [_numpy.uint64, value_dtype], @@ -15957,21 +16521,17 @@ sample_dtype = _get_sample_dtype_offsets() cdef class Sample: """Empty-initialize an array of `nvmlSample_t`. - The resulting object is of length `size` and of dtype `sample_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlSample_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=sample_dtype) self._data = arr.view(_numpy.recarray) @@ -16008,10 +16568,10 @@ cdef class Sample: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def time_stamp(self): @@ -16087,8 +16647,8 @@ cdef class Sample: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef Sample obj = Sample.__new__(Sample) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(nvmlSample_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=sample_dtype) obj._data = data.view(_numpy.recarray) @@ -16097,7 +16657,7 @@ cdef class Sample: cdef _get_vgpu_instance_utilization_sample_dtype_offsets(): - cdef nvmlVgpuInstanceUtilizationSample_t pod = nvmlVgpuInstanceUtilizationSample_t() + cdef nvmlVgpuInstanceUtilizationSample_t pod return _numpy.dtype({ 'names': ['vgpu_instance', 'time_stamp', 'sm_util', 'mem_util', 'enc_util', 'dec_util'], 'formats': [_numpy.uint32, _numpy.uint64, value_dtype, value_dtype, value_dtype, value_dtype], @@ -16116,21 +16676,17 @@ vgpu_instance_utilization_sample_dtype = _get_vgpu_instance_utilization_sample_d cdef class VgpuInstanceUtilizationSample: """Empty-initialize an array of `nvmlVgpuInstanceUtilizationSample_t`. - The resulting object is of length `size` and of dtype `vgpu_instance_utilization_sample_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlVgpuInstanceUtilizationSample_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=vgpu_instance_utilization_sample_dtype) self._data = arr.view(_numpy.recarray) @@ -16167,10 +16723,10 @@ cdef class VgpuInstanceUtilizationSample: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def vgpu_instance(self): @@ -16284,8 +16840,8 @@ cdef class VgpuInstanceUtilizationSample: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef VgpuInstanceUtilizationSample obj = VgpuInstanceUtilizationSample.__new__(VgpuInstanceUtilizationSample) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(nvmlVgpuInstanceUtilizationSample_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=vgpu_instance_utilization_sample_dtype) obj._data = data.view(_numpy.recarray) @@ -16294,7 +16850,7 @@ cdef class VgpuInstanceUtilizationSample: cdef _get_vgpu_instance_utilization_info_v1_dtype_offsets(): - cdef nvmlVgpuInstanceUtilizationInfo_v1_t pod = nvmlVgpuInstanceUtilizationInfo_v1_t() + cdef nvmlVgpuInstanceUtilizationInfo_v1_t pod return _numpy.dtype({ 'names': ['time_stamp', 'vgpu_instance', 'sm_util', 'mem_util', 'enc_util', 'dec_util', 'jpg_util', 'ofa_util'], 'formats': [_numpy.uint64, _numpy.uint32, value_dtype, value_dtype, value_dtype, value_dtype, value_dtype, value_dtype], @@ -16315,21 +16871,17 @@ vgpu_instance_utilization_info_v1_dtype = _get_vgpu_instance_utilization_info_v1 cdef class VgpuInstanceUtilizationInfo_v1: """Empty-initialize an array of `nvmlVgpuInstanceUtilizationInfo_v1_t`. - The resulting object is of length `size` and of dtype `vgpu_instance_utilization_info_v1_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlVgpuInstanceUtilizationInfo_v1_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=vgpu_instance_utilization_info_v1_dtype) self._data = arr.view(_numpy.recarray) @@ -16366,10 +16918,10 @@ cdef class VgpuInstanceUtilizationInfo_v1: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def time_stamp(self): @@ -16501,8 +17053,8 @@ cdef class VgpuInstanceUtilizationInfo_v1: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef VgpuInstanceUtilizationInfo_v1 obj = VgpuInstanceUtilizationInfo_v1.__new__(VgpuInstanceUtilizationInfo_v1) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(nvmlVgpuInstanceUtilizationInfo_v1_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=vgpu_instance_utilization_info_v1_dtype) obj._data = data.view(_numpy.recarray) @@ -16511,7 +17063,7 @@ cdef class VgpuInstanceUtilizationInfo_v1: cdef _get_field_value_dtype_offsets(): - cdef nvmlFieldValue_t pod = nvmlFieldValue_t() + cdef nvmlFieldValue_t pod return _numpy.dtype({ 'names': ['field_id', 'scope_id', 'timestamp', 'latency_usec', 'value_type', 'nvml_return', 'value'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.int64, _numpy.int64, _numpy.int32, _numpy.int32, value_dtype], @@ -16531,21 +17083,17 @@ field_value_dtype = _get_field_value_dtype_offsets() cdef class FieldValue: """Empty-initialize an array of `nvmlFieldValue_t`. - The resulting object is of length `size` and of dtype `field_value_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlFieldValue_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=field_value_dtype) self._data = arr.view(_numpy.recarray) @@ -16582,10 +17130,10 @@ cdef class FieldValue: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def field_id(self): @@ -16716,8 +17264,8 @@ cdef class FieldValue: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef FieldValue obj = FieldValue.__new__(FieldValue) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(nvmlFieldValue_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=field_value_dtype) obj._data = data.view(_numpy.recarray) @@ -16726,7 +17274,7 @@ cdef class FieldValue: cdef _get_prm_counter_value_v1_dtype_offsets(): - cdef nvmlPRMCounterValue_v1_t pod = nvmlPRMCounterValue_v1_t() + cdef nvmlPRMCounterValue_v1_t pod return _numpy.dtype({ 'names': ['status', 'output_type', 'output_value'], 'formats': [_numpy.int32, _numpy.int32, value_dtype], @@ -16753,7 +17301,7 @@ cdef class PRMCounterValue_v1: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlPRMCounterValue_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlPRMCounterValue_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating PRMCounterValue_v1") self._owner = None @@ -16765,7 +17313,7 @@ cdef class PRMCounterValue_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.PRMCounterValue_v1 object at {hex(id(self))}>" @@ -16786,20 +17334,20 @@ cdef class PRMCounterValue_v1: if not isinstance(other, PRMCounterValue_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlPRMCounterValue_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlPRMCounterValue_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlPRMCounterValue_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlPRMCounterValue_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlPRMCounterValue_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlPRMCounterValue_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating PRMCounterValue_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlPRMCounterValue_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlPRMCounterValue_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -16816,7 +17364,7 @@ cdef class PRMCounterValue_v1: if self._readonly: raise ValueError("This PRMCounterValue_v1 instance is read-only") cdef Value val_ = val - memcpy(&(self._ptr[0].outputValue), (val_._get_ptr()), sizeof(nvmlValue_t) * 1) + _cyb_memcpy(&(self._ptr[0].outputValue), (val_._get_ptr()), sizeof(nvmlValue_t) * 1) @property def status(self): @@ -16843,7 +17391,7 @@ cdef class PRMCounterValue_v1: @staticmethod def from_buffer(buffer): """Create an PRMCounterValue_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlPRMCounterValue_v1_t), PRMCounterValue_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlPRMCounterValue_v1_t), PRMCounterValue_v1) @staticmethod def from_data(data): @@ -16852,7 +17400,7 @@ cdef class PRMCounterValue_v1: Args: data (_numpy.ndarray): a single-element array of dtype `prm_counter_value_v1_dtype` holding the data. """ - return __from_data(data, "prm_counter_value_v1_dtype", prm_counter_value_v1_dtype, PRMCounterValue_v1) + return _cyb_from_data(data, "prm_counter_value_v1_dtype", prm_counter_value_v1_dtype, PRMCounterValue_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -16867,10 +17415,10 @@ cdef class PRMCounterValue_v1: raise ValueError("ptr must not be null (0)") cdef PRMCounterValue_v1 obj = PRMCounterValue_v1.__new__(PRMCounterValue_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlPRMCounterValue_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlPRMCounterValue_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating PRMCounterValue_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlPRMCounterValue_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlPRMCounterValue_v1_t)) obj._owner = None obj._owned = True else: @@ -16882,7 +17430,7 @@ cdef class PRMCounterValue_v1: cdef _get_gpu_thermal_settings_dtype_offsets(): - cdef nvmlGpuThermalSettings_t pod = nvmlGpuThermalSettings_t() + cdef nvmlGpuThermalSettings_t pod return _numpy.dtype({ 'names': ['count', 'sensor'], 'formats': [_numpy.uint32, (_py_anon_pod0_dtype, 3)], @@ -16908,7 +17456,7 @@ cdef class GpuThermalSettings: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlGpuThermalSettings_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlGpuThermalSettings_t)) if self._ptr == NULL: raise MemoryError("Error allocating GpuThermalSettings") self._owner = None @@ -16920,7 +17468,7 @@ cdef class GpuThermalSettings: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.GpuThermalSettings object at {hex(id(self))}>" @@ -16941,20 +17489,20 @@ cdef class GpuThermalSettings: if not isinstance(other, GpuThermalSettings): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuThermalSettings_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuThermalSettings_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlGpuThermalSettings_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlGpuThermalSettings_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlGpuThermalSettings_t)) + self._ptr = _cyb_malloc(sizeof(nvmlGpuThermalSettings_t)) if self._ptr == NULL: raise MemoryError("Error allocating GpuThermalSettings") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuThermalSettings_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuThermalSettings_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -16973,7 +17521,7 @@ cdef class GpuThermalSettings: cdef _py_anon_pod0 val_ = val if len(val) != 3: raise ValueError(f"Expected length { 3 } for field sensor, got {len(val)}") - memcpy(&(self._ptr[0].sensor), (val_._get_ptr()), sizeof(_anon_pod0) * 3) + _cyb_memcpy(&(self._ptr[0].sensor), (val_._get_ptr()), sizeof(cuda_bindings_nvml__anon_pod0) * 3) @property def count(self): @@ -16989,7 +17537,7 @@ cdef class GpuThermalSettings: @staticmethod def from_buffer(buffer): """Create an GpuThermalSettings instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlGpuThermalSettings_t), GpuThermalSettings) + return _cyb_from_buffer(buffer, sizeof(nvmlGpuThermalSettings_t), GpuThermalSettings) @staticmethod def from_data(data): @@ -16998,7 +17546,7 @@ cdef class GpuThermalSettings: Args: data (_numpy.ndarray): a single-element array of dtype `gpu_thermal_settings_dtype` holding the data. """ - return __from_data(data, "gpu_thermal_settings_dtype", gpu_thermal_settings_dtype, GpuThermalSettings) + return _cyb_from_data(data, "gpu_thermal_settings_dtype", gpu_thermal_settings_dtype, GpuThermalSettings) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -17013,10 +17561,10 @@ cdef class GpuThermalSettings: raise ValueError("ptr must not be null (0)") cdef GpuThermalSettings obj = GpuThermalSettings.__new__(GpuThermalSettings) if owner is None: - obj._ptr = malloc(sizeof(nvmlGpuThermalSettings_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlGpuThermalSettings_t)) if obj._ptr == NULL: raise MemoryError("Error allocating GpuThermalSettings") - memcpy((obj._ptr), ptr, sizeof(nvmlGpuThermalSettings_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGpuThermalSettings_t)) obj._owner = None obj._owned = True else: @@ -17028,7 +17576,7 @@ cdef class GpuThermalSettings: cdef _get_clk_mon_status_dtype_offsets(): - cdef nvmlClkMonStatus_t pod = nvmlClkMonStatus_t() + cdef nvmlClkMonStatus_t pod return _numpy.dtype({ 'names': ['b_global_status', 'clk_mon_list_size', 'clk_mon_list'], 'formats': [_numpy.uint32, _numpy.uint32, (clk_mon_fault_info_dtype, 32)], @@ -17055,7 +17603,7 @@ cdef class ClkMonStatus: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlClkMonStatus_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlClkMonStatus_t)) if self._ptr == NULL: raise MemoryError("Error allocating ClkMonStatus") self._owner = None @@ -17067,7 +17615,7 @@ cdef class ClkMonStatus: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.ClkMonStatus object at {hex(id(self))}>" @@ -17088,20 +17636,20 @@ cdef class ClkMonStatus: if not isinstance(other, ClkMonStatus): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlClkMonStatus_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlClkMonStatus_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlClkMonStatus_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlClkMonStatus_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlClkMonStatus_t)) + self._ptr = _cyb_malloc(sizeof(nvmlClkMonStatus_t)) if self._ptr == NULL: raise MemoryError("Error allocating ClkMonStatus") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlClkMonStatus_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlClkMonStatus_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -17123,7 +17671,7 @@ cdef class ClkMonStatus: self._ptr[0].clkMonListSize = len(val) if len(val) == 0: return - memcpy(&(self._ptr[0].clkMonList), (val_._get_ptr()), sizeof(nvmlClkMonFaultInfo_t) * self._ptr[0].clkMonListSize) + _cyb_memcpy(&(self._ptr[0].clkMonList), (val_._get_ptr()), sizeof(nvmlClkMonFaultInfo_t) * self._ptr[0].clkMonListSize) @property def b_global_status(self): @@ -17139,7 +17687,7 @@ cdef class ClkMonStatus: @staticmethod def from_buffer(buffer): """Create an ClkMonStatus instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlClkMonStatus_t), ClkMonStatus) + return _cyb_from_buffer(buffer, sizeof(nvmlClkMonStatus_t), ClkMonStatus) @staticmethod def from_data(data): @@ -17148,7 +17696,7 @@ cdef class ClkMonStatus: Args: data (_numpy.ndarray): a single-element array of dtype `clk_mon_status_dtype` holding the data. """ - return __from_data(data, "clk_mon_status_dtype", clk_mon_status_dtype, ClkMonStatus) + return _cyb_from_data(data, "clk_mon_status_dtype", clk_mon_status_dtype, ClkMonStatus) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -17163,10 +17711,10 @@ cdef class ClkMonStatus: raise ValueError("ptr must not be null (0)") cdef ClkMonStatus obj = ClkMonStatus.__new__(ClkMonStatus) if owner is None: - obj._ptr = malloc(sizeof(nvmlClkMonStatus_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlClkMonStatus_t)) if obj._ptr == NULL: raise MemoryError("Error allocating ClkMonStatus") - memcpy((obj._ptr), ptr, sizeof(nvmlClkMonStatus_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlClkMonStatus_t)) obj._owner = None obj._owned = True else: @@ -17178,7 +17726,7 @@ cdef class ClkMonStatus: cdef _get_processes_utilization_info_v1_dtype_offsets(): - cdef nvmlProcessesUtilizationInfo_v1_t pod = nvmlProcessesUtilizationInfo_v1_t() + cdef nvmlProcessesUtilizationInfo_v1_t pod return _numpy.dtype({ 'names': ['version', 'process_samples_count', 'last_seen_time_stamp', 'proc_util_array'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.intp], @@ -17207,7 +17755,7 @@ cdef class ProcessesUtilizationInfo_v1: dict _refs def __init__(self): - self._ptr = calloc(1, sizeof(nvmlProcessesUtilizationInfo_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlProcessesUtilizationInfo_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating ProcessesUtilizationInfo_v1") self._owner = None @@ -17220,7 +17768,7 @@ cdef class ProcessesUtilizationInfo_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.ProcessesUtilizationInfo_v1 object at {hex(id(self))}>" @@ -17241,20 +17789,20 @@ cdef class ProcessesUtilizationInfo_v1: if not isinstance(other, ProcessesUtilizationInfo_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlProcessesUtilizationInfo_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlProcessesUtilizationInfo_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlProcessesUtilizationInfo_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlProcessesUtilizationInfo_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlProcessesUtilizationInfo_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlProcessesUtilizationInfo_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating ProcessesUtilizationInfo_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlProcessesUtilizationInfo_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlProcessesUtilizationInfo_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -17302,7 +17850,7 @@ cdef class ProcessesUtilizationInfo_v1: @staticmethod def from_buffer(buffer): """Create an ProcessesUtilizationInfo_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlProcessesUtilizationInfo_v1_t), ProcessesUtilizationInfo_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlProcessesUtilizationInfo_v1_t), ProcessesUtilizationInfo_v1) @staticmethod def from_data(data): @@ -17311,7 +17859,7 @@ cdef class ProcessesUtilizationInfo_v1: Args: data (_numpy.ndarray): a single-element array of dtype `processes_utilization_info_v1_dtype` holding the data. """ - return __from_data(data, "processes_utilization_info_v1_dtype", processes_utilization_info_v1_dtype, ProcessesUtilizationInfo_v1) + return _cyb_from_data(data, "processes_utilization_info_v1_dtype", processes_utilization_info_v1_dtype, ProcessesUtilizationInfo_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -17326,10 +17874,10 @@ cdef class ProcessesUtilizationInfo_v1: raise ValueError("ptr must not be null (0)") cdef ProcessesUtilizationInfo_v1 obj = ProcessesUtilizationInfo_v1.__new__(ProcessesUtilizationInfo_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlProcessesUtilizationInfo_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlProcessesUtilizationInfo_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating ProcessesUtilizationInfo_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlProcessesUtilizationInfo_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlProcessesUtilizationInfo_v1_t)) obj._owner = None obj._owned = True else: @@ -17342,7 +17890,7 @@ cdef class ProcessesUtilizationInfo_v1: cdef _get_gpu_dynamic_pstates_info_dtype_offsets(): - cdef nvmlGpuDynamicPstatesInfo_t pod = nvmlGpuDynamicPstatesInfo_t() + cdef nvmlGpuDynamicPstatesInfo_t pod return _numpy.dtype({ 'names': ['flags_', 'utilization'], 'formats': [_numpy.uint32, (_py_anon_pod1_dtype, 8)], @@ -17368,7 +17916,7 @@ cdef class GpuDynamicPstatesInfo: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlGpuDynamicPstatesInfo_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlGpuDynamicPstatesInfo_t)) if self._ptr == NULL: raise MemoryError("Error allocating GpuDynamicPstatesInfo") self._owner = None @@ -17380,7 +17928,7 @@ cdef class GpuDynamicPstatesInfo: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.GpuDynamicPstatesInfo object at {hex(id(self))}>" @@ -17401,20 +17949,20 @@ cdef class GpuDynamicPstatesInfo: if not isinstance(other, GpuDynamicPstatesInfo): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuDynamicPstatesInfo_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuDynamicPstatesInfo_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlGpuDynamicPstatesInfo_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlGpuDynamicPstatesInfo_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlGpuDynamicPstatesInfo_t)) + self._ptr = _cyb_malloc(sizeof(nvmlGpuDynamicPstatesInfo_t)) if self._ptr == NULL: raise MemoryError("Error allocating GpuDynamicPstatesInfo") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuDynamicPstatesInfo_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuDynamicPstatesInfo_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -17433,7 +17981,7 @@ cdef class GpuDynamicPstatesInfo: cdef _py_anon_pod1 val_ = val if len(val) != 8: raise ValueError(f"Expected length { 8 } for field utilization, got {len(val)}") - memcpy(&(self._ptr[0].utilization), (val_._get_ptr()), sizeof(_anon_pod1) * 8) + _cyb_memcpy(&(self._ptr[0].utilization), (val_._get_ptr()), sizeof(cuda_bindings_nvml__anon_pod1) * 8) @property def flags_(self): @@ -17449,7 +17997,7 @@ cdef class GpuDynamicPstatesInfo: @staticmethod def from_buffer(buffer): """Create an GpuDynamicPstatesInfo instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlGpuDynamicPstatesInfo_t), GpuDynamicPstatesInfo) + return _cyb_from_buffer(buffer, sizeof(nvmlGpuDynamicPstatesInfo_t), GpuDynamicPstatesInfo) @staticmethod def from_data(data): @@ -17458,7 +18006,7 @@ cdef class GpuDynamicPstatesInfo: Args: data (_numpy.ndarray): a single-element array of dtype `gpu_dynamic_pstates_info_dtype` holding the data. """ - return __from_data(data, "gpu_dynamic_pstates_info_dtype", gpu_dynamic_pstates_info_dtype, GpuDynamicPstatesInfo) + return _cyb_from_data(data, "gpu_dynamic_pstates_info_dtype", gpu_dynamic_pstates_info_dtype, GpuDynamicPstatesInfo) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -17473,10 +18021,10 @@ cdef class GpuDynamicPstatesInfo: raise ValueError("ptr must not be null (0)") cdef GpuDynamicPstatesInfo obj = GpuDynamicPstatesInfo.__new__(GpuDynamicPstatesInfo) if owner is None: - obj._ptr = malloc(sizeof(nvmlGpuDynamicPstatesInfo_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlGpuDynamicPstatesInfo_t)) if obj._ptr == NULL: raise MemoryError("Error allocating GpuDynamicPstatesInfo") - memcpy((obj._ptr), ptr, sizeof(nvmlGpuDynamicPstatesInfo_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGpuDynamicPstatesInfo_t)) obj._owner = None obj._owned = True else: @@ -17488,7 +18036,7 @@ cdef class GpuDynamicPstatesInfo: cdef _get_vgpu_processes_utilization_info_v1_dtype_offsets(): - cdef nvmlVgpuProcessesUtilizationInfo_v1_t pod = nvmlVgpuProcessesUtilizationInfo_v1_t() + cdef nvmlVgpuProcessesUtilizationInfo_v1_t pod return _numpy.dtype({ 'names': ['version', 'vgpu_process_count', 'last_seen_time_stamp', 'vgpu_proc_util_array'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.intp], @@ -17517,7 +18065,7 @@ cdef class VgpuProcessesUtilizationInfo_v1: dict _refs def __init__(self): - self._ptr = calloc(1, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuProcessesUtilizationInfo_v1") self._owner = None @@ -17530,7 +18078,7 @@ cdef class VgpuProcessesUtilizationInfo_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.VgpuProcessesUtilizationInfo_v1 object at {hex(id(self))}>" @@ -17551,20 +18099,20 @@ cdef class VgpuProcessesUtilizationInfo_v1: if not isinstance(other, VgpuProcessesUtilizationInfo_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuProcessesUtilizationInfo_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -17612,7 +18160,7 @@ cdef class VgpuProcessesUtilizationInfo_v1: @staticmethod def from_buffer(buffer): """Create an VgpuProcessesUtilizationInfo_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t), VgpuProcessesUtilizationInfo_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t), VgpuProcessesUtilizationInfo_v1) @staticmethod def from_data(data): @@ -17621,7 +18169,7 @@ cdef class VgpuProcessesUtilizationInfo_v1: Args: data (_numpy.ndarray): a single-element array of dtype `vgpu_processes_utilization_info_v1_dtype` holding the data. """ - return __from_data(data, "vgpu_processes_utilization_info_v1_dtype", vgpu_processes_utilization_info_v1_dtype, VgpuProcessesUtilizationInfo_v1) + return _cyb_from_data(data, "vgpu_processes_utilization_info_v1_dtype", vgpu_processes_utilization_info_v1_dtype, VgpuProcessesUtilizationInfo_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -17636,10 +18184,10 @@ cdef class VgpuProcessesUtilizationInfo_v1: raise ValueError("ptr must not be null (0)") cdef VgpuProcessesUtilizationInfo_v1 obj = VgpuProcessesUtilizationInfo_v1.__new__(VgpuProcessesUtilizationInfo_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating VgpuProcessesUtilizationInfo_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) obj._owner = None obj._owned = True else: @@ -17659,7 +18207,6 @@ vgpu_scheduler_params_dtype = _numpy.dtype(( } )) - cdef class VgpuSchedulerParams: """Empty-initialize an instance of `nvmlVgpuSchedulerParams_t`. @@ -17673,7 +18220,7 @@ cdef class VgpuSchedulerParams: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlVgpuSchedulerParams_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerParams_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuSchedulerParams") self._owner = None @@ -17685,7 +18232,7 @@ cdef class VgpuSchedulerParams: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.VgpuSchedulerParams object at {hex(id(self))}>" @@ -17706,20 +18253,20 @@ cdef class VgpuSchedulerParams: if not isinstance(other, VgpuSchedulerParams): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerParams_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerParams_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerParams_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerParams_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlVgpuSchedulerParams_t)) + self._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerParams_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuSchedulerParams") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerParams_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerParams_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -17736,7 +18283,7 @@ cdef class VgpuSchedulerParams: if self._readonly: raise ValueError("This VgpuSchedulerParams instance is read-only") cdef _py_anon_pod2 val_ = val - memcpy(&(self._ptr[0].vgpuSchedDataWithARR), (val_._get_ptr()), sizeof(_anon_pod2) * 1) + _cyb_memcpy(&(self._ptr[0].vgpuSchedDataWithARR), (val_._get_ptr()), sizeof(cuda_bindings_nvml__anon_pod2) * 1) @property def vgpu_sched_data(self): @@ -17748,12 +18295,12 @@ cdef class VgpuSchedulerParams: if self._readonly: raise ValueError("This VgpuSchedulerParams instance is read-only") cdef _py_anon_pod3 val_ = val - memcpy(&(self._ptr[0].vgpuSchedData), (val_._get_ptr()), sizeof(_anon_pod3) * 1) + _cyb_memcpy(&(self._ptr[0].vgpuSchedData), (val_._get_ptr()), sizeof(cuda_bindings_nvml__anon_pod3) * 1) @staticmethod def from_buffer(buffer): """Create an VgpuSchedulerParams instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlVgpuSchedulerParams_t), VgpuSchedulerParams) + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerParams_t), VgpuSchedulerParams) @staticmethod def from_data(data): @@ -17762,7 +18309,7 @@ cdef class VgpuSchedulerParams: Args: data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_params_dtype` holding the data. """ - return __from_data(data, "vgpu_scheduler_params_dtype", vgpu_scheduler_params_dtype, VgpuSchedulerParams) + return _cyb_from_data(data, "vgpu_scheduler_params_dtype", vgpu_scheduler_params_dtype, VgpuSchedulerParams) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -17777,10 +18324,10 @@ cdef class VgpuSchedulerParams: raise ValueError("ptr must not be null (0)") cdef VgpuSchedulerParams obj = VgpuSchedulerParams.__new__(VgpuSchedulerParams) if owner is None: - obj._ptr = malloc(sizeof(nvmlVgpuSchedulerParams_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerParams_t)) if obj._ptr == NULL: raise MemoryError("Error allocating VgpuSchedulerParams") - memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerParams_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerParams_t)) obj._owner = None obj._owned = True else: @@ -17799,7 +18346,6 @@ vgpu_scheduler_set_params_dtype = _numpy.dtype(( } )) - cdef class VgpuSchedulerSetParams: """Empty-initialize an instance of `nvmlVgpuSchedulerSetParams_t`. @@ -17813,7 +18359,7 @@ cdef class VgpuSchedulerSetParams: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlVgpuSchedulerSetParams_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerSetParams_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuSchedulerSetParams") self._owner = None @@ -17825,7 +18371,7 @@ cdef class VgpuSchedulerSetParams: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.VgpuSchedulerSetParams object at {hex(id(self))}>" @@ -17846,20 +18392,20 @@ cdef class VgpuSchedulerSetParams: if not isinstance(other, VgpuSchedulerSetParams): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerSetParams_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerSetParams_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerSetParams_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerSetParams_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlVgpuSchedulerSetParams_t)) + self._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerSetParams_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuSchedulerSetParams") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerSetParams_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerSetParams_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -17876,7 +18422,7 @@ cdef class VgpuSchedulerSetParams: if self._readonly: raise ValueError("This VgpuSchedulerSetParams instance is read-only") cdef _py_anon_pod4 val_ = val - memcpy(&(self._ptr[0].vgpuSchedDataWithARR), (val_._get_ptr()), sizeof(_anon_pod4) * 1) + _cyb_memcpy(&(self._ptr[0].vgpuSchedDataWithARR), (val_._get_ptr()), sizeof(cuda_bindings_nvml__anon_pod4) * 1) @property def vgpu_sched_data(self): @@ -17888,12 +18434,12 @@ cdef class VgpuSchedulerSetParams: if self._readonly: raise ValueError("This VgpuSchedulerSetParams instance is read-only") cdef _py_anon_pod5 val_ = val - memcpy(&(self._ptr[0].vgpuSchedData), (val_._get_ptr()), sizeof(_anon_pod5) * 1) + _cyb_memcpy(&(self._ptr[0].vgpuSchedData), (val_._get_ptr()), sizeof(cuda_bindings_nvml__anon_pod5) * 1) @staticmethod def from_buffer(buffer): """Create an VgpuSchedulerSetParams instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlVgpuSchedulerSetParams_t), VgpuSchedulerSetParams) + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerSetParams_t), VgpuSchedulerSetParams) @staticmethod def from_data(data): @@ -17902,7 +18448,7 @@ cdef class VgpuSchedulerSetParams: Args: data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_set_params_dtype` holding the data. """ - return __from_data(data, "vgpu_scheduler_set_params_dtype", vgpu_scheduler_set_params_dtype, VgpuSchedulerSetParams) + return _cyb_from_data(data, "vgpu_scheduler_set_params_dtype", vgpu_scheduler_set_params_dtype, VgpuSchedulerSetParams) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -17917,10 +18463,10 @@ cdef class VgpuSchedulerSetParams: raise ValueError("ptr must not be null (0)") cdef VgpuSchedulerSetParams obj = VgpuSchedulerSetParams.__new__(VgpuSchedulerSetParams) if owner is None: - obj._ptr = malloc(sizeof(nvmlVgpuSchedulerSetParams_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerSetParams_t)) if obj._ptr == NULL: raise MemoryError("Error allocating VgpuSchedulerSetParams") - memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerSetParams_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerSetParams_t)) obj._owner = None obj._owned = True else: @@ -17932,7 +18478,7 @@ cdef class VgpuSchedulerSetParams: cdef _get_vgpu_license_info_dtype_offsets(): - cdef nvmlVgpuLicenseInfo_t pod = nvmlVgpuLicenseInfo_t() + cdef nvmlVgpuLicenseInfo_t pod return _numpy.dtype({ 'names': ['is_licensed', 'license_expiry', 'current_state'], 'formats': [_numpy.uint8, vgpu_license_expiry_dtype, _numpy.uint32], @@ -17959,7 +18505,7 @@ cdef class VgpuLicenseInfo: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlVgpuLicenseInfo_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuLicenseInfo_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuLicenseInfo") self._owner = None @@ -17971,7 +18517,7 @@ cdef class VgpuLicenseInfo: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.VgpuLicenseInfo object at {hex(id(self))}>" @@ -17992,20 +18538,20 @@ cdef class VgpuLicenseInfo: if not isinstance(other, VgpuLicenseInfo): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuLicenseInfo_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuLicenseInfo_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuLicenseInfo_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuLicenseInfo_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlVgpuLicenseInfo_t)) + self._ptr = _cyb_malloc(sizeof(nvmlVgpuLicenseInfo_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuLicenseInfo") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuLicenseInfo_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuLicenseInfo_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -18022,7 +18568,7 @@ cdef class VgpuLicenseInfo: if self._readonly: raise ValueError("This VgpuLicenseInfo instance is read-only") cdef VgpuLicenseExpiry val_ = val - memcpy(&(self._ptr[0].licenseExpiry), (val_._get_ptr()), sizeof(nvmlVgpuLicenseExpiry_t) * 1) + _cyb_memcpy(&(self._ptr[0].licenseExpiry), (val_._get_ptr()), sizeof(nvmlVgpuLicenseExpiry_t) * 1) @property def is_licensed(self): @@ -18049,7 +18595,7 @@ cdef class VgpuLicenseInfo: @staticmethod def from_buffer(buffer): """Create an VgpuLicenseInfo instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlVgpuLicenseInfo_t), VgpuLicenseInfo) + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuLicenseInfo_t), VgpuLicenseInfo) @staticmethod def from_data(data): @@ -18058,7 +18604,7 @@ cdef class VgpuLicenseInfo: Args: data (_numpy.ndarray): a single-element array of dtype `vgpu_license_info_dtype` holding the data. """ - return __from_data(data, "vgpu_license_info_dtype", vgpu_license_info_dtype, VgpuLicenseInfo) + return _cyb_from_data(data, "vgpu_license_info_dtype", vgpu_license_info_dtype, VgpuLicenseInfo) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -18073,10 +18619,10 @@ cdef class VgpuLicenseInfo: raise ValueError("ptr must not be null (0)") cdef VgpuLicenseInfo obj = VgpuLicenseInfo.__new__(VgpuLicenseInfo) if owner is None: - obj._ptr = malloc(sizeof(nvmlVgpuLicenseInfo_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuLicenseInfo_t)) if obj._ptr == NULL: raise MemoryError("Error allocating VgpuLicenseInfo") - memcpy((obj._ptr), ptr, sizeof(nvmlVgpuLicenseInfo_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuLicenseInfo_t)) obj._owner = None obj._owned = True else: @@ -18088,7 +18634,7 @@ cdef class VgpuLicenseInfo: cdef _get_grid_licensable_feature_dtype_offsets(): - cdef nvmlGridLicensableFeature_t pod = nvmlGridLicensableFeature_t() + cdef nvmlGridLicensableFeature_t pod return _numpy.dtype({ 'names': ['feature_code', 'feature_state', 'license_info', 'product_name', 'feature_enabled', 'license_expiry'], 'formats': [_numpy.int32, _numpy.uint32, (_numpy.int8, 128), (_numpy.int8, 128), _numpy.uint32, grid_license_expiry_dtype], @@ -18107,21 +18653,17 @@ grid_licensable_feature_dtype = _get_grid_licensable_feature_dtype_offsets() cdef class GridLicensableFeature: """Empty-initialize an array of `nvmlGridLicensableFeature_t`. - The resulting object is of length `size` and of dtype `grid_licensable_feature_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlGridLicensableFeature_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=grid_licensable_feature_dtype) self._data = arr.view(_numpy.recarray) @@ -18158,10 +18700,10 @@ cdef class GridLicensableFeature: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def feature_code(self): @@ -18277,8 +18819,8 @@ cdef class GridLicensableFeature: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef GridLicensableFeature obj = GridLicensableFeature.__new__(GridLicensableFeature) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(nvmlGridLicensableFeature_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=grid_licensable_feature_dtype) obj._data = data.view(_numpy.recarray) @@ -18287,7 +18829,7 @@ cdef class GridLicensableFeature: cdef _get_unit_fan_speeds_dtype_offsets(): - cdef nvmlUnitFanSpeeds_t pod = nvmlUnitFanSpeeds_t() + cdef nvmlUnitFanSpeeds_t pod return _numpy.dtype({ 'names': ['fans', 'count'], 'formats': [(unit_fan_info_dtype, 24), _numpy.uint32], @@ -18313,7 +18855,7 @@ cdef class UnitFanSpeeds: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlUnitFanSpeeds_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlUnitFanSpeeds_t)) if self._ptr == NULL: raise MemoryError("Error allocating UnitFanSpeeds") self._owner = None @@ -18325,7 +18867,7 @@ cdef class UnitFanSpeeds: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.UnitFanSpeeds object at {hex(id(self))}>" @@ -18346,20 +18888,20 @@ cdef class UnitFanSpeeds: if not isinstance(other, UnitFanSpeeds): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlUnitFanSpeeds_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlUnitFanSpeeds_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlUnitFanSpeeds_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlUnitFanSpeeds_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlUnitFanSpeeds_t)) + self._ptr = _cyb_malloc(sizeof(nvmlUnitFanSpeeds_t)) if self._ptr == NULL: raise MemoryError("Error allocating UnitFanSpeeds") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlUnitFanSpeeds_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlUnitFanSpeeds_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -18378,7 +18920,7 @@ cdef class UnitFanSpeeds: cdef UnitFanInfo val_ = val if len(val) != 24: raise ValueError(f"Expected length { 24 } for field fans, got {len(val)}") - memcpy(&(self._ptr[0].fans), (val_._get_ptr()), sizeof(nvmlUnitFanInfo_t) * 24) + _cyb_memcpy(&(self._ptr[0].fans), (val_._get_ptr()), sizeof(nvmlUnitFanInfo_t) * 24) @property def count(self): @@ -18394,7 +18936,7 @@ cdef class UnitFanSpeeds: @staticmethod def from_buffer(buffer): """Create an UnitFanSpeeds instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlUnitFanSpeeds_t), UnitFanSpeeds) + return _cyb_from_buffer(buffer, sizeof(nvmlUnitFanSpeeds_t), UnitFanSpeeds) @staticmethod def from_data(data): @@ -18403,7 +18945,7 @@ cdef class UnitFanSpeeds: Args: data (_numpy.ndarray): a single-element array of dtype `unit_fan_speeds_dtype` holding the data. """ - return __from_data(data, "unit_fan_speeds_dtype", unit_fan_speeds_dtype, UnitFanSpeeds) + return _cyb_from_data(data, "unit_fan_speeds_dtype", unit_fan_speeds_dtype, UnitFanSpeeds) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -18418,10 +18960,10 @@ cdef class UnitFanSpeeds: raise ValueError("ptr must not be null (0)") cdef UnitFanSpeeds obj = UnitFanSpeeds.__new__(UnitFanSpeeds) if owner is None: - obj._ptr = malloc(sizeof(nvmlUnitFanSpeeds_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlUnitFanSpeeds_t)) if obj._ptr == NULL: raise MemoryError("Error allocating UnitFanSpeeds") - memcpy((obj._ptr), ptr, sizeof(nvmlUnitFanSpeeds_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlUnitFanSpeeds_t)) obj._owner = None obj._owned = True else: @@ -18433,7 +18975,7 @@ cdef class UnitFanSpeeds: cdef _get_vgpu_pgpu_metadata_dtype_offsets(): - cdef nvmlVgpuPgpuMetadata_t pod = nvmlVgpuPgpuMetadata_t() + cdef nvmlVgpuPgpuMetadata_t pod return _numpy.dtype({ 'names': ['version', 'revision', 'host_driver_version', 'pgpu_virtualization_caps', 'reserved', 'host_supported_vgpu_range', 'opaque_data_size', 'opaque_data'], 'formats': [_numpy.uint32, _numpy.uint32, (_numpy.int8, 80), _numpy.uint32, (_numpy.uint32, 5), vgpu_version_dtype, _numpy.uint32, (_numpy.int8, 4)], @@ -18465,7 +19007,7 @@ cdef class VgpuPgpuMetadata: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlVgpuPgpuMetadata_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuPgpuMetadata_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuPgpuMetadata") self._owner = None @@ -18477,7 +19019,7 @@ cdef class VgpuPgpuMetadata: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.VgpuPgpuMetadata object at {hex(id(self))}>" @@ -18498,20 +19040,20 @@ cdef class VgpuPgpuMetadata: if not isinstance(other, VgpuPgpuMetadata): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuPgpuMetadata_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuPgpuMetadata_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuPgpuMetadata_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuPgpuMetadata_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlVgpuPgpuMetadata_t)) + self._ptr = _cyb_malloc(sizeof(nvmlVgpuPgpuMetadata_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuPgpuMetadata") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuPgpuMetadata_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuPgpuMetadata_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -18528,7 +19070,7 @@ cdef class VgpuPgpuMetadata: if self._readonly: raise ValueError("This VgpuPgpuMetadata instance is read-only") cdef VgpuVersion val_ = val - memcpy(&(self._ptr[0].hostSupportedVgpuRange), (val_._get_ptr()), sizeof(nvmlVgpuVersion_t) * 1) + _cyb_memcpy(&(self._ptr[0].hostSupportedVgpuRange), (val_._get_ptr()), sizeof(nvmlVgpuVersion_t) * 1) @property def version(self): @@ -18555,7 +19097,7 @@ cdef class VgpuPgpuMetadata: @property def host_driver_version(self): """~_numpy.int8: (array of length 80).""" - return cpython.PyUnicode_FromString(self._ptr[0].hostDriverVersion) + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].hostDriverVersion) @host_driver_version.setter def host_driver_version(self, val): @@ -18565,7 +19107,7 @@ cdef class VgpuPgpuMetadata: if len(buf) >= 80: raise ValueError("String too long for field host_driver_version, max length is 79") cdef char *ptr = buf - memcpy((self._ptr[0].hostDriverVersion), ptr, 80) + _cyb_memcpy((self._ptr[0].hostDriverVersion), ptr, 80) @property def pgpu_virtualization_caps(self): @@ -18592,7 +19134,7 @@ cdef class VgpuPgpuMetadata: @property def opaque_data(self): """~_numpy.int8: (array of length 4).""" - return cpython.PyUnicode_FromString(self._ptr[0].opaqueData) + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].opaqueData) @opaque_data.setter def opaque_data(self, val): @@ -18602,12 +19144,12 @@ cdef class VgpuPgpuMetadata: if len(buf) >= 4: raise ValueError("String too long for field opaque_data, max length is 3") cdef char *ptr = buf - memcpy((self._ptr[0].opaqueData), ptr, 4) + _cyb_memcpy((self._ptr[0].opaqueData), ptr, 4) @staticmethod def from_buffer(buffer): """Create an VgpuPgpuMetadata instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlVgpuPgpuMetadata_t), VgpuPgpuMetadata) + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuPgpuMetadata_t), VgpuPgpuMetadata) @staticmethod def from_data(data): @@ -18616,7 +19158,7 @@ cdef class VgpuPgpuMetadata: Args: data (_numpy.ndarray): a single-element array of dtype `vgpu_pgpu_metadata_dtype` holding the data. """ - return __from_data(data, "vgpu_pgpu_metadata_dtype", vgpu_pgpu_metadata_dtype, VgpuPgpuMetadata) + return _cyb_from_data(data, "vgpu_pgpu_metadata_dtype", vgpu_pgpu_metadata_dtype, VgpuPgpuMetadata) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -18631,10 +19173,10 @@ cdef class VgpuPgpuMetadata: raise ValueError("ptr must not be null (0)") cdef VgpuPgpuMetadata obj = VgpuPgpuMetadata.__new__(VgpuPgpuMetadata) if owner is None: - obj._ptr = malloc(sizeof(nvmlVgpuPgpuMetadata_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuPgpuMetadata_t)) if obj._ptr == NULL: raise MemoryError("Error allocating VgpuPgpuMetadata") - memcpy((obj._ptr), ptr, sizeof(nvmlVgpuPgpuMetadata_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuPgpuMetadata_t)) obj._owner = None obj._owned = True else: @@ -18646,7 +19188,7 @@ cdef class VgpuPgpuMetadata: cdef _get_gpu_instance_info_dtype_offsets(): - cdef nvmlGpuInstanceInfo_t pod = nvmlGpuInstanceInfo_t() + cdef nvmlGpuInstanceInfo_t pod return _numpy.dtype({ 'names': ['device_', 'id', 'profile_id', 'placement'], 'formats': [_numpy.intp, _numpy.uint32, _numpy.uint32, gpu_instance_placement_dtype], @@ -18674,7 +19216,7 @@ cdef class GpuInstanceInfo: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlGpuInstanceInfo_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlGpuInstanceInfo_t)) if self._ptr == NULL: raise MemoryError("Error allocating GpuInstanceInfo") self._owner = None @@ -18686,7 +19228,7 @@ cdef class GpuInstanceInfo: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.GpuInstanceInfo object at {hex(id(self))}>" @@ -18707,20 +19249,20 @@ cdef class GpuInstanceInfo: if not isinstance(other, GpuInstanceInfo): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuInstanceInfo_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuInstanceInfo_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlGpuInstanceInfo_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlGpuInstanceInfo_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlGpuInstanceInfo_t)) + self._ptr = _cyb_malloc(sizeof(nvmlGpuInstanceInfo_t)) if self._ptr == NULL: raise MemoryError("Error allocating GpuInstanceInfo") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuInstanceInfo_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuInstanceInfo_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -18737,7 +19279,7 @@ cdef class GpuInstanceInfo: if self._readonly: raise ValueError("This GpuInstanceInfo instance is read-only") cdef GpuInstancePlacement val_ = val - memcpy(&(self._ptr[0].placement), (val_._get_ptr()), sizeof(nvmlGpuInstancePlacement_t) * 1) + _cyb_memcpy(&(self._ptr[0].placement), (val_._get_ptr()), sizeof(nvmlGpuInstancePlacement_t) * 1) @property def device_(self): @@ -18775,7 +19317,7 @@ cdef class GpuInstanceInfo: @staticmethod def from_buffer(buffer): """Create an GpuInstanceInfo instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlGpuInstanceInfo_t), GpuInstanceInfo) + return _cyb_from_buffer(buffer, sizeof(nvmlGpuInstanceInfo_t), GpuInstanceInfo) @staticmethod def from_data(data): @@ -18784,7 +19326,7 @@ cdef class GpuInstanceInfo: Args: data (_numpy.ndarray): a single-element array of dtype `gpu_instance_info_dtype` holding the data. """ - return __from_data(data, "gpu_instance_info_dtype", gpu_instance_info_dtype, GpuInstanceInfo) + return _cyb_from_data(data, "gpu_instance_info_dtype", gpu_instance_info_dtype, GpuInstanceInfo) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -18799,10 +19341,10 @@ cdef class GpuInstanceInfo: raise ValueError("ptr must not be null (0)") cdef GpuInstanceInfo obj = GpuInstanceInfo.__new__(GpuInstanceInfo) if owner is None: - obj._ptr = malloc(sizeof(nvmlGpuInstanceInfo_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlGpuInstanceInfo_t)) if obj._ptr == NULL: raise MemoryError("Error allocating GpuInstanceInfo") - memcpy((obj._ptr), ptr, sizeof(nvmlGpuInstanceInfo_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGpuInstanceInfo_t)) obj._owner = None obj._owned = True else: @@ -18814,7 +19356,7 @@ cdef class GpuInstanceInfo: cdef _get_compute_instance_info_dtype_offsets(): - cdef nvmlComputeInstanceInfo_t pod = nvmlComputeInstanceInfo_t() + cdef nvmlComputeInstanceInfo_t pod return _numpy.dtype({ 'names': ['device_', 'gpu_instance', 'id', 'profile_id', 'placement'], 'formats': [_numpy.intp, _numpy.intp, _numpy.uint32, _numpy.uint32, compute_instance_placement_dtype], @@ -18843,7 +19385,7 @@ cdef class ComputeInstanceInfo: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlComputeInstanceInfo_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlComputeInstanceInfo_t)) if self._ptr == NULL: raise MemoryError("Error allocating ComputeInstanceInfo") self._owner = None @@ -18855,7 +19397,7 @@ cdef class ComputeInstanceInfo: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.ComputeInstanceInfo object at {hex(id(self))}>" @@ -18876,20 +19418,20 @@ cdef class ComputeInstanceInfo: if not isinstance(other, ComputeInstanceInfo): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlComputeInstanceInfo_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlComputeInstanceInfo_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlComputeInstanceInfo_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlComputeInstanceInfo_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlComputeInstanceInfo_t)) + self._ptr = _cyb_malloc(sizeof(nvmlComputeInstanceInfo_t)) if self._ptr == NULL: raise MemoryError("Error allocating ComputeInstanceInfo") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlComputeInstanceInfo_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlComputeInstanceInfo_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -18906,7 +19448,7 @@ cdef class ComputeInstanceInfo: if self._readonly: raise ValueError("This ComputeInstanceInfo instance is read-only") cdef ComputeInstancePlacement val_ = val - memcpy(&(self._ptr[0].placement), (val_._get_ptr()), sizeof(nvmlComputeInstancePlacement_t) * 1) + _cyb_memcpy(&(self._ptr[0].placement), (val_._get_ptr()), sizeof(nvmlComputeInstancePlacement_t) * 1) @property def device_(self): @@ -18955,7 +19497,7 @@ cdef class ComputeInstanceInfo: @staticmethod def from_buffer(buffer): """Create an ComputeInstanceInfo instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlComputeInstanceInfo_t), ComputeInstanceInfo) + return _cyb_from_buffer(buffer, sizeof(nvmlComputeInstanceInfo_t), ComputeInstanceInfo) @staticmethod def from_data(data): @@ -18964,7 +19506,7 @@ cdef class ComputeInstanceInfo: Args: data (_numpy.ndarray): a single-element array of dtype `compute_instance_info_dtype` holding the data. """ - return __from_data(data, "compute_instance_info_dtype", compute_instance_info_dtype, ComputeInstanceInfo) + return _cyb_from_data(data, "compute_instance_info_dtype", compute_instance_info_dtype, ComputeInstanceInfo) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -18979,10 +19521,10 @@ cdef class ComputeInstanceInfo: raise ValueError("ptr must not be null (0)") cdef ComputeInstanceInfo obj = ComputeInstanceInfo.__new__(ComputeInstanceInfo) if owner is None: - obj._ptr = malloc(sizeof(nvmlComputeInstanceInfo_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlComputeInstanceInfo_t)) if obj._ptr == NULL: raise MemoryError("Error allocating ComputeInstanceInfo") - memcpy((obj._ptr), ptr, sizeof(nvmlComputeInstanceInfo_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlComputeInstanceInfo_t)) obj._owner = None obj._owned = True else: @@ -18994,7 +19536,7 @@ cdef class ComputeInstanceInfo: cdef _get_ecc_sram_unique_uncorrected_error_counts_v1_dtype_offsets(): - cdef nvmlEccSramUniqueUncorrectedErrorCounts_v1_t pod = nvmlEccSramUniqueUncorrectedErrorCounts_v1_t() + cdef nvmlEccSramUniqueUncorrectedErrorCounts_v1_t pod return _numpy.dtype({ 'names': ['version', 'entry_count', 'entries'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.intp], @@ -19022,7 +19564,7 @@ cdef class EccSramUniqueUncorrectedErrorCounts_v1: dict _refs def __init__(self): - self._ptr = calloc(1, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating EccSramUniqueUncorrectedErrorCounts_v1") self._owner = None @@ -19035,7 +19577,7 @@ cdef class EccSramUniqueUncorrectedErrorCounts_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.EccSramUniqueUncorrectedErrorCounts_v1 object at {hex(id(self))}>" @@ -19056,20 +19598,20 @@ cdef class EccSramUniqueUncorrectedErrorCounts_v1: if not isinstance(other, EccSramUniqueUncorrectedErrorCounts_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating EccSramUniqueUncorrectedErrorCounts_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -19106,7 +19648,7 @@ cdef class EccSramUniqueUncorrectedErrorCounts_v1: @staticmethod def from_buffer(buffer): """Create an EccSramUniqueUncorrectedErrorCounts_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t), EccSramUniqueUncorrectedErrorCounts_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t), EccSramUniqueUncorrectedErrorCounts_v1) @staticmethod def from_data(data): @@ -19115,7 +19657,7 @@ cdef class EccSramUniqueUncorrectedErrorCounts_v1: Args: data (_numpy.ndarray): a single-element array of dtype `ecc_sram_unique_uncorrected_error_counts_v1_dtype` holding the data. """ - return __from_data(data, "ecc_sram_unique_uncorrected_error_counts_v1_dtype", ecc_sram_unique_uncorrected_error_counts_v1_dtype, EccSramUniqueUncorrectedErrorCounts_v1) + return _cyb_from_data(data, "ecc_sram_unique_uncorrected_error_counts_v1_dtype", ecc_sram_unique_uncorrected_error_counts_v1_dtype, EccSramUniqueUncorrectedErrorCounts_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -19130,10 +19672,10 @@ cdef class EccSramUniqueUncorrectedErrorCounts_v1: raise ValueError("ptr must not be null (0)") cdef EccSramUniqueUncorrectedErrorCounts_v1 obj = EccSramUniqueUncorrectedErrorCounts_v1.__new__(EccSramUniqueUncorrectedErrorCounts_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating EccSramUniqueUncorrectedErrorCounts_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) obj._owner = None obj._owned = True else: @@ -19146,7 +19688,7 @@ cdef class EccSramUniqueUncorrectedErrorCounts_v1: cdef _get_nvlink_firmware_info_dtype_offsets(): - cdef nvmlNvlinkFirmwareInfo_t pod = nvmlNvlinkFirmwareInfo_t() + cdef nvmlNvlinkFirmwareInfo_t pod return _numpy.dtype({ 'names': ['firmware_version', 'num_valid_entries'], 'formats': [(nvlink_firmware_version_dtype, 100), _numpy.uint32], @@ -19172,7 +19714,7 @@ cdef class NvlinkFirmwareInfo: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlNvlinkFirmwareInfo_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlNvlinkFirmwareInfo_t)) if self._ptr == NULL: raise MemoryError("Error allocating NvlinkFirmwareInfo") self._owner = None @@ -19184,7 +19726,7 @@ cdef class NvlinkFirmwareInfo: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.NvlinkFirmwareInfo object at {hex(id(self))}>" @@ -19205,68 +19747,262 @@ cdef class NvlinkFirmwareInfo: if not isinstance(other, NvlinkFirmwareInfo): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvlinkFirmwareInfo_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvlinkFirmwareInfo_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlNvlinkFirmwareInfo_t), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + if key == 0 and isinstance(val, _numpy.ndarray): + self._ptr = _cyb_malloc(sizeof(nvmlNvlinkFirmwareInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating NvlinkFirmwareInfo") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvlinkFirmwareInfo_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def firmware_version(self): + """NvlinkFirmwareVersion: OUT - NVLINK firmware version.""" + return NvlinkFirmwareVersion.from_ptr(&(self._ptr[0].firmwareVersion), 100, self._readonly) + + @firmware_version.setter + def firmware_version(self, val): + if self._readonly: + raise ValueError("This NvlinkFirmwareInfo instance is read-only") + cdef NvlinkFirmwareVersion val_ = val + if len(val) != 100: + raise ValueError(f"Expected length { 100 } for field firmware_version, got {len(val)}") + _cyb_memcpy(&(self._ptr[0].firmwareVersion), (val_._get_ptr()), sizeof(nvmlNvlinkFirmwareVersion_t) * 100) + + @property + def num_valid_entries(self): + """int: OUT - Number of valid firmware entries.""" + return self._ptr[0].numValidEntries + + @num_valid_entries.setter + def num_valid_entries(self, val): + if self._readonly: + raise ValueError("This NvlinkFirmwareInfo instance is read-only") + self._ptr[0].numValidEntries = val + + @staticmethod + def from_buffer(buffer): + """Create an NvlinkFirmwareInfo instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlNvlinkFirmwareInfo_t), NvlinkFirmwareInfo) + + @staticmethod + def from_data(data): + """Create an NvlinkFirmwareInfo instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `nvlink_firmware_info_dtype` holding the data. + """ + return _cyb_from_data(data, "nvlink_firmware_info_dtype", nvlink_firmware_info_dtype, NvlinkFirmwareInfo) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an NvlinkFirmwareInfo instance wrapping the given pointer. + + Args: + ptr (intptr_t): pointer address as Python :class:`int` to the data. + owner (object): The Python object that owns the pointer. If not provided, data will be copied. + readonly (bool): whether the data is read-only (to the user). default is `False`. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef NvlinkFirmwareInfo obj = NvlinkFirmwareInfo.__new__(NvlinkFirmwareInfo) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlNvlinkFirmwareInfo_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating NvlinkFirmwareInfo") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlNvlinkFirmwareInfo_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_vgpu_scheduler_log_info_v2_dtype_offsets(): + cdef nvmlVgpuSchedulerLogInfo_v2_t pod + return _numpy.dtype({ + 'names': ['engine_id', 'scheduler_policy', 'avg_factor', 'timeslice', 'entries_count', 'log_entries'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (vgpu_scheduler_log_entry_v2_dtype, 200)], + 'offsets': [ + (&(pod.engineId)) - (&pod), + (&(pod.schedulerPolicy)) - (&pod), + (&(pod.avgFactor)) - (&pod), + (&(pod.timeslice)) - (&pod), + (&(pod.entriesCount)) - (&pod), + (&(pod.logEntries)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerLogInfo_v2_t), + }) + +vgpu_scheduler_log_info_v2_dtype = _get_vgpu_scheduler_log_info_v2_dtype_offsets() + +cdef class VgpuSchedulerLogInfo_v2: + """Empty-initialize an instance of `nvmlVgpuSchedulerLogInfo_v2_t`. + + + .. seealso:: `nvmlVgpuSchedulerLogInfo_v2_t` + """ + cdef: + nvmlVgpuSchedulerLogInfo_v2_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerLogInfo_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerLogInfo_v2") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuSchedulerLogInfo_v2_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuSchedulerLogInfo_v2 object at {hex(id(self))}>" + + @property + def ptr(self): + """Get the pointer address to the data as Python :class:`int`.""" + return (self._ptr) + + cdef intptr_t _get_ptr(self): + return (self._ptr) + + def __int__(self): + return (self._ptr) + + def __eq__(self, other): + cdef VgpuSchedulerLogInfo_v2 other_ + if not isinstance(other, VgpuSchedulerLogInfo_v2): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerLogInfo_v2_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerLogInfo_v2_t), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + if key == 0 and isinstance(val, _numpy.ndarray): + self._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerLogInfo_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerLogInfo_v2") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerLogInfo_v2_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def log_entries(self): + """VgpuSchedulerLogEntry_v2: OUT: Structure to store the state and logs of a software runlist.""" + return VgpuSchedulerLogEntry_v2.from_ptr(&(self._ptr[0].logEntries), 200, self._readonly) + + @log_entries.setter + def log_entries(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLogInfo_v2 instance is read-only") + cdef VgpuSchedulerLogEntry_v2 val_ = val + if len(val) != 200: + raise ValueError(f"Expected length { 200 } for field log_entries, got {len(val)}") + _cyb_memcpy(&(self._ptr[0].logEntries), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerLogEntry_v2_t) * 200) + + @property + def engine_id(self): + """int: IN: Engine whose software runlist log entries are fetched. One of One of NVML_VGPU_SCHEDULER_ENGINE_TYPE_*.""" + return self._ptr[0].engineId + + @engine_id.setter + def engine_id(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLogInfo_v2 instance is read-only") + self._ptr[0].engineId = val - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlNvlinkFirmwareInfo_t), self._readonly) + @property + def scheduler_policy(self): + """int: OUT: Scheduler policy.""" + return self._ptr[0].schedulerPolicy - def __releasebuffer__(self, Py_buffer *buffer): - pass + @scheduler_policy.setter + def scheduler_policy(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLogInfo_v2 instance is read-only") + self._ptr[0].schedulerPolicy = val - def __setitem__(self, key, val): - if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlNvlinkFirmwareInfo_t)) - if self._ptr == NULL: - raise MemoryError("Error allocating NvlinkFirmwareInfo") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvlinkFirmwareInfo_t)) - self._owner = None - self._owned = True - self._readonly = not val.flags.writeable - else: - setattr(self, key, val) + @property + def avg_factor(self): + """int: OUT: Average factor in compensating the timeslice for Adaptive Round Robin mode. 0 when there is no active scheduling.""" + return self._ptr[0].avgFactor + + @avg_factor.setter + def avg_factor(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLogInfo_v2 instance is read-only") + self._ptr[0].avgFactor = val @property - def firmware_version(self): - """NvlinkFirmwareVersion: OUT - NVLINK firmware version.""" - return NvlinkFirmwareVersion.from_ptr(&(self._ptr[0].firmwareVersion), 100, self._readonly) + def timeslice(self): + """int: OUT: The timeslice in ns for each software run list as configured, or the default value otherwise. 0 when there is no active scheduling.""" + return self._ptr[0].timeslice - @firmware_version.setter - def firmware_version(self, val): + @timeslice.setter + def timeslice(self, val): if self._readonly: - raise ValueError("This NvlinkFirmwareInfo instance is read-only") - cdef NvlinkFirmwareVersion val_ = val - if len(val) != 100: - raise ValueError(f"Expected length { 100 } for field firmware_version, got {len(val)}") - memcpy(&(self._ptr[0].firmwareVersion), (val_._get_ptr()), sizeof(nvmlNvlinkFirmwareVersion_t) * 100) + raise ValueError("This VgpuSchedulerLogInfo_v2 instance is read-only") + self._ptr[0].timeslice = val @property - def num_valid_entries(self): - """int: OUT - Number of valid firmware entries.""" - return self._ptr[0].numValidEntries + def entries_count(self): + """int: OUT: Count of log entries fetched.""" + return self._ptr[0].entriesCount - @num_valid_entries.setter - def num_valid_entries(self, val): + @entries_count.setter + def entries_count(self, val): if self._readonly: - raise ValueError("This NvlinkFirmwareInfo instance is read-only") - self._ptr[0].numValidEntries = val + raise ValueError("This VgpuSchedulerLogInfo_v2 instance is read-only") + self._ptr[0].entriesCount = val @staticmethod def from_buffer(buffer): - """Create an NvlinkFirmwareInfo instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlNvlinkFirmwareInfo_t), NvlinkFirmwareInfo) + """Create an VgpuSchedulerLogInfo_v2 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerLogInfo_v2_t), VgpuSchedulerLogInfo_v2) @staticmethod def from_data(data): - """Create an NvlinkFirmwareInfo instance wrapping the given NumPy array. + """Create an VgpuSchedulerLogInfo_v2 instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `nvlink_firmware_info_dtype` holding the data. + data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_log_info_v2_dtype` holding the data. """ - return __from_data(data, "nvlink_firmware_info_dtype", nvlink_firmware_info_dtype, NvlinkFirmwareInfo) + return _cyb_from_data(data, "vgpu_scheduler_log_info_v2_dtype", vgpu_scheduler_log_info_v2_dtype, VgpuSchedulerLogInfo_v2) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an NvlinkFirmwareInfo instance wrapping the given pointer. + """Create an VgpuSchedulerLogInfo_v2 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -19275,16 +20011,16 @@ cdef class NvlinkFirmwareInfo: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef NvlinkFirmwareInfo obj = NvlinkFirmwareInfo.__new__(NvlinkFirmwareInfo) + cdef VgpuSchedulerLogInfo_v2 obj = VgpuSchedulerLogInfo_v2.__new__(VgpuSchedulerLogInfo_v2) if owner is None: - obj._ptr = malloc(sizeof(nvmlNvlinkFirmwareInfo_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerLogInfo_v2_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating NvlinkFirmwareInfo") - memcpy((obj._ptr), ptr, sizeof(nvmlNvlinkFirmwareInfo_t)) + raise MemoryError("Error allocating VgpuSchedulerLogInfo_v2") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerLogInfo_v2_t)) obj._owner = None obj._owned = True else: - obj._ptr = ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly @@ -19292,7 +20028,7 @@ cdef class NvlinkFirmwareInfo: cdef _get_vgpu_instances_utilization_info_v1_dtype_offsets(): - cdef nvmlVgpuInstancesUtilizationInfo_v1_t pod = nvmlVgpuInstancesUtilizationInfo_v1_t() + cdef nvmlVgpuInstancesUtilizationInfo_v1_t pod return _numpy.dtype({ 'names': ['version', 'sample_val_type', 'vgpu_instance_count', 'last_seen_time_stamp', 'vgpu_util_array'], 'formats': [_numpy.uint32, _numpy.int32, _numpy.uint32, _numpy.uint64, _numpy.intp], @@ -19322,7 +20058,7 @@ cdef class VgpuInstancesUtilizationInfo_v1: dict _refs def __init__(self): - self._ptr = calloc(1, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuInstancesUtilizationInfo_v1") self._owner = None @@ -19335,7 +20071,7 @@ cdef class VgpuInstancesUtilizationInfo_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.VgpuInstancesUtilizationInfo_v1 object at {hex(id(self))}>" @@ -19356,20 +20092,20 @@ cdef class VgpuInstancesUtilizationInfo_v1: if not isinstance(other, VgpuInstancesUtilizationInfo_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuInstancesUtilizationInfo_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -19428,7 +20164,7 @@ cdef class VgpuInstancesUtilizationInfo_v1: @staticmethod def from_buffer(buffer): """Create an VgpuInstancesUtilizationInfo_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t), VgpuInstancesUtilizationInfo_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t), VgpuInstancesUtilizationInfo_v1) @staticmethod def from_data(data): @@ -19437,7 +20173,7 @@ cdef class VgpuInstancesUtilizationInfo_v1: Args: data (_numpy.ndarray): a single-element array of dtype `vgpu_instances_utilization_info_v1_dtype` holding the data. """ - return __from_data(data, "vgpu_instances_utilization_info_v1_dtype", vgpu_instances_utilization_info_v1_dtype, VgpuInstancesUtilizationInfo_v1) + return _cyb_from_data(data, "vgpu_instances_utilization_info_v1_dtype", vgpu_instances_utilization_info_v1_dtype, VgpuInstancesUtilizationInfo_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -19452,10 +20188,10 @@ cdef class VgpuInstancesUtilizationInfo_v1: raise ValueError("ptr must not be null (0)") cdef VgpuInstancesUtilizationInfo_v1 obj = VgpuInstancesUtilizationInfo_v1.__new__(VgpuInstancesUtilizationInfo_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating VgpuInstancesUtilizationInfo_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) obj._owner = None obj._owned = True else: @@ -19468,7 +20204,7 @@ cdef class VgpuInstancesUtilizationInfo_v1: cdef _get_prm_counter_v1_dtype_offsets(): - cdef nvmlPRMCounter_v1_t pod = nvmlPRMCounter_v1_t() + cdef nvmlPRMCounter_v1_t pod return _numpy.dtype({ 'names': ['counter_id', 'in_data', 'counter_value'], 'formats': [_numpy.uint32, prm_counter_input_v1_dtype, prm_counter_value_v1_dtype], @@ -19484,21 +20220,17 @@ prm_counter_v1_dtype = _get_prm_counter_v1_dtype_offsets() cdef class PRMCounter_v1: """Empty-initialize an array of `nvmlPRMCounter_v1_t`. - The resulting object is of length `size` and of dtype `prm_counter_v1_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlPRMCounter_v1_t` """ cdef: readonly object _data - - def __init__(self, size=1): arr = _numpy.empty(size, dtype=prm_counter_v1_dtype) self._data = arr.view(_numpy.recarray) @@ -19535,14 +20267,14 @@ cdef class PRMCounter_v1: return bool((self_data == other._data).all()) def __getbuffer__(self, Py_buffer *buffer, int flags): - cpython.PyObject_GetBuffer(self._data, buffer, flags) + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - cpython.PyBuffer_Release(buffer) + _cyb_cpython.PyBuffer_Release(buffer) @property def counter_id(self): - """Union[~_numpy.uint32, int]: Counter ID, one of nvmlPRMCounterId_t.""" + """Union[~_numpy.uint32, int]: Counter ID, one of `nvmlPRMCounterId_t`.""" if self._data.size == 1: return int(self._data.counter_id[0]) return self._data.counter_id @@ -19623,8 +20355,8 @@ cdef class PRMCounter_v1: if ptr == 0: raise ValueError("ptr must not be null (0)") cdef PRMCounter_v1 obj = PRMCounter_v1.__new__(PRMCounter_v1) - cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE - cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( ptr, sizeof(nvmlPRMCounter_v1_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=prm_counter_v1_dtype) obj._data = data.view(_numpy.recarray) @@ -19633,7 +20365,7 @@ cdef class PRMCounter_v1: cdef _get_vgpu_scheduler_log_dtype_offsets(): - cdef nvmlVgpuSchedulerLog_t pod = nvmlVgpuSchedulerLog_t() + cdef nvmlVgpuSchedulerLog_t pod return _numpy.dtype({ 'names': ['engine_id', 'scheduler_policy', 'arr_mode', 'scheduler_params', 'entries_count', 'log_entries'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype, _numpy.uint32, (vgpu_scheduler_log_entry_dtype, 200)], @@ -19663,7 +20395,7 @@ cdef class VgpuSchedulerLog: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlVgpuSchedulerLog_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerLog_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuSchedulerLog") self._owner = None @@ -19675,7 +20407,7 @@ cdef class VgpuSchedulerLog: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.VgpuSchedulerLog object at {hex(id(self))}>" @@ -19696,20 +20428,20 @@ cdef class VgpuSchedulerLog: if not isinstance(other, VgpuSchedulerLog): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerLog_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerLog_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerLog_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerLog_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlVgpuSchedulerLog_t)) + self._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerLog_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuSchedulerLog") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerLog_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerLog_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -19726,7 +20458,7 @@ cdef class VgpuSchedulerLog: if self._readonly: raise ValueError("This VgpuSchedulerLog instance is read-only") cdef VgpuSchedulerParams val_ = val - memcpy(&(self._ptr[0].schedulerParams), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerParams_t) * 1) + _cyb_memcpy(&(self._ptr[0].schedulerParams), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerParams_t) * 1) @property def log_entries(self): @@ -19740,7 +20472,7 @@ cdef class VgpuSchedulerLog: cdef VgpuSchedulerLogEntry val_ = val if len(val) != 200: raise ValueError(f"Expected length { 200 } for field log_entries, got {len(val)}") - memcpy(&(self._ptr[0].logEntries), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerLogEntry_t) * 200) + _cyb_memcpy(&(self._ptr[0].logEntries), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerLogEntry_t) * 200) @property def engine_id(self): @@ -19789,7 +20521,7 @@ cdef class VgpuSchedulerLog: @staticmethod def from_buffer(buffer): """Create an VgpuSchedulerLog instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlVgpuSchedulerLog_t), VgpuSchedulerLog) + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerLog_t), VgpuSchedulerLog) @staticmethod def from_data(data): @@ -19798,7 +20530,7 @@ cdef class VgpuSchedulerLog: Args: data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_log_dtype` holding the data. """ - return __from_data(data, "vgpu_scheduler_log_dtype", vgpu_scheduler_log_dtype, VgpuSchedulerLog) + return _cyb_from_data(data, "vgpu_scheduler_log_dtype", vgpu_scheduler_log_dtype, VgpuSchedulerLog) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -19813,10 +20545,10 @@ cdef class VgpuSchedulerLog: raise ValueError("ptr must not be null (0)") cdef VgpuSchedulerLog obj = VgpuSchedulerLog.__new__(VgpuSchedulerLog) if owner is None: - obj._ptr = malloc(sizeof(nvmlVgpuSchedulerLog_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerLog_t)) if obj._ptr == NULL: raise MemoryError("Error allocating VgpuSchedulerLog") - memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerLog_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerLog_t)) obj._owner = None obj._owned = True else: @@ -19828,7 +20560,7 @@ cdef class VgpuSchedulerLog: cdef _get_vgpu_scheduler_get_state_dtype_offsets(): - cdef nvmlVgpuSchedulerGetState_t pod = nvmlVgpuSchedulerGetState_t() + cdef nvmlVgpuSchedulerGetState_t pod return _numpy.dtype({ 'names': ['scheduler_policy', 'arr_mode', 'scheduler_params'], 'formats': [_numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype], @@ -19855,7 +20587,7 @@ cdef class VgpuSchedulerGetState: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlVgpuSchedulerGetState_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerGetState_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuSchedulerGetState") self._owner = None @@ -19867,7 +20599,7 @@ cdef class VgpuSchedulerGetState: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.VgpuSchedulerGetState object at {hex(id(self))}>" @@ -19888,20 +20620,20 @@ cdef class VgpuSchedulerGetState: if not isinstance(other, VgpuSchedulerGetState): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerGetState_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerGetState_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerGetState_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerGetState_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlVgpuSchedulerGetState_t)) + self._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerGetState_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuSchedulerGetState") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerGetState_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerGetState_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -19918,7 +20650,7 @@ cdef class VgpuSchedulerGetState: if self._readonly: raise ValueError("This VgpuSchedulerGetState instance is read-only") cdef VgpuSchedulerParams val_ = val - memcpy(&(self._ptr[0].schedulerParams), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerParams_t) * 1) + _cyb_memcpy(&(self._ptr[0].schedulerParams), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerParams_t) * 1) @property def scheduler_policy(self): @@ -19945,7 +20677,7 @@ cdef class VgpuSchedulerGetState: @staticmethod def from_buffer(buffer): """Create an VgpuSchedulerGetState instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlVgpuSchedulerGetState_t), VgpuSchedulerGetState) + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerGetState_t), VgpuSchedulerGetState) @staticmethod def from_data(data): @@ -19954,7 +20686,7 @@ cdef class VgpuSchedulerGetState: Args: data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_get_state_dtype` holding the data. """ - return __from_data(data, "vgpu_scheduler_get_state_dtype", vgpu_scheduler_get_state_dtype, VgpuSchedulerGetState) + return _cyb_from_data(data, "vgpu_scheduler_get_state_dtype", vgpu_scheduler_get_state_dtype, VgpuSchedulerGetState) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -19969,10 +20701,10 @@ cdef class VgpuSchedulerGetState: raise ValueError("ptr must not be null (0)") cdef VgpuSchedulerGetState obj = VgpuSchedulerGetState.__new__(VgpuSchedulerGetState) if owner is None: - obj._ptr = malloc(sizeof(nvmlVgpuSchedulerGetState_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerGetState_t)) if obj._ptr == NULL: raise MemoryError("Error allocating VgpuSchedulerGetState") - memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerGetState_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerGetState_t)) obj._owner = None obj._owned = True else: @@ -19984,7 +20716,7 @@ cdef class VgpuSchedulerGetState: cdef _get_vgpu_scheduler_state_info_v1_dtype_offsets(): - cdef nvmlVgpuSchedulerStateInfo_v1_t pod = nvmlVgpuSchedulerStateInfo_v1_t() + cdef nvmlVgpuSchedulerStateInfo_v1_t pod return _numpy.dtype({ 'names': ['version', 'engine_id', 'scheduler_policy', 'arr_mode', 'scheduler_params'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype], @@ -20013,7 +20745,7 @@ cdef class VgpuSchedulerStateInfo_v1: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuSchedulerStateInfo_v1") self._owner = None @@ -20025,7 +20757,7 @@ cdef class VgpuSchedulerStateInfo_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.VgpuSchedulerStateInfo_v1 object at {hex(id(self))}>" @@ -20046,20 +20778,20 @@ cdef class VgpuSchedulerStateInfo_v1: if not isinstance(other, VgpuSchedulerStateInfo_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerStateInfo_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerStateInfo_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuSchedulerStateInfo_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -20076,7 +20808,7 @@ cdef class VgpuSchedulerStateInfo_v1: if self._readonly: raise ValueError("This VgpuSchedulerStateInfo_v1 instance is read-only") cdef VgpuSchedulerParams val_ = val - memcpy(&(self._ptr[0].schedulerParams), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerParams_t) * 1) + _cyb_memcpy(&(self._ptr[0].schedulerParams), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerParams_t) * 1) @property def version(self): @@ -20125,7 +20857,7 @@ cdef class VgpuSchedulerStateInfo_v1: @staticmethod def from_buffer(buffer): """Create an VgpuSchedulerStateInfo_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlVgpuSchedulerStateInfo_v1_t), VgpuSchedulerStateInfo_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerStateInfo_v1_t), VgpuSchedulerStateInfo_v1) @staticmethod def from_data(data): @@ -20134,7 +20866,7 @@ cdef class VgpuSchedulerStateInfo_v1: Args: data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_state_info_v1_dtype` holding the data. """ - return __from_data(data, "vgpu_scheduler_state_info_v1_dtype", vgpu_scheduler_state_info_v1_dtype, VgpuSchedulerStateInfo_v1) + return _cyb_from_data(data, "vgpu_scheduler_state_info_v1_dtype", vgpu_scheduler_state_info_v1_dtype, VgpuSchedulerStateInfo_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -20149,10 +20881,10 @@ cdef class VgpuSchedulerStateInfo_v1: raise ValueError("ptr must not be null (0)") cdef VgpuSchedulerStateInfo_v1 obj = VgpuSchedulerStateInfo_v1.__new__(VgpuSchedulerStateInfo_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating VgpuSchedulerStateInfo_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) obj._owner = None obj._owned = True else: @@ -20164,7 +20896,7 @@ cdef class VgpuSchedulerStateInfo_v1: cdef _get_vgpu_scheduler_log_info_v1_dtype_offsets(): - cdef nvmlVgpuSchedulerLogInfo_v1_t pod = nvmlVgpuSchedulerLogInfo_v1_t() + cdef nvmlVgpuSchedulerLogInfo_v1_t pod return _numpy.dtype({ 'names': ['version', 'engine_id', 'scheduler_policy', 'arr_mode', 'scheduler_params', 'entries_count', 'log_entries'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype, _numpy.uint32, (vgpu_scheduler_log_entry_dtype, 200)], @@ -20195,7 +20927,7 @@ cdef class VgpuSchedulerLogInfo_v1: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuSchedulerLogInfo_v1") self._owner = None @@ -20207,7 +20939,7 @@ cdef class VgpuSchedulerLogInfo_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.VgpuSchedulerLogInfo_v1 object at {hex(id(self))}>" @@ -20228,20 +20960,20 @@ cdef class VgpuSchedulerLogInfo_v1: if not isinstance(other, VgpuSchedulerLogInfo_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerLogInfo_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerLogInfo_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuSchedulerLogInfo_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -20258,7 +20990,7 @@ cdef class VgpuSchedulerLogInfo_v1: if self._readonly: raise ValueError("This VgpuSchedulerLogInfo_v1 instance is read-only") cdef VgpuSchedulerParams val_ = val - memcpy(&(self._ptr[0].schedulerParams), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerParams_t) * 1) + _cyb_memcpy(&(self._ptr[0].schedulerParams), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerParams_t) * 1) @property def log_entries(self): @@ -20272,7 +21004,7 @@ cdef class VgpuSchedulerLogInfo_v1: cdef VgpuSchedulerLogEntry val_ = val if len(val) != 200: raise ValueError(f"Expected length { 200 } for field log_entries, got {len(val)}") - memcpy(&(self._ptr[0].logEntries), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerLogEntry_t) * 200) + _cyb_memcpy(&(self._ptr[0].logEntries), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerLogEntry_t) * 200) @property def version(self): @@ -20332,7 +21064,7 @@ cdef class VgpuSchedulerLogInfo_v1: @staticmethod def from_buffer(buffer): """Create an VgpuSchedulerLogInfo_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlVgpuSchedulerLogInfo_v1_t), VgpuSchedulerLogInfo_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerLogInfo_v1_t), VgpuSchedulerLogInfo_v1) @staticmethod def from_data(data): @@ -20341,7 +21073,7 @@ cdef class VgpuSchedulerLogInfo_v1: Args: data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_log_info_v1_dtype` holding the data. """ - return __from_data(data, "vgpu_scheduler_log_info_v1_dtype", vgpu_scheduler_log_info_v1_dtype, VgpuSchedulerLogInfo_v1) + return _cyb_from_data(data, "vgpu_scheduler_log_info_v1_dtype", vgpu_scheduler_log_info_v1_dtype, VgpuSchedulerLogInfo_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -20356,10 +21088,10 @@ cdef class VgpuSchedulerLogInfo_v1: raise ValueError("ptr must not be null (0)") cdef VgpuSchedulerLogInfo_v1 obj = VgpuSchedulerLogInfo_v1.__new__(VgpuSchedulerLogInfo_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating VgpuSchedulerLogInfo_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) obj._owner = None obj._owned = True else: @@ -20371,7 +21103,7 @@ cdef class VgpuSchedulerLogInfo_v1: cdef _get_vgpu_scheduler_state_v1_dtype_offsets(): - cdef nvmlVgpuSchedulerState_v1_t pod = nvmlVgpuSchedulerState_v1_t() + cdef nvmlVgpuSchedulerState_v1_t pod return _numpy.dtype({ 'names': ['version', 'engine_id', 'scheduler_policy', 'enable_arr_mode', 'scheduler_params'], 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_set_params_dtype], @@ -20400,7 +21132,7 @@ cdef class VgpuSchedulerState_v1: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlVgpuSchedulerState_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerState_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuSchedulerState_v1") self._owner = None @@ -20412,7 +21144,7 @@ cdef class VgpuSchedulerState_v1: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.VgpuSchedulerState_v1 object at {hex(id(self))}>" @@ -20433,20 +21165,20 @@ cdef class VgpuSchedulerState_v1: if not isinstance(other, VgpuSchedulerState_v1): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerState_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerState_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerState_v1_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerState_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlVgpuSchedulerState_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerState_v1_t)) if self._ptr == NULL: raise MemoryError("Error allocating VgpuSchedulerState_v1") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerState_v1_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerState_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -20463,7 +21195,7 @@ cdef class VgpuSchedulerState_v1: if self._readonly: raise ValueError("This VgpuSchedulerState_v1 instance is read-only") cdef VgpuSchedulerSetParams val_ = val - memcpy(&(self._ptr[0].schedulerParams), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerSetParams_t) * 1) + _cyb_memcpy(&(self._ptr[0].schedulerParams), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerSetParams_t) * 1) @property def version(self): @@ -20512,7 +21244,7 @@ cdef class VgpuSchedulerState_v1: @staticmethod def from_buffer(buffer): """Create an VgpuSchedulerState_v1 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlVgpuSchedulerState_v1_t), VgpuSchedulerState_v1) + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerState_v1_t), VgpuSchedulerState_v1) @staticmethod def from_data(data): @@ -20521,7 +21253,7 @@ cdef class VgpuSchedulerState_v1: Args: data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_state_v1_dtype` holding the data. """ - return __from_data(data, "vgpu_scheduler_state_v1_dtype", vgpu_scheduler_state_v1_dtype, VgpuSchedulerState_v1) + return _cyb_from_data(data, "vgpu_scheduler_state_v1_dtype", vgpu_scheduler_state_v1_dtype, VgpuSchedulerState_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -20536,10 +21268,10 @@ cdef class VgpuSchedulerState_v1: raise ValueError("ptr must not be null (0)") cdef VgpuSchedulerState_v1 obj = VgpuSchedulerState_v1.__new__(VgpuSchedulerState_v1) if owner is None: - obj._ptr = malloc(sizeof(nvmlVgpuSchedulerState_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerState_v1_t)) if obj._ptr == NULL: raise MemoryError("Error allocating VgpuSchedulerState_v1") - memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerState_v1_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerState_v1_t)) obj._owner = None obj._owned = True else: @@ -20551,7 +21283,7 @@ cdef class VgpuSchedulerState_v1: cdef _get_grid_licensable_features_dtype_offsets(): - cdef nvmlGridLicensableFeatures_t pod = nvmlGridLicensableFeatures_t() + cdef nvmlGridLicensableFeatures_t pod return _numpy.dtype({ 'names': ['is_grid_license_supported', 'licensable_features_count', 'grid_licensable_features'], 'formats': [_numpy.int32, _numpy.uint32, (grid_licensable_feature_dtype, 3)], @@ -20578,7 +21310,7 @@ cdef class GridLicensableFeatures: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlGridLicensableFeatures_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlGridLicensableFeatures_t)) if self._ptr == NULL: raise MemoryError("Error allocating GridLicensableFeatures") self._owner = None @@ -20590,7 +21322,7 @@ cdef class GridLicensableFeatures: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.GridLicensableFeatures object at {hex(id(self))}>" @@ -20611,20 +21343,20 @@ cdef class GridLicensableFeatures: if not isinstance(other, GridLicensableFeatures): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlGridLicensableFeatures_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGridLicensableFeatures_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlGridLicensableFeatures_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlGridLicensableFeatures_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlGridLicensableFeatures_t)) + self._ptr = _cyb_malloc(sizeof(nvmlGridLicensableFeatures_t)) if self._ptr == NULL: raise MemoryError("Error allocating GridLicensableFeatures") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGridLicensableFeatures_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGridLicensableFeatures_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -20646,7 +21378,7 @@ cdef class GridLicensableFeatures: self._ptr[0].licensableFeaturesCount = len(val) if len(val) == 0: return - memcpy(&(self._ptr[0].gridLicensableFeatures), (val_._get_ptr()), sizeof(nvmlGridLicensableFeature_t) * self._ptr[0].licensableFeaturesCount) + _cyb_memcpy(&(self._ptr[0].gridLicensableFeatures), (val_._get_ptr()), sizeof(nvmlGridLicensableFeature_t) * self._ptr[0].licensableFeaturesCount) @property def is_grid_license_supported(self): @@ -20662,7 +21394,7 @@ cdef class GridLicensableFeatures: @staticmethod def from_buffer(buffer): """Create an GridLicensableFeatures instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlGridLicensableFeatures_t), GridLicensableFeatures) + return _cyb_from_buffer(buffer, sizeof(nvmlGridLicensableFeatures_t), GridLicensableFeatures) @staticmethod def from_data(data): @@ -20671,7 +21403,7 @@ cdef class GridLicensableFeatures: Args: data (_numpy.ndarray): a single-element array of dtype `grid_licensable_features_dtype` holding the data. """ - return __from_data(data, "grid_licensable_features_dtype", grid_licensable_features_dtype, GridLicensableFeatures) + return _cyb_from_data(data, "grid_licensable_features_dtype", grid_licensable_features_dtype, GridLicensableFeatures) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -20686,10 +21418,10 @@ cdef class GridLicensableFeatures: raise ValueError("ptr must not be null (0)") cdef GridLicensableFeatures obj = GridLicensableFeatures.__new__(GridLicensableFeatures) if owner is None: - obj._ptr = malloc(sizeof(nvmlGridLicensableFeatures_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlGridLicensableFeatures_t)) if obj._ptr == NULL: raise MemoryError("Error allocating GridLicensableFeatures") - memcpy((obj._ptr), ptr, sizeof(nvmlGridLicensableFeatures_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGridLicensableFeatures_t)) obj._owner = None obj._owned = True else: @@ -20701,7 +21433,7 @@ cdef class GridLicensableFeatures: cdef _get_nv_link_info_v2_dtype_offsets(): - cdef nvmlNvLinkInfo_v2_t pod = nvmlNvLinkInfo_v2_t() + cdef nvmlNvLinkInfo_v2_t pod return _numpy.dtype({ 'names': ['version', 'is_nvle_enabled', 'firmware_info'], 'formats': [_numpy.uint32, _numpy.uint32, nvlink_firmware_info_dtype], @@ -20728,7 +21460,7 @@ cdef class NvLinkInfo_v2: bint _readonly def __init__(self): - self._ptr = calloc(1, sizeof(nvmlNvLinkInfo_v2_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlNvLinkInfo_v2_t)) if self._ptr == NULL: raise MemoryError("Error allocating NvLinkInfo_v2") self._owner = None @@ -20740,7 +21472,7 @@ cdef class NvLinkInfo_v2: if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL - free(ptr) + _cyb_free(ptr) def __repr__(self): return f"<{__name__}.NvLinkInfo_v2 object at {hex(id(self))}>" @@ -20761,20 +21493,20 @@ cdef class NvLinkInfo_v2: if not isinstance(other, NvLinkInfo_v2): return False other_ = other - return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvLinkInfo_v2_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvLinkInfo_v2_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - __getbuffer(self, buffer, self._ptr, sizeof(nvmlNvLinkInfo_v2_t), self._readonly) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlNvLinkInfo_v2_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = malloc(sizeof(nvmlNvLinkInfo_v2_t)) + self._ptr = _cyb_malloc(sizeof(nvmlNvLinkInfo_v2_t)) if self._ptr == NULL: raise MemoryError("Error allocating NvLinkInfo_v2") - memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvLinkInfo_v2_t)) + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvLinkInfo_v2_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -20791,7 +21523,7 @@ cdef class NvLinkInfo_v2: if self._readonly: raise ValueError("This NvLinkInfo_v2 instance is read-only") cdef NvlinkFirmwareInfo val_ = val - memcpy(&(self._ptr[0].firmwareInfo), (val_._get_ptr()), sizeof(nvmlNvlinkFirmwareInfo_t) * 1) + _cyb_memcpy(&(self._ptr[0].firmwareInfo), (val_._get_ptr()), sizeof(nvmlNvlinkFirmwareInfo_t) * 1) @property def version(self): @@ -20818,7 +21550,7 @@ cdef class NvLinkInfo_v2: @staticmethod def from_buffer(buffer): """Create an NvLinkInfo_v2 instance with the memory from the given buffer.""" - return __from_buffer(buffer, sizeof(nvmlNvLinkInfo_v2_t), NvLinkInfo_v2) + return _cyb_from_buffer(buffer, sizeof(nvmlNvLinkInfo_v2_t), NvLinkInfo_v2) @staticmethod def from_data(data): @@ -20827,7 +21559,7 @@ cdef class NvLinkInfo_v2: Args: data (_numpy.ndarray): a single-element array of dtype `nv_link_info_v2_dtype` holding the data. """ - return __from_data(data, "nv_link_info_v2_dtype", nv_link_info_v2_dtype, NvLinkInfo_v2) + return _cyb_from_data(data, "nv_link_info_v2_dtype", nv_link_info_v2_dtype, NvLinkInfo_v2) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): @@ -20842,10 +21574,10 @@ cdef class NvLinkInfo_v2: raise ValueError("ptr must not be null (0)") cdef NvLinkInfo_v2 obj = NvLinkInfo_v2.__new__(NvLinkInfo_v2) if owner is None: - obj._ptr = malloc(sizeof(nvmlNvLinkInfo_v2_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlNvLinkInfo_v2_t)) if obj._ptr == NULL: raise MemoryError("Error allocating NvLinkInfo_v2") - memcpy((obj._ptr), ptr, sizeof(nvmlNvLinkInfo_v2_t)) + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlNvLinkInfo_v2_t)) obj._owner = None obj._owned = True else: @@ -20856,7 +21588,6 @@ cdef class NvLinkInfo_v2: return obj - cpdef init_v2(): """Initialize NVML, but don't initialize any GPUs yet. @@ -20868,7 +21599,7 @@ cpdef init_v2(): cpdef init_with_flags(unsigned int flags): - """nvmlInitWithFlags is a variant of nvmlInit(), that allows passing a set of boolean values modifying the behaviour of nvmlInit(). Other than the "flags" parameter it is completely similar to ``nvmlInit_v2``. + """nvmlInitWithFlags is a variant of ``nvmlInit()``, that allows passing a set of boolean values modifying the behaviour of ``nvmlInit()``. Other than the "flags" parameter it is completely similar to ``nvmlInit_v2``. Args: flags (unsigned int): behaviour modifier flags. @@ -20906,6 +21637,9 @@ cpdef str error_string(int result): cpdef str system_get_driver_version(): """Retrieves the version of the system's graphics driver. + Returns: + char: Reference in which to return the version identifier. + .. seealso:: `nvmlSystemGetDriverVersion` """ cdef unsigned int length = 80 @@ -20913,12 +21647,15 @@ cpdef str system_get_driver_version(): with nogil: __status__ = nvmlSystemGetDriverVersion(version, length) check_status(__status__) - return cpython.PyUnicode_FromString(version) + return _cyb_cpython.PyUnicode_FromString(version) cpdef str system_get_nvml_version(): """Retrieves the version of the NVML library. + Returns: + char: Reference in which to return the version identifier. + .. seealso:: `nvmlSystemGetNVMLVersion` """ cdef unsigned int length = 80 @@ -20926,7 +21663,7 @@ cpdef str system_get_nvml_version(): with nogil: __status__ = nvmlSystemGetNVMLVersion(version, length) check_status(__status__) - return cpython.PyUnicode_FromString(version) + return _cyb_cpython.PyUnicode_FromString(version) cpdef int system_get_cuda_driver_version() except *: @@ -20965,6 +21702,9 @@ cpdef str system_get_process_name(unsigned int pid): Args: pid (unsigned int): The identifier of the process. + Returns: + char: Reference in which to return the process name. + .. seealso:: `nvmlSystemGetProcessName` """ cdef unsigned int length = 1024 @@ -20972,12 +21712,15 @@ cpdef str system_get_process_name(unsigned int pid): with nogil: __status__ = nvmlSystemGetProcessName(pid, name, length) check_status(__status__) - return cpython.PyUnicode_FromString(name) + return _cyb_cpython.PyUnicode_FromString(name) cpdef object system_get_hic_version(): """Retrieves the IDs and firmware versions for any Host Interface Cards (HICs) in the system. + Returns: + nvmlHwbcEntry_t: Array holding information about hwbc. + .. seealso:: `nvmlSystemGetHicVersion` """ cdef unsigned int[1] hwbc_count = [0] @@ -21009,11 +21752,11 @@ cpdef unsigned int unit_get_count() except? 0: return unit_count -cpdef intptr_t unit_get_handle_by_index(unsigned int ind_ex) except? 0: - """Acquire the handle for a particular unit, based on its ind_ex. +cpdef intptr_t unit_get_handle_by_index(unsigned int index) except? 0: + """Acquire the handle for a particular unit, based on its index. Args: - ind_ex (unsigned int): The ind_ex of the target unit, >= 0 and < ``unitCount``. + index (unsigned int): The index of the target unit, >= 0 and < ``unitCount``. Returns: intptr_t: Reference in which to return the unit handle. @@ -21022,7 +21765,7 @@ cpdef intptr_t unit_get_handle_by_index(unsigned int ind_ex) except? 0: """ cdef Unit unit with nogil: - __status__ = nvmlUnitGetHandleByIndex(ind_ex, &unit) + __status__ = nvmlUnitGetHandleByIndex(index, &unit) check_status(__status__) return unit @@ -21156,11 +21899,11 @@ cpdef object device_get_attributes_v2(intptr_t device): return attributes_py -cpdef intptr_t device_get_handle_by_index_v2(unsigned int ind_ex) except? 0: - """Acquire the handle for a particular device, based on its ind_ex. +cpdef intptr_t device_get_handle_by_index_v2(unsigned int index) except? 0: + """Acquire the handle for a particular device, based on its index. Args: - ind_ex (unsigned int): The ind_ex of the target GPU, >= 0 and < ``accessibleDevices``. + index (unsigned int): The index of the target GPU, >= 0 and < ``accessibleDevices``. Returns: intptr_t: Reference in which to return the device handle. @@ -21169,7 +21912,7 @@ cpdef intptr_t device_get_handle_by_index_v2(unsigned int ind_ex) except? 0: """ cdef Device device with nogil: - __status__ = nvmlDeviceGetHandleByIndex_v2(ind_ex, &device) + __status__ = nvmlDeviceGetHandleByIndex_v2(index, &device) check_status(__status__) return device @@ -21246,6 +21989,9 @@ cpdef str device_get_name(intptr_t device): Args: device (intptr_t): The identifier of the target device. + Returns: + char: Reference in which to return the product name. + .. seealso:: `nvmlDeviceGetName` """ cdef unsigned int length = 96 @@ -21253,7 +21999,7 @@ cpdef str device_get_name(intptr_t device): with nogil: __status__ = nvmlDeviceGetName(device, name, length) check_status(__status__) - return cpython.PyUnicode_FromString(name) + return _cyb_cpython.PyUnicode_FromString(name) cpdef int device_get_brand(intptr_t device) except? -1: @@ -21285,11 +22031,11 @@ cpdef unsigned int device_get_index(intptr_t device) except? 0: .. seealso:: `nvmlDeviceGetIndex` """ - cdef unsigned int ind_ex + cdef unsigned int index with nogil: - __status__ = nvmlDeviceGetIndex(device, &ind_ex) + __status__ = nvmlDeviceGetIndex(device, &index) check_status(__status__) - return ind_ex + return index cpdef str device_get_serial(intptr_t device): @@ -21298,6 +22044,9 @@ cpdef str device_get_serial(intptr_t device): Args: device (intptr_t): The identifier of the target device. + Returns: + char: Reference in which to return the board/module serial number. + .. seealso:: `nvmlDeviceGetSerial` """ cdef unsigned int length = 30 @@ -21305,7 +22054,7 @@ cpdef str device_get_serial(intptr_t device): with nogil: __status__ = nvmlDeviceGetSerial(device, serial, length) check_status(__status__) - return cpython.PyUnicode_FromString(serial) + return _cyb_cpython.PyUnicode_FromString(serial) cpdef unsigned int device_get_module_id(intptr_t device) except? 0: @@ -21350,14 +22099,17 @@ cpdef object device_get_memory_affinity(intptr_t device, unsigned int node_set_s Args: device (intptr_t): The identifier of the target device. - node_set_size (unsigned int): The size of the nodeSet array that is safe to access. - scope (unsigned int): Array reference in which to return a bitmask of NODEs, 64 NODEs per unsigned long on 64-bit machines, 32 on 32-bit machines. + node_set_size (unsigned int): The size of the node_set array that is safe to access. + scope (unsigned int): Scope that change the default behavior. + + Returns: + unsigned long: Array reference in which to return a bitmask of NODEs, 64 NODEs per unsigned long on 64-bit machines, 32 on 32-bit machines. .. seealso:: `nvmlDeviceGetMemoryAffinity` """ if node_set_size == 0: - return view.array(shape=(1,), itemsize=sizeof(unsigned long), format="L", mode="c")[:0] - cdef view.array node_set = view.array(shape=(node_set_size,), itemsize=sizeof(unsigned long), format="L", mode="c") + return _cyb_view.array(shape=(1,), itemsize=sizeof(unsigned long), format="L", mode="c")[:0] + cdef _cyb_view.array node_set = _cyb_view.array(shape=(node_set_size,), itemsize=sizeof(unsigned long), format="L", mode="c") cdef unsigned long *node_set_ptr = (node_set.data) with nogil: __status__ = nvmlDeviceGetMemoryAffinity(device, node_set_size, node_set_ptr, scope) @@ -21370,14 +22122,17 @@ cpdef object device_get_cpu_affinity_within_scope(intptr_t device, unsigned int Args: device (intptr_t): The identifier of the target device. - cpu_set_size (unsigned int): The size of the cpuSet array that is safe to access. - scope (unsigned int): Array reference in which to return a bitmask of CPUs, 64 CPUs per unsigned long on 64-bit machines, 32 on 32-bit machines. + cpu_set_size (unsigned int): The size of the cpu_set array that is safe to access. + scope (unsigned int): Scope that change the default behavior. + + Returns: + unsigned long: Array reference in which to return a bitmask of CPUs, 64 CPUs per unsigned long on 64-bit machines, 32 on 32-bit machines. .. seealso:: `nvmlDeviceGetCpuAffinityWithinScope` """ if cpu_set_size == 0: - return view.array(shape=(1,), itemsize=sizeof(unsigned long), format="L", mode="c")[:0] - cdef view.array cpu_set = view.array(shape=(cpu_set_size,), itemsize=sizeof(unsigned long), format="L", mode="c") + return _cyb_view.array(shape=(1,), itemsize=sizeof(unsigned long), format="L", mode="c")[:0] + cdef _cyb_view.array cpu_set = _cyb_view.array(shape=(cpu_set_size,), itemsize=sizeof(unsigned long), format="L", mode="c") cdef unsigned long *cpu_set_ptr = (cpu_set.data) with nogil: __status__ = nvmlDeviceGetCpuAffinityWithinScope(device, cpu_set_size, cpu_set_ptr, scope) @@ -21390,13 +22145,16 @@ cpdef object device_get_cpu_affinity(intptr_t device, unsigned int cpu_set_size) Args: device (intptr_t): The identifier of the target device. - cpu_set_size (unsigned int): The size of the cpuSet array that is safe to access. + cpu_set_size (unsigned int): The size of the cpu_set array that is safe to access. + + Returns: + unsigned long: Array reference in which to return a bitmask of CPUs, 64 CPUs per unsigned long on 64-bit machines, 32 on 32-bit machines. .. seealso:: `nvmlDeviceGetCpuAffinity` """ if cpu_set_size == 0: - return view.array(shape=(1,), itemsize=sizeof(unsigned long), format="L", mode="c")[:0] - cdef view.array cpu_set = view.array(shape=(cpu_set_size,), itemsize=sizeof(unsigned long), format="L", mode="c") + return _cyb_view.array(shape=(1,), itemsize=sizeof(unsigned long), format="L", mode="c")[:0] + cdef _cyb_view.array cpu_set = _cyb_view.array(shape=(cpu_set_size,), itemsize=sizeof(unsigned long), format="L", mode="c") cdef unsigned long *cpu_set_ptr = (cpu_set.data) with nogil: __status__ = nvmlDeviceGetCpuAffinity(device, cpu_set_size, cpu_set_ptr) @@ -21467,22 +22225,22 @@ cpdef int device_get_topology_common_ancestor(intptr_t device1, intptr_t device2 return path_info -cpdef int device_get_p2p_status(intptr_t device1, intptr_t device2, int p2p_ind_ex) except? -1: +cpdef int device_get_p2p_status(intptr_t device1, intptr_t device2, int p2p_index) except? -1: """Retrieve the status for a given p2p capability index between a given pair of GPU. Args: device1 (intptr_t): The first device. device2 (intptr_t): The second device. - p2p_ind_ex (GpuP2PCapsIndex): p2p Capability Index being looked for between ``device1`` and ``device2``. + p2p_index (GpuP2PCapsIndex): p2p Capability Index being looked for between ``device1`` and ``device2``. Returns: - int: Reference in which to return the status of the ``p2p_ind_ex`` between ``device1`` and ``device2``. + int: Reference in which to return the status of the ``p2p_index`` between ``device1`` and ``device2``. .. seealso:: `nvmlDeviceGetP2PStatus` """ cdef _GpuP2PStatus p2p_status with nogil: - __status__ = nvmlDeviceGetP2PStatus(device1, device2, <_GpuP2PCapsIndex>p2p_ind_ex, &p2p_status) + __status__ = nvmlDeviceGetP2PStatus(device1, device2, <_GpuP2PCapsIndex>p2p_index, &p2p_status) check_status(__status__) return p2p_status @@ -21493,6 +22251,9 @@ cpdef str device_get_uuid(intptr_t device): Args: device (intptr_t): The identifier of the target device. + Returns: + char: Reference in which to return the GPU UUID. + .. seealso:: `nvmlDeviceGetUUID` """ cdef unsigned int length = 96 @@ -21500,7 +22261,7 @@ cpdef str device_get_uuid(intptr_t device): with nogil: __status__ = nvmlDeviceGetUUID(device, uuid, length) check_status(__status__) - return cpython.PyUnicode_FromString(uuid) + return _cyb_cpython.PyUnicode_FromString(uuid) cpdef unsigned int device_get_minor_number(intptr_t device) except? 0: @@ -21527,6 +22288,9 @@ cpdef str device_get_board_part_number(intptr_t device): Args: device (intptr_t): Identifier of the target device. + Returns: + char: Reference to the buffer to return. + .. seealso:: `nvmlDeviceGetBoardPartNumber` """ cdef unsigned int length = 80 @@ -21534,7 +22298,7 @@ cpdef str device_get_board_part_number(intptr_t device): with nogil: __status__ = nvmlDeviceGetBoardPartNumber(device, part_number, length) check_status(__status__) - return cpython.PyUnicode_FromString(part_number) + return _cyb_cpython.PyUnicode_FromString(part_number) cpdef str device_get_inforom_version(intptr_t device, int object): @@ -21544,6 +22308,9 @@ cpdef str device_get_inforom_version(intptr_t device, int object): device (intptr_t): The identifier of the target device. object (InforomObject): The target infoROM object. + Returns: + char: Reference in which to return the infoROM version. + .. seealso:: `nvmlDeviceGetInforomVersion` """ cdef unsigned int length = 16 @@ -21551,7 +22318,7 @@ cpdef str device_get_inforom_version(intptr_t device, int object): with nogil: __status__ = nvmlDeviceGetInforomVersion(device, <_InforomObject>object, version, length) check_status(__status__) - return cpython.PyUnicode_FromString(version) + return _cyb_cpython.PyUnicode_FromString(version) cpdef str device_get_inforom_image_version(intptr_t device): @@ -21560,6 +22327,9 @@ cpdef str device_get_inforom_image_version(intptr_t device): Args: device (intptr_t): The identifier of the target device. + Returns: + char: Reference in which to return the infoROM image version. + .. seealso:: `nvmlDeviceGetInforomImageVersion` """ cdef unsigned int length = 16 @@ -21567,7 +22337,7 @@ cpdef str device_get_inforom_image_version(intptr_t device): with nogil: __status__ = nvmlDeviceGetInforomImageVersion(device, version, length) check_status(__status__) - return cpython.PyUnicode_FromString(version) + return _cyb_cpython.PyUnicode_FromString(version) cpdef unsigned int device_get_inforom_configuration_checksum(intptr_t device) except? 0: @@ -21944,6 +22714,9 @@ cpdef object device_get_supported_memory_clocks(intptr_t device): Args: device (intptr_t): The identifier of the target device. + Returns: + unsigned int: Reference in which to return the clock in MHz. + .. seealso:: `nvmlDeviceGetSupportedMemoryClocks` """ cdef unsigned int[1] count = [0] @@ -21951,8 +22724,8 @@ cpdef object device_get_supported_memory_clocks(intptr_t device): __status__ = nvmlDeviceGetSupportedMemoryClocks(device, count, NULL) check_status_size(__status__) if count[0] == 0: - return view.array(shape=(1,), itemsize=sizeof(unsigned int), format="I", mode="c")[:0] - cdef view.array clocks_m_hz = view.array(shape=(count[0],), itemsize=sizeof(unsigned int), format="I", mode="c") + return _cyb_view.array(shape=(1,), itemsize=sizeof(unsigned int), format="I", mode="c")[:0] + cdef _cyb_view.array clocks_m_hz = _cyb_view.array(shape=(count[0],), itemsize=sizeof(unsigned int), format="I", mode="c") cdef unsigned int *clocks_m_hz_ptr = (clocks_m_hz.data) with nogil: __status__ = nvmlDeviceGetSupportedMemoryClocks(device, count, clocks_m_hz_ptr) @@ -21967,6 +22740,9 @@ cpdef object device_get_supported_graphics_clocks(intptr_t device, unsigned int device (intptr_t): The identifier of the target device. memory_clock_m_hz (unsigned int): Memory clock for which to return possible graphics clocks. + Returns: + unsigned int: Reference in which to return the clocks in MHz. + .. seealso:: `nvmlDeviceGetSupportedGraphicsClocks` """ cdef unsigned int[1] count = [0] @@ -21974,8 +22750,8 @@ cpdef object device_get_supported_graphics_clocks(intptr_t device, unsigned int __status__ = nvmlDeviceGetSupportedGraphicsClocks(device, memory_clock_m_hz, count, NULL) check_status_size(__status__) if count[0] == 0: - return view.array(shape=(1,), itemsize=sizeof(unsigned int), format="I", mode="c")[:0] - cdef view.array clocks_m_hz = view.array(shape=(count[0],), itemsize=sizeof(unsigned int), format="I", mode="c") + return _cyb_view.array(shape=(1,), itemsize=sizeof(unsigned int), format="I", mode="c")[:0] + cdef _cyb_view.array clocks_m_hz = _cyb_view.array(shape=(count[0],), itemsize=sizeof(unsigned int), format="I", mode="c") cdef unsigned int *clocks_m_hz_ptr = (clocks_m_hz.data) with nogil: __status__ = nvmlDeviceGetSupportedGraphicsClocks(device, memory_clock_m_hz, count, clocks_m_hz_ptr) @@ -21984,7 +22760,7 @@ cpdef object device_get_supported_graphics_clocks(intptr_t device, unsigned int cpdef tuple device_get_auto_boosted_clocks_enabled(intptr_t device): - """Retrieve the current state of Auto Boosted clocks on a device and store it in ``isEnabled``. + """Retrieve the current state of Auto Boosted clocks on a device and store it in ``is_enabled``. Args: device (intptr_t): The identifier of the target device. @@ -22159,12 +22935,12 @@ cpdef unsigned int device_get_temperature_threshold(intptr_t device, int thresho return temp -cpdef object device_get_thermal_settings(intptr_t device, unsigned int sensor_ind_ex): +cpdef object device_get_thermal_settings(intptr_t device, unsigned int sensor_index): """Used to execute a list of thermal system instructions. Args: device (intptr_t): The identifier of the target device. - sensor_ind_ex (unsigned int): The index of the thermal sensor. + sensor_index (unsigned int): The index of the thermal sensor. Returns: nvmlGpuThermalSettings_t: Reference in which to return the thermal sensor information. @@ -22174,7 +22950,7 @@ cpdef object device_get_thermal_settings(intptr_t device, unsigned int sensor_in cdef GpuThermalSettings p_thermal_settings_py = GpuThermalSettings() cdef nvmlGpuThermalSettings_t *p_thermal_settings = (p_thermal_settings_py._get_ptr()) with nogil: - __status__ = nvmlDeviceGetThermalSettings(device, sensor_ind_ex, p_thermal_settings) + __status__ = nvmlDeviceGetThermalSettings(device, sensor_index, p_thermal_settings) check_status(__status__) return p_thermal_settings_py @@ -22525,10 +23301,10 @@ cpdef object device_get_memory_info_v2(intptr_t device): cpdef int device_get_compute_mode(intptr_t device) except? -1: - """Retrieves the current compute mode for the device. + """Retrieves the current compute mode for the device or MIG device. Args: - device (intptr_t): The identifier of the target device. + device (intptr_t): The identifier of the target device handle or MIG device handle. Returns: int: Reference in which to return the current compute mode. @@ -22605,7 +23381,7 @@ cpdef int device_get_default_ecc_mode(intptr_t device) except? -1: cpdef unsigned int device_get_board_id(intptr_t device) except? 0: - """Retrieves the device boardId from 0-N. Devices with the same boardId indicate GPUs connected to the same PLX. Use in conjunction with :func:`device_get_multi_gpu_board` to decide if they are on the same board as well. The boardId returned is a unique ID for the current configuration. Uniqueness and ordering across reboots and system configurations is not guaranteed (i.e. if a Tesla K40c returns 0x100 and the two GPUs on a Tesla K10 in the same system returns 0x200 it is not guaranteed they will always return those values but they will always be different from each other). + """Retrieves the device board_id from 0-N. Devices with the same board_id indicate GPUs connected to the same PLX. Use in conjunction with :func:`device_get_multi_gpu_board` to decide if they are on the same board as well. The board_id returned is a unique ID for the current configuration. Uniqueness and ordering across reboots and system configurations is not guaranteed (i.e. if a Tesla K40c returns 0x100 and the two GPUs on a Tesla K10 in the same system returns 0x200 it is not guaranteed they will always return those values but they will always be different from each other). Args: device (intptr_t): The identifier of the target device. @@ -22623,7 +23399,7 @@ cpdef unsigned int device_get_board_id(intptr_t device) except? 0: cpdef unsigned int device_get_multi_gpu_board(intptr_t device) except? 0: - """Retrieves whether the device is on a Multi-GPU Board Devices that are on multi-GPU boards will set ``multiGpuBool`` to a non-zero value. + """Retrieves whether the device is on a Multi-GPU Board Devices that are on multi-GPU boards will set ``multi_gpu_bool`` to a non-zero value. Args: device (intptr_t): The identifier of the target device. @@ -22771,6 +23547,9 @@ cpdef object device_get_encoder_sessions(intptr_t device): Args: device (intptr_t): The identifier of the target device. + Returns: + nvmlEncoderSessionInfo_t: Reference in which to return the session information. + .. seealso:: `nvmlDeviceGetEncoderSessions` """ cdef unsigned int[1] session_count = [0] @@ -22860,7 +23639,7 @@ cpdef object device_get_fbc_stats(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlFBCStats_t: Reference to nvmlFBCStats_t structure containing NvFBC stats. + nvmlFBCStats_t: Reference to ``nvmlFBCStats_t`` structure containing NvFBC stats. .. seealso:: `nvmlDeviceGetFBCStats` """ @@ -22878,6 +23657,9 @@ cpdef object device_get_fbc_sessions(intptr_t device): Args: device (intptr_t): The identifier of the target device. + Returns: + nvmlFBCSessionInfo_t: Reference in which to return the session information. + .. seealso:: `nvmlDeviceGetFBCSessions` """ cdef unsigned int[1] session_count = [0] @@ -22922,6 +23704,9 @@ cpdef str device_get_vbios_version(intptr_t device): Args: device (intptr_t): The identifier of the target device. + Returns: + char: Reference to which to return the VBIOS version. + .. seealso:: `nvmlDeviceGetVbiosVersion` """ cdef unsigned int length = 32 @@ -22929,7 +23714,7 @@ cpdef str device_get_vbios_version(intptr_t device): with nogil: __status__ = nvmlDeviceGetVbiosVersion(device, version, length) check_status(__status__) - return cpython.PyUnicode_FromString(version) + return _cyb_cpython.PyUnicode_FromString(version) cpdef object device_get_bridge_chip_info(intptr_t device): @@ -22957,6 +23742,9 @@ cpdef object device_get_compute_running_processes_v3(intptr_t device): Args: device (intptr_t): The device handle or MIG device handle. + Returns: + nvmlProcessInfo_t: Reference in which to return the process information. + .. seealso:: `nvmlDeviceGetComputeRunningProcesses_v3` """ cdef unsigned int[1] info_count = [0] @@ -22973,12 +23761,40 @@ cpdef object device_get_compute_running_processes_v3(intptr_t device): return infos +cpdef object device_get_graphics_running_processes_v3(intptr_t device): + """Get information about processes with a graphics context on a device. + + Args: + device (intptr_t): The device handle or MIG device handle. + + Returns: + nvmlProcessInfo_t: Reference in which to return the process information. + + .. seealso:: `nvmlDeviceGetGraphicsRunningProcesses_v3` + """ + cdef unsigned int[1] info_count = [0] + with nogil: + __status__ = nvmlDeviceGetGraphicsRunningProcesses_v3(device, info_count, NULL) + check_status_size(__status__) + cdef ProcessInfo infos = ProcessInfo(info_count[0]) + cdef nvmlProcessInfo_t *infos_ptr = (infos._get_ptr()) + if info_count[0] == 0: + return infos + with nogil: + __status__ = nvmlDeviceGetGraphicsRunningProcesses_v3(device, info_count, infos_ptr) + check_status(__status__) + return infos + + cpdef object device_get_mps_compute_running_processes_v3(intptr_t device): """Get information about processes with a Multi-Process Service (MPS) compute context on a device. Args: device (intptr_t): The device handle or MIG device handle. + Returns: + nvmlProcessInfo_t: Reference in which to return the process information. + .. seealso:: `nvmlDeviceGetMPSComputeRunningProcesses_v3` """ cdef unsigned int[1] info_count = [0] @@ -23448,6 +24264,9 @@ cpdef object device_get_accounting_pids(intptr_t device): Args: device (intptr_t): The identifier of the target device. + Returns: + unsigned int: Reference in which to return list of process ids. + .. seealso:: `nvmlDeviceGetAccountingPids` """ cdef unsigned int[1] count = [0] @@ -23455,8 +24274,8 @@ cpdef object device_get_accounting_pids(intptr_t device): __status__ = nvmlDeviceGetAccountingPids(device, count, NULL) check_status_size(__status__) if count[0] == 0: - return view.array(shape=(1,), itemsize=sizeof(unsigned int), format="I", mode="c")[:0] - cdef view.array pids = view.array(shape=(count[0],), itemsize=sizeof(unsigned int), format="I", mode="c") + return _cyb_view.array(shape=(1,), itemsize=sizeof(unsigned int), format="I", mode="c")[:0] + cdef _cyb_view.array pids = _cyb_view.array(shape=(count[0],), itemsize=sizeof(unsigned int), format="I", mode="c") cdef unsigned int *pids_ptr = (pids.data) with nogil: __status__ = nvmlDeviceGetAccountingPids(device, count, pids_ptr) @@ -23489,6 +24308,9 @@ cpdef object device_get_retired_pages(intptr_t device, int cause): device (intptr_t): The identifier of the target device. cause (PageRetirementCause): Filter page addresses by cause of retirement. + Returns: + unsigned long long: Buffer to write the page addresses into. + .. seealso:: `nvmlDeviceGetRetiredPages` """ cdef unsigned int[1] page_count = [0] @@ -23496,8 +24318,8 @@ cpdef object device_get_retired_pages(intptr_t device, int cause): __status__ = nvmlDeviceGetRetiredPages(device, <_PageRetirementCause>cause, page_count, NULL) check_status_size(__status__) if page_count[0] == 0: - return view.array(shape=(1,), itemsize=sizeof(unsigned long long), format="Q", mode="c")[:0] - cdef view.array addresses = view.array(shape=(page_count[0],), itemsize=sizeof(unsigned long long), format="Q", mode="c") + return _cyb_view.array(shape=(1,), itemsize=sizeof(unsigned long long), format="Q", mode="c")[:0] + cdef _cyb_view.array addresses = _cyb_view.array(shape=(page_count[0],), itemsize=sizeof(unsigned long long), format="Q", mode="c") cdef unsigned long long *addresses_ptr = (addresses.data) with nogil: __status__ = nvmlDeviceGetRetiredPages(device, <_PageRetirementCause>cause, page_count, addresses_ptr) @@ -23524,7 +24346,7 @@ cpdef int device_get_retired_pages_pending_status(intptr_t device) except? -1: cpdef tuple device_get_remapped_rows(intptr_t device): - """Get number of remapped rows. The number of rows reported will be based on the cause of the remapping. isPending indicates whether or not there are pending remappings. A reset will be required to actually remap the row. failureOccurred will be set if a row remapping ever failed in the past. A pending remapping won't affect future work on the GPU since error-containment and dynamic page blacklisting will take care of that. + """Get number of remapped rows. The number of rows reported will be based on the cause of the remapping. is_pending indicates whether or not there are pending remappings. A reset will be required to actually remap the row. failure_occurred will be set if a row remapping ever failed in the past. A pending remapping won't affect future work on the GPU since error-containment and dynamic page blacklisting will take care of that. Args: device (intptr_t): The identifier of the target device. @@ -23610,7 +24432,10 @@ cpdef object device_get_process_utilization(intptr_t device, unsigned long long Args: device (intptr_t): The identifier of the target device. - last_seen_time_stamp (unsigned long long): Pointer to caller-supplied buffer in which guest process utilization samples are returned. + last_seen_time_stamp (unsigned long long): Return only samples with timestamp greater than last_seen_time_stamp. + + Returns: + nvmlProcessUtilizationSample_t: Pointer to caller-supplied buffer in which guest process utilization samples are returned. .. seealso:: `nvmlDeviceGetProcessUtilization` """ @@ -23657,10 +24482,10 @@ cpdef device_set_persistence_mode(intptr_t device, int mode): cpdef device_set_compute_mode(intptr_t device, int mode): - """Set the compute mode for the device. + """Set the compute mode for the device or MIG device. Args: - device (intptr_t): The identifier of the target device. + device (intptr_t): The identifier of the target device handle or MIG device handle. mode (ComputeMode): The target compute mode. .. seealso:: `nvmlDeviceSetComputeMode` @@ -24411,11 +25236,14 @@ cpdef unsigned int device_get_vgpu_capabilities(intptr_t device, int capability) cpdef str vgpu_type_get_class(unsigned int vgpu_type_id): - """Retrieve the class of a vGPU type. It will not exceed 64 characters in length (including the NUL terminator). See ``nvmlConstants.NVML_DEVICE_NAME_BUFFER_SIZE``. + """Retrieve the class of a vGPU type. It will not exceed 64 characters in length (including the NUL terminator). See nvmlConstants::NVML_DEVICE_NAME_BUFFER_SIZE. Args: vgpu_type_id (unsigned int): Handle to vGPU type. + Returns: + char: Pointer to string array to return class in. + .. seealso:: `nvmlVgpuTypeGetClass` """ cdef unsigned int[1] size = [0] @@ -24429,7 +25257,7 @@ cpdef str vgpu_type_get_class(unsigned int vgpu_type_id): with nogil: __status__ = nvmlVgpuTypeGetClass(vgpu_type_id, vgpu_type_class, size) check_status(__status__) - return cpython.PyUnicode_FromString(vgpu_type_class) + return _cyb_cpython.PyUnicode_FromString(vgpu_type_class) cpdef unsigned int vgpu_type_get_gpu_instance_profile_id(unsigned int vgpu_type_id) except? 0: @@ -24508,12 +25336,12 @@ cpdef unsigned int vgpu_type_get_num_display_heads(unsigned int vgpu_type_id) ex return num_display_heads -cpdef tuple vgpu_type_get_resolution(unsigned int vgpu_type_id, unsigned int display_ind_ex): +cpdef tuple vgpu_type_get_resolution(unsigned int vgpu_type_id, unsigned int display_index): """Retrieve vGPU display head's maximum supported resolution. Args: vgpu_type_id (unsigned int): Handle to vGPU type. - display_ind_ex (unsigned int): Zero-based index of display head. + display_index (unsigned int): Zero-based index of display head. Returns: A 2-tuple containing: @@ -24526,7 +25354,7 @@ cpdef tuple vgpu_type_get_resolution(unsigned int vgpu_type_id, unsigned int dis cdef unsigned int xdim cdef unsigned int ydim with nogil: - __status__ = nvmlVgpuTypeGetResolution(vgpu_type_id, display_ind_ex, &xdim, &ydim) + __status__ = nvmlVgpuTypeGetResolution(vgpu_type_id, display_index, &xdim, &ydim) check_status(__status__) return (xdim, ydim) @@ -24537,6 +25365,9 @@ cpdef str vgpu_type_get_license(unsigned int vgpu_type_id): Args: vgpu_type_id (unsigned int): Handle to vGPU type. + Returns: + char: Pointer to buffer to return license info. + .. seealso:: `nvmlVgpuTypeGetLicense` """ cdef unsigned int size = 128 @@ -24544,7 +25375,7 @@ cpdef str vgpu_type_get_license(unsigned int vgpu_type_id): with nogil: __status__ = nvmlVgpuTypeGetLicense(vgpu_type_id, vgpu_type_license_string, size) check_status(__status__) - return cpython.PyUnicode_FromString(vgpu_type_license_string) + return _cyb_cpython.PyUnicode_FromString(vgpu_type_license_string) cpdef unsigned int vgpu_type_get_frame_rate_limit(unsigned int vgpu_type_id) except? 0: @@ -24628,6 +25459,9 @@ cpdef str vgpu_instance_get_uuid(unsigned int vgpu_instance): Args: vgpu_instance (unsigned int): Identifier of the target vGPU instance. + Returns: + char: Pointer to caller-supplied buffer to hold vGPU UUID. + .. seealso:: `nvmlVgpuInstanceGetUUID` """ cdef unsigned int size = 80 @@ -24635,7 +25469,7 @@ cpdef str vgpu_instance_get_uuid(unsigned int vgpu_instance): with nogil: __status__ = nvmlVgpuInstanceGetUUID(vgpu_instance, uuid, size) check_status(__status__) - return cpython.PyUnicode_FromString(uuid) + return _cyb_cpython.PyUnicode_FromString(uuid) cpdef str vgpu_instance_get_vm_driver_version(unsigned int vgpu_instance): @@ -24644,6 +25478,9 @@ cpdef str vgpu_instance_get_vm_driver_version(unsigned int vgpu_instance): Args: vgpu_instance (unsigned int): Identifier of the target vGPU instance. + Returns: + char: Caller-supplied buffer to return driver version string. + .. seealso:: `nvmlVgpuInstanceGetVmDriverVersion` """ cdef unsigned int length = 80 @@ -24651,7 +25488,7 @@ cpdef str vgpu_instance_get_vm_driver_version(unsigned int vgpu_instance): with nogil: __status__ = nvmlVgpuInstanceGetVmDriverVersion(vgpu_instance, version, length) check_status(__status__) - return cpython.PyUnicode_FromString(version) + return _cyb_cpython.PyUnicode_FromString(version) cpdef unsigned long long vgpu_instance_get_fb_usage(unsigned int vgpu_instance) except? 0: @@ -24697,7 +25534,7 @@ cpdef unsigned int vgpu_instance_get_type(unsigned int vgpu_instance) except? 0: vgpu_instance (unsigned int): Identifier of the target vGPU instance. Returns: - unsigned int: Reference to return the vgpuTypeId. + unsigned int: Reference to return the vgpu_type_id. .. seealso:: `nvmlVgpuInstanceGetType` """ @@ -24806,6 +25643,9 @@ cpdef object vgpu_instance_get_encoder_sessions(unsigned int vgpu_instance): Args: vgpu_instance (unsigned int): Identifier of the target vGPU instance. + Returns: + nvmlEncoderSessionInfo_t: Reference to caller supplied array in which the list of session information us returned. + .. seealso:: `nvmlVgpuInstanceGetEncoderSessions` """ cdef unsigned int[1] session_count = [0] @@ -24829,7 +25669,7 @@ cpdef object vgpu_instance_get_fbc_stats(unsigned int vgpu_instance): vgpu_instance (unsigned int): Identifier of the target vGPU instance. Returns: - nvmlFBCStats_t: Reference to nvmlFBCStats_t structure containing NvFBC stats. + nvmlFBCStats_t: Reference to ``nvmlFBCStats_t`` structure containing NvFBC stats. .. seealso:: `nvmlVgpuInstanceGetFBCStats` """ @@ -24847,6 +25687,9 @@ cpdef object vgpu_instance_get_fbc_sessions(unsigned int vgpu_instance): Args: vgpu_instance (unsigned int): Identifier of the target vGPU instance. + Returns: + nvmlFBCSessionInfo_t: Reference in which to return the session information. + .. seealso:: `nvmlVgpuInstanceGetFBCSessions` """ cdef unsigned int[1] session_count = [0] @@ -24887,6 +25730,9 @@ cpdef str vgpu_instance_get_gpu_pci_id(unsigned int vgpu_instance): Args: vgpu_instance (unsigned int): Identifier of the target vGPU instance. + Returns: + char: Caller-supplied buffer to return vGPU PCI Id string. + .. seealso:: `nvmlVgpuInstanceGetGpuPciId` """ cdef unsigned int[1] length = [0] @@ -24900,11 +25746,11 @@ cpdef str vgpu_instance_get_gpu_pci_id(unsigned int vgpu_instance): with nogil: __status__ = nvmlVgpuInstanceGetGpuPciId(vgpu_instance, vgpu_pci_id, length) check_status(__status__) - return cpython.PyUnicode_FromString(vgpu_pci_id) + return _cyb_cpython.PyUnicode_FromString(vgpu_pci_id) cpdef unsigned int vgpu_type_get_capabilities(unsigned int vgpu_type_id, int capability) except? 0: - """Retrieve the requested capability for a given vGPU type. Refer to the ``nvmlVgpuCapability_t`` structure for the specific capabilities that can be queried. The return value in ``capResult`` should be treated as a boolean, with a non-zero value indicating that the capability is supported. + """Retrieve the requested capability for a given vGPU type. Refer to the ``nvmlVgpuCapability_t`` structure for the specific capabilities that can be queried. The return value in ``cap_result`` should be treated as a boolean, with a non-zero value indicating that the capability is supported. Args: vgpu_type_id (unsigned int): Handle to vGPU type. @@ -24928,6 +25774,9 @@ cpdef str vgpu_instance_get_mdev_uuid(unsigned int vgpu_instance): Args: vgpu_instance (unsigned int): Identifier of the target vGPU instance. + Returns: + char: Pointer to caller-supplied buffer to hold MDEV UUID. + .. seealso:: `nvmlVgpuInstanceGetMdevUUID` """ cdef unsigned int size = 80 @@ -24935,7 +25784,7 @@ cpdef str vgpu_instance_get_mdev_uuid(unsigned int vgpu_instance): with nogil: __status__ = nvmlVgpuInstanceGetMdevUUID(vgpu_instance, mdev_uuid, size) check_status(__status__) - return cpython.PyUnicode_FromString(mdev_uuid) + return _cyb_cpython.PyUnicode_FromString(mdev_uuid) cpdef gpu_instance_set_vgpu_scheduler_state(intptr_t gpu_instance, intptr_t p_scheduler): @@ -24943,7 +25792,7 @@ cpdef gpu_instance_set_vgpu_scheduler_state(intptr_t gpu_instance, intptr_t p_sc Args: gpu_instance (intptr_t): The GPU instance handle. - p_scheduler (intptr_t): Pointer to the caller-provided structure of nvmlVgpuSchedulerState_t. + p_scheduler (intptr_t): Pointer to the caller-provided structure of ``nvmlVgpuSchedulerState_t``. .. seealso:: `nvmlGpuInstanceSetVgpuSchedulerState` """ @@ -24960,7 +25809,7 @@ cpdef object gpu_instance_get_vgpu_scheduler_state(intptr_t gpu_instance): gpu_instance (intptr_t): The GPU instance handle. Returns: - nvmlVgpuSchedulerStateInfo_v1_t: Reference in which ``pSchedulerStateInfo`` is returned. + nvmlVgpuSchedulerStateInfo_v1_t: Reference in which ``p_scheduler_state_info`` is returned. .. seealso:: `nvmlGpuInstanceGetVgpuSchedulerState` """ @@ -24974,13 +25823,13 @@ cpdef object gpu_instance_get_vgpu_scheduler_state(intptr_t gpu_instance): cpdef object gpu_instance_get_vgpu_scheduler_log(intptr_t gpu_instance): - """Returns the vGPU scheduler logs for the given GPU instance. ``pSchedulerLogInfo`` points to a caller-allocated structure to contain the logs. The number of elements returned will never exceed ``NVML_SCHEDULER_SW_MAX_LOG_ENTRIES``. + """Returns the vGPU scheduler logs for the given GPU instance. ``p_scheduler_log_info`` points to a caller-allocated structure to contain the logs. The number of elements returned will never exceed ``NVML_SCHEDULER_SW_MAX_LOG_ENTRIES``. Args: gpu_instance (intptr_t): The GPU instance handle. Returns: - nvmlVgpuSchedulerLogInfo_v1_t: Reference in which ``pSchedulerLogInfo`` is written. + nvmlVgpuSchedulerLogInfo_v1_t: Reference in which ``p_scheduler_log_info`` is written. .. seealso:: `nvmlGpuInstanceGetVgpuSchedulerLog` """ @@ -24999,6 +25848,9 @@ cpdef str device_get_pgpu_metadata_string(intptr_t device): Args: device (intptr_t): The identifier of the target device. + Returns: + char: Pointer to caller-supplied buffer into which ``pgpu_metadata`` is written. + .. seealso:: `nvmlDeviceGetPgpuMetadataString` """ cdef unsigned int[1] buffer_size = [0] @@ -25012,17 +25864,17 @@ cpdef str device_get_pgpu_metadata_string(intptr_t device): with nogil: __status__ = nvmlDeviceGetPgpuMetadataString(device, pgpu_metadata, buffer_size) check_status(__status__) - return cpython.PyUnicode_FromString(pgpu_metadata) + return _cyb_cpython.PyUnicode_FromString(pgpu_metadata) cpdef object device_get_vgpu_scheduler_log(intptr_t device): - """Returns the vGPU Software scheduler logs. ``pSchedulerLog`` points to a caller-allocated structure to contain the logs. The number of elements returned will never exceed ``NVML_SCHEDULER_SW_MAX_LOG_ENTRIES``. + """Returns the vGPU Software scheduler logs. ``p_scheduler_log`` points to a caller-allocated structure to contain the logs. The number of elements returned will never exceed ``NVML_SCHEDULER_SW_MAX_LOG_ENTRIES``. Args: device (intptr_t): The identifier of the target ``device``. Returns: - nvmlVgpuSchedulerLog_t: Reference in which ``pSchedulerLog`` is written. + nvmlVgpuSchedulerLog_t: Reference in which ``p_scheduler_log`` is written. .. seealso:: `nvmlDeviceGetVgpuSchedulerLog` """ @@ -25041,7 +25893,7 @@ cpdef object device_get_vgpu_scheduler_state(intptr_t device): device (intptr_t): The identifier of the target ``device``. Returns: - nvmlVgpuSchedulerGetState_t: Reference in which ``pSchedulerState`` is returned. + nvmlVgpuSchedulerGetState_t: Reference in which ``p_scheduler_state`` is returned. .. seealso:: `nvmlDeviceGetVgpuSchedulerState` """ @@ -25060,7 +25912,7 @@ cpdef object device_get_vgpu_scheduler_capabilities(intptr_t device): device (intptr_t): The identifier of the target ``device``. Returns: - nvmlVgpuSchedulerCapabilities_t: Reference in which ``pCapabilities`` is written. + nvmlVgpuSchedulerCapabilities_t: Reference in which ``p_capabilities`` is written. .. seealso:: `nvmlDeviceGetVgpuSchedulerCapabilities` """ @@ -25146,6 +25998,9 @@ cpdef object vgpu_instance_get_accounting_pids(unsigned int vgpu_instance): Args: vgpu_instance (unsigned int): The identifier of the target vGPU instance. + Returns: + unsigned int: Reference in which to return list of process ids. + .. seealso:: `nvmlVgpuInstanceGetAccountingPids` """ cdef unsigned int[1] count = [0] @@ -25153,8 +26008,8 @@ cpdef object vgpu_instance_get_accounting_pids(unsigned int vgpu_instance): __status__ = nvmlVgpuInstanceGetAccountingPids(vgpu_instance, count, NULL) check_status_size(__status__) if count[0] == 0: - return view.array(shape=(1,), itemsize=sizeof(unsigned int), format="I", mode="c")[:0] - cdef view.array pids = view.array(shape=(count[0],), itemsize=sizeof(unsigned int), format="I", mode="c") + return _cyb_view.array(shape=(1,), itemsize=sizeof(unsigned int), format="I", mode="c")[:0] + cdef _cyb_view.array pids = _cyb_view.array(shape=(count[0],), itemsize=sizeof(unsigned int), format="I", mode="c") cdef unsigned int *pids_ptr = (pids.data) with nogil: __status__ = nvmlVgpuInstanceGetAccountingPids(vgpu_instance, count, pids_ptr) @@ -25229,11 +26084,11 @@ cpdef unsigned int get_excluded_device_count() except? 0: return device_count -cpdef object get_excluded_device_info_by_index(unsigned int ind_ex): - """Acquire the device information for an excluded GPU device, based on its ind_ex. +cpdef object get_excluded_device_info_by_index(unsigned int index): + """Acquire the device information for an excluded GPU device, based on its index. Args: - ind_ex (unsigned int): The ind_ex of the target GPU, >= 0 and < ``deviceCount``. + index (unsigned int): The index of the target GPU, >= 0 and < ``deviceCount``. Returns: nvmlExcludedDeviceInfo_t: Reference in which to return the device information. @@ -25243,7 +26098,7 @@ cpdef object get_excluded_device_info_by_index(unsigned int ind_ex): cdef ExcludedDeviceInfo info_py = ExcludedDeviceInfo() cdef nvmlExcludedDeviceInfo_t *info = (info_py._get_ptr()) with nogil: - __status__ = nvmlGetExcludedDeviceInfoByIndex(ind_ex, info) + __status__ = nvmlGetExcludedDeviceInfoByIndex(index, info) check_status(__status__) return info_py @@ -25256,7 +26111,7 @@ cpdef int device_set_mig_mode(intptr_t device, unsigned int mode) except? -1: mode (unsigned int): The mode to be set, ``NVML_DEVICE_MIG_DISABLE`` or ``NVML_DEVICE_MIG_ENABLE``. Returns: - int: The activationStatus status. + int: The activation_status status. .. seealso:: `nvmlDeviceSetMigMode` """ @@ -25296,6 +26151,9 @@ cpdef object device_get_gpu_instance_possible_placements_v2(intptr_t device, uns device (intptr_t): The identifier of the target device. profile_id (unsigned int): The GPU instance profile ID. See ``nvmlDeviceGetGpuInstanceProfileInfo``. + Returns: + nvmlGpuInstancePlacement_t: Returns placements allowed for the profile. Can be NULL to discover number of allowed placements for this profile. If non-NULL must be large enough to accommodate the placements supported by the profile. + .. seealso:: `nvmlDeviceGetGpuInstancePossiblePlacements_v2` """ cdef unsigned int[1] count = [0] @@ -25469,6 +26327,9 @@ cpdef object gpu_instance_get_compute_instance_possible_placements(intptr_t gpu_ gpu_instance (intptr_t): The identifier of the target GPU instance. profile_id (unsigned int): The compute instance profile ID. See ``nvmlGpuInstanceGetComputeInstanceProfileInfo``. + Returns: + nvmlComputeInstancePlacement_t: Returns placements allowed for the profile. Can be NULL to discover number of allowed placements for this profile. If non-NULL must be large enough to accommodate the placements supported by the profile. + .. seealso:: `nvmlGpuInstanceGetComputeInstancePossiblePlacements` """ cdef unsigned int[1] count = [0] @@ -25647,12 +26508,12 @@ cpdef unsigned int device_get_max_mig_device_count(intptr_t device) except? 0: return count -cpdef intptr_t device_get_mig_device_handle_by_index(intptr_t device, unsigned int ind_ex) except? 0: - """Get MIG device handle for the given ind_ex under its parent NVML device. +cpdef intptr_t device_get_mig_device_handle_by_index(intptr_t device, unsigned int index) except? 0: + """Get MIG device handle for the given index under its parent NVML device. Args: device (intptr_t): Reference to the parent GPU device handle. - ind_ex (unsigned int): Index of the MIG device. + index (unsigned int): Index of the MIG device. Returns: intptr_t: Reference to the MIG device handle. @@ -25661,7 +26522,7 @@ cpdef intptr_t device_get_mig_device_handle_by_index(intptr_t device, unsigned i """ cdef Device mig_device with nogil: - __status__ = nvmlDeviceGetMigDeviceHandleByIndex(device, ind_ex, &mig_device) + __status__ = nvmlDeviceGetMigDeviceHandleByIndex(device, index, &mig_device) check_status(__status__) return mig_device @@ -25799,6 +26660,123 @@ cpdef device_set_power_mizer_mode_v1(intptr_t device, intptr_t power_mizer_mode) check_status(__status__) +cpdef device_vgpu_force_gsp_unload(intptr_t device): + """Executes a forced GSP unload operation on a device. + + Args: + device (intptr_t): The identifier of the target device. + + .. seealso:: `nvmlDeviceVgpuForceGspUnload` + """ + with nogil: + __status__ = nvmlDeviceVgpuForceGspUnload(device) + check_status(__status__) + + +cpdef object device_get_vgpu_scheduler_state_v2(intptr_t device): + """Returns the vGPU scheduler state. The information returned in ``nvmlVgpuSchedulerStateInfo_v2_t`` is not relevant if the BEST EFFORT policy is set. + + Args: + device (intptr_t): The identifier of the target ``device``. + + Returns: + nvmlVgpuSchedulerStateInfo_v2_t: Reference in which ``p_scheduler_state_info`` is returned. + + .. seealso:: `nvmlDeviceGetVgpuSchedulerState_v2` + """ + cdef VgpuSchedulerStateInfo_v2 p_scheduler_state_info_py = VgpuSchedulerStateInfo_v2() + cdef nvmlVgpuSchedulerStateInfo_v2_t *p_scheduler_state_info = (p_scheduler_state_info_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetVgpuSchedulerState_v2(device, p_scheduler_state_info) + check_status(__status__) + return p_scheduler_state_info_py + + +cpdef object gpu_instance_get_vgpu_scheduler_state_v2(intptr_t gpu_instance): + """Returns the vGPU scheduler state for the given GPU instance. The information returned in ``nvmlVgpuSchedulerStateInfo_v2_t`` is not relevant if the BEST EFFORT policy is set. + + Args: + gpu_instance (intptr_t): The GPU instance handle. + + Returns: + nvmlVgpuSchedulerStateInfo_v2_t: Reference in which ``p_scheduler_state_info`` is returned. + + .. seealso:: `nvmlGpuInstanceGetVgpuSchedulerState_v2` + """ + cdef VgpuSchedulerStateInfo_v2 p_scheduler_state_info_py = VgpuSchedulerStateInfo_v2() + cdef nvmlVgpuSchedulerStateInfo_v2_t *p_scheduler_state_info = (p_scheduler_state_info_py._get_ptr()) + with nogil: + __status__ = nvmlGpuInstanceGetVgpuSchedulerState_v2(gpu_instance, p_scheduler_state_info) + check_status(__status__) + return p_scheduler_state_info_py + + +cpdef object device_get_vgpu_scheduler_log_v2(intptr_t device): + """Returns the vGPU Software scheduler logs for the device. ``p_scheduler_log_info`` points to a caller-allocated structure to contain the logs. The number of elements returned will never exceed ``NVML_SCHEDULER_SW_MAX_LOG_ENTRIES``. + + Args: + device (intptr_t): The identifier of the target ``device``. + + Returns: + nvmlVgpuSchedulerLogInfo_v2_t: Reference in which ``p_scheduler_log_info`` is written. + + .. seealso:: `nvmlDeviceGetVgpuSchedulerLog_v2` + """ + cdef VgpuSchedulerLogInfo_v2 p_scheduler_log_info_py = VgpuSchedulerLogInfo_v2() + cdef nvmlVgpuSchedulerLogInfo_v2_t *p_scheduler_log_info = (p_scheduler_log_info_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetVgpuSchedulerLog_v2(device, p_scheduler_log_info) + check_status(__status__) + return p_scheduler_log_info_py + + +cpdef object gpu_instance_get_vgpu_scheduler_log_v2(intptr_t gpu_instance): + """Returns the vGPU scheduler logs for the given GPU instance. ``p_scheduler_log_info`` points to a caller-allocated structure to contain the logs. The number of elements returned will never exceed ``NVML_SCHEDULER_SW_MAX_LOG_ENTRIES``. + + Args: + gpu_instance (intptr_t): The GPU instance handle. + + Returns: + nvmlVgpuSchedulerLogInfo_v2_t: Reference in which ``p_scheduler_log_info`` is written. + + .. seealso:: `nvmlGpuInstanceGetVgpuSchedulerLog_v2` + """ + cdef VgpuSchedulerLogInfo_v2 p_scheduler_log_info_py = VgpuSchedulerLogInfo_v2() + cdef nvmlVgpuSchedulerLogInfo_v2_t *p_scheduler_log_info = (p_scheduler_log_info_py._get_ptr()) + with nogil: + __status__ = nvmlGpuInstanceGetVgpuSchedulerLog_v2(gpu_instance, p_scheduler_log_info) + check_status(__status__) + return p_scheduler_log_info_py + + +cpdef device_set_vgpu_scheduler_state_v2(intptr_t device, intptr_t p_scheduler_state): + """Sets the vGPU scheduler state. + + Args: + device (intptr_t): The identifier of the target ``device``. + p_scheduler_state (intptr_t): vGPU ``p_scheduler_state`` to set. + + .. seealso:: `nvmlDeviceSetVgpuSchedulerState_v2` + """ + with nogil: + __status__ = nvmlDeviceSetVgpuSchedulerState_v2(device, p_scheduler_state) + check_status(__status__) + + +cpdef gpu_instance_set_vgpu_scheduler_state_v2(intptr_t gpu_instance, intptr_t p_scheduler_state): + """Set vGPU scheduler state for the given GPU instance. + + Args: + gpu_instance (intptr_t): The GPU instance handle. + p_scheduler_state (intptr_t): Pointer to the caller-provided structure of ``nvmlVgpuSchedulerState_v2_t``. + + .. seealso:: `nvmlGpuInstanceSetVgpuSchedulerState_v2` + """ + with nogil: + __status__ = nvmlGpuInstanceSetVgpuSchedulerState_v2(gpu_instance, p_scheduler_state) + check_status(__status__) + + cpdef object system_get_topology_gpu_set(unsigned int cpuNumber): """Retrieve the set of GPUs that have a CPU affinity with the given CPU number @@ -25850,13 +26828,13 @@ cpdef object unit_get_devices(intptr_t unit): """ cdef unsigned int[1] deviceCount = [0] with nogil: - __status__ = nvmlUnitGetDevices(unit, deviceCount, NULL) + __status__ = nvmlUnitGetDevices(unit, deviceCount, NULL) check_status_size(__status__) if deviceCount[0] == 0: return view.array(shape=(1,), itemsize=sizeof(intptr_t), format="P", mode="c")[:0] cdef view.array deviceArray = view.array(shape=(deviceCount[0],), itemsize=sizeof(intptr_t), format="P", mode="c") with nogil: - __status__ = nvmlUnitGetDevices(unit, deviceCount, deviceArray.data) + __status__ = nvmlUnitGetDevices(unit, deviceCount, deviceArray.data) check_status(__status__) return deviceArray @@ -26129,6 +27107,11 @@ cpdef object device_get_field_values(intptr_t device, values): cdef FieldValue values_ = _cast_field_values(values) cdef nvmlFieldValue_t *ptr = values_._get_ptr() cdef unsigned int valuesCount = len(values) + + # Passing a valuesCount of 0 to nvmlDeviceGetFieldValues returns NVML_INVALID_ARGUMENT + if valuesCount == 0: + return values_ + with nogil: __status__ = nvmlDeviceGetFieldValues(device, valuesCount, ptr) check_status(__status__) @@ -26149,6 +27132,10 @@ cpdef device_clear_field_values(intptr_t device, values): cdef nvmlFieldValue_t *ptr = values_._get_ptr() cdef unsigned int valuesCount = len(values) + # Passing a valuesCount of 0 to nvmlDeviceClearFieldValues returns NVML_INVALID_ARGUMENT + if valuesCount == 0: + return values_ + with nogil: __status__ = nvmlDeviceClearFieldValues(device, valuesCount, ptr) check_status(__status__) @@ -27471,3 +28458,10 @@ cpdef str vgpu_type_get_name(unsigned int vgpu_type_id): __status__ = nvmlVgpuTypeGetName(vgpu_type_id, vgpu_type_name, size) check_status(__status__) return cpython.PyUnicode_FromStringAndSize(vgpu_type_name, size[0]) + + +# Cleanup some docstrings that don't parse as rst. +device_get_virtualization_mode.__doc__ = device_get_virtualization_mode.__doc__.replace("NVML_GPU_VIRTUALIZATION_?", "``NVML_GPU_VIRTUALIZATION_?``") +device_set_virtualization_mode.__doc__ = device_set_virtualization_mode.__doc__.replace("NVML_GPU_VIRTUALIZATION_?", "``NVML_GPU_VIRTUALIZATION_?``") +GpmMetricId.GPM_METRIC_DRAM_BW_UTIL.__doc__ = "Percentage of DRAM bw used vs theoretical maximum. ``0.0 - 100.0 *\u200d/``." +del _cyb_FastEnum diff --git a/cuda_bindings/cuda/bindings/nvrtc.pxd b/cuda_bindings/cuda/bindings/nvrtc.pxd new file mode 100644 index 00000000000..a17faea0763 --- /dev/null +++ b/cuda_bindings/cuda/bindings/nvrtc.pxd @@ -0,0 +1,94 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This code was automatically generated with version 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=06a058e3c626563f034714cce129fd58b33dd80c0e4a954723e92d0ae61c7c58 +cimport cuda.bindings.cynvrtc as cynvrtc + +include "_lib/utils.pxd" + +cdef class nvrtcProgram: + """ nvrtcProgram is the unit of compilation, and an opaque handle for a program. + + To compile a CUDA program string, an instance of nvrtcProgram must be created first with nvrtcCreateProgram, then compiled with nvrtcCompileProgram. + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cynvrtc.nvrtcProgram _pvt_val + cdef cynvrtc.nvrtcProgram* _pvt_ptr + +cdef class anon_struct0: + """ + Attributes + ---------- + + available : int + + + + compressedSize : size_t + + + + uncompressedSize : size_t + + + + cudaVersionMajor : int + + + + cudaVersionMinor : int + + + + numFiles : unsigned int + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cynvrtc.nvrtcBundledHeadersInfo* _pvt_ptr + +cdef class nvrtcBundledHeadersInfo(anon_struct0): + """ + Attributes + ---------- + + available : int + + + + compressedSize : size_t + + + + uncompressedSize : size_t + + + + cudaVersionMajor : int + + + + cudaVersionMinor : int + + + + numFiles : unsigned int + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cynvrtc.nvrtcBundledHeadersInfo _pvt_val diff --git a/cuda_bindings/cuda/bindings/nvrtc.pxd.in b/cuda_bindings/cuda/bindings/nvrtc.pxd.in deleted file mode 100644 index f6cd88a3c98..00000000000 --- a/cuda_bindings/cuda/bindings/nvrtc.pxd.in +++ /dev/null @@ -1,24 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -# This code was automatically generated with version 13.2.0, generator version 8797618. Do not modify it directly. -cimport cuda.bindings.cynvrtc as cynvrtc - -include "_lib/utils.pxd" - -{{if 'nvrtcProgram' in found_types}} - -cdef class nvrtcProgram: - """ nvrtcProgram is the unit of compilation, and an opaque handle for a program. - - To compile a CUDA program string, an instance of nvrtcProgram must be created first with nvrtcCreateProgram, then compiled with nvrtcCompileProgram. - - Methods - ------- - getPtr() - Get memory address of class instance - - """ - cdef cynvrtc.nvrtcProgram _pvt_val - cdef cynvrtc.nvrtcProgram* _pvt_ptr -{{endif}} diff --git a/cuda_bindings/cuda/bindings/nvrtc.pyx.in b/cuda_bindings/cuda/bindings/nvrtc.pyx similarity index 72% rename from cuda_bindings/cuda/bindings/nvrtc.pyx.in rename to cuda_bindings/cuda/bindings/nvrtc.pyx index 7874cf7bc06..d963b48f791 100644 --- a/cuda_bindings/cuda/bindings/nvrtc.pyx.in +++ b/cuda_bindings/cuda/bindings/nvrtc.pyx @@ -1,7 +1,8 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated with version 13.2.0, generator version 8797618. Do not modify it directly. +# This code was automatically generated with version 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=ac1af34ecd1468ac91074ce7f18423af19fbc7727653cdfc1cd9b6f33f6cec72 from typing import Any, Optional import cython import ctypes @@ -43,59 +44,66 @@ ctypedef unsigned long long float_ptr ctypedef unsigned long long double_ptr ctypedef unsigned long long void_ptr +#: Flags for nvrtcInstallBundledHeaders.Skip installation if version marker +#: exists and version matches. This is the default behavior when flags=0. +NVRTC_INSTALL_HEADERS_SKIP_IF_EXISTS = cynvrtc.NVRTC_INSTALL_HEADERS_SKIP_IF_EXISTS -{{if 'nvrtcResult' in found_types}} +#: Clear existing directory contents before installation. Guarantees +#: consistency by removing any existing files first. +NVRTC_INSTALL_HEADERS_FORCE_OVERWRITE = cynvrtc.NVRTC_INSTALL_HEADERS_FORCE_OVERWRITE + +#: Return NVRTC_ERROR_BUSY immediately if installation is in progress by +#: another process, instead of waiting for the lock. Can be combined with +#: FORCE_OVERWRITE using bitwise OR. +NVRTC_INSTALL_HEADERS_NO_WAIT = cynvrtc.NVRTC_INSTALL_HEADERS_NO_WAIT class nvrtcResult(_FastEnum): """ - The enumerated type nvrtcResult defines API call result codes. - NVRTC API functions return nvrtcResult to indicate the call result. + The enumerated type :py:obj:`~.nvrtcResult` defines API call result + codes. NVRTC API functions return :py:obj:`~.nvrtcResult` to + indicate the call result. """ - {{if 'NVRTC_SUCCESS' in found_values}} - NVRTC_SUCCESS = cynvrtc.nvrtcResult.NVRTC_SUCCESS{{endif}} - {{if 'NVRTC_ERROR_OUT_OF_MEMORY' in found_values}} - NVRTC_ERROR_OUT_OF_MEMORY = cynvrtc.nvrtcResult.NVRTC_ERROR_OUT_OF_MEMORY{{endif}} - {{if 'NVRTC_ERROR_PROGRAM_CREATION_FAILURE' in found_values}} - NVRTC_ERROR_PROGRAM_CREATION_FAILURE = cynvrtc.nvrtcResult.NVRTC_ERROR_PROGRAM_CREATION_FAILURE{{endif}} - {{if 'NVRTC_ERROR_INVALID_INPUT' in found_values}} - NVRTC_ERROR_INVALID_INPUT = cynvrtc.nvrtcResult.NVRTC_ERROR_INVALID_INPUT{{endif}} - {{if 'NVRTC_ERROR_INVALID_PROGRAM' in found_values}} - NVRTC_ERROR_INVALID_PROGRAM = cynvrtc.nvrtcResult.NVRTC_ERROR_INVALID_PROGRAM{{endif}} - {{if 'NVRTC_ERROR_INVALID_OPTION' in found_values}} - NVRTC_ERROR_INVALID_OPTION = cynvrtc.nvrtcResult.NVRTC_ERROR_INVALID_OPTION{{endif}} - {{if 'NVRTC_ERROR_COMPILATION' in found_values}} - NVRTC_ERROR_COMPILATION = cynvrtc.nvrtcResult.NVRTC_ERROR_COMPILATION{{endif}} - {{if 'NVRTC_ERROR_BUILTIN_OPERATION_FAILURE' in found_values}} - NVRTC_ERROR_BUILTIN_OPERATION_FAILURE = cynvrtc.nvrtcResult.NVRTC_ERROR_BUILTIN_OPERATION_FAILURE{{endif}} - {{if 'NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION' in found_values}} - NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION = cynvrtc.nvrtcResult.NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION{{endif}} - {{if 'NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION' in found_values}} - NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION = cynvrtc.nvrtcResult.NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION{{endif}} - {{if 'NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID' in found_values}} - NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID = cynvrtc.nvrtcResult.NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID{{endif}} - {{if 'NVRTC_ERROR_INTERNAL_ERROR' in found_values}} - NVRTC_ERROR_INTERNAL_ERROR = cynvrtc.nvrtcResult.NVRTC_ERROR_INTERNAL_ERROR{{endif}} - {{if 'NVRTC_ERROR_TIME_FILE_WRITE_FAILED' in found_values}} - NVRTC_ERROR_TIME_FILE_WRITE_FAILED = cynvrtc.nvrtcResult.NVRTC_ERROR_TIME_FILE_WRITE_FAILED{{endif}} - {{if 'NVRTC_ERROR_NO_PCH_CREATE_ATTEMPTED' in found_values}} - NVRTC_ERROR_NO_PCH_CREATE_ATTEMPTED = cynvrtc.nvrtcResult.NVRTC_ERROR_NO_PCH_CREATE_ATTEMPTED{{endif}} - {{if 'NVRTC_ERROR_PCH_CREATE_HEAP_EXHAUSTED' in found_values}} - NVRTC_ERROR_PCH_CREATE_HEAP_EXHAUSTED = cynvrtc.nvrtcResult.NVRTC_ERROR_PCH_CREATE_HEAP_EXHAUSTED{{endif}} - {{if 'NVRTC_ERROR_PCH_CREATE' in found_values}} - 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}} - -{{endif}} -cdef object _nvrtcResult = nvrtcResult -cdef object _nvrtcResult_SUCCESS = nvrtcResult.NVRTC_SUCCESS + NVRTC_SUCCESS = cynvrtc.nvrtcResult.NVRTC_SUCCESS + + NVRTC_ERROR_OUT_OF_MEMORY = cynvrtc.nvrtcResult.NVRTC_ERROR_OUT_OF_MEMORY + + NVRTC_ERROR_PROGRAM_CREATION_FAILURE = cynvrtc.nvrtcResult.NVRTC_ERROR_PROGRAM_CREATION_FAILURE + + NVRTC_ERROR_INVALID_INPUT = cynvrtc.nvrtcResult.NVRTC_ERROR_INVALID_INPUT + + NVRTC_ERROR_INVALID_PROGRAM = cynvrtc.nvrtcResult.NVRTC_ERROR_INVALID_PROGRAM + + NVRTC_ERROR_INVALID_OPTION = cynvrtc.nvrtcResult.NVRTC_ERROR_INVALID_OPTION + + NVRTC_ERROR_COMPILATION = cynvrtc.nvrtcResult.NVRTC_ERROR_COMPILATION + + NVRTC_ERROR_BUILTIN_OPERATION_FAILURE = cynvrtc.nvrtcResult.NVRTC_ERROR_BUILTIN_OPERATION_FAILURE + + NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION = cynvrtc.nvrtcResult.NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION + + NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION = cynvrtc.nvrtcResult.NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION + + NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID = cynvrtc.nvrtcResult.NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID + NVRTC_ERROR_INTERNAL_ERROR = cynvrtc.nvrtcResult.NVRTC_ERROR_INTERNAL_ERROR + NVRTC_ERROR_TIME_FILE_WRITE_FAILED = cynvrtc.nvrtcResult.NVRTC_ERROR_TIME_FILE_WRITE_FAILED -{{if 'nvrtcProgram' in found_types}} + NVRTC_ERROR_NO_PCH_CREATE_ATTEMPTED = cynvrtc.nvrtcResult.NVRTC_ERROR_NO_PCH_CREATE_ATTEMPTED + + NVRTC_ERROR_PCH_CREATE_HEAP_EXHAUSTED = cynvrtc.nvrtcResult.NVRTC_ERROR_PCH_CREATE_HEAP_EXHAUSTED + + NVRTC_ERROR_PCH_CREATE = cynvrtc.nvrtcResult.NVRTC_ERROR_PCH_CREATE + + NVRTC_ERROR_CANCELLED = cynvrtc.nvrtcResult.NVRTC_ERROR_CANCELLED + + NVRTC_ERROR_TIME_TRACE_FILE_WRITE_FAILED = cynvrtc.nvrtcResult.NVRTC_ERROR_TIME_TRACE_FILE_WRITE_FAILED + + NVRTC_ERROR_BUSY = cynvrtc.nvrtcResult.NVRTC_ERROR_BUSY + +cdef object _nvrtcResult = nvrtcResult +cdef object _nvrtcResult_SUCCESS = nvrtcResult.NVRTC_SUCCESS cdef class nvrtcProgram: """ nvrtcProgram is the unit of compilation, and an opaque handle for a program. @@ -130,13 +138,187 @@ cdef class nvrtcProgram: return self._pvt_ptr[0] def getPtr(self): return self._pvt_ptr -{{endif}} -{{if 'nvrtcGetErrorString' in found_functions}} +cdef class anon_struct0: + """ + Attributes + ---------- + + available : int + + + + compressedSize : size_t + + + + uncompressedSize : size_t + + + + cudaVersionMajor : int + + + + cudaVersionMinor : int + + + + numFiles : unsigned int + + + + 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 + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['available : ' + str(self.available)] + except ValueError: + str_list += ['available : '] + + + try: + str_list += ['compressedSize : ' + str(self.compressedSize)] + except ValueError: + str_list += ['compressedSize : '] + + + try: + str_list += ['uncompressedSize : ' + str(self.uncompressedSize)] + except ValueError: + str_list += ['uncompressedSize : '] + + + try: + str_list += ['cudaVersionMajor : ' + str(self.cudaVersionMajor)] + except ValueError: + str_list += ['cudaVersionMajor : '] + + + try: + str_list += ['cudaVersionMinor : ' + str(self.cudaVersionMinor)] + except ValueError: + str_list += ['cudaVersionMinor : '] + + + try: + str_list += ['numFiles : ' + str(self.numFiles)] + except ValueError: + str_list += ['numFiles : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def available(self): + return self._pvt_ptr[0].available + @available.setter + def available(self, int available): + self._pvt_ptr[0].available = available + + + @property + def compressedSize(self): + return self._pvt_ptr[0].compressedSize + @compressedSize.setter + def compressedSize(self, size_t compressedSize): + self._pvt_ptr[0].compressedSize = compressedSize + + + @property + def uncompressedSize(self): + return self._pvt_ptr[0].uncompressedSize + @uncompressedSize.setter + def uncompressedSize(self, size_t uncompressedSize): + self._pvt_ptr[0].uncompressedSize = uncompressedSize + + + @property + def cudaVersionMajor(self): + return self._pvt_ptr[0].cudaVersionMajor + @cudaVersionMajor.setter + def cudaVersionMajor(self, int cudaVersionMajor): + self._pvt_ptr[0].cudaVersionMajor = cudaVersionMajor + + + @property + def cudaVersionMinor(self): + return self._pvt_ptr[0].cudaVersionMinor + @cudaVersionMinor.setter + def cudaVersionMinor(self, int cudaVersionMinor): + self._pvt_ptr[0].cudaVersionMinor = cudaVersionMinor + + + @property + def numFiles(self): + return self._pvt_ptr[0].numFiles + @numFiles.setter + def numFiles(self, unsigned int numFiles): + self._pvt_ptr[0].numFiles = numFiles + + +cdef class nvrtcBundledHeadersInfo(anon_struct0): + """ + Attributes + ---------- + + available : int + + + + compressedSize : size_t + + + + uncompressedSize : size_t + + + + cudaVersionMajor : int + + + + cudaVersionMinor : int + + + + numFiles : unsigned int + + + + 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 @cython.embedsignature(True) def nvrtcGetErrorString(result not None : nvrtcResult): - """ nvrtcGetErrorString is a helper function that returns a string describing the given nvrtcResult code, e.g., NVRTC_SUCCESS to `"NVRTC_SUCCESS"`. For unrecognized enumeration values, it returns `"NVRTC_ERROR unknown"`. + """ nvrtcGetErrorString is a helper function that returns a string describing the given :py:obj:`~.nvrtcResult` code, e.g., NVRTC_SUCCESS to `"NVRTC_SUCCESS"`. For unrecognized enumeration values, it returns `"NVRTC_ERROR unknown"`. Parameters ---------- @@ -154,9 +336,6 @@ def nvrtcGetErrorString(result not None : nvrtcResult): with nogil: err = cynvrtc.nvrtcGetErrorString(cyresult) return (nvrtcResult.NVRTC_SUCCESS, err) -{{endif}} - -{{if 'nvrtcVersion' in found_functions}} @cython.embedsignature(True) def nvrtcVersion(): @@ -179,9 +358,6 @@ def nvrtcVersion(): if err != cynvrtc.NVRTC_SUCCESS: return (_nvrtcResult(err), None, None) return (_nvrtcResult_SUCCESS, major, minor) -{{endif}} - -{{if 'nvrtcGetNumSupportedArchs' in found_functions}} @cython.embedsignature(True) def nvrtcGetNumSupportedArchs(): @@ -203,9 +379,6 @@ def nvrtcGetNumSupportedArchs(): if err != cynvrtc.NVRTC_SUCCESS: return (_nvrtcResult(err), None) return (_nvrtcResult_SUCCESS, numArchs) -{{endif}} - -{{if 'nvrtcGetSupportedArchs' in found_functions}} @cython.embedsignature(True) def nvrtcGetSupportedArchs(): @@ -230,13 +403,10 @@ def nvrtcGetSupportedArchs(): if err != cynvrtc.NVRTC_SUCCESS: return (_nvrtcResult(err), None) return (_nvrtcResult_SUCCESS, supportedArchs) -{{endif}} - -{{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]]): - """ nvrtcCreateProgram creates an instance of nvrtcProgram with the given input parameters, and sets the output parameter `prog` with it. + """ nvrtcCreateProgram creates an instance of :py:obj:`~.nvrtcProgram` with the given input parameters, and sets the output parameter `prog` with it. Parameters ---------- @@ -288,9 +458,6 @@ def nvrtcCreateProgram(char* src, char* name, int numHeaders, headers : Optional if err != cynvrtc.NVRTC_SUCCESS: return (_nvrtcResult(err), None) return (_nvrtcResult_SUCCESS, prog) -{{endif}} - -{{if 'nvrtcDestroyProgram' in found_functions}} @cython.embedsignature(True) def nvrtcDestroyProgram(prog): @@ -324,9 +491,6 @@ def nvrtcDestroyProgram(prog): with nogil: err = cynvrtc.nvrtcDestroyProgram(cyprog) return (_nvrtcResult(err),) -{{endif}} - -{{if 'nvrtcCompileProgram' in found_functions}} @cython.embedsignature(True) def nvrtcCompileProgram(prog, int numOptions, options : Optional[tuple[bytes] | list[bytes]]): @@ -374,9 +538,6 @@ def nvrtcCompileProgram(prog, int numOptions, options : Optional[tuple[bytes] | with nogil: err = cynvrtc.nvrtcCompileProgram(cyprog, numOptions, cyoptions.data()) return (_nvrtcResult(err),) -{{endif}} - -{{if 'nvrtcGetPTXSize' in found_functions}} @cython.embedsignature(True) def nvrtcGetPTXSize(prog): @@ -414,9 +575,6 @@ def nvrtcGetPTXSize(prog): if err != cynvrtc.NVRTC_SUCCESS: return (_nvrtcResult(err), None) return (_nvrtcResult_SUCCESS, ptxSizeRet) -{{endif}} - -{{if 'nvrtcGetPTX' in found_functions}} @cython.embedsignature(True) def nvrtcGetPTX(prog, char* ptx): @@ -451,9 +609,6 @@ def nvrtcGetPTX(prog, char* ptx): with nogil: err = cynvrtc.nvrtcGetPTX(cyprog, ptx) return (_nvrtcResult(err),) -{{endif}} - -{{if 'nvrtcGetCUBINSize' in found_functions}} @cython.embedsignature(True) def nvrtcGetCUBINSize(prog): @@ -491,13 +646,10 @@ def nvrtcGetCUBINSize(prog): if err != cynvrtc.NVRTC_SUCCESS: return (_nvrtcResult(err), None) return (_nvrtcResult_SUCCESS, cubinSizeRet) -{{endif}} - -{{if 'nvrtcGetCUBIN' in found_functions}} @cython.embedsignature(True) def nvrtcGetCUBIN(prog, char* cubin): - """ nvrtcGetCUBIN stores the cubin generated by the previous compilation of `prog` in the memory pointed by `cubin`. No cubin is available if the value specified to `-arch` is a virtual architecture instead of an actual architecture. + """ nvrtcGetCUBIN stores the cubin generated by the previous compilation of `prog` in the memory pointed by `cubin`. No cubin is available if the value specified to `-arch` is a virtual architecture instead of an actual architecture. The cubin does not contain code for the Tile functions (`__tile__` / `__tile_global__`) or variables (`__tile__`); use `nvrtcGetTileIR()` to extract the cuda_tile IR generated for Tile code. Parameters ---------- @@ -528,9 +680,6 @@ def nvrtcGetCUBIN(prog, char* cubin): with nogil: err = cynvrtc.nvrtcGetCUBIN(cyprog, cubin) return (_nvrtcResult(err),) -{{endif}} - -{{if 'nvrtcGetLTOIRSize' in found_functions}} @cython.embedsignature(True) def nvrtcGetLTOIRSize(prog): @@ -568,9 +717,6 @@ def nvrtcGetLTOIRSize(prog): if err != cynvrtc.NVRTC_SUCCESS: return (_nvrtcResult(err), None) return (_nvrtcResult_SUCCESS, LTOIRSizeRet) -{{endif}} - -{{if 'nvrtcGetLTOIR' in found_functions}} @cython.embedsignature(True) def nvrtcGetLTOIR(prog, char* LTOIR): @@ -605,9 +751,6 @@ def nvrtcGetLTOIR(prog, char* LTOIR): with nogil: err = cynvrtc.nvrtcGetLTOIR(cyprog, LTOIR) return (_nvrtcResult(err),) -{{endif}} - -{{if 'nvrtcGetOptiXIRSize' in found_functions}} @cython.embedsignature(True) def nvrtcGetOptiXIRSize(prog): @@ -645,9 +788,6 @@ def nvrtcGetOptiXIRSize(prog): if err != cynvrtc.NVRTC_SUCCESS: return (_nvrtcResult(err), None) return (_nvrtcResult_SUCCESS, optixirSizeRet) -{{endif}} - -{{if 'nvrtcGetOptiXIR' in found_functions}} @cython.embedsignature(True) def nvrtcGetOptiXIR(prog, char* optixir): @@ -682,9 +822,6 @@ def nvrtcGetOptiXIR(prog, char* optixir): with nogil: err = cynvrtc.nvrtcGetOptiXIR(cyprog, optixir) return (_nvrtcResult(err),) -{{endif}} - -{{if 'nvrtcGetProgramLogSize' in found_functions}} @cython.embedsignature(True) def nvrtcGetProgramLogSize(prog): @@ -725,9 +862,6 @@ def nvrtcGetProgramLogSize(prog): if err != cynvrtc.NVRTC_SUCCESS: return (_nvrtcResult(err), None) return (_nvrtcResult_SUCCESS, logSizeRet) -{{endif}} - -{{if 'nvrtcGetProgramLog' in found_functions}} @cython.embedsignature(True) def nvrtcGetProgramLog(prog, char* log): @@ -762,9 +896,6 @@ def nvrtcGetProgramLog(prog, char* log): with nogil: err = cynvrtc.nvrtcGetProgramLog(cyprog, log) return (_nvrtcResult(err),) -{{endif}} - -{{if 'nvrtcAddNameExpression' in found_functions}} @cython.embedsignature(True) def nvrtcAddNameExpression(prog, char* name_expression): @@ -804,9 +935,6 @@ def nvrtcAddNameExpression(prog, char* name_expression): with nogil: err = cynvrtc.nvrtcAddNameExpression(cyprog, name_expression) return (_nvrtcResult(err),) -{{endif}} - -{{if 'nvrtcGetLoweredName' in found_functions}} @cython.embedsignature(True) def nvrtcGetLoweredName(prog, char* name_expression): @@ -849,9 +977,6 @@ def nvrtcGetLoweredName(prog, char* name_expression): if err != cynvrtc.NVRTC_SUCCESS: return (_nvrtcResult(err), None) return (_nvrtcResult_SUCCESS, lowered_name if lowered_name != NULL else None) -{{endif}} - -{{if 'nvrtcGetPCHHeapSize' in found_functions}} @cython.embedsignature(True) def nvrtcGetPCHHeapSize(): @@ -871,9 +996,6 @@ def nvrtcGetPCHHeapSize(): if err != cynvrtc.NVRTC_SUCCESS: return (_nvrtcResult(err), None) return (_nvrtcResult_SUCCESS, ret) -{{endif}} - -{{if 'nvrtcSetPCHHeapSize' in found_functions}} @cython.embedsignature(True) def nvrtcSetPCHHeapSize(size_t size): @@ -896,9 +1018,6 @@ def nvrtcSetPCHHeapSize(size_t size): with nogil: err = cynvrtc.nvrtcSetPCHHeapSize(size) return (_nvrtcResult(err),) -{{endif}} - -{{if 'nvrtcGetPCHCreateStatus' in found_functions}} @cython.embedsignature(True) def nvrtcGetPCHCreateStatus(prog): @@ -944,9 +1063,6 @@ def nvrtcGetPCHCreateStatus(prog): with nogil: err = cynvrtc.nvrtcGetPCHCreateStatus(cyprog) return (_nvrtcResult(err),) -{{endif}} - -{{if 'nvrtcGetPCHHeapSizeRequired' in found_functions}} @cython.embedsignature(True) def nvrtcGetPCHHeapSizeRequired(prog): @@ -981,9 +1097,6 @@ def nvrtcGetPCHHeapSizeRequired(prog): if err != cynvrtc.NVRTC_SUCCESS: return (_nvrtcResult(err), None) return (_nvrtcResult_SUCCESS, size) -{{endif}} - -{{if 'nvrtcSetFlowCallback' in found_functions}} @cython.embedsignature(True) def nvrtcSetFlowCallback(prog, callback, payload): @@ -1044,25 +1157,28 @@ def nvrtcSetFlowCallback(prog, callback, payload): _helper_input_void_ptr_free(&cycallbackHelper) _helper_input_void_ptr_free(&cypayloadHelper) return (_nvrtcResult(err),) -{{endif}} - -{{if 'nvrtcGetTileIRSize' in found_functions}} @cython.embedsignature(True) def nvrtcGetTileIRSize(prog): - """ + """ nvrtcGetTileIRSize sets the value of `TileIRSizeRet` with the size of the cuda_tile IR generated by the previous compilation of `prog`. Parameters ---------- prog : :py:obj:`~.nvrtcProgram` - None + CUDA Runtime Compilation program. Returns ------- nvrtcResult - + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` + - :py:obj:`~.NVRTC_ERROR_INVALID_PROGRAM` TileIRSizeRet : int - None + Size of the generated cuda_tile IR. + + See Also + -------- + :py:obj:`~.nvrtcGetTileIR` """ cdef cynvrtc.nvrtcProgram cyprog if prog is None: @@ -1078,25 +1194,28 @@ def nvrtcGetTileIRSize(prog): if err != cynvrtc.NVRTC_SUCCESS: return (_nvrtcResult(err), None) return (_nvrtcResult_SUCCESS, TileIRSizeRet) -{{endif}} - -{{if 'nvrtcGetTileIR' in found_functions}} @cython.embedsignature(True) def nvrtcGetTileIR(prog, char* TileIR): - """ + """ nvrtcGetTileIR stores the cuda_tile IR generated by the previous compilation of `prog` in the memory pointed by `TileIR`. Parameters ---------- prog : :py:obj:`~.nvrtcProgram` - None + CUDA Runtime Compilation program. TileIR : bytes - None + Generated cuda_tile IR. Returns ------- nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` + - :py:obj:`~.NVRTC_ERROR_INVALID_PROGRAM` + See Also + -------- + :py:obj:`~.nvrtcGetTileIRSize` """ cdef cynvrtc.nvrtcProgram cyprog if prog is None: @@ -1109,7 +1228,136 @@ def nvrtcGetTileIR(prog, char* TileIR): with nogil: err = cynvrtc.nvrtcGetTileIR(cyprog, TileIR) return (_nvrtcResult(err),) -{{endif}} + +@cython.embedsignature(True) +def nvrtcInstallBundledHeaders(char* installPath, unsigned int flags): + """ nvrtcInstallBundledHeaders extracts CUDA headers bundled with NVRTC to a specified directory for use during compilation. + + NVRTC bundles a set of CUDA Toolkit headers and CUDA C++ Core Libraries + (CCCL) within libnvrtc-builtins. This function extracts these headers + to the specified directory, allowing NVRTC programs to compile without + requiring a separate CUDA Toolkit installation. The bundled headers + match those available in the CUDA Toolkit plus CCCL libraries. + + After extraction, users can compile kernels by passing appropriate + include paths (such as "-I" and "-I/cccl") to + nvrtcCompileProgram. + + A version marker file (.nvrtc_headers_version) is created in the + installation directory to track the installed version. + + This function is thread-safe and process-safe. Concurrent calls from + multiple threads or processes will be serialized using file locking. By + default, the function waits for the lock; use + NVRTC_INSTALL_HEADERS_NO_WAIT to return immediately with + NVRTC_ERROR_BUSY if another process holds the lock. + + Parameters + ---------- + installPath : bytes + Path where headers should be extracted (UTF-8 encoded). The + directory will be created if it doesn't exist. + flags : unsigned int + NVRTC_INSTALL_HEADERS_* flags: + + Returns + ------- + nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` (invalid path or conflicting flags like SKIP_IF_EXISTS | FORCE_OVERWRITE) + - :py:obj:`~.NVRTC_ERROR_BUILTIN_OPERATION_FAILURE` (extraction failed or version mismatch) + - :py:obj:`~.NVRTC_ERROR_BUSY` (lock held by another process and NVRTC_INSTALL_HEADERS_NO_WAIT was specified) + errorLog : bytes + Optional pointer to receive detailed error message on failure. If + non-NULL, `*errorLog` will be set to point to a string describing + the error cause. Note: subsequent API calls from the same thread + may overwrite this message. May be NULL if error details are not + needed. + + See Also + -------- + :py:obj:`~.nvrtcCompileProgram` + + Notes + ----- + Use NVRTC_INSTALL_HEADERS_SKIP_IF_EXISTS to avoid reinstalling if headers already exist. Use NVRTC_INSTALL_HEADERS_FORCE_OVERWRITE to guarantee consistency by clearing the directory first. + """ + cdef const char* errorLog = NULL + with nogil: + err = cynvrtc.nvrtcInstallBundledHeaders(installPath, flags, &errorLog) + if err != cynvrtc.NVRTC_SUCCESS: + return (_nvrtcResult(err), None) + return (_nvrtcResult_SUCCESS, errorLog if errorLog != NULL else None) + +@cython.embedsignature(True) +def nvrtcGetBundledHeadersInfo(): + """ nvrtcGetBundledHeadersInfo queries information about the bundled headers without extracting them. + + This function allows users to determine if bundled headers are + available and get size estimates before calling + nvrtcInstallBundledHeaders. + + Returns + ------- + nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` (info is NULL) + - :py:obj:`~.NVRTC_ERROR_BUILTIN_OPERATION_FAILURE` (failed to query bundled headers) + info : :py:obj:`~.nvrtcBundledHeadersInfo` + Pointer to structure to receive header information. + errorLog : bytes + Optional pointer to receive detailed error message on failure. If + non-NULL, `*errorLog` will be set to point to a string describing + the error cause. Note: subsequent API calls from the same thread + may overwrite this message. May be NULL if error details are not + needed. + """ + cdef nvrtcBundledHeadersInfo info = nvrtcBundledHeadersInfo() + cdef const char* errorLog = NULL + with nogil: + err = cynvrtc.nvrtcGetBundledHeadersInfo(info._pvt_ptr, &errorLog) + if err != cynvrtc.NVRTC_SUCCESS: + return (_nvrtcResult(err), None, None) + return (_nvrtcResult_SUCCESS, info, errorLog if errorLog != NULL else None) + +@cython.embedsignature(True) +def nvrtcRemoveBundledHeaders(char* installPath): + """ nvrtcRemoveBundledHeaders removes previously installed bundled headers. + + This function removes the headers installed by + nvrtcInstallBundledHeaders, helping users manage disk space. It + recursively removes all files and subdirectories within the + installation directory. + + Parameters + ---------- + installPath : bytes + Path where headers were previously installed. Must be the same path + used with nvrtcInstallBundledHeaders. + + Returns + ------- + nvrtcResult + - :py:obj:`~.NVRTC_SUCCESS` + - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` (invalid path) + - :py:obj:`~.NVRTC_ERROR_BUILTIN_OPERATION_FAILURE` (removal failed) + errorLog : bytes + Optional pointer to receive detailed error message on failure. If + non-NULL, `*errorLog` will be set to point to a string describing + the error cause. Note: subsequent API calls from the same thread + may overwrite this message. May be NULL if error details are not + needed. + + Notes + ----- + This function will remove ALL contents of the specified directory, not just files installed by NVRTC. Use with caution. + """ + cdef const char* errorLog = NULL + with nogil: + err = cynvrtc.nvrtcRemoveBundledHeaders(installPath, &errorLog) + if err != cynvrtc.NVRTC_SUCCESS: + return (_nvrtcResult(err), None) + return (_nvrtcResult_SUCCESS, errorLog if errorLog != NULL else None) @cython.embedsignature(True) def sizeof(objType): @@ -1125,7 +1373,10 @@ def sizeof(objType): lowered_name : int The size of `objType` in bytes """ - {{if 'nvrtcProgram' in found_types}} + if objType == nvrtcProgram: - return sizeof(cynvrtc.nvrtcProgram){{endif}} + return sizeof(cynvrtc.nvrtcProgram) + + if objType == nvrtcBundledHeadersInfo: + return sizeof(cynvrtc.nvrtcBundledHeadersInfo) raise TypeError("Unknown type: " + str(objType)) diff --git a/cuda_bindings/cuda/bindings/nvvm.pxd b/cuda_bindings/cuda/bindings/nvvm.pxd index 0b17a143ca0..cb97bd48714 100644 --- a/cuda_bindings/cuda/bindings/nvvm.pxd +++ b/cuda_bindings/cuda/bindings/nvvm.pxd @@ -1,9 +1,10 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b4e10f31d2308a47fccfc9401d4f179bf61d389c1eb1491e8f9b00bf37a14ea9 from libc.stdint cimport intptr_t from .cynvvm cimport * @@ -39,3 +40,4 @@ cpdef size_t get_compiled_result_size(intptr_t prog) except? 0 cpdef get_compiled_result(intptr_t prog, buffer) cpdef size_t get_program_log_size(intptr_t prog) except? 0 cpdef get_program_log(intptr_t prog, buffer) +cpdef int llvm_version(arch) except? 0 diff --git a/cuda_bindings/cuda/bindings/nvvm.pyx b/cuda_bindings/cuda/bindings/nvvm.pyx index 0077d594e06..eec2fd8556a 100644 --- a/cuda_bindings/cuda/bindings/nvvm.pyx +++ b/cuda_bindings/cuda/bindings/nvvm.pyx @@ -1,22 +1,28 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=663773bbe4ae03ad1e170d44b06d5a924b5e4a3a0bd901c2f276976b82943bcb + +# <<<< PREAMBLE CONTENT >>>> + +from cuda.bindings._internal._fast_enum import FastEnum as _cyb_FastEnum + +# <<<< END OF PREAMBLE CONTENT >>>> + cimport cython # NOQA from ._internal.utils cimport (get_buffer_pointer, get_nested_resource_ptr, nested_resource) -from cuda.bindings._internal._fast_enum import FastEnum as _IntEnum - ############################################################################### # Enum ############################################################################### -class Result(_IntEnum): +class Result(_cyb_FastEnum): """ NVVM API call result code. @@ -299,3 +305,26 @@ cpdef get_program_log(intptr_t prog, buffer): with nogil: __status__ = nvvmGetProgramLog(prog, _buffer_) check_status(__status__) + + +cpdef int llvm_version(arch) except? 0: + """Get the LLVM IR version guaranteed to be supported by NVVM. + + Args: + arch (str): Architecture string. + + Returns: + int: IR version number. + + .. seealso:: `nvvmLLVMVersion` + """ + if not isinstance(arch, str): + raise TypeError("arch must be a Python str") + cdef bytes _temp_arch_ = (arch).encode() + cdef char* _arch_ = _temp_arch_ + cdef int major + with nogil: + __status__ = nvvmLLVMVersion(_arch_, &major) + check_status(__status__) + return major +del _cyb_FastEnum diff --git a/cuda_bindings/cuda/bindings/runtime.pxd.in b/cuda_bindings/cuda/bindings/runtime.pxd.in index 2a54d3f6755..7881587683b 100644 --- a/cuda_bindings/cuda/bindings/runtime.pxd.in +++ b/cuda_bindings/cuda/bindings/runtime.pxd.in @@ -1,7 +1,8 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated with version 13.2.0, generator version 8797618. Do not modify it directly. +# This code was automatically generated with version 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=532f673750b6344c789f7947449c1d99e3587792ba3b110e9dcc36396decbb67 cimport cuda.bindings.cyruntime as cyruntime include "_lib/utils.pxd" @@ -333,6 +334,21 @@ cdef class cudaStreamCallback_t: cdef cyruntime.cudaStreamCallback_t* _pvt_ptr {{endif}} +{{if 'cudaGraphRecaptureCallback_t' in found_types}} + +cdef class cudaGraphRecaptureCallback_t: + """ + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cyruntime.cudaGraphRecaptureCallback_t _pvt_val + cdef cyruntime.cudaGraphRecaptureCallback_t* _pvt_ptr +{{endif}} + {{if 'cudaLogsCallback_t' in found_types}} cdef class cudaLogsCallback_t: @@ -511,7 +527,7 @@ cdef class cudaArrayMemoryRequirements: cdef class cudaPitchedPtr: """ - CUDA Pitched memory pointer ::make_cudaPitchedPtr + CUDA Pitched memory pointer make_cudaPitchedPtr Attributes ---------- @@ -547,7 +563,7 @@ cdef class cudaPitchedPtr: cdef class cudaExtent: """ - CUDA extent ::make_cudaExtent + CUDA extent make_cudaExtent Attributes ---------- @@ -577,7 +593,7 @@ cdef class cudaExtent: cdef class cudaPos: """ - CUDA 3D position ::make_cudaPos + CUDA 3D position make_cudaPos Attributes ---------- @@ -1428,8 +1444,14 @@ cdef class cudaFuncAttributes: higher cluster sizes that’s not guaranteed to be portable. See cudaFuncSetAttribute {{endif}} - {{if 'cudaFuncAttributes.reserved0' in found_struct}} - reserved0 : int + {{if 'cudaFuncAttributes.deviceNodeUpdateStatus' in found_struct}} + deviceNodeUpdateStatus : int + Whether the function can be updated on device. 1 means device node + update is supported, 0 is unsupported or driver is too old to check + the value. + {{endif}} + {{if 'cudaFuncAttributes.reserved1' in found_struct}} + reserved1 : int {{endif}} {{if 'cudaFuncAttributes.reserved' in found_struct}} @@ -1462,7 +1484,9 @@ cdef class cudaMemLocation: {{endif}} {{if 'cudaMemLocation.id' in found_struct}} id : int - identifier for a given this location's ::CUmemLocationType. + Identifier for cudaMemLocationType::cudaMemLocationTypeDevice, + cudaMemLocationType::cudaMemLocationTypeHost, or + cudaMemLocationType::cudaMemLocationTypeHostNuma. {{endif}} Methods @@ -1470,7 +1494,7 @@ cdef class cudaMemLocation: getPtr() Get memory address of class instance """ - cdef cyruntime.cudaMemLocation _pvt_val + cdef cyruntime.cudaMemLocation* _val_ptr cdef cyruntime.cudaMemLocation* _pvt_ptr {{endif}} {{if 'cudaMemAccessDesc' in found_struct}} @@ -1844,7 +1868,7 @@ cdef class anon_struct7: {{endif}} {{if 'cudaMemcpy3DOperand.op' in found_struct}} -cdef class anon_union1: +cdef class anon_union2: """ Attributes ---------- @@ -1883,7 +1907,7 @@ cdef class cudaMemcpy3DOperand: {{endif}} {{if 'cudaMemcpy3DOperand.op' in found_struct}} - op : anon_union1 + op : anon_union2 {{endif}} @@ -1895,7 +1919,7 @@ cdef class cudaMemcpy3DOperand: cdef cyruntime.cudaMemcpy3DOperand* _val_ptr cdef cyruntime.cudaMemcpy3DOperand* _pvt_ptr {{if 'cudaMemcpy3DOperand.op' in found_struct}} - cdef anon_union1 _op + cdef anon_union2 _op {{endif}} {{endif}} {{if 'cudaMemcpy3DBatchOp' in found_struct}} @@ -2468,7 +2492,7 @@ cdef class anon_struct8: {{endif}} {{if 'cudaExternalMemoryHandleDesc.handle' in found_struct}} -cdef class anon_union2: +cdef class anon_union3: """ Attributes ---------- @@ -2511,7 +2535,7 @@ cdef class cudaExternalMemoryHandleDesc: Type of the handle {{endif}} {{if 'cudaExternalMemoryHandleDesc.handle' in found_struct}} - handle : anon_union2 + handle : anon_union3 {{endif}} {{if 'cudaExternalMemoryHandleDesc.size' in found_struct}} @@ -2535,7 +2559,7 @@ cdef class cudaExternalMemoryHandleDesc: cdef cyruntime.cudaExternalMemoryHandleDesc* _val_ptr cdef cyruntime.cudaExternalMemoryHandleDesc* _pvt_ptr {{if 'cudaExternalMemoryHandleDesc.handle' in found_struct}} - cdef anon_union2 _handle + cdef anon_union3 _handle {{endif}} {{endif}} {{if 'cudaExternalMemoryBufferDesc' in found_struct}} @@ -2650,7 +2674,7 @@ cdef class anon_struct9: {{endif}} {{if 'cudaExternalSemaphoreHandleDesc.handle' in found_struct}} -cdef class anon_union3: +cdef class anon_union4: """ Attributes ---------- @@ -2693,7 +2717,7 @@ cdef class cudaExternalSemaphoreHandleDesc: Type of the handle {{endif}} {{if 'cudaExternalSemaphoreHandleDesc.handle' in found_struct}} - handle : anon_union3 + handle : anon_union4 {{endif}} {{if 'cudaExternalSemaphoreHandleDesc.flags' in found_struct}} @@ -2713,7 +2737,7 @@ cdef class cudaExternalSemaphoreHandleDesc: cdef cyruntime.cudaExternalSemaphoreHandleDesc* _val_ptr cdef cyruntime.cudaExternalSemaphoreHandleDesc* _pvt_ptr {{if 'cudaExternalSemaphoreHandleDesc.handle' in found_struct}} - cdef anon_union3 _handle + cdef anon_union4 _handle {{endif}} {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.fence' in found_struct}} @@ -2736,7 +2760,7 @@ cdef class anon_struct10: {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync' in found_struct}} -cdef class anon_union4: +cdef class anon_union5: """ Attributes ---------- @@ -2788,7 +2812,7 @@ cdef class anon_struct12: {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync' in found_struct}} - nvSciSync : anon_union4 + nvSciSync : anon_union5 {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.keyedMutex' in found_struct}} @@ -2810,7 +2834,7 @@ cdef class anon_struct12: cdef anon_struct10 _fence {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync' in found_struct}} - cdef anon_union4 _nvSciSync + cdef anon_union5 _nvSciSync {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.keyedMutex' in found_struct}} cdef anon_struct11 _keyedMutex @@ -2875,7 +2899,7 @@ cdef class anon_struct13: {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync' in found_struct}} -cdef class anon_union5: +cdef class anon_union6: """ Attributes ---------- @@ -2931,7 +2955,7 @@ cdef class anon_struct15: {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync' in found_struct}} - nvSciSync : anon_union5 + nvSciSync : anon_union6 {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.keyedMutex' in found_struct}} @@ -2953,7 +2977,7 @@ cdef class anon_struct15: cdef anon_struct13 _fence {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync' in found_struct}} - cdef anon_union5 _nvSciSync + cdef anon_union6 _nvSciSync {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.keyedMutex' in found_struct}} cdef anon_struct14 _keyedMutex @@ -3116,7 +3140,7 @@ cdef class cudaDevSmResourceGroupParams_st: {{endif}} {{if 'cudaDevSmResourceGroupParams_st.reserved' in found_struct}} reserved : list[unsigned int] - Reserved for future use - ensure this is is zero initialized. + Reserved for future use - ensure this is zero initialized. {{endif}} Methods @@ -3817,9 +3841,9 @@ cdef class cudaGraphEdgeData_st: {{endif}} {{if 'cudaGraphEdgeData_st.type' in found_struct}} type : bytes - This should be populated with a value from - ::cudaGraphDependencyType. (It is typed as char due to compiler- - specific layout of bitfields.) See ::cudaGraphDependencyType. + This should be populated with a value from cudaGraphDependencyType. + (It is typed as char due to compiler-specific layout of bitfields.) + See cudaGraphDependencyType. {{endif}} {{if 'cudaGraphEdgeData_st.reserved' in found_struct}} reserved : bytes @@ -3943,7 +3967,7 @@ cdef class anon_struct16: {{endif}} {{if 'cudaGraphKernelNodeUpdate.updateData' in found_struct}} -cdef class anon_union9: +cdef class anon_union10: """ Attributes ---------- @@ -3992,7 +4016,7 @@ cdef class cudaGraphKernelNodeUpdate: interpreted {{endif}} {{if 'cudaGraphKernelNodeUpdate.updateData' in found_struct}} - updateData : anon_union9 + updateData : anon_union10 Update data to apply. Which field is used depends on field's value {{endif}} @@ -4007,7 +4031,7 @@ cdef class cudaGraphKernelNodeUpdate: cdef cudaGraphDeviceNode_t _node {{endif}} {{if 'cudaGraphKernelNodeUpdate.updateData' in found_struct}} - cdef anon_union9 _updateData + cdef anon_union10 _updateData {{endif}} {{endif}} {{if 'cudaLaunchMemSyncDomainMap_st' in found_struct}} @@ -4017,8 +4041,8 @@ cdef class cudaLaunchMemSyncDomainMap_st: Memory Synchronization Domain map See cudaLaunchMemSyncDomain. By default, kernels are launched in domain 0. Kernel launched with cudaLaunchMemSyncDomainRemote will have a different domain ID. User - may also alter the domain ID with ::cudaLaunchMemSyncDomainMap for - a specific stream / graph node / kernel launch. See + may also alter the domain ID with cudaLaunchMemSyncDomainMap for a + specific stream / graph node / kernel launch. See cudaLaunchAttributeMemSyncDomainMap. Domain ID range is available through cudaDevAttrMemSyncDomainCount. @@ -4176,8 +4200,7 @@ cdef class anon_struct21: cdef class cudaLaunchAttributeValue: """ - Launch attributes union; used as value field of - ::cudaLaunchAttribute + Launch attributes union; used as value field of cudaLaunchAttribute Attributes ---------- @@ -4197,7 +4220,7 @@ cdef class cudaLaunchAttributeValue: {{if 'cudaLaunchAttributeValue.syncPolicy' in found_struct}} syncPolicy : cudaSynchronizationPolicy Value of launch attribute cudaLaunchAttributeSynchronizationPolicy. - ::cudaSynchronizationPolicy for work queued up in this stream. + cudaSynchronizationPolicy for work queued up in this stream. {{endif}} {{if 'cudaLaunchAttributeValue.clusterDim' in found_struct}} clusterDim : anon_struct17 @@ -4237,7 +4260,7 @@ cdef class cudaLaunchAttributeValue: {{if 'cudaLaunchAttributeValue.memSyncDomainMap' in found_struct}} memSyncDomainMap : cudaLaunchMemSyncDomainMap Value of launch attribute cudaLaunchAttributeMemSyncDomainMap. See - ::cudaLaunchMemSyncDomainMap. + cudaLaunchMemSyncDomainMap. {{endif}} {{if 'cudaLaunchAttributeValue.memSyncDomain' in found_struct}} memSyncDomain : cudaLaunchMemSyncDomain @@ -4252,12 +4275,12 @@ cdef class cudaLaunchAttributeValue: with the following fields: - `x` - The X dimension of the preferred cluster, in blocks. Must be a divisor of the grid X dimension, and must be a multiple of the `x` field of - cudaLaunchAttributeValue::clusterDim. - `y` - The Y dimension of - the preferred cluster, in blocks. Must be a divisor of the grid Y - dimension, and must be a multiple of the `y` field of - cudaLaunchAttributeValue::clusterDim. - `z` - The Z dimension of - the preferred cluster, in blocks. Must be equal to the `z` field of - cudaLaunchAttributeValue::clusterDim. + ::cudaLaunchAttributeValue::clusterDim. - `y` - The Y dimension + of the preferred cluster, in blocks. Must be a divisor of the grid + Y dimension, and must be a multiple of the `y` field of + ::cudaLaunchAttributeValue::clusterDim. - `z` - The Z dimension + of the preferred cluster, in blocks. Must be equal to the `z` field + of ::cudaLaunchAttributeValue::clusterDim. {{endif}} {{if 'cudaLaunchAttributeValue.launchCompletionEvent' in found_struct}} launchCompletionEvent : anon_struct20 @@ -4374,7 +4397,7 @@ cdef class anon_struct22: {{endif}} {{if 'cudaAsyncNotificationInfo.info' in found_struct}} -cdef class anon_union10: +cdef class anon_union11: """ Attributes ---------- @@ -4406,7 +4429,7 @@ cdef class cudaAsyncNotificationInfo: The type of notification being sent {{endif}} {{if 'cudaAsyncNotificationInfo.info' in found_struct}} - info : anon_union10 + info : anon_union11 Information about the notification. `typename` must be checked in order to interpret this field. {{endif}} @@ -4419,7 +4442,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_union11 _info {{endif}} {{endif}} {{if 'cudaTextureDesc' in found_struct}} @@ -4491,6 +4514,38 @@ cdef class cudaTextureDesc: cdef cyruntime.cudaTextureDesc _pvt_val cdef cyruntime.cudaTextureDesc* _pvt_ptr {{endif}} +{{if 'cudaGraphRecaptureCallbackData' in found_struct}} + +cdef class cudaGraphRecaptureCallbackData: + """ + Struct of user callback data that is invoked when node parameter + mismatches are detected while recapturing to an existing graph + + Attributes + ---------- + {{if 'cudaGraphRecaptureCallbackData.callbackFunc' in found_struct}} + callbackFunc : cudaGraphRecaptureCallback_t + Callback function that will be invoked + {{endif}} + {{if 'cudaGraphRecaptureCallbackData.userData' in found_struct}} + userData : Any + Generic pointer that is passed to the callback function + {{endif}} + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaGraphRecaptureCallbackData _pvt_val + cdef cyruntime.cudaGraphRecaptureCallbackData* _pvt_ptr + {{if 'cudaGraphRecaptureCallbackData.callbackFunc' in found_struct}} + cdef cudaGraphRecaptureCallback_t _callbackFunc + {{endif}} + {{if 'cudaGraphRecaptureCallbackData.userData' in found_struct}} + cdef _HelperInputVoidPtr _cyuserData + {{endif}} +{{endif}} {{if True}} cdef class cudaEglPlaneDesc_st: @@ -4542,7 +4597,7 @@ cdef class cudaEglPlaneDesc_st: {{endif}} {{if True}} -cdef class anon_union11: +cdef class anon_union12: """ Attributes ---------- @@ -4578,7 +4633,7 @@ cdef class cudaEglFrame_st: Attributes ---------- {{if True}} - frame : anon_union11 + frame : anon_union12 {{endif}} {{if True}} @@ -4606,7 +4661,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_union12 _frame {{endif}} {{endif}} {{if 'CUuuid' in found_types}} @@ -4732,7 +4787,7 @@ cdef class cudaDevSmResourceGroupParams(cudaDevSmResourceGroupParams_st): {{endif}} {{if 'cudaDevSmResourceGroupParams_st.reserved' in found_struct}} reserved : list[unsigned int] - Reserved for future use - ensure this is is zero initialized. + Reserved for future use - ensure this is zero initialized. {{endif}} Methods @@ -4835,9 +4890,9 @@ cdef class cudaGraphEdgeData(cudaGraphEdgeData_st): {{endif}} {{if 'cudaGraphEdgeData_st.type' in found_struct}} type : bytes - This should be populated with a value from - ::cudaGraphDependencyType. (It is typed as char due to compiler- - specific layout of bitfields.) See ::cudaGraphDependencyType. + This should be populated with a value from cudaGraphDependencyType. + (It is typed as char due to compiler-specific layout of bitfields.) + See cudaGraphDependencyType. {{endif}} {{if 'cudaGraphEdgeData_st.reserved' in found_struct}} reserved : bytes @@ -4922,8 +4977,8 @@ cdef class cudaLaunchMemSyncDomainMap(cudaLaunchMemSyncDomainMap_st): Memory Synchronization Domain map See cudaLaunchMemSyncDomain. By default, kernels are launched in domain 0. Kernel launched with cudaLaunchMemSyncDomainRemote will have a different domain ID. User - may also alter the domain ID with ::cudaLaunchMemSyncDomainMap for - a specific stream / graph node / kernel launch. See + may also alter the domain ID with cudaLaunchMemSyncDomainMap for a + specific stream / graph node / kernel launch. See cudaLaunchAttributeMemSyncDomainMap. Domain ID range is available through cudaDevAttrMemSyncDomainCount. @@ -4982,7 +5037,7 @@ cdef class cudaAsyncNotificationInfo_t(cudaAsyncNotificationInfo): The type of notification being sent {{endif}} {{if 'cudaAsyncNotificationInfo.info' in found_struct}} - info : anon_union10 + info : anon_union11 Information about the notification. `typename` must be checked in order to interpret this field. {{endif}} @@ -4998,8 +5053,7 @@ cdef class cudaAsyncNotificationInfo_t(cudaAsyncNotificationInfo): cdef class cudaStreamAttrValue(cudaLaunchAttributeValue): """ - Launch attributes union; used as value field of - ::cudaLaunchAttribute + Launch attributes union; used as value field of cudaLaunchAttribute Attributes ---------- @@ -5019,7 +5073,7 @@ cdef class cudaStreamAttrValue(cudaLaunchAttributeValue): {{if 'cudaLaunchAttributeValue.syncPolicy' in found_struct}} syncPolicy : cudaSynchronizationPolicy Value of launch attribute cudaLaunchAttributeSynchronizationPolicy. - ::cudaSynchronizationPolicy for work queued up in this stream. + cudaSynchronizationPolicy for work queued up in this stream. {{endif}} {{if 'cudaLaunchAttributeValue.clusterDim' in found_struct}} clusterDim : anon_struct17 @@ -5059,7 +5113,7 @@ cdef class cudaStreamAttrValue(cudaLaunchAttributeValue): {{if 'cudaLaunchAttributeValue.memSyncDomainMap' in found_struct}} memSyncDomainMap : cudaLaunchMemSyncDomainMap Value of launch attribute cudaLaunchAttributeMemSyncDomainMap. See - ::cudaLaunchMemSyncDomainMap. + cudaLaunchMemSyncDomainMap. {{endif}} {{if 'cudaLaunchAttributeValue.memSyncDomain' in found_struct}} memSyncDomain : cudaLaunchMemSyncDomain @@ -5074,12 +5128,12 @@ cdef class cudaStreamAttrValue(cudaLaunchAttributeValue): with the following fields: - `x` - The X dimension of the preferred cluster, in blocks. Must be a divisor of the grid X dimension, and must be a multiple of the `x` field of - cudaLaunchAttributeValue::clusterDim. - `y` - The Y dimension of - the preferred cluster, in blocks. Must be a divisor of the grid Y - dimension, and must be a multiple of the `y` field of - cudaLaunchAttributeValue::clusterDim. - `z` - The Z dimension of - the preferred cluster, in blocks. Must be equal to the `z` field of - cudaLaunchAttributeValue::clusterDim. + ::cudaLaunchAttributeValue::clusterDim. - `y` - The Y dimension + of the preferred cluster, in blocks. Must be a divisor of the grid + Y dimension, and must be a multiple of the `y` field of + ::cudaLaunchAttributeValue::clusterDim. - `z` - The Z dimension + of the preferred cluster, in blocks. Must be equal to the `z` field + of ::cudaLaunchAttributeValue::clusterDim. {{endif}} {{if 'cudaLaunchAttributeValue.launchCompletionEvent' in found_struct}} launchCompletionEvent : anon_struct20 @@ -5130,8 +5184,7 @@ cdef class cudaStreamAttrValue(cudaLaunchAttributeValue): cdef class cudaKernelNodeAttrValue(cudaLaunchAttributeValue): """ - Launch attributes union; used as value field of - ::cudaLaunchAttribute + Launch attributes union; used as value field of cudaLaunchAttribute Attributes ---------- @@ -5151,7 +5204,7 @@ cdef class cudaKernelNodeAttrValue(cudaLaunchAttributeValue): {{if 'cudaLaunchAttributeValue.syncPolicy' in found_struct}} syncPolicy : cudaSynchronizationPolicy Value of launch attribute cudaLaunchAttributeSynchronizationPolicy. - ::cudaSynchronizationPolicy for work queued up in this stream. + cudaSynchronizationPolicy for work queued up in this stream. {{endif}} {{if 'cudaLaunchAttributeValue.clusterDim' in found_struct}} clusterDim : anon_struct17 @@ -5191,7 +5244,7 @@ cdef class cudaKernelNodeAttrValue(cudaLaunchAttributeValue): {{if 'cudaLaunchAttributeValue.memSyncDomainMap' in found_struct}} memSyncDomainMap : cudaLaunchMemSyncDomainMap Value of launch attribute cudaLaunchAttributeMemSyncDomainMap. See - ::cudaLaunchMemSyncDomainMap. + cudaLaunchMemSyncDomainMap. {{endif}} {{if 'cudaLaunchAttributeValue.memSyncDomain' in found_struct}} memSyncDomain : cudaLaunchMemSyncDomain @@ -5206,12 +5259,12 @@ cdef class cudaKernelNodeAttrValue(cudaLaunchAttributeValue): with the following fields: - `x` - The X dimension of the preferred cluster, in blocks. Must be a divisor of the grid X dimension, and must be a multiple of the `x` field of - cudaLaunchAttributeValue::clusterDim. - `y` - The Y dimension of - the preferred cluster, in blocks. Must be a divisor of the grid Y - dimension, and must be a multiple of the `y` field of - cudaLaunchAttributeValue::clusterDim. - `z` - The Z dimension of - the preferred cluster, in blocks. Must be equal to the `z` field of - cudaLaunchAttributeValue::clusterDim. + ::cudaLaunchAttributeValue::clusterDim. - `y` - The Y dimension + of the preferred cluster, in blocks. Must be a divisor of the grid + Y dimension, and must be a multiple of the `y` field of + ::cudaLaunchAttributeValue::clusterDim. - `z` - The Z dimension + of the preferred cluster, in blocks. Must be equal to the `z` field + of ::cudaLaunchAttributeValue::clusterDim. {{endif}} {{if 'cudaLaunchAttributeValue.launchCompletionEvent' in found_struct}} launchCompletionEvent : anon_struct20 @@ -5319,7 +5372,7 @@ cdef class cudaEglFrame(cudaEglFrame_st): Attributes ---------- {{if True}} - frame : anon_union11 + frame : anon_union12 {{endif}} {{if True}} diff --git a/cuda_bindings/cuda/bindings/runtime.pyx.in b/cuda_bindings/cuda/bindings/runtime.pyx.in index 55c2b62e1c3..a2cb9ed6b39 100644 --- a/cuda_bindings/cuda/bindings/runtime.pyx.in +++ b/cuda_bindings/cuda/bindings/runtime.pyx.in @@ -1,7 +1,8 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated with version 13.2.0, generator version 8797618. Do not modify it directly. +# This code was automatically generated with version 13.3.0. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=6fe2ed828d10a452e3b9a6c2b27e9f606eb6aec3dae2613d0a6eae475c7744a2 from typing import Any, Optional import cython import ctypes @@ -83,16 +84,16 @@ cudaStreamNonBlocking = cyruntime.cudaStreamNonBlocking #: Legacy stream handle #: -#: Stream handle that can be passed as a cudaStream_t to use an implicit -#: stream with legacy synchronization behavior. +#: Stream handle that can be passed as a :py:obj:`~.cudaStream_t` to use an +#: implicit stream with legacy synchronization behavior. #: #: See details of the \link_sync_behavior cudaStreamLegacy = cyruntime.cudaStreamLegacy #: Per-thread stream handle #: -#: Stream handle that can be passed as a cudaStream_t to use an implicit -#: stream with per-thread synchronization behavior. +#: Stream handle that can be passed as a :py:obj:`~.cudaStream_t` to use an +#: implicit stream with per-thread synchronization behavior. #: #: See details of the \link_sync_behavior cudaStreamPerThread = cyruntime.cudaStreamPerThread @@ -136,7 +137,8 @@ cudaDeviceScheduleYield = cyruntime.cudaDeviceScheduleYield #: Device flag - Use blocking synchronization cudaDeviceScheduleBlockingSync = cyruntime.cudaDeviceScheduleBlockingSync -#: Device flag - Use blocking synchronization [Deprecated] +#: Device flag - Use blocking synchronization +#: [Deprecated] cudaDeviceBlockingSync = cyruntime.cudaDeviceBlockingSync #: Device schedule flags mask @@ -443,14 +445,16 @@ class cudaError_t(_FastEnum): cudaErrorInvalidHostPointer = ( cyruntime.cudaError.cudaErrorInvalidHostPointer, 'This indicates that at least one host pointer passed to the API call is not\n' - 'a valid host pointer. [Deprecated]\n' + 'a valid host pointer.\n' + '[Deprecated]\n' ){{endif}} {{if 'cudaErrorInvalidDevicePointer' in found_values}} cudaErrorInvalidDevicePointer = ( cyruntime.cudaError.cudaErrorInvalidDevicePointer, 'This indicates that at least one device pointer passed to the API call is\n' - 'not a valid device pointer. [Deprecated]\n' + 'not a valid device pointer.\n' + '[Deprecated]\n' ){{endif}} {{if 'cudaErrorInvalidTexture' in found_values}} @@ -486,28 +490,32 @@ class cudaError_t(_FastEnum): cudaErrorAddressOfConstant = ( cyruntime.cudaError.cudaErrorAddressOfConstant, 'This indicated that the user has taken the address of a constant variable,\n' - 'which was forbidden up until the CUDA 3.1 release. [Deprecated]\n' + 'which was forbidden up until the CUDA 3.1 release.\n' + '[Deprecated]\n' ){{endif}} {{if 'cudaErrorTextureFetchFailed' in found_values}} cudaErrorTextureFetchFailed = ( cyruntime.cudaError.cudaErrorTextureFetchFailed, 'This indicated that a texture fetch was not able to be performed. This was\n' - 'previously used for device emulation of texture operations. [Deprecated]\n' + 'previously used for device emulation of texture operations.\n' + '[Deprecated]\n' ){{endif}} {{if 'cudaErrorTextureNotBound' in found_values}} cudaErrorTextureNotBound = ( cyruntime.cudaError.cudaErrorTextureNotBound, 'This indicated that a texture was not bound for access. This was previously\n' - 'used for device emulation of texture operations. [Deprecated]\n' + 'used for device emulation of texture operations.\n' + '[Deprecated]\n' ){{endif}} {{if 'cudaErrorSynchronizationError' in found_values}} cudaErrorSynchronizationError = ( cyruntime.cudaError.cudaErrorSynchronizationError, 'This indicated that a synchronization operation had failed. This was\n' - 'previously used for some device emulation functions. [Deprecated]\n' + 'previously used for some device emulation functions.\n' + '[Deprecated]\n' ){{endif}} {{if 'cudaErrorInvalidFilterSetting' in found_values}} @@ -527,21 +535,24 @@ class cudaError_t(_FastEnum): cudaErrorMixedDeviceExecution = ( cyruntime.cudaError.cudaErrorMixedDeviceExecution, - 'Mixing of device and device emulation code was not allowed. [Deprecated]\n' + 'Mixing of device and device emulation code was not allowed.\n' + '[Deprecated]\n' ){{endif}} {{if 'cudaErrorNotYetImplemented' in found_values}} cudaErrorNotYetImplemented = ( cyruntime.cudaError.cudaErrorNotYetImplemented, 'This indicates that the API call is not yet implemented. Production\n' - 'releases of CUDA will never return this error. [Deprecated]\n' + 'releases of CUDA will never return this error.\n' + '[Deprecated]\n' ){{endif}} {{if 'cudaErrorMemoryValueTooLarge' in found_values}} cudaErrorMemoryValueTooLarge = ( cyruntime.cudaError.cudaErrorMemoryValueTooLarge, 'This indicated that an emulated device pointer exceeded the 32-bit address\n' - 'range. [Deprecated]\n' + 'range.\n' + '[Deprecated]\n' ){{endif}} {{if 'cudaErrorStubLibrary' in found_values}} @@ -618,7 +629,7 @@ class cudaError_t(_FastEnum): 'Driver context was created using an older version of the API, because the\n' 'Runtime API call expects a primary driver context and the Driver context is\n' 'not primary, or because the Driver context has been destroyed. Please see\n' - ':py:obj:`~.Interactions`with the CUDA Driver API" for more information.\n' + ':py:obj:`~.Interactions with the CUDA Driver API` for more information.\n' ){{endif}} {{if 'cudaErrorMissingConfiguration' in found_values}} @@ -633,7 +644,8 @@ class cudaError_t(_FastEnum): cudaErrorPriorLaunchFailure = ( cyruntime.cudaError.cudaErrorPriorLaunchFailure, 'This indicated that a previous kernel launch failed. This was previously\n' - 'used for device emulation of kernel launches. [Deprecated]\n' + 'used for device emulation of kernel launches.\n' + '[Deprecated]\n' ){{endif}} {{if 'cudaErrorLaunchMaxDepthExceeded' in found_values}} @@ -1402,6 +1414,13 @@ class cudaError_t(_FastEnum): "associated with the stream has been destroyed, limiting the stream's\n" 'operational capabilities.\n' ){{endif}} + {{if 'cudaErrorGraphRecaptureFailure' in found_values}} + + cudaErrorGraphRecaptureFailure = ( + cyruntime.cudaError.cudaErrorGraphRecaptureFailure, + 'This error indicates that a graph recapture failed and had to be\n' + 'terminated.\n' + ){{endif}} {{if 'cudaErrorUnknown' in found_values}} cudaErrorUnknown = ( @@ -1411,6 +1430,37 @@ class cudaError_t(_FastEnum): {{if 'cudaErrorApiFailureBase' in found_values}} cudaErrorApiFailureBase = cyruntime.cudaError.cudaErrorApiFailureBase{{endif}} +{{endif}} +{{if 'cudaSharedMemoryMode' in found_types}} + +class cudaSharedMemoryMode(_FastEnum): + """ + Shared memory related attributes for use with + :py:obj:`~.cuLaunchKernelEx` + """ + {{if 'cudaSharedMemoryModeDefault' in found_values}} + + cudaSharedMemoryModeDefault = ( + cyruntime.cudaSharedMemoryMode.cudaSharedMemoryModeDefault, + 'The default to use for allowing non-portable shared memory size on launch -\n' + 'uses current function attributes for\n' + ':py:obj:`~.cudaFuncAttributeMaxDynamicSharedMemorySize`\n' + ){{endif}} + {{if 'cudaSharedMemoryModeRequirePortable' in found_values}} + + cudaSharedMemoryModeRequirePortable = ( + cyruntime.cudaSharedMemoryMode.cudaSharedMemoryModeRequirePortable, + 'Specifies that the shared memory size requested must be a portable size\n' + 'within :py:obj:`~.cudaDevAttrMaxSharedMemoryPerBlock`\n' + ){{endif}} + {{if 'cudaSharedMemoryModeAllowNonPortable' in found_values}} + + cudaSharedMemoryModeAllowNonPortable = ( + cyruntime.cudaSharedMemoryMode.cudaSharedMemoryModeAllowNonPortable, + 'Specifies that the shared memory size requested may be a non-portable size\n' + 'up to :py:obj:`~.cudaDevAttrMaxSharedMemoryPerBlockOptin`\n' + ){{endif}} + {{endif}} {{if 'cudaGraphDependencyType_enum' in found_types}} @@ -1549,37 +1599,6 @@ class cudaLaunchAttributePortableClusterMode(_FastEnum): 'Specifies that the cluster size requested may be a non-portable size\n' ){{endif}} -{{endif}} -{{if 'cudaSharedMemoryMode' in found_types}} - -class cudaSharedMemoryMode(_FastEnum): - """ - Shared memory related attributes for use with - :py:obj:`~.cuLaunchKernelEx` - """ - {{if 'cudaSharedMemoryModeDefault' in found_values}} - - cudaSharedMemoryModeDefault = ( - cyruntime.cudaSharedMemoryMode.cudaSharedMemoryModeDefault, - 'The default to use for allowing non-portable shared memory size on launch -\n' - 'uses current function attributes for\n' - ':py:obj:`~.cudaFuncAttributeMaxDynamicSharedMemorySize`\n' - ){{endif}} - {{if 'cudaSharedMemoryModeRequirePortable' in found_values}} - - cudaSharedMemoryModeRequirePortable = ( - cyruntime.cudaSharedMemoryMode.cudaSharedMemoryModeRequirePortable, - 'Specifies that the shared memory size requested must be a portable size\n' - 'within :py:obj:`~.cudaDevAttrMaxSharedMemoryPerBlock`\n' - ){{endif}} - {{if 'cudaSharedMemoryModeAllowNonPortable' in found_values}} - - cudaSharedMemoryModeAllowNonPortable = ( - cyruntime.cudaSharedMemoryMode.cudaSharedMemoryModeAllowNonPortable, - 'Specifies that the shared memory size requested may be a non-portable size\n' - 'up to :py:obj:`~.cudaDevAttrMaxSharedMemoryPerBlockOptin`\n' - ){{endif}} - {{endif}} {{if 'cudaLaunchAttributeID' in found_types}} @@ -1753,7 +1772,7 @@ class cudaLaunchAttributeID(_FastEnum): 'only be set to 0 or 1. Setting the field to 1 indicates that the\n' 'corresponding kernel node should be device-updatable. On success, a handle\n' 'will be returned via\n' - ':py:obj:`~.cudaLaunchAttributeValue`::deviceUpdatableKernelNode::devNode\n' + ':py:obj:`~.cudaLaunchAttributeValue.deviceUpdatableKernelNode.devNode`\n' 'which can be passed to the various device-side update functions to update\n' "the node's kernel parameters from within another kernel. For more\n" 'information on the types of device updates that can be made, as well as the\n' @@ -1858,7 +1877,9 @@ class cudaLogLevel(_FastEnum): {{if 'cudaDataType_t' in found_types}} class cudaDataType(_FastEnum): - """""" + """ + + """ {{if 'CUDA_R_32F' in found_values}} CUDA_R_32F = cyruntime.cudaDataType_t.CUDA_R_32F{{endif}} {{if 'CUDA_R_64F' in found_values}} @@ -1934,43 +1955,98 @@ class cudaDataType(_FastEnum): {{if 'cudaEmulationStrategy_t' in found_types}} class cudaEmulationStrategy(_FastEnum): - """""" + """ + Enum for specifying how to leverage floating-point emulation + algorithms + """ {{if 'CUDA_EMULATION_STRATEGY_DEFAULT' in found_values}} - CUDA_EMULATION_STRATEGY_DEFAULT = cyruntime.cudaEmulationStrategy_t.CUDA_EMULATION_STRATEGY_DEFAULT{{endif}} + + CUDA_EMULATION_STRATEGY_DEFAULT = ( + cyruntime.cudaEmulationStrategy_t.CUDA_EMULATION_STRATEGY_DEFAULT, + 'The default emulation strategy. For emulated computations, this is\n' + 'equivalent to CUDA_EMULATION_STRATEGY_PERFORMANT, unless a library\n' + 'dependent environment variable is set\n' + ){{endif}} {{if 'CUDA_EMULATION_STRATEGY_PERFORMANT' in found_values}} - CUDA_EMULATION_STRATEGY_PERFORMANT = cyruntime.cudaEmulationStrategy_t.CUDA_EMULATION_STRATEGY_PERFORMANT{{endif}} + + CUDA_EMULATION_STRATEGY_PERFORMANT = ( + cyruntime.cudaEmulationStrategy_t.CUDA_EMULATION_STRATEGY_PERFORMANT, + 'An emulation strategy which configures libraries to use emulation when it\n' + 'provides a performance benefit\n' + ){{endif}} {{if 'CUDA_EMULATION_STRATEGY_EAGER' in found_values}} - CUDA_EMULATION_STRATEGY_EAGER = cyruntime.cudaEmulationStrategy_t.CUDA_EMULATION_STRATEGY_EAGER{{endif}} + + CUDA_EMULATION_STRATEGY_EAGER = ( + cyruntime.cudaEmulationStrategy_t.CUDA_EMULATION_STRATEGY_EAGER, + 'An emulation strategy which configures libraries to use emulation whenever\n' + 'possible\n' + ){{endif}} {{endif}} {{if 'cudaEmulationMantissaControl_t' in found_types}} class cudaEmulationMantissaControl(_FastEnum): - """""" + """ + Enum to configure the mantissa related parameters for floating- + point emulation algorithms + """ {{if 'CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC' in found_values}} - CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC = cyruntime.cudaEmulationMantissaControl_t.CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC{{endif}} + + CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC = ( + cyruntime.cudaEmulationMantissaControl_t.CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC, + 'The number of retained mantissa bits are computed at runtime to ensure the\n' + 'same or better accuracy than the floating point representation being\n' + 'emulated\n' + ){{endif}} {{if 'CUDA_EMULATION_MANTISSA_CONTROL_FIXED' in found_values}} - CUDA_EMULATION_MANTISSA_CONTROL_FIXED = cyruntime.cudaEmulationMantissaControl_t.CUDA_EMULATION_MANTISSA_CONTROL_FIXED{{endif}} + + CUDA_EMULATION_MANTISSA_CONTROL_FIXED = ( + cyruntime.cudaEmulationMantissaControl_t.CUDA_EMULATION_MANTISSA_CONTROL_FIXED, + 'The number of retained mantissa bits are known at runtime\n' + ){{endif}} {{endif}} {{if 'cudaEmulationSpecialValuesSupport_t' in found_types}} class cudaEmulationSpecialValuesSupport(_FastEnum): - """""" + """ + Enum to configure how special floating-point values will be handled + by emulation algorithms + """ {{if 'CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NONE' in found_values}} - CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NONE = cyruntime.cudaEmulationSpecialValuesSupport_t.CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NONE{{endif}} + + CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NONE = ( + cyruntime.cudaEmulationSpecialValuesSupport_t.CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NONE, + 'There are no requirements for emulation algorithms to support special\n' + 'values\n' + ){{endif}} {{if 'CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_INFINITY' in found_values}} - CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_INFINITY = cyruntime.cudaEmulationSpecialValuesSupport_t.CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_INFINITY{{endif}} + + CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_INFINITY = ( + cyruntime.cudaEmulationSpecialValuesSupport_t.CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_INFINITY, + 'Require emulation algorithms to handle signed infinity inputs and outputs\n' + ){{endif}} {{if 'CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NAN' in found_values}} - CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NAN = cyruntime.cudaEmulationSpecialValuesSupport_t.CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NAN{{endif}} + + CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NAN = ( + cyruntime.cudaEmulationSpecialValuesSupport_t.CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NAN, + 'Require emulation algorithms to handle NaN inputs and outputs\n' + ){{endif}} {{if 'CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_DEFAULT' in found_values}} - CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_DEFAULT = cyruntime.cudaEmulationSpecialValuesSupport_t.CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_DEFAULT{{endif}} + + CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_DEFAULT = ( + cyruntime.cudaEmulationSpecialValuesSupport_t.CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_DEFAULT, + 'The default special value support mask which contains support for signed\n' + 'infinities and NaN values\n' + ){{endif}} {{endif}} {{if 'libraryPropertyType_t' in found_types}} class libraryPropertyType(_FastEnum): - """""" + """ + + """ {{if 'MAJOR_VERSION' in found_values}} MAJOR_VERSION = cyruntime.libraryPropertyType_t.MAJOR_VERSION{{endif}} {{if 'MINOR_VERSION' in found_values}} @@ -2995,6 +3071,90 @@ class cudaChannelFormatKind(_FastEnum): cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized1010102, '4 channel unsigned normalized (10-bit, 10-bit, 10-bit, 2-bit) format\n' ){{endif}} + {{if 'cudaChannelFormatKindUnsigned8Packed422' in found_values}} + + cudaChannelFormatKindUnsigned8Packed422 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned8Packed422, + '4 channel unsigned 8-bit packed format, with 4:2:2 sampling\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsigned8Packed444' in found_values}} + + cudaChannelFormatKindUnsigned8Packed444 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned8Packed444, + '4 channel unsigned 8-bit packed format, with 4:4:4 sampling\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsigned8SemiPlanar420' in found_values}} + + cudaChannelFormatKindUnsigned8SemiPlanar420 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned8SemiPlanar420, + '3 channel unsigned 8-bit semi-planar format, with 4:2:0 sampling\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsigned16SemiPlanar420' in found_values}} + + cudaChannelFormatKindUnsigned16SemiPlanar420 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned16SemiPlanar420, + '3 channel unsigned 16-bit semi-planar format, with 4:2:0 sampling\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsigned8SemiPlanar422' in found_values}} + + cudaChannelFormatKindUnsigned8SemiPlanar422 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned8SemiPlanar422, + '3 channel unsigned 8-bit semi-planar format, with 4:2:2 sampling\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsigned16SemiPlanar422' in found_values}} + + cudaChannelFormatKindUnsigned16SemiPlanar422 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned16SemiPlanar422, + '3 channel unsigned 16-bit semi-planar format, with 4:2:2 sampling\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsigned8SemiPlanar444' in found_values}} + + cudaChannelFormatKindUnsigned8SemiPlanar444 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned8SemiPlanar444, + '3 channel unsigned 8-bit semi-planar format, with 4:4:4 sampling\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsigned16SemiPlanar444' in found_values}} + + cudaChannelFormatKindUnsigned16SemiPlanar444 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned16SemiPlanar444, + '3 channel unsigned 16-bit semi-planar format, with 4:4:4 sampling\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsigned8Planar420' in found_values}} + + cudaChannelFormatKindUnsigned8Planar420 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned8Planar420, + '3 channel unsigned 8-bit planar format, with 4:2:0 sampling\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsigned16Planar420' in found_values}} + + cudaChannelFormatKindUnsigned16Planar420 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned16Planar420, + '3 channel unsigned 16-bit planar format, with 4:2:0 sampling\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsigned8Planar422' in found_values}} + + cudaChannelFormatKindUnsigned8Planar422 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned8Planar422, + '3 channel unsigned 8-bit planar format, with 4:2:2 sampling\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsigned16Planar422' in found_values}} + + cudaChannelFormatKindUnsigned16Planar422 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned16Planar422, + '3 channel unsigned 16-bit planar format, with 4:2:2 sampling\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsigned8Planar444' in found_values}} + + cudaChannelFormatKindUnsigned8Planar444 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned8Planar444, + '3 channel unsigned 8-bit planar format, with 4:4:4 sampling\n' + ){{endif}} + {{if 'cudaChannelFormatKindUnsigned16Planar444' in found_values}} + + cudaChannelFormatKindUnsigned16Planar444 = ( + cyruntime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned16Planar444, + '3 channel unsigned 16-bit planar format, with 4:4:4 sampling\n' + ){{endif}} {{endif}} {{if 'cudaMemoryType' in found_types}} @@ -3122,6 +3282,34 @@ class cudaStreamCaptureStatus(_FastEnum): 'terminated\n' ){{endif}} +{{endif}} +{{if 'cudaGraphRecaptureStatus' in found_types}} + +class cudaGraphRecaptureStatus(_FastEnum): + """ + Possible recapture statuses that can be returned to the user + callback + """ + {{if 'cudaGraphRecaptureEligibleForUpdate' in found_values}} + + cudaGraphRecaptureEligibleForUpdate = ( + cyruntime.cudaGraphRecaptureStatus.cudaGraphRecaptureEligibleForUpdate, + 'Node is eligible for update in an instantiated graph.\n' + ){{endif}} + {{if 'cudaGraphRecaptureIneligibleForUpdate' in found_values}} + + cudaGraphRecaptureIneligibleForUpdate = ( + cyruntime.cudaGraphRecaptureStatus.cudaGraphRecaptureIneligibleForUpdate, + 'Parameter changes in the node cannot be applied to an instantiated graph.\n' + ){{endif}} + {{if 'cudaGraphRecaptureError' in found_values}} + + cudaGraphRecaptureError = ( + cyruntime.cudaGraphRecaptureStatus.cudaGraphRecaptureError, + 'Error while attempting to recapture the node. The recapture will be ended\n' + 'regardless of the return value from the callback.\n' + ){{endif}} + {{endif}} {{if 'cudaStreamCaptureMode' in found_types}} @@ -4806,6 +4994,19 @@ class cudaDeviceAttr(_FastEnum): 'Link between the device and the host supports only some native atomic\n' 'operations\n' ){{endif}} + {{if 'cudaDevAttrAtomicReductionSupported' in found_values}} + + cudaDevAttrAtomicReductionSupported = ( + cyruntime.cudaDeviceAttr.cudaDevAttrAtomicReductionSupported, + 'Device supports atomic reduction operations in stream batch memory\n' + 'operations\n' + ){{endif}} + {{if 'cudaDevAttrCigStreamsSupported' in found_values}} + + cudaDevAttrCigStreamsSupported = ( + cyruntime.cudaDeviceAttr.cudaDevAttrCigStreamsSupported, + 'Device supports CIG streams\n' + ){{endif}} {{if 'cudaDevAttrMax' in found_values}} cudaDevAttrMax = cyruntime.cudaDeviceAttr.cudaDevAttrMax{{endif}} @@ -4885,14 +5086,15 @@ class cudaMemPoolAttr(_FastEnum): cudaMemPoolAttrAllocationType = ( cyruntime.cudaMemPoolAttr.cudaMemPoolAttrAllocationType, - '(value type = cudaMemAllocationType) The allocation type of the mempool\n' + '(value type = :py:obj:`~.cudaMemAllocationType`) The allocation type of the\n' + 'mempool\n' ){{endif}} {{if 'cudaMemPoolAttrExportHandleTypes' in found_values}} cudaMemPoolAttrExportHandleTypes = ( cyruntime.cudaMemPoolAttr.cudaMemPoolAttrExportHandleTypes, - '(value type = cudaMemAllocationHandleType) Available export handle types\n' - 'for the mempool. For imported pools this value is always\n' + '(value type = :py:obj:`~.cudaMemAllocationHandleType`) Available export\n' + 'handle types for the mempool. For imported pools this value is always\n' 'cudaMemHandleTypeNone as an imported pool cannot be re-exported\n' ){{endif}} {{if 'cudaMemPoolAttrLocationId' in found_values}} @@ -4907,10 +5109,10 @@ class cudaMemPoolAttr(_FastEnum): cudaMemPoolAttrLocationType = ( cyruntime.cudaMemPoolAttr.cudaMemPoolAttrLocationType, - '(value type = cudaMemLocationType) The location type for the mempool. For\n' - 'imported memory pools where the device is not directly visible to the\n' - 'importing process or pools imported via fabric handles across nodes this\n' - 'will be cudaMemLocationTypeInvisible\n' + '(value type = :py:obj:`~.cudaMemLocationType`) The location type for the\n' + 'mempool. For imported memory pools where the device is not directly visible\n' + 'to the importing process or pools imported via fabric handles across nodes\n' + 'this will be cudaMemLocationTypeInvisible\n' ){{endif}} {{if 'cudaMemPoolAttrMaxPoolSize' in found_values}} @@ -5066,7 +5268,8 @@ class cudaMemAllocationHandleType(_FastEnum): cudaMemHandleTypeFabric = ( cyruntime.cudaMemAllocationHandleType.cudaMemHandleTypeFabric, - 'Allows a fabric handle to be used for exporting. (cudaMemFabricHandle_t)\n' + 'Allows a fabric handle to be used for exporting.\n' + '(:py:obj:`~.cudaMemFabricHandle_t`)\n' ){{endif}} {{endif}} @@ -5787,13 +5990,13 @@ class cudaKernelFunctionType(_FastEnum): cudaKernelFunctionTypeKernel = ( cyruntime.cudaKernelFunctionType.cudaKernelFunctionTypeKernel, - 'Function handle is a cudaKernel_t\n' + 'Function handle is a :py:obj:`~.cudaKernel_t`\n' ){{endif}} {{if 'cudaKernelFunctionTypeFunction' in found_values}} cudaKernelFunctionTypeFunction = ( cyruntime.cudaKernelFunctionType.cudaKernelFunctionTypeFunction, - 'Function handle is a cudaFunction_t\n' + 'Function handle is a :py:obj:`~.cudaFunction_t`\n' ){{endif}} {{endif}} @@ -5947,6 +6150,12 @@ class cudaGraphNodeType(_FastEnum): ' call :py:obj:`~.cudaGraphSetConditional`\n' 'from device code.\n' ){{endif}} + {{if 'cudaGraphNodeTypeReserved16' in found_values}} + + cudaGraphNodeTypeReserved16 = ( + cyruntime.cudaGraphNodeType.cudaGraphNodeTypeReserved16, + 'Reserved.\n' + ){{endif}} {{if 'cudaGraphNodeTypeCount' in found_values}} cudaGraphNodeTypeCount = cyruntime.cudaGraphNodeType.cudaGraphNodeTypeCount{{endif}} @@ -6181,7 +6390,7 @@ class cudaGraphDebugDotFlags(_FastEnum): cudaGraphDebugDotFlagsEventNodeParams = ( cyruntime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsEventNodeParams, - 'Adds cudaEvent_t handle from record and wait nodes to output\n' + 'Adds :py:obj:`~.cudaEvent_t` handle from record and wait nodes to output\n' ){{endif}} {{if 'cudaGraphDebugDotFlagsExtSemasSignalNodeParams' in found_values}} @@ -6272,6 +6481,36 @@ class cudaDeviceNumaConfig(_FastEnum): 'The GPU is a NUMA node, cudaDevAttrNumaId contains its NUMA ID\n' ){{endif}} +{{endif}} +{{if 'cudaFabricOpStatusSource' in found_types}} + +class cudaFabricOpStatusSource(_FastEnum): + """ + Fabric operation status source + """ + {{if 'cudaFabricOpStatusSourceMbarrierV1' in found_values}} + + cudaFabricOpStatusSourceMbarrierV1 = ( + cyruntime.cudaFabricOpStatusSource.cudaFabricOpStatusSourceMbarrierV1, + '1B-aligned 1B-wide status from an mbarrier.layout::v1\n' + ){{endif}} + {{if 'cudaFabricOpStatusSourceMax' in found_values}} + cudaFabricOpStatusSourceMax = cyruntime.cudaFabricOpStatusSource.cudaFabricOpStatusSourceMax{{endif}} + +{{endif}} +{{if 'cudaFabricOpStatusInfo' in found_types}} + +class cudaFabricOpStatusInfo(_FastEnum): + """ + Fabric operation status info + """ + {{if 'cudaFabricOpStatusInfoSuccess' in found_values}} + cudaFabricOpStatusInfoSuccess = cyruntime.cudaFabricOpStatusInfo.cudaFabricOpStatusInfoSuccess{{endif}} + {{if 'cudaFabricOpStatusInfoLast' in found_values}} + cudaFabricOpStatusInfoLast = cyruntime.cudaFabricOpStatusInfo.cudaFabricOpStatusInfoLast{{endif}} + {{if 'cudaFabricOpStatusInfoMax' in found_values}} + cudaFabricOpStatusInfoMax = cyruntime.cudaFabricOpStatusInfo.cudaFabricOpStatusInfoMax{{endif}} + {{endif}} {{if 'cudaSurfaceBoundaryMode' in found_types}} @@ -6394,7 +6633,9 @@ class cudaTextureReadMode(_FastEnum): {{if 'cudaRoundMode' in found_types}} class cudaRoundMode(_FastEnum): - """""" + """ + + """ {{if 'cudaRoundNearest' in found_values}} cudaRoundNearest = cyruntime.cudaRoundMode.cudaRoundNearest{{endif}} {{if 'cudaRoundZero' in found_values}} @@ -6637,7 +6878,7 @@ class cudaStreamAttrID(_FastEnum): 'only be set to 0 or 1. Setting the field to 1 indicates that the\n' 'corresponding kernel node should be device-updatable. On success, a handle\n' 'will be returned via\n' - ':py:obj:`~.cudaLaunchAttributeValue`::deviceUpdatableKernelNode::devNode\n' + ':py:obj:`~.cudaLaunchAttributeValue.deviceUpdatableKernelNode.devNode`\n' 'which can be passed to the various device-side update functions to update\n' "the node's kernel parameters from within another kernel. For more\n" 'information on the types of device updates that can be made, as well as the\n' @@ -6885,7 +7126,7 @@ class cudaKernelNodeAttrID(_FastEnum): 'only be set to 0 or 1. Setting the field to 1 indicates that the\n' 'corresponding kernel node should be device-updatable. On success, a handle\n' 'will be returned via\n' - ':py:obj:`~.cudaLaunchAttributeValue`::deviceUpdatableKernelNode::devNode\n' + ':py:obj:`~.cudaLaunchAttributeValue.deviceUpdatableKernelNode.devNode`\n' 'which can be passed to the various device-side update functions to update\n' "the node's kernel parameters from within another kernel. For more\n" 'information on the types of device updates that can be made, as well as the\n' @@ -7669,6 +7910,35 @@ cdef class cudaStreamCallback_t: return self._pvt_ptr {{endif}} +{{if 'cudaGraphRecaptureCallback_t' in found_types}} + +cdef class cudaGraphRecaptureCallback_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 'cudaLogsCallback_t' in found_types}} cdef class cudaLogsCallback_t: @@ -8076,7 +8346,7 @@ cdef class cudaArraySparseProperties: return self._tileExtent @tileExtent.setter def tileExtent(self, tileExtent not None : anon_struct0): - string.memcpy(&self._pvt_ptr[0].tileExtent, tileExtent.getPtr(), sizeof(self._pvt_ptr[0].tileExtent)) + string.memcpy(&self._pvt_ptr[0].tileExtent, tileExtent.getPtr(), sizeof(self._pvt_ptr[0].tileExtent)) {{endif}} {{if 'cudaArraySparseProperties.miptailFirstLevel' in found_struct}} @property @@ -8201,7 +8471,7 @@ cdef class cudaArrayMemoryRequirements: cdef class cudaPitchedPtr: """ - CUDA Pitched memory pointer ::make_cudaPitchedPtr + CUDA Pitched memory pointer make_cudaPitchedPtr Attributes ---------- @@ -8306,7 +8576,7 @@ cdef class cudaPitchedPtr: cdef class cudaExtent: """ - CUDA extent ::make_cudaExtent + CUDA extent make_cudaExtent Attributes ---------- @@ -8393,7 +8663,7 @@ cdef class cudaExtent: cdef class cudaPos: """ - CUDA 3D position ::make_cudaPos + CUDA 3D position make_cudaPos Attributes ---------- @@ -8630,7 +8900,7 @@ cdef class cudaMemcpy3DParms: return self._srcPos @srcPos.setter def srcPos(self, srcPos not None : cudaPos): - string.memcpy(&self._pvt_ptr[0].srcPos, srcPos.getPtr(), sizeof(self._pvt_ptr[0].srcPos)) + string.memcpy(&self._pvt_ptr[0].srcPos, srcPos.getPtr(), sizeof(self._pvt_ptr[0].srcPos)) {{endif}} {{if 'cudaMemcpy3DParms.srcPtr' in found_struct}} @property @@ -8638,7 +8908,7 @@ cdef class cudaMemcpy3DParms: return self._srcPtr @srcPtr.setter def srcPtr(self, srcPtr not None : cudaPitchedPtr): - string.memcpy(&self._pvt_ptr[0].srcPtr, srcPtr.getPtr(), sizeof(self._pvt_ptr[0].srcPtr)) + string.memcpy(&self._pvt_ptr[0].srcPtr, srcPtr.getPtr(), sizeof(self._pvt_ptr[0].srcPtr)) {{endif}} {{if 'cudaMemcpy3DParms.dstArray' in found_struct}} @property @@ -8663,7 +8933,7 @@ cdef class cudaMemcpy3DParms: return self._dstPos @dstPos.setter def dstPos(self, dstPos not None : cudaPos): - string.memcpy(&self._pvt_ptr[0].dstPos, dstPos.getPtr(), sizeof(self._pvt_ptr[0].dstPos)) + string.memcpy(&self._pvt_ptr[0].dstPos, dstPos.getPtr(), sizeof(self._pvt_ptr[0].dstPos)) {{endif}} {{if 'cudaMemcpy3DParms.dstPtr' in found_struct}} @property @@ -8671,7 +8941,7 @@ cdef class cudaMemcpy3DParms: return self._dstPtr @dstPtr.setter def dstPtr(self, dstPtr not None : cudaPitchedPtr): - string.memcpy(&self._pvt_ptr[0].dstPtr, dstPtr.getPtr(), sizeof(self._pvt_ptr[0].dstPtr)) + string.memcpy(&self._pvt_ptr[0].dstPtr, dstPtr.getPtr(), sizeof(self._pvt_ptr[0].dstPtr)) {{endif}} {{if 'cudaMemcpy3DParms.extent' in found_struct}} @property @@ -8679,7 +8949,7 @@ cdef class cudaMemcpy3DParms: return self._extent @extent.setter def extent(self, extent not None : cudaExtent): - string.memcpy(&self._pvt_ptr[0].extent, extent.getPtr(), sizeof(self._pvt_ptr[0].extent)) + string.memcpy(&self._pvt_ptr[0].extent, extent.getPtr(), sizeof(self._pvt_ptr[0].extent)) {{endif}} {{if 'cudaMemcpy3DParms.kind' in found_struct}} @property @@ -8807,7 +9077,7 @@ cdef class cudaMemcpyNodeParams: return self._copyParams @copyParams.setter def copyParams(self, copyParams not None : cudaMemcpy3DParms): - string.memcpy(&self._pvt_ptr[0].copyParams, copyParams.getPtr(), sizeof(self._pvt_ptr[0].copyParams)) + string.memcpy(&self._pvt_ptr[0].copyParams, copyParams.getPtr(), sizeof(self._pvt_ptr[0].copyParams)) {{endif}} {{endif}} {{if 'cudaMemcpy3DPeerParms' in found_struct}} @@ -8975,7 +9245,7 @@ cdef class cudaMemcpy3DPeerParms: return self._srcPos @srcPos.setter def srcPos(self, srcPos not None : cudaPos): - string.memcpy(&self._pvt_ptr[0].srcPos, srcPos.getPtr(), sizeof(self._pvt_ptr[0].srcPos)) + string.memcpy(&self._pvt_ptr[0].srcPos, srcPos.getPtr(), sizeof(self._pvt_ptr[0].srcPos)) {{endif}} {{if 'cudaMemcpy3DPeerParms.srcPtr' in found_struct}} @property @@ -8983,7 +9253,7 @@ cdef class cudaMemcpy3DPeerParms: return self._srcPtr @srcPtr.setter def srcPtr(self, srcPtr not None : cudaPitchedPtr): - string.memcpy(&self._pvt_ptr[0].srcPtr, srcPtr.getPtr(), sizeof(self._pvt_ptr[0].srcPtr)) + string.memcpy(&self._pvt_ptr[0].srcPtr, srcPtr.getPtr(), sizeof(self._pvt_ptr[0].srcPtr)) {{endif}} {{if 'cudaMemcpy3DPeerParms.srcDevice' in found_struct}} @property @@ -9016,7 +9286,7 @@ cdef class cudaMemcpy3DPeerParms: return self._dstPos @dstPos.setter def dstPos(self, dstPos not None : cudaPos): - string.memcpy(&self._pvt_ptr[0].dstPos, dstPos.getPtr(), sizeof(self._pvt_ptr[0].dstPos)) + string.memcpy(&self._pvt_ptr[0].dstPos, dstPos.getPtr(), sizeof(self._pvt_ptr[0].dstPos)) {{endif}} {{if 'cudaMemcpy3DPeerParms.dstPtr' in found_struct}} @property @@ -9024,7 +9294,7 @@ cdef class cudaMemcpy3DPeerParms: return self._dstPtr @dstPtr.setter def dstPtr(self, dstPtr not None : cudaPitchedPtr): - string.memcpy(&self._pvt_ptr[0].dstPtr, dstPtr.getPtr(), sizeof(self._pvt_ptr[0].dstPtr)) + string.memcpy(&self._pvt_ptr[0].dstPtr, dstPtr.getPtr(), sizeof(self._pvt_ptr[0].dstPtr)) {{endif}} {{if 'cudaMemcpy3DPeerParms.dstDevice' in found_struct}} @property @@ -9040,7 +9310,7 @@ cdef class cudaMemcpy3DPeerParms: return self._extent @extent.setter def extent(self, extent not None : cudaExtent): - string.memcpy(&self._pvt_ptr[0].extent, extent.getPtr(), sizeof(self._pvt_ptr[0].extent)) + string.memcpy(&self._pvt_ptr[0].extent, extent.getPtr(), sizeof(self._pvt_ptr[0].extent)) {{endif}} {{endif}} {{if 'cudaMemsetParams' in found_struct}} @@ -9861,7 +10131,7 @@ cdef class anon_struct3: return self._desc @desc.setter def desc(self, desc not None : cudaChannelFormatDesc): - string.memcpy(&self._pvt_ptr[0].res.linear.desc, desc.getPtr(), sizeof(self._pvt_ptr[0].res.linear.desc)) + string.memcpy(&self._pvt_ptr[0].res.linear.desc, desc.getPtr(), sizeof(self._pvt_ptr[0].res.linear.desc)) {{endif}} {{if 'cudaResourceDesc.res.linear.sizeInBytes' in found_struct}} @property @@ -9967,7 +10237,7 @@ cdef class anon_struct4: return self._desc @desc.setter def desc(self, desc not None : cudaChannelFormatDesc): - string.memcpy(&self._pvt_ptr[0].res.pitch2D.desc, desc.getPtr(), sizeof(self._pvt_ptr[0].res.pitch2D.desc)) + string.memcpy(&self._pvt_ptr[0].res.pitch2D.desc, desc.getPtr(), sizeof(self._pvt_ptr[0].res.pitch2D.desc)) {{endif}} {{if 'cudaResourceDesc.res.pitch2D.width' in found_struct}} @property @@ -10138,7 +10408,7 @@ cdef class anon_union0: return self._array @array.setter def array(self, array not None : anon_struct1): - string.memcpy(&self._pvt_ptr[0].res.array, array.getPtr(), sizeof(self._pvt_ptr[0].res.array)) + string.memcpy(&self._pvt_ptr[0].res.array, array.getPtr(), sizeof(self._pvt_ptr[0].res.array)) {{endif}} {{if 'cudaResourceDesc.res.mipmap' in found_struct}} @property @@ -10146,7 +10416,7 @@ cdef class anon_union0: return self._mipmap @mipmap.setter def mipmap(self, mipmap not None : anon_struct2): - string.memcpy(&self._pvt_ptr[0].res.mipmap, mipmap.getPtr(), sizeof(self._pvt_ptr[0].res.mipmap)) + string.memcpy(&self._pvt_ptr[0].res.mipmap, mipmap.getPtr(), sizeof(self._pvt_ptr[0].res.mipmap)) {{endif}} {{if 'cudaResourceDesc.res.linear' in found_struct}} @property @@ -10154,7 +10424,7 @@ cdef class anon_union0: return self._linear @linear.setter def linear(self, linear not None : anon_struct3): - string.memcpy(&self._pvt_ptr[0].res.linear, linear.getPtr(), sizeof(self._pvt_ptr[0].res.linear)) + string.memcpy(&self._pvt_ptr[0].res.linear, linear.getPtr(), sizeof(self._pvt_ptr[0].res.linear)) {{endif}} {{if 'cudaResourceDesc.res.pitch2D' in found_struct}} @property @@ -10162,7 +10432,7 @@ cdef class anon_union0: return self._pitch2D @pitch2D.setter 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)) + 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 @@ -10170,7 +10440,7 @@ cdef class anon_union0: 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)) + string.memcpy(&self._pvt_ptr[0].res.reserved, reserved.getPtr(), sizeof(self._pvt_ptr[0].res.reserved)) {{endif}} {{endif}} {{if 'cudaResourceDesc' in found_struct}} @@ -10253,7 +10523,7 @@ cdef class cudaResourceDesc: return self._res @res.setter def res(self, res not None : anon_union0): - string.memcpy(&self._pvt_ptr[0].res, res.getPtr(), sizeof(self._pvt_ptr[0].res)) + string.memcpy(&self._pvt_ptr[0].res, res.getPtr(), sizeof(self._pvt_ptr[0].res)) {{endif}} {{if 'cudaResourceDesc.flags' in found_struct}} @property @@ -10702,8 +10972,14 @@ cdef class cudaFuncAttributes: higher cluster sizes that’s not guaranteed to be portable. See cudaFuncSetAttribute {{endif}} - {{if 'cudaFuncAttributes.reserved0' in found_struct}} - reserved0 : int + {{if 'cudaFuncAttributes.deviceNodeUpdateStatus' in found_struct}} + deviceNodeUpdateStatus : int + Whether the function can be updated on device. 1 means device node + update is supported, 0 is unsupported or driver is too old to check + the value. + {{endif}} + {{if 'cudaFuncAttributes.reserved1' in found_struct}} + reserved1 : int {{endif}} {{if 'cudaFuncAttributes.reserved' in found_struct}} @@ -10826,11 +11102,17 @@ cdef class cudaFuncAttributes: except ValueError: str_list += ['nonPortableClusterSizeAllowed : '] {{endif}} - {{if 'cudaFuncAttributes.reserved0' in found_struct}} + {{if 'cudaFuncAttributes.deviceNodeUpdateStatus' in found_struct}} try: - str_list += ['reserved0 : ' + str(self.reserved0)] + str_list += ['deviceNodeUpdateStatus : ' + str(self.deviceNodeUpdateStatus)] except ValueError: - str_list += ['reserved0 : '] + str_list += ['deviceNodeUpdateStatus : '] + {{endif}} + {{if 'cudaFuncAttributes.reserved1' in found_struct}} + try: + str_list += ['reserved1 : ' + str(self.reserved1)] + except ValueError: + str_list += ['reserved1 : '] {{endif}} {{if 'cudaFuncAttributes.reserved' in found_struct}} try: @@ -10969,13 +11251,21 @@ cdef class cudaFuncAttributes: def nonPortableClusterSizeAllowed(self, int nonPortableClusterSizeAllowed): self._pvt_ptr[0].nonPortableClusterSizeAllowed = nonPortableClusterSizeAllowed {{endif}} - {{if 'cudaFuncAttributes.reserved0' in found_struct}} + {{if 'cudaFuncAttributes.deviceNodeUpdateStatus' in found_struct}} @property - def reserved0(self): - return self._pvt_ptr[0].reserved0 - @reserved0.setter - def reserved0(self, int reserved0): - self._pvt_ptr[0].reserved0 = reserved0 + def deviceNodeUpdateStatus(self): + return self._pvt_ptr[0].deviceNodeUpdateStatus + @deviceNodeUpdateStatus.setter + def deviceNodeUpdateStatus(self, int deviceNodeUpdateStatus): + self._pvt_ptr[0].deviceNodeUpdateStatus = deviceNodeUpdateStatus + {{endif}} + {{if 'cudaFuncAttributes.reserved1' in found_struct}} + @property + def reserved1(self): + return self._pvt_ptr[0].reserved1 + @reserved1.setter + def reserved1(self, int reserved1): + self._pvt_ptr[0].reserved1 = reserved1 {{endif}} {{if 'cudaFuncAttributes.reserved' in found_struct}} @property @@ -11003,7 +11293,9 @@ cdef class cudaMemLocation: {{endif}} {{if 'cudaMemLocation.id' in found_struct}} id : int - identifier for a given this location's ::CUmemLocationType. + Identifier for cudaMemLocationType::cudaMemLocationTypeDevice, + cudaMemLocationType::cudaMemLocationTypeHost, or + cudaMemLocationType::cudaMemLocationTypeHostNuma. {{endif}} Methods @@ -11013,13 +11305,15 @@ cdef class cudaMemLocation: """ def __cinit__(self, void_ptr _ptr = 0): if _ptr == 0: - self._pvt_ptr = &self._pvt_val + self._val_ptr = calloc(1, sizeof(cyruntime.cudaMemLocation)) + self._pvt_ptr = self._val_ptr else: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass def __dealloc__(self): - pass + if self._val_ptr is not NULL: + free(self._val_ptr) def getPtr(self): return self._pvt_ptr def __repr__(self): @@ -11117,7 +11411,7 @@ cdef class cudaMemAccessDesc: return self._location @location.setter def location(self, location not None : cudaMemLocation): - string.memcpy(&self._pvt_ptr[0].location, location.getPtr(), sizeof(self._pvt_ptr[0].location)) + string.memcpy(&self._pvt_ptr[0].location, location.getPtr(), sizeof(self._pvt_ptr[0].location)) {{endif}} {{if 'cudaMemAccessDesc.flags' in found_struct}} @property @@ -11260,7 +11554,7 @@ cdef class cudaMemPoolProps: return self._location @location.setter def location(self, location not None : cudaMemLocation): - string.memcpy(&self._pvt_ptr[0].location, location.getPtr(), sizeof(self._pvt_ptr[0].location)) + string.memcpy(&self._pvt_ptr[0].location, location.getPtr(), sizeof(self._pvt_ptr[0].location)) {{endif}} {{if 'cudaMemPoolProps.win32SecurityAttributes' in found_struct}} @property @@ -11405,6 +11699,7 @@ cdef class cudaMemAllocNodeParams: {{if 'cudaMemAllocNodeParams.accessDescs' in found_struct}} if self._accessDescs is not NULL: free(self._accessDescs) + self._pvt_ptr[0].accessDescs = NULL {{endif}} def getPtr(self): return self._pvt_ptr @@ -11450,7 +11745,7 @@ cdef class cudaMemAllocNodeParams: return self._poolProps @poolProps.setter def poolProps(self, poolProps not None : cudaMemPoolProps): - string.memcpy(&self._pvt_ptr[0].poolProps, poolProps.getPtr(), sizeof(self._pvt_ptr[0].poolProps)) + string.memcpy(&self._pvt_ptr[0].poolProps, poolProps.getPtr(), sizeof(self._pvt_ptr[0].poolProps)) {{endif}} {{if 'cudaMemAllocNodeParams.accessDescs' in found_struct}} @property @@ -11461,6 +11756,7 @@ cdef class cudaMemAllocNodeParams: def accessDescs(self, val): if len(val) == 0: free(self._accessDescs) + self._accessDescs = NULL self._accessDescs_length = 0 self._pvt_ptr[0].accessDescs = NULL else: @@ -11554,6 +11850,7 @@ cdef class cudaMemAllocNodeParamsV2: {{if 'cudaMemAllocNodeParamsV2.accessDescs' in found_struct}} if self._accessDescs is not NULL: free(self._accessDescs) + self._pvt_ptr[0].accessDescs = NULL {{endif}} def getPtr(self): return self._pvt_ptr @@ -11599,7 +11896,7 @@ cdef class cudaMemAllocNodeParamsV2: return self._poolProps @poolProps.setter def poolProps(self, poolProps not None : cudaMemPoolProps): - string.memcpy(&self._pvt_ptr[0].poolProps, poolProps.getPtr(), sizeof(self._pvt_ptr[0].poolProps)) + string.memcpy(&self._pvt_ptr[0].poolProps, poolProps.getPtr(), sizeof(self._pvt_ptr[0].poolProps)) {{endif}} {{if 'cudaMemAllocNodeParamsV2.accessDescs' in found_struct}} @property @@ -11610,6 +11907,7 @@ cdef class cudaMemAllocNodeParamsV2: def accessDescs(self, val): if len(val) == 0: free(self._accessDescs) + self._accessDescs = NULL self._accessDescs_length = 0 self._pvt_ptr[0].accessDescs = NULL else: @@ -11797,7 +12095,7 @@ cdef class cudaMemcpyAttributes: return self._srcLocHint @srcLocHint.setter def srcLocHint(self, srcLocHint not None : cudaMemLocation): - string.memcpy(&self._pvt_ptr[0].srcLocHint, srcLocHint.getPtr(), sizeof(self._pvt_ptr[0].srcLocHint)) + string.memcpy(&self._pvt_ptr[0].srcLocHint, srcLocHint.getPtr(), sizeof(self._pvt_ptr[0].srcLocHint)) {{endif}} {{if 'cudaMemcpyAttributes.dstLocHint' in found_struct}} @property @@ -11805,7 +12103,7 @@ cdef class cudaMemcpyAttributes: return self._dstLocHint @dstLocHint.setter def dstLocHint(self, dstLocHint not None : cudaMemLocation): - string.memcpy(&self._pvt_ptr[0].dstLocHint, dstLocHint.getPtr(), sizeof(self._pvt_ptr[0].dstLocHint)) + string.memcpy(&self._pvt_ptr[0].dstLocHint, dstLocHint.getPtr(), sizeof(self._pvt_ptr[0].dstLocHint)) {{endif}} {{if 'cudaMemcpyAttributes.flags' in found_struct}} @property @@ -12003,7 +12301,7 @@ cdef class anon_struct6: return self._locHint @locHint.setter def locHint(self, locHint not None : cudaMemLocation): - string.memcpy(&self._pvt_ptr[0].op.ptr.locHint, locHint.getPtr(), sizeof(self._pvt_ptr[0].op.ptr.locHint)) + string.memcpy(&self._pvt_ptr[0].op.ptr.locHint, locHint.getPtr(), sizeof(self._pvt_ptr[0].op.ptr.locHint)) {{endif}} {{endif}} {{if 'cudaMemcpy3DOperand.op.array' in found_struct}} @@ -12082,12 +12380,12 @@ cdef class anon_struct7: return self._offset @offset.setter def offset(self, offset not None : cudaOffset3D): - string.memcpy(&self._pvt_ptr[0].op.array.offset, offset.getPtr(), sizeof(self._pvt_ptr[0].op.array.offset)) + string.memcpy(&self._pvt_ptr[0].op.array.offset, offset.getPtr(), sizeof(self._pvt_ptr[0].op.array.offset)) {{endif}} {{endif}} {{if 'cudaMemcpy3DOperand.op' in found_struct}} -cdef class anon_union1: +cdef class anon_union2: """ Attributes ---------- @@ -12144,7 +12442,7 @@ cdef class anon_union1: return self._ptr @ptr.setter 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)) + 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 @@ -12152,7 +12450,7 @@ cdef class anon_union1: return self._array @array.setter 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)) + string.memcpy(&self._pvt_ptr[0].op.array, array.getPtr(), sizeof(self._pvt_ptr[0].op.array)) {{endif}} {{endif}} {{if 'cudaMemcpy3DOperand' in found_struct}} @@ -12168,7 +12466,7 @@ cdef class cudaMemcpy3DOperand: {{endif}} {{if 'cudaMemcpy3DOperand.op' in found_struct}} - op : anon_union1 + op : anon_union2 {{endif}} @@ -12186,7 +12484,7 @@ cdef class cudaMemcpy3DOperand: def __init__(self, void_ptr _ptr = 0): pass {{if 'cudaMemcpy3DOperand.op' in found_struct}} - self._op = anon_union1(_ptr=self._pvt_ptr) + self._op = anon_union2(_ptr=self._pvt_ptr) {{endif}} def __dealloc__(self): if self._val_ptr is not NULL: @@ -12224,8 +12522,8 @@ cdef class cudaMemcpy3DOperand: def op(self): return self._op @op.setter - def op(self, op not None : anon_union1): - string.memcpy(&self._pvt_ptr[0].op, op.getPtr(), sizeof(self._pvt_ptr[0].op)) + def op(self, op not None : anon_union2): + string.memcpy(&self._pvt_ptr[0].op, op.getPtr(), sizeof(self._pvt_ptr[0].op)) {{endif}} {{endif}} {{if 'cudaMemcpy3DBatchOp' in found_struct}} @@ -12323,7 +12621,7 @@ cdef class cudaMemcpy3DBatchOp: return self._src @src.setter def src(self, src not None : cudaMemcpy3DOperand): - string.memcpy(&self._pvt_ptr[0].src, src.getPtr(), sizeof(self._pvt_ptr[0].src)) + string.memcpy(&self._pvt_ptr[0].src, src.getPtr(), sizeof(self._pvt_ptr[0].src)) {{endif}} {{if 'cudaMemcpy3DBatchOp.dst' in found_struct}} @property @@ -12331,7 +12629,7 @@ cdef class cudaMemcpy3DBatchOp: return self._dst @dst.setter def dst(self, dst not None : cudaMemcpy3DOperand): - string.memcpy(&self._pvt_ptr[0].dst, dst.getPtr(), sizeof(self._pvt_ptr[0].dst)) + string.memcpy(&self._pvt_ptr[0].dst, dst.getPtr(), sizeof(self._pvt_ptr[0].dst)) {{endif}} {{if 'cudaMemcpy3DBatchOp.extent' in found_struct}} @property @@ -12339,7 +12637,7 @@ cdef class cudaMemcpy3DBatchOp: return self._extent @extent.setter def extent(self, extent not None : cudaExtent): - string.memcpy(&self._pvt_ptr[0].extent, extent.getPtr(), sizeof(self._pvt_ptr[0].extent)) + string.memcpy(&self._pvt_ptr[0].extent, extent.getPtr(), sizeof(self._pvt_ptr[0].extent)) {{endif}} {{if 'cudaMemcpy3DBatchOp.srcAccessOrder' in found_struct}} @property @@ -13405,7 +13703,7 @@ cdef class cudaDeviceProp: return self._uuid @uuid.setter def uuid(self, uuid not None : cudaUUID_t): - string.memcpy(&self._pvt_ptr[0].uuid, uuid.getPtr(), sizeof(self._pvt_ptr[0].uuid)) + string.memcpy(&self._pvt_ptr[0].uuid, uuid.getPtr(), sizeof(self._pvt_ptr[0].uuid)) {{endif}} {{if 'cudaDeviceProp.luid' in found_struct}} @property @@ -14396,7 +14694,7 @@ cdef class anon_struct8: {{endif}} {{if 'cudaExternalMemoryHandleDesc.handle' in found_struct}} -cdef class anon_union2: +cdef class anon_union3: """ Attributes ---------- @@ -14468,7 +14766,7 @@ cdef class anon_union2: 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)) + 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 @@ -14493,7 +14791,7 @@ cdef class cudaExternalMemoryHandleDesc: Type of the handle {{endif}} {{if 'cudaExternalMemoryHandleDesc.handle' in found_struct}} - handle : anon_union2 + handle : anon_union3 {{endif}} {{if 'cudaExternalMemoryHandleDesc.size' in found_struct}} @@ -14523,7 +14821,7 @@ cdef class cudaExternalMemoryHandleDesc: def __init__(self, void_ptr _ptr = 0): pass {{if 'cudaExternalMemoryHandleDesc.handle' in found_struct}} - self._handle = anon_union2(_ptr=self._pvt_ptr) + self._handle = anon_union3(_ptr=self._pvt_ptr) {{endif}} def __dealloc__(self): if self._val_ptr is not NULL: @@ -14579,8 +14877,8 @@ cdef class cudaExternalMemoryHandleDesc: def handle(self): return self._handle @handle.setter - def handle(self, handle not None : anon_union2): - string.memcpy(&self._pvt_ptr[0].handle, handle.getPtr(), sizeof(self._pvt_ptr[0].handle)) + def handle(self, handle not None : anon_union3): + string.memcpy(&self._pvt_ptr[0].handle, handle.getPtr(), sizeof(self._pvt_ptr[0].handle)) {{endif}} {{if 'cudaExternalMemoryHandleDesc.size' in found_struct}} @property @@ -14824,7 +15122,7 @@ cdef class cudaExternalMemoryMipmappedArrayDesc: return self._formatDesc @formatDesc.setter def formatDesc(self, formatDesc not None : cudaChannelFormatDesc): - string.memcpy(&self._pvt_ptr[0].formatDesc, formatDesc.getPtr(), sizeof(self._pvt_ptr[0].formatDesc)) + string.memcpy(&self._pvt_ptr[0].formatDesc, formatDesc.getPtr(), sizeof(self._pvt_ptr[0].formatDesc)) {{endif}} {{if 'cudaExternalMemoryMipmappedArrayDesc.extent' in found_struct}} @property @@ -14832,7 +15130,7 @@ cdef class cudaExternalMemoryMipmappedArrayDesc: return self._extent @extent.setter def extent(self, extent not None : cudaExtent): - string.memcpy(&self._pvt_ptr[0].extent, extent.getPtr(), sizeof(self._pvt_ptr[0].extent)) + string.memcpy(&self._pvt_ptr[0].extent, extent.getPtr(), sizeof(self._pvt_ptr[0].extent)) {{endif}} {{if 'cudaExternalMemoryMipmappedArrayDesc.flags' in found_struct}} @property @@ -14927,7 +15225,7 @@ cdef class anon_struct9: {{endif}} {{if 'cudaExternalSemaphoreHandleDesc.handle' in found_struct}} -cdef class anon_union3: +cdef class anon_union4: """ Attributes ---------- @@ -14999,7 +15297,7 @@ cdef class anon_union3: return self._win32 @win32.setter 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)) + 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 @@ -15024,7 +15322,7 @@ cdef class cudaExternalSemaphoreHandleDesc: Type of the handle {{endif}} {{if 'cudaExternalSemaphoreHandleDesc.handle' in found_struct}} - handle : anon_union3 + handle : anon_union4 {{endif}} {{if 'cudaExternalSemaphoreHandleDesc.flags' in found_struct}} @@ -15050,7 +15348,7 @@ cdef class cudaExternalSemaphoreHandleDesc: def __init__(self, void_ptr _ptr = 0): pass {{if 'cudaExternalSemaphoreHandleDesc.handle' in found_struct}} - self._handle = anon_union3(_ptr=self._pvt_ptr) + self._handle = anon_union4(_ptr=self._pvt_ptr) {{endif}} def __dealloc__(self): if self._val_ptr is not NULL: @@ -15100,8 +15398,8 @@ cdef class cudaExternalSemaphoreHandleDesc: def handle(self): return self._handle @handle.setter - def handle(self, handle not None : anon_union3): - string.memcpy(&self._pvt_ptr[0].handle, handle.getPtr(), sizeof(self._pvt_ptr[0].handle)) + def handle(self, handle not None : anon_union4): + string.memcpy(&self._pvt_ptr[0].handle, handle.getPtr(), sizeof(self._pvt_ptr[0].handle)) {{endif}} {{if 'cudaExternalSemaphoreHandleDesc.flags' in found_struct}} @property @@ -15168,7 +15466,7 @@ cdef class anon_struct10: {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync' in found_struct}} -cdef class anon_union4: +cdef class anon_union5: """ Attributes ---------- @@ -15288,7 +15586,7 @@ cdef class anon_struct12: {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync' in found_struct}} - nvSciSync : anon_union4 + nvSciSync : anon_union5 {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.keyedMutex' in found_struct}} @@ -15314,7 +15612,7 @@ cdef class anon_struct12: self._fence = anon_struct10(_ptr=self._pvt_ptr) {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync' in found_struct}} - self._nvSciSync = anon_union4(_ptr=self._pvt_ptr) + self._nvSciSync = anon_union5(_ptr=self._pvt_ptr) {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.keyedMutex' in found_struct}} self._keyedMutex = anon_struct11(_ptr=self._pvt_ptr) @@ -15359,15 +15657,15 @@ cdef class anon_struct12: return self._fence @fence.setter 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)) + 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_union4): - 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 'cudaExternalSemaphoreSignalParams.params.keyedMutex' in found_struct}} @property @@ -15375,7 +15673,7 @@ cdef class anon_struct12: return self._keyedMutex @keyedMutex.setter 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)) + 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 @@ -15463,7 +15761,7 @@ cdef class cudaExternalSemaphoreSignalParams: return self._params @params.setter def params(self, params not None : anon_struct12): - string.memcpy(&self._pvt_ptr[0].params, params.getPtr(), sizeof(self._pvt_ptr[0].params)) + string.memcpy(&self._pvt_ptr[0].params, params.getPtr(), sizeof(self._pvt_ptr[0].params)) {{endif}} {{if 'cudaExternalSemaphoreSignalParams.flags' in found_struct}} @property @@ -15530,7 +15828,7 @@ cdef class anon_struct13: {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync' in found_struct}} -cdef class anon_union5: +cdef class anon_union6: """ Attributes ---------- @@ -15668,7 +15966,7 @@ cdef class anon_struct15: {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync' in found_struct}} - nvSciSync : anon_union5 + nvSciSync : anon_union6 {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.keyedMutex' in found_struct}} @@ -15694,7 +15992,7 @@ cdef class anon_struct15: self._fence = anon_struct13(_ptr=self._pvt_ptr) {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync' in found_struct}} - self._nvSciSync = anon_union5(_ptr=self._pvt_ptr) + self._nvSciSync = anon_union6(_ptr=self._pvt_ptr) {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.keyedMutex' in found_struct}} self._keyedMutex = anon_struct14(_ptr=self._pvt_ptr) @@ -15739,15 +16037,15 @@ cdef class anon_struct15: return self._fence @fence.setter 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)) + 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_union5): - string.memcpy(&self._pvt_ptr[0].params.nvSciSync, nvSciSync.getPtr(), sizeof(self._pvt_ptr[0].params.nvSciSync)) + 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)) {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.keyedMutex' in found_struct}} @property @@ -15755,7 +16053,7 @@ cdef class anon_struct15: return self._keyedMutex @keyedMutex.setter 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)) + 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 @@ -15843,7 +16141,7 @@ cdef class cudaExternalSemaphoreWaitParams: return self._params @params.setter def params(self, params not None : anon_struct15): - string.memcpy(&self._pvt_ptr[0].params, params.getPtr(), sizeof(self._pvt_ptr[0].params)) + string.memcpy(&self._pvt_ptr[0].params, params.getPtr(), sizeof(self._pvt_ptr[0].params)) {{endif}} {{if 'cudaExternalSemaphoreWaitParams.flags' in found_struct}} @property @@ -16140,7 +16438,7 @@ cdef class cudaDevSmResourceGroupParams_st: {{endif}} {{if 'cudaDevSmResourceGroupParams_st.reserved' in found_struct}} reserved : list[unsigned int] - Reserved for future use - ensure this is is zero initialized. + Reserved for future use - ensure this is zero initialized. {{endif}} Methods @@ -16316,6 +16614,7 @@ cdef class cudaDevResource_st: {{if 'cudaDevResource_st.nextResource' in found_struct}} if self._nextResource is not NULL: free(self._nextResource) + self._pvt_ptr[0].nextResource = NULL {{endif}} def getPtr(self): return self._pvt_ptr @@ -16392,7 +16691,7 @@ cdef class cudaDevResource_st: return self._sm @sm.setter def sm(self, sm not None : cudaDevSmResource): - string.memcpy(&self._pvt_ptr[0].sm, sm.getPtr(), sizeof(self._pvt_ptr[0].sm)) + string.memcpy(&self._pvt_ptr[0].sm, sm.getPtr(), sizeof(self._pvt_ptr[0].sm)) {{endif}} {{if 'cudaDevResource_st.wqConfig' in found_struct}} @property @@ -16400,7 +16699,7 @@ cdef class cudaDevResource_st: return self._wqConfig @wqConfig.setter def wqConfig(self, wqConfig not None : cudaDevWorkqueueConfigResource): - string.memcpy(&self._pvt_ptr[0].wqConfig, wqConfig.getPtr(), sizeof(self._pvt_ptr[0].wqConfig)) + string.memcpy(&self._pvt_ptr[0].wqConfig, wqConfig.getPtr(), sizeof(self._pvt_ptr[0].wqConfig)) {{endif}} {{if 'cudaDevResource_st.wq' in found_struct}} @property @@ -16408,7 +16707,7 @@ cdef class cudaDevResource_st: return self._wq @wq.setter def wq(self, wq not None : cudaDevWorkqueueResource): - string.memcpy(&self._pvt_ptr[0].wq, wq.getPtr(), sizeof(self._pvt_ptr[0].wq)) + string.memcpy(&self._pvt_ptr[0].wq, wq.getPtr(), sizeof(self._pvt_ptr[0].wq)) {{endif}} {{if 'cudaDevResource_st._oversize' in found_struct}} @property @@ -16430,6 +16729,7 @@ cdef class cudaDevResource_st: def nextResource(self, val): if len(val) == 0: free(self._nextResource) + self._nextResource = NULL self._nextResource_length = 0 self._pvt_ptr[0].nextResource = NULL else: @@ -16661,7 +16961,7 @@ cdef class cudaKernelNodeParams: return self._gridDim @gridDim.setter def gridDim(self, gridDim not None : dim3): - string.memcpy(&self._pvt_ptr[0].gridDim, gridDim.getPtr(), sizeof(self._pvt_ptr[0].gridDim)) + string.memcpy(&self._pvt_ptr[0].gridDim, gridDim.getPtr(), sizeof(self._pvt_ptr[0].gridDim)) {{endif}} {{if 'cudaKernelNodeParams.blockDim' in found_struct}} @property @@ -16669,7 +16969,7 @@ cdef class cudaKernelNodeParams: return self._blockDim @blockDim.setter def blockDim(self, blockDim not None : dim3): - string.memcpy(&self._pvt_ptr[0].blockDim, blockDim.getPtr(), sizeof(self._pvt_ptr[0].blockDim)) + string.memcpy(&self._pvt_ptr[0].blockDim, blockDim.getPtr(), sizeof(self._pvt_ptr[0].blockDim)) {{endif}} {{if 'cudaKernelNodeParams.sharedMemBytes' in found_struct}} @property @@ -16895,7 +17195,7 @@ cdef class cudaKernelNodeParamsV2: return self._gridDim @gridDim.setter def gridDim(self, gridDim not None : dim3): - string.memcpy(&self._pvt_ptr[0].gridDim, gridDim.getPtr(), sizeof(self._pvt_ptr[0].gridDim)) + string.memcpy(&self._pvt_ptr[0].gridDim, gridDim.getPtr(), sizeof(self._pvt_ptr[0].gridDim)) {{endif}} {{if 'cudaKernelNodeParamsV2.blockDim' in found_struct}} @property @@ -16903,7 +17203,7 @@ cdef class cudaKernelNodeParamsV2: return self._blockDim @blockDim.setter def blockDim(self, blockDim not None : dim3): - string.memcpy(&self._pvt_ptr[0].blockDim, blockDim.getPtr(), sizeof(self._pvt_ptr[0].blockDim)) + string.memcpy(&self._pvt_ptr[0].blockDim, blockDim.getPtr(), sizeof(self._pvt_ptr[0].blockDim)) {{endif}} {{if 'cudaKernelNodeParamsV2.sharedMemBytes' in found_struct}} @property @@ -16995,10 +17295,12 @@ cdef class cudaExternalSemaphoreSignalNodeParams: {{if 'cudaExternalSemaphoreSignalNodeParams.extSemArray' in found_struct}} if self._extSemArray is not NULL: free(self._extSemArray) + self._pvt_ptr[0].extSemArray = NULL {{endif}} {{if 'cudaExternalSemaphoreSignalNodeParams.paramsArray' in found_struct}} if self._paramsArray is not NULL: free(self._paramsArray) + self._pvt_ptr[0].paramsArray = NULL {{endif}} def getPtr(self): return self._pvt_ptr @@ -17035,6 +17337,7 @@ cdef class cudaExternalSemaphoreSignalNodeParams: def extSemArray(self, val): if len(val) == 0: free(self._extSemArray) + self._extSemArray = NULL self._extSemArray_length = 0 self._pvt_ptr[0].extSemArray = NULL else: @@ -17058,6 +17361,7 @@ cdef class cudaExternalSemaphoreSignalNodeParams: def paramsArray(self, val): if len(val) == 0: free(self._paramsArray) + self._paramsArray = NULL self._paramsArray_length = 0 self._pvt_ptr[0].paramsArray = NULL else: @@ -17120,10 +17424,12 @@ cdef class cudaExternalSemaphoreSignalNodeParamsV2: {{if 'cudaExternalSemaphoreSignalNodeParamsV2.extSemArray' in found_struct}} if self._extSemArray is not NULL: free(self._extSemArray) + self._pvt_ptr[0].extSemArray = NULL {{endif}} {{if 'cudaExternalSemaphoreSignalNodeParamsV2.paramsArray' in found_struct}} if self._paramsArray is not NULL: free(self._paramsArray) + self._pvt_ptr[0].paramsArray = NULL {{endif}} def getPtr(self): return self._pvt_ptr @@ -17160,6 +17466,7 @@ cdef class cudaExternalSemaphoreSignalNodeParamsV2: def extSemArray(self, val): if len(val) == 0: free(self._extSemArray) + self._extSemArray = NULL self._extSemArray_length = 0 self._pvt_ptr[0].extSemArray = NULL else: @@ -17183,6 +17490,7 @@ cdef class cudaExternalSemaphoreSignalNodeParamsV2: def paramsArray(self, val): if len(val) == 0: free(self._paramsArray) + self._paramsArray = NULL self._paramsArray_length = 0 self._pvt_ptr[0].paramsArray = NULL else: @@ -17245,10 +17553,12 @@ cdef class cudaExternalSemaphoreWaitNodeParams: {{if 'cudaExternalSemaphoreWaitNodeParams.extSemArray' in found_struct}} if self._extSemArray is not NULL: free(self._extSemArray) + self._pvt_ptr[0].extSemArray = NULL {{endif}} {{if 'cudaExternalSemaphoreWaitNodeParams.paramsArray' in found_struct}} if self._paramsArray is not NULL: free(self._paramsArray) + self._pvt_ptr[0].paramsArray = NULL {{endif}} def getPtr(self): return self._pvt_ptr @@ -17285,6 +17595,7 @@ cdef class cudaExternalSemaphoreWaitNodeParams: def extSemArray(self, val): if len(val) == 0: free(self._extSemArray) + self._extSemArray = NULL self._extSemArray_length = 0 self._pvt_ptr[0].extSemArray = NULL else: @@ -17308,6 +17619,7 @@ cdef class cudaExternalSemaphoreWaitNodeParams: def paramsArray(self, val): if len(val) == 0: free(self._paramsArray) + self._paramsArray = NULL self._paramsArray_length = 0 self._pvt_ptr[0].paramsArray = NULL else: @@ -17370,10 +17682,12 @@ cdef class cudaExternalSemaphoreWaitNodeParamsV2: {{if 'cudaExternalSemaphoreWaitNodeParamsV2.extSemArray' in found_struct}} if self._extSemArray is not NULL: free(self._extSemArray) + self._pvt_ptr[0].extSemArray = NULL {{endif}} {{if 'cudaExternalSemaphoreWaitNodeParamsV2.paramsArray' in found_struct}} if self._paramsArray is not NULL: free(self._paramsArray) + self._pvt_ptr[0].paramsArray = NULL {{endif}} def getPtr(self): return self._pvt_ptr @@ -17410,6 +17724,7 @@ cdef class cudaExternalSemaphoreWaitNodeParamsV2: def extSemArray(self, val): if len(val) == 0: free(self._extSemArray) + self._extSemArray = NULL self._extSemArray_length = 0 self._pvt_ptr[0].extSemArray = NULL else: @@ -17433,6 +17748,7 @@ cdef class cudaExternalSemaphoreWaitNodeParamsV2: def paramsArray(self, val): if len(val) == 0: free(self._paramsArray) + self._paramsArray = NULL self._paramsArray_length = 0 self._pvt_ptr[0].paramsArray = NULL else: @@ -18086,7 +18402,7 @@ cdef class cudaGraphNodeParams: return self._kernel @kernel.setter def kernel(self, kernel not None : cudaKernelNodeParamsV2): - string.memcpy(&self._pvt_ptr[0].kernel, kernel.getPtr(), sizeof(self._pvt_ptr[0].kernel)) + string.memcpy(&self._pvt_ptr[0].kernel, kernel.getPtr(), sizeof(self._pvt_ptr[0].kernel)) {{endif}} {{if 'cudaGraphNodeParams.memcpy' in found_struct}} @property @@ -18094,7 +18410,7 @@ cdef class cudaGraphNodeParams: return self._memcpy @memcpy.setter def memcpy(self, memcpy not None : cudaMemcpyNodeParams): - string.memcpy(&self._pvt_ptr[0].memcpy, memcpy.getPtr(), sizeof(self._pvt_ptr[0].memcpy)) + string.memcpy(&self._pvt_ptr[0].memcpy, memcpy.getPtr(), sizeof(self._pvt_ptr[0].memcpy)) {{endif}} {{if 'cudaGraphNodeParams.memset' in found_struct}} @property @@ -18102,7 +18418,7 @@ cdef class cudaGraphNodeParams: return self._memset @memset.setter def memset(self, memset not None : cudaMemsetParamsV2): - string.memcpy(&self._pvt_ptr[0].memset, memset.getPtr(), sizeof(self._pvt_ptr[0].memset)) + string.memcpy(&self._pvt_ptr[0].memset, memset.getPtr(), sizeof(self._pvt_ptr[0].memset)) {{endif}} {{if 'cudaGraphNodeParams.host' in found_struct}} @property @@ -18110,7 +18426,7 @@ cdef class cudaGraphNodeParams: return self._host @host.setter def host(self, host not None : cudaHostNodeParamsV2): - string.memcpy(&self._pvt_ptr[0].host, host.getPtr(), sizeof(self._pvt_ptr[0].host)) + string.memcpy(&self._pvt_ptr[0].host, host.getPtr(), sizeof(self._pvt_ptr[0].host)) {{endif}} {{if 'cudaGraphNodeParams.graph' in found_struct}} @property @@ -18118,7 +18434,7 @@ cdef class cudaGraphNodeParams: return self._graph @graph.setter def graph(self, graph not None : cudaChildGraphNodeParams): - string.memcpy(&self._pvt_ptr[0].graph, graph.getPtr(), sizeof(self._pvt_ptr[0].graph)) + string.memcpy(&self._pvt_ptr[0].graph, graph.getPtr(), sizeof(self._pvt_ptr[0].graph)) {{endif}} {{if 'cudaGraphNodeParams.eventWait' in found_struct}} @property @@ -18126,7 +18442,7 @@ cdef class cudaGraphNodeParams: return self._eventWait @eventWait.setter def eventWait(self, eventWait not None : cudaEventWaitNodeParams): - string.memcpy(&self._pvt_ptr[0].eventWait, eventWait.getPtr(), sizeof(self._pvt_ptr[0].eventWait)) + string.memcpy(&self._pvt_ptr[0].eventWait, eventWait.getPtr(), sizeof(self._pvt_ptr[0].eventWait)) {{endif}} {{if 'cudaGraphNodeParams.eventRecord' in found_struct}} @property @@ -18134,7 +18450,7 @@ cdef class cudaGraphNodeParams: return self._eventRecord @eventRecord.setter def eventRecord(self, eventRecord not None : cudaEventRecordNodeParams): - string.memcpy(&self._pvt_ptr[0].eventRecord, eventRecord.getPtr(), sizeof(self._pvt_ptr[0].eventRecord)) + string.memcpy(&self._pvt_ptr[0].eventRecord, eventRecord.getPtr(), sizeof(self._pvt_ptr[0].eventRecord)) {{endif}} {{if 'cudaGraphNodeParams.extSemSignal' in found_struct}} @property @@ -18142,7 +18458,7 @@ cdef class cudaGraphNodeParams: return self._extSemSignal @extSemSignal.setter def extSemSignal(self, extSemSignal not None : cudaExternalSemaphoreSignalNodeParamsV2): - string.memcpy(&self._pvt_ptr[0].extSemSignal, extSemSignal.getPtr(), sizeof(self._pvt_ptr[0].extSemSignal)) + string.memcpy(&self._pvt_ptr[0].extSemSignal, extSemSignal.getPtr(), sizeof(self._pvt_ptr[0].extSemSignal)) {{endif}} {{if 'cudaGraphNodeParams.extSemWait' in found_struct}} @property @@ -18150,7 +18466,7 @@ cdef class cudaGraphNodeParams: return self._extSemWait @extSemWait.setter def extSemWait(self, extSemWait not None : cudaExternalSemaphoreWaitNodeParamsV2): - string.memcpy(&self._pvt_ptr[0].extSemWait, extSemWait.getPtr(), sizeof(self._pvt_ptr[0].extSemWait)) + string.memcpy(&self._pvt_ptr[0].extSemWait, extSemWait.getPtr(), sizeof(self._pvt_ptr[0].extSemWait)) {{endif}} {{if 'cudaGraphNodeParams.alloc' in found_struct}} @property @@ -18158,7 +18474,7 @@ cdef class cudaGraphNodeParams: return self._alloc @alloc.setter def alloc(self, alloc not None : cudaMemAllocNodeParamsV2): - string.memcpy(&self._pvt_ptr[0].alloc, alloc.getPtr(), sizeof(self._pvt_ptr[0].alloc)) + string.memcpy(&self._pvt_ptr[0].alloc, alloc.getPtr(), sizeof(self._pvt_ptr[0].alloc)) {{endif}} {{if 'cudaGraphNodeParams.free' in found_struct}} @property @@ -18166,7 +18482,7 @@ cdef class cudaGraphNodeParams: return self._free @free.setter def free(self, free not None : cudaMemFreeNodeParams): - string.memcpy(&self._pvt_ptr[0].free, free.getPtr(), sizeof(self._pvt_ptr[0].free)) + string.memcpy(&self._pvt_ptr[0].free, free.getPtr(), sizeof(self._pvt_ptr[0].free)) {{endif}} {{if 'cudaGraphNodeParams.conditional' in found_struct}} @property @@ -18174,7 +18490,7 @@ cdef class cudaGraphNodeParams: return self._conditional @conditional.setter def conditional(self, conditional not None : cudaConditionalNodeParams): - string.memcpy(&self._pvt_ptr[0].conditional, conditional.getPtr(), sizeof(self._pvt_ptr[0].conditional)) + string.memcpy(&self._pvt_ptr[0].conditional, conditional.getPtr(), sizeof(self._pvt_ptr[0].conditional)) {{endif}} {{if 'cudaGraphNodeParams.reserved2' in found_struct}} @property @@ -18219,9 +18535,9 @@ cdef class cudaGraphEdgeData_st: {{endif}} {{if 'cudaGraphEdgeData_st.type' in found_struct}} type : bytes - This should be populated with a value from - ::cudaGraphDependencyType. (It is typed as char due to compiler- - specific layout of bitfields.) See ::cudaGraphDependencyType. + This should be populated with a value from cudaGraphDependencyType. + (It is typed as char due to compiler-specific layout of bitfields.) + See cudaGraphDependencyType. {{endif}} {{if 'cudaGraphEdgeData_st.reserved' in found_struct}} reserved : bytes @@ -18637,7 +18953,7 @@ cdef class anon_struct16: {{endif}} {{if 'cudaGraphKernelNodeUpdate.updateData' in found_struct}} -cdef class anon_union9: +cdef class anon_union10: """ Attributes ---------- @@ -18704,7 +19020,7 @@ cdef class anon_union9: return self._gridDim @gridDim.setter def gridDim(self, gridDim not None : dim3): - string.memcpy(&self._pvt_ptr[0].updateData.gridDim, gridDim.getPtr(), sizeof(self._pvt_ptr[0].updateData.gridDim)) + string.memcpy(&self._pvt_ptr[0].updateData.gridDim, gridDim.getPtr(), sizeof(self._pvt_ptr[0].updateData.gridDim)) {{endif}} {{if 'cudaGraphKernelNodeUpdate.updateData.param' in found_struct}} @property @@ -18712,7 +19028,7 @@ cdef class anon_union9: return self._param @param.setter 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)) + 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 @@ -18742,7 +19058,7 @@ cdef class cudaGraphKernelNodeUpdate: interpreted {{endif}} {{if 'cudaGraphKernelNodeUpdate.updateData' in found_struct}} - updateData : anon_union9 + updateData : anon_union10 Update data to apply. Which field is used depends on field's value {{endif}} @@ -18763,7 +19079,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_union10(_ptr=self._pvt_ptr) {{endif}} def __dealloc__(self): if self._val_ptr is not NULL: @@ -18824,8 +19140,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_union10): + string.memcpy(&self._pvt_ptr[0].updateData, updateData.getPtr(), sizeof(self._pvt_ptr[0].updateData)) {{endif}} {{endif}} {{if 'cudaLaunchMemSyncDomainMap_st' in found_struct}} @@ -18835,8 +19151,8 @@ cdef class cudaLaunchMemSyncDomainMap_st: Memory Synchronization Domain map See cudaLaunchMemSyncDomain. By default, kernels are launched in domain 0. Kernel launched with cudaLaunchMemSyncDomainRemote will have a different domain ID. User - may also alter the domain ID with ::cudaLaunchMemSyncDomainMap for - a specific stream / graph node / kernel launch. See + may also alter the domain ID with cudaLaunchMemSyncDomainMap for a + specific stream / graph node / kernel launch. See cudaLaunchAttributeMemSyncDomainMap. Domain ID range is available through cudaDevAttrMemSyncDomainCount. @@ -19316,8 +19632,7 @@ cdef class anon_struct21: cdef class cudaLaunchAttributeValue: """ - Launch attributes union; used as value field of - ::cudaLaunchAttribute + Launch attributes union; used as value field of cudaLaunchAttribute Attributes ---------- @@ -19337,7 +19652,7 @@ cdef class cudaLaunchAttributeValue: {{if 'cudaLaunchAttributeValue.syncPolicy' in found_struct}} syncPolicy : cudaSynchronizationPolicy Value of launch attribute cudaLaunchAttributeSynchronizationPolicy. - ::cudaSynchronizationPolicy for work queued up in this stream. + cudaSynchronizationPolicy for work queued up in this stream. {{endif}} {{if 'cudaLaunchAttributeValue.clusterDim' in found_struct}} clusterDim : anon_struct17 @@ -19377,7 +19692,7 @@ cdef class cudaLaunchAttributeValue: {{if 'cudaLaunchAttributeValue.memSyncDomainMap' in found_struct}} memSyncDomainMap : cudaLaunchMemSyncDomainMap Value of launch attribute cudaLaunchAttributeMemSyncDomainMap. See - ::cudaLaunchMemSyncDomainMap. + cudaLaunchMemSyncDomainMap. {{endif}} {{if 'cudaLaunchAttributeValue.memSyncDomain' in found_struct}} memSyncDomain : cudaLaunchMemSyncDomain @@ -19392,12 +19707,12 @@ cdef class cudaLaunchAttributeValue: with the following fields: - `x` - The X dimension of the preferred cluster, in blocks. Must be a divisor of the grid X dimension, and must be a multiple of the `x` field of - cudaLaunchAttributeValue::clusterDim. - `y` - The Y dimension of - the preferred cluster, in blocks. Must be a divisor of the grid Y - dimension, and must be a multiple of the `y` field of - cudaLaunchAttributeValue::clusterDim. - `z` - The Z dimension of - the preferred cluster, in blocks. Must be equal to the `z` field of - cudaLaunchAttributeValue::clusterDim. + ::cudaLaunchAttributeValue::clusterDim. - `y` - The Y dimension + of the preferred cluster, in blocks. Must be a divisor of the grid + Y dimension, and must be a multiple of the `y` field of + ::cudaLaunchAttributeValue::clusterDim. - `z` - The Z dimension + of the preferred cluster, in blocks. Must be equal to the `z` field + of ::cudaLaunchAttributeValue::clusterDim. {{endif}} {{if 'cudaLaunchAttributeValue.launchCompletionEvent' in found_struct}} launchCompletionEvent : anon_struct20 @@ -19613,7 +19928,7 @@ cdef class cudaLaunchAttributeValue: return self._accessPolicyWindow @accessPolicyWindow.setter def accessPolicyWindow(self, accessPolicyWindow not None : cudaAccessPolicyWindow): - string.memcpy(&self._pvt_ptr[0].accessPolicyWindow, accessPolicyWindow.getPtr(), sizeof(self._pvt_ptr[0].accessPolicyWindow)) + string.memcpy(&self._pvt_ptr[0].accessPolicyWindow, accessPolicyWindow.getPtr(), sizeof(self._pvt_ptr[0].accessPolicyWindow)) {{endif}} {{if 'cudaLaunchAttributeValue.cooperative' in found_struct}} @property @@ -19637,7 +19952,7 @@ cdef class cudaLaunchAttributeValue: return self._clusterDim @clusterDim.setter def clusterDim(self, clusterDim not None : anon_struct17): - string.memcpy(&self._pvt_ptr[0].clusterDim, clusterDim.getPtr(), sizeof(self._pvt_ptr[0].clusterDim)) + string.memcpy(&self._pvt_ptr[0].clusterDim, clusterDim.getPtr(), sizeof(self._pvt_ptr[0].clusterDim)) {{endif}} {{if 'cudaLaunchAttributeValue.clusterSchedulingPolicyPreference' in found_struct}} @property @@ -19661,7 +19976,7 @@ cdef class cudaLaunchAttributeValue: return self._programmaticEvent @programmaticEvent.setter def programmaticEvent(self, programmaticEvent not None : anon_struct18): - string.memcpy(&self._pvt_ptr[0].programmaticEvent, programmaticEvent.getPtr(), sizeof(self._pvt_ptr[0].programmaticEvent)) + string.memcpy(&self._pvt_ptr[0].programmaticEvent, programmaticEvent.getPtr(), sizeof(self._pvt_ptr[0].programmaticEvent)) {{endif}} {{if 'cudaLaunchAttributeValue.priority' in found_struct}} @property @@ -19677,7 +19992,7 @@ cdef class cudaLaunchAttributeValue: return self._memSyncDomainMap @memSyncDomainMap.setter def memSyncDomainMap(self, memSyncDomainMap not None : cudaLaunchMemSyncDomainMap): - string.memcpy(&self._pvt_ptr[0].memSyncDomainMap, memSyncDomainMap.getPtr(), sizeof(self._pvt_ptr[0].memSyncDomainMap)) + string.memcpy(&self._pvt_ptr[0].memSyncDomainMap, memSyncDomainMap.getPtr(), sizeof(self._pvt_ptr[0].memSyncDomainMap)) {{endif}} {{if 'cudaLaunchAttributeValue.memSyncDomain' in found_struct}} @property @@ -19693,7 +20008,7 @@ cdef class cudaLaunchAttributeValue: return self._preferredClusterDim @preferredClusterDim.setter def preferredClusterDim(self, preferredClusterDim not None : anon_struct19): - string.memcpy(&self._pvt_ptr[0].preferredClusterDim, preferredClusterDim.getPtr(), sizeof(self._pvt_ptr[0].preferredClusterDim)) + string.memcpy(&self._pvt_ptr[0].preferredClusterDim, preferredClusterDim.getPtr(), sizeof(self._pvt_ptr[0].preferredClusterDim)) {{endif}} {{if 'cudaLaunchAttributeValue.launchCompletionEvent' in found_struct}} @property @@ -19701,7 +20016,7 @@ cdef class cudaLaunchAttributeValue: return self._launchCompletionEvent @launchCompletionEvent.setter def launchCompletionEvent(self, launchCompletionEvent not None : anon_struct20): - string.memcpy(&self._pvt_ptr[0].launchCompletionEvent, launchCompletionEvent.getPtr(), sizeof(self._pvt_ptr[0].launchCompletionEvent)) + string.memcpy(&self._pvt_ptr[0].launchCompletionEvent, launchCompletionEvent.getPtr(), sizeof(self._pvt_ptr[0].launchCompletionEvent)) {{endif}} {{if 'cudaLaunchAttributeValue.deviceUpdatableKernelNode' in found_struct}} @property @@ -19709,7 +20024,7 @@ cdef class cudaLaunchAttributeValue: return self._deviceUpdatableKernelNode @deviceUpdatableKernelNode.setter def deviceUpdatableKernelNode(self, deviceUpdatableKernelNode not None : anon_struct21): - string.memcpy(&self._pvt_ptr[0].deviceUpdatableKernelNode, deviceUpdatableKernelNode.getPtr(), sizeof(self._pvt_ptr[0].deviceUpdatableKernelNode)) + string.memcpy(&self._pvt_ptr[0].deviceUpdatableKernelNode, deviceUpdatableKernelNode.getPtr(), sizeof(self._pvt_ptr[0].deviceUpdatableKernelNode)) {{endif}} {{if 'cudaLaunchAttributeValue.sharedMemCarveout' in found_struct}} @property @@ -19812,7 +20127,7 @@ cdef class cudaLaunchAttribute_st: return self._val @val.setter def val(self, val not None : cudaLaunchAttributeValue): - string.memcpy(&self._pvt_ptr[0].val, val.getPtr(), sizeof(self._pvt_ptr[0].val)) + string.memcpy(&self._pvt_ptr[0].val, val.getPtr(), sizeof(self._pvt_ptr[0].val)) {{endif}} {{endif}} {{if 'cudaAsyncNotificationInfo.info.overBudget' in found_struct}} @@ -19863,7 +20178,7 @@ cdef class anon_struct22: {{endif}} {{if 'cudaAsyncNotificationInfo.info' in found_struct}} -cdef class anon_union10: +cdef class anon_union11: """ Attributes ---------- @@ -19907,7 +20222,7 @@ cdef class anon_union10: return self._overBudget @overBudget.setter 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)) + string.memcpy(&self._pvt_ptr[0].info.overBudget, overBudget.getPtr(), sizeof(self._pvt_ptr[0].info.overBudget)) {{endif}} {{endif}} {{if 'cudaAsyncNotificationInfo' in found_struct}} @@ -19923,7 +20238,7 @@ cdef class cudaAsyncNotificationInfo: The type of notification being sent {{endif}} {{if 'cudaAsyncNotificationInfo.info' in found_struct}} - info : anon_union10 + info : anon_union11 Information about the notification. `typename` must be checked in order to interpret this field. {{endif}} @@ -19942,7 +20257,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_union11(_ptr=self._pvt_ptr) {{endif}} def __dealloc__(self): if self._val_ptr is not NULL: @@ -19980,8 +20295,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_union11): + string.memcpy(&self._pvt_ptr[0].info, info.getPtr(), sizeof(self._pvt_ptr[0].info)) {{endif}} {{endif}} {{if 'cudaTextureDesc' in found_struct}} @@ -20250,6 +20565,88 @@ cdef class cudaTextureDesc: self._pvt_ptr[0].seamlessCubemap = seamlessCubemap {{endif}} {{endif}} +{{if 'cudaGraphRecaptureCallbackData' in found_struct}} + +cdef class cudaGraphRecaptureCallbackData: + """ + Struct of user callback data that is invoked when node parameter + mismatches are detected while recapturing to an existing graph + + Attributes + ---------- + {{if 'cudaGraphRecaptureCallbackData.callbackFunc' in found_struct}} + callbackFunc : cudaGraphRecaptureCallback_t + Callback function that will be invoked + {{endif}} + {{if 'cudaGraphRecaptureCallbackData.userData' in found_struct}} + userData : Any + Generic pointer that is passed to the callback function + {{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 'cudaGraphRecaptureCallbackData.callbackFunc' in found_struct}} + self._callbackFunc = cudaGraphRecaptureCallback_t(_ptr=&self._pvt_ptr[0].callbackFunc) + {{endif}} + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + {{if 'cudaGraphRecaptureCallbackData.callbackFunc' in found_struct}} + try: + str_list += ['callbackFunc : ' + str(self.callbackFunc)] + except ValueError: + str_list += ['callbackFunc : '] + {{endif}} + {{if 'cudaGraphRecaptureCallbackData.userData' in found_struct}} + try: + str_list += ['userData : ' + hex(self.userData)] + except ValueError: + str_list += ['userData : '] + {{endif}} + return '\n'.join(str_list) + else: + return '' + {{if 'cudaGraphRecaptureCallbackData.callbackFunc' in found_struct}} + @property + def callbackFunc(self): + return self._callbackFunc + @callbackFunc.setter + def callbackFunc(self, callbackFunc): + cdef cyruntime.cudaGraphRecaptureCallback_t cycallbackFunc + if callbackFunc is None: + cycallbackFunc = 0 + elif isinstance(callbackFunc, (cudaGraphRecaptureCallback_t)): + pcallbackFunc = int(callbackFunc) + cycallbackFunc = pcallbackFunc + else: + pcallbackFunc = int(cudaGraphRecaptureCallback_t(callbackFunc)) + cycallbackFunc = pcallbackFunc + self._callbackFunc._pvt_ptr[0] = cycallbackFunc + {{endif}} + {{if 'cudaGraphRecaptureCallbackData.userData' in found_struct}} + @property + def userData(self): + return self._pvt_ptr[0].userData + @userData.setter + def userData(self, userData): + self._cyuserData = _HelperInputVoidPtr(userData) + self._pvt_ptr[0].userData = self._cyuserData.cptr + {{endif}} +{{endif}} {{if True}} cdef class cudaEglPlaneDesc_st: @@ -20401,7 +20798,7 @@ cdef class cudaEglPlaneDesc_st: return self._channelDesc @channelDesc.setter def channelDesc(self, channelDesc not None : cudaChannelFormatDesc): - string.memcpy(&self._pvt_ptr[0].channelDesc, channelDesc.getPtr(), sizeof(self._pvt_ptr[0].channelDesc)) + string.memcpy(&self._pvt_ptr[0].channelDesc, channelDesc.getPtr(), sizeof(self._pvt_ptr[0].channelDesc)) {{endif}} {{if True}} @property @@ -20414,7 +20811,7 @@ cdef class cudaEglPlaneDesc_st: {{endif}} {{if True}} -cdef class anon_union11: +cdef class anon_union12: """ Attributes ---------- @@ -20484,7 +20881,7 @@ cdef class anon_union11: if len(pPitch) != 3: raise IndexError('not enough values found during array assignment, expected 3, got', len(pPitch)) for _idx in range(len(pPitch)): - string.memcpy(&self._pvt_ptr[0].frame.pPitch[_idx], pPitch[_idx].getPtr(), sizeof(cyruntime.cudaPitchedPtr)) + string.memcpy(&self._pvt_ptr[0].frame.pPitch[_idx], pPitch[_idx].getPtr(), sizeof(cyruntime.cudaPitchedPtr)) {{endif}} {{endif}} @@ -20504,7 +20901,7 @@ cdef class cudaEglFrame_st: Attributes ---------- {{if True}} - frame : anon_union11 + frame : anon_union12 {{endif}} {{if True}} @@ -20538,7 +20935,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_union12(_ptr=self._pvt_ptr) {{endif}} def __dealloc__(self): if self._val_ptr is not NULL: @@ -20586,8 +20983,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_union12): + string.memcpy(&self._pvt_ptr[0].frame, frame.getPtr(), sizeof(self._pvt_ptr[0].frame)) {{endif}} {{if True}} @property @@ -20601,7 +20998,7 @@ cdef class cudaEglFrame_st: if len(planeDesc) != 3: raise IndexError('not enough values found during array assignment, expected 3, got', len(planeDesc)) for _idx in range(len(planeDesc)): - string.memcpy(&self._pvt_ptr[0].planeDesc[_idx], planeDesc[_idx].getPtr(), sizeof(cyruntime.cudaEglPlaneDesc)) + string.memcpy(&self._pvt_ptr[0].planeDesc[_idx], planeDesc[_idx].getPtr(), sizeof(cyruntime.cudaEglPlaneDesc)) {{endif}} {{if True}} @@ -21210,7 +21607,7 @@ def cudaDeviceGetTexture1DLinearMaxWidth(fmtDesc : Optional[cudaChannelFormatDes :py:obj:`~.cuDeviceGetTexture1DLinearMaxWidth` """ cdef size_t maxWidthInElements = 0 - cdef cyruntime.cudaChannelFormatDesc* cyfmtDesc_ptr = fmtDesc._pvt_ptr if fmtDesc is not 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: @@ -21748,9 +22145,11 @@ def cudaDeviceFlushGPUDirectRDMAWrites(target not None : cudaFlushGPUDirectRDMAW Parameters ---------- target : :py:obj:`~.cudaFlushGPUDirectRDMAWritesTarget` - The target of the operation, see cudaFlushGPUDirectRDMAWritesTarget + The target of the operation, see + :py:obj:`~.cudaFlushGPUDirectRDMAWritesTarget` scope : :py:obj:`~.cudaFlushGPUDirectRDMAWritesScope` - The scope of the operation, see cudaFlushGPUDirectRDMAWritesScope + The scope of the operation, see + :py:obj:`~.cudaFlushGPUDirectRDMAWritesScope` Returns ------- @@ -22448,8 +22847,8 @@ def cudaDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, int device, int flags): - NvSciSyncAttrValPrimitiveType_SysmemSemaphorePayload64b if `device` is GA10X+. NvSciSyncAttrKey_GpuId is set to the same UUID that is - returned in `None` from :py:obj:`~.cudaDeviceGetProperties` for this - `device`. + returned in `cudaDeviceProp.uuid` from + :py:obj:`~.cudaDeviceGetProperties` for this `device`. :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorDeviceUninitialized`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidHandle`, @@ -22640,7 +23039,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 is not 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: @@ -23381,7 +23780,7 @@ def cudaStreamSetAttribute(hStream, attr not None : cudaStreamAttrID, value : Op phStream = int(cudaStream_t(hStream)) cyhStream = phStream cdef cyruntime.cudaStreamAttrID cyattr = int(attr) - cdef cyruntime.cudaStreamAttrValue* cyvalue_ptr = value._pvt_ptr if value is not 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 (_cudaError_t(err),) @@ -23851,6 +24250,82 @@ def cudaStreamBeginCapture(stream, mode not None : cudaStreamCaptureMode): return (_cudaError_t(err),) {{endif}} +{{if 'cudaStreamBeginRecaptureToGraph' in found_functions}} + +@cython.embedsignature(True) +def cudaStreamBeginRecaptureToGraph(stream, mode not None : cudaStreamCaptureMode, graph, callbackData : Optional[cudaGraphRecaptureCallbackData]): + """ Begin graph capture on a stream to an existing graph. + + Begin graph capture on `stream` to the existing `graph`. The node + creation order while recapturing the graph must be identical to the + original graph. The recapture will fail immediately for: + + - Topology mismatches between the existing graph and the recaptured + graph + + - Parameter mismatches for memory allocation or free nodes + + Any other node parameter mismatches during recapture can be configured + to call the function provided in `callbackFunc`. The recapture will + fail immediately if the callback returns anything other than + cudaSuccess. + + If the recapture fails for any reason, the `graph` will be in an + undefined state and should be destroyed. + + See cudaStreamBeginCapture for additional detail on beginning the + capture. + + Parameters + ---------- + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream in which to initiate capture + mode : :py:obj:`~.cudaStreamCaptureMode` + Controls the interaction of this capture sequence with other API + calls that are potentially unsafe. For more details see + :py:obj:`~.cudaThreadExchangeStreamCaptureMode`. + graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Existing CUDA graph to be captured into + callbackData : :py:obj:`~.cudaGraphRecaptureCallbackData` + Optional struct of callback data that will be invoked for all + parameter mismatches from the original graph + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorDeinitialized`, :py:obj:`~.cudaErrorNotInitialized`, :py:obj:`~.cudaErrorInvalidValue`, + + See Also + -------- + :py:obj:`~.cudaStreamCreate`, :py:obj:`~.cudaStreamBeginCapture`, :py:obj:`~.cudaStreamIsCapturing`, :py:obj:`~.cudaStreamEndCapture`, :py:obj:`~.cudaThreadExchangeStreamCaptureMode` + + Notes + ----- + Any user objects associated with `graph` will be released prior to the recapture. + """ + 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.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.cudaStreamCaptureMode cymode = int(mode) + cdef cyruntime.cudaGraphRecaptureCallbackData* cycallbackData_ptr = callbackData._pvt_ptr if callbackData is not None else NULL + with nogil: + err = cyruntime.cudaStreamBeginRecaptureToGraph(cystream, cymode, cygraph, cycallbackData_ptr) + return (_cudaError_t(err),) +{{endif}} + {{if 'cudaStreamBeginCaptureToGraph' in found_functions}} @cython.embedsignature(True) @@ -24232,9 +24707,13 @@ def cudaStreamGetCaptureInfo(stream): with nogil: 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)] + pydependencies_out = [cudaGraphNode_t() for _ in range(numDependencies_out)] + for idx in range(numDependencies_out): + (pydependencies_out[idx])._pvt_ptr[0] = cydependencies_out[idx] if cudaError_t(err) == cudaError_t(0): - pyedgeData_out = [cudaGraphEdgeData(_ptr=&cyedgeData_out[idx]) for idx in range(numDependencies_out)] + pyedgeData_out = [cudaGraphEdgeData() for _ in range(numDependencies_out)] + for idx in range(numDependencies_out): + (pyedgeData_out[idx])._pvt_ptr[0] = cyedgeData_out[idx] if err != cyruntime.cudaSuccess: return (_cudaError_t(err), None, None, None, None, None, None) return (_cudaError_t_SUCCESS, cudaStreamCaptureStatus(captureStatus_out), id_out, graph_out, pydependencies_out, pyedgeData_out, numDependencies_out) @@ -24760,88 +25239,83 @@ def cudaImportExternalMemory(memHandleDesc : Optional[cudaExternalMemoryHandleDe If :py:obj:`~.cudaExternalMemoryHandleDesc.type` is :py:obj:`~.cudaExternalMemoryHandleTypeOpaqueFd`, then - :py:obj:`~.cudaExternalMemoryHandleDesc`::handle::fd must be a valid - file descriptor referencing a memory object. Ownership of the file + :py:obj:`~.cudaExternalMemoryHandleDesc.handle.fd` must be a valid file + descriptor referencing a memory object. Ownership of the file descriptor is transferred to the CUDA driver when the handle is imported successfully. Performing any operations on the file descriptor after it is imported results in undefined behavior. If :py:obj:`~.cudaExternalMemoryHandleDesc.type` is :py:obj:`~.cudaExternalMemoryHandleTypeOpaqueWin32`, then exactly one - of :py:obj:`~.cudaExternalMemoryHandleDesc`::handle::win32::handle and - :py:obj:`~.cudaExternalMemoryHandleDesc`::handle::win32::name must not - be NULL. If - :py:obj:`~.cudaExternalMemoryHandleDesc`::handle::win32::handle is not - NULL, then it must represent a valid shared NT handle that references a - memory object. Ownership of this handle is not transferred to CUDA - after the import operation, so the application must release the handle - using the appropriate system call. If - :py:obj:`~.cudaExternalMemoryHandleDesc`::handle::win32::name is not - NULL, then it must point to a NULL-terminated array of UTF-16 - characters that refers to a memory object. + of :py:obj:`~.cudaExternalMemoryHandleDesc.handle.win32.handle` and + :py:obj:`~.cudaExternalMemoryHandleDesc.handle.win32.name` must not be + NULL. If :py:obj:`~.cudaExternalMemoryHandleDesc.handle.win32.handle` + is not NULL, then it must represent a valid shared NT handle that + references a memory object. Ownership of this handle is not transferred + to CUDA after the import operation, so the application must release the + handle using the appropriate system call. If + :py:obj:`~.cudaExternalMemoryHandleDesc.handle.win32.name` is not NULL, + then it must point to a NULL-terminated array of UTF-16 characters that + refers to a memory object. If :py:obj:`~.cudaExternalMemoryHandleDesc.type` is :py:obj:`~.cudaExternalMemoryHandleTypeOpaqueWin32Kmt`, then - :py:obj:`~.cudaExternalMemoryHandleDesc`::handle::win32::handle must be - non-NULL and - :py:obj:`~.cudaExternalMemoryHandleDesc`::handle::win32::name must be - NULL. The handle specified must be a globally shared KMT handle. This - handle does not hold a reference to the underlying object, and thus - will be invalid when all references to the memory object are destroyed. + :py:obj:`~.cudaExternalMemoryHandleDesc.handle.win32.handle` must be + non-NULL and :py:obj:`~.cudaExternalMemoryHandleDesc.handle.win32.name` + must be NULL. The handle specified must be a globally shared KMT + handle. This handle does not hold a reference to the underlying object, + and thus will be invalid when all references to the memory object are + destroyed. If :py:obj:`~.cudaExternalMemoryHandleDesc.type` is :py:obj:`~.cudaExternalMemoryHandleTypeD3D12Heap`, then exactly one of - :py:obj:`~.cudaExternalMemoryHandleDesc`::handle::win32::handle and - :py:obj:`~.cudaExternalMemoryHandleDesc`::handle::win32::name must not - be NULL. If - :py:obj:`~.cudaExternalMemoryHandleDesc`::handle::win32::handle is not - NULL, then it must represent a valid shared NT handle that is returned - by ID3D12Device::CreateSharedHandle when referring to a ID3D12Heap - object. This handle holds a reference to the underlying object. If - :py:obj:`~.cudaExternalMemoryHandleDesc`::handle::win32::name is not - NULL, then it must point to a NULL-terminated array of UTF-16 + :py:obj:`~.cudaExternalMemoryHandleDesc.handle.win32.handle` and + :py:obj:`~.cudaExternalMemoryHandleDesc.handle.win32.name` must not be + NULL. If :py:obj:`~.cudaExternalMemoryHandleDesc.handle.win32.handle` + is not NULL, then it must represent a valid shared NT handle that is + returned by ID3D12Device::CreateSharedHandle when referring to a + ID3D12Heap object. This handle holds a reference to the underlying + object. If :py:obj:`~.cudaExternalMemoryHandleDesc.handle.win32.name` + is not NULL, then it must point to a NULL-terminated array of UTF-16 characters that refers to a ID3D12Heap object. If :py:obj:`~.cudaExternalMemoryHandleDesc.type` is :py:obj:`~.cudaExternalMemoryHandleTypeD3D12Resource`, then exactly one - of :py:obj:`~.cudaExternalMemoryHandleDesc`::handle::win32::handle and - :py:obj:`~.cudaExternalMemoryHandleDesc`::handle::win32::name must not - be NULL. If - :py:obj:`~.cudaExternalMemoryHandleDesc`::handle::win32::handle is not - NULL, then it must represent a valid shared NT handle that is returned - by ID3D12Device::CreateSharedHandle when referring to a ID3D12Resource - object. This handle holds a reference to the underlying object. If - :py:obj:`~.cudaExternalMemoryHandleDesc`::handle::win32::name is not - NULL, then it must point to a NULL-terminated array of UTF-16 + of :py:obj:`~.cudaExternalMemoryHandleDesc.handle.win32.handle` and + :py:obj:`~.cudaExternalMemoryHandleDesc.handle.win32.name` must not be + NULL. If :py:obj:`~.cudaExternalMemoryHandleDesc.handle.win32.handle` + is not NULL, then it must represent a valid shared NT handle that is + returned by ID3D12Device::CreateSharedHandle when referring to a + ID3D12Resource object. This handle holds a reference to the underlying + object. If :py:obj:`~.cudaExternalMemoryHandleDesc.handle.win32.name` + is not NULL, then it must point to a NULL-terminated array of UTF-16 characters that refers to a ID3D12Resource object. If :py:obj:`~.cudaExternalMemoryHandleDesc.type` is :py:obj:`~.cudaExternalMemoryHandleTypeD3D11Resource`,then exactly one - of :py:obj:`~.cudaExternalMemoryHandleDesc`::handle::win32::handle and - :py:obj:`~.cudaExternalMemoryHandleDesc`::handle::win32::name must not - be NULL. If - :py:obj:`~.cudaExternalMemoryHandleDesc`::handle::win32::handle is - not NULL, then it must represent a valid shared NT handle that is + of :py:obj:`~.cudaExternalMemoryHandleDesc.handle.win32.handle` and + :py:obj:`~.cudaExternalMemoryHandleDesc.handle.win32.name` must not be + NULL. If :py:obj:`~.cudaExternalMemoryHandleDesc.handle.win32.handle` + is not NULL, then it must represent a valid shared NT handle that is returned by IDXGIResource1::CreateSharedHandle when referring to a ID3D11Resource object. If - :py:obj:`~.cudaExternalMemoryHandleDesc`::handle::win32::name is not - NULL, then it must point to a NULL-terminated array of UTF-16 - characters that refers to a ID3D11Resource object. + :py:obj:`~.cudaExternalMemoryHandleDesc.handle.win32.name` is not NULL, + then it must point to a NULL-terminated array of UTF-16 characters that + refers to a ID3D11Resource object. If :py:obj:`~.cudaExternalMemoryHandleDesc.type` is :py:obj:`~.cudaExternalMemoryHandleTypeD3D11ResourceKmt`, then - :py:obj:`~.cudaExternalMemoryHandleDesc`::handle::win32::handle must be - non-NULL and - :py:obj:`~.cudaExternalMemoryHandleDesc`::handle::win32::name must be - NULL. The handle specified must be a valid shared KMT handle that is - returned by IDXGIResource::GetSharedHandle when referring to a + :py:obj:`~.cudaExternalMemoryHandleDesc.handle.win32.handle` must be + non-NULL and :py:obj:`~.cudaExternalMemoryHandleDesc.handle.win32.name` + must be NULL. The handle specified must be a valid shared KMT handle + that is returned by IDXGIResource::GetSharedHandle when referring to a ID3D11Resource object. If :py:obj:`~.cudaExternalMemoryHandleDesc.type` is :py:obj:`~.cudaExternalMemoryHandleTypeNvSciBuf`, then - :py:obj:`~.cudaExternalMemoryHandleDesc`::handle::nvSciBufObject must - be NON-NULL and reference a valid NvSciBuf object. If the NvSciBuf - object imported into CUDA is also mapped by other drivers, then the + :py:obj:`~.cudaExternalMemoryHandleDesc.handle.nvSciBufObject` must be + NON-NULL and reference a valid NvSciBuf object. If the NvSciBuf object + imported into CUDA is also mapped by other drivers, then the application must use :py:obj:`~.cudaWaitExternalSemaphoresAsync` or :py:obj:`~.cudaSignalExternalSemaphoresAsync` as approprriate barriers to maintain coherence between CUDA and the other drivers. See @@ -24883,7 +25357,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 is not 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: @@ -24951,7 +25425,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 is not 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: @@ -25023,7 +25497,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 is not 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: @@ -25092,7 +25566,7 @@ def cudaImportExternalSemaphore(semHandleDesc : Optional[cudaExternalSemaphoreHa If :py:obj:`~.cudaExternalSemaphoreHandleDesc.type` is :py:obj:`~.cudaExternalSemaphoreHandleTypeOpaqueFd`, then - :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::fd must be a valid + :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.fd` must be a valid file descriptor referencing a synchronization object. Ownership of the file descriptor is transferred to the CUDA driver when the handle is imported successfully. Performing any operations on the file descriptor @@ -25100,80 +25574,78 @@ def cudaImportExternalSemaphore(semHandleDesc : Optional[cudaExternalSemaphoreHa If :py:obj:`~.cudaExternalSemaphoreHandleDesc.type` is :py:obj:`~.cudaExternalSemaphoreHandleTypeOpaqueWin32`, then exactly - one of - :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::win32::handle and - :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::win32::name must + one of :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.win32.handle` + and :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.win32.name` must not be NULL. If - :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::win32::handle is - not NULL, then it must represent a valid shared NT handle that - references a synchronization object. Ownership of this handle is not - transferred to CUDA after the import operation, so the application must - release the handle using the appropriate system call. If - :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::win32::name is not + :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.win32.handle` is not + NULL, then it must represent a valid shared NT handle that references a + synchronization object. Ownership of this handle is not transferred to + CUDA after the import operation, so the application must release the + handle using the appropriate system call. If + :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.win32.name` is not NULL, then it must name a valid synchronization object. If :py:obj:`~.cudaExternalSemaphoreHandleDesc.type` is :py:obj:`~.cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt`, then - :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::win32::handle must - be non-NULL and - :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::win32::name must - be NULL. The handle specified must be a globally shared KMT handle. - This handle does not hold a reference to the underlying object, and - thus will be invalid when all references to the synchronization object - are destroyed. + :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.win32.handle` must be + non-NULL and + :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.win32.name` must be + NULL. The handle specified must be a globally shared KMT handle. This + handle does not hold a reference to the underlying object, and thus + will be invalid when all references to the synchronization object are + destroyed. If :py:obj:`~.cudaExternalSemaphoreHandleDesc.type` is :py:obj:`~.cudaExternalSemaphoreHandleTypeD3D12Fence`, then exactly one - of :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::win32::handle - and :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::win32::name - must not be NULL. If - :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::win32::handle is - not NULL, then it must represent a valid shared NT handle that is - returned by ID3D12Device::CreateSharedHandle when referring to a - ID3D12Fence object. This handle holds a reference to the underlying - object. If - :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::win32::name is not + of :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.win32.handle` and + :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.win32.name` must not + be NULL. If + :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.win32.handle` is not + NULL, then it must represent a valid shared NT handle that is returned + by ID3D12Device::CreateSharedHandle when referring to a ID3D12Fence + object. This handle holds a reference to the underlying object. If + :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.win32.name` is not NULL, then it must name a valid synchronization object that refers to a valid ID3D12Fence object. If :py:obj:`~.cudaExternalSemaphoreHandleDesc.type` is :py:obj:`~.cudaExternalSemaphoreHandleTypeD3D11Fence`, then exactly one - of :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::win32::handle - and :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::win32::name - must not be NULL. If - :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::win32::handle is - not NULL, then it must represent a valid shared NT handle that is - returned by ID3D11Fence::CreateSharedHandle. If - :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::win32::name is not + of :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.win32.handle` and + :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.win32.name` must not + be NULL. If + :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.win32.handle` is not + NULL, then it must represent a valid shared NT handle that is returned + by ID3D11Fence::CreateSharedHandle. If + :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.win32.name` is not NULL, then it must name a valid synchronization object that refers to a valid ID3D11Fence object. If :py:obj:`~.cudaExternalSemaphoreHandleDesc.type` is :py:obj:`~.cudaExternalSemaphoreHandleTypeNvSciSync`, then - :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::nvSciSyncObj + :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.nvSciSyncObj` represents a valid NvSciSyncObj. :py:obj:`~.cudaExternalSemaphoreHandleTypeKeyedMutex`, then exactly one - of :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::win32::handle - and :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::win32::name - must not be NULL. If - :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::win32::handle is - not NULL, then it represent a valid shared NT handle that is returned - by IDXGIResource1::CreateSharedHandle when referring to a - IDXGIKeyedMutex object. + of :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.win32.handle` and + :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.win32.name` must not + be NULL. If + :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.win32.handle` is not + NULL, then it represent a valid shared NT handle that is returned by + IDXGIResource1::CreateSharedHandle when referring to a IDXGIKeyedMutex + object. If :py:obj:`~.cudaExternalSemaphoreHandleDesc.type` is :py:obj:`~.cudaExternalSemaphoreHandleTypeKeyedMutexKmt`, then - :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::win32::handle must - be non-NULL and - :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::win32::name must - be NULL. The handle specified must represent a valid KMT handle that is + :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.win32.handle` must be + non-NULL and + :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.win32.name` must be + NULL. The handle specified must represent a valid KMT handle that is returned by IDXGIResource::GetSharedHandle when referring to a IDXGIKeyedMutex object. If :py:obj:`~.cudaExternalSemaphoreHandleDesc.type` is :py:obj:`~.cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd`, then - :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::fd must be a valid + :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.fd` must be a valid file descriptor referencing a synchronization object. Ownership of the file descriptor is transferred to the CUDA driver when the handle is imported successfully. Performing any operations on the file descriptor @@ -25182,15 +25654,15 @@ def cudaImportExternalSemaphore(semHandleDesc : Optional[cudaExternalSemaphoreHa If :py:obj:`~.cudaExternalSemaphoreHandleDesc.type` is :py:obj:`~.cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32`, then exactly one of - :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::win32::handle and - :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::win32::name must - not be NULL. If - :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::win32::handle is - not NULL, then it must represent a valid shared NT handle that - references a synchronization object. Ownership of this handle is not - transferred to CUDA after the import operation, so the application must - release the handle using the appropriate system call. If - :py:obj:`~.cudaExternalSemaphoreHandleDesc`::handle::win32::name is not + :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.win32.handle` and + :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.win32.name` must not + be NULL. If + :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.win32.handle` is not + NULL, then it must represent a valid shared NT handle that references a + synchronization object. Ownership of this handle is not transferred to + CUDA after the import operation, so the application must release the + handle using the appropriate system call. If + :py:obj:`~.cudaExternalSemaphoreHandleDesc.handle.win32.name` is not NULL, then it must name a valid synchronization object. Parameters @@ -25210,7 +25682,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 is not 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: @@ -25243,15 +25715,15 @@ def cudaSignalExternalSemaphoresAsync(extSemArray : Optional[tuple[cudaExternalS :py:obj:`~.cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd`, :py:obj:`~.cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32` then the semaphore will be set to the value specified in - :py:obj:`~.cudaExternalSemaphoreSignalParams`::params::fence::value. + :py:obj:`~.cudaExternalSemaphoreSignalParams.params.fence.value`. If the semaphore object is of the type :py:obj:`~.cudaExternalSemaphoreHandleTypeNvSciSync` this API sets - :py:obj:`~.cudaExternalSemaphoreSignalParams`::params::nvSciSync::fence - to a value that can be used by subsequent waiters of the same NvSciSync + :py:obj:`~.cudaExternalSemaphoreSignalParams.params.nvSciSync.fence` to + a value that can be used by subsequent waiters of the same NvSciSync object to order operations with those currently submitted in `stream`. Such an update will overwrite previous contents of - :py:obj:`~.cudaExternalSemaphoreSignalParams`::params::nvSciSync::fence. + :py:obj:`~.cudaExternalSemaphoreSignalParams.params.nvSciSync.fence`. By default, signaling such an external semaphore object causes appropriate memory synchronization operations to be performed over all the external memory objects that are imported as @@ -25268,7 +25740,7 @@ def cudaSignalExternalSemaphoresAsync(extSemArray : Optional[tuple[cudaExternalS in :py:obj:`~.cudaDeviceGetNvSciSyncAttributes` to cudaNvSciSyncAttrSignal, this API will return cudaErrorNotSupported. - :py:obj:`~.cudaExternalSemaphoreSignalParams`::params::nvSciSync::fence + :py:obj:`~.cudaExternalSemaphoreSignalParams.params.nvSciSync.fence` associated with semaphore object of the type :py:obj:`~.cudaExternalSemaphoreHandleTypeNvSciSync` can be deterministic. For this the NvSciSyncAttrList used to create the @@ -25287,7 +25759,7 @@ 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 + :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 @@ -25308,7 +25780,7 @@ def cudaSignalExternalSemaphoresAsync(extSemArray : Optional[tuple[cudaExternalS :py:obj:`~.cudaExternalSemaphoreHandleTypeKeyedMutex`, :py:obj:`~.cudaExternalSemaphoreHandleTypeKeyedMutexKmt`, then the keyed mutex will be released with the key specified in - :py:obj:`~.cudaExternalSemaphoreSignalParams`::params::keyedmutex::key. + :py:obj:`~.cudaExternalSemaphoreSignalParams.params.keyedmutex.key`. Parameters ---------- @@ -25403,14 +25875,14 @@ def cudaWaitExternalSemaphoresAsync(extSemArray : Optional[tuple[cudaExternalSem :py:obj:`~.cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32` then waiting on the semaphore will wait until the value of the semaphore is greater than or equal to - :py:obj:`~.cudaExternalSemaphoreWaitParams`::params::fence::value. + :py:obj:`~.cudaExternalSemaphoreWaitParams.params.fence.value`. If the semaphore object is of the type :py:obj:`~.cudaExternalSemaphoreHandleTypeNvSciSync` then, waiting on the semaphore will wait until the - :py:obj:`~.cudaExternalSemaphoreSignalParams`::params::nvSciSync::fence - is signaled by the signaler of the NvSciSyncObj that was associated - with this semaphore object. By default, waiting on such an external + :py:obj:`~.cudaExternalSemaphoreSignalParams.params.nvSciSync.fence` is + signaled by the signaler of the NvSciSyncObj that was associated with + this semaphore object. By default, waiting on such an external semaphore object causes appropriate memory synchronization operations to be performed over all external memory objects that are imported as :py:obj:`~.cudaExternalMemoryHandleTypeNvSciBuf`. This ensures that any @@ -25430,10 +25902,9 @@ def cudaWaitExternalSemaphoresAsync(extSemArray : Optional[tuple[cudaExternalSem :py:obj:`~.cudaExternalSemaphoreHandleTypeKeyedMutex`, :py:obj:`~.cudaExternalSemaphoreHandleTypeKeyedMutexKmt`, then the keyed mutex will be acquired when it is released with the key specified - in - :py:obj:`~.cudaExternalSemaphoreSignalParams`::params::keyedmutex::key + in :py:obj:`~.cudaExternalSemaphoreSignalParams.params.keyedmutex.key` or until the timeout specified by - :py:obj:`~.cudaExternalSemaphoreSignalParams`::params::keyedmutex::timeoutMs + :py:obj:`~.cudaExternalSemaphoreSignalParams.params.keyedmutex.timeoutMs` has lapsed. The timeout interval can either be a finite value specified in milliseconds or an infinite value. In case an infinite value is specified the timeout never elapses. The windows INFINITE macro must be @@ -25553,8 +26024,8 @@ def cudaFuncSetCacheConfig(func, cacheConfig not None : cudaFuncCache): possible, but it is free to choose a different configuration if required to execute `func`. - `func` is a device function symbol and must be declared as a `None` - function. If the specified function does not exist, then + `func` is a device function symbol and must be declared as a + `__global__` function. If the specified function does not exist, then :py:obj:`~.cudaErrorInvalidDeviceFunction` is returned. For templated functions, pass the function symbol as follows: func_name @@ -25616,8 +26087,8 @@ def cudaFuncGetAttributes(func): This function obtains the attributes of a function specified via `func`. `func` is a device function symbol and must be declared as a - `None` function. The fetched attributes are placed in `attr`. If the - specified function does not exist, then it is assumed to be a + `__global__` function. The fetched attributes are placed in `attr`. If + the specified function does not exist, then it is assumed to be a :py:obj:`~.cudaKernel_t` and used as is. For templated functions, pass the function symbol as follows: func_name @@ -25662,11 +26133,11 @@ def cudaFuncSetAttribute(func, attr not None : cudaFuncAttribute, int value): This function sets the attributes of a function specified via `func`. The parameter `func` must be a pointer to a function that executes on the device. The parameter specified by `func` must be declared as a - `None` function. The enumeration defined by `attr` is set to the value - defined by `value`. If the specified function does not exist, then it - is assumed to be a :py:obj:`~.cudaKernel_t` and used as is. If the - specified attribute cannot be written, or if the value is incorrect, - then :py:obj:`~.cudaErrorInvalidValue` is returned. + `__global__` function. The enumeration defined by `attr` is set to the + value defined by `value`. If the specified function does not exist, + then it is assumed to be a :py:obj:`~.cudaKernel_t` and used as is. If + the specified attribute cannot be written, or if the value is + incorrect, then :py:obj:`~.cudaErrorInvalidValue` is returned. Valid values for `attr` are: @@ -25712,7 +26183,7 @@ def cudaFuncSetAttribute(func, attr not None : cudaFuncAttribute, int value): - :py:obj:`~.cudaFuncAttributeClusterSchedulingPolicyPreference`: The block scheduling policy of a function. The value type is - cudaClusterSchedulingPolicy. + :py:obj:`~.cudaClusterSchedulingPolicy`. cudaLaunchKernel (C++ API), cudaFuncSetCacheConfig (C++ API), :py:obj:`~.cudaFuncGetAttributes (C API)`, @@ -26526,7 +26997,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 is not 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: @@ -27191,7 +27662,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 is not 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: @@ -27317,7 +27788,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 is not 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: @@ -27452,7 +27923,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 is not 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 (_cudaError_t(err),) @@ -27489,7 +27960,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 is not 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 (_cudaError_t(err),) @@ -27594,7 +28065,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 is not 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 (_cudaError_t(err),) @@ -27634,7 +28105,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 is not 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 (_cudaError_t(err),) @@ -28681,33 +29152,33 @@ def cudaMemcpy3DBatchAsync(size_t numOps, opList : Optional[tuple[cudaMemcpy3DBa CUDA array. For CUDA array to CUDA array copies, the element size of the two CUDA arrays must match. - For a given operand, if :py:obj:`~.cudaMemcpy3DOperand`::type is + For a given operand, if :py:obj:`~.cudaMemcpy3DOperand.type` is specified as :py:obj:`~.cudaMemcpyOperandTypePointer`, then - :py:obj:`~.cudaMemcpy3DOperand`::op::ptr will be used. The - :py:obj:`~.cudaMemcpy3DOperand`::op::ptr::ptr field must contain the + :py:obj:`~.cudaMemcpy3DOperand.op.ptr` will be used. The + :py:obj:`~.cudaMemcpy3DOperand.op.ptr.ptr` field must contain the pointer where the copy should begin. The - :py:obj:`~.cudaMemcpy3DOperand`::op::ptr::rowLength field specifies the + :py:obj:`~.cudaMemcpy3DOperand.op.ptr.rowLength` field specifies the length of each row in elements and must either be zero or be greater than or equal to the width of the copy specified in - :py:obj:`~.cudaMemcpy3DBatchOp`::extent::width. The - :py:obj:`~.cudaMemcpy3DOperand`::op::ptr::layerHeight field specifies - the height of each layer and must either be zero or be greater than or + :py:obj:`~.cudaMemcpy3DBatchOp.extent.width`. The + :py:obj:`~.cudaMemcpy3DOperand.op.ptr.layerHeight` field specifies the + height of each layer and must either be zero or be greater than or equal to the height of the copy specified in - :py:obj:`~.cudaMemcpy3DBatchOp`::extent::height. When either of these + :py:obj:`~.cudaMemcpy3DBatchOp.extent.height`. When either of these values is zero, that aspect of the operand is considered to be tightly packed according to the copy extent. For managed memory pointers on devices where :py:obj:`~.cudaDevAttrConcurrentManagedAccess` is true or system-allocated pageable memory on devices where :py:obj:`~.cudaDevAttrPageableMemoryAccess` is true, the - :py:obj:`~.cudaMemcpy3DOperand`::op::ptr::locHint field can be used to + :py:obj:`~.cudaMemcpy3DOperand.op.ptr.locHint` field can be used to hint the location of the operand. If an operand's type is specified as :py:obj:`~.cudaMemcpyOperandTypeArray`, then - :py:obj:`~.cudaMemcpy3DOperand`::op::array will be used. The - :py:obj:`~.cudaMemcpy3DOperand`::op::array::array field specifies the - CUDA array and :py:obj:`~.cudaMemcpy3DOperand`::op::array::offset - specifies the 3D offset into that array where the copy begins. + :py:obj:`~.cudaMemcpy3DOperand.op.array` will be used. The + :py:obj:`~.cudaMemcpy3DOperand.op.array.array` field specifies the CUDA + array and :py:obj:`~.cudaMemcpy3DOperand.op.array.offset` specifies the + 3D offset into that array where the copy begins. The :py:obj:`~.cudaMemcpyAttributes.srcAccessOrder` indicates the source access ordering to be observed for copies associated with the @@ -28837,7 +29308,7 @@ def cudaMemcpyWithAttributesAsync(dst, src, size_t size, attr : Optional[cudaMem cdef void* cydst = _helper_input_void_ptr(dst, &cydstHelper) cdef _HelperInputVoidPtrStruct cysrcHelper cdef void* cysrc = _helper_input_void_ptr(src, &cysrcHelper) - cdef cyruntime.cudaMemcpyAttributes* cyattr_ptr = attr._pvt_ptr if attr is not None else NULL + cdef cyruntime.cudaMemcpyAttributes* cyattr_ptr = attr._pvt_ptr if attr is not None else NULL with nogil: err = cyruntime.cudaMemcpyWithAttributesAsync(cydst, cysrc, size, cyattr_ptr, cystream) _helper_input_void_ptr_free(&cydstHelper) @@ -28887,7 +29358,7 @@ def cudaMemcpy3DWithAttributesAsync(op : Optional[cudaMemcpy3DBatchOp], unsigned else: pstream = int(cudaStream_t(stream)) cystream = pstream - cdef cyruntime.cudaMemcpy3DBatchOp* cyop_ptr = op._pvt_ptr if op is not None else NULL + cdef cyruntime.cudaMemcpy3DBatchOp* cyop_ptr = op._pvt_ptr if op is not None else NULL with nogil: err = cyruntime.cudaMemcpy3DWithAttributesAsync(cyop_ptr, flags, cystream) return (_cudaError_t(err),) @@ -30949,11 +31420,11 @@ def cudaMemPoolGetAttribute(memPool, attr not None : cudaMemPoolAttr): pools: - :py:obj:`~.cudaMemPoolAttrAllocationType`: (value type = - cudaMemAllocationType) The allocation type of the mempool + :py:obj:`~.cudaMemAllocationType`) The allocation type of the mempool - :py:obj:`~.cudaMemPoolAttrExportHandleTypes`: (value type = - cudaMemAllocationHandleType) Available export handle types for the - mempool. For imported pools this value is always + :py:obj:`~.cudaMemAllocationHandleType`) Available export handle + types for the mempool. For imported pools this value is always cudaMemHandleTypeNone as an imported pool cannot be re-exported - :py:obj:`~.cudaMemPoolAttrLocationId`: (value type = int) The @@ -30961,10 +31432,10 @@ def cudaMemPoolGetAttribute(memPool, attr not None : cudaMemPoolAttr): cudaMemLocationTypeInvisible then ID will be cudaInvalidDeviceId. - :py:obj:`~.cudaMemPoolAttrLocationType`: (value type = - cudaMemLocationType) The location type for the mempool. For imported - memory pools where the device is not directly visible to the - importing process or pools imported via fabric handles across nodes - this will be cudaMemlocataionTypeInvisible. + :py:obj:`~.cudaMemLocationType`) The location type for the mempool. + For imported memory pools where the device is not directly visible to + the importing process or pools imported via fabric handles across + nodes this will be cudaMemlocataionTypeInvisible. - :py:obj:`~.cudaMemPoolAttrMaxPoolSize`: (value type = cuuint64_t) Maximum size of the pool in bytes, this value may be higher than what @@ -31101,7 +31572,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 is not 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: @@ -31121,20 +31592,20 @@ def cudaMemPoolCreate(poolProps : Optional[cudaMemPoolProps]): 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:`~.cudaMemPoolProps.cudaMemLocation.type` to :py:obj:`~.cudaMemLocationTypeHost`. - :py:obj:`~.cudaMemPoolProps`::cudaMemLocation::id is ignored for such + :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:`~.cudaMemPoolProps.cudaMemLocation.type` to :py:obj:`~.cudaMemLocationTypeHostNuma` and - :py:obj:`~.cudaMemPoolProps`::cudaMemLocation::id must specify the NUMA + :py:obj:`~.cudaMemPoolProps.cudaMemLocation.id` must specify the NUMA ID of the host memory node. Specifying :py:obj:`~.cudaMemLocationTypeHostNumaCurrent` as the - :py:obj:`~.cudaMemPoolProps`::cudaMemLocation::type will result in + :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` or @@ -31165,11 +31636,11 @@ def cudaMemPoolCreate(poolProps : Optional[cudaMemPoolProps]): /dev/nvidia-caps-imex-channels/channel0 c 0` To create a managed memory pool, applications must set - :py:obj:`~.cudaMemPoolProps`:cudaMemAllocationType to + :py:obj:`~.cudaMemPoolProps.py`:obj:`~.cudaMemAllocationType` to :py:obj:`~.cudaMemAllocationTypeManaged`. - :py:obj:`~.cudaMemPoolProps`::cudaMemAllocationHandleType must also be + :py:obj:`~.cudaMemPoolProps.cudaMemAllocationHandleType` must also be set to :py:obj:`~.cudaMemHandleTypeNone` since IPC is not supported. - For managed memory pools, :py:obj:`~.cudaMemPoolProps`::cudaMemLocation + For managed memory pools, :py:obj:`~.cudaMemPoolProps.cudaMemLocation` will be treated as the preferred location for all allocations created from the pool. An application can also set :py:obj:`~.cudaMemLocationTypeNone` to indicate no preferred location. @@ -31201,7 +31672,7 @@ def cudaMemPoolCreate(poolProps : Optional[cudaMemPoolProps]): Specifying :py:obj:`~.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 is not 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: @@ -31263,7 +31734,7 @@ def cudaMemGetDefaultMemPool(location : Optional[cudaMemLocation], typename not The memory location can be of one of :py:obj:`~.cudaMemLocationTypeDevice`, - :py:obj:`~.cudaMemLocationTypeHost` or + :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 @@ -31291,7 +31762,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 is not None else NULL + cdef cyruntime.cudaMemLocation* cylocation_ptr = location._pvt_ptr if location is not None else NULL cdef cyruntime.cudaMemAllocationType cytypename = int(typename) with nogil: err = cyruntime.cudaMemGetDefaultMemPool(memPool._pvt_ptr, cylocation_ptr, cytypename) @@ -31308,7 +31779,7 @@ def cudaMemGetMemPool(location : Optional[cudaMemLocation], typename not None : The memory location can be of one of :py:obj:`~.cudaMemLocationTypeDevice`, - :py:obj:`~.cudaMemLocationTypeHost` or + :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 @@ -31345,7 +31816,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 is not None else NULL + cdef cyruntime.cudaMemLocation* cylocation_ptr = location._pvt_ptr if location is not None else NULL cdef cyruntime.cudaMemAllocationType cytypename = int(typename) with nogil: err = cyruntime.cudaMemGetMemPool(memPool._pvt_ptr, cylocation_ptr, cytypename) @@ -31414,7 +31885,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 is not None else NULL + cdef cyruntime.cudaMemLocation* cylocation_ptr = location._pvt_ptr if location is not None else NULL cdef cyruntime.cudaMemAllocationType cytypename = int(typename) with nogil: err = cyruntime.cudaMemSetMemPool(cylocation_ptr, cytypename, cymemPool) @@ -31665,7 +32136,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 is not 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: @@ -32354,41 +32825,41 @@ def cudaCreateTextureObject(pResDesc : Optional[cudaResourceDesc], pTexDesc : Op If :py:obj:`~.cudaResourceDesc.resType` is set to :py:obj:`~.cudaResourceTypeArray`, - :py:obj:`~.cudaResourceDesc`::res::array::array must be set to a valid + :py:obj:`~.cudaResourceDesc.res.array.array` must be set to a valid CUDA array handle. If :py:obj:`~.cudaResourceDesc.resType` is set to :py:obj:`~.cudaResourceTypeMipmappedArray`, - :py:obj:`~.cudaResourceDesc`::res::mipmap::mipmap must be set to a - valid CUDA mipmapped array handle and + :py:obj:`~.cudaResourceDesc.res.mipmap.mipmap` must be set to a valid + CUDA mipmapped array handle and :py:obj:`~.cudaTextureDesc.normalizedCoords` must be set to true. If :py:obj:`~.cudaResourceDesc.resType` is set to :py:obj:`~.cudaResourceTypeLinear`, - :py:obj:`~.cudaResourceDesc`::res::linear::devPtr must be set to a - valid device pointer, that is aligned to + :py:obj:`~.cudaResourceDesc.res.linear.devPtr` must be set to a valid + device pointer, that is aligned to :py:obj:`~.cudaDeviceProp.textureAlignment`. - :py:obj:`~.cudaResourceDesc`::res::linear::desc describes the format - and the number of components per array element. - :py:obj:`~.cudaResourceDesc`::res::linear::sizeInBytes specifies the - size of the array in bytes. The total number of elements in the linear + :py:obj:`~.cudaResourceDesc.res.linear.desc` describes the format and + the number of components per array element. + :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:`~.cudaDeviceGetTexture1DLinearMaxWidth()`. The number of elements is computed as (sizeInBytes / sizeof(desc)). If :py:obj:`~.cudaResourceDesc.resType` is set to :py:obj:`~.cudaResourceTypePitch2D`, - :py:obj:`~.cudaResourceDesc`::res::pitch2D::devPtr must be set to a - valid device pointer, that is aligned to + :py:obj:`~.cudaResourceDesc.res.pitch2D.devPtr` must be set to a valid + device pointer, that is aligned to :py:obj:`~.cudaDeviceProp.textureAlignment`. - :py:obj:`~.cudaResourceDesc`::res::pitch2D::desc describes the format - and the number of components per array element. - :py:obj:`~.cudaResourceDesc`::res::pitch2D::width and - :py:obj:`~.cudaResourceDesc`::res::pitch2D::height specify the width - and height of the array in elements, and cannot exceed + :py:obj:`~.cudaResourceDesc.res.pitch2D.desc` describes the format and + the number of components per array element. + :py:obj:`~.cudaResourceDesc.res.pitch2D.width` and + :py:obj:`~.cudaResourceDesc.res.pitch2D.height` specify the width and + height of the array in elements, and cannot exceed :py:obj:`~.cudaDeviceProp.maxTexture2DLinear`[0] and :py:obj:`~.cudaDeviceProp.maxTexture2DLinear`[1] respectively. - :py:obj:`~.cudaResourceDesc`::res::pitch2D::pitchInBytes specifies the + :py:obj:`~.cudaResourceDesc.res.pitch2D.pitchInBytes` specifies the pitch between two rows in bytes and has to be aligned to :py:obj:`~.cudaDeviceProp.texturePitchAlignment`. Pitch cannot exceed :py:obj:`~.cudaDeviceProp.maxTexture2DLinear`[2]. @@ -32557,9 +33028,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 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 + 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: @@ -32736,7 +33207,7 @@ def cudaCreateSurfaceObject(pResDesc : Optional[cudaResourceDesc]): describes the data to perform surface load/stores on. :py:obj:`~.cudaResourceDesc.resType` must be :py:obj:`~.cudaResourceTypeArray` and - :py:obj:`~.cudaResourceDesc`::res::array::array must be set to a valid + :py:obj:`~.cudaResourceDesc.res.array.array` must be set to a valid CUDA array handle. Surface objects are only supported on devices of compute capability 3.0 @@ -32760,7 +33231,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 is not 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: @@ -33252,7 +33723,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 is not 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: @@ -33343,7 +33814,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 is not 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 (_cudaError_t(err),) @@ -33476,7 +33947,7 @@ def cudaGraphKernelNodeSetAttribute(hNode, attr not None : cudaKernelNodeAttrID, phNode = int(cudaGraphNode_t(hNode)) cyhNode = phNode cdef cyruntime.cudaKernelNodeAttrID cyattr = int(attr) - cdef cyruntime.cudaKernelNodeAttrValue* cyvalue_ptr = value._pvt_ptr if value is not 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 (_cudaError_t(err),) @@ -33548,7 +34019,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 is not 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: @@ -33727,7 +34198,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 is not 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 (_cudaError_t(err),) @@ -33857,7 +34328,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 is not 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: @@ -33939,7 +34410,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 is not 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 (_cudaError_t(err),) @@ -34006,7 +34477,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 is not 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: @@ -34088,7 +34559,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 is not 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 (_cudaError_t(err),) @@ -34686,7 +35157,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 is not 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: @@ -34775,7 +35246,7 @@ def cudaGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams : Optional[ else: phNode = int(cudaGraphNode_t(hNode)) cyhNode = phNode - cdef cyruntime.cudaExternalSemaphoreSignalNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not 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 (_cudaError_t(err),) @@ -34843,7 +35314,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 is not 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: @@ -34932,7 +35403,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 is not 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 (_cudaError_t(err),) @@ -35039,7 +35510,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 is not 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: @@ -35747,7 +36218,9 @@ def cudaGraphGetNodes(graph, size_t numNodes = 0): with nogil: err = cyruntime.cudaGraphGetNodes(cygraph, cynodes, &numNodes) if cudaError_t(err) == cudaError_t(0): - pynodes = [cudaGraphNode_t(init_value=cynodes[idx]) for idx in range(_graph_length)] + pynodes = [cudaGraphNode_t() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pynodes[idx])._pvt_ptr[0] = cynodes[idx] if cynodes is not NULL: free(cynodes) if err != cyruntime.cudaSuccess: @@ -35806,7 +36279,9 @@ def cudaGraphGetRootNodes(graph, size_t pNumRootNodes = 0): with nogil: err = cyruntime.cudaGraphGetRootNodes(cygraph, cypRootNodes, &pNumRootNodes) if cudaError_t(err) == cudaError_t(0): - pypRootNodes = [cudaGraphNode_t(init_value=cypRootNodes[idx]) for idx in range(_graph_length)] + pypRootNodes = [cudaGraphNode_t() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pypRootNodes[idx])._pvt_ptr[0] = cypRootNodes[idx] if cypRootNodes is not NULL: free(cypRootNodes) if err != cyruntime.cudaSuccess: @@ -35888,15 +36363,21 @@ def cudaGraphGetEdges(graph, size_t numEdges = 0): with nogil: 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)] + pyfrom_ = [cudaGraphNode_t() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyfrom_[idx])._pvt_ptr[0] = cyfrom_[idx] 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)] + pyto = [cudaGraphNode_t() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyto[idx])._pvt_ptr[0] = cyto[idx] if cyto is not NULL: free(cyto) if cudaError_t(err) == cudaError_t(0): - pyedgeData = [cudaGraphEdgeData(_ptr=&cyedgeData[idx]) for idx in range(_graph_length)] + pyedgeData = [cudaGraphEdgeData() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyedgeData[idx])._pvt_ptr[0] = cyedgeData[idx] if cyedgeData is not NULL: free(cyedgeData) if err != cyruntime.cudaSuccess: @@ -35969,11 +36450,15 @@ def cudaGraphNodeGetDependencies(node, size_t pNumDependencies = 0): with nogil: 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)] + pypDependencies = [cudaGraphNode_t() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pypDependencies[idx])._pvt_ptr[0] = cypDependencies[idx] if cypDependencies is not NULL: free(cypDependencies) if cudaError_t(err) == cudaError_t(0): - pyedgeData = [cudaGraphEdgeData(_ptr=&cyedgeData[idx]) for idx in range(_graph_length)] + pyedgeData = [cudaGraphEdgeData() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyedgeData[idx])._pvt_ptr[0] = cyedgeData[idx] if cyedgeData is not NULL: free(cyedgeData) if err != cyruntime.cudaSuccess: @@ -36046,11 +36531,15 @@ def cudaGraphNodeGetDependentNodes(node, size_t pNumDependentNodes = 0): with nogil: 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)] + pypDependentNodes = [cudaGraphNode_t() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pypDependentNodes[idx])._pvt_ptr[0] = cypDependentNodes[idx] if cypDependentNodes is not NULL: free(cypDependentNodes) if cudaError_t(err) == cudaError_t(0): - pyedgeData = [cudaGraphEdgeData(_ptr=&cyedgeData[idx]) for idx in range(_graph_length)] + pyedgeData = [cudaGraphEdgeData() for _ in range(_graph_length)] + for idx in range(_graph_length): + (pyedgeData[idx])._pvt_ptr[0] = cyedgeData[idx] if cyedgeData is not NULL: free(cyedgeData) if err != cyruntime.cudaSuccess: @@ -36635,7 +37124,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 is not 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: @@ -36762,7 +37251,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 is not 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 (_cudaError_t(err),) @@ -36827,7 +37316,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 is not 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 (_cudaError_t(err),) @@ -36972,7 +37461,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 is not 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 (_cudaError_t(err),) @@ -37027,7 +37516,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 is not 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 (_cudaError_t(err),) @@ -37283,7 +37772,7 @@ def cudaGraphExecExternalSemaphoresSignalNodeSetParams(hGraphExec, hNode, nodePa else: phGraphExec = int(cudaGraphExec_t(hGraphExec)) cyhGraphExec = phGraphExec - cdef cyruntime.cudaExternalSemaphoreSignalNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not 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 (_cudaError_t(err),) @@ -37343,7 +37832,7 @@ def cudaGraphExecExternalSemaphoresWaitNodeSetParams(hGraphExec, hNode, nodePara else: phGraphExec = int(cudaGraphExec_t(hGraphExec)) cyhGraphExec = phGraphExec - cdef cyruntime.cudaExternalSemaphoreWaitNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not 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 (_cudaError_t(err),) @@ -37839,8 +38328,8 @@ def cudaGraphDebugDotPrint(graph, char* path, unsigned int flags): path : bytes The path to write the DOT file to flags : unsigned int - Flags from cudaGraphDebugDotFlags for specifying which additional - node information to write + Flags from :py:obj:`~.cudaGraphDebugDotFlags` for specifying which + additional node information to write Returns ------- @@ -38201,7 +38690,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 is not 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: @@ -38251,7 +38740,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 is not 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 (_cudaError_t(err),) @@ -38364,7 +38853,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 is not 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 (_cudaError_t(err),) @@ -39285,7 +39774,7 @@ def cudaKernelSetAttributeForDevice(kernel, attr not None : cudaFuncAttribute, i - :py:obj:`~.cudaFuncAttributeClusterSchedulingPolicyPreference`: The block scheduling policy of a function. The value type is - cudaClusterSchedulingPolicy. + :py:obj:`~.cudaClusterSchedulingPolicy`. Parameters ---------- @@ -39349,7 +39838,7 @@ def cudaDeviceGetDevResource(int device, typename not None : cudaDevResourceType cudaError_t :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorNotPermitted`, :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorInvalidResourceType`, :py:obj:`~.cudaErrorNotSupported`, :py:obj:`~.cudaErrorCudartUnloading`, :py:obj:`~.cudaErrorInitializationError` resource : :py:obj:`~.cudaDevResource` - Output pointer to a cudaDevResource structure + Output pointer to a :py:obj:`~.cudaDevResource` structure See Also -------- @@ -39436,7 +39925,8 @@ def cudaDevSmResourceSplitByCount(unsigned int nbGroups, input_ : Optional[cudaD This is a pointer, specifying the number of groups that would be or should be created as described below. input : :py:obj:`~.cudaDevResource` - Input SM resource to be split. Must be a valid `None` resource. + Input SM resource to be split. Must be a valid `cudaDevSmResource` + resource. flags : unsigned int Flags specifying how these partitions are used or which constraints to abide by when splitting the input. Zero is valid for default @@ -39470,7 +39960,7 @@ def cudaDevSmResourceSplitByCount(unsigned int nbGroups, input_ : Optional[cudaD if cyresult is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(nbGroups) + 'x' + str(sizeof(cyruntime.cudaDevResource))) cdef unsigned int cynbGroups = nbGroups - cdef cyruntime.cudaDevResource* cyinput__ptr = input_._pvt_ptr if input_ is not None else NULL + cdef cyruntime.cudaDevResource* cyinput__ptr = input_._pvt_ptr if input_ is not None else NULL cdef cudaDevResource remaining = cudaDevResource() with nogil: err = cyruntime.cudaDevSmResourceSplitByCount(cyresult, &cynbGroups, cyinput__ptr, remaining._pvt_ptr, flags, minCount) @@ -39632,7 +40122,7 @@ def cudaDevSmResourceSplit(unsigned int nbGroups, input_ : Optional[cudaDevResou cyresult = calloc(nbGroups, sizeof(cyruntime.cudaDevResource)) if cyresult is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(nbGroups) + 'x' + str(sizeof(cyruntime.cudaDevResource))) - cdef cyruntime.cudaDevResource* cyinput__ptr = input_._pvt_ptr if input_ is not None else NULL + cdef cyruntime.cudaDevResource* cyinput__ptr = input_._pvt_ptr if input_ is not None else NULL cdef cudaDevResource remainder = cudaDevResource() cdef cyruntime.cudaDevSmResourceGroupParams* cygroupParams = NULL if len(groupParams) > 1: @@ -39869,7 +40359,7 @@ def cudaExecutionCtxGetDevResource(ctx, typename not None : cudaDevResourceType) cudaError_t :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorNotSupported`, :py:obj:`~.cudaErrorNotPermitted`, :py:obj:`~.cudaErrorCudartUnloading`, :py:obj:`~.cudaErrorInitializationError` resource : :py:obj:`~.cudaDevResource` - Output pointer to a cudaDevResource structure + Output pointer to a :py:obj:`~.cudaDevResource` structure See Also -------- @@ -40119,7 +40609,7 @@ def cudaStreamGetDevResource(hStream, typename not None : cudaDevResourceType): cudaError_t :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorCudartUnloading`, :py:obj:`~.cudaErrorInitializationError`, :py:obj:`~.cudaErrorDeviceUninitialized`, :py:obj:`~.cudaErrorInvalidResourceType`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidHandle`, :py:obj:`~.cudaErrorNotPermitted`, :py:obj:`~.cudaErrorCallRequiresNewerDriver`, resource : :py:obj:`~.cudaDevResource` - Output pointer to a cudaDevResource structure + Output pointer to a :py:obj:`~.cudaDevResource` structure See Also -------- @@ -40267,8 +40757,9 @@ def cudaDeviceGetExecutionCtx(int device): Returns in `ctx` the execution context for the specified device. This is the device's primary context. The returned context can then be - passed to APIs that take in a cudaExecutionContext_t enabling explicit - context-based programming without relying on thread-local state. + passed to APIs that take in a :py:obj:`~.cudaExecutionContext_t` + enabling explicit context-based programming without relying on thread- + local state. Passing the returned execution context to :py:obj:`~.cudaExecutionCtxDestroy()` is not allowed and will result in @@ -40304,7 +40795,7 @@ def cudaDeviceGetExecutionCtx(int device): def cudaGetExportTable(pExportTableId : Optional[cudaUUID_t]): """""" cdef void_ptr ppExportTable = 0 - cdef cyruntime.cudaUUID_t* cypExportTableId_ptr = pExportTableId._pvt_ptr if pExportTableId is not 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: @@ -41009,7 +41500,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 is not 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 (_cudaError_t(err),) @@ -42016,6 +42507,12 @@ def sizeof(objType): {{if 'cudaStreamCallback_t' in found_types}} if objType == cudaStreamCallback_t: return sizeof(cyruntime.cudaStreamCallback_t){{endif}} + {{if 'cudaGraphRecaptureCallback_t' in found_types}} + if objType == cudaGraphRecaptureCallback_t: + return sizeof(cyruntime.cudaGraphRecaptureCallback_t){{endif}} + {{if 'cudaGraphRecaptureCallbackData' in found_struct}} + if objType == cudaGraphRecaptureCallbackData: + return sizeof(cyruntime.cudaGraphRecaptureCallbackData){{endif}} {{if 'cudaLogsCallback_t' in found_types}} if objType == cudaLogsCallback_t: return sizeof(cyruntime.cudaLogsCallback_t){{endif}} diff --git a/cuda_bindings/cuda/bindings/utils/__init__.py b/cuda_bindings/cuda/bindings/utils/__init__.py index e4fcb15e8fd..0bfff4b78be 100644 --- a/cuda_bindings/cuda/bindings/utils/__init__.py +++ b/cuda_bindings/cuda/bindings/utils/__init__.py @@ -1,7 +1,8 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 from typing import Any, Callable +from ._nvvm_utils import check_nvvm_compiler_options from ._ptx_utils import get_minimal_required_cuda_ver_from_ptx_ver, get_ptx_ver from ._version_check import warn_if_cuda_major_version_mismatch diff --git a/cuda_bindings/cuda/bindings/utils/_nvvm_utils.py b/cuda_bindings/cuda/bindings/utils/_nvvm_utils.py new file mode 100644 index 00000000000..9ac37c3a236 --- /dev/null +++ b/cuda_bindings/cuda/bindings/utils/_nvvm_utils.py @@ -0,0 +1,89 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from typing import Sequence + +_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}}} +""" + + +def check_nvvm_compiler_options(options: Sequence[str]) -> bool: + """ + Abstracted from https://github.com/NVIDIA/numba-cuda/pull/681 + + Check if the specified options are supported by the current libNVVM version. + + The options are a list of strings, each representing a compiler option. + + If the test program fails to compile, the options are not supported and False + is returned. + + If the test program compiles successfully, True is returned. + + cuda.bindings.nvvm returns exceptions instead of return codes. + + Parameters + ---------- + options : Sequence[str] + List of compiler options as strings (e.g., ["-arch=compute_90", "-g"]). + + Returns + ------- + bool + True if the options are supported, False otherwise. + + Examples + -------- + >>> from cuda.bindings.utils import check_nvvm_compiler_options + >>> check_nvvm_compiler_options(["-arch=compute_90", "-g"]) + True + """ + try: + from cuda.bindings import nvvm + except ModuleNotFoundError as exc: + if exc.name == "nvvm": + return False + raise + + from cuda.bindings._internal.nvvm import _inspect_function_pointer + + if _inspect_function_pointer("__nvvmCreateProgram") == 0: + return False + + program = nvvm.create_program() + try: + major, minor, debug_major, debug_minor = nvvm.ir_version() + precheck_ir = _PRECHECK_NVVM_IR.format( + major=major, + minor=minor, + debug_major=debug_major, + debug_minor=debug_minor, + ) + precheck_ir_bytes = precheck_ir.encode("utf-8") + nvvm.add_module_to_program( + program, + precheck_ir_bytes, + len(precheck_ir_bytes), + "precheck.ll", + ) + try: + nvvm.compile_program(program, len(options), options) + except nvvm.nvvmError as e: + if e.status == nvvm.Result.ERROR_INVALID_OPTION: + return False + raise + finally: + nvvm.destroy_program(program) + return True diff --git a/cuda_bindings/cuda/bindings/utils/_ptx_utils.py b/cuda_bindings/cuda/bindings/utils/_ptx_utils.py index b9df6503120..1395fdfd469 100644 --- a/cuda_bindings/cuda/bindings/utils/_ptx_utils.py +++ b/cuda_bindings/cuda/bindings/utils/_ptx_utils.py @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 import re @@ -50,6 +50,7 @@ "9.0": (13, 0), "9.1": (13, 1), "9.2": (13, 2), + "9.3": (13, 3), } diff --git a/cuda_bindings/cuda/bindings/utils/_version_check.py b/cuda_bindings/cuda/bindings/utils/_version_check.py index 1ebd7f3d924..5c68b50152e 100644 --- a/cuda_bindings/cuda/bindings/utils/_version_check.py +++ b/cuda_bindings/cuda/bindings/utils/_version_check.py @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 import os import threading diff --git a/cuda_bindings/docs/Makefile b/cuda_bindings/docs/Makefile index 4ceed350782..5d861d28088 100644 --- a/cuda_bindings/docs/Makefile +++ b/cuda_bindings/docs/Makefile @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 # Minimal makefile for Sphinx documentation # diff --git a/cuda_bindings/docs/build_docs.sh b/cuda_bindings/docs/build_docs.sh index c4e959fd752..199ababce60 100755 --- a/cuda_bindings/docs/build_docs.sh +++ b/cuda_bindings/docs/build_docs.sh @@ -1,7 +1,7 @@ #!/bin/bash -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 set -ex @@ -25,8 +25,17 @@ if [[ -z "${SPHINX_CUDA_BINDINGS_VER}" ]]; then | awk -F'+' '{print $1}') fi +if [[ "${LATEST_ONLY}" == "1" && -z "${BUILD_PREVIEW:-}" && -z "${BUILD_LATEST:-}" ]]; then + export BUILD_LATEST=1 +fi + # build the docs (in parallel) -SPHINXOPTS="-j 4 -d build/.doctrees" make html +if [[ -z "${SPHINXOPTS:-}" ]]; then + HTML_SPHINXOPTS="-j 4 -d build/.doctrees" +else + HTML_SPHINXOPTS="${SPHINXOPTS}" +fi +SPHINXOPTS="${HTML_SPHINXOPTS}" 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 diff --git a/cuda_bindings/docs/make.bat b/cuda_bindings/docs/make.bat index b3c642f84f2..85f34efee44 100644 --- a/cuda_bindings/docs/make.bat +++ b/cuda_bindings/docs/make.bat @@ -1,7 +1,7 @@ @ECHO OFF -REM SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -REM SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +REM SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +REM SPDX-License-Identifier: Apache-2.0 pushd %~dp0 diff --git a/cuda_bindings/docs/nv-versions.json b/cuda_bindings/docs/nv-versions.json index 3b37062e6f5..f5795e15f66 100644 --- a/cuda_bindings/docs/nv-versions.json +++ b/cuda_bindings/docs/nv-versions.json @@ -3,6 +3,18 @@ "version": "latest", "url": "https://nvidia.github.io/cuda-python/cuda-bindings/latest/" }, + { + "version": "13.3.1", + "url": "https://nvidia.github.io/cuda-python/cuda-bindings/13.3.1/" + }, + { + "version": "13.3.0", + "url": "https://nvidia.github.io/cuda-python/cuda-bindings/13.3.0/" + }, + { + "version": "13.2.0", + "url": "https://nvidia.github.io/cuda-python/cuda-bindings/13.2.0/" + }, { "version": "13.1.1", "url": "https://nvidia.github.io/cuda-python/cuda-bindings/13.1.1/" @@ -27,6 +39,34 @@ "version": "13.0.0", "url": "https://nvidia.github.io/cuda-python/cuda-bindings/13.0.0/" }, + { + "version": "12.9.7", + "url": "https://nvidia.github.io/cuda-python/cuda-bindings/12.9.7/" + }, + { + "version": "12.9.6", + "url": "https://nvidia.github.io/cuda-python/cuda-bindings/12.9.6/" + }, + { + "version": "12.9.5", + "url": "https://nvidia.github.io/cuda-python/cuda-bindings/12.9.5/" + }, + { + "version": "12.9.4", + "url": "https://nvidia.github.io/cuda-python/cuda-bindings/12.9.4/" + }, + { + "version": "12.9.3", + "url": "https://nvidia.github.io/cuda-python/cuda-bindings/12.9.3/" + }, + { + "version": "12.9.2", + "url": "https://nvidia.github.io/cuda-python/cuda-bindings/12.9.2/" + }, + { + "version": "12.9.1", + "url": "https://nvidia.github.io/cuda-python/cuda-bindings/12.9.1/" + }, { "version": "12.9.0", "url": "https://nvidia.github.io/cuda-python/cuda-bindings/12.9.0/" diff --git a/cuda_bindings/docs/source/api.rst b/cuda_bindings/docs/source/api.rst index e6ee4b99ddd..c3de98f24d9 100644 --- a/cuda_bindings/docs/source/api.rst +++ b/cuda_bindings/docs/source/api.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 ------------------------- CUDA Python API Reference @@ -15,5 +15,7 @@ CUDA Python API Reference module/nvjitlink module/nvvm module/nvfatbin + module/cudla module/cufile + module/nvml module/utils diff --git a/cuda_bindings/docs/source/conduct.rst b/cuda_bindings/docs/source/conduct.rst index b70d9dd7ce3..8983e183956 100644 --- a/cuda_bindings/docs/source/conduct.rst +++ b/cuda_bindings/docs/source/conduct.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 Code of Conduct =============== @@ -85,7 +85,7 @@ Attribution ----------- 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 +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct/ For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq diff --git a/cuda_bindings/docs/source/conf.py b/cuda_bindings/docs/source/conf.py index 062c49db9a2..8a7e15d1be0 100644 --- a/cuda_bindings/docs/source/conf.py +++ b/cuda_bindings/docs/source/conf.py @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: Copyright (c) 2012-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2012-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 # Configuration file for the Sphinx documentation builder. # @@ -19,13 +19,33 @@ # -- Project information ----------------------------------------------------- project = "cuda.bindings" -copyright = "2021-2025, NVIDIA" +copyright = "2021-2026, NVIDIA" author = "NVIDIA" # The full version, including alpha/beta/rc tags release = os.environ["SPHINX_CUDA_BINDINGS_VER"] +def _github_examples_ref(): + if ref := os.environ.get("CUDA_PYTHON_DOCS_GITHUB_REF"): + return ref + if int(os.environ.get("BUILD_PREVIEW", 0)) or int(os.environ.get("BUILD_LATEST", 0)): + return "main" + return f"v{release}" + + +GITHUB_EXAMPLES_REF = _github_examples_ref() + + +def _html_baseurl(): + docs_domain = os.environ.get("CUDA_PYTHON_DOCS_DOMAIN", "https://nvidia.github.io/cuda-python") + if int(os.environ.get("BUILD_PREVIEW", 0)): + return f"{docs_domain}/pr-preview/pr-{os.environ['PR_NUMBER']}/cuda-bindings/latest/" + if int(os.environ.get("BUILD_LATEST", 0)): + return f"{docs_domain}/cuda-bindings/latest/" + return f"{docs_domain}/cuda-bindings/{release}/" + + # -- General configuration --------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be @@ -34,13 +54,14 @@ extensions = [ "sphinx.ext.autodoc", "sphinx.ext.autosummary", + "sphinx.ext.extlinks", "sphinx.ext.napoleon", "sphinx.ext.intersphinx", "myst_nb", - "enum_tools.autoenum", "sphinx_copybutton", "release_toc", "release_date", + "enum_documenter", ] nb_execution_mode = "off" @@ -64,7 +85,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_baseurl = "docs" +html_baseurl = _html_baseurl() html_theme = "nvidia_sphinx_theme" html_theme_options = { "switcher": { @@ -94,11 +115,22 @@ # 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"] +html_static_path = [] # ["_static"] does not exist in our environment # skip cmdline prompts copybutton_exclude = ".linenos, .gp" +extlinks = { + "cuda-bindings-example": ( + f"https://github.com/NVIDIA/cuda-python/blob/{GITHUB_EXAMPLES_REF}/cuda_bindings/examples/%s", + "%s", + ), + "cuda-bindings-examples": ( + f"https://github.com/NVIDIA/cuda-python/tree/{GITHUB_EXAMPLES_REF}/cuda_bindings/examples%s", + "%s", + ), +} + intersphinx_mapping = { "python": ("https://docs.python.org/3/", None), "numpy": ("https://numpy.org/doc/stable/", None), @@ -107,7 +139,17 @@ "cufile": ("https://docs.nvidia.com/gpudirect-storage/api-reference-guide/", None), } + +def rewrite_source(app, docname, source): + if docname.startswith("release/"): + source[0] = source[0].replace(".. module:: cuda.bindings\n\n", "", 1) + + suppress_warnings = [ # for warnings about multiple possible targets, see NVIDIA/cuda-python#152 "ref.python", ] + + +def setup(app): + app.connect("source-read", rewrite_source) diff --git a/cuda_bindings/docs/source/contribute.rst b/cuda_bindings/docs/source/contribute.rst index 20c7f51bc9b..f2a4fc9c53d 100644 --- a/cuda_bindings/docs/source/contribute.rst +++ b/cuda_bindings/docs/source/contribute.rst @@ -1,15 +1,27 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 Contributing ============ -Thank you for your interest in contributing to ``cuda-bindings``! Based on the type of contribution, it will fall into two categories: +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. +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 issue, triage it, and schedule it 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. + + Before starting work on an existing issue, comment on the issue to express + your interest and wait to be assigned by a maintainer. This helps avoid + redundant effort. + + Follow the repository `contribution guide + `_, including + signing off each commit under the Developer Certificate of Origin (DCO) and + cryptographically signing commits. diff --git a/cuda_bindings/docs/source/environment_variables.rst b/cuda_bindings/docs/source/environment_variables.rst index 7a49fb66a3f..4eba9e93047 100644 --- a/cuda_bindings/docs/source/environment_variables.rst +++ b/cuda_bindings/docs/source/environment_variables.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 Environment Variables ===================== @@ -15,7 +15,14 @@ Runtime Environment Variables Build-Time Environment Variables -------------------------------- -- ``CUDA_HOME`` or ``CUDA_PATH``: Specifies the location of the CUDA Toolkit. +- ``CUDA_PATH`` or ``CUDA_HOME``: Specifies the location of the CUDA Toolkit. If both are set, ``CUDA_PATH`` takes precedence. + + .. note:: + The ``CUDA_PATH`` > ``CUDA_HOME`` priority is determined by ``cuda-pathfinder``. + Earlier versions of ``cuda-pathfinder`` (before 1.5.0) used the opposite order + (``CUDA_HOME`` > ``CUDA_PATH``). See the + `cuda-pathfinder 1.5.0 release notes `_ + for details and migration guidance. - ``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. diff --git a/cuda_bindings/docs/source/examples.rst b/cuda_bindings/docs/source/examples.rst new file mode 100644 index 00000000000..911c27a099a --- /dev/null +++ b/cuda_bindings/docs/source/examples.rst @@ -0,0 +1,65 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +Examples +======== + +This page links to the ``cuda.bindings`` examples shipped in the +:cuda-bindings-examples:`cuda-python repository `. +Use it as a quick index when you want a runnable sample for a specific API area +or CUDA feature. + +Introduction +------------ + +- :cuda-bindings-example:`clock_nvrtc.py <0_Introduction/clock_nvrtc.py>` + uses NVRTC-compiled CUDA code and the device clock to time a reduction + kernel. +- :cuda-bindings-example:`simple_cubemap_texture.py <0_Introduction/simple_cubemap_texture.py>` + demonstrates cubemap texture sampling and transformation. +- :cuda-bindings-example:`simple_p2p.py <0_Introduction/simple_p2p.py>` + shows peer-to-peer memory access and transfers between multiple GPUs. +- :cuda-bindings-example:`simple_zero_copy.py <0_Introduction/simple_zero_copy.py>` + uses zero-copy mapped host memory for vector addition. +- :cuda-bindings-example:`system_wide_atomics.py <0_Introduction/system_wide_atomics.py>` + demonstrates system-wide atomic operations on managed memory. +- :cuda-bindings-example:`vector_add_drv.py <0_Introduction/vector_add_drv.py>` + uses the CUDA Driver API and unified virtual addressing for vector addition. +- :cuda-bindings-example:`vector_add_mmap.py <0_Introduction/vector_add_mmap.py>` + uses virtual memory management APIs such as ``cuMemCreate`` and + ``cuMemMap`` for vector addition. + +Concepts and techniques +----------------------- + +- :cuda-bindings-example:`stream_ordered_allocation.py <2_Concepts_and_Techniques/stream_ordered_allocation.py>` + demonstrates ``cudaMallocAsync`` and ``cudaFreeAsync`` together with + memory-pool release thresholds. + +CUDA features +------------- + +- :cuda-bindings-example:`global_to_shmem_async_copy.py <3_CUDA_Features/global_to_shmem_async_copy.py>` + compares asynchronous global-to-shared-memory copy strategies in matrix + multiplication kernels. +- :cuda-bindings-example:`simple_cuda_graphs.py <3_CUDA_Features/simple_cuda_graphs.py>` + shows both manual CUDA graph construction and stream-capture-based replay. + +Libraries and tools +------------------- + +- :cuda-bindings-example:`conjugate_gradient_multi_block_cg.py <4_CUDA_Libraries/conjugate_gradient_multi_block_cg.py>` + implements a conjugate-gradient solver with cooperative groups and + multi-block synchronization. +- :cuda-bindings-example:`nvidia_smi.py <4_CUDA_Libraries/nvidia_smi.py>` + uses NVML to implement a Python subset of ``nvidia-smi``. + +Advanced and interoperability +----------------------------- + +- :cuda-bindings-example:`iso_fd_modelling.py ` + runs isotropic finite-difference wave propagation across multiple GPUs with + peer-to-peer halo exchange. +- :cuda-bindings-example:`jit_program.py ` + JIT-compiles a SAXPY kernel with NVRTC and launches it through the Driver + API. diff --git a/cuda_bindings/docs/source/index.rst b/cuda_bindings/docs/source/index.rst index 3501b26a5c2..20642f2cdc5 100644 --- a/cuda_bindings/docs/source/index.rst +++ b/cuda_bindings/docs/source/index.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 ``cuda.bindings``: Low-level Python Bindings for CUDA ===================================================== @@ -11,6 +11,7 @@ release install overview + examples motivation environment_variables api diff --git a/cuda_bindings/docs/source/install.rst b/cuda_bindings/docs/source/install.rst index 58a6a0f31c3..7f890365ea3 100644 --- a/cuda_bindings/docs/source/install.rst +++ b/cuda_bindings/docs/source/install.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 Installation ============ @@ -12,7 +12,7 @@ Runtime Requirements * Linux (x86-64, arm64) and Windows (x86-64) * Python 3.10 - 3.14 * Driver: Linux (580.65.06 or later) Windows (580.88 or later) -* Optionally, NVRTC, nvJitLink, NVVM, and cuFile from CUDA Toolkit 13.x +* Optionally, NVRTC, nvJitLink, nvFatBin, NVVM, cuFile, and cuDLA from CUDA Toolkit 13.x .. note:: @@ -52,10 +52,12 @@ Where the optional dependencies include: * ``nvidia-cuda-nvrtc`` (NVRTC runtime compilation library) * ``nvidia-nvjitlink`` (nvJitLink library) +* ``nvidia-nvfatbin`` (nvFatBin library) * ``nvidia-nvvm`` (NVVM library) * ``nvidia-cufile`` (cuFile library, Linux only) +* ``nvidia-cudla`` (cuDLA library, Linux aarch64 only) -These are now installed through the ``cuda-toolkit`` metapackage for improved dependency resolution. +These are now installed through the ``cuda-toolkit`` metapackage, where available, for improved dependency resolution. Installing from Conda --------------------- @@ -74,8 +76,44 @@ For example: $ conda install -c conda-forge cuda-python cuda-version=13 +.. note:: + + Tegra users can install the cuDLA conda package from conda-forge through ``conda install -c conda-forge libcudla cuda-version=13``, if it does not already exist on the system. + +Development environment +----------------------- + +The sections above cover end-user installation. The section below focuses on +a repeatable *development* workflow (editable installs and running tests). + +Installing the latest nightly (top-of-tree builds) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +These are useful for users looking to test new features or bug fixes prior to +their inclusion in a release. + +CI publishes wheels as GitHub Actions artifacts on every push to ``main``. To +obtain the most recent build, use the following commands: + +.. code-block:: console + + $ # Find the latest successful CI run on main: + $ RUN_ID=$(gh run list -R NVIDIA/cuda-python -w ci.yml -b main -s success -L1 --json databaseId -q '.[0].databaseId') + + $ # Download the wheel (pick your Python version and platform): + $ gh run download "$RUN_ID" -R NVIDIA/cuda-python -p "cuda-bindings-python312-cuda13*-linux-64-*" + + $ # Install the downloaded wheel: + $ pip install cuda-bindings-python312-cuda13*-linux-64-*/cuda_bindings*.whl[all] + +Replace ``python312`` with your Python version (e.g. ``python310``, ``python311``, +``python313``, ``python314``, ``python314t``). For aarch64, replace ``linux-64`` +with ``linux-aarch64``; for Windows, use ``win-64``. Only the current CUDA +major version is built on ``main``; wheels for the prior CUDA major are +published from the corresponding backport branch. + Installing from Source ----------------------- +~~~~~~~~~~~~~~~~~~~~~~ Requirements ^^^^^^^^^^^^ @@ -87,13 +125,13 @@ Requirements [^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: +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_PATH`` (or ``CUDA_HOME``) environment variable to specify the location of your headers. If both are set, ``CUDA_PATH`` takes precedence. For example, if your headers are located in ``/usr/local/cuda/include``, then you should set ``CUDA_PATH`` with: .. code-block:: console - $ export CUDA_HOME=/usr/local/cuda + $ export CUDA_PATH=/usr/local/cuda -See `Environment Variables `_ for a description of other build-time environment variables. +See :doc:`Environment Variables ` for a description of other build-time environment variables. .. note:: diff --git a/cuda_bindings/docs/source/license.rst b/cuda_bindings/docs/source/license.rst index bd19c19722e..f5de9869980 100644 --- a/cuda_bindings/docs/source/license.rst +++ b/cuda_bindings/docs/source/license.rst @@ -1,8 +1,8 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 -Software License Agreement -************************** +Apache License 2.0 +****************** .. literalinclude:: ../../LICENSE :language: text diff --git a/cuda_bindings/docs/source/module/cudla.rst b/cuda_bindings/docs/source/module/cudla.rst new file mode 100644 index 00000000000..5a77fd45c56 --- /dev/null +++ b/cuda_bindings/docs/source/module/cudla.rst @@ -0,0 +1,64 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. default-role:: cpp:any + +cudla +===== + +Note +---- + +The cuDLA bindings require a Jetson platform with DLA hardware (Xavier or Orin). +cuDLA is not available on desktop GPUs. + +Functions +--------- + +cuDLA defines the following functions for DLA device management and inference. + +.. autofunction:: cuda.bindings.cudla.get_version +.. autofunction:: cuda.bindings.cudla.device_get_count +.. autofunction:: cuda.bindings.cudla.create_device +.. autofunction:: cuda.bindings.cudla.destroy_device +.. autofunction:: cuda.bindings.cudla.mem_register +.. autofunction:: cuda.bindings.cudla.mem_unregister +.. autofunction:: cuda.bindings.cudla.module_load_from_memory +.. autofunction:: cuda.bindings.cudla.module_get_attributes +.. autofunction:: cuda.bindings.cudla.module_unload +.. autofunction:: cuda.bindings.cudla.submit_task +.. autofunction:: cuda.bindings.cudla.device_get_attribute +.. autofunction:: cuda.bindings.cudla.get_last_error +.. autofunction:: cuda.bindings.cudla.set_task_timeout_in_ms + +Types +----- + +.. autoclass:: cuda.bindings.cudla.ExternalMemoryHandleDesc +.. autoclass:: cuda.bindings.cudla.ExternalSemaphoreHandleDesc +.. autoclass:: cuda.bindings.cudla.ModuleTensorDescriptor +.. autoclass:: cuda.bindings.cudla.Fence +.. autoclass:: cuda.bindings.cudla.DevAttribute +.. autoclass:: cuda.bindings.cudla.ModuleAttribute +.. autoclass:: cuda.bindings.cudla.WaitEvents +.. autoclass:: cuda.bindings.cudla.SignalEvents +.. autoclass:: cuda.bindings.cudla.Task + +Enums +----- + +.. autoclass:: cuda.bindings.cudla.Status + + .. autoattribute:: cuda.bindings.cudla.Status.Success + +.. autoclass:: cuda.bindings.cudla.Mode + + .. autoattribute:: cuda.bindings.cudla.Mode.CUDA_DLA + .. autoattribute:: cuda.bindings.cudla.Mode.STANDALONE + +.. autoclass:: cuda.bindings.cudla.ModuleAttributeType +.. autoclass:: cuda.bindings.cudla.FenceType +.. autoclass:: cuda.bindings.cudla.ModuleLoadFlags +.. autoclass:: cuda.bindings.cudla.SubmissionFlags +.. autoclass:: cuda.bindings.cudla.AccessPermissionFlags +.. autoclass:: cuda.bindings.cudla.DevAttributeType diff --git a/cuda_bindings/docs/source/module/cufile.rst b/cuda_bindings/docs/source/module/cufile.rst index 86d54f6c2d2..bd51ff26a40 100644 --- a/cuda_bindings/docs/source/module/cufile.rst +++ b/cuda_bindings/docs/source/module/cufile.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 .. default-role:: cpp:any .. module:: cuda.bindings.cufile diff --git a/cuda_bindings/docs/source/module/driver.rst b/cuda_bindings/docs/source/module/driver.rst index 172e328e92b..8d9490f54a7 100644 --- a/cuda_bindings/docs/source/module/driver.rst +++ b/cuda_bindings/docs/source/module/driver.rst @@ -1,6 +1,7 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 +.. CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=15f77ea651a2deffa7f7ae710189546cff9c23ba311b693207743eaf339a0a9c ------ driver ------ @@ -146,7 +147,9 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUctx_flags.CU_CTX_BLOCKING_SYNC - Set blocking synchronization as default scheduling [Deprecated] + Set blocking synchronization as default scheduling + + [Deprecated] .. autoattribute:: cuda.bindings.driver.CUctx_flags.CU_CTX_SCHED_MASK @@ -406,25 +409,25 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUstreamWaitValue_flags.CU_STREAM_WAIT_VALUE_GEQ - Wait until (int32_t)(*addr - value) >= 0 (or int64_t for 64 bit values). Note this is a cyclic comparison which ignores wraparound. (Default behavior.) + Wait until (int32_t)(\*addr - value) >= 0 (or int64_t for 64 bit values). Note this is a cyclic comparison which ignores wraparound. (Default behavior.) .. autoattribute:: cuda.bindings.driver.CUstreamWaitValue_flags.CU_STREAM_WAIT_VALUE_EQ - Wait until *addr == value. + Wait until \*addr == value. .. autoattribute:: cuda.bindings.driver.CUstreamWaitValue_flags.CU_STREAM_WAIT_VALUE_AND - Wait until (*addr & value) != 0. + Wait until (\*addr & value) != 0. .. autoattribute:: cuda.bindings.driver.CUstreamWaitValue_flags.CU_STREAM_WAIT_VALUE_NOR - Wait until ~(*addr | value) != 0. Support for this operation can be queried with :py:obj:`~.cuDeviceGetAttribute()` and :py:obj:`~.CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR`. + Wait until ~(\*addr | value) != 0. Support for this operation can be queried with :py:obj:`~.cuDeviceGetAttribute()` and :py:obj:`~.CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR`. .. autoattribute:: cuda.bindings.driver.CUstreamWaitValue_flags.CU_STREAM_WAIT_VALUE_FLUSH @@ -480,7 +483,7 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUstreamBatchMemOpType.CU_STREAM_MEM_OP_ATOMIC_REDUCTION - Perform a atomic reduction. See :py:obj:`~.CUstreamBatchMemOpParams`::atomicReduction + Perform a atomic reduction. See :py:obj:`~.CUstreamBatchMemOpParams.atomicReduction` .. autoattribute:: cuda.bindings.driver.CUstreamBatchMemOpType.CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES @@ -506,19 +509,19 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUstreamAtomicReductionOpType.CU_STREAM_ATOMIC_REDUCTION_OP_OR - Performs an atomic OR: *(address) = *(address) | value + Performs an atomic OR: \*(address) = \*(address) | value .. autoattribute:: cuda.bindings.driver.CUstreamAtomicReductionOpType.CU_STREAM_ATOMIC_REDUCTION_OP_AND - Performs an atomic AND: *(address) = *(address) & value + Performs an atomic AND: \*(address) = \*(address) & value .. autoattribute:: cuda.bindings.driver.CUstreamAtomicReductionOpType.CU_STREAM_ATOMIC_REDUCTION_OP_ADD - Performs an atomic ADD: *(address) = *(address) + value + Performs an atomic ADD: \*(address) = \*(address) + value .. autoclass:: cuda.bindings.driver.CUstreamAtomicReductionDataType @@ -1603,7 +1606,7 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN - Maximum optin shared memory per block + Maximum optin shared memory per block. That is shared memory that is available for dynamic allocation or static allocation (including architecture specific static shared memory) on this device but is not guaranteed to be portable. .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_CAN_FLUSH_REMOTE_WRITES @@ -1918,6 +1921,42 @@ Data types used by CUDA driver Device supports atomic reduction operations in stream batch memory operations + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_D3D12_CIG_STREAMS_SUPPORTED + + + Device supports CIG streams with D3D12 + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_DMA_BUF_MMAP_SUPPORTED + + + Device supports mmap() of dmabuf file descriptors for CUDA device memory allocations + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_UNICAST_SUPPORTED + + + Device supports unicast logical endpoints + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_MULTICAST_SUPPORTED + + + Device supports multicast logical endpoints + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_COUNTED_OPS_SUPPORTED + + + Device supports counted operations via logical endpoints + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_UNICAST_ACCESS_ON_OWNER_DEVICE_SUPPORTED + + + Device supports unicast logical endpoint access on the owner device + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAX .. autoclass:: cuda.bindings.driver.CUpointer_attribute @@ -2045,7 +2084,7 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_IS_HW_DECOMPRESS_CAPABLE - Returns in `*data` a boolean that indicates whether the pointer points to memory that is capable to be used for hardware accelerated decompression. + Returns in ``*data`` a boolean that indicates whether the pointer points to memory that is capable to be used for hardware accelerated decompression. .. autoclass:: cuda.bindings.driver.CUfunction_attribute @@ -2082,13 +2121,13 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_PTX_VERSION - The PTX virtual architecture version for which the function was compiled. This value is the major PTX version * 10 + the minor PTX version, so a PTX version 1.3 function would return the value 13. Note that this may return the undefined value of 0 for cubins compiled prior to CUDA 3.0. + The PTX virtual architecture version for which the function was compiled. This value is the major PTX version \* 10 + the minor PTX version, so a PTX version 1.3 function would return the value 13. Note that this may return the undefined value of 0 for cubins compiled prior to CUDA 3.0. .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_BINARY_VERSION - The binary architecture version for which the function was compiled. This value is the major binary version * 10 + the minor binary version, so a binary version 1.3 function would return the value 13. Note that this will return a value of 10 for legacy cubins that do not have a properly-encoded binary architecture version. + The binary architecture version for which the function was compiled. This value is the major binary version \* 10 + the minor binary version, so a binary version 1.3 function would return the value 13. Note that this will return a value of 10 for legacy cubins that do not have a properly-encoded binary architecture version. .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_CACHE_MODE_CA @@ -2170,7 +2209,13 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE - The block scheduling policy of a function. The value type is CUclusterSchedulingPolicy / cudaClusterSchedulingPolicy. See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` + The block scheduling policy of a function. The value type is :py:obj:`~.CUclusterSchedulingPolicy` / cudaClusterSchedulingPolicy. See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` + + + .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_DEVICE_NODE_UPDATE_SUPPORTED + + + Whether the function can be updated on device. 1 means device node update is supported, 0 is unsupported. See :py:obj:`~.cuFuncGetAttribute`. .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_MAX @@ -2409,7 +2454,7 @@ Data types used by CUDA driver Pointer to a buffer in which to print any log messages that are informational in nature (the buffer size is specified via option :py:obj:`~.CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES`) - Option type: char * + Option type: char \* Applies to: compiler and linker @@ -2431,7 +2476,7 @@ Data types used by CUDA driver Pointer to a buffer in which to print any log messages that reflect errors (the buffer size is specified via option :py:obj:`~.CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES`) - Option type: char * + Option type: char \* Applies to: compiler and linker @@ -2481,7 +2526,7 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_FALLBACK_STRATEGY - Specifies choice of fallback strategy if matching cubin is not found. Choice is based on supplied :py:obj:`~.CUjit_fallback`. This option cannot be used with cuLink* APIs as the linker requires exact matches. + Specifies choice of fallback strategy if matching cubin is not found. Choice is based on supplied :py:obj:`~.CUjit_fallback`. This option cannot be used with cuLink\* APIs as the linker requires exact matches. Option type: unsigned int for enumerated type :py:obj:`~.CUjit_fallback` @@ -2555,7 +2600,7 @@ Data types used by CUDA driver It is illegal to register the same device symbol at multiple addresses. - Option type: const char ** + Option type: const char \*\* Applies to: dynamic linker only @@ -2567,7 +2612,7 @@ Data types used by CUDA driver Must contain :py:obj:`~.CU_JIT_GLOBAL_SYMBOL_COUNT` entries. - Option type: void ** + Option type: void \*\* Applies to: dynamic linker only @@ -3198,7 +3243,7 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUgraphConditionalNodeType.CU_GRAPH_COND_TYPE_IF - Conditional 'if/else' Node. Body[0] executed if condition is non-zero. If `size` == 2, an optional ELSE graph is created and this is executed if the condition is zero. + Conditional 'if/else' Node. Body[0] executed if condition is non-zero. If ``size`` == 2, an optional ELSE graph is created and this is executed if the condition is zero. .. autoattribute:: cuda.bindings.driver.CUgraphConditionalNodeType.CU_GRAPH_COND_TYPE_WHILE @@ -3325,6 +3370,12 @@ Data types used by CUDA driver call :py:obj:`~.cudaGraphSetConditional` from device code. + + .. autoattribute:: cuda.bindings.driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_RESERVED_16 + + + Reserved + .. autoclass:: cuda.bindings.driver.CUgraphDependencyType .. autoattribute:: cuda.bindings.driver.CUgraphDependencyType.CU_GRAPH_DEPENDENCY_TYPE_DEFAULT @@ -3336,7 +3387,7 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUgraphDependencyType.CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC - This dependency type allows the downstream node to use `cudaGridDependencySynchronize()`. It may only be used between kernel nodes, and must be used with either the :py:obj:`~.CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC` or :py:obj:`~.CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER` outgoing port. + This dependency type allows the downstream node to use ``cudaGridDependencySynchronize()``. It may only be used between kernel nodes, and must be used with either the :py:obj:`~.CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC` or :py:obj:`~.CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER` outgoing port. .. autoclass:: cuda.bindings.driver.CUgraphInstantiateResult @@ -3535,7 +3586,7 @@ Data types used by CUDA driver Each type of cluster will have its enumeration / coordinate setup as if the grid consists solely of its type of cluster. For example, if the preferred substitute cluster dimensions double the regular cluster dimensions, there might be simultaneously a regular cluster indexed at (1,0,0), and a preferred cluster indexed at (1,0,0). In this example, the preferred substitute cluster (1,0,0) replaces regular clusters (2,0,0) and (3,0,0) and groups their blocks. - This attribute will only take effect when a regular cluster dimension has been specified. The preferred substitute cluster dimension must be an integer multiple greater than zero of the regular cluster dimension and must divide the grid. It must also be no more than `maxBlocksPerCluster`, if it is set in the kernel's `__launch_bounds__`. Otherwise it must be less than the maximum value the driver can support. Otherwise, setting this attribute to a value physically unable to fit on any particular device is permitted. + This attribute will only take effect when a regular cluster dimension has been specified. The preferred substitute cluster dimension must be an integer multiple greater than zero of the regular cluster dimension and must divide the grid. It must also be no more than ``maxBlocksPerCluster``, if it is set in the kernel's ``__launch_bounds__``. Otherwise it must be less than the maximum value the driver can support. Otherwise, setting this attribute to a value physically unable to fit on any particular device is permitted. .. autoattribute:: cuda.bindings.driver.CUlaunchAttributeID.CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT @@ -3545,7 +3596,7 @@ Data types used by CUDA driver Nominally, the event is triggered once all blocks of the kernel have begun execution. Currently this is a best effort. If a kernel B has a launch completion dependency on a kernel A, B may wait until A is complete. Alternatively, blocks of B may begin before all blocks of A have begun, for example if B can claim execution resources unavailable to A (e.g. they run on different GPUs) or if B is a higher priority than A. Exercise caution if such an ordering inversion could lead to deadlock. - A launch completion event is nominally similar to a programmatic event with `triggerAtBlockStart` set except that it is not visible to `cudaGridDependencySynchronize()` and can be used with compute capability less than 9.0. + A launch completion event is nominally similar to a programmatic event with ``triggerAtBlockStart`` set except that it is not visible to ``cudaGridDependencySynchronize()`` and can be used with compute capability less than 9.0. The event supplied must not be an interprocess or interop event. The event must disable timing (i.e. must be created with the :py:obj:`~.CU_EVENT_DISABLE_TIMING` flag set). @@ -3555,7 +3606,7 @@ Data types used by CUDA driver Valid for graph nodes, launches. This attribute is graphs-only, and passing it to a launch in a non-capturing stream will result in an error. - :py:obj:`~.CUlaunchAttributeValue`::deviceUpdatableKernelNode::deviceUpdatable can only be set to 0 or 1. Setting the field to 1 indicates that the corresponding kernel node should be device-updatable. On success, a handle will be returned via :py:obj:`~.CUlaunchAttributeValue`::deviceUpdatableKernelNode::devNode which can be passed to the various device-side update functions to update the node's kernel parameters from within another kernel. For more information on the types of device updates that can be made, as well as the relevant limitations thereof, see :py:obj:`~.cudaGraphKernelNodeUpdatesApply`. + :py:obj:`~.CUlaunchAttributeValue.deviceUpdatableKernelNode.deviceUpdatable` can only be set to 0 or 1. Setting the field to 1 indicates that the corresponding kernel node should be device-updatable. On success, a handle will be returned via :py:obj:`~.CUlaunchAttributeValue.deviceUpdatableKernelNode.devNode` which can be passed to the various device-side update functions to update the node's kernel parameters from within another kernel. For more information on the types of device updates that can be made, as well as the relevant limitations thereof, see :py:obj:`~.cudaGraphKernelNodeUpdatesApply`. Nodes which are device-updatable have additional restrictions compared to regular kernel nodes. Firstly, device-updatable nodes cannot be removed from their graph via :py:obj:`~.cuGraphDestroyNode`. Additionally, once opted-in to this functionality, a node cannot opt out, and any attempt to set the deviceUpdatable attribute to 0 will result in an error. Device-updatable kernel nodes also cannot have their attributes copied to/from another kernel node via :py:obj:`~.cuGraphKernelNodeCopyAttributes`. Graphs containing one or more device-updatable nodes also do not allow multiple instantiation, and neither the graph nor its instantiated version can be passed to :py:obj:`~.cuGraphExecUpdate`. @@ -3579,7 +3630,7 @@ Data types used by CUDA driver 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). + Valid values for :py:obj:`~.CUlaunchAttributeValue.nvlinkUtilCentricScheduling` are 0 (disabled) and 1 (enabled). .. autoattribute:: cuda.bindings.driver.CUlaunchAttributeID.CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE @@ -3698,7 +3749,7 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUlibraryOption.CU_LIBRARY_BINARY_IS_PRESERVED - Specifes that the argument `code` passed to :py:obj:`~.cuLibraryLoadData()` will be preserved. Specifying this option will let the driver know that `code` can be accessed at any point until :py:obj:`~.cuLibraryUnload()`. The default behavior is for the driver to allocate and maintain its own copy of `code`. Note that this is only a memory usage optimization hint and the driver can choose to ignore it if required. Specifying this option with :py:obj:`~.cuLibraryLoadFromFile()` is invalid and will return :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. + Specifes that the argument ``code`` passed to :py:obj:`~.cuLibraryLoadData()` will be preserved. Specifying this option will let the driver know that ``code`` can be accessed at any point until :py:obj:`~.cuLibraryUnload()`. The default behavior is for the driver to allocate and maintain its own copy of ``code``. Note that this is only a memory usage optimization hint and the driver can choose to ignore it if required. Specifying this option with :py:obj:`~.cuLibraryLoadFromFile()` is invalid and will return :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. .. autoattribute:: cuda.bindings.driver.CUlibraryOption.CU_LIBRARY_NUM_OPTIONS @@ -3810,7 +3861,9 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_CONTEXT_ALREADY_CURRENT - This indicated that the context being supplied as a parameter to the API call was already the active context. [Deprecated] + This indicated that the context being supplied as a parameter to the API call was already the active context. + + [Deprecated] .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_MAP_FAILED @@ -4311,6 +4364,12 @@ Data types used by CUDA driver This error indicates that the requested operation is not permitted because the stream is in a detached state. This can occur if the green context associated with the stream has been destroyed, limiting the stream's operational capabilities. + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_GRAPH_RECAPTURE_FAILURE + + + This error indicates that a graph recapture failed and had to be terminated. + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_UNKNOWN @@ -4836,7 +4895,7 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUmemAllocationHandleType.CU_MEM_HANDLE_TYPE_FABRIC - Allows a fabric handle to be used for exporting. (CUmemFabricHandle) + Allows a fabric handle to be used for exporting. (:py:obj:`~.CUmemFabricHandle`) .. autoattribute:: cuda.bindings.driver.CUmemAllocationHandleType.CU_MEM_HANDLE_TYPE_MAX @@ -5074,43 +5133,43 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD - (value type = cuuint64_t) Amount of reserved memory in bytes to hold onto before trying to release memory back to the OS. When more than the release threshold bytes of memory are held by the memory pool, the allocator will try to release memory back to the OS on the next call to stream, event or context synchronize. (default 0) + (value type = :py:obj:`~.cuuint64_t`) Amount of reserved memory in bytes to hold onto before trying to release memory back to the OS. When more than the release threshold bytes of memory are held by the memory pool, the allocator will try to release memory back to the OS on the next call to stream, event or context synchronize. (default 0) .. autoattribute:: cuda.bindings.driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT - (value type = cuuint64_t) Amount of backing memory currently allocated for the mempool. + (value type = :py:obj:`~.cuuint64_t`) Amount of backing memory currently allocated for the mempool. .. autoattribute:: cuda.bindings.driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH - (value type = cuuint64_t) High watermark of backing memory allocated for the mempool since the last time it was reset. High watermark can only be reset to zero. + (value type = :py:obj:`~.cuuint64_t`) High watermark of backing memory allocated for the mempool since the last time it was reset. High watermark can only be reset to zero. .. autoattribute:: cuda.bindings.driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_USED_MEM_CURRENT - (value type = cuuint64_t) Amount of memory from the pool that is currently in use by the application. + (value type = :py:obj:`~.cuuint64_t`) Amount of memory from the pool that is currently in use by the application. .. autoattribute:: cuda.bindings.driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_USED_MEM_HIGH - (value type = cuuint64_t) High watermark of the amount of memory from the pool that was in use by the application since the last time it was reset. High watermark can only be reset to zero. + (value type = :py:obj:`~.cuuint64_t`) High watermark of the amount of memory from the pool that was in use by the application since the last time it was reset. High watermark can only be reset to zero. .. autoattribute:: cuda.bindings.driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_ALLOCATION_TYPE - (value type = CUmemAllocationType) The allocation type of the mempool + (value type = :py:obj:`~.CUmemAllocationType`) The allocation type of the mempool .. autoattribute:: cuda.bindings.driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_EXPORT_HANDLE_TYPES - (value type = CUmemAllocationHandleType) Available export handle types for the mempool. For imported pools this value is always CU_MEM_HANDLE_TYPE_NONE as an imported pool cannot be re-exported + (value type = :py:obj:`~.CUmemAllocationHandleType`) Available export handle types for the mempool. For imported pools this value is always CU_MEM_HANDLE_TYPE_NONE as an imported pool cannot be re-exported .. autoattribute:: cuda.bindings.driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_LOCATION_ID @@ -5122,13 +5181,13 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_LOCATION_TYPE - (value type = CUmemLocationType) The location type for the mempool. For imported memory pools where the device is not directly visible to the importing process or pools imported via fabric handles across nodes this will be CU_MEM_LOCATION_TYPE_INVISIBLE. + (value type = :py:obj:`~.CUmemLocationType`) The location type for the mempool. For imported memory pools where the device is not directly visible to the importing process or pools imported via fabric handles across nodes this will be CU_MEM_LOCATION_TYPE_INVISIBLE. .. autoattribute:: cuda.bindings.driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_MAX_POOL_SIZE - (value type = cuuint64_t) Maximum size of the pool in bytes, this value may be higher than what was initially passed to cuMemPoolCreate due to alignment requirements. A value of 0 indicates no maximum size. For CU_MEM_ALLOCATION_TYPE_MANAGED and IPC imported pools this value will be system dependent. + (value type = :py:obj:`~.cuuint64_t`) Maximum size of the pool in bytes, this value may be higher than what was initially passed to cuMemPoolCreate due to alignment requirements. A value of 0 indicates no maximum size. For CU_MEM_ALLOCATION_TYPE_MANAGED and IPC imported pools this value will be system dependent. .. autoattribute:: cuda.bindings.driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_HW_DECOMPRESS_ENABLED @@ -5185,7 +5244,7 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUmemcpy3DOperandType.CU_MEMCPY_OPERAND_TYPE_ARRAY - Memcpy operand is a CUarray. + Memcpy operand is a :py:obj:`~.CUarray`. .. autoattribute:: cuda.bindings.driver.CUmemcpy3DOperandType.CU_MEMCPY_OPERAND_TYPE_MAX @@ -5195,25 +5254,25 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUgraphMem_attribute.CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT - (value type = cuuint64_t) Amount of memory, in bytes, currently associated with graphs + (value type = :py:obj:`~.cuuint64_t`) Amount of memory, in bytes, currently associated with graphs .. autoattribute:: cuda.bindings.driver.CUgraphMem_attribute.CU_GRAPH_MEM_ATTR_USED_MEM_HIGH - (value type = cuuint64_t) High watermark of memory, in bytes, associated with graphs since the last time it was reset. High watermark can only be reset to zero. + (value type = :py:obj:`~.cuuint64_t`) High watermark of memory, in bytes, associated with graphs since the last time it was reset. High watermark can only be reset to zero. .. autoattribute:: cuda.bindings.driver.CUgraphMem_attribute.CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT - (value type = cuuint64_t) Amount of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator. + (value type = :py:obj:`~.cuuint64_t`) Amount of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator. .. autoattribute:: cuda.bindings.driver.CUgraphMem_attribute.CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH - (value type = cuuint64_t) High watermark of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator. + (value type = :py:obj:`~.cuuint64_t`) High watermark of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator. .. autoclass:: cuda.bindings.driver.CUgraphChildGraphNodeOwnership @@ -5307,49 +5366,49 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_PARAMS - Adds CUDA_KERNEL_NODE_PARAMS values to output + Adds :py:obj:`~.CUDA_KERNEL_NODE_PARAMS` values to output .. autoattribute:: cuda.bindings.driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_MEMCPY_NODE_PARAMS - Adds CUDA_MEMCPY3D values to output + Adds :py:obj:`~.CUDA_MEMCPY3D` values to output .. autoattribute:: cuda.bindings.driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_MEMSET_NODE_PARAMS - Adds CUDA_MEMSET_NODE_PARAMS values to output + Adds :py:obj:`~.CUDA_MEMSET_NODE_PARAMS` values to output .. autoattribute:: cuda.bindings.driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_HOST_NODE_PARAMS - Adds CUDA_HOST_NODE_PARAMS values to output + Adds :py:obj:`~.CUDA_HOST_NODE_PARAMS` values to output .. autoattribute:: cuda.bindings.driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_EVENT_NODE_PARAMS - Adds CUevent handle from record and wait nodes to output + Adds :py:obj:`~.CUevent` handle from record and wait nodes to output .. autoattribute:: cuda.bindings.driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_SIGNAL_NODE_PARAMS - Adds CUDA_EXT_SEM_SIGNAL_NODE_PARAMS values to output + Adds :py:obj:`~.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS` values to output .. autoattribute:: cuda.bindings.driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_WAIT_NODE_PARAMS - Adds CUDA_EXT_SEM_WAIT_NODE_PARAMS values to output + Adds :py:obj:`~.CUDA_EXT_SEM_WAIT_NODE_PARAMS` values to output .. autoattribute:: cuda.bindings.driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_ATTRIBUTES - Adds CUkernelNodeAttrValue values to output + Adds :py:obj:`~.CUkernelNodeAttrValue` values to output .. autoattribute:: cuda.bindings.driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_HANDLES @@ -5412,7 +5471,7 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUgraphInstantiate_flags.CUDA_GRAPH_INSTANTIATE_FLAG_UPLOAD - Automatically upload the graph after instantiation. Only supported by :py:obj:`~.cuGraphInstantiateWithParams`. The upload will be performed using the stream provided in `instantiateParams`. + Automatically upload the graph after instantiation. Only supported by :py:obj:`~.cuGraphInstantiateWithParams`. The upload will be performed using the stream provided in ``instantiateParams``. .. autoattribute:: cuda.bindings.driver.CUgraphInstantiate_flags.CUDA_GRAPH_INSTANTIATE_FLAG_DEVICE_LAUNCH @@ -6387,7 +6446,7 @@ Data types used by CUDA driver - Stream handle that can be passed as a CUstream to use an implicit stream with legacy synchronization behavior. + Stream handle that can be passed as a :py:obj:`~.CUstream` to use an implicit stream with legacy synchronization behavior. @@ -6399,7 +6458,7 @@ Data types used by CUDA driver - Stream handle that can be passed as a CUstream to use an implicit stream with per-thread synchronization behavior. + Stream handle that can be passed as a :py:obj:`~.CUstream` to use an implicit stream with per-thread synchronization behavior. @@ -6481,19 +6540,19 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC - When the `flags` parameter of :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS` contains this flag, it indicates that signaling an external semaphore object should skip performing appropriate memory synchronization operations over all the external memory objects that are imported as :py:obj:`~.CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF`, which otherwise are performed by default to ensure data coherency with other importers of the same NvSciBuf memory objects. + When the ``flags`` parameter of :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS` contains this flag, it indicates that signaling an external semaphore object should skip performing appropriate memory synchronization operations over all the external memory objects that are imported as :py:obj:`~.CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF`, which otherwise are performed by default to ensure data coherency with other importers of the same NvSciBuf memory objects. .. autoattribute:: cuda.bindings.driver.CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC - When the `flags` parameter of :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS` contains this flag, it indicates that waiting on an external semaphore object should skip performing appropriate memory synchronization operations over all the external memory objects that are imported as :py:obj:`~.CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF`, which otherwise are performed by default to ensure data coherency with other importers of the same NvSciBuf memory objects. + When the ``flags`` parameter of :py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS` contains this flag, it indicates that waiting on an external semaphore object should skip performing appropriate memory synchronization operations over all the external memory objects that are imported as :py:obj:`~.CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF`, which otherwise are performed by default to ensure data coherency with other importers of the same NvSciBuf memory objects. .. autoattribute:: cuda.bindings.driver.CUDA_NVSCISYNC_ATTR_SIGNAL - When `flags` of :py:obj:`~.cuDeviceGetNvSciSyncAttributes` is set to this, it indicates that application needs signaler specific NvSciSyncAttr to be filled by :py:obj:`~.cuDeviceGetNvSciSyncAttributes`. + When ``flags`` of :py:obj:`~.cuDeviceGetNvSciSyncAttributes` is set to this, it indicates that application needs signaler specific NvSciSyncAttr to be filled by :py:obj:`~.cuDeviceGetNvSciSyncAttributes`. .. autoattribute:: cuda.bindings.driver.CUDA_NVSCISYNC_ATTR_WAIT - When `flags` of :py:obj:`~.cuDeviceGetNvSciSyncAttributes` is set to this, it indicates that application needs waiter specific NvSciSyncAttr to be filled by :py:obj:`~.cuDeviceGetNvSciSyncAttributes`. + When ``flags`` of :py:obj:`~.cuDeviceGetNvSciSyncAttributes` is set to this, it indicates that application needs waiter specific NvSciSyncAttr to be filled by :py:obj:`~.cuDeviceGetNvSciSyncAttributes`. .. autoattribute:: cuda.bindings.driver.CU_MEM_CREATE_USAGE_TILE_POOL @@ -6517,7 +6576,7 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUDA_ARRAY3D_LAYERED - If set, the CUDA array is a collection of layers, where each layer is either a 1D or a 2D array and the Depth member of CUDA_ARRAY3D_DESCRIPTOR specifies the number of layers, not the depth of a 3D array. + If set, the CUDA array is a collection of layers, where each layer is either a 1D or a 2D array and the Depth member of :py:obj:`~.CUDA_ARRAY3D_DESCRIPTOR` specifies the number of layers, not the depth of a 3D array. .. autoattribute:: cuda.bindings.driver.CUDA_ARRAY3D_2DARRAY @@ -6589,7 +6648,7 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CU_LAUNCH_PARAM_END - End of array terminator for the `extra` parameter to :py:obj:`~.cuLaunchKernel` + End of array terminator for the ``extra`` parameter to :py:obj:`~.cuLaunchKernel` .. autoattribute:: cuda.bindings.driver.CU_LAUNCH_PARAM_BUFFER_POINTER_AS_INT @@ -6597,7 +6656,7 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CU_LAUNCH_PARAM_BUFFER_POINTER - Indicator that the next value in the `extra` parameter to :py:obj:`~.cuLaunchKernel` will be a pointer to a buffer containing all kernel parameters used for launching kernel `f`. This buffer needs to honor all alignment/padding requirements of the individual parameters. If :py:obj:`~.CU_LAUNCH_PARAM_BUFFER_SIZE` is not also specified in the `extra` array, then :py:obj:`~.CU_LAUNCH_PARAM_BUFFER_POINTER` will have no effect. + Indicator that the next value in the ``extra`` parameter to :py:obj:`~.cuLaunchKernel` will be a pointer to a buffer containing all kernel parameters used for launching kernel ``f``. This buffer needs to honor all alignment/padding requirements of the individual parameters. If :py:obj:`~.CU_LAUNCH_PARAM_BUFFER_SIZE` is not also specified in the ``extra`` array, then :py:obj:`~.CU_LAUNCH_PARAM_BUFFER_POINTER` will have no effect. .. autoattribute:: cuda.bindings.driver.CU_LAUNCH_PARAM_BUFFER_SIZE_AS_INT @@ -6605,7 +6664,7 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CU_LAUNCH_PARAM_BUFFER_SIZE - Indicator that the next value in the `extra` parameter to :py:obj:`~.cuLaunchKernel` will be a pointer to a size_t which contains the size of the buffer specified with :py:obj:`~.CU_LAUNCH_PARAM_BUFFER_POINTER`. It is required that :py:obj:`~.CU_LAUNCH_PARAM_BUFFER_POINTER` also be specified in the `extra` array if the value associated with :py:obj:`~.CU_LAUNCH_PARAM_BUFFER_SIZE` is not zero. + Indicator that the next value in the ``extra`` parameter to :py:obj:`~.cuLaunchKernel` will be a pointer to a size_t which contains the size of the buffer specified with :py:obj:`~.CU_LAUNCH_PARAM_BUFFER_POINTER`. It is required that :py:obj:`~.CU_LAUNCH_PARAM_BUFFER_POINTER` also be specified in the ``extra`` array if the value associated with :py:obj:`~.CU_LAUNCH_PARAM_BUFFER_SIZE` is not zero. .. autoattribute:: cuda.bindings.driver.CU_PARAM_TR_DEFAULT @@ -6631,6 +6690,10 @@ Data types used by CUDA driver Error Handling -------------- +MANBRIEF error handling functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the error handling functions of the low-level CUDA driver application programming interface. .. autofunction:: cuda.bindings.driver.cuGetErrorString @@ -6639,6 +6702,10 @@ This section describes the error handling functions of the low-level CUDA driver Initialization -------------- +MANBRIEF initialization functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the initialization functions of the low-level CUDA driver application programming interface. .. autofunction:: cuda.bindings.driver.cuInit @@ -6646,6 +6713,10 @@ This section describes the initialization functions of the low-level CUDA driver Version Management ------------------ +MANBRIEF version management functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the version management functions of the low-level CUDA driver application programming interface. .. autofunction:: cuda.bindings.driver.cuDriverGetVersion @@ -6653,6 +6724,10 @@ This section describes the version management functions of the low-level CUDA dr Device Management ----------------- +MANBRIEF device management functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the device management functions of the low-level CUDA driver application programming interface. .. autofunction:: cuda.bindings.driver.cuDeviceGet @@ -6674,6 +6749,10 @@ This section describes the device management functions of the low-level CUDA dri Primary Context Management -------------------------- +MANBRIEF primary context management functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the primary context management functions of the low-level CUDA driver application programming interface. @@ -6689,6 +6768,10 @@ The primary context is unique per device and shared with the CUDA runtime API. T Context Management ------------------ +MANBRIEF context management functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the context management functions of the low-level CUDA driver application programming interface. @@ -6722,6 +6805,10 @@ Please note that some functions are described in Primary Context Management sect Module Management ----------------- +MANBRIEF module management functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the module management functions of the low-level CUDA driver application programming interface. .. autoclass:: cuda.bindings.driver.CUmoduleLoadingMode @@ -6756,6 +6843,10 @@ This section describes the module management functions of the low-level CUDA dri Library Management ------------------ +MANBRIEF library management functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the library management functions of the low-level CUDA driver application programming interface. .. autofunction:: cuda.bindings.driver.cuLibraryLoadData @@ -6780,6 +6871,10 @@ This section describes the library management functions of the low-level CUDA dr Memory Management ----------------- +MANBRIEF memory management functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the memory management functions of the low-level CUDA driver application programming interface. .. autoclass:: cuda.bindings.driver.CUmemDecompressParams_st @@ -6890,6 +6985,10 @@ This section describes the memory management functions of the low-level CUDA dri Virtual Memory Management ------------------------- +MANBRIEF virtual memory management functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the virtual memory management functions of the low-level CUDA driver application programming interface. .. autofunction:: cuda.bindings.driver.cuMemAddressReserve @@ -6910,15 +7009,17 @@ This section describes the virtual memory management functions of the low-level Stream Ordered Memory Allocator ------------------------------- -This section describes the stream ordered memory allocator exposed by the low-level CUDA driver application programming interface. +MANBRIEF Functions for performing allocation and free operations in stream order. Functions for controlling the behavior of the underlying allocator. (CURRENT_FILE) ENDMANBRIEF +This section describes the stream ordered memory allocator exposed by the low-level CUDA driver application programming interface. + -**overview** +**overview** The asynchronous allocator allows the user to allocate and free in stream order. All asynchronous accesses of the allocation must happen between the stream executions of the allocation and the free. If the memory is accessed outside of the promised stream order, a use before allocation / use after free error will cause undefined behavior. @@ -6930,8 +7031,6 @@ The allocator is free to reallocate the memory as long as it can guarantee that **Supported Platforms** - - Whether or not a device supports the integrated stream ordered memory allocator may be queried by calling cuDeviceGetAttribute() with the device attribute CU_DEVICE_ATTRIBUTE_MEMORY_POOLS_SUPPORTED .. autofunction:: cuda.bindings.driver.cuMemFreeAsync @@ -6955,15 +7054,17 @@ Whether or not a device supports the integrated stream ordered memory allocator Multicast Object Management --------------------------- -This section describes the CUDA multicast object operations exposed by the low-level CUDA driver application programming interface. +MANBRIEF Functions for creating multicast objects, adding devices to them and binding/unbinding memory (CURRENT_FILE) ENDMANBRIEF +This section describes the CUDA multicast object operations exposed by the low-level CUDA driver application programming interface. + -**overview** +**overview** A multicast object created via cuMulticastCreate enables certain memory operations to be broadcast to a team of devices. Devices can be added to a multicast object via cuMulticastAddDevice. Memory can be bound on each participating device via cuMulticastBindMem, cuMulticastBindMem_v2, cuMulticastBindAddr, or cuMulticastBindAddr_v2. Multicast objects can be mapped into a device's virtual address space using the virtual memmory management APIs (see cuMemMap and cuMemSetAccess). @@ -6973,8 +7074,6 @@ A multicast object created via cuMulticastCreate enables certain memory operatio **Supported Platforms** - - Support for multicast on a specific device can be queried using the device attribute CU_DEVICE_ATTRIBUTE_MULTICAST_SUPPORTED .. autofunction:: cuda.bindings.driver.cuMulticastCreate @@ -6986,19 +7085,78 @@ Support for multicast on a specific device can be queried using the device attri .. autofunction:: cuda.bindings.driver.cuMulticastUnbind .. autofunction:: cuda.bindings.driver.cuMulticastGetGranularity +Logical Endpoint +---------------- + +MANBRIEF logical endpoint functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + +This section describes the logical endpoint functions of the low-level CUDA driver application programming interface. + +.. autoclass:: cuda.bindings.driver.CUlogicalEndpointFabricHandle_st +.. autoclass:: cuda.bindings.driver.CUlogicalEndpointProp_struct +.. autoclass:: cuda.bindings.driver.CUlogicalEndpointIpcHandleType + + .. autoattribute:: cuda.bindings.driver.CUlogicalEndpointIpcHandleType.CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_NONE + + + .. autoattribute:: cuda.bindings.driver.CUlogicalEndpointIpcHandleType.CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_FABRIC + +.. autoclass:: cuda.bindings.driver.CUlogicalEndpointType + + .. autoattribute:: cuda.bindings.driver.CUlogicalEndpointType.CU_LOGICAL_ENDPOINT_TYPE_INVALID + + + .. autoattribute:: cuda.bindings.driver.CUlogicalEndpointType.CU_LOGICAL_ENDPOINT_TYPE_UNICAST + + + .. autoattribute:: cuda.bindings.driver.CUlogicalEndpointType.CU_LOGICAL_ENDPOINT_TYPE_MULTICAST + +.. autoclass:: cuda.bindings.driver.CUlogicalEndpointFlag + + .. autoattribute:: cuda.bindings.driver.CUlogicalEndpointFlag.CU_LOGICAL_ENDPOINT_FLAG_NONE + + + Default flag for logical endpoint construction + + + .. autoattribute:: cuda.bindings.driver.CUlogicalEndpointFlag.CU_LOGICAL_ENDPOINT_FLAG_COUNTED_OPS + + + Indicate the programmer's intention to use counted operations with the logical endpoint + +.. autoclass:: cuda.bindings.driver.CUlogicalEndpointId +.. autoclass:: cuda.bindings.driver.CUlogicalEndpointFabricHandle +.. autoclass:: cuda.bindings.driver.CUlogicalEndpointProp +.. autofunction:: cuda.bindings.driver.cuLogicalEndpointIdReserve +.. autofunction:: cuda.bindings.driver.cuLogicalEndpointIdRelease +.. autofunction:: cuda.bindings.driver.cuLogicalEndpointCreate +.. autofunction:: cuda.bindings.driver.cuLogicalEndpointAddDevice +.. autofunction:: cuda.bindings.driver.cuLogicalEndpointDestroy +.. autofunction:: cuda.bindings.driver.cuLogicalEndpointBindAddr +.. autofunction:: cuda.bindings.driver.cuLogicalEndpointBindMem +.. autofunction:: cuda.bindings.driver.cuLogicalEndpointUnbind +.. autofunction:: cuda.bindings.driver.cuLogicalEndpointExport +.. autofunction:: cuda.bindings.driver.cuLogicalEndpointImport +.. autofunction:: cuda.bindings.driver.cuLogicalEndpointGetLimits +.. autofunction:: cuda.bindings.driver.cuLogicalEndpointQuery + Unified Addressing ------------------ -This section describes the unified addressing functions of the low-level CUDA driver application programming interface. +MANBRIEF unified addressing functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF +This section describes the unified addressing functions of the low-level CUDA driver application programming interface. -**Overview** +**Overview** + CUDA devices can share a unified address space with the host. For these devices there is no distinction between a device pointer and a host pointer -- the same pointer value may be used to access memory from the host program and from a kernel running on the device (with exceptions enumerated below). @@ -7007,8 +7165,6 @@ CUDA devices can share a unified address space with the host. For these devices **Supported Platforms** - - Whether or not a device supports unified addressing may be queried by calling cuDeviceGetAttribute() with the device attribute CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING. Unified addressing is automatically enabled in 64-bit processes @@ -7019,8 +7175,6 @@ Unified addressing is automatically enabled in 64-bit processes **Looking Up Information from Pointer Values** - - It is possible to look up information about the memory which backs a pointer value. For instance, one may want to know if a pointer points to host or device memory. As another example, in the case of device memory, one may want to know on which CUDA device the memory resides. These properties may be queried using the function cuPointerGetAttribute() Since pointers are unique, it is not necessary to specify information about the pointers specified to the various copy functions in the CUDA API. The function cuMemcpy() may be used to perform a copy between two pointers, ignoring whether they point to host or device memory (making cuMemcpyHtoD(), cuMemcpyDtoD(), and cuMemcpyDtoH() unnecessary for devices supporting unified addressing). For multidimensional copies, the memory type CU_MEMORYTYPE_UNIFIED may be used to specify that the CUDA driver should infer the location of the pointer from its value. @@ -7031,8 +7185,6 @@ Since pointers are unique, it is not necessary to specify information about the **Automatic Mapping of Host Allocated Host Memory** - - All host memory allocated in all contexts using cuMemAllocHost() and cuMemHostAlloc() is always directly accessible from all contexts on all devices that support unified addressing. This is the case regardless of whether or not the flags CU_MEMHOSTALLOC_PORTABLE and CU_MEMHOSTALLOC_DEVICEMAP are specified. The pointer value through which allocated host memory may be accessed in kernels on all devices that support unified addressing is the same as the pointer value through which that memory is accessed on the host, so it is not necessary to call cuMemHostGetDevicePointer() to get the device pointer for these allocations. @@ -7045,8 +7197,6 @@ Note that this is not the case for memory allocated using the flag CU_MEMHOSTALL **Automatic Registration of Peer Memory** - - Upon enabling direct access from a context that supports unified addressing to another peer context that supports unified addressing using cuCtxEnablePeerAccess() all memory allocated in the peer context using cuMemAlloc() and cuMemAllocPitch() will immediately be accessible by the current context. The device pointer value through which any peer memory may be accessed in the current context is the same pointer value through which that memory may be accessed in the peer context. @@ -7055,8 +7205,6 @@ Upon enabling direct access from a context that supports unified addressing to a **Exceptions, Disjoint Addressing** - - Not all memory may be accessed on devices through the same pointer value through which they are accessed on the host. These exceptions are host memory registered using cuMemHostRegister() and host memory allocated using the flag CU_MEMHOSTALLOC_WRITECOMBINED. For these exceptions, there exists a distinct host and device address for the memory. The device address is guaranteed to not overlap any valid host pointer range and is guaranteed to have the same value across all contexts that support unified addressing. This device address may be queried using cuMemHostGetDevicePointer() when a context using unified addressing is current. Either the host or the unified device pointer value may be used to refer to this memory through cuMemcpy() and similar functions using the CU_MEMORYTYPE_UNIFIED memory type. @@ -7075,8 +7223,32 @@ This device address may be queried using cuMemHostGetDevicePointer() when a cont Stream Management ----------------- +MANBRIEF stream management functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the stream management functions of the low-level CUDA driver application programming interface. +.. autoclass:: cuda.bindings.driver.CUgraphRecaptureStatus + + .. autoattribute:: cuda.bindings.driver.CUgraphRecaptureStatus.CU_GRAPH_RECAPTURE_ELIGIBLE_FOR_UPDATE + + + Node is eligible for update in an instantiated graph. + + + .. autoattribute:: cuda.bindings.driver.CUgraphRecaptureStatus.CU_GRAPH_RECAPTURE_INELIGIBLE_FOR_UPDATE + + + Parameter changes in the node cannot be applied to an instantiated graph. + + + .. autoattribute:: cuda.bindings.driver.CUgraphRecaptureStatus.CU_GRAPH_RECAPTURE_ERROR + + + Error while attempting to recapture the node. The recapture will be ended regardless of the return value from the callback. + +.. autoclass:: cuda.bindings.driver.CUgraphRecaptureCallback .. autofunction:: cuda.bindings.driver.cuStreamCreate .. autofunction:: cuda.bindings.driver.cuStreamCreateWithPriority .. autofunction:: cuda.bindings.driver.cuStreamBeginCaptureToCig @@ -7090,6 +7262,7 @@ This section describes the stream management functions of the low-level CUDA dri .. autofunction:: cuda.bindings.driver.cuStreamWaitEvent .. autofunction:: cuda.bindings.driver.cuStreamAddCallback .. autofunction:: cuda.bindings.driver.cuStreamBeginCapture +.. autofunction:: cuda.bindings.driver.cuStreamBeginRecaptureToGraph .. autofunction:: cuda.bindings.driver.cuStreamBeginCaptureToGraph .. autofunction:: cuda.bindings.driver.cuThreadExchangeStreamCaptureMode .. autofunction:: cuda.bindings.driver.cuStreamEndCapture @@ -7107,6 +7280,10 @@ This section describes the stream management functions of the low-level CUDA dri Event Management ---------------- +MANBRIEF event management functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the event management functions of the low-level CUDA driver application programming interface. .. autofunction:: cuda.bindings.driver.cuEventCreate @@ -7120,6 +7297,10 @@ This section describes the event management functions of the low-level CUDA driv External Resource Interoperability ---------------------------------- +MANBRIEF External resource interoperability functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the external resource interoperability functions of the low-level CUDA driver application programming interface. .. autofunction:: cuda.bindings.driver.cuImportExternalMemory @@ -7134,6 +7315,10 @@ This section describes the external resource interoperability functions of the l Stream Memory Operations ------------------------ +MANBRIEF Stream memory operations of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the stream memory operations of the low-level CUDA driver application programming interface. @@ -7169,6 +7354,10 @@ Warning: Improper use of these APIs may deadlock the application. Synchronizatio Execution Control ----------------- +MANBRIEF execution control functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the execution control functions of the low-level CUDA driver application programming interface. .. autoclass:: cuda.bindings.driver.CUfunctionLoadingState @@ -7193,13 +7382,16 @@ This section describes the execution control functions of the low-level CUDA dri .. autofunction:: cuda.bindings.driver.cuLaunchKernel .. autofunction:: cuda.bindings.driver.cuLaunchKernelEx .. autofunction:: cuda.bindings.driver.cuLaunchCooperativeKernel -.. autofunction:: cuda.bindings.driver.cuLaunchCooperativeKernelMultiDevice .. autofunction:: cuda.bindings.driver.cuLaunchHostFunc .. autofunction:: cuda.bindings.driver.cuLaunchHostFunc_v2 Graph Management ---------------- +MANBRIEF graph management functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the graph management functions of the low-level CUDA driver application programming interface. .. autofunction:: cuda.bindings.driver.cuGraphCreate @@ -7294,6 +7486,10 @@ This section describes the graph management functions of the low-level CUDA driv Occupancy --------- +MANBRIEF occupancy calculation functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the occupancy calculation functions of the low-level CUDA driver application programming interface. .. autofunction:: cuda.bindings.driver.cuOccupancyMaxActiveBlocksPerMultiprocessor @@ -7307,6 +7503,10 @@ This section describes the occupancy calculation functions of the low-level CUDA Texture Object Management ------------------------- +MANBRIEF texture object management functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the texture object management functions of the low-level CUDA driver application programming interface. The texture object API is only supported on devices of compute capability 3.0 or higher. .. autofunction:: cuda.bindings.driver.cuTexObjectCreate @@ -7318,6 +7518,10 @@ This section describes the texture object management functions of the low-level Surface Object Management ------------------------- +MANBRIEF surface object management functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the surface object management functions of the low-level CUDA driver application programming interface. The surface object API is only supported on devices of compute capability 3.0 or higher. .. autofunction:: cuda.bindings.driver.cuSurfObjectCreate @@ -7327,6 +7531,10 @@ This section describes the surface object management functions of the low-level Tensor Map Object Managment --------------------------- +MANBRIEF tensor map object management functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the tensor map object management functions of the low-level CUDA driver application programming interface. The tensor core API is only supported on devices of compute capability 9.0 or higher. .. autofunction:: cuda.bindings.driver.cuTensorMapEncodeTiled @@ -7337,6 +7545,10 @@ This section describes the tensor map object management functions of the low-lev Peer Context Memory Access -------------------------- +MANBRIEF direct peer context memory access functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the direct peer context memory access functions of the low-level CUDA driver application programming interface. .. autofunction:: cuda.bindings.driver.cuDeviceCanAccessPeer @@ -7348,6 +7560,10 @@ This section describes the direct peer context memory access functions of the lo Graphics Interoperability ------------------------- +MANBRIEF graphics interoperability functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the graphics interoperability functions of the low-level CUDA driver application programming interface. .. autofunction:: cuda.bindings.driver.cuGraphicsUnregisterResource @@ -7361,6 +7577,10 @@ This section describes the graphics interoperability functions of the low-level Driver Entry Point Access ------------------------- +MANBRIEF driver entry point access functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the driver entry point access functions of the low-level CUDA driver application programming interface. .. autofunction:: cuda.bindings.driver.cuGetProcAddress @@ -7368,6 +7588,10 @@ This section describes the driver entry point access functions of the low-level Coredump Attributes Control API ------------------------------- +MANBRIEF coredump attribute control functions for the low-level CUDA API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the coredump attribute control functions of the low-level CUDA driver application programming interface. .. autoclass:: cuda.bindings.driver.CUcoredumpSettings @@ -7421,6 +7645,15 @@ This section describes the coredump attribute control functions of the low-level .. autoattribute:: cuda.bindings.driver.CUCoredumpGenerationFlags.CU_COREDUMP_GZIP_COMPRESS + .. autoattribute:: cuda.bindings.driver.CUCoredumpGenerationFlags.CU_COREDUMP_FAULTED_CONTEXTS_ONLY + + + .. autoattribute:: cuda.bindings.driver.CUCoredumpGenerationFlags.CU_COREDUMP_NO_ERRBAR_AT_EXIT + + + .. autoattribute:: cuda.bindings.driver.CUCoredumpGenerationFlags.CU_COREDUMP_LOG_ONLY + + .. autoattribute:: cuda.bindings.driver.CUCoredumpGenerationFlags.CU_COREDUMP_LIGHTWEIGHT_FLAGS .. autoclass:: cuda.bindings.driver.CUcoredumpCallbackHandle @@ -7437,6 +7670,10 @@ This section describes the coredump attribute control functions of the low-level Green Contexts -------------- +MANBRIEF Driver level API for creation and manipulation of green contexts (CURRENT_FILE) ENDMANBRIEF + + + This section describes the APIs for creation and manipulation of green contexts in the CUDA driver. Green contexts are a lightweight alternative to traditional contexts, that can be used to select a subset of device resources. This allows the developer to, for example, select SMs from distinct spatial partitions of the GPU and target them via CUDA stream operations, kernel launches, etc. @@ -7557,9 +7794,9 @@ Workqueues -For ``CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG``\ , the resource specifies the expected maximum number of concurrent stream-ordered workloads via the ``wqConcurrencyLimit``\ field. The ``sharingScope``\ field determines how workqueue resources are shared: +For ``CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG``, the resource specifies the expected maximum number of concurrent stream-ordered workloads via the ``wqConcurrencyLimit`` field. The ``sharingScope`` field determines how workqueue resources are shared: -- ``CU_WORKQUEUE_SCOPE_DEVICE_CTX:``\ Use all shared workqueue resources across all contexts (default driver behavior). +- ``CU_WORKQUEUE_SCOPE_DEVICE_CTX:`` Use all shared workqueue resources across all contexts (default driver behavior). @@ -7567,7 +7804,7 @@ For ``CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG``\ , the resource specifies the expe -- ``CU_WORKQUEUE_SCOPE_GREEN_CTX_BALANCED:``\ When possible, use non-overlapping workqueue resources with other balanced green contexts. +- ``CU_WORKQUEUE_SCOPE_GREEN_CTX_BALANCED:`` When possible, use non-overlapping workqueue resources with other balanced green contexts. @@ -7583,7 +7820,7 @@ The maximum concurrency limit depends on ::CUDA_DEVICE_MAX_CONNECTIONS and can b -For ``CU_DEV_RESOURCE_TYPE_WORKQUEUE``\ , the resource represents a pre-existing workqueue that can be retrieved from existing contexts or green contexts. This allows reusing workqueue resources across different green contexts. +For ``CU_DEV_RESOURCE_TYPE_WORKQUEUE``, the resource represents a pre-existing workqueue that can be retrieved from existing contexts or green contexts. This allows reusing workqueue resources across different green contexts. @@ -7601,7 +7838,7 @@ Even if the green contexts have disjoint SM partitions, it is not guaranteed tha Additionally, there are two known scenarios, where its possible for the workload to run on more SMs than was provisioned (but never less). -- On Volta+ MPS: When ``CUDA_MPS_ACTIVE_THREAD_PERCENTAGE``\ is used, the set of SMs that are used for running kernels can be scaled up to the value of SMs used for the MPS client. +- On Volta+ MPS: When ``CUDA_MPS_ACTIVE_THREAD_PERCENTAGE`` is used, the set of SMs that are used for running kernels can be scaled up to the value of SMs used for the MPS client. @@ -7623,10 +7860,13 @@ Additionally, there are two known scenarios, where its possible for the workload .. autoclass:: cuda.bindings.driver.CUdevResource .. autoclass:: cuda.bindings.driver.CUgreenCtxCreate_flags + .. autoattribute:: cuda.bindings.driver.CUgreenCtxCreate_flags.CU_GREEN_CTX_NONE + + .. autoattribute:: cuda.bindings.driver.CUgreenCtxCreate_flags.CU_GREEN_CTX_DEFAULT_STREAM - Required. Creates a default stream to use inside the green context + Creates a default stream to use inside the green context .. autoclass:: cuda.bindings.driver.CUdevSmResourceGroup_flags @@ -7706,6 +7946,10 @@ Additionally, there are two known scenarios, where its possible for the workload Error Log Management Functions ------------------------------ +MANBRIEF error log management functions for the low-level CUDA API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the error log management functions of the low-level CUDA driver application programming interface. .. autoclass:: cuda.bindings.driver.CUlogLevel @@ -7731,7 +7975,7 @@ CUDA API versioning support - +MANBRIEF CUDA checkpoint and restore functionality of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF @@ -7752,9 +7996,25 @@ Checkpoint and restore capabilities are currently restricted to Linux. .. autofunction:: cuda.bindings.driver.cuCheckpointProcessRestore .. autofunction:: cuda.bindings.driver.cuCheckpointProcessUnlock +Profiler Control +---------------- + +MANBRIEF profiler control functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + +This section describes the profiler control functions of the low-level CUDA driver application programming interface. + +.. autofunction:: cuda.bindings.driver.cuProfilerStart +.. autofunction:: cuda.bindings.driver.cuProfilerStop + EGL Interoperability -------------------- +MANBRIEF EGL interoperability functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the EGL interoperability functions of the low-level CUDA driver application programming interface. .. autofunction:: cuda.bindings.driver.cuGraphicsEGLRegisterImage @@ -7773,6 +8033,10 @@ This section describes the EGL interoperability functions of the low-level CUDA OpenGL Interoperability ----------------------- +MANBRIEF OpenGL interoperability functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + This section describes the OpenGL interoperability functions of the low-level CUDA driver application programming interface. Note that mapping of OpenGL resources is performed with the graphics API agnostic, resource mapping interface described in Graphics Interoperability. .. autoclass:: cuda.bindings.driver.CUGLDeviceList @@ -7798,16 +8062,12 @@ This section describes the OpenGL interoperability functions of the low-level CU .. autofunction:: cuda.bindings.driver.cuGraphicsGLRegisterImage .. autofunction:: cuda.bindings.driver.cuGLGetDevices -Profiler Control ----------------- +VDPAU Interoperability +---------------------- -This section describes the profiler control functions of the low-level CUDA driver application programming interface. +MANBRIEF VDPAU interoperability functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF -.. autofunction:: cuda.bindings.driver.cuProfilerStart -.. autofunction:: cuda.bindings.driver.cuProfilerStop -VDPAU Interoperability ----------------------- This section describes the VDPAU interoperability functions of the low-level CUDA driver application programming interface. diff --git a/cuda_bindings/docs/source/module/nvfatbin.rst b/cuda_bindings/docs/source/module/nvfatbin.rst index 297d4baa853..1455cf6ba50 100644 --- a/cuda_bindings/docs/source/module/nvfatbin.rst +++ b/cuda_bindings/docs/source/module/nvfatbin.rst @@ -1,5 +1,5 @@ .. SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-License-Identifier: Apache-2.0 .. default-role:: cpp:any diff --git a/cuda_bindings/docs/source/module/nvjitlink.rst b/cuda_bindings/docs/source/module/nvjitlink.rst index ff9bb1ea521..271fc4424bc 100644 --- a/cuda_bindings/docs/source/module/nvjitlink.rst +++ b/cuda_bindings/docs/source/module/nvjitlink.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 .. default-role:: cpp:any diff --git a/cuda_bindings/docs/source/module/nvml.rst b/cuda_bindings/docs/source/module/nvml.rst new file mode 100644 index 00000000000..c5d47ad1670 --- /dev/null +++ b/cuda_bindings/docs/source/module/nvml.rst @@ -0,0 +1,627 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. default-role:: cpp:any +.. module:: cuda.bindings.nvml + +nvml +==== + +The ``cuda.bindings.nvml`` Python module wraps the +`NVIDIA Management Library (NVML) APIs `_. + +Functions +--------- + +.. autosummary:: + :toctree: generated/ + + compute_instance_destroy + compute_instance_get_info_v2 + device_clear_accounting_pids + device_clear_cpu_affinity + device_clear_ecc_error_counts + device_clear_field_values + device_create_gpu_instance + device_create_gpu_instance_with_placement + device_discover_gpus + device_get_accounting_buffer_size + device_get_accounting_mode + device_get_accounting_pids + device_get_accounting_stats + device_get_active_vgpus + device_get_adaptive_clock_info_status + device_get_addressing_mode + device_get_api_restriction + device_get_architecture + device_get_attributes_v2 + device_get_auto_boosted_clocks_enabled + device_get_bar1_memory_info + device_get_board_id + device_get_board_part_number + device_get_brand + device_get_bridge_chip_info + device_get_bus_type + device_get_c2c_mode_info_v + device_get_capabilities + device_get_clk_mon_status + device_get_clock + device_get_clock_info + device_get_clock_offsets + device_get_compute_instance_id + device_get_compute_mode + device_get_compute_running_processes_v3 + device_get_conf_compute_gpu_attestation_report + device_get_conf_compute_gpu_certificate + device_get_conf_compute_mem_size_info + device_get_conf_compute_protected_memory_usage + device_get_cooler_info + device_get_count_v2 + device_get_cpu_affinity + device_get_cpu_affinity_within_scope + device_get_creatable_vgpus + device_get_cuda_compute_capability + device_get_curr_pcie_link_generation + device_get_curr_pcie_link_width + device_get_current_clock_freqs + device_get_current_clocks_event_reasons + device_get_decoder_utilization + device_get_default_ecc_mode + device_get_device_handle_from_mig_device_handle + device_get_display_active + device_get_display_mode + device_get_dram_encryption_mode + device_get_driver_model_v2 + device_get_dynamic_pstates_info + device_get_ecc_mode + device_get_encoder_capacity + device_get_encoder_sessions + device_get_encoder_stats + device_get_encoder_utilization + device_get_enforced_power_limit + device_get_fan_control_policy_v2 + device_get_fan_speed + device_get_fan_speed_rpm + device_get_fan_speed_v2 + device_get_fbc_sessions + device_get_fbc_stats + device_get_field_values + device_get_gpc_clk_min_max_vf_offset + device_get_gpc_clk_vf_offset + device_get_gpu_fabric_info_v + device_get_gpu_instance_by_id + device_get_gpu_instance_id + device_get_gpu_instance_possible_placements_v2 + device_get_gpu_instance_profile_info_by_id_v + device_get_gpu_instance_profile_info_v + device_get_gpu_instance_remaining_capacity + device_get_gpu_instances + device_get_gpu_max_pcie_link_generation + device_get_gpu_operation_mode + device_get_grid_licensable_features_v4 + device_get_gsp_firmware_mode + device_get_gsp_firmware_version + device_get_handle_by_index_v2 + device_get_handle_by_pci_bus_id_v2 + device_get_handle_by_serial + device_get_handle_by_uuid + device_get_handle_by_uuidv + device_get_host_vgpu_mode + device_get_hostname_v1 + device_get_index + device_get_inforom_configuration_checksum + device_get_inforom_image_version + device_get_inforom_version + device_get_irq_num + device_get_jpg_utilization + device_get_last_bbx_flush_time + device_get_margin_temperature + device_get_max_clock_info + device_get_max_customer_boost_clock + device_get_max_mig_device_count + device_get_max_pcie_link_generation + device_get_max_pcie_link_width + device_get_mem_clk_min_max_vf_offset + device_get_mem_clk_vf_offset + device_get_memory_affinity + device_get_memory_bus_width + device_get_memory_error_counter + device_get_memory_info_v2 + device_get_mig_device_handle_by_index + device_get_mig_mode + device_get_min_max_clock_of_p_state + device_get_min_max_fan_speed + device_get_minor_number + device_get_module_id + device_get_mps_compute_running_processes_v3 + device_get_multi_gpu_board + device_get_name + device_get_num_fans + device_get_num_gpu_cores + device_get_numa_node_id + device_get_nvlink_bw_mode + device_get_nvlink_capability + device_get_nvlink_error_counter + device_get_nvlink_info + device_get_nvlink_remote_device_type + device_get_nvlink_remote_pci_info_v2 + device_get_nvlink_state + device_get_nvlink_supported_bw_modes + device_get_nvlink_version + device_get_ofa_utilization + device_get_p2p_status + device_get_pci_info_ext + device_get_pci_info_v3 + device_get_pcie_link_max_speed + device_get_pcie_replay_counter + device_get_pcie_speed + device_get_pcie_throughput + device_get_pdi + device_get_performance_modes + device_get_performance_state + device_get_persistence_mode + device_get_pgpu_metadata_string + device_get_platform_info + device_get_power_management_default_limit + device_get_power_management_limit + device_get_power_management_limit_constraints + device_get_power_mizer_mode_v1 + device_get_power_source + device_get_power_state + device_get_power_usage + device_get_process_utilization + device_get_processes_utilization_info + device_get_remapped_rows + device_get_repair_status + device_get_retired_pages + device_get_retired_pages_pending_status + device_get_retired_pages_v2 + device_get_row_remapper_histogram + device_get_running_process_detail_list + device_get_samples + device_get_serial + device_get_sram_ecc_error_status + device_get_sram_unique_uncorrected_ecc_error_counts + device_get_supported_clocks_event_reasons + device_get_supported_event_types + device_get_supported_graphics_clocks + device_get_supported_memory_clocks + device_get_supported_performance_states + device_get_supported_vgpus + device_get_target_fan_speed + device_get_temperature_threshold + device_get_temperature_v + device_get_thermal_settings + device_get_topology_common_ancestor + device_get_topology_nearest_gpus + device_get_total_ecc_errors + device_get_total_energy_consumption + device_get_unrepairable_memory_flag_v1 + device_get_utilization_rates + device_get_uuid + device_get_vbios_version + device_get_vgpu_capabilities + device_get_vgpu_heterogeneous_mode + device_get_vgpu_instances_utilization_info + device_get_vgpu_metadata + device_get_vgpu_process_utilization + device_get_vgpu_processes_utilization_info + device_get_vgpu_scheduler_capabilities + device_get_vgpu_scheduler_log + device_get_vgpu_scheduler_state + device_get_vgpu_type_creatable_placements + device_get_vgpu_type_supported_placements + device_get_vgpu_utilization + device_get_virtualization_mode + device_is_mig_device_handle + device_modify_drain_state + device_on_same_board + device_power_smoothing_activate_preset_profile + device_power_smoothing_set_state + device_power_smoothing_update_preset_profile_param + device_query_drain_state + device_read_prm_counters_v1 + device_read_write_prm_v1 + device_register_events + device_remove_gpu_v2 + device_reset_gpu_locked_clocks + device_reset_memory_locked_clocks + device_reset_nvlink_error_counters + device_set_accounting_mode + device_set_api_restriction + device_set_auto_boosted_clocks_enabled + device_set_clock_offsets + device_set_compute_mode + device_set_conf_compute_unprotected_mem_size + device_set_cpu_affinity + device_set_default_auto_boosted_clocks_enabled + device_set_default_fan_speed_v2 + device_set_dram_encryption_mode + device_set_driver_model + device_set_ecc_mode + device_set_fan_control_policy + device_set_fan_speed_v2 + device_set_gpu_locked_clocks + device_set_gpu_operation_mode + device_set_hostname_v1 + device_set_memory_locked_clocks + device_set_mig_mode + device_set_nvlink_bw_mode + device_set_nvlink_device_low_power_threshold + device_set_persistence_mode + device_set_power_management_limit_v2 + device_set_power_mizer_mode_v1 + device_set_rusd_settings_v1 + device_set_temperature_threshold + device_set_vgpu_capabilities + device_set_vgpu_heterogeneous_mode + device_set_vgpu_scheduler_state + device_set_virtualization_mode + device_validate_inforom + error_string + event_set_create + event_set_free + event_set_wait_v2 + get_excluded_device_count + get_excluded_device_info_by_index + get_vgpu_compatibility + get_vgpu_driver_capabilities + get_vgpu_version + gpu_instance_create_compute_instance + gpu_instance_create_compute_instance_with_placement + gpu_instance_destroy + gpu_instance_get_active_vgpus + gpu_instance_get_compute_instance_by_id + gpu_instance_get_compute_instance_possible_placements + gpu_instance_get_compute_instance_profile_info_v + gpu_instance_get_compute_instance_remaining_capacity + gpu_instance_get_compute_instances + gpu_instance_get_creatable_vgpus + gpu_instance_get_info + gpu_instance_get_vgpu_heterogeneous_mode + gpu_instance_get_vgpu_scheduler_log + gpu_instance_get_vgpu_scheduler_state + gpu_instance_get_vgpu_type_creatable_placements + gpu_instance_set_vgpu_heterogeneous_mode + gpu_instance_set_vgpu_scheduler_state + init_v2 + init_with_flags + set_vgpu_version + shutdown + system_event_set_create + system_event_set_free + system_event_set_wait + system_get_conf_compute_capabilities + system_get_conf_compute_gpus_ready_state + system_get_conf_compute_key_rotation_threshold_info + system_get_conf_compute_settings + system_get_conf_compute_state + system_get_cuda_driver_version + system_get_cuda_driver_version_v2 + system_get_driver_branch + system_get_driver_version + system_get_hic_version + system_get_nvlink_bw_mode + system_get_nvml_version + system_get_process_name + system_get_topology_gpu_set + system_register_events + system_set_conf_compute_gpus_ready_state + system_set_conf_compute_key_rotation_threshold_info + system_set_nvlink_bw_mode + unit_get_count + unit_get_devices + unit_get_fan_speed_info + unit_get_handle_by_index + unit_get_led_state + unit_get_psu_info + unit_get_temperature + unit_get_unit_info + unit_set_led_state + vgpu_instance_clear_accounting_pids + vgpu_instance_get_accounting_mode + vgpu_instance_get_accounting_pids + vgpu_instance_get_accounting_stats + vgpu_instance_get_ecc_mode + vgpu_instance_get_encoder_capacity + vgpu_instance_get_encoder_sessions + vgpu_instance_get_encoder_stats + vgpu_instance_get_fb_usage + vgpu_instance_get_fbc_sessions + vgpu_instance_get_fbc_stats + vgpu_instance_get_frame_rate_limit + vgpu_instance_get_gpu_instance_id + vgpu_instance_get_gpu_pci_id + vgpu_instance_get_license_info_v2 + vgpu_instance_get_license_status + vgpu_instance_get_mdev_uuid + vgpu_instance_get_metadata + vgpu_instance_get_placement_id + vgpu_instance_get_runtime_state_size + vgpu_instance_get_type + vgpu_instance_get_uuid + vgpu_instance_get_vm_driver_version + vgpu_instance_get_vm_id + vgpu_instance_set_encoder_capacity + vgpu_type_get_bar1_info + vgpu_type_get_capabilities + vgpu_type_get_class + vgpu_type_get_device_id + vgpu_type_get_fb_reservation + vgpu_type_get_frame_rate_limit + vgpu_type_get_framebuffer_size + vgpu_type_get_gpu_instance_profile_id + vgpu_type_get_gsp_heap_size + vgpu_type_get_license + vgpu_type_get_max_instances + vgpu_type_get_max_instances_per_gpu_instance + vgpu_type_get_max_instances_per_vm + vgpu_type_get_name + vgpu_type_get_num_display_heads + vgpu_type_get_resolution + +Enums +----- + +.. autosummary:: + :toctree: generated/ + + AdaptiveClockingInfoStatus + AffinityScope + BrandType + BridgeChipType + BusType + C2CPowerState + CCAcceptingClientRequests + CCSystemCpuCaps + CCSystemDevtoolsMode + CCSystemEnvironment + CCSystemFeature + CCSystemGpus + CCSystemMultiGpu + ClockId + ClockLimitId + ClocksEventReasons + ClockType + ComputeInstanceEngineProfile + ComputeInstanceProfile + ComputeInstanceProfileCaps + ComputeMode + CoolerControl + CoolerTarget + DetachGpuState + DeviceAddressingModeType + DeviceArch + DeviceGpuRecoveryAction + DeviceMig + DeviceVgpuCapability + DriverModel + EccCounterType + EnableState + EncoderQuery + EncoderType + EventType + FanControlPolicy + FanState + FBCSessionType + FieldId + GpmMetricId + GpuFabricHealthMaskAccessTimeout + GpuFabricHealthMaskDegradedBw + GpuFabricHealthMaskIncorrectConfiguration + GpuFabricHealthMaskRouteRecovery + GpuFabricHealthMaskRouteUnhealthy + GpuFabricHealthSummary + GpuFabricState + GpuInstanceProfile + GpuInstanceProfileCaps + GpuOperationMode + GpuP2PCapsIndex + GpuP2PStatus + GpuTopologyLevel + GpuUtilizationDomainId + GpuVirtualizationMode + GridLicenseExpiryEnum + GridLicenseFeatureCode + GridLicenseState + HostVgpuMode + InforomObject + InitFlag + IntNvLinkDeviceType + LedColor + MemoryErrorType + MemoryLocation + NvFBCSessionFlag + NvLinkCapability + NvLinkErrorCounter + NvlinkFirmwareUcodeType + NvlinkLowPowerThreshold + NvlinkLowPowerThresholdUnit + NvlinkPowerState + NvlinkState + NvLinkUtilizationCountPktTypes + NvLinkUtilizationCountUnits + NvlinkVersion + PageRetirementCause + PcieAtomicsCap + PcieLinkMaxSpeed + PcieLinkState + PcieUtilCounter + PerfPolicyType + PowerMizerMode + PowerProfileOperation + PowerProfileType + PowerScope + PowerSmoothingProfileParam + PowerSource + PRMCounterId + Pstates + RestrictedAPI + Return + RUSD + SamplingType + SystemEventType + TemperatureSensors + TemperatureThresholds + ThermalController + ThermalTarget + UUIDType + ValueType + VgpuCapability + VgpuDriverCapability + VgpuGuestInfoState + VgpuPgpu + VgpuPgpuCompatibilityLimitCode + VgpuPgpuVirtualizationCapMigration + VgpuSchedulerArr + VgpuSchedulerEngineType + VgpuSchedulerPolicy + VgpuVirtualizationCapMigration + VgpuVmCompatibility + VgpuVmIdType + +Types +----- + +.. autosummary:: + :toctree: generated/ + + AccountingStats + ActiveVgpuInstanceInfo_v1 + BAR1Memory + BridgeChipHierarchy + BridgeChipInfo + C2cModeInfo_v1 + ClkMonFaultInfo + ClkMonStatus + ClockOffset_v1 + ComputeInstanceInfo + ComputeInstancePlacement + ComputeInstanceProfileInfo_v2 + ComputeInstanceProfileInfo_v3 + ConfComputeGpuAttestationReport + ConfComputeGpuCertificate + ConfComputeMemSizeInfo + ConfComputeSystemCaps + ConfComputeSystemState + CoolerInfo_v1 + DeviceAddressingMode_v1 + DeviceAttributes + DevicePowerMizerModes_v1 + EccSramErrorStatus_v1 + EccSramUniqueUncorrectedErrorCounts_v1 + EccSramUniqueUncorrectedErrorEntry_v1 + EncoderSessionInfo + EventData + ExcludedDeviceInfo + FBCSessionInfo + FBCStats + FieldValue + GpuDynamicPstatesInfo + GpuFabricInfo_v2 + GpuFabricInfo_v3 + GpuInstanceInfo + GpuInstancePlacement + GpuInstanceProfileInfo_v3 + GpuThermalSettings + GridLicensableFeature + GridLicensableFeatures + GridLicenseExpiry + HwbcEntry + LedState + Memory + Memory_v2 + NvlinkFirmwareInfo + NvlinkFirmwareVersion + NvlinkGetBwMode_v1 + NvLinkInfo_v1 + NvLinkInfo_v2 + NvlinkSetBwMode_v1 + NvlinkSupportedBwModes_v1 + PciInfo + PciInfoExt_v1 + PlatformInfo_v1 + PlatformInfo_v2 + PRMCounter_v1 + PRMCounterInput_v1 + PRMCounterValue_v1 + ProcessDetail_v1 + ProcessDetailList_v1 + ProcessesUtilizationInfo_v1 + ProcessInfo + ProcessUtilizationInfo_v1 + ProcessUtilizationSample + PSUInfo + RepairStatus_v1 + RowRemapperHistogramValues + Sample + SystemConfComputeSettings_v1 + SystemEventData_v1 + UnitFanInfo + UnitFanSpeeds + UnitInfo + Utilization + Value + VgpuCreatablePlacementInfo_v1 + VgpuInstancesUtilizationInfo_v1 + VgpuInstanceUtilizationInfo_v1 + VgpuInstanceUtilizationSample + VgpuLicenseExpiry + VgpuLicenseInfo + VgpuMetadata + VgpuPgpuCompatibility + VgpuPgpuMetadata + VgpuPlacementList_v2 + VgpuProcessesUtilizationInfo_v1 + VgpuProcessUtilizationInfo_v1 + VgpuSchedulerCapabilities + VgpuSchedulerGetState + VgpuSchedulerLog + VgpuSchedulerLogEntry + VgpuSchedulerLogInfo_v1 + VgpuSchedulerParams + VgpuSchedulerSetParams + VgpuSchedulerState_v1 + VgpuSchedulerStateInfo_v1 + VgpuTypeBar1Info_v1 + VgpuTypeIdInfo_v1 + VgpuVersion + +Exceptions +---------- + +.. autosummary:: + :toctree: generated/ + + NvmlError + UninitializedError + InvalidArgumentError + NotSupportedError + NoPermissionError + AlreadyInitializedError + NotFoundError + InsufficientSizeError + InsufficientPowerError + DriverNotLoadedError + TimeoutError + IrqIssueError + LibraryNotFoundError + FunctionNotFoundError + CorruptedInforomError + GpuIsLostError + ResetRequiredError + OperatingSystemError + LibRmVersionMismatchError + InUseError + MemoryError + NoDataError + VgpuEccNotSupportedError + InsufficientResourcesError + FreqNotSupportedError + ArgumentVersionMismatchError + DeprecatedError + NotReadyError + GpuNotFoundError + InvalidStateError + ResetTypeNotSupportedError + UnknownError diff --git a/cuda_bindings/docs/source/module/nvrtc.rst b/cuda_bindings/docs/source/module/nvrtc.rst index 959c37a7f4f..c879f49dc88 100644 --- a/cuda_bindings/docs/source/module/nvrtc.rst +++ b/cuda_bindings/docs/source/module/nvrtc.rst @@ -1,6 +1,7 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 +.. CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=9f44170e12fd85fa04fcd599a18d0b6474ec7920be8f28a5c097000eb3ccb0e0 ----- nvrtc ----- @@ -65,6 +66,9 @@ NVRTC defines the following enumeration type and function for API call error han .. autoattribute:: cuda.bindings.nvrtc.nvrtcResult.NVRTC_ERROR_TIME_TRACE_FILE_WRITE_FAILED + + .. autoattribute:: cuda.bindings.nvrtc.nvrtcResult.NVRTC_ERROR_BUSY + .. autofunction:: cuda.bindings.nvrtc.nvrtcGetErrorString General Information Query @@ -98,6 +102,8 @@ NVRTC defines the following type and functions for actual compilation. .. autofunction:: cuda.bindings.nvrtc.nvrtcAddNameExpression .. autofunction:: cuda.bindings.nvrtc.nvrtcGetLoweredName .. autofunction:: cuda.bindings.nvrtc.nvrtcSetFlowCallback +.. autofunction:: cuda.bindings.nvrtc.nvrtcGetTileIRSize +.. autofunction:: cuda.bindings.nvrtc.nvrtcGetTileIR Precompiled header (PCH) (CUDA 12.8+) ------------------------------------- @@ -109,10 +115,32 @@ NVRTC defines the following function related to PCH. Also see PCH related flags .. autofunction:: cuda.bindings.nvrtc.nvrtcGetPCHCreateStatus .. autofunction:: cuda.bindings.nvrtc.nvrtcGetPCHHeapSizeRequired +Bundled Headers Installation +---------------------------- + +NVRTC defines the following types and functions for bundled headers installation and management. + +.. autoclass:: cuda.bindings.nvrtc.nvrtcBundledHeadersInfo +.. autofunction:: cuda.bindings.nvrtc.nvrtcInstallBundledHeaders +.. autofunction:: cuda.bindings.nvrtc.nvrtcGetBundledHeadersInfo +.. autofunction:: cuda.bindings.nvrtc.nvrtcRemoveBundledHeaders +.. autoattribute:: cuda.bindings.nvrtc.NVRTC_INSTALL_HEADERS_SKIP_IF_EXISTS + + Flags for nvrtcInstallBundledHeaders.Skip installation if version marker exists and version matches. This is the default behavior when flags=0. + +.. autoattribute:: cuda.bindings.nvrtc.NVRTC_INSTALL_HEADERS_FORCE_OVERWRITE + + Clear existing directory contents before installation. Guarantees consistency by removing any existing files first. + +.. autoattribute:: cuda.bindings.nvrtc.NVRTC_INSTALL_HEADERS_NO_WAIT + + Return NVRTC_ERROR_BUSY immediately if installation is in progress by another process, instead of waiting for the lock. Can be combined with FORCE_OVERWRITE using bitwise OR. + + 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_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. +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. @@ -128,7 +156,7 @@ The valid compiler options are: - - ``--gpu-architecture=``\ (``-arch``\ ) + - ``--gpu-architecture=`` (``-arch``) Specify the name of the class of GPU architectures for which the input must be compiled. @@ -148,9 +176,9 @@ Specify the name of the class of GPU architectures for which the input must be c - - ``--device-c``\ (``-dc``\ ) + - ``--device-c`` (``-dc``) -Generate relocatable code that can be linked with other relocatable device code. It is equivalent to ``--relocatable-device-code=true``\ . +Generate relocatable code that can be linked with other relocatable device code. It is equivalent to ``--relocatable-device-code=true``. @@ -158,9 +186,9 @@ Generate relocatable code that can be linked with other relocatable device code. - - ``--device-w``\ (``-dw``\ ) + - ``--device-w`` (``-dw``) -Generate non-relocatable code. It is equivalent to ``--relocatable-device-code=false``\ . +Generate non-relocatable code. It is equivalent to ``--relocatable-device-code=false``. @@ -168,7 +196,7 @@ Generate non-relocatable code. It is equivalent to ``--relocatable-device-code=f - - ``--relocatable-device-code={true|false}``\ (``-rdc``\ ) + - ``--relocatable-device-code={true|false}`` (``-rdc``) Enable (disable) the generation of relocatable device code. @@ -178,7 +206,7 @@ Enable (disable) the generation of relocatable device code. - - ``--extensible-whole-program``\ (``-ewp``\ ) + - ``--extensible-whole-program`` (``-ewp``) Do extensible whole program compilation of device code. @@ -190,15 +218,75 @@ Do extensible whole program compilation of device code. +- Tile compilation + + + + + + - ``--enable-tile`` (``-enable-tile``) + +Enable support for Tile constructs (e.g. ``__tile__`` ) and define the macro ``__CUDACC_TILE__`` . + + + + + + + + - ``--tile-only`` (``-tile-only``) + +Enable support for parsing Tile constructs and define the macro ``__CUDACC_TILE__``, but omit code generation for non-Tile code (e.g. ``__global__`` function). + + + + + + + + - ``--simt-only`` (``-simt-only``) + +Enable support for parsing Tile constructs and define the macro ``__CUDACC_TILE__``, but omit code generation for Tile code (e.g. ``__tile_global__`` function). + + + + + + + + - ``--default-tile`` (``--default-tile``) + +Consider an unannotated function or static storage duration variable as having an implicit ``__tile__`` annotation. If the static storage duration variable violates Tile restrictions (e.g. cannot be of pointer type), then the implicit annotation is silently omitted by default; use ``-diagnose-implicit-tile-var`` to enable compiler diagnostics for such cases. + +``-default-tile`` can be used in conjunction with ``-default-device``. If both flags are specified, the unannotated function and/or static storage duration variable will be considered to have both ``__tile__`` and ``__device__`` implict annotations. There will be a separate copy of the function/variable in the generated SIMT and cuda_tile programs, at present. + + + + + + + + - ``--diagnose-implicit-tile-var`` (``-diagnose-implicit-tile-var``) + +When combined with ``-default-tile``, diagnose static storage duration variables that could not be implicitly annotated with the ``__tile__`` memory space specifier (e.g., due to pointer type restrictions). + + + + + + + + + - Debugging support - - ``--device-debug``\ (``-G``\ ) + - ``--device-debug`` (``-G``) -Generate debug information. If ``--dopt``\ is not specified, then turns off all optimizations. +Generate debug information. If ``--dopt`` is not specified, then turns off all optimizations. @@ -206,7 +294,7 @@ Generate debug information. If ``--dopt``\ is not specified, then turns off all - - ``--generate-line-info``\ (``-lineinfo``\ ) + - ``--generate-line-info`` (``-lineinfo``) Generate line-number information. @@ -224,7 +312,7 @@ Generate line-number information. - - ``--dopt``\ ``on``\ (``-dopt``\ ) + - ``--dopt`` ``on`` (``-dopt``) @@ -232,9 +320,9 @@ Generate line-number information. - - ``--dopt=on``\ + - ``--dopt=on`` -Enable device code optimization. When specified along with ``-G``\ , enables limited debug information generation for optimized device code (currently, only line number information). When ``-G``\ is not specified, ``-dopt=on``\ is implicit. +Enable device code optimization. When specified along with ``-G``, enables limited debug information generation for optimized device code (currently, only line number information). When ``-G`` is not specified, ``-dopt=on`` is implicit. @@ -242,7 +330,7 @@ Enable device code optimization. When specified along with ``-G``\ , enables lim - - ``--Ofast-compile={0|min|mid|max}``\ (``-Ofc``\ ) + - ``--Ofast-compile={0|min|mid|max}`` (``-Ofc``) Specify the fast-compile level for device code, which controls the tradeoff between compilation speed and runtime performance by disabling certain optimizations at varying levels. @@ -252,7 +340,7 @@ Specify the fast-compile level for device code, which controls the tradeoff betw - - ``--ptxas-options``\ (``-Xptxas``\ ) + - ``--ptxas-options`` (``-Xptxas``) @@ -260,7 +348,7 @@ Specify the fast-compile level for device code, which controls the tradeoff betw - - ``--ptxas-options=``\ + - ``--ptxas-options=`` Specify options directly to ptxas, the PTX optimizing assembler. @@ -270,7 +358,7 @@ Specify options directly to ptxas, the PTX optimizing assembler. - - ``--maxrregcount=``\ (``-maxrregcount``\ ) + - ``--maxrregcount=`` (``-maxrregcount``) Specify the maximum amount of registers that GPU functions can use. Until a function-specific limit, a higher value will generally increase the performance of individual GPU threads that execute this function. However, because thread registers are allocated from a global register pool on each GPU, a higher value of this option will also reduce the maximum thread block size, thereby reducing the amount of thread parallelism. Hence, a good maxrregcount value is the result of a trade-off. If this option is not specified, then no maximum is assumed. Value less than the minimum registers required by ABI will be bumped up by the compiler to ABI minimum limit. @@ -280,11 +368,11 @@ Specify the maximum amount of registers that GPU functions can use. Until a func - - ``--ftz={true|false}``\ (``-ftz``\ ) + - ``--ftz={true|false}`` (``-ftz``) When performing single-precision floating-point operations, flush denormal values to zero or preserve denormal values. -``--use_fast_math``\ implies ``--ftz=true``\ . +``--use_fast_math`` implies ``--ftz=true``. @@ -292,9 +380,9 @@ When performing single-precision floating-point operations, flush denormal value - - ``--prec-sqrt={true|false}``\ (``-prec-sqrt``\ ) + - ``--prec-sqrt={true|false}`` (``-prec-sqrt``) -For single-precision floating-point square root, use IEEE round-to-nearest mode or use a faster approximation. ``--use_fast_math``\ implies ``--prec-sqrt=false``\ . +For single-precision floating-point square root, use IEEE round-to-nearest mode or use a faster approximation. ``--use_fast_math`` implies ``--prec-sqrt=false``. @@ -302,13 +390,13 @@ For single-precision floating-point square root, use IEEE round-to-nearest mode - - ``--prec-div={true|false}``\ (``-prec-div``\ ) For single-precision floating-point division and reciprocals, use IEEE round-to-nearest mode or use a faster approximation. ``--use_fast_math``\ implies ``--prec-div=false``\ . + - ``--prec-div={true|false}`` (``-prec-div``) For single-precision floating-point division and reciprocals, use IEEE round-to-nearest mode or use a faster approximation. ``--use_fast_math`` implies ``--prec-div=false``. - - Default: ``true``\ + - Default: ``true`` @@ -318,9 +406,9 @@ For single-precision floating-point square root, use IEEE round-to-nearest mode - - ``--fmad={true|false}``\ (``-fmad``\ ) + - ``--fmad={true|false}`` (``-fmad``) -Enables (disables) the contraction of floating-point multiplies and adds/subtracts into floating-point multiply-add operations (FMAD, FFMA, or DFMA). ``--use_fast_math``\ implies ``--fmad=true``\ . +Enables (disables) the contraction of floating-point multiplies and adds/subtracts into floating-point multiply-add operations (FMAD, FFMA, or DFMA). ``--use_fast_math`` implies ``--fmad=true``. @@ -328,9 +416,9 @@ Enables (disables) the contraction of floating-point multiplies and adds/subtrac - - ``--use_fast_math``\ (``-use_fast_math``\ ) + - ``--use_fast_math`` (``-use_fast_math``) -Make use of fast math operations. ``--use_fast_math``\ implies ``--ftz=true``\ ``--prec-div=false``\ ``--prec-sqrt=false``\ ``--fmad=true``\ . +Make use of fast math operations. ``--use_fast_math`` implies ``--ftz=true`` ``--prec-div=false`` ``--prec-sqrt=false`` ``--fmad=true``. @@ -338,7 +426,7 @@ Make use of fast math operations. ``--use_fast_math``\ implies ``--ftz=true``\ - - ``--extra-device-vectorization``\ (``-extra-device-vectorization``\ ) + - ``--extra-device-vectorization`` (``-extra-device-vectorization``) Enables more aggressive device code vectorization in the NVVM optimizer. @@ -348,9 +436,9 @@ Enables more aggressive device code vectorization in the NVVM optimizer. - - ``--modify-stack-limit={true|false}``\ (``-modify-stack-limit``\ ) + - ``--modify-stack-limit={true|false}`` (``-modify-stack-limit``) -On Linux, during compilation, use ``setrlimit()``\ to increase stack size to maximum allowed. The limit is reset to the previous value at the end of compilation. Note: ``setrlimit()``\ changes the value for the entire process. +On Linux, during compilation, use ``setrlimit()`` to increase stack size to maximum allowed. The limit is reset to the previous value at the end of compilation. Note: ``setrlimit()`` changes the value for the entire process. @@ -358,9 +446,9 @@ On Linux, during compilation, use ``setrlimit()``\ to increase stack size to ma - - ``--dlink-time-opt``\ (``-dlto``\ ) + - ``--dlink-time-opt`` (``-dlto``) -Generate intermediate code for later link-time optimization. It implies ``-rdc=true``\ . Note: when this option is used the ``nvrtcGetLTOIR``\ API should be used, as PTX or Cubin will not be generated. +Generate intermediate code for later link-time optimization. It implies ``-rdc=true``. Note: when this option is used the ``nvrtcGetLTOIR`` API should be used, as PTX or Cubin will not be generated. @@ -368,7 +456,7 @@ Generate intermediate code for later link-time optimization. It implies ``-rdc=t - - ``--gen-opt-lto``\ (``-gen-opt-lto``\ ) + - ``--gen-opt-lto`` (``-gen-opt-lto``) Run the optimizer passes before generating the LTO IR. @@ -378,9 +466,9 @@ Run the optimizer passes before generating the LTO IR. - - ``--optix-ir``\ (``-optix-ir``\ ) + - ``--optix-ir`` (``-optix-ir``) -Generate OptiX IR. The Optix IR is only intended for consumption by OptiX through appropriate APIs. This feature is not supported with link-time-optimization (``-dlto``\ ). +Generate OptiX IR. The Optix IR is only intended for consumption by OptiX through appropriate APIs. This feature is not supported with link-time-optimization (``-dlto``). Note: when this option is used the nvrtcGetOptiX API should be used, as PTX or Cubin will not be generated. @@ -390,7 +478,7 @@ Note: when this option is used the nvrtcGetOptiX API should be used, as PTX or C - - ``--jump-table-density=``\ [0-101] (``-jtd``\ ) + - ``--jump-table-density=``\[0-101] (``-jtd``) Specify the case density percentage in switch statements, and use it as a minimal threshold to determine whether jump table(brx.idx instruction) will be used to implement a switch statement. Default value is 101. The percentage ranges from 0 to 101 inclusively. @@ -400,7 +488,7 @@ Specify the case density percentage in switch statements, and use it as a minima - - ``--device-stack-protector={true|false}``\ (``-device-stack-protector``\ ) + - ``--device-stack-protector={true|false}`` (``-device-stack-protector``) Enable (disable) the generation of stack canaries in device code. @@ -410,7 +498,7 @@ Enable (disable) the generation of stack canaries in device code. - - ``--no-cache``\ (``-no-cache``\ ) + - ``--no-cache`` (``-no-cache``) Disable the use of cache for both ptx and cubin code generation. @@ -420,7 +508,7 @@ Disable the use of cache for both ptx and cubin code generation. - - ``--frandom-seed``\ (``-frandom-seed``\ ) + - ``--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 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. @@ -438,9 +526,19 @@ The user specified random seed will be used to replace random numbers used in ge - - ``--define-macro=``\ (``-D``\ ) + - ``--define-macro=`` (``-D``) + +```` can be either ```` or ````. + + + + + + + + - ``--undefine-macro=`` (``-U``) -````\ can be either ````\ or ````\ . +Cancel any previous definition of ````. @@ -448,9 +546,9 @@ The user specified random seed will be used to replace random numbers used in ge - - ``--undefine-macro=``\ (``-U``\ ) + - ``--include-path=`` (``-I``) -Cancel any previous definition of ````\ . +Add the directory ```` to the list of directories to be searched for headers. These paths are searched after the list of headers given to nvrtcCreateProgram. @@ -458,9 +556,9 @@ Cancel any previous definition of ````\ . - - ``--include-path=``\ (``-I``\ ) + - ``--use-bundled-headers=`` -Add the directory ````\ to the list of directories to be searched for headers. These paths are searched after the list of headers given to nvrtcCreateProgram. +Install bundled CUDA headers to ```` and add include paths. This is a convenience flag that combines calling nvrtcInstallBundledHeaders and adding ``-I`` and ``-I/cccl`` to the include search path. Headers are installed only if they don't already exist at the specified location. @@ -468,9 +566,9 @@ Add the directory ````\ to the list of directories to be searched for head - - ``--pre-include=
``\ (``-include``\ ) + - ``--pre-include=
`` (``-include``) -Preinclude ``
``\ during preprocessing. +Preinclude ``
`` during preprocessing. @@ -478,7 +576,7 @@ Preinclude ``
``\ during preprocessing. - - ``--no-source-include``\ (``-no-source-include``\ ) + - ``--no-source-include`` (``-no-source-include``) The preprocessor by default adds the directory of each input sources to the include path. This option disables this feature and only considers the path specified explicitly. @@ -496,7 +594,7 @@ The preprocessor by default adds the directory of each input sources to the incl - - ``--std={c++03|c++11|c++14|c++17|c++20}``\ (``-std``\ ) + - ``--std={c++03|c++11|c++14|c++17|c++20}`` (``-std``) Set language dialect to C++03, C++11, C++14, C++17 or C++20 @@ -506,9 +604,9 @@ Set language dialect to C++03, C++11, C++14, C++17 or C++20 - - ``--builtin-move-forward={true|false}``\ (``-builtin-move-forward``\ ) + - ``--builtin-move-forward={true|false}`` (``-builtin-move-forward``) -Provide builtin definitions of ``std::move``\ and ``std::forward``\ , when C++11 or later language dialect is selected. +Provide builtin definitions of ``std::move`` and ``std::forward``, when C++11 or later language dialect is selected. @@ -516,9 +614,9 @@ Provide builtin definitions of ``std::move``\ and ``std::forward``\ , when C++1 - - ``--builtin-initializer-list={true|false}``\ (``-builtin-initializer-list``\ ) + - ``--builtin-initializer-list={true|false}`` (``-builtin-initializer-list``) -Provide builtin definitions of ``std::initializer_list``\ class and member functions when C++11 or later language dialect is selected. +Provide builtin definitions of ``std::initializer_list`` class and member functions when C++11 or later language dialect is selected. @@ -534,7 +632,7 @@ Provide builtin definitions of ``std::initializer_list``\ class and member func - - ``--pch``\ (``-pch``\ ) + - ``--pch`` (``-pch``) Enable automatic PCH processing. @@ -544,7 +642,7 @@ Enable automatic PCH processing. - - ``--create-pch=``\ (``-create-pch``\ ) + - ``--create-pch=`` (``-create-pch``) Create a PCH file. @@ -554,7 +652,7 @@ Create a PCH file. - - ``--use-pch=``\ (``-use-pch``\ ) + - ``--use-pch=`` (``-use-pch``) Use the specified PCH file. @@ -564,9 +662,9 @@ Use the specified PCH file. - - ``--pch-dir=``\ (``-pch-dir``\ ) + - ``--pch-dir=`` (``-pch-dir``) -When using automatic PCH (``-pch``\ ), look for and create PCH files in the specified directory. When using explicit PCH (``-create-pch``\ or ``-use-pch``\ ), the directory name is prefixed before the specified file name, unless the file name is an absolute path name. +When using automatic PCH (``-pch``), look for and create PCH files in the specified directory. When using explicit PCH (``-create-pch`` or ``-use-pch``), the directory name is prefixed before the specified file name, unless the file name is an absolute path name. @@ -574,7 +672,7 @@ When using automatic PCH (``-pch``\ ), look for and create PCH files in the spec - - ``--pch-verbose={true|false}``\ (``-pch-verbose``\ ) + - ``--pch-verbose={true|false}`` (``-pch-verbose``) In automatic PCH mode, for each PCH file that could not be used in current compilation, print the reason in the compilation log. @@ -584,7 +682,7 @@ In automatic PCH mode, for each PCH file that could not be used in current compi - - ``--pch-messages={true|false}``\ (``-pch-messages``\ ) + - ``--pch-messages={true|false}`` (``-pch-messages``) Print a message in the compilation log, if a PCH file was created or used in the current compilation. @@ -594,7 +692,7 @@ Print a message in the compilation log, if a PCH file was created or used in the - - ``--instantiate-templates-in-pch={true|false}``\ (``-instantiate-templates-in-pch``\ ) + - ``--instantiate-templates-in-pch={true|false}`` (``-instantiate-templates-in-pch``) Enable or disable instantiatiation of templates before PCH creation. Instantiating templates may increase the size of the PCH file, while reducing the compilation cost when using the PCH file (since some template instantiations can be skipped). @@ -612,7 +710,7 @@ Enable or disable instantiatiation of templates before PCH creation. Instantiati - - ``--disable-warnings``\ (``-w``\ ) + - ``--disable-warnings`` (``-w``) Inhibit all warning messages. @@ -622,7 +720,7 @@ Inhibit all warning messages. - - ``--Wreorder``\ (``-Wreorder``\ ) + - ``--Wreorder`` (``-Wreorder``) Generate warnings when member initializers are reordered. @@ -632,7 +730,7 @@ Generate warnings when member initializers are reordered. - - ``--warning-as-error=``\ ,... (``-Werror``\ ) + - ``--warning-as-error=`` ,... (``-Werror``) Make warnings of the specified kinds into errors. The following is the list of warning kinds accepted by this option: @@ -642,7 +740,7 @@ Make warnings of the specified kinds into errors. The following is the list of w - - ``--restrict``\ (``-restrict``\ ) + - ``--restrict`` (``-restrict``) Programmer assertion that all kernel pointer parameters are restrict pointers. @@ -652,9 +750,9 @@ Programmer assertion that all kernel pointer parameters are restrict pointers. - - ``--device-as-default-execution-space``\ (``-default-device``\ ) + - ``--device-as-default-execution-space`` (``-default-device``) -Treat entities with no execution space annotation as ``device``\ entities. +Treat entities with no execution space annotation as ``__device__`` entities. @@ -662,9 +760,9 @@ Treat entities with no execution space annotation as ``device``\ entities. - - ``--device-int128``\ (``-device-int128``\ ) + - ``--device-int128`` (``-device-int128``) -Allow the ``__int128``\ type in device code. Also causes the macro ``CUDACC_RTC_INT128``\ to be defined. +Allow the ``__int128`` type in device code. Also causes the macro ``__CUDACC_RTC_INT128__`` to be defined. @@ -672,9 +770,9 @@ Allow the ``__int128``\ type in device code. Also causes the macro ``CUDACC_RTC - - ``--device-float128``\ (``-device-float128``\ ) + - ``--device-float128`` (``-device-float128``) -Allow the ``__float128``\ and ``_Float128``\ types in device code. Also causes the macro ``D__CUDACC_RTC_FLOAT128__``\ to be defined. +Allow the ``__float128`` and ``_Float128`` types in device code. Also causes the macro ``D__CUDACC_RTC_FLOAT128__`` to be defined. @@ -682,7 +780,7 @@ Allow the ``__float128``\ and ``_Float128``\ types in device code. Also causes - - ``--optimization-info=``\ (``-opt-info``\ ) + - ``--optimization-info=`` (``-opt-info``) Provide optimization reports for the specified kind of optimization. The following kind tags are supported: @@ -692,7 +790,7 @@ Provide optimization reports for the specified kind of optimization. The followi - - ``--display-error-number``\ (``-err-no``\ ) + - ``--display-error-number`` (``-err-no``) Display diagnostic number for warning messages. (Default) @@ -702,7 +800,7 @@ Display diagnostic number for warning messages. (Default) - - ``--no-display-error-number``\ (``-no-err-no``\ ) + - ``--no-display-error-number`` (``-no-err-no``) Disables the display of a diagnostic number for warning messages. @@ -712,7 +810,7 @@ Disables the display of a diagnostic number for warning messages. - - ``--diag-error=``\ ,... (``-diag-error``\ ) + - ``--diag-error=``,... (``-diag-error``) Emit error for specified diagnostic message number(s). Message numbers can be separated by comma. @@ -722,7 +820,7 @@ Emit error for specified diagnostic message number(s). Message numbers can be se - - ``--diag-suppress=``\ ,... (``-diag-suppress``\ ) + - ``--diag-suppress=``,... (``-diag-suppress``) Suppress specified diagnostic message number(s). Message numbers can be separated by comma. @@ -732,7 +830,7 @@ Suppress specified diagnostic message number(s). Message numbers can be separate - - ``--diag-warn=``\ ,... (``-diag-warn``\ ) + - ``--diag-warn=``,... (``-diag-warn``) Emit warning for specified diagnostic message number(s). Message numbers can be separated by comma. @@ -742,9 +840,9 @@ Emit warning for specified diagnostic message number(s). Message numbers can be - - ``--brief-diagnostics={true|false}``\ (``-brief-diag``\ ) + - ``--brief-diagnostics={true|false}`` (``-brief-diag``) -This option disables or enables showing source line and column info in a diagnostic. The ``--brief-diagnostics=true``\ will not show the source line and column info. +This option disables or enables showing source line and column info in a diagnostic. The ``--brief-diagnostics=true`` will not show the source line and column info. @@ -752,7 +850,7 @@ This option disables or enables showing source line and column info in a diagnos - - ``--time=``\ (``-time``\ ) + - ``--time=`` (``-time``) Generate a comma separated value table with the time taken by each compilation phase, and append it at the end of the file given as the option argument. If the file does not exist, the column headings are generated in the first row of the table. If the file name is '-', the timing data is written to the compilation log. @@ -762,9 +860,9 @@ Generate a comma separated value table with the time taken by each compilation p - - ``--split-compile=``\ (``-split-compile=``\ ) + - ``--split-compile=`` (``-split-compile=``) -Perform compiler optimizations in parallel. Split compilation attempts to reduce compile time by enabling the compiler to run certain optimization passes concurrently. This option accepts a numerical value that specifies the maximum number of threads the compiler can use. One can also allow the compiler to use the maximum threads available on the system by setting ``--split-compile=0``\ . Setting ``--split-compile=1``\ will cause this option to be ignored. +Perform compiler optimizations in parallel. Split compilation attempts to reduce compile time by enabling the compiler to run certain optimization passes concurrently. This option accepts a numerical value that specifies the maximum number of threads the compiler can use. One can also allow the compiler to use the maximum threads available on the system by setting ``--split-compile=0``. Setting ``--split-compile=1`` will cause this option to be ignored. @@ -772,7 +870,7 @@ Perform compiler optimizations in parallel. Split compilation attempts to reduce - - ``--fdevice-syntax-only``\ (``-fdevice-syntax-only``\ ) + - ``--fdevice-syntax-only`` (``-fdevice-syntax-only``) Ends device compilation after front-end syntax checking. This option does not generate valid device code. @@ -782,7 +880,7 @@ Ends device compilation after front-end syntax checking. This option does not ge - - ``--minimal``\ (``-minimal``\ ) + - ``--minimal`` (``-minimal``) Omit certain language features to reduce compile time for small programs. In particular, the following are omitted: @@ -792,7 +890,7 @@ Omit certain language features to reduce compile time for small programs. In par - - ``--device-stack-protector``\ (``-device-stack-protector``\ ) + - ``--device-stack-protector`` (``-device-stack-protector``) Enable stack canaries in device code. Stack canaries make it more difficult to exploit certain types of memory safety bugs involving stack-local variables. The compiler uses heuristics to assess the risk of such a bug in each function. Only those functions which are deemed high-risk make use of a stack canary. @@ -802,5 +900,5 @@ Enable stack canaries in device code. Stack canaries make it more difficult to e - - ``--fdevice-time-trace=``\ (``-fdevice-time-trace=``\ ) Enables the time profiler, outputting a JSON file based on given . Results can be analyzed on chrome://tracing for a flamegraph visualization. + - ``--fdevice-time-trace=`` (``-fdevice-time-trace=``) Enables the time profiler, outputting a JSON file based on given . Results can be analyzed on chrome://tracing for a flamegraph visualization. diff --git a/cuda_bindings/docs/source/module/nvvm.rst b/cuda_bindings/docs/source/module/nvvm.rst index de5de88335a..9c0f00abdd3 100644 --- a/cuda_bindings/docs/source/module/nvvm.rst +++ b/cuda_bindings/docs/source/module/nvvm.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 .. default-role:: cpp:any diff --git a/cuda_bindings/docs/source/module/runtime.rst b/cuda_bindings/docs/source/module/runtime.rst index 210af1fe49a..80b11f16644 100644 --- a/cuda_bindings/docs/source/module/runtime.rst +++ b/cuda_bindings/docs/source/module/runtime.rst @@ -1,6336 +1,6539 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 +.. CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=0eccd5db44f7406acb693f5dd95ad2fa17c787c11659578cf54e116eb0b06e01 ------- runtime ------- -Profiler Control ----------------- +Data types used by CUDA Runtime +------------------------------- -This section describes the profiler control functions of the CUDA runtime application programming interface. -.. autofunction:: cuda.bindings.runtime.cudaProfilerStart -.. autofunction:: cuda.bindings.runtime.cudaProfilerStop -Device Management ------------------ +.. autoclass:: cuda.bindings.runtime.cudaChannelFormatDesc +.. autoclass:: cuda.bindings.runtime.cudaArraySparseProperties +.. autoclass:: cuda.bindings.runtime.cudaArrayMemoryRequirements +.. autoclass:: cuda.bindings.runtime.cudaPitchedPtr +.. autoclass:: cuda.bindings.runtime.cudaExtent +.. autoclass:: cuda.bindings.runtime.cudaPos +.. autoclass:: cuda.bindings.runtime.cudaMemcpy3DParms +.. autoclass:: cuda.bindings.runtime.cudaMemcpyNodeParams +.. autoclass:: cuda.bindings.runtime.cudaMemcpy3DPeerParms +.. autoclass:: cuda.bindings.runtime.cudaMemsetParams +.. autoclass:: cuda.bindings.runtime.cudaMemsetParamsV2 +.. autoclass:: cuda.bindings.runtime.cudaAccessPolicyWindow +.. autoclass:: cuda.bindings.runtime.cudaHostNodeParams +.. autoclass:: cuda.bindings.runtime.cudaHostNodeParamsV2 +.. autoclass:: cuda.bindings.runtime.cudaResourceDesc +.. autoclass:: cuda.bindings.runtime.cudaResourceViewDesc +.. autoclass:: cuda.bindings.runtime.cudaPointerAttributes +.. autoclass:: cuda.bindings.runtime.cudaFuncAttributes +.. autoclass:: cuda.bindings.runtime.cudaMemLocation +.. autoclass:: cuda.bindings.runtime.cudaMemAccessDesc +.. autoclass:: cuda.bindings.runtime.cudaMemPoolProps +.. autoclass:: cuda.bindings.runtime.cudaMemPoolPtrExportData +.. autoclass:: cuda.bindings.runtime.cudaMemAllocNodeParams +.. autoclass:: cuda.bindings.runtime.cudaMemAllocNodeParamsV2 +.. autoclass:: cuda.bindings.runtime.cudaMemFreeNodeParams +.. autoclass:: cuda.bindings.runtime.cudaMemcpyAttributes +.. autoclass:: cuda.bindings.runtime.cudaOffset3D +.. autoclass:: cuda.bindings.runtime.cudaMemcpy3DOperand +.. autoclass:: cuda.bindings.runtime.cudaMemcpy3DBatchOp +.. autoclass:: cuda.bindings.runtime.CUuuid_st +.. autoclass:: cuda.bindings.runtime.cudaDeviceProp +.. autoclass:: cuda.bindings.runtime.cudaIpcEventHandle_st +.. autoclass:: cuda.bindings.runtime.cudaIpcMemHandle_st +.. autoclass:: cuda.bindings.runtime.cudaMemFabricHandle_st +.. autoclass:: cuda.bindings.runtime.cudaExternalMemoryHandleDesc +.. autoclass:: cuda.bindings.runtime.cudaExternalMemoryBufferDesc +.. autoclass:: cuda.bindings.runtime.cudaExternalMemoryMipmappedArrayDesc +.. autoclass:: cuda.bindings.runtime.cudaExternalSemaphoreHandleDesc +.. autoclass:: cuda.bindings.runtime.cudaExternalSemaphoreSignalParams +.. autoclass:: cuda.bindings.runtime.cudaExternalSemaphoreWaitParams +.. autoclass:: cuda.bindings.runtime.cudaDevSmResource +.. autoclass:: cuda.bindings.runtime.cudaDevWorkqueueConfigResource +.. autoclass:: cuda.bindings.runtime.cudaDevWorkqueueResource +.. autoclass:: cuda.bindings.runtime.cudaDevSmResourceGroupParams_st +.. autoclass:: cuda.bindings.runtime.cudaDevResource_st +.. autoclass:: cuda.bindings.runtime.cudalibraryHostUniversalFunctionAndDataTable +.. autoclass:: cuda.bindings.runtime.cudaKernelNodeParams +.. autoclass:: cuda.bindings.runtime.cudaKernelNodeParamsV2 +.. autoclass:: cuda.bindings.runtime.cudaExternalSemaphoreSignalNodeParams +.. autoclass:: cuda.bindings.runtime.cudaExternalSemaphoreSignalNodeParamsV2 +.. autoclass:: cuda.bindings.runtime.cudaExternalSemaphoreWaitNodeParams +.. autoclass:: cuda.bindings.runtime.cudaExternalSemaphoreWaitNodeParamsV2 +.. autoclass:: cuda.bindings.runtime.cudaConditionalNodeParams +.. autoclass:: cuda.bindings.runtime.cudaChildGraphNodeParams +.. autoclass:: cuda.bindings.runtime.cudaEventRecordNodeParams +.. autoclass:: cuda.bindings.runtime.cudaEventWaitNodeParams +.. autoclass:: cuda.bindings.runtime.cudaGraphNodeParams +.. autoclass:: cuda.bindings.runtime.cudaGraphEdgeData_st +.. autoclass:: cuda.bindings.runtime.cudaGraphInstantiateParams_st +.. autoclass:: cuda.bindings.runtime.cudaGraphExecUpdateResultInfo_st +.. autoclass:: cuda.bindings.runtime.cudaGraphKernelNodeUpdate +.. autoclass:: cuda.bindings.runtime.cudaLaunchMemSyncDomainMap_st +.. autoclass:: cuda.bindings.runtime.cudaLaunchAttributeValue +.. autoclass:: cuda.bindings.runtime.cudaLaunchAttribute_st +.. autoclass:: cuda.bindings.runtime.cudaAsyncNotificationInfo +.. autoclass:: cuda.bindings.runtime.cudaTextureDesc +.. autoclass:: cuda.bindings.runtime.cudaEglPlaneDesc_st +.. autoclass:: cuda.bindings.runtime.cudaEglFrame_st +.. autoclass:: cuda.bindings.runtime.cudaError_t -impl_private + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaSuccess + The API call returned with no errors. In the case of query calls, this also means that the operation being queried is complete (see :py:obj:`~.cudaEventQuery()` and :py:obj:`~.cudaStreamQuery()`). + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidValue + This indicates that one or more of the parameters passed to the API call is not within an acceptable range of values. -This section describes the device management functions of the CUDA runtime application programming interface. -.. autofunction:: cuda.bindings.runtime.cudaDeviceReset -.. autofunction:: cuda.bindings.runtime.cudaDeviceSynchronize -.. autofunction:: cuda.bindings.runtime.cudaDeviceSetLimit -.. autofunction:: cuda.bindings.runtime.cudaDeviceGetLimit -.. autofunction:: cuda.bindings.runtime.cudaDeviceGetTexture1DLinearMaxWidth -.. autofunction:: cuda.bindings.runtime.cudaDeviceGetCacheConfig -.. autofunction:: cuda.bindings.runtime.cudaDeviceGetStreamPriorityRange -.. autofunction:: cuda.bindings.runtime.cudaDeviceSetCacheConfig -.. autofunction:: cuda.bindings.runtime.cudaDeviceGetByPCIBusId -.. autofunction:: cuda.bindings.runtime.cudaDeviceGetPCIBusId -.. autofunction:: cuda.bindings.runtime.cudaIpcGetEventHandle -.. autofunction:: cuda.bindings.runtime.cudaIpcOpenEventHandle -.. autofunction:: cuda.bindings.runtime.cudaIpcGetMemHandle -.. autofunction:: cuda.bindings.runtime.cudaIpcOpenMemHandle -.. autofunction:: cuda.bindings.runtime.cudaIpcCloseMemHandle -.. autofunction:: cuda.bindings.runtime.cudaDeviceFlushGPUDirectRDMAWrites -.. autofunction:: cuda.bindings.runtime.cudaDeviceRegisterAsyncNotification -.. autofunction:: cuda.bindings.runtime.cudaDeviceUnregisterAsyncNotification -.. 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 -.. autofunction:: cuda.bindings.runtime.cudaGetDevice -.. autofunction:: cuda.bindings.runtime.cudaSetDeviceFlags -.. autofunction:: cuda.bindings.runtime.cudaGetDeviceFlags + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMemoryAllocation -Error Handling --------------- -This section describes the error handling functions of the CUDA runtime application programming interface. + The API call failed because it was unable to allocate enough memory or other resources to perform the requested operation. -.. autofunction:: cuda.bindings.runtime.cudaGetLastError -.. autofunction:: cuda.bindings.runtime.cudaPeekAtLastError -.. autofunction:: cuda.bindings.runtime.cudaGetErrorName -.. autofunction:: cuda.bindings.runtime.cudaGetErrorString -Stream Management ------------------ + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInitializationError -This section describes the stream management functions of the CUDA runtime application programming interface. -.. autoclass:: cuda.bindings.runtime.cudaStreamCallback_t -.. autofunction:: cuda.bindings.runtime.cudaStreamCreate -.. autofunction:: cuda.bindings.runtime.cudaStreamCreateWithFlags -.. autofunction:: cuda.bindings.runtime.cudaStreamCreateWithPriority -.. autofunction:: cuda.bindings.runtime.cudaStreamGetPriority -.. autofunction:: cuda.bindings.runtime.cudaStreamGetFlags -.. autofunction:: cuda.bindings.runtime.cudaStreamGetId -.. autofunction:: cuda.bindings.runtime.cudaStreamGetDevice -.. autofunction:: cuda.bindings.runtime.cudaCtxResetPersistingL2Cache -.. autofunction:: cuda.bindings.runtime.cudaStreamCopyAttributes -.. autofunction:: cuda.bindings.runtime.cudaStreamGetAttribute -.. autofunction:: cuda.bindings.runtime.cudaStreamSetAttribute -.. autofunction:: cuda.bindings.runtime.cudaStreamDestroy -.. autofunction:: cuda.bindings.runtime.cudaStreamWaitEvent -.. autofunction:: cuda.bindings.runtime.cudaStreamAddCallback -.. autofunction:: cuda.bindings.runtime.cudaStreamSynchronize -.. autofunction:: cuda.bindings.runtime.cudaStreamQuery -.. autofunction:: cuda.bindings.runtime.cudaStreamAttachMemAsync -.. autofunction:: cuda.bindings.runtime.cudaStreamBeginCapture -.. autofunction:: cuda.bindings.runtime.cudaStreamBeginCaptureToGraph -.. autofunction:: cuda.bindings.runtime.cudaThreadExchangeStreamCaptureMode -.. autofunction:: cuda.bindings.runtime.cudaStreamEndCapture -.. autofunction:: cuda.bindings.runtime.cudaStreamIsCapturing -.. autofunction:: cuda.bindings.runtime.cudaStreamGetCaptureInfo -.. autofunction:: cuda.bindings.runtime.cudaStreamUpdateCaptureDependencies + The API call failed because the CUDA driver and runtime could not be initialized. -Event Management ----------------- -This section describes the event management functions of the CUDA runtime application programming interface. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorCudartUnloading -.. autofunction:: cuda.bindings.runtime.cudaEventCreate -.. autofunction:: cuda.bindings.runtime.cudaEventCreateWithFlags -.. autofunction:: cuda.bindings.runtime.cudaEventRecord -.. autofunction:: cuda.bindings.runtime.cudaEventRecordWithFlags -.. autofunction:: cuda.bindings.runtime.cudaEventQuery -.. autofunction:: cuda.bindings.runtime.cudaEventSynchronize -.. autofunction:: cuda.bindings.runtime.cudaEventDestroy -.. autofunction:: cuda.bindings.runtime.cudaEventElapsedTime -External Resource Interoperability ----------------------------------- + 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 section describes the external resource interoperability functions of the CUDA runtime application programming interface. -.. autofunction:: cuda.bindings.runtime.cudaImportExternalMemory -.. autofunction:: cuda.bindings.runtime.cudaExternalMemoryGetMappedBuffer -.. autofunction:: cuda.bindings.runtime.cudaExternalMemoryGetMappedMipmappedArray -.. autofunction:: cuda.bindings.runtime.cudaDestroyExternalMemory -.. autofunction:: cuda.bindings.runtime.cudaImportExternalSemaphore -.. autofunction:: cuda.bindings.runtime.cudaSignalExternalSemaphoresAsync -.. autofunction:: cuda.bindings.runtime.cudaWaitExternalSemaphoresAsync -.. autofunction:: cuda.bindings.runtime.cudaDestroyExternalSemaphore + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorProfilerDisabled -Execution Control ------------------ -This section describes the execution control functions of the CUDA runtime application programming interface. + This indicates profiler is not initialized for this run. This can happen when the application is running with external profiling tools like visual profiler. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorProfilerNotInitialized -Some functions have overloaded C++ API template versions documented separately in the C++ API Routines module. -.. autofunction:: cuda.bindings.runtime.cudaFuncSetCacheConfig -.. autofunction:: cuda.bindings.runtime.cudaFuncGetAttributes -.. autofunction:: cuda.bindings.runtime.cudaFuncSetAttribute -.. autofunction:: cuda.bindings.runtime.cudaFuncGetParamCount -.. autofunction:: cuda.bindings.runtime.cudaLaunchHostFunc -.. autofunction:: cuda.bindings.runtime.cudaLaunchHostFunc_v2 + [Deprecated] -Occupancy ---------- -This section describes the occupancy calculation functions of the CUDA runtime application programming interface. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorProfilerAlreadyStarted + [Deprecated] -Besides the occupancy calculator functions (cudaOccupancyMaxActiveBlocksPerMultiprocessor and cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags), there are also C++ only occupancy-based launch configuration functions documented in C++ API Routines module. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorProfilerAlreadyStopped -See cudaOccupancyMaxPotentialBlockSize (C++ API), cudaOccupancyMaxPotentialBlockSize (C++ API), cudaOccupancyMaxPotentialBlockSizeVariableSMem (C++ API), cudaOccupancyMaxPotentialBlockSizeVariableSMem (C++ API) cudaOccupancyAvailableDynamicSMemPerBlock (C++ API), + [Deprecated] -.. autofunction:: cuda.bindings.runtime.cudaOccupancyMaxActiveBlocksPerMultiprocessor -.. autofunction:: cuda.bindings.runtime.cudaOccupancyAvailableDynamicSMemPerBlock -.. autofunction:: cuda.bindings.runtime.cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags -Memory Management ------------------ + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidConfiguration -This section describes the memory management functions of the CUDA runtime application programming interface. + 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 :py:obj:`~.cudaDeviceProp` for more device limitations. -Some functions have overloaded C++ API template versions documented separately in the C++ API Routines module. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorVersionTranslation -.. autofunction:: cuda.bindings.runtime.cudaMallocManaged -.. autofunction:: cuda.bindings.runtime.cudaMalloc -.. autofunction:: cuda.bindings.runtime.cudaMallocHost -.. autofunction:: cuda.bindings.runtime.cudaMallocPitch -.. autofunction:: cuda.bindings.runtime.cudaMallocArray -.. autofunction:: cuda.bindings.runtime.cudaFree -.. autofunction:: cuda.bindings.runtime.cudaFreeHost -.. autofunction:: cuda.bindings.runtime.cudaFreeArray -.. autofunction:: cuda.bindings.runtime.cudaFreeMipmappedArray -.. autofunction:: cuda.bindings.runtime.cudaHostAlloc -.. autofunction:: cuda.bindings.runtime.cudaHostRegister -.. autofunction:: cuda.bindings.runtime.cudaHostUnregister -.. autofunction:: cuda.bindings.runtime.cudaHostGetDevicePointer -.. autofunction:: cuda.bindings.runtime.cudaHostGetFlags -.. autofunction:: cuda.bindings.runtime.cudaMalloc3D -.. autofunction:: cuda.bindings.runtime.cudaMalloc3DArray -.. autofunction:: cuda.bindings.runtime.cudaMallocMipmappedArray -.. autofunction:: cuda.bindings.runtime.cudaGetMipmappedArrayLevel -.. autofunction:: cuda.bindings.runtime.cudaMemcpy3D -.. autofunction:: cuda.bindings.runtime.cudaMemcpy3DPeer -.. autofunction:: cuda.bindings.runtime.cudaMemcpy3DAsync -.. autofunction:: cuda.bindings.runtime.cudaMemcpy3DPeerAsync -.. autofunction:: cuda.bindings.runtime.cudaMemGetInfo -.. autofunction:: cuda.bindings.runtime.cudaArrayGetInfo -.. autofunction:: cuda.bindings.runtime.cudaArrayGetPlane -.. autofunction:: cuda.bindings.runtime.cudaArrayGetMemoryRequirements -.. autofunction:: cuda.bindings.runtime.cudaMipmappedArrayGetMemoryRequirements -.. autofunction:: cuda.bindings.runtime.cudaArrayGetSparseProperties -.. autofunction:: cuda.bindings.runtime.cudaMipmappedArrayGetSparseProperties -.. autofunction:: cuda.bindings.runtime.cudaMemcpy -.. autofunction:: cuda.bindings.runtime.cudaMemcpyPeer -.. autofunction:: cuda.bindings.runtime.cudaMemcpy2D -.. autofunction:: cuda.bindings.runtime.cudaMemcpy2DToArray -.. autofunction:: cuda.bindings.runtime.cudaMemcpy2DFromArray -.. autofunction:: cuda.bindings.runtime.cudaMemcpy2DArrayToArray -.. autofunction:: cuda.bindings.runtime.cudaMemcpyAsync -.. autofunction:: cuda.bindings.runtime.cudaMemcpyPeerAsync -.. autofunction:: cuda.bindings.runtime.cudaMemcpyBatchAsync -.. autofunction:: cuda.bindings.runtime.cudaMemcpy3DBatchAsync -.. autofunction:: cuda.bindings.runtime.cudaMemcpyWithAttributesAsync -.. autofunction:: cuda.bindings.runtime.cudaMemcpy3DWithAttributesAsync -.. autofunction:: cuda.bindings.runtime.cudaMemcpy2DAsync -.. autofunction:: cuda.bindings.runtime.cudaMemcpy2DToArrayAsync -.. autofunction:: cuda.bindings.runtime.cudaMemcpy2DFromArrayAsync -.. autofunction:: cuda.bindings.runtime.cudaMemset -.. autofunction:: cuda.bindings.runtime.cudaMemset2D -.. autofunction:: cuda.bindings.runtime.cudaMemset3D -.. autofunction:: cuda.bindings.runtime.cudaMemsetAsync -.. autofunction:: cuda.bindings.runtime.cudaMemset2DAsync -.. autofunction:: cuda.bindings.runtime.cudaMemset3DAsync -.. autofunction:: cuda.bindings.runtime.cudaMemPrefetchAsync -.. autofunction:: cuda.bindings.runtime.cudaMemPrefetchBatchAsync -.. autofunction:: cuda.bindings.runtime.cudaMemDiscardBatchAsync -.. autofunction:: cuda.bindings.runtime.cudaMemDiscardAndPrefetchBatchAsync -.. autofunction:: cuda.bindings.runtime.cudaMemAdvise -.. autofunction:: cuda.bindings.runtime.cudaMemRangeGetAttribute -.. autofunction:: cuda.bindings.runtime.cudaMemRangeGetAttributes -.. autofunction:: cuda.bindings.runtime.make_cudaPitchedPtr -.. autofunction:: cuda.bindings.runtime.make_cudaPos -.. autofunction:: cuda.bindings.runtime.make_cudaExtent -Stream Ordered Memory Allocator -------------------------------- + This indicates that the driver is newer than the runtime version and returned graph node parameter information that the runtime does not understand and is unable to translate. -**overview** + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidPitchValue -The asynchronous allocator allows the user to allocate and free in stream order. All asynchronous accesses of the allocation must happen between the stream executions of the allocation and the free. If the memory is accessed outside of the promised stream order, a use before allocation / use after free error will cause undefined behavior. + This indicates that one or more of the pitch-related parameters passed to the API call is not within the acceptable range for pitch. -The allocator is free to reallocate the memory as long as it can guarantee that compliant memory accesses will not overlap temporally. The allocator may refer to internal stream ordering as well as inter-stream dependencies (such as CUDA events and null stream dependencies) when establishing the temporal guarantee. The allocator may also insert inter-stream dependencies to establish the temporal guarantee. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidSymbol + This indicates that the symbol name/identifier passed to the API call is not a valid name or identifier. -**Supported Platforms** + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidHostPointer + This indicates that at least one host pointer passed to the API call is not a valid host pointer. -Whether or not a device supports the integrated stream ordered memory allocator may be queried by calling cudaDeviceGetAttribute() with the device attribute cudaDevAttrMemoryPoolsSupported. + [Deprecated] -.. autofunction:: cuda.bindings.runtime.cudaMallocAsync -.. autofunction:: cuda.bindings.runtime.cudaFreeAsync -.. autofunction:: cuda.bindings.runtime.cudaMemPoolTrimTo -.. autofunction:: cuda.bindings.runtime.cudaMemPoolSetAttribute -.. autofunction:: cuda.bindings.runtime.cudaMemPoolGetAttribute -.. autofunction:: cuda.bindings.runtime.cudaMemPoolSetAccess -.. 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 -.. autofunction:: cuda.bindings.runtime.cudaMemPoolExportPointer -.. autofunction:: cuda.bindings.runtime.cudaMemPoolImportPointer -Unified Addressing ------------------- + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidDevicePointer + + + This indicates that at least one device pointer passed to the API call is not a valid device pointer. + + [Deprecated] + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidTexture + + + This indicates that the texture passed to the API call is not a valid texture. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidTextureBinding + + + This indicates that the texture binding is not valid. This occurs if you call :py:obj:`~.cudaGetTextureAlignmentOffset()` with an unbound texture. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidChannelDescriptor + + + 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 :py:obj:`~.cudaChannelFormatKind`, or if one of the dimensions is invalid. -This section describes the unified addressing functions of the CUDA runtime application programming interface. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidMemcpyDirection + + + This indicates that the direction of the memcpy passed to the API call is not one of the types specified by :py:obj:`~.cudaMemcpyKind`. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorAddressOfConstant + + + This indicated that the user has taken the address of a constant variable, which was forbidden up until the CUDA 3.1 release. + + [Deprecated] + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorTextureFetchFailed + + + This indicated that a texture fetch was not able to be performed. This was previously used for device emulation of texture operations. + + [Deprecated] + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorTextureNotBound + + + This indicated that a texture was not bound for access. This was previously used for device emulation of texture operations. + + [Deprecated] + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorSynchronizationError + + + This indicated that a synchronization operation had failed. This was previously used for some device emulation functions. + + [Deprecated] + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidFilterSetting + + + This indicates that a non-float texture was being accessed with linear filtering. This is not supported by CUDA. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidNormSetting + + + This indicates that an attempt was made to read an unsupported data type as a normalized float. This is not supported by CUDA. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMixedDeviceExecution + + + Mixing of device and device emulation code was not allowed. + + [Deprecated] + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorNotYetImplemented + + + This indicates that the API call is not yet implemented. Production releases of CUDA will never return this error. + + [Deprecated] + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMemoryValueTooLarge + + + This indicated that an emulated device pointer exceeded the 32-bit address range. + + [Deprecated] + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStubLibrary + + + 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.runtime.cudaError_t.cudaErrorInsufficientDriver + + + 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. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorCallRequiresNewerDriver + + + 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.runtime.cudaError_t.cudaErrorInvalidSurface + + + This indicates that the surface passed to the API call is not a valid surface. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorDuplicateVariableName + + + This indicates that multiple global or constant variables (across separate CUDA source files in the application) share the same string name. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorDuplicateTextureName + + + This indicates that multiple textures (across separate CUDA source files in the application) share the same string name. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorDuplicateSurfaceName + + + This indicates that multiple surfaces (across separate CUDA source files in the application) share the same string name. + + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorDevicesUnavailable + This indicates that all CUDA devices are busy or unavailable at the current time. Devices are often busy/unavailable due to use of :py:obj:`~.cudaComputeModeProhibited`, :py:obj:`~.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. -**Overview** + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorIncompatibleDriverContext + 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 :py:obj:`~.Interactions with the CUDA Driver API` for more information. -CUDA devices can share a unified address space with the host. - For these devices there is no distinction between a device pointer and a host pointer -- the same pointer value may be used to access memory from the host program and from a kernel running on the device (with exceptions enumerated below). + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMissingConfiguration + The device function being invoked (usually via :py:obj:`~.cudaLaunchKernel()`) was not previously configured via the :py:obj:`~.cudaConfigureCall()` function. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorPriorLaunchFailure -**Supported Platforms** + This indicated that a previous kernel launch failed. This was previously used for device emulation of kernel launches. + [Deprecated] -Whether or not a device supports unified addressing may be queried by calling cudaGetDeviceProperties() with the device property cudaDeviceProp::unifiedAddressing. -Unified addressing is automatically enabled in 64-bit processes . + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorLaunchMaxDepthExceeded + 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. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorLaunchFileScopedTex -**Looking Up Information from Pointer Values** + 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. -It is possible to look up information about the memory which backs a pointer value. For instance, one may want to know if a pointer points to host or device memory. As another example, in the case of device memory, one may want to know on which CUDA device the memory resides. These properties may be queried using the function cudaPointerGetAttributes() + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorLaunchFileScopedSurf -Since pointers are unique, it is not necessary to specify information about the pointers specified to cudaMemcpy() and other copy functions. - The copy direction cudaMemcpyDefault may be used to specify that the CUDA runtime should infer the location of the pointer from its value. + 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. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorSyncDepthExceeded + This error indicates that a call to :py:obj:`~.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 :py:obj:`~.cudaLimitDevRuntimeSyncDepth`. To be able to synchronize on launched grids at a greater depth successfully, the maximum nested depth at which :py:obj:`~.cudaDeviceSynchronize` will be called must be specified with the :py:obj:`~.cudaLimitDevRuntimeSyncDepth` limit to the :py:obj:`~.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 :py:obj:`~.cudaDeviceSynchronize` made from device runtime is only supported on devices of compute capability < 9.0. -**Automatic Mapping of Host Allocated Host Memory** + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorLaunchPendingCountExceeded -All host memory allocated through all devices using cudaMallocHost() and cudaHostAlloc() is always directly accessible from all devices that support unified addressing. This is the case regardless of whether or not the flags cudaHostAllocPortable and cudaHostAllocMapped are specified. + This error indicates that a device runtime grid launch failed because the launch would exceed the limit :py:obj:`~.cudaLimitDevRuntimePendingLaunchCount`. For this launch to proceed successfully, :py:obj:`~.cudaDeviceSetLimit` must be called to set the :py:obj:`~.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. -The pointer value through which allocated host memory may be accessed in kernels on all devices that support unified addressing is the same as the pointer value through which that memory is accessed on the host. It is not necessary to call cudaHostGetDevicePointer() to get the device pointer for these allocations. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidDeviceFunction -Note that this is not the case for memory allocated using the flag cudaHostAllocWriteCombined, as discussed below. + The requested device function does not exist or is not compiled for the proper device architecture. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorNoDevice + This indicates that no CUDA-capable devices were detected by the installed CUDA driver. -**Direct Access of Peer Memory** + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidDevice -Upon enabling direct access from a device that supports unified addressing to another peer device that supports unified addressing using cudaDeviceEnablePeerAccess() all memory allocated in the peer device using cudaMalloc() and cudaMallocPitch() will immediately be accessible by the current device. The device pointer value through which any peer's memory may be accessed in the current device is the same pointer value through which that memory may be accessed from the peer 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. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorDeviceNotLicensed + This indicates that the device doesn't have a valid Grid License. -**Exceptions, Disjoint Addressing** + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorSoftwareValidityNotEstablished -Not all memory may be accessed on devices through the same pointer value through which they are accessed on the host. These exceptions are host memory registered using cudaHostRegister() and host memory allocated using the flag cudaHostAllocWriteCombined. For these exceptions, there exists a distinct host and device address for the memory. The device address is guaranteed to not overlap any valid host pointer range and is guaranteed to have the same value across all devices that support unified addressing. + 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. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStartupFailure -This device address may be queried using cudaHostGetDevicePointer() when a device using unified addressing is current. Either the host or the unified device pointer value may be used to refer to this memory in cudaMemcpy() and similar functions using the cudaMemcpyDefault memory direction. -.. autofunction:: cuda.bindings.runtime.cudaPointerGetAttributes + This indicates an internal startup failure in the CUDA runtime. -Peer Device Memory Access -------------------------- -This section describes the peer device memory access functions of the CUDA runtime application programming interface. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidKernelImage -.. autofunction:: cuda.bindings.runtime.cudaDeviceCanAccessPeer -.. autofunction:: cuda.bindings.runtime.cudaDeviceEnablePeerAccess -.. autofunction:: cuda.bindings.runtime.cudaDeviceDisablePeerAccess -OpenGL Interoperability ------------------------ + This indicates that the device kernel image is invalid. -impl_private + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorDeviceUninitialized -This section describes the OpenGL interoperability functions of the CUDA runtime application programming interface. Note that mapping of OpenGL resources is performed with the graphics API agnostic, resource mapping interface described in Graphics Interopability. + 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 :py:obj:`~.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 :py:obj:`~.cuCtxGetApiVersion()` for more details. -.. autoclass:: cuda.bindings.runtime.cudaGLDeviceList - .. autoattribute:: cuda.bindings.runtime.cudaGLDeviceList.cudaGLDeviceListAll + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMapBufferObjectFailed - The CUDA devices for all GPUs used by the current OpenGL context + This indicates that the buffer object could not be mapped. - .. autoattribute:: cuda.bindings.runtime.cudaGLDeviceList.cudaGLDeviceListCurrentFrame + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorUnmapBufferObjectFailed - The CUDA devices for the GPUs used by the current OpenGL context in its currently rendering frame + This indicates that the buffer object could not be unmapped. - .. autoattribute:: cuda.bindings.runtime.cudaGLDeviceList.cudaGLDeviceListNextFrame + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorArrayIsMapped - The CUDA devices for the GPUs to be used by the current OpenGL context in the next frame + This indicates that the specified array is currently mapped and thus cannot be destroyed. -.. autofunction:: cuda.bindings.runtime.cudaGLGetDevices -.. autofunction:: cuda.bindings.runtime.cudaGraphicsGLRegisterImage -.. autofunction:: cuda.bindings.runtime.cudaGraphicsGLRegisterBuffer -Direct3D 9 Interoperability ---------------------------- + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorAlreadyMapped + This indicates that the resource is already mapped. -Direct3D 10 Interoperability ----------------------------- + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorNoKernelImageForDevice + 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. -Direct3D 11 Interoperability ----------------------------- + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorAlreadyAcquired + This indicates that a resource has already been acquired. -VDPAU Interoperability ----------------------- + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorNotMapped -This section describes the VDPAU interoperability functions of the CUDA runtime application programming interface. -.. autofunction:: cuda.bindings.runtime.cudaVDPAUGetDevice -.. autofunction:: cuda.bindings.runtime.cudaVDPAUSetVDPAUDevice -.. autofunction:: cuda.bindings.runtime.cudaGraphicsVDPAURegisterVideoSurface -.. autofunction:: cuda.bindings.runtime.cudaGraphicsVDPAURegisterOutputSurface + This indicates that a resource is not mapped. -EGL Interoperability --------------------- -This section describes the EGL interoperability functions of the CUDA runtime application programming interface. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorNotMappedAsArray -.. autofunction:: cuda.bindings.runtime.cudaGraphicsEGLRegisterImage -.. autofunction:: cuda.bindings.runtime.cudaEGLStreamConsumerConnect -.. autofunction:: cuda.bindings.runtime.cudaEGLStreamConsumerConnectWithFlags -.. autofunction:: cuda.bindings.runtime.cudaEGLStreamConsumerDisconnect -.. autofunction:: cuda.bindings.runtime.cudaEGLStreamConsumerAcquireFrame -.. autofunction:: cuda.bindings.runtime.cudaEGLStreamConsumerReleaseFrame -.. autofunction:: cuda.bindings.runtime.cudaEGLStreamProducerConnect -.. autofunction:: cuda.bindings.runtime.cudaEGLStreamProducerDisconnect -.. autofunction:: cuda.bindings.runtime.cudaEGLStreamProducerPresentFrame -.. autofunction:: cuda.bindings.runtime.cudaEGLStreamProducerReturnFrame -.. autofunction:: cuda.bindings.runtime.cudaGraphicsResourceGetMappedEglFrame -.. autofunction:: cuda.bindings.runtime.cudaEventCreateFromEGLSync -Graphics Interoperability -------------------------- + This indicates that a mapped resource is not available for access as an array. -This section describes the graphics interoperability functions of the CUDA runtime application programming interface. -.. autofunction:: cuda.bindings.runtime.cudaGraphicsUnregisterResource -.. autofunction:: cuda.bindings.runtime.cudaGraphicsResourceSetMapFlags -.. autofunction:: cuda.bindings.runtime.cudaGraphicsMapResources -.. autofunction:: cuda.bindings.runtime.cudaGraphicsUnmapResources -.. autofunction:: cuda.bindings.runtime.cudaGraphicsResourceGetMappedPointer -.. autofunction:: cuda.bindings.runtime.cudaGraphicsSubResourceGetMappedArray -.. autofunction:: cuda.bindings.runtime.cudaGraphicsResourceGetMappedMipmappedArray + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorNotMappedAsPointer -Texture Object Management -------------------------- -This section describes the low level texture object management functions of the CUDA runtime application programming interface. The texture object API is only supported on devices of compute capability 3.0 or higher. + This indicates that a mapped resource is not available for access as a pointer. -.. autofunction:: cuda.bindings.runtime.cudaGetChannelDesc -.. autofunction:: cuda.bindings.runtime.cudaCreateChannelDesc -.. autofunction:: cuda.bindings.runtime.cudaCreateTextureObject -.. autofunction:: cuda.bindings.runtime.cudaDestroyTextureObject -.. autofunction:: cuda.bindings.runtime.cudaGetTextureObjectResourceDesc -.. autofunction:: cuda.bindings.runtime.cudaGetTextureObjectTextureDesc -.. autofunction:: cuda.bindings.runtime.cudaGetTextureObjectResourceViewDesc -Surface Object Management -------------------------- + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorECCUncorrectable -This section describes the low level texture object management functions of the CUDA runtime application programming interface. The surface object API is only supported on devices of compute capability 3.0 or higher. -.. autofunction:: cuda.bindings.runtime.cudaCreateSurfaceObject -.. autofunction:: cuda.bindings.runtime.cudaDestroySurfaceObject -.. autofunction:: cuda.bindings.runtime.cudaGetSurfaceObjectResourceDesc + This indicates that an uncorrectable ECC error was detected during execution. -Version Management ------------------- + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorUnsupportedLimit -.. autofunction:: cuda.bindings.runtime.cudaDriverGetVersion -.. autofunction:: cuda.bindings.runtime.cudaRuntimeGetVersion -.. autofunction:: cuda.bindings.runtime.getLocalRuntimeVersion + This indicates that the :py:obj:`~.cudaLimit` passed to the API call is not supported by the active device. -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. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorDeviceAlreadyInUse -.. 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 ----------------- + This indicates that a call tried to access an exclusive-thread device that is already in use by a different thread. -This section describes the graph management functions of CUDA runtime application programming interface. -.. autofunction:: cuda.bindings.runtime.cudaGraphCreate -.. autofunction:: cuda.bindings.runtime.cudaGraphAddKernelNode -.. autofunction:: cuda.bindings.runtime.cudaGraphKernelNodeGetParams -.. autofunction:: cuda.bindings.runtime.cudaGraphKernelNodeSetParams -.. autofunction:: cuda.bindings.runtime.cudaGraphKernelNodeCopyAttributes -.. autofunction:: cuda.bindings.runtime.cudaGraphKernelNodeGetAttribute -.. autofunction:: cuda.bindings.runtime.cudaGraphKernelNodeSetAttribute -.. autofunction:: cuda.bindings.runtime.cudaGraphAddMemcpyNode -.. autofunction:: cuda.bindings.runtime.cudaGraphAddMemcpyNode1D -.. autofunction:: cuda.bindings.runtime.cudaGraphMemcpyNodeGetParams -.. autofunction:: cuda.bindings.runtime.cudaGraphMemcpyNodeSetParams -.. autofunction:: cuda.bindings.runtime.cudaGraphMemcpyNodeSetParams1D -.. autofunction:: cuda.bindings.runtime.cudaGraphAddMemsetNode -.. autofunction:: cuda.bindings.runtime.cudaGraphMemsetNodeGetParams -.. autofunction:: cuda.bindings.runtime.cudaGraphMemsetNodeSetParams -.. autofunction:: cuda.bindings.runtime.cudaGraphAddHostNode -.. autofunction:: cuda.bindings.runtime.cudaGraphHostNodeGetParams -.. autofunction:: cuda.bindings.runtime.cudaGraphHostNodeSetParams -.. autofunction:: cuda.bindings.runtime.cudaGraphAddChildGraphNode -.. autofunction:: cuda.bindings.runtime.cudaGraphChildGraphNodeGetGraph -.. autofunction:: cuda.bindings.runtime.cudaGraphAddEmptyNode -.. autofunction:: cuda.bindings.runtime.cudaGraphAddEventRecordNode -.. autofunction:: cuda.bindings.runtime.cudaGraphEventRecordNodeGetEvent -.. autofunction:: cuda.bindings.runtime.cudaGraphEventRecordNodeSetEvent -.. autofunction:: cuda.bindings.runtime.cudaGraphAddEventWaitNode -.. autofunction:: cuda.bindings.runtime.cudaGraphEventWaitNodeGetEvent -.. autofunction:: cuda.bindings.runtime.cudaGraphEventWaitNodeSetEvent -.. autofunction:: cuda.bindings.runtime.cudaGraphAddExternalSemaphoresSignalNode -.. autofunction:: cuda.bindings.runtime.cudaGraphExternalSemaphoresSignalNodeGetParams -.. autofunction:: cuda.bindings.runtime.cudaGraphExternalSemaphoresSignalNodeSetParams -.. autofunction:: cuda.bindings.runtime.cudaGraphAddExternalSemaphoresWaitNode -.. autofunction:: cuda.bindings.runtime.cudaGraphExternalSemaphoresWaitNodeGetParams -.. autofunction:: cuda.bindings.runtime.cudaGraphExternalSemaphoresWaitNodeSetParams -.. autofunction:: cuda.bindings.runtime.cudaGraphAddMemAllocNode -.. autofunction:: cuda.bindings.runtime.cudaGraphMemAllocNodeGetParams -.. autofunction:: cuda.bindings.runtime.cudaGraphAddMemFreeNode -.. autofunction:: cuda.bindings.runtime.cudaGraphMemFreeNodeGetParams -.. autofunction:: cuda.bindings.runtime.cudaDeviceGraphMemTrim -.. autofunction:: cuda.bindings.runtime.cudaDeviceGetGraphMemAttribute -.. autofunction:: cuda.bindings.runtime.cudaDeviceSetGraphMemAttribute -.. autofunction:: cuda.bindings.runtime.cudaGraphClone -.. autofunction:: cuda.bindings.runtime.cudaGraphNodeFindInClone -.. autofunction:: cuda.bindings.runtime.cudaGraphNodeGetType -.. autofunction:: cuda.bindings.runtime.cudaGraphNodeGetContainingGraph -.. autofunction:: cuda.bindings.runtime.cudaGraphNodeGetLocalId -.. autofunction:: cuda.bindings.runtime.cudaGraphNodeGetToolsId -.. autofunction:: cuda.bindings.runtime.cudaGraphGetId -.. autofunction:: cuda.bindings.runtime.cudaGraphExecGetId -.. autofunction:: cuda.bindings.runtime.cudaGraphGetNodes -.. autofunction:: cuda.bindings.runtime.cudaGraphGetRootNodes -.. autofunction:: cuda.bindings.runtime.cudaGraphGetEdges -.. autofunction:: cuda.bindings.runtime.cudaGraphNodeGetDependencies -.. autofunction:: cuda.bindings.runtime.cudaGraphNodeGetDependentNodes -.. autofunction:: cuda.bindings.runtime.cudaGraphAddDependencies -.. autofunction:: cuda.bindings.runtime.cudaGraphRemoveDependencies -.. autofunction:: cuda.bindings.runtime.cudaGraphDestroyNode -.. autofunction:: cuda.bindings.runtime.cudaGraphInstantiate -.. autofunction:: cuda.bindings.runtime.cudaGraphInstantiateWithFlags -.. autofunction:: cuda.bindings.runtime.cudaGraphInstantiateWithParams -.. autofunction:: cuda.bindings.runtime.cudaGraphExecGetFlags -.. autofunction:: cuda.bindings.runtime.cudaGraphExecKernelNodeSetParams -.. autofunction:: cuda.bindings.runtime.cudaGraphExecMemcpyNodeSetParams -.. autofunction:: cuda.bindings.runtime.cudaGraphExecMemcpyNodeSetParams1D -.. autofunction:: cuda.bindings.runtime.cudaGraphExecMemsetNodeSetParams -.. autofunction:: cuda.bindings.runtime.cudaGraphExecHostNodeSetParams -.. autofunction:: cuda.bindings.runtime.cudaGraphExecChildGraphNodeSetParams -.. autofunction:: cuda.bindings.runtime.cudaGraphExecEventRecordNodeSetEvent -.. autofunction:: cuda.bindings.runtime.cudaGraphExecEventWaitNodeSetEvent -.. autofunction:: cuda.bindings.runtime.cudaGraphExecExternalSemaphoresSignalNodeSetParams -.. autofunction:: cuda.bindings.runtime.cudaGraphExecExternalSemaphoresWaitNodeSetParams -.. autofunction:: cuda.bindings.runtime.cudaGraphNodeSetEnabled -.. autofunction:: cuda.bindings.runtime.cudaGraphNodeGetEnabled -.. autofunction:: cuda.bindings.runtime.cudaGraphExecUpdate -.. autofunction:: cuda.bindings.runtime.cudaGraphUpload -.. autofunction:: cuda.bindings.runtime.cudaGraphLaunch -.. autofunction:: cuda.bindings.runtime.cudaGraphExecDestroy -.. autofunction:: cuda.bindings.runtime.cudaGraphDestroy -.. autofunction:: cuda.bindings.runtime.cudaGraphDebugDotPrint -.. autofunction:: cuda.bindings.runtime.cudaUserObjectCreate -.. autofunction:: cuda.bindings.runtime.cudaUserObjectRetain -.. autofunction:: cuda.bindings.runtime.cudaUserObjectRelease -.. autofunction:: cuda.bindings.runtime.cudaGraphRetainUserObject -.. autofunction:: cuda.bindings.runtime.cudaGraphReleaseUserObject -.. autofunction:: cuda.bindings.runtime.cudaGraphAddNode -.. autofunction:: cuda.bindings.runtime.cudaGraphNodeSetParams -.. autofunction:: cuda.bindings.runtime.cudaGraphNodeGetParams -.. autofunction:: cuda.bindings.runtime.cudaGraphExecNodeSetParams -.. autofunction:: cuda.bindings.runtime.cudaGraphConditionalHandleCreate -.. autofunction:: cuda.bindings.runtime.cudaGraphConditionalHandleCreate_v2 + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorPeerAccessUnsupported -Driver Entry Point Access -------------------------- -This section describes the driver entry point access functions of CUDA runtime application programming interface. + This error indicates that P2P access is not supported across the given devices. -.. autofunction:: cuda.bindings.runtime.cudaGetDriverEntryPoint -.. autofunction:: cuda.bindings.runtime.cudaGetDriverEntryPointByVersion -Library Management ------------------- + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidPtx -This section describes the library management functions of the CUDA runtime application programming interface. -.. autofunction:: cuda.bindings.runtime.cudaLibraryLoadData -.. autofunction:: cuda.bindings.runtime.cudaLibraryLoadFromFile -.. autofunction:: cuda.bindings.runtime.cudaLibraryUnload -.. autofunction:: cuda.bindings.runtime.cudaLibraryGetKernel -.. autofunction:: cuda.bindings.runtime.cudaLibraryGetGlobal -.. autofunction:: cuda.bindings.runtime.cudaLibraryGetManaged -.. autofunction:: cuda.bindings.runtime.cudaLibraryGetUnifiedFunction -.. autofunction:: cuda.bindings.runtime.cudaLibraryGetKernelCount -.. autofunction:: cuda.bindings.runtime.cudaLibraryEnumerateKernels -.. autofunction:: cuda.bindings.runtime.cudaKernelSetAttributeForDevice + 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. -Execution Context Management ----------------------------- -This section describes the execution context management functions of the CUDA runtime application programming interface. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidGraphicsContext + This indicates an error with the OpenGL or DirectX context. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorNvlinkUncorrectable -**Overview** + This indicates that an uncorrectable NVLink error was detected during the execution. -A CUDA execution context cudaExecutionContext_t serves as an abstraction for the contexts exposed by the CUDA Runtime, specifically green contexts and the primary context, and provides a unified programming model and API interface for contexts in the Runtime. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorJitCompilerNotFound -There are two primary ways today to obtain an execution context: -- cudaDeviceGetExecutionCtx: Returns the execution context that corresponds to the primary context of the specified 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. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorUnsupportedPtxVersion + 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. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorJitCompilationDisabled -- cudaGreenCtxCreate: Creates a green context with the specified resources and returns an execution context. + 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. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorUnsupportedExecAffinity + This indicates that the provided execution affinity is not supported by the device. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorUnsupportedDevSideSync -Once you have an execution context at hand, you can perform context-level operations via the CUDA Runtime APIs. This includes: + This indicates that the code to be compiled by the PTX JIT contains unsupported call to cudaDeviceSynchronize. -- Submitting work via streams created with cudaExecutionCtxStreamCreate. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorContained + 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. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidSource -- Querying context via cudaExecutionCtxGetDevResource, cudaExecutionCtxGetDevice, etc. + This indicates that the device kernel source is invalid. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorFileNotFound + This indicates that the file specified was not found. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorSharedObjectSymbolNotFound -- Synchronizing and tracking context-level operations via cudaExecutionCtxSynchronize, cudaExecutionCtxRecordEvent, cudaExecutionCtxWaitEvent. + This indicates that a link to a shared object failed to resolve. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorSharedObjectInitFailed + This indicates that initialization of a shared object failed. -- Performing context-level graph node operations via cudaGraphAddNode by specifying the context in ``nodeParams``\ . Note that individual node creation APIs, such as cudaGraphAddKernelNode, do not support specifying an execution context. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorOperatingSystem + This error indicates that an OS call failed. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidResourceHandle + This indicates that a resource handle passed to the API call was not valid. Resource handles are opaque types like :py:obj:`~.cudaStream_t` and :py:obj:`~.cudaEvent_t`. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorIllegalState -Note: The above APIs take in an explicit cudaExecutionContext_t handle and ignores the context that is current to the calling thread. This enables explicit context-based programming without relying on thread-local state. If no context is specified, the APIs return cudaErrorInvalidValue. -Note: Developers should treat cudaExecutionContext_t as an opaque handle and avoid assumptions about its underlying representation. The CUDA Runtime does not provide a way to convert this handle into driver-level contexts, such as ::CUcontext or ::CUgreenCtx. + This indicates that a resource required by the API call is not in a valid state to perform the requested operation. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorLossyQuery + 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. -**Lifetime of CUDA Resources** + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorSymbolNotFound -The lifetime of CUDA resources (memory, streams, events, modules, etc) is not tied to the lifetime of the execution context. Their lifetime is tied to the device against which they were created. As such, usage of cudaDeviceReset() should be avoided to persist the lifetime of these resources. + 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. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorNotReady + This indicates that asynchronous operations issued previously have not completed yet. This result is not actually an error, but must be indicated differently than :py:obj:`~.cudaSuccess` (which indicates completion). Calls that may return this value include :py:obj:`~.cudaEventQuery()` and :py:obj:`~.cudaStreamQuery()`. -**APIs Operating on Current Context** + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorIllegalAddress -The CUDA runtime does not provide a way to set an execution context as current. Since, the majority of the runtime APIs operate on the current context, we document below how the developer can work with these APIs. + 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. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorLaunchOutOfResources -**APIs Operating on Device Resources** + This indicates that a launch did not occur because it did not have appropriate resources. Although this error is similar to :py:obj:`~.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. -To work with these APIs (for example, cudaMalloc, cudaEventCreate, etc), developers are expected to call cudaSetDevice() prior to invoking them. Doing so does not impact functional correctness as these APIs operate on resources that are device-wide. If users have a context handle at hand, they can get the device handle from the context handle using cudaExecutionCtxGetDevice(). + .. 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 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 -**APIs Operating on Context Resources** + This error indicates a kernel launch that uses an incompatible texturing mode. -These APIs (for example, cudaLaunchKernel, cudaMemcpyAsync, cudaMemsetAsync, etc) take in a stream and resources are inferred from the context bound to the stream at creation. See cudaExecutionCtxStreamCreate for more details. Developers are expected to use the stream-based APIs for context awareness and always pass an explicit stream handle to ensure context-awareness, and avoid reliance on the default NULL stream, which implicitly binds to the current context. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorPeerAccessAlreadyEnabled + This error indicates that a call to :py:obj:`~.cudaDeviceEnablePeerAccess()` is trying to re-enable peer addressing on from a context which has already had peer addressing enabled. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorPeerAccessNotEnabled + This error indicates that :py:obj:`~.cudaDeviceDisablePeerAccess()` is trying to disable peer addressing which has not been enabled yet via :py:obj:`~.cudaDeviceEnablePeerAccess()`. -**Green Contexts** + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorSetOnActiveProcess -Green contexts are a lightweight alternative to traditional contexts, that can be used to select a subset of device resources. This allows the developer to, for example, select SMs from distinct spatial partitions of the GPU and target them via CUDA stream operations, kernel launches, etc. + This indicates that the user has called :py:obj:`~.cudaSetValidDevices()`, :py:obj:`~.cudaSetDeviceFlags()`, :py:obj:`~.cudaD3D9SetDirect3DDevice()`, :py:obj:`~.cudaD3D10SetDirect3DDevice`, :py:obj:`~.cudaD3D11SetDirect3DDevice()`, or :py:obj:`~.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 :py:obj:`~.CUcontext` active on the host thread. -Here are the broad initial steps to follow to get started: -- (1) Start with an initial set of resources. For SM resources, they can be fetched via cudaDeviceGetDevResource. In case of workqueues, a new configuration can be used or an existing one queried via the cudaDeviceGetDevResource API. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorContextIsDestroyed + This error indicates that the context current to the calling thread has been destroyed using :py:obj:`~.cuCtxDestroy`, or is a primary context which has not yet been initialized. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorAssert + 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. -- (2) Modify these resources by either partitioning them (in case of SMs) or changing the configuration (in case of workqueues). To partition SMs, we recommend cudaDevSmResourceSplit. Changing the workqueue configuration can be done directly in place. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorTooManyPeers + This error indicates that the hardware resources required to enable peer access have been exhausted for one or more of the devices passed to :py:obj:`~.cudaEnablePeerAccess()`. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorHostMemoryAlreadyRegistered -- (3) Finalize the specification of resources by creating a descriptor via cudaDevResourceGenerateDesc. + This error indicates that the memory range passed to :py:obj:`~.cudaHostRegister()` has already been registered. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorHostMemoryNotRegistered + This error indicates that the pointer passed to :py:obj:`~.cudaHostUnregister()` does not correspond to any currently registered memory region. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorHardwareStackError -- (4) Create a green context via cudaGreenCtxCreate. This provisions the resource, such as workqueues (until this step it was only a configuration specification). + 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. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorIllegalInstruction + 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. -- (5) Create a stream via cudaExecutionCtxStreamCreate, and use it throughout your application. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMisalignedAddress + 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. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidAddressSpace + 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. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidPc -SMs -There are two possible partition operations - with cudaDevSmResourceSplitByCount the partitions created have to follow default SM count granularity requirements, so it will often be rounded up and aligned to a default value. On the other hand, cudaDevSmResourceSplit is explicit and allows for creation of non-equal groups. It will not round up automatically - instead it is the developer’s responsibility to query and set the correct values. These requirements can be queried with cudaDeviceGetDevResource to determine the alignment granularity (sm.smCoscheduledAlignment). A general guideline on the default values for each compute architecture: + 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. -- On Compute Architecture 7.X, 8.X, and all Tegra SoC: + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorLaunchFailure + 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. - - The smCount must be a multiple of 2. + .. 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` 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 + 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. - - The alignment (and default value of coscheduledSmCount) is 2. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorNotPermitted + This error indicates the attempted operation is not permitted. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorNotSupported + This error indicates the attempted operation is not supported on the current system or device. -- On Compute Architecture 9.0+: + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorSystemNotReady + 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. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorSystemDriverMismatch - - The smCount must be a multiple of 8, or coscheduledSmCount if provided. + 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. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorCompatNotSupportedOnDevice + 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. - - The alignment (and default value of coscheduledSmCount) is 8. While the maximum value for coscheduled SM count is 32 on all Compute Architecture 9.0+, it's recommended to follow cluster size requirements. The portable cluster size and the max cluster size should be used in order to benefit from this co-scheduling. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMpsConnectionFailed + This error indicates that the MPS client failed to connect to the MPS control daemon or the MPS server. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMpsRpcFailure + This error indicates that the remote procedural call between the MPS server and the MPS client failed. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMpsServerNotReady + 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. -Workqueues -For ``cudaDevResourceTypeWorkqueueConfig``\ , the resource specifies the expected maximum number of concurrent stream-ordered workloads via the ``wqConcurrencyLimit``\ field. The ``sharingScope``\ field determines how workqueue resources are shared: + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMpsMaxClientsReached -- ``cudaDevWorkqueueConfigScopeDeviceCtx:``\ Use all shared workqueue resources across all contexts (default driver behavior). + This error indicates that the hardware resources required to create MPS client have been exhausted. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMpsMaxConnectionsReached + This error indicates the the hardware resources required to device connections have been exhausted. -- ``cudaDevWorkqueueConfigScopeGreenCtxBalanced:``\ When possible, use non-overlapping workqueue resources with other balanced green contexts. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMpsClientTerminated + This error indicates that the MPS client has been terminated by the server. To continue using CUDA, the process must be terminated and relaunched. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorCdpNotSupported + This error indicates, that the program is using CUDA Dynamic Parallelism, but the current configuration, like MPS, does not support it. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorCdpVersionMismatch -The maximum concurrency limit depends on ::CUDA_DEVICE_MAX_CONNECTIONS and can be queried from the device via cudaDeviceGetDevResource. Configurations may exceed this concurrency limit, but the driver will not guarantee that work submission remains non-overlapping. -For ``cudaDevResourceTypeWorkqueue``\ , the resource represents a pre-existing workqueue that can be retrieved from existing execution contexts. This allows reusing workqueue resources across different execution contexts. + This error indicates, that the program contains an unsupported interaction between different versions of CUDA Dynamic Parallelism. -On Concurrency -Even if the green contexts have disjoint SM partitions, it is not guaranteed that the kernels launched in them will run concurrently or have forward progress guarantees. This is due to other resources that could cause a dependency. Using a combination of disjoint SMs and ``cudaDevWorkqueueConfigScopeGreenCtxBalanced``\ workqueue configurations can provide the best chance of avoiding interference. More resources will be added in the future to provide stronger guarantees. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStreamCaptureUnsupported -Additionally, there are two known scenarios, where its possible for the workload to run on more SMs than was provisioned (but never less). + The operation is not permitted when the stream is capturing. -- On Volta+ MPS: When ``CUDA_MPS_ACTIVE_THREAD_PERCENTAGE``\ is used, the set of SMs that are used for running kernels can be scaled up to the value of SMs used for the MPS client. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStreamCaptureInvalidated + The current capture sequence on the stream has been invalidated due to a previous error. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStreamCaptureMerge + The operation would have resulted in a merge of two independent capture sequences. -- On Compute Architecture 9.x: When a module with dynamic parallelism (CDP) is loaded, all future kernels running under green contexts may use and share an additional set of 2 SMs. -.. autofunction:: cuda.bindings.runtime.cudaDeviceGetDevResource -.. autofunction:: cuda.bindings.runtime.cudaDevSmResourceSplitByCount -.. autofunction:: cuda.bindings.runtime.cudaDevSmResourceSplit -.. autofunction:: cuda.bindings.runtime.cudaDevResourceGenerateDesc -.. autofunction:: cuda.bindings.runtime.cudaGreenCtxCreate -.. autofunction:: cuda.bindings.runtime.cudaExecutionCtxDestroy -.. autofunction:: cuda.bindings.runtime.cudaExecutionCtxGetDevResource -.. autofunction:: cuda.bindings.runtime.cudaExecutionCtxGetDevice -.. autofunction:: cuda.bindings.runtime.cudaExecutionCtxGetId -.. autofunction:: cuda.bindings.runtime.cudaExecutionCtxStreamCreate -.. autofunction:: cuda.bindings.runtime.cudaExecutionCtxSynchronize -.. autofunction:: cuda.bindings.runtime.cudaStreamGetDevResource -.. autofunction:: cuda.bindings.runtime.cudaExecutionCtxRecordEvent -.. autofunction:: cuda.bindings.runtime.cudaExecutionCtxWaitEvent -.. autofunction:: cuda.bindings.runtime.cudaDeviceGetExecutionCtx + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStreamCaptureUnmatched -C++ API Routines ----------------- -C++-style interface built on top of CUDA runtime API. -impl_private + The capture was not initiated in this stream. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStreamCaptureUnjoined + The capture sequence contains a fork that was not joined to the primary stream. -This section describes the C++ high level API functions of the CUDA runtime application programming interface. To use these functions, your application needs to be compiled with the ``nvcc``\ compiler. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStreamCaptureIsolation -Interactions with the CUDA Driver API -------------------------------------- + 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 section describes the interactions between the CUDA Driver API and the CUDA Runtime API + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStreamCaptureImplicit + The operation would have resulted in a disallowed implicit dependency on a current capture sequence from cudaStreamLegacy. -**Execution Contexts** + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorCapturedEvent + The operation is not permitted on an event which was last recorded in a capturing stream. -The CUDA Runtime provides cudaExecutionContext_t as an abstraction over driver-level contexts—specifically, green contexts and the primary context. -There are two primary ways to obtain an execution context: + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStreamCaptureWrongThread -- cudaDeviceGetExecutionCtx: Returns the execution context that corresponds to the primary context of the specified device. + A stream capture sequence not initiated with the :py:obj:`~.cudaStreamCaptureModeRelaxed` argument to :py:obj:`~.cudaStreamBeginCapture` was passed to :py:obj:`~.cudaStreamEndCapture` in a different thread. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorTimeout + This indicates that the wait operation has timed out. -- cudaGreenCtxCreate: Creates a green context with the specified resources and returns an execution context. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorGraphExecUpdateFailure + This error indicates that the graph update was not performed because it included changes which violated constraints specific to instantiated graph update. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorExternalDevice + This indicates that an error has occurred in a device outside of GPU. It can be a synchronous error w.r.t. CUDA API or an asynchronous error from the external device. In case of asynchronous error, it means that 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. In case of synchronous error, it means that one or more external devices have encountered an error and cannot complete the operation. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidClusterSize -Note: Developers should treat cudaExecutionContext_t as an opaque handle and avoid assumptions about its underlying representation. The CUDA Runtime does not provide a way to convert this handle into a ::CUcontext or ::CUgreenCtx. + This indicates that a kernel launch error has occurred due to cluster misconfiguration. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorFunctionNotLoaded -**Primary Context (aka Device Execution Context)** + Indiciates a function handle is not loaded when calling an API that requires a loaded function. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidResourceType -The primary context is the default execution context associated with a device in the Runtime. It can be obtained via a call to cudaDeviceGetExecutionCtx(). There is a one-to-one mapping between CUDA devices in the runtime and their primary contexts within a process. -From the CUDA Runtime’s perspective, a device and its primary context are functionally synonymous. + This error indicates one or more resources passed in are not valid resource types for the operation. -Unless explicitly overridden, either by making a different context current via the Driver API (e.g., ::cuCtxSetCurrent()) or by using an explicit execution context handle, the Runtime will implicitly initialize and use the primary context for API calls as needed. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidResourceConfiguration + This error indicates one or more resources are insufficient or non-applicable for the operation. -**Initialization and Tear-Down** + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStreamDetached + This error indicates that the requested operation is not permitted because the stream is in a detached state. This can occur if the green context associated with the stream has been destroyed, limiting the stream's operational capabilities. -Unless an explicit execution context is specified (see “Execution Context Management” for APIs), CUDA Runtime API calls operate on the CUDA Driver ::CUcontext which is current to the calling host thread. If no ::CUcontext is current to the calling thread when a CUDA Runtime API call which requires an active context is made, then the primary context (device execution context) for a device will be selected, made current to the calling thread, and initialized. The context will be initialized using the parameters specified by the CUDA Runtime API functions cudaSetDeviceFlags(), ::cudaD3D9SetDirect3DDevice(), ::cudaD3D10SetDirect3DDevice(), ::cudaD3D11SetDirect3DDevice(), cudaGLSetGLDevice(), and cudaVDPAUSetVDPAUDevice(). Note that these functions will fail with cudaErrorSetOnActiveProcess if they are called when the primary context for the specified device has already been initialized, except for cudaSetDeviceFlags() which will simply overwrite the previous settings. -The function cudaInitDevice() ensures that the primary context is initialized for the requested device but does not make it current to the calling thread. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorGraphRecaptureFailure -The function cudaSetDevice() initializes the primary context for the specified device and makes it current to the calling thread by calling ::cuCtxSetCurrent(). -Primary contexts will remain active until they are explicitly deinitialized using cudaDeviceReset(). The function cudaDeviceReset() will deinitialize the primary context for the calling thread's current device immediately. The context will remain current to all of the threads that it was current to. The next CUDA Runtime API call on any thread which requires an active context will trigger the reinitialization of that device's primary context. + This error indicates that a graph recapture failed and had to be terminated. -Note that primary contexts are shared resources. It is recommended that the primary context not be reset except just before exit or to recover from an unspecified launch failure. + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorUnknown + This indicates that an unknown internal error has occurred. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorApiFailureBase -**CUcontext Interoperability** +.. autoclass:: cuda.bindings.runtime.cudaChannelFormatKind + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSigned -Note that the use of multiple ::CUcontext s per device within a single process will substantially degrade performance and is strongly discouraged. Instead, it is highly recommended to either use execution contexts cudaExecutionContext_t or the implicit one-to-one device-to-primary context mapping for the process provided by the CUDA Runtime API. + Signed channel format -If a non-primary ::CUcontext created by the CUDA Driver API is current to a thread then the CUDA Runtime API calls to that thread will operate on that ::CUcontext, with some exceptions listed below. Interoperability between data types is discussed in the following sections. -The function cudaDeviceEnablePeerAccess() and the rest of the peer access API may not be called when a non-primary CUcontext is current. To use the peer access APIs with a context created using the CUDA Driver API, it is necessary that the CUDA Driver API be used to access these features. + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned + + + Unsigned channel format + + + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindFloat -All CUDA Runtime API state (e.g, global variables' addresses and values) travels with its underlying ::CUcontext. In particular, if a ::CUcontext is moved from one thread to another then all CUDA Runtime API state will move to that thread as well. -Please note that attaching to legacy CUcontext (those with a version of 3010 as returned by ::cuCtxGetApiVersion()) is not possible. The CUDA Runtime will return cudaErrorIncompatibleDriverContext in such cases. + Float channel format + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindNone + No channel format -**Interactions between CUstream and cudaStream_t** + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindNV12 -The types ::CUstream and cudaStream_t are identical and may be used interchangeably. + Unsigned 8-bit integers, planar 4:2:0 YUV format + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X1 + 1 channel unsigned 8-bit normalized integer -**Interactions between CUevent and cudaEvent_t** + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2 -The types ::CUevent and cudaEvent_t are identical and may be used interchangeably. + 2 channel unsigned 8-bit normalized integer + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4 + 4 channel unsigned 8-bit normalized integer -**Interactions between CUarray and cudaArray_t** + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X1 -The types ::CUarray and struct ::cudaArray * represent the same data type and may be used interchangeably by casting the two types between each other. + 1 channel unsigned 16-bit normalized integer -In order to use a ::CUarray in a CUDA Runtime API function which takes a struct ::cudaArray *, it is necessary to explicitly cast the ::CUarray to a struct ::cudaArray *. -In order to use a struct ::cudaArray * in a CUDA Driver API function which takes a ::CUarray, it is necessary to explicitly cast the struct ::cudaArray * to a ::CUarray . + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2 + 2 channel unsigned 16-bit normalized integer + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4 -**Interactions between CUgraphicsResource and cudaGraphicsResource_t** + 4 channel unsigned 16-bit normalized integer -The types ::CUgraphicsResource and cudaGraphicsResource_t represent the same data type and may be used interchangeably by casting the two types between each other. + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1 -In order to use a ::CUgraphicsResource in a CUDA Runtime API function which takes a cudaGraphicsResource_t, it is necessary to explicitly cast the ::CUgraphicsResource to a cudaGraphicsResource_t. -In order to use a cudaGraphicsResource_t in a CUDA Driver API function which takes a ::CUgraphicsResource, it is necessary to explicitly cast the cudaGraphicsResource_t to a ::CUgraphicsResource. + 1 channel signed 8-bit normalized integer + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2 + 2 channel signed 8-bit normalized integer -**Interactions between CUtexObject and cudaTextureObject_t** + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4 -The types ::CUtexObject and cudaTextureObject_t represent the same data type and may be used interchangeably by casting the two types between each other. + 4 channel signed 8-bit normalized integer -In order to use a ::CUtexObject in a CUDA Runtime API function which takes a cudaTextureObject_t, it is necessary to explicitly cast the ::CUtexObject to a cudaTextureObject_t. -In order to use a cudaTextureObject_t in a CUDA Driver API function which takes a ::CUtexObject, it is necessary to explicitly cast the cudaTextureObject_t to a ::CUtexObject. + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1 + 1 channel signed 16-bit normalized integer + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2 -**Interactions between CUsurfObject and cudaSurfaceObject_t** + 2 channel signed 16-bit normalized integer -The types ::CUsurfObject and cudaSurfaceObject_t represent the same data type and may be used interchangeably by casting the two types between each other. + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4 -In order to use a ::CUsurfObject in a CUDA Runtime API function which takes a cudaSurfaceObject_t, it is necessary to explicitly cast the ::CUsurfObject to a cudaSurfaceObject_t. -In order to use a cudaSurfaceObject_t in a CUDA Driver API function which takes a ::CUsurfObject, it is necessary to explicitly cast the cudaSurfaceObject_t to a ::CUsurfObject. + 4 channel signed 16-bit normalized integer + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1 + 4 channel unsigned normalized block-compressed (BC1 compression) format -**Interactions between CUfunction and cudaFunction_t** + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB -The types ::CUfunction and cudaFunction_t represent the same data type and may be used interchangeably by casting the two types between each other. + 4 channel unsigned normalized block-compressed (BC1 compression) format with sRGB encoding -In order to use a cudaFunction_t in a CUDA Driver API function which takes a ::CUfunction, it is necessary to explicitly cast the cudaFunction_t to a ::CUfunction. + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2 + 4 channel unsigned normalized block-compressed (BC2 compression) format -**Interactions between CUkernel and cudaKernel_t** + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB + 4 channel unsigned normalized block-compressed (BC2 compression) format with sRGB encoding -The types ::CUkernel and cudaKernel_t represent the same data type and may be used interchangeably by casting the two types between each other. -In order to use a cudaKernel_t in a CUDA Driver API function which takes a ::CUkernel, it is necessary to explicitly cast the cudaKernel_t to a ::CUkernel. + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3 -.. autofunction:: cuda.bindings.runtime.cudaGetKernel -Data types used by CUDA Runtime -------------------------------- + 4 channel unsigned normalized block-compressed (BC3 compression) format + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB -.. autoclass:: cuda.bindings.runtime.cudaEglPlaneDesc_st -.. autoclass:: cuda.bindings.runtime.cudaEglFrame_st -.. autoclass:: cuda.bindings.runtime.cudaChannelFormatDesc -.. autoclass:: cuda.bindings.runtime.cudaArraySparseProperties -.. autoclass:: cuda.bindings.runtime.cudaArrayMemoryRequirements -.. autoclass:: cuda.bindings.runtime.cudaPitchedPtr -.. autoclass:: cuda.bindings.runtime.cudaExtent -.. autoclass:: cuda.bindings.runtime.cudaPos -.. autoclass:: cuda.bindings.runtime.cudaMemcpy3DParms -.. autoclass:: cuda.bindings.runtime.cudaMemcpyNodeParams -.. autoclass:: cuda.bindings.runtime.cudaMemcpy3DPeerParms -.. autoclass:: cuda.bindings.runtime.cudaMemsetParams -.. autoclass:: cuda.bindings.runtime.cudaMemsetParamsV2 -.. autoclass:: cuda.bindings.runtime.cudaAccessPolicyWindow -.. autoclass:: cuda.bindings.runtime.cudaHostNodeParams -.. autoclass:: cuda.bindings.runtime.cudaHostNodeParamsV2 -.. autoclass:: cuda.bindings.runtime.cudaResourceDesc -.. autoclass:: cuda.bindings.runtime.cudaResourceViewDesc -.. autoclass:: cuda.bindings.runtime.cudaPointerAttributes -.. autoclass:: cuda.bindings.runtime.cudaFuncAttributes -.. autoclass:: cuda.bindings.runtime.cudaMemLocation -.. autoclass:: cuda.bindings.runtime.cudaMemAccessDesc -.. autoclass:: cuda.bindings.runtime.cudaMemPoolProps -.. autoclass:: cuda.bindings.runtime.cudaMemPoolPtrExportData -.. autoclass:: cuda.bindings.runtime.cudaMemAllocNodeParams -.. autoclass:: cuda.bindings.runtime.cudaMemAllocNodeParamsV2 -.. autoclass:: cuda.bindings.runtime.cudaMemFreeNodeParams -.. autoclass:: cuda.bindings.runtime.cudaMemcpyAttributes -.. autoclass:: cuda.bindings.runtime.cudaOffset3D -.. autoclass:: cuda.bindings.runtime.cudaMemcpy3DOperand -.. autoclass:: cuda.bindings.runtime.cudaMemcpy3DBatchOp -.. autoclass:: cuda.bindings.runtime.CUuuid_st -.. autoclass:: cuda.bindings.runtime.cudaDeviceProp -.. autoclass:: cuda.bindings.runtime.cudaIpcEventHandle_st -.. autoclass:: cuda.bindings.runtime.cudaIpcMemHandle_st -.. autoclass:: cuda.bindings.runtime.cudaMemFabricHandle_st -.. autoclass:: cuda.bindings.runtime.cudaExternalMemoryHandleDesc -.. autoclass:: cuda.bindings.runtime.cudaExternalMemoryBufferDesc -.. autoclass:: cuda.bindings.runtime.cudaExternalMemoryMipmappedArrayDesc -.. autoclass:: cuda.bindings.runtime.cudaExternalSemaphoreHandleDesc -.. autoclass:: cuda.bindings.runtime.cudaExternalSemaphoreSignalParams -.. autoclass:: cuda.bindings.runtime.cudaExternalSemaphoreWaitParams -.. autoclass:: cuda.bindings.runtime.cudaDevSmResource -.. autoclass:: cuda.bindings.runtime.cudaDevWorkqueueConfigResource -.. autoclass:: cuda.bindings.runtime.cudaDevWorkqueueResource -.. autoclass:: cuda.bindings.runtime.cudaDevSmResourceGroupParams_st -.. autoclass:: cuda.bindings.runtime.cudaDevResource_st -.. autoclass:: cuda.bindings.runtime.cudalibraryHostUniversalFunctionAndDataTable -.. autoclass:: cuda.bindings.runtime.cudaKernelNodeParams -.. autoclass:: cuda.bindings.runtime.cudaKernelNodeParamsV2 -.. autoclass:: cuda.bindings.runtime.cudaExternalSemaphoreSignalNodeParams -.. autoclass:: cuda.bindings.runtime.cudaExternalSemaphoreSignalNodeParamsV2 -.. autoclass:: cuda.bindings.runtime.cudaExternalSemaphoreWaitNodeParams -.. autoclass:: cuda.bindings.runtime.cudaExternalSemaphoreWaitNodeParamsV2 -.. autoclass:: cuda.bindings.runtime.cudaConditionalNodeParams -.. autoclass:: cuda.bindings.runtime.cudaChildGraphNodeParams -.. autoclass:: cuda.bindings.runtime.cudaEventRecordNodeParams -.. autoclass:: cuda.bindings.runtime.cudaEventWaitNodeParams -.. autoclass:: cuda.bindings.runtime.cudaGraphNodeParams -.. autoclass:: cuda.bindings.runtime.cudaGraphEdgeData_st -.. autoclass:: cuda.bindings.runtime.cudaGraphInstantiateParams_st -.. autoclass:: cuda.bindings.runtime.cudaGraphExecUpdateResultInfo_st -.. autoclass:: cuda.bindings.runtime.cudaGraphKernelNodeUpdate -.. autoclass:: cuda.bindings.runtime.cudaLaunchMemSyncDomainMap_st -.. autoclass:: cuda.bindings.runtime.cudaLaunchAttributeValue -.. autoclass:: cuda.bindings.runtime.cudaLaunchAttribute_st -.. autoclass:: cuda.bindings.runtime.cudaAsyncNotificationInfo -.. autoclass:: cuda.bindings.runtime.cudaTextureDesc -.. autoclass:: cuda.bindings.runtime.cudaEglFrameType - .. autoattribute:: cuda.bindings.runtime.cudaEglFrameType.cudaEglFrameTypeArray + 4 channel unsigned normalized block-compressed (BC3 compression) format with sRGB encoding - Frame type CUDA array + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4 - .. autoattribute:: cuda.bindings.runtime.cudaEglFrameType.cudaEglFrameTypePitch + 1 channel unsigned normalized block-compressed (BC4 compression) format - Frame type CUDA pointer + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4 -.. autoclass:: cuda.bindings.runtime.cudaEglResourceLocationFlags - .. autoattribute:: cuda.bindings.runtime.cudaEglResourceLocationFlags.cudaEglResourceLocationSysmem + 1 channel signed normalized block-compressed (BC4 compression) format - Resource location sysmem + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5 - .. autoattribute:: cuda.bindings.runtime.cudaEglResourceLocationFlags.cudaEglResourceLocationVidmem + 2 channel unsigned normalized block-compressed (BC5 compression) format - Resource location vidmem + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5 -.. autoclass:: cuda.bindings.runtime.cudaEglColorFormat - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV420Planar + 2 channel signed normalized block-compressed (BC5 compression) format - Y, U, V in three surfaces, each in a separate surface, U/V width = 1/2 Y width, U/V height = 1/2 Y height. + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV420SemiPlanar + 3 channel unsigned half-float block-compressed (BC6H compression) format - Y, UV in two surfaces (UV as one surface) with VU byte ordering, width, height ratio same as YUV420Planar. + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV422Planar + 3 channel signed half-float block-compressed (BC6H compression) format - Y, U, V each in a separate surface, U/V width = 1/2 Y width, U/V height = Y height. + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7 - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV422SemiPlanar + 4 channel unsigned normalized block-compressed (BC7 compression) format - Y, UV in two surfaces with VU byte ordering, width, height ratio same as YUV422Planar. + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatARGB + 4 channel unsigned normalized block-compressed (BC7 compression) format with sRGB encoding - R/G/B/A four channels in one surface with BGRA byte ordering. + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized1010102 - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatRGBA + 4 channel unsigned normalized (10-bit, 10-bit, 10-bit, 2-bit) format - R/G/B/A four channels in one surface with ABGR byte ordering. + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned8Packed422 - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatL + 4 channel unsigned 8-bit packed format, with 4:2:2 sampling - single luminance channel in one surface. + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned8Packed444 - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatR + 4 channel unsigned 8-bit packed format, with 4:4:4 sampling - single color channel in one surface. + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned8SemiPlanar420 - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV444Planar + 3 channel unsigned 8-bit semi-planar format, with 4:2:0 sampling - Y, U, V in three surfaces, each in a separate surface, U/V width = Y width, U/V height = Y height. + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned16SemiPlanar420 - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV444SemiPlanar + 3 channel unsigned 16-bit semi-planar format, with 4:2:0 sampling - Y, UV in two surfaces (UV as one surface) with VU byte ordering, width, height ratio same as YUV444Planar. + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned8SemiPlanar422 - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUYV422 + 3 channel unsigned 8-bit semi-planar format, with 4:2:2 sampling - Y, U, V in one surface, interleaved as UYVY in one channel. + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned16SemiPlanar422 - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatUYVY422 + 3 channel unsigned 16-bit semi-planar format, with 4:2:2 sampling - Y, U, V in one surface, interleaved as YUYV in one channel. + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned8SemiPlanar444 - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatABGR + 3 channel unsigned 8-bit semi-planar format, with 4:4:4 sampling - R/G/B/A four channels in one surface with RGBA byte ordering. + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned16SemiPlanar444 - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBGRA + 3 channel unsigned 16-bit semi-planar format, with 4:4:4 sampling - R/G/B/A four channels in one surface with ARGB byte ordering. + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned8Planar420 - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatA + 3 channel unsigned 8-bit planar format, with 4:2:0 sampling - Alpha color format - one channel in one surface. + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned16Planar420 - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatRG + 3 channel unsigned 16-bit planar format, with 4:2:0 sampling - R/G color format - two channels in one surface with GR byte ordering + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned8Planar422 - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatAYUV + 3 channel unsigned 8-bit planar format, with 4:2:2 sampling - Y, U, V, A four channels in one surface, interleaved as VUYA. + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned16Planar422 - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU444SemiPlanar + 3 channel unsigned 16-bit planar format, with 4:2:2 sampling - Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = Y width, U/V height = Y height. + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned8Planar444 - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU422SemiPlanar + 3 channel unsigned 8-bit planar format, with 4:4:4 sampling - Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V height = Y height. + .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned16Planar444 - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU420SemiPlanar + 3 channel unsigned 16-bit planar format, with 4:4:4 sampling +.. autoclass:: cuda.bindings.runtime.cudaMemoryType - Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V height = 1/2 Y height. + .. autoattribute:: cuda.bindings.runtime.cudaMemoryType.cudaMemoryTypeUnregistered - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_444SemiPlanar + Unregistered memory - Y10, V10U10 in two surfaces (VU as one surface) with UV byte ordering, U/V width = Y width, U/V height = Y height. + .. autoattribute:: cuda.bindings.runtime.cudaMemoryType.cudaMemoryTypeHost - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_420SemiPlanar + Host memory - Y10, V10U10 in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V height = 1/2 Y height. + .. autoattribute:: cuda.bindings.runtime.cudaMemoryType.cudaMemoryTypeDevice - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY12V12U12_444SemiPlanar + Device memory - Y12, V12U12 in two surfaces (VU as one surface) with UV byte ordering, U/V width = Y width, U/V height = Y height. + .. autoattribute:: cuda.bindings.runtime.cudaMemoryType.cudaMemoryTypeManaged - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY12V12U12_420SemiPlanar + Managed memory +.. autoclass:: cuda.bindings.runtime.cudaMemcpyKind - Y12, V12U12 in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V height = 1/2 Y height. + .. autoattribute:: cuda.bindings.runtime.cudaMemcpyKind.cudaMemcpyHostToHost - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatVYUY_ER + Host -> Host - Extended Range Y, U, V in one surface, interleaved as YVYU in one channel. + .. autoattribute:: cuda.bindings.runtime.cudaMemcpyKind.cudaMemcpyHostToDevice - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatUYVY_ER + Host -> Device - Extended Range Y, U, V in one surface, interleaved as YUYV in one channel. + .. autoattribute:: cuda.bindings.runtime.cudaMemcpyKind.cudaMemcpyDeviceToHost - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUYV_ER + Device -> Host - Extended Range Y, U, V in one surface, interleaved as UYVY in one channel. + .. autoattribute:: cuda.bindings.runtime.cudaMemcpyKind.cudaMemcpyDeviceToDevice - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVYU_ER + Device -> Device - Extended Range Y, U, V in one surface, interleaved as VYUY in one channel. + .. autoattribute:: cuda.bindings.runtime.cudaMemcpyKind.cudaMemcpyDefault - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUVA_ER + Direction of the transfer is inferred from the pointer values. Requires unified virtual addressing +.. autoclass:: cuda.bindings.runtime.cudaAccessProperty - Extended Range Y, U, V, A four channels in one surface, interleaved as AVUY. + .. autoattribute:: cuda.bindings.runtime.cudaAccessProperty.cudaAccessPropertyNormal - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatAYUV_ER + Normal cache persistence. - Extended Range Y, U, V, A four channels in one surface, interleaved as VUYA. + .. autoattribute:: cuda.bindings.runtime.cudaAccessProperty.cudaAccessPropertyStreaming - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV444Planar_ER + Streaming access is less likely to persit from cache. - Extended Range Y, U, V in three surfaces, U/V width = Y width, U/V height = Y height. + .. autoattribute:: cuda.bindings.runtime.cudaAccessProperty.cudaAccessPropertyPersisting - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV422Planar_ER + Persisting access is more likely to persist in cache. +.. autoclass:: cuda.bindings.runtime.cudaStreamCaptureStatus - Extended Range Y, U, V in three surfaces, U/V width = 1/2 Y width, U/V height = Y height. + .. autoattribute:: cuda.bindings.runtime.cudaStreamCaptureStatus.cudaStreamCaptureStatusNone - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV420Planar_ER + Stream is not capturing - Extended Range Y, U, V in three surfaces, U/V width = 1/2 Y width, U/V height = 1/2 Y height. + .. autoattribute:: cuda.bindings.runtime.cudaStreamCaptureStatus.cudaStreamCaptureStatusActive - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV444SemiPlanar_ER + Stream is actively capturing - Extended Range Y, UV in two surfaces (UV as one surface) with VU byte ordering, U/V width = Y width, U/V height = Y height. + .. autoattribute:: cuda.bindings.runtime.cudaStreamCaptureStatus.cudaStreamCaptureStatusInvalidated - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV422SemiPlanar_ER + Stream is part of a capture sequence that has been invalidated, but not terminated +.. autoclass:: cuda.bindings.runtime.cudaGraphRecaptureStatus - Extended Range Y, UV in two surfaces (UV as one surface) with VU byte ordering, U/V width = 1/2 Y width, U/V height = Y height. + .. autoattribute:: cuda.bindings.runtime.cudaGraphRecaptureStatus.cudaGraphRecaptureEligibleForUpdate - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV420SemiPlanar_ER + Node is eligible for update in an instantiated graph. - Extended Range Y, UV in two surfaces (UV as one surface) with VU byte ordering, U/V width = 1/2 Y width, U/V height = 1/2 Y height. + .. autoattribute:: cuda.bindings.runtime.cudaGraphRecaptureStatus.cudaGraphRecaptureIneligibleForUpdate - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU444Planar_ER + Parameter changes in the node cannot be applied to an instantiated graph. - Extended Range Y, V, U in three surfaces, U/V width = Y width, U/V height = Y height. + .. autoattribute:: cuda.bindings.runtime.cudaGraphRecaptureStatus.cudaGraphRecaptureError - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU422Planar_ER + Error while attempting to recapture the node. The recapture will be ended regardless of the return value from the callback. +.. autoclass:: cuda.bindings.runtime.cudaStreamCaptureMode - Extended Range Y, V, U in three surfaces, U/V width = 1/2 Y width, U/V height = Y height. + .. autoattribute:: cuda.bindings.runtime.cudaStreamCaptureMode.cudaStreamCaptureModeGlobal - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU420Planar_ER + .. autoattribute:: cuda.bindings.runtime.cudaStreamCaptureMode.cudaStreamCaptureModeThreadLocal - Extended Range Y, V, U in three surfaces, U/V width = 1/2 Y width, U/V height = 1/2 Y height. + .. autoattribute:: cuda.bindings.runtime.cudaStreamCaptureMode.cudaStreamCaptureModeRelaxed +.. autoclass:: cuda.bindings.runtime.cudaSynchronizationPolicy - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU444SemiPlanar_ER + .. autoattribute:: cuda.bindings.runtime.cudaSynchronizationPolicy.cudaSyncPolicyAuto - Extended Range Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = Y width, U/V height = Y height. + .. autoattribute:: cuda.bindings.runtime.cudaSynchronizationPolicy.cudaSyncPolicySpin - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU422SemiPlanar_ER + .. autoattribute:: cuda.bindings.runtime.cudaSynchronizationPolicy.cudaSyncPolicyYield - Extended Range Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V height = Y height. + .. autoattribute:: cuda.bindings.runtime.cudaSynchronizationPolicy.cudaSyncPolicyBlockingSync +.. autoclass:: cuda.bindings.runtime.cudaClusterSchedulingPolicy - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU420SemiPlanar_ER + .. autoattribute:: cuda.bindings.runtime.cudaClusterSchedulingPolicy.cudaClusterSchedulingPolicyDefault - Extended Range Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V height = 1/2 Y height. + the default policy - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerRGGB + .. autoattribute:: cuda.bindings.runtime.cudaClusterSchedulingPolicy.cudaClusterSchedulingPolicySpread - Bayer format - one channel in one surface with interleaved RGGB ordering. + spread the blocks within a cluster to the SMs - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerBGGR + .. autoattribute:: cuda.bindings.runtime.cudaClusterSchedulingPolicy.cudaClusterSchedulingPolicyLoadBalancing - Bayer format - one channel in one surface with interleaved BGGR ordering. + allow the hardware to load-balance the blocks in a cluster to the SMs +.. autoclass:: cuda.bindings.runtime.cudaStreamUpdateCaptureDependenciesFlags - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerGRBG + .. autoattribute:: cuda.bindings.runtime.cudaStreamUpdateCaptureDependenciesFlags.cudaStreamAddCaptureDependencies - Bayer format - one channel in one surface with interleaved GRBG ordering. + Add new nodes to the dependency set - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerGBRG + .. autoattribute:: cuda.bindings.runtime.cudaStreamUpdateCaptureDependenciesFlags.cudaStreamSetCaptureDependencies - Bayer format - one channel in one surface with interleaved GBRG ordering. + Replace the dependency set with the new nodes +.. autoclass:: cuda.bindings.runtime.cudaUserObjectFlags - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer10RGGB + .. autoattribute:: cuda.bindings.runtime.cudaUserObjectFlags.cudaUserObjectNoDestructorSync - Bayer10 format - one channel in one surface with interleaved RGGB ordering. Out of 16 bits, 10 bits used 6 bits No-op. + Indicates the destructor execution is not synchronized by any CUDA handle. +.. autoclass:: cuda.bindings.runtime.cudaUserObjectRetainFlags - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer10BGGR + .. autoattribute:: cuda.bindings.runtime.cudaUserObjectRetainFlags.cudaGraphUserObjectMove - Bayer10 format - one channel in one surface with interleaved BGGR ordering. Out of 16 bits, 10 bits used 6 bits No-op. + Transfer references from the caller rather than creating new references. +.. autoclass:: cuda.bindings.runtime.cudaHostTaskSyncMode - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer10GRBG + .. autoattribute:: cuda.bindings.runtime.cudaHostTaskSyncMode.cudaHostTaskBlocking - Bayer10 format - one channel in one surface with interleaved GRBG ordering. Out of 16 bits, 10 bits used 6 bits No-op. + .. autoattribute:: cuda.bindings.runtime.cudaHostTaskSyncMode.cudaHostTaskSpinWait +.. autoclass:: cuda.bindings.runtime.cudaGraphicsRegisterFlags - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer10GBRG + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsNone - Bayer10 format - one channel in one surface with interleaved GBRG ordering. Out of 16 bits, 10 bits used 6 bits No-op. + Default - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer12RGGB + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsReadOnly - Bayer12 format - one channel in one surface with interleaved RGGB ordering. Out of 16 bits, 12 bits used 4 bits No-op. + CUDA will not write to this resource - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer12BGGR + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsWriteDiscard - Bayer12 format - one channel in one surface with interleaved BGGR ordering. Out of 16 bits, 12 bits used 4 bits No-op. + CUDA will only write to and will not read from this resource - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer12GRBG + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsSurfaceLoadStore - Bayer12 format - one channel in one surface with interleaved GRBG ordering. Out of 16 bits, 12 bits used 4 bits No-op. + CUDA will bind this resource to a surface reference - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer12GBRG + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsTextureGather - Bayer12 format - one channel in one surface with interleaved GBRG ordering. Out of 16 bits, 12 bits used 4 bits No-op. + CUDA will perform texture gather operations on this resource +.. autoclass:: cuda.bindings.runtime.cudaGraphicsMapFlags - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer14RGGB + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsMapFlags.cudaGraphicsMapFlagsNone - Bayer14 format - one channel in one surface with interleaved RGGB ordering. Out of 16 bits, 14 bits used 2 bits No-op. + Default; Assume resource can be read/written - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer14BGGR + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsMapFlags.cudaGraphicsMapFlagsReadOnly - Bayer14 format - one channel in one surface with interleaved BGGR ordering. Out of 16 bits, 14 bits used 2 bits No-op. + CUDA will not write to this resource - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer14GRBG + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsMapFlags.cudaGraphicsMapFlagsWriteDiscard - Bayer14 format - one channel in one surface with interleaved GRBG ordering. Out of 16 bits, 14 bits used 2 bits No-op. + CUDA will only write to and will not read from this resource +.. autoclass:: cuda.bindings.runtime.cudaGraphicsCubeFace - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer14GBRG + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsCubeFace.cudaGraphicsCubeFacePositiveX - Bayer14 format - one channel in one surface with interleaved GBRG ordering. Out of 16 bits, 14 bits used 2 bits No-op. + Positive X face of cubemap - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer20RGGB + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsCubeFace.cudaGraphicsCubeFaceNegativeX - Bayer20 format - one channel in one surface with interleaved RGGB ordering. Out of 32 bits, 20 bits used 12 bits No-op. + Negative X face of cubemap - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer20BGGR + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsCubeFace.cudaGraphicsCubeFacePositiveY - Bayer20 format - one channel in one surface with interleaved BGGR ordering. Out of 32 bits, 20 bits used 12 bits No-op. + Positive Y face of cubemap - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer20GRBG + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsCubeFace.cudaGraphicsCubeFaceNegativeY - Bayer20 format - one channel in one surface with interleaved GRBG ordering. Out of 32 bits, 20 bits used 12 bits No-op. + Negative Y face of cubemap - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer20GBRG + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsCubeFace.cudaGraphicsCubeFacePositiveZ - Bayer20 format - one channel in one surface with interleaved GBRG ordering. Out of 32 bits, 20 bits used 12 bits No-op. + Positive Z face of cubemap - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU444Planar + .. autoattribute:: cuda.bindings.runtime.cudaGraphicsCubeFace.cudaGraphicsCubeFaceNegativeZ - Y, V, U in three surfaces, each in a separate surface, U/V width = Y width, U/V height = Y height. + Negative Z face of cubemap +.. autoclass:: cuda.bindings.runtime.cudaResourceType - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU422Planar + .. autoattribute:: cuda.bindings.runtime.cudaResourceType.cudaResourceTypeArray - Y, V, U in three surfaces, each in a separate surface, U/V width = 1/2 Y width, U/V height = Y height. + Array resource - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU420Planar + .. autoattribute:: cuda.bindings.runtime.cudaResourceType.cudaResourceTypeMipmappedArray - Y, V, U in three surfaces, each in a separate surface, U/V width = 1/2 Y width, U/V height = 1/2 Y height. + Mipmapped array resource - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerIspRGGB + .. autoattribute:: cuda.bindings.runtime.cudaResourceType.cudaResourceTypeLinear - Nvidia proprietary Bayer ISP format - one channel in one surface with interleaved RGGB ordering and mapped to opaque integer datatype. + Linear resource - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerIspBGGR + .. autoattribute:: cuda.bindings.runtime.cudaResourceType.cudaResourceTypePitch2D - Nvidia proprietary Bayer ISP format - one channel in one surface with interleaved BGGR ordering and mapped to opaque integer datatype. + Pitch 2D resource +.. autoclass:: cuda.bindings.runtime.cudaResourceViewFormat - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerIspGRBG + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatNone - Nvidia proprietary Bayer ISP format - one channel in one surface with interleaved GRBG ordering and mapped to opaque integer datatype. + No resource view format (use underlying resource format) - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerIspGBRG + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedChar1 - Nvidia proprietary Bayer ISP format - one channel in one surface with interleaved GBRG ordering and mapped to opaque integer datatype. + 1 channel unsigned 8-bit integers - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerBCCR + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedChar2 - Bayer format - one channel in one surface with interleaved BCCR ordering. + 2 channel unsigned 8-bit integers - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerRCCB + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedChar4 - Bayer format - one channel in one surface with interleaved RCCB ordering. + 4 channel unsigned 8-bit integers - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerCRBC + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedChar1 - Bayer format - one channel in one surface with interleaved CRBC ordering. + 1 channel signed 8-bit integers - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerCBRC + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedChar2 - Bayer format - one channel in one surface with interleaved CBRC ordering. + 2 channel signed 8-bit integers - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer10CCCC + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedChar4 - Bayer10 format - one channel in one surface with interleaved CCCC ordering. Out of 16 bits, 10 bits used 6 bits No-op. + 4 channel signed 8-bit integers - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer12BCCR + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedShort1 - Bayer12 format - one channel in one surface with interleaved BCCR ordering. Out of 16 bits, 12 bits used 4 bits No-op. + 1 channel unsigned 16-bit integers - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer12RCCB + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedShort2 - Bayer12 format - one channel in one surface with interleaved RCCB ordering. Out of 16 bits, 12 bits used 4 bits No-op. + 2 channel unsigned 16-bit integers - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer12CRBC + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedShort4 - Bayer12 format - one channel in one surface with interleaved CRBC ordering. Out of 16 bits, 12 bits used 4 bits No-op. + 4 channel unsigned 16-bit integers - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer12CBRC + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedShort1 - Bayer12 format - one channel in one surface with interleaved CBRC ordering. Out of 16 bits, 12 bits used 4 bits No-op. + 1 channel signed 16-bit integers - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer12CCCC + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedShort2 - Bayer12 format - one channel in one surface with interleaved CCCC ordering. Out of 16 bits, 12 bits used 4 bits No-op. + 2 channel signed 16-bit integers - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedShort4 - Color format for single Y plane. + 4 channel signed 16-bit integers - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV420SemiPlanar_2020 + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedInt1 - Y, UV in two surfaces (UV as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. + 1 channel unsigned 32-bit integers - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU420SemiPlanar_2020 + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedInt2 - Y, VU in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. + 2 channel unsigned 32-bit integers - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV420Planar_2020 + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedInt4 - Y, U, V in three surfaces, each in a separate surface, U/V width = 1/2 Y width, U/V height = 1/2 Y height. + 4 channel unsigned 32-bit integers - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU420Planar_2020 + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedInt1 - Y, V, U in three surfaces, each in a separate surface, U/V width = 1/2 Y width, U/V height = 1/2 Y height. + 1 channel signed 32-bit integers - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV420SemiPlanar_709 + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedInt2 - Y, UV in two surfaces (UV as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. + 2 channel signed 32-bit integers - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU420SemiPlanar_709 + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedInt4 - Y, VU in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. + 4 channel signed 32-bit integers - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV420Planar_709 + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatHalf1 - Y, U, V in three surfaces, each in a separate surface, U/V width = 1/2 Y width, U/V height = 1/2 Y height. + 1 channel 16-bit floating point - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU420Planar_709 + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatHalf2 - Y, V, U in three surfaces, each in a separate surface, U/V width = 1/2 Y width, U/V height = 1/2 Y height. + 2 channel 16-bit floating point - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_420SemiPlanar_709 + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatHalf4 - Y10, V10U10 in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. + 4 channel 16-bit floating point - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_420SemiPlanar_2020 + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatFloat1 - Y10, V10U10 in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. + 1 channel 32-bit floating point - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_422SemiPlanar_2020 + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatFloat2 - Y10, V10U10 in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = Y height. + 2 channel 32-bit floating point - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_422SemiPlanar + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatFloat4 - Y10, V10U10 in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = Y height. + 4 channel 32-bit floating point - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_422SemiPlanar_709 + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed1 - Y10, V10U10 in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = Y height. + Block compressed 1 - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY_ER + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed2 - Extended Range Color format for single Y plane. + Block compressed 2 - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY_709_ER + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed3 - Extended Range Color format for single Y plane. + Block compressed 3 - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10_ER + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed4 - Extended Range Color format for single Y10 plane. + Block compressed 4 unsigned - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10_709_ER + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedBlockCompressed4 - Extended Range Color format for single Y10 plane. + Block compressed 4 signed - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY12_ER + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed5 - Extended Range Color format for single Y12 plane. + Block compressed 5 unsigned - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY12_709_ER + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedBlockCompressed5 - Extended Range Color format for single Y12 plane. + Block compressed 5 signed - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUVA + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed6H - Y, U, V, A four channels in one surface, interleaved as AVUY. + Block compressed 6 unsigned half-float - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVYU + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedBlockCompressed6H - Y, U, V in one surface, interleaved as YVYU in one channel. + Block compressed 6 signed half-float - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatVYUY + .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed7 - Y, U, V in one surface, interleaved as VYUY in one channel. + Block compressed 7 +.. autoclass:: cuda.bindings.runtime.cudaSharedMemoryMode - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_420SemiPlanar_ER + .. autoattribute:: cuda.bindings.runtime.cudaSharedMemoryMode.cudaSharedMemoryModeDefault - Extended Range Y10, V10U10 in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. + The default to use for allowing non-portable shared memory size on launch - uses current function attributes for :py:obj:`~.cudaFuncAttributeMaxDynamicSharedMemorySize` - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER + .. autoattribute:: cuda.bindings.runtime.cudaSharedMemoryMode.cudaSharedMemoryModeRequirePortable - Extended Range Y10, V10U10 in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. + Specifies that the shared memory size requested must be a portable size within :py:obj:`~.cudaDevAttrMaxSharedMemoryPerBlock` - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_444SemiPlanar_ER + .. autoattribute:: cuda.bindings.runtime.cudaSharedMemoryMode.cudaSharedMemoryModeAllowNonPortable - Extended Range Y10, V10U10 in two surfaces (VU as one surface) U/V width = Y width, U/V height = Y height. + Specifies that the shared memory size requested may be a non-portable size up to :py:obj:`~.cudaDevAttrMaxSharedMemoryPerBlockOptin` +.. autoclass:: cuda.bindings.runtime.cudaFuncAttribute - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER + .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeMaxDynamicSharedMemorySize - Extended Range Y10, V10U10 in two surfaces (VU as one surface) U/V width = Y width, U/V height = Y height. + Maximum dynamic shared memory size - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY12V12U12_420SemiPlanar_ER + .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributePreferredSharedMemoryCarveout - Extended Range Y12, V12U12 in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. + Preferred shared memory-L1 cache split - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER + .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeClusterDimMustBeSet - Extended Range Y12, V12U12 in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. + Indicator to enforce valid cluster dimension specification on kernel launch - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY12V12U12_444SemiPlanar_ER + .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeRequiredClusterWidth - Extended Range Y12, V12U12 in two surfaces (VU as one surface) U/V width = Y width, U/V height = Y height. + Required cluster width - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER + .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeRequiredClusterHeight - Extended Range Y12, V12U12 in two surfaces (VU as one surface) U/V width = Y width, U/V height = Y height. + Required cluster height - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatUYVY709 + .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeRequiredClusterDepth - Y, U, V in one surface, interleaved as UYVY in one channel. + Required cluster depth - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatUYVY709_ER + .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeNonPortableClusterSizeAllowed - Extended Range Y, U, V in one surface, interleaved as UYVY in one channel. + Whether non-portable cluster scheduling policy is supported - .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatUYVY2020 + .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeClusterSchedulingPolicyPreference - Y, U, V in one surface, interleaved as UYVY in one channel. + Required cluster scheduling policy preference -.. autoclass:: cuda.bindings.runtime.cudaError_t - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaSuccess + .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeMax +.. autoclass:: cuda.bindings.runtime.cudaFuncCache - The API call returned with no errors. In the case of query calls, this also means that the operation being queried is complete (see :py:obj:`~.cudaEventQuery()` and :py:obj:`~.cudaStreamQuery()`). + .. autoattribute:: cuda.bindings.runtime.cudaFuncCache.cudaFuncCachePreferNone - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidValue + Default function cache configuration, no preference - This indicates that one or more of the parameters passed to the API call is not within an acceptable range of values. + .. autoattribute:: cuda.bindings.runtime.cudaFuncCache.cudaFuncCachePreferShared - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMemoryAllocation + Prefer larger shared memory and smaller L1 cache - The API call failed because it was unable to allocate enough memory or other resources to perform the requested operation. + .. autoattribute:: cuda.bindings.runtime.cudaFuncCache.cudaFuncCachePreferL1 - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInitializationError + Prefer larger L1 cache and smaller shared memory - The API call failed because the CUDA driver and runtime could not be initialized. + .. autoattribute:: cuda.bindings.runtime.cudaFuncCache.cudaFuncCachePreferEqual - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorCudartUnloading + Prefer equal size L1 cache and shared memory +.. autoclass:: cuda.bindings.runtime.cudaSharedMemConfig - 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. + .. autoattribute:: cuda.bindings.runtime.cudaSharedMemConfig.cudaSharedMemBankSizeDefault - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorProfilerDisabled + .. autoattribute:: cuda.bindings.runtime.cudaSharedMemConfig.cudaSharedMemBankSizeFourByte - This indicates profiler is not initialized for this run. This can happen when the application is running with external profiling tools like visual profiler. + .. autoattribute:: cuda.bindings.runtime.cudaSharedMemConfig.cudaSharedMemBankSizeEightByte +.. autoclass:: cuda.bindings.runtime.cudaSharedCarveout - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorProfilerNotInitialized + .. autoattribute:: cuda.bindings.runtime.cudaSharedCarveout.cudaSharedmemCarveoutDefault - [Deprecated] + No preference for shared memory or L1 (default) - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorProfilerAlreadyStarted + .. autoattribute:: cuda.bindings.runtime.cudaSharedCarveout.cudaSharedmemCarveoutMaxShared - [Deprecated] + Prefer maximum available shared memory, minimum L1 cache - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorProfilerAlreadyStopped + .. autoattribute:: cuda.bindings.runtime.cudaSharedCarveout.cudaSharedmemCarveoutMaxL1 - [Deprecated] + Prefer maximum available L1 cache, minimum shared memory +.. autoclass:: cuda.bindings.runtime.cudaComputeMode - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidConfiguration + .. autoattribute:: cuda.bindings.runtime.cudaComputeMode.cudaComputeModeDefault - 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 :py:obj:`~.cudaDeviceProp` for more device limitations. + Default compute mode (Multiple threads can use :py:obj:`~.cudaSetDevice()` with this device) - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorVersionTranslation + .. autoattribute:: cuda.bindings.runtime.cudaComputeMode.cudaComputeModeExclusive - This indicates that the driver is newer than the runtime version and returned graph node parameter information that the runtime does not understand and is unable to translate. + Compute-exclusive-thread mode (Only one thread in one process will be able to use :py:obj:`~.cudaSetDevice()` with this device) - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidPitchValue + .. autoattribute:: cuda.bindings.runtime.cudaComputeMode.cudaComputeModeProhibited - This indicates that one or more of the pitch-related parameters passed to the API call is not within the acceptable range for pitch. + Compute-prohibited mode (No threads can use :py:obj:`~.cudaSetDevice()` with this device) - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidSymbol + .. autoattribute:: cuda.bindings.runtime.cudaComputeMode.cudaComputeModeExclusiveProcess - This indicates that the symbol name/identifier passed to the API call is not a valid name or identifier. + Compute-exclusive-process mode (Many threads in one process will be able to use :py:obj:`~.cudaSetDevice()` with this device) +.. autoclass:: cuda.bindings.runtime.cudaLimit - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidHostPointer + .. autoattribute:: cuda.bindings.runtime.cudaLimit.cudaLimitStackSize - This indicates that at least one host pointer passed to the API call is not a valid host pointer. [Deprecated] + GPU thread stack size - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidDevicePointer + .. autoattribute:: cuda.bindings.runtime.cudaLimit.cudaLimitPrintfFifoSize - This indicates that at least one device pointer passed to the API call is not a valid device pointer. [Deprecated] + GPU printf FIFO size - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidTexture + .. autoattribute:: cuda.bindings.runtime.cudaLimit.cudaLimitMallocHeapSize - This indicates that the texture passed to the API call is not a valid texture. + GPU malloc heap size - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidTextureBinding + .. autoattribute:: cuda.bindings.runtime.cudaLimit.cudaLimitDevRuntimeSyncDepth - This indicates that the texture binding is not valid. This occurs if you call :py:obj:`~.cudaGetTextureAlignmentOffset()` with an unbound texture. + GPU device runtime synchronize depth - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidChannelDescriptor + .. autoattribute:: cuda.bindings.runtime.cudaLimit.cudaLimitDevRuntimePendingLaunchCount - 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 :py:obj:`~.cudaChannelFormatKind`, or if one of the dimensions is invalid. + GPU device runtime pending launch count - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidMemcpyDirection + .. autoattribute:: cuda.bindings.runtime.cudaLimit.cudaLimitMaxL2FetchGranularity - This indicates that the direction of the memcpy passed to the API call is not one of the types specified by :py:obj:`~.cudaMemcpyKind`. + A value between 0 and 128 that indicates the maximum fetch granularity of L2 (in Bytes). This is a hint - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorAddressOfConstant + .. autoattribute:: cuda.bindings.runtime.cudaLimit.cudaLimitPersistingL2CacheSize - This indicated that the user has taken the address of a constant variable, which was forbidden up until the CUDA 3.1 release. [Deprecated] + A size in bytes for L2 persisting lines cache size +.. autoclass:: cuda.bindings.runtime.cudaMemoryAdvise - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorTextureFetchFailed + .. autoattribute:: cuda.bindings.runtime.cudaMemoryAdvise.cudaMemAdviseSetReadMostly - This indicated that a texture fetch was not able to be performed. This was previously used for device emulation of texture operations. [Deprecated] + Data will mostly be read and only occassionally be written to - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorTextureNotBound + .. autoattribute:: cuda.bindings.runtime.cudaMemoryAdvise.cudaMemAdviseUnsetReadMostly - This indicated that a texture was not bound for access. This was previously used for device emulation of texture operations. [Deprecated] + Undo the effect of :py:obj:`~.cudaMemAdviseSetReadMostly` - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorSynchronizationError + .. autoattribute:: cuda.bindings.runtime.cudaMemoryAdvise.cudaMemAdviseSetPreferredLocation - This indicated that a synchronization operation had failed. This was previously used for some device emulation functions. [Deprecated] + Set the preferred location for the data as the specified device - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidFilterSetting + .. autoattribute:: cuda.bindings.runtime.cudaMemoryAdvise.cudaMemAdviseUnsetPreferredLocation - This indicates that a non-float texture was being accessed with linear filtering. This is not supported by CUDA. + Clear the preferred location for the data - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidNormSetting + .. autoattribute:: cuda.bindings.runtime.cudaMemoryAdvise.cudaMemAdviseSetAccessedBy - This indicates that an attempt was made to read an unsupported data type as a normalized float. This is not supported by CUDA. + Data will be accessed by the specified device, so prevent page faults as much as possible - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMixedDeviceExecution + .. autoattribute:: cuda.bindings.runtime.cudaMemoryAdvise.cudaMemAdviseUnsetAccessedBy - Mixing of device and device emulation code was not allowed. [Deprecated] + Let the Unified Memory subsystem decide on the page faulting policy for the specified device +.. autoclass:: cuda.bindings.runtime.cudaMemRangeAttribute - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorNotYetImplemented + .. autoattribute:: cuda.bindings.runtime.cudaMemRangeAttribute.cudaMemRangeAttributeReadMostly - This indicates that the API call is not yet implemented. Production releases of CUDA will never return this error. [Deprecated] + Whether the range will mostly be read and only occassionally be written to - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMemoryValueTooLarge + .. autoattribute:: cuda.bindings.runtime.cudaMemRangeAttribute.cudaMemRangeAttributePreferredLocation - This indicated that an emulated device pointer exceeded the 32-bit address range. [Deprecated] + The preferred location of the range - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStubLibrary + .. autoattribute:: cuda.bindings.runtime.cudaMemRangeAttribute.cudaMemRangeAttributeAccessedBy - 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. + Memory range has :py:obj:`~.cudaMemAdviseSetAccessedBy` set for specified device - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInsufficientDriver + .. autoattribute:: cuda.bindings.runtime.cudaMemRangeAttribute.cudaMemRangeAttributeLastPrefetchLocation - 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. + The last location to which the range was prefetched - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorCallRequiresNewerDriver + .. autoattribute:: cuda.bindings.runtime.cudaMemRangeAttribute.cudaMemRangeAttributePreferredLocationType - 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. + The preferred location type of the range - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidSurface + .. autoattribute:: cuda.bindings.runtime.cudaMemRangeAttribute.cudaMemRangeAttributePreferredLocationId - This indicates that the surface passed to the API call is not a valid surface. + The preferred location id of the range - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorDuplicateVariableName + .. autoattribute:: cuda.bindings.runtime.cudaMemRangeAttribute.cudaMemRangeAttributeLastPrefetchLocationType - This indicates that multiple global or constant variables (across separate CUDA source files in the application) share the same string name. + The last location type to which the range was prefetched - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorDuplicateTextureName + .. autoattribute:: cuda.bindings.runtime.cudaMemRangeAttribute.cudaMemRangeAttributeLastPrefetchLocationId - This indicates that multiple textures (across separate CUDA source files in the application) share the same string name. + The last location id to which the range was prefetched +.. autoclass:: cuda.bindings.runtime.cudaFlushGPUDirectRDMAWritesOptions - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorDuplicateSurfaceName + .. autoattribute:: cuda.bindings.runtime.cudaFlushGPUDirectRDMAWritesOptions.cudaFlushGPUDirectRDMAWritesOptionHost - This indicates that multiple surfaces (across separate CUDA source files in the application) share the same string name. + :py:obj:`~.cudaDeviceFlushGPUDirectRDMAWrites()` and its CUDA Driver API counterpart are supported on the device. - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorDevicesUnavailable + .. autoattribute:: cuda.bindings.runtime.cudaFlushGPUDirectRDMAWritesOptions.cudaFlushGPUDirectRDMAWritesOptionMemOps - This indicates that all CUDA devices are busy or unavailable at the current time. Devices are often busy/unavailable due to use of :py:obj:`~.cudaComputeModeProhibited`, :py:obj:`~.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. + The :py:obj:`~.CU_STREAM_WAIT_VALUE_FLUSH` flag and the :py:obj:`~.CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES` MemOp are supported on the CUDA device. +.. autoclass:: cuda.bindings.runtime.cudaGPUDirectRDMAWritesOrdering - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorIncompatibleDriverContext + .. autoattribute:: cuda.bindings.runtime.cudaGPUDirectRDMAWritesOrdering.cudaGPUDirectRDMAWritesOrderingNone - 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 :py:obj:`~.Interactions`with the CUDA Driver API" for more information. + The device does not natively support ordering of GPUDirect RDMA writes. :py:obj:`~.cudaFlushGPUDirectRDMAWrites()` can be leveraged if supported. - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMissingConfiguration + .. autoattribute:: cuda.bindings.runtime.cudaGPUDirectRDMAWritesOrdering.cudaGPUDirectRDMAWritesOrderingOwner - The device function being invoked (usually via :py:obj:`~.cudaLaunchKernel()`) was not previously configured via the :py:obj:`~.cudaConfigureCall()` function. + Natively, the device can consistently consume GPUDirect RDMA writes, although other CUDA devices may not. - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorPriorLaunchFailure + .. autoattribute:: cuda.bindings.runtime.cudaGPUDirectRDMAWritesOrdering.cudaGPUDirectRDMAWritesOrderingAllDevices - This indicated that a previous kernel launch failed. This was previously used for device emulation of kernel launches. [Deprecated] + Any CUDA device in the system can consistently consume GPUDirect RDMA writes to this device. +.. autoclass:: cuda.bindings.runtime.cudaFlushGPUDirectRDMAWritesScope - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorLaunchMaxDepthExceeded + .. autoattribute:: cuda.bindings.runtime.cudaFlushGPUDirectRDMAWritesScope.cudaFlushGPUDirectRDMAWritesToOwner - 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. + Blocks until remote writes are visible to the CUDA device context owning the data. - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorLaunchFileScopedTex + .. autoattribute:: cuda.bindings.runtime.cudaFlushGPUDirectRDMAWritesScope.cudaFlushGPUDirectRDMAWritesToAllDevices - 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. + Blocks until remote writes are visible to all CUDA device contexts. +.. autoclass:: cuda.bindings.runtime.cudaFlushGPUDirectRDMAWritesTarget - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorLaunchFileScopedSurf + .. autoattribute:: cuda.bindings.runtime.cudaFlushGPUDirectRDMAWritesTarget.cudaFlushGPUDirectRDMAWritesTargetCurrentDevice - 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. + Sets the target for :py:obj:`~.cudaDeviceFlushGPUDirectRDMAWrites()` to the currently active CUDA device context. +.. autoclass:: cuda.bindings.runtime.cudaDeviceAttr - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorSyncDepthExceeded + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxThreadsPerBlock - This error indicates that a call to :py:obj:`~.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 :py:obj:`~.cudaLimitDevRuntimeSyncDepth`. To be able to synchronize on launched grids at a greater depth successfully, the maximum nested depth at which :py:obj:`~.cudaDeviceSynchronize` will be called must be specified with the :py:obj:`~.cudaLimitDevRuntimeSyncDepth` limit to the :py:obj:`~.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 :py:obj:`~.cudaDeviceSynchronize` made from device runtime is only supported on devices of compute capability < 9.0. + Maximum number of threads per block - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorLaunchPendingCountExceeded + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxBlockDimX - This error indicates that a device runtime grid launch failed because the launch would exceed the limit :py:obj:`~.cudaLimitDevRuntimePendingLaunchCount`. For this launch to proceed successfully, :py:obj:`~.cudaDeviceSetLimit` must be called to set the :py:obj:`~.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. + Maximum block dimension X - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidDeviceFunction + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxBlockDimY - The requested device function does not exist or is not compiled for the proper device architecture. + Maximum block dimension Y - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorNoDevice + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxBlockDimZ - This indicates that no CUDA-capable devices were detected by the installed CUDA driver. + Maximum block dimension Z - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidDevice + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxGridDimX - 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. + Maximum grid dimension X - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorDeviceNotLicensed + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxGridDimY - This indicates that the device doesn't have a valid Grid License. + Maximum grid dimension Y - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorSoftwareValidityNotEstablished + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxGridDimZ - 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. + Maximum grid dimension Z - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStartupFailure + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSharedMemoryPerBlock - This indicates an internal startup failure in the CUDA runtime. + Maximum shared memory available per block in bytes - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidKernelImage + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrTotalConstantMemory - This indicates that the device kernel image is invalid. + Memory available on device for constant variables in a CUDA C kernel in bytes - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorDeviceUninitialized + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrWarpSize - 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 :py:obj:`~.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 :py:obj:`~.cuCtxGetApiVersion()` for more details. + Warp size in threads - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMapBufferObjectFailed + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxPitch - This indicates that the buffer object could not be mapped. + Maximum pitch in bytes allowed by memory copies - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorUnmapBufferObjectFailed + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxRegistersPerBlock - This indicates that the buffer object could not be unmapped. + Maximum number of 32-bit registers available per block - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorArrayIsMapped + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrClockRate - This indicates that the specified array is currently mapped and thus cannot be destroyed. + Peak clock frequency in kilohertz - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorAlreadyMapped + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrTextureAlignment - This indicates that the resource is already mapped. + Alignment requirement for textures - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorNoKernelImageForDevice + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrGpuOverlap - 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. + Device can possibly copy memory and execute a kernel concurrently - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorAlreadyAcquired + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMultiProcessorCount - This indicates that a resource has already been acquired. + Number of multiprocessors on device - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorNotMapped + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrKernelExecTimeout - This indicates that a resource is not mapped. + Specifies whether there is a run time limit on kernels - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorNotMappedAsArray + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrIntegrated - This indicates that a mapped resource is not available for access as an array. + Device is integrated with host memory - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorNotMappedAsPointer + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrCanMapHostMemory - This indicates that a mapped resource is not available for access as a pointer. + Device can map host memory into CUDA address space - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorECCUncorrectable + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrComputeMode - This indicates that an uncorrectable ECC error was detected during execution. + Compute mode (See :py:obj:`~.cudaComputeMode` for details) - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorUnsupportedLimit + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture1DWidth - This indicates that the :py:obj:`~.cudaLimit` passed to the API call is not supported by the active device. + Maximum 1D texture width - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorDeviceAlreadyInUse + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DWidth - This indicates that a call tried to access an exclusive-thread device that is already in use by a different thread. + Maximum 2D texture width - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorPeerAccessUnsupported + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DHeight - This error indicates that P2P access is not supported across the given devices. + Maximum 2D texture height - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidPtx + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture3DWidth - 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. + Maximum 3D texture width - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidGraphicsContext + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture3DHeight - This indicates an error with the OpenGL or DirectX context. + Maximum 3D texture height - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorNvlinkUncorrectable + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture3DDepth - This indicates that an uncorrectable NVLink error was detected during the execution. + Maximum 3D texture depth - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorJitCompilerNotFound + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DLayeredWidth - 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. + Maximum 2D layered texture width - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorUnsupportedPtxVersion + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DLayeredHeight - 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. + Maximum 2D layered texture height - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorJitCompilationDisabled + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DLayeredLayers - 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. + Maximum layers in a 2D layered texture - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorUnsupportedExecAffinity + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrSurfaceAlignment - This indicates that the provided execution affinity is not supported by the device. + Alignment requirement for surfaces - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorUnsupportedDevSideSync + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrConcurrentKernels - This indicates that the code to be compiled by the PTX JIT contains unsupported call to cudaDeviceSynchronize. + Device can possibly execute multiple kernels concurrently - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorContained + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrEccEnabled - 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. + Device has ECC support enabled - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidSource + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrPciBusId - This indicates that the device kernel source is invalid. + PCI bus ID of the device - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorFileNotFound + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrPciDeviceId - This indicates that the file specified was not found. + PCI device ID of the device - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorSharedObjectSymbolNotFound + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrTccDriver - This indicates that a link to a shared object failed to resolve. + Device is using TCC driver model - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorSharedObjectInitFailed + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMemoryClockRate - This indicates that initialization of a shared object failed. + Peak memory clock frequency in kilohertz - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorOperatingSystem + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrGlobalMemoryBusWidth - This error indicates that an OS call failed. + Global memory bus width in bits - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidResourceHandle + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrL2CacheSize - This indicates that a resource handle passed to the API call was not valid. Resource handles are opaque types like :py:obj:`~.cudaStream_t` and :py:obj:`~.cudaEvent_t`. + Size of L2 cache in bytes - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorIllegalState + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxThreadsPerMultiProcessor - This indicates that a resource required by the API call is not in a valid state to perform the requested operation. + Maximum resident threads per multiprocessor - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorLossyQuery + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrAsyncEngineCount - 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. + Number of asynchronous engines - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorSymbolNotFound + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrUnifiedAddressing - 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. + Device shares a unified address space with the host - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorNotReady + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture1DLayeredWidth - This indicates that asynchronous operations issued previously have not completed yet. This result is not actually an error, but must be indicated differently than :py:obj:`~.cudaSuccess` (which indicates completion). Calls that may return this value include :py:obj:`~.cudaEventQuery()` and :py:obj:`~.cudaStreamQuery()`. + Maximum 1D layered texture width - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorIllegalAddress + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture1DLayeredLayers - 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. + Maximum layers in a 1D layered texture - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorLaunchOutOfResources + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DGatherWidth - This indicates that a launch did not occur because it did not have appropriate resources. Although this error is similar to :py:obj:`~.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. + Maximum 2D texture width if cudaArrayTextureGather is set - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorLaunchTimeout + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DGatherHeight - 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. + Maximum 2D texture height if cudaArrayTextureGather is set - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorLaunchIncompatibleTexturing + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture3DWidthAlt - This error indicates a kernel launch that uses an incompatible texturing mode. + Alternate maximum 3D texture width - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorPeerAccessAlreadyEnabled + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture3DHeightAlt - This error indicates that a call to :py:obj:`~.cudaDeviceEnablePeerAccess()` is trying to re-enable peer addressing on from a context which has already had peer addressing enabled. + Alternate maximum 3D texture height - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorPeerAccessNotEnabled + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture3DDepthAlt - This error indicates that :py:obj:`~.cudaDeviceDisablePeerAccess()` is trying to disable peer addressing which has not been enabled yet via :py:obj:`~.cudaDeviceEnablePeerAccess()`. + Alternate maximum 3D texture depth - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorSetOnActiveProcess + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrPciDomainId - This indicates that the user has called :py:obj:`~.cudaSetValidDevices()`, :py:obj:`~.cudaSetDeviceFlags()`, :py:obj:`~.cudaD3D9SetDirect3DDevice()`, :py:obj:`~.cudaD3D10SetDirect3DDevice`, :py:obj:`~.cudaD3D11SetDirect3DDevice()`, or :py:obj:`~.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 :py:obj:`~.CUcontext` active on the host thread. + PCI domain ID of the device - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorContextIsDestroyed + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrTexturePitchAlignment - This error indicates that the context current to the calling thread has been destroyed using :py:obj:`~.cuCtxDestroy`, or is a primary context which has not yet been initialized. + Pitch alignment requirement for textures - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorAssert + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTextureCubemapWidth - 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. + Maximum cubemap texture width/height - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorTooManyPeers + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTextureCubemapLayeredWidth - This error indicates that the hardware resources required to enable peer access have been exhausted for one or more of the devices passed to :py:obj:`~.cudaEnablePeerAccess()`. + Maximum cubemap layered texture width/height - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorHostMemoryAlreadyRegistered + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTextureCubemapLayeredLayers - This error indicates that the memory range passed to :py:obj:`~.cudaHostRegister()` has already been registered. + Maximum layers in a cubemap layered texture - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorHostMemoryNotRegistered + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface1DWidth - This error indicates that the pointer passed to :py:obj:`~.cudaHostUnregister()` does not correspond to any currently registered memory region. + Maximum 1D surface width - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorHardwareStackError + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface2DWidth - 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. + Maximum 2D surface width - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorIllegalInstruction + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface2DHeight - 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. + Maximum 2D surface height - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMisalignedAddress + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface3DWidth - 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. + Maximum 3D surface width - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidAddressSpace + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface3DHeight - 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. + Maximum 3D surface height - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidPc + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface3DDepth - 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. + Maximum 3D surface depth - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorLaunchFailure + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface1DLayeredWidth - 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. + Maximum 1D layered surface width - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorCooperativeLaunchTooLarge + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface1DLayeredLayers - 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`. + Maximum layers in a 1D layered surface - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorTensorMemoryLeak + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface2DLayeredWidth - 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. + Maximum 2D layered surface width - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorNotPermitted + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface2DLayeredHeight - This error indicates the attempted operation is not permitted. + Maximum 2D layered surface height - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorNotSupported + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface2DLayeredLayers - This error indicates the attempted operation is not supported on the current system or device. + Maximum layers in a 2D layered surface - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorSystemNotReady + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurfaceCubemapWidth - 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. + Maximum cubemap surface width - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorSystemDriverMismatch + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurfaceCubemapLayeredWidth - 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. + Maximum cubemap layered surface width - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorCompatNotSupportedOnDevice + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurfaceCubemapLayeredLayers - 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. + Maximum layers in a cubemap layered surface - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMpsConnectionFailed + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture1DLinearWidth - This error indicates that the MPS client failed to connect to the MPS control daemon or the MPS server. + Maximum 1D linear texture width - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMpsRpcFailure + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DLinearWidth - This error indicates that the remote procedural call between the MPS server and the MPS client failed. + Maximum 2D linear texture width - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMpsServerNotReady + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DLinearHeight - 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. + Maximum 2D linear texture height - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMpsMaxClientsReached + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DLinearPitch - This error indicates that the hardware resources required to create MPS client have been exhausted. + Maximum 2D linear texture pitch in bytes - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMpsMaxConnectionsReached + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DMipmappedWidth - This error indicates the the hardware resources required to device connections have been exhausted. + Maximum mipmapped 2D texture width - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMpsClientTerminated + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DMipmappedHeight - This error indicates that the MPS client has been terminated by the server. To continue using CUDA, the process must be terminated and relaunched. + Maximum mipmapped 2D texture height - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorCdpNotSupported + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrComputeCapabilityMajor - This error indicates, that the program is using CUDA Dynamic Parallelism, but the current configuration, like MPS, does not support it. + Major compute capability version number - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorCdpVersionMismatch + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrComputeCapabilityMinor - This error indicates, that the program contains an unsupported interaction between different versions of CUDA Dynamic Parallelism. + Minor compute capability version number - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStreamCaptureUnsupported + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture1DMipmappedWidth - The operation is not permitted when the stream is capturing. + Maximum mipmapped 1D texture width - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStreamCaptureInvalidated + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrStreamPrioritiesSupported - The current capture sequence on the stream has been invalidated due to a previous error. + Device supports stream priorities - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStreamCaptureMerge + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrGlobalL1CacheSupported - The operation would have resulted in a merge of two independent capture sequences. + Device supports caching globals in L1 - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStreamCaptureUnmatched + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrLocalL1CacheSupported - The capture was not initiated in this stream. + Device supports caching locals in L1 - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStreamCaptureUnjoined + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSharedMemoryPerMultiprocessor - The capture sequence contains a fork that was not joined to the primary stream. + Maximum shared memory available per multiprocessor in bytes - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStreamCaptureIsolation + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxRegistersPerMultiprocessor - A dependency would have been created which crosses the capture sequence boundary. Only implicit in-stream ordering dependencies are allowed to cross the boundary. + Maximum number of 32-bit registers available per multiprocessor - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStreamCaptureImplicit + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrManagedMemory - The operation would have resulted in a disallowed implicit dependency on a current capture sequence from cudaStreamLegacy. + Device can allocate managed memory on this system - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorCapturedEvent + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrIsMultiGpuBoard - The operation is not permitted on an event which was last recorded in a capturing stream. + Device is on a multi-GPU board - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStreamCaptureWrongThread + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMultiGpuBoardGroupID - A stream capture sequence not initiated with the :py:obj:`~.cudaStreamCaptureModeRelaxed` argument to :py:obj:`~.cudaStreamBeginCapture` was passed to :py:obj:`~.cudaStreamEndCapture` in a different thread. + Unique identifier for a group of devices on the same multi-GPU board - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorTimeout + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrHostNativeAtomicSupported - This indicates that the wait operation has timed out. + Link between the device and the host supports native atomic operations - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorGraphExecUpdateFailure + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrSingleToDoublePrecisionPerfRatio - This error indicates that the graph update was not performed because it included changes which violated constraints specific to instantiated graph update. + Ratio of single precision performance (in floating-point operations per second) to double precision performance - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorExternalDevice + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrPageableMemoryAccess - This indicates that an error has occurred in a device outside of GPU. It can be a synchronous error w.r.t. CUDA API or an asynchronous error from the external device. In case of asynchronous error, it means that 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. In case of synchronous error, it means that one or more external devices have encountered an error and cannot complete the operation. + Device supports coherently accessing pageable memory without calling cudaHostRegister on it - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidClusterSize + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrConcurrentManagedAccess - This indicates that a kernel launch error has occurred due to cluster misconfiguration. + Device can coherently access managed memory concurrently with the CPU - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorFunctionNotLoaded + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrComputePreemptionSupported - Indiciates a function handle is not loaded when calling an API that requires a loaded function. + Device supports Compute Preemption - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidResourceType + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrCanUseHostPointerForRegisteredMem - This error indicates one or more resources passed in are not valid resource types for the operation. + Device can access host registered memory at the same virtual address as the CPU - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidResourceConfiguration + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved92 - This error indicates one or more resources are insufficient or non-applicable for the operation. + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved93 - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorStreamDetached + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved94 - This error indicates that the requested operation is not permitted because the stream is in a detached state. This can occur if the green context associated with the stream has been destroyed, limiting the stream's operational capabilities. + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrCooperativeLaunch - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorUnknown + Device supports launching cooperative kernels via :py:obj:`~.cudaLaunchCooperativeKernel` - This indicates that an unknown internal error has occurred. + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved96 - .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorApiFailureBase + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSharedMemoryPerBlockOptin -.. autoclass:: cuda.bindings.runtime.cudaChannelFormatKind - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSigned + The maximum optin shared memory per block. This value may vary by chip. See :py:obj:`~.cudaFuncSetAttribute` - Signed channel format + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrCanFlushRemoteWrites - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsigned + Device supports flushing of outstanding remote writes. - Unsigned channel format + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrHostRegisterSupported - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindFloat + Device supports host memory registration via :py:obj:`~.cudaHostRegister`. - Float channel format + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrPageableMemoryAccessUsesHostPageTables - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindNone + Device accesses pageable memory via the host's page tables. - No channel format + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrDirectManagedMemAccessFromHost - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindNV12 + Host can directly access managed memory on the device without migration. - Unsigned 8-bit integers, planar 4:2:0 YUV format + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxBlocksPerMultiprocessor - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X1 + Maximum number of blocks per multiprocessor - 1 channel unsigned 8-bit normalized integer + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxPersistingL2CacheSize - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2 + Maximum L2 persisting lines capacity setting in bytes. - 2 channel unsigned 8-bit normalized integer + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxAccessPolicyWindowSize - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4 + Maximum value of :py:obj:`~.cudaAccessPolicyWindow.num_bytes`. - 4 channel unsigned 8-bit normalized integer + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReservedSharedMemoryPerBlock - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X1 + Shared memory reserved by CUDA driver per block in bytes - 1 channel unsigned 16-bit normalized integer + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrSparseCudaArraySupported - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2 + Device supports sparse CUDA arrays and sparse CUDA mipmapped arrays - 2 channel unsigned 16-bit normalized integer + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrHostRegisterReadOnlySupported - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4 + Device supports using the :py:obj:`~.cudaHostRegister` flag cudaHostRegisterReadOnly to register memory that must be mapped as read-only to the GPU - 4 channel unsigned 16-bit normalized integer + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrTimelineSemaphoreInteropSupported - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1 + External timeline semaphore interop is supported on the device - 1 channel signed 8-bit normalized integer + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMemoryPoolsSupported - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2 + Device supports using the :py:obj:`~.cudaMallocAsync` and :py:obj:`~.cudaMemPool` family of APIs - 2 channel signed 8-bit normalized integer + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrGPUDirectRDMASupported - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4 + Device supports GPUDirect RDMA APIs, like nvidia_p2p_get_pages (see https://docs.nvidia.com/cuda/gpudirect-rdma for more information) - 4 channel signed 8-bit normalized integer + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrGPUDirectRDMAFlushWritesOptions - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1 + The returned attribute shall be interpreted as a bitmask, where the individual bits are listed in the :py:obj:`~.cudaFlushGPUDirectRDMAWritesOptions` enum - 1 channel signed 16-bit normalized integer + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrGPUDirectRDMAWritesOrdering - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2 + 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:`~.cudaGPUDirectRDMAWritesOrdering` for the numerical values returned here. - 2 channel signed 16-bit normalized integer + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMemoryPoolSupportedHandleTypes - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4 + Handle types supported with mempool based IPC - 4 channel signed 16-bit normalized integer + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrClusterLaunch - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1 + Indicates device supports cluster launch - 4 channel unsigned normalized block-compressed (BC1 compression) format + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrDeferredMappingCudaArraySupported - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB + Device supports deferred mapping CUDA arrays and CUDA mipmapped arrays - 4 channel unsigned normalized block-compressed (BC1 compression) format with sRGB encoding + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved122 - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2 + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved123 - 4 channel unsigned normalized block-compressed (BC2 compression) format + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved124 - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrIpcEventSupport - 4 channel unsigned normalized block-compressed (BC2 compression) format with sRGB encoding + Device supports IPC Events. - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3 + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMemSyncDomainCount - 4 channel unsigned normalized block-compressed (BC3 compression) format + Number of memory synchronization domains the device supports. - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved127 - 4 channel unsigned normalized block-compressed (BC3 compression) format with sRGB encoding + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved128 - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4 + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved129 - 1 channel unsigned normalized block-compressed (BC4 compression) format + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrNumaConfig - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4 + NUMA configuration of a device: value is of type :py:obj:`~.cudaDeviceNumaConfig` enum - 1 channel signed normalized block-compressed (BC4 compression) format + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrNumaId - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5 + NUMA node ID of the GPU memory - 2 channel unsigned normalized block-compressed (BC5 compression) format + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved132 - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5 + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMpsEnabled - 2 channel signed normalized block-compressed (BC5 compression) format + Contexts created on this device will be shared via MPS - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrHostNumaId - 3 channel unsigned half-float block-compressed (BC6H compression) format + NUMA ID of the host node closest to the device or -1 when system does not support NUMA - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrD3D12CigSupported - 3 channel signed half-float block-compressed (BC6H compression) format + Device supports CIG with D3D12. - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7 + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrVulkanCigSupported - 4 channel unsigned normalized block-compressed (BC7 compression) format + Device supports CIG with Vulkan. - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrGpuPciDeviceId - 4 channel unsigned normalized block-compressed (BC7 compression) format with sRGB encoding + The combined 16-bit PCI device ID and 16-bit PCI vendor ID. - .. autoattribute:: cuda.bindings.runtime.cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized1010102 + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrGpuPciSubsystemId - 4 channel unsigned normalized (10-bit, 10-bit, 10-bit, 2-bit) format + The combined 16-bit PCI subsystem ID and 16-bit PCI subsystem vendor ID. -.. autoclass:: cuda.bindings.runtime.cudaMemoryType - .. autoattribute:: cuda.bindings.runtime.cudaMemoryType.cudaMemoryTypeUnregistered + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved141 - Unregistered memory + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrHostNumaMemoryPoolsSupported - .. autoattribute:: cuda.bindings.runtime.cudaMemoryType.cudaMemoryTypeHost + Device supports HOST_NUMA location with the :py:obj:`~.cudaMallocAsync` and :py:obj:`~.cudaMemPool` family of APIs - Host memory + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrHostNumaMultinodeIpcSupported - .. autoattribute:: cuda.bindings.runtime.cudaMemoryType.cudaMemoryTypeDevice + Device supports HostNuma location IPC between nodes in a multi-node system. - Device memory + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrHostMemoryPoolsSupported - .. autoattribute:: cuda.bindings.runtime.cudaMemoryType.cudaMemoryTypeManaged + Device suports HOST location with the :py:obj:`~.cuMemAllocAsync` and :py:obj:`~.cuMemPool` family of APIs - Managed memory + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved145 -.. autoclass:: cuda.bindings.runtime.cudaMemcpyKind - .. autoattribute:: cuda.bindings.runtime.cudaMemcpyKind.cudaMemcpyHostToHost + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrOnlyPartialHostNativeAtomicSupported - Host -> Host + Link between the device and the host supports only some native atomic operations - .. autoattribute:: cuda.bindings.runtime.cudaMemcpyKind.cudaMemcpyHostToDevice + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrAtomicReductionSupported - Host -> Device + Device supports atomic reduction operations in stream batch memory operations - .. autoattribute:: cuda.bindings.runtime.cudaMemcpyKind.cudaMemcpyDeviceToHost + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrCigStreamsSupported - Device -> Host + Device supports CIG streams - .. autoattribute:: cuda.bindings.runtime.cudaMemcpyKind.cudaMemcpyDeviceToDevice + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMax +.. autoclass:: cuda.bindings.runtime.cudaMemPoolAttr - Device -> Device + .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolReuseFollowEventDependencies - .. autoattribute:: cuda.bindings.runtime.cudaMemcpyKind.cudaMemcpyDefault + (value type = int) Allow cuMemAllocAsync to use memory asynchronously freed in another streams as long as a stream ordering dependency of the allocating stream on the free action exists. Cuda events and null stream interactions can create the required stream ordered dependencies. (default enabled) - Direction of the transfer is inferred from the pointer values. Requires unified virtual addressing + .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolReuseAllowOpportunistic -.. autoclass:: cuda.bindings.runtime.cudaAccessProperty - .. autoattribute:: cuda.bindings.runtime.cudaAccessProperty.cudaAccessPropertyNormal + (value type = int) Allow reuse of already completed frees when there is no dependency between the free and allocation. (default enabled) - Normal cache persistence. + .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolReuseAllowInternalDependencies - .. autoattribute:: cuda.bindings.runtime.cudaAccessProperty.cudaAccessPropertyStreaming + (value type = int) Allow cuMemAllocAsync to insert new stream dependencies in order to establish the stream ordering required to reuse a piece of memory released by cuFreeAsync (default enabled). - Streaming access is less likely to persit from cache. + .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrReleaseThreshold - .. autoattribute:: cuda.bindings.runtime.cudaAccessProperty.cudaAccessPropertyPersisting + (value type = cuuint64_t) Amount of reserved memory in bytes to hold onto before trying to release memory back to the OS. When more than the release threshold bytes of memory are held by the memory pool, the allocator will try to release memory back to the OS on the next call to stream, event or context synchronize. (default 0) - Persisting access is more likely to persist in cache. + .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrReservedMemCurrent -.. autoclass:: cuda.bindings.runtime.cudaStreamCaptureStatus - .. autoattribute:: cuda.bindings.runtime.cudaStreamCaptureStatus.cudaStreamCaptureStatusNone + (value type = cuuint64_t) Amount of backing memory currently allocated for the mempool. - Stream is not capturing + .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrReservedMemHigh - .. autoattribute:: cuda.bindings.runtime.cudaStreamCaptureStatus.cudaStreamCaptureStatusActive + (value type = cuuint64_t) High watermark of backing memory allocated for the mempool since the last time it was reset. High watermark can only be reset to zero. - Stream is actively capturing + .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrUsedMemCurrent - .. autoattribute:: cuda.bindings.runtime.cudaStreamCaptureStatus.cudaStreamCaptureStatusInvalidated + (value type = cuuint64_t) Amount of memory from the pool that is currently in use by the application. - Stream is part of a capture sequence that has been invalidated, but not terminated + .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrUsedMemHigh -.. autoclass:: cuda.bindings.runtime.cudaStreamCaptureMode - .. autoattribute:: cuda.bindings.runtime.cudaStreamCaptureMode.cudaStreamCaptureModeGlobal + (value type = cuuint64_t) High watermark of the amount of memory from the pool that was in use by the application since the last time it was reset. High watermark can only be reset to zero. - .. autoattribute:: cuda.bindings.runtime.cudaStreamCaptureMode.cudaStreamCaptureModeThreadLocal + .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrAllocationType - .. autoattribute:: cuda.bindings.runtime.cudaStreamCaptureMode.cudaStreamCaptureModeRelaxed + (value type = :py:obj:`~.cudaMemAllocationType`) The allocation type of the mempool -.. autoclass:: cuda.bindings.runtime.cudaSynchronizationPolicy - .. autoattribute:: cuda.bindings.runtime.cudaSynchronizationPolicy.cudaSyncPolicyAuto + .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrExportHandleTypes - .. autoattribute:: cuda.bindings.runtime.cudaSynchronizationPolicy.cudaSyncPolicySpin + (value type = :py:obj:`~.cudaMemAllocationHandleType`) Available export handle types for the mempool. For imported pools this value is always cudaMemHandleTypeNone as an imported pool cannot be re-exported - .. autoattribute:: cuda.bindings.runtime.cudaSynchronizationPolicy.cudaSyncPolicyYield + .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrLocationId - .. autoattribute:: cuda.bindings.runtime.cudaSynchronizationPolicy.cudaSyncPolicyBlockingSync + (value type = int) The location id for the mempool. If the location type for this pool is cudaMemLocationTypeInvisible then ID will be cudaInvalidDeviceId -.. autoclass:: cuda.bindings.runtime.cudaClusterSchedulingPolicy - .. autoattribute:: cuda.bindings.runtime.cudaClusterSchedulingPolicy.cudaClusterSchedulingPolicyDefault + .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrLocationType - the default policy + (value type = :py:obj:`~.cudaMemLocationType`) The location type for the mempool. For imported memory pools where the device is not directly visible to the importing process or pools imported via fabric handles across nodes this will be cudaMemLocationTypeInvisible - .. autoattribute:: cuda.bindings.runtime.cudaClusterSchedulingPolicy.cudaClusterSchedulingPolicySpread + .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrMaxPoolSize - spread the blocks within a cluster to the SMs + (value type = cuuint64_t) Maximum size of the pool in bytes, this value may be higher than what was initially passed to cudaMemPoolCreate due to alignment requirements. A value of 0 indicates no maximum size. For cudaMemAllocationTypeManaged and IPC imported pools this value will be system dependent. - .. autoattribute:: cuda.bindings.runtime.cudaClusterSchedulingPolicy.cudaClusterSchedulingPolicyLoadBalancing + .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrHwDecompressEnabled - allow the hardware to load-balance the blocks in a cluster to the SMs + (value type = int) Indicates whether the pool has hardware compresssion enabled -.. autoclass:: cuda.bindings.runtime.cudaStreamUpdateCaptureDependenciesFlags +.. autoclass:: cuda.bindings.runtime.cudaMemLocationType - .. autoattribute:: cuda.bindings.runtime.cudaStreamUpdateCaptureDependenciesFlags.cudaStreamAddCaptureDependencies + .. autoattribute:: cuda.bindings.runtime.cudaMemLocationType.cudaMemLocationTypeInvalid - Add new nodes to the dependency set + .. autoattribute:: cuda.bindings.runtime.cudaMemLocationType.cudaMemLocationTypeNone - .. autoattribute:: cuda.bindings.runtime.cudaStreamUpdateCaptureDependenciesFlags.cudaStreamSetCaptureDependencies + Location is unspecified. This is used when creating a managed memory pool to indicate no preferred location for the pool - Replace the dependency set with the new nodes + .. autoattribute:: cuda.bindings.runtime.cudaMemLocationType.cudaMemLocationTypeDevice -.. autoclass:: cuda.bindings.runtime.cudaUserObjectFlags - .. autoattribute:: cuda.bindings.runtime.cudaUserObjectFlags.cudaUserObjectNoDestructorSync + Location is a device location, thus id is a device ordinal - Indicates the destructor execution is not synchronized by any CUDA handle. + .. autoattribute:: cuda.bindings.runtime.cudaMemLocationType.cudaMemLocationTypeHost -.. autoclass:: cuda.bindings.runtime.cudaUserObjectRetainFlags - .. autoattribute:: cuda.bindings.runtime.cudaUserObjectRetainFlags.cudaGraphUserObjectMove + Location is host, id is ignored - Transfer references from the caller rather than creating new references. + .. autoattribute:: cuda.bindings.runtime.cudaMemLocationType.cudaMemLocationTypeHostNuma -.. autoclass:: cuda.bindings.runtime.cudaHostTaskSyncMode - .. autoattribute:: cuda.bindings.runtime.cudaHostTaskSyncMode.cudaHostTaskBlocking + Location is a host NUMA node, thus id is a host NUMA node id - .. autoattribute:: cuda.bindings.runtime.cudaHostTaskSyncMode.cudaHostTaskSpinWait + .. autoattribute:: cuda.bindings.runtime.cudaMemLocationType.cudaMemLocationTypeHostNumaCurrent -.. autoclass:: cuda.bindings.runtime.cudaGraphicsRegisterFlags - .. autoattribute:: cuda.bindings.runtime.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsNone + Location is the host NUMA node closest to the current thread's CPU, id is ignored - Default + .. autoattribute:: cuda.bindings.runtime.cudaMemLocationType.cudaMemLocationTypeInvisible - .. autoattribute:: cuda.bindings.runtime.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsReadOnly + Location is not visible but device is accessible, id is always cudaInvalidDeviceId +.. autoclass:: cuda.bindings.runtime.cudaMemAccessFlags - CUDA will not write to this resource + .. autoattribute:: cuda.bindings.runtime.cudaMemAccessFlags.cudaMemAccessFlagsProtNone - .. autoattribute:: cuda.bindings.runtime.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsWriteDiscard + Default, make the address range not accessible - CUDA will only write to and will not read from this resource + .. autoattribute:: cuda.bindings.runtime.cudaMemAccessFlags.cudaMemAccessFlagsProtRead - .. autoattribute:: cuda.bindings.runtime.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsSurfaceLoadStore + Make the address range read accessible - CUDA will bind this resource to a surface reference + .. autoattribute:: cuda.bindings.runtime.cudaMemAccessFlags.cudaMemAccessFlagsProtReadWrite - .. autoattribute:: cuda.bindings.runtime.cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsTextureGather + Make the address range read-write accessible +.. autoclass:: cuda.bindings.runtime.cudaMemAllocationType - CUDA will perform texture gather operations on this resource + .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationType.cudaMemAllocationTypeInvalid -.. autoclass:: cuda.bindings.runtime.cudaGraphicsMapFlags - .. autoattribute:: cuda.bindings.runtime.cudaGraphicsMapFlags.cudaGraphicsMapFlagsNone + .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationType.cudaMemAllocationTypePinned - Default; Assume resource can be read/written + This allocation type is 'pinned', i.e. cannot migrate from its current location while the application is actively using it - .. autoattribute:: cuda.bindings.runtime.cudaGraphicsMapFlags.cudaGraphicsMapFlagsReadOnly + .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationType.cudaMemAllocationTypeManaged - CUDA will not write to this resource + This allocation type is managed memory - .. autoattribute:: cuda.bindings.runtime.cudaGraphicsMapFlags.cudaGraphicsMapFlagsWriteDiscard + .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationType.cudaMemAllocationTypeMax +.. autoclass:: cuda.bindings.runtime.cudaMemAllocationHandleType - CUDA will only write to and will not read from this resource + .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationHandleType.cudaMemHandleTypeNone -.. autoclass:: cuda.bindings.runtime.cudaGraphicsCubeFace - .. autoattribute:: cuda.bindings.runtime.cudaGraphicsCubeFace.cudaGraphicsCubeFacePositiveX + Does not allow any export mechanism. > - Positive X face of cubemap + .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationHandleType.cudaMemHandleTypePosixFileDescriptor - .. autoattribute:: cuda.bindings.runtime.cudaGraphicsCubeFace.cudaGraphicsCubeFaceNegativeX + Allows a file descriptor to be used for exporting. Permitted only on POSIX systems. (int) - Negative X face of cubemap + .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationHandleType.cudaMemHandleTypeWin32 - .. autoattribute:: cuda.bindings.runtime.cudaGraphicsCubeFace.cudaGraphicsCubeFacePositiveY + Allows a Win32 NT handle to be used for exporting. (HANDLE) - Positive Y face of cubemap + .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationHandleType.cudaMemHandleTypeWin32Kmt - .. autoattribute:: cuda.bindings.runtime.cudaGraphicsCubeFace.cudaGraphicsCubeFaceNegativeY + Allows a Win32 KMT handle to be used for exporting. (D3DKMT_HANDLE) - Negative Y face of cubemap + .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationHandleType.cudaMemHandleTypeFabric - .. autoattribute:: cuda.bindings.runtime.cudaGraphicsCubeFace.cudaGraphicsCubeFacePositiveZ + Allows a fabric handle to be used for exporting. (:py:obj:`~.cudaMemFabricHandle_t`) +.. autoclass:: cuda.bindings.runtime.cudaGraphMemAttributeType - Positive Z face of cubemap + .. autoattribute:: cuda.bindings.runtime.cudaGraphMemAttributeType.cudaGraphMemAttrUsedMemCurrent - .. autoattribute:: cuda.bindings.runtime.cudaGraphicsCubeFace.cudaGraphicsCubeFaceNegativeZ + (value type = cuuint64_t) Amount of memory, in bytes, currently associated with graphs. - Negative Z face of cubemap + .. autoattribute:: cuda.bindings.runtime.cudaGraphMemAttributeType.cudaGraphMemAttrUsedMemHigh -.. autoclass:: cuda.bindings.runtime.cudaResourceType - .. autoattribute:: cuda.bindings.runtime.cudaResourceType.cudaResourceTypeArray + (value type = cuuint64_t) High watermark of memory, in bytes, associated with graphs since the last time it was reset. High watermark can only be reset to zero. - Array resource + .. autoattribute:: cuda.bindings.runtime.cudaGraphMemAttributeType.cudaGraphMemAttrReservedMemCurrent - .. autoattribute:: cuda.bindings.runtime.cudaResourceType.cudaResourceTypeMipmappedArray + (value type = cuuint64_t) Amount of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator. - Mipmapped array resource + .. autoattribute:: cuda.bindings.runtime.cudaGraphMemAttributeType.cudaGraphMemAttrReservedMemHigh - .. autoattribute:: cuda.bindings.runtime.cudaResourceType.cudaResourceTypeLinear + (value type = cuuint64_t) High watermark of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator. +.. autoclass:: cuda.bindings.runtime.cudaMemcpyFlags - Linear resource + .. autoattribute:: cuda.bindings.runtime.cudaMemcpyFlags.cudaMemcpyFlagDefault - .. autoattribute:: cuda.bindings.runtime.cudaResourceType.cudaResourceTypePitch2D + .. autoattribute:: cuda.bindings.runtime.cudaMemcpyFlags.cudaMemcpyFlagPreferOverlapWithCompute - Pitch 2D resource + Hint to the driver to try and overlap the copy with compute work on the SMs. -.. autoclass:: cuda.bindings.runtime.cudaResourceViewFormat +.. autoclass:: cuda.bindings.runtime.cudaMemcpySrcAccessOrder - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatNone + .. autoattribute:: cuda.bindings.runtime.cudaMemcpySrcAccessOrder.cudaMemcpySrcAccessOrderInvalid - No resource view format (use underlying resource format) + Default invalid. - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedChar1 + .. autoattribute:: cuda.bindings.runtime.cudaMemcpySrcAccessOrder.cudaMemcpySrcAccessOrderStream - 1 channel unsigned 8-bit integers + Indicates that access to the source pointer must be in stream order. - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedChar2 + .. autoattribute:: cuda.bindings.runtime.cudaMemcpySrcAccessOrder.cudaMemcpySrcAccessOrderDuringApiCall - 2 channel unsigned 8-bit integers + Indicates that access to the source pointer can be out of stream order and all accesses must be complete before the API call returns. This flag is suited for ephemeral sources (ex., stack variables) when it's known that no prior operations in the stream can be accessing the memory and also that the lifetime of the memory is limited to the scope that the source variable was declared in. Specifying this flag allows the driver to optimize the copy and removes the need for the user to synchronize the stream after the API call. - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedChar4 + .. autoattribute:: cuda.bindings.runtime.cudaMemcpySrcAccessOrder.cudaMemcpySrcAccessOrderAny - 4 channel unsigned 8-bit integers + Indicates that access to the source pointer can be out of stream order and the accesses can happen even after the API call returns. This flag is suited for host pointers allocated outside CUDA (ex., via malloc) when it's known that no prior operations in the stream can be accessing the memory. Specifying this flag allows the driver to optimize the copy on certain platforms. - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedChar1 + .. autoattribute:: cuda.bindings.runtime.cudaMemcpySrcAccessOrder.cudaMemcpySrcAccessOrderMax +.. autoclass:: cuda.bindings.runtime.cudaMemcpy3DOperandType - 1 channel signed 8-bit integers + .. autoattribute:: cuda.bindings.runtime.cudaMemcpy3DOperandType.cudaMemcpyOperandTypePointer - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedChar2 + Memcpy operand is a valid pointer. - 2 channel signed 8-bit integers + .. autoattribute:: cuda.bindings.runtime.cudaMemcpy3DOperandType.cudaMemcpyOperandTypeArray - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedChar4 + Memcpy operand is a CUarray. - 4 channel signed 8-bit integers + .. autoattribute:: cuda.bindings.runtime.cudaMemcpy3DOperandType.cudaMemcpyOperandTypeMax +.. autoclass:: cuda.bindings.runtime.cudaDeviceP2PAttr - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedShort1 + .. autoattribute:: cuda.bindings.runtime.cudaDeviceP2PAttr.cudaDevP2PAttrPerformanceRank - 1 channel unsigned 16-bit integers + A relative value indicating the performance of the link between two devices - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedShort2 + .. autoattribute:: cuda.bindings.runtime.cudaDeviceP2PAttr.cudaDevP2PAttrAccessSupported - 2 channel unsigned 16-bit integers + Peer access is enabled - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedShort4 + .. autoattribute:: cuda.bindings.runtime.cudaDeviceP2PAttr.cudaDevP2PAttrNativeAtomicSupported - 4 channel unsigned 16-bit integers + Native atomic operation over the link supported - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedShort1 + .. autoattribute:: cuda.bindings.runtime.cudaDeviceP2PAttr.cudaDevP2PAttrCudaArrayAccessSupported - 1 channel signed 16-bit integers + Accessing CUDA arrays over the link supported - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedShort2 + .. autoattribute:: cuda.bindings.runtime.cudaDeviceP2PAttr.cudaDevP2PAttrOnlyPartialNativeAtomicSupported - 2 channel signed 16-bit integers + Only some CUDA-valid atomic operations over the link are supported. +.. autoclass:: cuda.bindings.runtime.cudaAtomicOperation - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedShort4 + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationIntegerAdd - 4 channel signed 16-bit integers + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationIntegerMin - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedInt1 + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationIntegerMax - 1 channel unsigned 32-bit integers + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationIntegerIncrement - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedInt2 + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationIntegerDecrement - 2 channel unsigned 32-bit integers + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationAnd - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedInt4 + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationOr - 4 channel unsigned 32-bit integers + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationXOR - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedInt1 + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationExchange - 1 channel signed 32-bit integers + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationCAS - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedInt2 + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationFloatAdd - 2 channel signed 32-bit integers + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationFloatMin - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedInt4 + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationFloatMax +.. autoclass:: cuda.bindings.runtime.cudaAtomicOperationCapability - 4 channel signed 32-bit integers + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperationCapability.cudaAtomicCapabilitySigned - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatHalf1 + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperationCapability.cudaAtomicCapabilityUnsigned - 1 channel 16-bit floating point + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperationCapability.cudaAtomicCapabilityReduction - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatHalf2 + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperationCapability.cudaAtomicCapabilityScalar32 - 2 channel 16-bit floating point + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperationCapability.cudaAtomicCapabilityScalar64 - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatHalf4 + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperationCapability.cudaAtomicCapabilityScalar128 - 4 channel 16-bit floating point + .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperationCapability.cudaAtomicCapabilityVector32x4 +.. autoclass:: cuda.bindings.runtime.cudaExternalMemoryHandleType - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatFloat1 + .. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueFd - 1 channel 32-bit floating point + Handle is an opaque file descriptor - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatFloat2 + .. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32 - 2 channel 32-bit floating point + Handle is an opaque shared NT handle - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatFloat4 + .. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32Kmt - 4 channel 32-bit floating point + Handle is an opaque, globally shared handle - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed1 + .. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Heap - Block compressed 1 + Handle is a D3D12 heap object - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed2 + .. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Resource - Block compressed 2 + Handle is a D3D12 committed resource - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed3 + .. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11Resource - Block compressed 3 + Handle is a shared NT handle to a D3D11 resource - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed4 + .. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11ResourceKmt - Block compressed 4 unsigned + Handle is a globally shared handle to a D3D11 resource - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedBlockCompressed4 + .. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeNvSciBuf - Block compressed 4 signed + Handle is an NvSciBuf object +.. autoclass:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed5 + .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueFd - Block compressed 5 unsigned + Handle is an opaque file descriptor - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedBlockCompressed5 + .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32 - Block compressed 5 signed + Handle is an opaque shared NT handle - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed6H + .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt - Block compressed 6 unsigned half-float + Handle is an opaque, globally shared handle - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatSignedBlockCompressed6H + .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D12Fence - Block compressed 6 signed half-float + Handle is a shared NT handle referencing a D3D12 fence object - .. autoattribute:: cuda.bindings.runtime.cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed7 + .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D11Fence - Block compressed 7 + Handle is a shared NT handle referencing a D3D11 fence object -.. autoclass:: cuda.bindings.runtime.cudaFuncAttribute - .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeMaxDynamicSharedMemorySize + .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeNvSciSync - Maximum dynamic shared memory size + Opaque handle to NvSciSync Object - .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributePreferredSharedMemoryCarveout + .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutex - Preferred shared memory-L1 cache split + Handle is a shared NT handle referencing a D3D11 keyed mutex object - .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeClusterDimMustBeSet + .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutexKmt - Indicator to enforce valid cluster dimension specification on kernel launch + Handle is a shared KMT handle referencing a D3D11 keyed mutex object - .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeRequiredClusterWidth + .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd - Required cluster width + Handle is an opaque handle file descriptor referencing a timeline semaphore - .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeRequiredClusterHeight + .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32 - Required cluster height + Handle is an opaque handle file descriptor referencing a timeline semaphore +.. autoclass:: cuda.bindings.runtime.cudaDevSmResourceGroup_flags - .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeRequiredClusterDepth + .. autoattribute:: cuda.bindings.runtime.cudaDevSmResourceGroup_flags.cudaDevSmResourceGroupDefault - Required cluster depth + .. autoattribute:: cuda.bindings.runtime.cudaDevSmResourceGroup_flags.cudaDevSmResourceGroupBackfill - .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeNonPortableClusterSizeAllowed + Lets smCount be a non-multiple of minCoscheduledCount, filling the difference with other SMs. +.. autoclass:: cuda.bindings.runtime.cudaDevSmResourceSplitByCount_flags - Whether non-portable cluster scheduling policy is supported + .. autoattribute:: cuda.bindings.runtime.cudaDevSmResourceSplitByCount_flags.cudaDevSmResourceSplitIgnoreSmCoscheduling - .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeClusterSchedulingPolicyPreference + .. autoattribute:: cuda.bindings.runtime.cudaDevSmResourceSplitByCount_flags.cudaDevSmResourceSplitMaxPotentialClusterSize +.. autoclass:: cuda.bindings.runtime.cudaDevResourceType - Required cluster scheduling policy preference + .. autoattribute:: cuda.bindings.runtime.cudaDevResourceType.cudaDevResourceTypeInvalid - .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeMax + .. autoattribute:: cuda.bindings.runtime.cudaDevResourceType.cudaDevResourceTypeSm -.. autoclass:: cuda.bindings.runtime.cudaFuncCache - .. autoattribute:: cuda.bindings.runtime.cudaFuncCache.cudaFuncCachePreferNone + Streaming multiprocessors related information - Default function cache configuration, no preference + .. autoattribute:: cuda.bindings.runtime.cudaDevResourceType.cudaDevResourceTypeWorkqueueConfig - .. autoattribute:: cuda.bindings.runtime.cudaFuncCache.cudaFuncCachePreferShared + Workqueue configuration related information - Prefer larger shared memory and smaller L1 cache + .. autoattribute:: cuda.bindings.runtime.cudaDevResourceType.cudaDevResourceTypeWorkqueue - .. autoattribute:: cuda.bindings.runtime.cudaFuncCache.cudaFuncCachePreferL1 + Pre-existing workqueue related information +.. autoclass:: cuda.bindings.runtime.cudaDevWorkqueueConfigScope - Prefer larger L1 cache and smaller shared memory + .. autoattribute:: cuda.bindings.runtime.cudaDevWorkqueueConfigScope.cudaDevWorkqueueConfigScopeDeviceCtx - .. autoattribute:: cuda.bindings.runtime.cudaFuncCache.cudaFuncCachePreferEqual + Use all shared workqueue resources on the device. Default driver behaviour. - Prefer equal size L1 cache and shared memory + .. autoattribute:: cuda.bindings.runtime.cudaDevWorkqueueConfigScope.cudaDevWorkqueueConfigScopeGreenCtxBalanced -.. autoclass:: cuda.bindings.runtime.cudaSharedMemConfig - .. autoattribute:: cuda.bindings.runtime.cudaSharedMemConfig.cudaSharedMemBankSizeDefault + When possible, use non-overlapping workqueue resources with other balanced green contexts. +.. autoclass:: cuda.bindings.runtime.cudaJitOption - .. autoattribute:: cuda.bindings.runtime.cudaSharedMemConfig.cudaSharedMemBankSizeFourByte + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitMaxRegisters - .. autoattribute:: cuda.bindings.runtime.cudaSharedMemConfig.cudaSharedMemBankSizeEightByte + Max number of registers that a thread may use. -.. autoclass:: cuda.bindings.runtime.cudaSharedCarveout + Option type: unsigned int - .. autoattribute:: cuda.bindings.runtime.cudaSharedCarveout.cudaSharedmemCarveoutDefault + Applies to: compiler only - No preference for shared memory or L1 (default) + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitThreadsPerBlock - .. autoattribute:: cuda.bindings.runtime.cudaSharedCarveout.cudaSharedmemCarveoutMaxShared + IN: Specifies minimum number of threads per block to target compilation for + OUT: Returns the number of threads the compiler actually targeted. This restricts the resource utilization of the compiler (e.g. max registers) such that a block with the given number of threads should be able to launch based on register limitations. Note, this option does not currently take into account any other resource limitations, such as shared memory utilization. - Prefer maximum available shared memory, minimum L1 cache + Option type: unsigned int + Applies to: compiler only - .. autoattribute:: cuda.bindings.runtime.cudaSharedCarveout.cudaSharedmemCarveoutMaxL1 + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitWallTime - Prefer maximum available L1 cache, minimum shared memory -.. autoclass:: cuda.bindings.runtime.cudaComputeMode + Overwrites the option value with the total wall clock time, in milliseconds, spent in the compiler and linker - .. autoattribute:: cuda.bindings.runtime.cudaComputeMode.cudaComputeModeDefault + Option type: float + Applies to: compiler and linker - Default compute mode (Multiple threads can use :py:obj:`~.cudaSetDevice()` with this device) + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitInfoLogBuffer - .. autoattribute:: cuda.bindings.runtime.cudaComputeMode.cudaComputeModeExclusive + Pointer to a buffer in which to print any log messages that are informational in nature (the buffer size is specified via option :py:obj:`~.cudaJitInfoLogBufferSizeBytes`) - Compute-exclusive-thread mode (Only one thread in one process will be able to use :py:obj:`~.cudaSetDevice()` with this device) + Option type: char \* + Applies to: compiler and linker - .. autoattribute:: cuda.bindings.runtime.cudaComputeMode.cudaComputeModeProhibited + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitInfoLogBufferSizeBytes - Compute-prohibited mode (No threads can use :py:obj:`~.cudaSetDevice()` with this device) + IN: Log buffer size in bytes. Log messages will be capped at this size (including null terminator) - .. autoattribute:: cuda.bindings.runtime.cudaComputeMode.cudaComputeModeExclusiveProcess + OUT: Amount of log buffer filled with messages + Option type: unsigned int - Compute-exclusive-process mode (Many threads in one process will be able to use :py:obj:`~.cudaSetDevice()` with this device) + Applies to: compiler and linker -.. autoclass:: cuda.bindings.runtime.cudaLimit - .. autoattribute:: cuda.bindings.runtime.cudaLimit.cudaLimitStackSize + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitErrorLogBuffer - GPU thread stack size + Pointer to a buffer in which to print any log messages that reflect errors (the buffer size is specified via option :py:obj:`~.cudaJitErrorLogBufferSizeBytes`) + Option type: char \* - .. autoattribute:: cuda.bindings.runtime.cudaLimit.cudaLimitPrintfFifoSize + Applies to: compiler and linker - GPU printf FIFO size + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitErrorLogBufferSizeBytes - .. autoattribute:: cuda.bindings.runtime.cudaLimit.cudaLimitMallocHeapSize + IN: Log buffer size in bytes. Log messages will be capped at this size (including null terminator) + OUT: Amount of log buffer filled with messages - GPU malloc heap size + Option type: unsigned int + Applies to: compiler and linker - .. autoattribute:: cuda.bindings.runtime.cudaLimit.cudaLimitDevRuntimeSyncDepth + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitOptimizationLevel - GPU device runtime synchronize depth + Level of optimizations to apply to generated code (0 - 4), with 4 being the default and highest level of optimizations. - .. autoattribute:: cuda.bindings.runtime.cudaLimit.cudaLimitDevRuntimePendingLaunchCount + Option type: unsigned int + Applies to: compiler only - GPU device runtime pending launch count + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitFallbackStrategy - .. autoattribute:: cuda.bindings.runtime.cudaLimit.cudaLimitMaxL2FetchGranularity + Specifies choice of fallback strategy if matching cubin is not found. Choice is based on supplied :py:obj:`~.cudaJit_Fallback`. Option type: unsigned int for enumerated type :py:obj:`~.cudaJit_Fallback` - A value between 0 and 128 that indicates the maximum fetch granularity of L2 (in Bytes). This is a hint + Applies to: compiler only - .. autoattribute:: cuda.bindings.runtime.cudaLimit.cudaLimitPersistingL2CacheSize + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitGenerateDebugInfo - A size in bytes for L2 persisting lines cache size + Specifies whether to create debug information in output (-g) (0: false, default) -.. autoclass:: cuda.bindings.runtime.cudaMemoryAdvise + Option type: int - .. autoattribute:: cuda.bindings.runtime.cudaMemoryAdvise.cudaMemAdviseSetReadMostly + Applies to: compiler and linker - Data will mostly be read and only occassionally be written to + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitLogVerbose - .. autoattribute:: cuda.bindings.runtime.cudaMemoryAdvise.cudaMemAdviseUnsetReadMostly + Generate verbose log messages (0: false, default) + Option type: int - Undo the effect of :py:obj:`~.cudaMemAdviseSetReadMostly` + Applies to: compiler and linker - .. autoattribute:: cuda.bindings.runtime.cudaMemoryAdvise.cudaMemAdviseSetPreferredLocation + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitGenerateLineInfo - Set the preferred location for the data as the specified device + Generate line number information (-lineinfo) (0: false, default) + Option type: int - .. autoattribute:: cuda.bindings.runtime.cudaMemoryAdvise.cudaMemAdviseUnsetPreferredLocation + Applies to: compiler only - Clear the preferred location for the data + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitCacheMode - .. autoattribute:: cuda.bindings.runtime.cudaMemoryAdvise.cudaMemAdviseSetAccessedBy + Specifies whether to enable caching explicitly (-dlcm) + Choice is based on supplied :py:obj:`~.cudaJit_CacheMode`. - Data will be accessed by the specified device, so prevent page faults as much as possible + Option type: unsigned int for enumerated type :py:obj:`~.cudaJit_CacheMode` + Applies to: compiler only - .. autoattribute:: cuda.bindings.runtime.cudaMemoryAdvise.cudaMemAdviseUnsetAccessedBy + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitPositionIndependentCode - Let the Unified Memory subsystem decide on the page faulting policy for the specified device -.. autoclass:: cuda.bindings.runtime.cudaMemRangeAttribute + Generate position independent code (0: false) - .. autoattribute:: cuda.bindings.runtime.cudaMemRangeAttribute.cudaMemRangeAttributeReadMostly + Option type: int + Applies to: compiler only - Whether the range will mostly be read and only occassionally be written to + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitMinCtaPerSm - .. autoattribute:: cuda.bindings.runtime.cudaMemRangeAttribute.cudaMemRangeAttributePreferredLocation + This option hints to the JIT compiler the minimum number of CTAs from the kernel’s grid to be mapped to a SM. This option is ignored when used together with :py:obj:`~.cudaJitMaxRegisters` or :py:obj:`~.cudaJitThreadsPerBlock`. Optimizations based on this option need :py:obj:`~.cudaJitMaxThreadsPerBlock` to be specified as well. For kernels already using PTX directive .minnctapersm, this option will be ignored by default. Use :py:obj:`~.cudaJitOverrideDirectiveValues` to let this option take precedence over the PTX directive. Option type: unsigned int - The preferred location of the range + Applies to: compiler only - .. autoattribute:: cuda.bindings.runtime.cudaMemRangeAttribute.cudaMemRangeAttributeAccessedBy + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitMaxThreadsPerBlock - Memory range has :py:obj:`~.cudaMemAdviseSetAccessedBy` set for specified device + Maximum number threads in a thread block, computed as the product of the maximum extent specifed for each dimension of the block. This limit is guaranteed not to be exeeded in any invocation of the kernel. Exceeding the the maximum number of threads results in runtime error or kernel launch failure. For kernels already using PTX directive .maxntid, this option will be ignored by default. Use :py:obj:`~.cudaJitOverrideDirectiveValues` to let this option take precedence over the PTX directive. Option type: int + Applies to: compiler only - .. autoattribute:: cuda.bindings.runtime.cudaMemRangeAttribute.cudaMemRangeAttributeLastPrefetchLocation + .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitOverrideDirectiveValues - The last location to which the range was prefetched + This option lets the values specified using :py:obj:`~.cudaJitMaxRegisters`, :py:obj:`~.cudaJitThreadsPerBlock`, :py:obj:`~.cudaJitMaxThreadsPerBlock` and :py:obj:`~.cudaJitMinCtaPerSm` take precedence over any PTX directives. (0: Disable, default; 1: Enable) Option type: int - .. autoattribute:: cuda.bindings.runtime.cudaMemRangeAttribute.cudaMemRangeAttributePreferredLocationType + Applies to: compiler only +.. autoclass:: cuda.bindings.runtime.cudaLibraryOption - The preferred location type of the range + .. autoattribute:: cuda.bindings.runtime.cudaLibraryOption.cudaLibraryHostUniversalFunctionAndDataTable - .. autoattribute:: cuda.bindings.runtime.cudaMemRangeAttribute.cudaMemRangeAttributePreferredLocationId + .. autoattribute:: cuda.bindings.runtime.cudaLibraryOption.cudaLibraryBinaryIsPreserved - The preferred location id of the range + Specifes that the argument ``code`` passed to :py:obj:`~.cudaLibraryLoadData()` will be preserved. Specifying this option will let the driver know that ``code`` can be accessed at any point until :py:obj:`~.cudaLibraryUnload()`. The default behavior is for the driver to allocate and maintain its own copy of ``code``. Note that this is only a memory usage optimization hint and the driver can choose to ignore it if required. Specifying this option with :py:obj:`~.cudaLibraryLoadFromFile()` is invalid and will return :py:obj:`~.cudaErrorInvalidValue`. +.. autoclass:: cuda.bindings.runtime.cudaJit_CacheMode - .. autoattribute:: cuda.bindings.runtime.cudaMemRangeAttribute.cudaMemRangeAttributeLastPrefetchLocationType + .. autoattribute:: cuda.bindings.runtime.cudaJit_CacheMode.cudaJitCacheOptionNone - The last location type to which the range was prefetched + Compile with no -dlcm flag specified - .. autoattribute:: cuda.bindings.runtime.cudaMemRangeAttribute.cudaMemRangeAttributeLastPrefetchLocationId + .. autoattribute:: cuda.bindings.runtime.cudaJit_CacheMode.cudaJitCacheOptionCG - The last location id to which the range was prefetched + Compile with L1 cache disabled -.. autoclass:: cuda.bindings.runtime.cudaFlushGPUDirectRDMAWritesOptions - .. autoattribute:: cuda.bindings.runtime.cudaFlushGPUDirectRDMAWritesOptions.cudaFlushGPUDirectRDMAWritesOptionHost + .. autoattribute:: cuda.bindings.runtime.cudaJit_CacheMode.cudaJitCacheOptionCA - :py:obj:`~.cudaDeviceFlushGPUDirectRDMAWrites()` and its CUDA Driver API counterpart are supported on the device. + Compile with L1 cache enabled +.. autoclass:: cuda.bindings.runtime.cudaJit_Fallback - .. autoattribute:: cuda.bindings.runtime.cudaFlushGPUDirectRDMAWritesOptions.cudaFlushGPUDirectRDMAWritesOptionMemOps + .. autoattribute:: cuda.bindings.runtime.cudaJit_Fallback.cudaPreferPtx - The :py:obj:`~.CU_STREAM_WAIT_VALUE_FLUSH` flag and the :py:obj:`~.CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES` MemOp are supported on the CUDA device. + Prefer to compile ptx if exact binary match not found -.. autoclass:: cuda.bindings.runtime.cudaGPUDirectRDMAWritesOrdering - .. autoattribute:: cuda.bindings.runtime.cudaGPUDirectRDMAWritesOrdering.cudaGPUDirectRDMAWritesOrderingNone + .. autoattribute:: cuda.bindings.runtime.cudaJit_Fallback.cudaPreferBinary - The device does not natively support ordering of GPUDirect RDMA writes. :py:obj:`~.cudaFlushGPUDirectRDMAWrites()` can be leveraged if supported. + Prefer to fall back to compatible binary code if exact match not found +.. autoclass:: cuda.bindings.runtime.cudaCGScope - .. autoattribute:: cuda.bindings.runtime.cudaGPUDirectRDMAWritesOrdering.cudaGPUDirectRDMAWritesOrderingOwner + .. autoattribute:: cuda.bindings.runtime.cudaCGScope.cudaCGScopeInvalid - Natively, the device can consistently consume GPUDirect RDMA writes, although other CUDA devices may not. + Invalid cooperative group scope - .. autoattribute:: cuda.bindings.runtime.cudaGPUDirectRDMAWritesOrdering.cudaGPUDirectRDMAWritesOrderingAllDevices + .. autoattribute:: cuda.bindings.runtime.cudaCGScope.cudaCGScopeGrid - Any CUDA device in the system can consistently consume GPUDirect RDMA writes to this device. + Scope represented by a grid_group -.. autoclass:: cuda.bindings.runtime.cudaFlushGPUDirectRDMAWritesScope - .. autoattribute:: cuda.bindings.runtime.cudaFlushGPUDirectRDMAWritesScope.cudaFlushGPUDirectRDMAWritesToOwner + .. autoattribute:: cuda.bindings.runtime.cudaCGScope.cudaCGScopeReserved - Blocks until remote writes are visible to the CUDA device context owning the data. + Reserved +.. autoclass:: cuda.bindings.runtime.cudaKernelFunctionType - .. autoattribute:: cuda.bindings.runtime.cudaFlushGPUDirectRDMAWritesScope.cudaFlushGPUDirectRDMAWritesToAllDevices + .. autoattribute:: cuda.bindings.runtime.cudaKernelFunctionType.cudaKernelFunctionTypeUnspecified - Blocks until remote writes are visible to all CUDA device contexts. + CUDA will attempt to deduce the type of the function handle -.. autoclass:: cuda.bindings.runtime.cudaFlushGPUDirectRDMAWritesTarget - .. autoattribute:: cuda.bindings.runtime.cudaFlushGPUDirectRDMAWritesTarget.cudaFlushGPUDirectRDMAWritesTargetCurrentDevice + .. autoattribute:: cuda.bindings.runtime.cudaKernelFunctionType.cudaKernelFunctionTypeDeviceEntry - Sets the target for :py:obj:`~.cudaDeviceFlushGPUDirectRDMAWrites()` to the currently active CUDA device context. + Function handle is a device-entry function pointer(i.e. global function pointer) -.. autoclass:: cuda.bindings.runtime.cudaDeviceAttr - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxThreadsPerBlock + .. autoattribute:: cuda.bindings.runtime.cudaKernelFunctionType.cudaKernelFunctionTypeKernel - Maximum number of threads per block + Function handle is a :py:obj:`~.cudaKernel_t` - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxBlockDimX + .. autoattribute:: cuda.bindings.runtime.cudaKernelFunctionType.cudaKernelFunctionTypeFunction - Maximum block dimension X + Function handle is a :py:obj:`~.cudaFunction_t` +.. autoclass:: cuda.bindings.runtime.cudaGraphConditionalHandleFlags - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxBlockDimY + .. autoattribute:: cuda.bindings.runtime.cudaGraphConditionalHandleFlags.cudaGraphCondAssignDefault - Maximum block dimension Y + Apply default handle value when graph is launched. +.. autoclass:: cuda.bindings.runtime.cudaGraphConditionalNodeType - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxBlockDimZ + .. autoattribute:: cuda.bindings.runtime.cudaGraphConditionalNodeType.cudaGraphCondTypeIf - Maximum block dimension Z + Conditional 'if/else' Node. Body[0] executed if condition is non-zero. If ``size`` == 2, an optional ELSE graph is created and this is executed if the condition is zero. - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxGridDimX + .. autoattribute:: cuda.bindings.runtime.cudaGraphConditionalNodeType.cudaGraphCondTypeWhile - Maximum grid dimension X + Conditional 'while' Node. Body executed repeatedly while condition value is non-zero. - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxGridDimY + .. autoattribute:: cuda.bindings.runtime.cudaGraphConditionalNodeType.cudaGraphCondTypeSwitch - Maximum grid dimension Y + Conditional 'switch' Node. Body[n] is executed once, where 'n' is the value of the condition. If the condition does not match a body index, no body is launched. +.. autoclass:: cuda.bindings.runtime.cudaGraphNodeType - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxGridDimZ + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeKernel - Maximum grid dimension Z + GPU kernel node - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSharedMemoryPerBlock + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeMemcpy - Maximum shared memory available per block in bytes + Memcpy node - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrTotalConstantMemory + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeMemset - Memory available on device for constant variables in a CUDA C kernel in bytes + Memset node - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrWarpSize + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeHost - Warp size in threads + Host (executable) node - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxPitch + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeGraph - Maximum pitch in bytes allowed by memory copies + Node which executes an embedded graph - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxRegistersPerBlock + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeEmpty - Maximum number of 32-bit registers available per block + Empty (no-op) node - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrClockRate + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeWaitEvent - Peak clock frequency in kilohertz + External event wait node - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrTextureAlignment + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeEventRecord - Alignment requirement for textures + External event record node - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrGpuOverlap + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeExtSemaphoreSignal - Device can possibly copy memory and execute a kernel concurrently + External semaphore signal node - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMultiProcessorCount + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeExtSemaphoreWait - Number of multiprocessors on device + External semaphore wait node - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrKernelExecTimeout + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeMemAlloc - Specifies whether there is a run time limit on kernels + Memory allocation node - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrIntegrated + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeMemFree - Device is integrated with host memory + Memory free node - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrCanMapHostMemory + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeConditional - Device can map host memory into CUDA address space + Conditional node May be used to implement a conditional execution path or loop + inside of a graph. The graph(s) contained within the body of the conditional node - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrComputeMode + can be selectively executed or iterated upon based on the value of a conditional + variable. - Compute mode (See :py:obj:`~.cudaComputeMode` for details) - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture1DWidth + Handles must be created in advance of creating the node + using :py:obj:`~.cudaGraphConditionalHandleCreate`. - Maximum 1D texture width - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DWidth + The following restrictions apply to graphs which contain conditional nodes: + The graph cannot be used in a child node. - Maximum 2D texture width + Only one instantiation of the graph may exist at any point in time. + The graph cannot be cloned. - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DHeight - Maximum 2D texture height + To set the control value, supply a default value when creating the handle and/or + call :py:obj:`~.cudaGraphSetConditional` from device code. - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture3DWidth + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeReserved16 - Maximum 3D texture width + Reserved. - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture3DHeight + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeCount - Maximum 3D texture height +.. autoclass:: cuda.bindings.runtime.cudaGraphChildGraphNodeOwnership + .. autoattribute:: cuda.bindings.runtime.cudaGraphChildGraphNodeOwnership.cudaGraphChildGraphOwnershipClone - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture3DDepth + Default behavior for a child graph node. Child graph is cloned into the parent and memory allocation/free nodes can't be present in the child graph. - Maximum 3D texture depth + .. autoattribute:: cuda.bindings.runtime.cudaGraphChildGraphNodeOwnership.cudaGraphChildGraphOwnershipMove - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DLayeredWidth + The child graph is moved to the parent. The handle to the child graph is owned by the parent and will be destroyed when the parent is destroyed. - Maximum 2D layered texture width - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DLayeredHeight + The following restrictions apply to child graphs after they have been moved: Cannot be independently instantiated or destroyed; Cannot be added as a child graph of a separate parent graph; Cannot be used as an argument to cudaGraphExecUpdate; Cannot have additional memory allocation or free nodes added. - Maximum 2D layered texture height + .. autoattribute:: cuda.bindings.runtime.cudaGraphChildGraphNodeOwnership.cudaGraphChildGraphOwnershipInvalid - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DLayeredLayers + Invalid ownership flag. Set when params are queried to prevent accidentally reusing the driver-owned graph object +.. autoclass:: cuda.bindings.runtime.cudaGraphDependencyType - Maximum layers in a 2D layered texture + .. autoattribute:: cuda.bindings.runtime.cudaGraphDependencyType.cudaGraphDependencyTypeDefault - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrSurfaceAlignment + This is an ordinary dependency. - Alignment requirement for surfaces + .. autoattribute:: cuda.bindings.runtime.cudaGraphDependencyType.cudaGraphDependencyTypeProgrammatic - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrConcurrentKernels + This dependency type allows the downstream node to use ``cudaGridDependencySynchronize()``. It may only be used between kernel nodes, and must be used with either the :py:obj:`~.cudaGraphKernelNodePortProgrammatic` or :py:obj:`~.cudaGraphKernelNodePortLaunchCompletion` outgoing port. +.. autoclass:: cuda.bindings.runtime.cudaGraphExecUpdateResult - Device can possibly execute multiple kernels concurrently + .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateSuccess - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrEccEnabled + The update succeeded - Device has ECC support enabled + .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateError - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrPciBusId + The update failed for an unexpected reason which is described in the return value of the function - PCI bus ID of the device + .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorTopologyChanged - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrPciDeviceId + The update failed because the topology changed - PCI device ID of the device + .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorNodeTypeChanged - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrTccDriver + The update failed because a node type changed - Device is using TCC driver model + .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorFunctionChanged - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMemoryClockRate + The update failed because the function of a kernel node changed (CUDA driver < 11.2) - Peak memory clock frequency in kilohertz + .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorParametersChanged - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrGlobalMemoryBusWidth + The update failed because the parameters changed in a way that is not supported - Global memory bus width in bits + .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorNotSupported - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrL2CacheSize + The update failed because something about the node is not supported - Size of L2 cache in bytes + .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorUnsupportedFunctionChange - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxThreadsPerMultiProcessor + The update failed because the function of a kernel node changed in an unsupported way - Maximum resident threads per multiprocessor + .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorAttributesChanged - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrAsyncEngineCount + The update failed because the node attributes changed in a way that is not supported +.. autoclass:: cuda.bindings.runtime.cudaGraphInstantiateResult - Number of asynchronous engines + .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateResult.cudaGraphInstantiateSuccess - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrUnifiedAddressing + Instantiation succeeded - Device shares a unified address space with the host + .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateResult.cudaGraphInstantiateError - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture1DLayeredWidth + Instantiation failed for an unexpected reason which is described in the return value of the function - Maximum 1D layered texture width + .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateResult.cudaGraphInstantiateInvalidStructure - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture1DLayeredLayers + Instantiation failed due to invalid structure, such as cycles - Maximum layers in a 1D layered texture + .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateResult.cudaGraphInstantiateNodeOperationNotSupported - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DGatherWidth + Instantiation for device launch failed because the graph contained an unsupported operation - Maximum 2D texture width if cudaArrayTextureGather is set + .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateResult.cudaGraphInstantiateMultipleDevicesNotSupported - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DGatherHeight + Instantiation for device launch failed due to the nodes belonging to different contexts - Maximum 2D texture height if cudaArrayTextureGather is set + .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateResult.cudaGraphInstantiateConditionalHandleUnused - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture3DWidthAlt + One or more conditional handles are not associated with conditional nodes +.. autoclass:: cuda.bindings.runtime.cudaGraphKernelNodeField - Alternate maximum 3D texture width + .. autoattribute:: cuda.bindings.runtime.cudaGraphKernelNodeField.cudaGraphKernelNodeFieldInvalid - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture3DHeightAlt + Invalid field - Alternate maximum 3D texture height + .. autoattribute:: cuda.bindings.runtime.cudaGraphKernelNodeField.cudaGraphKernelNodeFieldGridDim - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture3DDepthAlt + Grid dimension update - Alternate maximum 3D texture depth + .. autoattribute:: cuda.bindings.runtime.cudaGraphKernelNodeField.cudaGraphKernelNodeFieldParam - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrPciDomainId + Kernel parameter update - PCI domain ID of the device + .. autoattribute:: cuda.bindings.runtime.cudaGraphKernelNodeField.cudaGraphKernelNodeFieldEnabled - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrTexturePitchAlignment + Node enable/disable +.. autoclass:: cuda.bindings.runtime.cudaGetDriverEntryPointFlags - Pitch alignment requirement for textures + .. autoattribute:: cuda.bindings.runtime.cudaGetDriverEntryPointFlags.cudaEnableDefault - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTextureCubemapWidth + Default search mode for driver symbols. - Maximum cubemap texture width/height + .. autoattribute:: cuda.bindings.runtime.cudaGetDriverEntryPointFlags.cudaEnableLegacyStream - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTextureCubemapLayeredWidth + Search for legacy versions of driver symbols. - Maximum cubemap layered texture width/height + .. autoattribute:: cuda.bindings.runtime.cudaGetDriverEntryPointFlags.cudaEnablePerThreadDefaultStream - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTextureCubemapLayeredLayers + Search for per-thread versions of driver symbols. +.. autoclass:: cuda.bindings.runtime.cudaDriverEntryPointQueryResult - Maximum layers in a cubemap layered texture + .. autoattribute:: cuda.bindings.runtime.cudaDriverEntryPointQueryResult.cudaDriverEntryPointSuccess - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface1DWidth + Search for symbol found a match - Maximum 1D surface width + .. autoattribute:: cuda.bindings.runtime.cudaDriverEntryPointQueryResult.cudaDriverEntryPointSymbolNotFound - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface2DWidth + Search for symbol was not found - Maximum 2D surface width + .. autoattribute:: cuda.bindings.runtime.cudaDriverEntryPointQueryResult.cudaDriverEntryPointVersionNotSufficent - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface2DHeight + Search for symbol was found but version wasn't great enough +.. autoclass:: cuda.bindings.runtime.cudaGraphDebugDotFlags - Maximum 2D surface height + .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsVerbose - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface3DWidth + Output all debug data as if every debug flag is enabled - Maximum 3D surface width + .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsKernelNodeParams - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface3DHeight + Adds :py:obj:`~.cudaKernelNodeParams` to output - Maximum 3D surface height + .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsMemcpyNodeParams - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface3DDepth + Adds :py:obj:`~.cudaMemcpy3DParms` to output - Maximum 3D surface depth + .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsMemsetNodeParams - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface1DLayeredWidth + Adds :py:obj:`~.cudaMemsetParams` to output - Maximum 1D layered surface width + .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsHostNodeParams - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface1DLayeredLayers + Adds :py:obj:`~.cudaHostNodeParams` to output - Maximum layers in a 1D layered surface + .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsEventNodeParams - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface2DLayeredWidth + Adds :py:obj:`~.cudaEvent_t` handle from record and wait nodes to output - Maximum 2D layered surface width + .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsExtSemasSignalNodeParams - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface2DLayeredHeight + Adds :py:obj:`~.cudaExternalSemaphoreSignalNodeParams` values to output - Maximum 2D layered surface height + .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsExtSemasWaitNodeParams - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurface2DLayeredLayers + Adds :py:obj:`~.cudaExternalSemaphoreWaitNodeParams` to output - Maximum layers in a 2D layered surface + .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsKernelNodeAttributes - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurfaceCubemapWidth + Adds cudaKernelNodeAttrID values to output - Maximum cubemap surface width + .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsHandles - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurfaceCubemapLayeredWidth + Adds node handles and every kernel function handle to output - Maximum cubemap layered surface width + .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsConditionalNodeParams - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSurfaceCubemapLayeredLayers + Adds :py:obj:`~.cudaConditionalNodeParams` to output +.. autoclass:: cuda.bindings.runtime.cudaGraphInstantiateFlags - Maximum layers in a cubemap layered surface + .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateFlags.cudaGraphInstantiateFlagAutoFreeOnLaunch - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture1DLinearWidth + Automatically free memory allocated in a graph before relaunching. - Maximum 1D linear texture width + .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateFlags.cudaGraphInstantiateFlagUpload - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DLinearWidth + Automatically upload the graph after instantiation. Only supported by + :py:obj:`~.cudaGraphInstantiateWithParams`. The upload will be performed using the - Maximum 2D linear texture width + stream provided in ``instantiateParams``. - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DLinearHeight + .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateFlags.cudaGraphInstantiateFlagDeviceLaunch - Maximum 2D linear texture height + Instantiate the graph to be launchable from the device. This flag can only + be used on platforms which support unified addressing. This flag cannot be - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DLinearPitch + used in conjunction with cudaGraphInstantiateFlagAutoFreeOnLaunch. - Maximum 2D linear texture pitch in bytes + .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateFlags.cudaGraphInstantiateFlagUseNodePriority - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DMipmappedWidth + Run the graph using the per-node priority attributes rather than the priority of the stream it is launched into. +.. autoclass:: cuda.bindings.runtime.cudaLaunchMemSyncDomain - Maximum mipmapped 2D texture width + .. autoattribute:: cuda.bindings.runtime.cudaLaunchMemSyncDomain.cudaLaunchMemSyncDomainDefault - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture2DMipmappedHeight + Launch kernels in the default domain - Maximum mipmapped 2D texture height + .. autoattribute:: cuda.bindings.runtime.cudaLaunchMemSyncDomain.cudaLaunchMemSyncDomainRemote - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrComputeCapabilityMajor + Launch kernels in the remote domain +.. autoclass:: cuda.bindings.runtime.cudaLaunchAttributePortableClusterMode - Major compute capability version number + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributePortableClusterMode.cudaLaunchPortableClusterModeDefault - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrComputeCapabilityMinor + The default to use for allowing non-portable cluster size on launch - uses current function attribute for :py:obj:`~.cudaFuncAttributeNonPortableClusterSizeAllowed` - Minor compute capability version number + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributePortableClusterMode.cudaLaunchPortableClusterModeRequirePortable - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxTexture1DMipmappedWidth + Specifies that the cluster size requested must be a portable size - Maximum mipmapped 1D texture width + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributePortableClusterMode.cudaLaunchPortableClusterModeAllowNonPortable - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrStreamPrioritiesSupported + Specifies that the cluster size requested may be a non-portable size +.. autoclass:: cuda.bindings.runtime.cudaLaunchAttributeID - Device supports stream priorities + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeIgnore - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrGlobalL1CacheSupported + Ignored entry, for convenient composition - Device supports caching globals in L1 + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeAccessPolicyWindow - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrLocalL1CacheSupported + Valid for streams, graph nodes, launches. See :py:obj:`~.cudaLaunchAttributeValue.accessPolicyWindow`. - Device supports caching locals in L1 + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeCooperative - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSharedMemoryPerMultiprocessor + Valid for graph nodes, launches. See :py:obj:`~.cudaLaunchAttributeValue.cooperative`. - Maximum shared memory available per multiprocessor in bytes + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeSynchronizationPolicy - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxRegistersPerMultiprocessor + Valid for streams. See :py:obj:`~.cudaLaunchAttributeValue.syncPolicy`. - Maximum number of 32-bit registers available per multiprocessor + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeClusterDimension - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrManagedMemory + Valid for graph nodes, launches. See :py:obj:`~.cudaLaunchAttributeValue.clusterDim`. - Device can allocate managed memory on this system + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeClusterSchedulingPolicyPreference - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrIsMultiGpuBoard + Valid for graph nodes, launches. See :py:obj:`~.cudaLaunchAttributeValue.clusterSchedulingPolicyPreference`. - Device is on a multi-GPU board + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeProgrammaticStreamSerialization - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMultiGpuBoardGroupID + Valid for launches. Setting :py:obj:`~.cudaLaunchAttributeValue.programmaticStreamSerializationAllowed` to non-0 signals that the kernel will use programmatic means to resolve its stream dependency, so that the CUDA runtime should opportunistically allow the grid's execution to overlap with the previous kernel in the stream, if that kernel requests the overlap. The dependent launches can choose to wait on the dependency using the programmatic sync (cudaGridDependencySynchronize() or equivalent PTX instructions). - Unique identifier for a group of devices on the same multi-GPU board + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeProgrammaticEvent - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrHostNativeAtomicSupported + Valid for launches. Set :py:obj:`~.cudaLaunchAttributeValue.programmaticEvent` to record the event. Event recorded through this launch attribute is guaranteed to only trigger after all block in the associated kernel trigger the event. A block can trigger the event programmatically in a future CUDA release. A trigger can also be inserted at the beginning of each block's execution if triggerAtBlockStart is set to non-0. The dependent launches can choose to wait on the dependency using the programmatic sync (cudaGridDependencySynchronize() or equivalent PTX instructions). Note that dependents (including the CPU thread calling :py:obj:`~.cudaEventSynchronize()`) are not guaranteed to observe the release precisely when it is released. For example, :py:obj:`~.cudaEventSynchronize()` may only observe the event trigger long after the associated kernel has completed. This recording type is primarily meant for establishing programmatic dependency between device tasks. Note also this type of dependency allows, but does not guarantee, concurrent execution of tasks. + The event supplied must not be an interprocess or interop event. The event must disable timing (i.e. must be created with the :py:obj:`~.cudaEventDisableTiming` flag set). - Link between the device and the host supports native atomic operations + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributePriority - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrSingleToDoublePrecisionPerfRatio + Valid for streams, graph nodes, launches. See :py:obj:`~.cudaLaunchAttributeValue.priority`. - Ratio of single precision performance (in floating-point operations per second) to double precision performance + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeMemSyncDomainMap - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrPageableMemoryAccess + Valid for streams, graph nodes, launches. See :py:obj:`~.cudaLaunchAttributeValue.memSyncDomainMap`. - Device supports coherently accessing pageable memory without calling cudaHostRegister on it + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeMemSyncDomain - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrConcurrentManagedAccess + Valid for streams, graph nodes, launches. See :py:obj:`~.cudaLaunchAttributeValue.memSyncDomain`. - Device can coherently access managed memory concurrently with the CPU + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributePreferredClusterDimension - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrComputePreemptionSupported + Valid for graph nodes and launches. Set :py:obj:`~.cudaLaunchAttributeValue.preferredClusterDim` to allow the kernel launch to specify a preferred substitute cluster dimension. Blocks may be grouped according to either the dimensions specified with this attribute (grouped into a "preferred substitute cluster"), or the one specified with :py:obj:`~.cudaLaunchAttributeClusterDimension` attribute (grouped into a "regular cluster"). The cluster dimensions of a "preferred substitute cluster" shall be an integer multiple greater than zero of the regular cluster dimensions. The device will attempt - on a best-effort basis - to group thread blocks into preferred clusters over grouping them into regular clusters. When it deems necessary (primarily when the device temporarily runs out of physical resources to launch the larger preferred clusters), the device may switch to launch the regular clusters instead to attempt to utilize as much of the physical device resources as possible. - Device supports Compute Preemption + Each type of cluster will have its enumeration / coordinate setup as if the grid consists solely of its type of cluster. For example, if the preferred substitute cluster dimensions double the regular cluster dimensions, there might be simultaneously a regular cluster indexed at (1,0,0), and a preferred cluster indexed at (1,0,0). In this example, the preferred substitute cluster (1,0,0) replaces regular clusters (2,0,0) and (3,0,0) and groups their blocks. + This attribute will only take effect when a regular cluster dimension has been specified. The preferred substitute cluster dimension must be an integer multiple greater than zero of the regular cluster dimension and must divide the grid. It must also be no more than ``maxBlocksPerCluster``, if it is set in the kernel's ``__launch_bounds__``. Otherwise it must be less than the maximum value the driver can support. Otherwise, setting this attribute to a value physically unable to fit on any particular device is permitted. - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrCanUseHostPointerForRegisteredMem + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeLaunchCompletionEvent - Device can access host registered memory at the same virtual address as the CPU + Valid for launches. Set :py:obj:`~.cudaLaunchAttributeValue.launchCompletionEvent` to record the event. - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved92 + Nominally, the event is triggered once all blocks of the kernel have begun execution. Currently this is a best effort. If a kernel B has a launch completion dependency on a kernel A, B may wait until A is complete. Alternatively, blocks of B may begin before all blocks of A have begun, for example if B can claim execution resources unavailable to A (e.g. they run on different GPUs) or if B is a higher priority than A. Exercise caution if such an ordering inversion could lead to deadlock. + A launch completion event is nominally similar to a programmatic event with ``triggerAtBlockStart`` set except that it is not visible to ``cudaGridDependencySynchronize()`` and can be used with compute capability less than 9.0. - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved93 + The event supplied must not be an interprocess or interop event. The event must disable timing (i.e. must be created with the :py:obj:`~.cudaEventDisableTiming` flag set). - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved94 + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeDeviceUpdatableKernelNode - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrCooperativeLaunch + Valid for graph nodes, launches. This attribute is graphs-only, and passing it to a launch in a non-capturing stream will result in an error. + :cudaLaunchAttributeValue::deviceUpdatableKernelNode::deviceUpdatable can only be set to 0 or 1. Setting the field to 1 indicates that the corresponding kernel node should be device-updatable. On success, a handle will be returned via :py:obj:`~.cudaLaunchAttributeValue.deviceUpdatableKernelNode.devNode` which can be passed to the various device-side update functions to update the node's kernel parameters from within another kernel. For more information on the types of device updates that can be made, as well as the relevant limitations thereof, see :py:obj:`~.cudaGraphKernelNodeUpdatesApply`. - Device supports launching cooperative kernels via :py:obj:`~.cudaLaunchCooperativeKernel` + Nodes which are device-updatable have additional restrictions compared to regular kernel nodes. Firstly, device-updatable nodes cannot be removed from their graph via :py:obj:`~.cudaGraphDestroyNode`. Additionally, once opted-in to this functionality, a node cannot opt out, and any attempt to set the deviceUpdatable attribute to 0 will result in an error. Device-updatable kernel nodes also cannot have their attributes copied to/from another kernel node via :py:obj:`~.cudaGraphKernelNodeCopyAttributes`. Graphs containing one or more device-updatable nodes also do not allow multiple instantiation, and neither the graph nor its instantiated version can be passed to :py:obj:`~.cudaGraphExecUpdate`. + If a graph contains device-updatable nodes and updates those nodes from the device from within the graph, the graph must be uploaded with :py:obj:`~.cuGraphUpload` before it is launched. For such a graph, if host-side executable graph updates are made to the device-updatable nodes, the graph must be uploaded before it is launched again. - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved96 + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributePreferredSharedMemoryCarveout - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxSharedMemoryPerBlockOptin + 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. - The maximum optin shared memory per block. This value may vary by chip. See :py:obj:`~.cudaFuncSetAttribute` + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeNvlinkUtilCentricScheduling - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrCanFlushRemoteWrites + 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. - Device supports flushing of outstanding remote writes. - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrHostRegisterSupported + 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. - Device supports host memory registration via :py:obj:`~.cudaHostRegister`. + Valid values for :py:obj:`~.cudaLaunchAttributeValue.nvlinkUtilCentricScheduling` are 0 (disabled) and 1 (enabled). - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrPageableMemoryAccessUsesHostPageTables + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributePortableClusterSizeMode - Device accesses pageable memory via the host's page tables. + Valid for graph nodes, launches. This indicates whether the kernel launch is allowed to use a non-portable cluster size. Valid values for :py:obj:`~.cudaLaunchAttributeValue.portableClusterSizeMode` are values for :py:obj:`~.cudaLaunchAttributePortableClusterMode` Any other value will return :py:obj:`~.cudaErrorInvalidValue` - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrDirectManagedMemAccessFromHost + .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeSharedMemoryMode - Host can directly access managed memory on the device without migration. + Valid for graph nodes, launches. This indicates that the kernel launch is allowed to use a non-portable shared memory mode. +.. autoclass:: cuda.bindings.runtime.cudaDeviceNumaConfig - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxBlocksPerMultiprocessor + .. autoattribute:: cuda.bindings.runtime.cudaDeviceNumaConfig.cudaDeviceNumaConfigNone - Maximum number of blocks per multiprocessor + The GPU is not a NUMA node - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxPersistingL2CacheSize + .. autoattribute:: cuda.bindings.runtime.cudaDeviceNumaConfig.cudaDeviceNumaConfigNumaNode - Maximum L2 persisting lines capacity setting in bytes. + The GPU is a NUMA node, cudaDevAttrNumaId contains its NUMA ID +.. autoclass:: cuda.bindings.runtime.cudaAsyncNotificationType - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMaxAccessPolicyWindowSize + .. autoattribute:: cuda.bindings.runtime.cudaAsyncNotificationType.cudaAsyncNotificationTypeOverBudget - Maximum value of :py:obj:`~.cudaAccessPolicyWindow.num_bytes`. + Sent when the process has exceeded its device memory budget +.. autoclass:: cuda.bindings.runtime.cudaLogLevel - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReservedSharedMemoryPerBlock + .. autoattribute:: cuda.bindings.runtime.cudaLogLevel.cudaLogLevelError - Shared memory reserved by CUDA driver per block in bytes + .. autoattribute:: cuda.bindings.runtime.cudaLogLevel.cudaLogLevelWarning +.. autoclass:: cuda.bindings.runtime.cudaFabricOpStatusSource - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrSparseCudaArraySupported + .. autoattribute:: cuda.bindings.runtime.cudaFabricOpStatusSource.cudaFabricOpStatusSourceMbarrierV1 - Device supports sparse CUDA arrays and sparse CUDA mipmapped arrays + 1B-aligned 1B-wide status from an mbarrier.layout::v1 - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrHostRegisterReadOnlySupported + .. autoattribute:: cuda.bindings.runtime.cudaFabricOpStatusSource.cudaFabricOpStatusSourceMax +.. autoclass:: cuda.bindings.runtime.cudaFabricOpStatusInfo - Device supports using the :py:obj:`~.cudaHostRegister` flag cudaHostRegisterReadOnly to register memory that must be mapped as read-only to the GPU + .. autoattribute:: cuda.bindings.runtime.cudaFabricOpStatusInfo.cudaFabricOpStatusInfoSuccess - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrTimelineSemaphoreInteropSupported + .. autoattribute:: cuda.bindings.runtime.cudaFabricOpStatusInfo.cudaFabricOpStatusInfoLast - External timeline semaphore interop is supported on the device + .. autoattribute:: cuda.bindings.runtime.cudaFabricOpStatusInfo.cudaFabricOpStatusInfoMax +.. autoclass:: cuda.bindings.runtime.cudaSurfaceBoundaryMode - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMemoryPoolsSupported + .. autoattribute:: cuda.bindings.runtime.cudaSurfaceBoundaryMode.cudaBoundaryModeZero - Device supports using the :py:obj:`~.cudaMallocAsync` and :py:obj:`~.cudaMemPool` family of APIs + Zero boundary mode - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrGPUDirectRDMASupported + .. autoattribute:: cuda.bindings.runtime.cudaSurfaceBoundaryMode.cudaBoundaryModeClamp - Device supports GPUDirect RDMA APIs, like nvidia_p2p_get_pages (see https://docs.nvidia.com/cuda/gpudirect-rdma for more information) + Clamp boundary mode - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrGPUDirectRDMAFlushWritesOptions + .. autoattribute:: cuda.bindings.runtime.cudaSurfaceBoundaryMode.cudaBoundaryModeTrap - The returned attribute shall be interpreted as a bitmask, where the individual bits are listed in the :py:obj:`~.cudaFlushGPUDirectRDMAWritesOptions` enum + Trap boundary mode +.. autoclass:: cuda.bindings.runtime.cudaSurfaceFormatMode - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrGPUDirectRDMAWritesOrdering + .. autoattribute:: cuda.bindings.runtime.cudaSurfaceFormatMode.cudaFormatModeForced - 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:`~.cudaGPUDirectRDMAWritesOrdering` for the numerical values returned here. + Forced format mode - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMemoryPoolSupportedHandleTypes + .. autoattribute:: cuda.bindings.runtime.cudaSurfaceFormatMode.cudaFormatModeAuto - Handle types supported with mempool based IPC + Auto format mode +.. autoclass:: cuda.bindings.runtime.cudaTextureAddressMode - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrClusterLaunch + .. autoattribute:: cuda.bindings.runtime.cudaTextureAddressMode.cudaAddressModeWrap - Indicates device supports cluster launch + Wrapping address mode - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrDeferredMappingCudaArraySupported + .. autoattribute:: cuda.bindings.runtime.cudaTextureAddressMode.cudaAddressModeClamp - Device supports deferred mapping CUDA arrays and CUDA mipmapped arrays + Clamp to edge address mode - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved122 + .. autoattribute:: cuda.bindings.runtime.cudaTextureAddressMode.cudaAddressModeMirror - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved123 + Mirror address mode - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved124 + .. autoattribute:: cuda.bindings.runtime.cudaTextureAddressMode.cudaAddressModeBorder - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrIpcEventSupport + Border address mode +.. autoclass:: cuda.bindings.runtime.cudaTextureFilterMode - Device supports IPC Events. + .. autoattribute:: cuda.bindings.runtime.cudaTextureFilterMode.cudaFilterModePoint - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMemSyncDomainCount + Point filter mode - Number of memory synchronization domains the device supports. + .. autoattribute:: cuda.bindings.runtime.cudaTextureFilterMode.cudaFilterModeLinear - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved127 + Linear filter mode +.. autoclass:: cuda.bindings.runtime.cudaTextureReadMode - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved128 + .. autoattribute:: cuda.bindings.runtime.cudaTextureReadMode.cudaReadModeElementType - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved129 + Read texture as specified element type - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrNumaConfig + .. autoattribute:: cuda.bindings.runtime.cudaTextureReadMode.cudaReadModeNormalizedFloat - NUMA configuration of a device: value is of type :py:obj:`~.cudaDeviceNumaConfig` enum + Read texture as normalized float +.. autoclass:: cuda.bindings.runtime.cudaEglFrameType - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrNumaId + .. autoattribute:: cuda.bindings.runtime.cudaEglFrameType.cudaEglFrameTypeArray - NUMA node ID of the GPU memory + Frame type CUDA array - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved132 + .. autoattribute:: cuda.bindings.runtime.cudaEglFrameType.cudaEglFrameTypePitch - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMpsEnabled + Frame type CUDA pointer +.. autoclass:: cuda.bindings.runtime.cudaEglResourceLocationFlags - Contexts created on this device will be shared via MPS + .. autoattribute:: cuda.bindings.runtime.cudaEglResourceLocationFlags.cudaEglResourceLocationSysmem - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrHostNumaId + Resource location sysmem - NUMA ID of the host node closest to the device or -1 when system does not support NUMA + .. autoattribute:: cuda.bindings.runtime.cudaEglResourceLocationFlags.cudaEglResourceLocationVidmem - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrD3D12CigSupported + Resource location vidmem +.. autoclass:: cuda.bindings.runtime.cudaEglColorFormat - Device supports CIG with D3D12. + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV420Planar - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrVulkanCigSupported + Y, U, V in three surfaces, each in a separate surface, U/V width = 1/2 Y width, U/V height = 1/2 Y height. - Device supports CIG with Vulkan. + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV420SemiPlanar - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrGpuPciDeviceId + Y, UV in two surfaces (UV as one surface) with VU byte ordering, width, height ratio same as YUV420Planar. - The combined 16-bit PCI device ID and 16-bit PCI vendor ID. + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV422Planar - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrGpuPciSubsystemId + Y, U, V each in a separate surface, U/V width = 1/2 Y width, U/V height = Y height. - The combined 16-bit PCI subsystem ID and 16-bit PCI subsystem vendor ID. + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV422SemiPlanar - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved141 + Y, UV in two surfaces with VU byte ordering, width, height ratio same as YUV422Planar. - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrHostNumaMemoryPoolsSupported + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatARGB - Device supports HOST_NUMA location with the :py:obj:`~.cudaMallocAsync` and :py:obj:`~.cudaMemPool` family of APIs + R/G/B/A four channels in one surface with BGRA byte ordering. - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrHostNumaMultinodeIpcSupported + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatRGBA - Device supports HostNuma location IPC between nodes in a multi-node system. + R/G/B/A four channels in one surface with ABGR byte ordering. - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrHostMemoryPoolsSupported + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatL - Device suports HOST location with the :py:obj:`~.cuMemAllocAsync` and :py:obj:`~.cuMemPool` family of APIs + single luminance channel in one surface. - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrReserved145 + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatR - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrOnlyPartialHostNativeAtomicSupported + single color channel in one surface. - Link between the device and the host supports only some native atomic operations + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV444Planar - .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMax + Y, U, V in three surfaces, each in a separate surface, U/V width = Y width, U/V height = Y height. -.. autoclass:: cuda.bindings.runtime.cudaMemPoolAttr - .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolReuseFollowEventDependencies + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV444SemiPlanar - (value type = int) Allow cuMemAllocAsync to use memory asynchronously freed in another streams as long as a stream ordering dependency of the allocating stream on the free action exists. Cuda events and null stream interactions can create the required stream ordered dependencies. (default enabled) + Y, UV in two surfaces (UV as one surface) with VU byte ordering, width, height ratio same as YUV444Planar. - .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolReuseAllowOpportunistic + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUYV422 - (value type = int) Allow reuse of already completed frees when there is no dependency between the free and allocation. (default enabled) + Y, U, V in one surface, interleaved as UYVY in one channel. - .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolReuseAllowInternalDependencies + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatUYVY422 - (value type = int) Allow cuMemAllocAsync to insert new stream dependencies in order to establish the stream ordering required to reuse a piece of memory released by cuFreeAsync (default enabled). + Y, U, V in one surface, interleaved as YUYV in one channel. - .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrReleaseThreshold + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatABGR - (value type = cuuint64_t) Amount of reserved memory in bytes to hold onto before trying to release memory back to the OS. When more than the release threshold bytes of memory are held by the memory pool, the allocator will try to release memory back to the OS on the next call to stream, event or context synchronize. (default 0) + R/G/B/A four channels in one surface with RGBA byte ordering. - .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrReservedMemCurrent + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBGRA - (value type = cuuint64_t) Amount of backing memory currently allocated for the mempool. + R/G/B/A four channels in one surface with ARGB byte ordering. - .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrReservedMemHigh + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatA - (value type = cuuint64_t) High watermark of backing memory allocated for the mempool since the last time it was reset. High watermark can only be reset to zero. + Alpha color format - one channel in one surface. - .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrUsedMemCurrent + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatRG - (value type = cuuint64_t) Amount of memory from the pool that is currently in use by the application. + R/G color format - two channels in one surface with GR byte ordering - .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrUsedMemHigh + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatAYUV - (value type = cuuint64_t) High watermark of the amount of memory from the pool that was in use by the application since the last time it was reset. High watermark can only be reset to zero. + Y, U, V, A four channels in one surface, interleaved as VUYA. - .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrAllocationType + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU444SemiPlanar - (value type = cudaMemAllocationType) The allocation type of the mempool + Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = Y width, U/V height = Y height. - .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrExportHandleTypes + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU422SemiPlanar - (value type = cudaMemAllocationHandleType) Available export handle types for the mempool. For imported pools this value is always cudaMemHandleTypeNone as an imported pool cannot be re-exported + Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V height = Y height. - .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrLocationId + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU420SemiPlanar - (value type = int) The location id for the mempool. If the location type for this pool is cudaMemLocationTypeInvisible then ID will be cudaInvalidDeviceId + Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V height = 1/2 Y height. - .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrLocationType + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_444SemiPlanar - (value type = cudaMemLocationType) The location type for the mempool. For imported memory pools where the device is not directly visible to the importing process or pools imported via fabric handles across nodes this will be cudaMemLocationTypeInvisible + Y10, V10U10 in two surfaces (VU as one surface) with UV byte ordering, U/V width = Y width, U/V height = Y height. - .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrMaxPoolSize + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_420SemiPlanar - (value type = cuuint64_t) Maximum size of the pool in bytes, this value may be higher than what was initially passed to cudaMemPoolCreate due to alignment requirements. A value of 0 indicates no maximum size. For cudaMemAllocationTypeManaged and IPC imported pools this value will be system dependent. + Y10, V10U10 in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V height = 1/2 Y height. - .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrHwDecompressEnabled + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY12V12U12_444SemiPlanar - (value type = int) Indicates whether the pool has hardware compresssion enabled + Y12, V12U12 in two surfaces (VU as one surface) with UV byte ordering, U/V width = Y width, U/V height = Y height. -.. autoclass:: cuda.bindings.runtime.cudaMemLocationType - .. autoattribute:: cuda.bindings.runtime.cudaMemLocationType.cudaMemLocationTypeInvalid + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY12V12U12_420SemiPlanar - .. autoattribute:: cuda.bindings.runtime.cudaMemLocationType.cudaMemLocationTypeNone + Y12, V12U12 in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V height = 1/2 Y height. - Location is unspecified. This is used when creating a managed memory pool to indicate no preferred location for the pool + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatVYUY_ER - .. autoattribute:: cuda.bindings.runtime.cudaMemLocationType.cudaMemLocationTypeDevice + Extended Range Y, U, V in one surface, interleaved as YVYU in one channel. - Location is a device location, thus id is a device ordinal + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatUYVY_ER - .. autoattribute:: cuda.bindings.runtime.cudaMemLocationType.cudaMemLocationTypeHost + Extended Range Y, U, V in one surface, interleaved as YUYV in one channel. - Location is host, id is ignored + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUYV_ER - .. autoattribute:: cuda.bindings.runtime.cudaMemLocationType.cudaMemLocationTypeHostNuma + Extended Range Y, U, V in one surface, interleaved as UYVY in one channel. - Location is a host NUMA node, thus id is a host NUMA node id + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVYU_ER - .. autoattribute:: cuda.bindings.runtime.cudaMemLocationType.cudaMemLocationTypeHostNumaCurrent + Extended Range Y, U, V in one surface, interleaved as VYUY in one channel. - Location is the host NUMA node closest to the current thread's CPU, id is ignored + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUVA_ER - .. autoattribute:: cuda.bindings.runtime.cudaMemLocationType.cudaMemLocationTypeInvisible + Extended Range Y, U, V, A four channels in one surface, interleaved as AVUY. - Location is not visible but device is accessible, id is always cudaInvalidDeviceId + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatAYUV_ER -.. autoclass:: cuda.bindings.runtime.cudaMemAccessFlags - .. autoattribute:: cuda.bindings.runtime.cudaMemAccessFlags.cudaMemAccessFlagsProtNone + Extended Range Y, U, V, A four channels in one surface, interleaved as VUYA. - Default, make the address range not accessible + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV444Planar_ER - .. autoattribute:: cuda.bindings.runtime.cudaMemAccessFlags.cudaMemAccessFlagsProtRead + Extended Range Y, U, V in three surfaces, U/V width = Y width, U/V height = Y height. - Make the address range read accessible + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV422Planar_ER - .. autoattribute:: cuda.bindings.runtime.cudaMemAccessFlags.cudaMemAccessFlagsProtReadWrite + Extended Range Y, U, V in three surfaces, U/V width = 1/2 Y width, U/V height = Y height. - Make the address range read-write accessible + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV420Planar_ER -.. autoclass:: cuda.bindings.runtime.cudaMemAllocationType - .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationType.cudaMemAllocationTypeInvalid + Extended Range Y, U, V in three surfaces, U/V width = 1/2 Y width, U/V height = 1/2 Y height. - .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationType.cudaMemAllocationTypePinned + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV444SemiPlanar_ER - This allocation type is 'pinned', i.e. cannot migrate from its current location while the application is actively using it + Extended Range Y, UV in two surfaces (UV as one surface) with VU byte ordering, U/V width = Y width, U/V height = Y height. - .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationType.cudaMemAllocationTypeManaged + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV422SemiPlanar_ER - This allocation type is managed memory + Extended Range Y, UV in two surfaces (UV as one surface) with VU byte ordering, U/V width = 1/2 Y width, U/V height = Y height. - .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationType.cudaMemAllocationTypeMax + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV420SemiPlanar_ER -.. autoclass:: cuda.bindings.runtime.cudaMemAllocationHandleType - .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationHandleType.cudaMemHandleTypeNone + Extended Range Y, UV in two surfaces (UV as one surface) with VU byte ordering, U/V width = 1/2 Y width, U/V height = 1/2 Y height. - Does not allow any export mechanism. > + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU444Planar_ER - .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationHandleType.cudaMemHandleTypePosixFileDescriptor + Extended Range Y, V, U in three surfaces, U/V width = Y width, U/V height = Y height. - Allows a file descriptor to be used for exporting. Permitted only on POSIX systems. (int) + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU422Planar_ER - .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationHandleType.cudaMemHandleTypeWin32 + Extended Range Y, V, U in three surfaces, U/V width = 1/2 Y width, U/V height = Y height. - Allows a Win32 NT handle to be used for exporting. (HANDLE) + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU420Planar_ER - .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationHandleType.cudaMemHandleTypeWin32Kmt + Extended Range Y, V, U in three surfaces, U/V width = 1/2 Y width, U/V height = 1/2 Y height. - Allows a Win32 KMT handle to be used for exporting. (D3DKMT_HANDLE) + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU444SemiPlanar_ER - .. autoattribute:: cuda.bindings.runtime.cudaMemAllocationHandleType.cudaMemHandleTypeFabric + Extended Range Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = Y width, U/V height = Y height. - Allows a fabric handle to be used for exporting. (cudaMemFabricHandle_t) + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU422SemiPlanar_ER -.. autoclass:: cuda.bindings.runtime.cudaGraphMemAttributeType - .. autoattribute:: cuda.bindings.runtime.cudaGraphMemAttributeType.cudaGraphMemAttrUsedMemCurrent + Extended Range Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V height = Y height. - (value type = cuuint64_t) Amount of memory, in bytes, currently associated with graphs. + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU420SemiPlanar_ER - .. autoattribute:: cuda.bindings.runtime.cudaGraphMemAttributeType.cudaGraphMemAttrUsedMemHigh + Extended Range Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V height = 1/2 Y height. - (value type = cuuint64_t) High watermark of memory, in bytes, associated with graphs since the last time it was reset. High watermark can only be reset to zero. + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerRGGB - .. autoattribute:: cuda.bindings.runtime.cudaGraphMemAttributeType.cudaGraphMemAttrReservedMemCurrent + Bayer format - one channel in one surface with interleaved RGGB ordering. - (value type = cuuint64_t) Amount of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator. + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerBGGR - .. autoattribute:: cuda.bindings.runtime.cudaGraphMemAttributeType.cudaGraphMemAttrReservedMemHigh + Bayer format - one channel in one surface with interleaved BGGR ordering. - (value type = cuuint64_t) High watermark of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator. + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerGRBG -.. autoclass:: cuda.bindings.runtime.cudaMemcpyFlags - .. autoattribute:: cuda.bindings.runtime.cudaMemcpyFlags.cudaMemcpyFlagDefault + Bayer format - one channel in one surface with interleaved GRBG ordering. - .. autoattribute:: cuda.bindings.runtime.cudaMemcpyFlags.cudaMemcpyFlagPreferOverlapWithCompute + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerGBRG - Hint to the driver to try and overlap the copy with compute work on the SMs. + Bayer format - one channel in one surface with interleaved GBRG ordering. -.. autoclass:: cuda.bindings.runtime.cudaMemcpySrcAccessOrder - .. autoattribute:: cuda.bindings.runtime.cudaMemcpySrcAccessOrder.cudaMemcpySrcAccessOrderInvalid + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer10RGGB - Default invalid. + Bayer10 format - one channel in one surface with interleaved RGGB ordering. Out of 16 bits, 10 bits used 6 bits No-op. - .. autoattribute:: cuda.bindings.runtime.cudaMemcpySrcAccessOrder.cudaMemcpySrcAccessOrderStream + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer10BGGR - Indicates that access to the source pointer must be in stream order. + Bayer10 format - one channel in one surface with interleaved BGGR ordering. Out of 16 bits, 10 bits used 6 bits No-op. - .. autoattribute:: cuda.bindings.runtime.cudaMemcpySrcAccessOrder.cudaMemcpySrcAccessOrderDuringApiCall + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer10GRBG - Indicates that access to the source pointer can be out of stream order and all accesses must be complete before the API call returns. This flag is suited for ephemeral sources (ex., stack variables) when it's known that no prior operations in the stream can be accessing the memory and also that the lifetime of the memory is limited to the scope that the source variable was declared in. Specifying this flag allows the driver to optimize the copy and removes the need for the user to synchronize the stream after the API call. + Bayer10 format - one channel in one surface with interleaved GRBG ordering. Out of 16 bits, 10 bits used 6 bits No-op. - .. autoattribute:: cuda.bindings.runtime.cudaMemcpySrcAccessOrder.cudaMemcpySrcAccessOrderAny + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer10GBRG - Indicates that access to the source pointer can be out of stream order and the accesses can happen even after the API call returns. This flag is suited for host pointers allocated outside CUDA (ex., via malloc) when it's known that no prior operations in the stream can be accessing the memory. Specifying this flag allows the driver to optimize the copy on certain platforms. + Bayer10 format - one channel in one surface with interleaved GBRG ordering. Out of 16 bits, 10 bits used 6 bits No-op. - .. autoattribute:: cuda.bindings.runtime.cudaMemcpySrcAccessOrder.cudaMemcpySrcAccessOrderMax + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer12RGGB -.. autoclass:: cuda.bindings.runtime.cudaMemcpy3DOperandType - .. autoattribute:: cuda.bindings.runtime.cudaMemcpy3DOperandType.cudaMemcpyOperandTypePointer + Bayer12 format - one channel in one surface with interleaved RGGB ordering. Out of 16 bits, 12 bits used 4 bits No-op. - Memcpy operand is a valid pointer. + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer12BGGR - .. autoattribute:: cuda.bindings.runtime.cudaMemcpy3DOperandType.cudaMemcpyOperandTypeArray + Bayer12 format - one channel in one surface with interleaved BGGR ordering. Out of 16 bits, 12 bits used 4 bits No-op. - Memcpy operand is a CUarray. + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer12GRBG - .. autoattribute:: cuda.bindings.runtime.cudaMemcpy3DOperandType.cudaMemcpyOperandTypeMax + Bayer12 format - one channel in one surface with interleaved GRBG ordering. Out of 16 bits, 12 bits used 4 bits No-op. -.. autoclass:: cuda.bindings.runtime.cudaDeviceP2PAttr - .. autoattribute:: cuda.bindings.runtime.cudaDeviceP2PAttr.cudaDevP2PAttrPerformanceRank + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer12GBRG - A relative value indicating the performance of the link between two devices + Bayer12 format - one channel in one surface with interleaved GBRG ordering. Out of 16 bits, 12 bits used 4 bits No-op. - .. autoattribute:: cuda.bindings.runtime.cudaDeviceP2PAttr.cudaDevP2PAttrAccessSupported + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer14RGGB - Peer access is enabled + Bayer14 format - one channel in one surface with interleaved RGGB ordering. Out of 16 bits, 14 bits used 2 bits No-op. - .. autoattribute:: cuda.bindings.runtime.cudaDeviceP2PAttr.cudaDevP2PAttrNativeAtomicSupported + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer14BGGR - Native atomic operation over the link supported + Bayer14 format - one channel in one surface with interleaved BGGR ordering. Out of 16 bits, 14 bits used 2 bits No-op. - .. autoattribute:: cuda.bindings.runtime.cudaDeviceP2PAttr.cudaDevP2PAttrCudaArrayAccessSupported + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer14GRBG - Accessing CUDA arrays over the link supported + Bayer14 format - one channel in one surface with interleaved GRBG ordering. Out of 16 bits, 14 bits used 2 bits No-op. - .. autoattribute:: cuda.bindings.runtime.cudaDeviceP2PAttr.cudaDevP2PAttrOnlyPartialNativeAtomicSupported + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer14GBRG - Only some CUDA-valid atomic operations over the link are supported. + Bayer14 format - one channel in one surface with interleaved GBRG ordering. Out of 16 bits, 14 bits used 2 bits No-op. -.. autoclass:: cuda.bindings.runtime.cudaAtomicOperation - .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationIntegerAdd + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer20RGGB - .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationIntegerMin + Bayer20 format - one channel in one surface with interleaved RGGB ordering. Out of 32 bits, 20 bits used 12 bits No-op. - .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationIntegerMax + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer20BGGR - .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationIntegerIncrement + Bayer20 format - one channel in one surface with interleaved BGGR ordering. Out of 32 bits, 20 bits used 12 bits No-op. - .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationIntegerDecrement + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer20GRBG - .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationAnd + Bayer20 format - one channel in one surface with interleaved GRBG ordering. Out of 32 bits, 20 bits used 12 bits No-op. - .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationOr + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer20GBRG - .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationXOR + Bayer20 format - one channel in one surface with interleaved GBRG ordering. Out of 32 bits, 20 bits used 12 bits No-op. - .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationExchange + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU444Planar - .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationCAS + Y, V, U in three surfaces, each in a separate surface, U/V width = Y width, U/V height = Y height. - .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationFloatAdd + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU422Planar - .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationFloatMin + Y, V, U in three surfaces, each in a separate surface, U/V width = 1/2 Y width, U/V height = Y height. - .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperation.cudaAtomicOperationFloatMax + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU420Planar -.. autoclass:: cuda.bindings.runtime.cudaAtomicOperationCapability - .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperationCapability.cudaAtomicCapabilitySigned + Y, V, U in three surfaces, each in a separate surface, U/V width = 1/2 Y width, U/V height = 1/2 Y height. - .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperationCapability.cudaAtomicCapabilityUnsigned + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerIspRGGB - .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperationCapability.cudaAtomicCapabilityReduction + Nvidia proprietary Bayer ISP format - one channel in one surface with interleaved RGGB ordering and mapped to opaque integer datatype. - .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperationCapability.cudaAtomicCapabilityScalar32 + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerIspBGGR - .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperationCapability.cudaAtomicCapabilityScalar64 + Nvidia proprietary Bayer ISP format - one channel in one surface with interleaved BGGR ordering and mapped to opaque integer datatype. - .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperationCapability.cudaAtomicCapabilityScalar128 + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerIspGRBG - .. autoattribute:: cuda.bindings.runtime.cudaAtomicOperationCapability.cudaAtomicCapabilityVector32x4 + Nvidia proprietary Bayer ISP format - one channel in one surface with interleaved GRBG ordering and mapped to opaque integer datatype. -.. autoclass:: cuda.bindings.runtime.cudaExternalMemoryHandleType - .. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueFd + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerIspGBRG - Handle is an opaque file descriptor + Nvidia proprietary Bayer ISP format - one channel in one surface with interleaved GBRG ordering and mapped to opaque integer datatype. - .. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32 + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerBCCR - Handle is an opaque shared NT handle + Bayer format - one channel in one surface with interleaved BCCR ordering. - .. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32Kmt + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerRCCB - Handle is an opaque, globally shared handle + Bayer format - one channel in one surface with interleaved RCCB ordering. - .. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Heap + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerCRBC - Handle is a D3D12 heap object + Bayer format - one channel in one surface with interleaved CRBC ordering. - .. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Resource + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayerCBRC - Handle is a D3D12 committed resource + Bayer format - one channel in one surface with interleaved CBRC ordering. - .. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11Resource + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer10CCCC - Handle is a shared NT handle to a D3D11 resource + Bayer10 format - one channel in one surface with interleaved CCCC ordering. Out of 16 bits, 10 bits used 6 bits No-op. - .. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11ResourceKmt + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer12BCCR - Handle is a globally shared handle to a D3D11 resource + Bayer12 format - one channel in one surface with interleaved BCCR ordering. Out of 16 bits, 12 bits used 4 bits No-op. - .. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeNvSciBuf + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer12RCCB - Handle is an NvSciBuf object + Bayer12 format - one channel in one surface with interleaved RCCB ordering. Out of 16 bits, 12 bits used 4 bits No-op. -.. autoclass:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType - .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueFd + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer12CRBC - Handle is an opaque file descriptor + Bayer12 format - one channel in one surface with interleaved CRBC ordering. Out of 16 bits, 12 bits used 4 bits No-op. - .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32 + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer12CBRC - Handle is an opaque shared NT handle + Bayer12 format - one channel in one surface with interleaved CBRC ordering. Out of 16 bits, 12 bits used 4 bits No-op. - .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatBayer12CCCC - Handle is an opaque, globally shared handle + Bayer12 format - one channel in one surface with interleaved CCCC ordering. Out of 16 bits, 12 bits used 4 bits No-op. - .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D12Fence + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY - Handle is a shared NT handle referencing a D3D12 fence object + Color format for single Y plane. - .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D11Fence + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV420SemiPlanar_2020 - Handle is a shared NT handle referencing a D3D11 fence object + Y, UV in two surfaces (UV as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. - .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeNvSciSync + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU420SemiPlanar_2020 - Opaque handle to NvSciSync Object + Y, VU in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. - .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutex + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV420Planar_2020 - Handle is a shared NT handle referencing a D3D11 keyed mutex object + Y, U, V in three surfaces, each in a separate surface, U/V width = 1/2 Y width, U/V height = 1/2 Y height. - .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutexKmt + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU420Planar_2020 - Handle is a shared KMT handle referencing a D3D11 keyed mutex object + Y, V, U in three surfaces, each in a separate surface, U/V width = 1/2 Y width, U/V height = 1/2 Y height. - .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV420SemiPlanar_709 - Handle is an opaque handle file descriptor referencing a timeline semaphore + Y, UV in two surfaces (UV as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. - .. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32 + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU420SemiPlanar_709 - Handle is an opaque handle file descriptor referencing a timeline semaphore + Y, VU in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. -.. autoclass:: cuda.bindings.runtime.cudaDevSmResourceGroup_flags - .. autoattribute:: cuda.bindings.runtime.cudaDevSmResourceGroup_flags.cudaDevSmResourceGroupDefault + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUV420Planar_709 - .. autoattribute:: cuda.bindings.runtime.cudaDevSmResourceGroup_flags.cudaDevSmResourceGroupBackfill + Y, U, V in three surfaces, each in a separate surface, U/V width = 1/2 Y width, U/V height = 1/2 Y height. - Lets smCount be a non-multiple of minCoscheduledCount, filling the difference with other SMs. + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVU420Planar_709 -.. autoclass:: cuda.bindings.runtime.cudaDevSmResourceSplitByCount_flags - .. autoattribute:: cuda.bindings.runtime.cudaDevSmResourceSplitByCount_flags.cudaDevSmResourceSplitIgnoreSmCoscheduling + Y, V, U in three surfaces, each in a separate surface, U/V width = 1/2 Y width, U/V height = 1/2 Y height. - .. autoattribute:: cuda.bindings.runtime.cudaDevSmResourceSplitByCount_flags.cudaDevSmResourceSplitMaxPotentialClusterSize + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_420SemiPlanar_709 -.. autoclass:: cuda.bindings.runtime.cudaDevResourceType - .. autoattribute:: cuda.bindings.runtime.cudaDevResourceType.cudaDevResourceTypeInvalid + Y10, V10U10 in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. - .. autoattribute:: cuda.bindings.runtime.cudaDevResourceType.cudaDevResourceTypeSm + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_420SemiPlanar_2020 - Streaming multiprocessors related information + Y10, V10U10 in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. - .. autoattribute:: cuda.bindings.runtime.cudaDevResourceType.cudaDevResourceTypeWorkqueueConfig + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_422SemiPlanar_2020 - Workqueue configuration related information + Y10, V10U10 in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = Y height. - .. autoattribute:: cuda.bindings.runtime.cudaDevResourceType.cudaDevResourceTypeWorkqueue + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_422SemiPlanar - Pre-existing workqueue related information + Y10, V10U10 in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = Y height. -.. autoclass:: cuda.bindings.runtime.cudaDevWorkqueueConfigScope - .. autoattribute:: cuda.bindings.runtime.cudaDevWorkqueueConfigScope.cudaDevWorkqueueConfigScopeDeviceCtx + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_422SemiPlanar_709 - Use all shared workqueue resources on the device. Default driver behaviour. + Y10, V10U10 in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = Y height. - .. autoattribute:: cuda.bindings.runtime.cudaDevWorkqueueConfigScope.cudaDevWorkqueueConfigScopeGreenCtxBalanced + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY_ER - When possible, use non-overlapping workqueue resources with other balanced green contexts. + Extended Range Color format for single Y plane. -.. autoclass:: cuda.bindings.runtime.cudaJitOption - .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitMaxRegisters + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY_709_ER - Max number of registers that a thread may use. + Extended Range Color format for single Y plane. - Option type: unsigned int - Applies to: compiler only + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10_ER - .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitThreadsPerBlock + Extended Range Color format for single Y10 plane. - IN: Specifies minimum number of threads per block to target compilation for + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10_709_ER - OUT: Returns the number of threads the compiler actually targeted. This restricts the resource utilization of the compiler (e.g. max registers) such that a block with the given number of threads should be able to launch based on register limitations. Note, this option does not currently take into account any other resource limitations, such as shared memory utilization. - Option type: unsigned int + Extended Range Color format for single Y10 plane. - Applies to: compiler only + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY12_ER - .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitWallTime + Extended Range Color format for single Y12 plane. - Overwrites the option value with the total wall clock time, in milliseconds, spent in the compiler and linker - Option type: float + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY12_709_ER - Applies to: compiler and linker + Extended Range Color format for single Y12 plane. - .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitInfoLogBuffer + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYUVA - Pointer to a buffer in which to print any log messages that are informational in nature (the buffer size is specified via option :py:obj:`~.cudaJitInfoLogBufferSizeBytes`) - Option type: char * + Y, U, V, A four channels in one surface, interleaved as AVUY. - Applies to: compiler and linker + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatYVYU - .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitInfoLogBufferSizeBytes + Y, U, V in one surface, interleaved as YVYU in one channel. - IN: Log buffer size in bytes. Log messages will be capped at this size (including null terminator) - OUT: Amount of log buffer filled with messages + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatVYUY - Option type: unsigned int - Applies to: compiler and linker + Y, U, V in one surface, interleaved as VYUY in one channel. - .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitErrorLogBuffer + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_420SemiPlanar_ER - Pointer to a buffer in which to print any log messages that reflect errors (the buffer size is specified via option :py:obj:`~.cudaJitErrorLogBufferSizeBytes`) + Extended Range Y10, V10U10 in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. - Option type: char * - Applies to: compiler and linker + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER - .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitErrorLogBufferSizeBytes + Extended Range Y10, V10U10 in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. - IN: Log buffer size in bytes. Log messages will be capped at this size (including null terminator) + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_444SemiPlanar_ER - OUT: Amount of log buffer filled with messages - Option type: unsigned int + Extended Range Y10, V10U10 in two surfaces (VU as one surface) U/V width = Y width, U/V height = Y height. - Applies to: compiler and linker + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER - .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitOptimizationLevel + Extended Range Y10, V10U10 in two surfaces (VU as one surface) U/V width = Y width, U/V height = Y height. - Level of optimizations to apply to generated code (0 - 4), with 4 being the default and highest level of optimizations. - Option type: unsigned int + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY12V12U12_420SemiPlanar_ER - Applies to: compiler only + Extended Range Y12, V12U12 in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. - .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitFallbackStrategy + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER - Specifies choice of fallback strategy if matching cubin is not found. Choice is based on supplied :py:obj:`~.cudaJit_Fallback`. Option type: unsigned int for enumerated type :py:obj:`~.cudaJit_Fallback` - Applies to: compiler only + Extended Range Y12, V12U12 in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. - .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitGenerateDebugInfo + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY12V12U12_444SemiPlanar_ER - Specifies whether to create debug information in output (-g) (0: false, default) + Extended Range Y12, V12U12 in two surfaces (VU as one surface) U/V width = Y width, U/V height = Y height. - Option type: int - Applies to: compiler and linker + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER - .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitLogVerbose + Extended Range Y12, V12U12 in two surfaces (VU as one surface) U/V width = Y width, U/V height = Y height. - Generate verbose log messages (0: false, default) + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatUYVY709 - Option type: int - Applies to: compiler and linker + Y, U, V in one surface, interleaved as UYVY in one channel. - .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitGenerateLineInfo + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatUYVY709_ER - Generate line number information (-lineinfo) (0: false, default) + Extended Range Y, U, V in one surface, interleaved as UYVY in one channel. - Option type: int - Applies to: compiler only + .. autoattribute:: cuda.bindings.runtime.cudaEglColorFormat.cudaEglColorFormatUYVY2020 - .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitCacheMode + Y, U, V in one surface, interleaved as UYVY in one channel. +.. autoclass:: cuda.bindings.runtime.cudaDevResourceDesc_t +.. autoclass:: cuda.bindings.runtime.cudaExecutionContext_t +.. autoclass:: cuda.bindings.runtime.cudaArray_t +.. autoclass:: cuda.bindings.runtime.cudaArray_const_t +.. autoclass:: cuda.bindings.runtime.cudaMipmappedArray_t +.. autoclass:: cuda.bindings.runtime.cudaMipmappedArray_const_t +.. autoclass:: cuda.bindings.runtime.cudaHostFn_t +.. autoclass:: cuda.bindings.runtime.CUuuid +.. autoclass:: cuda.bindings.runtime.cudaUUID_t +.. autoclass:: cuda.bindings.runtime.cudaIpcEventHandle_t +.. autoclass:: cuda.bindings.runtime.cudaIpcMemHandle_t +.. autoclass:: cuda.bindings.runtime.cudaMemFabricHandle_t +.. autoclass:: cuda.bindings.runtime.cudaDevSmResourceGroupParams +.. autoclass:: cuda.bindings.runtime.cudaDevResource +.. autoclass:: cuda.bindings.runtime.cudaStream_t +.. autoclass:: cuda.bindings.runtime.cudaEvent_t +.. autoclass:: cuda.bindings.runtime.cudaGraphicsResource_t +.. autoclass:: cuda.bindings.runtime.cudaExternalMemory_t +.. autoclass:: cuda.bindings.runtime.cudaExternalSemaphore_t +.. autoclass:: cuda.bindings.runtime.cudaGraph_t +.. autoclass:: cuda.bindings.runtime.cudaGraphNode_t +.. autoclass:: cuda.bindings.runtime.cudaUserObject_t +.. autoclass:: cuda.bindings.runtime.cudaGraphConditionalHandle +.. autoclass:: cuda.bindings.runtime.cudaFunction_t +.. autoclass:: cuda.bindings.runtime.cudaKernel_t +.. autoclass:: cuda.bindings.runtime.cudaLibrary_t +.. autoclass:: cuda.bindings.runtime.cudaMemPool_t +.. autoclass:: cuda.bindings.runtime.cudaGraphEdgeData +.. autoclass:: cuda.bindings.runtime.cudaGraphExec_t +.. autoclass:: cuda.bindings.runtime.cudaGraphInstantiateParams +.. autoclass:: cuda.bindings.runtime.cudaGraphExecUpdateResultInfo +.. autoclass:: cuda.bindings.runtime.cudaGraphDeviceNode_t +.. autoclass:: cuda.bindings.runtime.cudaLaunchMemSyncDomainMap +.. autoclass:: cuda.bindings.runtime.cudaLaunchAttributeValue +.. autoclass:: cuda.bindings.runtime.cudaLaunchAttribute +.. 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 +.. autoclass:: cuda.bindings.runtime.cudaEglPlaneDesc +.. autoclass:: cuda.bindings.runtime.cudaEglFrame +.. autoclass:: cuda.bindings.runtime.cudaEglStreamConnection +.. autoattribute:: cuda.bindings.runtime.cudaHostAllocDefault - Specifies whether to enable caching explicitly (-dlcm) + Default page-locked allocation flag - Choice is based on supplied :py:obj:`~.cudaJit_CacheMode`. +.. autoattribute:: cuda.bindings.runtime.cudaHostAllocPortable - Option type: unsigned int for enumerated type :py:obj:`~.cudaJit_CacheMode` + Pinned memory accessible by all CUDA contexts - Applies to: compiler only +.. autoattribute:: cuda.bindings.runtime.cudaHostAllocMapped + Map allocation into device space - .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitPositionIndependentCode +.. autoattribute:: cuda.bindings.runtime.cudaHostAllocWriteCombined + Write-combined memory - Generate position independent code (0: false) +.. autoattribute:: cuda.bindings.runtime.cudaHostRegisterDefault - Option type: int + Default host memory registration flag - Applies to: compiler only +.. autoattribute:: cuda.bindings.runtime.cudaHostRegisterPortable + Pinned memory accessible by all CUDA contexts - .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitMinCtaPerSm +.. autoattribute:: cuda.bindings.runtime.cudaHostRegisterMapped + Map registered memory into device space - This option hints to the JIT compiler the minimum number of CTAs from the kernel’s grid to be mapped to a SM. This option is ignored when used together with :py:obj:`~.cudaJitMaxRegisters` or :py:obj:`~.cudaJitThreadsPerBlock`. Optimizations based on this option need :py:obj:`~.cudaJitMaxThreadsPerBlock` to be specified as well. For kernels already using PTX directive .minnctapersm, this option will be ignored by default. Use :py:obj:`~.cudaJitOverrideDirectiveValues` to let this option take precedence over the PTX directive. Option type: unsigned int +.. autoattribute:: cuda.bindings.runtime.cudaHostRegisterIoMemory - Applies to: compiler only + Memory-mapped I/O space +.. autoattribute:: cuda.bindings.runtime.cudaHostRegisterReadOnly - .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitMaxThreadsPerBlock + Memory-mapped read-only +.. autoattribute:: cuda.bindings.runtime.cudaPeerAccessDefault - Maximum number threads in a thread block, computed as the product of the maximum extent specifed for each dimension of the block. This limit is guaranteed not to be exeeded in any invocation of the kernel. Exceeding the the maximum number of threads results in runtime error or kernel launch failure. For kernels already using PTX directive .maxntid, this option will be ignored by default. Use :py:obj:`~.cudaJitOverrideDirectiveValues` to let this option take precedence over the PTX directive. Option type: int + Default peer addressing enable flag - Applies to: compiler only +.. autoattribute:: cuda.bindings.runtime.cudaStreamDefault + Default stream flag - .. autoattribute:: cuda.bindings.runtime.cudaJitOption.cudaJitOverrideDirectiveValues +.. autoattribute:: cuda.bindings.runtime.cudaStreamNonBlocking + Stream does not synchronize with stream 0 (the NULL stream) - This option lets the values specified using :py:obj:`~.cudaJitMaxRegisters`, :py:obj:`~.cudaJitThreadsPerBlock`, :py:obj:`~.cudaJitMaxThreadsPerBlock` and :py:obj:`~.cudaJitMinCtaPerSm` take precedence over any PTX directives. (0: Disable, default; 1: Enable) Option type: int +.. autoattribute:: cuda.bindings.runtime.cudaStreamLegacy - Applies to: compiler only + Legacy stream handle -.. autoclass:: cuda.bindings.runtime.cudaLibraryOption - .. autoattribute:: cuda.bindings.runtime.cudaLibraryOption.cudaLibraryHostUniversalFunctionAndDataTable + Stream handle that can be passed as a :py:obj:`~.cudaStream_t` to use an implicit stream with legacy synchronization behavior. - .. autoattribute:: cuda.bindings.runtime.cudaLibraryOption.cudaLibraryBinaryIsPreserved - Specifes that the argument `code` passed to :py:obj:`~.cudaLibraryLoadData()` will be preserved. Specifying this option will let the driver know that `code` can be accessed at any point until :py:obj:`~.cudaLibraryUnload()`. The default behavior is for the driver to allocate and maintain its own copy of `code`. Note that this is only a memory usage optimization hint and the driver can choose to ignore it if required. Specifying this option with :py:obj:`~.cudaLibraryLoadFromFile()` is invalid and will return :py:obj:`~.cudaErrorInvalidValue`. + See details of the \link_sync_behavior -.. autoclass:: cuda.bindings.runtime.cudaJit_CacheMode +.. autoattribute:: cuda.bindings.runtime.cudaStreamPerThread - .. autoattribute:: cuda.bindings.runtime.cudaJit_CacheMode.cudaJitCacheOptionNone + Per-thread stream handle - Compile with no -dlcm flag specified + Stream handle that can be passed as a :py:obj:`~.cudaStream_t` to use an implicit stream with per-thread synchronization behavior. - .. autoattribute:: cuda.bindings.runtime.cudaJit_CacheMode.cudaJitCacheOptionCG - Compile with L1 cache disabled + See details of the \link_sync_behavior +.. autoattribute:: cuda.bindings.runtime.cudaEventDefault - .. autoattribute:: cuda.bindings.runtime.cudaJit_CacheMode.cudaJitCacheOptionCA + Default event flag +.. autoattribute:: cuda.bindings.runtime.cudaEventBlockingSync - Compile with L1 cache enabled + Event uses blocking synchronization -.. autoclass:: cuda.bindings.runtime.cudaJit_Fallback +.. autoattribute:: cuda.bindings.runtime.cudaEventDisableTiming - .. autoattribute:: cuda.bindings.runtime.cudaJit_Fallback.cudaPreferPtx + Event will not record timing data +.. autoattribute:: cuda.bindings.runtime.cudaEventInterprocess - Prefer to compile ptx if exact binary match not found + Event is suitable for interprocess use. cudaEventDisableTiming must be set +.. autoattribute:: cuda.bindings.runtime.cudaEventRecordDefault - .. autoattribute:: cuda.bindings.runtime.cudaJit_Fallback.cudaPreferBinary + Default event record flag +.. autoattribute:: cuda.bindings.runtime.cudaEventRecordExternal - Prefer to fall back to compatible binary code if exact match not found + Event is captured in the graph as an external event node when performing stream capture -.. autoclass:: cuda.bindings.runtime.cudaCGScope +.. autoattribute:: cuda.bindings.runtime.cudaEventWaitDefault - .. autoattribute:: cuda.bindings.runtime.cudaCGScope.cudaCGScopeInvalid + Default event wait flag +.. autoattribute:: cuda.bindings.runtime.cudaEventWaitExternal - Invalid cooperative group scope + Event is captured in the graph as an external event node when performing stream capture +.. autoattribute:: cuda.bindings.runtime.cudaDeviceScheduleAuto - .. autoattribute:: cuda.bindings.runtime.cudaCGScope.cudaCGScopeGrid + Device flag - Automatic scheduling +.. autoattribute:: cuda.bindings.runtime.cudaDeviceScheduleSpin - Scope represented by a grid_group + Device flag - Spin default scheduling +.. autoattribute:: cuda.bindings.runtime.cudaDeviceScheduleYield - .. autoattribute:: cuda.bindings.runtime.cudaCGScope.cudaCGScopeReserved + Device flag - Yield default scheduling +.. autoattribute:: cuda.bindings.runtime.cudaDeviceScheduleBlockingSync - Reserved + Device flag - Use blocking synchronization -.. autoclass:: cuda.bindings.runtime.cudaKernelFunctionType +.. autoattribute:: cuda.bindings.runtime.cudaDeviceBlockingSync - .. autoattribute:: cuda.bindings.runtime.cudaKernelFunctionType.cudaKernelFunctionTypeUnspecified + Device flag - Use blocking synchronization + [Deprecated] - CUDA will attempt to deduce the type of the function handle +.. autoattribute:: cuda.bindings.runtime.cudaDeviceScheduleMask + Device schedule flags mask - .. autoattribute:: cuda.bindings.runtime.cudaKernelFunctionType.cudaKernelFunctionTypeDeviceEntry +.. autoattribute:: cuda.bindings.runtime.cudaDeviceMapHost + Device flag - Support mapped pinned allocations - Function handle is a device-entry function pointer(i.e. global function pointer) +.. autoattribute:: cuda.bindings.runtime.cudaDeviceLmemResizeToMax + Device flag - Keep local memory allocation after launch - .. autoattribute:: cuda.bindings.runtime.cudaKernelFunctionType.cudaKernelFunctionTypeKernel +.. autoattribute:: cuda.bindings.runtime.cudaDeviceSyncMemops + Device flag - Ensure synchronous memory operations on this context will synchronize - Function handle is a cudaKernel_t +.. autoattribute:: cuda.bindings.runtime.cudaDeviceMask + Device flags mask - .. autoattribute:: cuda.bindings.runtime.cudaKernelFunctionType.cudaKernelFunctionTypeFunction +.. autoattribute:: cuda.bindings.runtime.cudaArrayDefault + Default CUDA array allocation flag - Function handle is a cudaFunction_t +.. autoattribute:: cuda.bindings.runtime.cudaArrayLayered -.. autoclass:: cuda.bindings.runtime.cudaGraphConditionalHandleFlags + Must be set in cudaMalloc3DArray to create a layered CUDA array - .. autoattribute:: cuda.bindings.runtime.cudaGraphConditionalHandleFlags.cudaGraphCondAssignDefault +.. autoattribute:: cuda.bindings.runtime.cudaArraySurfaceLoadStore + Must be set in cudaMallocArray or cudaMalloc3DArray in order to bind surfaces to the CUDA array - Apply default handle value when graph is launched. +.. autoattribute:: cuda.bindings.runtime.cudaArrayCubemap -.. autoclass:: cuda.bindings.runtime.cudaGraphConditionalNodeType + Must be set in cudaMalloc3DArray to create a cubemap CUDA array - .. autoattribute:: cuda.bindings.runtime.cudaGraphConditionalNodeType.cudaGraphCondTypeIf +.. autoattribute:: cuda.bindings.runtime.cudaArrayTextureGather + Must be set in cudaMallocArray or cudaMalloc3DArray in order to perform texture gather operations on the CUDA array - Conditional 'if/else' Node. Body[0] executed if condition is non-zero. If `size` == 2, an optional ELSE graph is created and this is executed if the condition is zero. +.. autoattribute:: cuda.bindings.runtime.cudaArrayColorAttachment + Must be set in cudaExternalMemoryGetMappedMipmappedArray if the mipmapped array is used as a color target in a graphics API - .. autoattribute:: cuda.bindings.runtime.cudaGraphConditionalNodeType.cudaGraphCondTypeWhile +.. autoattribute:: cuda.bindings.runtime.cudaArraySparse + Must be set in cudaMallocArray, cudaMalloc3DArray or cudaMallocMipmappedArray in order to create a sparse CUDA array or CUDA mipmapped array - Conditional 'while' Node. Body executed repeatedly while condition value is non-zero. +.. autoattribute:: cuda.bindings.runtime.cudaArrayDeferredMapping + Must be set in cudaMallocArray, cudaMalloc3DArray or cudaMallocMipmappedArray in order to create a deferred mapping CUDA array or CUDA mipmapped array - .. autoattribute:: cuda.bindings.runtime.cudaGraphConditionalNodeType.cudaGraphCondTypeSwitch +.. autoattribute:: cuda.bindings.runtime.cudaIpcMemLazyEnablePeerAccess + Automatically enable peer access between remote devices as needed - Conditional 'switch' Node. Body[n] is executed once, where 'n' is the value of the condition. If the condition does not match a body index, no body is launched. +.. autoattribute:: cuda.bindings.runtime.cudaMemAttachGlobal -.. autoclass:: cuda.bindings.runtime.cudaGraphNodeType + Memory can be accessed by any stream on any device - .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeKernel +.. autoattribute:: cuda.bindings.runtime.cudaMemAttachHost + Memory cannot be accessed by any stream on any device - GPU kernel node +.. autoattribute:: cuda.bindings.runtime.cudaMemAttachSingle + Memory can only be accessed by a single stream on the associated device - .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeMemcpy +.. autoattribute:: cuda.bindings.runtime.cudaOccupancyDefault + Default behavior - Memcpy node +.. autoattribute:: cuda.bindings.runtime.cudaOccupancyDisableCachingOverride + Assume global caching is enabled and cannot be automatically turned off - .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeMemset +.. autoattribute:: cuda.bindings.runtime.cudaCpuDeviceId + Device id that represents the CPU - Memset node +.. autoattribute:: cuda.bindings.runtime.cudaInvalidDeviceId + Device id that represents an invalid device - .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeHost +.. autoattribute:: cuda.bindings.runtime.cudaInitDeviceFlagsAreValid + Tell the CUDA runtime that DeviceFlags is being set in cudaInitDevice call - Host (executable) node +.. 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 - .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeGraph +.. autoattribute:: cuda.bindings.runtime.CUDART_CB +.. autoattribute:: cuda.bindings.runtime.cudaMemPoolCreateUsageHwDecompress + This flag, if set, indicates that the memory will be used as a buffer for hardware accelerated decompression. - Node which executes an embedded graph +.. autoattribute:: cuda.bindings.runtime.CU_UUID_HAS_BEEN_DEFINED + CUDA UUID types - .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeEmpty +.. autoattribute:: cuda.bindings.runtime.CUDA_IPC_HANDLE_SIZE + CUDA IPC Handle Size - Empty (no-op) node +.. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryDedicated + Indicates that the external memory object is a dedicated resource - .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeWaitEvent +.. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreSignalSkipNvSciBufMemSync + When the /p flags parameter of :py:obj:`~.cudaExternalSemaphoreSignalParams` contains this flag, it indicates that signaling an external semaphore object should skip performing appropriate memory synchronization operations over all the external memory objects that are imported as :py:obj:`~.cudaExternalMemoryHandleTypeNvSciBuf`, which otherwise are performed by default to ensure data coherency with other importers of the same NvSciBuf memory objects. - External event wait node +.. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreWaitSkipNvSciBufMemSync + When the /p flags parameter of :py:obj:`~.cudaExternalSemaphoreWaitParams` contains this flag, it indicates that waiting an external semaphore object should skip performing appropriate memory synchronization operations over all the external memory objects that are imported as :py:obj:`~.cudaExternalMemoryHandleTypeNvSciBuf`, which otherwise are performed by default to ensure data coherency with other importers of the same NvSciBuf memory objects. - .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeEventRecord +.. autoattribute:: cuda.bindings.runtime.cudaNvSciSyncAttrSignal + When /p flags of :py:obj:`~.cudaDeviceGetNvSciSyncAttributes` is set to this, it indicates that application need signaler specific NvSciSyncAttr to be filled by :py:obj:`~.cudaDeviceGetNvSciSyncAttributes`. - External event record node +.. autoattribute:: cuda.bindings.runtime.cudaNvSciSyncAttrWait + When /p flags of :py:obj:`~.cudaDeviceGetNvSciSyncAttributes` is set to this, it indicates that application need waiter specific NvSciSyncAttr to be filled by :py:obj:`~.cudaDeviceGetNvSciSyncAttributes`. - .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeExtSemaphoreSignal +.. autoattribute:: cuda.bindings.runtime.RESOURCE_ABI_BYTES +.. autoattribute:: cuda.bindings.runtime.cudaGraphKernelNodePortDefault + This port activates when the kernel has finished executing. - External semaphore signal node +.. autoattribute:: cuda.bindings.runtime.cudaGraphKernelNodePortProgrammatic + This port activates when all blocks of the kernel have performed cudaTriggerProgrammaticLaunchCompletion() or have terminated. It must be used with edge type :py:obj:`~.cudaGraphDependencyTypeProgrammatic`. See also :py:obj:`~.cudaLaunchAttributeProgrammaticEvent`. - .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeExtSemaphoreWait +.. autoattribute:: cuda.bindings.runtime.cudaGraphKernelNodePortLaunchCompletion + This port activates when all blocks of the kernel have begun execution. See also :py:obj:`~.cudaLaunchAttributeLaunchCompletionEvent`. - External semaphore wait node +.. autoattribute:: cuda.bindings.runtime.cudaStreamAttrID +.. autoattribute:: cuda.bindings.runtime.cudaStreamAttributeAccessPolicyWindow +.. autoattribute:: cuda.bindings.runtime.cudaStreamAttributeSynchronizationPolicy +.. autoattribute:: cuda.bindings.runtime.cudaStreamAttributeMemSyncDomainMap +.. autoattribute:: cuda.bindings.runtime.cudaStreamAttributeMemSyncDomain +.. autoattribute:: cuda.bindings.runtime.cudaStreamAttributePriority +.. autoattribute:: cuda.bindings.runtime.cudaStreamAttrValue +.. autoattribute:: cuda.bindings.runtime.cudaKernelNodeAttrID +.. autoattribute:: cuda.bindings.runtime.cudaKernelNodeAttributeAccessPolicyWindow +.. autoattribute:: cuda.bindings.runtime.cudaKernelNodeAttributeCooperative +.. autoattribute:: cuda.bindings.runtime.cudaKernelNodeAttributePriority +.. autoattribute:: cuda.bindings.runtime.cudaKernelNodeAttributeClusterDimension +.. autoattribute:: cuda.bindings.runtime.cudaKernelNodeAttributeClusterSchedulingPolicyPreference +.. autoattribute:: cuda.bindings.runtime.cudaKernelNodeAttributeMemSyncDomainMap +.. 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 +.. autoattribute:: cuda.bindings.runtime.cudaSurfaceType3D +.. autoattribute:: cuda.bindings.runtime.cudaSurfaceTypeCubemap +.. autoattribute:: cuda.bindings.runtime.cudaSurfaceType1DLayered +.. autoattribute:: cuda.bindings.runtime.cudaSurfaceType2DLayered +.. autoattribute:: cuda.bindings.runtime.cudaSurfaceTypeCubemapLayered +.. autoattribute:: cuda.bindings.runtime.cudaTextureType1D +.. autoattribute:: cuda.bindings.runtime.cudaTextureType2D +.. autoattribute:: cuda.bindings.runtime.cudaTextureType3D +.. autoattribute:: cuda.bindings.runtime.cudaTextureTypeCubemap +.. autoattribute:: cuda.bindings.runtime.cudaTextureType1DLayered +.. autoattribute:: cuda.bindings.runtime.cudaTextureType2DLayered +.. autoattribute:: cuda.bindings.runtime.cudaTextureTypeCubemapLayered +.. autoattribute:: cuda.bindings.runtime.CUDA_EGL_MAX_PLANES + Maximum number of planes per frame - .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeMemAlloc +Device Management +----------------- - Memory allocation node +impl_private - .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeMemFree +MANBRIEF device management functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF - Memory free node - .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeConditional +This section describes the device management functions of the CUDA runtime application programming interface. +.. autofunction:: cuda.bindings.runtime.cudaDeviceReset +.. autofunction:: cuda.bindings.runtime.cudaDeviceSynchronize +.. autofunction:: cuda.bindings.runtime.cudaDeviceSetLimit +.. autofunction:: cuda.bindings.runtime.cudaDeviceGetLimit +.. autofunction:: cuda.bindings.runtime.cudaDeviceGetTexture1DLinearMaxWidth +.. autofunction:: cuda.bindings.runtime.cudaDeviceGetCacheConfig +.. autofunction:: cuda.bindings.runtime.cudaDeviceGetStreamPriorityRange +.. autofunction:: cuda.bindings.runtime.cudaDeviceSetCacheConfig +.. autofunction:: cuda.bindings.runtime.cudaDeviceGetByPCIBusId +.. autofunction:: cuda.bindings.runtime.cudaDeviceGetPCIBusId +.. autofunction:: cuda.bindings.runtime.cudaIpcGetEventHandle +.. autofunction:: cuda.bindings.runtime.cudaIpcOpenEventHandle +.. autofunction:: cuda.bindings.runtime.cudaIpcGetMemHandle +.. autofunction:: cuda.bindings.runtime.cudaIpcOpenMemHandle +.. autofunction:: cuda.bindings.runtime.cudaIpcCloseMemHandle +.. autofunction:: cuda.bindings.runtime.cudaDeviceFlushGPUDirectRDMAWrites +.. autofunction:: cuda.bindings.runtime.cudaDeviceRegisterAsyncNotification +.. autofunction:: cuda.bindings.runtime.cudaDeviceUnregisterAsyncNotification +.. 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 +.. autofunction:: cuda.bindings.runtime.cudaGetDevice +.. autofunction:: cuda.bindings.runtime.cudaSetDeviceFlags +.. autofunction:: cuda.bindings.runtime.cudaGetDeviceFlags - Conditional node May be used to implement a conditional execution path or loop +Error Handling +-------------- - inside of a graph. The graph(s) contained within the body of the conditional node +MANBRIEF error handling functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF - can be selectively executed or iterated upon based on the value of a conditional - variable. +This section describes the error handling functions of the CUDA runtime application programming interface. +.. autofunction:: cuda.bindings.runtime.cudaGetLastError +.. autofunction:: cuda.bindings.runtime.cudaPeekAtLastError +.. autofunction:: cuda.bindings.runtime.cudaGetErrorName +.. autofunction:: cuda.bindings.runtime.cudaGetErrorString - Handles must be created in advance of creating the node +Stream Management +----------------- - using :py:obj:`~.cudaGraphConditionalHandleCreate`. +MANBRIEF stream management functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF - The following restrictions apply to graphs which contain conditional nodes: +This section describes the stream management functions of the CUDA runtime application programming interface. - The graph cannot be used in a child node. +.. autoclass:: cuda.bindings.runtime.cudaGraphRecaptureCallbackData +.. autoclass:: cuda.bindings.runtime.cudaStreamCallback_t +.. autoclass:: cuda.bindings.runtime.cudaGraphRecaptureCallback_t +.. autofunction:: cuda.bindings.runtime.cudaStreamCreate +.. autofunction:: cuda.bindings.runtime.cudaStreamCreateWithFlags +.. autofunction:: cuda.bindings.runtime.cudaStreamCreateWithPriority +.. autofunction:: cuda.bindings.runtime.cudaStreamGetPriority +.. autofunction:: cuda.bindings.runtime.cudaStreamGetFlags +.. autofunction:: cuda.bindings.runtime.cudaStreamGetId +.. autofunction:: cuda.bindings.runtime.cudaStreamGetDevice +.. autofunction:: cuda.bindings.runtime.cudaCtxResetPersistingL2Cache +.. autofunction:: cuda.bindings.runtime.cudaStreamCopyAttributes +.. autofunction:: cuda.bindings.runtime.cudaStreamGetAttribute +.. autofunction:: cuda.bindings.runtime.cudaStreamSetAttribute +.. autofunction:: cuda.bindings.runtime.cudaStreamDestroy +.. autofunction:: cuda.bindings.runtime.cudaStreamWaitEvent +.. autofunction:: cuda.bindings.runtime.cudaStreamAddCallback +.. autofunction:: cuda.bindings.runtime.cudaStreamSynchronize +.. autofunction:: cuda.bindings.runtime.cudaStreamQuery +.. autofunction:: cuda.bindings.runtime.cudaStreamAttachMemAsync +.. autofunction:: cuda.bindings.runtime.cudaStreamBeginCapture +.. autofunction:: cuda.bindings.runtime.cudaStreamBeginRecaptureToGraph +.. autofunction:: cuda.bindings.runtime.cudaStreamBeginCaptureToGraph +.. autofunction:: cuda.bindings.runtime.cudaThreadExchangeStreamCaptureMode +.. autofunction:: cuda.bindings.runtime.cudaStreamEndCapture +.. autofunction:: cuda.bindings.runtime.cudaStreamIsCapturing +.. autofunction:: cuda.bindings.runtime.cudaStreamGetCaptureInfo +.. autofunction:: cuda.bindings.runtime.cudaStreamUpdateCaptureDependencies - Only one instantiation of the graph may exist at any point in time. +Event Management +---------------- - The graph cannot be cloned. +MANBRIEF event management functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF - To set the control value, supply a default value when creating the handle and/or +This section describes the event management functions of the CUDA runtime application programming interface. - call :py:obj:`~.cudaGraphSetConditional` from device code. +.. autofunction:: cuda.bindings.runtime.cudaEventCreate +.. autofunction:: cuda.bindings.runtime.cudaEventCreateWithFlags +.. autofunction:: cuda.bindings.runtime.cudaEventRecord +.. autofunction:: cuda.bindings.runtime.cudaEventRecordWithFlags +.. autofunction:: cuda.bindings.runtime.cudaEventQuery +.. autofunction:: cuda.bindings.runtime.cudaEventSynchronize +.. autofunction:: cuda.bindings.runtime.cudaEventDestroy +.. autofunction:: cuda.bindings.runtime.cudaEventElapsedTime +External Resource Interoperability +---------------------------------- - .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeCount +MANBRIEF External resource interoperability functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF -.. autoclass:: cuda.bindings.runtime.cudaGraphChildGraphNodeOwnership - .. autoattribute:: cuda.bindings.runtime.cudaGraphChildGraphNodeOwnership.cudaGraphChildGraphOwnershipClone +This section describes the external resource interoperability functions of the CUDA runtime application programming interface. - Default behavior for a child graph node. Child graph is cloned into the parent and memory allocation/free nodes can't be present in the child graph. +.. autofunction:: cuda.bindings.runtime.cudaImportExternalMemory +.. autofunction:: cuda.bindings.runtime.cudaExternalMemoryGetMappedBuffer +.. autofunction:: cuda.bindings.runtime.cudaExternalMemoryGetMappedMipmappedArray +.. autofunction:: cuda.bindings.runtime.cudaDestroyExternalMemory +.. autofunction:: cuda.bindings.runtime.cudaImportExternalSemaphore +.. autofunction:: cuda.bindings.runtime.cudaSignalExternalSemaphoresAsync +.. autofunction:: cuda.bindings.runtime.cudaWaitExternalSemaphoresAsync +.. autofunction:: cuda.bindings.runtime.cudaDestroyExternalSemaphore +Execution Control +----------------- - .. autoattribute:: cuda.bindings.runtime.cudaGraphChildGraphNodeOwnership.cudaGraphChildGraphOwnershipMove +MANBRIEF execution control functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF - The child graph is moved to the parent. The handle to the child graph is owned by the parent and will be destroyed when the parent is destroyed. +This section describes the execution control functions of the CUDA runtime application programming interface. - The following restrictions apply to child graphs after they have been moved: Cannot be independently instantiated or destroyed; Cannot be added as a child graph of a separate parent graph; Cannot be used as an argument to cudaGraphExecUpdate; Cannot have additional memory allocation or free nodes added. +Some functions have overloaded C++ API template versions documented separately in the C++ API Routines module. - .. autoattribute:: cuda.bindings.runtime.cudaGraphChildGraphNodeOwnership.cudaGraphChildGraphOwnershipInvalid +.. autofunction:: cuda.bindings.runtime.cudaFuncSetCacheConfig +.. autofunction:: cuda.bindings.runtime.cudaFuncGetAttributes +.. autofunction:: cuda.bindings.runtime.cudaFuncSetAttribute +.. autofunction:: cuda.bindings.runtime.cudaFuncGetParamCount +.. autofunction:: cuda.bindings.runtime.cudaLaunchHostFunc +.. autofunction:: cuda.bindings.runtime.cudaLaunchHostFunc_v2 +Occupancy +--------- - Invalid ownership flag. Set when params are queried to prevent accidentally reusing the driver-owned graph object +MANBRIEF occupancy calculation functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF -.. autoclass:: cuda.bindings.runtime.cudaGraphDependencyType - .. autoattribute:: cuda.bindings.runtime.cudaGraphDependencyType.cudaGraphDependencyTypeDefault +This section describes the occupancy calculation functions of the CUDA runtime application programming interface. - This is an ordinary dependency. - .. autoattribute:: cuda.bindings.runtime.cudaGraphDependencyType.cudaGraphDependencyTypeProgrammatic +Besides the occupancy calculator functions (cudaOccupancyMaxActiveBlocksPerMultiprocessor and cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags), there are also C++ only occupancy-based launch configuration functions documented in C++ API Routines module. - This dependency type allows the downstream node to use `cudaGridDependencySynchronize()`. It may only be used between kernel nodes, and must be used with either the :py:obj:`~.cudaGraphKernelNodePortProgrammatic` or :py:obj:`~.cudaGraphKernelNodePortLaunchCompletion` outgoing port. -.. autoclass:: cuda.bindings.runtime.cudaGraphExecUpdateResult +See cudaOccupancyMaxPotentialBlockSize (C++ API), cudaOccupancyMaxPotentialBlockSize (C++ API), cudaOccupancyMaxPotentialBlockSizeVariableSMem (C++ API), cudaOccupancyMaxPotentialBlockSizeVariableSMem (C++ API) cudaOccupancyAvailableDynamicSMemPerBlock (C++ API), - .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateSuccess +.. autofunction:: cuda.bindings.runtime.cudaOccupancyMaxActiveBlocksPerMultiprocessor +.. autofunction:: cuda.bindings.runtime.cudaOccupancyAvailableDynamicSMemPerBlock +.. autofunction:: cuda.bindings.runtime.cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags +Memory Management +----------------- - The update succeeded +MANBRIEF memory management functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF - .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateError +This section describes the memory management functions of the CUDA runtime application programming interface. - The update failed for an unexpected reason which is described in the return value of the function - .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorTopologyChanged +Some functions have overloaded C++ API template versions documented separately in the C++ API Routines module. +.. autofunction:: cuda.bindings.runtime.cudaMallocManaged +.. autofunction:: cuda.bindings.runtime.cudaMalloc +.. autofunction:: cuda.bindings.runtime.cudaMallocHost +.. autofunction:: cuda.bindings.runtime.cudaMallocPitch +.. autofunction:: cuda.bindings.runtime.cudaMallocArray +.. autofunction:: cuda.bindings.runtime.cudaFree +.. autofunction:: cuda.bindings.runtime.cudaFreeHost +.. autofunction:: cuda.bindings.runtime.cudaFreeArray +.. autofunction:: cuda.bindings.runtime.cudaFreeMipmappedArray +.. autofunction:: cuda.bindings.runtime.cudaHostAlloc +.. autofunction:: cuda.bindings.runtime.cudaHostRegister +.. autofunction:: cuda.bindings.runtime.cudaHostUnregister +.. autofunction:: cuda.bindings.runtime.cudaHostGetDevicePointer +.. autofunction:: cuda.bindings.runtime.cudaHostGetFlags +.. autofunction:: cuda.bindings.runtime.cudaMalloc3D +.. autofunction:: cuda.bindings.runtime.cudaMalloc3DArray +.. autofunction:: cuda.bindings.runtime.cudaMallocMipmappedArray +.. autofunction:: cuda.bindings.runtime.cudaGetMipmappedArrayLevel +.. autofunction:: cuda.bindings.runtime.cudaMemcpy3D +.. autofunction:: cuda.bindings.runtime.cudaMemcpy3DPeer +.. autofunction:: cuda.bindings.runtime.cudaMemcpy3DAsync +.. autofunction:: cuda.bindings.runtime.cudaMemcpy3DPeerAsync +.. autofunction:: cuda.bindings.runtime.cudaMemGetInfo +.. autofunction:: cuda.bindings.runtime.cudaArrayGetInfo +.. autofunction:: cuda.bindings.runtime.cudaArrayGetPlane +.. autofunction:: cuda.bindings.runtime.cudaArrayGetMemoryRequirements +.. autofunction:: cuda.bindings.runtime.cudaMipmappedArrayGetMemoryRequirements +.. autofunction:: cuda.bindings.runtime.cudaArrayGetSparseProperties +.. autofunction:: cuda.bindings.runtime.cudaMipmappedArrayGetSparseProperties +.. autofunction:: cuda.bindings.runtime.cudaMemcpy +.. autofunction:: cuda.bindings.runtime.cudaMemcpyPeer +.. autofunction:: cuda.bindings.runtime.cudaMemcpy2D +.. autofunction:: cuda.bindings.runtime.cudaMemcpy2DToArray +.. autofunction:: cuda.bindings.runtime.cudaMemcpy2DFromArray +.. autofunction:: cuda.bindings.runtime.cudaMemcpy2DArrayToArray +.. autofunction:: cuda.bindings.runtime.cudaMemcpyAsync +.. autofunction:: cuda.bindings.runtime.cudaMemcpyPeerAsync +.. autofunction:: cuda.bindings.runtime.cudaMemcpyBatchAsync +.. autofunction:: cuda.bindings.runtime.cudaMemcpy3DBatchAsync +.. autofunction:: cuda.bindings.runtime.cudaMemcpyWithAttributesAsync +.. autofunction:: cuda.bindings.runtime.cudaMemcpy3DWithAttributesAsync +.. autofunction:: cuda.bindings.runtime.cudaMemcpy2DAsync +.. autofunction:: cuda.bindings.runtime.cudaMemcpy2DToArrayAsync +.. autofunction:: cuda.bindings.runtime.cudaMemcpy2DFromArrayAsync +.. autofunction:: cuda.bindings.runtime.cudaMemset +.. autofunction:: cuda.bindings.runtime.cudaMemset2D +.. autofunction:: cuda.bindings.runtime.cudaMemset3D +.. autofunction:: cuda.bindings.runtime.cudaMemsetAsync +.. autofunction:: cuda.bindings.runtime.cudaMemset2DAsync +.. autofunction:: cuda.bindings.runtime.cudaMemset3DAsync +.. autofunction:: cuda.bindings.runtime.cudaMemPrefetchAsync +.. autofunction:: cuda.bindings.runtime.cudaMemPrefetchBatchAsync +.. autofunction:: cuda.bindings.runtime.cudaMemDiscardBatchAsync +.. autofunction:: cuda.bindings.runtime.cudaMemDiscardAndPrefetchBatchAsync +.. autofunction:: cuda.bindings.runtime.cudaMemAdvise +.. autofunction:: cuda.bindings.runtime.cudaMemRangeGetAttribute +.. autofunction:: cuda.bindings.runtime.cudaMemRangeGetAttributes +.. autofunction:: cuda.bindings.runtime.make_cudaPitchedPtr +.. autofunction:: cuda.bindings.runtime.make_cudaPos +.. autofunction:: cuda.bindings.runtime.make_cudaExtent - The update failed because the topology changed +Stream Ordered Memory Allocator +------------------------------- +MANBRIEF Functions for performing allocation and free operations in stream order. Functions for controlling the behavior of the underlying allocator. (CURRENT_FILE) ENDMANBRIEF - .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorNodeTypeChanged - The update failed because a node type changed - .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorFunctionChanged +**overview** +The asynchronous allocator allows the user to allocate and free in stream order. All asynchronous accesses of the allocation must happen between the stream executions of the allocation and the free. If the memory is accessed outside of the promised stream order, a use before allocation / use after free error will cause undefined behavior. - The update failed because the function of a kernel node changed (CUDA driver < 11.2) +The allocator is free to reallocate the memory as long as it can guarantee that compliant memory accesses will not overlap temporally. The allocator may refer to internal stream ordering as well as inter-stream dependencies (such as CUDA events and null stream dependencies) when establishing the temporal guarantee. The allocator may also insert inter-stream dependencies to establish the temporal guarantee. - .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorParametersChanged - The update failed because the parameters changed in a way that is not supported +**Supported Platforms** - .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorNotSupported +Whether or not a device supports the integrated stream ordered memory allocator may be queried by calling cudaDeviceGetAttribute() with the device attribute cudaDevAttrMemoryPoolsSupported. +.. autofunction:: cuda.bindings.runtime.cudaMallocAsync +.. autofunction:: cuda.bindings.runtime.cudaFreeAsync +.. autofunction:: cuda.bindings.runtime.cudaMemPoolTrimTo +.. autofunction:: cuda.bindings.runtime.cudaMemPoolSetAttribute +.. autofunction:: cuda.bindings.runtime.cudaMemPoolGetAttribute +.. autofunction:: cuda.bindings.runtime.cudaMemPoolSetAccess +.. 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 +.. autofunction:: cuda.bindings.runtime.cudaMemPoolExportPointer +.. autofunction:: cuda.bindings.runtime.cudaMemPoolImportPointer - The update failed because something about the node is not supported +Unified Addressing +------------------ +MANBRIEF unified addressing functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF - .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorUnsupportedFunctionChange - The update failed because the function of a kernel node changed in an unsupported way +This section describes the unified addressing functions of the CUDA runtime application programming interface. - .. autoattribute:: cuda.bindings.runtime.cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorAttributesChanged - The update failed because the node attributes changed in a way that is not supported -.. autoclass:: cuda.bindings.runtime.cudaGraphInstantiateResult +**Overview** - .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateResult.cudaGraphInstantiateSuccess +CUDA devices can share a unified address space with the host. + For these devices there is no distinction between a device pointer and a host pointer -- the same pointer value may be used to access memory from the host program and from a kernel running on the device (with exceptions enumerated below). - Instantiation succeeded - .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateResult.cudaGraphInstantiateError - Instantiation failed for an unexpected reason which is described in the return value of the function +**Supported Platforms** +Whether or not a device supports unified addressing may be queried by calling cudaGetDeviceProperties() with the device property cudaDeviceProp::unifiedAddressing. - .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateResult.cudaGraphInstantiateInvalidStructure +Unified addressing is automatically enabled in 64-bit processes . - Instantiation failed due to invalid structure, such as cycles - .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateResult.cudaGraphInstantiateNodeOperationNotSupported +**Looking Up Information from Pointer Values** - Instantiation for device launch failed because the graph contained an unsupported operation +It is possible to look up information about the memory which backs a pointer value. For instance, one may want to know if a pointer points to host or device memory. As another example, in the case of device memory, one may want to know on which CUDA device the memory resides. These properties may be queried using the function cudaPointerGetAttributes() +Since pointers are unique, it is not necessary to specify information about the pointers specified to cudaMemcpy() and other copy functions. - .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateResult.cudaGraphInstantiateMultipleDevicesNotSupported + The copy direction cudaMemcpyDefault may be used to specify that the CUDA runtime should infer the location of the pointer from its value. - Instantiation for device launch failed due to the nodes belonging to different contexts - .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateResult.cudaGraphInstantiateConditionalHandleUnused +**Automatic Mapping of Host Allocated Host Memory** - One or more conditional handles are not associated with conditional nodes +All host memory allocated through all devices using cudaMallocHost() and cudaHostAlloc() is always directly accessible from all devices that support unified addressing. This is the case regardless of whether or not the flags cudaHostAllocPortable and cudaHostAllocMapped are specified. -.. autoclass:: cuda.bindings.runtime.cudaGraphKernelNodeField +The pointer value through which allocated host memory may be accessed in kernels on all devices that support unified addressing is the same as the pointer value through which that memory is accessed on the host. It is not necessary to call cudaHostGetDevicePointer() to get the device pointer for these allocations. - .. autoattribute:: cuda.bindings.runtime.cudaGraphKernelNodeField.cudaGraphKernelNodeFieldInvalid - Invalid field +Note that this is not the case for memory allocated using the flag cudaHostAllocWriteCombined, as discussed below. - .. autoattribute:: cuda.bindings.runtime.cudaGraphKernelNodeField.cudaGraphKernelNodeFieldGridDim - Grid dimension update +**Direct Access of Peer Memory** - .. autoattribute:: cuda.bindings.runtime.cudaGraphKernelNodeField.cudaGraphKernelNodeFieldParam +Upon enabling direct access from a device that supports unified addressing to another peer device that supports unified addressing using cudaDeviceEnablePeerAccess() all memory allocated in the peer device using cudaMalloc() and cudaMallocPitch() will immediately be accessible by the current device. The device pointer value through which any peer's memory may be accessed in the current device is the same pointer value through which that memory may be accessed from the peer device. - Kernel parameter update - .. autoattribute:: cuda.bindings.runtime.cudaGraphKernelNodeField.cudaGraphKernelNodeFieldEnabled +**Exceptions, Disjoint Addressing** - Node enable/disable +Not all memory may be accessed on devices through the same pointer value through which they are accessed on the host. These exceptions are host memory registered using cudaHostRegister() and host memory allocated using the flag cudaHostAllocWriteCombined. For these exceptions, there exists a distinct host and device address for the memory. The device address is guaranteed to not overlap any valid host pointer range and is guaranteed to have the same value across all devices that support unified addressing. -.. autoclass:: cuda.bindings.runtime.cudaGetDriverEntryPointFlags - .. autoattribute:: cuda.bindings.runtime.cudaGetDriverEntryPointFlags.cudaEnableDefault +This device address may be queried using cudaHostGetDevicePointer() when a device using unified addressing is current. Either the host or the unified device pointer value may be used to refer to this memory in cudaMemcpy() and similar functions using the cudaMemcpyDefault memory direction. - Default search mode for driver symbols. +.. autofunction:: cuda.bindings.runtime.cudaPointerGetAttributes +Peer Device Memory Access +------------------------- - .. autoattribute:: cuda.bindings.runtime.cudaGetDriverEntryPointFlags.cudaEnableLegacyStream +MANBRIEF peer device memory access functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF - Search for legacy versions of driver symbols. +This section describes the peer device memory access functions of the CUDA runtime application programming interface. - .. autoattribute:: cuda.bindings.runtime.cudaGetDriverEntryPointFlags.cudaEnablePerThreadDefaultStream +.. autofunction:: cuda.bindings.runtime.cudaDeviceCanAccessPeer +.. autofunction:: cuda.bindings.runtime.cudaDeviceEnablePeerAccess +.. autofunction:: cuda.bindings.runtime.cudaDeviceDisablePeerAccess +OpenGL Interoperability +----------------------- - Search for per-thread versions of driver symbols. +impl_private -.. autoclass:: cuda.bindings.runtime.cudaDriverEntryPointQueryResult - .. autoattribute:: cuda.bindings.runtime.cudaDriverEntryPointQueryResult.cudaDriverEntryPointSuccess +This section describes the OpenGL interoperability functions of the CUDA runtime application programming interface. Note that mapping of OpenGL resources is performed with the graphics API agnostic, resource mapping interface described in Graphics Interopability. - Search for symbol found a match +.. autoclass:: cuda.bindings.runtime.cudaGLDeviceList + .. autoattribute:: cuda.bindings.runtime.cudaGLDeviceList.cudaGLDeviceListAll - .. autoattribute:: cuda.bindings.runtime.cudaDriverEntryPointQueryResult.cudaDriverEntryPointSymbolNotFound + The CUDA devices for all GPUs used by the current OpenGL context - Search for symbol was not found + .. autoattribute:: cuda.bindings.runtime.cudaGLDeviceList.cudaGLDeviceListCurrentFrame - .. autoattribute:: cuda.bindings.runtime.cudaDriverEntryPointQueryResult.cudaDriverEntryPointVersionNotSufficent + The CUDA devices for the GPUs used by the current OpenGL context in its currently rendering frame - Search for symbol was found but version wasn't great enough -.. autoclass:: cuda.bindings.runtime.cudaGraphDebugDotFlags + .. autoattribute:: cuda.bindings.runtime.cudaGLDeviceList.cudaGLDeviceListNextFrame - .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsVerbose + The CUDA devices for the GPUs to be used by the current OpenGL context in the next frame - Output all debug data as if every debug flag is enabled +.. autofunction:: cuda.bindings.runtime.cudaGLGetDevices +.. autofunction:: cuda.bindings.runtime.cudaGraphicsGLRegisterImage +.. autofunction:: cuda.bindings.runtime.cudaGraphicsGLRegisterBuffer +Direct3D 9 Interoperability +--------------------------- - .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsKernelNodeParams - Adds :py:obj:`~.cudaKernelNodeParams` to output +Direct3D 10 Interoperability +---------------------------- - .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsMemcpyNodeParams - Adds :py:obj:`~.cudaMemcpy3DParms` to output +Direct3D 11 Interoperability +---------------------------- - .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsMemsetNodeParams - Adds :py:obj:`~.cudaMemsetParams` to output +VDPAU Interoperability +---------------------- - .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsHostNodeParams +This section describes the VDPAU interoperability functions of the CUDA runtime application programming interface. +.. autofunction:: cuda.bindings.runtime.cudaVDPAUGetDevice +.. autofunction:: cuda.bindings.runtime.cudaVDPAUSetVDPAUDevice +.. autofunction:: cuda.bindings.runtime.cudaGraphicsVDPAURegisterVideoSurface +.. autofunction:: cuda.bindings.runtime.cudaGraphicsVDPAURegisterOutputSurface - Adds :py:obj:`~.cudaHostNodeParams` to output +EGL Interoperability +-------------------- +This section describes the EGL interoperability functions of the CUDA runtime application programming interface. - .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsEventNodeParams +.. autofunction:: cuda.bindings.runtime.cudaGraphicsEGLRegisterImage +.. autofunction:: cuda.bindings.runtime.cudaEGLStreamConsumerConnect +.. autofunction:: cuda.bindings.runtime.cudaEGLStreamConsumerConnectWithFlags +.. autofunction:: cuda.bindings.runtime.cudaEGLStreamConsumerDisconnect +.. autofunction:: cuda.bindings.runtime.cudaEGLStreamConsumerAcquireFrame +.. autofunction:: cuda.bindings.runtime.cudaEGLStreamConsumerReleaseFrame +.. autofunction:: cuda.bindings.runtime.cudaEGLStreamProducerConnect +.. autofunction:: cuda.bindings.runtime.cudaEGLStreamProducerDisconnect +.. autofunction:: cuda.bindings.runtime.cudaEGLStreamProducerPresentFrame +.. autofunction:: cuda.bindings.runtime.cudaEGLStreamProducerReturnFrame +.. autofunction:: cuda.bindings.runtime.cudaGraphicsResourceGetMappedEglFrame +.. autofunction:: cuda.bindings.runtime.cudaEventCreateFromEGLSync +Graphics Interoperability +------------------------- - Adds cudaEvent_t handle from record and wait nodes to output +MANBRIEF graphics interoperability functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF - .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsExtSemasSignalNodeParams +This section describes the graphics interoperability functions of the CUDA runtime application programming interface. - Adds :py:obj:`~.cudaExternalSemaphoreSignalNodeParams` values to output +.. autofunction:: cuda.bindings.runtime.cudaGraphicsUnregisterResource +.. autofunction:: cuda.bindings.runtime.cudaGraphicsResourceSetMapFlags +.. autofunction:: cuda.bindings.runtime.cudaGraphicsMapResources +.. autofunction:: cuda.bindings.runtime.cudaGraphicsUnmapResources +.. autofunction:: cuda.bindings.runtime.cudaGraphicsResourceGetMappedPointer +.. autofunction:: cuda.bindings.runtime.cudaGraphicsSubResourceGetMappedArray +.. autofunction:: cuda.bindings.runtime.cudaGraphicsResourceGetMappedMipmappedArray +Texture Object Management +------------------------- - .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsExtSemasWaitNodeParams +MANBRIEF texture object management functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF - Adds :py:obj:`~.cudaExternalSemaphoreWaitNodeParams` to output +This section describes the low level texture object management functions of the CUDA runtime application programming interface. The texture object API is only supported on devices of compute capability 3.0 or higher. - .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsKernelNodeAttributes +.. autofunction:: cuda.bindings.runtime.cudaGetChannelDesc +.. autofunction:: cuda.bindings.runtime.cudaCreateChannelDesc +.. autofunction:: cuda.bindings.runtime.cudaCreateTextureObject +.. autofunction:: cuda.bindings.runtime.cudaDestroyTextureObject +.. autofunction:: cuda.bindings.runtime.cudaGetTextureObjectResourceDesc +.. autofunction:: cuda.bindings.runtime.cudaGetTextureObjectTextureDesc +.. autofunction:: cuda.bindings.runtime.cudaGetTextureObjectResourceViewDesc +Surface Object Management +------------------------- - Adds cudaKernelNodeAttrID values to output +MANBRIEF surface object management functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF - .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsHandles +This section describes the low level texture object management functions of the CUDA runtime application programming interface. The surface object API is only supported on devices of compute capability 3.0 or higher. - Adds node handles and every kernel function handle to output +.. autofunction:: cuda.bindings.runtime.cudaCreateSurfaceObject +.. autofunction:: cuda.bindings.runtime.cudaDestroySurfaceObject +.. autofunction:: cuda.bindings.runtime.cudaGetSurfaceObjectResourceDesc +Version Management +------------------ - .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsConditionalNodeParams - Adds :py:obj:`~.cudaConditionalNodeParams` to output +.. autofunction:: cuda.bindings.runtime.cudaDriverGetVersion +.. autofunction:: cuda.bindings.runtime.cudaRuntimeGetVersion +.. autofunction:: cuda.bindings.runtime.getLocalRuntimeVersion -.. autoclass:: cuda.bindings.runtime.cudaGraphInstantiateFlags +Error Log Management Functions +------------------------------ - .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateFlags.cudaGraphInstantiateFlagAutoFreeOnLaunch +MANBRIEF error log management interface for the CUDA Runtime and Driver (CURRENT_FILE) ENDMANBRIEF - Automatically free memory allocated in a graph before relaunching. +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. - .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateFlags.cudaGraphInstantiateFlagUpload +.. 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 +---------------- - Automatically upload the graph after instantiation. Only supported by +MANBRIEF graph management functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF - :py:obj:`~.cudaGraphInstantiateWithParams`. The upload will be performed using the - stream provided in `instantiateParams`. +This section describes the graph management functions of CUDA runtime application programming interface. - .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateFlags.cudaGraphInstantiateFlagDeviceLaunch +.. autofunction:: cuda.bindings.runtime.cudaGraphCreate +.. autofunction:: cuda.bindings.runtime.cudaGraphAddKernelNode +.. autofunction:: cuda.bindings.runtime.cudaGraphKernelNodeGetParams +.. autofunction:: cuda.bindings.runtime.cudaGraphKernelNodeSetParams +.. autofunction:: cuda.bindings.runtime.cudaGraphKernelNodeCopyAttributes +.. autofunction:: cuda.bindings.runtime.cudaGraphKernelNodeGetAttribute +.. autofunction:: cuda.bindings.runtime.cudaGraphKernelNodeSetAttribute +.. autofunction:: cuda.bindings.runtime.cudaGraphAddMemcpyNode +.. autofunction:: cuda.bindings.runtime.cudaGraphAddMemcpyNode1D +.. autofunction:: cuda.bindings.runtime.cudaGraphMemcpyNodeGetParams +.. autofunction:: cuda.bindings.runtime.cudaGraphMemcpyNodeSetParams +.. autofunction:: cuda.bindings.runtime.cudaGraphMemcpyNodeSetParams1D +.. autofunction:: cuda.bindings.runtime.cudaGraphAddMemsetNode +.. autofunction:: cuda.bindings.runtime.cudaGraphMemsetNodeGetParams +.. autofunction:: cuda.bindings.runtime.cudaGraphMemsetNodeSetParams +.. autofunction:: cuda.bindings.runtime.cudaGraphAddHostNode +.. autofunction:: cuda.bindings.runtime.cudaGraphHostNodeGetParams +.. autofunction:: cuda.bindings.runtime.cudaGraphHostNodeSetParams +.. autofunction:: cuda.bindings.runtime.cudaGraphAddChildGraphNode +.. autofunction:: cuda.bindings.runtime.cudaGraphChildGraphNodeGetGraph +.. autofunction:: cuda.bindings.runtime.cudaGraphAddEmptyNode +.. autofunction:: cuda.bindings.runtime.cudaGraphAddEventRecordNode +.. autofunction:: cuda.bindings.runtime.cudaGraphEventRecordNodeGetEvent +.. autofunction:: cuda.bindings.runtime.cudaGraphEventRecordNodeSetEvent +.. autofunction:: cuda.bindings.runtime.cudaGraphAddEventWaitNode +.. autofunction:: cuda.bindings.runtime.cudaGraphEventWaitNodeGetEvent +.. autofunction:: cuda.bindings.runtime.cudaGraphEventWaitNodeSetEvent +.. autofunction:: cuda.bindings.runtime.cudaGraphAddExternalSemaphoresSignalNode +.. autofunction:: cuda.bindings.runtime.cudaGraphExternalSemaphoresSignalNodeGetParams +.. autofunction:: cuda.bindings.runtime.cudaGraphExternalSemaphoresSignalNodeSetParams +.. autofunction:: cuda.bindings.runtime.cudaGraphAddExternalSemaphoresWaitNode +.. autofunction:: cuda.bindings.runtime.cudaGraphExternalSemaphoresWaitNodeGetParams +.. autofunction:: cuda.bindings.runtime.cudaGraphExternalSemaphoresWaitNodeSetParams +.. autofunction:: cuda.bindings.runtime.cudaGraphAddMemAllocNode +.. autofunction:: cuda.bindings.runtime.cudaGraphMemAllocNodeGetParams +.. autofunction:: cuda.bindings.runtime.cudaGraphAddMemFreeNode +.. autofunction:: cuda.bindings.runtime.cudaGraphMemFreeNodeGetParams +.. autofunction:: cuda.bindings.runtime.cudaDeviceGraphMemTrim +.. autofunction:: cuda.bindings.runtime.cudaDeviceGetGraphMemAttribute +.. autofunction:: cuda.bindings.runtime.cudaDeviceSetGraphMemAttribute +.. autofunction:: cuda.bindings.runtime.cudaGraphClone +.. autofunction:: cuda.bindings.runtime.cudaGraphNodeFindInClone +.. autofunction:: cuda.bindings.runtime.cudaGraphNodeGetType +.. autofunction:: cuda.bindings.runtime.cudaGraphNodeGetContainingGraph +.. autofunction:: cuda.bindings.runtime.cudaGraphNodeGetLocalId +.. autofunction:: cuda.bindings.runtime.cudaGraphNodeGetToolsId +.. autofunction:: cuda.bindings.runtime.cudaGraphGetId +.. autofunction:: cuda.bindings.runtime.cudaGraphExecGetId +.. autofunction:: cuda.bindings.runtime.cudaGraphGetNodes +.. autofunction:: cuda.bindings.runtime.cudaGraphGetRootNodes +.. autofunction:: cuda.bindings.runtime.cudaGraphGetEdges +.. autofunction:: cuda.bindings.runtime.cudaGraphNodeGetDependencies +.. autofunction:: cuda.bindings.runtime.cudaGraphNodeGetDependentNodes +.. autofunction:: cuda.bindings.runtime.cudaGraphAddDependencies +.. autofunction:: cuda.bindings.runtime.cudaGraphRemoveDependencies +.. autofunction:: cuda.bindings.runtime.cudaGraphDestroyNode +.. autofunction:: cuda.bindings.runtime.cudaGraphInstantiate +.. autofunction:: cuda.bindings.runtime.cudaGraphInstantiateWithFlags +.. autofunction:: cuda.bindings.runtime.cudaGraphInstantiateWithParams +.. autofunction:: cuda.bindings.runtime.cudaGraphExecGetFlags +.. autofunction:: cuda.bindings.runtime.cudaGraphExecKernelNodeSetParams +.. autofunction:: cuda.bindings.runtime.cudaGraphExecMemcpyNodeSetParams +.. autofunction:: cuda.bindings.runtime.cudaGraphExecMemcpyNodeSetParams1D +.. autofunction:: cuda.bindings.runtime.cudaGraphExecMemsetNodeSetParams +.. autofunction:: cuda.bindings.runtime.cudaGraphExecHostNodeSetParams +.. autofunction:: cuda.bindings.runtime.cudaGraphExecChildGraphNodeSetParams +.. autofunction:: cuda.bindings.runtime.cudaGraphExecEventRecordNodeSetEvent +.. autofunction:: cuda.bindings.runtime.cudaGraphExecEventWaitNodeSetEvent +.. autofunction:: cuda.bindings.runtime.cudaGraphExecExternalSemaphoresSignalNodeSetParams +.. autofunction:: cuda.bindings.runtime.cudaGraphExecExternalSemaphoresWaitNodeSetParams +.. autofunction:: cuda.bindings.runtime.cudaGraphNodeSetEnabled +.. autofunction:: cuda.bindings.runtime.cudaGraphNodeGetEnabled +.. autofunction:: cuda.bindings.runtime.cudaGraphExecUpdate +.. autofunction:: cuda.bindings.runtime.cudaGraphUpload +.. autofunction:: cuda.bindings.runtime.cudaGraphLaunch +.. autofunction:: cuda.bindings.runtime.cudaGraphExecDestroy +.. autofunction:: cuda.bindings.runtime.cudaGraphDestroy +.. autofunction:: cuda.bindings.runtime.cudaGraphDebugDotPrint +.. autofunction:: cuda.bindings.runtime.cudaUserObjectCreate +.. autofunction:: cuda.bindings.runtime.cudaUserObjectRetain +.. autofunction:: cuda.bindings.runtime.cudaUserObjectRelease +.. autofunction:: cuda.bindings.runtime.cudaGraphRetainUserObject +.. autofunction:: cuda.bindings.runtime.cudaGraphReleaseUserObject +.. autofunction:: cuda.bindings.runtime.cudaGraphAddNode +.. autofunction:: cuda.bindings.runtime.cudaGraphNodeSetParams +.. autofunction:: cuda.bindings.runtime.cudaGraphNodeGetParams +.. autofunction:: cuda.bindings.runtime.cudaGraphExecNodeSetParams +.. autofunction:: cuda.bindings.runtime.cudaGraphConditionalHandleCreate +.. autofunction:: cuda.bindings.runtime.cudaGraphConditionalHandleCreate_v2 +Driver Entry Point Access +------------------------- - Instantiate the graph to be launchable from the device. This flag can only +MANBRIEF driver entry point access functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF - be used on platforms which support unified addressing. This flag cannot be - used in conjunction with cudaGraphInstantiateFlagAutoFreeOnLaunch. +This section describes the driver entry point access functions of CUDA runtime application programming interface. - .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateFlags.cudaGraphInstantiateFlagUseNodePriority +.. autofunction:: cuda.bindings.runtime.cudaGetDriverEntryPoint +.. autofunction:: cuda.bindings.runtime.cudaGetDriverEntryPointByVersion +Library Management +------------------ - Run the graph using the per-node priority attributes rather than the priority of the stream it is launched into. +MANBRIEF library management functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF -.. autoclass:: cuda.bindings.runtime.cudaLaunchMemSyncDomain - .. autoattribute:: cuda.bindings.runtime.cudaLaunchMemSyncDomain.cudaLaunchMemSyncDomainDefault +This section describes the library management functions of the CUDA runtime application programming interface. - Launch kernels in the default domain +.. autofunction:: cuda.bindings.runtime.cudaLibraryLoadData +.. autofunction:: cuda.bindings.runtime.cudaLibraryLoadFromFile +.. autofunction:: cuda.bindings.runtime.cudaLibraryUnload +.. autofunction:: cuda.bindings.runtime.cudaLibraryGetKernel +.. autofunction:: cuda.bindings.runtime.cudaLibraryGetGlobal +.. autofunction:: cuda.bindings.runtime.cudaLibraryGetManaged +.. autofunction:: cuda.bindings.runtime.cudaLibraryGetUnifiedFunction +.. autofunction:: cuda.bindings.runtime.cudaLibraryGetKernelCount +.. autofunction:: cuda.bindings.runtime.cudaLibraryEnumerateKernels +.. autofunction:: cuda.bindings.runtime.cudaKernelSetAttributeForDevice +Execution Context Management +---------------------------- - .. autoattribute:: cuda.bindings.runtime.cudaLaunchMemSyncDomain.cudaLaunchMemSyncDomainRemote +MANBRIEF execution context management functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF - Launch kernels in the remote domain -.. autoclass:: cuda.bindings.runtime.cudaLaunchAttributePortableClusterMode +This section describes the execution context management functions of the CUDA runtime application programming interface. - .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributePortableClusterMode.cudaLaunchPortableClusterModeDefault - The default to use for allowing non-portable cluster size on launch - uses current function attribute for :py:obj:`~.cudaFuncAttributeNonPortableClusterSizeAllowed` - .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributePortableClusterMode.cudaLaunchPortableClusterModeRequirePortable +**Overview** +A CUDA execution context cudaExecutionContext_t serves as an abstraction for the contexts exposed by the CUDA Runtime, specifically green contexts and the primary context, and provides a unified programming model and API interface for contexts in the Runtime. - Specifies that the cluster size requested must be a portable size +There are two primary ways today to obtain an execution context: +- cudaDeviceGetExecutionCtx: Returns the execution context that corresponds to the primary context of the specified device. - .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributePortableClusterMode.cudaLaunchPortableClusterModeAllowNonPortable - Specifies that the cluster size requested may be a non-portable size -.. autoclass:: cuda.bindings.runtime.cudaSharedMemoryMode - .. autoattribute:: cuda.bindings.runtime.cudaSharedMemoryMode.cudaSharedMemoryModeDefault - The default to use for allowing non-portable shared memory size on launch - uses current function attributes for :py:obj:`~.cudaFuncAttributeMaxDynamicSharedMemorySize` +- cudaGreenCtxCreate: Creates a green context with the specified resources and returns an execution context. - .. autoattribute:: cuda.bindings.runtime.cudaSharedMemoryMode.cudaSharedMemoryModeRequirePortable - Specifies that the shared memory size requested must be a portable size within :py:obj:`~.cudaDevAttrMaxSharedMemoryPerBlock` - .. autoattribute:: cuda.bindings.runtime.cudaSharedMemoryMode.cudaSharedMemoryModeAllowNonPortable - Specifies that the shared memory size requested may be a non-portable size up to :py:obj:`~.cudaDevAttrMaxSharedMemoryPerBlockOptin` -.. autoclass:: cuda.bindings.runtime.cudaLaunchAttributeID +Once you have an execution context at hand, you can perform context-level operations via the CUDA Runtime APIs. This includes: - .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeIgnore +- Submitting work via streams created with cudaExecutionCtxStreamCreate. - Ignored entry, for convenient composition - .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeAccessPolicyWindow - Valid for streams, graph nodes, launches. See :py:obj:`~.cudaLaunchAttributeValue.accessPolicyWindow`. +- Querying context via cudaExecutionCtxGetDevResource, cudaExecutionCtxGetDevice, etc. - .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeCooperative - Valid for graph nodes, launches. See :py:obj:`~.cudaLaunchAttributeValue.cooperative`. - .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeSynchronizationPolicy - Valid for streams. See :py:obj:`~.cudaLaunchAttributeValue.syncPolicy`. +- Synchronizing and tracking context-level operations via cudaExecutionCtxSynchronize, cudaExecutionCtxRecordEvent, cudaExecutionCtxWaitEvent. - .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeClusterDimension - Valid for graph nodes, launches. See :py:obj:`~.cudaLaunchAttributeValue.clusterDim`. - .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeClusterSchedulingPolicyPreference +- Performing context-level graph node operations via cudaGraphAddNode by specifying the context in ``nodeParams``. Note that individual node creation APIs, such as cudaGraphAddKernelNode, do not support specifying an execution context. - Valid for graph nodes, launches. See :py:obj:`~.cudaLaunchAttributeValue.clusterSchedulingPolicyPreference`. - .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeProgrammaticStreamSerialization - Valid for launches. Setting :py:obj:`~.cudaLaunchAttributeValue.programmaticStreamSerializationAllowed` to non-0 signals that the kernel will use programmatic means to resolve its stream dependency, so that the CUDA runtime should opportunistically allow the grid's execution to overlap with the previous kernel in the stream, if that kernel requests the overlap. The dependent launches can choose to wait on the dependency using the programmatic sync (cudaGridDependencySynchronize() or equivalent PTX instructions). - .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeProgrammaticEvent - Valid for launches. Set :py:obj:`~.cudaLaunchAttributeValue.programmaticEvent` to record the event. Event recorded through this launch attribute is guaranteed to only trigger after all block in the associated kernel trigger the event. A block can trigger the event programmatically in a future CUDA release. A trigger can also be inserted at the beginning of each block's execution if triggerAtBlockStart is set to non-0. The dependent launches can choose to wait on the dependency using the programmatic sync (cudaGridDependencySynchronize() or equivalent PTX instructions). Note that dependents (including the CPU thread calling :py:obj:`~.cudaEventSynchronize()`) are not guaranteed to observe the release precisely when it is released. For example, :py:obj:`~.cudaEventSynchronize()` may only observe the event trigger long after the associated kernel has completed. This recording type is primarily meant for establishing programmatic dependency between device tasks. Note also this type of dependency allows, but does not guarantee, concurrent execution of tasks. +Note: The above APIs take in an explicit cudaExecutionContext_t handle and ignores the context that is current to the calling thread. This enables explicit context-based programming without relying on thread-local state. If no context is specified, the APIs return cudaErrorInvalidValue. - The event supplied must not be an interprocess or interop event. The event must disable timing (i.e. must be created with the :py:obj:`~.cudaEventDisableTiming` flag set). +Note: Developers should treat cudaExecutionContext_t as an opaque handle and avoid assumptions about its underlying representation. The CUDA Runtime does not provide a way to convert this handle into driver-level contexts, such as ::CUcontext or ::CUgreenCtx. - .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributePriority - Valid for streams, graph nodes, launches. See :py:obj:`~.cudaLaunchAttributeValue.priority`. +**Lifetime of CUDA Resources** - .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeMemSyncDomainMap +The lifetime of CUDA resources (memory, streams, events, modules, etc) is not tied to the lifetime of the execution context. Their lifetime is tied to the device against which they were created. As such, usage of cudaDeviceReset() should be avoided to persist the lifetime of these resources. - Valid for streams, graph nodes, launches. See :py:obj:`~.cudaLaunchAttributeValue.memSyncDomainMap`. - .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeMemSyncDomain +**APIs Operating on Current Context** - Valid for streams, graph nodes, launches. See :py:obj:`~.cudaLaunchAttributeValue.memSyncDomain`. +The CUDA runtime does not provide a way to set an execution context as current. Since, the majority of the runtime APIs operate on the current context, we document below how the developer can work with these APIs. - .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributePreferredClusterDimension +**APIs Operating on Device Resources** - Valid for graph nodes and launches. Set :py:obj:`~.cudaLaunchAttributeValue.preferredClusterDim` to allow the kernel launch to specify a preferred substitute cluster dimension. Blocks may be grouped according to either the dimensions specified with this attribute (grouped into a "preferred substitute cluster"), or the one specified with :py:obj:`~.cudaLaunchAttributeClusterDimension` attribute (grouped into a "regular cluster"). The cluster dimensions of a "preferred substitute cluster" shall be an integer multiple greater than zero of the regular cluster dimensions. The device will attempt - on a best-effort basis - to group thread blocks into preferred clusters over grouping them into regular clusters. When it deems necessary (primarily when the device temporarily runs out of physical resources to launch the larger preferred clusters), the device may switch to launch the regular clusters instead to attempt to utilize as much of the physical device resources as possible. +To work with these APIs (for example, cudaMalloc, cudaEventCreate, etc), developers are expected to call cudaSetDevice() prior to invoking them. Doing so does not impact functional correctness as these APIs operate on resources that are device-wide. If users have a context handle at hand, they can get the device handle from the context handle using cudaExecutionCtxGetDevice(). - Each type of cluster will have its enumeration / coordinate setup as if the grid consists solely of its type of cluster. For example, if the preferred substitute cluster dimensions double the regular cluster dimensions, there might be simultaneously a regular cluster indexed at (1,0,0), and a preferred cluster indexed at (1,0,0). In this example, the preferred substitute cluster (1,0,0) replaces regular clusters (2,0,0) and (3,0,0) and groups their blocks. - This attribute will only take effect when a regular cluster dimension has been specified. The preferred substitute cluster dimension must be an integer multiple greater than zero of the regular cluster dimension and must divide the grid. It must also be no more than `maxBlocksPerCluster`, if it is set in the kernel's `__launch_bounds__`. Otherwise it must be less than the maximum value the driver can support. Otherwise, setting this attribute to a value physically unable to fit on any particular device is permitted. - .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeLaunchCompletionEvent +**APIs Operating on Context Resources** - Valid for launches. Set :py:obj:`~.cudaLaunchAttributeValue.launchCompletionEvent` to record the event. +These APIs (for example, cudaLaunchKernel, cudaMemcpyAsync, cudaMemsetAsync, etc) take in a stream and resources are inferred from the context bound to the stream at creation. See cudaExecutionCtxStreamCreate for more details. Developers are expected to use the stream-based APIs for context awareness and always pass an explicit stream handle to ensure context-awareness, and avoid reliance on the default NULL stream, which implicitly binds to the current context. - Nominally, the event is triggered once all blocks of the kernel have begun execution. Currently this is a best effort. If a kernel B has a launch completion dependency on a kernel A, B may wait until A is complete. Alternatively, blocks of B may begin before all blocks of A have begun, for example if B can claim execution resources unavailable to A (e.g. they run on different GPUs) or if B is a higher priority than A. Exercise caution if such an ordering inversion could lead to deadlock. - A launch completion event is nominally similar to a programmatic event with `triggerAtBlockStart` set except that it is not visible to `cudaGridDependencySynchronize()` and can be used with compute capability less than 9.0. - The event supplied must not be an interprocess or interop event. The event must disable timing (i.e. must be created with the :py:obj:`~.cudaEventDisableTiming` flag set). - .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeDeviceUpdatableKernelNode - Valid for graph nodes, launches. This attribute is graphs-only, and passing it to a launch in a non-capturing stream will result in an error. +**Green Contexts** - :cudaLaunchAttributeValue::deviceUpdatableKernelNode::deviceUpdatable can only be set to 0 or 1. Setting the field to 1 indicates that the corresponding kernel node should be device-updatable. On success, a handle will be returned via :py:obj:`~.cudaLaunchAttributeValue`::deviceUpdatableKernelNode::devNode which can be passed to the various device-side update functions to update the node's kernel parameters from within another kernel. For more information on the types of device updates that can be made, as well as the relevant limitations thereof, see :py:obj:`~.cudaGraphKernelNodeUpdatesApply`. +Green contexts are a lightweight alternative to traditional contexts, that can be used to select a subset of device resources. This allows the developer to, for example, select SMs from distinct spatial partitions of the GPU and target them via CUDA stream operations, kernel launches, etc. - Nodes which are device-updatable have additional restrictions compared to regular kernel nodes. Firstly, device-updatable nodes cannot be removed from their graph via :py:obj:`~.cudaGraphDestroyNode`. Additionally, once opted-in to this functionality, a node cannot opt out, and any attempt to set the deviceUpdatable attribute to 0 will result in an error. Device-updatable kernel nodes also cannot have their attributes copied to/from another kernel node via :py:obj:`~.cudaGraphKernelNodeCopyAttributes`. Graphs containing one or more device-updatable nodes also do not allow multiple instantiation, and neither the graph nor its instantiated version can be passed to :py:obj:`~.cudaGraphExecUpdate`. +Here are the broad initial steps to follow to get started: - If a graph contains device-updatable nodes and updates those nodes from the device from within the graph, the graph must be uploaded with :py:obj:`~.cuGraphUpload` before it is launched. For such a graph, if host-side executable graph updates are made to the device-updatable nodes, the graph must be uploaded before it is launched again. +- (1) Start with an initial set of resources. For SM resources, they can be fetched via cudaDeviceGetDevResource. In case of workqueues, a new configuration can be used or an existing one queried via the cudaDeviceGetDevResource API. - .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributePreferredSharedMemoryCarveout - 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 +- (2) Modify these resources by either partitioning them (in case of SMs) or changing the configuration (in case of workqueues). To partition SMs, we recommend cudaDevSmResourceSplit. Changing the workqueue configuration can be done directly in place. - 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). +- (3) Finalize the specification of resources by creating a descriptor via cudaDevResourceGenerateDesc. - .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributePortableClusterSizeMode - Valid for graph nodes, launches. This indicates whether the kernel launch is allowed to use a non-portable cluster size. Valid values for :py:obj:`~.cudaLaunchAttributeValue.portableClusterSizeMode` are values for :py:obj:`~.cudaLaunchAttributePortableClusterMode` Any other value will return :py:obj:`~.cudaErrorInvalidValue` - .. autoattribute:: cuda.bindings.runtime.cudaLaunchAttributeID.cudaLaunchAttributeSharedMemoryMode - Valid for graph nodes, launches. This indicates that the kernel launch is allowed to use a non-portable shared memory mode. +- (4) Create a green context via cudaGreenCtxCreate. This provisions the resource, such as workqueues (until this step it was only a configuration specification). -.. autoclass:: cuda.bindings.runtime.cudaDeviceNumaConfig - .. autoattribute:: cuda.bindings.runtime.cudaDeviceNumaConfig.cudaDeviceNumaConfigNone - The GPU is not a NUMA node - .. autoattribute:: cuda.bindings.runtime.cudaDeviceNumaConfig.cudaDeviceNumaConfigNumaNode +- (5) Create a stream via cudaExecutionCtxStreamCreate, and use it throughout your application. - The GPU is a NUMA node, cudaDevAttrNumaId contains its NUMA ID -.. autoclass:: cuda.bindings.runtime.cudaAsyncNotificationType - .. autoattribute:: cuda.bindings.runtime.cudaAsyncNotificationType.cudaAsyncNotificationTypeOverBudget - 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 +SMs -.. autoclass:: cuda.bindings.runtime.cudaSurfaceBoundaryMode +There are two possible partition operations - with cudaDevSmResourceSplitByCount the partitions created have to follow default SM count granularity requirements, so it will often be rounded up and aligned to a default value. On the other hand, cudaDevSmResourceSplit is explicit and allows for creation of non-equal groups. It will not round up automatically - instead it is the developer’s responsibility to query and set the correct values. These requirements can be queried with cudaDeviceGetDevResource to determine the alignment granularity (sm.smCoscheduledAlignment). A general guideline on the default values for each compute architecture: - .. autoattribute:: cuda.bindings.runtime.cudaSurfaceBoundaryMode.cudaBoundaryModeZero +- On Compute Architecture 7.X, 8.X, and all Tegra SoC: - Zero boundary mode - .. autoattribute:: cuda.bindings.runtime.cudaSurfaceBoundaryMode.cudaBoundaryModeClamp + - The smCount must be a multiple of 2. - Clamp boundary mode - .. autoattribute:: cuda.bindings.runtime.cudaSurfaceBoundaryMode.cudaBoundaryModeTrap - Trap boundary mode -.. autoclass:: cuda.bindings.runtime.cudaSurfaceFormatMode - .. autoattribute:: cuda.bindings.runtime.cudaSurfaceFormatMode.cudaFormatModeForced + - The alignment (and default value of coscheduledSmCount) is 2. - Forced format mode - .. autoattribute:: cuda.bindings.runtime.cudaSurfaceFormatMode.cudaFormatModeAuto - Auto format mode -.. autoclass:: cuda.bindings.runtime.cudaTextureAddressMode - .. autoattribute:: cuda.bindings.runtime.cudaTextureAddressMode.cudaAddressModeWrap +- On Compute Architecture 9.0+: - Wrapping address mode - .. autoattribute:: cuda.bindings.runtime.cudaTextureAddressMode.cudaAddressModeClamp - Clamp to edge address mode + - The smCount must be a multiple of 8, or coscheduledSmCount if provided. - .. autoattribute:: cuda.bindings.runtime.cudaTextureAddressMode.cudaAddressModeMirror - Mirror address mode - .. autoattribute:: cuda.bindings.runtime.cudaTextureAddressMode.cudaAddressModeBorder + - The alignment (and default value of coscheduledSmCount) is 8. While the maximum value for coscheduled SM count is 32 on all Compute Architecture 9.0+, it's recommended to follow cluster size requirements. The portable cluster size and the max cluster size should be used in order to benefit from this co-scheduling. - Border address mode -.. autoclass:: cuda.bindings.runtime.cudaTextureFilterMode - .. autoattribute:: cuda.bindings.runtime.cudaTextureFilterMode.cudaFilterModePoint - Point filter mode - .. autoattribute:: cuda.bindings.runtime.cudaTextureFilterMode.cudaFilterModeLinear - Linear filter mode -.. autoclass:: cuda.bindings.runtime.cudaTextureReadMode - .. autoattribute:: cuda.bindings.runtime.cudaTextureReadMode.cudaReadModeElementType +Workqueues +For ``cudaDevResourceTypeWorkqueueConfig``, the resource specifies the expected maximum number of concurrent stream-ordered workloads via the ``wqConcurrencyLimit`` field. The ``sharingScope`` field determines how workqueue resources are shared: - Read texture as specified element type +- ``cudaDevWorkqueueConfigScopeDeviceCtx:`` Use all shared workqueue resources across all contexts (default driver behavior). - .. autoattribute:: cuda.bindings.runtime.cudaTextureReadMode.cudaReadModeNormalizedFloat - Read texture as normalized float -.. autoclass:: cuda.bindings.runtime.cudaEglPlaneDesc -.. autoclass:: cuda.bindings.runtime.cudaEglFrame -.. autoclass:: cuda.bindings.runtime.cudaEglStreamConnection -.. autoclass:: cuda.bindings.runtime.cudaDevResourceDesc_t -.. autoclass:: cuda.bindings.runtime.cudaExecutionContext_t -.. autoclass:: cuda.bindings.runtime.cudaArray_t -.. autoclass:: cuda.bindings.runtime.cudaArray_const_t -.. autoclass:: cuda.bindings.runtime.cudaMipmappedArray_t -.. autoclass:: cuda.bindings.runtime.cudaMipmappedArray_const_t -.. autoclass:: cuda.bindings.runtime.cudaHostFn_t -.. autoclass:: cuda.bindings.runtime.CUuuid -.. autoclass:: cuda.bindings.runtime.cudaUUID_t -.. autoclass:: cuda.bindings.runtime.cudaIpcEventHandle_t -.. autoclass:: cuda.bindings.runtime.cudaIpcMemHandle_t -.. autoclass:: cuda.bindings.runtime.cudaMemFabricHandle_t -.. autoclass:: cuda.bindings.runtime.cudaDevSmResourceGroupParams -.. autoclass:: cuda.bindings.runtime.cudaDevResource -.. autoclass:: cuda.bindings.runtime.cudaStream_t -.. autoclass:: cuda.bindings.runtime.cudaEvent_t -.. autoclass:: cuda.bindings.runtime.cudaGraphicsResource_t -.. autoclass:: cuda.bindings.runtime.cudaExternalMemory_t -.. autoclass:: cuda.bindings.runtime.cudaExternalSemaphore_t -.. autoclass:: cuda.bindings.runtime.cudaGraph_t -.. autoclass:: cuda.bindings.runtime.cudaGraphNode_t -.. autoclass:: cuda.bindings.runtime.cudaUserObject_t -.. autoclass:: cuda.bindings.runtime.cudaGraphConditionalHandle -.. autoclass:: cuda.bindings.runtime.cudaFunction_t -.. autoclass:: cuda.bindings.runtime.cudaKernel_t -.. autoclass:: cuda.bindings.runtime.cudaLibrary_t -.. autoclass:: cuda.bindings.runtime.cudaMemPool_t -.. autoclass:: cuda.bindings.runtime.cudaGraphEdgeData -.. autoclass:: cuda.bindings.runtime.cudaGraphExec_t -.. autoclass:: cuda.bindings.runtime.cudaGraphInstantiateParams -.. autoclass:: cuda.bindings.runtime.cudaGraphExecUpdateResultInfo -.. autoclass:: cuda.bindings.runtime.cudaGraphDeviceNode_t -.. autoclass:: cuda.bindings.runtime.cudaLaunchMemSyncDomainMap -.. autoclass:: cuda.bindings.runtime.cudaLaunchAttributeValue -.. autoclass:: cuda.bindings.runtime.cudaLaunchAttribute -.. 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 - Maximum number of planes per frame -.. autoattribute:: cuda.bindings.runtime.cudaHostAllocDefault +- ``cudaDevWorkqueueConfigScopeGreenCtxBalanced:`` When possible, use non-overlapping workqueue resources with other balanced green contexts. - Default page-locked allocation flag -.. autoattribute:: cuda.bindings.runtime.cudaHostAllocPortable - Pinned memory accessible by all CUDA contexts -.. autoattribute:: cuda.bindings.runtime.cudaHostAllocMapped - Map allocation into device space -.. autoattribute:: cuda.bindings.runtime.cudaHostAllocWriteCombined - Write-combined memory -.. autoattribute:: cuda.bindings.runtime.cudaHostRegisterDefault - Default host memory registration flag +The maximum concurrency limit depends on ::CUDA_DEVICE_MAX_CONNECTIONS and can be queried from the device via cudaDeviceGetDevResource. Configurations may exceed this concurrency limit, but the driver will not guarantee that work submission remains non-overlapping. -.. autoattribute:: cuda.bindings.runtime.cudaHostRegisterPortable +For ``cudaDevResourceTypeWorkqueue``, the resource represents a pre-existing workqueue that can be retrieved from existing execution contexts. This allows reusing workqueue resources across different execution contexts. - Pinned memory accessible by all CUDA contexts +On Concurrency -.. autoattribute:: cuda.bindings.runtime.cudaHostRegisterMapped +Even if the green contexts have disjoint SM partitions, it is not guaranteed that the kernels launched in them will run concurrently or have forward progress guarantees. This is due to other resources that could cause a dependency. Using a combination of disjoint SMs and ``cudaDevWorkqueueConfigScopeGreenCtxBalanced`` workqueue configurations can provide the best chance of avoiding interference. More resources will be added in the future to provide stronger guarantees. - Map registered memory into device space +Additionally, there are two known scenarios, where its possible for the workload to run on more SMs than was provisioned (but never less). -.. autoattribute:: cuda.bindings.runtime.cudaHostRegisterIoMemory - Memory-mapped I/O space -.. autoattribute:: cuda.bindings.runtime.cudaHostRegisterReadOnly +- On Volta+ MPS: When ``CUDA_MPS_ACTIVE_THREAD_PERCENTAGE`` is used, the set of SMs that are used for running kernels can be scaled up to the value of SMs used for the MPS client. - Memory-mapped read-only -.. autoattribute:: cuda.bindings.runtime.cudaPeerAccessDefault - Default peer addressing enable flag -.. autoattribute:: cuda.bindings.runtime.cudaStreamDefault - Default stream flag -.. autoattribute:: cuda.bindings.runtime.cudaStreamNonBlocking - Stream does not synchronize with stream 0 (the NULL stream) +- On Compute Architecture 9.x: When a module with dynamic parallelism (CDP) is loaded, all future kernels running under green contexts may use and share an additional set of 2 SMs. -.. autoattribute:: cuda.bindings.runtime.cudaStreamLegacy +.. autofunction:: cuda.bindings.runtime.cudaDeviceGetDevResource +.. autofunction:: cuda.bindings.runtime.cudaDevSmResourceSplitByCount +.. autofunction:: cuda.bindings.runtime.cudaDevSmResourceSplit +.. autofunction:: cuda.bindings.runtime.cudaDevResourceGenerateDesc +.. autofunction:: cuda.bindings.runtime.cudaGreenCtxCreate +.. autofunction:: cuda.bindings.runtime.cudaExecutionCtxDestroy +.. autofunction:: cuda.bindings.runtime.cudaExecutionCtxGetDevResource +.. autofunction:: cuda.bindings.runtime.cudaExecutionCtxGetDevice +.. autofunction:: cuda.bindings.runtime.cudaExecutionCtxGetId +.. autofunction:: cuda.bindings.runtime.cudaExecutionCtxStreamCreate +.. autofunction:: cuda.bindings.runtime.cudaExecutionCtxSynchronize +.. autofunction:: cuda.bindings.runtime.cudaStreamGetDevResource +.. autofunction:: cuda.bindings.runtime.cudaExecutionCtxRecordEvent +.. autofunction:: cuda.bindings.runtime.cudaExecutionCtxWaitEvent +.. autofunction:: cuda.bindings.runtime.cudaDeviceGetExecutionCtx - Legacy stream handle +C++ API Routines +---------------- +C++-style interface built on top of CUDA runtime API. +impl_private - Stream handle that can be passed as a cudaStream_t to use an implicit stream with legacy synchronization behavior. +MANBRIEF C++ high level API functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF - See details of the \link_sync_behavior +This section describes the C++ high level API functions of the CUDA runtime application programming interface. To use these functions, your application needs to be compiled with the ``nvcc`` compiler. -.. autoattribute:: cuda.bindings.runtime.cudaStreamPerThread - Per-thread stream handle +Interactions with the CUDA Driver API +------------------------------------- +MANBRIEF interactions between CUDA Driver API and CUDA Runtime API (CURRENT_FILE) ENDMANBRIEF - Stream handle that can be passed as a cudaStream_t to use an implicit stream with per-thread synchronization behavior. +This section describes the interactions between the CUDA Driver API and the CUDA Runtime API - See details of the \link_sync_behavior -.. autoattribute:: cuda.bindings.runtime.cudaEventDefault - Default event flag -.. autoattribute:: cuda.bindings.runtime.cudaEventBlockingSync +**Execution Contexts** - Event uses blocking synchronization +The CUDA Runtime provides cudaExecutionContext_t as an abstraction over driver-level contexts—specifically, green contexts and the primary context. -.. autoattribute:: cuda.bindings.runtime.cudaEventDisableTiming +There are two primary ways to obtain an execution context: - Event will not record timing data +- cudaDeviceGetExecutionCtx: Returns the execution context that corresponds to the primary context of the specified device. -.. autoattribute:: cuda.bindings.runtime.cudaEventInterprocess - Event is suitable for interprocess use. cudaEventDisableTiming must be set -.. autoattribute:: cuda.bindings.runtime.cudaEventRecordDefault - Default event record flag -.. autoattribute:: cuda.bindings.runtime.cudaEventRecordExternal - Event is captured in the graph as an external event node when performing stream capture -.. autoattribute:: cuda.bindings.runtime.cudaEventWaitDefault +- cudaGreenCtxCreate: Creates a green context with the specified resources and returns an execution context. - Default event wait flag -.. autoattribute:: cuda.bindings.runtime.cudaEventWaitExternal - Event is captured in the graph as an external event node when performing stream capture -.. autoattribute:: cuda.bindings.runtime.cudaDeviceScheduleAuto - Device flag - Automatic scheduling -.. autoattribute:: cuda.bindings.runtime.cudaDeviceScheduleSpin - Device flag - Spin default scheduling -.. autoattribute:: cuda.bindings.runtime.cudaDeviceScheduleYield - Device flag - Yield default scheduling +Note: Developers should treat cudaExecutionContext_t as an opaque handle and avoid assumptions about its underlying representation. The CUDA Runtime does not provide a way to convert this handle into a ::CUcontext or ::CUgreenCtx. -.. autoattribute:: cuda.bindings.runtime.cudaDeviceScheduleBlockingSync - Device flag - Use blocking synchronization -.. autoattribute:: cuda.bindings.runtime.cudaDeviceBlockingSync - Device flag - Use blocking synchronization [Deprecated] -.. autoattribute:: cuda.bindings.runtime.cudaDeviceScheduleMask +**Primary Context (aka Device Execution Context)** - Device schedule flags mask +The primary context is the default execution context associated with a device in the Runtime. It can be obtained via a call to cudaDeviceGetExecutionCtx(). There is a one-to-one mapping between CUDA devices in the runtime and their primary contexts within a process. -.. autoattribute:: cuda.bindings.runtime.cudaDeviceMapHost +From the CUDA Runtime’s perspective, a device and its primary context are functionally synonymous. - Device flag - Support mapped pinned allocations +Unless explicitly overridden, either by making a different context current via the Driver API (e.g., ::cuCtxSetCurrent()) or by using an explicit execution context handle, the Runtime will implicitly initialize and use the primary context for API calls as needed. -.. autoattribute:: cuda.bindings.runtime.cudaDeviceLmemResizeToMax - Device flag - Keep local memory allocation after launch -.. autoattribute:: cuda.bindings.runtime.cudaDeviceSyncMemops - Device flag - Ensure synchronous memory operations on this context will synchronize -.. autoattribute:: cuda.bindings.runtime.cudaDeviceMask +**Initialization and Tear-Down** - Device flags mask +Unless an explicit execution context is specified (see “Execution Context Management” for APIs), CUDA Runtime API calls operate on the CUDA Driver ::CUcontext which is current to the calling host thread. If no ::CUcontext is current to the calling thread when a CUDA Runtime API call which requires an active context is made, then the primary context (device execution context) for a device will be selected, made current to the calling thread, and initialized. The context will be initialized using the parameters specified by the CUDA Runtime API functions cudaSetDeviceFlags(), ::cudaD3D9SetDirect3DDevice(), ::cudaD3D10SetDirect3DDevice(), ::cudaD3D11SetDirect3DDevice(), cudaGLSetGLDevice(), and cudaVDPAUSetVDPAUDevice(). Note that these functions will fail with cudaErrorSetOnActiveProcess if they are called when the primary context for the specified device has already been initialized, except for cudaSetDeviceFlags() which will simply overwrite the previous settings. -.. autoattribute:: cuda.bindings.runtime.cudaArrayDefault +The function cudaInitDevice() ensures that the primary context is initialized for the requested device but does not make it current to the calling thread. - Default CUDA array allocation flag +The function cudaSetDevice() initializes the primary context for the specified device and makes it current to the calling thread by calling ::cuCtxSetCurrent(). -.. autoattribute:: cuda.bindings.runtime.cudaArrayLayered +Primary contexts will remain active until they are explicitly deinitialized using cudaDeviceReset(). The function cudaDeviceReset() will deinitialize the primary context for the calling thread's current device immediately. The context will remain current to all of the threads that it was current to. The next CUDA Runtime API call on any thread which requires an active context will trigger the reinitialization of that device's primary context. - Must be set in cudaMalloc3DArray to create a layered CUDA array +Note that primary contexts are shared resources. It is recommended that the primary context not be reset except just before exit or to recover from an unspecified launch failure. -.. autoattribute:: cuda.bindings.runtime.cudaArraySurfaceLoadStore - Must be set in cudaMallocArray or cudaMalloc3DArray in order to bind surfaces to the CUDA array -.. autoattribute:: cuda.bindings.runtime.cudaArrayCubemap - Must be set in cudaMalloc3DArray to create a cubemap CUDA array -.. autoattribute:: cuda.bindings.runtime.cudaArrayTextureGather +**CUcontext Interoperability** - Must be set in cudaMallocArray or cudaMalloc3DArray in order to perform texture gather operations on the CUDA array +Note that the use of multiple ::CUcontext s per device within a single process will substantially degrade performance and is strongly discouraged. Instead, it is highly recommended to either use execution contexts cudaExecutionContext_t or the implicit one-to-one device-to-primary context mapping for the process provided by the CUDA Runtime API. -.. autoattribute:: cuda.bindings.runtime.cudaArrayColorAttachment +If a non-primary ::CUcontext created by the CUDA Driver API is current to a thread then the CUDA Runtime API calls to that thread will operate on that ::CUcontext, with some exceptions listed below. Interoperability between data types is discussed in the following sections. - Must be set in cudaExternalMemoryGetMappedMipmappedArray if the mipmapped array is used as a color target in a graphics API +The function cudaDeviceEnablePeerAccess() and the rest of the peer access API may not be called when a non-primary CUcontext is current. To use the peer access APIs with a context created using the CUDA Driver API, it is necessary that the CUDA Driver API be used to access these features. -.. autoattribute:: cuda.bindings.runtime.cudaArraySparse +All CUDA Runtime API state (e.g, global variables' addresses and values) travels with its underlying ::CUcontext. In particular, if a ::CUcontext is moved from one thread to another then all CUDA Runtime API state will move to that thread as well. - Must be set in cudaMallocArray, cudaMalloc3DArray or cudaMallocMipmappedArray in order to create a sparse CUDA array or CUDA mipmapped array +Please note that attaching to legacy CUcontext (those with a version of 3010 as returned by ::cuCtxGetApiVersion()) is not possible. The CUDA Runtime will return cudaErrorIncompatibleDriverContext in such cases. -.. autoattribute:: cuda.bindings.runtime.cudaArrayDeferredMapping - Must be set in cudaMallocArray, cudaMalloc3DArray or cudaMallocMipmappedArray in order to create a deferred mapping CUDA array or CUDA mipmapped array -.. autoattribute:: cuda.bindings.runtime.cudaIpcMemLazyEnablePeerAccess - Automatically enable peer access between remote devices as needed -.. autoattribute:: cuda.bindings.runtime.cudaMemAttachGlobal +**Interactions between CUstream and cudaStream_t** - Memory can be accessed by any stream on any device +The types ::CUstream and cudaStream_t are identical and may be used interchangeably. -.. autoattribute:: cuda.bindings.runtime.cudaMemAttachHost - Memory cannot be accessed by any stream on any device -.. autoattribute:: cuda.bindings.runtime.cudaMemAttachSingle - Memory can only be accessed by a single stream on the associated device -.. autoattribute:: cuda.bindings.runtime.cudaOccupancyDefault +**Interactions between CUevent and cudaEvent_t** - Default behavior +The types ::CUevent and cudaEvent_t are identical and may be used interchangeably. -.. autoattribute:: cuda.bindings.runtime.cudaOccupancyDisableCachingOverride - Assume global caching is enabled and cannot be automatically turned off -.. autoattribute:: cuda.bindings.runtime.cudaCpuDeviceId - Device id that represents the CPU -.. autoattribute:: cuda.bindings.runtime.cudaInvalidDeviceId +**Interactions between CUarray and cudaArray_t** - Device id that represents an invalid device +The types ::CUarray and struct ::cudaArray \* represent the same data type and may be used interchangeably by casting the two types between each other. -.. autoattribute:: cuda.bindings.runtime.cudaInitDeviceFlagsAreValid +In order to use a ::CUarray in a CUDA Runtime API function which takes a struct ::cudaArray \*, it is necessary to explicitly cast the ::CUarray to a struct ::cudaArray \*. - Tell the CUDA runtime that DeviceFlags is being set in cudaInitDevice call +In order to use a struct ::cudaArray \* in a CUDA Driver API function which takes a ::CUarray, it is necessary to explicitly cast the struct ::cudaArray \* to a ::CUarray . -.. 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 -.. autoattribute:: cuda.bindings.runtime.CUDART_CB -.. autoattribute:: cuda.bindings.runtime.cudaMemPoolCreateUsageHwDecompress - This flag, if set, indicates that the memory will be used as a buffer for hardware accelerated decompression. -.. autoattribute:: cuda.bindings.runtime.CU_UUID_HAS_BEEN_DEFINED +**Interactions between CUgraphicsResource and cudaGraphicsResource_t** - CUDA UUID types +The types ::CUgraphicsResource and cudaGraphicsResource_t represent the same data type and may be used interchangeably by casting the two types between each other. -.. autoattribute:: cuda.bindings.runtime.CUDA_IPC_HANDLE_SIZE +In order to use a ::CUgraphicsResource in a CUDA Runtime API function which takes a cudaGraphicsResource_t, it is necessary to explicitly cast the ::CUgraphicsResource to a cudaGraphicsResource_t. - CUDA IPC Handle Size +In order to use a cudaGraphicsResource_t in a CUDA Driver API function which takes a ::CUgraphicsResource, it is necessary to explicitly cast the cudaGraphicsResource_t to a ::CUgraphicsResource. -.. autoattribute:: cuda.bindings.runtime.cudaExternalMemoryDedicated - Indicates that the external memory object is a dedicated resource -.. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreSignalSkipNvSciBufMemSync - When the /p flags parameter of :py:obj:`~.cudaExternalSemaphoreSignalParams` contains this flag, it indicates that signaling an external semaphore object should skip performing appropriate memory synchronization operations over all the external memory objects that are imported as :py:obj:`~.cudaExternalMemoryHandleTypeNvSciBuf`, which otherwise are performed by default to ensure data coherency with other importers of the same NvSciBuf memory objects. -.. autoattribute:: cuda.bindings.runtime.cudaExternalSemaphoreWaitSkipNvSciBufMemSync +**Interactions between CUtexObject and cudaTextureObject_t** - When the /p flags parameter of :py:obj:`~.cudaExternalSemaphoreWaitParams` contains this flag, it indicates that waiting an external semaphore object should skip performing appropriate memory synchronization operations over all the external memory objects that are imported as :py:obj:`~.cudaExternalMemoryHandleTypeNvSciBuf`, which otherwise are performed by default to ensure data coherency with other importers of the same NvSciBuf memory objects. +The types ::CUtexObject and cudaTextureObject_t represent the same data type and may be used interchangeably by casting the two types between each other. -.. autoattribute:: cuda.bindings.runtime.cudaNvSciSyncAttrSignal +In order to use a ::CUtexObject in a CUDA Runtime API function which takes a cudaTextureObject_t, it is necessary to explicitly cast the ::CUtexObject to a cudaTextureObject_t. - When /p flags of :py:obj:`~.cudaDeviceGetNvSciSyncAttributes` is set to this, it indicates that application need signaler specific NvSciSyncAttr to be filled by :py:obj:`~.cudaDeviceGetNvSciSyncAttributes`. +In order to use a cudaTextureObject_t in a CUDA Driver API function which takes a ::CUtexObject, it is necessary to explicitly cast the cudaTextureObject_t to a ::CUtexObject. -.. autoattribute:: cuda.bindings.runtime.cudaNvSciSyncAttrWait - When /p flags of :py:obj:`~.cudaDeviceGetNvSciSyncAttributes` is set to this, it indicates that application need waiter specific NvSciSyncAttr to be filled by :py:obj:`~.cudaDeviceGetNvSciSyncAttributes`. -.. autoattribute:: cuda.bindings.runtime.RESOURCE_ABI_BYTES -.. autoattribute:: cuda.bindings.runtime.cudaGraphKernelNodePortDefault - This port activates when the kernel has finished executing. -.. autoattribute:: cuda.bindings.runtime.cudaGraphKernelNodePortProgrammatic +**Interactions between CUsurfObject and cudaSurfaceObject_t** - This port activates when all blocks of the kernel have performed cudaTriggerProgrammaticLaunchCompletion() or have terminated. It must be used with edge type :py:obj:`~.cudaGraphDependencyTypeProgrammatic`. See also :py:obj:`~.cudaLaunchAttributeProgrammaticEvent`. +The types ::CUsurfObject and cudaSurfaceObject_t represent the same data type and may be used interchangeably by casting the two types between each other. -.. autoattribute:: cuda.bindings.runtime.cudaGraphKernelNodePortLaunchCompletion +In order to use a ::CUsurfObject in a CUDA Runtime API function which takes a cudaSurfaceObject_t, it is necessary to explicitly cast the ::CUsurfObject to a cudaSurfaceObject_t. - This port activates when all blocks of the kernel have begun execution. See also :py:obj:`~.cudaLaunchAttributeLaunchCompletionEvent`. +In order to use a cudaSurfaceObject_t in a CUDA Driver API function which takes a ::CUsurfObject, it is necessary to explicitly cast the cudaSurfaceObject_t to a ::CUsurfObject. -.. autoattribute:: cuda.bindings.runtime.cudaStreamAttrID -.. autoattribute:: cuda.bindings.runtime.cudaStreamAttributeAccessPolicyWindow -.. autoattribute:: cuda.bindings.runtime.cudaStreamAttributeSynchronizationPolicy -.. autoattribute:: cuda.bindings.runtime.cudaStreamAttributeMemSyncDomainMap -.. autoattribute:: cuda.bindings.runtime.cudaStreamAttributeMemSyncDomain -.. autoattribute:: cuda.bindings.runtime.cudaStreamAttributePriority -.. autoattribute:: cuda.bindings.runtime.cudaStreamAttrValue -.. autoattribute:: cuda.bindings.runtime.cudaKernelNodeAttrID -.. autoattribute:: cuda.bindings.runtime.cudaKernelNodeAttributeAccessPolicyWindow -.. autoattribute:: cuda.bindings.runtime.cudaKernelNodeAttributeCooperative -.. autoattribute:: cuda.bindings.runtime.cudaKernelNodeAttributePriority -.. autoattribute:: cuda.bindings.runtime.cudaKernelNodeAttributeClusterDimension -.. autoattribute:: cuda.bindings.runtime.cudaKernelNodeAttributeClusterSchedulingPolicyPreference -.. autoattribute:: cuda.bindings.runtime.cudaKernelNodeAttributeMemSyncDomainMap -.. 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 -.. autoattribute:: cuda.bindings.runtime.cudaSurfaceType3D -.. autoattribute:: cuda.bindings.runtime.cudaSurfaceTypeCubemap -.. autoattribute:: cuda.bindings.runtime.cudaSurfaceType1DLayered -.. autoattribute:: cuda.bindings.runtime.cudaSurfaceType2DLayered -.. autoattribute:: cuda.bindings.runtime.cudaSurfaceTypeCubemapLayered -.. autoattribute:: cuda.bindings.runtime.cudaTextureType1D -.. autoattribute:: cuda.bindings.runtime.cudaTextureType2D -.. autoattribute:: cuda.bindings.runtime.cudaTextureType3D -.. autoattribute:: cuda.bindings.runtime.cudaTextureTypeCubemap -.. autoattribute:: cuda.bindings.runtime.cudaTextureType1DLayered -.. autoattribute:: cuda.bindings.runtime.cudaTextureType2DLayered -.. autoattribute:: cuda.bindings.runtime.cudaTextureTypeCubemapLayered + + + + +**Interactions between CUfunction and cudaFunction_t** + +The types ::CUfunction and cudaFunction_t represent the same data type and may be used interchangeably by casting the two types between each other. + +In order to use a cudaFunction_t in a CUDA Driver API function which takes a ::CUfunction, it is necessary to explicitly cast the cudaFunction_t to a ::CUfunction. + + + + + +**Interactions between CUkernel and cudaKernel_t** + +The types ::CUkernel and cudaKernel_t represent the same data type and may be used interchangeably by casting the two types between each other. + +In order to use a cudaKernel_t in a CUDA Driver API function which takes a ::CUkernel, it is necessary to explicitly cast the cudaKernel_t to a ::CUkernel. + +.. autofunction:: cuda.bindings.runtime.cudaGetKernel + +Profiler Control +---------------- + +MANBRIEF profiler control functions of the CUDA runtime API (CURRENT_FILE) ENDMANBRIEF + + + +This section describes the profiler control functions of the CUDA runtime application programming interface. + +.. autofunction:: cuda.bindings.runtime.cudaProfilerStart +.. autofunction:: cuda.bindings.runtime.cudaProfilerStop diff --git a/cuda_bindings/docs/source/module/utils.rst b/cuda_bindings/docs/source/module/utils.rst index e720b0979cc..7673b742b59 100644 --- a/cuda_bindings/docs/source/module/utils.rst +++ b/cuda_bindings/docs/source/module/utils.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 .. module:: cuda.bindings.utils diff --git a/cuda_bindings/docs/source/motivation.rst b/cuda_bindings/docs/source/motivation.rst index 433cc166193..0236299bf7d 100644 --- a/cuda_bindings/docs/source/motivation.rst +++ b/cuda_bindings/docs/source/motivation.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 Motivation ========== @@ -31,7 +31,7 @@ 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 +`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 diff --git a/cuda_bindings/docs/source/overview.rst b/cuda_bindings/docs/source/overview.rst index fdef83639b0..14c068c2af5 100644 --- a/cuda_bindings/docs/source/overview.rst +++ b/cuda_bindings/docs/source/overview.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 Overview ======== @@ -25,20 +25,21 @@ 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 +`NVRTC `_, a runtime compilation library for CUDA C++. Using the NVIDIA `Driver -API `_, manually create a +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 `_. +`SAXPY `_. For more +end-to-end samples, see the :doc:`examples` page. 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 `_. +approaches can be used to accomplish this and are described in +:ref:`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. @@ -307,6 +308,8 @@ maximize performance ({numref}``Figure 1``). Screenshot of Nsight Compute CLI output of ``cuda.bindings`` example. +.. _preparing-kernel-arguments: + Preparing kernel arguments -------------------------- @@ -427,7 +430,7 @@ Putting it all together: ) 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. +with NumPy's `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: @@ -520,7 +523,10 @@ 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 `_: +For this example, lets use the ``transformKernel`` from +:cuda-bindings-example:`simple_cubemap_texture.py <0_Introduction/simple_cubemap_texture.py>`. +The :doc:`examples` page links to more samples covering textures, graphs, +memory mapping, and multi-GPU workflows. .. code-block:: python diff --git a/cuda_bindings/docs/source/release.rst b/cuda_bindings/docs/source/release.rst index f9a24a36b3c..f844bfc251d 100644 --- a/cuda_bindings/docs/source/release.rst +++ b/cuda_bindings/docs/source/release.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 Release Notes ============= diff --git a/cuda_bindings/docs/source/release/11.4.0-notes.rst b/cuda_bindings/docs/source/release/11.4.0-notes.rst index c019aedd95a..afb723b33a2 100644 --- a/cuda_bindings/docs/source/release/11.4.0-notes.rst +++ b/cuda_bindings/docs/source/release/11.4.0-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 CUDA Python 11.4.0 Release notes ================================ diff --git a/cuda_bindings/docs/source/release/11.5.0-notes.rst b/cuda_bindings/docs/source/release/11.5.0-notes.rst index 17cb02e0ca2..172c3d94e20 100644 --- a/cuda_bindings/docs/source/release/11.5.0-notes.rst +++ b/cuda_bindings/docs/source/release/11.5.0-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 CUDA Python 11.5.0 Release notes ================================ 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 bcc8944e1f6..ec7fbfdc4fa 100644 --- a/cuda_bindings/docs/source/release/11.6.0-notes.rst +++ b/cuda_bindings/docs/source/release/11.6.0-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 CUDA Python 11.6.0 Release notes ================================ diff --git a/cuda_bindings/docs/source/release/11.6.1-notes.rst b/cuda_bindings/docs/source/release/11.6.1-notes.rst index f136c942244..b30ad115b93 100644 --- a/cuda_bindings/docs/source/release/11.6.1-notes.rst +++ b/cuda_bindings/docs/source/release/11.6.1-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 CUDA Python 11.6.1 Release notes ================================ diff --git a/cuda_bindings/docs/source/release/11.7.0-notes.rst b/cuda_bindings/docs/source/release/11.7.0-notes.rst index 1f850c4283b..6a85be2e051 100644 --- a/cuda_bindings/docs/source/release/11.7.0-notes.rst +++ b/cuda_bindings/docs/source/release/11.7.0-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 CUDA Python 11.7.0 Release notes ================================ diff --git a/cuda_bindings/docs/source/release/11.7.1-notes.rst b/cuda_bindings/docs/source/release/11.7.1-notes.rst index 0fbea248e36..f381ef19c5f 100644 --- a/cuda_bindings/docs/source/release/11.7.1-notes.rst +++ b/cuda_bindings/docs/source/release/11.7.1-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 CUDA Python 11.7.1 Release notes ================================ @@ -14,6 +14,8 @@ Highlights Limitations ----------- +.. _cuda-bindings-11-7-1-source-builds: + Source builds ^^^^^^^^^^^^^ diff --git a/cuda_bindings/docs/source/release/11.8.0-notes.rst b/cuda_bindings/docs/source/release/11.8.0-notes.rst index e24022142df..c3837f18a68 100644 --- a/cuda_bindings/docs/source/release/11.8.0-notes.rst +++ b/cuda_bindings/docs/source/release/11.8.0-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 CUDA Python 11.8.0 Release notes ================================ @@ -16,7 +16,7 @@ Highlights 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 `_ 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 :ref:`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). diff --git a/cuda_bindings/docs/source/release/11.8.1-notes.rst b/cuda_bindings/docs/source/release/11.8.1-notes.rst index 0df23c92997..0c6b7351ef0 100644 --- a/cuda_bindings/docs/source/release/11.8.1-notes.rst +++ b/cuda_bindings/docs/source/release/11.8.1-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 CUDA Python 11.8.1 Release notes ================================ diff --git a/cuda_bindings/docs/source/release/11.8.2-notes.rst b/cuda_bindings/docs/source/release/11.8.2-notes.rst index ec9f0324e5a..b5d5e768657 100644 --- a/cuda_bindings/docs/source/release/11.8.2-notes.rst +++ b/cuda_bindings/docs/source/release/11.8.2-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 CUDA Python 11.8.2 Release notes ================================ diff --git a/cuda_bindings/docs/source/release/11.8.3-notes.rst b/cuda_bindings/docs/source/release/11.8.3-notes.rst index 806f5eb1b3b..cb642daadb8 100644 --- a/cuda_bindings/docs/source/release/11.8.3-notes.rst +++ b/cuda_bindings/docs/source/release/11.8.3-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 CUDA Python 11.8.3 Release notes ================================ diff --git a/cuda_bindings/docs/source/release/11.8.4-notes.rst b/cuda_bindings/docs/source/release/11.8.4-notes.rst index 6bafd0b63cb..a0360bc1e93 100644 --- a/cuda_bindings/docs/source/release/11.8.4-notes.rst +++ b/cuda_bindings/docs/source/release/11.8.4-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 CUDA Python 11.8.4 Release notes ================================ diff --git a/cuda_bindings/docs/source/release/11.8.5-notes.rst b/cuda_bindings/docs/source/release/11.8.5-notes.rst index 7580d468b49..54a4de15906 100644 --- a/cuda_bindings/docs/source/release/11.8.5-notes.rst +++ b/cuda_bindings/docs/source/release/11.8.5-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 CUDA Python 11.8.5 Release notes ================================ diff --git a/cuda_bindings/docs/source/release/11.8.6-notes.rst b/cuda_bindings/docs/source/release/11.8.6-notes.rst index 9ab6db2d508..9d3acc4122f 100644 --- a/cuda_bindings/docs/source/release/11.8.6-notes.rst +++ b/cuda_bindings/docs/source/release/11.8.6-notes.rst @@ -1,8 +1,8 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 ``cuda-bindings`` 11.8.6 Release notes -==================================== +========================================== Released on January 24, 2025. diff --git a/cuda_bindings/docs/source/release/11.8.7-notes.rst b/cuda_bindings/docs/source/release/11.8.7-notes.rst index 69e5f38438d..ab38253ceeb 100644 --- a/cuda_bindings/docs/source/release/11.8.7-notes.rst +++ b/cuda_bindings/docs/source/release/11.8.7-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 ``cuda-bindings`` 11.8.7 Release notes ====================================== diff --git a/cuda_bindings/docs/source/release/12.0.0-notes.rst b/cuda_bindings/docs/source/release/12.0.0-notes.rst index b61741a24ca..75ac832083b 100644 --- a/cuda_bindings/docs/source/release/12.0.0-notes.rst +++ b/cuda_bindings/docs/source/release/12.0.0-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 CUDA Python 12.0.0 Release notes ================================ diff --git a/cuda_bindings/docs/source/release/12.1.0-notes.rst b/cuda_bindings/docs/source/release/12.1.0-notes.rst index 161b4596cba..371d943b3fd 100644 --- a/cuda_bindings/docs/source/release/12.1.0-notes.rst +++ b/cuda_bindings/docs/source/release/12.1.0-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 CUDA Python 12.1.0 Release notes ================================ diff --git a/cuda_bindings/docs/source/release/12.2.0-notes.rst b/cuda_bindings/docs/source/release/12.2.0-notes.rst index 796aaa1e520..e39bdb3402c 100644 --- a/cuda_bindings/docs/source/release/12.2.0-notes.rst +++ b/cuda_bindings/docs/source/release/12.2.0-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 CUDA Python 12.2.0 Release notes ================================ diff --git a/cuda_bindings/docs/source/release/12.2.1-notes.rst b/cuda_bindings/docs/source/release/12.2.1-notes.rst index 3ccacdd30e5..6a004d93445 100644 --- a/cuda_bindings/docs/source/release/12.2.1-notes.rst +++ b/cuda_bindings/docs/source/release/12.2.1-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 CUDA Python 12.2.1 Release notes ================================ diff --git a/cuda_bindings/docs/source/release/12.3.0-notes.rst b/cuda_bindings/docs/source/release/12.3.0-notes.rst index 0a14aea9e6c..b917965a90b 100644 --- a/cuda_bindings/docs/source/release/12.3.0-notes.rst +++ b/cuda_bindings/docs/source/release/12.3.0-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 CUDA Python 12.3.0 Release notes ================================ diff --git a/cuda_bindings/docs/source/release/12.4.0-notes.rst b/cuda_bindings/docs/source/release/12.4.0-notes.rst index b71a4ce7d42..8c9d91c60f3 100644 --- a/cuda_bindings/docs/source/release/12.4.0-notes.rst +++ b/cuda_bindings/docs/source/release/12.4.0-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 CUDA Python 12.4.0 Release notes ================================ diff --git a/cuda_bindings/docs/source/release/12.5.0-notes.rst b/cuda_bindings/docs/source/release/12.5.0-notes.rst index 0ac6a25ee0f..8259af1ebe7 100644 --- a/cuda_bindings/docs/source/release/12.5.0-notes.rst +++ b/cuda_bindings/docs/source/release/12.5.0-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 CUDA Python 12.5.0 Release notes ================================ diff --git a/cuda_bindings/docs/source/release/12.6.0-notes.rst b/cuda_bindings/docs/source/release/12.6.0-notes.rst index 9cd5bbff599..10e336aae46 100644 --- a/cuda_bindings/docs/source/release/12.6.0-notes.rst +++ b/cuda_bindings/docs/source/release/12.6.0-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 CUDA Python 12.6.0 Release notes ================================ diff --git a/cuda_bindings/docs/source/release/12.6.1-notes.rst b/cuda_bindings/docs/source/release/12.6.1-notes.rst index 25716334454..8ca01b605f9 100644 --- a/cuda_bindings/docs/source/release/12.6.1-notes.rst +++ b/cuda_bindings/docs/source/release/12.6.1-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 CUDA Python 12.6.1 Release notes ================================ diff --git a/cuda_bindings/docs/source/release/12.6.2-notes.rst b/cuda_bindings/docs/source/release/12.6.2-notes.rst index 4ce87dd8b45..8dc9aebcf03 100644 --- a/cuda_bindings/docs/source/release/12.6.2-notes.rst +++ b/cuda_bindings/docs/source/release/12.6.2-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 CUDA Python 12.6.2 Release notes ================================ diff --git a/cuda_bindings/docs/source/release/12.8.0-notes.rst b/cuda_bindings/docs/source/release/12.8.0-notes.rst index 6c9c9517792..41c2cb930ea 100644 --- a/cuda_bindings/docs/source/release/12.8.0-notes.rst +++ b/cuda_bindings/docs/source/release/12.8.0-notes.rst @@ -1,8 +1,8 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 ``cuda-bindings`` 12.8.0 Release notes -==================================== +========================================== Released on January 24, 2025. diff --git a/cuda_bindings/docs/source/release/12.9.0-notes.rst b/cuda_bindings/docs/source/release/12.9.0-notes.rst index 1ffb28cc7b4..40b6c0ac853 100644 --- a/cuda_bindings/docs/source/release/12.9.0-notes.rst +++ b/cuda_bindings/docs/source/release/12.9.0-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 ``cuda-bindings`` 12.9.0 Release notes ====================================== 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 49531c9de22..bb536b8a135 100644 --- a/cuda_bindings/docs/source/release/12.9.1-notes.rst +++ b/cuda_bindings/docs/source/release/12.9.1-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 .. module:: cuda.bindings diff --git a/cuda_bindings/docs/source/release/12.9.2-notes.rst b/cuda_bindings/docs/source/release/12.9.2-notes.rst index b22bdb39413..11d3bf0af31 100644 --- a/cuda_bindings/docs/source/release/12.9.2-notes.rst +++ b/cuda_bindings/docs/source/release/12.9.2-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 .. module:: cuda.bindings diff --git a/cuda_bindings/docs/source/release/12.9.3-notes.rst b/cuda_bindings/docs/source/release/12.9.3-notes.rst index 07b8d4072f1..66876a7f3eb 100644 --- a/cuda_bindings/docs/source/release/12.9.3-notes.rst +++ b/cuda_bindings/docs/source/release/12.9.3-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 .. module:: cuda.bindings diff --git a/cuda_bindings/docs/source/release/12.9.4-notes.rst b/cuda_bindings/docs/source/release/12.9.4-notes.rst index cf834c8c97c..79abcd35dba 100644 --- a/cuda_bindings/docs/source/release/12.9.4-notes.rst +++ b/cuda_bindings/docs/source/release/12.9.4-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 .. module:: cuda.bindings diff --git a/cuda_bindings/docs/source/release/12.9.5-notes.rst b/cuda_bindings/docs/source/release/12.9.5-notes.rst index 9d1939fd814..13c49394a29 100644 --- a/cuda_bindings/docs/source/release/12.9.5-notes.rst +++ b/cuda_bindings/docs/source/release/12.9.5-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 .. module:: cuda.bindings diff --git a/cuda_bindings/docs/source/release/12.9.6-notes.rst b/cuda_bindings/docs/source/release/12.9.6-notes.rst index dd508ff1478..1589796ed9a 100644 --- a/cuda_bindings/docs/source/release/12.9.6-notes.rst +++ b/cuda_bindings/docs/source/release/12.9.6-notes.rst @@ -1,5 +1,5 @@ .. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-License-Identifier: Apache-2.0 .. module:: cuda.bindings @@ -31,7 +31,7 @@ Bugfixes * Fixed an issue where the ``CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL`` attribute was retrieved as an unsigned int, rather than a signed int. - (`PR #1336 `_) + (`PR #1451 `_) * Fixed a use-after-free in ``_HelperInputVoidPtr`` properties when backed by Python buffer objects. (`PR #1629 `_) diff --git a/cuda_bindings/docs/source/release/12.9.7-notes.rst b/cuda_bindings/docs/source/release/12.9.7-notes.rst new file mode 100644 index 00000000000..842f1f3923e --- /dev/null +++ b/cuda_bindings/docs/source/release/12.9.7-notes.rst @@ -0,0 +1,53 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. module:: cuda.bindings + +``cuda-bindings`` 12.9.7 Release notes +====================================== + +Bugfixes +-------- + +* Fixed ``CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM=0`` incorrectly enabling + per-thread default stream mode. + (`PR #2110 `_) + +* Fixed a use-after-free in ``cudaGraphGetEdges``, ``cudaGraphNodeGetDependencies``, + ``cudaGraphNodeGetDependentNodes``, ``cudaStreamGetCaptureInfo``, and their + driver-API counterparts (``cuGraphGetEdges``, ``cuGraphNodeGetDependencies``, + ``cuGraphNodeGetDependentNodes``, ``cuStreamGetCaptureInfo``). The returned + ``cudaGraphEdgeData``/``CUgraphEdgeData`` wrappers were backed by a scratch + buffer that was freed before the call returned, leaving every wrapper holding + a dangling pointer. The returned wrappers now own deep copies of the edge + data. + (`Issue #1804 `_, + `PR #2110 `_) + +* Fixed a double-free in the generated setters for list-valued struct members + (e.g. ``CUlaunchConfig.attrs``, ``CUDA_MEM_ALLOC_NODE_PARAMS.accessDescs``, + external-semaphore and batch-mem-op node parameter arrays, and their runtime + counterparts). Assigning an empty list freed the internal buffer but left + the cached pointer non-NULL, so a subsequent assignment or ``__dealloc__`` + would call ``free()`` again on the dangling pointer. + (`PR #2115 `_) + +Miscellaneous +------------- + +* NVRTC bindings now use pre-generated Cython files and no longer require + pyclibrary header parsing at build time. + (`PR #1957 `_) + +* Improved generated documentation and argument names, including the ``ind_ex`` + argument naming bug. + (`PR #1928 `_, + `PR #2110 `_) + +* Source archives now include git archival metadata for setuptools-scm. + (`PR #1756 `_) + +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.0-notes.rst b/cuda_bindings/docs/source/release/13.0.0-notes.rst index 138ff6091b3..7f0ea720a6e 100644 --- a/cuda_bindings/docs/source/release/13.0.0-notes.rst +++ b/cuda_bindings/docs/source/release/13.0.0-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 .. module:: cuda.bindings diff --git a/cuda_bindings/docs/source/release/13.0.1-notes.rst b/cuda_bindings/docs/source/release/13.0.1-notes.rst index 1280de46078..545d72642ac 100644 --- a/cuda_bindings/docs/source/release/13.0.1-notes.rst +++ b/cuda_bindings/docs/source/release/13.0.1-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 .. module:: cuda.bindings diff --git a/cuda_bindings/docs/source/release/13.0.2-notes.rst b/cuda_bindings/docs/source/release/13.0.2-notes.rst index 5148b95a277..0e34f0bef8d 100644 --- a/cuda_bindings/docs/source/release/13.0.2-notes.rst +++ b/cuda_bindings/docs/source/release/13.0.2-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 .. module:: cuda.bindings diff --git a/cuda_bindings/docs/source/release/13.0.3-notes.rst b/cuda_bindings/docs/source/release/13.0.3-notes.rst index 1c48d7e3f2e..244289067ac 100644 --- a/cuda_bindings/docs/source/release/13.0.3-notes.rst +++ b/cuda_bindings/docs/source/release/13.0.3-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 .. module:: cuda.bindings diff --git a/cuda_bindings/docs/source/release/13.1.0-notes.rst b/cuda_bindings/docs/source/release/13.1.0-notes.rst index 5da7659ba34..741830842c6 100644 --- a/cuda_bindings/docs/source/release/13.1.0-notes.rst +++ b/cuda_bindings/docs/source/release/13.1.0-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 .. module:: cuda.bindings diff --git a/cuda_bindings/docs/source/release/13.1.1-notes.rst b/cuda_bindings/docs/source/release/13.1.1-notes.rst index 37353cbe145..97139642d06 100644 --- a/cuda_bindings/docs/source/release/13.1.1-notes.rst +++ b/cuda_bindings/docs/source/release/13.1.1-notes.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 .. module:: cuda.bindings @@ -12,7 +12,7 @@ Highlights ---------- * Add missing driver & runtime bindings for functions new in CTK 13.1.0 - (`PR #1321 `_) + (`PR #1337 `_) Experimental ------------ diff --git a/cuda_bindings/docs/source/release/13.2.0-notes.rst b/cuda_bindings/docs/source/release/13.2.0-notes.rst index d255fa8e20c..7f807d372a3 100644 --- a/cuda_bindings/docs/source/release/13.2.0-notes.rst +++ b/cuda_bindings/docs/source/release/13.2.0-notes.rst @@ -1,5 +1,5 @@ .. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-License-Identifier: Apache-2.0 .. module:: cuda.bindings @@ -14,12 +14,11 @@ Highlights ``cuStreamBeginCaptureToCig``, ``cuLaunchHostFunc_v2``, ``cuGraphNodeGetParams``, coredump callback registration, and more) and their runtime counterparts. -* ``cuda.bindings.nvml`` has graduated from experimental (``cuda.bindings._nvml``) - to a fully supported public module with extensive handwritten Pythonic API - coverage spanning ~170 functions across system queries, device discovery, - memory, power, clocks, utilization, thermals, NVLink, and device configuration. - (`PR #1524 `_, - `PR #1548 `_) +* ``cuda.bindings.nvml`` has graduated from experimental + (``cuda.bindings._nvml``) to a fully supported public module with coverage + spanning 378 functions. `PR #1524 + `_, `PR #1548 + `_) * Add ``nvFatbin`` bindings. (`PR #1467 `_) * Performance improvement: ``cuda.bindings`` now uses a faster ``enum`` @@ -40,7 +39,7 @@ Bugfixes * Fixed an issue where the ``CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL`` attribute was retrieved as an unsigned int, rather than a signed int. - (`PR #1336 `_) + (`PR #1451 `_) * Fixed ABI incompatibility bugs in cuFILE bindings introduced in v13.1.0. (`PR #1468 `_) * Fixed a use-after-free in ``_HelperInputVoidPtr`` properties when backed by @@ -81,3 +80,4 @@ 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``. +* ``nvml.system_get_process_name`` on WSL can return incorrect values. To work around this, set the locale to "C" before calling ``nvml.device_get_compute_running_processes_v3`` (which sets the process names) and before calling ``nvml.system_get_process_name``. ``cuda_core`` does this automatically, but users of the raw NVML API will need to do this manually. diff --git a/cuda_bindings/docs/source/release/13.3.0-notes.rst b/cuda_bindings/docs/source/release/13.3.0-notes.rst new file mode 100644 index 00000000000..88a7ea1c332 --- /dev/null +++ b/cuda_bindings/docs/source/release/13.3.0-notes.rst @@ -0,0 +1,92 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. module:: cuda.bindings + +``cuda-bindings`` 13.3.0 Release notes +====================================== + +Highlights +---------- + +* Support for new APIs introduced in CUDA 13.3, including driver logical + endpoint APIs, graph recapture APIs, NVRTC Tile IR and bundled-header APIs, + and related runtime graph/event APIs. + (`PR #2139 `_) + +* Add ``cuda.bindings.cudla`` bindings. + (`PR #2034 `_) + +* Add the ``nvvmLLVMVersion`` binding. + (`PR #1774 `_) + +* Add additional NVML APIs introduced in CUDA 13.2. + (`PR #1830 `_) + +Bugfixes +-------- + +* Fixed the ``cuDevSmResourceSplit`` and ``cudaDevSmResourceSplit`` binding + signatures so ``groupParams`` is accepted as a sequence matching the CUDA API. + (`PR #1766 `_) + +* Fixed nested resource pointer handling to accept both ``str`` and ``bytes`` + inputs. + (`PR #1698 `_) + +* Fixed ``nvmlDeviceGetFieldValues`` and ``nvmlDeviceClearFieldValues`` handling + of empty field lists so they return empty results instead of raising + ``NVML_ERROR_INVALID_ARGUMENT``. + (`PR #1982 `_) + +* Fixed ``CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM=0`` incorrectly enabling + per-thread default stream mode. + (`PR #2076 `_) + +* Fixed a use-after-free in ``cudaGraphGetEdges``, ``cudaGraphNodeGetDependencies``, + ``cudaGraphNodeGetDependentNodes``, ``cudaStreamGetCaptureInfo``, and their + driver-API counterparts (``cuGraphGetEdges``, ``cuGraphNodeGetDependencies``, + ``cuGraphNodeGetDependentNodes``, ``cuStreamGetCaptureInfo``). The returned + ``cudaGraphEdgeData``/``CUgraphEdgeData`` wrappers were backed by a scratch + buffer that was freed before the call returned, leaving every wrapper holding + a dangling pointer. The returned wrappers now own deep copies of the edge + data. + (`Issue #1804 `_, + `PR #2083 `_) + +* Fixed a double-free in the generated setters for list-valued struct members + (e.g. ``CUlaunchConfig.attrs``, ``CUDA_MEM_ALLOC_NODE_PARAMS.accessDescs``, + external-semaphore and batch-mem-op node parameter arrays, and their runtime + counterparts). Assigning an empty list freed the internal buffer but left + the cached pointer non-NULL, so a subsequent assignment or ``__dealloc__`` + would call ``free()`` again on the dangling pointer. + (`PR #2112 `_) + +Miscellaneous +------------- + +* Add ``cuda.bindings.utils.check_nvvm_compiler_options()`` to check whether a + set of NVVM compiler options is supported by the installed NVVM library. + (`PR #1837 `_) + +* NVRTC bindings now use pre-generated Cython files and no longer require + pyclibrary header parsing at build time. + (`PR #1900 `_) + +* Improved generated documentation and argument names, including the ``ind_ex`` + argument naming bug. + (`PR #1927 `_, + `PR #2082 `_) + +* Fixed ``cuda-bindings`` debug builds. + (`PR #1890 `_) + +* Declare ``cuda-pathfinder`` as a host dependency for pixi path-dependency + builds of ``cuda-bindings``. + (`PR #1926 `_) + +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``. +* ``nvml.system_get_process_name`` on WSL can return incorrect values. To work around this, set the locale to "C" before calling ``nvml.device_get_compute_running_processes_v3`` (which sets the process names) and before calling ``nvml.system_get_process_name``. ``cuda_core`` does this automatically, but users of the raw NVML API will need to do this manually. diff --git a/cuda_bindings/docs/source/release/13.3.1-notes.rst b/cuda_bindings/docs/source/release/13.3.1-notes.rst new file mode 100644 index 00000000000..5dbceb43fbc --- /dev/null +++ b/cuda_bindings/docs/source/release/13.3.1-notes.rst @@ -0,0 +1,26 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. module:: cuda.bindings + +``cuda-bindings`` 13.3.1 Release notes +====================================== + +Bugfixes +-------- + +* Restored the ``CUcheckpointRestoreArgs`` and ``CUcheckpointRestoreArgs_st`` + driver bindings for CUDA 13.3. CUDA 13.3 changed the checkpoint restore + argument layout in a way that caused header parsing to omit the restore + argument struct and typedef during generation. + (`PR #2144 `_) + +* Fixed generated CUDA 13.3 driver API documentation for checkpoint restore + arguments and related references. + (`PR #2144 `_) + +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``. +* ``nvml.system_get_process_name`` on WSL can return incorrect values. To work around this, set the locale to "C" before calling ``nvml.device_get_compute_running_processes_v3`` (which sets the process names) and before calling ``nvml.system_get_process_name``. ``cuda_core`` does this automatically, but users of the raw NVML API will need to do this manually. diff --git a/cuda_bindings/docs/source/support.rst b/cuda_bindings/docs/source/support.rst index 4439d963c0e..5c292eb5cb5 100644 --- a/cuda_bindings/docs/source/support.rst +++ b/cuda_bindings/docs/source/support.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 .. _support: @@ -38,7 +38,7 @@ The NVIDIA CUDA Python team reserves rights to amend the above support policy. A however, will be announced to the users in advance. -.. _CUDA minor version compatibility: https://docs.nvidia.com/deploy/cuda-compatibility/#minor-version-compatibility +.. _CUDA minor version compatibility: https://docs.nvidia.com/deploy/cuda-compatibility/minor-version-compatibility.html .. _CPython EOL schedule: https://devguide.python.org/versions/ .. _built-in modules that are known to be thread-unsafe: https://github.com/python/cpython/issues/116738 .. _free-threaded interpreter: https://docs.python.org/3/howto/free-threading-python.html diff --git a/cuda_bindings/docs/source/tips_and_tricks.rst b/cuda_bindings/docs/source/tips_and_tricks.rst index 1a77eb53fd5..adedb14eeb4 100644 --- a/cuda_bindings/docs/source/tips_and_tricks.rst +++ b/cuda_bindings/docs/source/tips_and_tricks.rst @@ -1,5 +1,5 @@ -.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 Tips and Tricks --------------- diff --git a/cuda_bindings/examples/0_Introduction/clock_nvrtc_test.py b/cuda_bindings/examples/0_Introduction/clock_nvrtc.py similarity index 78% rename from cuda_bindings/examples/0_Introduction/clock_nvrtc_test.py rename to cuda_bindings/examples/0_Introduction/clock_nvrtc.py index d67f180fe02..14572469e79 100644 --- a/cuda_bindings/examples/0_Introduction/clock_nvrtc_test.py +++ b/cuda_bindings/examples/0_Introduction/clock_nvrtc.py @@ -1,13 +1,23 @@ -# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# ################################################################################ +# +# This example demonstrates using the device clock for kernel timing via +# NVRTC-compiled CUDA code. +# +# ################################################################################ + +# /// script +# dependencies = ["cuda_bindings>13.2.1", "numpy"] +# /// import platform import numpy as np -from common import common -from common.helper_cuda import check_cuda_errors, find_cuda_device from cuda.bindings import driver as cuda +from cuda.bindings._example_helpers import KernelHelper, check_cuda_errors, find_cuda_device, requirement_not_met clock_nvrtc = """\ extern "C" __global__ void timedReduction(const float *hinput, float *output, clock_t *timer) @@ -58,11 +68,13 @@ def elems_to_bytes(nelems, dt): return nelems * np.dtype(dt).itemsize -def main(): - import pytest - +def check_requirements(): if platform.machine() == "armv7l": - pytest.skip("clock_nvrtc is not supported on ARMv7") + requirement_not_met("clock_nvrtc is not supported on ARMv7") + + +def main(): + check_requirements() timer = np.empty(num_blocks * 2, dtype="int64") hinput = np.empty(num_threads * 2, dtype="float32") @@ -71,7 +83,7 @@ def main(): hinput[i] = i dev_id = find_cuda_device() - kernel_helper = common.KernelHelper(clock_nvrtc, dev_id) + kernel_helper = KernelHelper(clock_nvrtc, dev_id) kernel_addr = kernel_helper.get_function(b"timedReduction") dinput = check_cuda_errors(cuda.cuMemAlloc(hinput.nbytes)) diff --git a/cuda_bindings/examples/0_Introduction/simpleCubemapTexture_test.py b/cuda_bindings/examples/0_Introduction/simple_cubemap_texture.py similarity index 90% rename from cuda_bindings/examples/0_Introduction/simpleCubemapTexture_test.py rename to cuda_bindings/examples/0_Introduction/simple_cubemap_texture.py index 5d764509cea..cad35990e91 100644 --- a/cuda_bindings/examples/0_Introduction/simpleCubemapTexture_test.py +++ b/cuda_bindings/examples/0_Introduction/simple_cubemap_texture.py @@ -1,16 +1,27 @@ -# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# ################################################################################ +# +# This example demonstrates cubemap texture sampling and transformation. +# +# ################################################################################ + + +# /// script +# dependencies = ["cuda_bindings>13.2.1", "numpy"] +# /// + import ctypes import sys import time import numpy as np -from common import common -from common.helper_cuda import check_cuda_errors, find_cuda_device from cuda.bindings import driver as cuda from cuda.bindings import runtime as cudart +from cuda.bindings._example_helpers import KernelHelper, check_cuda_errors, find_cuda_device, requirement_not_met simple_cubemap_texture = """\ extern "C" @@ -91,9 +102,7 @@ def main(): f"CUDA device [{device_props.name}] has {device_props.multiProcessorCount} Multi-Processors SM {device_props.major}.{device_props.minor}" ) if device_props.major < 2: - import pytest - - pytest.skip("Test requires SM 2.0 or higher for support of Texture Arrays.") + requirement_not_met("Test requires SM 2.0 or higher for support of Texture Arrays.") # Generate input data for layered texture width = 64 @@ -156,7 +165,7 @@ def main(): f"Covering Cubemap data array of {width}~3 x {num_layers}: Grid size is {dim_grid.x} x {dim_grid.y}, each block has 8 x 8 threads" ) - kernel_helper = common.KernelHelper(simple_cubemap_texture, dev_id) + kernel_helper = KernelHelper(simple_cubemap_texture, dev_id) _transform_kernel = kernel_helper.get_function(b"transformKernel") kernel_args = ((d_data, width, tex), (ctypes.c_void_p, ctypes.c_int, None)) check_cuda_errors( diff --git a/cuda_bindings/examples/0_Introduction/simpleP2P_test.py b/cuda_bindings/examples/0_Introduction/simple_p2p.py similarity index 87% rename from cuda_bindings/examples/0_Introduction/simpleP2P_test.py rename to cuda_bindings/examples/0_Introduction/simple_p2p.py index 09dafa1be11..0c6700bc8df 100644 --- a/cuda_bindings/examples/0_Introduction/simpleP2P_test.py +++ b/cuda_bindings/examples/0_Introduction/simple_p2p.py @@ -1,16 +1,26 @@ -# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# ################################################################################ +# +# This example demonstrates peer-to-peer memory access and data transfer +# between multiple GPUs. +# +# ################################################################################ + +# /// script +# dependencies = ["cuda_bindings>13.2.1", "numpy"] +# /// import ctypes import platform import sys import numpy as np -from common import common -from common.helper_cuda import check_cuda_errors from cuda.bindings import driver as cuda from cuda.bindings import runtime as cudart +from cuda.bindings._example_helpers import KernelHelper, check_cuda_errors, requirement_not_met simplep2p = """\ extern "C" @@ -25,19 +35,17 @@ def main(): - import pytest - if platform.system() == "Darwin": - pytest.skip("simpleP2P is not supported on Mac OSX") + requirement_not_met("simpleP2P is not supported on Mac OSX") if platform.machine() == "armv7l": - pytest.skip("simpleP2P is not supported on ARMv7") + requirement_not_met("simpleP2P is not supported on ARMv7") if platform.machine() == "aarch64": - pytest.skip("simpleP2P is not supported on aarch64") + requirement_not_met("simpleP2P is not supported on aarch64") if platform.machine() == "sbsa": - pytest.skip("simpleP2P is not supported on sbsa") + requirement_not_met("simpleP2P is not supported on sbsa") # Number of GPUs print("Checking for multiple GPUs...") @@ -45,7 +53,7 @@ def main(): print(f"CUDA-capable device count: {gpu_n}") if gpu_n < 2: - pytest.skip("Two or more GPUs with Peer-to-Peer access capability are required") + requirement_not_met("Two or more GPUs with Peer-to-Peer access capability are required") prop = [check_cuda_errors(cudart.cudaGetDeviceProperties(i)) for i in range(gpu_n)] # Check possibility for peer access @@ -66,7 +74,7 @@ def main(): ) print( "> Peer access from {} (GPU{}) -> {} (GPU{}) : {}\n".format( - prop[j].name, j, prop[i].name, i, "Yes" if i_access_j else "No" + prop[j].name, j, prop[i].name, i, "Yes" if j_access_i else "No" ) ) if i_access_j and j_access_i: @@ -76,7 +84,7 @@ def main(): break if p2p_capable_gp_us[0] == -1 or p2p_capable_gp_us[1] == -1: - pytest.skip("Peer to Peer access is not available amongst GPUs in the system") + requirement_not_met("Peer to Peer access is not available amongst GPUs in the system") # Use first pair of p2p capable GPUs detected gpuid = [p2p_capable_gp_us[0], p2p_capable_gp_us[1]] @@ -151,7 +159,7 @@ def main(): _simple_kernel = [None] * 2 kernel_args = [None] * 2 - kernel_helper[1] = common.KernelHelper(simplep2p, gpuid[1]) + kernel_helper[1] = KernelHelper(simplep2p, gpuid[1]) _simple_kernel[1] = kernel_helper[1].get_function(b"SimpleKernel") kernel_args[1] = ((g0, g1), (ctypes.c_void_p, ctypes.c_void_p)) check_cuda_errors( @@ -176,7 +184,7 @@ def main(): # output to the GPU 0 buffer print(f"Run kernel on GPU{gpuid[0]}, taking source data from GPU{gpuid[1]} and writing to GPU{gpuid[0]}...") check_cuda_errors(cudart.cudaSetDevice(gpuid[0])) - kernel_helper[0] = common.KernelHelper(simplep2p, gpuid[0]) + kernel_helper[0] = KernelHelper(simplep2p, gpuid[0]) _simple_kernel[0] = kernel_helper[0].get_function(b"SimpleKernel") kernel_args[0] = ((g1, g0), (ctypes.c_void_p, ctypes.c_void_p)) check_cuda_errors( diff --git a/cuda_bindings/examples/0_Introduction/simpleZeroCopy_test.py b/cuda_bindings/examples/0_Introduction/simple_zero_copy.py similarity index 82% rename from cuda_bindings/examples/0_Introduction/simpleZeroCopy_test.py rename to cuda_bindings/examples/0_Introduction/simple_zero_copy.py index d4bf44e19a8..72c5fe8b701 100644 --- a/cuda_bindings/examples/0_Introduction/simpleZeroCopy_test.py +++ b/cuda_bindings/examples/0_Introduction/simple_zero_copy.py @@ -1,5 +1,16 @@ -# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# ################################################################################ +# +# This example demonstrates vector addition using zero-copy (mapped) host +# memory, allowing the GPU to access CPU memory directly. +# +# ################################################################################ + +# /// script +# dependencies = ["cuda_bindings>13.2.1", "numpy"] +# /// import ctypes import math @@ -8,12 +19,16 @@ import sys import numpy as np -from common import common -from common.helper_cuda import check_cuda_errors -from common.helper_string import check_cmd_line_flag, get_cmd_line_argument_int from cuda.bindings import driver as cuda from cuda.bindings import runtime as cudart +from cuda.bindings._example_helpers import ( + KernelHelper, + check_cmd_line_flag, + check_cuda_errors, + get_cmd_line_argument_int, + requirement_not_met, +) simple_zero_copy = """\ extern "C" @@ -33,19 +48,17 @@ def main(): idev = 0 b_pin_generic_memory = False - import pytest - if platform.system() == "Darwin": - pytest.skip("simpleZeroCopy is not supported on Mac OSX") + requirement_not_met("simpleZeroCopy is not supported on Mac OSX") if platform.machine() == "armv7l": - pytest.skip("simpleZeroCopy is not supported on ARMv7") + requirement_not_met("simpleZeroCopy is not supported on ARMv7") if platform.machine() == "aarch64": - pytest.skip("simpleZeroCopy is not supported on aarch64") + requirement_not_met("simpleZeroCopy is not supported on aarch64") if platform.machine() == "sbsa": - pytest.skip("simpleZeroCopy is not supported on sbsa") + requirement_not_met("simpleZeroCopy is not supported on sbsa") if check_cmd_line_flag("help"): print("Usage: simpleZeroCopy [OPTION]\n", file=sys.stderr) @@ -77,7 +90,7 @@ def main(): device_prop = check_cuda_errors(cudart.cudaGetDeviceProperties(idev)) if not device_prop.canMapHostMemory: - pytest.skip(f"Device {idev} does not support mapping CPU host memory!") + requirement_not_met(f"Device {idev} does not support mapping CPU host memory!") check_cuda_errors(cudart.cudaSetDeviceFlags(cudart.cudaDeviceMapHost)) @@ -124,7 +137,7 @@ def main(): grid.x = math.ceil(nelem / float(block.x)) grid.y = 1 grid.z = 1 - kernel_helper = common.KernelHelper(simple_zero_copy, idev) + kernel_helper = KernelHelper(simple_zero_copy, idev) _vector_add_gpu = kernel_helper.get_function(b"vectorAddGPU") kernel_args = ( (d_a, d_b, d_c, nelem), diff --git a/cuda_bindings/examples/0_Introduction/systemWideAtomics_test.py b/cuda_bindings/examples/0_Introduction/system_wide_atomics.py similarity index 86% rename from cuda_bindings/examples/0_Introduction/systemWideAtomics_test.py rename to cuda_bindings/examples/0_Introduction/system_wide_atomics.py index 94a356101ff..fde3e67ad8f 100644 --- a/cuda_bindings/examples/0_Introduction/systemWideAtomics_test.py +++ b/cuda_bindings/examples/0_Introduction/system_wide_atomics.py @@ -1,16 +1,25 @@ -# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# ################################################################################ +# +# This example demonstrates system-wide atomic operations on managed memory. +# +# ################################################################################ + +# /// script +# dependencies = ["cuda_bindings>13.2.1", "numpy"] +# /// import ctypes import os import sys import numpy as np -from common import common -from common.helper_cuda import check_cuda_errors, find_cuda_device from cuda.bindings import driver as cuda from cuda.bindings import runtime as cudart +from cuda.bindings._example_helpers import KernelHelper, check_cuda_errors, find_cuda_device, requirement_not_met system_wide_atomics = """\ #define LOOP_NUM 50 @@ -166,26 +175,24 @@ def verify(test_data, length): def main(): - import pytest - if os.name == "nt": - pytest.skip("Atomics not supported on Windows") + requirement_not_met("Atomics not supported on Windows") # set device dev_id = find_cuda_device() device_prop = check_cuda_errors(cudart.cudaGetDeviceProperties(dev_id)) if not device_prop.managedMemory: - pytest.skip("Unified Memory not supported on this device") + requirement_not_met("Unified Memory not supported on this device") compute_mode = check_cuda_errors( cudart.cudaDeviceGetAttribute(cudart.cudaDeviceAttr.cudaDevAttrComputeMode, dev_id) ) if compute_mode == cudart.cudaComputeMode.cudaComputeModeProhibited: - pytest.skip("This sample requires a device in either default or process exclusive mode") + requirement_not_met("This sample requires a device in either default or process exclusive mode") if device_prop.major < 6: - pytest.skip("Requires a minimum CUDA compute 6.0 capability") + requirement_not_met("Requires a minimum CUDA compute 6.0 capability") num_threads = 256 num_blocks = 64 @@ -208,7 +215,7 @@ def main(): # To make the AND and XOR tests generate something other than 0... atom_arr_h[7] = atom_arr_h[9] = 0xFF - kernel_helper = common.KernelHelper(system_wide_atomics, dev_id) + kernel_helper = KernelHelper(system_wide_atomics, dev_id) _atomic_kernel = kernel_helper.get_function(b"atomicKernel") kernel_args = ((atom_arr,), (ctypes.c_void_p,)) check_cuda_errors( diff --git a/cuda_bindings/examples/0_Introduction/vectorAddDrv_test.py b/cuda_bindings/examples/0_Introduction/vector_add_drv.py similarity index 65% rename from cuda_bindings/examples/0_Introduction/vectorAddDrv_test.py rename to cuda_bindings/examples/0_Introduction/vector_add_drv.py index 8c70aadd3aa..d2356c0d3a1 100644 --- a/cuda_bindings/examples/0_Introduction/vectorAddDrv_test.py +++ b/cuda_bindings/examples/0_Introduction/vector_add_drv.py @@ -1,15 +1,25 @@ -# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# ################################################################################ +# +# This example demonstrates vector addition using the CUDA Driver API with +# unified virtual addressing. +# +# ################################################################################ + +# /// script +# dependencies = ["cuda_bindings>13.2.1", "numpy"] +# /// import ctypes import math import sys import numpy as np -from common import common -from common.helper_cuda import check_cuda_errors, find_cuda_device_drv from cuda.bindings import driver as cuda +from cuda.bindings._example_helpers import KernelHelper, check_cuda_errors, find_cuda_device_drv, requirement_not_met vector_add_drv = """\ /* Vector addition: C = A + B. @@ -45,11 +55,9 @@ def main(): cuda.cuDeviceGetAttribute(cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING, cu_device) ) if not uva_supported: - import pytest + requirement_not_met("Accessing pageable memory directly requires UVA") - pytest.skip("Accessing pageable memory directly requires UVA") - - kernel_helper = common.KernelHelper(vector_add_drv, int(cu_device)) + kernel_helper = KernelHelper(vector_add_drv, int(cu_device)) _vec_add_kernel = kernel_helper.get_function(b"VecAdd_kernel") # Allocate input vectors h_A and h_B in host memory @@ -66,31 +74,28 @@ def main(): check_cuda_errors(cuda.cuMemcpyHtoD(d_a, h_a, nbytes)) check_cuda_errors(cuda.cuMemcpyHtoD(d_b, h_b, nbytes)) - if True: - # Grid/Block configuration - threads_per_block = 256 - blocks_per_grid = (n + threads_per_block - 1) / threads_per_block - - kernel_args = ((d_a, d_b, d_c, n), (None, None, None, ctypes.c_int)) - - # Launch the CUDA kernel - check_cuda_errors( - cuda.cuLaunchKernel( - _vec_add_kernel, - blocks_per_grid, - 1, - 1, - threads_per_block, - 1, - 1, - 0, - 0, - kernel_args, - 0, - ) + # Grid/Block configuration + threads_per_block = 256 + blocks_per_grid = (n + threads_per_block - 1) / threads_per_block + + kernel_args = ((d_a, d_b, d_c, n), (None, None, None, ctypes.c_int)) + + # Launch the CUDA kernel + check_cuda_errors( + cuda.cuLaunchKernel( + _vec_add_kernel, + blocks_per_grid, + 1, + 1, + threads_per_block, + 1, + 1, + 0, + 0, + kernel_args, + 0, ) - else: - pass + ) # Copy result from device memory to host memory # h_C contains the result in host memory diff --git a/cuda_bindings/examples/0_Introduction/vectorAddMMAP_test.py b/cuda_bindings/examples/0_Introduction/vector_add_mmap.py similarity index 91% rename from cuda_bindings/examples/0_Introduction/vectorAddMMAP_test.py rename to cuda_bindings/examples/0_Introduction/vector_add_mmap.py index d5e2e3d26fc..9faa45bedb8 100644 --- a/cuda_bindings/examples/0_Introduction/vectorAddMMAP_test.py +++ b/cuda_bindings/examples/0_Introduction/vector_add_mmap.py @@ -1,5 +1,16 @@ -# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# ################################################################################ +# +# This example demonstrates vector addition using multi-device memory +# mapping (cuMemCreate, cuMemMap) with virtual address management. +# +# ################################################################################ + +# /// script +# dependencies = ["cuda_bindings>13.2.1", "numpy"] +# /// import ctypes import math @@ -7,10 +18,9 @@ import sys import numpy as np -from common import common -from common.helper_cuda import check_cuda_errors, find_cuda_device_drv from cuda.bindings import driver as cuda +from cuda.bindings._example_helpers import KernelHelper, check_cuda_errors, find_cuda_device_drv, requirement_not_met vector_add_mmap = """\ /* Vector addition: C = A + B. @@ -190,19 +200,17 @@ def simple_free_multi_device_mmap(dptr, size): def main(): - import pytest - if platform.system() == "Darwin": - pytest.skip("vectorAddMMAP is not supported on Mac OSX") + requirement_not_met("vectorAddMMAP is not supported on Mac OSX") if platform.machine() == "armv7l": - pytest.skip("vectorAddMMAP is not supported on ARMv7") + requirement_not_met("vectorAddMMAP is not supported on ARMv7") if platform.machine() == "aarch64": - pytest.skip("vectorAddMMAP is not supported on aarch64") + requirement_not_met("vectorAddMMAP is not supported on aarch64") if platform.machine() == "sbsa": - pytest.skip("vectorAddMMAP is not supported on sbsa") + requirement_not_met("vectorAddMMAP is not supported on sbsa") n = 50000 size = n * np.dtype(np.float32).itemsize @@ -221,7 +229,7 @@ def main(): ) print(f"Device {cu_device} VIRTUAL ADDRESS MANAGEMENT SUPPORTED = {attribute_val}.") if not attribute_val: - pytest.skip(f"Device {cu_device} doesn't support VIRTUAL ADDRESS MANAGEMENT.") + requirement_not_met(f"Device {cu_device} doesn't support VIRTUAL ADDRESS MANAGEMENT.") # The vector addition happens on cuDevice, so the allocations need to be mapped there. mapping_devices = [cu_device] @@ -232,7 +240,7 @@ def main(): # Create context cu_context = check_cuda_errors(cuda.cuCtxCreate(None, 0, cu_device)) - kernel_helper = common.KernelHelper(vector_add_mmap, int(cu_device)) + kernel_helper = KernelHelper(vector_add_mmap, int(cu_device)) _vec_add_kernel = kernel_helper.get_function(b"VecAdd_kernel") # Allocate input vectors h_A and h_B in host memory diff --git a/cuda_bindings/examples/2_Concepts_and_Techniques/streamOrderedAllocation_test.py b/cuda_bindings/examples/2_Concepts_and_Techniques/stream_ordered_allocation.py similarity index 89% rename from cuda_bindings/examples/2_Concepts_and_Techniques/streamOrderedAllocation_test.py rename to cuda_bindings/examples/2_Concepts_and_Techniques/stream_ordered_allocation.py index f26dd2dabe6..b45f11f317b 100644 --- a/cuda_bindings/examples/2_Concepts_and_Techniques/streamOrderedAllocation_test.py +++ b/cuda_bindings/examples/2_Concepts_and_Techniques/stream_ordered_allocation.py @@ -1,5 +1,16 @@ -# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# ################################################################################ +# +# This example demonstrates stream-ordered memory allocation (cudaMallocAsync +# / cudaFreeAsync) and memory pool release thresholds. +# +# ################################################################################ + +# /// script +# dependencies = ["cuda_bindings>13.2.1", "numpy"] +# /// import ctypes import math @@ -8,12 +19,16 @@ import sys import numpy as np -from common import common -from common.helper_cuda import check_cuda_errors, find_cuda_device -from common.helper_string import check_cmd_line_flag from cuda.bindings import driver as cuda from cuda.bindings import runtime as cudart +from cuda.bindings._example_helpers import ( + KernelHelper, + check_cmd_line_flag, + check_cuda_errors, + find_cuda_device, + requirement_not_met, +) stream_ordered_allocation = """\ /* Add two vectors on the GPU */ @@ -122,7 +137,7 @@ def stream_ordered_allocation_post_sync(dev, nelem, a, b, c): threshold_val, ) ) - # Record teh start event + # Record the start event check_cuda_errors(cudart.cudaEventRecord(start, stream)) for _i in range(MAX_ITER): d_a = check_cuda_errors(cudart.cudaMallocAsync(num_bytes, stream)) @@ -198,10 +213,8 @@ def stream_ordered_allocation_post_sync(dev, nelem, a, b, c): def main(): - import pytest - if platform.system() == "Darwin": - pytest.skip("streamOrderedAllocation is not supported on Mac OSX") + requirement_not_met("streamOrderedAllocation is not supported on Mac OSX") cuda.cuInit(0) if check_cmd_line_flag("help"): @@ -220,10 +233,10 @@ def main(): cudart.cudaDeviceGetAttribute(cuda.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MEMORY_POOLS_SUPPORTED, dev) ) if not is_mem_pool_supported: - pytest.skip("Waiving execution as device does not support Memory Pools") + requirement_not_met("Waiving execution as device does not support Memory Pools") global _vector_add_gpu - kernel_helper = common.KernelHelper(stream_ordered_allocation, dev) + kernel_helper = KernelHelper(stream_ordered_allocation, dev) _vector_add_gpu = kernel_helper.get_function(b"vectorAddGPU") # Allocate CPU memory diff --git a/cuda_bindings/examples/3_CUDA_Features/globalToShmemAsyncCopy_test.py b/cuda_bindings/examples/3_CUDA_Features/global_to_shmem_async_copy.py similarity index 97% rename from cuda_bindings/examples/3_CUDA_Features/globalToShmemAsyncCopy_test.py rename to cuda_bindings/examples/3_CUDA_Features/global_to_shmem_async_copy.py index 722d19dcb53..9a2ec3dec3b 100644 --- a/cuda_bindings/examples/3_CUDA_Features/globalToShmemAsyncCopy_test.py +++ b/cuda_bindings/examples/3_CUDA_Features/global_to_shmem_async_copy.py @@ -1,5 +1,16 @@ -# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# ################################################################################ +# +# This example demonstrates asynchronous copy from global to shared memory +# (memcpy_async) in matrix multiplication kernels. +# +# ################################################################################ + +# /// script +# dependencies = ["cuda_bindings>13.2.1", "numpy"] +# /// import ctypes import math @@ -8,12 +19,18 @@ from enum import Enum import numpy as np -from common import common -from common.helper_cuda import check_cuda_errors, find_cuda_device -from common.helper_string import check_cmd_line_flag, get_cmd_line_argument_int from cuda.bindings import driver as cuda from cuda.bindings import runtime as cudart +from cuda.bindings._example_helpers import ( + KernelHelper, + check_cmd_line_flag, + check_compute_capability_too_low, + check_cuda_errors, + find_cuda_device, + get_cmd_line_argument_int, + requirement_not_met, +) block_size = 16 @@ -1123,16 +1140,14 @@ def matrix_multiply(dims_a, dims_b, kernel_number): def main(): - import pytest - - common.pytest_skipif_compute_capability_too_low(find_cuda_device(), (7, 0)) + check_compute_capability_too_low(find_cuda_device(), (7, 0)) - if platform.machine() == "qnx": - pytest.skip("globalToShmemAsyncCopy is not supported on QNX") + if platform.system() == "QNX": + requirement_not_met("globalToShmemAsyncCopy is not supported on QNX") version = check_cuda_errors(cuda.cuDriverGetVersion()) if version < 11010: - pytest.skip("CUDA Toolkit 11.1 or greater is required") + requirement_not_met("CUDA Toolkit 11.1 or greater is required") if check_cmd_line_flag("help") or check_cmd_line_flag("?"): print("Usage device=n (n >= 0 for deviceID)", file=sys.stderr) @@ -1200,7 +1215,7 @@ def main(): cudart.cudaDeviceGetAttribute(cudart.cudaDeviceAttr.cudaDevAttrComputeCapabilityMajor, dev_id) ) if major < 7: - pytest.skip("globalToShmemAsyncCopy requires SM 7.0 or higher.") + requirement_not_met("globalToShmemAsyncCopy requires SM 7.0 or higher.") print(f"MatrixA({dims_a.x},{dims_a.y}), MatrixB({dims_b.x},{dims_b.y})") @@ -1212,7 +1227,7 @@ def main(): global _MatrixMulAsyncCopySingleStage global _MatrixMulNaive global _MatrixMulNaiveLargeChunk - kernel_helper = common.KernelHelper(global_to_shmem_async_copy, dev_id) + kernel_helper = KernelHelper(global_to_shmem_async_copy, dev_id) _MatrixMulAsyncCopyMultiStageLargeChunk = kernel_helper.get_function(b"MatrixMulAsyncCopyMultiStageLargeChunk") _MatrixMulAsyncCopyLargeChunk = kernel_helper.get_function(b"MatrixMulAsyncCopyLargeChunk") _MatrixMulAsyncCopyLargeChunkAWBarrier = kernel_helper.get_function(b"MatrixMulAsyncCopyLargeChunkAWBarrier") diff --git a/cuda_bindings/examples/3_CUDA_Features/simpleCudaGraphs_test.py b/cuda_bindings/examples/3_CUDA_Features/simple_cuda_graphs.py similarity index 95% rename from cuda_bindings/examples/3_CUDA_Features/simpleCudaGraphs_test.py rename to cuda_bindings/examples/3_CUDA_Features/simple_cuda_graphs.py index b08da3edc03..317a774d5df 100644 --- a/cuda_bindings/examples/3_CUDA_Features/simpleCudaGraphs_test.py +++ b/cuda_bindings/examples/3_CUDA_Features/simple_cuda_graphs.py @@ -1,15 +1,29 @@ -# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# ################################################################################ +# +# This example demonstrates CUDA Graphs for capture and replay of GPU +# workloads, including manual graph construction and stream capture. +# +# ################################################################################ + +# /// script +# dependencies = ["cuda_bindings>13.2.1", "numpy"] +# /// import ctypes import random as rnd import numpy as np -from common import common -from common.helper_cuda import check_cuda_errors, find_cuda_device from cuda.bindings import driver as cuda from cuda.bindings import runtime as cudart +from cuda.bindings._example_helpers import ( + KernelHelper, + check_cuda_errors, + find_cuda_device, +) THREADS_PER_BLOCK = 512 GRAPH_LAUNCH_ITERATIONS = 3 @@ -371,7 +385,7 @@ def main(): global _reduce global _reduceFinal - kernel_helper = common.KernelHelper(simple_cuda_graphs, dev_id) + kernel_helper = KernelHelper(simple_cuda_graphs, dev_id) _reduce = kernel_helper.get_function(b"reduce") _reduceFinal = kernel_helper.get_function(b"reduceFinal") diff --git a/cuda_bindings/examples/4_CUDA_Libraries/conjugateGradientMultiBlockCG_test.py b/cuda_bindings/examples/4_CUDA_Libraries/conjugate_gradient_multi_block_cg.py similarity index 76% rename from cuda_bindings/examples/4_CUDA_Libraries/conjugateGradientMultiBlockCG_test.py rename to cuda_bindings/examples/4_CUDA_Libraries/conjugate_gradient_multi_block_cg.py index 8ef55062576..83d359b1e93 100644 --- a/cuda_bindings/examples/4_CUDA_Libraries/conjugateGradientMultiBlockCG_test.py +++ b/cuda_bindings/examples/4_CUDA_Libraries/conjugate_gradient_multi_block_cg.py @@ -1,5 +1,16 @@ -# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# ################################################################################ +# +# This example demonstrates a conjugate gradient solver using cooperative +# groups and multi-block grid synchronization. +# +# ################################################################################ + +# /// script +# dependencies = ["cuda_bindings>13.2.1", "numpy"] +# /// import ctypes import math @@ -8,11 +19,15 @@ from random import random import numpy as np -from common import common -from common.helper_cuda import check_cuda_errors, find_cuda_device from cuda.bindings import driver as cuda from cuda.bindings import runtime as cudart +from cuda.bindings._example_helpers import ( + KernelHelper, + check_cuda_errors, + find_cuda_device, + requirement_not_met, +) conjugate_gradient_multi_block_cg = """\ #line __LINE__ @@ -163,75 +178,72 @@ """ -def gen_tridiag(i, j, val, n, nz): - i[0] = 0 - j[0] = 0 - j[1] = 0 +def gen_tridiag(row_offsets, col_indices, values, n, nz): + row_offsets[0] = 0 + col_indices[0] = 0 + col_indices[1] = 0 - val[0] = float(random()) + 10.0 - val[1] = float(random()) + values[0] = float(random()) + 10.0 + values[1] = float(random()) - for i in range(1, n): - if i > 1: - i[i] = i[i - 1] + 3 + for row_idx in range(1, n): + if row_idx > 1: + row_offsets[row_idx] = row_offsets[row_idx - 1] + 3 else: - i[1] = 2 + row_offsets[1] = 2 - start = (i - 1) * 3 + 2 - j[start] = i - 1 - j[start + 1] = i + start = (row_idx - 1) * 3 + 2 + col_indices[start] = row_idx - 1 + col_indices[start + 1] = row_idx - if i < n - 1: - j[start + 2] = i + 1 + if row_idx < n - 1: + col_indices[start + 2] = row_idx + 1 - val[start] = val[start - 1] - val[start + 1] = float(random()) + 10.0 + values[start] = values[start - 1] + values[start + 1] = float(random()) + 10.0 - if i < n - 1: - val[start + 2] = float(random()) - i[n] = nz + if row_idx < n - 1: + values[start + 2] = float(random()) + row_offsets[n] = nz THREADS_PER_BLOCK = 512 s_sd_kname = "conjugateGradientMultiBlockCG" +UNSUPPORTED_SYSTEMS = {"Darwin", "QNX"} +UNSUPPORTED_MACHINES = {"armv7l"} def main(): tol = 1e-5 - import pytest - - # WAIVE: Due to bug in NVRTC - return - - if platform.system() == "Darwin": - pytest.skip("conjugateGradientMultiBlockCG is not supported on Mac OSX") + system_name = platform.system() + if system_name in UNSUPPORTED_SYSTEMS: + requirement_not_met(f"{s_sd_kname} is not supported on {system_name}") - if platform.machine() == "armv7l": - pytest.skip("conjugateGradientMultiBlockCG is not supported on ARMv7") - - if platform.machine() == "qnx": - pytest.skip("conjugateGradientMultiBlockCG is not supported on QNX") + machine_name = platform.machine() + if machine_name in UNSUPPORTED_MACHINES: + requirement_not_met(f"{s_sd_kname} is not supported on {machine_name}") # This will pick the best possible CUDA capable device dev_id = find_cuda_device() device_prop = check_cuda_errors(cudart.cudaGetDeviceProperties(dev_id)) if not device_prop.managedMemory: - pytest.skip("Unified Memory not supported on this device") + requirement_not_met("Unified Memory not supported on this device") # This sample requires being run on a device that supports Cooperative Kernel # Launch if not device_prop.cooperativeLaunch: - pytest.skip(f"Selected GPU {dev_id} does not support Cooperative Kernel Launch") + requirement_not_met(f"Selected GPU {dev_id} does not support Cooperative Kernel Launch") # Statistics about the GPU device print( - f"> GPU device has {device_prop.multiProcessorCount:%d} Multi-Processors, SM {device_prop.major:%d}.{device_prop.minor:%d} compute capabilities\n" + f"> GPU device has {device_prop.multiProcessorCount} Multi-Processors, " + f"SM {device_prop.major}.{device_prop.minor} compute capabilities\n" ) # Get kernel - kernel_helper = common.KernelHelper(conjugate_gradient_multi_block_cg, dev_id) + kernel_helper = KernelHelper(conjugate_gradient_multi_block_cg, dev_id) _gpu_conjugate_gradient = kernel_helper.get_function(b"gpuConjugateGradient") # Generate a random tridiagonal symmetric matrix in CSR format @@ -253,7 +265,7 @@ def main(): x_local = (ctypes.c_float * n).from_address(x) rhs_local = (ctypes.c_float * n).from_address(rhs) dot_result_local = (ctypes.c_double).from_address(dot_result) - dot_result_local = 0 + dot_result_local.value = 0.0 # temp memory for CG r = check_cuda_errors(cudart.cudaMallocManaged(np.dtype(np.float32).itemsize * n, cudart.cudaMemAttachGlobal)) @@ -266,9 +278,9 @@ def main(): start = check_cuda_errors(cudart.cudaEventCreate()) stop = check_cuda_errors(cudart.cudaEventCreate()) - for i in range(n): - r_local[i] = rhs_local[i] = 1.0 - x_local[i] = 0.0 + for idx in range(n): + r_local[idx] = rhs_local[idx] = 1.0 + x_local[idx] = 0.0 kernel_args_value = (i, j, val, x, ax, p, r, dot_result, nz, n, tol) kernel_args_types = ( @@ -286,7 +298,7 @@ def main(): ) kernel_args = (kernel_args_value, kernel_args_types) - s_mem_size = np.dtype(np.float64).itemsize * ((THREADS_PER_BLOCK / 32) + 1) + s_mem_size = np.dtype(np.float64).itemsize * ((THREADS_PER_BLOCK // 32) + 1) num_threads = THREADS_PER_BLOCK num_blocks_per_sm = check_cuda_errors( cuda.cuOccupancyMaxActiveBlocksPerMultiprocessor(_gpu_conjugate_gradient, num_threads, s_mem_size) @@ -311,7 +323,7 @@ def main(): dim_block.x, dim_block.y, dim_block.z, - 0, + s_mem_size, 0, kernel_args, ) @@ -320,16 +332,17 @@ def main(): check_cuda_errors(cudart.cudaDeviceSynchronize()) time = check_cuda_errors(cudart.cudaEventElapsedTime(start, stop)) - print(f"GPU Final, residual = {math.sqrt(dot_result_local):e}, kernel execution time = {time:f} ms") + residual = math.sqrt(dot_result_local.value) + print(f"GPU Final, residual = {residual:e}, kernel execution time = {time:f} ms") err = 0.0 - for i in range(n): + for row_idx in range(n): rsum = 0.0 - for j in range(i_local[i], i_local[i + 1]): - rsum += val_local[j] * x_local[j_local[j]] + for elem_idx in range(i_local[row_idx], i_local[row_idx + 1]): + rsum += val_local[elem_idx] * x_local[j_local[elem_idx]] - diff = math.fabs(rsum - rhs_local[i]) + diff = math.fabs(rsum - rhs_local[row_idx]) if diff > err: err = diff @@ -347,6 +360,10 @@ def main(): check_cuda_errors(cudart.cudaEventDestroy(stop)) print(f"Test Summary: Error amount = {err:f}") - if math.sqrt(dot_result_local) >= tol: + if residual >= tol: print("conjugateGradientMultiBlockCG FAILED", file=sys.stderr) sys.exit(1) + + +if __name__ == "__main__": + main() diff --git a/cuda_bindings/examples/4_CUDA_Libraries/nvidia_smi.py b/cuda_bindings/examples/4_CUDA_Libraries/nvidia_smi.py new file mode 100644 index 00000000000..459022784b3 --- /dev/null +++ b/cuda_bindings/examples/4_CUDA_Libraries/nvidia_smi.py @@ -0,0 +1,245 @@ +# Copyright 2026 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + + +# ################################################################################ +# +# This example demonstrates the core cuda.bindings.nvml functionality by +# implementing a subset of the NVIDIA System Management Interface (nvidia-smi) +# command line tool in Python. +# +# ################################################################################ + + +# /// script +# dependencies = ["cuda_bindings>13.2.1"] +# /// + +import sys + +from cuda.bindings import nvml + +################################################################################## +# FORMATTING HELPERS + +# Utilities to help format the output table. See below for NVML usage. + + +def format_size(bytes_val: int) -> str: + """Formats bytes to MiB.""" + return f"{bytes_val / (1024 * 1024):.0f}MiB" + + +LINES = [[[4, 27, 6], [18, 3], [20]], [[4, 6, 13, 13], [22], [9, 10]]] + + +class TableFormatter: + def __init__(self, lines): + self.formats, self.sizes, self.counts = zip(*[self._create_line_format(line) for line in lines]) + + def _create_line_format(self, descriptor): + parts = [] + sizes = [] + for section in descriptor: + parts.append("| ") + sizes.append(1) + for i, align in enumerate(section): + if i == len(section) - 1: + direct = ">" + else: + direct = "<" + parts.append(f"{{:{direct}{align}}} ") + sizes[-1] += align + 1 + parts.append("|") + return "".join(parts), sizes, sum(len(x) for x in descriptor) + + def print_line(self, char="-"): + parts = ["+"] + for size in self.sizes[0]: + parts.append(char * size) + parts.append("+") + print("".join(parts)) + + def print_values(self, *args): + for line_format, count in zip(self.formats, self.counts): + print(line_format.format(*args[:count])) + args = args[count:] + + +def print_table(metadata, devices): + formatter = TableFormatter(LINES) + + print("+-----------------------------------------------------------------------------------------+") + print( + f"| NVIDIA-MINI-SMI {metadata['driver_version']:<16} Driver Version: {metadata['driver_version']:<15} CUDA Version: {metadata['cuda_version']:<9}|" + ) + formatter.print_line() + print("| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |") + print("| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |") + formatter.print_line("=") + + for device in devices: + formatter.print_values( + str(device["index"]), + device["name"], + device["persistence"], + device["bus_id"], + device["display_active"], + device["ecc_mode"], + device["fan_speed"], + device["temperature"], + device["performance_state"], + device["power"], + device["memory"], + device["utilization"], + device["compute_mode"], + ) + formatter.print_line() + + +################################################################################## +# NVML USAGE EXAMPLES + + +def collect_info(): + metadata = {} + metadata["driver_version"] = nvml.system_get_driver_version() + cuda_version_int = nvml.system_get_cuda_driver_version() + cuda_major = cuda_version_int // 1000 + cuda_minor = (cuda_version_int % 1000) // 10 + metadata["cuda_version"] = f"{cuda_major}.{cuda_minor}" + + devices = [] + + device_count = nvml.device_get_count_v2() + + for i in range(device_count): + device = {} + device["index"] = i + + handle = nvml.device_get_handle_by_index_v2(i) + + name = nvml.device_get_name(handle) + device["name"] = name + + try: + persistence = nvml.device_get_persistence_mode(handle) + persistence_str = "On" if persistence == nvml.EnableState.FEATURE_ENABLED else "Off" + except nvml.NvmlError: + persistence_str = "N/A" + device["persistence"] = persistence_str + + try: + pci_info = nvml.device_get_pci_info_v3(handle) + bus_id = pci_info.bus_id + except nvml.NvmlError: + bus_id = "N/A" + device["bus_id"] = bus_id + + try: + display_active = nvml.device_get_display_active(handle) + disp_str = "On" if display_active == nvml.EnableState.FEATURE_ENABLED else "Off" + except nvml.NvmlError: + disp_str = "N/A" + device["display_active"] = disp_str + + try: + current, _ = nvml.device_get_ecc_mode(handle) + ecc_str = "On" if current == nvml.EnableState.FEATURE_ENABLED else "Off" + except nvml.NvmlError: + ecc_str = "N/A" + device["ecc_mode"] = ecc_str + + try: + fan = nvml.device_get_fan_speed(handle) + fan_str = f"{fan: >3}%" + except nvml.NvmlError: + fan_str = "N/A" + device["fan_speed"] = fan_str + + try: + temp = nvml.device_get_temperature_v(handle, nvml.TemperatureSensors.TEMPERATURE_GPU) + temp_str = f"{temp}C" + except nvml.NvmlError: + temp_str = "N/A" + device["temperature"] = temp_str + + try: + perf_state = nvml.device_get_performance_state(handle) + perf_str = f"P{perf_state}" + except nvml.NvmlError: + perf_str = "N/A" + device["performance_state"] = perf_str + + try: + power_usage = nvml.device_get_power_usage(handle) # mW + usage_str = f"{power_usage // 1000}W" + except nvml.NvmlError: + usage_str = "N/A" + + try: + power_cap = nvml.device_get_power_management_limit(handle) # mW + cap_str = f"{power_cap // 1000}W" + except nvml.NvmlError: + cap_str = "N/A" + + pwr_str = f"{usage_str} / {cap_str}" + device["power"] = pwr_str + + try: + mem_info = nvml.device_get_memory_info_v2(handle) + except nvml.NvmlError: + mem_str = "N/A" + else: + mem_used = format_size(mem_info.used) + mem_total = format_size(mem_info.total) + mem_str = f"{mem_used} / {mem_total}" + + device["memory"] = mem_str + + try: + util_rates = nvml.device_get_utilization_rates(handle) + except nvml.NvmlError: + util_str = "N/A" + else: + gpu_util = util_rates.gpu + util_str = f"{gpu_util: >3}%" + + device["utilization"] = util_str + + try: + compute_mode = nvml.device_get_compute_mode(handle) + except nvml.NvmlError: + comp_str = "N/A" + else: + if compute_mode == nvml.ComputeMode.COMPUTEMODE_DEFAULT: + comp_str = "Default" + elif compute_mode == nvml.ComputeMode.COMPUTEMODE_EXCLUSIVE_PROCESS: + comp_str = "E. Process" + elif compute_mode == nvml.ComputeMode.COMPUTEMODE_PROHIBITED: + comp_str = "Prohibited" + else: + comp_str = "Unknown" + device["compute_mode"] = comp_str + + devices.append(device) + + return metadata, devices + + +def main(): + try: + nvml.init_v2() + except nvml.NvmlError as e: + print(f"Failed to initialize NVML: {e}") + sys.exit(1) + + try: + metadata, devices = collect_info() + print_table(metadata, devices) + finally: + nvml.shutdown() + + +if __name__ == "__main__": + main() diff --git a/cuda_bindings/examples/extra/isoFDModelling_test.py b/cuda_bindings/examples/extra/iso_fd_modelling.py similarity index 96% rename from cuda_bindings/examples/extra/isoFDModelling_test.py rename to cuda_bindings/examples/extra/iso_fd_modelling.py index 21303664ac3..9fe9432862c 100644 --- a/cuda_bindings/examples/extra/isoFDModelling_test.py +++ b/cuda_bindings/examples/extra/iso_fd_modelling.py @@ -1,14 +1,24 @@ -# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# ################################################################################ +# +# This example demonstrates isotropic finite-difference wave propagation +# modelling across multiple GPUs with peer-to-peer halo exchange. +# +# ################################################################################ + +# /// script +# dependencies = ["cuda_bindings>13.2.1", "numpy", "matplotlib"] +# /// import time import numpy as np -from common import common -from common.helper_cuda import check_cuda_errors from cuda.bindings import driver as cuda from cuda.bindings import runtime as cudart +from cuda.bindings._example_helpers import KernelHelper, check_cuda_errors, requirement_not_met iso_propagator = """\ extern "C" @@ -215,7 +225,7 @@ def __init__(self, cntx): check_cuda_errors(cuda.cuCtxSetCurrent(cntx)) dev = check_cuda_errors(cuda.cuCtxGetDevice()) - self.kernel_helper = common.KernelHelper(iso_propagator, int(dev)) + self.kernel_helper = KernelHelper(iso_propagator, int(dev)) # kernel to create a source fnction with some max frequency self.creatSource = self.kernel_helper.get_function(b"createSource") @@ -620,8 +630,7 @@ def main(): print(f"CUDA-capable device count: {gpu_n}") if gpu_n < 2: - print("Two or more GPUs with Peer-to-Peer access capability are required") - return + requirement_not_met("Two or more GPUs with Peer-to-Peer access capability are required") prop = [check_cuda_errors(cudart.cudaGetDeviceProperties(i)) for i in range(gpu_n)] # Check possibility for peer access @@ -642,7 +651,7 @@ def main(): ) print( "> Peer access from {} (GPU{}) -> {} (GPU{}) : {}\n".format( - prop[j].name, j, prop[i].name, i, "Yes" if i_access_j else "No" + prop[j].name, j, prop[i].name, i, "Yes" if j_access_i else "No" ) ) if i_access_j and j_access_i: @@ -652,9 +661,7 @@ def main(): break if p2p_capable_gp_us[0] == -1 or p2p_capable_gp_us[1] == -1: - print("Two or more GPUs with Peer-to-Peer access capability are required.") - print("Peer to Peer access is not available amongst GPUs in the system, waiving test.") - return + requirement_not_met("Two or more GPUs with Peer-to-Peer access capability are required") # Use first pair of p2p capable GPUs detected gpuid = [p2p_capable_gp_us[0], p2p_capable_gp_us[1]] diff --git a/cuda_bindings/examples/extra/jit_program_test.py b/cuda_bindings/examples/extra/jit_program.py similarity index 91% rename from cuda_bindings/examples/extra/jit_program_test.py rename to cuda_bindings/examples/extra/jit_program.py index 80e7e733761..7f55b2243ed 100644 --- a/cuda_bindings/examples/extra/jit_program_test.py +++ b/cuda_bindings/examples/extra/jit_program.py @@ -1,5 +1,16 @@ -# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# ################################################################################ +# +# This example demonstrates JIT compilation of CUDA kernels using NVRTC +# and the Driver API (saxpy kernel). +# +# ################################################################################ + +# /// script +# dependencies = ["cuda_bindings>13.2.1", "numpy"] +# /// import ctypes diff --git a/cuda_bindings/examples/extra/numba_emm_plugin.py b/cuda_bindings/examples/extra/numba_emm_plugin.py deleted file mode 100644 index dcbf5413210..00000000000 --- a/cuda_bindings/examples/extra/numba_emm_plugin.py +++ /dev/null @@ -1,161 +0,0 @@ -# Copyright 2021-2025 NVIDIA Corporation. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -"""Numba EMM Plugin using the CUDA Python Driver API. - -This example provides an External Memory Management (EMM) Plugin for Numba (see -https://numba.readthedocs.io/en/stable/cuda/external-memory.html) that uses the -NVIDIA CUDA Python Driver API for all on-device allocations and frees. For -other operations interacting with the driver, Numba uses its internal ctypes -wrapper. This serves as an example of interoperability between the NVIDIA CUDA -Python Driver API, and other implementations of driver API wrappers (in this -case Numba's ctypes wrapper), and demonstrates an on-ramp to using the NVIDIA -CUDA Python Driver API wrapper by showing that it can co-exist with other -wrappers - it is not necessary to replace all wrappers in all libraries to -start using the NVIDIA wrapper. - -The current version of Numba passes all tests using this plugin (with a small -patch to recognize CUDA 11.3 as a supported version). The Numba test suite can -be run with the plugin by executing: - - NUMBA_CUDA_MEMORY_MANAGER=numba_emm_plugin \\ - python -m numba.runtests numba.cuda.tests -vf -m - -when the directory containing this example is on the PYTHONPATH. When tests are -run, the test summary is expected to be close to: - - Ran 1121 tests in 159.572s - - OK (skipped=17, expected failures=1) - -The number of tests may vary with changes between commits in Numba, but the -main result is that there are no unexpected failures. - -This example can also be run standalone with: - - python numba_emm_plugin.py - -in which case it sets up Numba to use the included EMM plugin, then creates and -destroys a device array. When run standalone, the output may look like: - - Free before creating device array: 50781159424 - Free after creating device array: 50779062272 - Free after freeing device array: 50781159424 - -The initial value may vary, but the expectation is that 2097152 bytes (2MB) -should be taken up by the device array creation, and the original value should -be restored after freeing it. -""" - -from ctypes import c_size_t - -from numba.cuda import ( - GetIpcHandleMixin, - HostOnlyCUDAMemoryManager, - MemoryInfo, - MemoryPointer, -) - -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 - - -def driver_alloc(size): - """ - Allocate `size` bytes of device memory and return a device pointer to the - allocated memory. - """ - err, ptr = cuda_driver.cuMemAlloc(size) - if err != cuda_driver.CUresult.CUDA_SUCCESS: - raise RuntimeError(f"Unexpected error code {err} from cuMemAlloc") - return ptr - - -def driver_free(ptr): - """ - Free device memory pointed to by `ptr`. - """ - (err,) = cuda_driver.cuMemFree(ptr) - if err != cuda_driver.CUresult.CUDA_SUCCESS: - raise RuntimeError(f"Unexpected error code {err} from cuMemFree") - - -def driver_memory_info(): - """ - Return the free and total amount of device memory in bytes as a tuple. - """ - err, free, total = cuda_driver.cuMemGetInfo() - if err != cuda_driver.CUresult.CUDA_SUCCESS: - raise RuntimeError(f"Unexpected error code {err} from cuMemGetInfo") - return free, total - - -# EMM Plugin implementation. For documentation of the methods implemented here, -# see: -# -# https://numba.readthedocs.io/en/stable/cuda/external-memory.html#numba.cuda.BaseCUDAMemoryManager - - -class DriverEMMPlugin(GetIpcHandleMixin, HostOnlyCUDAMemoryManager): - def memalloc(self, size): - ptr = driver_alloc(size) - ctx = self.context - finalizer = make_finalizer(ptr) - # We wrap the pointer value in a c_size_t because Numba expects ctypes - # objects - wrapped_ptr = c_size_t(int(ptr)) - return MemoryPointer(ctx, wrapped_ptr, size, finalizer=finalizer) - - def initialize(self): - # No setup required to use the EMM Plugin in a given context - pass - - def get_memory_info(self): - free, total = driver_memory_info() - return MemoryInfo(free=free, total=total) - - @property - def interface_version(self): - return 1 - - -def make_finalizer(ptr): - def finalizer(): - driver_free(ptr) - - return finalizer - - -# If NUMBA_CUDA_MEMORY_MANAGER is set to this module (e.g. -# `NUMBA_CUDA_MEMORY_MANAGER=numba_emm_plugin`), then Numba will look at the -# _numba_memory_manager global to determine what class to use for memory -# management. - -_numba_memory_manager = DriverEMMPlugin - - -def main(): - """ - A simple test / demonstration setting the memory manager and - allocating/deleting an array. - """ - - cuda.set_memory_manager(DriverEMMPlugin) - ctx = cuda.current_context() - print(f"Free before creating device array: {ctx.get_memory_info().free}") - x = cuda.device_array(1000) - print(f"Free after creating device array: {ctx.get_memory_info().free}") - del x - print(f"Free after freeing device array: {ctx.get_memory_info().free}") - - -if __name__ == "__main__": - import argparse - - formatter = argparse.RawDescriptionHelpFormatter - parser = argparse.ArgumentParser(description=__doc__, formatter_class=formatter) - parser.parse_args() - main() diff --git a/cuda_bindings/examples/pytest.ini b/cuda_bindings/examples/pytest.ini deleted file mode 100644 index e105585d5aa..00000000000 --- a/cuda_bindings/examples/pytest.ini +++ /dev/null @@ -1,4 +0,0 @@ -[pytest] -python_files = *_test.py -python_functions = main -pythonpath = . diff --git a/cuda_bindings/pixi.lock b/cuda_bindings/pixi.lock index b01d6eec69d..b3493db3209 100644 --- a/cuda_bindings/pixi.lock +++ b/cuda_bindings/pixi.lock @@ -559,21 +559,21 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-64/cairo-1.18.4-he90730b_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/colorama-0.4.6-pyhd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/conda-gcc-specs-15.2.0-h53410ce_16.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_linux-64-13.2.27-ha770c72_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_linux-64-13.2.51-ha770c72_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-13.2.51-hecca717_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-dev-13.2.51-hecca717_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_linux-64-13.2.51-h376f20c_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-static-13.2.51-hecca717_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_linux-64-13.2.51-h376f20c_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_linux-64-13.2.51-h376f20c_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvrtc-13.2.51-hecca717_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-13.2.51-h69a702a_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_linux-64-13.2.51-ha770c72_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-impl-13.2.51-h4bc722e_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-tools-13.2.51-h4bc722e_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-profiler-api-13.2.20-h7938cbb_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-13.2-he2cc418_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_linux-64-13.3.3.3.1-ha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_linux-64-13.3.33-ha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-13.3.29-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-dev-13.3.29-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_linux-64-13.3.29-h376f20c_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-static-13.3.29-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_linux-64-13.3.29-h376f20c_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_linux-64-13.3.29-h376f20c_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvrtc-13.3.33-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-13.3.33-h69a702a_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_linux-64-13.3.33-ha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-impl-13.3.33-h4bc722e_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-tools-13.3.33-h4bc722e_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-profiler-api-13.3.27-h7938cbb_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-13.3-hcbadf70_3.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/cython-3.2.4-py314h1807b08_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/dav1d-1.2.1-hd590300_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/dbus-1.16.2-h24cb091_1.conda @@ -612,7 +612,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-64/libblas-3.11.0-5_h4a7cf45_openblas.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libcap-2.77-h3ff7636_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libcblas-3.11.0-5_h0358290_openblas.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/libcufile-1.17.0.44-h85c024f_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcufile-1.18.0.66-h85c024f_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libdeflate-1.25-h17f619e_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libdrm-2.4.125-hb03c661_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libegl-1.7.0-ha4b6fd6_2.conda @@ -638,8 +638,8 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-64/liblzma-5.8.1-hb9d3cd8_2.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libmpdec-4.0.0-hb9d3cd8_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libnl-3.11.0-hb9d3cd8_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/libnvfatbin-13.2.51-hecca717_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/libnvjitlink-13.2.51-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnvfatbin-13.3.29-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnvjitlink-13.3.33-hecca717_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libogg-1.3.5-hd0c01bc_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenblas-0.3.30-pthreads_h94d23a6_4.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-2025.2.0-hb617929_1.conda @@ -742,7 +742,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/zipp-3.23.0-pyhcf101f3_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_6.conda - conda: . - build: py314hb727236_0 + build: py314hd3a1e81_0 - conda: ../cuda_pathfinder linux-aarch64: - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/_openmp_mutex-4.5-2_gnu.tar.bz2 @@ -755,21 +755,21 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.1.4-hbd8a1cb_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cairo-1.18.4-h0b6afd8_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/colorama-0.4.6-pyhd8ed1ab_1.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_linux-aarch64-13.2.27-h579c4fd_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_linux-aarch64-13.2.51-h579c4fd_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-13.2.51-h8f3c8d4_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-dev-13.2.51-h8f3c8d4_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_linux-aarch64-13.2.51-h8f3c8d4_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-static-13.2.51-h8f3c8d4_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_linux-aarch64-13.2.51-h8f3c8d4_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_linux-aarch64-13.2.51-h8f3c8d4_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvrtc-13.2.51-h8f3c8d4_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-13.2.51-he9431aa_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_linux-aarch64-13.2.51-h579c4fd_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-impl-13.2.51-h7b14b0b_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-tools-13.2.51-h7b14b0b_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-profiler-api-13.2.20-h16bee8c_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-13.2-he2cc418_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_linux-aarch64-13.3.3.3.1-h579c4fd_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_linux-aarch64-13.3.33-h579c4fd_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-13.3.29-h8f3c8d4_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-dev-13.3.29-h8f3c8d4_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_linux-aarch64-13.3.29-h8f3c8d4_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-static-13.3.29-h8f3c8d4_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_linux-aarch64-13.3.29-h8f3c8d4_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_linux-aarch64-13.3.29-h8f3c8d4_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvrtc-13.3.33-h8f3c8d4_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-13.3.33-he9431aa_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_linux-aarch64-13.3.33-h579c4fd_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-impl-13.3.33-h7b14b0b_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-tools-13.3.33-h7b14b0b_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-profiler-api-13.3.27-h16bee8c_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-13.3-hcbadf70_3.conda - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cython-3.2.4-py314h4c416a3_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/dav1d-1.2.1-h31becfc_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/dbus-1.16.2-h70963c4_1.conda @@ -805,7 +805,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libblas-3.11.0-5_haddc8a3_openblas.conda - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcap-2.77-h68e9139_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcblas-3.11.0-5_hd72aa62_openblas.conda - - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcufile-1.17.0.44-h4243460_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcufile-1.18.0.66-h4243460_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libdeflate-1.25-h1af38f5_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libdrm-2.4.125-he30d5cf_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libegl-1.7.0-hd24410f_2.conda @@ -831,8 +831,8 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/liblzma-5.8.1-h86ecc28_2.conda - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libmpdec-4.0.0-h86ecc28_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnl-3.11.0-h86ecc28_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnvfatbin-13.2.51-h8f3c8d4_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnvjitlink-13.2.51-h8f3c8d4_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnvfatbin-13.3.29-h8f3c8d4_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnvjitlink-13.3.33-h8f3c8d4_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libogg-1.3.5-h86ecc28_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenblas-0.3.30-pthreads_h9d3fd7e_4.conda - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenvino-2025.2.0-hcd21e76_1.conda @@ -927,7 +927,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/zipp-3.23.0-pyhcf101f3_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/zstd-1.5.7-h85ac4a6_6.conda - conda: . - build: py314h9a28ecd_0 + build: py314h3ff45e1_0 - conda: ../cuda_pathfinder win-64: - conda: https://conda.anaconda.org/conda-forge/win-64/_openmp_mutex-4.5-2_gnu.conda @@ -938,21 +938,21 @@ environments: - conda: https://conda.anaconda.org/conda-forge/win-64/cairo-1.18.4-h477c42c_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/colorama-0.4.6-pyhd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/win-64/conda-gcc-specs-15.2.0-hd546029_16.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_win-64-13.2.27-h57928b3_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_win-64-13.2.51-h57928b3_0.conda - - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-cudart-13.2.51-hac47afa_0.conda - - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-cudart-dev-13.2.51-hac47afa_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_win-64-13.2.51-hac47afa_0.conda - - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-cudart-static-13.2.51-hac47afa_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_win-64-13.2.51-hac47afa_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_win-64-13.2.51-hac47afa_0.conda - - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvrtc-13.2.51-hac47afa_0.conda - - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvvm-13.2.51-h719f0c7_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_win-64-13.2.51-h57928b3_0.conda - - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvvm-impl-13.2.51-h2466b09_0.conda - - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvvm-tools-13.2.51-h2466b09_0.conda - - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-profiler-api-13.2.20-h57928b3_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-13.2-he2cc418_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_win-64-13.3.3.3.1-h57928b3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_win-64-13.3.33-h57928b3_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-cudart-13.3.29-hac47afa_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-cudart-dev-13.3.29-hac47afa_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_win-64-13.3.29-hac47afa_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-cudart-static-13.3.29-hac47afa_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_win-64-13.3.29-hac47afa_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_win-64-13.3.29-hac47afa_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvrtc-13.3.33-hac47afa_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvvm-13.3.33-h719f0c7_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_win-64-13.3.33-h57928b3_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvvm-impl-13.3.33-h2466b09_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvvm-tools-13.3.33-h2466b09_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-profiler-api-13.3.27-h57928b3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-13.3-hcbadf70_3.conda - conda: https://conda.anaconda.org/conda-forge/win-64/cython-3.2.4-py314h344ed54_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/dav1d-1.2.1-hcfcfb64_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.3.1-pyhd8ed1ab_0.conda @@ -998,8 +998,8 @@ environments: - conda: https://conda.anaconda.org/conda-forge/win-64/liblapack-3.11.0-5_hf9ab0e9_mkl.conda - conda: https://conda.anaconda.org/conda-forge/win-64/liblzma-5.8.1-h2466b09_2.conda - conda: https://conda.anaconda.org/conda-forge/win-64/libmpdec-4.0.0-h2466b09_0.conda - - conda: https://conda.anaconda.org/conda-forge/win-64/libnvfatbin-13.2.51-hac47afa_0.conda - - conda: https://conda.anaconda.org/conda-forge/win-64/libnvjitlink-13.2.51-hac47afa_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libnvfatbin-13.3.29-hac47afa_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libnvjitlink-13.3.33-hac47afa_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/libogg-1.3.5-h2466b09_1.conda - conda: https://conda.anaconda.org/conda-forge/win-64/libopus-1.6-h6a83c73_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/libpng-1.6.53-h7351971_0.conda @@ -1061,7 +1061,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/zipp-3.23.0-pyhcf101f3_1.conda - conda: https://conda.anaconda.org/conda-forge/win-64/zstd-1.5.7-h534d264_6.conda - conda: . - build: py314h356c398_0 + build: py314hd7f1909_0 - conda: ../cuda_pathfinder default: channels: @@ -1081,21 +1081,21 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-64/cairo-1.18.4-h3394656_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/colorama-0.4.6-pyhd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/conda-gcc-specs-15.2.0-h53410ce_16.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_linux-64-13.2.27-ha770c72_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_linux-64-13.2.51-ha770c72_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-13.2.51-hecca717_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-dev-13.2.51-hecca717_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_linux-64-13.2.51-h376f20c_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-static-13.2.51-hecca717_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_linux-64-13.2.51-h376f20c_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_linux-64-13.2.51-h376f20c_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvrtc-13.2.51-hecca717_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-13.2.51-h69a702a_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_linux-64-13.2.51-ha770c72_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-impl-13.2.51-h4bc722e_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-tools-13.2.51-h4bc722e_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-profiler-api-13.2.20-h7938cbb_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-13.2-he2cc418_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_linux-64-12.9.27-ha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_linux-64-12.9.86-ha770c72_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-12.9.79-h5888daf_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-dev-12.9.79-h5888daf_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_linux-64-12.9.79-h3f2d84a_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-static-12.9.79-h5888daf_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_linux-64-12.9.79-h3f2d84a_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_linux-64-12.9.79-h3f2d84a_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvrtc-12.9.86-hecca717_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-12.9.86-h69a702a_6.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_linux-64-12.9.86-ha770c72_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-impl-12.9.86-h4bc722e_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-tools-12.9.86-h4bc722e_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-profiler-api-12.9.79-h7938cbb_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-12.9-h4f385c5_3.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/cython-3.2.3-py314h1807b08_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/dav1d-1.2.1-hd590300_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/dbus-1.16.2-h24cb091_1.conda @@ -1134,7 +1134,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-64/libblas-3.11.0-5_h4a7cf45_openblas.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libcap-2.77-h3ff7636_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libcblas-3.11.0-5_h0358290_openblas.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/libcufile-1.17.0.44-h85c024f_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcufile-1.14.1.1-hbc026e6_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libdeflate-1.25-h17f619e_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libdrm-2.4.125-hb03c661_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libegl-1.7.0-ha4b6fd6_2.conda @@ -1160,8 +1160,8 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-64/liblzma-5.8.1-hb9d3cd8_2.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libmpdec-4.0.0-hb9d3cd8_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libnl-3.11.0-hb9d3cd8_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/libnvfatbin-13.2.51-hecca717_0.conda - - conda: https://conda.anaconda.org/conda-forge/linux-64/libnvjitlink-13.2.51-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnvfatbin-12.9.82-hecca717_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnvjitlink-12.9.86-hecca717_2.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libogg-1.3.5-hd0c01bc_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenblas-0.3.30-pthreads_h94d23a6_4.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-2025.2.0-hb617929_1.conda @@ -1264,7 +1264,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/zipp-3.23.0-pyhcf101f3_1.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_6.conda - conda: . - build: py314hb727236_0 + build: py314ha6d028f_0 - conda: ../cuda_pathfinder linux-aarch64: - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/_openmp_mutex-4.5-2_gnu.tar.bz2 @@ -1460,21 +1460,21 @@ environments: - conda: https://conda.anaconda.org/conda-forge/win-64/cairo-1.18.4-h5782bbf_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/colorama-0.4.6-pyhd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/win-64/conda-gcc-specs-15.2.0-hd546029_16.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_win-64-12.9.27-h57928b3_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_win-64-12.9.86-h57928b3_2.conda - - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-cudart-12.9.79-he0c23c2_0.conda - - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-cudart-dev-12.9.79-he0c23c2_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_win-64-12.9.79-he0c23c2_0.conda - - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-cudart-static-12.9.79-he0c23c2_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_win-64-12.9.79-he0c23c2_0.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_win-64-12.9.79-he0c23c2_0.conda - - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvrtc-12.9.86-hac47afa_1.conda - - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvvm-12.9.86-h719f0c7_6.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_win-64-12.9.86-h57928b3_2.conda - - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvvm-impl-12.9.86-h2466b09_2.conda - - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvvm-tools-12.9.86-h2466b09_2.conda - - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-profiler-api-12.9.79-h57928b3_1.conda - - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-12.9-h4f385c5_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_win-64-13.3.3.3.1-h57928b3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_win-64-13.3.33-h57928b3_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-cudart-13.3.29-hac47afa_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-cudart-dev-13.3.29-hac47afa_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_win-64-13.3.29-hac47afa_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-cudart-static-13.3.29-hac47afa_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_win-64-13.3.29-hac47afa_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_win-64-13.3.29-hac47afa_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvrtc-13.3.33-hac47afa_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvvm-13.3.33-h719f0c7_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_win-64-13.3.33-h57928b3_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvvm-impl-13.3.33-h2466b09_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvvm-tools-13.3.33-h2466b09_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-profiler-api-13.3.27-h57928b3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-13.3-hcbadf70_3.conda - conda: https://conda.anaconda.org/conda-forge/win-64/cython-3.2.3-py314h344ed54_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/dav1d-1.2.1-hcfcfb64_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.3.1-pyhd8ed1ab_0.conda @@ -1520,8 +1520,8 @@ environments: - conda: https://conda.anaconda.org/conda-forge/win-64/liblapack-3.11.0-5_hf9ab0e9_mkl.conda - conda: https://conda.anaconda.org/conda-forge/win-64/liblzma-5.8.1-h2466b09_2.conda - conda: https://conda.anaconda.org/conda-forge/win-64/libmpdec-4.0.0-h2466b09_0.conda - - conda: https://conda.anaconda.org/conda-forge/win-64/libnvfatbin-12.9.82-hac47afa_1.conda - - conda: https://conda.anaconda.org/conda-forge/win-64/libnvjitlink-12.9.86-hac47afa_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libnvfatbin-13.3.29-hac47afa_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libnvjitlink-13.3.33-hac47afa_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/libogg-1.3.5-h2466b09_1.conda - conda: https://conda.anaconda.org/conda-forge/win-64/libopus-1.6-h6a83c73_0.conda - conda: https://conda.anaconda.org/conda-forge/win-64/libpng-1.6.53-h7351971_0.conda @@ -1583,8 +1583,540 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/zipp-3.23.0-pyhcf101f3_1.conda - conda: https://conda.anaconda.org/conda-forge/win-64/zstd-1.5.7-h534d264_6.conda - conda: . - build: py314h5e6f764_0 + build: py314hd7f1909_0 - conda: ../cuda_pathfinder + docs: + channels: + - url: https://conda.anaconda.org/conda-forge/ + indexes: + - https://pypi.org/simple + options: + pypi-prerelease-mode: if-necessary-or-explicit + packages: + linux-64: + - conda: https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-20_gnu.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/_python_abi3_support-1.0-hd8ed1ab_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/accessible-pygments-0.0.5-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/alabaster-1.0.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/apeye-1.4.1-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/apeye-core-1.1.5-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/asttokens-3.0.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/attrs-26.1.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/autodocsumm-0.2.15-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/backports.zstd-1.3.0-py312h90b7ffd_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/beautifulsoup4-4.14.3-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/brotli-python-1.2.0-py312hdb49522_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hda65f42_9.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.2.25-hbd8a1cb_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cachecontrol-0.14.3-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/certifi-2026.2.25-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/charset-normalizer-3.4.7-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/click-8.3.1-pyh8f84b5b_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/colorama-0.4.6-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/comm-0.2.3-pyhe01879c_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cpython-3.12.13-py312hd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cssutils-2.11.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-bindings-13.2.0-py312hf79963d_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvrtc-13.3.33-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-impl-13.3.33-h4bc722e_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-pathfinder-1.5.2-pyhc364b38_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-13.3-hcbadf70_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/cython-3.2.4-py312h68e6be4_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/debugpy-1.8.20-py312h8285ef7_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/decorator-5.2.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/dict2css-0.3.0.post1-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/docutils-0.21.2-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/domdf-python-tools-3.10.0-pyhff2d567_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/enum_tools-0.13.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.3.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/executing-2.2.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/filelock-3.25.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/greenlet-3.3.2-py312h8285ef7_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/h2-4.3.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/hpack-4.1.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/html5lib-1.1-pyhd8ed1ab_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/hyperframe-6.1.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/icu-78.3-h33c6efd_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/idna-3.11-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/imagesize-2.0.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/importlib-metadata-8.8.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/importlib-resources-6.5.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/importlib_resources-6.5.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/iniconfig-2.3.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ipykernel-7.2.0-pyha191276_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ipython-9.12.0-pyhecfbec7_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ipython_pygments_lexers-1.1.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jedi-0.19.2-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jinja2-3.1.6-pyhcf101f3_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jsonschema-4.26.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jsonschema-specifications-2025.9.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jupyter-cache-1.0.1-pyhff2d567_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jupyter_client-8.8.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jupyter_core-5.9.1-pyhc90fa1f_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/keyutils-1.6.3-hb9d3cd8_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/krb5-1.22.2-ha1258a1_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.45.1-default_hbd61a6d_102.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libblas-3.11.0-6_h4a7cf45_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcap-2.77-hd0affe5_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcblas-3.11.0-6_h0358290_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libcufile-1.18.0.66-h85c024f_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libedit-3.1.20250104-pl5321h7949ede_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.7.5-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libffi-3.5.2-h3435931_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-15.2.0-he0feb66_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-15.2.0-h69a702a_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran-15.2.0-h69a702a_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-15.2.0-h68bc16d_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libgomp-15.2.0-he0feb66_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/liblapack-3.11.0-6_h47877c9_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/liblzma-5.8.2-hb03c661_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnl-3.11.0-hb9d3cd8_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnsl-2.0.1-hb9d3cd8_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libnvjitlink-13.3.33-hecca717_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenblas-0.3.32-pthreads_h94d23a6_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsodium-1.0.21-h280c20c_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.52.0-hf4e2dac_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-15.2.0-h934c35e_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libsystemd0-257.13-hd0affe5_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libudev1-257.13-hd0affe5_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.42-h5347b49_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libxcrypt-4.4.36-hd590300_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.2-h25fd6f3_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/make-4.4.1-hb9d3cd8_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/markdown-it-py-4.0.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/markupsafe-3.0.3-py312h8a5da7c_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/matplotlib-inline-0.2.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/mdit-py-plugins-0.5.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/mdurl-0.1.2-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/more-itertools-11.0.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/msgpack-python-1.1.2-py312hd9148b4_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/mypy_extensions-1.1.0-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/myst-nb-1.4.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/myst-parser-5.0.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/natsort-8.4.0-pyhcf101f3_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/nbclient-0.10.4-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/nbformat-5.10.4-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.5-h2d0b736_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/nest-asyncio-1.6.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/numpy-2.4.3-py312h33ff503_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/numpydoc-1.10.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/openssl-3.6.1-h35e630c_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-26.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/parso-0.8.6-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pexpect-4.9.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pip-26.0.1-pyh8b19718_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.9.4-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pluggy-1.6.0-pyhf9edf01_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/prompt-toolkit-3.0.52-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/psutil-7.2.2-py312h5253ce2_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ptyprocess-0.7.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pure_eval-0.2.3-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pyclibrary-0.2.2-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pydata-sphinx-theme-0.17.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pygments-2.20.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pyparsing-3.3.2-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pysocks-1.7.1-pyha55dd90_7.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-9.0.2-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/python-3.12.13-hd63d673_0_cpython.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python-dateutil-2.9.0.post0-pyhe01879c_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python-fastjsonschema-2.21.2-pyhe01879c_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python-gil-3.12.13-hd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.12-8_cp312.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pyyaml-6.0.3-py312h8a5da7c_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/pyzmq-27.1.0-py312hda471dd_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/rdma-core-61.0-h192683f_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/readline-8.3-h853b02a_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/referencing-0.37.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/requests-2.33.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/rpds-py-0.30.0-py312h868fb18_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ruamel.yaml-0.19.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/ruamel.yaml.clib-0.2.15-py312h5253ce2_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/scipy-1.17.1-py312h54fa4ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/six-1.17.0-pyhe01879c_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/snowballstemmer-3.0.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/soupsieve-2.8.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-8.1.3-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-autodoc-typehints-3.0.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-copybutton-0.5.2-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-jinja2-compat-0.4.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-prompt-1.10.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-tabs-3.4.1-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-toolbox-4.1.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-applehelp-2.0.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-devhelp-2.0.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-htmlhelp-2.1.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-jsmath-1.0.1-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-qthelp-2.0.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-serializinghtml-1.1.10-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/sqlalchemy-2.0.49-py312h5253ce2_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/stack_data-0.6.3-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tabulate-0.10.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_h366c992_103.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.4.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/tornado-6.5.5-py312h4c3975b_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/traitlets-5.14.3-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing-extensions-4.15.0-h396c80c_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.15.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_inspect-0.9.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/urllib3-2.6.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wcwidth-0.6.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/webencodings-0.5.1-pyhd8ed1ab_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wheel-0.46.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/yaml-0.2.5-h280c20c_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/zeromq-4.3.5-h41580af_10.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/zipp-3.23.0-pyhcf101f3_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_6.conda + - pypi: https://files.pythonhosted.org/packages/8c/79/017fab2f7167a9a9795665f894d04f77aafceca80821b51589bb4b23ff5c/nvidia_sphinx_theme-0.0.9.post1-py3-none-any.whl + linux-aarch64: + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/_openmp_mutex-4.5-20_gnu.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/_python_abi3_support-1.0-hd8ed1ab_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/accessible-pygments-0.0.5-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/alabaster-1.0.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/apeye-1.4.1-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/apeye-core-1.1.5-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/arm-variant-1.2.0-sbsa.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/asttokens-3.0.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/attrs-26.1.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/autodocsumm-0.2.15-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/backports.zstd-1.3.0-py312h3d8e7d4_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/beautifulsoup4-4.14.3-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/brotli-python-1.2.0-py312hac7b6a9_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/bzip2-1.0.8-h4777abc_9.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.2.25-hbd8a1cb_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cachecontrol-0.14.3-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/certifi-2026.2.25-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/charset-normalizer-3.4.7-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/click-8.3.1-pyh8f84b5b_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/colorama-0.4.6-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/comm-0.2.3-pyhe01879c_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cpython-3.12.13-py312hd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cssutils-2.11.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-bindings-13.2.0-py312hdc0efb6_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvrtc-13.3.33-h8f3c8d4_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-impl-13.3.33-h7b14b0b_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-pathfinder-1.5.2-pyhc364b38_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-13.3-hcbadf70_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cython-3.2.4-py312he940de5_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/debugpy-1.8.20-py312hf55c4e8_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/decorator-5.2.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/dict2css-0.3.0.post1-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/docutils-0.21.2-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/domdf-python-tools-3.10.0-pyhff2d567_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/enum_tools-0.13.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.3.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/executing-2.2.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/filelock-3.25.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/greenlet-3.3.2-py312hf55c4e8_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/h2-4.3.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/hpack-4.1.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/html5lib-1.1-pyhd8ed1ab_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/hyperframe-6.1.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/icu-78.3-hcab7f73_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/idna-3.11-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/imagesize-2.0.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/importlib-metadata-8.8.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/importlib-resources-6.5.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/importlib_resources-6.5.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/iniconfig-2.3.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ipykernel-7.2.0-pyha191276_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ipython-9.12.0-pyhecfbec7_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ipython_pygments_lexers-1.1.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jedi-0.19.2-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jinja2-3.1.6-pyhcf101f3_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jsonschema-4.26.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jsonschema-specifications-2025.9.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jupyter-cache-1.0.1-pyhff2d567_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jupyter_client-8.8.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jupyter_core-5.9.1-pyhc90fa1f_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/keyutils-1.6.3-h86ecc28_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/krb5-1.22.2-hfd895c2_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/ld_impl_linux-aarch64-2.45.1-default_h1979696_102.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libblas-3.11.0-6_haddc8a3_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcap-2.77-hf9559e3_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcblas-3.11.0-6_hd72aa62_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcufile-1.18.0.66-h4243460_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libedit-3.1.20250104-pl5321h976ea20_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libexpat-2.7.5-hfae3067_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libffi-3.5.2-h376a255_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgcc-15.2.0-h8acb6b2_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgcc-ng-15.2.0-he9431aa_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgfortran-15.2.0-he9431aa_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgfortran5-15.2.0-h1b7bec0_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgomp-15.2.0-h8acb6b2_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/liblapack-3.11.0-6_h88aeb00_openblas.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/liblzma-5.8.2-he30d5cf_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnl-3.11.0-h86ecc28_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnsl-2.0.1-h86ecc28_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnvjitlink-13.3.33-h8f3c8d4_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenblas-0.3.32-pthreads_h9d3fd7e_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsodium-1.0.21-h80f16a2_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsqlite-3.52.0-h10b116e_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libstdcxx-15.2.0-hef695bb_18.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsystemd0-257.13-hf9559e3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libudev1-257.13-hf9559e3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libuuid-2.42-h1022ec0_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libxcrypt-4.4.36-h31becfc_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libzlib-1.3.2-hdc9db2a_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/make-4.4.1-h2a6d0cb_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/markdown-it-py-4.0.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/markupsafe-3.0.3-py312hd077ced_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/matplotlib-inline-0.2.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/mdit-py-plugins-0.5.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/mdurl-0.1.2-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/more-itertools-11.0.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/msgpack-python-1.1.2-py312h4f740d2_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/mypy_extensions-1.1.0-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/myst-nb-1.4.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/myst-parser-5.0.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/natsort-8.4.0-pyhcf101f3_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/nbclient-0.10.4-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/nbformat-5.10.4-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/ncurses-6.5-ha32ae93_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/nest-asyncio-1.6.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/numpy-2.4.3-py312h6615c27_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/numpydoc-1.10.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/openssl-3.6.1-h546c87b_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-26.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/parso-0.8.6-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pexpect-4.9.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pip-26.0.1-pyh8b19718_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.9.4-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pluggy-1.6.0-pyhf9edf01_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/prompt-toolkit-3.0.52-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/psutil-7.2.2-py312hd41f8a7_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ptyprocess-0.7.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pure_eval-0.2.3-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pyclibrary-0.2.2-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pydata-sphinx-theme-0.17.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pygments-2.20.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pyparsing-3.3.2-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pysocks-1.7.1-pyha55dd90_7.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-9.0.2-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/python-3.12.13-h91f4b29_0_cpython.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python-dateutil-2.9.0.post0-pyhe01879c_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python-fastjsonschema-2.21.2-pyhe01879c_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python-gil-3.12.13-hd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.12-8_cp312.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/pyyaml-6.0.3-py312ha4530ae_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/pyzmq-27.1.0-py312hdf0a211_2.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/rdma-core-61.0-h1f0f388_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/readline-8.3-hb682ff5_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/referencing-0.37.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/requests-2.33.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/rpds-py-0.30.0-py312h75d7d99_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ruamel.yaml-0.19.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/ruamel.yaml.clib-0.2.15-py312hd41f8a7_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/scipy-1.17.1-py312he5b0e10_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/six-1.17.0-pyhe01879c_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/snowballstemmer-3.0.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/soupsieve-2.8.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-8.1.3-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-autodoc-typehints-3.0.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-copybutton-0.5.2-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-jinja2-compat-0.4.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-prompt-1.10.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-tabs-3.4.1-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-toolbox-4.1.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-applehelp-2.0.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-devhelp-2.0.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-htmlhelp-2.1.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-jsmath-1.0.1-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-qthelp-2.0.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-serializinghtml-1.1.10-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/sqlalchemy-2.0.49-py312h2fc9c67_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/stack_data-0.6.3-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tabulate-0.10.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/tk-8.6.13-noxft_h0dc03b3_103.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.4.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/tornado-6.5.5-py312hefbd42c_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/traitlets-5.14.3-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing-extensions-4.15.0-h396c80c_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.15.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_inspect-0.9.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/urllib3-2.6.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wcwidth-0.6.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/webencodings-0.5.1-pyhd8ed1ab_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wheel-0.46.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/yaml-0.2.5-h80f16a2_3.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/zeromq-4.3.5-hc0523f8_10.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/zipp-3.23.0-pyhcf101f3_1.conda + - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/zstd-1.5.7-h85ac4a6_6.conda + - pypi: https://files.pythonhosted.org/packages/8c/79/017fab2f7167a9a9795665f894d04f77aafceca80821b51589bb4b23ff5c/nvidia_sphinx_theme-0.0.9.post1-py3-none-any.whl + win-64: + - conda: https://conda.anaconda.org/conda-forge/win-64/_openmp_mutex-4.5-20_gnu.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/_python_abi3_support-1.0-hd8ed1ab_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/accessible-pygments-0.0.5-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/alabaster-1.0.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/apeye-1.4.1-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/apeye-core-1.1.5-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/asttokens-3.0.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/attrs-26.1.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/autodocsumm-0.2.15-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/backports.zstd-1.3.0-py312h06d0912_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/beautifulsoup4-4.14.3-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/brotli-python-1.2.0-py312hc6d9e41_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/bzip2-1.0.8-h0ad9c76_9.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.2.25-h4c7d964_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cachecontrol-0.14.3-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/certifi-2026.2.25-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/charset-normalizer-3.4.7-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/click-8.3.1-pyha7b4d00_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/colorama-0.4.6-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/comm-0.2.3-pyhe01879c_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cpython-3.12.13-py312hd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cssutils-2.11.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-bindings-13.2.0-py312hc128f0a_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvrtc-13.3.33-hac47afa_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvvm-impl-13.3.33-h2466b09_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-pathfinder-1.5.2-pyhc364b38_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-13.3-hcbadf70_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/cython-3.2.4-py312hd245ac3_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/debugpy-1.8.20-py312ha1a9051_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/decorator-5.2.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/dict2css-0.3.0.post1-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/docutils-0.21.2-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/domdf-python-tools-3.10.0-pyhff2d567_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/enum_tools-0.13.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.3.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/executing-2.2.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/filelock-3.25.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/greenlet-3.3.2-py312ha1a9051_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/h2-4.3.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/hpack-4.1.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/html5lib-1.1-pyhd8ed1ab_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/hyperframe-6.1.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/idna-3.11-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/imagesize-2.0.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/importlib-metadata-8.8.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/importlib-resources-6.5.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/importlib_resources-6.5.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/iniconfig-2.3.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ipykernel-7.2.0-pyh6dadd2b_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ipython-9.12.0-pyhccfa634_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ipython_pygments_lexers-1.1.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jedi-0.19.2-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jinja2-3.1.6-pyhcf101f3_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jsonschema-4.26.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jsonschema-specifications-2025.9.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jupyter-cache-1.0.1-pyhff2d567_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jupyter_client-8.8.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/jupyter_core-5.9.1-pyh6dadd2b_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/krb5-1.22.2-h0ea6238_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libblas-3.11.0-6_hf2e6a31_mkl.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libcblas-3.11.0-6_h2a3cdd5_mkl.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libexpat-2.7.5-hac47afa_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libffi-3.5.2-h3d046cb_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libgcc-15.2.0-h8ee18e1_18.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libgomp-15.2.0-h8ee18e1_18.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libhwloc-2.12.2-default_h4379cf1_1000.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libiconv-1.18-hc1393d2_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/liblapack-3.11.0-6_hf9ab0e9_mkl.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/liblzma-5.8.2-hfd05255_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libnvjitlink-13.3.33-hac47afa_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libsodium-1.0.21-h6a83c73_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libsqlite-3.52.0-hf5d6505_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libwinpthread-12.0.0.r4.gg4f2fc60ca-h57928b3_10.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libxml2-16-2.15.2-h692994f_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libxml2-2.15.2-h5d26750_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/libzlib-1.3.2-hfd05255_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/llvm-openmp-22.1.2-h4fa8253_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/make-4.4.1-h0e40799_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/markdown-it-py-4.0.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/markupsafe-3.0.3-py312h05f76fc_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/matplotlib-inline-0.2.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/mdit-py-plugins-0.5.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/mdurl-0.1.2-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/mkl-2025.3.1-hac47afa_11.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/more-itertools-11.0.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/msgpack-python-1.1.2-py312hf90b1b7_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/mypy_extensions-1.1.0-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/myst-nb-1.4.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/myst-parser-5.0.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/natsort-8.4.0-pyhcf101f3_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/nbclient-0.10.4-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/nbformat-5.10.4-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/nest-asyncio-1.6.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/numpy-2.4.3-py312ha3f287d_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/numpydoc-1.10.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/openssl-3.6.1-hf411b9b_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-26.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/parso-0.8.6-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pip-26.0.1-pyh8b19718_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.9.4-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pluggy-1.6.0-pyhf9edf01_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/prompt-toolkit-3.0.52-pyha770c72_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py312he5662c2_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pure_eval-0.2.3-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pyclibrary-0.2.2-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pydata-sphinx-theme-0.17.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pygments-2.20.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pyparsing-3.3.2-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pysocks-1.7.1-pyh09c184e_7.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-9.0.2-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/python-3.12.13-h0159041_0_cpython.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python-dateutil-2.9.0.post0-pyhe01879c_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python-fastjsonschema-2.21.2-pyhe01879c_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python-gil-3.12.13-hd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.12-8_cp312.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/pywin32-311-py312h829343e_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/pyyaml-6.0.3-py312h05f76fc_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/pyzmq-27.1.0-py312h343a6d4_2.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/referencing-0.37.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/requests-2.33.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/rpds-py-0.30.0-py312hdabe01f_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/ruamel.yaml-0.19.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/ruamel.yaml.clib-0.2.15-py312he5662c2_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/scipy-1.17.1-py312h9b3c559_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/six-1.17.0-pyhe01879c_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/snowballstemmer-3.0.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/soupsieve-2.8.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-8.1.3-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-autodoc-typehints-3.0.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-copybutton-0.5.2-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-jinja2-compat-0.4.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-prompt-1.10.1-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-tabs-3.4.1-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-toolbox-4.1.2-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-applehelp-2.0.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-devhelp-2.0.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-htmlhelp-2.1.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-jsmath-1.0.1-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-qthelp-2.0.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-serializinghtml-1.1.10-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/sqlalchemy-2.0.49-py312he5662c2_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/stack_data-0.6.3-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tabulate-0.10.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/tbb-2022.3.0-h3155e25_2.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/tk-8.6.13-h6ed50ae_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.4.1-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/tornado-6.5.5-py312he06e257_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/traitlets-5.14.3-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing-extensions-4.15.0-h396c80c_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.15.0-pyhcf101f3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/typing_inspect-0.9.0-pyhd8ed1ab_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/ucrt-10.0.26100.0-h57928b3_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/urllib3-2.6.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/vc-14.3-h41ae7f8_34.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.44.35208-h818238b_34.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/vcomp14-14.44.35208-h818238b_34.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wcwidth-0.6.0-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/webencodings-0.5.1-pyhd8ed1ab_3.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wheel-0.46.3-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/win_inet_pton-1.1.0-pyh7428d3b_8.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/yaml-0.2.5-h6a83c73_3.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/zeromq-4.3.5-h507cc87_10.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/zipp-3.23.0-pyhcf101f3_1.conda + - conda: https://conda.anaconda.org/conda-forge/win-64/zstd-1.5.7-h534d264_6.conda + - pypi: https://files.pythonhosted.org/packages/8c/79/017fab2f7167a9a9795665f894d04f77aafceca80821b51589bb4b23ff5c/nvidia_sphinx_theme-0.0.9.post1-py3-none-any.whl packages: - conda: https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2 sha256: fe51de6107f9edc7aa4f786a70f4a883943bc9d39b3bb7307c04c41410990726 @@ -1603,6 +2135,7 @@ packages: - openmp_impl <0.0a0 license: BSD-3-Clause license_family: BSD + purls: [] size: 28948 timestamp: 1770939786096 - conda: https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-2_gnu.tar.bz2 @@ -1628,6 +2161,7 @@ packages: - openmp_impl <0.0a0 license: BSD-3-Clause license_family: BSD + purls: [] size: 28926 timestamp: 1770939656741 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/_openmp_mutex-4.5-2_gnu.tar.bz2 @@ -1654,6 +2188,7 @@ packages: - msys2-conda-epoch <0.0a0 license: BSD-3-Clause license_family: BSD + purls: [] size: 52252 timestamp: 1770943776666 - conda: https://conda.anaconda.org/conda-forge/win-64/_openmp_mutex-4.5-2_gnu.conda @@ -1670,6 +2205,40 @@ packages: license_family: BSD size: 49468 timestamp: 1718213032772 +- conda: https://conda.anaconda.org/conda-forge/noarch/_python_abi3_support-1.0-hd8ed1ab_2.conda + sha256: a3967b937b9abf0f2a99f3173fa4630293979bd1644709d89580e7c62a544661 + md5: aaa2a381ccc56eac91d63b6c1240312f + depends: + - cpython + - python-gil + license: MIT + license_family: MIT + purls: [] + size: 8191 + timestamp: 1744137672556 +- conda: https://conda.anaconda.org/conda-forge/noarch/accessible-pygments-0.0.5-pyhd8ed1ab_1.conda + sha256: 1307719f0d8ee694fc923579a39c0621c23fdaa14ccdf9278a5aac5665ac58e9 + md5: 74ac5069774cdbc53910ec4d631a3999 + depends: + - pygments + - python >=3.9 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/accessible-pygments?source=hash-mapping + size: 1326096 + timestamp: 1734956217254 +- conda: https://conda.anaconda.org/conda-forge/noarch/alabaster-1.0.0-pyhd8ed1ab_1.conda + sha256: 6c4456a138919dae9edd3ac1a74b6fbe5fd66c05675f54df2f8ab8c8d0cc6cea + md5: 1fd9696649f65fd6611fcdb4ffec738a + depends: + - python >=3.10 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/alabaster?source=hash-mapping + size: 18684 + timestamp: 1733750512696 - conda: https://conda.anaconda.org/conda-forge/linux-64/alsa-lib-1.2.15.1-hb03c661_0.conda sha256: 224f1a55a9ba7e877bce980f14fc3e3c0f0fb6d3cbf3c5f1a8f5dd8391ce8bba md5: bba37fb066adb90e1d876dff0fd5d09d @@ -1739,13 +2308,57 @@ packages: license_family: BSD size: 1958151 timestamp: 1718551737234 +- conda: https://conda.anaconda.org/conda-forge/noarch/apeye-1.4.1-pyhd8ed1ab_1.conda + sha256: b554d2d2fc869a5955ebb3e5c8aea5e13ec49363b782b08e1802e29c91beaebf + md5: 0f2a7ba1dfc3b6117cfd864d25fa86ce + depends: + - apeye-core >=1.0.0b2 + - domdf-python-tools >=2.6.0 + - platformdirs >=2.3.0 + - python >=3.9 + - requests >=2.24.0 + constrains: + - cachecontrol >=0.12.6 + license: LGPL-3.0-or-later + license_family: LGPL + purls: + - pkg:pypi/apeye?source=hash-mapping + size: 95690 + timestamp: 1738250335247 +- conda: https://conda.anaconda.org/conda-forge/noarch/apeye-core-1.1.5-pyhd8ed1ab_1.conda + sha256: 3ee9787c3876c2ffb4b3c77ac73c0b28d67d18a376f4c952643cac95020a2a14 + md5: b60c08c6a0cbb505016075bb9e484e56 + depends: + - domdf-python-tools >=2.6.0 + - idna >=2.5 + - python >=3.9 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/apeye-core?source=hash-mapping + size: 94258 + timestamp: 1738681346787 - conda: https://conda.anaconda.org/conda-forge/noarch/arm-variant-1.2.0-sbsa.conda sha256: 0658cac65071ace5beded633851681e6f0b381040c8ce313bbe2a0ab410c5072 md5: b7d6244b9c7a660f10336645e73c2cd2 license: BSD-3-Clause license_family: BSD + purls: [] size: 7126 timestamp: 1742928603302 +- conda: https://conda.anaconda.org/conda-forge/noarch/asttokens-3.0.1-pyhd8ed1ab_0.conda + sha256: ee4da0f3fe9d59439798ee399ef3e482791e48784873d546e706d0935f9ff010 + md5: 9673a61a297b00016442e022d689faa6 + depends: + - python >=3.10 + constrains: + - astroid >=2,<5 + license: Apache-2.0 + license_family: Apache + purls: + - pkg:pypi/asttokens?source=hash-mapping + size: 28797 + timestamp: 1763410017955 - conda: https://conda.anaconda.org/conda-forge/linux-64/attr-2.5.2-h39aace5_0.conda sha256: a9c114cbfeda42a226e2db1809a538929d2f118ef855372293bd188f71711c48 md5: 791365c5f65975051e4e017b5da3abf5 @@ -1765,6 +2378,100 @@ packages: license_family: GPL size: 74992 timestamp: 1660065534958 +- conda: https://conda.anaconda.org/conda-forge/noarch/attrs-26.1.0-pyhcf101f3_0.conda + sha256: 1b6124230bb4e571b1b9401537ecff575b7b109cc3a21ee019f65e083b8399ab + md5: c6b0543676ecb1fb2d7643941fe375f2 + depends: + - python >=3.10 + - python + license: MIT + license_family: MIT + purls: + - pkg:pypi/attrs?source=hash-mapping + size: 64927 + timestamp: 1773935801332 +- conda: https://conda.anaconda.org/conda-forge/noarch/autodocsumm-0.2.15-pyhd8ed1ab_0.conda + sha256: 21cb40c7c5f47bf54d2722b1ab3c91f747ef2b80ba16ece058755371e5c6385b + md5: e51977d5fe34698e26a20950b8b449e6 + depends: + - python >=3.7 + - sphinx >=2.2,<10.0 + license: Apache-2.0 + license_family: APACHE + purls: + - pkg:pypi/autodocsumm?source=hash-mapping + size: 20495 + timestamp: 1774600916594 +- conda: https://conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1.conda + sha256: a14a9ad02101aab25570543a59c5193043b73dc311a25650134ed9e6cb691770 + md5: f1976ce927373500cc19d3c0b2c85177 + depends: + - python >=3.10 + - python + constrains: + - pytz >=2015.7 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/babel?source=compressed-mapping + size: 7684321 + timestamp: 1772555330347 +- conda: https://conda.anaconda.org/conda-forge/linux-64/backports.zstd-1.3.0-py312h90b7ffd_0.conda + sha256: d77a24be15e283d83214121428290dbe55632a6e458378205b39c550afa008cf + md5: 5b8c55fed2e576dde4b0b33693a4fdb1 + depends: + - python + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + - python_abi 3.12.* *_cp312 + - zstd >=1.5.7,<1.6.0a0 + license: BSD-3-Clause AND MIT AND EPL-2.0 + purls: + - pkg:pypi/backports-zstd?source=hash-mapping + size: 237970 + timestamp: 1767045004512 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/backports.zstd-1.3.0-py312h3d8e7d4_0.conda + sha256: 15ca235863f67ebbfa5a3c1cf1eb3f448ad4bafa9e9d1660996d90b406c2f5ca + md5: 342f2741b222094a78db95893ecc42f9 + depends: + - python + - libgcc >=14 + - python 3.12.* *_cpython + - zstd >=1.5.7,<1.6.0a0 + - python_abi 3.12.* *_cp312 + license: BSD-3-Clause AND MIT AND EPL-2.0 + purls: + - pkg:pypi/backports-zstd?source=hash-mapping + size: 243175 + timestamp: 1767044998908 +- conda: https://conda.anaconda.org/conda-forge/win-64/backports.zstd-1.3.0-py312h06d0912_0.conda + sha256: c9c97cd644faa6c4fb38017c5ecfd082f56a3126af5925d246364fa4a22b2a74 + md5: 2db2b356f08f19ce4309a79a9ee6b9d8 + depends: + - python + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - python_abi 3.12.* *_cp312 + - zstd >=1.5.7,<1.6.0a0 + license: BSD-3-Clause AND MIT AND EPL-2.0 + purls: + - pkg:pypi/backports-zstd?source=hash-mapping + size: 236635 + timestamp: 1767045021157 +- conda: https://conda.anaconda.org/conda-forge/noarch/beautifulsoup4-4.14.3-pyha770c72_0.conda + sha256: bf1e71c3c0a5b024e44ff928225a0874fc3c3356ec1a0b6fe719108e6d1288f6 + md5: 5267bef8efea4127aacd1f4e1f149b6e + depends: + - python >=3.10 + - soupsieve >=1.2 + - typing-extensions + license: MIT + license_family: MIT + purls: + - pkg:pypi/beautifulsoup4?source=hash-mapping + size: 90399 + timestamp: 1764520638652 - conda: https://conda.anaconda.org/conda-forge/linux-64/binutils_impl_linux-64-2.45-default_hfdba357_104.conda sha256: 054a77ccab631071a803737ea8e5d04b5b18e57db5b0826a04495bd3fdf39a7c md5: a7a67bf132a4a2dea92a7cb498cdc5b1 @@ -1864,6 +2571,57 @@ packages: license_family: GPL size: 5830940 timestamp: 1770267725685 +- conda: https://conda.anaconda.org/conda-forge/linux-64/brotli-python-1.2.0-py312hdb49522_1.conda + sha256: 49df13a1bb5e388ca0e4e87022260f9501ed4192656d23dc9d9a1b4bf3787918 + md5: 64088dffd7413a2dd557ce837b4cbbdb + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + constrains: + - libbrotlicommon 1.2.0 hb03c661_1 + license: MIT + license_family: MIT + purls: + - pkg:pypi/brotli?source=compressed-mapping + size: 368300 + timestamp: 1764017300621 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/brotli-python-1.2.0-py312hac7b6a9_1.conda + sha256: aa14d1f26a1d4ed3a735281beb20129b9ba4670fed688045ac71f4119aeed7e6 + md5: d64147176625536a8024e26577c5e894 + depends: + - libgcc >=14 + - libstdcxx >=14 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + constrains: + - libbrotlicommon 1.2.0 he30d5cf_1 + license: MIT + license_family: MIT + purls: + - pkg:pypi/brotli?source=hash-mapping + size: 373800 + timestamp: 1764017545385 +- conda: https://conda.anaconda.org/conda-forge/win-64/brotli-python-1.2.0-py312hc6d9e41_1.conda + sha256: 2bb6f384a51929ef2d5d6039fcf6c294874f20aaab2f63ca768cbe462ed4b379 + md5: e8e7a6346a9e50d19b4daf41f367366f + depends: + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + constrains: + - libbrotlicommon 1.2.0 hfd05255_1 + license: MIT + license_family: MIT + purls: + - pkg:pypi/brotli?source=hash-mapping + size: 335482 + timestamp: 1764018063640 - conda: https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hda65f42_8.conda sha256: c30daba32ddebbb7ded490f0e371eae90f51e72db620554089103b4a6934b0d5 md5: 51a19bba1b8ebfb60df25cde030b7ebc @@ -1882,6 +2640,7 @@ packages: - libgcc >=14 license: bzip2-1.0.6 license_family: BSD + purls: [] size: 260182 timestamp: 1771350215188 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/bzip2-1.0.8-h4777abc_8.conda @@ -1900,6 +2659,7 @@ packages: - libgcc >=14 license: bzip2-1.0.6 license_family: BSD + purls: [] size: 192412 timestamp: 1771350241232 - conda: https://conda.anaconda.org/conda-forge/win-64/bzip2-1.0.8-h0ad9c76_8.conda @@ -1922,6 +2682,7 @@ packages: - vc14_runtime >=14.44.35208 license: bzip2-1.0.6 license_family: BSD + purls: [] size: 56115 timestamp: 1771350256444 - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2025.11.12-h4c7d964_0.conda @@ -1962,6 +2723,7 @@ packages: depends: - __win license: ISC + purls: [] size: 147734 timestamp: 1772006322223 - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.2.25-hbd8a1cb_0.conda @@ -1970,8 +2732,22 @@ packages: depends: - __unix license: ISC + purls: [] size: 147413 timestamp: 1772006283803 +- conda: https://conda.anaconda.org/conda-forge/noarch/cachecontrol-0.14.3-pyha770c72_0.conda + sha256: ec791bb6f1ef504411f87b28946a7ae63ed1f3681cefc462cf1dfdaf0790b6a9 + md5: 241ef6e3db47a143ac34c21bfba510f1 + depends: + - msgpack-python >=0.5.2,<2.0.0 + - python >=3.9 + - requests >=2.16.0 + license: Apache-2.0 + license_family: Apache + purls: + - pkg:pypi/cachecontrol?source=hash-mapping + size: 23868 + timestamp: 1746103006628 - conda: https://conda.anaconda.org/conda-forge/linux-64/cairo-1.18.4-h3394656_0.conda sha256: 3bd6a391ad60e471de76c0e9db34986c4b5058587fbf2efa5a7f54645e28c2c7 md5: 09262e66b19567aff4f592fb53b28760 @@ -2111,6 +2887,54 @@ packages: license: LGPL-2.1-only or MPL-1.1 size: 1524254 timestamp: 1741555212198 +- conda: https://conda.anaconda.org/conda-forge/noarch/certifi-2026.2.25-pyhd8ed1ab_0.conda + sha256: a6b118fd1ed6099dc4fc03f9c492b88882a780fadaef4ed4f93dc70757713656 + md5: 765c4d97e877cdbbb88ff33152b86125 + depends: + - python >=3.10 + license: ISC + purls: + - pkg:pypi/certifi?source=compressed-mapping + size: 151445 + timestamp: 1772001170301 +- conda: https://conda.anaconda.org/conda-forge/noarch/charset-normalizer-3.4.7-pyhd8ed1ab_0.conda + sha256: 3f9483d62ce24ecd063f8a5a714448445dc8d9e201147c46699fc0033e824457 + md5: a9167b9571f3baa9d448faa2139d1089 + depends: + - python >=3.10 + license: MIT + license_family: MIT + purls: + - pkg:pypi/charset-normalizer?source=compressed-mapping + size: 58872 + timestamp: 1775127203018 +- conda: https://conda.anaconda.org/conda-forge/noarch/click-8.3.1-pyh8f84b5b_1.conda + sha256: 38cfe1ee75b21a8361c8824f5544c3866f303af1762693a178266d7f198e8715 + md5: ea8a6c3256897cc31263de9f455e25d9 + depends: + - python >=3.10 + - __unix + - python + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/click?source=hash-mapping + size: 97676 + timestamp: 1764518652276 +- conda: https://conda.anaconda.org/conda-forge/noarch/click-8.3.1-pyha7b4d00_1.conda + sha256: c3bc9a49930fa1c3383a1485948b914823290efac859a2587ca57a270a652e08 + md5: 6cd3ccc98bacfcc92b2bd7f236f01a7e + depends: + - python >=3.10 + - colorama + - __win + - python + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/click?source=hash-mapping + size: 96620 + timestamp: 1764518654675 - conda: https://conda.anaconda.org/conda-forge/noarch/colorama-0.4.6-pyhd8ed1ab_1.conda sha256: ab29d57dc70786c1269633ba3dff20288b81664d3ff8d21af995742e2bb03287 md5: 962b9857ee8e7018c22f2776ffa0b2d7 @@ -2118,8 +2942,22 @@ packages: - python >=3.9 license: BSD-3-Clause license_family: BSD + purls: + - pkg:pypi/colorama?source=hash-mapping size: 27011 timestamp: 1733218222191 +- conda: https://conda.anaconda.org/conda-forge/noarch/comm-0.2.3-pyhe01879c_0.conda + sha256: 576a44729314ad9e4e5ebe055fbf48beb8116b60e58f9070278985b2b634f212 + md5: 2da13f2b299d8e1995bafbbe9689a2f7 + depends: + - python >=3.9 + - python + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/comm?source=hash-mapping + size: 14690 + timestamp: 1753453984907 - conda: https://conda.anaconda.org/conda-forge/linux-64/conda-gcc-specs-15.2.0-h53410ce_16.conda sha256: 0e3a6497ccfad65246f9ca8225f290b10ee3be7712e6f7585f1585f72074ecff md5: 7d1e5e99f086b25a8aeace8f35962fe7 @@ -2147,32 +2985,55 @@ packages: license_family: GPL size: 54725 timestamp: 1771382417485 +- conda: https://conda.anaconda.org/conda-forge/noarch/cpython-3.12.13-py312hd8ed1ab_0.conda + noarch: generic + sha256: d3e9bbd7340199527f28bbacf947702368f31de60c433a16446767d3c6aaf6fe + md5: f54c1ffb8ecedb85a8b7fcde3a187212 + depends: + - python >=3.12,<3.13.0a0 + - python_abi * *_cp312 + license: Python-2.0 + purls: [] + size: 46463 + timestamp: 1772728929620 +- conda: https://conda.anaconda.org/conda-forge/noarch/cssutils-2.11.1-pyhd8ed1ab_0.conda + sha256: b9006cbd28ed63a6461717cb9234e1d1f39441d9db0493f55ee0ca72f3577833 + md5: 99cf98eea444365238fb6ee8f518ef19 + depends: + - more-itertools + - python >=3.9 + license: LGPL-3.0-only + license_family: LGPL + purls: + - pkg:pypi/cssutils?source=hash-mapping + size: 284664 + timestamp: 1747322864144 - conda: . name: cuda-bindings version: 13.2.0 - build: py314h356c398_0 - subdir: win-64 + build: py314h3ff45e1_0 + subdir: linux-aarch64 variants: - c_compiler: vs2022 - cuda-version: 13.2.* - cxx_compiler: vs2022 + cuda_version: 13.3.* python: 3.14.* - target_platform: win-64 + target_platform: linux-aarch64 depends: - python - cuda-version - cuda-pathfinder - libnvjitlink - cuda-nvrtc - - cuda-nvrtc >=13.2.51,<14.0a0 + - cuda-nvrtc >=13.3.33,<14.0a0 - cuda-nvvm - libnvfatbin - - vc >=14.3,<15 - - vc14_runtime >=14.44.35208 - - ucrt >=10.0.20348.0 - - python_abi 3.14.* *_cp314 - license: LicenseRef-NVIDIA-SOFTWARE-LICENSE - sources: + - libcufile + - libcufile >=1.18.0.66,<2.0a0 + - libgcc >=15 + - libgcc >=15 + - libstdcxx >=15 + - python_abi 3.14.* *_cp314 + license: Apache-2.0 + sources: cuda-pathfinder: path: ../cuda_pathfinder - conda: . @@ -2182,7 +3043,7 @@ packages: subdir: win-64 variants: c_compiler: vs2022 - cuda-version: 12.* + cuda_version: 12.* cxx_compiler: vs2022 python: 3.14.* target_platform: win-64 @@ -2199,45 +3060,45 @@ packages: - vc14_runtime >=14.44.35208 - ucrt >=10.0.20348.0 - python_abi 3.14.* *_cp314 - license: LicenseRef-NVIDIA-SOFTWARE-LICENSE + license: Apache-2.0 sources: cuda-pathfinder: path: ../cuda_pathfinder - conda: . name: cuda-bindings version: 13.2.0 - build: py314h9a28ecd_0 - subdir: linux-aarch64 + build: py314ha6d028f_0 + subdir: linux-64 variants: - cuda-version: 13.2.* + cuda_version: 12.* python: 3.14.* - target_platform: linux-aarch64 + target_platform: linux-64 depends: - python - cuda-version - cuda-pathfinder - libnvjitlink - cuda-nvrtc - - cuda-nvrtc >=13.2.51,<14.0a0 + - cuda-nvrtc >=12.9.86,<13.0a0 - cuda-nvvm - libnvfatbin - libcufile - - libcufile >=1.17.0.44,<2.0a0 + - libcufile >=1.14.1.1,<2.0a0 - libgcc >=15 - libgcc >=15 - libstdcxx >=15 - python_abi 3.14.* *_cp314 - license: LicenseRef-NVIDIA-SOFTWARE-LICENSE + license: Apache-2.0 sources: cuda-pathfinder: path: ../cuda_pathfinder - conda: . name: cuda-bindings version: 13.2.0 - build: py314ha6d028f_0 + build: py314hd3a1e81_0 subdir: linux-64 variants: - cuda-version: 12.* + cuda_version: 13.3.* python: 3.14.* target_platform: linux-64 depends: @@ -2246,44 +3107,44 @@ packages: - cuda-pathfinder - libnvjitlink - cuda-nvrtc - - cuda-nvrtc >=12.9.86,<13.0a0 + - cuda-nvrtc >=13.3.33,<14.0a0 - cuda-nvvm - libnvfatbin - libcufile - - libcufile >=1.14.1.1,<2.0a0 + - libcufile >=1.18.0.66,<2.0a0 - libgcc >=15 - libgcc >=15 - libstdcxx >=15 - python_abi 3.14.* *_cp314 - license: LicenseRef-NVIDIA-SOFTWARE-LICENSE + license: Apache-2.0 sources: cuda-pathfinder: path: ../cuda_pathfinder - conda: . name: cuda-bindings version: 13.2.0 - build: py314hb727236_0 - subdir: linux-64 + build: py314hd7f1909_0 + subdir: win-64 variants: - cuda-version: 13.2.* + c_compiler: vs2022 + cuda_version: 13.3.* + cxx_compiler: vs2022 python: 3.14.* - target_platform: linux-64 + target_platform: win-64 depends: - python - cuda-version - cuda-pathfinder - libnvjitlink - cuda-nvrtc - - cuda-nvrtc >=13.2.51,<14.0a0 + - cuda-nvrtc >=13.3.33,<14.0a0 - cuda-nvvm - libnvfatbin - - libcufile - - libcufile >=1.17.0.44,<2.0a0 - - libgcc >=15 - - libgcc >=15 - - libstdcxx >=15 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 - python_abi 3.14.* *_cp314 - license: LicenseRef-NVIDIA-SOFTWARE-LICENSE + license: Apache-2.0 sources: cuda-pathfinder: path: ../cuda_pathfinder @@ -2293,7 +3154,7 @@ packages: build: py314he8946ed_0 subdir: linux-aarch64 variants: - cuda-version: 12.* + cuda_version: 12.* python: 3.14.* target_platform: linux-aarch64 depends: @@ -2311,10 +3172,78 @@ packages: - libgcc >=15 - libstdcxx >=15 - python_abi 3.14.* *_cp314 - license: LicenseRef-NVIDIA-SOFTWARE-LICENSE + license: Apache-2.0 sources: cuda-pathfinder: path: ../cuda_pathfinder +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-bindings-13.2.0-py312hf79963d_0.conda + sha256: 3234a03d1c491edb7d24ce995dd271dab038bc58eee5dffbaab8253a8042ac4a + md5: cf07366d06fc39a555feb7e288de2dfe + depends: + - __glibc >=2.17,<3.0.a0 + - cuda-nvrtc >=13,<14.0a0 + - cuda-nvvm-impl >=13,<14.0a0 + - cuda-pathfinder >=1.1.0,<2 + - cuda-version >=13,<14.0a0 + - libcufile >=1,<2.0a0 + - libgcc >=14 + - libnvjitlink >=13.0,<14.0a0 + - libstdcxx >=14 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + constrains: + - cuda-python >=13.2.0,<13.3.0a0 + - cuda-cudart >=13,<14.0a0 + license: LicenseRef-NVIDIA-SOFTWARE-LICENSE + purls: + - pkg:pypi/cuda-bindings?source=hash-mapping + size: 4018993 + timestamp: 1773284505127 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-bindings-13.2.0-py312hdc0efb6_0.conda + sha256: 609e783783f4bb44643115665923ce225619ec5f5534099ce19a312119714fc4 + md5: 89d9c83a2a367fc5dad80bb134302d9c + depends: + - cuda-nvrtc >=13,<14.0a0 + - cuda-nvvm-impl >=13,<14.0a0 + - cuda-pathfinder >=1.1.0,<2 + - cuda-version >=13,<14.0a0 + - libcufile >=1,<2.0a0 + - libgcc >=14 + - libnvjitlink >=13.0,<14.0a0 + - libstdcxx >=14 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + constrains: + - cuda-cudart >=13,<14.0a0 + - cuda-python >=13.2.0,<13.3.0a0 + license: LicenseRef-NVIDIA-SOFTWARE-LICENSE + purls: + - pkg:pypi/cuda-bindings?source=hash-mapping + size: 3714646 + timestamp: 1773284747607 +- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-bindings-13.2.0-py312hc128f0a_0.conda + sha256: 04a8aafd54d5a42f8587706f1458e5a7491775292e3361a66ddd7fd5c517d407 + md5: 38204c165a2af6c58dfa1f59eb5e1f64 + depends: + - cuda-nvrtc >=13,<14.0a0 + - cuda-nvvm-impl >=13,<14.0a0 + - cuda-pathfinder >=1.1.0,<2 + - cuda-version >=13,<14.0a0 + - libnvjitlink >=13.0,<14.0a0 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + constrains: + - cuda-cudart >=13,<14.0a0 + - cuda-python >=13.2.0,<13.3.0a0 + license: LicenseRef-NVIDIA-SOFTWARE-LICENSE + purls: + - pkg:pypi/cuda-bindings?source=hash-mapping + size: 3575293 + timestamp: 1773284355109 - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_linux-64-12.9.27-ha770c72_0.conda sha256: 2ee3b9564ca326226e5cda41d11b251482df8e7c757e333d28ec75213c75d126 md5: 87ff6381e33b76e5b9b179a2cdd005ec @@ -2323,14 +3252,14 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 1150650 timestamp: 1746189825236 -- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_linux-64-13.2.27-ha770c72_0.conda - sha256: e539baa32e3be63f89bd11d421911363faac322903caf58a15a46ba68ae29867 - md5: 4910b7b709f1168baffc2a742b39a222 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_linux-64-13.3.3.3.1-ha770c72_0.conda + sha256: 66d95390d49b989f550ede42dfb3f6e82b6b729493f0843e13cd041a91682730 + md5: 56501e8a53d75afef7a2e3ca723d7569 depends: - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 1415308 - timestamp: 1773098874302 + size: 1472271 + timestamp: 1779895496841 - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_linux-aarch64-12.9.27-h579c4fd_0.conda sha256: b4efaee8fa95b9ec97a462dc343914a138ece704895e33caa52ac55968f7adfa md5: 71e4d87a72bf003bd05f05a502288b2a @@ -2340,15 +3269,15 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 1149299 timestamp: 1746189919921 -- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_linux-aarch64-13.2.27-h579c4fd_0.conda - sha256: b42ad7ab2c6d26d4f7227b979440550b8739840dfd207270092924cd59328390 - md5: 7feeffb9470b1b5732ea019743f2f309 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_linux-aarch64-13.3.3.3.1-h579c4fd_0.conda + sha256: f35385d6e5aca20274ae3d97f7859dae903b61ed5353ed68595d234beb774dfe + md5: e4cee0d90174186e1bdc9e01d6c66b90 depends: - arm-variant * sbsa - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 1416854 - timestamp: 1773098911724 + size: 1481900 + timestamp: 1779895522474 - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_win-64-12.9.27-h57928b3_0.conda sha256: 681eb1d9afd596e04329a82b04734c0e37c6ecb94b3380f3a378d61983e2a8cc md5: 8f897dca7111f3bb4ded97ba6947b186 @@ -2357,14 +3286,14 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 1139649 timestamp: 1746189858434 -- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_win-64-13.2.27-h57928b3_0.conda - sha256: c4f7d750b2d681dbce7b26367e353da02c473b216a22d06543ee5c874f539cfe - md5: 3cf8d4353e3e687daf464705daee416e +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cccl_win-64-13.3.3.3.1-h57928b3_0.conda + sha256: d730af2f1553511eab97a43522cae5c71ed618c65821084571a2d0655a426f4b + md5: 48f0b2f8be52ff044598069b4753f5bc depends: - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 1397188 - timestamp: 1773098940991 + size: 1462453 + timestamp: 1779895589763 - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_linux-64-12.9.86-ha770c72_2.conda sha256: e6257534c4b4b6b8a1192f84191c34906ab9968c92680fa09f639e7846a87304 md5: 79d280de61e18010df5997daea4743df @@ -2373,14 +3302,14 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 94239 timestamp: 1753975242354 -- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_linux-64-13.2.51-ha770c72_0.conda - sha256: dd9a74a40b196b1ea150b17ca8fb539dd8f75edd349af354a7bae6dbb43e43b4 - md5: 6f4a609f3d142d4b22728823955249e9 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_linux-64-13.3.33-ha770c72_0.conda + sha256: bd3381629964d1d00245ae9e4a7918c35e4967d216a34aad013f0ce387065b05 + md5: 0c95fd4e823baffe0f8885f4eef00ce7 depends: - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 97122 - timestamp: 1773115163637 + size: 116655 + timestamp: 1779905079263 - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_linux-aarch64-12.9.86-h579c4fd_2.conda sha256: 1db1f3ff4b0f445ce4064eb323733f7612ce28bc879dd6849e162b1504b7474a md5: 86be43a4154301b74f823bc6fe476629 @@ -2390,15 +3319,15 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 94794 timestamp: 1753975199249 -- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_linux-aarch64-13.2.51-h579c4fd_0.conda - sha256: 6cd3b6ab4fc3f0285843196527ed29c78c419d87f56f2e30cb954e3b5af9b2d6 - md5: 7273c2a7bd364c7b155bc97337b4b766 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_linux-aarch64-13.3.33-h579c4fd_0.conda + sha256: 129008eb8a49e1c0edbb4ba33855f46aab879b975fc427c5990c945fd371d89e + md5: b865ed5c0162925511f48e5a425e42bb depends: - arm-variant * sbsa - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 97002 - timestamp: 1773115152472 + size: 116665 + timestamp: 1779905122757 - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_win-64-12.9.86-h57928b3_2.conda sha256: 2fccde18cafec3cdb6697f37c576567ac623dc69531e2a81bbc83d8a86a82d1f md5: 569c55bd368307e48191a2ed54c64428 @@ -2407,14 +3336,14 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 95452 timestamp: 1753975640812 -- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_win-64-13.2.51-h57928b3_0.conda - sha256: 5c82150dfc8a4263963f945e599d478d8183050115812fd716e4b8553650a975 - md5: fd2d086385ef52584d8c4ca82f9560ae +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-crt-dev_win-64-13.3.33-h57928b3_0.conda + sha256: ed73e5072b9f4e603bb43f30988dde675174c38e45ce8120a39e6125283b3563 + md5: 7207fca55f102141c1e038577a153c1e depends: - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 97856 - timestamp: 1773115258856 + size: 117452 + timestamp: 1779905164275 - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-12.9.79-h5888daf_0.conda sha256: 57d1294ecfaf9dc8cdb5fc4be3e63ebc7614538bddb5de53cfd9b1b7de43aed5 md5: cb15315d19b58bd9cd424084e58ad081 @@ -2427,18 +3356,18 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 23242 timestamp: 1749218416505 -- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-13.2.51-hecca717_0.conda - sha256: 9cc44fd4914738a32cf5c801925a08c61ce45b5534833cf1df1621236a9a321d - md5: 29f5b46965bd82b0e9cc27a96d13f2bd +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-13.3.29-hecca717_0.conda + sha256: 3d74819f261d77a410e8f8ddbd973446c312ec76605d60619d9b85113eca9632 + md5: 3fc21c99786b908fd7f32ea279fc9780 depends: - __glibc >=2.17,<3.0.a0 - - cuda-cudart_linux-64 13.2.51 h376f20c_0 - - cuda-version >=13.2,<13.3.0a0 + - cuda-cudart_linux-64 13.3.29 h376f20c_0 + - cuda-version >=13.3,<13.4.0a0 - libgcc >=14 - libstdcxx >=14 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 24534 - timestamp: 1773104357094 + size: 24659 + timestamp: 1779898425780 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-12.9.79-h3ae8b8a_0.conda sha256: 3d6699fc27ffabf28a9d359b48e7b88437e4d945844718a58608627998db5d1b md5: df78e19e5fe656631d1470aa0fcf6ced @@ -2451,18 +3380,18 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 23466 timestamp: 1749218349235 -- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-13.2.51-h8f3c8d4_0.conda - sha256: 29be349d467aa2d2a8b6ccc738fca46e7a34ae30d220b6a70a2c99116f904801 - md5: 9dd153714cb42e271205d8b91d6da397 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-13.3.29-h8f3c8d4_0.conda + sha256: 7b02fe40d6a503f42e4ffe83bf2512876c7e4eb5374199b03045b0e17e14ec6f + md5: 8daff8683cfa57366f88b5a980d4bd03 depends: - arm-variant * sbsa - - cuda-cudart_linux-aarch64 13.2.51 h8f3c8d4_0 - - cuda-version >=13.2,<13.3.0a0 + - cuda-cudart_linux-aarch64 13.3.29 h8f3c8d4_0 + - cuda-version >=13.3,<13.4.0a0 - libgcc >=14 - libstdcxx >=14 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 24693 - timestamp: 1773104347563 + size: 24782 + timestamp: 1779898439985 - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-cudart-12.9.79-he0c23c2_0.conda sha256: a30cd9adf3a70d069d4d87c5728ec16778b77071629612ca5d8513cd92d89c09 md5: 0a243d4f000a0d2f51dd94ee9132b234 @@ -2475,18 +3404,18 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 170799 timestamp: 1749218946117 -- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-cudart-13.2.51-hac47afa_0.conda - sha256: fd5dfadd632558139570558d996d1f450abf189bf7d9ef309d4cf991a44b00db - md5: 19022910964efc250a83ebedebabd725 +- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-cudart-13.3.29-hac47afa_0.conda + sha256: c1d2727ec436cdc324d4c3e5d8256ea8bc0f9a8793773033021e5476533de719 + md5: a527f7cd2eec390cc8700a0e1878a954 depends: - - cuda-cudart_win-64 13.2.51 hac47afa_0 - - cuda-version >=13.2,<13.3.0a0 + - cuda-cudart_win-64 13.3.29 hac47afa_0 + - cuda-version >=13.3,<13.4.0a0 - ucrt >=10.0.20348.0 - vc >=14.3,<15 - vc14_runtime >=14.44.35208 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 217040 - timestamp: 1773104472849 + size: 215494 + timestamp: 1779898489923 - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-dev-12.9.79-h5888daf_0.conda sha256: 04d8235cb3cb3510c0492c3515a9d1a6053b50ef39be42b60cafb05044b5f4c6 md5: ba38a7c3b4c14625de45784b773f0c71 @@ -2501,20 +3430,20 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 23687 timestamp: 1749218464010 -- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-dev-13.2.51-hecca717_0.conda - sha256: f6d81c961b6212389c07ffc9dc1268966db63aa351d46875effee40447eb9dd8 - md5: 9b35a56418b6cbbde5ea5f7d84c26317 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-dev-13.3.29-hecca717_0.conda + sha256: 050ac942737f501b5dee21c0bbfa77f4617c52269f188ab66a5e2b8b7acd0f22 + md5: e21171cc900f202b2af82f1afddbdfcf depends: - __glibc >=2.17,<3.0.a0 - - cuda-cudart 13.2.51 hecca717_0 - - cuda-cudart-dev_linux-64 13.2.51 h376f20c_0 - - cuda-cudart-static 13.2.51 hecca717_0 - - cuda-version >=13.2,<13.3.0a0 + - cuda-cudart 13.3.29 hecca717_0 + - cuda-cudart-dev_linux-64 13.3.29 h376f20c_0 + - cuda-cudart-static 13.3.29 hecca717_0 + - cuda-version >=13.3,<13.4.0a0 - libgcc >=14 - libstdcxx >=14 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 24961 - timestamp: 1773104406956 + size: 25129 + timestamp: 1779898446163 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-dev-12.9.79-h3ae8b8a_0.conda sha256: d70f85411992e03494f2fe94a9852d79f366a92f40ba791611eda5551044afe9 md5: d58cc487273764a11637456c06399ff0 @@ -2529,20 +3458,20 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 23911 timestamp: 1749218369632 -- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-dev-13.2.51-h8f3c8d4_0.conda - sha256: 85b87e97cffc45aac2a85104f7afcf376f90d589afaa8026cefe5e518130e238 - md5: 0ac4ca914e1974f7651884841628fe9d +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-dev-13.3.29-h8f3c8d4_0.conda + sha256: 3ac23580a5152826def6f4ef8767ad24f38433ff47d85d8d971b9b67ee192e02 + md5: ce781c2e7b35de72a2b002d58f2e0d8f depends: - arm-variant * sbsa - - cuda-cudart 13.2.51 h8f3c8d4_0 - - cuda-cudart-dev_linux-aarch64 13.2.51 h8f3c8d4_0 - - cuda-cudart-static 13.2.51 h8f3c8d4_0 - - cuda-version >=13.2,<13.3.0a0 + - cuda-cudart 13.3.29 h8f3c8d4_0 + - cuda-cudart-dev_linux-aarch64 13.3.29 h8f3c8d4_0 + - cuda-cudart-static 13.3.29 h8f3c8d4_0 + - cuda-version >=13.3,<13.4.0a0 - libgcc >=14 - libstdcxx >=14 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 25169 - timestamp: 1773104375869 + size: 25269 + timestamp: 1779898455527 - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-cudart-dev-12.9.79-he0c23c2_0.conda sha256: 1ee68f0ffd37889f0fc438d4da7124054b124632e1c3bc15950b9851b002473e md5: e5bb074108bc2501f8374e80748aa181 @@ -2557,20 +3486,20 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 23222 timestamp: 1749219022963 -- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-cudart-dev-13.2.51-hac47afa_0.conda - sha256: 616a90e2401f5b0cf1ed061485eaabd8ef41f273a4634e41728170d605b5e795 - md5: 8180aa6faeefa23f02d60bb6b5793d4e +- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-cudart-dev-13.3.29-hac47afa_0.conda + sha256: 035d753771cb6736724ae08d0f4f1bb2886c590d7e06f303eb3ef47c15d39e7e + md5: b654d915abbee1382e58e49db9884f8e depends: - - cuda-cudart 13.2.51 hac47afa_0 - - cuda-cudart-dev_win-64 13.2.51 hac47afa_0 - - cuda-cudart-static 13.2.51 hac47afa_0 - - cuda-version >=13.2,<13.3.0a0 + - cuda-cudart 13.3.29 hac47afa_0 + - cuda-cudart-dev_win-64 13.3.29 hac47afa_0 + - cuda-cudart-static 13.3.29 hac47afa_0 + - cuda-version >=13.3,<13.4.0a0 - ucrt >=10.0.20348.0 - vc >=14.3,<15 - vc14_runtime >=14.44.35208 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 24390 - timestamp: 1773104527692 + size: 24489 + timestamp: 1779898504358 - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_linux-64-12.9.79-h3f2d84a_0.conda sha256: ffe86ed0144315b276f18020d836c8ef05bf971054cf7c3eb167af92494080d5 md5: 86e40eb67d83f1a58bdafdd44e5a77c6 @@ -2582,17 +3511,17 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 389140 timestamp: 1749218427266 -- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_linux-64-13.2.51-h376f20c_0.conda - sha256: 86dd0dc301bab5263d63f13d47b02507e0cf2fd22ff9aefa37dea2dd03c6df83 - md5: 7e5cf4b991525b7b1a2cfa3f1c81462e +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_linux-64-13.3.29-h376f20c_0.conda + sha256: d95f1b404119e3f72edb7ac5dbd4443e2d7d040f7d68c3905c0dd7ad78f11311 + md5: 4165013e8d24dd61774458e6f2e36c32 depends: - cuda-cccl_linux-64 - cuda-cudart-static_linux-64 - cuda-cudart_linux-64 - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 399921 - timestamp: 1773104368666 + size: 405020 + timestamp: 1779898430134 - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_linux-aarch64-12.9.79-h3ae8b8a_0.conda sha256: ad64a1ecfc933172dbc6407d71b1abb78dc7ffcd5cc871baee238350307a7c0c md5: 60e07c05a51d5549bec1e7ee38849feb @@ -2605,18 +3534,18 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 388797 timestamp: 1749218354725 -- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_linux-aarch64-13.2.51-h8f3c8d4_0.conda - sha256: a70843df7614baec358de351aed9530f98c4a69fe1307b2b91ea6cfcbf636f1b - md5: 18ae93fa573c2746f4dff1089aa62429 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_linux-aarch64-13.3.29-h8f3c8d4_0.conda + sha256: 4e15b3a139285d1e86691d5987e7bf4b9e8cbce1df0af206e0c95299a8015644 + md5: f3855f0a74455604f9950bf91ce6d846 depends: - arm-variant * sbsa - cuda-cccl_linux-aarch64 - cuda-cudart-static_linux-aarch64 - cuda-cudart_linux-aarch64 - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 400484 - timestamp: 1773104355769 + size: 403650 + timestamp: 1779898443931 - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_win-64-12.9.79-he0c23c2_0.conda sha256: e022d36a333420130faf6473c49f8dab54bf976cf320577ffb06db0a0797b734 md5: 3c3e2f6b5455783fd332a072d632ea78 @@ -2628,17 +3557,17 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 1190184 timestamp: 1749218971019 -- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_win-64-13.2.51-hac47afa_0.conda - sha256: 2887dd6f372282109505096c22bc87fe3e414d2c208bd25cd1cb45acad00e70b - md5: cffe63503acded8f8addc48ffe2c698c +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-dev_win-64-13.3.29-hac47afa_0.conda + sha256: f77605b230a88d089e4294b9b4d650dd4ec4841a0bec9f528b6b4a736299dcb1 + md5: d387bc63f2d520cb434489e41a33614d depends: - cuda-cccl_win-64 - cuda-cudart-static_win-64 - cuda-cudart_win-64 - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 1513033 - timestamp: 1773104490263 + size: 1548117 + timestamp: 1779898493787 - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-static-12.9.79-h5888daf_0.conda sha256: 6261e1d9af80e1ec308e3e5e2ff825d189ef922d24093beaf6efca12e67ce060 md5: d3c4ac48f4967f09dd910d9c15d40c81 @@ -2651,18 +3580,18 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 23283 timestamp: 1749218442382 -- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-static-13.2.51-hecca717_0.conda - sha256: d4a316038b02161e04a864c8cd146d2ec62cbd114eb951197c6ef6042d3c46c4 - md5: daec4c4dc0355adcdf009dceb3b94259 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-static-13.3.29-hecca717_0.conda + sha256: e2596138baef66e9b7fa08329e944d3ef8cca7c3d2da28d32bc37ff7e4801d1a + md5: 3a99ba2e09c508fd8b8b0eaf6d37a376 depends: - __glibc >=2.17,<3.0.a0 - - cuda-cudart-static_linux-64 13.2.51 h376f20c_0 - - cuda-version >=13.2,<13.3.0a0 + - cuda-cudart-static_linux-64 13.3.29 h376f20c_0 + - cuda-version >=13.3,<13.4.0a0 - libgcc >=14 - libstdcxx >=14 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 24494 - timestamp: 1773104383494 + size: 24626 + timestamp: 1779898435744 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-static-12.9.79-h3ae8b8a_0.conda sha256: dac33edcebbf557563a41521f67961039186efbc276903d937b32243ef3be937 md5: 365adcddf99b81eb323698fda31d507c @@ -2675,18 +3604,18 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 23507 timestamp: 1749218358755 -- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-static-13.2.51-h8f3c8d4_0.conda - sha256: 2d9ca3121765a7e9567285ff7d2f285381d35bda65c08333205084370ee174f0 - md5: fb60e62fd7fc3cb9076e9e328597d525 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-cudart-static-13.3.29-h8f3c8d4_0.conda + sha256: 8f83d5e859f3ef949589b4ef2bf1eb0a99d02ad2941c6f9c0a802b96a1d65c25 + md5: a40f6427160d6394dfa189276386be91 depends: - arm-variant * sbsa - - cuda-cudart-static_linux-aarch64 13.2.51 h8f3c8d4_0 - - cuda-version >=13.2,<13.3.0a0 + - cuda-cudart-static_linux-aarch64 13.3.29 h8f3c8d4_0 + - cuda-version >=13.3,<13.4.0a0 - libgcc >=14 - libstdcxx >=14 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 24659 - timestamp: 1773104359540 + size: 24786 + timestamp: 1779898447855 - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-cudart-static-12.9.79-he0c23c2_0.conda sha256: 02d3ff9ec59c7f59132ffe9398746ad9422a75706e7cad19acc6c30a5c0fc763 md5: 718879691b8119c893f587f46c734fca @@ -2699,18 +3628,18 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 23249 timestamp: 1749218998822 -- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-cudart-static-13.2.51-hac47afa_0.conda - sha256: 42332f50c3064774dea165f9643828ac0452c9af63a8aed0c34d2c5f675da285 - md5: 3f66101f2d227a2bc34b0d3911bf67d5 +- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-cudart-static-13.3.29-hac47afa_0.conda + sha256: 685533b8d9b7a65810fd86da7d2c605ddb4ba1270591d7137be995c0dbf4661b + md5: a5a881ac16787902dc51e5d7b6c870c1 depends: - - cuda-cudart-static_win-64 13.2.51 hac47afa_0 - - cuda-version >=13.2,<13.3.0a0 + - cuda-cudart-static_win-64 13.3.29 hac47afa_0 + - cuda-version >=13.3,<13.4.0a0 - ucrt >=10.0.20348.0 - vc >=14.3,<15 - vc14_runtime >=14.44.35208 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 24400 - timestamp: 1773104510500 + size: 24488 + timestamp: 1779898500699 - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_linux-64-12.9.79-h3f2d84a_0.conda sha256: d435f8a19b59b52ce460ee3a6bfd877288a0d1d645119a6ba60f1c3627dc5032 md5: b87bf315d81218dd63eb46cc1eaef775 @@ -2719,14 +3648,14 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 1148889 timestamp: 1749218381225 -- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_linux-64-13.2.51-h376f20c_0.conda - sha256: e3cc51809bd8be0a96bbe01a668f08e6e611c8fba60426c4d9f10926f3159456 - md5: aa9c7d5cd427042ffbd59c9ef6014f98 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_linux-64-13.3.29-h376f20c_0.conda + sha256: fa920f2c2154ea2ace2d55457e43af8e7bfc2c94fa5ec7276792ad411d1011d1 + md5: 7d4fe2a79d971522b3ad68b772c197eb depends: - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 1103784 - timestamp: 1773104321614 + size: 1126340 + timestamp: 1779898412056 - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_linux-aarch64-12.9.79-h3ae8b8a_0.conda sha256: d4be038bad9abf0eac1e88dc57c8db6a469db8eb5d7c281085dfbb018ef84212 md5: 52498fedeb43bbd4c45f84a0fb722d21 @@ -2736,15 +3665,15 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 1152498 timestamp: 1749218333554 -- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_linux-aarch64-13.2.51-h8f3c8d4_0.conda - sha256: 45e800eebb45b0affd49818acc6154a89d40c2b3b1ef3552245e1513b7667d34 - md5: dc6f6e5590f4c32060e197711707f400 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_linux-aarch64-13.3.29-h8f3c8d4_0.conda + sha256: efccfa33242cc65deb11312f46244da2e07ba8332352d31f0565e8243215fe09 + md5: 464a04d3d8ffcba349f4e21553dfbcdd depends: - arm-variant * sbsa - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 1117788 - timestamp: 1773104327628 + size: 1133087 + timestamp: 1779898428591 - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_win-64-12.9.79-he0c23c2_0.conda sha256: 6a3410cd7ce07955cb705801055ef129ebee1cd6390c6fe9e5f607b67c3dba36 md5: 0dd152a1493d90356037604a865f050f @@ -2753,14 +3682,14 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 354611 timestamp: 1749218544740 -- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_win-64-13.2.51-hac47afa_0.conda - sha256: 60b2646773b4eb5ee8c802e0ad23485e5569e789ec77a231be79da958d76d9b8 - md5: 0d9d25e8fc2a3c72128e2a41f8a460cc +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart-static_win-64-13.3.29-hac47afa_0.conda + sha256: c837c4eaadbca4426f93ff99b4a0f05ca199f0fb43ec0eac4bd30a2cec4257d0 + md5: 999b16444442cf6d914cecef070d13de depends: - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 407072 - timestamp: 1773104432336 + size: 83026 + timestamp: 1779898478182 - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_linux-64-12.9.79-h3f2d84a_0.conda sha256: 6cde0ace2b995b49d0db2eefb7bc30bf00ffc06bb98ef7113632dec8f8907475 md5: 64508631775fbbf9eca83c84b1df0cae @@ -2769,14 +3698,14 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 197249 timestamp: 1749218394213 -- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_linux-64-13.2.51-h376f20c_0.conda - sha256: e1d943a5582c8e171c9dcf2c0c72ddd5bf0a2ac9acd6ed15898d69d618cf53c6 - md5: 51a1624c7e26d8821b5d959ee7ecb517 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_linux-64-13.3.29-h376f20c_0.conda + sha256: a86028f94acf37b17ca2280734ae9dcc407cdf68a9c400102d323a3b15e52f0b + md5: 10949c6dfe9157fedb19170bd6e0b835 depends: - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 203460 - timestamp: 1773104333900 + size: 206064 + timestamp: 1779898416941 - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_linux-aarch64-12.9.79-h3ae8b8a_0.conda sha256: 4900ff2f000a4f8a70a7bc8576469640aa6590618fa9e73c84e066e025dcb760 md5: cc2459ad427431e089d78d760cf24437 @@ -2786,15 +3715,15 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 212993 timestamp: 1749218341193 -- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_linux-aarch64-13.2.51-h8f3c8d4_0.conda - sha256: 187a80a3c5b1e5006c21cce319f54a3cb01f29e671f9468e5d8bb99969128fab - md5: 8f795465876173a2f2f39fe5e14fd3a9 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_linux-aarch64-13.3.29-h8f3c8d4_0.conda + sha256: 15f0614bd0ae66c43148539d1c7cd4bbbd1b13aa14045a2339df5737e3d6e36e + md5: 4a7f98cadd8be6b7dcce34764fb38997 depends: - arm-variant * sbsa - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 217385 - timestamp: 1773104336884 + size: 222441 + timestamp: 1779898433566 - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_win-64-12.9.79-he0c23c2_0.conda sha256: 6a89a53cdbcfafa0bb55abee1b58492c6a9a28e688abe04f48f0d01649c5f3e4 md5: 71c9c2ab52226f990f268164381d8494 @@ -2803,14 +3732,14 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 23260 timestamp: 1749218569458 -- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_win-64-13.2.51-hac47afa_0.conda - sha256: af580b027c600135147d7992f5bd848e76f235c8bc99431cbf11fda192f15b5e - md5: c93f356afbdfc24524c665f6c319cc2a +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_win-64-13.3.29-hac47afa_0.conda + sha256: 3b858e8593d00fa36a6786d1c3d981369f84ae68d3700349dba4c1e4d779c904 + md5: f0253958e16223aabcc8b5561a6f98a7 depends: - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 24526 - timestamp: 1773104452452 + size: 24659 + timestamp: 1779898481919 - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvrtc-12.9.86-hecca717_1.conda sha256: 68f81268c25befa9b70dc49af469ab0eb131960e3700b9a4edb46a32da343a28 md5: 53f0062e2243b26e43ddac0b5267c6a3 @@ -2822,17 +3751,18 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 67168282 timestamp: 1760723629347 -- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvrtc-13.2.51-hecca717_0.conda - sha256: 9de235d328b7124f715805715e9918eb7f8aa5b9c56a2afa62b84f84f98077a5 - md5: 0413baaa73be1a39d5d8e442184acc78 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvrtc-13.3.33-hecca717_0.conda + sha256: a70641e7d81694f57c7df46a17b657594393082dad667532c29df9540b7f99ca + md5: 57124a775cb937bb2bfd10f09a230430 depends: - __glibc >=2.17,<3.0.a0 - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 - libgcc >=14 - libstdcxx >=14 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 35736655 - timestamp: 1773100338749 + purls: [] + size: 39254802 + timestamp: 1779897349474 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvrtc-12.9.86-h8f3c8d4_1.conda sha256: e7f8d835d7bf993dcad9fba6db5af89c35b2b4f0282799b729bf6ad2c3bd896d md5: 48187c09673a42f9930764e8170b8787 @@ -2844,17 +3774,18 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 33382016 timestamp: 1760723722396 -- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvrtc-13.2.51-h8f3c8d4_0.conda - sha256: 1fd23b87b7184b2ca38cf3e7c3197bb44b897d8f42010bb87edf5d689a041452 - md5: 5005bdb2a590f169dcb3ce3a321f6009 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvrtc-13.3.33-h8f3c8d4_0.conda + sha256: cd16532e362662c88f6bc3b009457b3d36b33ca990f0deabece6def7d44aaa72 + md5: 7147a017b16d0d7c93c53d261e0ef0b6 depends: - arm-variant * sbsa - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 - libgcc >=14 - libstdcxx >=14 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 33927374 - timestamp: 1773100385281 + purls: [] + size: 37806494 + timestamp: 1779897383028 - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvrtc-12.9.86-hac47afa_1.conda sha256: d90ef446ac859db26286a5d39d39333c4e4cee31ba5042b5c7922bd25de531f6 md5: d68b5d96a53c80dc3dbbd8f7c3b8106d @@ -2866,17 +3797,18 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 58467504 timestamp: 1760723834711 -- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvrtc-13.2.51-hac47afa_0.conda - sha256: 217b5194ecd6834e361329d6132c2dfc96fa588715438231503dc12d59e0fac8 - md5: 15f6f2629264309d48712c499ac6f3f5 +- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvrtc-13.3.33-hac47afa_0.conda + sha256: 7306b27c3a70cf1c35d4d200c1936037c9d6484322a39fac1967439a20585003 + md5: ab010d7a1be0e140b65f6bf8473180fb depends: - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 - ucrt >=10.0.20348.0 - vc >=14.3,<15 - vc14_runtime >=14.44.35208 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 31221551 - timestamp: 1773100427009 + purls: [] + size: 35152509 + timestamp: 1779897499641 - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-12.9.86-h69a702a_6.conda sha256: 5c70d91e6d30eb6000ea036558a20fd0b1bc13cdd2c04fd5dbf94d9caa0a7fbc md5: 704956f67e44ddf046565ead01f9efcd @@ -2887,16 +3819,16 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 25475 timestamp: 1771619493286 -- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-13.2.51-h69a702a_0.conda - sha256: d0111ba8fa12b96d38989d2016ecec0c11410c0e566d839ed54f3925591efb0b - md5: 03cd3639b8e13623c7b91b1cb0136402 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-13.3.33-h69a702a_0.conda + sha256: 5a379ec765df86fa34c253033fff9e916b3b8a01fc6a8ab2ec451e2ac7b57a2c + md5: 6dc6ffa1da0abc6d1fa4f5385aa93040 depends: - - cuda-nvvm-dev_linux-64 13.2.51.* - - cuda-nvvm-impl 13.2.51.* - - cuda-nvvm-tools 13.2.51.* + - cuda-nvvm-dev_linux-64 13.3.33.* + - cuda-nvvm-impl 13.3.33.* + - cuda-nvvm-tools 13.3.33.* license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 25494 - timestamp: 1773157399568 + size: 25697 + timestamp: 1779909800589 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-12.9.86-he9431aa_106.conda sha256: 97bf1688e3847090d1c4193c39ca575a67e2183d0c20ddf8bcedc0f9d9528bbc md5: 8ace2a8121a5f733a902822290aae11c @@ -2907,16 +3839,16 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 25585 timestamp: 1771619514901 -- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-13.2.51-he9431aa_0.conda - sha256: 95e66d53b8d078d77459a259340af3222eda7835c4d4b111104fad7359746f3d - md5: 63d2802c0212895b010a371f5e552717 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-13.3.33-he9431aa_0.conda + sha256: cf2ee921c3e8bb70872b0e146f7809d02f45c894e12bf93537fc0523ecc370a8 + md5: b69f69843b228a650173716b23b1d834 depends: - - cuda-nvvm-dev_linux-aarch64 13.2.51.* - - cuda-nvvm-impl 13.2.51.* - - cuda-nvvm-tools 13.2.51.* + - cuda-nvvm-dev_linux-aarch64 13.3.33.* + - cuda-nvvm-impl 13.3.33.* + - cuda-nvvm-tools 13.3.33.* license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 25527 - timestamp: 1773157409090 + size: 25733 + timestamp: 1779909827964 - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvvm-12.9.86-h719f0c7_6.conda sha256: 020a5bb67a35654f391d21b170ba763f95b7f133fec5678d69e676559dcd5653 md5: b162c7fb8b19f9102bd5f801d7f58ca2 @@ -2927,16 +3859,16 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 26007 timestamp: 1771619504675 -- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvvm-13.2.51-h719f0c7_0.conda - sha256: dae025a742247b1d81cf93a4369fe27978e4ed806d4cb4433d7d221e278b156b - md5: a45c9094d93eeae246626bcf71e04aa6 +- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvvm-13.3.33-h719f0c7_0.conda + sha256: d63d8a093e2390976ef5732996248fe683f153764553a98f5096de7252fb31bb + md5: 28b7994501f69efa53dbf1ebe9f9b350 depends: - - cuda-nvvm-dev_win-64 13.2.51.* - - cuda-nvvm-impl 13.2.51.* - - cuda-nvvm-tools 13.2.51.* + - cuda-nvvm-dev_win-64 13.3.33.* + - cuda-nvvm-impl 13.3.33.* + - cuda-nvvm-tools 13.3.33.* license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 26021 - timestamp: 1773157402940 + size: 26223 + timestamp: 1779909907942 - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_linux-64-12.9.86-ha770c72_2.conda sha256: 522722dcaffd133e0c7500c69dc70e21ac34d6762dcbaabfe847439f944028f0 md5: 7b386291414c7eea113d25ac28a33772 @@ -2945,14 +3877,14 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 27096 timestamp: 1753975261562 -- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_linux-64-13.2.51-ha770c72_0.conda - sha256: f00fce92bf7f1da314654f7693f571a014aaa2ba1fae3762634f3e5be254da83 - md5: 57724ac113f7435762d0c39e1b1ad341 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_linux-64-13.3.33-ha770c72_0.conda + sha256: a7eada853603adf6bed7022384b2b4ddb6d27b348a23a271f75caefa141ea954 + md5: b1b8dcad428089c6ddc16e0f4ac2631d depends: - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 28399 - timestamp: 1773115185916 + size: 28476 + timestamp: 1779905085657 - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_linux-aarch64-12.9.86-h579c4fd_2.conda sha256: 5f27299818ecef44d6cf46a99465671744f6074c14618b5f8491a03a62942a7f md5: c59b036058d7bf78ac0a99618c321e85 @@ -2962,15 +3894,15 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 27218 timestamp: 1753975206503 -- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_linux-aarch64-13.2.51-h579c4fd_0.conda - sha256: d85c80d7e6bf9f98e45b21d2baf90c1491f7d94fdbbf025f0a5d088465bb48e9 - md5: 5965fccb0651c0bc399b36ae9f072d63 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_linux-aarch64-13.3.33-h579c4fd_0.conda + sha256: 68c76156498287e1fcffd5d0fb2a83b99b570e3efacf2e9416dfc9a356384738 + md5: 89a0f306085d404e6e774edc5d812679 depends: - arm-variant * sbsa - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 28513 - timestamp: 1773115160061 + size: 28720 + timestamp: 1779905125664 - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_win-64-12.9.86-h57928b3_2.conda sha256: 455dbf0ec81efdbd40c0387d82c77689721f6d34b6e7694ca0d51bad9392eddc md5: 23f7e70c03eabd2139b5e659c8e188b4 @@ -2979,14 +3911,14 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 27284 timestamp: 1753975714790 -- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_win-64-13.2.51-h57928b3_0.conda - sha256: d33a50af4780bcb3a064564ceafb5f978d0caa15a249ad47f68ae7b0a2c180a1 - md5: 9a4265b59f1e4f683eaf79ea74eb7454 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-nvvm-dev_win-64-13.3.33-h57928b3_0.conda + sha256: 295a4555e021ec3d4a35009a46b9a190c24e33f27e54e2575472c332fd52f204 + md5: c437c34990ce67cd1defa7f98a674417 depends: - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 28573 - timestamp: 1773115296051 + size: 28779 + timestamp: 1779905174253 - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-impl-12.9.86-h4bc722e_2.conda sha256: f4d34556174e4faa9d374ba2244707082870e1bbc1bb441ad3d9d2cea37da6af md5: 82125dd3c0c4aa009faa00e2829b93d8 @@ -2997,16 +3929,17 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 21425520 timestamp: 1753975283188 -- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-impl-13.2.51-h4bc722e_0.conda - sha256: bea7cbd2ff0f8bf07e0b90d522b4834533b4024237322c09f1b3875970c4abc9 - md5: 3c3872ff2bd6cc6368dcd4b35bb995f2 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-impl-13.3.33-h4bc722e_0.conda + sha256: 1ea87e853ba917c14b222da1bff5179a3aa490ca5fd64e9ff1b865d2ca62e569 + md5: 3cdad839773c71e550927c626f8ba5fa depends: - __glibc >=2.17,<3.0.a0 - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 - libgcc >=12 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 22202489 - timestamp: 1773115209641 + purls: [] + size: 22428462 + timestamp: 1779905092854 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-impl-12.9.86-h7b14b0b_2.conda sha256: 100accfc6f608004ddef4b9004ee5179eddbac19e7d5c4c7bd5e6e8b71bd7c5d md5: 8e9fceb7b677be7107cc9c20f8d71d86 @@ -3017,16 +3950,17 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 21601172 timestamp: 1753975236344 -- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-impl-13.2.51-h7b14b0b_0.conda - sha256: 9aff302b7a93573ddc2249b530492b43a89b1af0487dfe935bc4e65a138d45d0 - md5: 9ae8108ce3c351632f3b4fae8a1f65da +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-impl-13.3.33-h7b14b0b_0.conda + sha256: e90b28ba3cac0f00acb5090693f7aaca46884ed9bd2d6fabec2b2c2c753be795 + md5: aee27037173867115c798567ba92c876 depends: - arm-variant * sbsa - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 - libgcc >=12 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 21359859 - timestamp: 1773115190001 + purls: [] + size: 21556608 + timestamp: 1779905144993 - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvvm-impl-12.9.86-h2466b09_2.conda sha256: 7b995ea653816b129bae6e4ee92898824a39fe82227472537bf75ac6ece7e955 md5: d8cea7bc32045bde718d0b1ceb595445 @@ -3038,17 +3972,18 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 31168 timestamp: 1753975780038 -- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvvm-impl-13.2.51-h2466b09_0.conda - sha256: 28cd6aba65546437a292948b4ea091429211e9ab775426eb950b8d8b035f36e1 - md5: 80a5ca923e1c131277e7ff682927c585 +- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvvm-impl-13.3.33-h2466b09_0.conda + sha256: 64393c62eb39d09b1be9cecddd6721fa018f67f1d598d89ff63a36d4d1dac221 + md5: 0aa6111a0d7a368cc75e261d020a2c07 depends: - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 - ucrt >=10.0.20348.0 - vc >=14.2,<15 - vc14_runtime >=14.29.30139 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 32705 - timestamp: 1773115330786 + purls: [] + size: 32862 + timestamp: 1779905180272 - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-tools-12.9.86-h4bc722e_2.conda sha256: 45f5e881ed0d973132a5475a0b5c066db6e748ef3a831a14dba8374b252e0067 md5: f9af26e4079adcd72688a8e8dbecb229 @@ -3059,16 +3994,16 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 24246736 timestamp: 1753975332907 -- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-tools-13.2.51-h4bc722e_0.conda - sha256: da5fd2dc57df2047215ff76f295685b1e1e586a46c2e46214120458cee18ee80 - md5: 2df6cd3b3d6d1365a2979285703056f9 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-nvvm-tools-13.3.33-h4bc722e_0.conda + sha256: 3fc9d3ba08b4a3b5fd0065f048e8c6007a8ca1c8df07b3538f4b61435ecbc2ac + md5: 99365fca01f05b4255c79180e6e86a43 depends: - __glibc >=2.17,<3.0.a0 - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 - libgcc >=12 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 25988523 - timestamp: 1773115248060 + size: 29720382 + timestamp: 1779905121216 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-tools-12.9.86-h7b14b0b_2.conda sha256: f5cf91e491e150e37cd224fa648c07f6b1cd2cbfee5affba10625df7ba0b0425 md5: 9a35dcda5573a713183f5159ec282364 @@ -3079,16 +4014,16 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 24411824 timestamp: 1753975273689 -- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-tools-13.2.51-h7b14b0b_0.conda - sha256: 0fa71feeead6b0e6f2358551c400da314f45f0f0fab3d5a8a49abf0220e167e2 - md5: 9849c2dfc18739acf65c048c23eac852 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-nvvm-tools-13.3.33-h7b14b0b_0.conda + sha256: cce5ef4c36f3db60909fc5bbbe138dfbf51d237d880cea77e366db33d97cac56 + md5: 6c981201b590365bbe2fd8af4f8a1675 depends: - arm-variant * sbsa - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 - libgcc >=12 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 25020569 - timestamp: 1773115219866 + size: 29031580 + timestamp: 1779905175228 - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvvm-tools-12.9.86-h2466b09_2.conda sha256: 5692a559206420f77e376a598329db966da762ad574866f9cc80a447d26ac49c md5: 25e269101d3eb39715a48998bc04289e @@ -3100,17 +4035,17 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 40286977 timestamp: 1753975898550 -- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvvm-tools-13.2.51-h2466b09_0.conda - sha256: 334e911ef74137b14fcf4f25826643930e5bcac5f2d28059511466f1b9de8c6e - md5: 4814b155963deefa8a72b21527478708 +- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-nvvm-tools-13.3.33-h2466b09_0.conda + sha256: aac4f4ddb2d612350269e58364b5aa1142612838d429d493e2816a1626e41883 + md5: 394839d70f28114ece1f2e4efac66523 depends: - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 - ucrt >=10.0.20348.0 - vc >=14.2,<15 - vc14_runtime >=14.29.30139 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 42701238 - timestamp: 1773115361393 + size: 45453672 + timestamp: 1779905194696 - conda: ../cuda_pathfinder name: cuda-pathfinder version: 1.3.4a0 @@ -3122,6 +4057,18 @@ packages: - python >=3.10 - python * license: Apache-2.0 +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-pathfinder-1.5.2-pyhc364b38_0.conda + sha256: 8d1c8a686dd0b1b131eb6dd91aaf35b9cd9c256e26bfebe702683c32bee82798 + md5: 63c7ba46fbfc291fab512005c1753041 + depends: + - python >=3.10 + - cuda-version >=12.0,<14 + - python + license: Apache-2.0 + purls: + - pkg:pypi/cuda-pathfinder?source=hash-mapping + size: 44855 + timestamp: 1775517790256 - conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-profiler-api-12.9.79-h7938cbb_1.conda sha256: 4f679dfbf2bf2d17abb507f31b0176c0e3572337b5005b9e36179948a53988ac md5: 90d09865fb37d11d510444e34ebe6a09 @@ -3131,15 +4078,15 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 23668 timestamp: 1761098836058 -- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-profiler-api-13.2.20-h7938cbb_0.conda - sha256: 8ddc3b2e353671df4d8edb96214672901ce3e69f155c39391e1ff2f6624ceed4 - md5: 90127f6cdd5fb377b844f596af263571 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cuda-profiler-api-13.3.27-h7938cbb_0.conda + sha256: 716eb13fe58332ed1d5079edae720177da0aeb3bb51cb5a05072385faa8dd704 + md5: a251ae89c6c9a7f5e8a39adc9a3041bd depends: - cuda-cudart-dev - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 24704 - timestamp: 1773114128683 + size: 25007 + timestamp: 1779913616712 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-profiler-api-12.9.79-h16bee8c_1.conda sha256: 6fa8a4d4548b114acd3c9849b65b5d9fcf1ca8f39cd2b792ce5167a51955100c md5: 875bfddc9855f12e9f518ef8e44c2d85 @@ -3150,18 +4097,18 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 23784 timestamp: 1761098779882 -- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-profiler-api-13.2.20-h16bee8c_0.conda - sha256: cf8716360c550e6ab3234cd8b97c8ad3b80e3e30c92ebc4ae8eff14d10e2554e - md5: a70b7b9f1761d9eb5051f854078d391d +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cuda-profiler-api-13.3.27-h16bee8c_0.conda + sha256: edee9a24047014874cb0b324702967f7a99c0b209bee96544eb84de8714a3306 + md5: a2ea427fd6a0c3fc57d32e541b13f912 depends: - arm-variant * sbsa - cuda-cudart-dev - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 constrains: - arm-variant * sbsa license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 24849 - timestamp: 1773114152237 + size: 25101 + timestamp: 1779913642980 - conda: https://conda.anaconda.org/conda-forge/win-64/cuda-profiler-api-12.9.79-h57928b3_1.conda sha256: e2ea70bfd20decd9e8401b5388693e1fd8e25a120580338a22b8b890f4933520 md5: 57d6f85f552878de71f8136cc6d2ab16 @@ -3171,15 +4118,15 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 24150 timestamp: 1761098813665 -- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-profiler-api-13.2.20-h57928b3_0.conda - sha256: 9ad2810631785a34f831709c3481f67a3c4ceb00a34bdac1df2af57f7945511d - md5: 977ba52e88cf3e82cf451de3c31461c1 +- conda: https://conda.anaconda.org/conda-forge/win-64/cuda-profiler-api-13.3.27-h57928b3_0.conda + sha256: 51e619f0151a0b109671abfc6daa7761e17054f7d570c2e50dc7141745dd633c + md5: 024766ae1ca6cbe87200bf11d9643039 depends: - cuda-cudart-dev - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 25138 - timestamp: 1773114166912 + size: 25690 + timestamp: 1779913686281 - conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-12.9-h4f385c5_3.conda sha256: 5f5f428031933f117ff9f7fcc650e6ea1b3fef5936cf84aa24af79167513b656 md5: b6d5d7f1c171cbd228ea06b556cfa859 @@ -3189,15 +4136,16 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 21578 timestamp: 1746134436166 -- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-13.2-he2cc418_3.conda - sha256: 64aebe8ccb3a2c3ff446d3c0c0e88ef4fdb069a5732c03539bf3a37243c4c679 - md5: 45676e3dd76b30ec613f1f822d450eff +- conda: https://conda.anaconda.org/conda-forge/noarch/cuda-version-13.3-hcbadf70_3.conda + sha256: bd8ee668f416bdd0f6548b2413550ae83d3834665a5be869a2daf99233ec526e + md5: 0fd72afdcc74560b80eb74b78767c454 constrains: - __cuda >=13 - - cudatoolkit 13.2|13.2.* + - cudatoolkit 13.3|13.3.* license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 21908 - timestamp: 1773093709154 + purls: [] + size: 22083 + timestamp: 1779891651771 - conda: https://conda.anaconda.org/conda-forge/linux-64/cython-3.2.3-py314h1807b08_0.conda sha256: a0e2ed0efefb82278e0fd1d455d10d1095d951a896591838b30674aa872300c4 md5: f0658a93053b13335be941289d7d6160 @@ -3211,6 +4159,21 @@ packages: license_family: APACHE size: 3797747 timestamp: 1765651158436 +- conda: https://conda.anaconda.org/conda-forge/linux-64/cython-3.2.4-py312h68e6be4_0.conda + sha256: 01b815091e0c534a5f32a830b514e31c150dc2f539b7ba1d5c70b6d095a5ebcf + md5: 14f638dad5953c83443a2c4f011f1c9e + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + license: Apache-2.0 + license_family: APACHE + purls: + - pkg:pypi/cython?source=hash-mapping + size: 3738170 + timestamp: 1767577770165 - conda: https://conda.anaconda.org/conda-forge/linux-64/cython-3.2.4-py314h1807b08_0.conda sha256: f700d10c2a794710a1656a6fdb8908fb04f3c7812ac4f17187777646ede1a3d9 md5: 866fd3d25b767bccb4adc8476f4035cd @@ -3237,6 +4200,21 @@ packages: license_family: APACHE size: 3701570 timestamp: 1765651306767 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cython-3.2.4-py312he940de5_0.conda + sha256: 30bfb6445b8ae8022996283faa2d918393b1f0f78e37014995e1733e50df4303 + md5: 2f50ec4afc8e9f402b9041e9cee62744 + depends: + - libgcc >=14 + - libstdcxx >=14 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + license: Apache-2.0 + license_family: APACHE + purls: + - pkg:pypi/cython?source=hash-mapping + size: 3629503 + timestamp: 1767577211661 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/cython-3.2.4-py314h4c416a3_0.conda sha256: 1369b5b23d9451ae3ef678cb68678778a6ea164186bc8ebe6539a1d6fa803da8 md5: 822c83a4ba5a12101695ba39607c338f @@ -3263,6 +4241,21 @@ packages: license_family: APACHE size: 3336844 timestamp: 1765651351516 +- conda: https://conda.anaconda.org/conda-forge/win-64/cython-3.2.4-py312hd245ac3_0.conda + sha256: 68e921fad16accb32e86c7c73abaea7d49c9346e078924d0a593f821672a5a0c + md5: 575ebca0d973015c21087b800bc48515 + depends: + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: Apache-2.0 + license_family: APACHE + purls: + - pkg:pypi/cython?source=hash-mapping + size: 3285032 + timestamp: 1767577225362 - conda: https://conda.anaconda.org/conda-forge/win-64/cython-3.2.4-py314h344ed54_0.conda sha256: c2e08246f2e6f38b5793ebc8d36de32704e4f152ed959ab0558d529580610e0e md5: 545afbc1940d8a81f114b9c14eecf2ca @@ -3330,6 +4323,116 @@ packages: license: AFL-2.1 OR GPL-2.0-or-later size: 480416 timestamp: 1764536098891 +- conda: https://conda.anaconda.org/conda-forge/linux-64/debugpy-1.8.20-py312h8285ef7_0.conda + sha256: f20121b67149ff80bf951ccae7442756586d8789204cd08ade59397b22bfd098 + md5: ee1b48795ceb07311dd3e665dd4f5f33 + depends: + - python + - libgcc >=14 + - libstdcxx >=14 + - __glibc >=2.17,<3.0.a0 + - python_abi 3.12.* *_cp312 + license: MIT + license_family: MIT + purls: + - pkg:pypi/debugpy?source=hash-mapping + size: 2858582 + timestamp: 1769744978783 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/debugpy-1.8.20-py312hf55c4e8_0.conda + sha256: c041ed2da3fd1e237972a360cb0f532a0caf66f571fdc9ec2cc07ccb48b8c665 + md5: d7ee86593223e812e41612678c26a10d + depends: + - python + - libstdcxx >=14 + - libgcc >=14 + - python 3.12.* *_cpython + - python_abi 3.12.* *_cp312 + license: MIT + license_family: MIT + purls: + - pkg:pypi/debugpy?source=hash-mapping + size: 2820348 + timestamp: 1769745006474 +- conda: https://conda.anaconda.org/conda-forge/win-64/debugpy-1.8.20-py312ha1a9051_0.conda + sha256: 5a886b1af3c66bf58213c7f3d802ea60fe8218313d9072bc1c9e8f7840548ba0 + md5: 032746a0b0663920f0afb18cec61062b + depends: + - python + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - python_abi 3.12.* *_cp312 + license: MIT + license_family: MIT + purls: + - pkg:pypi/debugpy?source=hash-mapping + size: 3996113 + timestamp: 1769745013982 +- conda: https://conda.anaconda.org/conda-forge/noarch/decorator-5.2.1-pyhd8ed1ab_0.conda + sha256: c17c6b9937c08ad63cb20a26f403a3234088e57d4455600974a0ce865cb14017 + md5: 9ce473d1d1be1cc3810856a48b3fab32 + depends: + - python >=3.9 + license: BSD-2-Clause + license_family: BSD + purls: + - pkg:pypi/decorator?source=hash-mapping + size: 14129 + timestamp: 1740385067843 +- conda: https://conda.anaconda.org/conda-forge/noarch/dict2css-0.3.0.post1-pyhd8ed1ab_1.conda + sha256: 3aa044441dcea3afb935a48a075b59ed14dabb7ee6e019a757ff68d6b13c0a36 + md5: 103dc54172d3083adcda6bf8f1addcf3 + depends: + - cssutils >=2.2.0 + - domdf-python-tools >=2.2.0 + - python >=3.9 + license: MIT + license_family: MIT + purls: + - pkg:pypi/dict2css?source=hash-mapping + size: 13700 + timestamp: 1738250096666 +- conda: https://conda.anaconda.org/conda-forge/noarch/docutils-0.21.2-pyhd8ed1ab_1.conda + sha256: fa5966bb1718bbf6967a85075e30e4547901410cc7cb7b16daf68942e9a94823 + md5: 24c1ca34138ee57de72a943237cde4cc + depends: + - python >=3.9 + license: CC-PDDC AND BSD-3-Clause AND BSD-2-Clause AND ZPL-2.1 + purls: + - pkg:pypi/docutils?source=hash-mapping + size: 402700 + timestamp: 1733217860944 +- conda: https://conda.anaconda.org/conda-forge/noarch/domdf-python-tools-3.10.0-pyhff2d567_0.conda + sha256: e7a7121de51caa332e73a0a7345d78fb514a8460311347be5d8eba0738c66c31 + md5: 0254332c3957f0ae09a58670c2d7ea01 + depends: + - importlib-metadata >=3.6.0 + - importlib-resources >=3.0.0 + - natsort >=7.0.1 + - python >=3.9 + - typing-extensions >=3.7.4.1 + license: MIT + license_family: MIT + purls: + - pkg:pypi/domdf-python-tools?source=hash-mapping + size: 96253 + timestamp: 1739444562482 +- conda: https://conda.anaconda.org/conda-forge/noarch/enum_tools-0.13.0-pyhd8ed1ab_0.conda + sha256: 07f06106f9c15d36dff4694d1191e7c0f42273f175ad8d7abbffd347dfe33d4c + md5: 8b259cc3194c36e0235f873c6dae9eef + depends: + - pygments >=2.6.1 + - python >=3.9 + - typing-extensions >=3.7.4.3 + constrains: + - sphinx >=3.4.0 + - sphinx-toolbox >=2.16.0 + license: LGPL-3.0-or-later + license_family: LGPL + purls: + - pkg:pypi/enum-tools?source=hash-mapping + size: 24762 + timestamp: 1744913087216 - conda: https://conda.anaconda.org/conda-forge/noarch/exceptiongroup-1.3.1-pyhd8ed1ab_0.conda sha256: ee6cf346d017d954255bbcbdb424cddea4d14e4ed7e9813e429db1d795d01144 md5: 8e662bd460bda79b1ea39194e3c4c9ab @@ -3337,8 +4440,21 @@ packages: - python >=3.10 - typing_extensions >=4.6.0 license: MIT and PSF-2.0 + purls: + - pkg:pypi/exceptiongroup?source=hash-mapping size: 21333 timestamp: 1763918099466 +- conda: https://conda.anaconda.org/conda-forge/noarch/executing-2.2.1-pyhd8ed1ab_0.conda + sha256: 210c8165a58fdbf16e626aac93cc4c14dbd551a01d1516be5ecad795d2422cad + md5: ff9efb7f7469aed3c4a8106ffa29593c + depends: + - python >=3.10 + license: MIT + license_family: MIT + purls: + - pkg:pypi/executing?source=hash-mapping + size: 30753 + timestamp: 1756729456476 - conda: https://conda.anaconda.org/conda-forge/linux-64/ffmpeg-8.0.1-gpl_hb3f9226_906.conda sha256: 7992f272a45d90731771b36db0acd3565f22ebc285829385262900e59f75db12 md5: 48787f2eab82ef1d90ccd9c24b64981e @@ -3696,6 +4812,16 @@ packages: license_family: GPL size: 10417843 timestamp: 1773010275486 +- conda: https://conda.anaconda.org/conda-forge/noarch/filelock-3.25.2-pyhd8ed1ab_0.conda + sha256: dddea9ec53d5e179de82c24569d41198f98db93314f0adae6b15195085d5567f + md5: f58064cec97b12a7136ebb8a6f8a129b + depends: + - python >=3.10 + license: Unlicense + purls: + - pkg:pypi/filelock?source=compressed-mapping + size: 25845 + timestamp: 1773314012590 - conda: https://conda.anaconda.org/conda-forge/noarch/font-ttf-dejavu-sans-mono-2.37-hab24e00_0.tar.bz2 sha256: 58d7f40d2940dd0a8aa28651239adbf5613254df0f75789919c4e6762054403b md5: 0c96522c6bdaed4b1566d11387caaf45 @@ -4282,6 +5408,51 @@ packages: license_family: LGPL size: 96336 timestamp: 1755102441729 +- conda: https://conda.anaconda.org/conda-forge/linux-64/greenlet-3.3.2-py312h8285ef7_0.conda + sha256: 03c8d065ef1e07053252412c541b5f1af70bc5fa2f974f129128d90fbdc47fe5 + md5: db6bba1610e5c4256d2892ec2997c425 + depends: + - python + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + - python_abi 3.12.* *_cp312 + license: MIT + license_family: MIT + purls: + - pkg:pypi/greenlet?source=hash-mapping + size: 253793 + timestamp: 1771658391409 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/greenlet-3.3.2-py312hf55c4e8_0.conda + sha256: 0680f4359f6ae4eecd78f07f460b9bc284789df6859967d64a4eca0c25140b0b + md5: 2af59fcde8a95b7eb9f4f101ec3d3fcd + depends: + - python + - libgcc >=14 + - libstdcxx >=14 + - python 3.12.* *_cpython + - python_abi 3.12.* *_cp312 + license: MIT + license_family: MIT + purls: + - pkg:pypi/greenlet?source=hash-mapping + size: 259597 + timestamp: 1771658392329 +- conda: https://conda.anaconda.org/conda-forge/win-64/greenlet-3.3.2-py312ha1a9051_0.conda + sha256: cbc6f4c63c779f1b5fce7c22bb737c87daa14083134990c9673ef15ed0a85572 + md5: 0f200f3d8424d0ace61b9c2c0cfe99d4 + depends: + - python + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - python_abi 3.12.* *_cp312 + license: MIT + license_family: MIT + purls: + - pkg:pypi/greenlet?source=hash-mapping + size: 235335 + timestamp: 1771658408666 - conda: https://conda.anaconda.org/conda-forge/linux-64/gxx-15.2.0-h76987e4_16.conda sha256: 850c1662b9fdfea118c7632f928adb4b9c4f2f3edce166fbce02bfb9633ead85 md5: 7acc57b08553cf6f682c9b70e6fe6b8f @@ -4414,6 +5585,20 @@ packages: license_family: GPL size: 14533744 timestamp: 1771382555150 +- conda: https://conda.anaconda.org/conda-forge/noarch/h2-4.3.0-pyhcf101f3_0.conda + sha256: 84c64443368f84b600bfecc529a1194a3b14c3656ee2e832d15a20e0329b6da3 + md5: 164fc43f0b53b6e3a7bc7dce5e4f1dc9 + depends: + - python >=3.10 + - hyperframe >=6.1,<7 + - hpack >=4.1,<5 + - python + license: MIT + license_family: MIT + purls: + - pkg:pypi/h2?source=hash-mapping + size: 95967 + timestamp: 1756364871835 - conda: https://conda.anaconda.org/conda-forge/linux-64/harfbuzz-12.2.0-h15599e2_0.conda sha256: 6bd8b22beb7d40562b2889dc68232c589ff0d11a5ad3addd41a8570d11f039d9 md5: b8690f53007e9b5ee2c2178dd4ac778c @@ -4582,6 +5767,41 @@ packages: license_family: MIT size: 1285640 timestamp: 1773217788574 +- conda: https://conda.anaconda.org/conda-forge/noarch/hpack-4.1.0-pyhd8ed1ab_0.conda + sha256: 6ad78a180576c706aabeb5b4c8ceb97c0cb25f1e112d76495bff23e3779948ba + md5: 0a802cb9888dd14eeefc611f05c40b6e + depends: + - python >=3.9 + license: MIT + license_family: MIT + purls: + - pkg:pypi/hpack?source=hash-mapping + size: 30731 + timestamp: 1737618390337 +- conda: https://conda.anaconda.org/conda-forge/noarch/html5lib-1.1-pyhd8ed1ab_2.conda + sha256: 8027e436ad59e2a7392f6036392ef9d6c223798d8a1f4f12d5926362def02367 + md5: cf25bfddbd3bc275f3d3f9936cee1dd3 + depends: + - python >=3.9 + - six >=1.9 + - webencodings + license: MIT + license_family: MIT + purls: + - pkg:pypi/html5lib?source=hash-mapping + size: 94853 + timestamp: 1734075276288 +- conda: https://conda.anaconda.org/conda-forge/noarch/hyperframe-6.1.0-pyhd8ed1ab_0.conda + sha256: 77af6f5fe8b62ca07d09ac60127a30d9069fdc3c68d6b256754d0ffb1f7779f8 + md5: 8e6923fc12f1fe8f8c4e5c9f343256ac + depends: + - python >=3.9 + license: MIT + license_family: MIT + purls: + - pkg:pypi/hyperframe?source=hash-mapping + size: 17397 + timestamp: 1737618427549 - conda: https://conda.anaconda.org/conda-forge/linux-64/icu-75.1-he02047a_0.conda sha256: 71e750d509f5fa3421087ba88ef9a7b9be11c53174af3aa4d06aff4c18b38e8e md5: 8b189310083baabfb622af68fd9d3ae3 @@ -4615,6 +5835,18 @@ packages: license_family: MIT size: 12728445 timestamp: 1767969922681 +- conda: https://conda.anaconda.org/conda-forge/linux-64/icu-78.3-h33c6efd_0.conda + sha256: fbf86c4a59c2ed05bbffb2ba25c7ed94f6185ec30ecb691615d42342baa1a16a + md5: c80d8a3b84358cb967fa81e7075fbc8a + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + license: MIT + license_family: MIT + purls: [] + size: 12723451 + timestamp: 1773822285671 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/icu-75.1-hf9b3779_0.conda sha256: 813298f2e54ef087dbfc9cc2e56e08ded41de65cff34c639cc8ba4e27e4540c9 md5: 268203e8b983fddb6412b36f2024e75c @@ -4645,6 +5877,17 @@ packages: license_family: MIT size: 12851689 timestamp: 1772208964788 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/icu-78.3-hcab7f73_0.conda + sha256: 49ba6aed2c6b482bb0ba41078057555d29764299bc947b990708617712ef6406 + md5: 546da38c2fa9efacf203e2ad3f987c59 + depends: + - libgcc >=14 + - libstdcxx >=14 + license: MIT + license_family: MIT + purls: [] + size: 12837286 + timestamp: 1773822650615 - conda: https://conda.anaconda.org/conda-forge/win-64/icu-75.1-he0c23c2_0.conda sha256: 1d04369a1860a1e9e371b9fc82dd0092b616adcf057d6c88371856669280e920 md5: 8579b6bb8d18be7c0b27fb08adeeeb40 @@ -4678,6 +5921,28 @@ packages: license_family: MIT size: 13222158 timestamp: 1767970128854 +- conda: https://conda.anaconda.org/conda-forge/noarch/idna-3.11-pyhd8ed1ab_0.conda + sha256: ae89d0299ada2a3162c2614a9d26557a92aa6a77120ce142f8e0109bbf0342b0 + md5: 53abe63df7e10a6ba605dc5f9f961d36 + depends: + - python >=3.10 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/idna?source=hash-mapping + size: 50721 + timestamp: 1760286526795 +- conda: https://conda.anaconda.org/conda-forge/noarch/imagesize-2.0.0-pyhd8ed1ab_0.conda + sha256: 5a047f9eac290e679b4e6f6f4cbfcc5acdfbf031a4f06824d4ddb590cdbb850b + md5: 92617c2ba2847cca7a6ed813b6f4ab79 + depends: + - python >=3.10 + license: MIT + license_family: MIT + purls: + - pkg:pypi/imagesize?source=hash-mapping + size: 15729 + timestamp: 1773752188889 - conda: https://conda.anaconda.org/conda-forge/noarch/importlib-metadata-8.7.0-pyhe01879c_1.conda sha256: c18ab120a0613ada4391b15981d86ff777b5690ca461ea7e9e49531e8f374745 md5: 63ccfdc3a3ce25b027b8767eb722fca8 @@ -4689,6 +5954,44 @@ packages: license_family: APACHE size: 34641 timestamp: 1747934053147 +- conda: https://conda.anaconda.org/conda-forge/noarch/importlib-metadata-8.8.0-pyhcf101f3_0.conda + sha256: 82ab2a0d91ca1e7e63ab6a4939356667ef683905dea631bc2121aa534d347b16 + md5: 080594bf4493e6bae2607e65390c520a + depends: + - python >=3.10 + - zipp >=3.20 + - python + license: Apache-2.0 + license_family: APACHE + purls: + - pkg:pypi/importlib-metadata?source=compressed-mapping + size: 34387 + timestamp: 1773931568510 +- conda: https://conda.anaconda.org/conda-forge/noarch/importlib-resources-6.5.2-pyhd8ed1ab_0.conda + sha256: a99a3dafdfff2bb648d2b10637c704400295cb2ba6dc929e2d814870cf9f6ae5 + md5: e376ea42e9ae40f3278b0f79c9bf9826 + depends: + - importlib_resources >=6.5.2,<6.5.3.0a0 + - python >=3.9 + license: Apache-2.0 + license_family: APACHE + purls: [] + size: 9724 + timestamp: 1736252443859 +- conda: https://conda.anaconda.org/conda-forge/noarch/importlib_resources-6.5.2-pyhd8ed1ab_0.conda + sha256: acc1d991837c0afb67c75b77fdc72b4bf022aac71fedd8b9ea45918ac9b08a80 + md5: c85c76dc67d75619a92f51dfbce06992 + depends: + - python >=3.9 + - zipp >=3.1.0 + constrains: + - importlib-resources >=6.5.2,<6.5.3.0a0 + license: Apache-2.0 + license_family: APACHE + purls: + - pkg:pypi/importlib-resources?source=hash-mapping + size: 33781 + timestamp: 1736252433366 - conda: https://conda.anaconda.org/conda-forge/noarch/iniconfig-2.3.0-pyhd8ed1ab_0.conda sha256: e1a9e3b1c8fe62dc3932a616c284b5d8cbe3124bbfbedcf4ce5c828cb166ee19 md5: 9614359868482abba1bd15ce465e3c42 @@ -4696,6 +5999,8 @@ packages: - python >=3.10 license: MIT license_family: MIT + purls: + - pkg:pypi/iniconfig?source=hash-mapping size: 13387 timestamp: 1760831448842 - conda: https://conda.anaconda.org/conda-forge/linux-64/intel-gmmlib-22.9.0-hb700be7_0.conda @@ -4735,56 +6040,354 @@ packages: license_family: MIT size: 8783533 timestamp: 1773230300873 -- conda: https://conda.anaconda.org/conda-forge/noarch/kernel-headers_linux-64-4.18.0-he073ed8_9.conda - sha256: 41557eeadf641de6aeae49486cef30d02a6912d8da98585d687894afd65b356a - md5: 86d9cba083cd041bfbf242a01a7a1999 +- conda: https://conda.anaconda.org/conda-forge/noarch/ipykernel-7.2.0-pyh6dadd2b_1.conda + sha256: 9cdadaeef5abadca4113f92f5589db19f8b7df5e1b81cb0225f7024a3aedefa3 + md5: b3a7d5842f857414d9ae831a799444dd + depends: + - __win + - comm >=0.1.1 + - debugpy >=1.6.5 + - ipython >=7.23.1 + - jupyter_client >=8.8.0 + - jupyter_core >=5.1,!=6.0.* + - matplotlib-inline >=0.1 + - nest-asyncio >=1.4 + - packaging >=22 + - psutil >=5.7 + - python >=3.10 + - pyzmq >=25 + - tornado >=6.4.1 + - traitlets >=5.4.0 + - python constrains: - - sysroot_linux-64 ==2.28 - license: LGPL-2.0-or-later AND LGPL-2.0-or-later WITH exceptions AND GPL-2.0-or-later - license_family: GPL - size: 1278712 - timestamp: 1765578681495 -- conda: https://conda.anaconda.org/conda-forge/noarch/kernel-headers_linux-aarch64-4.18.0-h05a177a_9.conda - sha256: 5d224bf4df9bac24e69de41897c53756108c5271a0e5d2d2f66fd4e2fbc1d84b - md5: bb3b7cad9005f2cbf9d169fb30263f3e + - appnope >=0.1.2 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/ipykernel?source=hash-mapping + size: 132382 + timestamp: 1770566174387 +- conda: https://conda.anaconda.org/conda-forge/noarch/ipykernel-7.2.0-pyha191276_1.conda + sha256: b77ed58eb235e5ad80e742b03caeed4bbc2a2ef064cb9a2deee3b75dfae91b2a + md5: 8b267f517b81c13594ed68d646fd5dcb + depends: + - __linux + - comm >=0.1.1 + - debugpy >=1.6.5 + - ipython >=7.23.1 + - jupyter_client >=8.8.0 + - jupyter_core >=5.1,!=6.0.* + - matplotlib-inline >=0.1 + - nest-asyncio >=1.4 + - packaging >=22 + - psutil >=5.7 + - python >=3.10 + - pyzmq >=25 + - tornado >=6.4.1 + - traitlets >=5.4.0 + - python constrains: - - sysroot_linux-aarch64 ==2.28 - license: LGPL-2.0-or-later AND LGPL-2.0-or-later WITH exceptions AND GPL-2.0-or-later - license_family: GPL - size: 1248134 - timestamp: 1765578613607 -- conda: https://conda.anaconda.org/conda-forge/linux-64/lame-3.100-h166bdaf_1003.tar.bz2 - sha256: aad2a703b9d7b038c0f745b853c6bb5f122988fe1a7a096e0e606d9cbec4eaab - md5: a8832b479f93521a9e7b5b743803be51 + - appnope >=0.1.2 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/ipykernel?source=hash-mapping + size: 133644 + timestamp: 1770566133040 +- conda: https://conda.anaconda.org/conda-forge/noarch/ipython-9.12.0-pyhccfa634_0.conda + sha256: a0d3e4c8e4d7b3801377a03de32951f68d77dd1bfe25082c7915f4e6b0aaa463 + md5: 3734e3b6618ea6e04ad08678d8ed7a45 depends: - - libgcc-ng >=12 - license: LGPL-2.0-only - license_family: LGPL - size: 508258 - timestamp: 1664996250081 -- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/lame-3.100-h4e544f5_1003.tar.bz2 - sha256: 2502904a42df6d94bd743f7b73915415391dd6d31d5f50cb57c0a54a108e7b0a - md5: ab05bcf82d8509b4243f07e93bada144 + - __win + - decorator >=5.1.0 + - ipython_pygments_lexers >=1.0.0 + - jedi >=0.18.2 + - matplotlib-inline >=0.1.6 + - prompt-toolkit >=3.0.41,<3.1.0 + - pygments >=2.14.0 + - python >=3.12 + - stack_data >=0.6.0 + - traitlets >=5.13.0 + - colorama >=0.4.4 + - python + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/ipython?source=compressed-mapping + size: 648954 + timestamp: 1774610078420 +- conda: https://conda.anaconda.org/conda-forge/noarch/ipython-9.12.0-pyhecfbec7_0.conda + sha256: 932044bd893f7adce6c9b384b96a72fd3804cc381e76789398c2fae900f21df7 + md5: b293210beb192c3024683bf6a998a0b8 depends: - - libgcc-ng >=12 - license: LGPL-2.0-only - license_family: LGPL - size: 604863 - timestamp: 1664997611416 -- conda: https://conda.anaconda.org/conda-forge/win-64/lame-3.100-hcfcfb64_1003.tar.bz2 - sha256: 824988a396b97bb9138823a1b3aabd8326e06da5834b3011253d72bb45fd3a88 - md5: d92e64077c44c9e32c72d4b5799d47e4 + - __unix + - decorator >=5.1.0 + - ipython_pygments_lexers >=1.0.0 + - jedi >=0.18.2 + - matplotlib-inline >=0.1.6 + - prompt-toolkit >=3.0.41,<3.1.0 + - pygments >=2.14.0 + - python >=3.12 + - stack_data >=0.6.0 + - traitlets >=5.13.0 + - pexpect >4.6 + - python + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/ipython?source=compressed-mapping + size: 649967 + timestamp: 1774609994657 +- conda: https://conda.anaconda.org/conda-forge/noarch/ipython_pygments_lexers-1.1.1-pyhd8ed1ab_0.conda + sha256: 894682a42a7d659ae12878dbcb274516a7031bbea9104e92f8e88c1f2765a104 + md5: bd80ba060603cc228d9d81c257093119 depends: - - ucrt >=10.0.20348.0 - - vc >=14.2,<15 - - vs2015_runtime >=14.29.30139 - license: LGPL-2.0-only - license_family: LGPL - size: 570583 - timestamp: 1664996824680 -- conda: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.45-default_hbd61a6d_104.conda - sha256: 9e191baf2426a19507f1d0a17be0fdb7aa155cdf0f61d5a09c808e0a69464312 - md5: a6abd2796fc332536735f68ba23f7901 + - pygments + - python >=3.9 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/ipython-pygments-lexers?source=hash-mapping + size: 13993 + timestamp: 1737123723464 +- conda: https://conda.anaconda.org/conda-forge/noarch/jedi-0.19.2-pyhd8ed1ab_1.conda + sha256: 92c4d217e2dc68983f724aa983cca5464dcb929c566627b26a2511159667dba8 + md5: a4f4c5dc9b80bc50e0d3dc4e6e8f1bd9 + depends: + - parso >=0.8.3,<0.9.0 + - python >=3.9 + license: Apache-2.0 AND MIT + purls: + - pkg:pypi/jedi?source=hash-mapping + size: 843646 + timestamp: 1733300981994 +- conda: https://conda.anaconda.org/conda-forge/noarch/jinja2-3.1.6-pyhcf101f3_1.conda + sha256: fc9ca7348a4f25fed2079f2153ecdcf5f9cf2a0bc36c4172420ca09e1849df7b + md5: 04558c96691bed63104678757beb4f8d + depends: + - markupsafe >=2.0 + - python >=3.10 + - python + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/jinja2?source=compressed-mapping + size: 120685 + timestamp: 1764517220861 +- conda: https://conda.anaconda.org/conda-forge/noarch/jsonschema-4.26.0-pyhcf101f3_0.conda + sha256: db973a37d75db8e19b5f44bbbdaead0c68dde745407f281e2a7fe4db74ec51d7 + md5: ada41c863af263cc4c5fcbaff7c3e4dc + depends: + - attrs >=22.2.0 + - jsonschema-specifications >=2023.3.6 + - python >=3.10 + - referencing >=0.28.4 + - rpds-py >=0.25.0 + - python + license: MIT + license_family: MIT + purls: + - pkg:pypi/jsonschema?source=hash-mapping + size: 82356 + timestamp: 1767839954256 +- conda: https://conda.anaconda.org/conda-forge/noarch/jsonschema-specifications-2025.9.1-pyhcf101f3_0.conda + sha256: 0a4f3b132f0faca10c89fdf3b60e15abb62ded6fa80aebfc007d05965192aa04 + md5: 439cd0f567d697b20a8f45cb70a1005a + depends: + - python >=3.10 + - referencing >=0.31.0 + - python + license: MIT + license_family: MIT + purls: + - pkg:pypi/jsonschema-specifications?source=hash-mapping + size: 19236 + timestamp: 1757335715225 +- conda: https://conda.anaconda.org/conda-forge/noarch/jupyter-cache-1.0.1-pyhff2d567_0.conda + sha256: 054d397dd45ed08bffb0976702e553dfb0d0b0a477da9cff36e2ea702e928f48 + md5: b0ee650829b8974202a7abe7f8b81e5a + depends: + - attrs + - click + - importlib-metadata + - nbclient >=0.2 + - nbformat + - python >=3.9 + - pyyaml + - sqlalchemy >=1.3.12,<3 + - tabulate + license: MIT + license_family: MIT + purls: + - pkg:pypi/jupyter-cache?source=hash-mapping + size: 31236 + timestamp: 1731777189586 +- conda: https://conda.anaconda.org/conda-forge/noarch/jupyter_client-8.8.0-pyhcf101f3_0.conda + sha256: e402bd119720862a33229624ec23645916a7d47f30e1711a4af9e005162b84f3 + md5: 8a3d6d0523f66cf004e563a50d9392b3 + depends: + - jupyter_core >=5.1 + - python >=3.10 + - python-dateutil >=2.8.2 + - pyzmq >=25.0 + - tornado >=6.4.1 + - traitlets >=5.3 + - python + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/jupyter-client?source=compressed-mapping + size: 112785 + timestamp: 1767954655912 +- conda: https://conda.anaconda.org/conda-forge/noarch/jupyter_core-5.9.1-pyh6dadd2b_0.conda + sha256: ed709a6c25b731e01563521ef338b93986cd14b5bc17f35e9382000864872ccc + md5: a8db462b01221e9f5135be466faeb3e0 + depends: + - __win + - pywin32 + - platformdirs >=2.5 + - python >=3.10 + - traitlets >=5.3 + - python + constrains: + - pywin32 >=300 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/jupyter-core?source=hash-mapping + size: 64679 + timestamp: 1760643889625 +- conda: https://conda.anaconda.org/conda-forge/noarch/jupyter_core-5.9.1-pyhc90fa1f_0.conda + sha256: 1d34b80e5bfcd5323f104dbf99a2aafc0e5d823019d626d0dce5d3d356a2a52a + md5: b38fe4e78ee75def7e599843ef4c1ab0 + depends: + - __unix + - python + - platformdirs >=2.5 + - python >=3.10 + - traitlets >=5.3 + - python + constrains: + - pywin32 >=300 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/jupyter-core?source=hash-mapping + size: 65503 + timestamp: 1760643864586 +- conda: https://conda.anaconda.org/conda-forge/noarch/kernel-headers_linux-64-4.18.0-he073ed8_9.conda + sha256: 41557eeadf641de6aeae49486cef30d02a6912d8da98585d687894afd65b356a + md5: 86d9cba083cd041bfbf242a01a7a1999 + constrains: + - sysroot_linux-64 ==2.28 + license: LGPL-2.0-or-later AND LGPL-2.0-or-later WITH exceptions AND GPL-2.0-or-later + license_family: GPL + size: 1278712 + timestamp: 1765578681495 +- conda: https://conda.anaconda.org/conda-forge/noarch/kernel-headers_linux-aarch64-4.18.0-h05a177a_9.conda + sha256: 5d224bf4df9bac24e69de41897c53756108c5271a0e5d2d2f66fd4e2fbc1d84b + md5: bb3b7cad9005f2cbf9d169fb30263f3e + constrains: + - sysroot_linux-aarch64 ==2.28 + license: LGPL-2.0-or-later AND LGPL-2.0-or-later WITH exceptions AND GPL-2.0-or-later + license_family: GPL + size: 1248134 + timestamp: 1765578613607 +- conda: https://conda.anaconda.org/conda-forge/linux-64/keyutils-1.6.3-hb9d3cd8_0.conda + sha256: 0960d06048a7185d3542d850986d807c6e37ca2e644342dd0c72feefcf26c2a4 + md5: b38117a3c920364aff79f870c984b4a3 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + license: LGPL-2.1-or-later + purls: [] + size: 134088 + timestamp: 1754905959823 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/keyutils-1.6.3-h86ecc28_0.conda + sha256: 5ce830ca274b67de11a7075430a72020c1fb7d486161a82839be15c2b84e9988 + md5: e7df0aab10b9cbb73ab2a467ebfaf8c7 + depends: + - libgcc >=13 + license: LGPL-2.1-or-later + purls: [] + size: 129048 + timestamp: 1754906002667 +- conda: https://conda.anaconda.org/conda-forge/linux-64/krb5-1.22.2-ha1258a1_0.conda + sha256: 3e307628ca3527448dd1cb14ad7bb9d04d1d28c7d4c5f97ba196ae984571dd25 + md5: fb53fb07ce46a575c5d004bbc96032c2 + depends: + - __glibc >=2.17,<3.0.a0 + - keyutils >=1.6.3,<2.0a0 + - libedit >=3.1.20250104,<3.2.0a0 + - libedit >=3.1.20250104,<4.0a0 + - libgcc >=14 + - libstdcxx >=14 + - openssl >=3.5.5,<4.0a0 + license: MIT + license_family: MIT + purls: [] + size: 1386730 + timestamp: 1769769569681 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/krb5-1.22.2-hfd895c2_0.conda + sha256: b53999d888dda53c506b264e8c02b5f5c8e022c781eda0718f007339e6bc90ba + md5: d9ca108bd680ea86a963104b6b3e95ca + depends: + - keyutils >=1.6.3,<2.0a0 + - libedit >=3.1.20250104,<3.2.0a0 + - libedit >=3.1.20250104,<4.0a0 + - libgcc >=14 + - libstdcxx >=14 + - openssl >=3.5.5,<4.0a0 + license: MIT + license_family: MIT + purls: [] + size: 1517436 + timestamp: 1769773395215 +- conda: https://conda.anaconda.org/conda-forge/win-64/krb5-1.22.2-h0ea6238_0.conda + sha256: eb60f1ad8b597bcf95dee11bc11fe71a8325bc1204cf51d2bb1f2120ffd77761 + md5: 4432f52dc0c8eb6a7a6abc00a037d93c + depends: + - openssl >=3.5.5,<4.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: MIT + license_family: MIT + purls: [] + size: 751055 + timestamp: 1769769688841 +- conda: https://conda.anaconda.org/conda-forge/linux-64/lame-3.100-h166bdaf_1003.tar.bz2 + sha256: aad2a703b9d7b038c0f745b853c6bb5f122988fe1a7a096e0e606d9cbec4eaab + md5: a8832b479f93521a9e7b5b743803be51 + depends: + - libgcc-ng >=12 + license: LGPL-2.0-only + license_family: LGPL + size: 508258 + timestamp: 1664996250081 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/lame-3.100-h4e544f5_1003.tar.bz2 + sha256: 2502904a42df6d94bd743f7b73915415391dd6d31d5f50cb57c0a54a108e7b0a + md5: ab05bcf82d8509b4243f07e93bada144 + depends: + - libgcc-ng >=12 + license: LGPL-2.0-only + license_family: LGPL + size: 604863 + timestamp: 1664997611416 +- conda: https://conda.anaconda.org/conda-forge/win-64/lame-3.100-hcfcfb64_1003.tar.bz2 + sha256: 824988a396b97bb9138823a1b3aabd8326e06da5834b3011253d72bb45fd3a88 + md5: d92e64077c44c9e32c72d4b5799d47e4 + depends: + - ucrt >=10.0.20348.0 + - vc >=14.2,<15 + - vs2015_runtime >=14.29.30139 + license: LGPL-2.0-only + license_family: LGPL + size: 570583 + timestamp: 1664996824680 +- conda: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.45-default_hbd61a6d_104.conda + sha256: 9e191baf2426a19507f1d0a17be0fdb7aa155cdf0f61d5a09c808e0a69464312 + md5: a6abd2796fc332536735f68ba23f7901 depends: - __glibc >=2.17,<3.0.a0 - zstd >=1.5.7,<1.6.0a0 @@ -4818,6 +6421,19 @@ packages: license_family: GPL size: 725507 timestamp: 1770267139900 +- conda: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.45.1-default_hbd61a6d_102.conda + sha256: 3d584956604909ff5df353767f3a2a2f60e07d070b328d109f30ac40cd62df6c + md5: 18335a698559cdbcd86150a48bf54ba6 + depends: + - __glibc >=2.17,<3.0.a0 + - zstd >=1.5.7,<1.6.0a0 + constrains: + - binutils_impl_linux-64 2.45.1 + license: GPL-3.0-only + license_family: GPL + purls: [] + size: 728002 + timestamp: 1774197446916 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/ld_impl_linux-aarch64-2.45-default_h1979696_104.conda sha256: 7a13072581fa23f658a04f62f62c4677c57d3c9696fbc01cc954a88fc354b44d md5: 28035705fe0c977ea33963489cd008ad @@ -4851,6 +6467,18 @@ packages: license_family: GPL size: 875924 timestamp: 1770267209884 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/ld_impl_linux-aarch64-2.45.1-default_h1979696_102.conda + sha256: 7abd913d81a9bf00abb699e8987966baa2065f5132e37e815f92d90fc6bba530 + md5: a21644fc4a83da26452a718dc9468d5f + depends: + - zstd >=1.5.7,<1.6.0a0 + constrains: + - binutils_impl_linux-aarch64 2.45.1 + license: GPL-3.0-only + license_family: GPL + purls: [] + size: 875596 + timestamp: 1774197520746 - conda: https://conda.anaconda.org/conda-forge/win-64/ld_impl_win-64-2.45-default_hfd38196_104.conda sha256: 14f0c7487f0567ce4e0af3a4f0c4378597d0db4798b0786d6acc8d9498c8ed5a md5: 53e0006599159c099d051eaa08316403 @@ -5085,6 +6713,24 @@ packages: license_family: BSD size: 18213 timestamp: 1765818813880 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libblas-3.11.0-6_h4a7cf45_openblas.conda + build_number: 6 + sha256: 7bfe936dbb5db04820cf300a9cc1f5ee8d5302fc896c2d66e30f1ee2f20fbfd6 + md5: 6d6d225559bfa6e2f3c90ee9c03d4e2e + depends: + - libopenblas >=0.3.32,<0.3.33.0a0 + - libopenblas >=0.3.32,<1.0a0 + constrains: + - blas 2.306 openblas + - liblapack 3.11.0 6*_openblas + - liblapacke 3.11.0 6*_openblas + - libcblas 3.11.0 6*_openblas + - mkl <2026 + license: BSD-3-Clause + license_family: BSD + purls: [] + size: 18621 + timestamp: 1774503034895 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libblas-3.11.0-5_haddc8a3_openblas.conda build_number: 5 sha256: 700f3c03d0fba8e687a345404a45fbabe781c1cf92242382f62cef2948745ec4 @@ -5102,6 +6748,24 @@ packages: license_family: BSD size: 18369 timestamp: 1765818610617 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libblas-3.11.0-6_haddc8a3_openblas.conda + build_number: 6 + sha256: 7374c744c37786bfa4cfd30bbbad13469882e5d9f32ed792922b447b7e369554 + md5: 652bb20bb4618cacd11e17ae070f47ce + depends: + - libopenblas >=0.3.32,<0.3.33.0a0 + - libopenblas >=0.3.32,<1.0a0 + constrains: + - blas 2.306 openblas + - mkl <2026 + - liblapack 3.11.0 6*_openblas + - liblapacke 3.11.0 6*_openblas + - libcblas 3.11.0 6*_openblas + license: BSD-3-Clause + license_family: BSD + purls: [] + size: 18682 + timestamp: 1774503047392 - conda: https://conda.anaconda.org/conda-forge/win-64/libblas-3.11.0-5_hf2e6a31_mkl.conda build_number: 5 sha256: f0cb7b2697461a306341f7ff32d5b361bb84f3e94478464c1e27ee01fc8f276b @@ -5117,6 +6781,22 @@ packages: license_family: BSD size: 67438 timestamp: 1765819100043 +- conda: https://conda.anaconda.org/conda-forge/win-64/libblas-3.11.0-6_hf2e6a31_mkl.conda + build_number: 6 + sha256: 10c8054f007adca8c780cd8bb9335fa5d990f0494b825158d3157983a25b1ea2 + md5: 95543eec964b4a4a7ca3c4c9be481aa1 + depends: + - mkl >=2025.3.1,<2026.0a0 + constrains: + - blas 2.306 mkl + - liblapacke 3.11.0 6*_mkl + - liblapack 3.11.0 6*_mkl + - libcblas 3.11.0 6*_mkl + license: BSD-3-Clause + license_family: BSD + purls: [] + size: 68082 + timestamp: 1774503684284 - conda: https://conda.anaconda.org/conda-forge/linux-64/libbrotlicommon-1.2.0-hb03c661_1.conda sha256: 318f36bd49ca8ad85e6478bd8506c88d82454cc008c1ac1c6bf00a3c42fa610e md5: 72c8fd1af66bd67bf580645b426513ed @@ -5224,6 +6904,17 @@ packages: license_family: BSD size: 121429 timestamp: 1762349484074 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libcap-2.77-hd0affe5_1.conda + sha256: 37c41b1024d0c75da76822e3c079aabaf121618a32fe05e53a897b35a88008fc + md5: 499cd8e2d4358986dbe3b30e8fe1bf6a + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: BSD-3-Clause + license_family: BSD + purls: [] + size: 124432 + timestamp: 1774333989027 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcap-2.77-h68e9139_0.conda sha256: 154eefd8f94010d89ba76a057949b9b1f75c7379bd0d19d4657c952bedcf5904 md5: 10fe36ec0a9f7b1caae0331c9ba50f61 @@ -5234,6 +6925,16 @@ packages: license_family: BSD size: 108542 timestamp: 1762350753349 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcap-2.77-hf9559e3_1.conda + sha256: e04f0c4287362ea2033421c1b516d7d83c308084bcc9483b2e6038ec7c711e0a + md5: bdda58ab0358b0e9ff45fd2503b38410 + depends: + - libgcc >=14 + license: BSD-3-Clause + license_family: BSD + purls: [] + size: 109458 + timestamp: 1774335293336 - conda: https://conda.anaconda.org/conda-forge/linux-64/libcblas-3.11.0-5_h0358290_openblas.conda build_number: 5 sha256: 0cbdcc67901e02dc17f1d19e1f9170610bd828100dc207de4d5b6b8ad1ae7ad8 @@ -5248,6 +6949,21 @@ packages: license_family: BSD size: 18194 timestamp: 1765818837135 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libcblas-3.11.0-6_h0358290_openblas.conda + build_number: 6 + sha256: 57edafa7796f6fa3ebbd5367692dd4c7f552be42109c2dd1a7c89b55089bf374 + md5: 36ae340a916635b97ac8a0655ace2a35 + depends: + - libblas 3.11.0 6_h4a7cf45_openblas + constrains: + - blas 2.306 openblas + - liblapack 3.11.0 6*_openblas + - liblapacke 3.11.0 6*_openblas + license: BSD-3-Clause + license_family: BSD + purls: [] + size: 18622 + timestamp: 1774503050205 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcblas-3.11.0-5_hd72aa62_openblas.conda build_number: 5 sha256: 3fad5c9de161dccb4e42c8b1ae8eccb33f4ed56bccbcced9cbb0956ae7869e61 @@ -5262,6 +6978,21 @@ packages: license_family: BSD size: 18371 timestamp: 1765818618899 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcblas-3.11.0-6_hd72aa62_openblas.conda + build_number: 6 + sha256: 5dd9e872cf8ebd632f31cd3a5ca6d3cb331f4d3a90bfafbe572093afeb77632b + md5: 939e300b110db241a96a1bed438c315b + depends: + - libblas 3.11.0 6_haddc8a3_openblas + constrains: + - blas 2.306 openblas + - liblapack 3.11.0 6*_openblas + - liblapacke 3.11.0 6*_openblas + license: BSD-3-Clause + license_family: BSD + purls: [] + size: 18689 + timestamp: 1774503058069 - conda: https://conda.anaconda.org/conda-forge/win-64/libcblas-3.11.0-5_h2a3cdd5_mkl.conda build_number: 5 sha256: 49dc59d8e58360920314b8d276dd80da7866a1484a9abae4ee2760bc68f3e68d @@ -5276,6 +7007,21 @@ packages: license_family: BSD size: 68079 timestamp: 1765819124349 +- conda: https://conda.anaconda.org/conda-forge/win-64/libcblas-3.11.0-6_h2a3cdd5_mkl.conda + build_number: 6 + sha256: 02b2a2225f4899c6aaa1dc723e06b3f7a4903d2129988f91fc1527409b07b0a5 + md5: 9e4bf521c07f4d423cba9296b7927e3c + depends: + - libblas 3.11.0 6_hf2e6a31_mkl + constrains: + - blas 2.306 mkl + - liblapacke 3.11.0 6*_mkl + - liblapack 3.11.0 6*_mkl + license: BSD-3-Clause + license_family: BSD + purls: [] + size: 68221 + timestamp: 1774503722413 - conda: https://conda.anaconda.org/conda-forge/linux-64/libcufile-1.14.1.1-hbc026e6_1.conda sha256: 5fa43e8a8d335fc0c3a6aeb2e7b0debc7d8495b8a60a56ac30f23b0e852ab74a md5: cab1818eada3952ed09c8dcbb7c26af7 @@ -5288,18 +7034,19 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 969845 timestamp: 1761098818759 -- conda: https://conda.anaconda.org/conda-forge/linux-64/libcufile-1.17.0.44-h85c024f_0.conda - sha256: dc2b0c43aeacbaa686061353807e718236d8c5b346f624e76fed98b066898e19 - md5: 6d8ed8335d144ec7303b8d3587b2205c +- conda: https://conda.anaconda.org/conda-forge/linux-64/libcufile-1.18.0.66-h85c024f_0.conda + sha256: aa2ce3784f756fabde147be6dc606f93a6e6be5e0a146697b57454e9f4adc264 + md5: f760d9e2103a43d25f930cd3706c0cab depends: - __glibc >=2.28,<3.0.a0 - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 - libgcc >=14 - libstdcxx >=14 - rdma-core >=61.0 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 1085341 - timestamp: 1773100191342 + purls: [] + size: 1115061 + timestamp: 1779897561291 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcufile-1.14.1.1-had8bf56_1.conda sha256: fbc1fa6b3ddf946b2999c9820310682739505df71e1e2ac513a72efb951fa3e5 md5: ee136db5a5409dddc78eaf7658fccffe @@ -5313,21 +7060,22 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 909365 timestamp: 1761098964619 -- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcufile-1.17.0.44-h4243460_0.conda - sha256: 37615867c9cf3727289fb8f0fabf43e5e5e9989091d6ba86c1eccd9323b54492 - md5: 62177c2a0b2d8ab2cfa065df0ef656b7 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libcufile-1.18.0.66-h4243460_0.conda + sha256: 46bd414aaac6274db9118965459a173f8339529c6d0fda53d2e167579cee1ce0 + md5: cc1766bf438c27f357c37bf0869686f1 depends: - __glibc >=2.28,<3.0.a0 - arm-variant * sbsa - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 - libgcc >=14 - libstdcxx >=14 - rdma-core >=61.0 constrains: - arm-variant * sbsa license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 973639 - timestamp: 1773100202181 + purls: [] + size: 998160 + timestamp: 1779897582676 - conda: https://conda.anaconda.org/conda-forge/linux-64/libdeflate-1.25-h17f619e_0.conda sha256: aa8e8c4be9a2e81610ddf574e05b64ee131fab5e0e3693210c9d6d2fba32c680 md5: 6c77a605a7a689d17d4819c0f8ac9a00 @@ -5379,6 +7127,31 @@ packages: license_family: MIT size: 344548 timestamp: 1757212128414 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libedit-3.1.20250104-pl5321h7949ede_0.conda + sha256: d789471216e7aba3c184cd054ed61ce3f6dac6f87a50ec69291b9297f8c18724 + md5: c277e0a4d549b03ac1e9d6cbbe3d017b + depends: + - ncurses + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - ncurses >=6.5,<7.0a0 + license: BSD-2-Clause + license_family: BSD + purls: [] + size: 134676 + timestamp: 1738479519902 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libedit-3.1.20250104-pl5321h976ea20_0.conda + sha256: c0b27546aa3a23d47919226b3a1635fccdb4f24b94e72e206a751b33f46fd8d6 + md5: fb640d776fc92b682a14e001980825b1 + depends: + - ncurses + - libgcc >=13 + - ncurses >=6.5,<7.0a0 + license: BSD-2-Clause + license_family: BSD + purls: [] + size: 148125 + timestamp: 1738479808948 - conda: https://conda.anaconda.org/conda-forge/linux-64/libegl-1.7.0-ha4b6fd6_2.conda sha256: 7fd5408d359d05a969133e47af580183fbf38e2235b562193d427bb9dad79723 md5: c151d5eb730e9b7480e6d48c0fc44048 @@ -5420,6 +7193,19 @@ packages: license_family: MIT size: 76798 timestamp: 1771259418166 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libexpat-2.7.5-hecca717_0.conda + sha256: e8c2b57f6aacabdf2f1b0924bd4831ce5071ba080baa4a9e8c0d720588b6794c + md5: 49f570f3bc4c874a06ea69b7225753af + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + constrains: + - expat 2.7.5.* + license: MIT + license_family: MIT + purls: [] + size: 76624 + timestamp: 1774719175983 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libexpat-2.7.3-hfae3067_0.conda sha256: cc2581a78315418cc2e0bb2a273d37363203e79cefe78ba6d282fed546262239 md5: b414e36fbb7ca122030276c75fa9c34a @@ -5442,6 +7228,18 @@ packages: license_family: MIT size: 76564 timestamp: 1771259530958 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libexpat-2.7.5-hfae3067_0.conda + sha256: 6d438fc0bfdb263c24654fe49c09b31f06ec78eb709eb386392d2499af105f85 + md5: 05d1e0b30acd816a192c03dc6e164f4d + depends: + - libgcc >=14 + constrains: + - expat 2.7.5.* + license: MIT + license_family: MIT + purls: [] + size: 76523 + timestamp: 1774719129371 - conda: https://conda.anaconda.org/conda-forge/win-64/libexpat-2.7.3-hac47afa_0.conda sha256: 844ab708594bdfbd7b35e1a67c379861bcd180d6efe57b654f482ae2f7f5c21e md5: 8c9e4f1a0e688eef2e95711178061a0f @@ -5468,6 +7266,20 @@ packages: license_family: MIT size: 70323 timestamp: 1771259521393 +- conda: https://conda.anaconda.org/conda-forge/win-64/libexpat-2.7.5-hac47afa_0.conda + sha256: 6850c3a4d5dc215b86f58518cfb8752998533d6569b08da8df1da72e7c68e571 + md5: bfb43f52f13b7c56e7677aa7a8efdf0c + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + constrains: + - expat 2.7.5.* + license: MIT + license_family: MIT + purls: [] + size: 70609 + timestamp: 1774719377850 - conda: https://conda.anaconda.org/conda-forge/linux-64/libffi-3.5.2-h3435931_0.conda sha256: 31f19b6a88ce40ebc0d5a992c131f57d919f73c0b92cd1617a5bec83f6e961e6 md5: a360c33a5abe61c07959e449fa1453eb @@ -5476,6 +7288,7 @@ packages: - libgcc >=14 license: MIT license_family: MIT + purls: [] size: 58592 timestamp: 1769456073053 - conda: https://conda.anaconda.org/conda-forge/linux-64/libffi-3.5.2-h9ec8514_0.conda @@ -5495,6 +7308,7 @@ packages: - libgcc >=14 license: MIT license_family: MIT + purls: [] size: 55952 timestamp: 1769456078358 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libffi-3.5.2-hd65408f_0.conda @@ -5515,6 +7329,7 @@ packages: - vc14_runtime >=14.44.35208 license: MIT license_family: MIT + purls: [] size: 45831 timestamp: 1769456418774 - conda: https://conda.anaconda.org/conda-forge/win-64/libffi-3.5.2-h52bdfb6_0.conda @@ -5715,6 +7530,7 @@ packages: - libgomp 15.2.0 he0feb66_18 license: GPL-3.0-only WITH GCC-exception-3.1 license_family: GPL + purls: [] size: 1041788 timestamp: 1771378212382 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgcc-15.2.0-h8acb6b2_15.conda @@ -5750,6 +7566,7 @@ packages: - libgomp 15.2.0 h8acb6b2_18 license: GPL-3.0-only WITH GCC-exception-3.1 license_family: GPL + purls: [] size: 622900 timestamp: 1771378128706 - conda: https://conda.anaconda.org/conda-forge/win-64/libgcc-15.2.0-h8ee18e1_16.conda @@ -5778,6 +7595,7 @@ packages: - libgomp 15.2.0 h8ee18e1_18 license: GPL-3.0-only WITH GCC-exception-3.1 license_family: GPL + purls: [] size: 820022 timestamp: 1771382190160 - conda: https://conda.anaconda.org/conda-forge/noarch/libgcc-devel_linux-64-15.2.0-hcc6f6b0_116.conda @@ -5859,6 +7677,7 @@ packages: - libgcc 15.2.0 he0feb66_18 license: GPL-3.0-only WITH GCC-exception-3.1 license_family: GPL + purls: [] size: 27526 timestamp: 1771378224552 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgcc-ng-15.2.0-he9431aa_15.conda @@ -5885,6 +7704,7 @@ packages: - libgcc 15.2.0 h8acb6b2_18 license: GPL-3.0-only WITH GCC-exception-3.1 license_family: GPL + purls: [] size: 27568 timestamp: 1771378136019 - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran-15.2.0-h69a702a_16.conda @@ -5907,6 +7727,7 @@ packages: - libgfortran-ng ==15.2.0=*_18 license: GPL-3.0-only WITH GCC-exception-3.1 license_family: GPL + purls: [] size: 27523 timestamp: 1771378269450 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgfortran-15.2.0-he9431aa_16.conda @@ -5929,6 +7750,7 @@ packages: - libgfortran-ng ==15.2.0=*_18 license: GPL-3.0-only WITH GCC-exception-3.1 license_family: GPL + purls: [] size: 27587 timestamp: 1771378169244 - conda: https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-15.2.0-h68bc16d_16.conda @@ -5953,6 +7775,7 @@ packages: - libgfortran 15.2.0 license: GPL-3.0-only WITH GCC-exception-3.1 license_family: GPL + purls: [] size: 2482475 timestamp: 1771378241063 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgfortran5-15.2.0-h1b7bec0_16.conda @@ -5975,6 +7798,7 @@ packages: - libgfortran 15.2.0 license: GPL-3.0-only WITH GCC-exception-3.1 license_family: GPL + purls: [] size: 1486341 timestamp: 1771378148102 - conda: https://conda.anaconda.org/conda-forge/linux-64/libgl-1.7.0-ha4b6fd6_2.conda @@ -6145,6 +7969,7 @@ packages: - __glibc >=2.17,<3.0.a0 license: GPL-3.0-only WITH GCC-exception-3.1 license_family: GPL + purls: [] size: 603262 timestamp: 1771378117851 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libgomp-15.2.0-h8acb6b2_15.conda @@ -6165,6 +7990,7 @@ packages: md5: 4faa39bf919939602e594253bd673958 license: GPL-3.0-only WITH GCC-exception-3.1 license_family: GPL + purls: [] size: 588060 timestamp: 1771378040807 - conda: https://conda.anaconda.org/conda-forge/win-64/libgomp-15.2.0-h8ee18e1_16.conda @@ -6187,6 +8013,7 @@ packages: - msys2-conda-epoch <0.0a0 license: GPL-3.0-only WITH GCC-exception-3.1 license_family: GPL + purls: [] size: 663864 timestamp: 1771382118742 - conda: https://conda.anaconda.org/conda-forge/linux-64/libhwloc-2.12.1-default_hafda6a7_1003.conda @@ -6265,6 +8092,7 @@ packages: - vc14_runtime >=14.44.35208 license: BSD-3-Clause license_family: BSD + purls: [] size: 2411241 timestamp: 1765104337762 - conda: https://conda.anaconda.org/conda-forge/linux-64/libhwy-1.3.0-h4c17acf_1.conda @@ -6321,6 +8149,7 @@ packages: - vc >=14.3,<15 - vc14_runtime >=14.44.35208 license: LGPL-2.1-only + purls: [] size: 696926 timestamp: 1754909290005 - conda: https://conda.anaconda.org/conda-forge/win-64/libintl-0.22.5-h5728263_3.conda @@ -6419,6 +8248,21 @@ packages: license_family: BSD size: 18200 timestamp: 1765818857876 +- conda: https://conda.anaconda.org/conda-forge/linux-64/liblapack-3.11.0-6_h47877c9_openblas.conda + build_number: 6 + sha256: 371f517eb7010b21c6cc882c7606daccebb943307cb9a3bf2c70456a5c024f7d + md5: 881d801569b201c2e753f03c84b85e15 + depends: + - libblas 3.11.0 6_h4a7cf45_openblas + constrains: + - blas 2.306 openblas + - liblapacke 3.11.0 6*_openblas + - libcblas 3.11.0 6*_openblas + license: BSD-3-Clause + license_family: BSD + purls: [] + size: 18624 + timestamp: 1774503065378 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/liblapack-3.11.0-5_h88aeb00_openblas.conda build_number: 5 sha256: 692222d186d3ffbc99eaf04b5b20181fd26aee1edec1106435a0a755c57cce86 @@ -6433,6 +8277,21 @@ packages: license_family: BSD size: 18392 timestamp: 1765818627104 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/liblapack-3.11.0-6_h88aeb00_openblas.conda + build_number: 6 + sha256: 67472a3cb761ff95527387ea0367883a22f9fbda1283b9880e5ad644fafd0735 + md5: e23a27b52fb320687239e2c5ae4d7540 + depends: + - libblas 3.11.0 6_haddc8a3_openblas + constrains: + - blas 2.306 openblas + - liblapacke 3.11.0 6*_openblas + - libcblas 3.11.0 6*_openblas + license: BSD-3-Clause + license_family: BSD + purls: [] + size: 18702 + timestamp: 1774503068721 - conda: https://conda.anaconda.org/conda-forge/win-64/liblapack-3.11.0-5_hf9ab0e9_mkl.conda build_number: 5 sha256: a2d33f5cc2b8a9042f2af6981c6733ab1a661463823eaa56595a9c58c0ab77e1 @@ -6447,6 +8306,21 @@ packages: license_family: BSD size: 80225 timestamp: 1765819148014 +- conda: https://conda.anaconda.org/conda-forge/win-64/liblapack-3.11.0-6_hf9ab0e9_mkl.conda + build_number: 6 + sha256: 2e6ac39e456ba13ec8f02fc0787b8a22c89780e24bd5556eaf642177463ffb36 + md5: 7e9cdaf6f302142bc363bbab3b5e7074 + depends: + - libblas 3.11.0 6_hf2e6a31_mkl + constrains: + - blas 2.306 mkl + - liblapacke 3.11.0 6*_mkl + - libcblas 3.11.0 6*_mkl + license: BSD-3-Clause + license_family: BSD + purls: [] + size: 80571 + timestamp: 1774503757128 - conda: https://conda.anaconda.org/conda-forge/linux-64/liblzma-5.8.1-hb9d3cd8_2.conda sha256: f2591c0069447bbe28d4d696b7fcb0c5bd0b4ac582769b89addbcf26fb3430d8 md5: 1a580f7796c7bf6393fddb8bbbde58dc @@ -6467,6 +8341,7 @@ packages: constrains: - xz 5.8.2.* license: 0BSD + purls: [] size: 113207 timestamp: 1768752626120 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/liblzma-5.8.1-h86ecc28_2.conda @@ -6487,6 +8362,7 @@ packages: constrains: - xz 5.8.2.* license: 0BSD + purls: [] size: 125916 timestamp: 1768754941722 - conda: https://conda.anaconda.org/conda-forge/win-64/liblzma-5.8.1-h2466b09_2.conda @@ -6511,6 +8387,7 @@ packages: constrains: - xz 5.8.2.* license: 0BSD + purls: [] size: 106169 timestamp: 1768752763559 - conda: https://conda.anaconda.org/conda-forge/linux-64/libmpdec-4.0.0-hb03c661_1.conda @@ -6581,6 +8458,7 @@ packages: - libgcc >=13 license: LGPL-2.1-or-later license_family: LGPL + purls: [] size: 741323 timestamp: 1731846827427 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnl-3.11.0-h86ecc28_0.conda @@ -6590,8 +8468,30 @@ packages: - libgcc >=13 license: LGPL-2.1-or-later license_family: LGPL + purls: [] size: 768716 timestamp: 1731846931826 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libnsl-2.0.1-hb9d3cd8_1.conda + sha256: 927fe72b054277cde6cb82597d0fcf6baf127dcbce2e0a9d8925a68f1265eef5 + md5: d864d34357c3b65a4b731f78c0801dc4 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + license: LGPL-2.1-only + license_family: GPL + purls: [] + size: 33731 + timestamp: 1750274110928 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnsl-2.0.1-h86ecc28_1.conda + sha256: c0dc4d84198e3eef1f37321299e48e2754ca83fd12e6284754e3cb231357c3a5 + md5: d5d58b2dc3e57073fe22303f5fed4db7 + depends: + - libgcc >=13 + license: LGPL-2.1-only + license_family: GPL + purls: [] + size: 34831 + timestamp: 1750274211 - conda: https://conda.anaconda.org/conda-forge/linux-64/libnvfatbin-12.9.82-hecca717_1.conda sha256: 4404948624cbddb8dd1bf52d259fe0c1ef24f30e3ff8ce887b002b395796acc7 md5: 2deb1bea8f1d9cd44d0b29390fd33017 @@ -6603,17 +8503,17 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 818615 timestamp: 1761098926897 -- conda: https://conda.anaconda.org/conda-forge/linux-64/libnvfatbin-13.2.51-hecca717_0.conda - sha256: 66b7bbe40d259e4927b9c264569afd49d0e31a3813c585beea63f3415577f1b3 - md5: 7e6534bce7252c84efdedae1fae2148e +- conda: https://conda.anaconda.org/conda-forge/linux-64/libnvfatbin-13.3.29-hecca717_0.conda + sha256: 3de6aed48ca7a705aa22444b54ad7236f0e1f9dc7f41ec3e2273e6cb991be213 + md5: 1f9be211f7ec5c88b1d2d561aee7884d depends: - __glibc >=2.17,<3.0.a0 - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 - libgcc >=14 - libstdcxx >=14 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 471076 - timestamp: 1773100181931 + size: 472135 + timestamp: 1779897596590 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnvfatbin-12.9.82-h8f3c8d4_1.conda sha256: 049ef83fb49c800369a410a9b27287aca2364ebdb6263d553db09f0b45aac3b5 md5: f7ebe6ae68c9722674d3474110eae245 @@ -6625,19 +8525,19 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 770989 timestamp: 1761098866337 -- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnvfatbin-13.2.51-h8f3c8d4_0.conda - sha256: 04cd9332d54c74cbededdcd1fdd0366b4848647f4b0fecbfe1900c3b8cd869fc - md5: 21f05b9cff10d73703b7983b49107e4d +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnvfatbin-13.3.29-h8f3c8d4_0.conda + sha256: a811726bc62a3e1952672aa0917166f8123e0ff2c182b9346384f8e962184530 + md5: 3ace0e6476f8c17381dc3b391c3c5049 depends: - arm-variant * sbsa - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 - libgcc >=14 - libstdcxx >=14 constrains: - arm-variant * sbsa license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 458768 - timestamp: 1773100228637 + size: 459700 + timestamp: 1779897643320 - conda: https://conda.anaconda.org/conda-forge/win-64/libnvfatbin-12.9.82-hac47afa_1.conda sha256: 0020038f897ddc83ed2cf5b128239c073e8db15dc661951bd674c4865f295f1b md5: cd0c30f6b1f93ea0ebac830fad30c100 @@ -6649,17 +8549,17 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 345320 timestamp: 1761099100395 -- conda: https://conda.anaconda.org/conda-forge/win-64/libnvfatbin-13.2.51-hac47afa_0.conda - sha256: 14d4b69ff9d789c23b18333d206c9cd1d6f21b13b4c3ebf7d7ea0f396743c1b9 - md5: 6835e52ecf2300915a80a146b238e45b +- conda: https://conda.anaconda.org/conda-forge/win-64/libnvfatbin-13.3.29-hac47afa_0.conda + sha256: 665c371c11211fb767e9b04e921fd6aed4148072df189039f48d732d28bb9dce + md5: 3391d24d389bc2230da0b534e79c1d69 depends: - - cuda-version >=13.2,<13.3.0a0 + - cuda-version >=13.3,<13.4.0a0 - ucrt >=10.0.20348.0 - vc >=14.3,<15 - vc14_runtime >=14.44.35208 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 360391 - timestamp: 1773100234002 + size: 361081 + timestamp: 1779897659188 - conda: https://conda.anaconda.org/conda-forge/linux-64/libnvjitlink-12.9.86-hecca717_2.conda sha256: 3b1c851f4fc42d347ce1c1606bdd195343a47f121e0fceb7a1f1e5aa1d497da9 md5: 3461b0f2d5cbb7973d361f9e85241d98 @@ -6671,17 +8571,18 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 30515495 timestamp: 1760723776293 -- conda: https://conda.anaconda.org/conda-forge/linux-64/libnvjitlink-13.2.51-hecca717_0.conda - sha256: 2ca45a2c9e6cc307cea3c8a1bf27bceb745fa5e1150d7b768b63a781eeaee7a2 - md5: 20a82402e6851e5d4e0b13ee1083d370 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libnvjitlink-13.3.33-hecca717_0.conda + sha256: f5d0aed3cfb504239fac6e03e994f36c34725acba5382adc516cbfdd6993a959 + md5: 2795538ca415afd5d35aec7c6cd2e385 depends: - __glibc >=2.17,<3.0.a0 - - cuda-version >=13,<13.3.0a0 + - cuda-version >=13,<13.4.0a0 - libgcc >=14 - libstdcxx >=14 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 31691081 - timestamp: 1773100788615 + purls: [] + size: 31168008 + timestamp: 1779897778168 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnvjitlink-12.9.86-h8f3c8d4_2.conda sha256: d5ff36f46250069a23b18d557052c6656f40a002333885e8c5332071e873b48e md5: e318a6573fea150226d5f417d1c0807a @@ -6693,19 +8594,20 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 30323952 timestamp: 1760723774770 -- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnvjitlink-13.2.51-h8f3c8d4_0.conda - sha256: a10185e3b25306ff00446ea3ba5194fbec2c9811607385a76219ab33adac437a - md5: 211b6538aa60c70e38d0efe2955e70ec +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libnvjitlink-13.3.33-h8f3c8d4_0.conda + sha256: 4b1519898eceba923e11b5ae3588af886ce57a7ba3336ffd900320dfe156e457 + md5: cb19b7f9f8c0b6ee98e8a390b54c5a92 depends: - arm-variant * sbsa - - cuda-version >=13,<13.3.0a0 + - cuda-version >=13,<13.4.0a0 - libgcc >=14 - libstdcxx >=14 constrains: - arm-variant * sbsa license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 30101903 - timestamp: 1773100818361 + purls: [] + size: 29975854 + timestamp: 1779897817336 - conda: https://conda.anaconda.org/conda-forge/win-64/libnvjitlink-12.9.86-hac47afa_2.conda sha256: adf35938c9ecd77d27c87ef870f7710ee422933ad95d1aac136ff39e7af0551f md5: feaee6b1ab0e7ed9152dc88e1b0eeddd @@ -6717,17 +8619,18 @@ packages: license: LicenseRef-NVIDIA-End-User-License-Agreement size: 27343190 timestamp: 1760724535115 -- conda: https://conda.anaconda.org/conda-forge/win-64/libnvjitlink-13.2.51-hac47afa_0.conda - sha256: da00e26a253a69cfef7c70a5e22f6889005ccd4b34acb6e66a105d28aae762e3 - md5: 34c01855f4bba880d5cafa81326209a6 +- conda: https://conda.anaconda.org/conda-forge/win-64/libnvjitlink-13.3.33-hac47afa_0.conda + sha256: 90d9e0eec8aca30a7592d137c68f755bf743e1be43b38657751beadb06b443c2 + md5: a1067e24336c586bf64b47206c5bd8b5 depends: - - cuda-version >=13,<13.3.0a0 + - cuda-version >=13,<13.4.0a0 - ucrt >=10.0.20348.0 - vc >=14.3,<15 - vc14_runtime >=14.44.35208 license: LicenseRef-NVIDIA-End-User-License-Agreement - size: 28162828 - timestamp: 1773100888282 + purls: [] + size: 28928043 + timestamp: 1779897886674 - conda: https://conda.anaconda.org/conda-forge/linux-64/libogg-1.3.5-hd0c01bc_1.conda sha256: ffb066ddf2e76953f92e06677021c73c85536098f1c21fcd15360dbc859e22e4 md5: 68e52064ed3897463c0e958ab5c8f91b @@ -6775,6 +8678,21 @@ packages: license_family: BSD size: 5927939 timestamp: 1763114673331 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libopenblas-0.3.32-pthreads_h94d23a6_0.conda + sha256: 6dc30b28f32737a1c52dada10c8f3a41bc9e021854215efca04a7f00487d09d9 + md5: 89d61bc91d3f39fda0ca10fcd3c68594 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libgfortran + - libgfortran5 >=14.3.0 + constrains: + - openblas >=0.3.32,<0.3.33.0a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + size: 5928890 + timestamp: 1774471724897 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenblas-0.3.30-pthreads_h9d3fd7e_4.conda sha256: 794a7270ea049ec931537874cd8d2de0ef4b3cef71c055cfd8b4be6d2f4228b0 md5: 11d7d57b7bdd01da745bbf2b67020b2e @@ -6788,6 +8706,20 @@ packages: license_family: BSD size: 4959359 timestamp: 1763114173544 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libopenblas-0.3.32-pthreads_h9d3fd7e_0.conda + sha256: 51fcf5eb1fc43bfeca5bf3aa3f51546e92e5a92047ba47146dcea555142e30f8 + md5: 5d2ce5cf40443d055ec6d33840192265 + depends: + - libgcc >=14 + - libgfortran + - libgfortran5 >=14.3.0 + constrains: + - openblas >=0.3.32,<0.3.33.0a0 + license: BSD-3-Clause + license_family: BSD + purls: [] + size: 5122134 + timestamp: 1774471612323 - conda: https://conda.anaconda.org/conda-forge/linux-64/libopenvino-2025.2.0-hb617929_1.conda sha256: 235e7d474c90ad9d8955401b8a91dbe373aa1dc65db3c8232a5e22e4eaf41976 md5: 1da20cc4ff32dc74424dec68ec087dba @@ -7761,6 +9693,36 @@ packages: license_family: LGPL size: 406978 timestamp: 1765181892661 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libsodium-1.0.21-h280c20c_3.conda + sha256: 64e5c80cbce4680a2d25179949739a6def695d72c40ca28f010711764e372d97 + md5: 7af961ef4aa2c1136e11dd43ded245ab + depends: + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + license: ISC + purls: [] + size: 277661 + timestamp: 1772479381288 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsodium-1.0.21-h80f16a2_3.conda + sha256: d6112f3a7e7ffcd726ce653724f979b528cb8a19675fc06016a5d360ef94e9a4 + md5: 9e1fe4202543fa5b6ab58dbf12d34ced + depends: + - libgcc >=14 + license: ISC + purls: [] + size: 272649 + timestamp: 1772479384085 +- conda: https://conda.anaconda.org/conda-forge/win-64/libsodium-1.0.21-h6a83c73_3.conda + sha256: d915f4fa8ebbf237c7a6e511ed458f2cfdc7c76843a924740318a15d0dd33d6d + md5: da2aa614d16a795b3007b6f4a1318a81 + depends: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + license: ISC + purls: [] + size: 276860 + timestamp: 1772479407566 - conda: https://conda.anaconda.org/conda-forge/linux-64/libsqlite-3.51.1-h0c1763c_0.conda sha256: 6f0e8a812e8e33a4d8b7a0e595efe28373080d27b78ee4828aa4f6649a088454 md5: 2e1b84d273b01835256e53fd938de355 @@ -7791,6 +9753,7 @@ packages: - libgcc >=14 - libzlib >=1.3.1,<2.0a0 license: blessing + purls: [] size: 951405 timestamp: 1772818874251 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsqlite-3.51.1-h022381a_0.conda @@ -7820,6 +9783,7 @@ packages: - libgcc >=14 - libzlib >=1.3.1,<2.0a0 license: blessing + purls: [] size: 952296 timestamp: 1772818881550 - conda: https://conda.anaconda.org/conda-forge/win-64/libsqlite-3.51.1-hf5d6505_0.conda @@ -7850,6 +9814,7 @@ packages: - vc >=14.3,<15 - vc14_runtime >=14.44.35208 license: blessing + purls: [] size: 1297302 timestamp: 1772818899033 - conda: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-15.2.0-h934c35e_15.conda @@ -7885,6 +9850,7 @@ packages: - libstdcxx-ng ==15.2.0=*_18 license: GPL-3.0-only WITH GCC-exception-3.1 license_family: GPL + purls: [] size: 5852330 timestamp: 1771378262446 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libstdcxx-15.2.0-hef695bb_15.conda @@ -7917,6 +9883,7 @@ packages: - libstdcxx-ng ==15.2.0=*_18 license: GPL-3.0-only WITH GCC-exception-3.1 license_family: GPL + purls: [] size: 5541411 timestamp: 1771378162499 - conda: https://conda.anaconda.org/conda-forge/win-64/libstdcxx-15.2.0-hae5796f_16.conda @@ -8081,6 +10048,17 @@ packages: license: LGPL-2.1-or-later size: 491953 timestamp: 1770738638119 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libsystemd0-257.13-hd0affe5_0.conda + sha256: c5008b602cb5c819f7b52d418b3ed17e1818cbbf6705b189e7ab36bb70cce3d8 + md5: 8ee3cb7f64be0e8c4787f3a4dbe024e6 + depends: + - __glibc >=2.17,<3.0.a0 + - libcap >=2.77,<2.78.0a0 + - libgcc >=14 + license: LGPL-2.1-or-later + purls: [] + size: 492799 + timestamp: 1773797095649 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsystemd0-257.10-hf9559e3_2.conda sha256: 22e5bc2b72eb4a104927d34d06954573dbbdef1981fd7f73520f2ca82f0b7101 md5: e7a86e3cdea9c37bf12005778d490148 @@ -8108,6 +10086,16 @@ packages: license: LGPL-2.1-or-later size: 517911 timestamp: 1770738680829 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libsystemd0-257.13-hf9559e3_0.conda + sha256: b38e9777b3231dfda62f2d127aac8091d990b5c45814a2b9d2e382f42f73a895 + md5: ffd5411606e65767354fe153371cc63a + depends: + - libcap >=2.77,<2.78.0a0 + - libgcc >=14 + license: LGPL-2.1-or-later + purls: [] + size: 516600 + timestamp: 1773797150163 - conda: https://conda.anaconda.org/conda-forge/linux-64/libtiff-4.7.1-h9d88235_1.conda sha256: e5f8c38625aa6d567809733ae04bb71c161a42e44a9fa8227abe61fa5c60ebe0 md5: cd5a90476766d53e901500df9215e927 @@ -8187,9 +10175,20 @@ packages: license: LGPL-2.1-or-later size: 144654 timestamp: 1770738650966 -- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libudev1-257.10-hf9559e3_2.conda - sha256: dd1ec27fef9f74ebdd0211ad875ba037f924931c81be164e7ff756b5d86ffc72 - md5: 4fc935d5bebd8e6e070a861544a71a34 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libudev1-257.13-hd0affe5_0.conda + sha256: 1a1e367c04d66030aa93b4d33905f7f6fbb59cfc292e816fe3e9c1e8b3f4d1e2 + md5: 2c2270f93d6f9073cbf72d821dfc7d72 + depends: + - __glibc >=2.17,<3.0.a0 + - libcap >=2.77,<2.78.0a0 + - libgcc >=14 + license: LGPL-2.1-or-later + purls: [] + size: 145087 + timestamp: 1773797108513 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libudev1-257.10-hf9559e3_2.conda + sha256: dd1ec27fef9f74ebdd0211ad875ba037f924931c81be164e7ff756b5d86ffc72 + md5: 4fc935d5bebd8e6e070a861544a71a34 depends: - libcap >=2.77,<2.78.0a0 - libgcc >=14 @@ -8214,6 +10213,16 @@ packages: license: LGPL-2.1-or-later size: 157130 timestamp: 1770738690431 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libudev1-257.13-hf9559e3_0.conda + sha256: 4946526f7723cb0f5a4dc830381ea48f455f9aebd456655cac99df70cd0d9567 + md5: b3a73b94483260f38dcbb489ee20c6d9 + depends: + - libcap >=2.77,<2.78.0a0 + - libgcc >=14 + license: LGPL-2.1-or-later + purls: [] + size: 156357 + timestamp: 1773797159424 - conda: https://conda.anaconda.org/conda-forge/linux-64/libunwind-1.8.3-h65a8314_0.conda sha256: 71c8b9d5c72473752a0bb6e91b01dd209a03916cb71f36cc6a564e3a2a132d7a md5: e179a69edd30d75c0144d7a380b88f28 @@ -8349,6 +10358,17 @@ packages: license_family: BSD size: 40311 timestamp: 1766271528534 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libuuid-2.42-h5347b49_0.conda + sha256: bc1b08c92626c91500fd9f26f2c797f3eb153b627d53e9c13cd167f1e12b2829 + md5: 38ffe67b78c9d4de527be8315e5ada2c + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: BSD-3-Clause + license_family: BSD + purls: [] + size: 40297 + timestamp: 1775052476770 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libuuid-2.41.2-h1022ec0_1.conda sha256: 3113c857e36779d94cf9a18236a710ceca0e94230b3bfeba0d134f33ee8c9ecd md5: 15b2cc72b9b05bcb141810b1bada654f @@ -8366,6 +10386,16 @@ packages: license_family: BSD size: 43453 timestamp: 1766271546875 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libuuid-2.42-h1022ec0_0.conda + sha256: 7d427edf58c702c337bf62bc90f355b7fc374a65fd9f70ea7a490f13bb76b1b9 + md5: a0b5de740d01c390bdbb46d7503c9fab + depends: + - libgcc >=14 + license: BSD-3-Clause + license_family: BSD + purls: [] + size: 43567 + timestamp: 1775052485727 - conda: https://conda.anaconda.org/conda-forge/linux-64/libva-2.23.0-he1eb515_0.conda sha256: 255c7d00b54e26f19fad9340db080716bced1d8539606e2b8396c57abd40007c md5: 25813fe38b3e541fc40007592f12bae5 @@ -8608,6 +10638,7 @@ packages: - pthreads-win32 <0.0a0 - msys2-conda-epoch <0.0a0 license: MIT AND BSD-3-Clause-Clear + purls: [] size: 36621 timestamp: 1759768399557 - conda: https://conda.anaconda.org/conda-forge/linux-64/libxcb-1.17.0-h8a09558_0.conda @@ -8635,6 +10666,24 @@ packages: license_family: MIT size: 397493 timestamp: 1727280745441 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libxcrypt-4.4.36-hd590300_1.conda + sha256: 6ae68e0b86423ef188196fff6207ed0c8195dd84273cb5623b85aa08033a410c + md5: 5aa797f8787fe7a17d1b0821485b5adc + depends: + - libgcc-ng >=12 + license: LGPL-2.1-or-later + purls: [] + size: 100393 + timestamp: 1702724383534 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libxcrypt-4.4.36-h31becfc_1.conda + sha256: 6b46c397644091b8a26a3048636d10b989b1bf266d4be5e9474bf763f828f41f + md5: b4df5d7d4b63579d081fd3a4cf99740e + depends: + - libgcc-ng >=12 + license: LGPL-2.1-or-later + purls: [] + size: 114269 + timestamp: 1702724369203 - conda: https://conda.anaconda.org/conda-forge/linux-64/libxkbcommon-1.13.1-hca5e8e5_0.conda sha256: d2195b5fbcb0af1ff7b345efdf89290c279b8d1d74f325ae0ac98148c375863c md5: 2bca1fbb221d9c3c8e3a155784bbc2e9 @@ -8785,6 +10834,24 @@ packages: license_family: MIT size: 43042 timestamp: 1761016261024 +- conda: https://conda.anaconda.org/conda-forge/win-64/libxml2-2.15.2-h5d26750_0.conda + sha256: f905eb7046987c336122121759e7f09144729f6898f48cd06df2a945b86998d8 + md5: 1007e1bfe181a2aee214779ee7f13d30 + depends: + - libiconv >=1.18,<2.0a0 + - liblzma >=5.8.2,<6.0a0 + - libxml2-16 2.15.2 h692994f_0 + - libzlib >=1.3.1,<2.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + constrains: + - icu <0.0a0 + license: MIT + license_family: MIT + purls: [] + size: 43681 + timestamp: 1772704748950 - conda: https://conda.anaconda.org/conda-forge/win-64/libxml2-2.15.2-h779ef1b_0.conda sha256: 2131e25d4fb21be66d7ef685e1b2d66f04aa08e70b37322d557824389d0a4c2a md5: be3843e412c9f9d697958aa68c72d09d @@ -8945,6 +11012,24 @@ packages: license_family: MIT size: 520731 timestamp: 1772704723763 +- conda: https://conda.anaconda.org/conda-forge/win-64/libxml2-16-2.15.2-h692994f_0.conda + sha256: b8c71b3b609c7cfe17f3f2a47c75394d7b30acfb8b34ad7a049ea8757b4d33df + md5: e365238134188e42ed36ee996159d482 + depends: + - libiconv >=1.18,<2.0a0 + - liblzma >=5.8.2,<6.0a0 + - libzlib >=1.3.1,<2.0a0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + constrains: + - libxml2 2.15.2 + - icu <0.0a0 + license: MIT + license_family: MIT + purls: [] + size: 520078 + timestamp: 1772704728534 - conda: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.1-hb9d3cd8_2.conda sha256: d4bfe88d7cb447768e31650f06257995601f89076080e76df55e3112d4e47dc4 md5: edb0dca6bc32e4f4789199455a1dbeb8 @@ -8957,6 +11042,18 @@ packages: license_family: Other size: 60963 timestamp: 1727963148474 +- conda: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.2-h25fd6f3_2.conda + sha256: 55044c403570f0dc26e6364de4dc5368e5f3fc7ff103e867c487e2b5ab2bcda9 + md5: d87ff7921124eccd67248aa483c23fec + depends: + - __glibc >=2.17,<3.0.a0 + constrains: + - zlib 1.3.2 *_2 + license: Zlib + license_family: Other + purls: [] + size: 63629 + timestamp: 1774072609062 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libzlib-1.3.1-h86ecc28_2.conda sha256: 5a2c1eeef69342e88a98d1d95bff1603727ab1ff4ee0e421522acd8813439b84 md5: 08aad7cbe9f5a6b460d0976076b6ae64 @@ -8968,6 +11065,16 @@ packages: license_family: Other size: 66657 timestamp: 1727963199518 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/libzlib-1.3.2-hdc9db2a_2.conda + sha256: eb111e32e5a7313a5bf799c7fb2419051fa2fe7eff74769fac8d5a448b309f7f + md5: 502006882cf5461adced436e410046d1 + constrains: + - zlib 1.3.2 *_2 + license: Zlib + license_family: Other + purls: [] + size: 69833 + timestamp: 1774072605429 - conda: https://conda.anaconda.org/conda-forge/win-64/libzlib-1.3.1-h2466b09_2.conda sha256: ba945c6493449bed0e6e29883c4943817f7c79cbff52b83360f7b341277c6402 md5: 41fbfac52c601159df6c01f875de31b9 @@ -8981,6 +11088,20 @@ packages: license_family: Other size: 55476 timestamp: 1727963768015 +- conda: https://conda.anaconda.org/conda-forge/win-64/libzlib-1.3.2-hfd05255_2.conda + sha256: 88609816e0cc7452bac637aaf65783e5edf4fee8a9f8e22bdc3a75882c536061 + md5: dbabbd6234dea34040e631f87676292f + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + constrains: + - zlib 1.3.2 *_2 + license: Zlib + license_family: Other + purls: [] + size: 58347 + timestamp: 1774072851498 - conda: https://conda.anaconda.org/conda-forge/win-64/llvm-openmp-21.1.8-h4fa8253_0.conda sha256: 145c4370abe870f10987efa9fc15a8383f1dab09abbc9ad4ff15a55d45658f7b md5: 0d8b425ac862bcf17e4b28802c9351cb @@ -9009,6 +11130,21 @@ packages: license_family: APACHE size: 347404 timestamp: 1772025050288 +- conda: https://conda.anaconda.org/conda-forge/win-64/llvm-openmp-22.1.2-h4fa8253_0.conda + sha256: fa8bd542624507309cbdfc620bdfe546ed823d418e6ba878977d48da7a0f6212 + md5: 29407a30bd93dc8c11c03ca60249a340 + depends: + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + constrains: + - intel-openmp <0.0a0 + - openmp 22.1.2|22.1.2.* + license: Apache-2.0 WITH LLVM-exception + license_family: APACHE + purls: [] + size: 348400 + timestamp: 1774733045609 - conda: https://conda.anaconda.org/conda-forge/win-64/m2-conda-epoch-20250515-0_x86_64.conda build_number: 0 sha256: 51e9214548f177db9c3fe70424e3774c95bf19cd69e0e56e83abe2e393228ba1 @@ -9031,6 +11167,134 @@ packages: - ucrt size: 8421 timestamp: 1759768559974 +- conda: https://conda.anaconda.org/conda-forge/linux-64/make-4.4.1-hb9d3cd8_2.conda + sha256: d652c7bd4d3b6f82b0f6d063b0d8df6f54cc47531092d7ff008e780f3261bdda + md5: 33405d2a66b1411db9f7242c8b97c9e7 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + license: GPL-3.0-or-later + license_family: GPL + purls: [] + size: 513088 + timestamp: 1727801714848 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/make-4.4.1-h2a6d0cb_2.conda + sha256: d243aea768e6fa360b7eda598340f43d2a41c9fc169d9f97f505410be68815f8 + md5: 5983ffb12d09efc45c4a3b74cd890137 + depends: + - libgcc >=13 + license: GPL-3.0-or-later + license_family: GPL + purls: [] + size: 528318 + timestamp: 1727801707353 +- conda: https://conda.anaconda.org/conda-forge/win-64/make-4.4.1-h0e40799_2.conda + sha256: a810cdca3d5fa50d562cda23c0c1195b45ff5f9b0c41e0d4c8c2dd3c043ff4f2 + md5: 77ff648ad9fec660f261aa8ab0949f62 + depends: + - libgcc >=13 + - libwinpthread >=12.0.0.r4.gg4f2fc60ca + - ucrt >=10.0.20348.0 + license: GPL-3.0-or-later + license_family: GPL + purls: [] + size: 2176937 + timestamp: 1727802346950 +- conda: https://conda.anaconda.org/conda-forge/noarch/markdown-it-py-4.0.0-pyhd8ed1ab_0.conda + sha256: 7b1da4b5c40385791dbc3cc85ceea9fad5da680a27d5d3cb8bfaa185e304a89e + md5: 5b5203189eb668f042ac2b0826244964 + depends: + - mdurl >=0.1,<1 + - python >=3.10 + license: MIT + license_family: MIT + purls: + - pkg:pypi/markdown-it-py?source=hash-mapping + size: 64736 + timestamp: 1754951288511 +- conda: https://conda.anaconda.org/conda-forge/linux-64/markupsafe-3.0.3-py312h8a5da7c_1.conda + sha256: 5f3aad1f3a685ed0b591faad335957dbdb1b73abfd6fc731a0d42718e0653b33 + md5: 93a4752d42b12943a355b682ee43285b + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + constrains: + - jinja2 >=3.0.0 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/markupsafe?source=compressed-mapping + size: 26057 + timestamp: 1772445297924 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/markupsafe-3.0.3-py312hd077ced_1.conda + sha256: 5919bf53e9f74ee1c6ce35ce13a7cd92741d45385c2d0b3eae48b01c0f11f41a + md5: 1fecdd103b37427ba6041b9b03d657ea + depends: + - libgcc >=14 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + constrains: + - jinja2 >=3.0.0 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/markupsafe?source=hash-mapping + size: 26305 + timestamp: 1772446326927 +- conda: https://conda.anaconda.org/conda-forge/win-64/markupsafe-3.0.3-py312h05f76fc_1.conda + sha256: b744287a780211ac4595126ef96a44309c791f155d4724021ef99092bae4aace + md5: a73298d225c7852f97403ca105d10a13 + depends: + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + constrains: + - jinja2 >=3.0.0 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/markupsafe?source=compressed-mapping + size: 28510 + timestamp: 1772445175216 +- conda: https://conda.anaconda.org/conda-forge/noarch/matplotlib-inline-0.2.1-pyhd8ed1ab_0.conda + sha256: 9d690334de0cd1d22c51bc28420663f4277cfa60d34fa5cad1ce284a13f1d603 + md5: 00e120ce3e40bad7bfc78861ce3c4a25 + depends: + - python >=3.10 + - traitlets + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/matplotlib-inline?source=hash-mapping + size: 15175 + timestamp: 1761214578417 +- conda: https://conda.anaconda.org/conda-forge/noarch/mdit-py-plugins-0.5.0-pyhd8ed1ab_0.conda + sha256: 123cc004e2946879708cdb6a9eff24acbbb054990d6131bb94bca7a374ebebfc + md5: 1997a083ef0b4c9331f9191564be275e + depends: + - markdown-it-py >=2.0.0,<5.0.0 + - python >=3.10 + license: MIT + license_family: MIT + purls: + - pkg:pypi/mdit-py-plugins?source=hash-mapping + size: 43805 + timestamp: 1754946862113 +- conda: https://conda.anaconda.org/conda-forge/noarch/mdurl-0.1.2-pyhd8ed1ab_1.conda + sha256: 78c1bbe1723449c52b7a9df1af2ee5f005209f67e40b6e1d3c7619127c43b1c7 + md5: 592132998493b3ff25fd7479396e8351 + depends: + - python >=3.9 + license: MIT + license_family: MIT + purls: + - pkg:pypi/mdurl?source=hash-mapping + size: 14465 + timestamp: 1733255681319 - conda: https://conda.anaconda.org/conda-forge/noarch/mingw-w64-ucrt-x86_64-crt-git-12.0.0.r4.gg4f2fc60ca-hd8ed1ab_10.conda sha256: de3e42149b498c16bfb485b7729f4ca0fe392be576a2a10ff702d661799b1df3 md5: 44ffa6d68699ec9321f6d48d75bdc726 @@ -9100,6 +11364,32 @@ packages: license_family: Proprietary size: 100224829 timestamp: 1767634557029 +- conda: https://conda.anaconda.org/conda-forge/win-64/mkl-2025.3.1-hac47afa_11.conda + sha256: f2c2b2a3c2e7d08d78c10bef7c135a4262c80d1d48c85fb5902ca30d61d645f4 + md5: 3fd3009cef89c36e9898a6feeb0f5530 + depends: + - llvm-openmp >=22.1.1 + - tbb >=2022.3.0 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: LicenseRef-IntelSimplifiedSoftwareOct2022 + license_family: Proprietary + purls: [] + size: 99997309 + timestamp: 1774449747739 +- conda: https://conda.anaconda.org/conda-forge/noarch/more-itertools-11.0.1-pyhcf101f3_0.conda + sha256: af8f30fb9542f48167fedbe1ab14230bfb82245cd4338b70c30dd55729714472 + md5: 6fbedd565de86ec83bc96531ee3ab856 + depends: + - python >=3.10 + - python + license: MIT + license_family: MIT + purls: + - pkg:pypi/more-itertools?source=compressed-mapping + size: 71354 + timestamp: 1775153285920 - conda: https://conda.anaconda.org/conda-forge/linux-64/mpg123-1.32.9-hc50e24c_0.conda sha256: 39c4700fb3fbe403a77d8cc27352fa72ba744db487559d5d44bf8411bb4ea200 md5: c7f302fd11eeb0987a6a5e1f3aed6a21 @@ -9121,6 +11411,143 @@ packages: license_family: LGPL size: 558708 timestamp: 1730581372400 +- conda: https://conda.anaconda.org/conda-forge/linux-64/msgpack-python-1.1.2-py312hd9148b4_1.conda + sha256: 94068fd39d1a672f8799e3146a18ba4ef553f0fcccefddb3c07fbdabfd73667a + md5: 2e489969e38f0b428c39492619b5e6e5 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - libstdcxx >=14 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + license: Apache-2.0 + license_family: Apache + purls: + - pkg:pypi/msgpack?source=hash-mapping + size: 102525 + timestamp: 1762504116832 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/msgpack-python-1.1.2-py312h4f740d2_1.conda + sha256: 54d29951b12731bbcd01b914f101566fc00da060151e11c295b8eb698d219897 + md5: fa2dab79048dfea842cb4f6eac8301fb + depends: + - libgcc >=14 + - libstdcxx >=14 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + license: Apache-2.0 + license_family: Apache + purls: + - pkg:pypi/msgpack?source=hash-mapping + size: 99305 + timestamp: 1762504246142 +- conda: https://conda.anaconda.org/conda-forge/win-64/msgpack-python-1.1.2-py312hf90b1b7_1.conda + sha256: 0408cc0868e0963922c76940d618266df88518a7b58b5d28da8378911916b998 + md5: 3272249c8d0f9cb7693e189611b9943f + depends: + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: Apache-2.0 + license_family: Apache + purls: + - pkg:pypi/msgpack?source=hash-mapping + size: 87478 + timestamp: 1762504274037 +- conda: https://conda.anaconda.org/conda-forge/noarch/mypy_extensions-1.1.0-pyha770c72_0.conda + sha256: 6ed158e4e5dd8f6a10ad9e525631e35cee8557718f83de7a4e3966b1f772c4b1 + md5: e9c622e0d00fa24a6292279af3ab6d06 + depends: + - python >=3.9 + license: MIT + license_family: MIT + purls: + - pkg:pypi/mypy-extensions?source=hash-mapping + size: 11766 + timestamp: 1745776666688 +- conda: https://conda.anaconda.org/conda-forge/noarch/myst-nb-1.4.0-pyhcf101f3_0.conda + sha256: c81d0c8c74c3da66808f8da09d8e48f2af2d173d357d45239defaf466838edba + md5: da07c7b1588ad0a44118d28aeb31b6a6 + depends: + - importlib-metadata + - ipykernel + - ipython + - jupyter-cache >=0.5 + - myst-parser >=1.0.0 + - nbclient + - nbformat >=5.0 + - python >=3.10 + - pyyaml + - sphinx >=5 + - typing_extensions + - python + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/myst-nb?source=hash-mapping + size: 68766 + timestamp: 1772587444587 +- conda: https://conda.anaconda.org/conda-forge/noarch/myst-parser-5.0.0-pyhd8ed1ab_0.conda + sha256: f352d594d968acd31052c5f894ae70718be56481ffa9c304fdfcbe78ddf66eb1 + md5: a65e2c3c764766f0b28a3ac5052502a6 + depends: + - docutils >=0.20,<0.23 + - jinja2 + - markdown-it-py >=4.0.0,<4.1.0 + - mdit-py-plugins >=0.5,<0.6 + - python >=3.11 + - pyyaml + - sphinx >=8,<10 + license: MIT + license_family: MIT + purls: + - pkg:pypi/myst-parser?source=hash-mapping + size: 73535 + timestamp: 1768942892170 +- conda: https://conda.anaconda.org/conda-forge/noarch/natsort-8.4.0-pyhcf101f3_2.conda + sha256: aeb1548eb72e4f198e72f19d242fb695b35add2ac7b2c00e0d83687052867680 + md5: e941e85e273121222580723010bd4fa2 + depends: + - python >=3.9 + - python + license: MIT + license_family: MIT + purls: + - pkg:pypi/natsort?source=hash-mapping + size: 39262 + timestamp: 1770905275632 +- conda: https://conda.anaconda.org/conda-forge/noarch/nbclient-0.10.4-pyhd8ed1ab_0.conda + sha256: 1b66960ee06874ddceeebe375d5f17fb5f393d025a09e15b830ad0c4fffb585b + md5: 00f5b8dafa842e0c27c1cd7296aa4875 + depends: + - jupyter_client >=6.1.12 + - jupyter_core >=4.12,!=5.0.* + - nbformat >=5.1 + - python >=3.8 + - traitlets >=5.4 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/nbclient?source=compressed-mapping + size: 28473 + timestamp: 1766485646962 +- conda: https://conda.anaconda.org/conda-forge/noarch/nbformat-5.10.4-pyhd8ed1ab_1.conda + sha256: 7a5bd30a2e7ddd7b85031a5e2e14f290898098dc85bea5b3a5bf147c25122838 + md5: bbe1963f1e47f594070ffe87cdf612ea + depends: + - jsonschema >=2.6 + - jupyter_core >=4.12,!=5.0.* + - python >=3.9 + - python-fastjsonschema >=2.15 + - traitlets >=5.1 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/nbformat?source=hash-mapping + size: 100945 + timestamp: 1733402844974 - conda: https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.5-h2d0b736_3.conda sha256: 3fde293232fa3fca98635e1167de6b7c7fda83caf24b9d6c91ec9eefb4f4d586 md5: 47e340acb35de30501a76c7c799c41d7 @@ -9128,6 +11555,7 @@ packages: - __glibc >=2.17,<3.0.a0 - libgcc >=13 license: X11 AND BSD-3-Clause + purls: [] size: 891641 timestamp: 1738195959188 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/ncurses-6.5-ha32ae93_3.conda @@ -9136,8 +11564,20 @@ packages: depends: - libgcc >=13 license: X11 AND BSD-3-Clause + purls: [] size: 926034 timestamp: 1738196018799 +- conda: https://conda.anaconda.org/conda-forge/noarch/nest-asyncio-1.6.0-pyhd8ed1ab_1.conda + sha256: bb7b21d7fd0445ddc0631f64e66d91a179de4ba920b8381f29b9d006a42788c0 + md5: 598fd7d4d0de2455fb74f56063969a97 + depends: + - python >=3.9 + license: BSD-2-Clause + license_family: BSD + purls: + - pkg:pypi/nest-asyncio?source=hash-mapping + size: 11543 + timestamp: 1733325673691 - conda: https://conda.anaconda.org/conda-forge/linux-64/numpy-2.3.5-py314h2b28147_0.conda sha256: 4fa3b8b80dd848a70f679b31d74d6fb28f9c4de9cd81086aa8e10256e9de20d1 md5: 6d2cff81447b8fe424645d7dd3bde8bf @@ -9193,6 +11633,26 @@ packages: license_family: BSD size: 8926994 timestamp: 1770098474394 +- conda: https://conda.anaconda.org/conda-forge/linux-64/numpy-2.4.3-py312h33ff503_0.conda + sha256: 1aab7ba963affa572956b1bd8d239df52a9c7bc799c560f98bc658ab70224e10 + md5: 5930ee8a175a242b4f001b1e9e72024f + depends: + - python + - libgcc >=14 + - libstdcxx >=14 + - __glibc >=2.17,<3.0.a0 + - liblapack >=3.9.0,<4.0a0 + - libblas >=3.9.0,<4.0a0 + - python_abi 3.12.* *_cp312 + - libcblas >=3.9.0,<4.0a0 + constrains: + - numpy-base <0a0 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/numpy?source=compressed-mapping + size: 8757569 + timestamp: 1773839284329 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/numpy-2.3.5-py314haac167e_0.conda sha256: e7015a79fb2d8d0573ae1b55db71792292285a86111ccf2683872db848734db8 md5: ea4652f80053fb52748bc10e0b401b2f @@ -9248,6 +11708,26 @@ packages: license_family: BSD size: 8006259 timestamp: 1770098510476 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/numpy-2.4.3-py312h6615c27_0.conda + sha256: 9e30d173e3a16714c009957aa69f2ec982b603585be6adabdedc51a213f8c308 + md5: c5b98ed4e80a53e18cd67f7cbbb2e091 + depends: + - python + - libstdcxx >=14 + - libgcc >=14 + - python 3.12.* *_cpython + - liblapack >=3.9.0,<4.0a0 + - libblas >=3.9.0,<4.0a0 + - libcblas >=3.9.0,<4.0a0 + - python_abi 3.12.* *_cp312 + constrains: + - numpy-base <0a0 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/numpy?source=compressed-mapping + size: 7841597 + timestamp: 1773839274579 - conda: https://conda.anaconda.org/conda-forge/win-64/numpy-2.3.5-py314h06c3c77_0.conda sha256: e64d4c049c9c69ef02d924ac1750b32e08f57732cbc6a3fe11794f3169b59d14 md5: ddc6687a8f402695bd22229aaf69fb26 @@ -9305,6 +11785,48 @@ packages: license_family: BSD size: 7309134 timestamp: 1770098414535 +- conda: https://conda.anaconda.org/conda-forge/win-64/numpy-2.4.3-py312ha3f287d_0.conda + sha256: f0b92b9f58406ce21c7d0f037e58cb62380daffb9232c7cb31ab5edc217527e6 + md5: 6169671e14dc7c36eebfd9870446f11c + depends: + - python + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - libcblas >=3.9.0,<4.0a0 + - liblapack >=3.9.0,<4.0a0 + - libblas >=3.9.0,<4.0a0 + - python_abi 3.12.* *_cp312 + constrains: + - numpy-base <0a0 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/numpy?source=compressed-mapping + size: 7166412 + timestamp: 1773839142889 +- conda: https://conda.anaconda.org/conda-forge/noarch/numpydoc-1.10.0-pyhcf101f3_0.conda + sha256: 482d94fce136c4352b18c6397b9faf0a3149bfb12499ab1ffebad8db0cb6678f + md5: 3aa4b625f20f55cf68e92df5e5bf3c39 + depends: + - python >=3.10 + - sphinx >=6 + - tomli >=1.1.0 + - python + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/numpydoc?source=hash-mapping + size: 65801 + timestamp: 1764715638266 +- pypi: https://files.pythonhosted.org/packages/8c/79/017fab2f7167a9a9795665f894d04f77aafceca80821b51589bb4b23ff5c/nvidia_sphinx_theme-0.0.9.post1-py3-none-any.whl + name: nvidia-sphinx-theme + version: 0.0.9.post1 + sha256: 21ca60206dff2f380d7783d64bbaf71a5b9cacae53c7d0686f089c16b5a3d45a + requires_dist: + - sphinx>=7.1 + - pydata-sphinx-theme>=0.15 + requires_python: '>=3.10' - conda: https://conda.anaconda.org/conda-forge/linux-64/ocl-icd-2.3.3-hb9d3cd8_0.conda sha256: 2254dae821b286fb57c61895f2b40e3571a070910fdab79a948ff703e1ea807b md5: 56f8947aa9d5cf37b0b3d43b83f34192 @@ -9379,6 +11901,7 @@ packages: - libgcc >=14 license: Apache-2.0 license_family: Apache + purls: [] size: 3164551 timestamp: 1769555830639 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/openssl-3.6.0-h8e36d6e_0.conda @@ -9399,6 +11922,7 @@ packages: - libgcc >=14 license: Apache-2.0 license_family: Apache + purls: [] size: 3692030 timestamp: 1769557678657 - conda: https://conda.anaconda.org/conda-forge/win-64/openssl-3.6.0-h725018a_0.conda @@ -9423,6 +11947,7 @@ packages: - vc14_runtime >=14.44.35208 license: Apache-2.0 license_family: Apache + purls: [] size: 9343023 timestamp: 1769557547888 - conda: https://conda.anaconda.org/conda-forge/noarch/packaging-25.0-pyh29332c3_1.conda @@ -9443,6 +11968,8 @@ packages: - python license: Apache-2.0 license_family: APACHE + purls: + - pkg:pypi/packaging?source=compressed-mapping size: 72010 timestamp: 1769093650580 - conda: https://conda.anaconda.org/conda-forge/linux-64/pango-1.56.4-hadf4263_0.conda @@ -9505,6 +12032,18 @@ packages: license: LGPL-2.1-or-later size: 454854 timestamp: 1751292618315 +- conda: https://conda.anaconda.org/conda-forge/noarch/parso-0.8.6-pyhcf101f3_0.conda + sha256: 42b2d77ccea60752f3aa929a6413a7835aaacdbbde679f2f5870a744fa836b94 + md5: 97c1ce2fffa1209e7afb432810ec6e12 + depends: + - python >=3.10 + - python + license: MIT + license_family: MIT + purls: + - pkg:pypi/parso?source=hash-mapping + size: 82287 + timestamp: 1770676243987 - conda: https://conda.anaconda.org/conda-forge/linux-64/pcre2-10.47-haa7fec5_0.conda sha256: 5e6f7d161356fefd981948bea5139c5aa0436767751a6930cb1ca801ebb113ff md5: 7a3bff861a6583f1889021facefc08b1 @@ -9541,6 +12080,30 @@ packages: license_family: BSD size: 995992 timestamp: 1763655708300 +- conda: https://conda.anaconda.org/conda-forge/noarch/pexpect-4.9.0-pyhd8ed1ab_1.conda + sha256: 202af1de83b585d36445dc1fda94266697341994d1a3328fabde4989e1b3d07a + md5: d0d408b1f18883a944376da5cf8101ea + depends: + - ptyprocess >=0.5 + - python >=3.9 + license: ISC + purls: + - pkg:pypi/pexpect?source=hash-mapping + size: 53561 + timestamp: 1733302019362 +- conda: https://conda.anaconda.org/conda-forge/noarch/pip-26.0.1-pyh8b19718_0.conda + sha256: 8e1497814a9997654ed7990a79c054ea5a42545679407acbc6f7e809c73c9120 + md5: 67bdec43082fd8a9cffb9484420b39a2 + depends: + - python >=3.10,<3.13.0a0 + - setuptools + - wheel + license: MIT + license_family: MIT + purls: + - pkg:pypi/pip?source=compressed-mapping + size: 1181790 + timestamp: 1770270305795 - conda: https://conda.anaconda.org/conda-forge/linux-64/pixman-0.46.4-h54a6638_1.conda sha256: 43d37bc9ca3b257c5dd7bf76a8426addbdec381f6786ff441dc90b1a49143b6a md5: c01af13bdc553d1a8fbfff6e8db075f0 @@ -9578,6 +12141,18 @@ packages: license_family: MIT size: 542795 timestamp: 1754665193489 +- conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.9.4-pyhcf101f3_0.conda + sha256: 0289f0a38337ee201d984f8f31f11f6ef076cfbbfd0ab9181d12d9d1d099bf46 + md5: 82c1787f2a65c0155ef9652466ee98d6 + depends: + - python >=3.10 + - python + license: MIT + license_family: MIT + purls: + - pkg:pypi/platformdirs?source=compressed-mapping + size: 25646 + timestamp: 1773199142345 - conda: https://conda.anaconda.org/conda-forge/noarch/pluggy-1.6.0-pyhf9edf01_1.conda sha256: e14aafa63efa0528ca99ba568eaf506eb55a0371d12e6250aaaa61718d2eb62e md5: d7585b6550ad04c8c5e21097ada2888e @@ -9586,8 +12161,67 @@ packages: - python license: MIT license_family: MIT + purls: + - pkg:pypi/pluggy?source=hash-mapping size: 25877 timestamp: 1764896838868 +- conda: https://conda.anaconda.org/conda-forge/noarch/prompt-toolkit-3.0.52-pyha770c72_0.conda + sha256: 4817651a276016f3838957bfdf963386438c70761e9faec7749d411635979bae + md5: edb16f14d920fb3faf17f5ce582942d6 + depends: + - python >=3.10 + - wcwidth + constrains: + - prompt_toolkit 3.0.52 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/prompt-toolkit?source=hash-mapping + size: 273927 + timestamp: 1756321848365 +- conda: https://conda.anaconda.org/conda-forge/linux-64/psutil-7.2.2-py312h5253ce2_0.conda + sha256: d834fd656133c9e4eaf63ffe9a117c7d0917d86d89f7d64073f4e3a0020bd8a7 + md5: dd94c506b119130aef5a9382aed648e7 + depends: + - python + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + - python_abi 3.12.* *_cp312 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/psutil?source=compressed-mapping + size: 225545 + timestamp: 1769678155334 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/psutil-7.2.2-py312hd41f8a7_0.conda + sha256: ea2f332dde5f428c506816d39063705c40767a350f54c22fde89b74aac878355 + md5: 4efa924b35ea429f3ded10ddae9d5fb3 + depends: + - python + - python 3.12.* *_cpython + - libgcc >=14 + - python_abi 3.12.* *_cp312 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/psutil?source=hash-mapping + size: 230283 + timestamp: 1769678159757 +- conda: https://conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py312he5662c2_0.conda + sha256: edffc84c001a05b996b5f8607c8164432754e86ec9224e831cd00ebabdec04e7 + md5: a2724c93b745fc7861948eb8b9f6679a + depends: + - python + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - python_abi 3.12.* *_cp312 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/psutil?source=hash-mapping + size: 242769 + timestamp: 1769678170631 - conda: https://conda.anaconda.org/conda-forge/linux-64/pthread-stubs-0.4-hb9d3cd8_1002.conda sha256: 9c88f8c64590e9567c6c80823f0328e58d3b1efb0e1c539c0315ceca764e0973 md5: b3c17d95b5a10c6e64a21fa17573e70e @@ -9607,6 +12241,16 @@ packages: license_family: MIT size: 8342 timestamp: 1726803319942 +- conda: https://conda.anaconda.org/conda-forge/noarch/ptyprocess-0.7.0-pyhd8ed1ab_1.conda + sha256: a7713dfe30faf17508ec359e0bc7e0983f5d94682492469bd462cdaae9c64d83 + md5: 7d9daffbb8d8e0af0f769dbbcd173a54 + depends: + - python >=3.9 + license: ISC + purls: + - pkg:pypi/ptyprocess?source=hash-mapping + size: 19457 + timestamp: 1733302371990 - conda: https://conda.anaconda.org/conda-forge/linux-64/pugixml-1.15-h3f63f65_0.conda sha256: 23c98a5000356e173568dc5c5770b53393879f946f3ace716bbdefac2a8b23d2 md5: b11a4c6bf6f6f44e5e143f759ffa2087 @@ -9663,6 +12307,17 @@ packages: license_family: LGPL size: 760306 timestamp: 1763148231117 +- conda: https://conda.anaconda.org/conda-forge/noarch/pure_eval-0.2.3-pyhd8ed1ab_1.conda + sha256: 71bd24600d14bb171a6321d523486f6a06f855e75e547fa0cb2a0953b02047f0 + md5: 3bfdfb8dbcdc4af1ae3f9a8eb3948f04 + depends: + - python >=3.9 + license: MIT + license_family: MIT + purls: + - pkg:pypi/pure-eval?source=hash-mapping + size: 16668 + timestamp: 1733569518868 - conda: https://conda.anaconda.org/conda-forge/noarch/py-cpuinfo-9.0.0-pyhd8ed1ab_1.conda sha256: 6d8f03c13d085a569fde931892cded813474acbef2e03381a1a87f420c7da035 md5: 46830ee16925d5ed250850503b5dc3a8 @@ -9672,6 +12327,37 @@ packages: license_family: MIT size: 25766 timestamp: 1733236452235 +- conda: https://conda.anaconda.org/conda-forge/noarch/pyclibrary-0.2.2-pyhd8ed1ab_1.conda + sha256: 210a7beee6dce5e57d4d4166b6fd93693ede3e213510efa7373103f10c18d057 + md5: 0cda5dbfd261b08292fcf16429662b0a + depends: + - pyparsing >=2.3.1,<4 + - python >=3.9 + license: MIT + license_family: MIT + purls: + - pkg:pypi/pyclibrary?source=hash-mapping + size: 437505 + timestamp: 1734953615203 +- conda: https://conda.anaconda.org/conda-forge/noarch/pydata-sphinx-theme-0.17.0-pyhcf101f3_0.conda + sha256: 03ae7063dd18f070cf28a441dd86ea476c20ff7fc174d8365a476a650a6ae20f + md5: c09bb5f9960ff1cd334c5573b5ad79c2 + depends: + - accessible-pygments + - babel + - beautifulsoup4 + - docutils !=0.17.0 + - pygments >=2.7 + - python >=3.10 + - sphinx >=7.0 + - typing_extensions + - python + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/pydata-sphinx-theme?source=hash-mapping + size: 1655347 + timestamp: 1775308781489 - conda: https://conda.anaconda.org/conda-forge/noarch/pyglet-2.1.11-pyhd8ed1ab_0.conda sha256: 471cc2e244e5ffdd909d4c46219d59b3ba1e7fe9bd7e99c6c64382d4939f63a3 md5: 1cf39bf57f0b038b12dffce5a4b27e14 @@ -9703,6 +12389,54 @@ packages: license_family: BSD size: 889287 timestamp: 1750615908735 +- conda: https://conda.anaconda.org/conda-forge/noarch/pygments-2.20.0-pyhd8ed1ab_0.conda + sha256: cf70b2f5ad9ae472b71235e5c8a736c9316df3705746de419b59d442e8348e86 + md5: 16c18772b340887160c79a6acc022db0 + depends: + - python >=3.10 + license: BSD-2-Clause + license_family: BSD + purls: + - pkg:pypi/pygments?source=compressed-mapping + size: 893031 + timestamp: 1774796815820 +- conda: https://conda.anaconda.org/conda-forge/noarch/pyparsing-3.3.2-pyhcf101f3_0.conda + sha256: 417fba4783e528ee732afa82999300859b065dc59927344b4859c64aae7182de + md5: 3687cc0b82a8b4c17e1f0eb7e47163d5 + depends: + - python >=3.10 + - python + license: MIT + license_family: MIT + purls: + - pkg:pypi/pyparsing?source=hash-mapping + size: 110893 + timestamp: 1769003998136 +- conda: https://conda.anaconda.org/conda-forge/noarch/pysocks-1.7.1-pyh09c184e_7.conda + sha256: d016e04b0e12063fbee4a2d5fbb9b39a8d191b5a0042f0b8459188aedeabb0ca + md5: e2fd202833c4a981ce8a65974fe4abd1 + depends: + - __win + - python >=3.9 + - win_inet_pton + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/pysocks?source=hash-mapping + size: 21784 + timestamp: 1733217448189 +- conda: https://conda.anaconda.org/conda-forge/noarch/pysocks-1.7.1-pyha55dd90_7.conda + sha256: ba3b032fa52709ce0d9fd388f63d330a026754587a2f461117cac9ab73d8d0d8 + md5: 461219d1a5bd61342293efa2c0c90eac + depends: + - __unix + - python >=3.9 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/pysocks?source=hash-mapping + size: 21085 + timestamp: 1733217331982 - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-9.0.2-pyhcf101f3_0.conda sha256: 9e749fb465a8bedf0184d8b8996992a38de351f7c64e967031944978de03a520 md5: 2b694bad8a50dc2f712f5368de866480 @@ -9720,6 +12454,8 @@ packages: - pytest-faulthandler >=2 license: MIT license_family: MIT + purls: + - pkg:pypi/pytest?source=hash-mapping size: 299581 timestamp: 1765062031645 - conda: https://conda.anaconda.org/conda-forge/noarch/pytest-benchmark-5.2.3-pyhd8ed1ab_0.conda @@ -9754,6 +12490,33 @@ packages: license_family: MOZILLA size: 10537 timestamp: 1744061283541 +- conda: https://conda.anaconda.org/conda-forge/linux-64/python-3.12.13-hd63d673_0_cpython.conda + sha256: a44655c1c3e1d43ed8704890a91e12afd68130414ea2c0872e154e5633a13d7e + md5: 7eccb41177e15cc672e1babe9056018e + depends: + - __glibc >=2.17,<3.0.a0 + - bzip2 >=1.0.8,<2.0a0 + - ld_impl_linux-64 >=2.36.1 + - libexpat >=2.7.4,<3.0a0 + - libffi >=3.5.2,<3.6.0a0 + - libgcc >=14 + - liblzma >=5.8.2,<6.0a0 + - libnsl >=2.0.1,<2.1.0a0 + - libsqlite >=3.51.2,<4.0a0 + - libuuid >=2.41.3,<3.0a0 + - libxcrypt >=4.4.36 + - libzlib >=1.3.1,<2.0a0 + - ncurses >=6.5,<7.0a0 + - openssl >=3.5.5,<4.0a0 + - readline >=8.3,<9.0a0 + - tk >=8.6.13,<8.7.0a0 + - tzdata + constrains: + - python_abi 3.12.* *_cp312 + license: Python-2.0 + purls: [] + size: 31608571 + timestamp: 1772730708989 - conda: https://conda.anaconda.org/conda-forge/linux-64/python-3.14.1-h32b2ec7_100_cp314.conda build_number: 100 sha256: 30d9c0997cec58298b4de04b44b4acc2bd16860ecbb8f6e623256c71820918ed @@ -9835,6 +12598,32 @@ packages: size: 36702440 timestamp: 1770675584356 python_site_packages_path: lib/python3.14/site-packages +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/python-3.12.13-h91f4b29_0_cpython.conda + sha256: 61933478813f5fd96c89a00dd964201b0266d71d2e3bc4dd5679354056e46948 + md5: 8aed8fdbbc03a5c9f455d20ce75a9dce + depends: + - bzip2 >=1.0.8,<2.0a0 + - ld_impl_linux-aarch64 >=2.36.1 + - libexpat >=2.7.4,<3.0a0 + - libffi >=3.5.2,<3.6.0a0 + - libgcc >=14 + - liblzma >=5.8.2,<6.0a0 + - libnsl >=2.0.1,<2.1.0a0 + - libsqlite >=3.51.2,<4.0a0 + - libuuid >=2.41.3,<3.0a0 + - libxcrypt >=4.4.36 + - libzlib >=1.3.1,<2.0a0 + - ncurses >=6.5,<7.0a0 + - openssl >=3.5.5,<4.0a0 + - readline >=8.3,<9.0a0 + - tk >=8.6.13,<8.7.0a0 + - tzdata + constrains: + - python_abi 3.12.* *_cp312 + license: Python-2.0 + purls: [] + size: 13757191 + timestamp: 1772728951853 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/python-3.14.1-hb06a95a_100_cp314.conda build_number: 100 sha256: 482bc557d2a5b13a854a2fb8abdcfcef527640720fabdccb9421fa109e4cb4b8 @@ -9913,6 +12702,28 @@ packages: size: 37305578 timestamp: 1770674395875 python_site_packages_path: lib/python3.14/site-packages +- conda: https://conda.anaconda.org/conda-forge/win-64/python-3.12.13-h0159041_0_cpython.conda + sha256: a02b446d8b7b167b61733a3de3be5de1342250403e72a63b18dac89e99e6180e + md5: 2956dff38eb9f8332ad4caeba941cfe7 + depends: + - bzip2 >=1.0.8,<2.0a0 + - libexpat >=2.7.4,<3.0a0 + - libffi >=3.5.2,<3.6.0a0 + - liblzma >=5.8.2,<6.0a0 + - libsqlite >=3.51.2,<4.0a0 + - libzlib >=1.3.1,<2.0a0 + - openssl >=3.5.5,<4.0a0 + - tk >=8.6.13,<8.7.0a0 + - tzdata + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + constrains: + - python_abi 3.12.* *_cp312 + license: Python-2.0 + purls: [] + size: 15840187 + timestamp: 1772728877265 - conda: https://conda.anaconda.org/conda-forge/win-64/python-3.14.1-h4b44e0e_100_cp314.conda build_number: 100 sha256: 21feeb6ee92abd17bf73e063dbcfe0b00ccb5e67f291379dee7183294413a01f @@ -9985,6 +12796,52 @@ packages: size: 18273230 timestamp: 1770675442998 python_site_packages_path: Lib/site-packages +- conda: https://conda.anaconda.org/conda-forge/noarch/python-dateutil-2.9.0.post0-pyhe01879c_2.conda + sha256: d6a17ece93bbd5139e02d2bd7dbfa80bee1a4261dced63f65f679121686bf664 + md5: 5b8d21249ff20967101ffa321cab24e8 + depends: + - python >=3.9 + - six >=1.5 + - python + license: Apache-2.0 + license_family: APACHE + purls: + - pkg:pypi/python-dateutil?source=hash-mapping + size: 233310 + timestamp: 1751104122689 +- conda: https://conda.anaconda.org/conda-forge/noarch/python-fastjsonschema-2.21.2-pyhe01879c_0.conda + sha256: df9aa74e9e28e8d1309274648aac08ec447a92512c33f61a8de0afa9ce32ebe8 + md5: 23029aae904a2ba587daba708208012f + depends: + - python >=3.9 + - python + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/fastjsonschema?source=hash-mapping + size: 244628 + timestamp: 1755304154927 +- conda: https://conda.anaconda.org/conda-forge/noarch/python-gil-3.12.13-hd8ed1ab_0.conda + sha256: 97327b9509ae3aae28d27217a5d7bd31aff0ab61a02041e9c6f98c11d8a53b29 + md5: 32780d6794b8056b78602103a04e90ef + depends: + - cpython 3.12.13.* + - python_abi * *_cp312 + license: Python-2.0 + purls: [] + size: 46449 + timestamp: 1772728979370 +- conda: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.12-8_cp312.conda + build_number: 8 + sha256: 80677180dd3c22deb7426ca89d6203f1c7f1f256f2d5a94dc210f6e758229809 + md5: c3efd25ac4d74b1584d2f7a57195ddf1 + constrains: + - python 3.12.* *_cpython + license: BSD-3-Clause + license_family: BSD + purls: [] + size: 6958 + timestamp: 1752805918820 - conda: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.14-8_cp314.conda build_number: 8 sha256: ad6d2e9ac39751cc0529dd1566a26751a0bf2542adb0c232533d32e176e21db5 @@ -9995,74 +12852,397 @@ packages: license_family: BSD size: 6989 timestamp: 1752805904792 +- conda: https://conda.anaconda.org/conda-forge/win-64/pywin32-311-py312h829343e_1.conda + sha256: a7505522048dad63940d06623f07eb357b9b65510a8d23ff32b99add05aac3a1 + md5: 64cbe4ecbebe185a2261d3f298a60cde + depends: + - python + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - python_abi 3.12.* *_cp312 + license: PSF-2.0 + license_family: PSF + purls: + - pkg:pypi/pywin32?source=hash-mapping + size: 6684490 + timestamp: 1756487136116 +- conda: https://conda.anaconda.org/conda-forge/linux-64/pyyaml-6.0.3-py312h8a5da7c_1.conda + sha256: cb142bfd92f6e55749365ddc244294fa7b64db6d08c45b018ff1c658907bfcbf + md5: 15878599a87992e44c059731771591cb + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + - yaml >=0.2.5,<0.3.0a0 + license: MIT + license_family: MIT + purls: + - pkg:pypi/pyyaml?source=hash-mapping + size: 198293 + timestamp: 1770223620706 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/pyyaml-6.0.3-py312ha4530ae_1.conda + sha256: 0ba02720b470150a8c6261a86ea4db01dcf121e16a3e3978a84e965d3fe9c39a + md5: 47018c13dbb26186b577fd8bd1823a44 + depends: + - libgcc >=14 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + - yaml >=0.2.5,<0.3.0a0 + license: MIT + license_family: MIT + purls: + - pkg:pypi/pyyaml?source=hash-mapping + size: 192182 + timestamp: 1770223431156 +- conda: https://conda.anaconda.org/conda-forge/win-64/pyyaml-6.0.3-py312h05f76fc_1.conda + sha256: 1cab6cbd6042b2a1d8ee4d6b4ec7f36637a41f57d2f5c5cf0c12b7c4ce6a62f6 + md5: 9f6ebef672522cb9d9a6257215ca5743 + depends: + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - yaml >=0.2.5,<0.3.0a0 + license: MIT + license_family: MIT + purls: + - pkg:pypi/pyyaml?source=hash-mapping + size: 179738 + timestamp: 1770223468771 +- conda: https://conda.anaconda.org/conda-forge/linux-64/pyzmq-27.1.0-py312hda471dd_2.conda + noarch: python + sha256: be66c1f85c3b48137200d62c12d918f4f8ad329423daef04fed292818efd3c28 + md5: 082985717303dab433c976986c674b35 + depends: + - python + - libgcc >=14 + - libstdcxx >=14 + - __glibc >=2.17,<3.0.a0 + - zeromq >=4.3.5,<4.4.0a0 + - _python_abi3_support 1.* + - cpython >=3.12 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/pyzmq?source=hash-mapping + size: 211567 + timestamp: 1771716961404 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/pyzmq-27.1.0-py312hdf0a211_2.conda + noarch: python + sha256: afdff66cb54e22d0d2c682731e08bb8f319dfd93f3cdcff4a4640cb5a8ae2460 + md5: 130d781798bb24a0b86290e65acd50d8 + depends: + - python + - libstdcxx >=14 + - libgcc >=14 + - zeromq >=4.3.5,<4.4.0a0 + - _python_abi3_support 1.* + - cpython >=3.12 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/pyzmq?source=hash-mapping + size: 212585 + timestamp: 1771716963309 +- conda: https://conda.anaconda.org/conda-forge/win-64/pyzmq-27.1.0-py312h343a6d4_2.conda + noarch: python + sha256: d84bcc19a945ca03d1fd794be3e9896ab6afc9f691d58d9c2da514abe584d4df + md5: eb1ec67a70b4d479f7dd76e6c8fe7575 + depends: + - python + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - zeromq >=4.3.5,<4.3.6.0a0 + - _python_abi3_support 1.* + - cpython >=3.12 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/pyzmq?source=hash-mapping + size: 183235 + timestamp: 1771716967192 - conda: https://conda.anaconda.org/conda-forge/linux-64/rdma-core-61.0-h192683f_0.conda sha256: 8e0b7962cf8bec9a016cd91a6c6dc1f9ebc8e7e316b1d572f7b9047d0de54717 md5: d487d93d170e332ab39803e05912a762 depends: - __glibc >=2.17,<3.0.a0 - libgcc >=14 - - libnl >=3.11.0,<4.0a0 + - libnl >=3.11.0,<4.0a0 + - libstdcxx >=14 + - libsystemd0 >=257.10 + - libudev1 >=257.10 + license: Linux-OpenIB + license_family: BSD + purls: [] + size: 1268666 + timestamp: 1769154883613 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/rdma-core-61.0-h1f0f388_0.conda + sha256: 1c69fab2e833080d48f24d5ac06ea6745c470a8ef779d526bd1edd846184da7e + md5: 58f1eb9b507e3e098091840c6f1f9c11 + depends: + - libgcc >=14 + - libnl >=3.11.0,<4.0a0 + - libstdcxx >=14 + - libsystemd0 >=257.10 + - libudev1 >=257.10 + license: Linux-OpenIB + license_family: BSD + purls: [] + size: 1341616 + timestamp: 1769154919140 +- conda: https://conda.anaconda.org/conda-forge/linux-64/readline-8.2-h8c095d6_2.conda + sha256: 2d6d0c026902561ed77cd646b5021aef2d4db22e57a5b0178dfc669231e06d2c + md5: 283b96675859b20a825f8fa30f311446 + depends: + - libgcc >=13 + - ncurses >=6.5,<7.0a0 + license: GPL-3.0-only + license_family: GPL + size: 282480 + timestamp: 1740379431762 +- conda: https://conda.anaconda.org/conda-forge/linux-64/readline-8.3-h853b02a_0.conda + sha256: 12ffde5a6f958e285aa22c191ca01bbd3d6e710aa852e00618fa6ddc59149002 + md5: d7d95fc8287ea7bf33e0e7116d2b95ec + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - ncurses >=6.5,<7.0a0 + license: GPL-3.0-only + license_family: GPL + purls: [] + size: 345073 + timestamp: 1765813471974 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/readline-8.2-h8382b9d_2.conda + sha256: 54bed3a3041befaa9f5acde4a37b1a02f44705b7796689574bcf9d7beaad2959 + md5: c0f08fc2737967edde1a272d4bf41ed9 + depends: + - libgcc >=13 + - ncurses >=6.5,<7.0a0 + license: GPL-3.0-only + license_family: GPL + size: 291806 + timestamp: 1740380591358 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/readline-8.3-hb682ff5_0.conda + sha256: fe695f9d215e9a2e3dd0ca7f56435ab4df24f5504b83865e3d295df36e88d216 + md5: 3d49cad61f829f4f0e0611547a9cda12 + depends: + - libgcc >=14 + - ncurses >=6.5,<7.0a0 + license: GPL-3.0-only + license_family: GPL + purls: [] + size: 357597 + timestamp: 1765815673644 +- conda: https://conda.anaconda.org/conda-forge/noarch/referencing-0.37.0-pyhcf101f3_0.conda + sha256: 0577eedfb347ff94d0f2fa6c052c502989b028216996b45c7f21236f25864414 + md5: 870293df500ca7e18bedefa5838a22ab + depends: + - attrs >=22.2.0 + - python >=3.10 + - rpds-py >=0.7.0 + - typing_extensions >=4.4.0 + - python + license: MIT + license_family: MIT + purls: + - pkg:pypi/referencing?source=hash-mapping + size: 51788 + timestamp: 1760379115194 +- conda: https://conda.anaconda.org/conda-forge/noarch/requests-2.33.1-pyhcf101f3_0.conda + sha256: c0249bc4bf4c0e8e06d0e7b4d117a5d593cc4ab2144d5006d6d47c83cb0af18e + md5: 10afbb4dbf06ff959ad25a92ccee6e59 + depends: + - python >=3.10 + - certifi >=2023.5.7 + - charset-normalizer >=2,<4 + - idna >=2.5,<4 + - urllib3 >=1.26,<3 + - python + constrains: + - chardet >=3.0.2,<6 + license: Apache-2.0 + license_family: APACHE + purls: + - pkg:pypi/requests?source=compressed-mapping + size: 63712 + timestamp: 1774894783063 +- conda: https://conda.anaconda.org/conda-forge/linux-64/rpds-py-0.30.0-py312h868fb18_0.conda + sha256: 62f46e85caaba30b459da7dfcf3e5488ca24fd11675c33ce4367163ab191a42c + md5: 3ffc5a3572db8751c2f15bacf6a0e937 + depends: + - python + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - python_abi 3.12.* *_cp312 + constrains: + - __glibc >=2.17 + license: MIT + license_family: MIT + purls: + - pkg:pypi/rpds-py?source=hash-mapping + size: 383750 + timestamp: 1764543174231 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/rpds-py-0.30.0-py312h75d7d99_0.conda + sha256: 51e7d33b71b30ac5ceab09cc35521eccdaf4e3897ca4c6eda1059fb82a91b285 + md5: 85212b0e327723285cc36efddd25e03d + depends: + - python + - libgcc >=14 + - python_abi 3.12.* *_cp312 + constrains: + - __glibc >=2.17 + license: MIT + license_family: MIT + purls: + - pkg:pypi/rpds-py?source=hash-mapping + size: 380599 + timestamp: 1764543504405 +- conda: https://conda.anaconda.org/conda-forge/win-64/rpds-py-0.30.0-py312hdabe01f_0.conda + sha256: faad05e6df2fc15e3ae06fdd71a36e17ff25364777aa4c40f2ec588740d64091 + md5: 2c51baeda0a355b0a5e7b6acb28cf02d + depends: + - python + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - python_abi 3.12.* *_cp312 + license: MIT + license_family: MIT + purls: + - pkg:pypi/rpds-py?source=hash-mapping + size: 243577 + timestamp: 1764543069837 +- conda: https://conda.anaconda.org/conda-forge/noarch/ruamel.yaml-0.19.1-pyhcf101f3_0.conda + sha256: b48bebe297a63ae60f52e50be328262e880702db4d9b4e86731473ada459c2a1 + md5: 06ad944772941d5dae1e0d09848d8e49 + depends: + - python >=3.10 + - ruamel.yaml.clib >=0.2.15 + - python + license: MIT + license_family: MIT + purls: + - pkg:pypi/ruamel-yaml?source=hash-mapping + size: 98448 + timestamp: 1767538149184 +- conda: https://conda.anaconda.org/conda-forge/linux-64/ruamel.yaml.clib-0.2.15-py312h5253ce2_1.conda + sha256: dc520329bdfd356e2f464393f8ad9b8450fd5a269699907b2b8d629300c2c068 + md5: 84aa470567e2211a2f8e5c8491cdd78c + depends: + - python + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - python_abi 3.12.* *_cp312 + license: MIT + license_family: MIT + purls: + - pkg:pypi/ruamel-yaml-clib?source=hash-mapping + size: 148221 + timestamp: 1766159515069 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/ruamel.yaml.clib-0.2.15-py312hd41f8a7_1.conda + sha256: 0183f9c738abe70a9e292342877932eefc6a60dcfad7c58d6b0df77236052e17 + md5: 1c284baa9b7c47ccca48d776c7c93893 + depends: + - python + - libgcc >=14 + - python 3.12.* *_cpython + - python_abi 3.12.* *_cp312 + license: MIT + license_family: MIT + purls: + - pkg:pypi/ruamel-yaml-clib?source=hash-mapping + size: 147242 + timestamp: 1766159546485 +- conda: https://conda.anaconda.org/conda-forge/win-64/ruamel.yaml.clib-0.2.15-py312he5662c2_1.conda + sha256: a28bd33ef3380c44632d6ead75a6ec170e135f18941f4b1d77f1cc1b24c1dc02 + md5: cc0977464335ea5c2e5ee3d00458e0c2 + depends: + - python + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - python_abi 3.12.* *_cp312 + license: MIT + license_family: MIT + purls: + - pkg:pypi/ruamel-yaml-clib?source=hash-mapping + size: 105961 + timestamp: 1766159551536 +- conda: https://conda.anaconda.org/conda-forge/linux-64/scipy-1.17.1-py312h54fa4ab_0.conda + sha256: e3ad577361d67f6c078a6a7a3898bf0617b937d44dc4ccd57aa3336f2b5778dd + md5: 3e38daeb1fb05a95656ff5af089d2e4c + depends: + - __glibc >=2.17,<3.0.a0 + - libblas >=3.9.0,<4.0a0 + - libcblas >=3.9.0,<4.0a0 + - libgcc >=14 + - libgfortran + - libgfortran5 >=14.3.0 + - liblapack >=3.9.0,<4.0a0 - libstdcxx >=14 - - libsystemd0 >=257.10 - - libudev1 >=257.10 - license: Linux-OpenIB + - numpy <2.7 + - numpy >=1.23,<3 + - numpy >=1.25.2 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + license: BSD-3-Clause license_family: BSD - size: 1268666 - timestamp: 1769154883613 -- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/rdma-core-61.0-h1f0f388_0.conda - sha256: 1c69fab2e833080d48f24d5ac06ea6745c470a8ef779d526bd1edd846184da7e - md5: 58f1eb9b507e3e098091840c6f1f9c11 + purls: + - pkg:pypi/scipy?source=compressed-mapping + size: 17109648 + timestamp: 1771880675810 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/scipy-1.17.1-py312he5b0e10_0.conda + sha256: 24e608c0c94865f40df5201175b921068a297663bcc56e538970003ddf964b59 + md5: bc10849473fe9b8c95f1a07a396baf26 depends: + - libblas >=3.9.0,<4.0a0 + - libcblas >=3.9.0,<4.0a0 - libgcc >=14 - - libnl >=3.11.0,<4.0a0 + - libgfortran + - libgfortran5 >=14.3.0 + - liblapack >=3.9.0,<4.0a0 - libstdcxx >=14 - - libsystemd0 >=257.10 - - libudev1 >=257.10 - license: Linux-OpenIB + - numpy <2.7 + - numpy >=1.23,<3 + - numpy >=1.25.2 + - python >=3.12,<3.13.0a0 + - python >=3.12,<3.13.0a0 *_cpython + - python_abi 3.12.* *_cp312 + license: BSD-3-Clause license_family: BSD - size: 1341616 - timestamp: 1769154919140 -- conda: https://conda.anaconda.org/conda-forge/linux-64/readline-8.2-h8c095d6_2.conda - sha256: 2d6d0c026902561ed77cd646b5021aef2d4db22e57a5b0178dfc669231e06d2c - md5: 283b96675859b20a825f8fa30f311446 - depends: - - libgcc >=13 - - ncurses >=6.5,<7.0a0 - license: GPL-3.0-only - license_family: GPL - size: 282480 - timestamp: 1740379431762 -- conda: https://conda.anaconda.org/conda-forge/linux-64/readline-8.3-h853b02a_0.conda - sha256: 12ffde5a6f958e285aa22c191ca01bbd3d6e710aa852e00618fa6ddc59149002 - md5: d7d95fc8287ea7bf33e0e7116d2b95ec - depends: - - __glibc >=2.17,<3.0.a0 - - libgcc >=14 - - ncurses >=6.5,<7.0a0 - license: GPL-3.0-only - license_family: GPL - size: 345073 - timestamp: 1765813471974 -- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/readline-8.2-h8382b9d_2.conda - sha256: 54bed3a3041befaa9f5acde4a37b1a02f44705b7796689574bcf9d7beaad2959 - md5: c0f08fc2737967edde1a272d4bf41ed9 - depends: - - libgcc >=13 - - ncurses >=6.5,<7.0a0 - license: GPL-3.0-only - license_family: GPL - size: 291806 - timestamp: 1740380591358 -- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/readline-8.3-hb682ff5_0.conda - sha256: fe695f9d215e9a2e3dd0ca7f56435ab4df24f5504b83865e3d295df36e88d216 - md5: 3d49cad61f829f4f0e0611547a9cda12 + purls: + - pkg:pypi/scipy?source=hash-mapping + size: 16675045 + timestamp: 1771881005471 +- conda: https://conda.anaconda.org/conda-forge/win-64/scipy-1.17.1-py312h9b3c559_0.conda + sha256: bdb2437aa5db3a00c5e69808f9d1a695bbe74b4758ffdf2e79777c8e11680443 + md5: bf4d70d225c530053128bae8d2531516 depends: - - libgcc >=14 - - ncurses >=6.5,<7.0a0 - license: GPL-3.0-only - license_family: GPL - size: 357597 - timestamp: 1765815673644 + - libblas >=3.9.0,<4.0a0 + - libcblas >=3.9.0,<4.0a0 + - liblapack >=3.9.0,<4.0a0 + - numpy <2.7 + - numpy >=1.23,<3 + - numpy >=1.25.2 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/scipy?source=hash-mapping + size: 15009886 + timestamp: 1771881635432 - conda: https://conda.anaconda.org/conda-forge/linux-64/sdl2-2.32.56-h54a6638_0.conda sha256: 987ad072939fdd51c92ea8d3544b286bb240aefda329f9b03a51d9b7e777f9de md5: cdd138897d94dc07d99afe7113a07bec @@ -10315,6 +13495,8 @@ packages: - python >=3.10 license: MIT license_family: MIT + purls: + - pkg:pypi/setuptools?source=hash-mapping size: 639697 timestamp: 1773074868565 - conda: https://conda.anaconda.org/conda-forge/linux-64/shaderc-2025.5-h3e344bc_0.conda @@ -10393,6 +13575,18 @@ packages: license_family: Apache size: 1516952 timestamp: 1764288127996 +- conda: https://conda.anaconda.org/conda-forge/noarch/six-1.17.0-pyhe01879c_1.conda + sha256: 458227f759d5e3fcec5d9b7acce54e10c9e1f4f4b7ec978f3bfd54ce4ee9853d + md5: 3339e3b65d58accf4ca4fb8748ab16b3 + depends: + - python >=3.9 + - python + license: MIT + license_family: MIT + purls: + - pkg:pypi/six?source=hash-mapping + size: 18455 + timestamp: 1753199211006 - conda: https://conda.anaconda.org/conda-forge/linux-64/snappy-1.2.2-h03e3b7b_1.conda sha256: 48f3f6a76c34b2cfe80de9ce7f2283ecb55d5ed47367ba91e8bb8104e12b8f11 md5: 98b6c9dc80eb87b2519b97bcf7e578dd @@ -10416,6 +13610,220 @@ packages: license_family: BSD size: 47096 timestamp: 1762948094646 +- conda: https://conda.anaconda.org/conda-forge/noarch/snowballstemmer-3.0.1-pyhd8ed1ab_0.conda + sha256: 17007a4cfbc564dc3e7310dcbe4932c6ecb21593d4fec3c68610720f19e73fb2 + md5: 755cf22df8693aa0d1aec1c123fa5863 + depends: + - python >=3.9 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/snowballstemmer?source=hash-mapping + size: 73009 + timestamp: 1747749529809 +- conda: https://conda.anaconda.org/conda-forge/noarch/soupsieve-2.8.3-pyhd8ed1ab_0.conda + sha256: 23b71ecf089967d2900126920e7f9ff18cdcef82dbff3e2f54ffa360243a17ac + md5: 18de09b20462742fe093ba39185d9bac + depends: + - python >=3.10 + license: MIT + license_family: MIT + purls: + - pkg:pypi/soupsieve?source=hash-mapping + size: 38187 + timestamp: 1769034509657 +- conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-8.1.3-pyhd8ed1ab_1.conda + sha256: 3228eb332ce159f031d4b7d2e08117df973b0ba3ddcb8f5dbb7f429f71d27ea1 + md5: 1a3281a0dc355c02b5506d87db2d78ac + depends: + - alabaster >=0.7.14 + - babel >=2.13 + - colorama >=0.4.6 + - docutils >=0.20,<0.22 + - imagesize >=1.3 + - jinja2 >=3.1 + - packaging >=23.0 + - pygments >=2.17 + - python >=3.10 + - requests >=2.30.0 + - snowballstemmer >=2.2 + - sphinxcontrib-applehelp >=1.0.7 + - sphinxcontrib-devhelp >=1.0.6 + - sphinxcontrib-htmlhelp >=2.0.6 + - sphinxcontrib-jsmath >=1.0.1 + - sphinxcontrib-qthelp >=1.0.6 + - sphinxcontrib-serializinghtml >=1.1.9 + - tomli >=2.0 + license: BSD-2-Clause + license_family: BSD + purls: + - pkg:pypi/sphinx?source=hash-mapping + size: 1387076 + timestamp: 1733754175386 +- conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-autodoc-typehints-3.0.1-pyhd8ed1ab_0.conda + sha256: 0f93bb75a41918433abc8d8d80ef99d7fd8658d5ba34da3c5d8f707cb6bb3f46 + md5: 6ad405d62c8de3792608a27b7e085e15 + depends: + - python >=3.10 + - sphinx >=8.1.3 + license: MIT + license_family: MIT + purls: + - pkg:pypi/sphinx-autodoc-typehints?source=hash-mapping + size: 24055 + timestamp: 1737099757820 +- conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-copybutton-0.5.2-pyhd8ed1ab_1.conda + sha256: 8cd892e49cb4d00501bc4439fb0c73ca44905f01a65b2b7fa05ba0e8f3924f19 + md5: bf22cb9c439572760316ce0748af3713 + depends: + - python >=3.9 + - sphinx >=1.8 + license: MIT + license_family: MIT + purls: + - pkg:pypi/sphinx-copybutton?source=hash-mapping + size: 17893 + timestamp: 1734573117732 +- conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-jinja2-compat-0.4.1-pyhd8ed1ab_0.conda + sha256: 115f4306ace812d90b4ffab5ac27cc01c2fac13df67c5dcc37931130c8ebea13 + md5: 7ecc82915cd2c4654fa26ddc4d3650f7 + depends: + - jinja2 >=2.10 + - markupsafe >=1 + - python >=3.9 + license: MIT + license_family: MIT + purls: + - pkg:pypi/sphinx-jinja2-compat?source=hash-mapping + size: 12320 + timestamp: 1754550385132 +- conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-prompt-1.10.1-pyhd8ed1ab_0.conda + sha256: 3d2e0d961b38f66ea3e7decd04917bf69104b6683dae778e4d3ef5291c04b861 + md5: bfc047865de18ef2657bd8a95d7b8b49 + depends: + - pygments + - python >=3.11 + - sphinx + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/sphinx-prompt?source=hash-mapping + size: 12214 + timestamp: 1758128174284 +- conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-tabs-3.4.1-pyhd8ed1ab_1.conda + sha256: 43c343edc9ea11ffd947d97fa60bf6347a404700e2cde81fb954e60b7e6a42c1 + md5: 8b8362d876396fd967cbb5f404def907 + depends: + - docutils >=0.18.0 + - pygments + - python >=3.6 + - sphinx >=2 + license: MIT + license_family: MIT + purls: + - pkg:pypi/sphinx-tabs?source=hash-mapping + size: 15026 + timestamp: 1675342588275 +- conda: https://conda.anaconda.org/conda-forge/noarch/sphinx-toolbox-4.1.2-pyhd8ed1ab_0.conda + sha256: 63d5b2d672499191d26f3ad2ed57a39c5fc691086a28fd41caec4689b6fa901a + md5: 8f0cb58909ab8ef6d76f03dac2a4a6d0 + depends: + - apeye >=0.4.0 + - autodocsumm >=0.2.0 + - beautifulsoup4 >=4.9.1 + - cachecontrol >=0.13.0 + - dict2css >=0.2.3 + - docutils >=0.16 + - domdf-python-tools >=2.9.0 + - filelock >=3.8.0 + - html5lib >=1.1 + - python >=3.10 + - ruamel.yaml >=0.16.12 + - sphinx >=3.2.0 + - sphinx-autodoc-typehints >=1.11.1 + - sphinx-jinja2-compat >=0.1.0 + - sphinx-prompt >=1.1.0 + - sphinx-tabs <3.5.0,>=1.2.1 + - tabulate >=0.8.7 + - typing-extensions !=3.10.0.1,>=3.7.4.3 + - typing_inspect >=0.6.0 + license: MIT + license_family: MIT + purls: + - pkg:pypi/sphinx-toolbox?source=hash-mapping + size: 98891 + timestamp: 1768566379359 +- conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-applehelp-2.0.0-pyhd8ed1ab_1.conda + sha256: d7433a344a9ad32a680b881c81b0034bc61618d12c39dd6e3309abeffa9577ba + md5: 16e3f039c0aa6446513e94ab18a8784b + depends: + - python >=3.9 + - sphinx >=5 + license: BSD-2-Clause + license_family: BSD + purls: + - pkg:pypi/sphinxcontrib-applehelp?source=hash-mapping + size: 29752 + timestamp: 1733754216334 +- conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-devhelp-2.0.0-pyhd8ed1ab_1.conda + sha256: 55d5076005d20b84b20bee7844e686b7e60eb9f683af04492e598a622b12d53d + md5: 910f28a05c178feba832f842155cbfff + depends: + - python >=3.9 + - sphinx >=5 + license: BSD-2-Clause + license_family: BSD + purls: + - pkg:pypi/sphinxcontrib-devhelp?source=hash-mapping + size: 24536 + timestamp: 1733754232002 +- conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-htmlhelp-2.1.0-pyhd8ed1ab_1.conda + sha256: c1492c0262ccf16694bdcd3bb62aa4627878ea8782d5cd3876614ffeb62b3996 + md5: e9fb3fe8a5b758b4aff187d434f94f03 + depends: + - python >=3.9 + - sphinx >=5 + license: BSD-2-Clause + license_family: BSD + purls: + - pkg:pypi/sphinxcontrib-htmlhelp?source=hash-mapping + size: 32895 + timestamp: 1733754385092 +- conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-jsmath-1.0.1-pyhd8ed1ab_1.conda + sha256: 578bef5ec630e5b2b8810d898bbbf79b9ae66d49b7938bcc3efc364e679f2a62 + md5: fa839b5ff59e192f411ccc7dae6588bb + depends: + - python >=3.9 + license: BSD-2-Clause + license_family: BSD + purls: + - pkg:pypi/sphinxcontrib-jsmath?source=hash-mapping + size: 10462 + timestamp: 1733753857224 +- conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-qthelp-2.0.0-pyhd8ed1ab_1.conda + sha256: c664fefae4acdb5fae973bdde25836faf451f41d04342b64a358f9a7753c92ca + md5: 00534ebcc0375929b45c3039b5ba7636 + depends: + - python >=3.9 + - sphinx >=5 + license: BSD-2-Clause + license_family: BSD + purls: + - pkg:pypi/sphinxcontrib-qthelp?source=hash-mapping + size: 26959 + timestamp: 1733753505008 +- conda: https://conda.anaconda.org/conda-forge/noarch/sphinxcontrib-serializinghtml-1.1.10-pyhd8ed1ab_1.conda + sha256: 64d89ecc0264347486971a94487cb8d7c65bfc0176750cf7502b8a272f4ab557 + md5: 3bc61f7161d28137797e038263c04c54 + depends: + - python >=3.9 + - sphinx >=5 + license: BSD-2-Clause + license_family: BSD + purls: + - pkg:pypi/sphinxcontrib-serializinghtml?source=hash-mapping + size: 28669 + timestamp: 1733750596111 - conda: https://conda.anaconda.org/conda-forge/linux-64/spirv-tools-2025.4-hb700be7_0.conda sha256: aa0f0fc41646ef5a825d5725a2d06659df1c1084f15155936319e1909ac9cd16 md5: aace50912e0f7361d0d223e7f7cfa6e5 @@ -10492,6 +13900,68 @@ packages: license_family: APACHE size: 13881533 timestamp: 1770089875437 +- conda: https://conda.anaconda.org/conda-forge/linux-64/sqlalchemy-2.0.49-py312h5253ce2_0.conda + sha256: ab3445a03e1fe99093cac00a4f923c25e1f438cc7f7b64d254b7e4f06e52693e + md5: 0662f9f9ffb7ae91f2c095c77f18b9a5 + depends: + - python + - greenlet !=0.4.17 + - typing-extensions >=4.6.0 + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + - python_abi 3.12.* *_cp312 + license: MIT + license_family: MIT + purls: + - pkg:pypi/sqlalchemy?source=compressed-mapping + size: 3707065 + timestamp: 1775241332871 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/sqlalchemy-2.0.49-py312h2fc9c67_0.conda + sha256: ded6744a827bef2644547ebb30453dfb367e76b9b38d70be5934cee586aad5a0 + md5: a4bfb5442cfc73af95ff3b61ee5a880d + depends: + - python + - greenlet !=0.4.17 + - typing-extensions >=4.6.0 + - libgcc >=14 + - python_abi 3.12.* *_cp312 + license: MIT + license_family: MIT + purls: + - pkg:pypi/sqlalchemy?source=compressed-mapping + size: 3711633 + timestamp: 1775241583240 +- conda: https://conda.anaconda.org/conda-forge/win-64/sqlalchemy-2.0.49-py312he5662c2_0.conda + sha256: ee7289c97b4892fac2752d71fc773603210bf3b671c886499c7dbacad9b4c08a + md5: d42e4d5316b68fc70bdf09e5fccf3eb0 + depends: + - python + - greenlet !=0.4.17 + - typing-extensions >=4.6.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - python_abi 3.12.* *_cp312 + license: MIT + license_family: MIT + purls: + - pkg:pypi/sqlalchemy?source=compressed-mapping + size: 3665426 + timestamp: 1775241406935 +- conda: https://conda.anaconda.org/conda-forge/noarch/stack_data-0.6.3-pyhd8ed1ab_1.conda + sha256: 570da295d421661af487f1595045760526964f41471021056e993e73089e9c41 + md5: b1b505328da7a6b246787df4b5a49fbc + depends: + - asttokens + - executing + - pure_eval + - python >=3.9 + license: MIT + license_family: MIT + purls: + - pkg:pypi/stack-data?source=hash-mapping + size: 26988 + timestamp: 1733569565672 - conda: https://conda.anaconda.org/conda-forge/linux-64/svt-av1-3.1.2-hecca717_0.conda sha256: 34e2e9c505cd25dba0a9311eb332381b15147cf599d972322a7c197aedfc8ce2 md5: 9859766c658e78fec9afa4a54891d920 @@ -10578,6 +14048,18 @@ packages: license_family: GPL size: 23644746 timestamp: 1765578629426 +- conda: https://conda.anaconda.org/conda-forge/noarch/tabulate-0.10.0-pyhcf101f3_0.conda + sha256: 3f661e98a09f976775a494488beb3d35ebb00f535b169c6bd891f2e280d55783 + md5: 3b887b7b3468b0f494b4fad40178b043 + depends: + - python >=3.10 + - python + license: MIT + license_family: MIT + purls: + - pkg:pypi/tabulate?source=compressed-mapping + size: 43964 + timestamp: 1772732795746 - conda: https://conda.anaconda.org/conda-forge/linux-64/tbb-2022.3.0-h8d10470_1.conda sha256: 2e3238234ae094d5a5f7c559410ea8875351b6bac0d9d0e576bf64b732b8029e md5: e3259be3341da4bc06c5b7a78c8bf1bd @@ -10634,6 +14116,7 @@ packages: - vc14_runtime >=14.44.35208 license: Apache-2.0 license_family: APACHE + purls: [] size: 155869 timestamp: 1767886839029 - conda: https://conda.anaconda.org/conda-forge/win-64/tbb-2022.3.0-hd094cb3_1.conda @@ -10659,6 +14142,7 @@ packages: - xorg-libx11 >=1.8.12,<2.0a0 license: TCL license_family: BSD + purls: [] size: 3301196 timestamp: 1769460227866 - conda: https://conda.anaconda.org/conda-forge/linux-64/tk-8.6.13-noxft_ha0e22de_103.conda @@ -10684,6 +14168,7 @@ packages: - xorg-libx11 >=1.8.12,<2.0a0 license: TCL license_family: BSD + purls: [] size: 3368666 timestamp: 1769464148928 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/tk-8.6.13-noxft_h561c983_103.conda @@ -10718,6 +14203,7 @@ packages: - vc14_runtime >=14.44.35208 license: TCL license_family: BSD + purls: [] size: 3526350 timestamp: 1769460339384 - conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.3.0-pyhcf101f3_0.conda @@ -10740,6 +14226,81 @@ packages: license_family: MIT size: 21453 timestamp: 1768146676791 +- conda: https://conda.anaconda.org/conda-forge/noarch/tomli-2.4.1-pyhcf101f3_0.conda + sha256: 91cafdb64268e43e0e10d30bd1bef5af392e69f00edd34dfaf909f69ab2da6bd + md5: b5325cf06a000c5b14970462ff5e4d58 + depends: + - python >=3.10 + - python + license: MIT + license_family: MIT + purls: + - pkg:pypi/tomli?source=compressed-mapping + size: 21561 + timestamp: 1774492402955 +- conda: https://conda.anaconda.org/conda-forge/linux-64/tornado-6.5.5-py312h4c3975b_0.conda + sha256: 4629b1c9139858fb08bb357df917ffc12e4d284c57ff389806bb3ae476ef4e0a + md5: 2b37798adbc54fd9e591d24679d2133a + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + license: Apache-2.0 + license_family: Apache + purls: + - pkg:pypi/tornado?source=compressed-mapping + size: 859665 + timestamp: 1774358032165 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/tornado-6.5.5-py312hefbd42c_0.conda + sha256: 36c363ba31390875a7b024899077268b7fd55fe35e8f9190b5154c4f5032a99b + md5: 9bd0a2e992f86149013b0a5c50a912c9 + depends: + - libgcc >=14 + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + license: Apache-2.0 + license_family: Apache + purls: + - pkg:pypi/tornado?source=hash-mapping + size: 859168 + timestamp: 1774359394755 +- conda: https://conda.anaconda.org/conda-forge/win-64/tornado-6.5.5-py312he06e257_0.conda + sha256: 1220c986664e9e8662e660dc64dd97ed823926b1ba05175771408cf1d6a46dd2 + md5: c6c66a64da3d2953c83ed2789a7f4bdb + depends: + - python >=3.12,<3.13.0a0 + - python_abi 3.12.* *_cp312 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + license: Apache-2.0 + license_family: Apache + purls: + - pkg:pypi/tornado?source=compressed-mapping + size: 859726 + timestamp: 1774358173994 +- conda: https://conda.anaconda.org/conda-forge/noarch/traitlets-5.14.3-pyhd8ed1ab_1.conda + sha256: f39a5620c6e8e9e98357507262a7869de2ae8cc07da8b7f84e517c9fd6c2b959 + md5: 019a7385be9af33791c989871317e1ed + depends: + - python >=3.9 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/traitlets?source=hash-mapping + size: 110051 + timestamp: 1733367480074 +- conda: https://conda.anaconda.org/conda-forge/noarch/typing-extensions-4.15.0-h396c80c_0.conda + sha256: 7c2df5721c742c2a47b2c8f960e718c930031663ac1174da67c1ed5999f7938c + md5: edd329d7d3a4ab45dcf905899a7a6115 + depends: + - typing_extensions ==4.15.0 pyhcf101f3_0 + license: PSF-2.0 + license_family: PSF + purls: [] + size: 91383 + timestamp: 1756220668932 - conda: https://conda.anaconda.org/conda-forge/noarch/typing_extensions-4.15.0-pyhcf101f3_0.conda sha256: 032271135bca55aeb156cee361c81350c6f3fb203f57d024d7e5a1fc9ef18731 md5: 0caa1af407ecff61170c9437a808404d @@ -10748,8 +14309,23 @@ packages: - python license: PSF-2.0 license_family: PSF + purls: + - pkg:pypi/typing-extensions?source=hash-mapping size: 51692 timestamp: 1756220668932 +- conda: https://conda.anaconda.org/conda-forge/noarch/typing_inspect-0.9.0-pyhd8ed1ab_1.conda + sha256: a3fbdd31b509ff16c7314e8d01c41d9146504df632a360ab30dbc1d3ca79b7c0 + md5: fa31df4d4193aabccaf09ce78a187faf + depends: + - mypy_extensions >=0.3.0 + - python >=3.9 + - typing_extensions >=3.7.4 + license: MIT + license_family: MIT + purls: + - pkg:pypi/typing-inspect?source=hash-mapping + size: 14919 + timestamp: 1733845966415 - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2025b-h78e105d_0.conda sha256: 5aaa366385d716557e365f0a4e9c3fca43ba196872abbbe3d56bb610d131e192 md5: 4222072737ccff51314b5ece9c7d6f5a @@ -10760,6 +14336,7 @@ packages: sha256: 1d30098909076af33a35017eed6f2953af1c769e273a0626a04722ac4acaba3c md5: ad659d0a2b3e47e38d829aa8cad2d610 license: LicenseRef-Public-Domain + purls: [] size: 119135 timestamp: 1767016325805 - conda: https://conda.anaconda.org/conda-forge/win-64/ucrt-10.0.26100.0-h57928b3_0.conda @@ -10769,8 +14346,24 @@ packages: - vc14_runtime >=14.29.30037 - vs2015_runtime >=14.29.30037 license: LicenseRef-MicrosoftWindowsSDK10 + purls: [] size: 694692 timestamp: 1756385147981 +- conda: https://conda.anaconda.org/conda-forge/noarch/urllib3-2.6.3-pyhd8ed1ab_0.conda + sha256: af641ca7ab0c64525a96fd9ad3081b0f5bcf5d1cbb091afb3f6ed5a9eee6111a + md5: 9272daa869e03efe68833e3dc7a02130 + depends: + - backports.zstd >=1.0.0 + - brotli-python >=1.2.0 + - h2 >=4,<5 + - pysocks >=1.5.6,<2.0,!=1.5.7 + - python >=3.10 + license: MIT + license_family: MIT + purls: + - pkg:pypi/urllib3?source=hash-mapping + size: 103172 + timestamp: 1767817860341 - conda: https://conda.anaconda.org/conda-forge/win-64/vc-14.3-h2b53caa_32.conda sha256: 82250af59af9ff3c6a635dd4c4764c631d854feb334d6747d356d949af44d7cf md5: ef02bbe151253a72b8eda264a935db66 @@ -10791,6 +14384,7 @@ packages: - vc14 license: BSD-3-Clause license_family: BSD + purls: [] size: 19356 timestamp: 1767320221521 - conda: https://conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.44.35208-h818238b_32.conda @@ -10815,6 +14409,7 @@ packages: - vs2015_runtime 14.44.35208.* *_34 license: LicenseRef-MicrosoftVisualCpp2015-2022Runtime license_family: Proprietary + purls: [] size: 683233 timestamp: 1767320219644 - conda: https://conda.anaconda.org/conda-forge/win-64/vcomp14-14.44.35208-h818238b_32.conda @@ -10837,6 +14432,7 @@ packages: - vs2015_runtime 14.44.35208.* *_34 license: LicenseRef-MicrosoftVisualCpp2015-2022Runtime license_family: Proprietary + purls: [] size: 115235 timestamp: 1767320173250 - conda: https://conda.anaconda.org/conda-forge/win-64/vs2015_runtime-14.44.35208-h38c0c73_32.conda @@ -10889,6 +14485,51 @@ packages: license_family: MIT size: 140476 timestamp: 1765821981856 +- conda: https://conda.anaconda.org/conda-forge/noarch/wcwidth-0.6.0-pyhd8ed1ab_0.conda + sha256: e298b508b2473c4227206800dfb14c39e4b14fd79d4636132e9e1e4244cdf4aa + md5: c3197f8c0d5b955c904616b716aca093 + depends: + - python >=3.10 + license: MIT + license_family: MIT + purls: + - pkg:pypi/wcwidth?source=compressed-mapping + size: 71550 + timestamp: 1770634638503 +- conda: https://conda.anaconda.org/conda-forge/noarch/webencodings-0.5.1-pyhd8ed1ab_3.conda + sha256: 19ff205e138bb056a46f9e3839935a2e60bd1cf01c8241a5e172a422fed4f9c6 + md5: 2841eb5bfc75ce15e9a0054b98dcd64d + depends: + - python >=3.9 + license: BSD-3-Clause + license_family: BSD + purls: + - pkg:pypi/webencodings?source=hash-mapping + size: 15496 + timestamp: 1733236131358 +- conda: https://conda.anaconda.org/conda-forge/noarch/wheel-0.46.3-pyhd8ed1ab_0.conda + sha256: d6cf2f0ebd5e09120c28ecba450556ce553752652d91795442f0e70f837126ae + md5: bdbd7385b4a67025ac2dba4ef8cb6a8f + depends: + - packaging >=24.0 + - python >=3.10 + license: MIT + license_family: MIT + purls: + - pkg:pypi/wheel?source=hash-mapping + size: 31858 + timestamp: 1769139207397 +- conda: https://conda.anaconda.org/conda-forge/noarch/win_inet_pton-1.1.0-pyh7428d3b_8.conda + sha256: 93807369ab91f230cf9e6e2a237eaa812492fe00face5b38068735858fba954f + md5: 46e441ba871f524e2b067929da3051c2 + depends: + - __win + - python >=3.9 + license: LicenseRef-Public-Domain + purls: + - pkg:pypi/win-inet-pton?source=hash-mapping + size: 9555 + timestamp: 1733130678956 - conda: https://conda.anaconda.org/conda-forge/linux-64/x264-1!164.3095-h166bdaf_2.tar.bz2 sha256: 175315eb3d6ea1f64a6ce470be00fa2ee59980108f246d3072ab8b977cb048a5 md5: 6c99772d483f566d59e25037fea2c4b1 @@ -11343,6 +14984,83 @@ packages: license_family: MIT size: 33786 timestamp: 1727964907993 +- conda: https://conda.anaconda.org/conda-forge/linux-64/yaml-0.2.5-h280c20c_3.conda + sha256: 6d9ea2f731e284e9316d95fa61869fe7bbba33df7929f82693c121022810f4ad + md5: a77f85f77be52ff59391544bfe73390a + depends: + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + license: MIT + license_family: MIT + purls: [] + size: 85189 + timestamp: 1753484064210 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/yaml-0.2.5-h80f16a2_3.conda + sha256: 66265e943f32ce02396ad214e27cb35f5b0490b3bd4f064446390f9d67fa5d88 + md5: 032d8030e4a24fe1f72c74423a46fb88 + depends: + - libgcc >=14 + license: MIT + license_family: MIT + purls: [] + size: 88088 + timestamp: 1753484092643 +- conda: https://conda.anaconda.org/conda-forge/win-64/yaml-0.2.5-h6a83c73_3.conda + sha256: 80ee68c1e7683a35295232ea79bcc87279d31ffeda04a1665efdb43cbd50a309 + md5: 433699cba6602098ae8957a323da2664 + depends: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + license: MIT + license_family: MIT + purls: [] + size: 63944 + timestamp: 1753484092156 +- conda: https://conda.anaconda.org/conda-forge/linux-64/zeromq-4.3.5-h41580af_10.conda + sha256: 325d370b28e2b9cc1f765c5b4cdb394c91a5d958fbd15da1a14607a28fee09f6 + md5: 755b096086851e1193f3b10347415d7c + depends: + - libgcc >=14 + - __glibc >=2.17,<3.0.a0 + - libstdcxx >=14 + - krb5 >=1.22.2,<1.23.0a0 + - libsodium >=1.0.21,<1.0.22.0a0 + license: MPL-2.0 + license_family: MOZILLA + purls: [] + size: 311150 + timestamp: 1772476812121 +- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/zeromq-4.3.5-hc0523f8_10.conda + sha256: 32f77d565687a8241ebfb66fe630dcb197efc84f6a8b59df8260b1191b7deb2c + md5: ac79d51c73c8fbe6ef6e9067191b7f1a + depends: + - libgcc >=14 + - libstdcxx >=14 + - libsodium >=1.0.21,<1.0.22.0a0 + - krb5 >=1.22.2,<1.23.0a0 + license: MPL-2.0 + license_family: MOZILLA + purls: [] + size: 350773 + timestamp: 1772476818466 +- conda: https://conda.anaconda.org/conda-forge/win-64/zeromq-4.3.5-h507cc87_10.conda + sha256: b8568dfde46edf3455458912ea6ffb760e4456db8230a0cf34ecbc557d3c275f + md5: 1ab0237036bfb14e923d6107473b0021 + depends: + - vc >=14.3,<15 + - vc14_runtime >=14.44.35208 + - ucrt >=10.0.20348.0 + - libsodium >=1.0.21,<1.0.22.0a0 + - krb5 >=1.22.2,<1.23.0a0 + license: MPL-2.0 + license_family: MOZILLA + purls: [] + size: 265665 + timestamp: 1772476832995 - conda: https://conda.anaconda.org/conda-forge/noarch/zipp-3.23.0-pyhcf101f3_1.conda sha256: b4533f7d9efc976511a73ef7d4a2473406d7f4c750884be8e8620b0ce70f4dae md5: 30cd29cb87d819caead4d55184c1d115 @@ -11351,6 +15069,8 @@ packages: - python license: MIT license_family: MIT + purls: + - pkg:pypi/zipp?source=hash-mapping size: 24194 timestamp: 1764460141901 - conda: https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_6.conda @@ -11360,6 +15080,7 @@ packages: - __glibc >=2.17,<3.0.a0 - libzlib >=1.3.1,<2.0a0 license: BSD-3-Clause + purls: [] size: 601375 timestamp: 1764777111296 - conda: https://conda.anaconda.org/conda-forge/linux-aarch64/zstd-1.5.7-h85ac4a6_6.conda @@ -11368,6 +15089,7 @@ packages: depends: - libzlib >=1.3.1,<2.0a0 license: BSD-3-Clause + purls: [] size: 614429 timestamp: 1764777145593 - conda: https://conda.anaconda.org/conda-forge/win-64/zstd-1.5.7-h534d264_6.conda @@ -11379,5 +15101,6 @@ packages: - ucrt >=10.0.20348.0 - libzlib >=1.3.1,<2.0a0 license: BSD-3-Clause + purls: [] size: 388453 timestamp: 1764777142545 diff --git a/cuda_bindings/pixi.toml b/cuda_bindings/pixi.toml index 770ad5b6d43..58722da7d2f 100644 --- a/cuda_bindings/pixi.toml +++ b/cuda_bindings/pixi.toml @@ -10,12 +10,10 @@ preview = ["pixi-build"] [workspace.build-variants] python = ["3.10.*", "3.11.*", "3.12.*", "3.13.*", "3.14.*"] # Keep source-package metadata aligned with the consuming environment's CUDA major. -cuda-version = ["12.*", "13.2.*"] - -[dependencies] -cuda-bindings = { path = "." } +cuda-version = ["12.*", "13.3.*"] [feature.test.dependencies] +cuda-bindings = { path = "." } pytest = ">=6.2.4" pytest-benchmark = ">=3.4.1" pytest-randomly = "*" @@ -23,6 +21,26 @@ pytest-repeat = "*" pyglet = ">=2.1.9" numpy = "*" +# Keep this dependency set aligned with cuda_python/docs/environment-docs.yml. +[feature.docs.dependencies] +cuda-bindings = "13.2.*" +python = "3.12.*" +cython = "*" +enum_tools = "*" +make = "*" +myst-nb = "*" +myst-parser = "*" +numpy = "*" +numpydoc = "*" +pip = "*" +pyclibrary = "*" +pydata-sphinx-theme = "*" +pytest = "*" +scipy = "*" +sphinx = "<8.2.0" +sphinx-copybutton = "*" +sphinx-toolbox = "*" + [feature.cython-tests.dependencies] cython = ">=3.2,<3.3" # for tests that exercise APIs from cython setuptools = "*" # for distutils @@ -50,18 +68,22 @@ CUDA_HOME = "$CONDA_PREFIX/targets/x86_64-linux" CUDA_HOME = "$CONDA_PREFIX/targets/sbsa-linux" [feature.cython-tests.target.win-64.activation.env] -CUDA_HOME = '%CONDA_PREFIX%\Library' +CUDA_HOME = "$CONDA_PREFIX/Library" [feature.cu12.dependencies] cuda-version = "12.*" [feature.cu13.dependencies] -cuda-version = "13.2.*" +cuda-version = "13.3.*" [environments] default = { features = ["test", "cython-tests"], solve-group = "default" } cu13 = { features = ["cu13", "test", "cython-tests"], solve-group = "cu13" } cu12 = { features = ["cu12", "test", "cython-tests"], solve-group = "cu12" } +docs = { features = ["cu13", "docs"], solve-group = "docs" } + +[feature.docs.pypi-dependencies] +nvidia-sphinx-theme = "*" # TODO: check if these can be extracted from pyproject.toml [package] @@ -86,7 +108,7 @@ CUDA_HOME = "$PREFIX/targets/sbsa-linux" CUDA_PYTHON_PARALLEL_LEVEL = "$(nproc)" [package.build.target.win-64.config.env] -CUDA_HOME = '%PREFIX%\Library' +CUDA_HOME = "$PREFIX/Library" # TODO: revisit this # [package.build-dependencies] @@ -99,6 +121,7 @@ setuptools = ">=80" setuptools-scm = ">=8" cython = ">=3.2,<3.3" pyclibrary = ">=0.1.7" +cuda-pathfinder = { path = "../cuda_pathfinder" } cuda-cudart-static = "*" cuda-nvrtc-dev = "*" cuda-profiler-api = "*" @@ -132,7 +155,7 @@ libcufile = "*" cmd = ["$PIXI_PROJECT_ROOT/tests/cython/build_tests.sh"] [target.win-64.tasks.build-cython-tests] -cmd = ['%PIXI_PROJECT_ROOT%\tests\cython\build_tests.bat'] +cmd = ["$PIXI_PROJECT_ROOT/tests/cython/build_tests.bat"] [target.linux.tasks.test] cmd = [ @@ -143,10 +166,17 @@ cmd = [ ] depends-on = [{ task = "build-cython-tests" }] +[target.linux.tasks.build-docs] +cmd = [ + "bash", + "-lc", + "rm -rf \"$PIXI_PROJECT_ROOT/docs/build\" \"$PIXI_PROJECT_ROOT/docs/source/generated\" && cd \"$PIXI_PROJECT_ROOT/docs\" && ./build_docs.sh", +] + [target.win-64.tasks.test] cmd = [ "pytest", - "%PIXI_PROJECT_ROOT%", + "$PIXI_PROJECT_ROOT", "--override-ini", "norecursedirs=examples", # include cython tests (ignore by default config) ] diff --git a/cuda_bindings/pyproject.toml b/cuda_bindings/pyproject.toml index 96cfb4dd07b..22de742f724 100644 --- a/cuda_bindings/pyproject.toml +++ b/cuda_bindings/pyproject.toml @@ -1,11 +1,12 @@ # SPDX-FileCopyrightText: Copyright (c) 2023-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 [build-system] requires = [ "setuptools>=80.0.0", - "setuptools_scm[simple]>=8", + "setuptools_scm[simple]>=8,!=10.1", "cython>=3.2,<3.3", "pyclibrary>=0.1.7", + "cuda-pathfinder>=1.5", ] build-backend = "build_hooks" backend-path = ["."] @@ -16,7 +17,8 @@ description = "Python bindings for CUDA" authors = [ { name = "NVIDIA Corporation", email = "cuda-python-conduct@nvidia.com" }, ] -license = "LicenseRef-NVIDIA-SOFTWARE-LICENSE" +license = "Apache-2.0" +license-files = ["LICENSE"] requires-python = ">=3.10" classifiers = [ "Intended Audience :: Developers", @@ -37,18 +39,22 @@ dependencies = ["cuda-pathfinder >=1.4.2"] all = [ "cuda-toolkit[nvrtc,nvjitlink,nvvm,nvfatbin]==13.*", "cuda-toolkit[cufile]==13.*; sys_platform == 'linux'", + "cuda-toolkit==13.*", + "nvidia-cudla==13.*; platform_system == 'Linux' and platform_machine == 'aarch64'", ] [dependency-groups] test = [ "cython>=3.2,<3.3", - "setuptools>=77.0.0", - "numpy>=1.21.1", - "pytest>=6.2.4", - "pytest-benchmark>=3.4.1", - "pytest-repeat", - "pytest-randomly", - "pyglet>=2.1.9", + "setuptools>=80.0.0", + # TODO: remove the Python 3.15 guard once 3.15 is officially supported + "matplotlib>=3.5.0,<=3.10.9; python_version < '3.15'", + "numpy>=1.21.1,<=2.5.0", + "pytest==9.1.0", + "pytest-benchmark==5.2.3", + "pytest-repeat==0.9.4", + "pytest-randomly==4.1.0", + "pyglet==2.1.14", ] [project.urls] @@ -71,7 +77,6 @@ readme = { file = ["DESCRIPTION.rst"], content-type = "text/x-rst" } [tool.cibuildwheel] skip = "*-musllinux_*" -enable = "cpython-freethreading" build-verbosity = 1 [tool.cibuildwheel.linux] @@ -87,6 +92,13 @@ required_plugins = "pytest-benchmark" addopts = "--benchmark-disable --showlocals" norecursedirs = ["tests/cython", "examples"] xfail_strict = true +# Keep this authorship marker registry in sync across all pytest config roots. +# Search for "agent_authored(model)" before editing. +markers = [ + "agent_authored(model): agent-authored test not yet materially human-reviewed", + "human_reviewed: agent-authored test materially reviewed or rewritten by a human", + "human_authored: test authored primarily by a human", +] [tool.setuptools_scm] root = ".." diff --git a/cuda_bindings/setup.py b/cuda_bindings/setup.py index 2f6069c7383..4cfffcf6e1a 100644 --- a/cuda_bindings/setup.py +++ b/cuda_bindings/setup.py @@ -1,5 +1,5 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 import functools import os diff --git a/cuda_bindings/tests/conftest.py b/cuda_bindings/tests/conftest.py index f30500c1342..1618d63a133 100644 --- a/cuda_bindings/tests/conftest.py +++ b/cuda_bindings/tests/conftest.py @@ -1,8 +1,11 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +import functools +import inspect import pathlib import sys +from contextlib import contextmanager from importlib.metadata import PackageNotFoundError, distribution import pytest @@ -25,6 +28,80 @@ sys.path.insert(0, test_helpers_root) +def pytest_configure(config): + # When using `parallel-threads` set up mini-plugin to ensure each thread has a CUDA context + parallel_threads = getattr(config.option, "parallel_threads", 0) + if parallel_threads == "auto" or int(parallel_threads) > 1: + config.pluginmanager.register(_CudaBindingsParallelPlugin(), name="_cuda_bindings_parallel_plugin") + + +@contextmanager +def _thread_context(): + # Context setting up `device` and `ctx` for individual threads on + # pytest-run-parallel + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, ctx = cuda.cuCtxCreate(None, 0, device) + assert err == cuda.CUresult.CUDA_SUCCESS + try: + yield device, ctx + finally: + (err,) = cuda.cuCtxDestroy(ctx) + assert err == cuda.CUresult.CUDA_SUCCESS + + +def _wrap_worker_cuda_test(func): + if getattr(func, "_cuda_bindings_worker_cuda_wrapped", False): + return func + + sig = inspect.signature(func) + wants_device = "device" in sig.parameters + wants_ctx = "ctx" in sig.parameters + + @functools.wraps(func) + def wrapper(*args, **kwargs): + kwargs = dict(kwargs) # copy before mutating + with _thread_context() as (device, ctx): + # device is None when reusing an existing context (defensive path); + # keep whatever the fixture provided in kwargs as-is. + if wants_device and device is not None: + kwargs["device"] = device + if wants_ctx: + kwargs["ctx"] = ctx + return func(*args, **kwargs) + + wrapper._cuda_bindings_worker_cuda_wrapped = True + return wrapper + + +def _item_needs_thread_ctx(item): + fixturenames = getattr(item, "fixturenames", ()) + # The 'device' fixture is the main fixture to set up a CUDA context. + # 'driver' is specific to the cufile tests and used there instead. + return "device" in fixturenames or "driver" in fixturenames + + +class _CudaBindingsParallelPlugin: + """A mini pytest plugin used only for pytest-run-parallel testing. + pytest-run-parallel spawns new threads for each test and we need to + initialize and pass the correct CUDA context for each these. + + This plugin looks for context specific fixtures and replaces them + new context specific fixtures may have to be added. + + + This plugin approach is not ideal, it would be nicer to introduce hooks + into pytest-run-parallel. Once that issue is closed this would be good + to refactor: https://github.com/Quansight-Labs/pytest-run-parallel/issues/189 + """ + + @pytest.hookimpl() + def pytest_collection_modifyitems(self, config, items): + for item in items: + if _item_needs_thread_ctx(item): + item.obj = _wrap_worker_cuda_test(item.obj) + + @pytest.fixture(scope="module") def cuda_driver(): (err,) = cuda.cuInit(0) diff --git a/cuda_bindings/tests/cudla/conftest.py b/cuda_bindings/tests/cudla/conftest.py new file mode 100644 index 00000000000..aa277bf9a9d --- /dev/null +++ b/cuda_bindings/tests/cudla/conftest.py @@ -0,0 +1,13 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import pytest + + +@pytest.fixture(scope="module", autouse=True) +def ctx(): + """Override the parent conftest's ``ctx`` fixture which creates a CUDA + context. cuDLA tests do not require a CUDA context, so this no-op + prevents ``cuInit`` / ``cuCtxCreate`` from running (and failing on + machines without a CUDA-capable GPU).""" + return None diff --git a/cuda_bindings/tests/cudla/test_cudla_bindings.py b/cuda_bindings/tests/cudla/test_cudla_bindings.py new file mode 100644 index 00000000000..b95283fac84 --- /dev/null +++ b/cuda_bindings/tests/cudla/test_cudla_bindings.py @@ -0,0 +1,231 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import pytest + +cudla = pytest.importorskip("cuda.bindings.cudla") + + +# --------------------------------------------------------------------------- +# Enum tests (always run -- no library needed) +# --------------------------------------------------------------------------- + + +class TestEnums: + def test_status_values(self): + assert cudla.Status.Success == 0 + assert cudla.Status.ErrorInvalidParam == 1 + assert cudla.Status.ErrorOutOfResources == 2 + assert cudla.Status.ErrorCreationFailed == 3 + assert cudla.Status.ErrorInvalidAddress == 4 + assert cudla.Status.ErrorOs == 5 + assert cudla.Status.ErrorCuda == 6 + assert cudla.Status.ErrorUmd == 7 + assert cudla.Status.ErrorInvalidDevice == 8 + assert cudla.Status.ErrorInvalidAttribute == 9 + assert cudla.Status.ErrorIncompatibleDlaSWVersion == 10 + assert cudla.Status.ErrorMemoryRegistered == 11 + assert cudla.Status.ErrorInvalidModule == 12 + assert cudla.Status.ErrorUnsupportedOperation == 13 + assert cudla.Status.ErrorNvSci == 14 + assert cudla.Status.ErrorDlaErrInvalidInput == 0x40000001 + assert cudla.Status.ErrorDlaErrInvalidPreAction == 0x40000002 + assert cudla.Status.ErrorDlaErrNoMem == 0x40000003 + assert cudla.Status.ErrorDlaErrProcessorBusy == 0x40000004 + assert cudla.Status.ErrorDlaErrTaskStatusMismatch == 0x40000005 + assert cudla.Status.ErrorDlaErrEngineTimeout == 0x40000006 + assert cudla.Status.ErrorDlaErrDataMismatch == 0x40000007 + assert cudla.Status.ErrorUnknown == 0x7FFFFFFF + + def test_status_member_count(self): + assert len(cudla.Status) == 24 + + def test_mode_values(self): + assert cudla.Mode.CUDA_DLA == 0 + assert cudla.Mode.STANDALONE == 1 + + def test_module_attribute_type_values(self): + assert cudla.ModuleAttributeType.NUM_INPUT_TENSORS == 0 + assert cudla.ModuleAttributeType.NUM_OUTPUT_TENSORS == 1 + assert cudla.ModuleAttributeType.INPUT_TENSOR_DESCRIPTORS == 2 + assert cudla.ModuleAttributeType.OUTPUT_TENSOR_DESCRIPTORS == 3 + assert cudla.ModuleAttributeType.NUM_OUTPUT_TASK_STATISTICS == 4 + assert cudla.ModuleAttributeType.OUTPUT_TASK_STATISTICS_DESCRIPTORS == 5 + + def test_fence_type_values(self): + assert cudla.FenceType.NVSCISYNC_FENCE == 1 + assert cudla.FenceType.NVSCISYNC_FENCE_SOF == 2 + + def test_module_load_flags(self): + assert cudla.ModuleLoadFlags.MODULE_DEFAULT == 0 + assert cudla.ModuleLoadFlags.MODULE_ENABLE_FAULT_DIAGNOSTICS == 1 + + def test_submission_flags(self): + assert cudla.SubmissionFlags.SUBMIT_NOOP == 1 + assert cudla.SubmissionFlags.SUBMIT_SKIP_LOCK_ACQUIRE == 2 + assert cudla.SubmissionFlags.SUBMIT_DIAGNOSTICS_TASK == 4 + + def test_access_permission_flags(self): + assert cudla.AccessPermissionFlags.READ_WRITE_PERM == 0 + assert cudla.AccessPermissionFlags.READ_ONLY_PERM == 1 + assert cudla.AccessPermissionFlags.TASK_STATISTICS == 2 + + def test_dev_attribute_type(self): + assert cudla.DevAttributeType.UNIFIED_ADDRESSING == 0 + assert cudla.DevAttributeType.DEVICE_VERSION == 1 + + +# --------------------------------------------------------------------------- +# POD type tests (always run -- no library needed) +# --------------------------------------------------------------------------- + + +class TestPodTypes: + def test_external_memory_handle_desc(self): + desc = cudla.ExternalMemoryHandleDesc() + desc.size_ = 4096 + assert desc.size_ == 4096 + desc.ext_buf_object = 0xABCD + assert desc.ext_buf_object == 0xABCD + + def test_external_semaphore_handle_desc(self): + desc = cudla.ExternalSemaphoreHandleDesc() + desc.ext_sync_object = 0x1234 + assert desc.ext_sync_object == 0x1234 + + def test_module_tensor_descriptor_fields(self): + desc = cudla.ModuleTensorDescriptor() + assert desc.size_ == 0 + assert desc.n == 0 + assert desc.c == 0 + assert desc.h == 0 + assert desc.w == 0 + assert desc.data_format == 0 + assert desc.data_type == 0 + assert desc.data_category == 0 + assert desc.pixel_format == 0 + assert desc.pixel_mapping == 0 + + def test_module_tensor_descriptor_name(self): + desc = cudla.ModuleTensorDescriptor() + name = desc.name + assert isinstance(name, (str, bytes)) + + def test_module_tensor_descriptor_stride(self): + desc = cudla.ModuleTensorDescriptor() + stride = desc.stride + assert len(stride) == 8 + + def test_fence(self): + fence = cudla.Fence() + fence.fence = 0xBEEF + assert fence.fence == 0xBEEF + fence.type = int(cudla.FenceType.NVSCISYNC_FENCE) + assert fence.type == 1 + + def test_dev_attribute(self): + attr = cudla.DevAttribute() + assert attr.unified_addressing_supported == 0 + assert attr.device_version == 0 + attr.unified_addressing_supported = 1 + assert attr.unified_addressing_supported == 1 + attr.device_version = 0x20 + assert attr.device_version == 0x20 + + def test_module_attribute(self): + attr = cudla.ModuleAttribute() + assert attr.num_input_tensors == 0 + assert attr.num_output_tensors == 0 + attr.num_input_tensors = 3 + assert attr.num_input_tensors == 3 + attr.num_output_tensors = 1 + assert attr.num_output_tensors == 1 + + def test_wait_events(self): + we = cudla.WaitEvents() + assert we.pre_fences == [] + + def test_signal_events(self): + se = cudla.SignalEvents() + assert se.eof_fences == [] + + def test_task_construction(self): + task = cudla.Task() + task.module_handle = 0xDEAD + assert task.module_handle == 0xDEAD + + def test_task_input_tensor_auto_size(self): + task = cudla.Task() + task.input_tensor = [0x1000, 0x2000, 0x3000] + assert len(task.input_tensor) == 3 + + def test_task_output_tensor_auto_size(self): + task = cudla.Task() + task.output_tensor = [0x4000] + assert len(task.output_tensor) == 1 + + def test_task_combined(self): + task = cudla.Task() + task.module_handle = 0xABCD + task.input_tensor = [0x1000, 0x2000] + task.output_tensor = [0x3000] + task.wait_events = 0 + task.signal_events = 0 + assert task.module_handle == 0xABCD + assert len(task.input_tensor) == 2 + assert len(task.output_tensor) == 1 + + def test_pod_ptr_is_nonzero(self): + """Verify that int(pod) returns a nonzero pointer (memory is allocated).""" + task = cudla.Task() + assert int(task) != 0 + desc = cudla.ModuleTensorDescriptor() + assert int(desc) != 0 + + +# --------------------------------------------------------------------------- +# Error type tests (always run -- no library needed) +# --------------------------------------------------------------------------- + + +class TestErrorType: + def test_cudla_error_is_exception(self): + assert issubclass(cudla.CudlaError, Exception) + + def test_cudla_error_stores_status(self): + err = cudla.CudlaError(int(cudla.Status.ErrorInvalidParam)) + assert err.status == int(cudla.Status.ErrorInvalidParam) + + def test_cudla_error_str(self): + err = cudla.CudlaError(int(cudla.Status.ErrorInvalidParam)) + assert "ErrorInvalidParam" in str(err) + + +# --------------------------------------------------------------------------- +# API surface tests (always run -- no library needed) +# --------------------------------------------------------------------------- + + +class TestApiSurface: + """Verify that all expected functions exist as callable attributes.""" + + @pytest.mark.parametrize( + "func_name", + [ + "get_version", + "device_get_count", + "create_device", + "destroy_device", + "mem_register", + "mem_unregister", + "module_load_from_memory", + "module_get_attributes", + "module_unload", + "submit_task", + "device_get_attribute", + "get_last_error", + "set_task_timeout_in_ms", + ], + ) + def test_function_exists(self, func_name): + assert callable(getattr(cudla, func_name)) diff --git a/cuda_bindings/tests/cufile.json b/cuda_bindings/tests/cufile.json index 36b3b9bd722..21ab1f3b6bb 100644 --- a/cuda_bindings/tests/cufile.json +++ b/cuda_bindings/tests/cufile.json @@ -3,6 +3,10 @@ // e.g : export CUFILE_ENV_PATH_JSON="/home//cufile.json" + "properties" : { + "allow_compat_mode" : true + }, + "execution" : { // max number of workitems in the queue; "max_io_queue_depth": 128, diff --git a/cuda_bindings/tests/cython/build_tests.bat b/cuda_bindings/tests/cython/build_tests.bat index e1bf73af170..a59bcf53d05 100644 --- a/cuda_bindings/tests/cython/build_tests.bat +++ b/cuda_bindings/tests/cython/build_tests.bat @@ -1,7 +1,7 @@ @echo off -REM SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -REM SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +REM SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +REM SPDX-License-Identifier: Apache-2.0 setlocal set CL=%CL% /I"%CUDA_HOME%\include" diff --git a/cuda_bindings/tests/cython/build_tests.py b/cuda_bindings/tests/cython/build_tests.py new file mode 100644 index 00000000000..ac22e1fd962 --- /dev/null +++ b/cuda_bindings/tests/cython/build_tests.py @@ -0,0 +1,61 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +"""Build cuda_bindings Cython test extensions in-place. + +pixi-build's editable install exposes the `cuda` namespace package via a +PEP 660 finder hook. Python's import machinery honors the hook, but +Cython's filesystem .pxd resolver only walks real directories on sys.path, +so `cimport cuda.bindings.*` fails to locate the .pxd files. We resolve +the namespace package's source root from `cuda.bindings.__file__` and pass +it via `include_path=` so cythonize finds the .pxd tree on every platform. +""" + +from __future__ import annotations + +import os +import sys +from pathlib import Path + +from Cython.Build import cythonize +from setuptools import setup + +import cuda.bindings + + +def _bindings_source_root() -> Path: + # cuda.bindings.__file__ -> ...//cuda/bindings/__init__.py + root = Path(cuda.bindings.__file__).resolve().parents[2] + if not (root / "cuda" / "bindings").is_dir(): + raise RuntimeError( + f"cuda.bindings source tree not found at {root}; pixi-build editable install layout may have changed." + ) + return root + + +def main() -> None: + script_dir = Path(__file__).resolve().parent + pyx_files = sorted(str(p) for p in script_dir.glob("test_*.pyx")) + if not pyx_files: + raise SystemExit(f"no test_*.pyx files under {script_dir}") + + ext_modules = cythonize( + pyx_files, + language_level=3, + nthreads=1, + include_path=[str(_bindings_source_root())], + compiler_directives={"freethreading_compatible": True}, + ) + + # `build_ext --inplace` places the compiled .so relative to the current + # working directory, but pixi runs this task from the project root. pytest + # imports each extension by bare module name (see test_cython.py), which + # only resolves when the .so sits in tests/cython (the dir pytest puts on + # sys.path). chdir here so the .so lands next to its .pyx regardless of the + # invoking cwd. + os.chdir(script_dir) + sys.argv = [sys.argv[0], "build_ext", "--inplace"] + setup(name="cuda_bindings_cython_tests", ext_modules=ext_modules) + + +if __name__ == "__main__": + main() diff --git a/cuda_bindings/tests/cython/build_tests.sh b/cuda_bindings/tests/cython/build_tests.sh index c2ddc9ea79d..0ca0745d2b4 100755 --- a/cuda_bindings/tests/cython/build_tests.sh +++ b/cuda_bindings/tests/cython/build_tests.sh @@ -1,18 +1,23 @@ #!/bin/bash +set -eo pipefail -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 UNAME=$(uname) if [ "$UNAME" == "Linux" ] ; then SCRIPTPATH=$(dirname $(realpath "$0")) - export CPLUS_INCLUDE_PATH=$CUDA_HOME/include:$CPLUS_INCLUDE_PATH + export CPLUS_INCLUDE_PATH=$CUDA_HOME/include:${CPLUS_INCLUDE_PATH:-} elif [[ "$UNAME" == CYGWIN* || "$UNAME" == MINGW* || "$UNAME" == MSYS* ]] ; then SCRIPTPATH="$(dirname $(cygpath -w $(realpath "$0")))" - export CL="/I\"${CUDA_HOME}\\include\" ${CL}" + export CL="/I\"${CUDA_HOME}\\include\" ${CL:-}" else exit 1 fi -# Use -j 1 to side-step any process-pool issues and ensure deterministic single-threaded builds -cythonize -3 -j 1 -i -Xfreethreading_compatible=True ${SCRIPTPATH}/test_*.pyx +# Use a Python driver so the cuda.bindings source root is resolved at +# runtime and passed via Cython's include_path -- avoids platform-specific +# PYTHONPATH separator handling and surfaces import errors as exceptions. +# nthreads=1 inside the driver mirrors the previous `-j 1` to side-step +# any process-pool issues and keep builds deterministic. +python "${SCRIPTPATH}/build_tests.py" diff --git a/cuda_bindings/tests/cython/test_ccuda.pyx b/cuda_bindings/tests/cython/test_ccuda.pyx index 2d47bed4dea..4af8a84ba75 100644 --- a/cuda_bindings/tests/cython/test_ccuda.pyx +++ b/cuda_bindings/tests/cython/test_ccuda.pyx @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 # distutils: language=c++ from libc.string cimport ( diff --git a/cuda_bindings/tests/cython/test_ccudart.pyx b/cuda_bindings/tests/cython/test_ccudart.pyx index 7f80c8f569f..4460ceb618a 100644 --- a/cuda_bindings/tests/cython/test_ccudart.pyx +++ b/cuda_bindings/tests/cython/test_ccudart.pyx @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 # distutils: language=c++ from libc.string cimport ( diff --git a/cuda_bindings/tests/cython/test_cython.py b/cuda_bindings/tests/cython/test_cython.py index 3e14b48e0ff..a6f8133909e 100644 --- a/cuda_bindings/tests/cython/test_cython.py +++ b/cuda_bindings/tests/cython/test_cython.py @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 import functools import importlib diff --git a/cuda_bindings/tests/cython/test_interoperability_cython.pyx b/cuda_bindings/tests/cython/test_interoperability_cython.pyx index 0531ae5876d..5278a10e38a 100644 --- a/cuda_bindings/tests/cython/test_interoperability_cython.pyx +++ b/cuda_bindings/tests/cython/test_interoperability_cython.pyx @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 # distutils: language=c++ from libc.stdlib cimport calloc, free diff --git a/cuda_bindings/tests/nvml/__init__.py b/cuda_bindings/tests/nvml/__init__.py index 854f640766e..c746f897d2d 100644 --- a/cuda_bindings/tests/nvml/__init__.py +++ b/cuda_bindings/tests/nvml/__init__.py @@ -1,5 +1,5 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 import pytest diff --git a/cuda_bindings/tests/nvml/conftest.py b/cuda_bindings/tests/nvml/conftest.py index f350610c7cb..9897420e38d 100644 --- a/cuda_bindings/tests/nvml/conftest.py +++ b/cuda_bindings/tests/nvml/conftest.py @@ -1,5 +1,5 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 from collections import namedtuple @@ -106,8 +106,23 @@ def nmigs(handles): @pytest.fixture def mig_handles(nmigs): - handles = [nvml.device_get_mig_device_handle_by_index(i) for i in range(nmigs)] - assert len(handles) == nmigs + handles = [] + with NVMLInitializer(): + dev_count = nvml.device_get_count_v2() + + for dev_idx in range(dev_count): + try: + dev = nvml.device_get_handle_by_index_v2(dev_idx) + except nvml.NoPermissionError: + continue + for mig_idx in range(nmigs): + try: + mig = nvml.device_get_mig_device_handle_by_index(dev, mig_idx) + except nvml.NotFoundError: + # Not all MIG devices may be available + continue + else: + handles.append(mig) return handles diff --git a/cuda_bindings/tests/nvml/test_compute_mode.py b/cuda_bindings/tests/nvml/test_compute_mode.py index e9b020d32a9..83c7827f53a 100644 --- a/cuda_bindings/tests/nvml/test_compute_mode.py +++ b/cuda_bindings/tests/nvml/test_compute_mode.py @@ -1,5 +1,5 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 import sys diff --git a/cuda_bindings/tests/nvml/test_cuda.py b/cuda_bindings/tests/nvml/test_cuda.py index 181b0046eaa..7a782e7403c 100644 --- a/cuda_bindings/tests/nvml/test_cuda.py +++ b/cuda_bindings/tests/nvml/test_cuda.py @@ -1,8 +1,10 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 import os +import pytest + import cuda.bindings.driver as cuda from cuda.bindings import nvml @@ -56,6 +58,10 @@ def test_cuda_device_order(): cuda_devices = get_cuda_device_names() nvml_devices = get_nvml_device_names() + if any("Thor" in device["name"] for device in nvml_devices): + pytest.skip("Skipping test on Thor, which has non-standard device naming") + return + if "CUDA_VISIBLE_DEVICES" not in os.environ: # If that environment variable isn't set, the device lists should match exactly assert cuda_devices == nvml_devices, "CUDA and NVML device lists do not match" diff --git a/cuda_bindings/tests/nvml/test_device.py b/cuda_bindings/tests/nvml/test_device.py index 7344a93efe3..301bfca59d3 100644 --- a/cuda_bindings/tests/nvml/test_device.py +++ b/cuda_bindings/tests/nvml/test_device.py @@ -1,9 +1,10 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 from functools import cache +import numpy as np import pytest from cuda.bindings import nvml @@ -72,13 +73,13 @@ def test_get_nv_link_supported_bw_modes(all_devices): for device in all_devices: with unsupported_before(device, None): modes = nvml.device_get_nvlink_supported_bw_modes(device) - assert isinstance(modes, nvml.NvlinkSupportedBWModes_v1) + assert isinstance(modes, nvml.NvlinkSupportedBwModes_v1) # #define NVML_NVLINK_TOTAL_SUPPORTED_BW_MODES 23 assert len(modes.bw_modes) <= 23 assert not hasattr(modes, "total_bw_modes") for mode in modes.bw_modes: - assert isinstance(mode, int) + assert isinstance(mode, np.uint8) def test_device_get_pdi(all_devices): @@ -119,6 +120,7 @@ def test_read_prm_counters(all_devices): assert len(read_counters) == 5 +@pytest.mark.thread_unsafe(reason="API appears to be thread-unsafe (2026-06)") def test_read_write_prm(all_devices): for device in all_devices: # Docs say supported in BLACKWELL or later diff --git a/cuda_bindings/tests/nvml/test_gpu.py b/cuda_bindings/tests/nvml/test_gpu.py index 6119a5f7a93..6757e4760f1 100644 --- a/cuda_bindings/tests/nvml/test_gpu.py +++ b/cuda_bindings/tests/nvml/test_gpu.py @@ -1,5 +1,5 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 import numpy as np import pytest diff --git a/cuda_bindings/tests/nvml/test_init.py b/cuda_bindings/tests/nvml/test_init.py index 2a04799708e..a47af24dc6a 100644 --- a/cuda_bindings/tests/nvml/test_init.py +++ b/cuda_bindings/tests/nvml/test_init.py @@ -1,5 +1,5 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 import sys import warnings @@ -25,17 +25,24 @@ def test_devices_are_the_same_architecture(all_devices): # they won't be tested properly. This tests for the (hopefully rare) case # where a system has devices of different architectures and produces a warning. - all_arches = {nvml.DeviceArch(nvml.device_get_architecture(device)) for device in all_devices} + def get_architecture_name(arch): + try: + return nvml.DeviceArch(arch).name + except ValueError: + return f"UNKNOWN_ARCH_ID({arch})" + + all_arches = {nvml.device_get_architecture(device) for device in all_devices} if len(all_arches) > 1: warnings.warn( - f"System has devices of multiple architectures ({', '.join(x.name for x in all_arches)}). " + f"System has devices of multiple architectures ({', '.join(get_architecture_name(x) for x in all_arches)}). " f" Some tests may be skipped unexpectedly", UserWarning, ) @pytest.mark.skipif(sys.platform == "win32", reason="Test not supported on Windows") +@pytest.mark.thread_unsafe(reason="nvml init affects other threads") def test_init_ref_count(): """ Verifies that we can call NVML shutdown and init(2) multiple times, and that ref counting works diff --git a/cuda_bindings/tests/nvml/test_nvlink.py b/cuda_bindings/tests/nvml/test_nvlink.py index d8e782831ef..04bc8eaae4c 100644 --- a/cuda_bindings/tests/nvml/test_nvlink.py +++ b/cuda_bindings/tests/nvml/test_nvlink.py @@ -1,5 +1,5 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 from cuda.bindings import nvml @@ -10,6 +10,11 @@ def test_nvlink_get_link_count(all_devices): Checks that the link count of the device is same. """ for device in all_devices: + fields = nvml.FieldValue(0) + assert len(nvml.device_get_field_values(device, fields)) == 0 + + assert len(nvml.device_get_field_values(device, [])) == 0 + fields = nvml.FieldValue(1) fields[0].field_id = nvml.FieldId.DEV_NVLINK_LINK_COUNT value = nvml.device_get_field_values(device, fields)[0] @@ -26,4 +31,4 @@ def test_nvlink_get_link_count(all_devices): # The feature_nvlink_supported detection is not robust, so we # can't be more specific about how many links we should find. if value.nvml_return == nvml.Return.SUCCESS: - assert value.value.ui_val <= nvml.NVLINK_MAX_LINKS, f"Unexpected link count {value.value.ui_val}" + assert value.value.ui_val[0] <= nvml.NVLINK_MAX_LINKS, f"Unexpected link count {value.value.ui_val[0]}" diff --git a/cuda_bindings/tests/nvml/test_page_retirement.py b/cuda_bindings/tests/nvml/test_page_retirement.py index cded0841731..34c6cf78625 100644 --- a/cuda_bindings/tests/nvml/test_page_retirement.py +++ b/cuda_bindings/tests/nvml/test_page_retirement.py @@ -1,5 +1,5 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 import pytest diff --git a/cuda_bindings/tests/nvml/test_pci.py b/cuda_bindings/tests/nvml/test_pci.py index 90605783d8c..74c7a65a655 100644 --- a/cuda_bindings/tests/nvml/test_pci.py +++ b/cuda_bindings/tests/nvml/test_pci.py @@ -1,5 +1,5 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 import contextlib diff --git a/cuda_bindings/tests/nvml/test_pynvml.py b/cuda_bindings/tests/nvml/test_pynvml.py index e94fc331381..2d1029e9d9b 100644 --- a/cuda_bindings/tests/nvml/test_pynvml.py +++ b/cuda_bindings/tests/nvml/test_pynvml.py @@ -1,5 +1,5 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 # A set of tests ported from https://github.com/gpuopenanalytics/pynvml/blob/11.5.3/pynvml/tests/test_nvml.py @@ -47,7 +47,7 @@ def test_device_get_attributes(mig_handles): if mig_handles: for handle in mig_handles: - att = nvml.device_get_attributes(handle) + att = nvml.device_get_attributes_v2(handle) assert att is not None else: pytest.skip("No MIG devices found") @@ -187,7 +187,7 @@ def test_device_get_memory_info(ngpus, handles): def test_device_get_utilization_rates(ngpus, handles): for i in range(ngpus): - with unsupported_before(handles[i], "FERMI"): + with unsupported_before(handles[i], None): urate = nvml.device_get_utilization_rates(handles[i]) assert urate.gpu >= 0 assert urate.memory >= 0 diff --git a/cuda_bindings/tests/nvml/test_unit.py b/cuda_bindings/tests/nvml/test_unit.py new file mode 100644 index 00000000000..fb8c2552839 --- /dev/null +++ b/cuda_bindings/tests/nvml/test_unit.py @@ -0,0 +1,32 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import pytest + +from cuda.bindings import nvml + + +@pytest.fixture +def unit_handles(nvml_init): + """Yield all unit handles, or skip if no units are present.""" + count = nvml.unit_get_count() + if count == 0: + pytest.skip("No NVML units present on this system") + return [nvml.unit_get_handle_by_index(i) for i in range(count)] + + +@pytest.mark.agent_authored(model="claude-sonnet-4-6") +def test_unit_get_devices_returns_array(unit_handles): + """Regression test: unit_get_devices must not crash due to double-pointer cast. + + Previously nvmlUnitGetDevices was called with unit instead of + unit, causing undefined behaviour because nvmlUnit_t is itself an + opaque pointer handle. + """ + for unit in unit_handles: + devices = nvml.unit_get_devices(unit) + # Result is a memoryview / cython array of intptr_t device handles. + assert hasattr(devices, "__len__") + # Each element must be a non-zero pointer (valid device handle). + for dev in devices: + assert dev != 0 diff --git a/cuda_bindings/tests/nvml/util.py b/cuda_bindings/tests/nvml/util.py index 545826a2eb8..038fe58d8be 100644 --- a/cuda_bindings/tests/nvml/util.py +++ b/cuda_bindings/tests/nvml/util.py @@ -1,5 +1,5 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 import functools diff --git a/cuda_bindings/tests/test_basics.py b/cuda_bindings/tests/test_basics.py index cb3732f534b..bbb11fddbb7 100644 --- a/cuda_bindings/tests/test_basics.py +++ b/cuda_bindings/tests/test_basics.py @@ -1,5 +1,5 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 import enum import sys diff --git a/cuda_bindings/tests/test_cuda.py b/cuda_bindings/tests/test_cuda.py index e3eefb1fdd7..192ad0f72fe 100644 --- a/cuda_bindings/tests/test_cuda.py +++ b/cuda_bindings/tests/test_cuda.py @@ -1,9 +1,11 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 import ctypes -import platform +import os.path import shutil +import subprocess +import sys import textwrap import numpy as np @@ -12,6 +14,7 @@ import cuda.bindings.driver as cuda import cuda.bindings.runtime as cudart from cuda.bindings import driver +from cuda.bindings._test_helpers.mempool import xfail_if_mempool_oom def driverVersionLessThan(target): @@ -40,6 +43,11 @@ def callableBinary(name): return shutil.which(name) is not None +@pytest.mark.skipif(True, reason="Always skip!") +def test_always_skip(): + pass + + def test_cuda_memcpy(): # Get device @@ -270,6 +278,7 @@ def test_cuda_memPool_attr(): attr_list = [None] * 8 err, pool = cuda.cuMemPoolCreate(poolProps) + xfail_if_mempool_oom(err, "cuMemPoolCreate", poolProps.location.id) assert err == cuda.CUresult.CUDA_SUCCESS for idx, attr in enumerate( @@ -452,6 +461,7 @@ def test_cuda_mem_range_attr(device): @pytest.mark.skipif(driverVersionLessThan(11040) or not supportsMemoryPool(), reason="Mempool for graphs not supported") +@pytest.mark.thread_unsafe(reason="used high memory can be higher if threaded.") def test_cuda_graphMem_attr(device): err, stream = cuda.cuStreamCreate(0) assert err == cuda.CUresult.CUDA_SUCCESS @@ -468,6 +478,12 @@ def test_cuda_graphMem_attr(device): params.bytesize = allocSize err, allocNode = cuda.cuGraphAddMemAllocNode(graph, None, 0, params) + if err == cuda.CUresult.CUDA_ERROR_OUT_OF_MEMORY: + (destroy_err,) = cuda.cuGraphDestroy(graph) + assert destroy_err == cuda.CUresult.CUDA_SUCCESS + (destroy_err,) = cuda.cuStreamDestroy(stream) + assert destroy_err == cuda.CUresult.CUDA_SUCCESS + xfail_if_mempool_oom(err, "cuGraphAddMemAllocNode", device) assert err == cuda.CUresult.CUDA_SUCCESS err, freeNode = cuda.cuGraphAddMemFreeNode(graph, [allocNode], 1, params.dptr) assert err == cuda.CUresult.CUDA_SUCCESS @@ -552,29 +568,6 @@ def test_get_error_name_and_string(): assert s == b"CUDA_ERROR_INVALID_DEVICE" -@pytest.mark.skipif(not callableBinary("nvidia-smi"), reason="Binary existence needed") -def test_device_get_name(device): - # TODO: Refactor this test once we have nvml bindings to avoid the use of subprocess - import subprocess - - p = subprocess.check_output( - ["nvidia-smi", "--query-gpu=name", "--format=csv,noheader"], # noqa: S607 - shell=False, - stderr=subprocess.PIPE, - ) - - delimiter = b"\r\n" if platform.system() == "Windows" else b"\n" - expect = p.split(delimiter) - size = 64 - _, got = cuda.cuDeviceGetName(size, device) - got = got.split(b"\x00")[0] - if any(b"Unable to determine the device handle for" in result for result in expect): - # Undeterministic devices get waived - pass - else: - assert any(got in result for result in expect) - - # TODO: cuStreamGetCaptureInfo_v2 @pytest.mark.skipif(driverVersionLessThan(11030), reason="Driver too old for cuStreamGetCaptureInfo_v2") def test_stream_capture(): @@ -875,7 +868,7 @@ def test_cuCheckpointProcessGetState_failure(): def test_private_function_pointer_inspector(): - from cuda.bindings._bindings.cydriver import _inspect_function_pointer + from cuda.bindings._internal.driver import _inspect_function_pointer assert _inspect_function_pointer("__cuGetErrorString") != 0 @@ -980,6 +973,87 @@ def test_cuGraphExecGetId(device, ctx): assert err == cuda.CUresult.CUDA_SUCCESS +def test_cuGraphGetEdges_edgeData_outlives_call(device, ctx): + # Regression test for https://github.com/NVIDIA/cuda-python/issues/1804 + # cuGraphGetEdges previously returned CUgraphEdgeData wrappers backed by + # a scratch buffer that was freed before the call returned, leaving the + # wrappers pointing at freed memory. Ensure the returned objects remain + # readable after the call and after subsequent allocations. + err, graph = cuda.cuGraphCreate(0) + assert err == cuda.CUresult.CUDA_SUCCESS + try: + err, n0 = cuda.cuGraphAddEmptyNode(graph, None, 0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, n1 = cuda.cuGraphAddEmptyNode(graph, [n0], 1) + assert err == cuda.CUresult.CUDA_SUCCESS + err, n2 = cuda.cuGraphAddEmptyNode(graph, [n0, n1], 2) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, _, _, _, num_edges = cuda.cuGraphGetEdges(graph) + assert err == cuda.CUresult.CUDA_SUCCESS + assert num_edges == 3 + err, from_nodes, to_nodes, edge_data, num_edges = cuda.cuGraphGetEdges(graph, num_edges) + assert err == cuda.CUresult.CUDA_SUCCESS + assert len(edge_data) == num_edges == 3 + + # Stir the heap to make a use-after-free more likely to surface. + for _ in range(64): + err, _, _, _, _ = cuda.cuGraphGetEdges(graph, num_edges) + assert err == cuda.CUresult.CUDA_SUCCESS + err, _, _, _ = cuda.cuGraphNodeGetDependencies(n1, 1) + assert err == cuda.CUresult.CUDA_SUCCESS + + # Each wrapper must still own its data. + for ed in edge_data: + assert ed.from_port == 0 + assert ed.to_port == 0 + assert int(ed.type) == 0 + assert ed.reserved == b"\x00" * 5 + finally: + (err,) = cuda.cuGraphDestroy(graph) + assert err == cuda.CUresult.CUDA_SUCCESS + + +def test_cuGraphNodeGetDependencies_edgeData_outlives_call(device, ctx): + # Companion regression test for #1804 covering the dependency-query path. + err, graph = cuda.cuGraphCreate(0) + assert err == cuda.CUresult.CUDA_SUCCESS + try: + err, n0 = cuda.cuGraphAddEmptyNode(graph, None, 0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, n1 = cuda.cuGraphAddEmptyNode(graph, [n0], 1) + assert err == cuda.CUresult.CUDA_SUCCESS + + err, _, _, num_deps = cuda.cuGraphNodeGetDependencies(n1) + assert err == cuda.CUresult.CUDA_SUCCESS + assert num_deps == 1 + err, deps, edge_data, num_deps = cuda.cuGraphNodeGetDependencies(n1, num_deps) + assert err == cuda.CUresult.CUDA_SUCCESS + assert len(edge_data) == num_deps == 1 + + err, _, _, num_dependents = cuda.cuGraphNodeGetDependentNodes(n0) + assert err == cuda.CUresult.CUDA_SUCCESS + assert num_dependents == 1 + err, dependents, dep_edge_data, num_dependents = cuda.cuGraphNodeGetDependentNodes(n0, num_dependents) + assert err == cuda.CUresult.CUDA_SUCCESS + assert len(dep_edge_data) == num_dependents == 1 + + for _ in range(64): + err, _, _, _ = cuda.cuGraphNodeGetDependencies(n1, num_deps) + assert err == cuda.CUresult.CUDA_SUCCESS + err, _, _, _ = cuda.cuGraphNodeGetDependentNodes(n0, num_dependents) + assert err == cuda.CUresult.CUDA_SUCCESS + + for ed in edge_data + dep_edge_data: + assert ed.from_port == 0 + assert ed.to_port == 0 + assert int(ed.type) == 0 + assert ed.reserved == b"\x00" * 5 + finally: + (err,) = cuda.cuGraphDestroy(graph) + assert err == cuda.CUresult.CUDA_SUCCESS + + @pytest.mark.skipif( driverVersionLessThan(13010) or not supportsCudaAPI("cuGraphNodeGetLocalId"), reason="Requires CUDA 13.1+", @@ -1205,3 +1279,79 @@ def test_buffer_reference(): ptr = ctypes.cast(memcpyParams.memcpy.copyParams.dstHost, ctypes.POINTER(ctypes.c_uint8)) x = np.ctypeslib.as_array(ptr, shape=(size,)) assert np.all(x == 2) + + +def test_array_setter_no_double_free_after_clearing_with_empty_list(): + # Regression test for a double-free in the generated setters for + # list-valued struct members (e.g. CUlaunchConfig.attrs, + # CUDA_MEM_ALLOC_NODE_PARAMS.accessDescs, ...). Assigning an empty list + # used to free the internal buffer but leave the cached pointer non-NULL; + # the next assignment (or __dealloc__) would call free() on that dangling + # pointer, causing a double-free that glibc aborts via SIGABRT. + # + # CUlaunchConfig.attrs is exercised here as one representative instance; + # the same pattern was applied across many setters in driver.pyx.in and + # runtime.pyx.in. + # + # The reproducer runs in a subprocess so that a glibc abort surfaces as + # a non-zero return code instead of tearing down the pytest process. + code = textwrap.dedent( + """ + import cuda.bindings.driver as cuda + + params = cuda.CUlaunchConfig() + # Allocate the internal buffer. + params.attrs = [cuda.CUlaunchAttribute() for _ in range(4)] + # Free it. Pre-fix, self._attrs is left pointing at freed memory. + params.attrs = [] + # Length mismatch (0 vs 8) takes the else branch and calls free() + # again on the dangling pointer. + params.attrs = [cuda.CUlaunchAttribute() for _ in range(8)] + """ + ) + proc = subprocess.run([sys.executable, "-c", code], capture_output=True, cwd=os.path.dirname(__file__)) # noqa: S603 + assert proc.returncode == 0, ( + f"reproducer subprocess exited with code {proc.returncode}; stderr: {proc.stderr.decode(errors='replace')}" + ) + + +def test_dealloc_clears_array_field_in_external_struct(): + # Regression test for the externally-owned-memory case of the same bug. + # + # When a wrapper aliases an externally-owned struct (constructed with + # `_ptr=...`), `__dealloc__` used to free its internal buffer but leave + # `self._pvt_ptr[0].` pointing at the freed memory. Anyone still + # holding the external struct (the owning wrapper, a parent struct, or + # the CUDA driver itself) would see a dangling pointer. + # + # CUlaunchConfig.attrs is exercised here as one representative instance; + # the same pattern was applied across the `__dealloc__` methods in + # driver.pyx.in and runtime.pyx.in. + outer = cuda.CUlaunchConfig() + # `inner` aliases the same underlying struct as `outer`. + inner = cuda.CUlaunchConfig(_ptr=outer.getPtr()) + # Allocates a buffer and writes its pointer into the shared struct's + # `attrs` field. + inner.attrs = [cuda.CUlaunchAttribute() for _ in range(4)] + + # Locate `attrs` in the C struct by scanning for the just-written + # pointer. The struct is small and only `attrs` is non-NULL. + struct_addr = outer.getPtr() + word_size = ctypes.sizeof(ctypes.c_void_p) + scan_words = 128 // word_size + words = (ctypes.c_void_p * scan_words).from_address(struct_addr) + attrs_offset = next( + (i * word_size for i, p in enumerate(words) if p), + None, + ) + assert attrs_offset is not None, "attrs pointer was not written into the C struct" + + # Destroy the wrapper. With the fix, __dealloc__ also clears the field + # in the externally-owned struct; without it, the field remains dangling. + del inner + + attrs_after = ctypes.c_void_p.from_address(struct_addr + attrs_offset).value + assert attrs_after is None, ( + f"external struct still holds a dangling pointer ({attrs_after:#x}) " + "where attrs was, after the aliasing wrapper was destroyed" + ) diff --git a/cuda_bindings/tests/test_cudart.py b/cuda_bindings/tests/test_cudart.py index 3fa5594a262..ddb4448499b 100644 --- a/cuda_bindings/tests/test_cudart.py +++ b/cuda_bindings/tests/test_cudart.py @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 import ctypes import math @@ -11,6 +11,7 @@ import cuda.bindings.runtime as cudart from cuda import pathfinder from cuda.bindings import runtime +from cuda.bindings._test_helpers.mempool import xfail_if_mempool_oom def isSuccess(err): @@ -256,6 +257,89 @@ def test_cudart_graphs(): assertSuccess(err) +def test_cudart_cudaGraphGetEdges_edgeData_outlives_call(): + # Regression test for https://github.com/NVIDIA/cuda-python/issues/1804 + # cudaGraphGetEdges previously returned cudaGraphEdgeData wrappers backed + # by a scratch buffer that was freed before the call returned, leaving + # the wrappers pointing at freed memory. Ensure the returned objects + # remain readable after the call and after subsequent allocations. + err, graph = cudart.cudaGraphCreate(0) + assertSuccess(err) + try: + err, n0 = cudart.cudaGraphAddEmptyNode(graph, None, 0) + assertSuccess(err) + err, n1 = cudart.cudaGraphAddEmptyNode(graph, [n0], 1) + assertSuccess(err) + err, n2 = cudart.cudaGraphAddEmptyNode(graph, [n0, n1], 2) + assertSuccess(err) + + err, _, _, _, num_edges = cudart.cudaGraphGetEdges(graph) + assertSuccess(err) + assert num_edges == 3 + err, from_nodes, to_nodes, edge_data, num_edges = cudart.cudaGraphGetEdges(graph, num_edges) + assertSuccess(err) + assert len(edge_data) == num_edges == 3 + + # Stir the heap to make a use-after-free more likely to surface + # by reallocating the same-sized scratch buffer many times. + for _ in range(64): + err, _, _, _, _ = cudart.cudaGraphGetEdges(graph, num_edges) + assertSuccess(err) + + # Each wrapper must still own its data. Default-edge values are zero; + # if the wrapper were holding a dangling pointer, attribute access + # would be undefined behavior. We at minimum require it to not crash + # and to report the documented defaults. + for ed in edge_data: + assert ed.from_port == 0 + assert ed.to_port == 0 + assert int(ed.type) == 0 + assert ed.reserved == b"\x00" * 5 + finally: + (err,) = cudart.cudaGraphDestroy(graph) + assertSuccess(err) + + +def test_cudart_cudaGraphNodeGetDependencies_edgeData_outlives_call(): + # Companion regression test for #1804 covering the dependency-query path. + err, graph = cudart.cudaGraphCreate(0) + assertSuccess(err) + try: + err, n0 = cudart.cudaGraphAddEmptyNode(graph, None, 0) + assertSuccess(err) + err, n1 = cudart.cudaGraphAddEmptyNode(graph, [n0], 1) + assertSuccess(err) + + err, _, _, num_deps = cudart.cudaGraphNodeGetDependencies(n1) + assertSuccess(err) + assert num_deps == 1 + err, deps, edge_data, num_deps = cudart.cudaGraphNodeGetDependencies(n1, num_deps) + assertSuccess(err) + assert len(edge_data) == num_deps == 1 + + err, _, _, num_dependents = cudart.cudaGraphNodeGetDependentNodes(n0) + assertSuccess(err) + assert num_dependents == 1 + err, dependents, dep_edge_data, num_dependents = cudart.cudaGraphNodeGetDependentNodes(n0, num_dependents) + assertSuccess(err) + assert len(dep_edge_data) == num_dependents == 1 + + for _ in range(64): + err, _, _, _ = cudart.cudaGraphNodeGetDependencies(n1, num_deps) + assertSuccess(err) + err, _, _, _ = cudart.cudaGraphNodeGetDependentNodes(n0, num_dependents) + assertSuccess(err) + + for ed in edge_data + dep_edge_data: + assert ed.from_port == 0 + assert ed.to_port == 0 + assert int(ed.type) == 0 + assert ed.reserved == b"\x00" * 5 + finally: + (err,) = cudart.cudaGraphDestroy(graph) + assertSuccess(err) + + def test_cudart_list_access(): err, prop = cudart.cudaGetDeviceProperties(0) prop.name = prop.name + b" " * (256 - len(prop.name)) @@ -432,6 +516,7 @@ def test_cudart_MemPool_attr(): attr_list = [None] * 8 err, pool = cudart.cudaMemPoolCreate(poolProps) + xfail_if_mempool_oom(err, "cudaMemPoolCreate", poolProps.location.id) assertSuccess(err) for idx, attr in enumerate( diff --git a/cuda_bindings/tests/test_cufile.py b/cuda_bindings/tests/test_cufile.py index a4400f637a3..46bd8429a62 100644 --- a/cuda_bindings/tests/test_cufile.py +++ b/cuda_bindings/tests/test_cufile.py @@ -1,15 +1,14 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 import ctypes -import errno import logging import os import pathlib import platform import subprocess import tempfile -from contextlib import suppress +from contextlib import contextmanager, suppress from functools import cache import pytest @@ -28,6 +27,16 @@ cufile = pytest.importorskip("cuda.bindings.cufile", reason="skipping tests on Windows") +@contextmanager +def _cufile_driver_session(): + """Open the cuFile driver for a block; always close in a finally (mirrors try/finally).""" + cufile.driver_open() + try: + yield + finally: + cufile.driver_close() + + @pytest.fixture def cufile_env_json(monkeypatch): """Set CUFILE_ENV_PATH_JSON environment variable for async tests.""" @@ -108,12 +117,6 @@ def get_tegra_kind(): ), ] -xfail_handle_register = pytest.mark.xfail( - condition=isSupportedFilesystem() and os.environ.get("CI") is not None, - raises=cufile.cuFileError, - reason="handle_register call fails in CI for unknown reasons", -) - def test_cufile_success_defined(): """Check if CUFILE_SUCCESS is defined in OpError enum.""" @@ -140,6 +143,51 @@ def ctx(): cuda.cuDevicePrimaryCtxRelease(device) +@pytest.fixture(scope="module", autouse=True) +def _cufile_driver_prewarm(): + """Prime libcufile with one driver_open/close cycle before any test runs. + + The cuFile test module mixes two incompatible regimes: + + - Driver-open tests (buf_register_*, cufile_read_write, batch_io, stats, + etc.) need cuFileDriverOpen; they use the function-scope `driver` + fixture to open/close per test. + - Driver-closed tests (test_set_get_parameter_*, test_set_parameter_posix_*) + must run with the driver CLOSED — libcufile rejects parameter-set calls + when the driver is open (DRIVER_ALREADY_OPEN, 5026). + + Workaround for NVIDIA libcufile 1.17.1 bug: calling cuFileSetParameterSizeT + (or similar pre-open configuration APIs) BEFORE the first cuFileDriverOpen + leaves an internal version list uninitialized such that a later + cuFileDriverOpen SIGFPEs in CUFileDrv::ReadVersionInfo (div-by-zero). + Under random ordering, a driver-closed test can run before any + driver-open test, poisoning libcufile and tearing down pytest with a fatal + signal on the next driver_open. + + One open/close cycle up front primes libcufile's version list. After that, + both regimes work: the per-test `driver` fixture can open/close freely, + and parameter-set tests run against the (now properly initialized) closed + driver. + + Note: per-test driver_open/close is not ideal on throughput grounds, but + it is forced by the libcufile API — parameter-set tests cannot coexist + with a session-wide open driver. + """ + (err,) = cuda.cuInit(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, device = cuda.cuDeviceGet(0) + assert err == cuda.CUresult.CUDA_SUCCESS + err, dctx = cuda.cuDevicePrimaryCtxRetain(device) + assert err == cuda.CUresult.CUDA_SUCCESS + (err,) = cuda.cuCtxSetCurrent(dctx) + assert err == cuda.CUresult.CUDA_SUCCESS + try: + cufile.driver_open() + cufile.driver_close() + finally: + cuda.cuDevicePrimaryCtxRelease(device) + + @pytest.fixture def driver(ctx): cufile.driver_open() @@ -149,11 +197,10 @@ def driver(ctx): @pytest.mark.skipif(not isSupportedFilesystem(), reason="cuFile handle_register requires ext4 or xfs filesystem") @pytest.mark.usefixtures("driver") -@xfail_handle_register -def test_handle_register(): +def test_handle_register(tmpdir): """Test file handle registration with cuFile.""" # Create test file - file_path = "test_handle_register.bin" + file_path = tmpdir / "test_handle_register.bin" # Create file with POSIX operations fd = os.open(file_path, os.O_CREAT | os.O_RDWR, 0o600) @@ -187,8 +234,6 @@ def test_handle_register(): finally: os.close(fd) - with suppress(OSError): - os.unlink(file_path) @pytest.mark.usefixtures("driver") @@ -342,11 +387,10 @@ def test_buf_register_already_registered(): @pytest.mark.skipif(not isSupportedFilesystem(), reason="cuFile handle_register requires ext4 or xfs filesystem") @pytest.mark.usefixtures("driver") -@xfail_handle_register -def test_cufile_read_write(): +def test_cufile_read_write(tmpdir): """Test cuFile read and write operations.""" # Create test file - file_path = "test_cufile_rw.bin" + file_path = tmpdir / "test_cufile_rw.bin" # Allocate CUDA memory for write and read write_size = 65536 # 64KB, aligned to 4096 bytes (65536 % 4096 == 0) @@ -423,21 +467,14 @@ def test_cufile_read_write(): # Free CUDA memory cuda.cuMemFree(write_buf) cuda.cuMemFree(read_buf) - # Clean up test file - try: - os.unlink(file_path) - except OSError as e: - if e.errno != errno.ENOENT: - raise @pytest.mark.skipif(not isSupportedFilesystem(), reason="cuFile handle_register requires ext4 or xfs filesystem") @pytest.mark.usefixtures("driver") -@xfail_handle_register -def test_cufile_read_write_host_memory(): +def test_cufile_read_write_host_memory(tmpdir): """Test cuFile read and write operations using host memory.""" # Create test file - file_path = "test_cufile_rw_host.bin" + file_path = tmpdir / "test_cufile_rw_host.bin" # Allocate host memory for write and read write_size = 65536 # 64KB, aligned to 4096 bytes (65536 % 4096 == 0) @@ -510,21 +547,14 @@ def test_cufile_read_write_host_memory(): # Free host memory cuda.cuMemFreeHost(write_buf) cuda.cuMemFreeHost(read_buf) - # Clean up test file - try: - os.unlink(file_path) - except OSError as e: - if e.errno != errno.ENOENT: - raise @pytest.mark.skipif(not isSupportedFilesystem(), reason="cuFile handle_register requires ext4 or xfs filesystem") @pytest.mark.usefixtures("driver") -@xfail_handle_register -def test_cufile_read_write_large(): +def test_cufile_read_write_large(tmpdir): """Test cuFile read and write operations with large data.""" # Create test file - file_path = "test_cufile_rw_large.bin" + file_path = tmpdir / "test_cufile_rw_large.bin" # Allocate large CUDA memory (1MB, aligned to 4096 bytes) write_size = 1024 * 1024 # 1MB, aligned to 4096 bytes (1048576 % 4096 == 0) @@ -604,21 +634,14 @@ def test_cufile_read_write_large(): # Free CUDA memory cuda.cuMemFree(write_buf) cuda.cuMemFree(read_buf) - # Clean up test file - try: - os.unlink(file_path) - except OSError as e: - if e.errno != errno.ENOENT: - raise @pytest.mark.skipif(not isSupportedFilesystem(), reason="cuFile handle_register requires ext4 or xfs filesystem") @pytest.mark.usefixtures("ctx", "cufile_env_json", "driver") -@xfail_handle_register -def test_cufile_write_async(): +def test_cufile_write_async(tmpdir): """Test cuFile asynchronous write operations.""" # Create test file - file_path = "test_cufile_write_async.bin" + file_path = tmpdir / "test_cufile_write_async.bin" fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) try: @@ -686,17 +709,14 @@ def test_cufile_write_async(): finally: os.close(fd) - with suppress(OSError): - os.unlink(file_path) @pytest.mark.skipif(not isSupportedFilesystem(), reason="cuFile handle_register requires ext4 or xfs filesystem") @pytest.mark.usefixtures("ctx", "cufile_env_json", "driver") -@xfail_handle_register -def test_cufile_read_async(): +def test_cufile_read_async(tmpdir): """Test cuFile asynchronous read operations.""" # Create test file - file_path = "test_cufile_read_async.bin" + file_path = tmpdir / "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, 0o600) @@ -777,17 +797,14 @@ def test_cufile_read_async(): finally: os.close(fd) - with suppress(OSError): - os.unlink(file_path) @pytest.mark.skipif(not isSupportedFilesystem(), reason="cuFile handle_register requires ext4 or xfs filesystem") -@xfail_handle_register @pytest.mark.usefixtures("ctx", "cufile_env_json", "driver") -def test_cufile_async_read_write(): +def test_cufile_async_read_write(tmpdir): """Test cuFile asynchronous read and write operations in sequence.""" # Create test file - file_path = "test_cufile_async_rw.bin" + file_path = tmpdir / "test_cufile_async_rw.bin" fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) try: @@ -891,17 +908,14 @@ def test_cufile_async_read_write(): finally: os.close(fd) - with suppress(OSError): - os.unlink(file_path) @pytest.mark.skipif(not isSupportedFilesystem(), reason="cuFile handle_register requires ext4 or xfs filesystem") @pytest.mark.usefixtures("driver") -@xfail_handle_register -def test_batch_io_basic(): +def test_batch_io_basic(tmpdir): """Test basic batch IO operations with multiple read/write operations.""" # Create test file - file_path = "test_batch_io.bin" + file_path = tmpdir / "test_batch_io.bin" # Allocate CUDA memory for multiple operations buf_size = 65536 # 64KB @@ -1090,21 +1104,14 @@ def test_batch_io_basic(): # Free CUDA memory for buf in buffers + read_buffers: cuda.cuMemFree(buf) - # Clean up test file - try: - os.unlink(file_path) - except OSError as e: - if e.errno != errno.ENOENT: - raise @pytest.mark.skipif(not isSupportedFilesystem(), reason="cuFile handle_register requires ext4 or xfs filesystem") @pytest.mark.usefixtures("driver") -@xfail_handle_register -def test_batch_io_cancel(): +def test_batch_io_cancel(tmpdir): """Test batch IO cancellation.""" # Create test file - file_path = "test_batch_cancel.bin" + file_path = tmpdir / "test_batch_cancel.bin" # Allocate CUDA memory buf_size = 4096 # 4KB, aligned to 4096 bytes @@ -1174,21 +1181,14 @@ def test_batch_io_cancel(): # Free CUDA memory for buf in buffers: cuda.cuMemFree(buf) - # Clean up test file - try: - os.unlink(file_path) - except OSError as e: - if e.errno != errno.ENOENT: - raise @pytest.mark.skipif(not isSupportedFilesystem(), reason="cuFile handle_register requires ext4 or xfs filesystem") @pytest.mark.usefixtures("driver") -@xfail_handle_register -def test_batch_io_large_operations(): +def test_batch_io_large_operations(tmpdir): """Test batch IO with large buffer operations.""" # Create test file - file_path = "test_batch_large.bin" + file_path = tmpdir / "test_batch_large.bin" # Allocate large CUDA memory (1MB, aligned to 4096 bytes) buf_size = 1024 * 1024 # 1MB, aligned to 4096 bytes @@ -1366,18 +1366,12 @@ def test_batch_io_large_operations(): # Free CUDA memory for buf in all_buffers: cuda.cuMemFree(buf) - # Clean up test file - try: - os.unlink(file_path) - except OSError as e: - if e.errno != errno.ENOENT: - raise @pytest.mark.skipif( cufileVersionLessThan(1140), reason="cuFile parameter APIs require cuFile library version 1.14.0 or later" ) -@pytest.mark.usefixtures("ctx") +@pytest.mark.usefixtures("ctx", "cufile_env_json") def test_set_get_parameter_size_t(): """Test setting and getting size_t parameters with cuFile validation.""" param_val_pairs = ( @@ -1394,8 +1388,13 @@ def test_set_get_parameter_size_t(): (cufile.SizeTConfigParameter.EXECUTION_MAX_REQUEST_PARALLELISM, 4), # Max 4 parallel requests ) + # Snapshot baselines after driver_open so getters reflect merged config (defaults + JSON), + # not pre-open pending state that could restore invalid values (e.g. 0 for per-buffer cache). + with _cufile_driver_session(): + originals = {param: cufile.get_parameter_size_t(param) for param, _ in param_val_pairs} + def test_param(param, val): - orig_val = cufile.get_parameter_size_t(param) + orig_val = originals[param] cufile.set_parameter_size_t(param, val) retrieved_val = cufile.get_parameter_size_t(param) assert retrieved_val == val @@ -1409,9 +1408,11 @@ def test_param(param, val): @pytest.mark.skipif( cufileVersionLessThan(1140), reason="cuFile parameter APIs require cuFile library version 1.14.0 or later" ) -@pytest.mark.usefixtures("ctx") +@pytest.mark.usefixtures("ctx", "cufile_env_json") def test_set_get_parameter_bool(): """Test setting and getting boolean parameters with cuFile validation.""" + # Load the compat-enabled test config before the first driver_open so the compat + # bool params can still be round-tripped on systems without nvidia-fs. param_val_pairs = ( (cufile.BoolConfigParameter.PROPERTIES_USE_POLL_MODE, True), (cufile.BoolConfigParameter.PROPERTIES_ALLOW_COMPAT_MODE, False), @@ -1426,28 +1427,29 @@ def test_set_get_parameter_bool(): (cufile.BoolConfigParameter.SKIP_TOPOLOGY_DETECTION, False), (cufile.BoolConfigParameter.STREAM_MEMOPS_BYPASS, True), ) + # PROFILE_NVTX is deprecated (CTK 13.1.0+); cuFile >= 1.16 rejects bool getters for it. + if cufile.get_version() >= 1160: + param_val_pairs = tuple((p, v) for p, v in param_val_pairs if p is not cufile.BoolConfigParameter.PROFILE_NVTX) + + with _cufile_driver_session(): + originals = {param: cufile.get_parameter_bool(param) for param, _ in param_val_pairs} def test_param(param, val): - orig_val = cufile.get_parameter_bool(param) + orig_val = originals[param] cufile.set_parameter_bool(param, val) retrieved_val = cufile.get_parameter_bool(param) assert retrieved_val is val cufile.set_parameter_bool(param, orig_val) - try: - # Test setting and getting various boolean parameters - for param, val in param_val_pairs: - test_param(param, val) - except cufile.cuFileError: - if cufile.get_version() < 1160: - raise - assert param is cufile.BoolConfigParameter.PROFILE_NVTX # Deprecated in CTK 13.1.0 + # Test setting and getting various boolean parameters + for param, val in param_val_pairs: + test_param(param, val) @pytest.mark.skipif( cufileVersionLessThan(1140), reason="cuFile parameter APIs require cuFile library version 1.14.0 or later" ) -@pytest.mark.usefixtures("ctx") +@pytest.mark.usefixtures("ctx", "cufile_env_json") def test_set_get_parameter_string(tmp_path): """Test setting and getting string parameters with cuFile validation.""" temp_dir = tempfile.gettempdir() @@ -1468,8 +1470,11 @@ def test_set_get_parameter_string(tmp_path): ), # Test log directory ) + with _cufile_driver_session(): + originals = {param: cufile.get_parameter_string(param, 256) for param, _, _ in param_val_pairs} + def test_param(param, val, default_val): - orig_val = cufile.get_parameter_string(param, 256) + orig_val = originals[param] val_b = val.encode("utf-8") val_buf = ctypes.create_string_buffer(val_b) @@ -1565,6 +1570,7 @@ def test_get_parameter_min_max_value(): cufileVersionLessThan(1150), reason="cuFile parameter APIs require cuFile library version 13.0 or later" ) @pytest.mark.usefixtures("stats") +@pytest.mark.thread_unsafe(reason="not safe to stats_start() from multiple threads") def test_stats_start_stop(): """Test cuFile statistics collection stop.""" # Set statistics level first (required before starting stats) @@ -1581,11 +1587,11 @@ def test_stats_start_stop(): ) @pytest.mark.skipif(not isSupportedFilesystem(), reason="cuFile handle_register requires ext4 or xfs filesystem") @pytest.mark.usefixtures("stats") -@xfail_handle_register -def test_get_stats_l1(): +@pytest.mark.thread_unsafe(reason="cuFile stats counters and collection state are process-global") +def test_get_stats_l1(tmpdir): """Test cuFile L1 statistics retrieval with file operations.""" # Create test file directly with O_DIRECT - file_path = "test_stats_l1.bin" + file_path = tmpdir / "test_stats_l1.bin" fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) try: @@ -1652,8 +1658,6 @@ def test_get_stats_l1(): finally: os.close(fd) - with suppress(OSError): - os.unlink(file_path) @pytest.mark.skipif( @@ -1661,11 +1665,11 @@ def test_get_stats_l1(): ) @pytest.mark.skipif(not isSupportedFilesystem(), reason="cuFile handle_register requires ext4 or xfs filesystem") @pytest.mark.usefixtures("stats") -@xfail_handle_register -def test_get_stats_l2(): +@pytest.mark.thread_unsafe(reason="cuFile stats counters and collection state are process-global") +def test_get_stats_l2(tmpdir): """Test cuFile L2 statistics retrieval with file operations.""" # Create test file directly with O_DIRECT - file_path = "test_stats_l2.bin" + file_path = tmpdir / "test_stats_l2.bin" fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) try: @@ -1736,8 +1740,6 @@ def test_get_stats_l2(): finally: os.close(fd) - with suppress(OSError): - os.unlink(file_path) @pytest.mark.skipif( @@ -1745,11 +1747,11 @@ def test_get_stats_l2(): ) @pytest.mark.skipif(not isSupportedFilesystem(), reason="cuFile handle_register requires ext4 or xfs filesystem") @pytest.mark.usefixtures("stats") -@xfail_handle_register -def test_get_stats_l3(): +@pytest.mark.thread_unsafe(reason="cuFile stats counters and collection state are process-global") +def test_get_stats_l3(tmpdir): """Test cuFile L3 statistics retrieval with file operations.""" # Create test file directly with O_DIRECT - file_path = "test_stats_l3.bin" + file_path = tmpdir / "test_stats_l3.bin" fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) try: @@ -1830,8 +1832,6 @@ def test_get_stats_l3(): finally: os.close(fd) - with suppress(OSError): - os.unlink(file_path) @pytest.mark.skipif( @@ -1896,8 +1896,7 @@ def driver_config(slab_sizes, slab_counts): @pytest.mark.skipif( cufileVersionLessThan(1150), reason="cuFile parameter APIs require cuFile library version 13.0 or later" ) -@pytest.mark.usefixtures("ctx") -def test_set_parameter_posix_pool_slab_array(slab_sizes, slab_counts, driver_config): +def test_set_parameter_posix_pool_slab_array(slab_sizes, slab_counts, driver_config, driver): """Test cuFile POSIX pool slab array configuration.""" # After setting parameters, retrieve them back to verify n_slab_sizes = len(slab_sizes) @@ -1908,11 +1907,8 @@ def test_set_parameter_posix_pool_slab_array(slab_sizes, slab_counts, driver_con retrieved_counts_addr = ctypes.addressof(retrieved_counts) # Open cuFile driver AFTER setting parameters - cufile.driver_open() - try: + with _cufile_driver_session(): cufile.get_parameter_posix_pool_slab_array(retrieved_sizes_addr, retrieved_counts_addr, n_slab_sizes) - finally: - cufile.driver_close() # Verify they match what we set assert list(retrieved_sizes) == slab_sizes diff --git a/cuda_bindings/tests/test_examples.py b/cuda_bindings/tests/test_examples.py new file mode 100644 index 00000000000..63a56c78fb7 --- /dev/null +++ b/cuda_bindings/tests/test_examples.py @@ -0,0 +1,33 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import glob +import os +import subprocess +import sys + +import pytest + +from cuda.bindings._test_helpers.pep723 import has_package_requirements_or_skip + +examples_path = os.path.join(os.path.dirname(__file__), "..", "examples") +examples_files = glob.glob(os.path.join(examples_path, "**/*.py"), recursive=True) + + +@pytest.mark.parametrize("example", examples_files) +def test_example(example): + has_package_requirements_or_skip(example) + + env = os.environ.copy() + env["CUDA_BINDINGS_SKIP_EXAMPLE"] = "100" + + process = subprocess.run([sys.executable, example], capture_output=True, env=env) # noqa: S603 + # returncode is a special value used in the examples to indicate that system requirements are not met. + if process.returncode == 100: + pytest.skip(process.stderr.decode(errors="replace").strip()) + elif process.returncode != 0: + if process.stdout: + print(process.stdout.decode(errors="replace")) + if process.stderr: + print(process.stderr.decode(errors="replace"), file=sys.stderr) + raise AssertionError(f"`{example}` failed ({process.returncode})") diff --git a/cuda_bindings/tests/test_graphics_apis.py b/cuda_bindings/tests/test_graphics_apis.py index ecfeba96fd1..8b74d8d2a1d 100644 --- a/cuda_bindings/tests/test_graphics_apis.py +++ b/cuda_bindings/tests/test_graphics_apis.py @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 import contextlib import ctypes diff --git a/cuda_bindings/tests/test_interoperability.py b/cuda_bindings/tests/test_interoperability.py index 3da1877128b..18a37ec6b4e 100644 --- a/cuda_bindings/tests/test_interoperability.py +++ b/cuda_bindings/tests/test_interoperability.py @@ -1,11 +1,12 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 import numpy as np import pytest import cuda.bindings.driver as cuda import cuda.bindings.runtime as cudart +from cuda.bindings._test_helpers.mempool import xfail_if_mempool_oom def supportsMemoryPool(): @@ -87,12 +88,14 @@ def test_interop_graphNode(): def test_interop_memPool(): # DRV to RT err_dr, pool = cuda.cuDeviceGetDefaultMemPool(0) + xfail_if_mempool_oom(err_dr, "cuDeviceGetDefaultMemPool", 0) assert err_dr == cuda.CUresult.CUDA_SUCCESS (err_rt,) = cudart.cudaDeviceSetMemPool(0, pool) assert err_rt == cudart.cudaError_t.cudaSuccess # RT to DRV err_rt, pool = cudart.cudaDeviceGetDefaultMemPool(0) + xfail_if_mempool_oom(err_rt, "cudaDeviceGetDefaultMemPool", 0) assert err_rt == cudart.cudaError_t.cudaSuccess (err_dr,) = cuda.cuDeviceSetMemPool(0, pool) assert err_dr == cuda.CUresult.CUDA_SUCCESS diff --git a/cuda_bindings/tests/test_kernelParams.py b/cuda_bindings/tests/test_kernelParams.py index f64444da066..555d6a7284c 100644 --- a/cuda_bindings/tests/test_kernelParams.py +++ b/cuda_bindings/tests/test_kernelParams.py @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 import ctypes diff --git a/cuda_bindings/tests/test_nvfatbin.py b/cuda_bindings/tests/test_nvfatbin.py index 32c6e70f593..32b981d93da 100644 --- a/cuda_bindings/tests/test_nvfatbin.py +++ b/cuda_bindings/tests/test_nvfatbin.py @@ -1,5 +1,5 @@ # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 import base64 @@ -121,8 +121,7 @@ def nvcc_smoke(tmpdir) -> str: return nvcc -@pytest.fixture -def CUBIN(arch): +def _build_cubin(arch): def CHECK_NVRTC(err): if err != nvrtc.nvrtcResult.NVRTC_SUCCESS: raise RuntimeError(repr(err)) @@ -141,6 +140,11 @@ def CHECK_NVRTC(err): return cubin +@pytest.fixture +def CUBIN(arch): + return _build_cubin(arch) + + # create a valid LTOIR input for testing @pytest.fixture def LTOIR(arch): @@ -259,11 +263,11 @@ def test_nvfatbin_add_ptx(PTX, arch): nvfatbin.destroy(handle) -@pytest.mark.parametrize("arch", ["sm_80"], indirect=True) -def test_nvfatbin_add_cubin_ELF_SIZE_MISMATCH(CUBIN, arch): +def test_nvfatbin_add_cubin_ELF_SIZE_MISMATCH(): + cubin = _build_cubin("sm_80") handle = nvfatbin.create([], 0) with pytest.raises(nvfatbin.nvFatbinError, match="ERROR_ELF_ARCH_MISMATCH"): - nvfatbin.add_cubin(handle, CUBIN, len(CUBIN), "75", "inc") + nvfatbin.add_cubin(handle, cubin, len(cubin), "75", "inc") nvfatbin.destroy(handle) @@ -280,11 +284,11 @@ def test_nvfatbin_add_cubin(CUBIN, arch): nvfatbin.destroy(handle) -@pytest.mark.parametrize("arch", ["sm_80"], indirect=True) -def test_nvfatbin_add_cubin_ELF_ARCH_MISMATCH(CUBIN, arch): +def test_nvfatbin_add_cubin_ELF_ARCH_MISMATCH(): + cubin = _build_cubin("sm_80") handle = nvfatbin.create([], 0) with pytest.raises(nvfatbin.nvFatbinError, match="ERROR_ELF_ARCH_MISMATCH"): - nvfatbin.add_cubin(handle, CUBIN, len(CUBIN), "75", "inc") + nvfatbin.add_cubin(handle, cubin, len(cubin), "75", "inc") nvfatbin.destroy(handle) diff --git a/cuda_bindings/tests/test_nvjitlink.py b/cuda_bindings/tests/test_nvjitlink.py index 42b93c3dda1..a2020f042e4 100644 --- a/cuda_bindings/tests/test_nvjitlink.py +++ b/cuda_bindings/tests/test_nvjitlink.py @@ -1,10 +1,24 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from contextlib import contextmanager import pytest from cuda.bindings import nvjitlink, nvrtc + +@contextmanager +def nvjitlink_session(num_options, options): + """Create an nvJitLink handle and always destroy it (including on test failure).""" + handle = nvjitlink.create(num_options, options) + try: + yield handle + finally: + if handle != 0: + nvjitlink.destroy(handle) + + # Establish a handful of compatible architectures and PTX versions to test with ARCHITECTURES = ["sm_75", "sm_80", "sm_90", "sm_100"] PTX_VERSIONS = ["6.4", "7.0", "8.5", "8.8"] @@ -95,81 +109,78 @@ def test_invalid_arch_error(): @pytest.mark.parametrize("option", ARCHITECTURES) def test_create_and_destroy(option): - handle = nvjitlink.create(1, [f"-arch={option}"]) - assert handle != 0 - nvjitlink.destroy(handle) + with nvjitlink_session(1, [f"-arch={option}"]) as handle: + assert handle != 0 + + +def test_create_and_destroy_bytes_options(): + with nvjitlink_session(1, [b"-arch=sm_80"]) as handle: + assert handle != 0 @pytest.mark.parametrize("option", ARCHITECTURES) def test_complete_empty(option): - handle = nvjitlink.create(1, [f"-arch={option}"]) - nvjitlink.complete(handle) - nvjitlink.destroy(handle) + with nvjitlink_session(1, [f"-arch={option}"]) as handle: + nvjitlink.complete(handle) @arch_ptx_parametrized def test_add_data(arch, ptx_bytes): - handle = nvjitlink.create(1, [f"-arch={arch}"]) - nvjitlink.add_data(handle, nvjitlink.InputType.ANY, ptx_bytes, len(ptx_bytes), "test_data") - nvjitlink.complete(handle) - nvjitlink.destroy(handle) + with nvjitlink_session(1, [f"-arch={arch}"]) as handle: + nvjitlink.add_data(handle, nvjitlink.InputType.ANY, ptx_bytes, len(ptx_bytes), "test_data") + nvjitlink.complete(handle) @arch_ptx_parametrized def test_add_file(arch, ptx_bytes, tmp_path): - handle = nvjitlink.create(1, [f"-arch={arch}"]) - file_path = tmp_path / "test_file.cubin" - file_path.write_bytes(ptx_bytes) - nvjitlink.add_file(handle, nvjitlink.InputType.ANY, str(file_path)) - nvjitlink.complete(handle) - nvjitlink.destroy(handle) + with nvjitlink_session(1, [f"-arch={arch}"]) as handle: + file_path = tmp_path / "test_file.cubin" + file_path.write_bytes(ptx_bytes) + nvjitlink.add_file(handle, nvjitlink.InputType.ANY, str(file_path)) + nvjitlink.complete(handle) @pytest.mark.parametrize("arch", ARCHITECTURES) def test_get_error_log(arch): - handle = nvjitlink.create(1, [f"-arch={arch}"]) - nvjitlink.complete(handle) - log_size = nvjitlink.get_error_log_size(handle) - log = bytearray(log_size) - nvjitlink.get_error_log(handle, log) - assert len(log) == log_size - nvjitlink.destroy(handle) + with nvjitlink_session(1, [f"-arch={arch}"]) as handle: + nvjitlink.complete(handle) + log_size = nvjitlink.get_error_log_size(handle) + log = bytearray(log_size) + nvjitlink.get_error_log(handle, log) + assert len(log) == log_size @arch_ptx_parametrized def test_get_info_log(arch, ptx_bytes): - handle = nvjitlink.create(1, [f"-arch={arch}"]) - nvjitlink.add_data(handle, nvjitlink.InputType.ANY, ptx_bytes, len(ptx_bytes), "test_data") - nvjitlink.complete(handle) - log_size = nvjitlink.get_info_log_size(handle) - log = bytearray(log_size) - nvjitlink.get_info_log(handle, log) - assert len(log) == log_size - nvjitlink.destroy(handle) + with nvjitlink_session(1, [f"-arch={arch}"]) as handle: + nvjitlink.add_data(handle, nvjitlink.InputType.ANY, ptx_bytes, len(ptx_bytes), "test_data") + nvjitlink.complete(handle) + log_size = nvjitlink.get_info_log_size(handle) + log = bytearray(log_size) + nvjitlink.get_info_log(handle, log) + assert len(log) == log_size @arch_ptx_parametrized def test_get_linked_cubin(arch, ptx_bytes): - handle = nvjitlink.create(1, [f"-arch={arch}"]) - nvjitlink.add_data(handle, nvjitlink.InputType.ANY, ptx_bytes, len(ptx_bytes), "test_data") - nvjitlink.complete(handle) - cubin_size = nvjitlink.get_linked_cubin_size(handle) - cubin = bytearray(cubin_size) - nvjitlink.get_linked_cubin(handle, cubin) - assert len(cubin) == cubin_size - nvjitlink.destroy(handle) + with nvjitlink_session(1, [f"-arch={arch}"]) as handle: + nvjitlink.add_data(handle, nvjitlink.InputType.ANY, ptx_bytes, len(ptx_bytes), "test_data") + nvjitlink.complete(handle) + cubin_size = nvjitlink.get_linked_cubin_size(handle) + cubin = bytearray(cubin_size) + nvjitlink.get_linked_cubin(handle, cubin) + assert len(cubin) == cubin_size @pytest.mark.parametrize("arch", ARCHITECTURES) def test_get_linked_ptx(arch, get_dummy_ltoir): - handle = nvjitlink.create(3, [f"-arch={arch}", "-lto", "-ptx"]) - nvjitlink.add_data(handle, nvjitlink.InputType.LTOIR, get_dummy_ltoir, len(get_dummy_ltoir), "test_data") - nvjitlink.complete(handle) - ptx_size = nvjitlink.get_linked_ptx_size(handle) - ptx = bytearray(ptx_size) - nvjitlink.get_linked_ptx(handle, ptx) - assert len(ptx) == ptx_size - nvjitlink.destroy(handle) + with nvjitlink_session(3, [f"-arch={arch}", "-lto", "-ptx"]) as handle: + nvjitlink.add_data(handle, nvjitlink.InputType.LTOIR, get_dummy_ltoir, len(get_dummy_ltoir), "test_data") + nvjitlink.complete(handle) + ptx_size = nvjitlink.get_linked_ptx_size(handle) + ptx = bytearray(ptx_size) + nvjitlink.get_linked_ptx(handle, ptx) + assert len(ptx) == ptx_size def test_package_version(): diff --git a/cuda_bindings/tests/test_nvrtc.py b/cuda_bindings/tests/test_nvrtc.py index 51202e64d9a..90ff6766d41 100644 --- a/cuda_bindings/tests/test_nvrtc.py +++ b/cuda_bindings/tests/test_nvrtc.py @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 import pytest diff --git a/cuda_bindings/tests/test_nvvm.py b/cuda_bindings/tests/test_nvvm.py index a3e4c81d4a5..91b7d705d34 100644 --- a/cuda_bindings/tests/test_nvvm.py +++ b/cuda_bindings/tests/test_nvvm.py @@ -1,6 +1,6 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 import re from contextlib import contextmanager @@ -8,6 +8,7 @@ import pytest from cuda.bindings import nvvm +from cuda.bindings._internal.utils import FunctionNotFoundError pytest_plugins = ("cuda_python_test_helpers.nvvm_bitcode",) @@ -62,6 +63,15 @@ def test_nvvm_ir_version(): assert ver >= (1, 0, 0, 0) +def test_nvvm_llvm_version(): + try: + ver = nvvm.llvm_version("compute_75") + except FunctionNotFoundError: + pytest.skip("nvvmLLVMVersion not available in this NVVM version") + assert isinstance(ver, int) + assert ver >= 0 + + def test_create_and_destroy(): with nvvm_program() as prog: assert isinstance(prog, int) @@ -116,7 +126,7 @@ def test_get_buffer_empty(get_size, get_buffer): assert buffer == b"\x00" -@pytest.mark.parametrize("options", [[], ["-opt=0"], ["-opt=3", "-g"]]) +@pytest.mark.parametrize("options", [[], ["-opt=0"], ["-opt=3", "-g"], [b"-opt=0"]]) def test_compile_program_with_minimal_nvvm_ir(minimal_nvvmir, options): with nvvm_program() as prog: nvvm.add_module_to_program(prog, minimal_nvvmir, len(minimal_nvvmir), "FileNameHere.ll") diff --git a/cuda_bindings/tests/test_utils.py b/cuda_bindings/tests/test_utils.py index fd89cd00bde..c767996bced 100644 --- a/cuda_bindings/tests/test_utils.py +++ b/cuda_bindings/tests/test_utils.py @@ -1,5 +1,5 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 import importlib import random @@ -11,10 +11,29 @@ from cuda.bindings import driver, runtime from cuda.bindings._internal.utils import get_c_compiler -from cuda.bindings.utils import get_cuda_native_handle, get_minimal_required_cuda_ver_from_ptx_ver, get_ptx_ver +from cuda.bindings.utils import ( + check_nvvm_compiler_options, + get_cuda_native_handle, + get_minimal_required_cuda_ver_from_ptx_ver, + get_ptx_ver, +) have_cufile = importlib.util.find_spec("cuda.bindings.cufile") is not None + +def _is_libnvvm_available() -> bool: + from cuda.bindings._internal.nvvm import _inspect_function_pointer + from cuda.pathfinder import DynamicLibNotFoundError + + try: + return _inspect_function_pointer("__nvvmCreateProgram") != 0 + except DynamicLibNotFoundError: + return False + + +_libnvvm_available = _is_libnvvm_available() +_skip_no_libnvvm = pytest.mark.skipif(not _libnvvm_available, reason="libNVVM not available") + ptx_88_kernel = r""" .version 8.8 .target sm_75 @@ -118,3 +137,35 @@ def test_get_c_compiler(): c_compiler = get_c_compiler() prefix = ("GCC", "Clang", "MSVC", "Unknown") assert sum(c_compiler.startswith(p) for p in prefix) == 1 + + +@_skip_no_libnvvm +def test_check_nvvm_compiler_options_valid(): + assert check_nvvm_compiler_options(["-arch=compute_90"]) is True + + +@_skip_no_libnvvm +def test_check_nvvm_compiler_options_invalid(): + assert check_nvvm_compiler_options(["--this-is-not-a-valid-option"]) is False + + +@_skip_no_libnvvm +def test_check_nvvm_compiler_options_empty(): + assert check_nvvm_compiler_options([]) is True + + +@_skip_no_libnvvm +def test_check_nvvm_compiler_options_multiple_valid(): + assert check_nvvm_compiler_options(["-arch=compute_90", "-opt=3", "-g"]) is True + + +@_skip_no_libnvvm +def test_check_nvvm_compiler_options_arch_detection(): + assert check_nvvm_compiler_options(["-arch=compute_90"]) is True + assert check_nvvm_compiler_options(["-arch=compute_99999"]) is False + + +def test_check_nvvm_compiler_options_no_libnvvm(): + if _libnvvm_available: + pytest.skip("libNVVM is available; this test targets the fallback path") + assert check_nvvm_compiler_options(["-arch=compute_90"]) is False diff --git a/cuda_bindings/tests/test_version_check.py b/cuda_bindings/tests/test_version_check.py index 21a70137687..03c3d7d3c2c 100644 --- a/cuda_bindings/tests/test_version_check.py +++ b/cuda_bindings/tests/test_version_check.py @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 import os import warnings diff --git a/cuda_bindings/tests/utils/check_cyclical_import.py b/cuda_bindings/tests/utils/check_cyclical_import.py index e40f8001108..5c2106612e3 100644 --- a/cuda_bindings/tests/utils/check_cyclical_import.py +++ b/cuda_bindings/tests/utils/check_cyclical_import.py @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 """ Tests whether importing a specific module leads to cyclical imports. diff --git a/cuda_core/AGENTS.md b/cuda_core/AGENTS.md index 357e228360d..45fc2481042 100644 --- a/cuda_core/AGENTS.md +++ b/cuda_core/AGENTS.md @@ -40,7 +40,6 @@ This file describes `cuda_core`, the high-level Pythonic CUDA subpackage in the - run: `pytest tests/cython/` - **Examples**: validate affected examples in `examples/` when changing user workflows or public APIs. -- **Orchestrated run**: from repo root, `scripts/run_tests.sh core`. ## Runtime/build environment notes @@ -63,3 +62,85 @@ This file describes `cuda_core`, the high-level Pythonic CUDA subpackage in the call-site consistency. - Prefer explicit error propagation over silent fallback paths. - If you change public behavior, update tests and docs under `docs/source/`. + +## API design guidelines + +These are some API design guidelines we try to follow when adding new APIs to +`cuda.core`. These rules only apply to public APIs. Private implementation +details can violate these rules at any time. + +Public APIs are defined as symbols defined in `__all__` within modules or +subpackages that are not prefixed with `_`. + +In code reviews, any violations of this section should be considered +suggestions, not hard rules. Consistency with existing API design in this code +base is also important. + +### Unintentional exposure of symbols + +The following things should not be exposed as part of the public API: + +- Private symbols (prefixed with `_`) +- Symbols from a third-party module or the standard library +- Helper classes that can not be instantiated from Python + +### Naming + +As a blanket rule, we follow the naming guidelines for capitalization in PEP 8. + +Naming should be consistent. We should use the same English words for the same +concepts throughout the public API. When abbreviations are used, they should be +commonly understood, and they should also be used consistently across the public +API. + +For all attributes of a class: + +- Properties and member variables should be nouns +- Methods should be verbs +- Methods that take no arguments, are idempotent and cheap (O(1) or trivial), + and do not mutate observable state should be properties + +Make sure conceptual pairs match, e.g. add/remove, get/set, create/delete, +alloc/free. + +Free functions should be verbs. + +### Enumerations + +Enumerations from the underlying `cuda_bindings` should not be re-exposed. +Instead, a new `StrEnum` subclass should be used to define the values. Anywhere +a `StrEnum` is accepted as an argument, a `str` should also be acceptable. An +invalid value should raise an exception. When a function returns a `str` drawn +from a small number of values, return a `StrEnum` subclass instead. + +### Exception handling + +Raising exceptions is preferred over a C-style return code that must be checked +by the user. + +### Type annotations + +Python or Cython type annotations should be included for all public APIs. Avoid +the use of `Any` unless absolutely necessary. The argument and return types as +defined in the docstrings should match the type annotations. + +Python imports should generally be outside of an if typing.TYPE_CHECK: block, even if the imported object is only used in type annotations. Use if typing.TYPE_CHECK: only to avoid creating import cycles. (This guidance maximizes compatibility with the cross-reference mechanisms in Sphinx.) + +### Semantics + +APIs should exist for both manual resource management (such as `close()`) and +automatic resource management, using context managers or destructors where +appropriate. Context managers should be implemented with `__enter__` and +`__exit__`, not `contextlib.contextmanager`. For destructors use `__dealloc__` +where possible, otherwise `__del__`. + +### Documentation + +The entirety of the public API should be documented in `api.rst` or one of the +subpages linked from it. Classes that are not directly instantiable but which +may be returned through the public API should be documented in `api_private.rst` +so that they are documented but don't appear in the main index. + +### API stability + +Reviews should point out where existing public APIs are broken. diff --git a/cuda_core/LICENSE b/cuda_core/LICENSE index f433b1a53f5..d6f74778be8 100644 --- a/cuda_core/LICENSE +++ b/cuda_core/LICENSE @@ -1,3 +1,4 @@ +Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. Apache License Version 2.0, January 2004 diff --git a/cuda_core/MANIFEST.in b/cuda_core/MANIFEST.in index f476ae8ef2c..f63b324cab7 100644 --- a/cuda_core/MANIFEST.in +++ b/cuda_core/MANIFEST.in @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 -recursive-include cuda/core *.pyx *.pxd *.pxi -recursive-include cuda/core/_cpp *.cpp *.hpp +recursive-include cuda/core *.pyx *.pxd *.pxi *.pyi +recursive-include cuda/core/_cpp *.cpp *.h *.hpp recursive-include cuda/core/_include *.h *.hpp +include cuda/core/py.typed +include NOTICE diff --git a/cuda_core/NOTICE b/cuda_core/NOTICE new file mode 100644 index 00000000000..c4625e23899 --- /dev/null +++ b/cuda_core/NOTICE @@ -0,0 +1,13 @@ +SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +SPDX-License-Identifier: Apache-2.0 + +CUDA Python - cuda.core +Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +Third-party software notices +---------------------------- + +DLPack +Copyright (c) 2017 by Contributors +Licensed under the Apache License, Version 2.0. +Source: https://github.com/dmlc/dlpack diff --git a/cuda_core/README.md b/cuda_core/README.md index 9925511ef9d..74b2b6638f7 100644 --- a/cuda_core/README.md +++ b/cuda_core/README.md @@ -1,32 +1,34 @@ -# `cuda.core`: (experimental) Pythonic CUDA module +# `cuda.core`: Pythonic CUDA module Currently under active development; see [the documentation](https://nvidia.github.io/cuda-python/cuda-core/latest/) for more details. ## Installing -Please refer to the [Installation page](https://nvidia.github.io/cuda-python/cuda-bindings/latest/install.html) for instructions and required/optional dependencies. +Please refer to the [Installation page](https://nvidia.github.io/cuda-python/cuda-core/latest/install.html) for instructions and required/optional dependencies. ## Developing This subpackage adheres to the developing practices described in the parent metapackage [CONTRIBUTING.md](https://github.com/NVIDIA/cuda-python/blob/main/CONTRIBUTING.md). +## Debugging + +Pass the `pip` / `uv` configuration option `-C="debug=True"` or +`--config-settings="debug=True"` to explicitly to build debuggable binaries. +Debuggable binaries are built by default for editable builds. + +Debuggable builds are not supported on Windows. + ## Testing 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: -1. Set up environment variable `CUDA_HOME` with the path to the CUDA Toolkit installation. +1. Set up environment variable `CUDA_PATH` (or `CUDA_HOME`) with the path to the CUDA Toolkit installation. Note: If both are set, `CUDA_PATH` takes precedence. 2. Run `build_tests` script located in `tests/cython` appropriate to your platform. This will both cythonize the tests and build them. To run these tests: diff --git a/cuda_core/build_hooks.py b/cuda_core/build_hooks.py index a98a33b6fb5..dfd08d56733 100644 --- a/cuda_core/build_hooks.py +++ b/cuda_core/build_hooks.py @@ -28,13 +28,44 @@ COMPILE_FOR_COVERAGE = bool(int(os.environ.get("CUDA_PYTHON_COVERAGE", "0"))) +# Please keep in sync with the copy in cuda_bindings/build_hooks.py. +def _import_get_cuda_path_or_home(): + """Import get_cuda_path_or_home, working around PEP 517 namespace shadowing. + + See https://github.com/NVIDIA/cuda-python/issues/1824 for why this helper is needed. + """ + try: + import cuda.pathfinder + except ModuleNotFoundError as exc: + if exc.name not in ("cuda", "cuda.pathfinder"): + raise + try: + import cuda + except ModuleNotFoundError: + cuda = None + + for p in sys.path: + sp_cuda = os.path.join(p, "cuda") + if os.path.isdir(os.path.join(sp_cuda, "pathfinder")): + cuda.__path__ = list(cuda.__path__) + [sp_cuda] + break + else: + raise ModuleNotFoundError( + "cuda-pathfinder is not installed in the build environment. " + "Ensure 'cuda-pathfinder>=1.5' is in build-system.requires." + ) + import cuda.pathfinder + + return cuda.pathfinder.get_cuda_path_or_home + + @functools.cache -def _get_cuda_paths() -> list[str]: - cuda_path = os.environ.get("CUDA_PATH", os.environ.get("CUDA_HOME", None)) +def _get_cuda_path() -> str: + get_cuda_path_or_home = _import_get_cuda_path_or_home() + cuda_path = get_cuda_path_or_home() if not cuda_path: raise RuntimeError("Environment variable CUDA_PATH or CUDA_HOME is not set") - cuda_path = cuda_path.split(os.pathsep) - print("CUDA paths:", cuda_path) + print("CUDA path:", cuda_path) return cuda_path @@ -60,21 +91,20 @@ def _determine_cuda_major_version() -> str: return cuda_major # Derive from the CUDA headers (the authoritative source for what we compile against). - cuda_path = _get_cuda_paths() - for root in cuda_path: - cuda_h = os.path.join(root, "include", "cuda.h") - try: - with open(cuda_h, encoding="utf-8") as f: - for line in f: - m = re.match(r"^#\s*define\s+CUDA_VERSION\s+(\d+)\s*$", line) - if m: - v = int(m.group(1)) - # CUDA_VERSION is e.g. 12020 for 12.2. - cuda_major = str(v // 1000) - print("CUDA MAJOR VERSION:", cuda_major) - return cuda_major - except OSError: - continue + cuda_path = _get_cuda_path() + cuda_h = os.path.join(cuda_path, "include", "cuda.h") + try: + with open(cuda_h, encoding="utf-8") as f: + for line in f: + m = re.match(r"^#\s*define\s+CUDA_VERSION\s+(\d+)\s*$", line) + if m: + v = int(m.group(1)) + # CUDA_VERSION is e.g. 12020 for 12.2. + cuda_major = str(v // 1000) + print("CUDA MAJOR VERSION:", cuda_major) + return cuda_major + except OSError: + pass # CUDA_PATH or CUDA_HOME is required for the build, so we should not reach here # in normal circumstances. Raise an error to make the issue clear. @@ -89,7 +119,7 @@ def _determine_cuda_major_version() -> str: _extensions = None -def _build_cuda_core(): +def _build_cuda_core(debug=False): # Customizing the build hooks is needed because we must defer cythonization until cuda-bindings, # now a required build-time dependency that's dynamically installed via the other hook below, # is installed. Otherwise, cimport any cuda.bindings modules would fail! @@ -113,12 +143,21 @@ def _build_cuda_core(): # cuda-bindings not available in editable mode, will use installed version pass + _posix_only_modules = frozenset( + { + "_utils/_wsl_locale", + } + ) + # It seems setuptools' wildcard support has problems for namespace packages, # so we explicitly spell out all Extension instances. def module_names(): root_path = os.path.sep.join(["cuda", "core", ""]) for filename in glob.glob(f"{root_path}/**/*.pyx", recursive=True): - yield filename[len(root_path) : -4] + mod = filename[len(root_path) : -4] + if sys.platform == "win32" and mod.replace(os.path.sep, "/") in _posix_only_modules: + continue + yield mod def get_sources(mod_name): """Get source files for a module, including any .cpp files.""" @@ -132,8 +171,23 @@ def get_sources(mod_name): return sources - all_include_dirs = [os.path.join(root, "include") for root in _get_cuda_paths()] + all_include_dirs = [os.path.join(_get_cuda_path(), "include")] extra_compile_args = [] + extra_link_args = [] + extra_cythonize_kwargs = {} + if sys.platform == "win32": + extra_compile_args += ["/std:c++17"] + if debug: + raise RuntimeError("Debuggable builds are not supported on Windows.") + else: + extra_compile_args += ["-std=c++17"] + if debug: + extra_cythonize_kwargs["gdb_debug"] = True + extra_compile_args += ["-g", "-O0"] + extra_compile_args += ["-D _GLIBCXX_ASSERTIONS"] + else: + extra_compile_args += ["-O2"] + extra_link_args += ["-Wl,--strip-all"] if COMPILE_FOR_COVERAGE: # CYTHON_TRACE_NOGIL indicates to trace nogil functions. It is not # related to free-threading builds. @@ -150,6 +204,7 @@ def get_sources(mod_name): + all_include_dirs, language="c++", extra_compile_args=extra_compile_args, + extra_link_args=extra_link_args, ) for mod in module_names() ) @@ -167,6 +222,7 @@ def get_sources(mod_name): nthreads=nthreads, compiler_directives=compiler_directives, compile_time_env=compile_time_env, + **extra_cythonize_kwargs, ) return @@ -252,7 +308,9 @@ def _add_cython_include_paths_to_pth(wheel_path: str) -> None: def build_editable(wheel_directory, config_settings=None, metadata_directory=None): - _build_cuda_core() + debug_default = sys.platform != "win32" # Debug builds not supported on Windows + debug = config_settings.get("debug", debug_default) if config_settings else debug_default + _build_cuda_core(debug=debug) wheel_name = _build_meta.build_editable(wheel_directory, config_settings, metadata_directory) # Patch the .pth file to add Cython include paths @@ -263,7 +321,8 @@ def build_editable(wheel_directory, config_settings=None, metadata_directory=Non def build_wheel(wheel_directory, config_settings=None, metadata_directory=None): - _build_cuda_core() + debug = config_settings.get("debug", False) if config_settings else False + _build_cuda_core(debug=debug) return _build_meta.build_wheel(wheel_directory, config_settings, metadata_directory) diff --git a/cuda_core/cuda/core/__init__.py b/cuda_core/cuda/core/__init__.py index dfba887144e..dc6fefdffea 100644 --- a/cuda_core/cuda/core/__init__.py +++ b/cuda_core/cuda/core/__init__.py @@ -1,46 +1,88 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 from cuda.core._version import __version__ -try: + +def _import_versioned_module() -> None: + import importlib + from cuda import bindings -except ImportError: - raise ImportError("cuda.bindings 12.x or 13.x must be installed") from None -else: - cuda_major, cuda_minor = bindings.__version__.split(".")[:2] + + cuda_major = bindings.__version__.split(".")[0] if cuda_major not in ("12", "13"): raise ImportError("cuda.bindings 12.x or 13.x must be installed") -import importlib - -subdir = f"cu{cuda_major}" -try: - versioned_mod = importlib.import_module(f".{subdir}", __package__) - # Import all symbols from the module - globals().update(versioned_mod.__dict__) -except ImportError: - # This is not a wheel build, but a conda or local build, do nothing - pass -else: - del versioned_mod -finally: - del bindings, importlib, subdir, cuda_major, cuda_minor - -from cuda.core import system, utils + subdir = f"cu{cuda_major}" + try: + versioned_mod = importlib.import_module(f".{subdir}", __package__) + # Import all symbols from the module + globals().update(versioned_mod.__dict__) + except ImportError: + # This is not a wheel build, but a conda or local build, do nothing + pass + + +_import_versioned_module() +del _import_versioned_module + + +def _patch_rlcompleter_for_cython_properties() -> None: + # TODO: This can be removed when Python 3.13 is our minimum-supported version: + # https://github.com/python/cpython/pull/149577 + + # Cython @property on cdef class compiles to a C-level getset_descriptor, + # which rlcompleter's narrow isinstance(..., property) check misses; the + # fallback getattr() then invokes the descriptor and any non-AttributeError + # it raises kills tab completion. Extend that isinstance check to also + # match getset_descriptor / member_descriptor. Only installed in + # interactive mode so library users running scripts see no global + # rlcompleter side effect. + import os + + if int(os.environ.get("CUDA_CORE_DONT_FIX_TAB_COMPLETION", "0")): + # Explicit opt-out for users who don't want the global rlcompleter + # side effect, even in an interactive session. + return + + import rlcompleter + from types import GetSetDescriptorType, MemberDescriptorType + + # This works by overriding the `property` built-in with a custom subclass of + # property, but only in the rlcompleter module. This subclass overrides the + # `__instancecheck__` method to also return True for getset_descriptor and + # member_descriptor types, which are what Cython uses for properties on cdef + # classes. + class _PatchedPropMeta(type): + def __instancecheck__(cls, inst: object) -> bool: + return isinstance(inst, (property, GetSetDescriptorType, MemberDescriptorType)) + + class _PatchedProperty(metaclass=_PatchedPropMeta): + pass + + rlcompleter.property = _PatchedProperty # type: ignore[attr-defined] + + +_patch_rlcompleter_for_cython_properties() +del _patch_rlcompleter_for_cython_properties + + +from cuda.core import checkpoint, system, utils +from cuda.core._context import Context, ContextOptions from cuda.core._device import Device -from cuda.core._event import Event, EventOptions -from cuda.core._graph import ( - Graph, - GraphBuilder, - GraphCompleteOptions, - GraphDebugPrintOptions, +from cuda.core._device_resources import ( + DeviceResources, + SMResource, + SMResourceOptions, + WorkqueueResource, + WorkqueueResourceOptions, ) +from cuda.core._event import Event, EventOptions from cuda.core._graphics import GraphicsResource +from cuda.core._host import Host from cuda.core._launch_config import LaunchConfig from cuda.core._launcher import launch -from cuda.core._layout import _StridedLayout from cuda.core._linker import Linker, LinkerOptions from cuda.core._memory import ( Buffer, @@ -48,6 +90,7 @@ DeviceMemoryResourceOptions, GraphMemoryResource, LegacyPinnedMemoryResource, + ManagedBuffer, ManagedMemoryResource, ManagedMemoryResourceOptions, MemoryResource, @@ -56,10 +99,6 @@ VirtualMemoryResource, VirtualMemoryResourceOptions, ) -from cuda.core._memoryview import ( - StridedMemoryView, - args_viewable_as_strided_memory, -) from cuda.core._module import Kernel, ObjectCode from cuda.core._program import Program, ProgramOptions from cuda.core._stream import ( @@ -68,3 +107,15 @@ Stream, StreamOptions, ) +from cuda.core._tensor_map import TensorMapDescriptor, TensorMapDescriptorOptions + +# isort: split +# Texture/surface types live under the cuda.core.texture namespace (not the +# flat cuda.core namespace); import the subpackage so it is available as +# `cuda.core.texture` after `import cuda.core`. +# Must come after the cuda.core._* extension imports above: loading graph +# earlier interacts badly with the merged-wheel __path__ rewrite and leaves +# Graph/GraphBuilder/GraphCompleteOptions/GraphDebugPrintOptions missing from +# cuda.core.graph. +import cuda.core.graph +import cuda.core.texture diff --git a/cuda_core/cuda/core/_context.pxd b/cuda_core/cuda/core/_context.pxd index 9e1a460f50f..b0edf5a0674 100644 --- a/cuda_core/cuda/core/_context.pxd +++ b/cuda_core/cuda/core/_context.pxd @@ -1,8 +1,8 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 -from cuda.core._resource_handles cimport ContextHandle +from cuda.core._resource_handles cimport ContextHandle, GreenCtxHandle cdef class Context: """Cython declaration for Context class. @@ -18,3 +18,8 @@ cdef class Context: @staticmethod cdef Context _from_handle(type cls, ContextHandle h_context, int device_id) + + @staticmethod + cdef Context _from_green_ctx(type cls, GreenCtxHandle h_green_ctx, int device_id) + + cpdef close(self) diff --git a/cuda_core/cuda/core/_context.pyi b/cuda_core/cuda/core/_context.pyi new file mode 100644 index 00000000000..afbc130882e --- /dev/null +++ b/cuda_core/cuda/core/_context.pyi @@ -0,0 +1,87 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_context.pyx + +from __future__ import annotations + +from collections.abc import Sequence +from dataclasses import dataclass + +import cuda.bindings.driver +from cuda.core._device_resources import (DeviceResources, SMResource, + WorkqueueResource) +from cuda.core._stream import Stream + + +class Context: + """CUDA context wrapper. + + Context objects represent CUDA contexts and cannot be instantiated directly. + Use Device or Stream APIs to obtain context objects. + """ + + def close(self): + """Release this context wrapper's underlying CUDA handles.""" + + def __init__(self, *args, **kwargs) -> None: + ... + + @property + def handle(self) -> cuda.bindings.driver.CUcontext | None: + """Return the underlying CUcontext handle.""" + + @property + def _handle(self) -> cuda.bindings.driver.CUcontext | None: + ... + + @property + def is_green(self) -> bool: + """True if this context was created from device resources.""" + + @property + def resources(self) -> DeviceResources: + """Query the hardware resources provisioned for this context. + + For green contexts, returns the resources this context was created + with (SM partition, workqueue config). For primary contexts, returns + the full device resources. + + Raises :class:`RuntimeError` if the context has been closed. + """ + + def create_stream(self, options: object=None) -> Stream: + """Create a new stream bound to this green context. + + This method is only available on green contexts. For primary + contexts, use :meth:`Device.create_stream` instead. + + Parameters + ---------- + options : :obj:`~_stream.StreamOptions`, optional + Customizable dataclass for stream creation options. + + Returns + ------- + :obj:`~_stream.Stream` + Newly created stream object. + """ + + def __eq__(self, other: object) -> bool: + ... + + def __hash__(self) -> int: + ... + + def __repr__(self) -> str: + ... + +@dataclass +class ContextOptions: + """Options for context creation. + + Attributes + ---------- + resources : :obj:`~cuda.core.typing.DeviceResourcesType` + Device resources used to create a green context. + """ + resources: DeviceResourcesType +__all__ = ['Context', 'ContextOptions'] +DeviceResourcesType = Sequence[SMResource | WorkqueueResource] \ No newline at end of file diff --git a/cuda_core/cuda/core/_context.pyx b/cuda_core/cuda/core/_context.pyx index b2b21465c81..6da72addb0d 100644 --- a/cuda_core/cuda/core/_context.pyx +++ b/cuda_core/cuda/core/_context.pyx @@ -2,18 +2,38 @@ # # SPDX-License-Identifier: Apache-2.0 +from __future__ import annotations + +from collections.abc import Sequence from dataclasses import dataclass +from typing import TYPE_CHECKING +from cuda.bindings cimport cydriver +from cuda.core._device_resources cimport DeviceResources, SMResource, WorkqueueResource +from cuda.core._device_resources import SMResource, WorkqueueResource from cuda.core._resource_handles cimport ( ContextHandle, + GreenCtxHandle, + as_cu, + create_context_handle_from_green_ctx, + get_context_green_ctx, + get_last_error, as_intptr, as_py, ) +from cuda.core._stream import Stream +from cuda.core._utils.cuda_utils cimport HANDLE_RETURN + +if TYPE_CHECKING: + import cuda.bindings.driver # no-cython-lint __all__ = ['Context', 'ContextOptions'] +DeviceResourcesType = Sequence[SMResource | WorkqueueResource] + + cdef class Context: """CUDA context wrapper. @@ -21,7 +41,7 @@ cdef class Context: Use Device or Stream APIs to obtain context objects. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: raise RuntimeError("Context objects cannot be instantiated directly. Please use Device or Stream APIs.") @staticmethod @@ -32,18 +52,89 @@ cdef class Context: ctx._device_id = device_id return ctx + @staticmethod + cdef Context _from_green_ctx(type cls, GreenCtxHandle h_green_ctx, int device_id): + """Create Context from an owning green context handle.""" + cdef ContextHandle h_context = create_context_handle_from_green_ctx(h_green_ctx) + if not h_context: + HANDLE_RETURN(get_last_error()) + raise RuntimeError("Failed to create CUDA context view from green context") + return Context._from_handle(cls, h_context, device_id) + @property - def handle(self): + def handle(self) -> cuda.bindings.driver.CUcontext | None: """Return the underlying CUcontext handle.""" - if self._h_context.get() == NULL: + if not self._h_context: + return None + if as_cu(self._h_context) == NULL: return None return as_py(self._h_context) @property - def _handle(self): + def _handle(self) -> cuda.bindings.driver.CUcontext | None: return self.handle - def __eq__(self, other): + @property + def is_green(self) -> bool: + """True if this context was created from device resources.""" + if not self._h_context: + return False + return get_context_green_ctx(self._h_context).get() != NULL + + @property + def resources(self) -> DeviceResources: + """Query the hardware resources provisioned for this context. + + For green contexts, returns the resources this context was created + with (SM partition, workqueue config). For primary contexts, returns + the full device resources. + + Raises :class:`RuntimeError` if the context has been closed. + """ + if not self._h_context: + raise RuntimeError("Cannot query resources on a closed context") + return DeviceResources._init_from_ctx(self._h_context, self._device_id) + + def create_stream(self, options: object = None) -> Stream: + """Create a new stream bound to this green context. + + This method is only available on green contexts. For primary + contexts, use :meth:`Device.create_stream` instead. + + Parameters + ---------- + options : :obj:`~_stream.StreamOptions`, optional + Customizable dataclass for stream creation options. + + Returns + ------- + :obj:`~_stream.Stream` + Newly created stream object. + """ + if not self._h_context: + raise RuntimeError("Cannot create a stream on a closed context") + if not self.is_green: + raise RuntimeError( + "Context.create_stream() is only supported on green contexts. " + "Use Device.create_stream() for primary contexts." + ) + + return Stream._init(options=options, device_id=self._device_id, ctx=self) + + cpdef close(self): + """Release this context wrapper's underlying CUDA handles.""" + cdef cydriver.CUcontext current_ctx + if self._h_context and as_cu(self._h_context) != NULL: + with nogil: + HANDLE_RETURN(cydriver.cuCtxGetCurrent(¤t_ctx)) + if current_ctx == as_cu(self._h_context): + raise RuntimeError( + "Cannot close a CUDA context while it is current. " + "Restore a previous context before closing this context." + ) + self._h_context.reset() + + def __eq__(self, other: object) -> bool: if not isinstance(other, Context): return NotImplemented cdef Context _other = other @@ -57,9 +148,12 @@ cdef class Context: @dataclass -class ContextOptions: +cdef class ContextOptions: """Options for context creation. - Currently unused, reserved for future use. + Attributes + ---------- + resources : :obj:`~cuda.core.typing.DeviceResourcesType` + Device resources used to create a green context. """ - pass # TODO + resources: DeviceResourcesType diff --git a/cuda_core/cuda/core/_cpp/REGISTRY_DESIGN.md b/cuda_core/cuda/core/_cpp/REGISTRY_DESIGN.md new file mode 100644 index 00000000000..089f98acd93 --- /dev/null +++ b/cuda_core/cuda/core/_cpp/REGISTRY_DESIGN.md @@ -0,0 +1,52 @@ +# Handle and Object Registries + +When Python-managed objects round-trip through the CUDA driver (e.g., +querying a graph's nodes and getting back raw `CUgraphNode` pointers), +we need to recover the original Python object rather than creating a +duplicate. + +This document describes the approach used to achieve this. The pattern +is driven mainly by needs arising in the context of CUDA graphs, but +it is general and can be extended to other object types as needs arise. + +This solves the same problem as pybind11's `registered_instances` map +and is sometimes called the Identity Map pattern. Two registries work +together to map a raw driver handle all the way back to the original +Python object. Both use weak references so they +do not prevent cleanup. Entries are removed either explicitly (via +`destroy()` or a Box destructor) or implicitly when the weak reference +expires. + +## Level 1: Driver Handle -> Resource Handle (C++) + +`HandleRegistry` in `resource_handles.cpp` maps a raw CUDA handle +(e.g., `CUevent`, `CUkernel`, `CUgraphNode`) to the `weak_ptr` that +owns it. When a `_ref` constructor receives a raw handle, it +checks the registry first. If found, it returns the existing +`shared_ptr`, preserving the Box and its metadata (e.g., `EventBox` +carries timing/IPC flags, `KernelBox` carries the library dependency). + +Without this level, a round-tripped handle would produce a new Box +with default metadata, losing information that was set at creation. + +Instances: `context_registry`, `stream_registry`, `event_registry`, +`kernel_registry`, `graph_node_registry`. + +## Level 2: Resource Handle -> Python Object (Cython) + +`_node_registry` in `_graph_node.pyx` is a `WeakValueDictionary` +mapping a resource address (`shared_ptr::get()`) to a Python +`GraphNode` object. When `GraphNode._create` receives a handle from +Level 1, it checks this registry. If found, it returns the existing +Python object. + +Without this level, each driver round-trip would produce a distinct +Python object for the same logical node, resulting in surprising +behavior: + +```python +a = g.empty() +a.succ = {b} +b2, = a.succ # queries driver, gets back CUgraphNode for b +assert b2 is b # fails without Level 2 registry +``` diff --git a/cuda_core/cuda/core/_cpp/resource_handles.cpp b/cuda_core/cuda/core/_cpp/resource_handles.cpp index 714a84b6ec4..b97b207d2a4 100644 --- a/cuda_core/cuda/core/_cpp/resource_handles.cpp +++ b/cuda_core/cuda/core/_cpp/resource_handles.cpp @@ -6,12 +6,20 @@ #include "resource_handles.hpp" #include +#include #include +#include #include +#include #include +#include #include #include +#ifndef _WIN32 +#include +#endif + namespace cuda_core { // ============================================================================ @@ -24,6 +32,12 @@ namespace cuda_core { decltype(&cuDevicePrimaryCtxRetain) p_cuDevicePrimaryCtxRetain = nullptr; decltype(&cuDevicePrimaryCtxRelease) p_cuDevicePrimaryCtxRelease = nullptr; decltype(&cuCtxGetCurrent) p_cuCtxGetCurrent = nullptr; +decltype(&cuGreenCtxCreate) p_cuGreenCtxCreate = nullptr; +decltype(&cuGreenCtxDestroy) p_cuGreenCtxDestroy = nullptr; +decltype(&cuCtxFromGreenCtx) p_cuCtxFromGreenCtx = nullptr; +decltype(&cuDevResourceGenerateDesc) p_cuDevResourceGenerateDesc = nullptr; + +decltype(&cuGreenCtxStreamCreate) p_cuGreenCtxStreamCreate = nullptr; decltype(&cuStreamCreateWithPriority) p_cuStreamCreateWithPriority = nullptr; decltype(&cuStreamDestroy) p_cuStreamDestroy = nullptr; @@ -56,12 +70,37 @@ decltype(&cuLibraryLoadData) p_cuLibraryLoadData = nullptr; decltype(&cuLibraryUnload) p_cuLibraryUnload = nullptr; decltype(&cuLibraryGetKernel) p_cuLibraryGetKernel = nullptr; +// Graph +decltype(&cuGraphDestroy) p_cuGraphDestroy = nullptr; +decltype(&cuGraphExecDestroy) p_cuGraphExecDestroy = nullptr; +decltype(&cuUserObjectCreate) p_cuUserObjectCreate = nullptr; +decltype(&cuUserObjectRelease) p_cuUserObjectRelease = nullptr; +decltype(&cuGraphRetainUserObject) p_cuGraphRetainUserObject = nullptr; + // Linker decltype(&cuLinkDestroy) p_cuLinkDestroy = nullptr; // GL interop pointers +decltype(&cuGraphicsUnmapResources) p_cuGraphicsUnmapResources = nullptr; decltype(&cuGraphicsUnregisterResource) p_cuGraphicsUnregisterResource = nullptr; +decltype(&cuArray3DCreate) p_cuArray3DCreate = nullptr; +decltype(&cuArrayDestroy) p_cuArrayDestroy = nullptr; +decltype(&cuMipmappedArrayCreate) p_cuMipmappedArrayCreate = nullptr; +decltype(&cuMipmappedArrayDestroy) p_cuMipmappedArrayDestroy = nullptr; +decltype(&cuMipmappedArrayGetLevel) p_cuMipmappedArrayGetLevel = nullptr; +decltype(&cuTexObjectCreate) p_cuTexObjectCreate = nullptr; +decltype(&cuTexObjectDestroy) p_cuTexObjectDestroy = nullptr; +decltype(&cuSurfObjectCreate) p_cuSurfObjectCreate = nullptr; +decltype(&cuSurfObjectDestroy) p_cuSurfObjectDestroy = nullptr; + +// SM resource split (13.1+ — may be null on older drivers/bindings) +#if CUDA_VERSION >= 13010 +decltype(&cuDevSmResourceSplit) p_cuDevSmResourceSplit = nullptr; +#else +void* p_cuDevSmResourceSplit = nullptr; +#endif + // NVRTC function pointers decltype(&nvrtcDestroyProgram) p_nvrtcDestroyProgram = nullptr; @@ -165,13 +204,8 @@ class HandleRegistry { } void unregister_handle(const Key& key) noexcept { - try { - std::lock_guard lock(mutex_); - auto it = map_.find(key); - if (it != map_.end() && it->second.expired()) { - map_.erase(it); - } - } catch (...) {} + std::lock_guard lock(mutex_); + map_.erase(key); } Handle lookup(const Key& key) { @@ -219,12 +253,108 @@ void clear_last_error() noexcept { namespace { struct ContextBox { CUcontext resource; + GreenCtxHandle h_green_ctx; +}; + +struct GreenCtxBox { + CUgreenCtx resource; }; + +static const ContextBox* get_box(const ContextHandle& h) noexcept { + const CUcontext* p = h.get(); + return reinterpret_cast( + reinterpret_cast(p) - offsetof(ContextBox, resource) + ); +} + +// See REGISTRY_DESIGN.md (Level 1: Driver Handle -> Resource Handle) +static HandleRegistry context_registry; + +// Create a context handle reference, with optional green context as source. +ContextHandle create_context_handle_ref(CUcontext ctx, GreenCtxHandle h_green_ctx) { + if (!ctx) { + return {}; + } + if (auto h = context_registry.lookup(ctx)) { + return h; + } + auto box = std::shared_ptr( + new ContextBox{ctx, std::move(h_green_ctx)}, + [](const ContextBox* b) { + context_registry.unregister_handle(b->resource); + delete b; + } + ); + ContextHandle h(box, &box->resource); + context_registry.register_handle(ctx, h); + return h; +} } // namespace ContextHandle create_context_handle_ref(CUcontext ctx) { - auto box = std::make_shared(ContextBox{ctx}); - return ContextHandle(box, &box->resource); + return create_context_handle_ref(ctx, {}); +} + +ContextHandle create_context_handle_from_green_ctx(const GreenCtxHandle& h_green_ctx) { + GILReleaseGuard gil; + if (!h_green_ctx) { + return {}; + } + if (!p_cuCtxFromGreenCtx) { + err = CUDA_ERROR_NOT_SUPPORTED; + return {}; + } + + CUcontext ctx = nullptr; + if (CUDA_SUCCESS != (err = p_cuCtxFromGreenCtx(&ctx, as_cu(h_green_ctx)))) { + return {}; + } + + return create_context_handle_ref(ctx, h_green_ctx); +} + +GreenCtxHandle get_context_green_ctx(const ContextHandle& h) noexcept { + if (!h) { + return {}; + } + return get_box(h)->h_green_ctx; +} + +GreenCtxHandle create_green_ctx_handle(CUdevResource* resources, unsigned int nbResources, + CUdevice dev, unsigned int flags) { + GILReleaseGuard gil; + if (!p_cuDevResourceGenerateDesc || !p_cuGreenCtxCreate || !p_cuGreenCtxDestroy) { + err = CUDA_ERROR_NOT_SUPPORTED; + return {}; + } + + CUdevResourceDesc desc = nullptr; + if (CUDA_SUCCESS != (err = p_cuDevResourceGenerateDesc(&desc, resources, nbResources))) { + return {}; + } + + CUgreenCtx green_ctx = nullptr; + if (CUDA_SUCCESS != (err = p_cuGreenCtxCreate(&green_ctx, desc, dev, flags))) { + return {}; + } + + auto box = std::shared_ptr( + new GreenCtxBox{green_ctx}, + [](const GreenCtxBox* b) { + GILReleaseGuard gil; + p_cuGreenCtxDestroy(b->resource); + delete b; + } + ); + return GreenCtxHandle(box, &box->resource); +} + +GreenCtxHandle create_green_ctx_handle_ref(CUgreenCtx green_ctx) { + if (!green_ctx) { + return {}; + } + auto box = std::make_shared(GreenCtxBox{green_ctx}); + return GreenCtxHandle(box, &box->resource); } // Thread-local cache of primary contexts indexed by device ID @@ -246,14 +376,16 @@ ContextHandle get_primary_context(int device_id) { } auto box = std::shared_ptr( - new ContextBox{ctx}, + new ContextBox{ctx, {}}, [device_id](const ContextBox* b) { + context_registry.unregister_handle(b->resource); GILReleaseGuard gil; p_cuDevicePrimaryCtxRelease(device_id); delete b; } ); auto h = ContextHandle(box, &box->resource); + context_registry.register_handle(ctx, h); // Update cache if (static_cast(device_id) >= primary_context_cache.size()) { @@ -282,33 +414,78 @@ ContextHandle get_current_context() { namespace { struct StreamBox { CUstream resource; + ContextHandle h_context; }; + +static const StreamBox* get_box(const StreamHandle& h) noexcept { + const CUstream* p = h.get(); + return reinterpret_cast( + reinterpret_cast(p) - offsetof(StreamBox, resource) + ); +} + +// See REGISTRY_DESIGN.md (Level 1: Driver Handle -> Resource Handle) +static HandleRegistry stream_registry; } // namespace StreamHandle create_stream_handle(const ContextHandle& h_ctx, unsigned int flags, int priority) { GILReleaseGuard gil; CUstream stream; - if (CUDA_SUCCESS != (err = p_cuStreamCreateWithPriority(&stream, flags, priority))) { - return {}; + + // Dispatch: green context uses cuGreenCtxStreamCreate, primary uses cuStreamCreateWithPriority + GreenCtxHandle h_green = get_context_green_ctx(h_ctx); + if (h_green) { + if (!p_cuGreenCtxStreamCreate) { + err = CUDA_ERROR_NOT_SUPPORTED; + return {}; + } + if (CUDA_SUCCESS != (err = p_cuGreenCtxStreamCreate(&stream, as_cu(h_green), flags, priority))) { + return {}; + } + } else { + if (CUDA_SUCCESS != (err = p_cuStreamCreateWithPriority(&stream, flags, priority))) { + return {}; + } } auto box = std::shared_ptr( - new StreamBox{stream}, - [h_ctx](const StreamBox* b) { + new StreamBox{stream, h_ctx}, + [](const StreamBox* b) { + stream_registry.unregister_handle(b->resource); GILReleaseGuard gil; p_cuStreamDestroy(b->resource); delete b; } ); - return StreamHandle(box, &box->resource); + StreamHandle h(box, &box->resource); + stream_registry.register_handle(stream, h); + return h; } StreamHandle create_stream_handle_ref(CUstream stream) { - auto box = std::make_shared(StreamBox{stream}); - return StreamHandle(box, &box->resource); + if (auto h = stream_registry.lookup(stream)) { + return h; + } + auto box = std::shared_ptr( + new StreamBox{stream, {}}, + [](const StreamBox* b) { + stream_registry.unregister_handle(b->resource); + delete b; + } + ); + StreamHandle h(box, &box->resource); + stream_registry.register_handle(stream, h); + return h; } StreamHandle create_stream_handle_with_owner(CUstream stream, PyObject* owner) { + if (auto h = stream_registry.lookup(stream)) { + // Reuse handles that already carry structural context metadata, e.g. + // cuda-core-owned streams. + if (get_box(h)->h_context) { + return h; + } + } if (!owner) { return create_stream_handle_ref(stream); } @@ -319,8 +496,11 @@ StreamHandle create_stream_handle_with_owner(CUstream stream, PyObject* owner) { return create_stream_handle_ref(stream); } Py_INCREF(owner); + // Owner-backed handles are NOT registered in the stream registry to avoid + // corruption when multiple owners wrap the same CUstream (each stacks its + // own Py_INCREF/Py_DECREF independently). auto box = std::shared_ptr( - new StreamBox{stream}, + new StreamBox{stream, {}}, [owner](const StreamBox* b) { GILAcquireGuard gil; if (gil.acquired()) { @@ -332,6 +512,21 @@ StreamHandle create_stream_handle_with_owner(CUstream stream, PyObject* owner) { return StreamHandle(box, &box->resource); } +void py_object_user_object_destroy(void* py_object) noexcept { + if (!py_object) { + return; + } + GILAcquireGuard gil; + if (!gil.acquired()) { + return; + } + Py_DECREF(reinterpret_cast(py_object)); +} + +ContextHandle get_stream_context(const StreamHandle& h) noexcept { + return h ? get_box(h)->h_context : ContextHandle{}; +} + StreamHandle get_legacy_stream() { static StreamHandle handle = create_stream_handle_ref(CU_STREAM_LEGACY); return handle; @@ -349,8 +544,8 @@ StreamHandle get_per_thread_stream() { namespace { struct EventBox { CUevent resource; - bool timing_disabled; - bool busy_waited; + bool timing_enabled; + bool is_blocking_sync; bool ipc_enabled; int device_id; ContextHandle h_context; @@ -364,12 +559,12 @@ static const EventBox* get_box(const EventHandle& h) { ); } -bool get_event_timing_disabled(const EventHandle& h) noexcept { - return h ? get_box(h)->timing_disabled : true; +bool get_event_timing_enabled(const EventHandle& h) noexcept { + return h ? get_box(h)->timing_enabled : false; } -bool get_event_busy_waited(const EventHandle& h) noexcept { - return h ? get_box(h)->busy_waited : false; +bool get_event_is_blocking_sync(const EventHandle& h) noexcept { + return h ? get_box(h)->is_blocking_sync : false; } bool get_event_ipc_enabled(const EventHandle& h) noexcept { @@ -384,10 +579,11 @@ ContextHandle get_event_context(const EventHandle& h) noexcept { return h ? get_box(h)->h_context : ContextHandle{}; } +// See REGISTRY_DESIGN.md (Level 1: Driver Handle -> Resource Handle) static HandleRegistry event_registry; EventHandle create_event_handle(const ContextHandle& h_ctx, unsigned int flags, - bool timing_disabled, bool busy_waited, + bool timing_enabled, bool is_blocking_sync, bool ipc_enabled, int device_id) { GILReleaseGuard gil; CUevent event; @@ -396,7 +592,7 @@ EventHandle create_event_handle(const ContextHandle& h_ctx, unsigned int flags, } auto box = std::shared_ptr( - new EventBox{event, timing_disabled, busy_waited, ipc_enabled, device_id, h_ctx}, + new EventBox{event, timing_enabled, is_blocking_sync, ipc_enabled, device_id, h_ctx}, [h_ctx](const EventBox* b) { event_registry.unregister_handle(b->resource); GILReleaseGuard gil; @@ -410,19 +606,19 @@ EventHandle create_event_handle(const ContextHandle& h_ctx, unsigned int flags, } EventHandle create_event_handle_noctx(unsigned int flags) { - return create_event_handle(ContextHandle{}, flags, true, false, false, -1); + return create_event_handle(ContextHandle{}, flags, false, false, false, -1); } EventHandle create_event_handle_ref(CUevent event) { if (auto h = event_registry.lookup(event)) { return h; } - auto box = std::make_shared(EventBox{event, true, false, false, -1, {}}); + auto box = std::make_shared(EventBox{event, false, false, false, -1, {}}); return EventHandle(box, &box->resource); } EventHandle create_event_handle_ipc(const CUipcEventHandle& ipc_handle, - bool busy_waited) { + bool is_blocking_sync) { GILReleaseGuard gil; CUevent event; if (CUDA_SUCCESS != (err = p_cuIpcOpenEventHandle(&event, ipc_handle))) { @@ -430,7 +626,7 @@ EventHandle create_event_handle_ipc(const CUipcEventHandle& ipc_handle, } auto box = std::shared_ptr( - new EventBox{event, true, busy_waited, true, -1, {}}, + new EventBox{event, false, is_blocking_sync, true, -1, {}}, [](const EventBox* b) { event_registry.unregister_handle(b->resource); GILReleaseGuard gil; @@ -656,6 +852,23 @@ DevicePtrHandle deviceptr_create_with_owner(CUdeviceptr ptr, PyObject* owner) { return DevicePtrHandle(box, &box->resource); } +DevicePtrHandle deviceptr_create_mapped_graphics( + CUdeviceptr ptr, + const GraphicsResourceHandle& h_resource, + const StreamHandle& h_stream +) { + auto box = std::shared_ptr( + new DevicePtrBox{ptr, h_stream}, + [h_resource](DevicePtrBox* b) { + GILReleaseGuard gil; + CUgraphicsResource resource = as_cu(h_resource); + p_cuGraphicsUnmapResources(1, &resource, as_cu(b->h_stream)); + delete b; + } + ); + return DevicePtrHandle(box, &box->resource); +} + // ============================================================================ // MemoryResource-owned Device Pointer Handles // ============================================================================ @@ -873,6 +1086,7 @@ static const KernelBox* get_box(const KernelHandle& h) { ); } +// See REGISTRY_DESIGN.md (Level 1: Driver Handle -> Resource Handle) static HandleRegistry kernel_registry; KernelHandle create_kernel_handle(const LibraryHandle& h_library, const char* name) { @@ -901,6 +1115,197 @@ LibraryHandle get_kernel_library(const KernelHandle& h) noexcept { return get_box(h)->h_library; } +// ============================================================================ +// Graph Handles +// ============================================================================ + +namespace { + +// Slot table layout (internal). Each graph maps CUgraphNode -> a fixed-size +// array of type-erased owners. The width is the most any single node needs: a +// kernel node holds its kernel and its packed arguments; a host node holds its +// callback and the userData. The table is heap-allocated and retained on the +// graph as a user object, so the driver frees it -- and every owner in it -- +// when the graph is destroyed. +constexpr std::size_t SLOTS_PER_NODE = 2; +using NodeSlots = std::array; +using GraphSlotTable = std::map; + +// shared_ptr deleters for the payloads that need one. Typed handles convert to +// OpaqueHandle by assignment and reuse their own control block, so they need no +// deleter here. The Python deleter follows the owner-release pattern used by +// the stream/deviceptr handles above. +void py_deleter(const void* p) noexcept { + GILAcquireGuard gil; + if (gil.acquired()) { + Py_DECREF(const_cast(static_cast(p))); + } +} + +void free_deleter(const void* p) noexcept { + std::free(const_cast(p)); +} + +void destroy_graph_slot_table(void* table) noexcept { + delete static_cast(table); +} + +struct GraphBox { + CUgraph resource; + GraphHandle h_parent; // Keeps parent alive for child/branch graphs + mutable GraphSlotTable* slot_table = nullptr; // Lazily created; owned by the graph's user object +}; + +const GraphBox* get_box(const GraphHandle& h) { + const CUgraph* p = h.get(); + return reinterpret_cast( + reinterpret_cast(p) - offsetof(GraphBox, resource) + ); +} + +// Return box's slot table, creating it on first use. The table is retained on +// the graph as a user object (MOVE transfers our only reference into the +// graph), so it -- and every owner in it -- is freed when the graph is +// destroyed. Returns nullptr if the driver lacks user-object support or a +// driver call fails; the cached pointer is non-owning. +GraphSlotTable* ensure_slot_table(const GraphBox* box) { + if (box->slot_table) { + return box->slot_table; + } + if (!p_cuUserObjectCreate || !p_cuGraphRetainUserObject || !p_cuUserObjectRelease) { + return nullptr; + } + auto* table = new GraphSlotTable(); + CUuserObject user_obj = nullptr; + { + GILReleaseGuard gil; + if (p_cuUserObjectCreate(&user_obj, table, + reinterpret_cast(destroy_graph_slot_table), + 1, CU_USER_OBJECT_NO_DESTRUCTOR_SYNC) != CUDA_SUCCESS) { + delete table; // no user object created; nothing else owns the table + return nullptr; + } + if (p_cuGraphRetainUserObject(box->resource, user_obj, 1, + CU_GRAPH_USER_OBJECT_MOVE) != CUDA_SUCCESS) { + p_cuUserObjectRelease(user_obj, 1); // drops refcount to 0 -> frees table + return nullptr; + } + } + box->slot_table = table; // non-owning cache; the user object owns it + return table; +} + +} // namespace + +OpaqueHandle make_opaque_py(PyObject* obj) { + Py_INCREF(obj); + return OpaqueHandle(static_cast(obj), py_deleter); +} + +OpaqueHandle make_opaque_malloc(void* buf) { + return OpaqueHandle(static_cast(buf), free_deleter); +} + +GraphHandle create_graph_handle(CUgraph graph) { + auto box = std::shared_ptr( + new GraphBox{graph, {}}, + [](const GraphBox* b) { + GILReleaseGuard gil; + p_cuGraphDestroy(b->resource); + delete b; + } + ); + return GraphHandle(box, &box->resource); +} + +GraphHandle create_graph_handle_ref(CUgraph graph, const GraphHandle& h_parent) { + auto box = std::make_shared(GraphBox{graph, h_parent}); + return GraphHandle(box, &box->resource); +} + +CUresult graph_set_slot(const GraphHandle& h_graph, CUgraphNode node, + unsigned int slot, OpaqueHandle owner) { + if (!h_graph || slot >= SLOTS_PER_NODE) { + return CUDA_ERROR_INVALID_VALUE; + } + if (!owner) { + return CUDA_SUCCESS; // nothing to retain; don't force table creation + } + GraphSlotTable* table = ensure_slot_table(get_box(h_graph)); + if (!table) { + return CUDA_ERROR_NOT_SUPPORTED; + } + (*table)[node][slot] = std::move(owner); + return CUDA_SUCCESS; +} + +// ============================================================================ +// Graph Exec Handles +// ============================================================================ + +namespace { +struct GraphExecBox { + CUgraphExec resource; +}; +} // namespace + +GraphExecHandle create_graph_exec_handle(CUgraphExec graph_exec) { + auto box = std::shared_ptr( + new GraphExecBox{graph_exec}, + [](const GraphExecBox* b) { + GILReleaseGuard gil; + p_cuGraphExecDestroy(b->resource); + delete b; + } + ); + return GraphExecHandle(box, &box->resource); +} + +namespace { +struct GraphNodeBox { + mutable CUgraphNode resource; + GraphHandle h_graph; +}; +} // namespace + +static const GraphNodeBox* get_box(const GraphNodeHandle& h) { + const CUgraphNode* p = h.get(); + return reinterpret_cast( + reinterpret_cast(p) - offsetof(GraphNodeBox, resource) + ); +} + +// See REGISTRY_DESIGN.md (Level 1: Driver Handle -> Resource Handle) +static HandleRegistry graph_node_registry; + +GraphNodeHandle create_graph_node_handle(CUgraphNode node, const GraphHandle& h_graph) { + if (node) { + if (auto h = graph_node_registry.lookup(node)) { + return h; + } + } + auto box = std::make_shared(GraphNodeBox{node, h_graph}); + GraphNodeHandle h(box, &box->resource); + if (node) { + graph_node_registry.register_handle(node, h); + } + return h; +} + +GraphHandle graph_node_get_graph(const GraphNodeHandle& h) noexcept { + return h ? get_box(h)->h_graph : GraphHandle{}; +} + +void invalidate_graph_node(const GraphNodeHandle& h) noexcept { + if (h) { + CUgraphNode node = get_box(h)->resource; + if (node) { + graph_node_registry.unregister_handle(node); + } + get_box(h)->resource = nullptr; + } +} + // ============================================================================ // Graphics Resource Handles // ============================================================================ @@ -1044,4 +1449,207 @@ CuLinkHandle create_culink_handle_ref(CUlinkState state) { return CuLinkHandle(box, &box->resource); } +// ============================================================================ +// File Descriptor Handles +// ============================================================================ + +FileDescriptorHandle create_fd_handle(int fd) { +#ifdef _WIN32 + throw std::runtime_error("create_fd_handle is not supported on Windows"); +#else + return FileDescriptorHandle( + new int(fd), + [](const int* p) { ::close(*p); delete p; } + ); +#endif +} + +FileDescriptorHandle create_fd_handle_ref(int fd) { +#ifdef _WIN32 + throw std::runtime_error("create_fd_handle_ref is not supported on Windows"); +#else + return std::make_shared(fd); +#endif +} + +// ============================================================================ +// Array / mipmapped-array / texture / surface handles (PR #467) +// ============================================================================ + +namespace { +struct ArrayBox { + CUarray resource; + // Non-null only for a mipmap-level view: keeps the parent mipmap (the real + // owner of the level's storage) alive for as long as the level is held. + MipmappedArrayHandle h_parent; +}; + +struct MipmappedArrayBox { + CUmipmappedArray resource; +}; + +struct TexObjectBox { + // Tagged so TexObjectHandle is a distinct C++ type from DevicePtrHandle / + // SurfObjectHandle (all wrap `unsigned long long`). + TexObjectValue resource; + // Type-erased backing dependency (OpaqueArrayHandle / MipmappedArrayHandle / + // DevicePtrHandle). The texture's resource is a union; we only need to keep + // whichever backing it was built from alive, never to dereference it. + std::shared_ptr h_backing; +}; + +struct SurfObjectBox { + SurfObjectValue resource; + OpaqueArrayHandle h_array; // surfaces are always array-backed +}; +} // namespace + +OpaqueArrayHandle create_array_handle(const CUDA_ARRAY3D_DESCRIPTOR& desc) { + GILReleaseGuard gil; + CUarray arr; + if (CUDA_SUCCESS != (err = p_cuArray3DCreate(&arr, &desc))) { + return {}; + } + // Allocation and adoption share the same owning lifetime; the only + // difference is who calls cuArray3DCreate. Delegate so the owning box and + // its destroy-on-last-ref deleter are defined in exactly one place. + return create_array_handle_owning(arr); +} + +OpaqueArrayHandle create_array_handle_ref(CUarray arr) { + if (!arr) { + return {}; + } + auto box = std::make_shared(ArrayBox{arr, {}}); + return OpaqueArrayHandle(box, &box->resource); +} + +OpaqueArrayHandle create_array_handle_owning(CUarray arr) { + if (!arr) { + return {}; + } + auto box = std::shared_ptr( + new ArrayBox{arr, {}}, + [](const ArrayBox* b) { + GILReleaseGuard gil; + p_cuArrayDestroy(b->resource); + delete b; + } + ); + return OpaqueArrayHandle(box, &box->resource); +} + +OpaqueArrayHandle create_array_level_handle(const MipmappedArrayHandle& h_mip, unsigned int level) { + GILReleaseGuard gil; + CUarray arr; + if (CUDA_SUCCESS != (err = p_cuMipmappedArrayGetLevel(&arr, as_cu(h_mip), level))) { + return {}; + } + // Non-owning level view: storage belongs to the mipmap. Embed the mipmap + // handle so the parent outlives this level; the deleter does not destroy. + auto box = std::shared_ptr( + new ArrayBox{arr, h_mip}, + [](const ArrayBox* b) { delete b; } + ); + return OpaqueArrayHandle(box, &box->resource); +} + +MipmappedArrayHandle create_mipmapped_array_handle(const CUDA_ARRAY3D_DESCRIPTOR& desc, + unsigned int num_levels) { + GILReleaseGuard gil; + CUmipmappedArray mip; + if (CUDA_SUCCESS != (err = p_cuMipmappedArrayCreate(&mip, &desc, num_levels))) { + return {}; + } + auto box = std::shared_ptr( + new MipmappedArrayBox{mip}, + [](const MipmappedArrayBox* b) { + GILReleaseGuard gil; + p_cuMipmappedArrayDestroy(b->resource); + delete b; + } + ); + return MipmappedArrayHandle(box, &box->resource); +} + +namespace { +TexObjectHandle make_tex_object_handle(const CUDA_RESOURCE_DESC& res, + const CUDA_TEXTURE_DESC& tex, + std::shared_ptr h_backing) { + GILReleaseGuard gil; + CUtexObject obj; + if (CUDA_SUCCESS != (err = p_cuTexObjectCreate(&obj, &res, &tex, nullptr))) { + return {}; + } + auto box = std::shared_ptr( + new TexObjectBox{TexObjectValue{obj}, std::move(h_backing)}, + [](const TexObjectBox* b) { + GILReleaseGuard gil; + p_cuTexObjectDestroy(b->resource.raw); + delete b; + } + ); + return TexObjectHandle(box, &box->resource); +} +} // namespace + +TexObjectHandle create_tex_object_handle_array(const CUDA_RESOURCE_DESC& res, + const CUDA_TEXTURE_DESC& tex, + const OpaqueArrayHandle& h_backing) { + return make_tex_object_handle(res, tex, h_backing); +} + +TexObjectHandle create_tex_object_handle_mipmap(const CUDA_RESOURCE_DESC& res, + const CUDA_TEXTURE_DESC& tex, + const MipmappedArrayHandle& h_backing) { + return make_tex_object_handle(res, tex, h_backing); +} + +TexObjectHandle create_tex_object_handle_linear(const CUDA_RESOURCE_DESC& res, + const CUDA_TEXTURE_DESC& tex, + const DevicePtrHandle& h_backing) { + return make_tex_object_handle(res, tex, h_backing); +} + +SurfObjectHandle create_surf_object_handle(const CUDA_RESOURCE_DESC& res, + const OpaqueArrayHandle& h_backing) { + GILReleaseGuard gil; + CUsurfObject obj; + if (CUDA_SUCCESS != (err = p_cuSurfObjectCreate(&obj, &res))) { + return {}; + } + auto box = std::shared_ptr( + new SurfObjectBox{SurfObjectValue{obj}, h_backing}, + [](const SurfObjectBox* b) { + GILReleaseGuard gil; + p_cuSurfObjectDestroy(b->resource.raw); + delete b; + } + ); + return SurfObjectHandle(box, &box->resource); +} + +// ============================================================================ +// SM resource split wrapper +// ============================================================================ + +CUresult sm_resource_split(CUdevResource* result, unsigned int nbGroups, + const CUdevResource* input, CUdevResource* remainder, + unsigned int flags, void* groupParams) { +#if CUDA_VERSION >= 13010 + if (!p_cuDevSmResourceSplit) { + return CUDA_ERROR_NOT_SUPPORTED; + } + return p_cuDevSmResourceSplit( + result, nbGroups, input, remainder, flags, + static_cast(groupParams)); +#else + return CUDA_ERROR_NOT_SUPPORTED; +#endif +} + +bool has_sm_resource_split() noexcept { + return p_cuDevSmResourceSplit != nullptr; +} + } // namespace cuda_core diff --git a/cuda_core/cuda/core/_cpp/resource_handles.hpp b/cuda_core/cuda/core/_cpp/resource_handles.hpp index 28b2d8d1c84..e8f4e83ecaf 100644 --- a/cuda_core/cuda/core/_cpp/resource_handles.hpp +++ b/cuda_core/cuda/core/_cpp/resource_handles.hpp @@ -36,6 +36,14 @@ struct TaggedHandle { using NvvmProgramValue = TaggedHandle; using NvJitLinkValue = TaggedHandle; +// CUtexObject, CUsurfObject and CUdeviceptr are all `unsigned long long`, so +// shared_ptr et al. would be the *same* C++ type as +// DevicePtrHandle (and each other), collapsing the as_cu/as_intptr/as_py +// overload sets. Tag them to keep each handle type distinct, exactly as the +// NVVM / nvJitLink handles above do. +using TexObjectValue = TaggedHandle; +using SurfObjectValue = TaggedHandle; + // ============================================================================ // Thread-local error handling // ============================================================================ @@ -59,6 +67,12 @@ void clear_last_error() noexcept; extern decltype(&cuDevicePrimaryCtxRetain) p_cuDevicePrimaryCtxRetain; extern decltype(&cuDevicePrimaryCtxRelease) p_cuDevicePrimaryCtxRelease; extern decltype(&cuCtxGetCurrent) p_cuCtxGetCurrent; +extern decltype(&cuGreenCtxCreate) p_cuGreenCtxCreate; +extern decltype(&cuGreenCtxDestroy) p_cuGreenCtxDestroy; +extern decltype(&cuCtxFromGreenCtx) p_cuCtxFromGreenCtx; +extern decltype(&cuDevResourceGenerateDesc) p_cuDevResourceGenerateDesc; + +extern decltype(&cuGreenCtxStreamCreate) p_cuGreenCtxStreamCreate; extern decltype(&cuStreamCreateWithPriority) p_cuStreamCreateWithPriority; extern decltype(&cuStreamDestroy) p_cuStreamDestroy; @@ -92,12 +106,40 @@ extern decltype(&cuLibraryLoadData) p_cuLibraryLoadData; extern decltype(&cuLibraryUnload) p_cuLibraryUnload; extern decltype(&cuLibraryGetKernel) p_cuLibraryGetKernel; +// Graph +extern decltype(&cuGraphDestroy) p_cuGraphDestroy; +extern decltype(&cuGraphExecDestroy) p_cuGraphExecDestroy; +extern decltype(&cuUserObjectCreate) p_cuUserObjectCreate; +extern decltype(&cuUserObjectRelease) p_cuUserObjectRelease; +extern decltype(&cuGraphRetainUserObject) p_cuGraphRetainUserObject; + // Linker extern decltype(&cuLinkDestroy) p_cuLinkDestroy; // Graphics interop +extern decltype(&cuGraphicsUnmapResources) p_cuGraphicsUnmapResources; extern decltype(&cuGraphicsUnregisterResource) p_cuGraphicsUnregisterResource; +// Texture / surface / array (PR #467) +extern decltype(&cuArray3DCreate) p_cuArray3DCreate; +extern decltype(&cuArrayDestroy) p_cuArrayDestroy; +extern decltype(&cuMipmappedArrayCreate) p_cuMipmappedArrayCreate; +extern decltype(&cuMipmappedArrayDestroy) p_cuMipmappedArrayDestroy; +extern decltype(&cuMipmappedArrayGetLevel) p_cuMipmappedArrayGetLevel; +extern decltype(&cuTexObjectCreate) p_cuTexObjectCreate; +extern decltype(&cuTexObjectDestroy) p_cuTexObjectDestroy; +extern decltype(&cuSurfObjectCreate) p_cuSurfObjectCreate; +extern decltype(&cuSurfObjectDestroy) p_cuSurfObjectDestroy; + +// SM resource split (13.1+ — may be null on older drivers/bindings) +#if CUDA_VERSION >= 13010 +extern decltype(&cuDevSmResourceSplit) p_cuDevSmResourceSplit; +#else +// cuDevSmResourceSplit doesn't exist in CUDA < 13.1 headers, so use a +// void* placeholder. The pointer is always null when built against 12.x. +extern void* p_cuDevSmResourceSplit; +#endif + // ============================================================================ // NVRTC function pointers // @@ -138,16 +180,25 @@ extern NvJitLinkDestroyFn p_nvJitLinkDestroy; // ============================================================================ using ContextHandle = std::shared_ptr; +using GreenCtxHandle = std::shared_ptr; using StreamHandle = std::shared_ptr; using EventHandle = std::shared_ptr; using MemoryPoolHandle = std::shared_ptr; using LibraryHandle = std::shared_ptr; using KernelHandle = std::shared_ptr; +using GraphHandle = std::shared_ptr; +using GraphExecHandle = std::shared_ptr; +using GraphNodeHandle = std::shared_ptr; using GraphicsResourceHandle = std::shared_ptr; using NvrtcProgramHandle = std::shared_ptr; using NvvmProgramHandle = std::shared_ptr; using NvJitLinkHandle = std::shared_ptr; using CuLinkHandle = std::shared_ptr; +using FileDescriptorHandle = std::shared_ptr; +using OpaqueArrayHandle = std::shared_ptr; +using MipmappedArrayHandle = std::shared_ptr; +using TexObjectHandle = std::shared_ptr; +using SurfObjectHandle = std::shared_ptr; // ============================================================================ @@ -157,6 +208,21 @@ using CuLinkHandle = std::shared_ptr; // Function to create a non-owning context handle (references existing context). ContextHandle create_context_handle_ref(CUcontext ctx); +// Create a context handle for the CUcontext view of the provided green context. +// The returned ContextHandle keeps the green context alive, but the CUcontext +// view is non-owning and is not destroyed independently. +ContextHandle create_context_handle_from_green_ctx(const GreenCtxHandle& h_green_ctx); + +// Return the green context dependency associated with a ContextHandle, if any. +GreenCtxHandle get_context_green_ctx(const ContextHandle& h) noexcept; + +// Create an owning green context handle from a list of device resources. +GreenCtxHandle create_green_ctx_handle(CUdevResource* resources, unsigned int nbResources, + CUdevice dev, unsigned int flags); + +// Create a non-owning green context handle. +GreenCtxHandle create_green_ctx_handle_ref(CUgreenCtx ctx); + // Get handle to the primary context for a device (with thread-local caching) // Returns empty handle on error (caller must check) ContextHandle get_primary_context(int device_id); @@ -186,6 +252,13 @@ StreamHandle create_stream_handle_ref(CUstream stream); // The owner is responsible for keeping the stream's context alive. StreamHandle create_stream_handle_with_owner(CUstream stream, PyObject* owner); +// Destroy a Python-backed CUDA user object by decref'ing it when safe. +// If Python is finalized or finalizing, the object is intentionally leaked. +void py_object_user_object_destroy(void* py_object) noexcept; + +// Return the context dependency associated with a stream handle, if any. +ContextHandle get_stream_context(const StreamHandle& h) noexcept; + // Get non-owning handle to the legacy default stream (CU_STREAM_LEGACY) // Note: Legacy stream has no specific context dependency. StreamHandle get_legacy_stream(); @@ -204,7 +277,7 @@ StreamHandle get_per_thread_stream(); // When the last reference is released, cuEventDestroy is called automatically. // Returns empty handle on error (caller must check). EventHandle create_event_handle(const ContextHandle& h_ctx, unsigned int flags, - bool timing_disabled, bool busy_waited, + bool timing_enabled, bool is_blocking_sync, bool ipc_enabled, int device_id); // Create an owning event handle without context dependency. @@ -218,17 +291,17 @@ EventHandle create_event_handle_noctx(unsigned int flags); // When the last reference is released, cuEventDestroy is called automatically. // Returns empty handle on error (caller must check). EventHandle create_event_handle_ipc(const CUipcEventHandle& ipc_handle, - bool busy_waited); + bool is_blocking_sync); // Create a non-owning event handle (references existing event). // Use for events that are managed by the CUDA graph or another owner. // The event will NOT be destroyed when the handle is released. -// Metadata defaults to unknown (timing_disabled=true, device_id=-1). +// Metadata defaults to unknown (timing_enabled=false, device_id=-1). EventHandle create_event_handle_ref(CUevent event); // Event metadata accessors (read from EventBox via pointer arithmetic) -bool get_event_timing_disabled(const EventHandle& h) noexcept; -bool get_event_busy_waited(const EventHandle& h) noexcept; +bool get_event_timing_enabled(const EventHandle& h) noexcept; +bool get_event_is_blocking_sync(const EventHandle& h) noexcept; bool get_event_ipc_enabled(const EventHandle& h) noexcept; int get_event_device_id(const EventHandle& h) noexcept; ContextHandle get_event_context(const EventHandle& h) noexcept; @@ -299,6 +372,16 @@ DevicePtrHandle deviceptr_create_ref(CUdeviceptr ptr); // If owner is nullptr, equivalent to deviceptr_create_ref. DevicePtrHandle deviceptr_create_with_owner(CUdeviceptr ptr, PyObject* owner); +// Create a device pointer handle for a mapped graphics resource. +// The pointer structurally depends on the provided graphics resource handle. +// When the last reference is released, cuGraphicsUnmapResources is called on +// the stored stream, then the graphics resource may be unregistered when its +// own handle is released. +DevicePtrHandle deviceptr_create_mapped_graphics( + CUdeviceptr ptr, + const GraphicsResourceHandle& h_resource, + const StreamHandle& h_stream); + // Callback type for MemoryResource deallocation. // Called from the shared_ptr deleter when a handle created via // deviceptr_create_with_mr is destroyed. The implementation is responsible @@ -371,6 +454,77 @@ KernelHandle create_kernel_handle_ref(CUkernel kernel); // Returns empty handle if the kernel has no library dependency. LibraryHandle get_kernel_library(const KernelHandle& h) noexcept; +// ============================================================================ +// Graph handle functions +// ============================================================================ + +// Wrap an externally-created CUgraph with RAII cleanup. +// When the last reference is released, cuGraphDestroy is called automatically. +// The caller must have already created the graph via cuGraphCreate. +GraphHandle create_graph_handle(CUgraph graph); + +// Create a non-owning graph handle that keeps h_parent alive. +// Use for graphs owned by a child/conditional node in a parent graph. +// The child graph will NOT be destroyed when this handle is released, +// but h_parent will be prevented from destruction while this handle exists. +GraphHandle create_graph_handle_ref(CUgraph graph, const GraphHandle& h_parent); + +// ============================================================================ +// Graph slot attachments +// +// A graph carries a side table that keeps resources used by its nodes (kernel +// arguments, host callbacks, events, ...) alive for as long as the graph can +// execute. The table is created on first use and retained on the CUgraph as a +// user object, so the driver releases it -- and everything attached through it +// -- when the graph is destroyed. The table layout is an internal detail; +// callers use the abstract API below. +// ============================================================================ + +// Type-erased shared owner of an attached resource. Typed handles such as +// EventHandle and KernelHandle convert to OpaqueHandle by assignment, reusing +// their existing control block; the helpers below build OpaqueHandles for the +// two cases that need a custom deleter. +using OpaqueHandle = std::shared_ptr; + +// Build an OpaqueHandle from a Python object: increments its refcount now and +// decrements it (under the GIL) on release. The caller must hold the GIL. +OpaqueHandle make_opaque_py(PyObject* obj); + +// Build an OpaqueHandle from a malloc'd buffer: std::free on release. +OpaqueHandle make_opaque_malloc(void* buf); + +// Attach owner to one of node's fixed slots on h_graph, replacing whatever was +// there. The graph's slot table is created on first use. A null owner is a +// no-op (returns CUDA_SUCCESS without creating the table), so callers need not +// guard optional owners. Returns CUDA_SUCCESS, or an error if slot is out of +// range or the graph cannot hold a table (e.g. the driver lacks user-object +// support). +CUresult graph_set_slot(const GraphHandle& h_graph, CUgraphNode node, + unsigned int slot, OpaqueHandle owner); + +// ============================================================================ +// Graph exec handle functions +// ============================================================================ + +// Wrap an externally-created CUgraphExec with RAII cleanup. +// When the last reference is released, cuGraphExecDestroy is called automatically. +GraphExecHandle create_graph_exec_handle(CUgraphExec graph_exec); + +// ============================================================================ +// Graph node handle functions +// ============================================================================ + +// Create a node handle. Nodes are owned by their parent graph (not +// independently destroyable). The GraphHandle dependency ensures the +// graph outlives any node reference. +GraphNodeHandle create_graph_node_handle(CUgraphNode node, const GraphHandle& h_graph); + +// Extract the owning graph handle from a node handle. +GraphHandle graph_node_get_graph(const GraphNodeHandle& h) noexcept; + +// Zero the CUgraphNode resource inside the handle, marking it invalid. +void invalidate_graph_node(const GraphNodeHandle& h) noexcept; + // ============================================================================ // Graphics resource handle functions // ============================================================================ @@ -434,6 +588,72 @@ CuLinkHandle create_culink_handle(CUlinkState state); // The handle will NOT be destroyed when the last reference is released. CuLinkHandle create_culink_handle_ref(CUlinkState state); +// ============================================================================ +// File descriptor handle functions +// ============================================================================ + +// Create an owning file descriptor handle. +// When the last reference is released, POSIX close() is called. +FileDescriptorHandle create_fd_handle(int fd); + +// Create a non-owning file descriptor handle (caller manages the fd). +FileDescriptorHandle create_fd_handle_ref(int fd); + +// ============================================================================ +// Array / mipmapped-array / texture / surface handle functions (PR #467) +// +// These resources are managed exactly like every other cuda.core resource: +// the owning handle's deleter calls the matching cu*Destroy with the GIL +// released, structural dependencies are embedded in the box (so a backing +// resource always outlives a texture/surface/level built on it), and +// creation returns an empty handle + thread-local error on failure. +// ============================================================================ + +// Create an owning CUDA array via cuArray3DCreate. +// When the last reference is released, cuArrayDestroy is called automatically. +// Returns empty handle on error (caller must check). +OpaqueArrayHandle create_array_handle(const CUDA_ARRAY3D_DESCRIPTOR& desc); + +// Create a non-owning array handle (references an existing CUarray). +// Use for arrays owned elsewhere (e.g. graphics interop). Never destroyed here. +OpaqueArrayHandle create_array_handle_ref(CUarray arr); + +// Create an owning array handle adopting an existing CUarray. +// When the last reference is released, cuArrayDestroy is called automatically. +OpaqueArrayHandle create_array_handle_owning(CUarray arr); + +// Create a non-owning handle to a mipmap level via cuMipmappedArrayGetLevel. +// The level CUarray is owned by the mipmap; the parent MipmappedArrayHandle is +// embedded in the box so it outlives the level view. No destroy in the deleter. +// Returns empty handle on error (caller must check). +OpaqueArrayHandle create_array_level_handle(const MipmappedArrayHandle& h_mip, unsigned int level); + +// Create an owning mipmapped array via cuMipmappedArrayCreate. +// When the last reference is released, cuMipmappedArrayDestroy is called. +// Returns empty handle on error (caller must check). +MipmappedArrayHandle create_mipmapped_array_handle(const CUDA_ARRAY3D_DESCRIPTOR& desc, + unsigned int num_levels); + +// Create an owning texture object via cuTexObjectCreate, embedding the backing +// resource handle (array / mipmapped array / linear-or-pitch2d device pointer) +// so the backing always outlives the texture. cuTexObjectDestroy runs in the +// deleter. Returns empty handle on error (caller must check). +TexObjectHandle create_tex_object_handle_array(const CUDA_RESOURCE_DESC& res, + const CUDA_TEXTURE_DESC& tex, + const OpaqueArrayHandle& h_backing); +TexObjectHandle create_tex_object_handle_mipmap(const CUDA_RESOURCE_DESC& res, + const CUDA_TEXTURE_DESC& tex, + const MipmappedArrayHandle& h_backing); +TexObjectHandle create_tex_object_handle_linear(const CUDA_RESOURCE_DESC& res, + const CUDA_TEXTURE_DESC& tex, + const DevicePtrHandle& h_backing); + +// Create an owning surface object via cuSurfObjectCreate, embedding the backing +// array handle so it outlives the surface. cuSurfObjectDestroy runs in the +// deleter. Returns empty handle on error (caller must check). +SurfObjectHandle create_surf_object_handle(const CUDA_RESOURCE_DESC& res, + const OpaqueArrayHandle& h_backing); + // ============================================================================ // Overloaded helper functions to extract raw resources from handles // ============================================================================ @@ -443,6 +663,10 @@ inline CUcontext as_cu(const ContextHandle& h) noexcept { return h ? *h : nullptr; } +inline CUgreenCtx as_cu(const GreenCtxHandle& h) noexcept { + return h ? *h : nullptr; +} + inline CUstream as_cu(const StreamHandle& h) noexcept { return h ? *h : nullptr; } @@ -467,6 +691,18 @@ inline CUkernel as_cu(const KernelHandle& h) noexcept { return h ? *h : nullptr; } +inline CUgraph as_cu(const GraphHandle& h) noexcept { + return h ? *h : nullptr; +} + +inline CUgraphExec as_cu(const GraphExecHandle& h) noexcept { + return h ? *h : nullptr; +} + +inline CUgraphNode as_cu(const GraphNodeHandle& h) noexcept { + return h ? *h : nullptr; +} + inline CUgraphicsResource as_cu(const GraphicsResourceHandle& h) noexcept { return h ? *h : nullptr; } @@ -487,12 +723,34 @@ inline CUlinkState as_cu(const CuLinkHandle& h) noexcept { return h ? *h : nullptr; } +inline CUarray as_cu(const OpaqueArrayHandle& h) noexcept { + return h ? *h : nullptr; +} + +inline CUmipmappedArray as_cu(const MipmappedArrayHandle& h) noexcept { + return h ? *h : nullptr; +} + +// CUtexObject / CUsurfObject are integer-valued (like CUdeviceptr); null is 0. +// The raw value lives in the tagged wrapper's `raw` field. +inline CUtexObject as_cu(const TexObjectHandle& h) noexcept { + return h ? h->raw : 0; +} + +inline CUsurfObject as_cu(const SurfObjectHandle& h) noexcept { + return h ? h->raw : 0; +} + // as_intptr() - extract handle as intptr_t for Python interop // Using signed intptr_t per C standard convention and issue #1342 inline std::intptr_t as_intptr(const ContextHandle& h) noexcept { return reinterpret_cast(as_cu(h)); } +inline std::intptr_t as_intptr(const GreenCtxHandle& h) noexcept { + return reinterpret_cast(as_cu(h)); +} + inline std::intptr_t as_intptr(const StreamHandle& h) noexcept { return reinterpret_cast(as_cu(h)); } @@ -517,6 +775,18 @@ inline std::intptr_t as_intptr(const KernelHandle& h) noexcept { return reinterpret_cast(as_cu(h)); } +inline std::intptr_t as_intptr(const GraphHandle& h) noexcept { + return reinterpret_cast(as_cu(h)); +} + +inline std::intptr_t as_intptr(const GraphExecHandle& h) noexcept { + return reinterpret_cast(as_cu(h)); +} + +inline std::intptr_t as_intptr(const GraphNodeHandle& h) noexcept { + return reinterpret_cast(as_cu(h)); +} + inline std::intptr_t as_intptr(const GraphicsResourceHandle& h) noexcept { return reinterpret_cast(as_cu(h)); } @@ -537,11 +807,47 @@ inline std::intptr_t as_intptr(const CuLinkHandle& h) noexcept { return reinterpret_cast(as_cu(h)); } +inline std::intptr_t as_intptr(const FileDescriptorHandle& h) noexcept { + return h ? static_cast(*h) : -1; +} + +inline std::intptr_t as_intptr(const OpaqueArrayHandle& h) noexcept { + return reinterpret_cast(as_cu(h)); +} + +inline std::intptr_t as_intptr(const MipmappedArrayHandle& h) noexcept { + return reinterpret_cast(as_cu(h)); +} + +inline std::intptr_t as_intptr(const TexObjectHandle& h) noexcept { + return static_cast(as_cu(h)); +} + +inline std::intptr_t as_intptr(const SurfObjectHandle& h) noexcept { + return static_cast(as_cu(h)); +} + // as_py() - convert handle to Python wrapper object (returns new reference) #if PY_VERSION_HEX < 0x030D0000 extern "C" int _Py_IsFinalizing(void); #endif +// Best-effort probe for interpreter shutdown. +// +// In CPython this is not a hard guarantee: finalization can begin after this +// returns false but before a later PyGILState_Ensure() or other Python C-API +// call. +// +// If that race is lost on a non-finalizer thread, CPython's behavior is +// version-dependent: on older supported versions (3.10-3.13) it may abruptly +// terminate the current thread (historically via PyThread_exit_thread(), +// without normal C++ unwinding), while on newer versions (3.14+) it may hang +// the thread until process exit. +// +// We still use this check because the policy in this layer is to avoid Python +// work once shutdown is underway and accept an intentional leak or skipped +// Python conversion in that edge case rather than add more complex deferral +// machinery. inline bool py_is_finalizing() noexcept { #if PY_VERSION_HEX >= 0x030D0000 return Py_IsFinalizing(); @@ -571,6 +877,10 @@ inline PyObject* as_py(const ContextHandle& h) noexcept { return detail::make_py("cuda.bindings.driver", "CUcontext", as_intptr(h)); } +inline PyObject* as_py(const GreenCtxHandle& h) noexcept { + return detail::make_py("cuda.bindings.driver", "CUgreenCtx", as_intptr(h)); +} + inline PyObject* as_py(const StreamHandle& h) noexcept { return detail::make_py("cuda.bindings.driver", "CUstream", as_intptr(h)); } @@ -595,6 +905,21 @@ inline PyObject* as_py(const KernelHandle& h) noexcept { return detail::make_py("cuda.bindings.driver", "CUkernel", as_intptr(h)); } +inline PyObject* as_py(const GraphHandle& h) noexcept { + return detail::make_py("cuda.bindings.driver", "CUgraph", as_intptr(h)); +} + +inline PyObject* as_py(const GraphExecHandle& h) noexcept { + return detail::make_py("cuda.bindings.driver", "CUgraphExec", as_intptr(h)); +} + +inline PyObject* as_py(const GraphNodeHandle& h) noexcept { + if (!as_intptr(h)) { + Py_RETURN_NONE; + } + return detail::make_py("cuda.bindings.driver", "CUgraphNode", as_intptr(h)); +} + inline PyObject* as_py(const NvrtcProgramHandle& h) noexcept { return detail::make_py("cuda.bindings.nvrtc", "nvrtcProgram", as_intptr(h)); } @@ -617,4 +942,42 @@ inline PyObject* as_py(const GraphicsResourceHandle& h) noexcept { return detail::make_py("cuda.bindings.driver", "CUgraphicsResource", as_intptr(h)); } +inline PyObject* as_py(const FileDescriptorHandle& h) noexcept { + return PyLong_FromSsize_t(as_intptr(h)); +} + +inline PyObject* as_py(const OpaqueArrayHandle& h) noexcept { + return detail::make_py("cuda.bindings.driver", "CUarray", as_intptr(h)); +} + +inline PyObject* as_py(const MipmappedArrayHandle& h) noexcept { + return detail::make_py("cuda.bindings.driver", "CUmipmappedArray", as_intptr(h)); +} + +inline PyObject* as_py(const TexObjectHandle& h) noexcept { + return detail::make_py("cuda.bindings.driver", "CUtexObject", as_intptr(h)); +} + +inline PyObject* as_py(const SurfObjectHandle& h) noexcept { + return detail::make_py("cuda.bindings.driver", "CUsurfObject", as_intptr(h)); +} + +// ============================================================================ +// SM resource split wrapper (13.1+) +// +// Calls through p_cuDevSmResourceSplit if available, otherwise returns +// CUDA_ERROR_NOT_SUPPORTED. This avoids a direct Cython cimport of the +// cydriver cdef function, which would fail at module init on cuda-bindings +// < 13.1 (see https://github.com/NVIDIA/cuda-python/issues/2063). +// ============================================================================ + +// groupParams is void* so the Cython declaration doesn't reference +// CU_DEV_SM_RESOURCE_GROUP_PARAMS (absent from cuda-bindings 13.0 .pxd). +CUresult sm_resource_split(CUdevResource* result, unsigned int nbGroups, + const CUdevResource* input, CUdevResource* remainder, + unsigned int flags, void* groupParams); + +// Returns true if the cuDevSmResourceSplit function pointer is available. +bool has_sm_resource_split() noexcept; + } // namespace cuda_core diff --git a/cuda_core/cuda/core/_cpp/tensor_map.cpp b/cuda_core/cuda/core/_cpp/tensor_map.cpp new file mode 100644 index 00000000000..df3f7654e54 --- /dev/null +++ b/cuda_core/cuda/core/_cpp/tensor_map.cpp @@ -0,0 +1,154 @@ +// SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +#include "tensor_map_cccl.h" + +#include + +#include +#include + +#if defined(__has_include) +// Older CTK releases do not ship . When it is unavailable we keep +// the CCCL helper compiled out and fall back to the direct driver path. +# if __has_include() +# include +# define CUDA_CORE_HAS_CUDA_TMA 1 +# else +# define CUDA_CORE_HAS_CUDA_TMA 0 +# endif +# if __has_include("dlpack.h") +# include "dlpack.h" +# define CUDA_CORE_HAS_DLPACK_H 1 +# elif __has_include() +# include +# define CUDA_CORE_HAS_DLPACK_H 1 +# else +# define CUDA_CORE_HAS_DLPACK_H 0 +# endif +#else +# define CUDA_CORE_HAS_CUDA_TMA 0 +# define CUDA_CORE_HAS_DLPACK_H 0 +#endif + +static inline void cuda_core_write_err(char* err, size_t cap, const char* msg) noexcept +{ + if (!err || cap == 0) + return; + if (!msg) + { + err[0] = '\0'; + return; + } + size_t n = ::strlen(msg); + if (n >= cap) + n = cap - 1; + ::memcpy(err, msg, n); + err[n] = '\0'; +} + +int cuda_core_cccl_make_tma_descriptor_tiled( + void* out_tensor_map, + void* data, + int device_type, + int device_id, + int ndim, + const int64_t* shape, + const int64_t* strides, + uint8_t dtype_code, + uint8_t dtype_bits, + uint16_t dtype_lanes, + const int* box_sizes, + const int* elem_strides, + int interleave_layout, + int swizzle, + int l2_fetch_size, + int oob_fill, + char* err, + size_t err_cap) noexcept +{ +#if !(CUDA_CORE_HAS_CUDA_TMA && CUDA_CORE_HAS_DLPACK_H) + (void)out_tensor_map; + (void)data; + (void)device_type; + (void)device_id; + (void)ndim; + (void)shape; + (void)strides; + (void)dtype_code; + (void)dtype_bits; + (void)dtype_lanes; + (void)box_sizes; + (void)elem_strides; + (void)interleave_layout; + (void)swizzle; + (void)l2_fetch_size; + (void)oob_fill; + cuda_core_write_err(err, err_cap, "CCCL and/or not available at build time"); + return 1; +#else + try + { + if (!out_tensor_map) + { + cuda_core_write_err(err, err_cap, "out_tensor_map is NULL"); + return 1; + } + if (!data) + { + cuda_core_write_err(err, err_cap, "tensor data pointer is NULL"); + return 1; + } + if (!shape || !box_sizes || ndim <= 0) + { + cuda_core_write_err(err, err_cap, "invalid rank/shape/box_sizes"); + return 1; + } + + DLTensor t{}; + t.data = data; + t.device = {static_cast(device_type), device_id}; + t.ndim = ndim; + t.dtype.code = dtype_code; + t.dtype.bits = dtype_bits; + t.dtype.lanes = dtype_lanes; + // CCCL promises not to mutate the arrays, but DLPack uses non-const pointers. + t.shape = const_cast(shape); + t.strides = const_cast(strides); + t.byte_offset = 0; + + const auto layout = static_cast(interleave_layout); + const auto swz = static_cast(swizzle); + const auto l2 = static_cast(l2_fetch_size); + const auto oob = static_cast(oob_fill); + + auto box = cuda::std::span(box_sizes, static_cast(ndim)); + + CUtensorMap desc{}; + if (elem_strides) + { + auto es = cuda::std::span(elem_strides, static_cast(ndim)); + desc = cuda::make_tma_descriptor(t, box, es, layout, swz, l2, oob); + } + else + { + desc = cuda::make_tma_descriptor(t, box, layout, swz, l2, oob); + } + + ::memcpy(out_tensor_map, &desc, sizeof(CUtensorMap)); + cuda_core_write_err(err, err_cap, nullptr); + return 0; + } + catch (const std::exception& e) + { + cuda_core_write_err(err, err_cap, e.what()); + return 1; + } + catch (...) + { + cuda_core_write_err(err, err_cap, "unknown error while building TMA descriptor"); + return 1; + } +#endif +} diff --git a/cuda_core/cuda/core/_cpp/tensor_map_cccl.h b/cuda_core/cuda/core/_cpp/tensor_map_cccl.h new file mode 100644 index 00000000000..37f0e0fd8d2 --- /dev/null +++ b/cuda_core/cuda/core/_cpp/tensor_map_cccl.h @@ -0,0 +1,45 @@ +// SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +#ifndef CUDA_CORE_TENSOR_MAP_CCCL_H_ +#define CUDA_CORE_TENSOR_MAP_CCCL_H_ + +#ifdef __cplusplus +#include +#include +extern "C" { +#else +#include +#include +#endif + +// Build a tiled CUtensorMap using CCCL's cuda::make_tma_descriptor (from ). +// +// Returns 0 on success; on failure returns non-zero and writes a best-effort +// human-readable message into (err, err_cap) if provided. +int cuda_core_cccl_make_tma_descriptor_tiled( + void* out_tensor_map, + void* data, + int device_type, + int device_id, + int ndim, + const int64_t* shape, // length ndim + const int64_t* strides, // length ndim, or NULL for contiguous + uint8_t dtype_code, + uint8_t dtype_bits, + uint16_t dtype_lanes, + const int* box_sizes, // length ndim + const int* elem_strides, // length ndim, or NULL for all-ones overload + int interleave_layout, + int swizzle, + int l2_fetch_size, + int oob_fill, + char* err, + size_t err_cap) noexcept; + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // CUDA_CORE_TENSOR_MAP_CCCL_H_ diff --git a/cuda_core/cuda/core/_device.pyi b/cuda_core/cuda/core/_device.pyi new file mode 100644 index 00000000000..14893fbd3c0 --- /dev/null +++ b/cuda_core/cuda/core/_device.pyi @@ -0,0 +1,1026 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_device.pyx + +from __future__ import annotations + +import threading + +import cuda.core.system +from cuda.core._context import Context, ContextOptions +from cuda.core._device_resources import DeviceResources +from cuda.core._event import Event, EventOptions +from cuda.core._memory._buffer import Buffer, MemoryResource +from cuda.core._stream import IsStreamType, Stream +from cuda.core._utils.cuda_utils import ComputeCapability +from cuda.core.graph import GraphBuilder +from cuda.core.texture import (MipmappedArray, MipmappedArrayOptions, + OpaqueArray, OpaqueArrayOptions, + ResourceDescriptor, SurfaceObject, + TextureObject, TextureObjectOptions) + + +class DeviceProperties: + """ + A class to query various attributes of a CUDA device. + + Attributes are read-only and provide information about the device. + """ + + def __init__(self, *args, **kwargs) -> None: + ... + + @classmethod + def _init(cls, handle: int) -> DeviceProperties: + ... + + @property + def max_threads_per_block(self) -> int: + """int: Maximum number of threads per block.""" + + @property + def max_block_dim_x(self) -> int: + """int: Maximum block dimension X.""" + + @property + def max_block_dim_y(self) -> int: + """int: Maximum block dimension Y.""" + + @property + def max_block_dim_z(self) -> int: + """int: Maximum block dimension Z.""" + + @property + def max_grid_dim_x(self) -> int: + """int: Maximum grid dimension X.""" + + @property + def max_grid_dim_y(self) -> int: + """int: Maximum grid dimension Y.""" + + @property + def max_grid_dim_z(self) -> int: + """int: Maximum grid dimension Z.""" + + @property + def max_shared_memory_per_block(self) -> int: + """int: Maximum shared memory available per block in bytes.""" + + @property + def total_constant_memory(self) -> int: + """int: Memory available on device for constant variables in a CUDA C kernel in bytes.""" + + @property + def warp_size(self) -> int: + """int: Warp size in threads.""" + + @property + def max_pitch(self) -> int: + """int: Maximum pitch in bytes allowed by memory copies.""" + + @property + def maximum_texture1d_width(self) -> int: + """int: Maximum 1D texture width.""" + + @property + def maximum_texture1d_linear_width(self) -> int: + """int: Maximum width for a 1D texture bound to linear memory.""" + + @property + def maximum_texture1d_mipmapped_width(self) -> int: + """int: Maximum mipmapped 1D texture width.""" + + @property + def maximum_texture2d_width(self) -> int: + """int: Maximum 2D texture width.""" + + @property + def maximum_texture2d_height(self) -> int: + """int: Maximum 2D texture height.""" + + @property + def maximum_texture2d_linear_width(self) -> int: + """int: Maximum width for a 2D texture bound to linear memory.""" + + @property + def maximum_texture2d_linear_height(self) -> int: + """int: Maximum height for a 2D texture bound to linear memory.""" + + @property + def maximum_texture2d_linear_pitch(self) -> int: + """int: Maximum pitch in bytes for a 2D texture bound to linear memory.""" + + @property + def maximum_texture2d_mipmapped_width(self) -> int: + """int: Maximum mipmapped 2D texture width.""" + + @property + def maximum_texture2d_mipmapped_height(self) -> int: + """int: Maximum mipmapped 2D texture height.""" + + @property + def maximum_texture3d_width(self) -> int: + """int: Maximum 3D texture width.""" + + @property + def maximum_texture3d_height(self) -> int: + """int: Maximum 3D texture height.""" + + @property + def maximum_texture3d_depth(self) -> int: + """int: Maximum 3D texture depth.""" + + @property + def maximum_texture3d_width_alternate(self) -> int: + """int: Alternate maximum 3D texture width, 0 if no alternate maximum 3D texture size is supported.""" + + @property + def maximum_texture3d_height_alternate(self) -> int: + """int: Alternate maximum 3D texture height, 0 if no alternate maximum 3D texture size is supported.""" + + @property + def maximum_texture3d_depth_alternate(self) -> int: + """int: Alternate maximum 3D texture depth, 0 if no alternate maximum 3D texture size is supported.""" + + @property + def maximum_texturecubemap_width(self) -> int: + """int: Maximum cubemap texture width or height.""" + + @property + def maximum_texture1d_layered_width(self) -> int: + """int: Maximum 1D layered texture width.""" + + @property + def maximum_texture1d_layered_layers(self) -> int: + """int: Maximum layers in a 1D layered texture.""" + + @property + def maximum_texture2d_layered_width(self) -> int: + """int: Maximum 2D layered texture width.""" + + @property + def maximum_texture2d_layered_height(self) -> int: + """int: Maximum 2D layered texture height.""" + + @property + def maximum_texture2d_layered_layers(self) -> int: + """int: Maximum layers in a 2D layered texture.""" + + @property + def maximum_texturecubemap_layered_width(self) -> int: + """int: Maximum cubemap layered texture width or height.""" + + @property + def maximum_texturecubemap_layered_layers(self) -> int: + """int: Maximum layers in a cubemap layered texture.""" + + @property + def maximum_surface1d_width(self) -> int: + """int: Maximum 1D surface width.""" + + @property + def maximum_surface2d_width(self) -> int: + """int: Maximum 2D surface width.""" + + @property + def maximum_surface2d_height(self) -> int: + """int: Maximum 2D surface height.""" + + @property + def maximum_surface3d_width(self) -> int: + """int: Maximum 3D surface width.""" + + @property + def maximum_surface3d_height(self) -> int: + """int: Maximum 3D surface height.""" + + @property + def maximum_surface3d_depth(self) -> int: + """int: Maximum 3D surface depth.""" + + @property + def maximum_surface1d_layered_width(self) -> int: + """int: Maximum 1D layered surface width.""" + + @property + def maximum_surface1d_layered_layers(self) -> int: + """int: Maximum layers in a 1D layered surface.""" + + @property + def maximum_surface2d_layered_width(self) -> int: + """int: Maximum 2D layered surface width.""" + + @property + def maximum_surface2d_layered_height(self) -> int: + """int: Maximum 2D layered surface height.""" + + @property + def maximum_surface2d_layered_layers(self) -> int: + """int: Maximum layers in a 2D layered surface.""" + + @property + def maximum_surfacecubemap_width(self) -> int: + """int: Maximum cubemap surface width.""" + + @property + def maximum_surfacecubemap_layered_width(self) -> int: + """int: Maximum cubemap layered surface width.""" + + @property + def maximum_surfacecubemap_layered_layers(self) -> int: + """int: Maximum layers in a cubemap layered surface.""" + + @property + def max_registers_per_block(self) -> int: + """int: Maximum number of 32-bit registers available to a thread block.""" + + @property + def clock_rate(self) -> int: + """int: Typical clock frequency in kilohertz.""" + + @property + def texture_alignment(self) -> int: + """int: Alignment requirement for textures.""" + + @property + def texture_pitch_alignment(self) -> int: + """int: Pitch alignment requirement for textures.""" + + @property + def gpu_overlap(self) -> bool: + """bool: Device can possibly copy memory and execute a kernel concurrently. Deprecated. Use :attr:`~DeviceProperties.async_engine_count` instead.""" + + @property + def multiprocessor_count(self) -> int: + """int: Number of multiprocessors on device.""" + + @property + def kernel_exec_timeout(self) -> bool: + """bool: Specifies whether there is a run time limit on kernels.""" + + @property + def integrated(self) -> bool: + """bool: Device is integrated with host memory.""" + + @property + def can_map_host_memory(self) -> bool: + """bool: Device can map host memory into CUDA address space.""" + + @property + def compute_mode(self) -> int: + """int: Compute mode (See CUcomputemode for details).""" + + @property + def concurrent_kernels(self) -> bool: + """bool: Device can possibly execute multiple kernels concurrently.""" + + @property + def ecc_enabled(self) -> bool: + """bool: Device has ECC support enabled.""" + + @property + def pci_bus_id(self) -> int: + """int: PCI bus ID of the device.""" + + @property + def pci_device_id(self) -> int: + """int: PCI device ID of the device.""" + + @property + def pci_domain_id(self) -> int: + """int: PCI domain ID of the device.""" + + @property + def tcc_driver(self) -> bool: + """bool: Device is using TCC driver model.""" + + @property + def memory_clock_rate(self) -> int: + """int: Peak memory clock frequency in kilohertz.""" + + @property + def global_memory_bus_width(self) -> int: + """int: Global memory bus width in bits.""" + + @property + def l2_cache_size(self) -> int: + """int: Size of L2 cache in bytes.""" + + @property + def max_threads_per_multiprocessor(self) -> int: + """int: Maximum resident threads per multiprocessor.""" + + @property + def unified_addressing(self) -> bool: + """bool: Device shares a unified address space with the host.""" + + @property + def compute_capability_major(self) -> int: + """int: Major compute capability version number.""" + + @property + def compute_capability_minor(self) -> int: + """int: Minor compute capability version number.""" + + @property + def global_l1_cache_supported(self) -> bool: + """bool: Device supports caching globals in L1.""" + + @property + def local_l1_cache_supported(self) -> bool: + """bool: Device supports caching locals in L1.""" + + @property + def max_shared_memory_per_multiprocessor(self) -> int: + """int: Maximum shared memory available per multiprocessor in bytes.""" + + @property + def max_registers_per_multiprocessor(self) -> int: + """int: Maximum number of 32-bit registers available per multiprocessor.""" + + @property + def managed_memory(self) -> bool: + """bool: Device can allocate managed memory on this system.""" + + @property + def multi_gpu_board(self) -> bool: + """bool: Device is on a multi-GPU board.""" + + @property + def multi_gpu_board_group_id(self) -> int: + """int: Unique id for a group of devices on the same multi-GPU board.""" + + @property + def host_native_atomic_supported(self) -> bool: + """bool: Link between the device and the host supports all native atomic operations.""" + + @property + def single_to_double_precision_perf_ratio(self) -> int: + """int: Ratio of single precision performance (in floating-point operations per second) to double precision performance.""" + + @property + def pageable_memory_access(self) -> bool: + """bool: Device supports coherently accessing pageable memory without calling cudaHostRegister on it.""" + + @property + def concurrent_managed_access(self) -> bool: + """bool: Device can coherently access managed memory concurrently with the CPU.""" + + @property + def compute_preemption_supported(self) -> bool: + """bool: Device supports compute preemption.""" + + @property + def can_use_host_pointer_for_registered_mem(self) -> bool: + """bool: Device can access host registered memory at the same virtual address as the CPU.""" + + @property + def cooperative_launch(self) -> bool: + """bool: Device supports launching cooperative kernels via cuLaunchCooperativeKernel.""" + + @property + def max_shared_memory_per_block_optin(self) -> int: + """int: Maximum optin shared memory per block.""" + + @property + def pageable_memory_access_uses_host_page_tables(self) -> bool: + """bool: Device accesses pageable memory via the host's page tables.""" + + @property + def direct_managed_mem_access_from_host(self) -> bool: + """bool: The host can directly access managed memory on the device without migration.""" + + @property + def virtual_memory_management_supported(self) -> bool: + """bool: Device supports virtual memory management APIs like cuMemAddressReserve, cuMemCreate, cuMemMap and related APIs.""" + + @property + def handle_type_posix_file_descriptor_supported(self) -> bool: + """bool: Device supports exporting memory to a posix file descriptor with cuMemExportToShareableHandle, if requested via cuMemCreate.""" + + @property + def handle_type_win32_handle_supported(self) -> bool: + """bool: Device supports exporting memory to a Win32 NT handle with cuMemExportToShareableHandle, if requested via cuMemCreate.""" + + @property + def handle_type_win32_kmt_handle_supported(self) -> bool: + """bool: Device supports exporting memory to a Win32 KMT handle with cuMemExportToShareableHandle, if requested via cuMemCreate.""" + + @property + def max_blocks_per_multiprocessor(self) -> int: + """int: Maximum number of blocks per multiprocessor.""" + + @property + def generic_compression_supported(self) -> bool: + """bool: Device supports compression of memory.""" + + @property + def max_persisting_l2_cache_size(self) -> int: + """int: Maximum L2 persisting lines capacity setting in bytes.""" + + @property + def max_access_policy_window_size(self) -> int: + """int: Maximum value of CUaccessPolicyWindow.num_bytes.""" + + @property + def gpu_direct_rdma_with_cuda_vmm_supported(self) -> bool: + """bool: Device supports specifying the GPUDirect RDMA flag with cuMemCreate.""" + + @property + def reserved_shared_memory_per_block(self) -> int: + """int: Shared memory reserved by CUDA driver per block in bytes.""" + + @property + def sparse_cuda_array_supported(self) -> bool: + """bool: Device supports sparse CUDA arrays and sparse CUDA mipmapped arrays.""" + + @property + def read_only_host_register_supported(self) -> bool: + """bool: True if device supports using the cuMemHostRegister flag CU_MEMHOSTREGISTER_READ_ONLY to register memory that must be mapped as read-only to the GPU, False if not.""" + + @property + def memory_pools_supported(self) -> bool: + """bool: Device supports using the cuMemAllocAsync and cuMemPool family of APIs.""" + + @property + def gpu_direct_rdma_supported(self) -> bool: + """bool: Device supports GPUDirect RDMA APIs, like nvidia_p2p_get_pages (see https://docs.nvidia.com/cuda/gpudirect-rdma for more information).""" + + @property + def gpu_direct_rdma_flush_writes_options(self) -> int: + """int: The returned attribute shall be interpreted as a bitmask, where the individual bits are described by the CUflushGPUDirectRDMAWritesOptions enum.""" + + @property + def gpu_direct_rdma_writes_ordering(self) -> int: + """int: GPUDirect RDMA writes to the device do not need to be flushed for consumers within the scope indicated by the returned attribute. See CUGPUDirectRDMAWritesOrdering for the numerical values returned here.""" + + @property + def mempool_supported_handle_types(self) -> int: + """int: Handle types supported with mempool based IPC.""" + + @property + def deferred_mapping_cuda_array_supported(self) -> bool: + """bool: Device supports deferred mapping CUDA arrays and CUDA mipmapped arrays.""" + + @property + def numa_config(self) -> int: + """int: NUMA configuration of a device: value is of type CUdeviceNumaConfig enum.""" + + @property + def numa_id(self) -> int: + """int: NUMA node ID of the GPU memory.""" + + @property + def multicast_supported(self) -> bool: + """bool: Device supports switch multicast and reduction operations.""" + + @property + def surface_alignment(self) -> int: + """int: Surface alignment requirement in bytes.""" + + @property + def async_engine_count(self) -> int: + """int: Number of asynchronous engines.""" + + @property + def can_tex2d_gather(self) -> bool: + """bool: True if device supports 2D texture gather operations, False if not.""" + + @property + def maximum_texture2d_gather_width(self) -> int: + """int: Maximum 2D texture gather width.""" + + @property + def maximum_texture2d_gather_height(self) -> int: + """int: Maximum 2D texture gather height.""" + + @property + def stream_priorities_supported(self) -> bool: + """bool: True if device supports stream priorities, False if not.""" + + @property + def can_flush_remote_writes(self) -> bool: + """bool: The CU_STREAM_WAIT_VALUE_FLUSH flag and the CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES MemOp are supported on the device. See Stream Memory Operations for additional details.""" + + @property + def host_register_supported(self) -> bool: + """bool: Device supports host memory registration via cudaHostRegister.""" + + @property + def timeline_semaphore_interop_supported(self) -> bool: + """bool: External timeline semaphore interop is supported on the device.""" + + @property + def cluster_launch(self) -> bool: + """bool: Indicates device supports cluster launch.""" + + @property + def can_use_64_bit_stream_mem_ops(self) -> bool: + """bool: 64-bit operations are supported in cuStreamBatchMemOp and related MemOp APIs.""" + + @property + def can_use_stream_wait_value_nor(self) -> bool: + """bool: CU_STREAM_WAIT_VALUE_NOR is supported by MemOp APIs.""" + + @property + def dma_buf_supported(self) -> bool: + """bool: Device supports buffer sharing with dma_buf mechanism.""" + + @property + def ipc_event_supported(self) -> bool: + """bool: Device supports IPC Events.""" + + @property + def mem_sync_domain_count(self) -> int: + """int: Number of memory domains the device supports.""" + + @property + def tensor_map_access_supported(self) -> bool: + """bool: Device supports accessing memory using Tensor Map.""" + + @property + def handle_type_fabric_supported(self) -> bool: + """bool: Device supports exporting memory to a fabric handle with cuMemExportToShareableHandle() or requested with cuMemCreate().""" + + @property + def unified_function_pointers(self) -> bool: + """bool: Device supports unified function pointers.""" + + @property + def mps_enabled(self) -> bool: + """bool: Indicates if contexts created on this device will be shared via MPS.""" + + @property + def host_numa_id(self) -> int: + """int: NUMA ID of the host node closest to the device. Returns -1 when system does not support NUMA.""" + + @property + def d3d12_cig_supported(self) -> bool: + """bool: Device supports CIG with D3D12.""" + + @property + def mem_decompress_algorithm_mask(self) -> int: + """int: The returned value shall be interpreted as a bitmask, where the individual bits are described by the CUmemDecompressAlgorithm enum.""" + + @property + def mem_decompress_maximum_length(self) -> int: + """int: The returned value is the maximum length in bytes of a single decompress operation that is allowed.""" + + @property + def vulkan_cig_supported(self) -> bool: + """bool: Device supports CIG with Vulkan.""" + + @property + def gpu_pci_device_id(self) -> int: + """int: The combined 16-bit PCI device ID and 16-bit PCI vendor ID. + + Returns 0 if the driver does not support this query. + """ + + @property + def gpu_pci_subsystem_id(self) -> int: + """int: The combined 16-bit PCI subsystem ID and 16-bit PCI subsystem vendor ID. + + Returns 0 if the driver does not support this query. + """ + + @property + def host_numa_virtual_memory_management_supported(self) -> bool: + """bool: Device supports HOST_NUMA location with the virtual memory management APIs like cuMemCreate, cuMemMap and related APIs.""" + + @property + def host_numa_memory_pools_supported(self) -> bool: + """bool: Device supports HOST_NUMA location with the cuMemAllocAsync and cuMemPool family of APIs.""" + + @property + def host_numa_multinode_ipc_supported(self) -> bool: + """bool: Device supports HOST_NUMA location IPC between nodes in a multi-node system.""" + + @property + def host_memory_pools_supported(self) -> bool: + """bool: Device supports HOST location with the cuMemAllocAsync and cuMemPool family of APIs.""" + + @property + def host_virtual_memory_management_supported(self) -> bool: + """bool: Device supports HOST location with the virtual memory management APIs like cuMemCreate, cuMemMap and related APIs.""" + + @property + def host_alloc_dma_buf_supported(self) -> bool: + """bool: Device supports page-locked host memory buffer sharing with dma_buf mechanism.""" + + @property + def only_partial_host_native_atomic_supported(self) -> bool: + """bool: Link between the device and the host supports only some native atomic operations.""" + +class Device: + """Represent a GPU and act as an entry point for cuda.core features. + + This is a singleton object that helps ensure interoperability + across multiple libraries imported in the process to both see + and use the same GPU device. + + While acting as the entry point, many other CUDA resources can be + allocated such as streams and buffers. Any :obj:`~_context.Context` dependent + resource created through this device, will continue to refer to + this device's context. + + Newly returned :obj:`~_device.Device` objects are thread-local singletons + for a specified device. + + Note + ---- + Will not initialize the GPU. + + Parameters + ---------- + device_id : int, optional + Device ordinal to return a :obj:`~_device.Device` object for. + Default value of `None` return the currently used device. + + """ + __slots__ = ('_device_id', '_memory_resource', '_has_inited', '_properties', '_resources', '_uuid', '_context', '__weakref__') + + def __new__(cls, device_id: Device | int | None=None) -> Device: + ... + + def _check_context_initialized(self) -> None: + ... + + @classmethod + def get_all_devices(cls) -> tuple[Device, ...]: + """ + Query the available device instances. + + Returns + ------- + tuple of Device + A tuple containing instances of available devices. + """ + + def to_system_device(self) -> 'cuda.core.system.Device': + """ + Get the corresponding :class:`cuda.core.system.Device` (which is used + for NVIDIA Management Library (NVML) access) for this + :class:`cuda.core.Device` (which is used for CUDA access). + + The devices are mapped to one another by their UUID. + + Returns + ------- + cuda.core.system.Device + The corresponding system-level device instance used for NVML access. + """ + + @property + def device_id(self) -> int: + """Return device ordinal.""" + + @property + def pci_bus_id(self) -> str: + """Return a PCI Bus Id string for this device.""" + + def can_access_peer(self, peer: Device | int) -> bool: + """Check if this device can access memory from the specified peer device. + + Queries whether peer-to-peer memory access is supported between this + device and the specified peer device. + + Parameters + ---------- + peer : Device | int + The peer device to check accessibility to. Can be a :obj:`~_device.Device` object or device ID. + """ + + @property + def uuid(self) -> str: + """Return a UUID for the device. + + Returns 16-octets identifying the device. If the device is in + MIG mode, returns its MIG UUID which uniquely identifies the + subscribed MIG compute instance. + + Note + ---- + MIG UUID is only returned when device is in MIG mode and the + driver is older than CUDA 11.4. + + The UUID is cached after first access to avoid repeated CUDA API calls. + + """ + + @property + def name(self) -> str: + """Return the device name.""" + + @property + def properties(self) -> DeviceProperties: + """Return a :obj:`~_device.DeviceProperties` class with information about the device.""" + + @property + def resources(self) -> DeviceResources: + """Return the hardware resource query namespace for this device.""" + + @property + def compute_capability(self) -> ComputeCapability: + """Return a named tuple with 2 fields: major and minor.""" + + @property + def arch(self) -> str: + """Return compute capability as a string (e.g., '75' for CC 7.5).""" + + @property + def context(self) -> Context: + """Return the :obj:`~_context.Context` associated with this device. + + Note + ---- + Device must be initialized. + + """ + + @property + def memory_resource(self) -> MemoryResource: + """Return :obj:`~_memory.MemoryResource` associated with this device.""" + + @memory_resource.setter + def memory_resource(self, mr: MemoryResource) -> None: + ... + + @property + def default_stream(self) -> Stream: + """Return default CUDA :obj:`~_stream.Stream` associated with this device. + + The type of default stream returned depends on if the environment + variable CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM is set. + + If set, returns a per-thread default stream. Otherwise returns + the legacy stream. + + """ + + def __int__(self) -> int: + """Return device_id.""" + + def __repr__(self) -> str: + ... + + def __hash__(self) -> int: + ... + + def __eq__(self, other: object) -> bool: + ... + + def __reduce__(self) -> tuple[object, ...]: + ... + + def set_current(self, ctx: Context | None=None) -> Context | None: + """Set device to be used for GPU executions. + + Initializes CUDA and sets the calling thread to a valid CUDA + context. By default the primary context is used, but optional `ctx` + parameter can be used to explicitly supply a :obj:`~_context.Context` object. + + Providing a `ctx` causes the previous set context to be popped and returned. + + Parameters + ---------- + ctx : :obj:`~_context.Context`, optional + Optional context to push onto this device's current thread stack. + + Returns + ------- + :obj:`~_context.Context`, optional + Popped context. + + Examples + -------- + Acts as an entry point of this object. Users always start a code by + calling this method, e.g. + + >>> from cuda.core import Device + >>> dev0 = Device(0) + >>> dev0.set_current() + >>> # ... do work on device 0 ... + + """ + + def create_context(self, options: ContextOptions | None=None) -> Context: + """Create a new :obj:`~_context.Context` object. + + Note + ---- + The newly created context will not be set as current. + + Parameters + ---------- + options : :obj:`~_context.ContextOptions`, optional + Customizable dataclass for context creation options. + + Returns + ------- + :obj:`~_context.Context` + Newly created context object. + + """ + + def create_stream(self, obj: IsStreamType | None=None, options: object=None) -> Stream: + """Create a :obj:`~_stream.Stream` object. + + New stream objects can be created in two different ways: + + 1) Create a new CUDA stream with customizable ``options``. + 2) Wrap an existing foreign `obj` supporting the ``__cuda_stream__`` protocol. + + Option (2) internally holds a reference to the foreign object + such that the lifetime is managed. + + Note + ---- + Device must be initialized. + + Parameters + ---------- + obj : :obj:`~_stream.IsStreamType`, optional + Any object supporting the ``__cuda_stream__`` protocol. + options : :obj:`~_stream.StreamOptions`, optional + Customizable dataclass for stream creation options. + + Returns + ------- + :obj:`~_stream.Stream` + Newly created stream object. + + """ + + def create_event(self, options: EventOptions | None=None) -> Event: + """Create an :obj:`~_event.Event` object without recording it to a :obj:`~_stream.Stream`. + + Note + ---- + Device must be initialized. + + Parameters + ---------- + options : :obj:`EventOptions`, optional + Customizable dataclass for event creation options. + + Returns + ------- + :obj:`~_event.Event` + Newly created event object. + + """ + + def allocate(self, size: int, *, stream: Stream | GraphBuilder) -> Buffer: + """Allocate device memory from a specified stream. + + Allocates device memory of `size` bytes on the specified `stream` + using the memory resource currently associated with this Device. + + Note + ---- + Device must be initialized. + + Parameters + ---------- + size : int + Number of bytes to allocate. + stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` + Keyword-only. The stream establishing the stream ordering semantic. + Must be passed explicitly; pass ``self.default_stream`` to use + the default stream. + + Returns + ------- + :obj:`~_memory.Buffer` + Newly created buffer object. + + """ + + def sync(self) -> None: + """Synchronize the device. + + Note + ---- + Device must be initialized. + + """ + + def create_graph_builder(self) -> GraphBuilder: + """Create a new :obj:`~graph.GraphBuilder` object. + + Returns + ------- + :obj:`~graph.GraphBuilder` + Newly created graph builder object. + + """ + + def create_opaque_array(self, options: OpaqueArrayOptions) -> OpaqueArray: + """Create an :obj:`~cuda.core.texture.OpaqueArray` on the current device. + + Allocates an opaque, hardware-laid-out CUDA array for texture/surface + access. The array is created in the current CUDA context, so make this + device current with :meth:`set_current` before calling (mirroring + :meth:`create_stream` / :meth:`create_event`). + + Note + ---- + Device must be initialized. + + Parameters + ---------- + options : :obj:`~cuda.core.texture.OpaqueArrayOptions` + Allocation options (shape, format, channels, surface flag). + + Returns + ------- + :obj:`~cuda.core.texture.OpaqueArray` + Newly created opaque array. + + .. versionadded:: 1.1.0 + """ + + def create_mipmapped_array(self, options: MipmappedArrayOptions) -> MipmappedArray: + """Create a :obj:`~cuda.core.texture.MipmappedArray` on the current device. + + Allocates a mipmapped CUDA array for texture/surface access across + levels. The array is created in the current CUDA context, so make this + device current with :meth:`set_current` before calling (mirroring + :meth:`create_stream` / :meth:`create_event`). + + Note + ---- + Device must be initialized. + + Parameters + ---------- + options : :obj:`~cuda.core.texture.MipmappedArrayOptions` + Allocation options (shape, format, channels, levels, surface flag). + + Returns + ------- + :obj:`~cuda.core.texture.MipmappedArray` + Newly created mipmapped array. + + .. versionadded:: 1.1.0 + """ + + def create_texture_object(self, *, resource: ResourceDescriptor, options: TextureObjectOptions | None=None) -> TextureObject: + """Create a :obj:`~cuda.core.texture.TextureObject` on the current device. + + Binds a resource (an :obj:`~cuda.core.texture.OpaqueArray` / + :obj:`~cuda.core.texture.MipmappedArray` / linear or pitch2d + :obj:`~cuda.core.Buffer`, wrapped in a + :obj:`~cuda.core.texture.ResourceDescriptor`) as a bindless texture for + kernel-side sampled reads. The object is created in the current CUDA + context, so make this device current with :meth:`set_current` before + calling (mirroring :meth:`create_stream` / :meth:`create_event`). + + Note + ---- + Device must be initialized. + + Parameters + ---------- + resource : :obj:`~cuda.core.texture.ResourceDescriptor` + The memory backing the texture. + options : :obj:`~cuda.core.texture.TextureObjectOptions` + Sampling state (address/filter/read modes, normalization, etc.). + + Returns + ------- + :obj:`~cuda.core.texture.TextureObject` + Newly created texture object. + + .. versionadded:: 1.1.0 + """ + + def create_surface_object(self, *, resource: ResourceDescriptor) -> SurfaceObject: + """Create a :obj:`~cuda.core.texture.SurfaceObject` on the current device. + + Binds an :obj:`~cuda.core.texture.OpaqueArray` (via a + :obj:`~cuda.core.texture.ResourceDescriptor`) as a bindless surface for + kernel-side typed load/store. The backing array must have been created + with ``is_surface_load_store=True``. The object is created in the + current CUDA context, so make this device current with + :meth:`set_current` before calling (mirroring :meth:`create_stream` / + :meth:`create_event`). + + Note + ---- + Device must be initialized. + + Parameters + ---------- + resource : :obj:`~cuda.core.texture.ResourceDescriptor` + Must wrap an :obj:`~cuda.core.texture.OpaqueArray` allocated with + ``is_surface_load_store=True``. + + Returns + ------- + :obj:`~cuda.core.texture.SurfaceObject` + Newly created surface object. + + .. versionadded:: 1.1.0 + """ +_tls = threading.local() +_lock = threading.Lock() \ No newline at end of file diff --git a/cuda_core/cuda/core/_device.pyx b/cuda_core/cuda/core/_device.pyx index 9d143679f83..ea5bb62cc1b 100644 --- a/cuda_core/cuda/core/_device.pyx +++ b/cuda_core/cuda/core/_device.pyx @@ -1,30 +1,34 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations cimport cpython -from libc.stdint cimport uintptr_t from cuda.bindings cimport cydriver -from cuda.core._utils.cuda_utils cimport HANDLE_RETURN +from cuda.core._utils.cuda_utils cimport check_or_create_options, HANDLE_RETURN +from libcpp.vector cimport vector import threading from cuda.core._context cimport Context from cuda.core._context import ContextOptions +from cuda.core._device_resources cimport DeviceResources, SMResource, WorkqueueResource from cuda.core._event cimport Event as cyEvent from cuda.core._event import Event, EventOptions +from cuda.core._memory._buffer cimport Buffer, MemoryResource from cuda.core._resource_handles cimport ( ContextHandle, + GreenCtxHandle, create_context_handle_ref, + create_green_ctx_handle, get_primary_context, + get_last_error, as_cu, ) -from cuda.core._graph import GraphBuilder -from cuda.core._stream import IsStreamT, Stream, StreamOptions +from cuda.core._stream import IsStreamType, Stream from cuda.core._utils.clear_error_support import assert_type from cuda.core._utils.cuda_utils import ( ComputeCapability, @@ -35,6 +39,22 @@ from cuda.core._utils.cuda_utils import ( ) from cuda.core._stream cimport default_stream +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + import cuda.core.system # no-cython-lint + from cuda.core.graph import GraphBuilder + from cuda.core.texture import ( + MipmappedArray, + MipmappedArrayOptions, + OpaqueArray, + OpaqueArrayOptions, + ResourceDescriptor, + SurfaceObject, + TextureObject, + TextureObjectOptions, + ) + # TODO: I prefer to type these as "cdef object" and avoid accessing them from within Python, # but it seems it is very convenient to expose them for testing purposes... _tls = threading.local() @@ -52,11 +72,11 @@ cdef class DeviceProperties: int _handle dict _cache - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: raise RuntimeError("DeviceProperties cannot be instantiated directly. Please use Device APIs.") @classmethod - def _init(cls, handle): + def _init(cls, handle: int) -> DeviceProperties: cdef DeviceProperties self = DeviceProperties.__new__(cls) self._handle = handle self._cache = {} @@ -75,9 +95,12 @@ cdef class DeviceProperties: cdef inline int _get_cached_attribute(self, attr, default=0) except? -2: """Retrieve the attribute value, using cache if applicable.""" - if attr not in self._cache: - self._cache[attr] = self._get_attribute(attr, default) - return self._cache[attr] + cached = self._cache.get(attr) + if cached is not None: + return cached + cdef int value = self._get_attribute(attr, default) + self._cache[attr] = value # setdefault not needed for ints + return value @property def max_threads_per_block(self) -> int: @@ -378,7 +401,7 @@ cdef class DeviceProperties: @property def gpu_overlap(self) -> bool: - """bool: Device can possibly copy memory and execute a kernel concurrently. Deprecated. Use instead async_engine_count.""" + """bool: Device can possibly copy memory and execute a kernel concurrently. Deprecated. Use :attr:`~DeviceProperties.async_engine_count` instead.""" return bool(self._get_cached_attribute(driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_GPU_OVERLAP)) @property @@ -663,7 +686,7 @@ cdef class DeviceProperties: @property def read_only_host_register_supported(self) -> bool: - """bool: True if device supports using the cuMemHostRegister flag CU_MEMHOSTERGISTER_READ_ONLY to register memory that must be mapped as read-only to the GPU, False if not.""" + """bool: True if device supports using the cuMemHostRegister flag CU_MEMHOSTREGISTER_READ_ONLY to register memory that must be mapped as read-only to the GPU, False if not.""" return bool( self._get_cached_attribute(driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_READ_ONLY_HOST_REGISTER_SUPPORTED) ) @@ -842,12 +865,12 @@ cdef class DeviceProperties: @property def mem_decompress_algorithm_mask(self) -> int: - """int: The returned valued shall be interpreted as a bitmask, where the individual bits are described by the CUmemDecompressAlgorithm enum.""" + """int: The returned value shall be interpreted as a bitmask, where the individual bits are described by the CUmemDecompressAlgorithm enum.""" return self._get_cached_attribute(driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_ALGORITHM_MASK) @property def mem_decompress_maximum_length(self) -> int: - """int: The returned valued is the maximum length in bytes of a single decompress operation that is allowed.""" + """int: The returned value is the maximum length in bytes of a single decompress operation that is allowed.""" return self._get_cached_attribute(driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_MAXIMUM_LENGTH) @property @@ -898,7 +921,7 @@ cdef class DeviceProperties: @property def host_memory_pools_supported(self) -> bool: - """bool: Device suports HOST location with the cuMemAllocAsync and cuMemPool family of APIs.""" + """bool: Device supports HOST location with the cuMemAllocAsync and cuMemPool family of APIs.""" return bool( self._get_cached_attribute(driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_HOST_MEMORY_POOLS_SUPPORTED) ) @@ -955,9 +978,18 @@ class Device: Default value of `None` return the currently used device. """ - __slots__ = ("_device_id", "_memory_resource", "_has_inited", "_properties", "_uuid", "_context", "__weakref__") - - def __new__(cls, device_id: Device | int | None = None): + __slots__ = ( + "_device_id", + "_memory_resource", + "_has_inited", + "_properties", + "_resources", + "_uuid", + "_context", + "__weakref__", + ) + + def __new__(cls, device_id: Device | int | None = None) -> Device: if isinstance(device_id, Device): return device_id @@ -970,7 +1002,7 @@ class Device: except IndexError: raise ValueError(f"device_id must be within [0, {len(devices)}), got {device_id}") from None - def _check_context_initialized(self): + def _check_context_initialized(self) -> None: if not self._has_inited: raise CUDAError( f"Device {self._device_id} is not yet initialized, perhaps you forgot to call .set_current() first?" @@ -978,7 +1010,7 @@ class Device: @classmethod - def get_all_devices(cls): + def get_all_devices(cls) -> tuple[Device, ...]: """ Query the available device instances. @@ -994,7 +1026,7 @@ class Device: def to_system_device(self) -> 'cuda.core.system.Device': """ Get the corresponding :class:`cuda.core.system.Device` (which is used - for NVIDIA Machine Library (NVML) access) for this + for NVIDIA Management Library (NVML) access) for this :class:`cuda.core.Device` (which is used for CUDA access). The devices are mapped to one another by their UUID. @@ -1008,7 +1040,7 @@ class Device: if not CUDA_BINDINGS_NVML_IS_COMPATIBLE: raise RuntimeError( - "cuda.core.system.Device requires cuda_bindings 13.1.2+ or 12.9.6+" + "cuda.core.system.Device requires cuda-bindings 12.9.6+ for CUDA 12.x, or cuda-bindings 13.2.0+ for CUDA 13.x" ) from cuda.core.system import Device as SystemDevice @@ -1034,7 +1066,7 @@ class Device: Parameters ---------- peer : Device | int - The peer device to check accessibility to. Can be a Device object or device ID. + The peer device to check accessibility to. Can be a :obj:`~_device.Device` object or device ID. """ peer = Device(peer) cdef int d1 = self.device_id @@ -1101,15 +1133,22 @@ class Device: return self._properties + @property + def resources(self) -> DeviceResources: + """Return the hardware resource query namespace for this device.""" + if self._resources is None: + self._resources = DeviceResources._init(self._device_id) + return self._resources + @property def compute_capability(self) -> ComputeCapability: """Return a named tuple with 2 fields: major and minor.""" cdef DeviceProperties prop = self.properties - if "compute_capability" in prop._cache: - return prop._cache["compute_capability"] + cached = prop._cache.get("compute_capability") + if cached is not None: + return cached cc = ComputeCapability(prop.compute_capability_major, prop.compute_capability_minor) - prop._cache["compute_capability"] = cc - return cc + return prop._cache.setdefault("compute_capability", cc) @property def arch(self) -> str: @@ -1146,13 +1185,13 @@ class Device: from cuda.core._memory import DeviceMemoryResource self._memory_resource = DeviceMemoryResource(self._device_id) else: - from cuda.core._memory import _SynchronousMemoryResource + from cuda.core._memory._legacy import _SynchronousMemoryResource self._memory_resource = _SynchronousMemoryResource(self._device_id) return self._memory_resource @memory_resource.setter - def memory_resource(self, mr): + def memory_resource(self, mr: MemoryResource) -> None: from cuda.core._memory import MemoryResource assert_type(mr, MemoryResource) self._memory_resource = mr @@ -1170,25 +1209,25 @@ class Device: """ return default_stream() - def __int__(self): + def __int__(self) -> int: """Return device_id.""" return self._device_id - def __repr__(self): + def __repr__(self) -> str: return f"" def __hash__(self) -> int: return hash(self.uuid) - def __eq__(self, other) -> bool: + def __eq__(self, other: object) -> bool: if not isinstance(other, Device): return NotImplemented return self._device_id == other._device_id - def __reduce__(self): + def __reduce__(self) -> tuple[object, ...]: return Device, (self.device_id,) - def set_current(self, ctx: Context = None) -> Context | None: + def set_current(self, ctx: Context | None = None) -> Context | None: """Set device to be used for GPU executions. Initializes CUDA and sets the calling thread to a valid CUDA @@ -1220,6 +1259,7 @@ class Device: """ cdef ContextHandle h_context cdef cydriver.CUcontext prev_ctx, curr_ctx + cdef Context prev_owned = None if ctx is not None: # TODO: revisit once Context is cythonized @@ -1229,6 +1269,8 @@ class Device: "the provided context was created on the device with" f" id={ctx._device_id}, which is different from the target id={self._device_id}" ) + if self._has_inited and self._context is not None: + prev_owned = self._context # prev_ctx is the previous context curr_ctx = as_cu(ctx._h_context) prev_ctx = NULL @@ -1238,6 +1280,8 @@ class Device: self._has_inited = True self._context = ctx # Store owning context reference if prev_ctx != NULL: + if prev_owned is not None and as_cu(prev_owned._h_context) == prev_ctx: + return prev_owned return Context._from_handle(Context, create_context_handle_ref(prev_ctx), self._device_id) else: # use primary ctx @@ -1249,12 +1293,12 @@ class Device: self._has_inited = True self._context = Context._from_handle(Context, h_context, self._device_id) # Store owning context - def create_context(self, options: ContextOptions = None) -> Context: + def create_context(self, options: ContextOptions | None = None) -> Context: """Create a new :obj:`~_context.Context` object. Note ---- - The newly context will not be set as current. + The newly created context will not be set as current. Parameters ---------- @@ -1267,10 +1311,57 @@ class Device: Newly created context object. """ - raise NotImplementedError("WIP: https://github.com/NVIDIA/cuda-python/issues/189") + cdef int i + cdef object resources + cdef object res + cdef SMResource sm_res + cdef WorkqueueResource wq_res + cdef GreenCtxHandle h_green + + if options is None: + raise ValueError( + "options with device resources must be provided to create a green context" + ) + + options = check_or_create_options(ContextOptions, options, "Context options") + if options.resources is None: + raise ValueError( + "ContextOptions.resources must be provided to create a green context" + ) + + resources = tuple(options.resources) + if len(resources) == 0: + raise ValueError("ContextOptions.resources must not be empty") + + cdef vector[cydriver.CUdevResource] c_resources + c_resources.resize(len(resources)) + + for i, res in enumerate(resources): + if isinstance(res, SMResource): + sm_res = res + if not sm_res._is_usable: + raise ValueError("dry-run SMResource objects cannot be used to create a context") + c_resources[i] = sm_res._resource + elif isinstance(res, WorkqueueResource): + wq_res = res + c_resources[i] = wq_res._wq_config_resource + else: + raise TypeError(f"Unsupported context resource type: {type(res)}") + + h_green = create_green_ctx_handle( + c_resources.data(), + (c_resources.size()), + (self._device_id), + (cydriver.CUgreenCtxCreate_flags.CU_GREEN_CTX_DEFAULT_STREAM), + ) + if h_green.get() == NULL: + HANDLE_RETURN(get_last_error()) + raise RuntimeError("Failed to create CUDA green context") + + return Context._from_green_ctx(Context, h_green, self._device_id) - def create_stream(self, obj: IsStreamT | None = None, options: StreamOptions | None = None) -> Stream: - """Create a Stream object. + def create_stream(self, obj: IsStreamType | None = None, options: object = None) -> Stream: + """Create a :obj:`~_stream.Stream` object. New stream objects can be created in two different ways: @@ -1286,7 +1377,7 @@ class Device: Parameters ---------- - obj : :obj:`~_stream.IsStreamT`, optional + obj : :obj:`~_stream.IsStreamType`, optional Any object supporting the ``__cuda_stream__`` protocol. options : :obj:`~_stream.StreamOptions`, optional Customizable dataclass for stream creation options. @@ -1301,7 +1392,7 @@ class Device: return Stream._init(obj=obj, options=options, device_id=self._device_id, ctx=self._context) def create_event(self, options: EventOptions | None = None) -> Event: - """Create an Event object without recording it to a Stream. + """Create an :obj:`~_event.Event` object without recording it to a :obj:`~_stream.Stream`. Note ---- @@ -1322,14 +1413,12 @@ class Device: cdef Context ctx = self._context return cyEvent._init(cyEvent, self._device_id, ctx._h_context, options, True) - def allocate(self, size, stream: Stream | GraphBuilder | None = None) -> Buffer: + def allocate(self, size: int, *, stream: Stream | GraphBuilder) -> Buffer: """Allocate device memory from a specified stream. Allocates device memory of `size` bytes on the specified `stream` using the memory resource currently associated with this Device. - Parameter `stream` is optional, using a default stream by default. - Note ---- Device must be initialized. @@ -1338,9 +1427,10 @@ class Device: ---------- size : int Number of bytes to allocate. - stream : :obj:`~_stream.Stream`, optional - The stream establishing the stream ordering semantic. - Default value of `None` uses default stream. + stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` + Keyword-only. The stream establishing the stream ordering semantic. + Must be passed explicitly; pass ``self.default_stream`` to use + the default stream. Returns ------- @@ -1349,9 +1439,9 @@ class Device: """ self._check_context_initialized() - return self.memory_resource.allocate(size, stream) + return self.memory_resource.allocate(size, stream=stream) - def sync(self): + def sync(self) -> None: """Synchronize the device. Note @@ -1363,16 +1453,145 @@ class Device: handle_return(runtime.cudaDeviceSynchronize()) def create_graph_builder(self) -> GraphBuilder: - """Create a new :obj:`~_graph.GraphBuilder` object. + """Create a new :obj:`~graph.GraphBuilder` object. Returns ------- - :obj:`~_graph.GraphBuilder` + :obj:`~graph.GraphBuilder` Newly created graph builder object. """ + from cuda.core.graph._graph_builder import GraphBuilder + + self._check_context_initialized() + return GraphBuilder._init(self.create_stream()) + + def create_opaque_array(self, options: OpaqueArrayOptions) -> OpaqueArray: + """Create an :obj:`~cuda.core.texture.OpaqueArray` on the current device. + + Allocates an opaque, hardware-laid-out CUDA array for texture/surface + access. The array is created in the current CUDA context, so make this + device current with :meth:`set_current` before calling (mirroring + :meth:`create_stream` / :meth:`create_event`). + + Note + ---- + Device must be initialized. + + Parameters + ---------- + options : :obj:`~cuda.core.texture.OpaqueArrayOptions` + Allocation options (shape, format, channels, surface flag). + + Returns + ------- + :obj:`~cuda.core.texture.OpaqueArray` + Newly created opaque array. + + .. versionadded:: 1.1.0 + """ + from cuda.core.texture._array import _create_opaque_array + + self._check_context_initialized() + return _create_opaque_array(options) + + def create_mipmapped_array(self, options: MipmappedArrayOptions) -> MipmappedArray: + """Create a :obj:`~cuda.core.texture.MipmappedArray` on the current device. + + Allocates a mipmapped CUDA array for texture/surface access across + levels. The array is created in the current CUDA context, so make this + device current with :meth:`set_current` before calling (mirroring + :meth:`create_stream` / :meth:`create_event`). + + Note + ---- + Device must be initialized. + + Parameters + ---------- + options : :obj:`~cuda.core.texture.MipmappedArrayOptions` + Allocation options (shape, format, channels, levels, surface flag). + + Returns + ------- + :obj:`~cuda.core.texture.MipmappedArray` + Newly created mipmapped array. + + .. versionadded:: 1.1.0 + """ + from cuda.core.texture._mipmapped_array import _create_mipmapped_array + + self._check_context_initialized() + return _create_mipmapped_array(options) + + def create_texture_object( + self, *, resource: ResourceDescriptor, options: TextureObjectOptions | None = None + ) -> TextureObject: + """Create a :obj:`~cuda.core.texture.TextureObject` on the current device. + + Binds a resource (an :obj:`~cuda.core.texture.OpaqueArray` / + :obj:`~cuda.core.texture.MipmappedArray` / linear or pitch2d + :obj:`~cuda.core.Buffer`, wrapped in a + :obj:`~cuda.core.texture.ResourceDescriptor`) as a bindless texture for + kernel-side sampled reads. The object is created in the current CUDA + context, so make this device current with :meth:`set_current` before + calling (mirroring :meth:`create_stream` / :meth:`create_event`). + + Note + ---- + Device must be initialized. + + Parameters + ---------- + resource : :obj:`~cuda.core.texture.ResourceDescriptor` + The memory backing the texture. + options : :obj:`~cuda.core.texture.TextureObjectOptions` + Sampling state (address/filter/read modes, normalization, etc.). + + Returns + ------- + :obj:`~cuda.core.texture.TextureObject` + Newly created texture object. + + .. versionadded:: 1.1.0 + """ + from cuda.core.texture._texture import _create_texture_object + + self._check_context_initialized() + return _create_texture_object(resource, options) + + def create_surface_object(self, *, resource: ResourceDescriptor) -> SurfaceObject: + """Create a :obj:`~cuda.core.texture.SurfaceObject` on the current device. + + Binds an :obj:`~cuda.core.texture.OpaqueArray` (via a + :obj:`~cuda.core.texture.ResourceDescriptor`) as a bindless surface for + kernel-side typed load/store. The backing array must have been created + with ``is_surface_load_store=True``. The object is created in the + current CUDA context, so make this device current with + :meth:`set_current` before calling (mirroring :meth:`create_stream` / + :meth:`create_event`). + + Note + ---- + Device must be initialized. + + Parameters + ---------- + resource : :obj:`~cuda.core.texture.ResourceDescriptor` + Must wrap an :obj:`~cuda.core.texture.OpaqueArray` allocated with + ``is_surface_load_store=True``. + + Returns + ------- + :obj:`~cuda.core.texture.SurfaceObject` + Newly created surface object. + + .. versionadded:: 1.1.0 + """ + from cuda.core.texture._surface import _create_surface_object + self._check_context_initialized() - return GraphBuilder._init(stream=self.create_stream(), is_stream_owner=True) + return _create_surface_object(resource) cdef inline int Device_ensure_cuda_initialized() except? -1: @@ -1428,6 +1647,7 @@ cdef inline list Device_ensure_tls_devices(cls): device._memory_resource = None device._has_inited = False device._properties = None + device._resources = None device._uuid = None device._context = None devices.append(device) diff --git a/cuda_core/cuda/core/_device_resources.pxd b/cuda_core/cuda/core/_device_resources.pxd new file mode 100644 index 00000000000..98f91ab4733 --- /dev/null +++ b/cuda_core/cuda/core/_device_resources.pxd @@ -0,0 +1,54 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +cimport cython + +from cuda.bindings cimport cydriver +from cuda.core._resource_handles cimport ContextHandle, GreenCtxHandle + + +cdef class SMResource: + cdef: + cydriver.CUdevResource _resource + unsigned int _sm_count + unsigned int _min_partition_size + unsigned int _coscheduled_alignment + unsigned int _flags + bint _is_usable + object __weakref__ + cython.pymutex _split_mutex + + @staticmethod + cdef SMResource _from_dev_resource(cydriver.CUdevResource res, int device_id) + + @staticmethod + cdef SMResource _from_split_resource(cydriver.CUdevResource res, SMResource parent, bint is_usable) + + +cdef class WorkqueueResource: + cdef: + cydriver.CUdevResource _wq_config_resource + cydriver.CUdevResource _wq_resource + object __weakref__ + + @staticmethod + cdef WorkqueueResource _from_dev_resources( + cydriver.CUdevResource wq_config, + cydriver.CUdevResource wq, + ) + + +cdef class DeviceResources: + cdef: + int _device_id + ContextHandle _h_context # NULL for device-level queries + object __weakref__ + + @staticmethod + cdef DeviceResources _init(int device_id) + + @staticmethod + cdef DeviceResources _init_from_ctx(ContextHandle h_context, int device_id) + + cdef inline int _query_sm(self, cydriver.CUdevResource* res) except?-1 nogil diff --git a/cuda_core/cuda/core/_device_resources.pyi b/cuda_core/cuda/core/_device_resources.pyi new file mode 100644 index 00000000000..7514f5a2f43 --- /dev/null +++ b/cuda_core/cuda/core/_device_resources.pyi @@ -0,0 +1,187 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_device_resources.pyx + +from __future__ import annotations + +from collections.abc import Sequence as SequenceABC +from dataclasses import dataclass + +from cuda.core._device import Device +from cuda.core.typing import WorkqueueSharingScopeType + + +@dataclass +class SMResourceOptions: + """Customizable :obj:`SMResource.split` options. + + Each field accepts a scalar (for a single group) or a ``Sequence`` + (for multiple groups). ``count`` drives the number of groups; other + ``Sequence`` fields must match its length. + + Attributes + ---------- + count : int or Sequence[int], optional + Requested SM count per group. ``None`` means discovery mode + (auto-detect). (Default to ``None``) + coscheduled_sm_count : int or Sequence[int], optional + Minimum number of SMs guaranteed to be co-scheduled in each + group. (Default to ``None``) + preferred_coscheduled_sm_count : int or Sequence[int], optional + Preferred co-scheduled SM count; the driver tries to satisfy + this but may fall back to ``coscheduled_sm_count``. + (Default to ``None``) + backfill : bool or Sequence[bool], optional + If ``True``, allow the driver to relax the co-scheduling + constraint when assigning SMs. This enables requesting + arbitrary aligned SM counts that the driver would otherwise + reject due to hardware topology constraints. + (Default to ``False``) + """ + count: int | SequenceABC[int] | None = None + coscheduled_sm_count: int | SequenceABC[int] | None = None + preferred_coscheduled_sm_count: int | SequenceABC[int] | None = None + backfill: bool | SequenceABC[bool] = False + +@dataclass +class WorkqueueResourceOptions: + """Customizable :obj:`WorkqueueResource.configure` options. + + Attributes + ---------- + sharing_scope : :class:`~cuda.core.typing.WorkqueueSharingScopeType` | str, optional + Workqueue sharing scope. Accepted values: ``"device_ctx"`` or + ``"green_ctx_balanced"``. + concurrency_limit : int, optional + Expected maximum number of concurrent stream-ordered + workloads. Must be ``>= 1`` when set. The effective + driver-side cap is ``CUDA_DEVICE_MAX_CONNECTIONS`` + (typically ``[1, 32]``); configurations may exceed + this cap, but the driver will not guarantee that work + submission remains non-overlapping. (Default to ``None``) + """ + sharing_scope: WorkqueueSharingScopeType | str | None = None + concurrency_limit: int | None = None + + def __post_init__(self): + ... + +class SMResource: + """Represent an SM (streaming multiprocessor) resource partition. + + Instances are returned by :obj:`DeviceResources.sm` or + :meth:`SMResource.split` and cannot be instantiated directly. + """ + + def __init__(self, *args, **kwargs): + ... + + @property + def handle(self) -> int: + """Return the address of the underlying ``CUdevResource`` struct.""" + + @property + def sm_count(self) -> int: + """Total SMs available in this resource.""" + + @property + def min_partition_size(self) -> int: + """Minimum SM count required to create a partition.""" + + @property + def coscheduled_alignment(self) -> int: + """Number of SMs guaranteed to be co-scheduled.""" + + @property + def flags(self) -> int: + """Raw flags from the underlying SM resource.""" + + def split(self, options: SMResourceOptions, *, dry_run: bool=False) -> tuple[list[SMResource], SMResource]: + """Split this SM resource into groups and a remainder. + + Parameters + ---------- + options : :obj:`SMResourceOptions` + Split configuration (count, co-scheduling constraints). + dry_run : bool, optional + If ``True``, return filled-in metadata without creating + usable resource objects. (Default to ``False``) + + Returns + ------- + tuple[list[:obj:`SMResource`], :obj:`SMResource`] + ``(groups, remainder)`` where each group holds a disjoint + SM partition and *remainder* holds any unassigned SMs. + """ + +class WorkqueueResource: + """Represent a workqueue resource for a device or green context. + + Merges ``CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG`` and + ``CU_DEV_RESOURCE_TYPE_WORKQUEUE`` under one user-facing type. + Instances are returned by :obj:`DeviceResources.workqueue` and + cannot be instantiated directly. + """ + + def __init__(self, *args, **kwargs) -> None: + ... + + @property + def handle(self) -> int: + """Return the address of the underlying config ``CUdevResource`` struct.""" + + @property + def sharing_scope(self) -> WorkqueueSharingScopeType: + """Current sharing scope of this workqueue resource. + + Returns the :class:`~cuda.core.typing.WorkqueueSharingScopeType` + member corresponding to the driver-populated + ``wqConfig.sharingScope`` field. It can be updated via + :meth:`configure` with + :attr:`WorkqueueResourceOptions.sharing_scope`. + """ + + @property + def concurrency_limit(self) -> int: + """Current expected maximum concurrent stream-ordered workloads. + + Reflects the driver-populated ``wqConfig.wqConcurrencyLimit`` field. + When first queried from a device, this matches the driver-reported + cap (typically ``CUDA_DEVICE_MAX_CONNECTIONS``). It can be updated + via :meth:`configure` with + :attr:`WorkqueueResourceOptions.concurrency_limit`. + """ + + @property + def device(self) -> Device: + """The :class:`~cuda.core.Device` this workqueue resource is available on.""" + + def configure(self, options: WorkqueueResourceOptions) -> None: + """Configure the workqueue resource in place. + + Parameters + ---------- + options : :obj:`WorkqueueResourceOptions` + Configuration options (sharing scope, concurrency limit). + """ + +class DeviceResources: + """Namespace for hardware resource queries. + + When obtained via :obj:`Device.resources`, queries return full device + resources. When obtained via :obj:`Context.resources` or + :obj:`Stream.resources`, queries return the resources provisioned for + that context. + + This class cannot be instantiated directly. + """ + + def __init__(self, *args, **kwargs) -> None: + ... + + @property + def sm(self) -> SMResource: + """Return the :obj:`SMResource` for this device or context.""" + + @property + def workqueue(self) -> WorkqueueResource: + """Return the :obj:`WorkqueueResource` for this device or context.""" +__all__ = ['DeviceResources', 'SMResource', 'SMResourceOptions', 'WorkqueueResource', 'WorkqueueResourceOptions'] \ No newline at end of file diff --git a/cuda_core/cuda/core/_device_resources.pyx b/cuda_core/cuda/core/_device_resources.pyx new file mode 100644 index 00000000000..0c01956d2ea --- /dev/null +++ b/cuda_core/cuda/core/_device_resources.pyx @@ -0,0 +1,765 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from collections.abc import Sequence as SequenceABC +from dataclasses import dataclass +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from cuda.core._device import Device + from cuda.core.typing import WorkqueueSharingScopeType + +from libc.stdint cimport intptr_t +from libc.stdlib cimport free, malloc +from libc.string cimport memset + +from cuda.bindings cimport cydriver +from cuda.core._resource_handles cimport ContextHandle, GreenCtxHandle, as_cu, get_context_green_ctx +from cuda.core._utils.cuda_utils cimport check_or_create_options, HANDLE_RETURN +from cuda.core._utils.cuda_utils import is_sequence +from cuda.core._utils.version cimport cy_binding_version, cy_driver_version + + +__all__ = [ + "DeviceResources", + "SMResource", + "SMResourceOptions", + "WorkqueueResource", + "WorkqueueResourceOptions", +] + + +# Module-level cached version checks (trinary: 0=unchecked, 1=supported, -1=unsupported) +cdef int _green_ctx_checked = 0 +cdef int _workqueue_checked = 0 +cdef str _green_ctx_err_msg = "" +cdef str _workqueue_err_msg = "" + + +cdef inline int _check_green_ctx_support() except?-1: + global _green_ctx_checked, _green_ctx_err_msg + if _green_ctx_checked == 1: + return 0 + if _green_ctx_checked == -1: + raise RuntimeError(_green_ctx_err_msg) + cdef tuple drv = cy_driver_version() + cdef tuple bind = cy_binding_version() + if drv < (12, 4, 0): + _green_ctx_err_msg = ( + "Green context support requires CUDA driver 12.4 or newer " + f"(current driver: {'.'.join(map(str, drv))})" + ) + _green_ctx_checked = -1 + raise RuntimeError(_green_ctx_err_msg) + if bind < (12, 4, 0): + _green_ctx_err_msg = ( + "Green context support requires cuda.bindings 12.4 or newer " + f"(current bindings: {'.'.join(map(str, bind))})" + ) + _green_ctx_checked = -1 + raise RuntimeError(_green_ctx_err_msg) + _green_ctx_checked = 1 + return 0 + + +cdef inline int _check_workqueue_support() except?-1: + global _workqueue_checked, _workqueue_err_msg + if _workqueue_checked == 1: + return 0 + if _workqueue_checked == -1: + raise RuntimeError(_workqueue_err_msg) + cdef tuple drv = cy_driver_version() + cdef tuple bind = cy_binding_version() + if drv < (13, 1, 0): + _workqueue_err_msg = ( + "WorkqueueResource requires CUDA driver 13.1 or newer " + f"(current driver: {'.'.join(map(str, drv))})" + ) + _workqueue_checked = -1 + raise RuntimeError(_workqueue_err_msg) + if bind < (13, 1, 0): + _workqueue_err_msg = ( + "WorkqueueResource requires cuda.bindings 13.1 or newer " + f"(current bindings: {'.'.join(map(str, bind))})" + ) + _workqueue_checked = -1 + raise RuntimeError(_workqueue_err_msg) + _workqueue_checked = 1 + return 0 + + +@dataclass +cdef class SMResourceOptions: + """Customizable :obj:`SMResource.split` options. + + Each field accepts a scalar (for a single group) or a ``Sequence`` + (for multiple groups). ``count`` drives the number of groups; other + ``Sequence`` fields must match its length. + + Attributes + ---------- + count : int or Sequence[int], optional + Requested SM count per group. ``None`` means discovery mode + (auto-detect). (Default to ``None``) + coscheduled_sm_count : int or Sequence[int], optional + Minimum number of SMs guaranteed to be co-scheduled in each + group. (Default to ``None``) + preferred_coscheduled_sm_count : int or Sequence[int], optional + Preferred co-scheduled SM count; the driver tries to satisfy + this but may fall back to ``coscheduled_sm_count``. + (Default to ``None``) + backfill : bool or Sequence[bool], optional + If ``True``, allow the driver to relax the co-scheduling + constraint when assigning SMs. This enables requesting + arbitrary aligned SM counts that the driver would otherwise + reject due to hardware topology constraints. + (Default to ``False``) + """ + + count: int | SequenceABC[int] | None = None + coscheduled_sm_count: int | SequenceABC[int] | None = None + preferred_coscheduled_sm_count: int | SequenceABC[int] | None = None + backfill: bool | SequenceABC[bool] = False + + +@dataclass +cdef class WorkqueueResourceOptions: + """Customizable :obj:`WorkqueueResource.configure` options. + + Attributes + ---------- + sharing_scope : :class:`~cuda.core.typing.WorkqueueSharingScopeType` | str, optional + Workqueue sharing scope. Accepted values: ``"device_ctx"`` or + ``"green_ctx_balanced"``. + concurrency_limit : int, optional + Expected maximum number of concurrent stream-ordered + workloads. Must be ``>= 1`` when set. The effective + driver-side cap is ``CUDA_DEVICE_MAX_CONNECTIONS`` + (typically ``[1, 32]``); configurations may exceed + this cap, but the driver will not guarantee that work + submission remains non-overlapping. (Default to ``None``) + """ + + sharing_scope: WorkqueueSharingScopeType | str | None = None + concurrency_limit: int | None = None + + def __post_init__(self): + if self.sharing_scope not in (None, "device_ctx", "green_ctx_balanced"): + raise ValueError( + f"Unknown sharing_scope: {self.sharing_scope!r}. " + "Expected 'device_ctx' or 'green_ctx_balanced'." + ) + if self.concurrency_limit is not None and self.concurrency_limit < 1: + raise ValueError( + f"concurrency_limit must be >= 1, got {self.concurrency_limit}" + ) + + +cdef inline int _validate_split_field_length( + object value, str field_name, int n_groups, bint count_is_scalar +) except?-1: + if count_is_scalar: + if is_sequence(value): + raise ValueError( + f"{field_name} is a Sequence but count is scalar; " + "count must be a Sequence to specify multiple groups" + ) + elif is_sequence(value) and len(value) != n_groups: + raise ValueError( + f"{field_name} has length {len(value)}, expected {n_groups} " + "(must match count)" + ) + return 0 + + +cdef inline int _resolve_group_count(SMResourceOptions options) except?-1: + cdef object count = options.count + cdef int n_groups + cdef bint count_is_scalar + + if count is None or isinstance(count, int): + n_groups = 1 + count_is_scalar = True + elif is_sequence(count): + n_groups = len(count) + if n_groups == 0: + raise ValueError("count sequence must not be empty") + count_is_scalar = False + else: + raise TypeError(f"count must be int, Sequence, or None, got {type(count)}") + + _validate_split_field_length( + options.coscheduled_sm_count, + "coscheduled_sm_count", + n_groups, + count_is_scalar, + ) + _validate_split_field_length( + options.preferred_coscheduled_sm_count, + "preferred_coscheduled_sm_count", + n_groups, + count_is_scalar, + ) + _validate_split_field_length( + options.backfill, + "backfill", + n_groups, + count_is_scalar, + ) + return n_groups + + +cdef inline object _broadcast_field(object value, int n_groups): + if is_sequence(value): + return list(value) + return [value] * n_groups + + +cdef inline unsigned int _to_sm_count(object value) except? 0: + """Convert a count value to unsigned int. None maps to 0 (discovery).""" + if value is None: + return 0 + if value < 0: + raise ValueError(f"count must be non-negative, got {value}") + return (value) + + +IF CUDA_CORE_BUILD_MAJOR >= 13: + from cuda.core._resource_handles cimport sm_resource_split, has_sm_resource_split + +cdef int _structured_split_checked = 0 + +cdef inline bint _can_use_structured_sm_split(): + """Check if cuDevSmResourceSplit (13.1+) is available. Cached.""" + global _structured_split_checked + if _structured_split_checked != 0: + return _structured_split_checked == 1 + IF CUDA_CORE_BUILD_MAJOR >= 13: + if (has_sm_resource_split() + and cy_driver_version() >= (13, 1, 0) + and cy_binding_version() >= (13, 1, 0)): + _structured_split_checked = 1 + return True + _structured_split_checked = -1 + return False + + +cdef object _resolve_split_by_count_request(SMResourceOptions options): + cdef int n_groups = _resolve_group_count(options) + cdef list counts = _broadcast_field(options.count, n_groups) + cdef object first = counts[0] + cdef object value + cdef unsigned int min_count + + if options.coscheduled_sm_count is not None: + raise RuntimeError( + "SMResourceOptions.coscheduled_sm_count requires the CUDA 13.1 " + "structured SM split API" + ) + if options.preferred_coscheduled_sm_count is not None: + raise RuntimeError( + "SMResourceOptions.preferred_coscheduled_sm_count requires the " + "CUDA 13.1 structured SM split API" + ) + + for value in counts[1:]: + if value != first: + raise RuntimeError( + "CUDA 12 SM splitting only supports homogeneous count values; " + "use CUDA 13.1 or newer for per-group counts" + ) + + min_count = _to_sm_count(first) + return n_groups, min_count + + +IF CUDA_CORE_BUILD_MAJOR >= 13: + cdef inline int _fill_group_params( + cydriver.CU_DEV_SM_RESOURCE_GROUP_PARAMS* params, + int n_groups, + SMResourceOptions options, + ) except?-1: + cdef list counts = _broadcast_field(options.count, n_groups) + cdef list coscheduled = _broadcast_field(options.coscheduled_sm_count, n_groups) + cdef list preferred = _broadcast_field(options.preferred_coscheduled_sm_count, n_groups) + cdef list backfills = _broadcast_field(options.backfill, n_groups) + cdef int i + + for i in range(n_groups): + memset(¶ms[i], 0, sizeof(cydriver.CU_DEV_SM_RESOURCE_GROUP_PARAMS)) + params[i].smCount = _to_sm_count(counts[i]) + if coscheduled[i] is not None: + params[i].coscheduledSmCount = (coscheduled[i]) + if preferred[i] is not None: + params[i].preferredCoscheduledSmCount = (preferred[i]) + params[i].flags = ( + cydriver.CUdevSmResourceGroup_flags.CU_DEV_SM_RESOURCE_GROUP_BACKFILL + if backfills[i] else 0 + ) + return 0 + + + cdef object _split_with_general_api(SMResource sm, SMResourceOptions options, bint dry_run): + cdef int n_groups = _resolve_group_count(options) + cdef cydriver.CUdevResource* result = NULL + cdef cydriver.CUdevResource remaining + cdef cydriver.CUdevResource synth + cdef cydriver.CU_DEV_SM_RESOURCE_GROUP_PARAMS* params = NULL + cdef list groups = [] + cdef int i + + params = malloc( + n_groups * sizeof(cydriver.CU_DEV_SM_RESOURCE_GROUP_PARAMS) + ) + if params == NULL: + raise MemoryError() + + try: + _fill_group_params(params, n_groups, options) + + if not dry_run: + result = malloc( + n_groups * sizeof(cydriver.CUdevResource) + ) + if result == NULL: + raise MemoryError() + + memset(&remaining, 0, sizeof(cydriver.CUdevResource)) + with nogil: + HANDLE_RETURN(sm_resource_split( + result, + (n_groups), + &sm._resource, + &remaining, + 0, + params, + )) + + if result != NULL: + for i in range(n_groups): + groups.append(SMResource._from_split_resource(result[i], sm, True)) + return groups, SMResource._from_split_resource(remaining, sm, True) + + for i in range(n_groups): + memset(&synth, 0, sizeof(cydriver.CUdevResource)) + synth.type = cydriver.CUdevResourceType.CU_DEV_RESOURCE_TYPE_SM + synth.sm.smCount = params[i].smCount + groups.append(SMResource._from_split_resource(synth, sm, False)) + return groups, SMResource._from_split_resource(remaining, sm, False) + finally: + if params != NULL: + free(params) + if result != NULL: + free(result) +ELSE: + cdef object _split_with_general_api(SMResource sm, SMResourceOptions options, bint dry_run): + raise RuntimeError( + "SMResource.split() requires cuda.core to be built with CUDA 13.x bindings" + ) + + +cdef object _split_with_count_api(SMResource sm, SMResourceOptions options, bint dry_run): + cdef object request = _resolve_split_by_count_request(options) + cdef unsigned int nb_groups = (request[0]) + cdef unsigned int min_count = (request[1]) + cdef unsigned int actual_groups = nb_groups + cdef cydriver.CUdevResource* result = NULL + cdef cydriver.CUdevResource remaining + cdef list groups = [] + cdef int i + + result = malloc(nb_groups * sizeof(cydriver.CUdevResource)) + if result == NULL: + raise MemoryError() + + try: + memset(&remaining, 0, sizeof(cydriver.CUdevResource)) + with nogil: + HANDLE_RETURN(cydriver.cuDevSmResourceSplitByCount( + result, + &actual_groups, + &sm._resource, + &remaining, + 0, + min_count, + )) + + for i in range(actual_groups): + if dry_run: + groups.append(SMResource._from_split_resource(result[i], sm, False)) + else: + groups.append(SMResource._from_split_resource(result[i], sm, True)) + if dry_run: + return groups, SMResource._from_split_resource(remaining, sm, False) + return groups, SMResource._from_split_resource(remaining, sm, True) + finally: + free(result) + + +cdef inline unsigned int _sm_resource_granularity(int device_id) except? 0: + cdef int major + + with nogil: + HANDLE_RETURN(cydriver.cuDeviceGetAttribute( + &major, + cydriver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, + (device_id), + )) + if major >= 9: + return 8 + return 2 + + +cdef inline unsigned int _fallback_if_zero(unsigned int value, unsigned int fallback) noexcept: + if value != 0: + return value + return fallback + + +cdef class SMResource: + """Represent an SM (streaming multiprocessor) resource partition. + + Instances are returned by :obj:`DeviceResources.sm` or + :meth:`SMResource.split` and cannot be instantiated directly. + """ + + def __init__(self, *args, **kwargs): + raise RuntimeError( + "SMResource cannot be instantiated directly. " + "Use dev.resources.sm or SMResource.split()." + ) + + @staticmethod + cdef SMResource _from_dev_resource(cydriver.CUdevResource res, int device_id): + cdef SMResource self = SMResource.__new__(SMResource) + self._resource = res + self._sm_count = res.sm.smCount + IF CUDA_CORE_BUILD_MAJOR >= 13: + self._min_partition_size = res.sm.minSmPartitionSize + self._coscheduled_alignment = res.sm.smCoscheduledAlignment + self._flags = res.sm.flags + ELSE: + self._min_partition_size = _sm_resource_granularity(device_id) + self._coscheduled_alignment = self._min_partition_size + self._flags = 0 + self._is_usable = True + return self + + @staticmethod + cdef SMResource _from_split_resource(cydriver.CUdevResource res, SMResource parent, bint is_usable): + cdef SMResource self = SMResource.__new__(SMResource) + self._resource = res + self._sm_count = res.sm.smCount + IF CUDA_CORE_BUILD_MAJOR >= 13: + self._min_partition_size = _fallback_if_zero( + res.sm.minSmPartitionSize, + parent._min_partition_size, + ) + self._coscheduled_alignment = _fallback_if_zero( + res.sm.smCoscheduledAlignment, + parent._coscheduled_alignment, + ) + self._flags = res.sm.flags + ELSE: + self._min_partition_size = parent._min_partition_size + self._coscheduled_alignment = parent._coscheduled_alignment + self._flags = parent._flags + self._is_usable = is_usable + return self + + @property + def handle(self) -> int: + """Return the address of the underlying ``CUdevResource`` struct.""" + return (&self._resource) + + @property + def sm_count(self) -> int: + """Total SMs available in this resource.""" + return self._sm_count + + @property + def min_partition_size(self) -> int: + """Minimum SM count required to create a partition.""" + return self._min_partition_size + + @property + def coscheduled_alignment(self) -> int: + """Number of SMs guaranteed to be co-scheduled.""" + return self._coscheduled_alignment + + @property + def flags(self) -> int: + """Raw flags from the underlying SM resource.""" + return self._flags + + def split( + self, + options: SMResourceOptions, + *, + bint dry_run=False + ) -> tuple[list[SMResource], SMResource]: + """Split this SM resource into groups and a remainder. + + Parameters + ---------- + options : :obj:`SMResourceOptions` + Split configuration (count, co-scheduling constraints). + dry_run : bool, optional + If ``True``, return filled-in metadata without creating + usable resource objects. (Default to ``False``) + + Returns + ------- + tuple[list[:obj:`SMResource`], :obj:`SMResource`] + ``(groups, remainder)`` where each group holds a disjoint + SM partition and *remainder* holds any unassigned SMs. + """ + cdef SMResourceOptions opts = check_or_create_options( + SMResourceOptions, options, "SM resource options" + ) + _resolve_group_count(opts) + _check_green_ctx_support() + with self._split_mutex: + if _can_use_structured_sm_split(): + return _split_with_general_api(self, opts, dry_run) + # SplitByCount requires the same 12.4+ as green ctx support (already checked above) + return _split_with_count_api(self, opts, dry_run) + + +cdef class WorkqueueResource: + """Represent a workqueue resource for a device or green context. + + Merges ``CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG`` and + ``CU_DEV_RESOURCE_TYPE_WORKQUEUE`` under one user-facing type. + Instances are returned by :obj:`DeviceResources.workqueue` and + cannot be instantiated directly. + """ + + def __init__(self, *args, **kwargs) -> None: + raise RuntimeError( + "WorkqueueResource cannot be instantiated directly. " + "Use dev.resources.workqueue." + ) + + @staticmethod + cdef WorkqueueResource _from_dev_resources( + cydriver.CUdevResource wq_config, + cydriver.CUdevResource wq, + ): + cdef WorkqueueResource self = WorkqueueResource.__new__(WorkqueueResource) + self._wq_config_resource = wq_config + self._wq_resource = wq + return self + + @property + def handle(self) -> int: + """Return the address of the underlying config ``CUdevResource`` struct.""" + return (&self._wq_config_resource) + + @property + def sharing_scope(self) -> WorkqueueSharingScopeType: + """Current sharing scope of this workqueue resource. + + Returns the :class:`~cuda.core.typing.WorkqueueSharingScopeType` + member corresponding to the driver-populated + ``wqConfig.sharingScope`` field. It can be updated via + :meth:`configure` with + :attr:`WorkqueueResourceOptions.sharing_scope`. + """ + IF CUDA_CORE_BUILD_MAJOR >= 13: + from cuda.core.typing import WorkqueueSharingScopeType + cdef object scope = self._wq_config_resource.wqConfig.sharingScope + if scope == cydriver.CUdevWorkqueueConfigScope.CU_WORKQUEUE_SCOPE_DEVICE_CTX: + return WorkqueueSharingScopeType.DEVICE_CTX + elif scope == cydriver.CUdevWorkqueueConfigScope.CU_WORKQUEUE_SCOPE_GREEN_CTX_BALANCED: + return WorkqueueSharingScopeType.GREEN_CTX_BALANCED + raise RuntimeError(f"Unknown sharing scope enum value: {scope}") + ELSE: + raise RuntimeError( + "WorkqueueResource requires cuda.core to be built with CUDA 13.x bindings" + ) + + @property + def concurrency_limit(self) -> int: + """Current expected maximum concurrent stream-ordered workloads. + + Reflects the driver-populated ``wqConfig.wqConcurrencyLimit`` field. + When first queried from a device, this matches the driver-reported + cap (typically ``CUDA_DEVICE_MAX_CONNECTIONS``). It can be updated + via :meth:`configure` with + :attr:`WorkqueueResourceOptions.concurrency_limit`. + """ + IF CUDA_CORE_BUILD_MAJOR >= 13: + return self._wq_config_resource.wqConfig.wqConcurrencyLimit + ELSE: + raise RuntimeError( + "WorkqueueResource requires cuda.core to be built with CUDA 13.x bindings" + ) + + @property + def device(self) -> Device: + """The :class:`~cuda.core.Device` this workqueue resource is available on.""" + IF CUDA_CORE_BUILD_MAJOR >= 13: + from cuda.core._device import Device # avoid circular import + return Device(int(self._wq_config_resource.wqConfig.device)) + ELSE: + raise RuntimeError( + "WorkqueueResource requires cuda.core to be built with CUDA 13.x bindings" + ) + + def configure(self, options: WorkqueueResourceOptions) -> None: + """Configure the workqueue resource in place. + + Parameters + ---------- + options : :obj:`WorkqueueResourceOptions` + Configuration options (sharing scope, concurrency limit). + """ + cdef WorkqueueResourceOptions opts = check_or_create_options( + WorkqueueResourceOptions, options, "Workqueue resource options" + ) + _check_green_ctx_support() + _check_workqueue_support() + if opts.sharing_scope is None and opts.concurrency_limit is None: + return None + + IF CUDA_CORE_BUILD_MAJOR >= 13: + if opts.concurrency_limit is not None: + self._wq_config_resource.wqConfig.wqConcurrencyLimit = ( + opts.concurrency_limit + ) + if opts.sharing_scope == "device_ctx": + self._wq_config_resource.wqConfig.sharingScope = ( + cydriver.CUdevWorkqueueConfigScope.CU_WORKQUEUE_SCOPE_DEVICE_CTX + ) + elif opts.sharing_scope == "green_ctx_balanced": + self._wq_config_resource.wqConfig.sharingScope = ( + cydriver.CUdevWorkqueueConfigScope.CU_WORKQUEUE_SCOPE_GREEN_CTX_BALANCED + ) + ELSE: + raise RuntimeError( + "WorkqueueResource requires cuda.core to be built with CUDA 13.x bindings" + ) + + +cdef class DeviceResources: + """Namespace for hardware resource queries. + + When obtained via :obj:`Device.resources`, queries return full device + resources. When obtained via :obj:`Context.resources` or + :obj:`Stream.resources`, queries return the resources provisioned for + that context. + + This class cannot be instantiated directly. + """ + + def __init__(self, *args, **kwargs) -> None: + raise RuntimeError( + "DeviceResources cannot be instantiated directly. " + "Use dev.resources or ctx.resources." + ) + + @staticmethod + cdef DeviceResources _init(int device_id): + cdef DeviceResources self = DeviceResources.__new__(DeviceResources) + self._device_id = device_id + # _h_context is default empty — queries use cuDeviceGetDevResource + return self + + @staticmethod + cdef DeviceResources _init_from_ctx(ContextHandle h_context, int device_id): + cdef DeviceResources self = DeviceResources.__new__(DeviceResources) + self._device_id = device_id + self._h_context = h_context + return self + + cdef inline int _query_sm(self, cydriver.CUdevResource* res) except?-1 nogil: + """Query SM resource from either device or context.""" + cdef GreenCtxHandle h_green + if self._h_context: + h_green = get_context_green_ctx(self._h_context) + if h_green: + HANDLE_RETURN(cydriver.cuGreenCtxGetDevResource( + as_cu(h_green), res, + cydriver.CUdevResourceType.CU_DEV_RESOURCE_TYPE_SM, + )) + else: + HANDLE_RETURN(cydriver.cuCtxGetDevResource( + as_cu(self._h_context), res, + cydriver.CUdevResourceType.CU_DEV_RESOURCE_TYPE_SM, + )) + else: + HANDLE_RETURN(cydriver.cuDeviceGetDevResource( + (self._device_id), res, + cydriver.CUdevResourceType.CU_DEV_RESOURCE_TYPE_SM, + )) + return 0 + + @property + def sm(self) -> SMResource: + """Return the :obj:`SMResource` for this device or context.""" + _check_green_ctx_support() + cdef cydriver.CUdevResource res + with nogil: + self._query_sm(&res) + return SMResource._from_dev_resource(res, self._device_id) + + @property + def workqueue(self) -> WorkqueueResource: + """Return the :obj:`WorkqueueResource` for this device or context.""" + _check_green_ctx_support() + _check_workqueue_support() + cdef cydriver.CUdevResource _wq_config + cdef cydriver.CUdevResource _wq + + IF CUDA_CORE_BUILD_MAJOR >= 13: + cdef GreenCtxHandle h_green + if self._h_context: + h_green = get_context_green_ctx(self._h_context) + if h_green: + # Green context query + with nogil: + HANDLE_RETURN(cydriver.cuGreenCtxGetDevResource( + as_cu(h_green), + &_wq_config, + cydriver.CUdevResourceType.CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG, + )) + HANDLE_RETURN(cydriver.cuGreenCtxGetDevResource( + as_cu(h_green), + &_wq, + cydriver.CUdevResourceType.CU_DEV_RESOURCE_TYPE_WORKQUEUE, + )) + else: + # Primary context query + with nogil: + HANDLE_RETURN(cydriver.cuCtxGetDevResource( + as_cu(self._h_context), + &_wq_config, + cydriver.CUdevResourceType.CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG, + )) + HANDLE_RETURN(cydriver.cuCtxGetDevResource( + as_cu(self._h_context), + &_wq, + cydriver.CUdevResourceType.CU_DEV_RESOURCE_TYPE_WORKQUEUE, + )) + else: + # Device-level query + with nogil: + HANDLE_RETURN(cydriver.cuDeviceGetDevResource( + (self._device_id), + &_wq_config, + cydriver.CUdevResourceType.CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG, + )) + HANDLE_RETURN(cydriver.cuDeviceGetDevResource( + (self._device_id), + &_wq, + cydriver.CUdevResourceType.CU_DEV_RESOURCE_TYPE_WORKQUEUE, + )) + return WorkqueueResource._from_dev_resources(_wq_config, _wq) + ELSE: + raise RuntimeError( + "WorkqueueResource requires cuda.core to be built with CUDA 13.x bindings" + ) diff --git a/cuda_core/cuda/core/_dlpack.pyi b/cuda_core/cuda/core/_dlpack.pyi new file mode 100644 index 00000000000..575d9ced8f5 --- /dev/null +++ b/cuda_core/cuda/core/_dlpack.pyi @@ -0,0 +1,24 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_dlpack.pyx + +from __future__ import annotations + +from enum import IntEnum + +_DLDeviceType = int +DLDataTypeCode = int + +class DLDeviceType(IntEnum): + kDLCPU = 1 + kDLCUDA = 2 + kDLCUDAHost = 3 + kDLCUDAManaged = 13 + +def make_py_capsule(buf: object, versioned: bool) -> object: + ... + +def classify_dl_device(buf: object) -> tuple[int, int]: + """Classify a buffer into a DLPack (device_type, device_id) pair. + + ``buf`` must expose ``is_device_accessible``, ``is_host_accessible``, + ``is_managed``, and ``device_id`` attributes. + """ \ No newline at end of file diff --git a/cuda_core/cuda/core/_dlpack.pyx b/cuda_core/cuda/core/_dlpack.pyx index 55472168915..0c251881d11 100644 --- a/cuda_core/cuda/core/_dlpack.pyx +++ b/cuda_core/cuda/core/_dlpack.pyx @@ -1,7 +1,8 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 + from enum import IntEnum @@ -88,20 +89,28 @@ cdef inline int setup_dl_tensor_layout(DLTensor* dl_tensor, object buf) except - return 0 +def classify_dl_device(buf: object) -> tuple[int, int]: + """Classify a buffer into a DLPack (device_type, device_id) pair. + + ``buf`` must expose ``is_device_accessible``, ``is_host_accessible``, + ``is_managed``, and ``device_id`` attributes. + """ + cdef bint d = buf.is_device_accessible + cdef bint h = buf.is_host_accessible + if d and not h: + return (_kDLCUDA, buf.device_id) + if d and h: + return (_kDLCUDAManaged if buf.is_managed else _kDLCUDAHost, 0) + if not d and h: + return (_kDLCPU, 0) + raise BufferError("buffer is neither device-accessible nor host-accessible") + + cdef inline int setup_dl_tensor_device(DLTensor* dl_tensor, object buf) except -1: cdef DLDevice* device = &dl_tensor.device - # buf should be a Buffer instance - if buf.is_device_accessible and not buf.is_host_accessible: - device.device_type = _kDLCUDA - device.device_id = buf.device_id - elif buf.is_device_accessible and buf.is_host_accessible: - device.device_type = _kDLCUDAHost - device.device_id = 0 - elif not buf.is_device_accessible and buf.is_host_accessible: - device.device_type = _kDLCPU - device.device_id = 0 - else: # not buf.is_device_accessible and not buf.is_host_accessible - raise BufferError("invalid buffer") + dev_type, dev_id = classify_dl_device(buf) + device.device_type = <_DLDeviceType>dev_type + device.device_id = dev_id return 0 @@ -157,8 +166,11 @@ cpdef object make_py_capsule(object buf, bint versioned): return ret +# Values are fixed by the DLPack spec; see _include/dlpack.h. They are +# hard-coded here (rather than referencing the cdef extern names) so that the +# generated .pyi stub doesn't reference Cython-only identifiers. class DLDeviceType(IntEnum): - kDLCPU = _kDLCPU - kDLCUDA = _kDLCUDA - kDLCUDAHost = _kDLCUDAHost - kDLCUDAManaged = _kDLCUDAManaged + kDLCPU = 1 + kDLCUDA = 2 + kDLCUDAHost = 3 + kDLCUDAManaged = 13 diff --git a/cuda_core/cuda/core/_event.pyi b/cuda_core/cuda/core/_event.pyi new file mode 100644 index 00000000000..1ea91308bc1 --- /dev/null +++ b/cuda_core/cuda/core/_event.pyi @@ -0,0 +1,185 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_event.pyx + +from __future__ import annotations + +from dataclasses import dataclass + +import cuda.bindings.driver +import cython +from cuda.core._context import Context +from cuda.core._device import Device + + +@dataclass +class EventOptions: + """Customizable :obj:`~_event.Event` options. + + Attributes + ---------- + timing_enabled : bool, optional + Event will record timing data. (Default to False) + blocking_sync : bool, optional + If True, the event uses blocking synchronization: a CPU + thread that calls :meth:`Event.sync` blocks (yields) until + the event has completed. Otherwise (the default), the CPU + thread busy-waits until the event has completed. + (Default to False) + ipc_enabled : bool, optional + Event will be suitable for interprocess use. + Note that timing_enabled must be False. (Default to False) + + """ + timing_enabled: bool | None = False + blocking_sync: bool | None = False + ipc_enabled: bool | None = False + +class Event: + """Represent a record at a specific point of execution within a CUDA stream. + + Applications can asynchronously record events at any point in + the program. An event keeps a record of all previous work within + the last recorded stream. + + Events can be used to monitor device's progress, query completion + of work up to event's record, help establish dependencies + between GPU work submissions, and record the elapsed time (in milliseconds) + on GPU: + + .. code-block:: python + + # To create events and record the timing: + s = Device().create_stream() + e1 = Device().create_event({"timing_enabled": True}) + e2 = Device().create_event({"timing_enabled": True}) + s.record(e1) + # ... run some GPU works ... + s.record(e2) + e2.sync() + print(f"time = {e2 - e1} milliseconds") + + Directly creating an :obj:`~_event.Event` is not supported due to ambiguity, + and they should instead be created through a :obj:`~_stream.Stream` object. + + """ + + def close(self): + """Destroy the event. + + Releases the event handle. The underlying CUDA event is destroyed + when the last reference is released. + """ + + def __init__(self, *args, **kwargs) -> None: + ... + + def __isub__(self, other: object): + ... + + def __rsub__(self, other: object): + ... + + def __sub__(self, other: Event) -> float: + ... + + def __hash__(self) -> int: + ... + + def __eq__(self, other: object) -> bool: + ... + + def __repr__(self) -> str: + ... + + @property + def ipc_descriptor(self) -> IPCEventDescriptor: + """Descriptor for sharing this event with other processes.""" + + @classmethod + def from_ipc_descriptor(cls, ipc_descriptor: IPCEventDescriptor) -> Event: + """Import an event that was exported from another process. + + Parameters + ---------- + ipc_descriptor : :obj:`~_memory._ipc.IPCEventDescriptor` + The IPC descriptor obtained from :attr:`~Event.ipc_descriptor` in + another process. + + Returns + ------- + :obj:`~_event.Event` + A new event backed by the imported IPC handle. + + """ + + @property + def is_ipc_enabled(self) -> bool: + """Return True if the event can be shared across process boundaries, otherwise False.""" + + @property + def is_timing_enabled(self) -> bool: + """Return True if the event records timing data, otherwise False.""" + + @property + def is_blocking_sync(self) -> bool: + """Return True if the event uses blocking synchronization (the CPU + thread blocks on :meth:`sync` instead of busy-waiting), otherwise False. + """ + + def sync(self) -> None: + """Synchronize until the event completes. + + If the event was created with ``blocking_sync=True``, the + calling CPU thread blocks (yields) until the event has been + completed by the device. Otherwise (the default) the CPU + thread busy-waits until the event has completed. + + """ + + @property + def is_done(self) -> bool: + """Return True if all captured works have been completed, otherwise False.""" + + @property + def handle(self) -> cuda.bindings.driver.CUevent: + """Return the underlying CUevent object. + + .. caution:: + + This handle is a Python object. To get the memory address of the underlying C + handle, call ``int(Event.handle)``. + """ + + @property + def device(self) -> Device: + """Return the :obj:`~_device.Device` singleton associated with this event. + + Note + ---- + The current context on the device may differ from this + event's context. This case occurs when a different CUDA + context is set current after a event is created. + + """ + + @property + def context(self) -> Context: + """Return the :obj:`~_context.Context` associated with this event.""" + +class IPCEventDescriptor: + """Serializable object describing an event that can be shared between processes.""" + + def __init__(self, *arg, **kwargs) -> None: + ... + + @staticmethod + def _init(reserved: bytes, is_blocking_sync: cython.bint) -> IPCEventDescriptor: + ... + + def __eq__(self, other: object) -> bool: + ... + + def __reduce__(self) -> tuple[object, ...]: + ... + +def _reduce_event(event: Event) -> tuple[object, ...]: + ... \ No newline at end of file diff --git a/cuda_core/cuda/core/_event.pyx b/cuda_core/cuda/core/_event.pyx index 4a0491d8650..e5cb81ac41e 100644 --- a/cuda_core/cuda/core/_event.pyx +++ b/cuda_core/cuda/core/_event.pyx @@ -5,6 +5,7 @@ from __future__ import annotations cimport cpython +from libc.stddef cimport size_t from libc.string cimport memcpy from cuda.bindings cimport cydriver from cuda.core._context cimport Context @@ -13,8 +14,8 @@ from cuda.core._resource_handles cimport ( EventHandle, create_event_handle, create_event_handle_ipc, - get_event_timing_disabled, - get_event_busy_waited, + get_event_timing_enabled, + get_event_is_blocking_sync, get_event_ipc_enabled, get_event_device_id, get_event_context, @@ -31,12 +32,17 @@ from cuda.core._utils.cuda_utils cimport ( import cython from dataclasses import dataclass import multiprocessing +from typing import TYPE_CHECKING from cuda.core._utils.cuda_utils import ( CUDAError, check_multiprocessing_start_method, ) +if TYPE_CHECKING: + import cuda.bindings.driver # no-cython-lint + from cuda.core._device import Device + @dataclass cdef class EventOptions: @@ -44,22 +50,22 @@ cdef class EventOptions: Attributes ---------- - enable_timing : bool, optional + timing_enabled : bool, optional Event will record timing data. (Default to False) - busy_waited_sync : bool, optional - If True, event will use blocking synchronization. When a CPU - thread calls synchronize, the call will block until the event - has actually been completed. - Otherwise, the CPU thread will busy-wait until the event has - been completed. (Default to False) + blocking_sync : bool, optional + If True, the event uses blocking synchronization: a CPU + thread that calls :meth:`Event.sync` blocks (yields) until + the event has completed. Otherwise (the default), the CPU + thread busy-waits until the event has completed. + (Default to False) ipc_enabled : bool, optional Event will be suitable for interprocess use. - Note that enable_timing must be False. (Default to False) + Note that timing_enabled must be False. (Default to False) """ - enable_timing: bool | None = False - busy_waited_sync: bool | None = False + timing_enabled: bool | None = False + blocking_sync: bool | None = False ipc_enabled: bool | None = False @@ -79,8 +85,8 @@ cdef class Event: # To create events and record the timing: s = Device().create_stream() - e1 = Device().create_event({"enable_timing": True}) - e2 = Device().create_event({"enable_timing": True}) + e1 = Device().create_event({"timing_enabled": True}) + e2 = Device().create_event({"timing_enabled": True}) s.record(e1) # ... run some GPU works ... s.record(e2) @@ -92,7 +98,7 @@ cdef class Event: """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: raise RuntimeError("Event objects cannot be instantiated directly. Please use Stream APIs (record).") @staticmethod @@ -100,16 +106,16 @@ cdef class Event: cdef Event self = cls.__new__(cls) cdef EventOptions opts = check_or_create_options(EventOptions, options, "Event options") cdef unsigned int flags = 0x0 - cdef bint timing_disabled = False - cdef bint busy_waited = False + cdef bint timing_enabled = True + cdef bint is_blocking_sync = False cdef bint ipc_enabled = False self._ipc_descriptor = None - if not opts.enable_timing: + if not opts.timing_enabled: flags |= cydriver.CUevent_flags.CU_EVENT_DISABLE_TIMING - timing_disabled = True - if opts.busy_waited_sync: + timing_enabled = False + if opts.blocking_sync: flags |= cydriver.CUevent_flags.CU_EVENT_BLOCKING_SYNC - busy_waited = True + is_blocking_sync = True if opts.ipc_enabled: if is_free: raise TypeError( @@ -117,23 +123,24 @@ cdef class Event: ) flags |= cydriver.CUevent_flags.CU_EVENT_INTERPROCESS ipc_enabled = True - if not timing_disabled: + if timing_enabled: raise TypeError("IPC-enabled events cannot use timing.") cdef EventHandle h_event = create_event_handle( - h_context, flags, timing_disabled, busy_waited, ipc_enabled, device_id) + h_context, flags, timing_enabled, is_blocking_sync, ipc_enabled, device_id) if not h_event: raise RuntimeError("Failed to create CUDA event") self._h_event = h_event if ipc_enabled: - self.get_ipc_descriptor() + _ = self.ipc_descriptor # eagerly populate the descriptor cache return self @staticmethod cdef Event _from_handle(EventHandle h_event): """Create an Event wrapping an existing EventHandle. - Metadata (timing, busy_waited, ipc, device_id) is read from the - EventBox via pointer arithmetic — no fields are cached on Event. + Metadata (timing, blocking_sync, ipc, device_id) is read from + the EventBox via pointer arithmetic — no fields are cached on + Event. """ cdef Event self = Event.__new__(Event) self._h_event = h_event @@ -148,13 +155,13 @@ cdef class Event: """ self._h_event.reset() - def __isub__(self, other): + def __isub__(self, other: object): return NotImplemented - def __rsub__(self, other): + def __rsub__(self, other: object): return NotImplemented - def __sub__(self, other: Event): + def __sub__(self, other: Event) -> float: # return self - other (in milliseconds) cdef float timing with nogil: @@ -163,10 +170,10 @@ cdef class Event: return timing else: if err == cydriver.CUresult.CUDA_ERROR_INVALID_HANDLE: - if self.is_timing_disabled or other.is_timing_disabled: + if not self.is_timing_enabled or not other.is_timing_enabled: explanation = ( "Both Events must be created with timing enabled in order to subtract them; " - "use EventOptions(enable_timing=True) when creating both events." + "use EventOptions(timing_enabled=True) when creating both events." ) else: explanation = ( @@ -186,7 +193,7 @@ cdef class Event: def __hash__(self) -> int: return hash(as_intptr(self._h_event)) - def __eq__(self, other) -> bool: + def __eq__(self, other: object) -> bool: # Note: using isinstance because `Event` can be subclassed. if not isinstance(other, Event): return NotImplemented @@ -196,8 +203,9 @@ cdef class Event: def __repr__(self) -> str: return f"" - def get_ipc_descriptor(self) -> IPCEventDescriptor: - """Export an event allocated for sharing between processes.""" + @property + def ipc_descriptor(self) -> IPCEventDescriptor: + """Descriptor for sharing this event with other processes.""" if self._ipc_descriptor is not None: return self._ipc_descriptor if not self.is_ipc_enabled: @@ -206,16 +214,36 @@ cdef class Event: with nogil: HANDLE_RETURN(cydriver.cuIpcGetEventHandle(&data, as_cu(self._h_event))) cdef bytes data_b = cpython.PyBytes_FromStringAndSize((data.reserved), sizeof(data.reserved)) - self._ipc_descriptor = IPCEventDescriptor._init(data_b, get_event_busy_waited(self._h_event)) + self._ipc_descriptor = IPCEventDescriptor._init(data_b, get_event_is_blocking_sync(self._h_event)) return self._ipc_descriptor @classmethod def from_ipc_descriptor(cls, ipc_descriptor: IPCEventDescriptor) -> Event: - """Import an event that was exported from another process.""" + """Import an event that was exported from another process. + + Parameters + ---------- + ipc_descriptor : :obj:`~_memory._ipc.IPCEventDescriptor` + The IPC descriptor obtained from :attr:`~Event.ipc_descriptor` in + another process. + + Returns + ------- + :obj:`~_event.Event` + A new event backed by the imported IPC handle. + + """ + cdef size_t reserved_size = len(ipc_descriptor._reserved) + cdef size_t expected_size = sizeof(cydriver.CUipcEventHandle) + if reserved_size < expected_size: + raise ValueError( + f"IPC event descriptor reserved field is {reserved_size} bytes; " + f"expected at least {expected_size}" + ) cdef cydriver.CUipcEventHandle data memcpy(data.reserved, (ipc_descriptor._reserved), sizeof(data.reserved)) cdef Event self = Event.__new__(cls) - cdef EventHandle h_event = create_event_handle_ipc(data, ipc_descriptor._busy_waited) + cdef EventHandle h_event = create_event_handle_ipc(data, ipc_descriptor._is_blocking_sync) if not h_event: raise RuntimeError("Failed to open IPC event handle") self._h_event = h_event @@ -228,23 +256,24 @@ cdef class Event: return get_event_ipc_enabled(self._h_event) @property - def is_timing_disabled(self) -> bool: - """Return True if the event does not record timing data, otherwise False.""" - return get_event_timing_disabled(self._h_event) + def is_timing_enabled(self) -> bool: + """Return True if the event records timing data, otherwise False.""" + return get_event_timing_enabled(self._h_event) @property - def is_sync_busy_waited(self) -> bool: - """Return True if the event synchronization would keep the CPU busy-waiting, otherwise False.""" - return get_event_busy_waited(self._h_event) + def is_blocking_sync(self) -> bool: + """Return True if the event uses blocking synchronization (the CPU + thread blocks on :meth:`sync` instead of busy-waiting), otherwise False. + """ + return get_event_is_blocking_sync(self._h_event) - def sync(self): + def sync(self) -> None: """Synchronize until the event completes. - If the event was created with busy_waited_sync, then the - calling CPU thread will block until the event has been - completed by the device. - Otherwise the CPU thread will busy-wait until the event - has been completed. + If the event was created with ``blocking_sync=True``, the + calling CPU thread blocks (yields) until the event has been + completed by the device. Otherwise (the default) the CPU + thread busy-waits until the event has completed. """ with nogil: @@ -302,28 +331,30 @@ cdef class IPCEventDescriptor: cdef: bytes _reserved - bint _busy_waited + bint _is_blocking_sync - def __init__(self, *arg, **kwargs): + def __init__(self, *arg, **kwargs) -> None: raise RuntimeError("IPCEventDescriptor objects cannot be instantiated directly. Please use Event APIs.") @staticmethod - def _init(reserved: bytes, busy_waited: cython.bint): + def _init(reserved: bytes, is_blocking_sync: cython.bint) -> IPCEventDescriptor: cdef IPCEventDescriptor self = IPCEventDescriptor.__new__(IPCEventDescriptor) self._reserved = reserved - self._busy_waited = busy_waited + self._is_blocking_sync = is_blocking_sync return self - def __eq__(self, IPCEventDescriptor rhs): - # No need to check self._busy_waited. - return self._reserved == rhs._reserved + def __eq__(self, other: object) -> bool: + if not isinstance(other, IPCEventDescriptor): + return NotImplemented + # No need to check self._is_blocking_sync. + return self._reserved == (other)._reserved - def __reduce__(self): - return IPCEventDescriptor._init, (self._reserved, self._busy_waited) + def __reduce__(self) -> tuple[object, ...]: + return IPCEventDescriptor._init, (self._reserved, self._is_blocking_sync) -def _reduce_event(event): +def _reduce_event(event: Event) -> tuple[object, ...]: check_multiprocessing_start_method() - return event.from_ipc_descriptor, (event.get_ipc_descriptor(),) + return event.from_ipc_descriptor, (event.ipc_descriptor,) multiprocessing.reduction.register(Event, _reduce_event) diff --git a/cuda_core/cuda/core/_graph/__init__.py b/cuda_core/cuda/core/_graph/__init__.py deleted file mode 100644 index 80482c38ac3..00000000000 --- a/cuda_core/cuda/core/_graph/__init__.py +++ /dev/null @@ -1,801 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# -# SPDX-License-Identifier: Apache-2.0 - -from __future__ import annotations - -import weakref -from dataclasses import dataclass -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from cuda.core._stream import Stream - -from cuda.core._utils.cuda_utils import ( - driver, - get_binding_version, - handle_return, -) - -_inited = False -_driver_ver = None - - -def _lazy_init(): - global _inited - if _inited: - return - - global _py_major_minor, _driver_ver - # binding availability depends on cuda-python version - _py_major_minor = get_binding_version() - _driver_ver = handle_return(driver.cuDriverGetVersion()) - _inited = True - - -@dataclass -class GraphDebugPrintOptions: - """Customizable options for :obj:`_graph.GraphBuilder.debug_dot_print()` - - Attributes - ---------- - verbose : bool - Output all debug data as if every debug flag is enabled (Default to False) - runtime_types : bool - Use CUDA Runtime structures for output (Default to False) - kernel_node_params : bool - Adds kernel parameter values to output (Default to False) - memcpy_node_params : bool - Adds memcpy parameter values to output (Default to False) - memset_node_params : bool - Adds memset parameter values to output (Default to False) - host_node_params : bool - Adds host parameter values to output (Default to False) - event_node_params : bool - Adds event parameter values to output (Default to False) - ext_semas_signal_node_params : bool - Adds external semaphore signal parameter values to output (Default to False) - ext_semas_wait_node_params : bool - Adds external semaphore wait parameter values to output (Default to False) - kernel_node_attributes : bool - Adds kernel node attributes to output (Default to False) - handles : bool - Adds node handles and every kernel function handle to output (Default to False) - mem_alloc_node_params : bool - Adds memory alloc parameter values to output (Default to False) - mem_free_node_params : bool - Adds memory free parameter values to output (Default to False) - batch_mem_op_node_params : bool - Adds batch mem op parameter values to output (Default to False) - extra_topo_info : bool - Adds edge numbering information (Default to False) - conditional_node_params : bool - Adds conditional node parameter values to output (Default to False) - - """ - - verbose: bool = False - runtime_types: bool = False - kernel_node_params: bool = False - memcpy_node_params: bool = False - memset_node_params: bool = False - host_node_params: bool = False - event_node_params: bool = False - ext_semas_signal_node_params: bool = False - ext_semas_wait_node_params: bool = False - kernel_node_attributes: bool = False - handles: bool = False - mem_alloc_node_params: bool = False - mem_free_node_params: bool = False - batch_mem_op_node_params: bool = False - extra_topo_info: bool = False - conditional_node_params: bool = False - - -@dataclass -class GraphCompleteOptions: - """Customizable options for :obj:`_graph.GraphBuilder.complete()` - - Attributes - ---------- - auto_free_on_launch : bool, optional - Automatically free memory allocated in a graph before relaunching. (Default to False) - upload_stream : Stream, optional - Stream to use to automatically upload the graph after completion. (Default to None) - device_launch : bool, optional - Configure the graph to be launchable from the device. This flag can only - be used on platforms which support unified addressing. This flag cannot be - used in conjunction with auto_free_on_launch. (Default to False) - use_node_priority : bool, optional - Run the graph using the per-node priority attributes rather than the - priority of the stream it is launched into. (Default to False) - - """ - - auto_free_on_launch: bool = False - upload_stream: Stream | None = None - device_launch: bool = False - use_node_priority: bool = False - - -class GraphBuilder: - """Represents a graph under construction. - - A graph groups a set of CUDA kernels and other CUDA operations together and executes - them with a specified dependency tree. It speeds up the workflow by combining the - driver activities associated with CUDA kernel launches and CUDA API calls. - - Directly creating a :obj:`~_graph.GraphBuilder` is not supported due - to ambiguity. New graph builders should instead be created through a - :obj:`~_device.Device`, or a :obj:`~_stream.stream` object. - - """ - - class _MembersNeededForFinalize: - __slots__ = ("conditional_graph", "graph", "is_join_required", "is_stream_owner", "stream") - - def __init__(self, graph_builder_obj, stream_obj, is_stream_owner, conditional_graph, is_join_required): - self.stream = stream_obj - self.is_stream_owner = is_stream_owner - self.graph = None - self.conditional_graph = conditional_graph - self.is_join_required = is_join_required - weakref.finalize(graph_builder_obj, self.close) - - def close(self): - if self.stream: - if not self.is_join_required: - capture_status = handle_return(driver.cuStreamGetCaptureInfo(self.stream.handle))[0] - if capture_status != driver.CUstreamCaptureStatus.CU_STREAM_CAPTURE_STATUS_NONE: - # Note how this condition only occures for the primary graph builder - # This is because calling cuStreamEndCapture streams that were split off of the primary - # would error out with CUDA_ERROR_STREAM_CAPTURE_UNJOINED. - # Therefore, it is currently a requirement that users join all split graph builders - # before a graph builder can be clearly destroyed. - handle_return(driver.cuStreamEndCapture(self.stream.handle)) - if self.is_stream_owner: - self.stream.close() - self.stream = None - if self.graph: - handle_return(driver.cuGraphDestroy(self.graph)) - self.graph = None - self.conditional_graph = None - - __slots__ = ("__weakref__", "_building_ended", "_mnff") - - def __init__(self): - raise NotImplementedError( - "directly creating a Graph object can be ambiguous. Please either " - "call Device.create_graph_builder() or stream.create_graph_builder()" - ) - - @classmethod - def _init(cls, stream, is_stream_owner, conditional_graph=None, is_join_required=False): - self = cls.__new__(cls) - _lazy_init() - self._mnff = GraphBuilder._MembersNeededForFinalize( - self, stream, is_stream_owner, conditional_graph, is_join_required - ) - - self._building_ended = False - return self - - @property - def stream(self) -> Stream: - """Returns the stream associated with the graph builder.""" - return self._mnff.stream - - @property - def is_join_required(self) -> bool: - """Returns True if this graph builder must be joined before building is ended.""" - return self._mnff.is_join_required - - def begin_building(self, mode="relaxed") -> GraphBuilder: - """Begins the building process. - - Build `mode` for controlling interaction with other API calls must be one of the following: - - - `global` : Prohibit potentially unsafe operations across all streams in the process. - - `thread_local` : Prohibit potentially unsafe operations in streams created by the current thread. - - `relaxed` : The local thread is not prohibited from potentially unsafe operations. - - Parameters - ---------- - mode : str, optional - Build mode to control the interaction with other API calls that are porentially unsafe. - Default set to use relaxed. - - """ - if self._building_ended: - raise RuntimeError("Cannot resume building after building has ended.") - if mode not in ("global", "thread_local", "relaxed"): - raise ValueError(f"Unsupported build mode: {mode}") - if mode == "global": - capture_mode = driver.CUstreamCaptureMode.CU_STREAM_CAPTURE_MODE_GLOBAL - elif mode == "thread_local": - capture_mode = driver.CUstreamCaptureMode.CU_STREAM_CAPTURE_MODE_THREAD_LOCAL - elif mode == "relaxed": - capture_mode = driver.CUstreamCaptureMode.CU_STREAM_CAPTURE_MODE_RELAXED - else: - raise ValueError(f"Unsupported build mode: {mode}") - - if self._mnff.conditional_graph: - handle_return( - driver.cuStreamBeginCaptureToGraph( - self._mnff.stream.handle, - self._mnff.conditional_graph, - None, # dependencies - None, # dependencyData - 0, # numDependencies - capture_mode, - ) - ) - else: - handle_return(driver.cuStreamBeginCapture(self._mnff.stream.handle, capture_mode)) - return self - - @property - def is_building(self) -> bool: - """Returns True if the graph builder is currently building.""" - capture_status = handle_return(driver.cuStreamGetCaptureInfo(self._mnff.stream.handle))[0] - if capture_status == driver.CUstreamCaptureStatus.CU_STREAM_CAPTURE_STATUS_NONE: - return False - elif capture_status == driver.CUstreamCaptureStatus.CU_STREAM_CAPTURE_STATUS_ACTIVE: - return True - elif capture_status == driver.CUstreamCaptureStatus.CU_STREAM_CAPTURE_STATUS_INVALIDATED: - raise RuntimeError( - "Build process encountered an error and has been invalidated. Build process must now be ended." - ) - else: - raise NotImplementedError(f"Unsupported capture status type received: {capture_status}") - - def end_building(self) -> GraphBuilder: - """Ends the building process.""" - if not self.is_building: - raise RuntimeError("Graph builder is not building.") - if self._mnff.conditional_graph: - self._mnff.conditional_graph = handle_return(driver.cuStreamEndCapture(self.stream.handle)) - else: - self._mnff.graph = handle_return(driver.cuStreamEndCapture(self.stream.handle)) - - # TODO: Resolving https://github.com/NVIDIA/cuda-python/issues/617 would allow us to - # resume the build process after the first call to end_building() - self._building_ended = True - return self - - def complete(self, options: GraphCompleteOptions | None = None) -> Graph: - """Completes the graph builder and returns the built :obj:`~_graph.Graph` object. - - Parameters - ---------- - options : :obj:`~_graph.GraphCompleteOptions`, optional - Customizable dataclass for the graph builder completion options. - - Returns - ------- - graph : :obj:`~_graph.Graph` - The newly built graph. - - """ - if not self._building_ended: - raise RuntimeError("Graph has not finished building.") - - if (_driver_ver < 12000) or (_py_major_minor < (12, 0)): - flags = 0 - if options: - if options.auto_free_on_launch: - flags |= driver.CUgraphInstantiate_flags.CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH - if options.use_node_priority: - flags |= driver.CUgraphInstantiate_flags.CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY - return Graph._init(handle_return(driver.cuGraphInstantiateWithFlags(self._mnff.graph, flags))) - - params = driver.CUDA_GRAPH_INSTANTIATE_PARAMS() - if options: - flags = 0 - if options.auto_free_on_launch: - flags |= driver.CUgraphInstantiate_flags.CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH - if options.upload_stream: - flags |= driver.CUgraphInstantiate_flags.CUDA_GRAPH_INSTANTIATE_FLAG_UPLOAD - params.hUploadStream = options.upload_stream.handle - if options.device_launch: - flags |= driver.CUgraphInstantiate_flags.CUDA_GRAPH_INSTANTIATE_FLAG_DEVICE_LAUNCH - if options.use_node_priority: - flags |= driver.CUgraphInstantiate_flags.CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY - params.flags = flags - - graph = Graph._init(handle_return(driver.cuGraphInstantiateWithParams(self._mnff.graph, params))) - if params.result_out == driver.CUgraphInstantiateResult.CUDA_GRAPH_INSTANTIATE_ERROR: - # NOTE: Should never get here since the handle_return should have caught this case - raise RuntimeError( - "Instantiation failed for an unexpected reason which is described in the return value of the function." - ) - elif params.result_out == driver.CUgraphInstantiateResult.CUDA_GRAPH_INSTANTIATE_INVALID_STRUCTURE: - raise RuntimeError("Instantiation failed due to invalid structure, such as cycles.") - elif params.result_out == driver.CUgraphInstantiateResult.CUDA_GRAPH_INSTANTIATE_NODE_OPERATION_NOT_SUPPORTED: - raise RuntimeError( - "Instantiation for device launch failed because the graph contained an unsupported operation." - ) - elif params.result_out == driver.CUgraphInstantiateResult.CUDA_GRAPH_INSTANTIATE_MULTIPLE_CTXS_NOT_SUPPORTED: - raise RuntimeError( - "Instantiation for device launch failed due to the nodes belonging to different contexts." - ) - elif ( - _py_major_minor >= (12, 8) - and params.result_out == driver.CUgraphInstantiateResult.CUDA_GRAPH_INSTANTIATE_CONDITIONAL_HANDLE_UNUSED - ): - raise RuntimeError("One or more conditional handles are not associated with conditional builders.") - elif params.result_out != driver.CUgraphInstantiateResult.CUDA_GRAPH_INSTANTIATE_SUCCESS: - raise RuntimeError(f"Graph instantiation failed with unexpected error code: {params.result_out}") - return graph - - def debug_dot_print(self, path, options: GraphDebugPrintOptions | None = None): - """Generates a DOT debug file for the graph builder. - - Parameters - ---------- - path : str - File path to use for writting debug DOT output - options : :obj:`~_graph.GraphDebugPrintOptions`, optional - Customizable dataclass for the debug print options. - - """ - if not self._building_ended: - raise RuntimeError("Graph has not finished building.") - flags = 0 - if options: - if options.verbose: - flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_VERBOSE - if options.runtime_types: - flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_RUNTIME_TYPES - if options.kernel_node_params: - flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_PARAMS - if options.memcpy_node_params: - flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_MEMCPY_NODE_PARAMS - if options.memset_node_params: - flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_MEMSET_NODE_PARAMS - if options.host_node_params: - flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_HOST_NODE_PARAMS - if options.event_node_params: - flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_EVENT_NODE_PARAMS - if options.ext_semas_signal_node_params: - flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_SIGNAL_NODE_PARAMS - if options.ext_semas_wait_node_params: - flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_WAIT_NODE_PARAMS - if options.kernel_node_attributes: - flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_ATTRIBUTES - if options.handles: - flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_HANDLES - if options.mem_alloc_node_params: - flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_MEM_ALLOC_NODE_PARAMS - if options.mem_free_node_params: - flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_MEM_FREE_NODE_PARAMS - if options.batch_mem_op_node_params: - flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_BATCH_MEM_OP_NODE_PARAMS - if options.extra_topo_info: - flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_EXTRA_TOPO_INFO - if options.conditional_node_params: - flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_CONDITIONAL_NODE_PARAMS - - handle_return(driver.cuGraphDebugDotPrint(self._mnff.graph, path, flags)) - - def split(self, count: int) -> tuple[GraphBuilder, ...]: - """Splits the original graph builder into multiple graph builders. - - The new builders inherit work dependencies from the original builder. - The original builder is reused for the split and is returned first in the tuple. - - Parameters - ---------- - count : int - The number of graph builders to split the graph builder into. - - Returns - ------- - graph_builders : tuple[:obj:`~_graph.GraphBuilder`, ...] - A tuple of split graph builders. The first graph builder in the tuple - is always the original graph builder. - - """ - if count < 2: - raise ValueError(f"Invalid split count: expecting >= 2, got {count}") - - event = self._mnff.stream.record() - result = [self] - for i in range(count - 1): - stream = self._mnff.stream.device.create_stream() - stream.wait(event) - result.append( - GraphBuilder._init(stream=stream, is_stream_owner=True, conditional_graph=None, is_join_required=True) - ) - event.close() - return result - - @staticmethod - def join(*graph_builders) -> GraphBuilder: - """Joins multiple graph builders into a single graph builder. - - The returned builder inherits work dependencies from the provided builders. - - Parameters - ---------- - *graph_builders : :obj:`~_graph.GraphBuilder` - The graph builders to join. - - Returns - ------- - graph_builder : :obj:`~_graph.GraphBuilder` - The newly joined graph builder. - - """ - if any(not isinstance(builder, GraphBuilder) for builder in graph_builders): - raise TypeError("All arguments must be GraphBuilder instances") - if len(graph_builders) < 2: - raise ValueError("Must join with at least two graph builders") - - # Discover the root builder others should join - root_idx = 0 - for i, builder in enumerate(graph_builders): - if not builder.is_join_required: - root_idx = i - break - - # Join all onto the root builder - root_bdr = graph_builders[root_idx] - for idx, builder in enumerate(graph_builders): - if idx == root_idx: - continue - root_bdr.stream.wait(builder.stream) - builder.close() - - return root_bdr - - def __cuda_stream__(self) -> tuple[int, int]: - """Return an instance of a __cuda_stream__ protocol.""" - return self.stream.__cuda_stream__() - - def _get_conditional_context(self) -> driver.CUcontext: - return self._mnff.stream.context.handle - - def create_conditional_handle(self, default_value=None) -> driver.CUgraphConditionalHandle: - """Creates a conditional handle for the graph builder. - - Parameters - ---------- - default_value : int, optional - The default value to assign to the conditional handle. - - Returns - ------- - handle : driver.CUgraphConditionalHandle - The newly created conditional handle. - - """ - if _driver_ver < 12030: - raise RuntimeError(f"Driver version {_driver_ver} does not support conditional handles") - if _py_major_minor < (12, 3): - raise RuntimeError(f"Binding version {_py_major_minor} does not support conditional handles") - if default_value is not None: - flags = driver.CU_GRAPH_COND_ASSIGN_DEFAULT - else: - default_value = 0 - flags = 0 - - status, _, graph, *_, _ = handle_return(driver.cuStreamGetCaptureInfo(self._mnff.stream.handle)) - if status != driver.CUstreamCaptureStatus.CU_STREAM_CAPTURE_STATUS_ACTIVE: - raise RuntimeError("Cannot create a conditional handle when graph is not being built") - - return handle_return( - driver.cuGraphConditionalHandleCreate(graph, self._get_conditional_context(), default_value, flags) - ) - - def _cond_with_params(self, node_params) -> GraphBuilder: - # Get current capture info to ensure we're in a valid state - status, _, graph, *deps_info, num_dependencies = handle_return( - driver.cuStreamGetCaptureInfo(self._mnff.stream.handle) - ) - if status != driver.CUstreamCaptureStatus.CU_STREAM_CAPTURE_STATUS_ACTIVE: - raise RuntimeError("Cannot add conditional node when not actively capturing") - - # Add the conditional node to the graph - deps_info_update = [ - [handle_return(driver.cuGraphAddNode(graph, *deps_info, num_dependencies, node_params))] - ] + [None] * (len(deps_info) - 1) - - # Update the stream's capture dependencies - handle_return( - driver.cuStreamUpdateCaptureDependencies( - self._mnff.stream.handle, - *deps_info_update, # dependencies, edgeData - 1, # numDependencies - driver.CUstreamUpdateCaptureDependencies_flags.CU_STREAM_SET_CAPTURE_DEPENDENCIES, - ) - ) - - # Create new graph builders for each condition - return tuple( - [ - GraphBuilder._init( - stream=self._mnff.stream.device.create_stream(), - is_stream_owner=True, - conditional_graph=node_params.conditional.phGraph_out[i], - is_join_required=False, - ) - for i in range(node_params.conditional.size) - ] - ) - - def if_cond(self, handle: driver.CUgraphConditionalHandle) -> GraphBuilder: - """Adds an if condition branch and returns a new graph builder for it. - - The resulting if graph will only execute the branch if the conditional - handle evaluates to true at runtime. - - The new builder inherits work dependencies from the original builder. - - Parameters - ---------- - handle : driver.CUgraphConditionalHandle - The handle to use for the if conditional. - - Returns - ------- - graph_builder : :obj:`~_graph.GraphBuilder` - The newly created conditional graph builder. - - """ - if _driver_ver < 12030: - raise RuntimeError(f"Driver version {_driver_ver} does not support conditional if") - if _py_major_minor < (12, 3): - raise RuntimeError(f"Binding version {_py_major_minor} does not support conditional if") - node_params = driver.CUgraphNodeParams() - node_params.type = driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_CONDITIONAL - node_params.conditional.handle = handle - node_params.conditional.type = driver.CUgraphConditionalNodeType.CU_GRAPH_COND_TYPE_IF - node_params.conditional.size = 1 - node_params.conditional.ctx = self._get_conditional_context() - return self._cond_with_params(node_params)[0] - - def if_else(self, handle: driver.CUgraphConditionalHandle) -> tuple[GraphBuilder, GraphBuilder]: - """Adds an if-else condition branch and returns new graph builders for both branches. - - The resulting if graph will execute the branch if the conditional handle - evaluates to true at runtime, otherwise the else branch will execute. - - The new builders inherit work dependencies from the original builder. - - Parameters - ---------- - handle : driver.CUgraphConditionalHandle - The handle to use for the if-else conditional. - - Returns - ------- - graph_builders : tuple[:obj:`~_graph.GraphBuilder`, :obj:`~_graph.GraphBuilder`] - A tuple of two new graph builders, one for the if branch and one for the else branch. - - """ - if _driver_ver < 12080: - raise RuntimeError(f"Driver version {_driver_ver} does not support conditional if-else") - if _py_major_minor < (12, 8): - raise RuntimeError(f"Binding version {_py_major_minor} does not support conditional if-else") - node_params = driver.CUgraphNodeParams() - node_params.type = driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_CONDITIONAL - node_params.conditional.handle = handle - node_params.conditional.type = driver.CUgraphConditionalNodeType.CU_GRAPH_COND_TYPE_IF - node_params.conditional.size = 2 - node_params.conditional.ctx = self._get_conditional_context() - return self._cond_with_params(node_params) - - def switch(self, handle: driver.CUgraphConditionalHandle, count: int) -> tuple[GraphBuilder, ...]: - """Adds a switch condition branch and returns new graph builders for all cases. - - The resulting switch graph will execute the branch that matches the - case index of the conditional handle at runtime. If no match is found, no branch - will be executed. - - The new builders inherit work dependencies from the original builder. - - Parameters - ---------- - handle : driver.CUgraphConditionalHandle - The handle to use for the switch conditional. - count : int - The number of cases to add to the switch conditional. - - Returns - ------- - graph_builders : tuple[:obj:`~_graph.GraphBuilder`, ...] - A tuple of new graph builders, one for each branch. - - """ - if _driver_ver < 12080: - raise RuntimeError(f"Driver version {_driver_ver} does not support conditional switch") - if _py_major_minor < (12, 8): - raise RuntimeError(f"Binding version {_py_major_minor} does not support conditional switch") - node_params = driver.CUgraphNodeParams() - node_params.type = driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_CONDITIONAL - node_params.conditional.handle = handle - node_params.conditional.type = driver.CUgraphConditionalNodeType.CU_GRAPH_COND_TYPE_SWITCH - node_params.conditional.size = count - node_params.conditional.ctx = self._get_conditional_context() - return self._cond_with_params(node_params) - - def while_loop(self, handle: driver.CUgraphConditionalHandle) -> GraphBuilder: - """Adds a while loop and returns a new graph builder for it. - - The resulting while loop graph will execute the branch repeatedly at runtime - until the conditional handle evaluates to false. - - The new builder inherits work dependencies from the original builder. - - Parameters - ---------- - handle : driver.CUgraphConditionalHandle - The handle to use for the while loop. - - Returns - ------- - graph_builder : :obj:`~_graph.GraphBuilder` - The newly created while loop graph builder. - - """ - if _driver_ver < 12030: - raise RuntimeError(f"Driver version {_driver_ver} does not support conditional while loop") - if _py_major_minor < (12, 3): - raise RuntimeError(f"Binding version {_py_major_minor} does not support conditional while loop") - node_params = driver.CUgraphNodeParams() - node_params.type = driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_CONDITIONAL - node_params.conditional.handle = handle - node_params.conditional.type = driver.CUgraphConditionalNodeType.CU_GRAPH_COND_TYPE_WHILE - node_params.conditional.size = 1 - node_params.conditional.ctx = self._get_conditional_context() - return self._cond_with_params(node_params)[0] - - def close(self): - """Destroy the graph builder. - - Closes the associated stream if we own it. Borrowed stream - object will instead have their references released. - - """ - self._mnff.close() - - def add_child(self, child_graph: GraphBuilder): - """Adds the child :obj:`~_graph.GraphBuilder` builder into self. - - The child graph builder will be added as a child node to the parent graph builder. - - Parameters - ---------- - child_graph : :obj:`~_graph.GraphBuilder` - The child graph builder. Must have finished building. - """ - if (_driver_ver < 12000) or (_py_major_minor < (12, 0)): - raise NotImplementedError( - f"Launching child graphs is not implemented for versions older than CUDA 12." - f"Found driver version is {_driver_ver} and binding version is {_py_major_minor}" - ) - - if not child_graph._building_ended: - raise ValueError("Child graph has not finished building.") - - if not self.is_building: - raise ValueError("Parent graph is not being built.") - - stream_handle = self._mnff.stream.handle - _, _, graph_out, *deps_info_out, num_dependencies_out = handle_return( - 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_trimmed, num_dependencies_out, child_graph._mnff.graph - ) - ) - ] - ] + [None] * (len(deps_info_out) - 1) - handle_return( - driver.cuStreamUpdateCaptureDependencies( - stream_handle, - *deps_info_update, # dependencies, edgeData - 1, - driver.CUstreamUpdateCaptureDependencies_flags.CU_STREAM_SET_CAPTURE_DEPENDENCIES, - ) - ) - - -class Graph: - """Represents an executable graph. - - A graph groups a set of CUDA kernels and other CUDA operations together and executes - them with a specified dependency tree. It speeds up the workflow by combining the - driver activities associated with CUDA kernel launches and CUDA API calls. - - Graphs must be built using a :obj:`~_graph.GraphBuilder` object. - - """ - - class _MembersNeededForFinalize: - __slots__ = "graph" - - def __init__(self, graph_obj, graph): - self.graph = graph - weakref.finalize(graph_obj, self.close) - - def close(self): - if self.graph: - handle_return(driver.cuGraphExecDestroy(self.graph)) - self.graph = None - - __slots__ = ("__weakref__", "_mnff") - - def __init__(self): - raise RuntimeError("directly constructing a Graph instance is not supported") - - @classmethod - def _init(cls, graph): - self = cls.__new__(cls) - self._mnff = Graph._MembersNeededForFinalize(self, graph) - return self - - def close(self): - """Destroy the graph.""" - self._mnff.close() - - @property - def handle(self) -> driver.CUgraphExec: - """Return the underlying ``CUgraphExec`` object. - - .. caution:: - - This handle is a Python object. To get the memory address of the underlying C - handle, call ``int()`` on the returned object. - - """ - return self._mnff.graph - - def update(self, builder: GraphBuilder): - """Update the graph using new build configuration from the builder. - - The topology of the provided builder must be identical to this graph. - - Parameters - ---------- - builder : :obj:`~_graph.GraphBuilder` - The builder to update the graph with. - - """ - if not builder._building_ended: - raise ValueError("Graph has not finished building.") - - # Update the graph with the new nodes from the builder - exec_update_result = handle_return(driver.cuGraphExecUpdate(self._mnff.graph, builder._mnff.graph)) - if exec_update_result.result != driver.CUgraphExecUpdateResult.CU_GRAPH_EXEC_UPDATE_SUCCESS: - raise RuntimeError(f"Failed to update graph: {exec_update_result.result()}") - - def upload(self, stream: Stream): - """Uploads the graph in a stream. - - Parameters - ---------- - stream : :obj:`~_stream.Stream` - The stream in which to upload the graph - - """ - handle_return(driver.cuGraphUpload(self._mnff.graph, stream.handle)) - - def launch(self, stream: Stream): - """Launches the graph in a stream. - - Parameters - ---------- - stream : :obj:`~_stream.Stream` - The stream in which to launch the graph - - """ - handle_return(driver.cuGraphLaunch(self._mnff.graph, stream.handle)) diff --git a/cuda_core/cuda/core/_graphics.pxd b/cuda_core/cuda/core/_graphics.pxd index 9a8eb84f502..520a366bbde 100644 --- a/cuda_core/cuda/core/_graphics.pxd +++ b/cuda_core/cuda/core/_graphics.pxd @@ -9,6 +9,8 @@ cdef class GraphicsResource: cdef: GraphicsResourceHandle _handle - bint _mapped + object _mapped_buffer + object _context_manager_stream + object _entered_buffer - cpdef close(self) + cpdef close(self, stream=*) diff --git a/cuda_core/cuda/core/_graphics.pyi b/cuda_core/cuda/core/_graphics.pyi new file mode 100644 index 00000000000..b7022e5a18a --- /dev/null +++ b/cuda_core/cuda/core/_graphics.pyi @@ -0,0 +1,226 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_graphics.pyx + +from __future__ import annotations + +from typing import Sequence + +from cuda.bindings import cydriver +from cuda.core._memory._buffer import Buffer +from cuda.core._stream import Stream + + +class GraphicsResource: + """RAII wrapper for a CUDA graphics resource (``CUgraphicsResource``). + + A :class:`GraphicsResource` represents an OpenGL buffer or image that has + been registered for access by CUDA. This enables zero-copy sharing of GPU + data between CUDA compute kernels and graphics renderers. + + Mapping the resource returns a :class:`~cuda.core.Buffer` whose lifetime + controls when the graphics resource is unmapped. This keeps stream-ordered + cleanup tied to the mapped pointer itself rather than to mutable state on + the :class:`GraphicsResource` object. + + The resource is automatically unregistered when :meth:`close` is called or + when the object is garbage collected. + + :class:`GraphicsResource` objects should not be instantiated directly. + Use the factory classmethods :meth:`from_gl_buffer` or :meth:`from_gl_image`. + + Examples + -------- + Register an OpenGL VBO, map it to get a buffer, and write to it from CUDA: + + .. code-block:: python + + resource = GraphicsResource.from_gl_buffer(vbo) + + with resource.map(stream=s) as buf: + view = StridedMemoryView.from_buffer(buf, shape=(256,), dtype=np.float32) + # view.ptr is a CUDA device pointer into the GL buffer + + Or scope registration separately from mapping: + + .. code-block:: python + + with GraphicsResource.from_gl_buffer(vbo) as resource: + with resource.map(stream=s) as buf: + # ... launch kernels using buf.handle, buf.size ... + pass + """ + + def close(self, stream: object=None): + """Unregister this graphics resource from CUDA. + + If the resource is currently mapped, it is unmapped first. After + closing, the resource cannot be used again. + + Parameters + ---------- + stream : :class:`~cuda.core.Stream`, optional + Optional override for the stream used to close the currently + mapped buffer, if one exists. + """ + + def __init__(self) -> None: + ... + + @classmethod + def from_gl_buffer(cls, gl_buffer: int, *, flags: str | tuple[str, ...] | list[str] | None=None, stream: Stream | None=None) -> GraphicsResource: + """Register an OpenGL buffer object for CUDA access. + + Parameters + ---------- + gl_buffer : int + The OpenGL buffer name (``GLuint``) to register. + flags : str or sequence of str, optional + Registration flags specifying intended usage. Accepted values: + ``"none"``, ``"read_only"``, ``"write_discard"``, + ``"surface_load_store"``, ``"texture_gather"``. + Multiple flags can be combined by passing a sequence + (e.g., ``("surface_load_store", "read_only")``). + Defaults to ``None`` (no flags). + stream : :class:`~cuda.core.Stream`, optional + If provided, the resource can be used directly as a context manager + and it will be mapped on entry:: + + with GraphicsResource.from_gl_buffer(vbo, stream=s) as buf: + view = StridedMemoryView.from_buffer(buf, shape=(256,), dtype=np.float32) + + If omitted, the returned resource can still be used as a context + manager to scope registration and automatic cleanup:: + + with GraphicsResource.from_gl_buffer(vbo) as resource: + with resource.map(stream=s) as buf: + ... + + Returns + ------- + GraphicsResource + A new graphics resource wrapping the registered GL buffer. + The returned resource can be used as a context manager. If + *stream* was given, entering maps the resource and yields a + :class:`~cuda.core.Buffer`; otherwise entering yields the + :class:`GraphicsResource` itself and closes it on exit. + + Raises + ------ + CUDAError + If the registration fails (e.g., no current GL context, invalid + buffer name, or operating system error). + ValueError + If an unknown flag string is provided. + """ + + @classmethod + def from_gl_image(cls, image: int, target: int, *, flags: str | tuple[str, ...] | list[str] | None=None) -> GraphicsResource: + """Register an OpenGL texture or renderbuffer for CUDA access. + + Parameters + ---------- + image : int + The OpenGL texture or renderbuffer name (``GLuint``) to register. + target : int + The OpenGL target type (e.g., ``GL_TEXTURE_2D``). + flags : str or sequence of str, optional + Registration flags specifying intended usage. Accepted values: + ``"none"``, ``"read_only"``, ``"write_discard"``, + ``"surface_load_store"``, ``"texture_gather"``. + Multiple flags can be combined by passing a sequence + (e.g., ``("surface_load_store", "read_only")``). + Defaults to ``None`` (no flags). + + Returns + ------- + GraphicsResource + A new graphics resource wrapping the registered GL image. + + Raises + ------ + CUDAError + If the registration fails. + ValueError + If an unknown flag string is provided. + """ + + def _get_mapped_buffer(self) -> object: + ... + + def map(self, *, stream: Stream) -> Buffer: + """Map this graphics resource for CUDA access. + + After mapping, a CUDA device pointer into the underlying graphics + memory is available as a :class:`~cuda.core.Buffer`. + + Can be used as a context manager for automatic unmapping:: + + with resource.map(stream=s) as buf: + # use buf.handle, buf.size, etc. + # automatically unmapped here + + Parameters + ---------- + stream : :class:`~cuda.core.Stream` + Keyword-only. The CUDA stream on which to perform the mapping. + Must be passed explicitly; pass ``device.default_stream`` to use + the default stream. + + Returns + ------- + Buffer + A buffer whose lifetime controls when the graphics resource is + unmapped. + + Raises + ------ + RuntimeError + If the resource is already mapped or has been closed. + CUDAError + If the mapping fails. + """ + + def unmap(self, *, stream: Stream | None=None) -> None: + """Unmap this graphics resource, releasing it back to the graphics API. + + After unmapping, the :class:`~cuda.core.Buffer` previously returned + by :meth:`map` must not be used. + + Parameters + ---------- + stream : :class:`~cuda.core.Stream`, optional + If provided, overrides the stream that will be used when the + mapped buffer is closed. Otherwise the mapping stream is reused. + + Raises + ------ + RuntimeError + If the resource is not currently mapped or has been closed. + CUDAError + If the unmapping fails. + """ + + def __enter__(self) -> object: + ... + + def __exit__(self, exc_type: type | None, exc_val: BaseException | None, exc_tb: object) -> bool: + ... + + @property + def is_mapped(self) -> bool: + """Whether the resource is currently mapped for CUDA access.""" + + @property + def handle(self) -> int: + """The raw ``CUgraphicsResource`` handle as a Python int.""" + + @property + def resource_handle(self) -> int: + """Alias for :attr:`handle`.""" + + def __repr__(self) -> str: + ... +__all__ = ['GraphicsResource'] +_REGISTER_FLAGS = {'none': cydriver.CU_GRAPHICS_REGISTER_FLAGS_NONE, 'read_only': cydriver.CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY, 'write_discard': cydriver.CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD, 'surface_load_store': cydriver.CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST, 'texture_gather': cydriver.CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER} + +def _parse_register_flags(flags: str | Sequence[str] | None) -> int: + ... \ No newline at end of file diff --git a/cuda_core/cuda/core/_graphics.pyx b/cuda_core/cuda/core/_graphics.pyx index 4e1620bb2f4..c5fc5c83ecc 100644 --- a/cuda_core/cuda/core/_graphics.pyx +++ b/cuda_core/cuda/core/_graphics.pyx @@ -4,17 +4,19 @@ from __future__ import annotations +from typing import Sequence + from cuda.bindings cimport cydriver from cuda.core._resource_handles cimport ( create_graphics_resource_handle, + deviceptr_create_mapped_graphics, as_cu, as_intptr, ) +from cuda.core._memory._buffer cimport Buffer, Buffer_from_deviceptr_handle from cuda.core._stream cimport Stream, Stream_accept from cuda.core._utils.cuda_utils cimport HANDLE_RETURN -from cuda.core._memory import Buffer - __all__ = ['GraphicsResource'] _REGISTER_FLAGS = { @@ -26,7 +28,7 @@ _REGISTER_FLAGS = { } -def _parse_register_flags(flags): +def _parse_register_flags(flags: str | Sequence[str] | None) -> int: if flags is None: return 0 if isinstance(flags, str): @@ -43,40 +45,6 @@ def _parse_register_flags(flags): return result -class _MappedBufferContext: - """Context manager returned by :meth:`GraphicsResource.map`. - - Wraps a :class:`~cuda.core.Buffer` and ensures the graphics resource - is unmapped when the context exits. Can also be used without ``with`` - by calling :meth:`GraphicsResource.unmap` explicitly. - """ - __slots__ = ('_buffer', '_resource', '_stream') - - def __init__(self, buffer, resource, stream): - self._buffer = buffer - self._resource = resource - self._stream = stream - - def __enter__(self): - return self._buffer - - def __exit__(self, exc_type, exc_val, exc_tb): - self._resource.unmap(stream=self._stream) - return False - - # Delegate Buffer attributes so the return value of map() is directly usable - @property - def handle(self): - return self._buffer.handle - - @property - def size(self): - return self._buffer.size - - def __repr__(self): - return repr(self._buffer) - - cdef class GraphicsResource: """RAII wrapper for a CUDA graphics resource (``CUgraphicsResource``). @@ -84,6 +52,11 @@ cdef class GraphicsResource: been registered for access by CUDA. This enables zero-copy sharing of GPU data between CUDA compute kernels and graphics renderers. + Mapping the resource returns a :class:`~cuda.core.Buffer` whose lifetime + controls when the graphics resource is unmapped. This keeps stream-ordered + cleanup tied to the mapped pointer itself rather than to mutable state on + the :class:`GraphicsResource` object. + The resource is automatically unregistered when :meth:`close` is called or when the object is garbage collected. @@ -92,8 +65,7 @@ cdef class GraphicsResource: Examples -------- - Register an OpenGL VBO, map it to get a :class:`~cuda.core.Buffer`, and - write to it from CUDA: + Register an OpenGL VBO, map it to get a buffer, and write to it from CUDA: .. code-block:: python @@ -103,23 +75,30 @@ cdef class GraphicsResource: view = StridedMemoryView.from_buffer(buf, shape=(256,), dtype=np.float32) # view.ptr is a CUDA device pointer into the GL buffer - Or use explicit map/unmap for render loops: + Or scope registration separately from mapping: .. code-block:: python - buf = resource.map(stream=s) - # ... launch kernels using buf ... - resource.unmap(stream=s) + with GraphicsResource.from_gl_buffer(vbo) as resource: + with resource.map(stream=s) as buf: + # ... launch kernels using buf.handle, buf.size ... + pass """ - def __init__(self): + def __init__(self) -> None: raise RuntimeError( "GraphicsResource objects cannot be instantiated directly. " "Use GraphicsResource.from_gl_buffer() or GraphicsResource.from_gl_image()." ) @classmethod - def from_gl_buffer(cls, int gl_buffer, *, flags=None) -> GraphicsResource: + def from_gl_buffer( + cls, + int gl_buffer, + *, + flags: str | tuple[str, ...] | list[str] | None = None, + stream: Stream | None = None + ) -> GraphicsResource: """Register an OpenGL buffer object for CUDA access. Parameters @@ -133,11 +112,28 @@ cdef class GraphicsResource: Multiple flags can be combined by passing a sequence (e.g., ``("surface_load_store", "read_only")``). Defaults to ``None`` (no flags). + stream : :class:`~cuda.core.Stream`, optional + If provided, the resource can be used directly as a context manager + and it will be mapped on entry:: + + with GraphicsResource.from_gl_buffer(vbo, stream=s) as buf: + view = StridedMemoryView.from_buffer(buf, shape=(256,), dtype=np.float32) + + If omitted, the returned resource can still be used as a context + manager to scope registration and automatic cleanup:: + + with GraphicsResource.from_gl_buffer(vbo) as resource: + with resource.map(stream=s) as buf: + ... Returns ------- GraphicsResource A new graphics resource wrapping the registered GL buffer. + The returned resource can be used as a context manager. If + *stream* was given, entering maps the resource and yields a + :class:`~cuda.core.Buffer`; otherwise entering yields the + :class:`GraphicsResource` itself and closes it on exit. Raises ------ @@ -156,12 +152,18 @@ cdef class GraphicsResource: cydriver.cuGraphicsGLRegisterBuffer(&resource, cy_buffer, cy_flags) ) self._handle = create_graphics_resource_handle(resource) - self._mapped = False + self._mapped_buffer = None + self._context_manager_stream = stream + self._entered_buffer = None return self @classmethod def from_gl_image( - cls, int image, int target, *, flags=None + cls, + int image, + int target, + *, + flags: str | tuple[str, ...] | list[str] | None = None ) -> GraphicsResource: """Register an OpenGL texture or renderbuffer for CUDA access. @@ -201,10 +203,22 @@ cdef class GraphicsResource: cydriver.cuGraphicsGLRegisterImage(&resource, cy_image, cy_target, cy_flags) ) self._handle = create_graphics_resource_handle(resource) - self._mapped = False + self._mapped_buffer = None + self._context_manager_stream = None + self._entered_buffer = None return self - def map(self, *, stream: Stream | None = None): + def _get_mapped_buffer(self) -> object: + cdef Buffer buf + if self._mapped_buffer is None: + return None + buf = self._mapped_buffer + if not buf._h_ptr: + self._mapped_buffer = None + return None + return self._mapped_buffer + + def map(self, *, stream: Stream) -> Buffer: """Map this graphics resource for CUDA access. After mapping, a CUDA device pointer into the underlying graphics @@ -216,25 +230,18 @@ cdef class GraphicsResource: # use buf.handle, buf.size, etc. # automatically unmapped here - Or called directly for explicit control:: - - mapped = resource.map(stream=s) - buf = mapped._buffer # or use mapped.handle, mapped.size - # ... do work ... - resource.unmap(stream=s) - Parameters ---------- - stream : :class:`~cuda.core.Stream`, optional - The CUDA stream on which to perform the mapping. If ``None``, - the default stream (``0``) is used. + stream : :class:`~cuda.core.Stream` + Keyword-only. The CUDA stream on which to perform the mapping. + Must be passed explicitly; pass ``device.default_stream`` to use + the default stream. Returns ------- - _MappedBufferContext - An object that is both a context manager and provides access - to the underlying :class:`~cuda.core.Buffer`. When used with - ``with``, the resource is unmapped on exit. + Buffer + A buffer whose lifetime controls when the graphics resource is + unmapped. Raises ------ @@ -243,20 +250,20 @@ cdef class GraphicsResource: CUDAError If the mapping fails. """ + cdef Stream s_obj + cdef cydriver.CUgraphicsResource raw + cdef cydriver.CUstream cy_stream + cdef cydriver.CUdeviceptr dev_ptr = 0 + cdef size_t size = 0 + cdef Buffer buf if not self._handle: raise RuntimeError("GraphicsResource has been closed") - if self._mapped: + if self._get_mapped_buffer() is not None: raise RuntimeError("GraphicsResource is already mapped") - cdef cydriver.CUgraphicsResource raw = as_cu(self._handle) - cdef cydriver.CUstream cy_stream = 0 - cdef Stream s_obj = None - if stream is not None: - s_obj = Stream_accept(stream) - cy_stream = as_cu(s_obj._h_stream) - - cdef cydriver.CUdeviceptr dev_ptr = 0 - cdef size_t size = 0 + s_obj = Stream_accept(stream) + raw = as_cu(self._handle) + cy_stream = as_cu(s_obj._h_stream) with nogil: HANDLE_RETURN( cydriver.cuGraphicsMapResources(1, &raw, cy_stream) @@ -264,11 +271,16 @@ cdef class GraphicsResource: HANDLE_RETURN( cydriver.cuGraphicsResourceGetMappedPointer(&dev_ptr, &size, raw) ) - self._mapped = True - buf = Buffer.from_handle(int(dev_ptr), size, owner=self) - return _MappedBufferContext(buf, self, stream) + buf = Buffer_from_deviceptr_handle( + deviceptr_create_mapped_graphics(dev_ptr, self._handle, s_obj._h_stream), + size, + None, + None, + ) + self._mapped_buffer = buf + return buf - def unmap(self, *, stream: Stream | None = None): + def unmap(self, *, stream: Stream | None = None) -> None: """Unmap this graphics resource, releasing it back to the graphics API. After unmapping, the :class:`~cuda.core.Buffer` previously returned @@ -277,8 +289,8 @@ cdef class GraphicsResource: Parameters ---------- stream : :class:`~cuda.core.Stream`, optional - The CUDA stream on which to perform the unmapping. If ``None``, - the default stream (``0``) is used. + If provided, overrides the stream that will be used when the + mapped buffer is closed. Otherwise the mapping stream is reused. Raises ------ @@ -287,51 +299,68 @@ cdef class GraphicsResource: CUDAError If the unmapping fails. """ + cdef object buf_obj + cdef Buffer buf if not self._handle: raise RuntimeError("GraphicsResource has been closed") - if not self._mapped: + buf_obj = self._get_mapped_buffer() + if buf_obj is None: raise RuntimeError("GraphicsResource is not mapped") + buf = buf_obj + buf.close(stream=stream) + self._mapped_buffer = None + + def __enter__(self) -> object: + if self._context_manager_stream is None: + return self + self._entered_buffer = self.map(stream=self._context_manager_stream) + return self._entered_buffer + + def __exit__(self, exc_type: type | None, exc_val: BaseException | None, exc_tb: object) -> bool: + self.close() + return False - cdef cydriver.CUgraphicsResource raw = as_cu(self._handle) - cdef cydriver.CUstream cy_stream = 0 - if stream is not None: - cy_stream = as_cu((Stream_accept(stream))._h_stream) - with nogil: - HANDLE_RETURN( - cydriver.cuGraphicsUnmapResources(1, &raw, cy_stream) - ) - self._mapped = False - - cpdef close(self): + cpdef close(self, object stream=None): """Unregister this graphics resource from CUDA. - If the resource is currently mapped, it is unmapped first (on the - default stream). After closing, the resource cannot be used again. + If the resource is currently mapped, it is unmapped first. After + closing, the resource cannot be used again. + + Parameters + ---------- + stream : :class:`~cuda.core.Stream`, optional + Optional override for the stream used to close the currently + mapped buffer, if one exists. """ - cdef cydriver.CUgraphicsResource raw - cdef cydriver.CUstream cy_stream + cdef object buf_obj + cdef Buffer buf if not self._handle: return - if self._mapped: - # Best-effort unmap before unregister - raw = as_cu(self._handle) - cy_stream = 0 - with nogil: - cydriver.cuGraphicsUnmapResources(1, &raw, cy_stream) - self._mapped = False + buf_obj = self._get_mapped_buffer() + if buf_obj is not None: + buf = buf_obj + buf.close(stream=stream) + self._mapped_buffer = None self._handle.reset() + self._context_manager_stream = None + self._entered_buffer = None @property def is_mapped(self) -> bool: """Whether the resource is currently mapped for CUDA access.""" - return self._mapped + return self._get_mapped_buffer() is not None @property def handle(self) -> int: """The raw ``CUgraphicsResource`` handle as a Python int.""" return as_intptr(self._handle) - def __repr__(self): - mapped_str = " mapped" if self._mapped else "" + @property + def resource_handle(self) -> int: + """Alias for :attr:`handle`.""" + return self.handle + + def __repr__(self) -> str: + mapped_str = " mapped" if self.is_mapped else "" closed_str = " closed" if not self._handle else "" return f"" diff --git a/cuda_core/cuda/core/_host.py b/cuda_core/cuda/core/_host.py new file mode 100644 index 00000000000..e74743d493a --- /dev/null +++ b/cuda_core/cuda/core/_host.py @@ -0,0 +1,103 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +import threading +from typing import ClassVar + + +class Host: + """Host (CPU) location for managed-memory operations. + + Use one of the following forms: + + * ``Host()`` — generic host (any NUMA node). + * ``Host(numa_id=N)`` — specific NUMA node ``N``. + * ``Host.numa_current()`` or ``Host(is_numa_current=True)`` — NUMA node + of the calling thread. ``numa_id`` and ``is_numa_current`` are + mutually exclusive. + + ``Host`` is the symmetric counterpart of :class:`~cuda.core.Device` + for managed-memory `prefetch`, `advise`, and `discard_prefetch` + targets. Pass either a ``Device`` or a ``Host`` to those operations + and to ``ManagedBuffer.preferred_location`` / ``accessed_by``. + + ``Host`` is a singleton class, mirroring :class:`~cuda.core.Device`: + constructor calls with the same arguments return the same instance, + so ``Host() is Host()`` and ``Host(numa_id=1) is Host(numa_id=1)``. + ``Host.numa_current()`` returns its own singleton, distinct from + ``Host()`` because it represents a thread-relative location rather + than a fixed one. + """ + + __slots__ = ("__weakref__", "_is_numa_current", "_numa_id") + + _numa_id: int | None + _is_numa_current: bool + + # Singleton cache keyed by (numa_id, is_numa_current). + _instances: ClassVar[dict[tuple[int | None, bool], Host]] = {} + _instances_lock: ClassVar[threading.Lock] = threading.Lock() + + def __new__(cls, numa_id: int | None = None, *, is_numa_current: bool = False) -> Host: + if is_numa_current and numa_id is not None: + raise ValueError("numa_id and is_numa_current are mutually exclusive") + if numa_id is not None and (isinstance(numa_id, bool) or not isinstance(numa_id, int) or numa_id < 0): + raise ValueError(f"numa_id must be a non-negative int, got {numa_id!r}") + return cls._get_or_create(numa_id, is_numa_current) + + @classmethod + def _get_or_create(cls, numa_id: int | None, is_numa_current: bool) -> Host: + key = (numa_id, is_numa_current) + cache = cls._instances + inst = cache.get(key) + if inst is not None: + return inst + with cls._instances_lock: + inst = cache.get(key) + if inst is None: + inst = object.__new__(cls) + inst._numa_id = numa_id + inst._is_numa_current = is_numa_current + cache[key] = inst + return inst + + @property + def numa_id(self) -> int | None: + """NUMA node ID, or ``None`` if not pinned to a specific NUMA node.""" + return self._numa_id + + @property + def is_numa_current(self) -> bool: + """``True`` if this ``Host`` represents the calling thread's NUMA node (constructed via :meth:`numa_current`).""" + return self._is_numa_current + + @classmethod + def numa_current(cls) -> Host: + """Construct a ``Host`` referring to the calling thread's NUMA node.""" + return cls(is_numa_current=True) + + def __eq__(self, other: object) -> bool: + if not isinstance(other, Host): + return NotImplemented + return self is other + + def __hash__(self) -> int: + return hash((Host, self._numa_id, self._is_numa_current)) + + def __reduce__(self) -> tuple[object, ...]: + if self._is_numa_current: + return (_reconstruct_numa_current, ()) + return (Host, (self._numa_id,)) + + def __repr__(self) -> str: + if self.is_numa_current: + return "Host.numa_current()" + if self.numa_id is None: + return "Host()" + return f"Host(numa_id={self.numa_id})" + + +def _reconstruct_numa_current() -> Host: + return Host.numa_current() diff --git a/cuda_core/cuda/core/_include/aoti_shim.def b/cuda_core/cuda/core/_include/aoti_shim.def new file mode 100644 index 00000000000..3cd1e31aeac --- /dev/null +++ b/cuda_core/cuda/core/_include/aoti_shim.def @@ -0,0 +1,36 @@ +; Stub import library definition for PyTorch's AOTI stable C ABI symbols. +; Used on Windows only: 'lib /DEF:aoti_shim.def /OUT:aoti_shim.lib /MACHINE:X64' +; generates a minimal import library that satisfies the MSVC linker. +; At runtime the symbols resolve from torch_cpu.dll (loaded by 'import torch'). +; +; IMPORTANT: Keep this export list in sync with the AOTI_SHIM_API declarations +; in aoti_shim.h. setup.py turns this file into the stub import library +; that MSVC uses to link _tensor_bridge, so any added/removed/renamed AOTI +; symbol must be updated in both files. +LIBRARY torch_cpu.dll +EXPORTS + aoti_torch_get_data_ptr + aoti_torch_get_dim + aoti_torch_get_sizes + aoti_torch_get_strides + aoti_torch_get_dtype + aoti_torch_dtype_float16 + aoti_torch_dtype_float32 + aoti_torch_dtype_float64 + aoti_torch_dtype_bfloat16 + aoti_torch_dtype_uint8 + aoti_torch_dtype_uint16 + aoti_torch_dtype_uint32 + aoti_torch_dtype_uint64 + aoti_torch_dtype_int8 + aoti_torch_dtype_int16 + aoti_torch_dtype_int32 + aoti_torch_dtype_int64 + aoti_torch_dtype_bool + aoti_torch_dtype_complex32 + aoti_torch_dtype_complex64 + aoti_torch_dtype_complex128 + aoti_torch_get_device_type + aoti_torch_get_device_index + aoti_torch_device_type_cpu + aoti_torch_device_type_cuda diff --git a/cuda_core/cuda/core/_include/aoti_shim.h b/cuda_core/cuda/core/_include/aoti_shim.h new file mode 100644 index 00000000000..bf8894d940a --- /dev/null +++ b/cuda_core/cuda/core/_include/aoti_shim.h @@ -0,0 +1,121 @@ +/* + * Vendored subset of PyTorch's AOT Inductor (AOTI) stable C ABI. + * Original: torch/csrc/inductor/aoti_torch/c/shim.h + * + * These are declarations only -- no definitions are provided. The actual + * symbols are exported by libtorch (loaded via torch._C with RTLD_GLOBAL) + * and resolved at runtime by the dynamic linker. This means PyTorch is + * NOT required at compile time. + * + * From PyTorch: + * + * Copyright (c) 2016- Facebook, Inc (Adam Paszke) + * Copyright (c) 2014- Facebook, Inc (Soumith Chintala) + * Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert) + * Copyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu) + * Copyright (c) 2011-2012 NEC Laboratories America (Koray Kavukcuoglu) + * Copyright (c) 2011-2013 NYU (Clement Farabet) + * Copyright (c) 2006-2010 NEC Laboratories America (Ronan Collobert, Leon Bottou, Iain Melvin, Jason Weston) + * Copyright (c) 2006 Idiap Research Institute (Samy Bengio) + * Copyright (c) 2001-2004 Idiap Research Institute (Ronan Collobert, Samy Bengio, Johnny Mariethoz) + * + * SPDX-License-Identifier: BSD-3-Clause + * See https://github.com/pytorch/pytorch/blob/main/LICENSE + */ + +#ifndef CUDA_CORE_AOTI_SHIM_H +#define CUDA_CORE_AOTI_SHIM_H + +#include + +/* + * On Windows the AOTI symbols live in torch_cpu.dll. We consume them + * via __declspec(dllimport) and a stub import library generated from + * aoti_shim.def at build time. On Linux/macOS the symbols are made + * visible at runtime through ctypes.CDLL(torch._C, RTLD_GLOBAL). + */ +#ifdef _WIN32 +# define AOTI_SHIM_API __declspec(dllimport) +#else +# define AOTI_SHIM_API +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef int32_t AOTITorchError; + +/* Opaque tensor handle -- corresponds to at::Tensor on the C++ side. */ +struct AtenTensorOpaque; +typedef struct AtenTensorOpaque* AtenTensorHandle; + +/* + * IMPORTANT: Keep the AOTI_SHIM_API declaration list below in sync with + * aoti_shim.def. On Windows, setup.py generates that stub import library + * during build_ext so MSVC can link _tensor_bridge without making PyTorch a + * build-time dependency. If you add, remove, or rename an imported AOTI + * symbol here, update aoti_shim.def in the same change. + * + * Exception: aoti_torch_get_current_cuda_stream lives in torch_cuda (not + * torch_cpu) and is resolved lazily at runtime — see _tensor_bridge.pyx. + */ + +/* ---- tensor metadata --------------------------------------------------- */ + +AOTI_SHIM_API AOTITorchError aoti_torch_get_data_ptr( + AtenTensorHandle tensor, void** ret_data_ptr); + +AOTI_SHIM_API AOTITorchError aoti_torch_get_dim( + AtenTensorHandle tensor, int64_t* ret_dim); + +AOTI_SHIM_API AOTITorchError aoti_torch_get_sizes( + AtenTensorHandle tensor, int64_t** ret_sizes); + +AOTI_SHIM_API AOTITorchError aoti_torch_get_strides( + AtenTensorHandle tensor, int64_t** ret_strides); + +/* ---- dtype ------------------------------------------------------------- */ + +AOTI_SHIM_API AOTITorchError aoti_torch_get_dtype( + AtenTensorHandle tensor, int32_t* ret_dtype); + +AOTI_SHIM_API int32_t aoti_torch_dtype_float16(void); +AOTI_SHIM_API int32_t aoti_torch_dtype_float32(void); +AOTI_SHIM_API int32_t aoti_torch_dtype_float64(void); +AOTI_SHIM_API int32_t aoti_torch_dtype_bfloat16(void); +AOTI_SHIM_API int32_t aoti_torch_dtype_uint8(void); +AOTI_SHIM_API int32_t aoti_torch_dtype_uint16(void); +AOTI_SHIM_API int32_t aoti_torch_dtype_uint32(void); +AOTI_SHIM_API int32_t aoti_torch_dtype_uint64(void); +AOTI_SHIM_API int32_t aoti_torch_dtype_int8(void); +AOTI_SHIM_API int32_t aoti_torch_dtype_int16(void); +AOTI_SHIM_API int32_t aoti_torch_dtype_int32(void); +AOTI_SHIM_API int32_t aoti_torch_dtype_int64(void); +AOTI_SHIM_API int32_t aoti_torch_dtype_bool(void); +AOTI_SHIM_API int32_t aoti_torch_dtype_complex32(void); +AOTI_SHIM_API int32_t aoti_torch_dtype_complex64(void); +AOTI_SHIM_API int32_t aoti_torch_dtype_complex128(void); + +/* ---- device ------------------------------------------------------------ */ + +AOTI_SHIM_API AOTITorchError aoti_torch_get_device_type( + AtenTensorHandle tensor, int32_t* ret_device_type); + +AOTI_SHIM_API AOTITorchError aoti_torch_get_device_index( + AtenTensorHandle tensor, int32_t* ret_device_index); + +AOTI_SHIM_API int32_t aoti_torch_device_type_cpu(void); +AOTI_SHIM_API int32_t aoti_torch_device_type_cuda(void); + +/* ---- stream -------------------------------------------------------------- + * aoti_torch_get_current_cuda_stream is NOT declared here — it lives in + * torch_cuda (not torch_cpu) and is resolved at runtime. See the inline + * C helper _resolve_cuda_stream_fn() in _tensor_bridge.pyx. + * ---------------------------------------------------------------------- */ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* CUDA_CORE_AOTI_SHIM_H */ diff --git a/cuda_core/cuda/core/_include/layout.hpp b/cuda_core/cuda/core/_include/layout.hpp index ad3a2c6ffdb..b5da219df34 100644 --- a/cuda_core/cuda/core/_include/layout.hpp +++ b/cuda_core/cuda/core/_include/layout.hpp @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. // All rights reserved. // -// SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +// SPDX-License-Identifier: Apache-2.0 #ifndef CUDA_CORE_LAYOUT_HPP #define CUDA_CORE_LAYOUT_HPP diff --git a/cuda_core/cuda/core/_include/utility.hpp b/cuda_core/cuda/core/_include/utility.hpp index aa83a465e32..64b357ac324 100644 --- a/cuda_core/cuda/core/_include/utility.hpp +++ b/cuda_core/cuda/core/_include/utility.hpp @@ -1,6 +1,6 @@ // SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // -// SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +// SPDX-License-Identifier: Apache-2.0 #pragma once diff --git a/cuda_core/cuda/core/_kernel_arg_handler.pyi b/cuda_core/cuda/core/_kernel_arg_handler.pyi new file mode 100644 index 00000000000..0ebd2c0d0b6 --- /dev/null +++ b/cuda_core/cuda/core/_kernel_arg_handler.pyi @@ -0,0 +1,18 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_kernel_arg_handler.pyx + +from __future__ import annotations + +from typing import Any, Sequence + +from libcpp.complex import complex as cpp_complex + + +class ParamHolder: + + def __init__(self, kernel_args: Sequence[Any]) -> None: + ... + + def __dealloc__(self) -> None: + ... +cpp_single_complex = cpp_complex.complex +cpp_double_complex = cpp_complex.complex \ No newline at end of file diff --git a/cuda_core/cuda/core/_kernel_arg_handler.pyx b/cuda_core/cuda/core/_kernel_arg_handler.pyx index 882ca5eaabd..9fa5d47e336 100644 --- a/cuda_core/cuda/core/_kernel_arg_handler.pyx +++ b/cuda_core/cuda/core/_kernel_arg_handler.pyx @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 @@ -12,10 +12,14 @@ from libcpp cimport nullptr from libcpp cimport vector import ctypes +from typing import Sequence, Any import numpy from cuda.core._memory import Buffer +from cuda.core._tensor_map import TensorMapDescriptor as _TensorMapDescriptor_py +from cuda.core._tensor_map cimport TensorMapDescriptor +from cuda.core.graph._graph_definition cimport GraphCondition from cuda.core._utils.cuda_utils import driver from cuda.bindings cimport cydriver @@ -97,6 +101,9 @@ cdef object numpy_complex64 = numpy.complex64 cdef object numpy_complex128 = numpy.complex128 +cdef object tensor_map_descriptor_type = _TensorMapDescriptor_py + + # limitation due to cython/cython#534 ctypedef void* voidptr @@ -124,6 +131,17 @@ cdef inline int prepare_arg( return 0 +cdef inline int prepare_tensor_map_arg( + vector.vector[void*]& data, + vector.vector[void*]& data_addresses, + TensorMapDescriptor arg, + const size_t idx) except -1: + # cuLaunchKernel copies argument bytes during launch, so a TensorMap + # descriptor can point directly at its internal CUtensorMap storage. + data_addresses[idx] = arg._get_data_ptr() + return 0 + + cdef inline int prepare_ctypes_arg( vector.vector[void*]& data, vector.vector[void*]& data_addresses, @@ -250,7 +268,7 @@ cdef inline int prepare_numpy_arg( cdef class ParamHolder: - def __init__(self, kernel_args): + def __init__(self, kernel_args: Sequence[Any]) -> None: if len(kernel_args) == 0: self.ptr = 0 return @@ -290,6 +308,9 @@ cdef class ParamHolder: elif arg_type is complex: prepare_arg[cpp_double_complex](self.data, self.data_addresses, arg, i) continue + elif arg_type is tensor_map_descriptor_type: + prepare_tensor_map_arg(self.data, self.data_addresses, arg, i) + continue not_prepared = prepare_numpy_arg(self.data, self.data_addresses, arg, i) if not_prepared: @@ -299,6 +320,11 @@ cdef class ParamHolder: if arg_type is driver.CUgraphConditionalHandle: prepare_arg[cydriver.CUgraphConditionalHandle](self.data, self.data_addresses, int(arg), i) continue + elif arg_type is GraphCondition: + prepare_arg[cydriver.CUgraphConditionalHandle]( + self.data, self.data_addresses, + (arg)._c_handle, i) + continue # If no exact types are found, fallback to slower `isinstance` check elif isinstance(arg, Buffer): if isinstance(arg.handle, int): @@ -322,13 +348,18 @@ cdef class ParamHolder: elif isinstance(arg, driver.CUgraphConditionalHandle): prepare_arg[cydriver.CUgraphConditionalHandle](self.data, self.data_addresses, arg, i) continue + elif isinstance(arg, GraphCondition): + prepare_arg[cydriver.CUgraphConditionalHandle]( + self.data, self.data_addresses, + (arg)._c_handle, i) + continue # TODO: support ctypes/numpy struct raise TypeError("the argument is of unsupported type: " + str(type(arg))) self.kernel_args = kernel_args self.ptr = self.data_addresses.data() - def __dealloc__(self): + def __dealloc__(self) -> None: for data in self.data: if data: PyMem_Free(data) diff --git a/cuda_core/cuda/core/_launch_config.pxd b/cuda_core/cuda/core/_launch_config.pxd index 909c236309a..112007b9cfd 100644 --- a/cuda_core/cuda/core/_launch_config.pxd +++ b/cuda_core/cuda/core/_launch_config.pxd @@ -14,7 +14,7 @@ cdef class LaunchConfig: public tuple cluster public tuple block public int shmem_size - public bint cooperative_launch + public bint is_cooperative vector[cydriver.CUlaunchAttribute] _attrs object __weakref__ diff --git a/cuda_core/cuda/core/_launch_config.pyi b/cuda_core/cuda/core/_launch_config.pyi new file mode 100644 index 00000000000..eac16c1878f --- /dev/null +++ b/cuda_core/cuda/core/_launch_config.pyi @@ -0,0 +1,82 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_launch_config.pyx + +from __future__ import annotations + +from typing import Any + + +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. 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 + distributed shared memory and can be explicitly synchronized. + block : Union[tuple, int] + Group of threads (Thread Block) that will execute on the same + streaming multiprocessor (SM). Threads within a thread blocks have + access to shared memory and can be explicitly synchronized. + shmem_size : int, optional + Dynamic shared-memory size per thread block in bytes. + (Default to size 0) + is_cooperative : bool, optional + Whether this config can be used to launch a cooperative kernel. + """ + + def __init__(self, grid: int | tuple[int, ...] | None=None, cluster: int | tuple[int, ...] | None=None, block: int | tuple[int, ...] | None=None, shmem_size: int | None=None, is_cooperative: bool=False) -> None: + """Initialize LaunchConfig with validation. + + Parameters + ---------- + grid : Union[tuple, int], optional + Grid dimensions (number of blocks or clusters if cluster is specified) + cluster : Union[tuple, int], optional + Cluster dimensions (Thread Block Cluster) + block : Union[tuple, int], optional + Block dimensions (threads per block) + shmem_size : int, optional + Dynamic shared memory size in bytes (default: 0) + is_cooperative : bool, optional + Whether to launch as cooperative kernel (default: False) + """ + + def _identity(self) -> tuple[Any, ...]: + ... + + def __repr__(self) -> str: + """Return string representation of LaunchConfig.""" + + def __eq__(self, other: object) -> bool: + ... + + def __hash__(self) -> int: + ... +_LAUNCH_CONFIG_ATTRS = ('grid', 'cluster', 'block', 'shmem_size', 'is_cooperative') + +def _to_native_launch_config(config: LaunchConfig) -> object: + """Convert LaunchConfig to native driver CUlaunchConfig. + + Parameters + ---------- + config : LaunchConfig + High-level launch configuration + + Returns + ------- + driver.CUlaunchConfig + Native CUDA driver launch configuration + """ \ No newline at end of file diff --git a/cuda_core/cuda/core/_launch_config.pyx b/cuda_core/cuda/core/_launch_config.pyx index 798df71d9e3..a92ecf1f9e3 100644 --- a/cuda_core/cuda/core/_launch_config.pyx +++ b/cuda_core/cuda/core/_launch_config.pyx @@ -4,47 +4,16 @@ from libc.string cimport memset -from cuda.core._utils.cuda_utils cimport ( - HANDLE_RETURN, -) - -import threading +from typing import Any from cuda.core._device import Device from cuda.core._utils.cuda_utils import ( CUDAError, cast_to_3_tuple, driver, - get_binding_version, ) - -cdef bint _inited = False -cdef bint _use_ex = False -cdef object _lock = threading.Lock() - -# Attribute names for identity comparison and representation -_LAUNCH_CONFIG_ATTRS = ('grid', 'cluster', 'block', 'shmem_size', 'cooperative_launch') - - -cdef int _lazy_init() except?-1: - global _inited, _use_ex - if _inited: - return 0 - - cdef tuple _py_major_minor - cdef int _driver_ver - with _lock: - if _inited: - return 0 - - # binding availability depends on cuda-python version - _py_major_minor = get_binding_version() - HANDLE_RETURN(cydriver.cuDriverGetVersion(&_driver_ver)) - _use_ex = (_driver_ver >= 11080) and (_py_major_minor >= (11, 8)) - _inited = True - - return 0 +_LAUNCH_CONFIG_ATTRS = ('grid', 'cluster', 'block', 'shmem_size', 'is_cooperative') cdef class LaunchConfig: @@ -75,15 +44,21 @@ cdef class LaunchConfig: shmem_size : int, optional Dynamic shared-memory size per thread block in bytes. (Default to size 0) - cooperative_launch : bool, optional + is_cooperative : bool, optional Whether this config can be used to launch a cooperative kernel. """ # TODO: expand LaunchConfig to include other attributes # Note: attributes are declared in _launch_config.pxd - def __init__(self, grid=None, cluster=None, block=None, - shmem_size=None, cooperative_launch=False): + def __init__( + self, + grid: int | tuple[int, ...] | None = None, + cluster: int | tuple[int, ...] | None = None, + block: int | tuple[int, ...] | None = None, + shmem_size: int | None = None, + is_cooperative: bool = False, + ) -> None: """Initialize LaunchConfig with validation. Parameters @@ -96,11 +71,9 @@ cdef class LaunchConfig: Block dimensions (threads per block) shmem_size : int, optional Dynamic shared memory size in bytes (default: 0) - cooperative_launch : bool, optional + is_cooperative : bool, optional Whether to launch as cooperative kernel (default: False) """ - _lazy_init() - # Convert and validate grid and block dimensions self.grid = cast_to_3_tuple("LaunchConfig.grid", grid) self.block = cast_to_3_tuple("LaunchConfig.block", block) @@ -110,10 +83,6 @@ cdef class LaunchConfig: # device compute capability or attributes. # thread block clusters are supported starting H100 if cluster is not None: - if not _use_ex: - err, drvers = driver.cuDriverGetVersion() - drvers_fmt = f" (got driver version {drvers})" if err == driver.CUresult.CUDA_SUCCESS else "" - raise CUDAError(f"thread block clusters require cuda.bindings & driver 11.8+{drvers_fmt}") cc = Device().compute_capability if cc < (9, 0): raise CUDAError( @@ -129,22 +98,20 @@ cdef class LaunchConfig: else: self.shmem_size = shmem_size - # Handle cooperative_launch - self.cooperative_launch = cooperative_launch + self.is_cooperative = is_cooperative - # Validate cooperative launch support - if self.cooperative_launch and not Device().properties.cooperative_launch: + if self.is_cooperative and not Device().properties.cooperative_launch: raise CUDAError("cooperative kernels are not supported on this device") - def _identity(self): + def _identity(self) -> tuple[Any, ...]: return tuple(getattr(self, attr) for attr in _LAUNCH_CONFIG_ATTRS) - def __repr__(self): + def __repr__(self) -> str: """Return string representation of LaunchConfig.""" parts = ', '.join(f'{attr}={getattr(self, attr)!r}' for attr in _LAUNCH_CONFIG_ATTRS) return f"LaunchConfig({parts})" - def __eq__(self, other) -> bool: + def __eq__(self, other: object) -> bool: if not isinstance(other, LaunchConfig): return NotImplemented return self._identity() == (other)._identity() @@ -153,7 +120,6 @@ cdef class LaunchConfig: return hash(self._identity()) cdef cydriver.CUlaunchConfig _to_native_launch_config(self): - _lazy_init() cdef cydriver.CUlaunchConfig drv_cfg cdef cydriver.CUlaunchAttribute attr memset(&drv_cfg, 0, sizeof(drv_cfg)) @@ -176,7 +142,7 @@ cdef class LaunchConfig: drv_cfg.blockDimX, drv_cfg.blockDimY, drv_cfg.blockDimZ = self.block drv_cfg.sharedMemBytes = self.shmem_size - if self.cooperative_launch: + if self.is_cooperative: attr.id = cydriver.CUlaunchAttributeID.CU_LAUNCH_ATTRIBUTE_COOPERATIVE attr.value.cooperative = 1 self._attrs.push_back(attr) @@ -201,8 +167,6 @@ cpdef object _to_native_launch_config(LaunchConfig config): driver.CUlaunchConfig Native CUDA driver launch configuration """ - _lazy_init() - cdef object drv_cfg = driver.CUlaunchConfig() cdef list attrs cdef object attr @@ -232,7 +196,7 @@ cpdef object _to_native_launch_config(LaunchConfig config): drv_cfg.blockDimX, drv_cfg.blockDimY, drv_cfg.blockDimZ = config.block drv_cfg.sharedMemBytes = config.shmem_size - if config.cooperative_launch: + if config.is_cooperative: attr = driver.CUlaunchAttribute() attr.id = driver.CUlaunchAttributeID.CU_LAUNCH_ATTRIBUTE_COOPERATIVE attr.value.cooperative = 1 diff --git a/cuda_core/cuda/core/_launcher.pyi b/cuda_core/cuda/core/_launcher.pyi new file mode 100644 index 00000000000..a292c3eec95 --- /dev/null +++ b/cuda_core/cuda/core/_launcher.pyi @@ -0,0 +1,30 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_launcher.pyx + +from __future__ import annotations + +from cuda.core._launch_config import LaunchConfig +from cuda.core._module import Kernel +from cuda.core._stream import Stream +from cuda.core.graph import GraphBuilder +from cuda.core.typing import IsStreamType + + +def launch(stream: Stream | GraphBuilder | IsStreamType, config: LaunchConfig, kernel: Kernel, *kernel_args) -> None: + """Launches a :obj:`~_module.Kernel` + object with launch-time configuration. + + Parameters + ---------- + stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` + The stream establishing the stream ordering semantic of a + launch. + config : :obj:`LaunchConfig` + Launch configurations inline with options provided by + :obj:`~_launcher.LaunchConfig` dataclass. + kernel : :obj:`~_module.Kernel` + Kernel to launch. + *kernel_args : Any + Variable length argument list that is provided to the + launching kernel. + + """ \ No newline at end of file diff --git a/cuda_core/cuda/core/_launcher.pyx b/cuda_core/cuda/core/_launcher.pyx index ce5f7339e01..d5ddaff4d56 100644 --- a/cuda_core/cuda/core/_launcher.pyx +++ b/cuda_core/cuda/core/_launcher.pyx @@ -15,48 +15,28 @@ from cuda.core._utils.cuda_utils cimport ( check_or_create_options, HANDLE_RETURN, ) - -import threading - from cuda.core._module import Kernel from cuda.core._stream import Stream -from cuda.core._utils.cuda_utils import ( - _reduce_3_tuple, - get_binding_version, -) - - -cdef bint _inited = False -cdef bint _use_ex = False -cdef object _lock = threading.Lock() - - -cdef int _lazy_init() except?-1: - global _inited, _use_ex - if _inited: - return 0 - - cdef int _driver_ver - with _lock: - if _inited: - return 0 - - # binding availability depends on cuda-python version - _py_major_minor = get_binding_version() - HANDLE_RETURN(cydriver.cuDriverGetVersion(&_driver_ver)) - _use_ex = (_driver_ver >= 11080) and (_py_major_minor >= (11, 8)) - _inited = True +from math import prod +from typing import TYPE_CHECKING - return 0 +if TYPE_CHECKING: + from cuda.core.graph import GraphBuilder + from cuda.core.typing import IsStreamType -def launch(stream: Stream | GraphBuilder | IsStreamT, config: LaunchConfig, kernel: Kernel, *kernel_args): +def launch( + stream: Stream | GraphBuilder | IsStreamType, + config: LaunchConfig, + kernel: Kernel, + *kernel_args +) -> None: """Launches a :obj:`~_module.Kernel` object with launch-time configuration. Parameters ---------- - stream : :obj:`~_stream.Stream` | :obj:`~_graph.GraphBuilder` + stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` The stream establishing the stream ordering semantic of a launch. config : :obj:`LaunchConfig` @@ -70,7 +50,6 @@ def launch(stream: Stream | GraphBuilder | IsStreamT, config: LaunchConfig, kern """ cdef Stream s = Stream_accept(stream, allow_stream_protocol=True) - _lazy_init() cdef LaunchConfig conf = check_or_create_options(LaunchConfig, config, "launch config") # TODO: can we ensure kernel_args is valid/safe to use here? @@ -78,41 +57,24 @@ def launch(stream: Stream | GraphBuilder | IsStreamT, config: LaunchConfig, kern cdef ParamHolder ker_args = ParamHolder(kernel_args) cdef void** args_ptr = (ker_args.ptr) - # Note: We now use CUkernel handles exclusively (CUDA 12+), but they can be cast to - # CUfunction for use with cuLaunchKernel, as both handle types are interchangeable - # for kernel launch purposes. cdef Kernel ker = kernel cdef cydriver.CUfunction func_handle = as_cu(ker._h_kernel) - # Note: CUkernel can still be launched via cuLaunchKernel (not just cuLaunchKernelEx). - # We check both binding & driver versions here mainly to see if the "Ex" API is - # available and if so we use it, as it's more feature rich. - if _use_ex: - drv_cfg = conf._to_native_launch_config() - drv_cfg.hStream = as_cu(s._h_stream) - if conf.cooperative_launch: - _check_cooperative_launch(kernel, conf, s) - with nogil: - HANDLE_RETURN(cydriver.cuLaunchKernelEx(&drv_cfg, func_handle, args_ptr, NULL)) - else: - # TODO: check if config has any unsupported attrs - HANDLE_RETURN( - cydriver.cuLaunchKernel( - func_handle, - conf.grid[0], conf.grid[1], conf.grid[2], - conf.block[0], conf.block[1], conf.block[2], - conf.shmem_size, as_cu(s._h_stream), args_ptr, NULL - ) - ) + drv_cfg = conf._to_native_launch_config() + drv_cfg.hStream = as_cu(s._h_stream) + if conf.is_cooperative: + _check_cooperative_launch(kernel, conf, s) + with nogil: + HANDLE_RETURN(cydriver.cuLaunchKernelEx(&drv_cfg, func_handle, args_ptr, NULL)) cdef _check_cooperative_launch(kernel: Kernel, config: LaunchConfig, stream: Stream): dev = stream.device num_sm = dev.properties.multiprocessor_count max_grid_size = ( - kernel.occupancy.max_active_blocks_per_multiprocessor(_reduce_3_tuple(config.block), config.shmem_size) * num_sm + kernel.occupancy.max_active_blocks_per_multiprocessor(prod(config.block), config.shmem_size) * num_sm ) - if _reduce_3_tuple(config.grid) > max_grid_size: + if prod(config.grid) > max_grid_size: # For now let's try not to be smart and adjust the grid size behind users' back. # We explicitly ask users to adjust. x, y, z = config.grid diff --git a/cuda_core/cuda/core/_layout.pyi b/cuda_core/cuda/core/_layout.pyi new file mode 100644 index 00000000000..1562a2bf76f --- /dev/null +++ b/cuda_core/cuda/core/_layout.pyi @@ -0,0 +1,581 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_layout.pyx + +from __future__ import annotations + +import cython +from libcpp import vector + +OrderFlag = int +Property = int + +@cython.final +class _StridedLayout: + """ + A class describing the layout of a multi-dimensional tensor + with a shape, strides and itemsize. + + Parameters + ---------- + shape : tuple + A tuple of non-negative integers. + strides : tuple, optional + If provided, must be a tuple of integers of the same length as ``shape``. + Otherwise, the strides are assumed to be implicitly C-contiguous and the resulting + layout's :attr:`strides` will be None. + itemsize : int + The number of bytes per single element (dtype size). + divide_strides : bool, optional + If True, the provided :attr:`strides` will be divided by the :attr:`itemsize`. + + + See also :meth:`dense`. + + + Attributes + ---------- + itemsize : int + The number of bytes per single element (dtype size). + slice_offset : int + The offset (as a number of elements, not bytes) of the element at + index ``(0,) * ndim``. See also :attr:`slice_offset_in_bytes`. + """ + + def __init__(self: _StridedLayout, shape: tuple[int, ...], strides: tuple[int, ...] | None, itemsize: int, divide_strides: bool=False) -> None: + ... + + @classmethod + def dense(cls, shape: tuple[int], itemsize: int, stride_order: str | tuple[int]='C') -> _StridedLayout: + """ + Creates a new _StridedLayout instance with dense strides. + + Parameters + ---------- + shape : tuple + A tuple of non-negative integers. + itemsize : int + The number of bytes per single element of the tensor. + stride_order : str or tuple, optional + The order of the strides: + * 'C' (default) - the strides are computed in C-order (increasing from the right to the left) + * 'F' - the strides are computed in F-order (increasing from the left to the right) + * A tuple - it must be a permutation of ``tuple(range(len(shape)))``. + The last element of the tuple is the axis with stride 1. + + See also :attr:`stride_order`. + + + .. highlight:: python + .. code-block:: python + + assert _StridedLayout.dense((5, 3, 7), 1, "C") == _StridedLayout((5, 3, 7), (21, 7, 1), 1) + assert _StridedLayout.dense((5, 3, 7), 1, "F") == _StridedLayout((5, 3, 7), (1, 5, 15), 1) + assert _StridedLayout.dense((5, 3, 7), 1, (2, 0, 1)) == _StridedLayout((5, 3, 7), (3, 1, 15), 1) + + """ + + @classmethod + def dense_like(cls, other: _StridedLayout, stride_order: str | tuple[int]='K') -> _StridedLayout: + """ + Creates a _StridedLayout with the same :attr:`shape` and :attr:`itemsize` as the other layout, + but with contiguous strides in the specified order and no slice offset. + + See also :attr:`is_dense`. + + Parameters + ---------- + other : _StridedLayout + The _StridedLayout to copy the :attr:`shape` and :attr:`itemsize` from. + stride_order : str or tuple, optional + The order of the strides: + * 'K' (default) - keeps the order of the strides as in the ``other`` layout. + * 'C' - the strides are computed in C-order (increasing from the right to the left) + * 'F' - the strides are computed in F-order (increasing from the left to the right) + * A tuple - it must be a permutation of ``tuple(range(len(shape)))``. + The last element of the tuple is the axis with stride 1. + + See also :attr:`stride_order`. + + + .. highlight:: python + .. code-block:: python + + layout = _StridedLayout.dense((5, 3, 7), 1).permuted((2, 0, 1)) + assert layout == _StridedLayout((7, 5, 3), (1, 21, 7), 1) + + # dense_like with the default "K" stride_order + # keeps the same order of strides as in the original layout + assert _StridedLayout.dense_like(layout) == layout + # "C", "F" recompute the strides accordingly + assert _StridedLayout.dense_like(layout, "C") == _StridedLayout((7, 5, 3), (15, 3, 1), 1) + assert _StridedLayout.dense_like(layout, "F") == _StridedLayout((7, 5, 3), (1, 7, 35), 1) + """ + + def __repr__(self: _StridedLayout) -> str: + ... + + def __eq__(self, other: object) -> bool: + ... + + @property + def ndim(self: _StridedLayout) -> int: + """ + The number of dimensions (length of the shape tuple). + + :type: int + """ + + @property + def shape(self: _StridedLayout) -> tuple[int, ...]: + """ + Shape of the tensor. + + :type: tuple[int] + """ + + @property + def strides(self: _StridedLayout) -> tuple[int, ...] | None: + """ + Strides of the tensor (in **counts**, not bytes). + If _StridedLayout was created with strides=None, the + returned value is None and layout is implicitly C-contiguous. + + :type: tuple[int] | None + """ + + @property + def strides_in_bytes(self: _StridedLayout) -> tuple[int, ...] | None: + """ + Strides of the tensor (in bytes). + + :type: tuple[int] | None + """ + + @property + def stride_order(self: _StridedLayout) -> tuple[int, ...]: + """ + A permutation of ``tuple(range(ndim))`` describing the + relative order of the strides. + + .. highlight:: python + .. code-block:: python + + # C-contiguous layout + assert _StridedLayout.dense((5, 3, 7), 1).stride_order == (0, 1, 2) + # F-contiguous layout + assert _StridedLayout.dense((5, 3, 7), 1, stride_order="F").stride_order == (2, 1, 0) + # Permuted layout + assert _StridedLayout.dense((5, 3, 7), 1, stride_order=(2, 0, 1)).stride_order == (2, 0, 1) + + :type: tuple[int] + """ + + @property + def volume(self: _StridedLayout) -> int: + """ + The number of elements in the tensor, i.e. the product of the shape tuple. + + :type: int + """ + + @property + def is_unique(self: _StridedLayout) -> bool: + """ + If True, each element of a tensor with this layout is mapped to + a unique memory offset. + + All contiguous layouts are unique and so are layouts that can be created + by permuting, slicing, flattening, squeezing, repacking, or reshaping + a contiguous layout. + Conversely, broadcast layouts (layouts with a 0 stride + for some extent greater than 1) are not unique. + + For layouts resulting from manual stride manipulations + (such as with ``numpy.lib.stride_tricks``), the check + may inaccurately report False, as the exact uniqueness + check may be expensive. + + :type: bool + """ + + @property + def is_contiguous_c(self: _StridedLayout) -> bool: + """ + True iff the layout is contiguous in C-order, i.e. + the rightmost stride is 1 and each subsequent + stride to the left is the product of the + extent and the stride to the right. + + .. highlight:: python + .. code-block:: python + + layout = _StridedLayout.dense((2, 5, 3), 1, "C") + assert layout == _StridedLayout((2, 5, 3), (15, 3, 1), 1) + assert layout.is_contiguous_c + + See also :attr:`is_contiguous_any`. + + :type: bool + """ + + @property + def is_contiguous_f(self: _StridedLayout) -> bool: + """ + True iff the layout is contiguous in F-order, i.e. + the leftmost stride is 1 and each subsequent + stride to the right is the product of the + stride and extent to the left. + + .. highlight:: python + .. code-block:: python + + layout = _StridedLayout.dense((2, 5, 3), 1, "F") + assert layout == _StridedLayout((2, 5, 3), (1, 2, 10), 1) + assert layout.is_contiguous_f + + See also :attr:`is_contiguous_any`. + + :type: bool + """ + + @property + def is_contiguous_any(self: _StridedLayout) -> bool: + """ + True iff the layout is contiguous in some axis order, i.e. + there exists a permutation of axes such that the layout + is C-contiguous. + + In a contiguous layout, the strides are non-negative and + the mapping of elements to the memory offset range + ``[min_offset, max_offset]`` is 1-to-1. + + .. highlight:: python + .. code-block:: python + + # dense defaults to C-contiguous + layout = _StridedLayout.dense((5, 3, 7), 1) + assert layout.is_contiguous_c and not layout.is_contiguous_f + assert layout.is_contiguous_any + + # reversing the order of axes gives F-contiguous layout + permuted = layout.permuted((2, 1, 0)) + assert not permuted.is_contiguous_c and permuted.is_contiguous_f + assert permuted.is_contiguous_any + + # neither C- nor F-order but still contiguous + permuted = layout.permuted((2, 0, 1)) + assert not permuted.is_contiguous_c and not permuted.is_contiguous_f + assert permuted.is_contiguous_any + + # slicing the right-most extent creates a gap in the + # offset_bounds range that is not reachable with any + # element in the sliced layout + sliced = layout[:, :, :-1] + assert not sliced.is_contiguous_c and not sliced.is_contiguous_f + assert not sliced.is_contiguous_any + + :type: bool + """ + + @property + def is_dense(self: _StridedLayout) -> bool: + """ + A dense layout is contiguous (:attr:`is_contiguous_any` is True) + and has no slice offset (:attr:`slice_offset_in_bytes` is 0). + + In a dense layout, elements are mapped 1-to-1 to the ``[0, volume - 1]`` + memory offset range. + + :type: bool + """ + + @property + def offset_bounds(self: _StridedLayout) -> tuple[int, int]: + """ + The memory offset range ``[min_offset, max_offset]`` (in element counts, not bytes) + that elements of a tensor with this layout are mapped to. + + If the layout is empty (i.e. ``volume == 0``), the returned tuple is ``(0, -1)``. + Otherwise, ``min_offset <= max_offset`` and all elements of the tensor with + this layout are mapped within the ``[min_offset, max_offset]`` range. + + .. highlight:: python + .. code-block:: python + + # Possible implementation of the offset_bounds + def offset_bounds(layout : _StridedLayout): + if layout.volume == 0: + return 0, -1 + ndim = layout.ndim + shape = layout.shape + strides = layout.strides + idx_min = [shape[i] - 1 if strides[i] < 0 else 0 for i in range(ndim)] + idx_max = [shape[i] - 1 if strides[i] > 0 else 0 for i in range(ndim)] + min_offset = sum(strides[i] * idx_min[i] for i in range(ndim)) + layout.slice_offset + max_offset = sum(strides[i] * idx_max[i] for i in range(ndim)) + layout.slice_offset + return min_offset, max_offset + + :type: tuple[int, int] + """ + + @property + def min_offset(self: _StridedLayout) -> int: + """ + See :attr:`offset_bounds` for details. + + :type: int + """ + + @property + def max_offset(self: _StridedLayout) -> int: + """ + See :attr:`offset_bounds` for details. + + :type: int + """ + + @property + def slice_offset_in_bytes(self: _StridedLayout) -> int: + """ + The memory offset (as a number of bytes) of the element at index ``(0,) * ndim``. + Equal to :attr:`itemsize` ``*`` :attr:`slice_offset`. + + .. note:: + The only way for the index ``(0,) * ndim`` to be mapped to a non-zero offset + is slicing with :meth:`sliced` method (or ``[]`` operator). + + :type: int + """ + + def required_size_in_bytes(self: _StridedLayout) -> int: + """ + The memory allocation size (in bytes) needed so that + all elements of a tensor with this layout can be mapped + within the allocated memory range. + + The function raises an error if ``min_offset < 0``. + Otherwise, the returned value is equal to + ``(max_offset + 1) * itemsize``. + + .. hint:: + For dense layouts, the function always succeeds and the + ``(max_offset + 1) * itemsize`` is equal to the ``volume * itemsize``. + + .. highlight:: python + .. code-block:: python + + # Allocating memory on a device to copy a host tensor + def device_tensor_like(a : numpy.ndarray, device : ccx.Device) -> StridedMemoryView: + a_view = StridedMemoryView(a, -1) + # get the original layout of ``a`` and convert it to a dense layout + # to avoid overallocating memory (e.g. if the ``a`` was sliced) + layout = a_view._layout.to_dense() + # get the required size in bytes to fit the tensor + required_size = layout.required_size_in_bytes() + # allocate the memory on the device + device.set_current() + mem = device.allocate(required_size, stream=device.default_stream) + # create a view on the newly allocated device memory + b_view = StridedMemoryView.from_buffer(mem, layout, a_view.dtype) + return b_view + """ + + def flattened_axis_mask(self: _StridedLayout) -> axes_mask_t: + """ + A mask describing which axes of this layout are mergeable + using the :meth:`flattened` method. + """ + + def to_dense(self: _StridedLayout, stride_order: object='K') -> _StridedLayout: + """ + Returns a dense layout with the same shape and itemsize, + but with dense strides in the specified order. + + See :meth:`dense_like` method documentation for details. + """ + + def reshaped(self: _StridedLayout, shape: tuple[int]) -> _StridedLayout: + """ + Returns a layout with the new shape, if the new shape is compatible + with the current layout. + + The new shape is compatible if: + * the new and old shapes have the same volume + * the old strides can be split or flattened to match the new shape, + assuming indices are iterated in C-order + + A single extent in the ``shape`` tuple can be set to -1 to indicate + it should be inferred from the old volume and the other extents. + + .. highlight:: python + .. code-block:: python + + layout = _StridedLayout.dense((5, 3, 4), 1) + assert layout.reshaped((20, 3)) == _StridedLayout.dense((20, 3), 1) + assert layout.reshaped((4, -1)) == _StridedLayout.dense((4, 15), 1) + assert layout.permuted((2, 0, 1)).reshaped((4, 15,)) == _StridedLayout((4, 15), (1, 4), 1) + # layout.permuted((2, 0, 1)).reshaped((20, 3)) -> error + """ + + def permuted(self: _StridedLayout, axis_order: tuple[int]) -> _StridedLayout: + """ + Returns a new layout where the shape and strides tuples are permuted + according to the specified permutation of axes. + """ + + def flattened(self: _StridedLayout, start_axis: int=0, end_axis: int=-1, mask: int | None=None) -> _StridedLayout: + """ + Merges consecutive extents into a single extent (equal to the product of merged extents) + if the corresponding strides can be replaced with a single stride + (assuming indices are iterated in C-order, i.e. the rightmost + axis is incremented first). + + .. highlight:: python + .. code-block:: python + + # the two extents can be merged into a single extent + # because layout.strides[0] == layout.strides[1] * layout.shape[1] + layout = _StridedLayout((3, 2), (2, 1), 1) + assert layout.flattened() == _StridedLayout((6,), (1,), 1) + + # the two extents cannot be merged into a single extent + # because layout.strides[0] != layout.strides[1] * layout.shape[1] + layout = _StridedLayout((3, 2), (1, 3), 1) + assert layout.flattened() == layout + + If ``start_axis`` and ``end_axis`` are provided, only the axes in the + inclusive range ``[start_axis, end_axis]`` are considered for flattening. + + Alternatively, a mask specifying which axes to consider can be provided. + A mask of mergeable extents can be obtained using the :meth:`flattened_axis_mask` method. + Masks for layouts with the same number of dimensions can be combined + using the logical ``&`` (bitwise AND) operator. + + .. highlight:: python + .. code-block:: python + + layout = _StridedLayout.dense((4, 5, 3), 4) + layout2 = _StridedLayout((4, 5, 3), (1, 12, 4), 4) + # Even though the two layouts have the same shape initially, + # their shapes differ after flattening. + assert layout.flattened() == _StridedLayout((60,), (1,), 4) + assert layout2.flattened() == _StridedLayout((4, 15), (1, 4), 4) + # With the mask, only extents that are mergeable in both layouts are flattened + # and the resulting shape is the same for both layouts. + mask = layout.flattened_axis_mask() & layout2.flattened_axis_mask() + assert layout.flattened(mask=mask) == _StridedLayout((4, 15), (15, 1), 4) + assert layout2.flattened(mask=mask) == _StridedLayout((4, 15), (1, 4), 4) + """ + + def squeezed(self: _StridedLayout) -> _StridedLayout: + """ + Returns a new layout where all the singleton dimensions (extents equal to 1) + are removed. Additionally, if the layout volume is 0, + the returned layout will be reduced to a 1-dim layout + with shape (0,) and strides (0,). + """ + + def unsqueezed(self: _StridedLayout, axis: int | tuple[int]) -> _StridedLayout: + """ + Returns a new layout where the specified axis or axes are added as singleton extents. + The ``axis`` can be either a single integer in range ``[0, ndim]`` + or a tuple of unique integers in range ``[0, ndim + len(axis) - 1]``. + """ + + def broadcast_to(self: _StridedLayout, shape: tuple[int]) -> _StridedLayout: + """ + Returns a layout with the new shape, if the old shape can be + broadcast to the new one. + + The shapes are compatible if: + * the new shape has the same or greater number of dimensions + * starting from the right, each extent in the old shape must be 1 or + equal to the corresponding extent in the new shape. + + Strides of the added or modified extents are set to 0, the remaining ones are unchanged. + If the shapes are not compatible, a ValueError is raised. + """ + + def repacked(self: _StridedLayout, itemsize: int, data_ptr: int=0, axis: int=-1, keep_dim: bool=True) -> _StridedLayout: + """ + Converts the layout to match the specified itemsize. + If ``new_itemsize < itemsize``, each element of the tensor is **unpacked** into multiple elements, + i.e. the extent at ``axis`` increases by the factor ``itemsize // new_itemsize``. + If ``new_itemsize > itemsize``, the consecutive elements in the tensor are **packed** into a single element, + i.e. the extent at ``axis`` decreases by the factor ``new_itemsize // itemsize``. + In either case, the ``volume * itemsize`` of the layout remains the same. + + The conversion is subject to the following constraints: + * The extent at ``axis`` must be a positive integer. + * The stride at ``axis`` must be 1. + + Moreover, if the ``new_itemsize > itemsize``: + * The extent at ``axis`` must be divisible by ``new_itemsize // itemsize``. + * All other strides must be divisible by ``new_itemsize // itemsize``. + * The ``slice_offset`` must be divisible by ``new_itemsize // itemsize``. + * If ``data_ptr`` is provided, it must be aligned to the new itemsize. + + The maximum itemsize that satisfies all the constraints + can be obtained using the :meth:`max_compatible_itemsize` method. + + If the ``keep_dim`` is False and the extent at ``axis`` would be reduced to 1, + it is omitted from the returned layout. + + .. highlight:: python + .. code-block:: python + + # Repacking the layout with itemsize = 4 bytes as 2, 8, and 16 sized layouts. + layout = _StridedLayout.dense((5, 4), 4) + assert layout.repacked(2) == _StridedLayout.dense((5, 8), 2) + assert layout.repacked(8) == _StridedLayout.dense((5, 2), 8) + assert layout.repacked(16) == _StridedLayout.dense((5, 1), 16) + assert layout.repacked(16, keep_dim=False) == _StridedLayout.dense((5,), 16) + + + .. highlight:: python + .. code-block:: python + + # Viewing (5, 6) float array as (5, 3) complex64 array. + a = numpy.ones((5, 6), dtype=numpy.float32) + float_view = StridedMemoryView(a, -1) + layout = float_view._layout + assert layout.shape == (5, 6) + assert layout.itemsize == 4 + complex_view = float_view.view(layout.repacked(8), numpy.complex64) + assert complex_view._layout.shape == (5, 3) + assert complex_view._layout.itemsize == 8 + b = numpy.from_dlpack(complex_view) + assert b.shape == (5, 3) + """ + + def max_compatible_itemsize(self: _StridedLayout, max_itemsize: int=16, data_ptr: int=0, axis: int=-1) -> int: + """ + Returns the maximum itemsize (but no greater than ``max_itemsize``) that can be used + with the :meth:`repacked` method for the current layout. + """ + + def sliced(self: _StridedLayout, slices: int | slice | tuple[int | slice]) -> _StridedLayout: + """ + Returns a sliced layout. + The ``slices`` parameter can be a single integer, a single :py:class:`slice` object + or a tuple of integers/slices. + + .. hint:: + For convenience, instead of calling this method directly, please rely + on the :py:meth:`~object.__getitem__` operator (i.e. bracket syntax), e.g.: + ``layout[:, start:end:step]``. + + .. note:: + Slicing is purely a layout transformation and does not involve + any data access. + + """ + + def __getitem__(self: _StridedLayout, slices: int | slice | tuple[int | slice]) -> _StridedLayout: + ... +extent_t = int +stride_t = int +axis_t = int +axes_mask_t = int +property_mask_t = int +extents_strides_t = vector.vector +axis_vec_t = vector.vector \ No newline at end of file diff --git a/cuda_core/cuda/core/_layout.pyx b/cuda_core/cuda/core/_layout.pyx index 3c9392430b6..9996a75e640 100644 --- a/cuda_core/cuda/core/_layout.pyx +++ b/cuda_core/cuda/core/_layout.pyx @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 @@ -176,11 +176,18 @@ cdef class _StridedLayout: f"_StridedLayout(shape={self.shape}, strides={self.strides}, itemsize={self.itemsize}, _slice_offset={self.slice_offset})" ) - def __eq__(self : _StridedLayout, other : _StridedLayout) -> bool: - return self.itemsize == other.itemsize and self.slice_offset == other.slice_offset and _base_layout_equal(self.base, other.base) + def __eq__(self, other: object) -> bool: + if not isinstance(other, _StridedLayout): + return NotImplemented + cdef _StridedLayout _other = <_StridedLayout>other + return ( + self.itemsize == _other.itemsize + and self.slice_offset == _other.slice_offset + and _base_layout_equal(self.base, _other.base) + ) @property - def ndim(self : _StridedLayout): + def ndim(self : _StridedLayout) -> int: """ The number of dimensions (length of the shape tuple). @@ -189,7 +196,7 @@ cdef class _StridedLayout: return self.base.ndim @property - def shape(self : _StridedLayout): + def shape(self : _StridedLayout) -> tuple[int, ...]: """ Shape of the tensor. @@ -198,7 +205,7 @@ cdef class _StridedLayout: return self.get_shape_tuple() @property - def strides(self : _StridedLayout): + def strides(self : _StridedLayout) -> tuple[int, ...] | None: """ Strides of the tensor (in **counts**, not bytes). If _StridedLayout was created with strides=None, the @@ -209,7 +216,7 @@ cdef class _StridedLayout: return self.get_strides_tuple() @property - def strides_in_bytes(self : _StridedLayout): + def strides_in_bytes(self : _StridedLayout) -> tuple[int, ...] | None: """ Strides of the tensor (in bytes). @@ -218,7 +225,7 @@ cdef class _StridedLayout: return self.get_strides_in_bytes_tuple() @property - def stride_order(self : _StridedLayout): + def stride_order(self : _StridedLayout) -> tuple[int, ...]: """ A permutation of ``tuple(range(ndim))`` describing the relative order of the strides. @@ -238,7 +245,7 @@ cdef class _StridedLayout: return self.get_stride_order_tuple() @property - def volume(self : _StridedLayout): + def volume(self : _StridedLayout) -> int: """ The number of elements in the tensor, i.e. the product of the shape tuple. @@ -247,7 +254,7 @@ cdef class _StridedLayout: return self.get_volume() @property - def is_unique(self : _StridedLayout): + def is_unique(self : _StridedLayout) -> bool: """ If True, each element of a tensor with this layout is mapped to a unique memory offset. @@ -268,7 +275,7 @@ cdef class _StridedLayout: return self.get_is_unique() @property - def is_contiguous_c(self : _StridedLayout): + def is_contiguous_c(self : _StridedLayout) -> bool: """ True iff the layout is contiguous in C-order, i.e. the rightmost stride is 1 and each subsequent @@ -289,7 +296,7 @@ cdef class _StridedLayout: return self.get_is_contiguous_c() @property - def is_contiguous_f(self : _StridedLayout): + def is_contiguous_f(self : _StridedLayout) -> bool: """ True iff the layout is contiguous in F-order, i.e. the leftmost stride is 1 and each subsequent @@ -310,7 +317,7 @@ cdef class _StridedLayout: return self.get_is_contiguous_f() @property - def is_contiguous_any(self : _StridedLayout): + def is_contiguous_any(self : _StridedLayout) -> bool: """ True iff the layout is contiguous in some axis order, i.e. there exists a permutation of axes such that the layout @@ -350,7 +357,7 @@ cdef class _StridedLayout: return self.get_is_contiguous_any() @property - def is_dense(self : _StridedLayout): + def is_dense(self : _StridedLayout) -> bool: """ A dense layout is contiguous (:attr:`is_contiguous_any` is True) and has no slice offset (:attr:`slice_offset_in_bytes` is 0). @@ -363,7 +370,7 @@ cdef class _StridedLayout: return self.get_is_dense() @property - def offset_bounds(self : _StridedLayout): + def offset_bounds(self : _StridedLayout) -> tuple[int, int]: """ The memory offset range ``[min_offset, max_offset]`` (in element counts, not bytes) that elements of a tensor with this layout are mapped to. @@ -396,7 +403,7 @@ cdef class _StridedLayout: return min_offset, max_offset @property - def min_offset(self : _StridedLayout): + def min_offset(self : _StridedLayout) -> int: """ See :attr:`offset_bounds` for details. @@ -408,7 +415,7 @@ cdef class _StridedLayout: return min_offset @property - def max_offset(self : _StridedLayout): + def max_offset(self : _StridedLayout) -> int: """ See :attr:`offset_bounds` for details. @@ -420,7 +427,7 @@ cdef class _StridedLayout: return max_offset @property - def slice_offset_in_bytes(self : _StridedLayout): + def slice_offset_in_bytes(self : _StridedLayout) -> int: """ The memory offset (as a number of bytes) of the element at index ``(0,) * ndim``. Equal to :attr:`itemsize` ``*`` :attr:`slice_offset`. @@ -460,7 +467,7 @@ cdef class _StridedLayout: required_size = layout.required_size_in_bytes() # allocate the memory on the device device.set_current() - mem = device.allocate(required_size) + mem = device.allocate(required_size, stream=device.default_stream) # create a view on the newly allocated device memory b_view = StridedMemoryView.from_buffer(mem, layout, a_view.dtype) return b_view diff --git a/cuda_core/cuda/core/_linker.pxd b/cuda_core/cuda/core/_linker.pxd index e50ebb97705..1b7d39fd1d4 100644 --- a/cuda_core/cuda/core/_linker.pxd +++ b/cuda_core/cuda/core/_linker.pxd @@ -2,6 +2,10 @@ # # SPDX-License-Identifier: Apache-2.0 +from libcpp.vector cimport vector + +from cuda.bindings cimport cydriver + from ._resource_handles cimport NvJitLinkHandle, CuLinkHandle @@ -9,8 +13,12 @@ cdef class Linker: cdef: NvJitLinkHandle _nvjitlink_handle CuLinkHandle _culink_handle + # The driver retains these arrays until cuLinkDestroy. Declare them + # after the handle so their destructors run after cuLinkDestroy. + vector[cydriver.CUjit_option] _drv_jit_keys + vector[void*] _drv_jit_values bint _use_nvjitlink - object _drv_log_bufs # formatted_options list (driver); None for nvjitlink; cleared in link() + object _drv_log_bufs # formatted_options list (driver); None for nvjitlink str _info_log # decoded log; None until link() or pre-link get_*_log() str _error_log # decoded log; None until link() or pre-link get_*_log() object _options # LinkerOptions diff --git a/cuda_core/cuda/core/_linker.pyi b/cuda_core/cuda/core/_linker.pyi new file mode 100644 index 00000000000..37e05fc7fe6 --- /dev/null +++ b/cuda_core/cuda/core/_linker.pyi @@ -0,0 +1,251 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_linker.pyx + +"""Linking machinery for combining object codes. + +This module provides :class:`Linker` for linking one or more +:class:`~cuda.core.ObjectCode` objects, with :class:`LinkerOptions` for +configuration. +""" +from __future__ import annotations + +from dataclasses import dataclass +from typing import Union + +import cuda.bindings.driver +import cuda.bindings.nvjitlink +from cuda.core._module import ObjectCode +from cuda.core.typing import CompilerBackendType, ObjectCodeFormatType + + +class Linker: + """Represent a linking machinery to link one or more object codes into + :class:`~cuda.core.ObjectCode`. + + This object provides a unified interface to multiple underlying + linker libraries (such as nvJitLink or cuLink* from the CUDA driver). + + Parameters + ---------- + object_codes : :class:`~cuda.core.ObjectCode` + One or more ObjectCode objects to be linked. + options : :class:`LinkerOptions`, optional + Options for the linker. If not provided, default options will be used. + """ + + def __init__(self, options: LinkerOptions | None=None, *object_codes: ObjectCode): + ... + + def link(self, target_type: ObjectCodeFormatType | str) -> ObjectCode: + """Link the provided object codes into a single output of the specified target type. + + Parameters + ---------- + target_type : ObjectCodeFormatType | str + The type of the target output. Must be either "cubin" or "ptx". + + Returns + ------- + :class:`~cuda.core.ObjectCode` + The linked object code of the specified target type. + + .. note:: + + Ensure that input object codes were compiled with appropriate + flags for linking (e.g., relocatable device code enabled). + """ + + def get_error_log(self) -> str: + """Get the error log generated by the linker. + + Returns + ------- + str + The error log. + """ + + def get_info_log(self) -> str: + """Get the info log generated by the linker. + + Returns + ------- + str + The info log. + """ + + def close(self) -> None: + """Destroy this linker.""" + + @property + def handle(self) -> LinkerHandleT: + """Return the underlying handle object. + + .. note:: + + The type of the returned object depends on the backend. + + .. caution:: + + This handle is a Python object. To get the memory address of the underlying C + handle, call ``int(Linker.handle)``. + """ + + @classmethod + def which_backend(cls) -> CompilerBackendType: + """Return which linking backend will be used. + + Returns :attr:`~CompilerBackendType.NVJITLINK` when the nvJitLink + library is available and meets the minimum version requirement, + otherwise :attr:`~CompilerBackendType.DRIVER`. + + .. note:: + + Prefer letting :class:`Linker` decide. Query ``which_backend()`` + only when you need to dispatch based on input format (for + example: choose PTX vs. LTOIR before constructing a + ``Linker``). The returned value names an implementation + detail whose support matrix may shift across CTK releases. + """ + +@dataclass +class LinkerOptions: + """Customizable options for configuring :class:`Linker`. + + Since the linker may choose to use nvJitLink or the driver APIs as the linking backend, + not all options are applicable. When the system's installed nvJitLink is too old (<12.3), + not installed, or older than the CUDA driver major version, the driver APIs (cuLink) + will be used instead. + + Attributes + ---------- + name : str, optional + Name of the linker. If the linking succeeds, the name is passed down to the generated :class:`ObjectCode`. + arch : str, optional + Pass the SM architecture value, such as ``sm_`` (for generating CUBIN) or + ``compute_`` (for generating PTX). If not provided, the current device's architecture + will be used. + max_register_count : int, optional + Maximum register count. + time : bool, optional + Print timing information to the info log. + Default: False. + verbose : bool, optional + Print verbose messages to the info log. + Default: False. + link_time_optimization : bool, optional + Perform link time optimization. + Default: False. + ptx : bool, optional + Emit PTX after linking instead of CUBIN; only supported with ``link_time_optimization=True``. + Default: False. + optimization_level : int, optional + Set optimization level. Only 0 and 3 are accepted. + debug : bool, optional + Generate debug information. + Default: False. + lineinfo : bool, optional + Generate line information. + Default: False. + ftz : bool, optional + Flush denormal values to zero. + Default: False. + prec_div : bool, optional + Use precise division. + Default: True. + prec_sqrt : bool, optional + Use precise square root. + Default: True. + fma : bool, optional + Use fast multiply-add. + Default: True. + kernels_used : [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 : [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 : [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 + compilation (default). + Default: 1. + split_compile_extended : int, optional + A more aggressive form of split compilation available in LTO mode only. Accepts a maximum thread count value. + Use 0 to use all available processors. Value of 1 disables extended split compilation (default). Note: This + option can potentially impact performance of the compiled binary. + Default: 1. + no_cache : bool, optional + Do not cache the intermediate steps of nvJitLink. + Default: False. + """ + name: str | None = '' + arch: str | None = None + max_register_count: int | None = None + time: bool | None = None + verbose: bool | None = None + link_time_optimization: bool | None = None + ptx: bool | None = None + optimization_level: int | None = None + debug: bool | None = None + lineinfo: bool | None = None + ftz: bool | None = None + prec_div: bool | None = None + prec_sqrt: bool | None = None + fma: bool | None = None + kernels_used: str | tuple[str] | list[str] | None = None + variables_used: str | tuple[str] | list[str] | None = None + optimize_unused_variables: bool | None = None + ptxas_options: str | tuple[str] | list[str] | None = None + split_compile: int | None = None + split_compile_extended: int | None = None + no_cache: bool | None = None + numba_debug: bool | None = None + + def __post_init__(self) -> None: + ... + + def _prepare_nvjitlink_options(self, as_bytes: bool=False) -> list[bytes] | list[str]: + ... + + def _prepare_driver_options(self) -> tuple[list[object], list[object]]: + ... + + def as_bytes(self, backend: str='nvjitlink') -> list[bytes]: + """Convert linker options to bytes format for the nvjitlink backend. + + Parameters + ---------- + backend : str, optional + The linker backend. Only "nvjitlink" is supported. Default is "nvjitlink". + + Returns + ------- + list[bytes] + List of option strings encoded as bytes. + + Raises + ------ + ValueError + If an unsupported backend is specified. + RuntimeError + If nvJitLink backend is not available. + """ +_keep_driver_in_stub: 'cuda.bindings.driver.CUlinkState' +_keep_nvjitlink_in_stub: 'cuda.bindings.nvjitlink.nvJitLinkHandle' +__all__ = ['Linker', 'LinkerOptions'] +LinkerHandleT = Union['cuda.bindings.nvjitlink.nvJitLinkHandle', 'cuda.bindings.driver.CUlinkState'] +_driver = None +_inited = False +_use_nvjitlink_backend = None +_nvjitlink_input_types = None +_driver_input_types = None + +def _nvjitlink_has_version_symbol(nvjitlink) -> bool: + ... + +def _decide_nvjitlink_or_driver() -> bool: + """Return True if falling back to the cuLink* driver APIs.""" + +def _lazy_init() -> None: + ... \ No newline at end of file diff --git a/cuda_core/cuda/core/_linker.pyx b/cuda_core/cuda/core/_linker.pyx index ce7c6e4528b..172b176c844 100644 --- a/cuda_core/cuda/core/_linker.pyx +++ b/cuda_core/cuda/core/_linker.pyx @@ -26,7 +26,7 @@ from cuda.core._utils.cuda_utils cimport HANDLE_RETURN, HANDLE_RETURN_NVJITLINK import sys from dataclasses import dataclass -from typing import Union +from typing import TYPE_CHECKING, Union from warnings import warn from cuda.pathfinder._optional_cuda_import import _optional_cuda_import @@ -37,12 +37,22 @@ from cuda.core._utils.cuda_utils import ( CUDAError, check_or_create_options, driver, - handle_return, is_sequence, ) +from cuda.core._utils.version import driver_version +from cuda.core.typing import CompilerBackendType, ObjectCodeFormatType + +if TYPE_CHECKING: + import cuda.bindings.driver # no-cython-lint + import cuda.bindings.nvjitlink # no-cython-lint + +# Module-level annotations to ensure stubgen-pyx keeps the above imports in +# the generated `.pyi` so that the LinkerHandleT forward references resolve. +# These names are not assigned, so they only affect __annotations__. +_keep_driver_in_stub: "cuda.bindings.driver.CUlinkState" +_keep_nvjitlink_in_stub: "cuda.bindings.nvjitlink.nvJitLinkHandle" ctypedef const char* const_char_ptr -ctypedef void* void_ptr __all__ = ["Linker", "LinkerOptions"] @@ -68,15 +78,15 @@ cdef class Linker: Options for the linker. If not provided, default options will be used. """ - def __init__(self, *object_codes: ObjectCode, options: LinkerOptions = None): + def __init__(self, *object_codes: ObjectCode, options: LinkerOptions | None = None): Linker_init(self, object_codes, options) - def link(self, target_type) -> ObjectCode: + def link(self, target_type: ObjectCodeFormatType | str) -> ObjectCode: """Link the provided object codes into a single output of the specified target type. Parameters ---------- - target_type : str + target_type : ObjectCodeFormatType | str The type of the target output. Must be either "cubin" or "ptx". Returns @@ -89,7 +99,7 @@ cdef class Linker: Ensure that input object codes were compiled with appropriate flags for linking (e.g., relocatable device code enabled). """ - return Linker_link(self, target_type) + return Linker_link(self, str(target_type)) def get_error_log(self) -> str: """Get the error log generated by the linker. @@ -107,11 +117,11 @@ cdef class Linker: cdef char* c_log_ptr if self._use_nvjitlink: c_h = as_cu(self._nvjitlink_handle) - cynvjitlink.nvJitLinkGetErrorLogSize(c_h, &c_log_size) + HANDLE_RETURN_NVJITLINK(c_h, cynvjitlink.nvJitLinkGetErrorLogSize(c_h, &c_log_size)) log = bytearray(c_log_size) if c_log_size > 0: c_log_ptr = (log) - cynvjitlink.nvJitLinkGetErrorLog(c_h, c_log_ptr) + HANDLE_RETURN_NVJITLINK(c_h, cynvjitlink.nvJitLinkGetErrorLog(c_h, c_log_ptr)) return log.decode("utf-8", errors="backslashreplace") else: return (self._drv_log_bufs[2]).decode( @@ -133,22 +143,33 @@ cdef class Linker: cdef char* c_log_ptr if self._use_nvjitlink: c_h = as_cu(self._nvjitlink_handle) - cynvjitlink.nvJitLinkGetInfoLogSize(c_h, &c_log_size) + HANDLE_RETURN_NVJITLINK(c_h, cynvjitlink.nvJitLinkGetInfoLogSize(c_h, &c_log_size)) log = bytearray(c_log_size) if c_log_size > 0: c_log_ptr = (log) - cynvjitlink.nvJitLinkGetInfoLog(c_h, c_log_ptr) + HANDLE_RETURN_NVJITLINK(c_h, cynvjitlink.nvJitLinkGetInfoLog(c_h, c_log_ptr)) return log.decode("utf-8", errors="backslashreplace") else: return (self._drv_log_bufs[0]).decode( "utf-8", errors="backslashreplace").rstrip('\x00') - def close(self): + def close(self) -> None: """Destroy this linker.""" + cdef vector[cydriver.CUjit_option] empty_keys + cdef vector[void*] empty_values if self._use_nvjitlink: self._nvjitlink_handle.reset() else: + if self._drv_log_bufs is not None: + if self._info_log is None: + self._info_log = self.get_info_log() + if self._error_log is None: + self._error_log = self.get_error_log() + # Destroy the CUlinkState before releasing storage referenced by it. self._culink_handle.reset() + self._drv_jit_keys.swap(empty_keys) + self._drv_jit_values.swap(empty_values) + self._drv_log_bufs = None @property def handle(self) -> LinkerHandleT: @@ -168,10 +189,23 @@ cdef class Linker: else: return as_py(self._culink_handle) - @property - def backend(self) -> str: - """Return this Linker instance's underlying backend.""" - return "nvJitLink" if self._use_nvjitlink else "driver" + @classmethod + def which_backend(cls) -> CompilerBackendType: + """Return which linking backend will be used. + + Returns :attr:`~CompilerBackendType.NVJITLINK` when the nvJitLink + library is available and meets the minimum version requirement, + otherwise :attr:`~CompilerBackendType.DRIVER`. + + .. note:: + + Prefer letting :class:`Linker` decide. Query ``which_backend()`` + only when you need to dispatch based on input format (for + example: choose PTX vs. LTOIR before constructing a + ``Linker``). The returned value names an implementation + detail whose support matrix may shift across CTK releases. + """ + return CompilerBackendType.DRIVER if _decide_nvjitlink_or_driver() else CompilerBackendType.NVJITLINK # ============================================================================= @@ -184,12 +218,13 @@ class LinkerOptions: Since the linker may choose to use nvJitLink or the driver APIs as the linking backend, not all options are applicable. When the system's installed nvJitLink is too old (<12.3), - or not installed, the driver APIs (cuLink) will be used instead. + not installed, or older than the CUDA driver major version, the driver APIs (cuLink) + will be used instead. Attributes ---------- name : str, optional - Name of the linker. If the linking succeeds, the name is passed down to the generated `ObjectCode`. + Name of the linker. If the linking succeeds, the name is passed down to the generated :class:`ObjectCode`. arch : str, optional Pass the SM architecture value, such as ``sm_`` (for generating CUBIN) or ``compute_`` (for generating PTX). If not provided, the current device's architecture @@ -272,8 +307,9 @@ class LinkerOptions: split_compile: int | None = None split_compile_extended: int | None = None no_cache: bool | None = None + numba_debug: bool | None = None - def __post_init__(self): + def __post_init__(self) -> None: _lazy_init() self._name = self.name.encode() @@ -340,7 +376,7 @@ class LinkerOptions: else: return options - def _prepare_driver_options(self) -> tuple[list, list]: + def _prepare_driver_options(self) -> tuple[list[object], list[object]]: formatted_options = [] option_keys = [] @@ -449,8 +485,8 @@ cdef inline int Linker_init(Linker self, tuple object_codes, object options) exc cdef cydriver.CUlinkState c_raw_culink cdef Py_ssize_t c_num_opts, i cdef vector[const_char_ptr] c_str_opts - cdef vector[cydriver.CUjit_option] c_jit_keys - cdef vector[void_ptr] c_jit_values + cdef cydriver.CUjit_option* c_drv_jit_keys_ptr + cdef void** c_drv_jit_values_ptr self._options = options = check_or_create_options(LinkerOptions, options, "Linker options") @@ -472,19 +508,24 @@ cdef inline int Linker_init(Linker self, tuple object_codes, object options) exc # the driver writes into via raw pointers during linking operations. self._drv_log_bufs = formatted_options c_num_opts = len(option_keys) - c_jit_keys.resize(c_num_opts) - c_jit_values.resize(c_num_opts) + self._drv_jit_keys.resize(c_num_opts) + self._drv_jit_values.resize(c_num_opts) for i in range(c_num_opts): - c_jit_keys[i] = option_keys[i] + self._drv_jit_keys[i] = option_keys[i] val = formatted_options[i] if isinstance(val, bytearray): - c_jit_values[i] = PyByteArray_AS_STRING(val) + self._drv_jit_values[i] = PyByteArray_AS_STRING(val) else: - c_jit_values[i] = int(val) + self._drv_jit_values[i] = int(val) + c_drv_jit_keys_ptr = self._drv_jit_keys.data() + c_drv_jit_values_ptr = self._drv_jit_values.data() try: with nogil: HANDLE_RETURN(cydriver.cuLinkCreate( - c_num_opts, c_jit_keys.data(), c_jit_values.data(), &c_raw_culink)) + c_num_opts, + c_drv_jit_keys_ptr, + c_drv_jit_values_ptr, + &c_raw_culink)) except CUDAError as e: Linker_annotate_error_log(self, e) raise @@ -598,11 +639,10 @@ cdef inline object Linker_link(Linker self, str target_type): raise code = (c_cubin_out)[:c_output_size] - # Linking is complete; cache the decoded log strings and release - # the driver's raw bytearray buffers (no longer written to). + # Linking is complete; cache the decoded logs. cuLinkDestroy may still + # dereference the raw log-buffer pointers, so retain them until close(). self._info_log = self.get_info_log() self._error_log = self.get_error_log() - self._drv_log_bufs = None return ObjectCode._init(bytes(code), target_type, name=self._options.name) @@ -620,9 +660,8 @@ cdef inline void Linker_annotate_error_log(Linker self, object e): # TODO: revisit this treatment for py313t builds _driver = None # populated if nvJitLink cannot be used -_driver_ver = None _inited = False -_use_nvjitlink_backend = False # set by _decide_nvjitlink_or_driver() +_use_nvjitlink_backend = None # set by _decide_nvjitlink_or_driver() # Input type mappings populated by _lazy_init() with C-level enum ints. _nvjitlink_input_types = None @@ -637,13 +676,10 @@ def _nvjitlink_has_version_symbol(nvjitlink) -> bool: # Note: this function is reused in the tests def _decide_nvjitlink_or_driver() -> bool: """Return True if falling back to the cuLink* driver APIs.""" - global _driver_ver, _driver, _use_nvjitlink_backend - if _driver_ver is not None: + global _driver, _use_nvjitlink_backend + if _use_nvjitlink_backend is not None: return not _use_nvjitlink_backend - _driver_ver = handle_return(driver.cuDriverGetVersion()) - _driver_ver = (_driver_ver // 1000, (_driver_ver % 1000) // 10) - warn_txt_common = ( "the driver APIs will be used instead, which do not support" " minor version compatibility or linking LTO IRs." @@ -660,19 +696,30 @@ def _decide_nvjitlink_or_driver() -> bool: from cuda.bindings._internal import nvjitlink if _nvjitlink_has_version_symbol(nvjitlink): - _use_nvjitlink_backend = True - return False # Use nvjitlink - warn_txt = ( - f"{'nvJitLink*.dll' if sys.platform == 'win32' else 'libnvJitLink.so*'} is too old (<12.3)." - f" Therefore cuda.bindings.nvjitlink is not usable and {warn_txt_common} nvJitLink." - ) + nvjitlink_version = nvjitlink_module.version() + driver_major = driver_version()[0] + if driver_major <= nvjitlink_version[0]: + _use_nvjitlink_backend = True + return False # Use nvjitlink + + warn_txt = ( + f"CUDA driver major version {driver_major} is newer than " + f"nvJitLink major version {nvjitlink_version[0]}; therefore " + f"{warn_txt_common} nvJitLink." + ) + else: + warn_txt = ( + f"{'nvJitLink*.dll' if sys.platform == 'win32' else 'libnvJitLink.so*'} is too old (<12.3)." + f" Therefore cuda.bindings.nvjitlink is not usable and {warn_txt_common} nvJitLink." + ) warn(warn_txt, stacklevel=2, category=RuntimeWarning) + _use_nvjitlink_backend = False _driver = driver return True -def _lazy_init(): +def _lazy_init() -> None: global _inited, _nvjitlink_input_types, _driver_input_types if _inited: return diff --git a/cuda_core/cuda/core/_memory/__init__.py b/cuda_core/cuda/core/_memory/__init__.py index 068a6526b7a..bf40a643f8c 100644 --- a/cuda_core/cuda/core/_memory/__init__.py +++ b/cuda_core/cuda/core/_memory/__init__.py @@ -7,6 +7,7 @@ from ._graph_memory_resource import * from ._ipc import * from ._legacy import * +from ._managed_buffer import ManagedBuffer from ._managed_memory_resource import * from ._pinned_memory_resource import * from ._virtual_memory_resource import * diff --git a/cuda_core/cuda/core/_memory/_buffer.pxd b/cuda_core/cuda/core/_memory/_buffer.pxd index 91c0cfe24af..b552e69554d 100644 --- a/cuda_core/cuda/core/_memory/_buffer.pxd +++ b/cuda_core/cuda/core/_memory/_buffer.pxd @@ -1,39 +1,46 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 -from libc.stdint cimport uintptr_t +from libcpp cimport bool as cpp_bool +from libcpp.atomic cimport atomic as std_atomic from cuda.core._resource_handles cimport DevicePtrHandle -from cuda.core._stream cimport Stream cdef struct _MemAttrs: int device_id bint is_device_accessible bint is_host_accessible + bint is_managed cdef class Buffer: cdef: - DevicePtrHandle _h_ptr + DevicePtrHandle _h_ptr + MemoryResource _memory_resource + object _ipc_data + object _owner + _MemAttrs _mem_attrs + std_atomic[cpp_bool] _mem_attrs_inited + object __weakref__ + cdef public: + # Python code in _memory/_virtual_memory_resource.py needs to update + # this value, though it is technically private. size_t _size - MemoryResource _memory_resource - object _ipc_data - object _owner - _MemAttrs _mem_attrs - bint _mem_attrs_inited - object __weakref__ cdef class MemoryResource: pass -# Helper function to create a Buffer from a DevicePtrHandle +# Helper function to create a Buffer from a DevicePtrHandle. +# `cls` lets callers materialize Buffer subclasses (e.g. ManagedBuffer for +# managed-memory allocations); defaults to Buffer. cdef Buffer Buffer_from_deviceptr_handle( DevicePtrHandle h_ptr, size_t size, MemoryResource mr, - object ipc_descriptor = * + object ipc_descriptor = *, + type cls = *, ) diff --git a/cuda_core/cuda/core/_memory/_buffer.pyi b/cuda_core/cuda/core/_memory/_buffer.pyi new file mode 100644 index 00000000000..1d824cf6fc0 --- /dev/null +++ b/cuda_core/cuda/core/_memory/_buffer.pyi @@ -0,0 +1,306 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_memory/_buffer.pyx + +from __future__ import annotations + +import cython +from cuda.core._memory._device_memory_resource import DeviceMemoryResource +from cuda.core._memory._ipc import IPCBufferDescriptor +from cuda.core._memory._pinned_memory_resource import PinnedMemoryResource +from cuda.core._stream import Stream +from cuda.core._utils.pycompat import BufferProtocol +from cuda.core.graph import GraphBuilder +from cuda.core.typing import DevicePointerType + + +class Buffer: + """Represent a handle to allocated memory. + + This generic object provides a unified representation for how + different memory resources are to give access to their memory + allocations. + + Support for data interchange mechanisms are provided by DLPack. + + Note + ---- + Pickling an IPC-enabled :class:`Buffer` embeds an + :class:`~_memory.IPCBufferDescriptor`. Unpickling reconstructs the buffer + by calling :meth:`from_ipc_descriptor` and therefore performs an IPC + import. Do not unpickle buffers from untrusted sources. + """ + + def __cinit__(self) -> None: + ... + + def _clear(self) -> None: + ... + + def __init__(self, *args, **kwargs) -> None: + ... + + @classmethod + def _init(cls, ptr: DevicePointerType, size: int, mr: MemoryResource | None=None, ipc_descriptor: IPCBufferDescriptor | None=None, owner: object | None=None) -> Buffer: + """Create a Buffer from a raw pointer. + + When ``mr`` is provided, the buffer takes ownership: ``mr.deallocate()`` + is called when the buffer is closed or garbage collected. When ``owner`` + is provided, the owner is kept alive but no deallocation is performed. + """ + + @staticmethod + def _reduce_helper(mr, ipc_descriptor): + ... + + def __reduce__(self) -> tuple[object, ...]: + ... + + @staticmethod + def from_handle(ptr: DevicePointerType, size: int, mr: MemoryResource | None=None, owner: object | None=None) -> Buffer: + """Create a new :class:`Buffer` object from a pointer. + + Parameters + ---------- + ptr : :obj:`~_memory.DevicePointerType` + Allocated buffer handle object + size : int + Memory size of the buffer + mr : :obj:`~_memory.MemoryResource`, optional + Memory resource associated with the buffer. When provided, + :meth:`MemoryResource.deallocate` is called when the buffer is + closed or garbage collected. + owner : object, optional + An object holding external allocation that the ``ptr`` points to. + The reference is kept as long as the buffer is alive. + The ``owner`` and ``mr`` cannot be specified together. + + Note + ---- + When neither ``mr`` nor ``owner`` is specified, this creates a + non-owning reference. The pointer will NOT be freed when the + :class:`Buffer` is closed or garbage collected. + """ + + @classmethod + def from_ipc_descriptor(cls, mr: DeviceMemoryResource | PinnedMemoryResource, ipc_descriptor: IPCBufferDescriptor, *, stream: Stream) -> Buffer: + """Import a buffer that was exported from another process. + + Parameters + ---------- + mr : :obj:`~_memory.DeviceMemoryResource` | :obj:`~_memory.PinnedMemoryResource` + The IPC-enabled memory resource matching the exporting process. + ipc_descriptor : :obj:`~_memory.IPCBufferDescriptor` + The descriptor exported from another process. + stream : :obj:`~_stream.Stream` + Keyword-only. The stream used for asynchronous deallocation when + the buffer is closed or garbage collected. + + Note + ---- + The descriptor payload and ``size`` are supplied by the exporting peer + and must be treated as untrusted input unless the peer is known to be + cooperating. + """ + + @property + @cython.critical_section + def ipc_descriptor(self) -> IPCBufferDescriptor: + """Descriptor for sharing this buffer with other processes.""" + + def close(self, stream: Stream | GraphBuilder | None=None) -> None: + """Deallocate this buffer asynchronously on the given stream. + + This buffer is released back to their memory resource + asynchronously on the given stream. + + Parameters + ---------- + stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder`, optional + The stream object to use for asynchronous deallocation. If None, + the deallocation stream stored in the handle is used. + """ + + def __enter__(self): + ... + + def __exit__(self, exc_type, exc_val, exc_tb): + ... + + def copy_to(self, dst: Buffer | None=None, *, stream: Stream | GraphBuilder) -> Buffer: + """Copy from this buffer to the dst buffer asynchronously on the given stream. + + Copies the data from this buffer to the provided dst buffer. + If the dst buffer is not provided, then a new buffer is first + allocated using the associated memory resource before the copy. + + Parameters + ---------- + dst : :obj:`~_memory.Buffer`, optional + Destination buffer to copy data to. If not provided, a new buffer + is allocated using this buffer's memory resource. + stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` + Keyword argument specifying the stream for the + asynchronous copy + + """ + + def copy_from(self, src: Buffer, *, stream: Stream | GraphBuilder) -> None: + """Copy from the src buffer to this buffer asynchronously on the given stream. + + Parameters + ---------- + src : :obj:`~_memory.Buffer` + Source buffer to copy data from + stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` + Keyword argument specifying the stream for the + asynchronous copy + + """ + + def fill(self, value: int | BufferProtocol, *, stream: Stream | GraphBuilder) -> None: + """Fill this buffer with a repeating byte pattern. + + Parameters + ---------- + value : int | :obj:`collections.abc.Buffer` + - int: Must be in range [0, 256). Converted to 1 byte. + - :obj:`collections.abc.Buffer`: Must be 1, 2, or 4 bytes. + stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` + Stream for the asynchronous fill operation. + + Raises + ------ + TypeError + If value is not an int and does not support the buffer protocol. + ValueError + If value byte length is not 1, 2, or 4. + If buffer size is not divisible by value byte length. + OverflowError + If int value is outside [0, 256). + + """ + + def __dlpack__(self, *, stream: int | None=None, max_version: tuple[int, int] | None=None, dl_device: tuple[int, int] | None=None, copy: bool | None=None) -> object: + ... + + def __dlpack_device__(self) -> tuple[int, int]: + ... + + def __buffer__(self, flags: int, /) -> memoryview: + ... + + def __release_buffer__(self, buffer: memoryview, /) -> None: + ... + + @property + def device_id(self) -> int: + """Return the device ordinal of this buffer.""" + + @property + def handle(self) -> int: + """Return the buffer handle object. + + .. caution:: + + This handle is a Python object. To get the memory address of the underlying C + handle, call ``int(Buffer.handle)``. + """ + + def __eq__(self, other: object) -> bool: + ... + + def __hash__(self) -> int: + ... + + def __repr__(self) -> str: + ... + + @property + def is_device_accessible(self) -> bool: + """Return True if this buffer can be accessed by the GPU, otherwise False.""" + + @property + def is_host_accessible(self) -> bool: + """Return True if this buffer can be accessed by the CPU, otherwise False.""" + + @property + def is_managed(self) -> bool: + """Return True if this buffer is CUDA managed (unified) memory, otherwise False.""" + + @property + def is_mapped(self) -> bool: + """Return True if this buffer is mapped into the process via IPC.""" + + @property + def memory_resource(self) -> MemoryResource: + """Return the memory resource associated with this buffer.""" + + @property + def size(self) -> int: + """Return the memory size of this buffer.""" + + @property + def owner(self) -> object: + """Return the object holding external allocation.""" + +class MemoryResource: + """Abstract base class for memory resources that manage allocation and + deallocation of buffers. + + Subclasses must implement methods for allocating and deallocation, as well + as properties associated with this memory resource from which all allocated + buffers will inherit. (Since all :class:`Buffer` instances allocated and + returned by the :meth:`allocate` method would hold a reference to self, the + buffer properties are retrieved simply by looking up the underlying memory + resource's respective property.) + """ + + def allocate(self, size: int, *, stream: Stream | GraphBuilder) -> Buffer: + """Allocate a buffer of the requested size. + + Parameters + ---------- + size : int + The size of the buffer to allocate, in bytes. + stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` + Keyword-only. The stream on which to perform the allocation + asynchronously. Must be passed explicitly; pass + ``device.default_stream`` to use the default stream. + + Returns + ------- + Buffer + The allocated buffer object, which can be used for device or host operations + depending on the resource's properties. + """ + + def deallocate(self, ptr: DevicePointerType, size: int, *, stream: Stream | GraphBuilder) -> None: + """Deallocate a buffer previously allocated by this resource. + + Parameters + ---------- + ptr : :obj:`~_memory.DevicePointerType` + The pointer or handle to the buffer to deallocate. + size : int + The size of the buffer to deallocate, in bytes. + stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` + Keyword-only. The stream on which to perform the deallocation + asynchronously. Must be passed explicitly; pass + ``device.default_stream`` to use the default stream. + """ + + @property + def is_device_accessible(self) -> bool: + """Whether buffers allocated by this resource are device-accessible.""" + + @property + def is_host_accessible(self) -> bool: + """Whether buffers allocated by this resource are host-accessible.""" + + @property + def is_managed(self) -> bool: + """Whether buffers allocated by this resource are CUDA managed (unified) memory.""" + + @property + def device_id(self) -> int: + """Device ID associated with this memory resource, or -1 if not applicable.""" +__all__ = ['Buffer', 'MemoryResource'] \ No newline at end of file diff --git a/cuda_core/cuda/core/_memory/_buffer.pyx b/cuda_core/cuda/core/_memory/_buffer.pyx index 83009f74aed..97ef892547d 100644 --- a/cuda_core/cuda/core/_memory/_buffer.pyx +++ b/cuda_core/cuda/core/_memory/_buffer.pyx @@ -5,8 +5,8 @@ from __future__ import annotations cimport cython -from libc.stdint cimport uint8_t, uint16_t, uint32_t, uintptr_t -from cpython.buffer cimport PyObject_GetBuffer, PyBuffer_Release, Py_buffer, PyBUF_SIMPLE +from libc.stdint cimport uintptr_t +from libcpp.atomic cimport memory_order_acquire, memory_order_release from cuda.bindings cimport cydriver from cuda.core._memory._device_memory_resource import DeviceMemoryResource @@ -23,22 +23,21 @@ from cuda.core._resource_handles cimport ( as_cu, set_deallocation_stream, ) +from cuda.core.typing import DevicePointerType -from cuda.core._stream cimport Stream, Stream_accept -from cuda.core._utils.cuda_utils cimport HANDLE_RETURN +from cuda.core._stream cimport Stream, Stream_accept, default_stream +from cuda.core._utils.cuda_utils cimport HANDLE_RETURN, _parse_fill_value import sys -from typing import TypeVar +from typing import TYPE_CHECKING -if sys.version_info >= (3, 12): - from collections.abc import Buffer as BufferProtocol -else: - BufferProtocol = object - -from cuda.core._dlpack import DLDeviceType, make_py_capsule -from cuda.core._utils.cuda_utils import driver +from cuda.core._utils.pycompat import BufferProtocol +from cuda.core._dlpack import classify_dl_device, make_py_capsule from cuda.core._device import Device +if TYPE_CHECKING: + from cuda.core.graph import GraphBuilder + # ============================================================================= # MR deallocation callback (invoked from C++ shared_ptr deleter) @@ -50,12 +49,24 @@ cdef void _mr_dealloc_callback( size_t size, const StreamHandle& h_stream, ) noexcept: - """Called by the C++ deleter to deallocate via MemoryResource.deallocate.""" + """Called by the C++ deleter to deallocate via MemoryResource.deallocate. + + This is the C++ teardown path: there is no Python caller frame from + which to obtain a stream. If the device-pointer handle was created + without ``set_deallocation_stream`` being called (e.g. buffers minted + via ``Buffer.from_handle(ptr, size, mr=mr)`` from DLPack import, + third-party adapters, or other foreign sources), ``h_stream`` is + empty here. Stream-ordered MR ``deallocate`` overrides reject + ``stream=None`` (issue #2001), so without a fallback the destructor + would print a warning and leak the allocation. Fall back to the + legacy/per-thread default stream so the free still happens; this is + the unique exception to the "no implicit default-stream fallback" + policy because the teardown has no other source of truth. + """ + cdef Stream stream try: - stream = None - if h_stream: - stream = Stream._from_handle(Stream, h_stream) - mr.deallocate(int(ptr), size, stream) + stream = Stream._from_handle(Stream, h_stream) if h_stream else default_stream() + mr.deallocate(int(ptr), size, stream=stream) except Exception as exc: print(f"Warning: mr.deallocate() failed during Buffer destruction: {exc}", file=sys.stderr) @@ -66,11 +77,69 @@ register_mr_dealloc_callback(_mr_dealloc_callback) __all__ = ['Buffer', 'MemoryResource'] -DevicePointerT = driver.CUdeviceptr | int | None -""" -A type union of :obj:`~driver.CUdeviceptr`, `int` and `None` for hinting -:attr:`Buffer.handle`. -""" +# Memory Attribute Query Helpers +# ------------------------------ +cdef inline int _query_memory_attrs( + _MemAttrs& out, + cydriver.CUdeviceptr ptr +) except -1 nogil: + """Query memory attributes for a device pointer.""" + cdef unsigned int memory_type = 0 + cdef int is_managed = 0 + cdef int device_id = 0 + cdef cydriver.CUpointer_attribute[3] attrs = [ + cydriver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_MEMORY_TYPE, + cydriver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_IS_MANAGED, + cydriver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL, + ] + cdef uintptr_t[3] vals = [ + &memory_type, + &is_managed, + &device_id, + ] + + cdef cydriver.CUresult ret + ret = cydriver.cuPointerGetAttributes(3, attrs, vals, ptr) + if ret == cydriver.CUresult.CUDA_ERROR_NOT_INITIALIZED: + with cython.gil: + # Device class handles the cuInit call internally + Device() + ret = cydriver.cuPointerGetAttributes(3, attrs, vals, ptr) + HANDLE_RETURN(ret) + + # TODO: HMM/ATS-enabled sysmem should also report is_managed=True; the + # CU_POINTER_ATTRIBUTE_IS_MANAGED query does not capture that yet. + out.is_managed = is_managed != 0 + + if memory_type == 0: + # unregistered host pointer + out.is_host_accessible = True + out.is_device_accessible = False + out.device_id = -1 + elif ( + is_managed + or memory_type == cydriver.CUmemorytype.CU_MEMORYTYPE_HOST + ): + # Managed memory or pinned host memory + out.is_host_accessible = True + out.is_device_accessible = True + out.device_id = device_id + elif memory_type == cydriver.CUmemorytype.CU_MEMORYTYPE_DEVICE: + out.is_host_accessible = False + out.is_device_accessible = True + out.device_id = device_id + else: + with cython.gil: + raise ValueError(f"Unsupported memory type: {memory_type}") + return 0 + + +cdef inline void _init_memory_attrs(Buffer self): + """Initialize memory attributes by querying the pointer.""" + if not self._mem_attrs_inited.load(memory_order_acquire): + _query_memory_attrs(self._mem_attrs, as_cu(self._h_ptr)) + self._mem_attrs_inited.store(True, memory_order_release) + cdef class Buffer: """Represent a handle to allocated memory. @@ -80,28 +149,35 @@ cdef class Buffer: allocations. Support for data interchange mechanisms are provided by DLPack. + + Note + ---- + Pickling an IPC-enabled :class:`Buffer` embeds an + :class:`~_memory.IPCBufferDescriptor`. Unpickling reconstructs the buffer + by calling :meth:`from_ipc_descriptor` and therefore performs an IPC + import. Do not unpickle buffers from untrusted sources. """ - def __cinit__(self): + def __cinit__(self) -> None: self._clear() - def _clear(self): + def _clear(self) -> None: self._h_ptr.reset() # Release the handle self._size = 0 self._memory_resource = None self._ipc_data = None self._owner = None - self._mem_attrs_inited = False + self._mem_attrs_inited.store(False) - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: raise RuntimeError("Buffer objects cannot be instantiated directly. " "Please use MemoryResource APIs.") @classmethod def _init( - cls, ptr: DevicePointerT, size_t size, mr: MemoryResource | None = None, + cls, ptr: DevicePointerType, size_t size, mr: MemoryResource | None = None, ipc_descriptor: IPCBufferDescriptor | None = None, owner : object | None = None - ): + ) -> Buffer: """Create a Buffer from a raw pointer. When ``mr`` is provided, the buffer takes ownership: ``mr.deallocate()`` @@ -120,27 +196,33 @@ cdef class Buffer: self._memory_resource = mr self._ipc_data = IPCDataForBuffer(ipc_descriptor, True) if ipc_descriptor is not None else None self._owner = owner - self._mem_attrs_inited = False + self._mem_attrs_inited.store(False) return self @staticmethod def _reduce_helper(mr, ipc_descriptor): - return Buffer.from_ipc_descriptor(mr, ipc_descriptor) - - def __reduce__(self): + # The parent process's stream is not portable across processes, so the + # pickle path cannot thread an explicit stream through. Seed the + # imported buffer's deallocation with the current context's default + # stream; the receiver can override via buffer.close(stream). + return Buffer.from_ipc_descriptor(mr, ipc_descriptor, stream=default_stream()) + + def __reduce__(self) -> tuple[object, ...]: + # Unpickling performs a live CUDA IPC import from descriptor bytes in the + # pickle stream. Only deserialize Buffers from a trusted principal. # Must not serialize the parent's stream! - return Buffer._reduce_helper, (self.memory_resource, self.get_ipc_descriptor()) + return Buffer._reduce_helper, (self.memory_resource, self.ipc_descriptor) @staticmethod def from_handle( - ptr: DevicePointerT, size_t size, mr: MemoryResource | None = None, + ptr: DevicePointerType, size_t size, mr: MemoryResource | None = None, owner: object | None = None, ) -> Buffer: """Create a new :class:`Buffer` object from a pointer. Parameters ---------- - ptr : :obj:`~_memory.DevicePointerT` + ptr : :obj:`~_memory.DevicePointerType` Allocated buffer handle object size : int Memory size of the buffer @@ -164,18 +246,37 @@ cdef class Buffer: @classmethod def from_ipc_descriptor( cls, mr: DeviceMemoryResource | PinnedMemoryResource, ipc_descriptor: IPCBufferDescriptor, - stream: Stream = None + *, stream: Stream ) -> Buffer: - """Import a buffer that was exported from another process.""" + """Import a buffer that was exported from another process. + + Parameters + ---------- + mr : :obj:`~_memory.DeviceMemoryResource` | :obj:`~_memory.PinnedMemoryResource` + The IPC-enabled memory resource matching the exporting process. + ipc_descriptor : :obj:`~_memory.IPCBufferDescriptor` + The descriptor exported from another process. + stream : :obj:`~_stream.Stream` + Keyword-only. The stream used for asynchronous deallocation when + the buffer is closed or garbage collected. + + Note + ---- + The descriptor payload and ``size`` are supplied by the exporting peer + and must be treated as untrusted input unless the peer is known to be + cooperating. + """ return _ipc.Buffer_from_ipc_descriptor(cls, mr, ipc_descriptor, stream) - def get_ipc_descriptor(self) -> IPCBufferDescriptor: - """Export a buffer allocated for sharing between processes.""" + @property + @cython.critical_section + def ipc_descriptor(self) -> IPCBufferDescriptor: + """Descriptor for sharing this buffer with other processes.""" if self._ipc_data is None: self._ipc_data = IPCDataForBuffer(_ipc.Buffer_get_ipc_descriptor(self), False) return self._ipc_data.ipc_descriptor - def close(self, stream: Stream | GraphBuilder | None = None): + def close(self, stream: Stream | GraphBuilder | None = None) -> None: """Deallocate this buffer asynchronously on the given stream. This buffer is released back to their memory resource @@ -183,13 +284,20 @@ cdef class Buffer: Parameters ---------- - stream : :obj:`~_stream.Stream` | :obj:`~_graph.GraphBuilder`, optional + stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder`, optional The stream object to use for asynchronous deallocation. If None, the deallocation stream stored in the handle is used. """ Buffer_close(self, stream) - def copy_to(self, dst: Buffer = None, *, stream: Stream | GraphBuilder) -> Buffer: + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + self.close() + return False + + def copy_to(self, dst: Buffer | None = None, *, stream: Stream | GraphBuilder) -> Buffer: """Copy from this buffer to the dst buffer asynchronously on the given stream. Copies the data from this buffer to the provided dst buffer. @@ -198,9 +306,10 @@ cdef class Buffer: Parameters ---------- - dst : :obj:`~_memory.Buffer` - Source buffer to copy data from - stream : :obj:`~_stream.Stream` | :obj:`~_graph.GraphBuilder` + dst : :obj:`~_memory.Buffer`, optional + Destination buffer to copy data to. If not provided, a new buffer + is allocated using this buffer's memory resource. + stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` Keyword argument specifying the stream for the asynchronous copy @@ -212,7 +321,7 @@ cdef class Buffer: if self._memory_resource is None: raise ValueError("a destination buffer must be provided (this " "buffer does not have a memory_resource)") - dst = self._memory_resource.allocate(src_size, s) + dst = self._memory_resource.allocate(src_size, stream=s) cdef size_t dst_size = dst._size if dst_size != src_size: @@ -224,14 +333,14 @@ cdef class Buffer: as_cu(dst._h_ptr), as_cu(self._h_ptr), src_size, as_cu(s._h_stream))) return dst - def copy_from(self, src: Buffer, *, stream: Stream | GraphBuilder): + def copy_from(self, src: Buffer, *, stream: Stream | GraphBuilder) -> None: """Copy from the src buffer to this buffer asynchronously on the given stream. Parameters ---------- src : :obj:`~_memory.Buffer` Source buffer to copy data from - stream : :obj:`~_stream.Stream` | :obj:`~_graph.GraphBuilder` + stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` Keyword argument specifying the stream for the asynchronous copy @@ -248,7 +357,7 @@ cdef class Buffer: HANDLE_RETURN(cydriver.cuMemcpyAsync( as_cu(self._h_ptr), as_cu(src._h_ptr), dst_size, as_cu(s._h_stream))) - def fill(self, value: int | BufferProtocol, *, stream: Stream | GraphBuilder): + def fill(self, value: int | BufferProtocol, *, stream: Stream | GraphBuilder) -> None: """Fill this buffer with a repeating byte pattern. Parameters @@ -256,7 +365,7 @@ cdef class Buffer: value : int | :obj:`collections.abc.Buffer` - int: Must be in range [0, 256). Converted to 1 byte. - :obj:`collections.abc.Buffer`: Must be 1, 2, or 4 bytes. - stream : :obj:`~_stream.Stream` | :obj:`~_graph.GraphBuilder` + stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` Stream for the asynchronous fill operation. Raises @@ -271,27 +380,27 @@ cdef class Buffer: """ cdef Stream s_stream = Stream_accept(stream) - - # Handle int case: 1-byte fill with automatic overflow checking. - if isinstance(value, int): - Buffer_fill_uint8(self, value, s_stream._h_stream) - return - - # Handle bytes case: direct pointer access without intermediate objects. - if isinstance(value, bytes): - Buffer_fill_from_ptr(self, value, len(value), s_stream._h_stream) - return - - # General buffer protocol path using C buffer API. - cdef Py_buffer buf - if PyObject_GetBuffer(value, &buf, PyBUF_SIMPLE) != 0: - raise TypeError( - f"value must be an int or support the buffer protocol, got {type(value).__name__}" - ) - try: - Buffer_fill_from_ptr(self, buf.buf, buf.len, s_stream._h_stream) - finally: - PyBuffer_Release(&buf) + cdef unsigned int val + cdef unsigned int elem_size + val, elem_size = _parse_fill_value(value) + + cdef size_t buffer_size = self._size + cdef cydriver.CUdeviceptr dst = as_cu(self._h_ptr) + cdef cydriver.CUstream s = as_cu(s_stream._h_stream) + + if elem_size == 1: + with nogil: + HANDLE_RETURN(cydriver.cuMemsetD8Async(dst, val, buffer_size, s)) + elif elem_size == 2: + if buffer_size & 0x1: + raise ValueError(f"buffer size ({buffer_size}) must be divisible by 2") + with nogil: + HANDLE_RETURN(cydriver.cuMemsetD16Async(dst, val, buffer_size // 2, s)) + elif elem_size == 4: + if buffer_size & 0x3: + raise ValueError(f"buffer size ({buffer_size}) must be divisible by 4") + with nogil: + HANDLE_RETURN(cydriver.cuMemsetD32Async(dst, val, buffer_size // 4, s)) def __dlpack__( self, @@ -300,7 +409,7 @@ cdef class Buffer: max_version: tuple[int, int] | None = None, dl_device: tuple[int, int] | None = None, copy: bool | None = None, - ) -> TypeVar("PyCapsule"): + ) -> object: # Note: we ignore the stream argument entirely (as if it is -1). # It is the user's responsibility to maintain stream order. if dl_device is not None: @@ -317,16 +426,7 @@ cdef class Buffer: return capsule 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): - return (DLDeviceType.kDLCUDA, self.device_id) - if d and h: - # TODO: this can also be kDLCUDAManaged, we need more fine-grained checks - return (DLDeviceType.kDLCUDAHost, 0) - if (not d) and h: - return (DLDeviceType.kDLCPU, 0) - raise BufferError("buffer is neither device-accessible nor host-accessible") + return classify_dl_device(self) def __buffer__(self, flags: int, /) -> memoryview: # Support for Python-level buffer protocol as per PEP 688. @@ -335,7 +435,7 @@ cdef class Buffer: # 2. This Buffer object is host accessible raise NotImplementedError("WIP: Buffer.__buffer__ hasn't been implemented yet.") - def __release_buffer__(self, buffer: memoryview, /): + def __release_buffer__(self, buffer: memoryview, /) -> None: # Supporting method paired with __buffer__. raise NotImplementedError("WIP: Buffer.__release_buffer__ hasn't been implemented yet.") @@ -344,11 +444,11 @@ cdef class Buffer: """Return the device ordinal of this buffer.""" if self._memory_resource is not None: return self._memory_resource.device_id - _init_mem_attrs(self) + _init_memory_attrs(self) return self._mem_attrs.device_id @property - def handle(self) -> DevicePointerT: + def handle(self) -> int: """Return the buffer handle object. .. caution:: @@ -360,7 +460,7 @@ cdef class Buffer: # that expect a raw pointer value return as_intptr(self._h_ptr) - def __eq__(self, other) -> bool: + def __eq__(self, other: object) -> bool: if not isinstance(other, Buffer): return NotImplemented cdef Buffer other_buf = other @@ -379,7 +479,7 @@ cdef class Buffer: """Return True if this buffer can be accessed by the GPU, otherwise False.""" if self._memory_resource is not None: return self._memory_resource.is_device_accessible - _init_mem_attrs(self) + _init_memory_attrs(self) return self._mem_attrs.is_device_accessible @property @@ -387,9 +487,19 @@ cdef class Buffer: """Return True if this buffer can be accessed by the CPU, otherwise False.""" if self._memory_resource is not None: return self._memory_resource.is_host_accessible - _init_mem_attrs(self) + _init_memory_attrs(self) return self._mem_attrs.is_host_accessible + @property + def is_managed(self) -> bool: + """Return True if this buffer is CUDA managed (unified) memory, otherwise False.""" + _init_memory_attrs(self) + if self._mem_attrs.is_managed: + return True + # Pool-allocated managed memory does not set CU_POINTER_ATTRIBUTE_IS_MANAGED, + # so fall back to the memory resource when it advertises managed allocations. + return self._memory_resource is not None and self._memory_resource.is_managed + @property def is_mapped(self) -> bool: """Return True if this buffer is mapped into the process via IPC.""" @@ -412,65 +522,6 @@ cdef class Buffer: return self._owner -# Memory Attribute Query Helpers -# ------------------------------ -cdef inline void _init_mem_attrs(Buffer self): - """Initialize memory attributes by querying the pointer.""" - if not self._mem_attrs_inited: - _query_memory_attrs(self._mem_attrs, as_cu(self._h_ptr)) - self._mem_attrs_inited = True - - -cdef inline int _query_memory_attrs( - _MemAttrs& out, - cydriver.CUdeviceptr ptr -) except -1 nogil: - """Query memory attributes for a device pointer.""" - cdef unsigned int memory_type = 0 - cdef int is_managed = 0 - cdef int device_id = 0 - cdef cydriver.CUpointer_attribute attrs[3] - cdef uintptr_t vals[3] - - attrs[0] = cydriver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_MEMORY_TYPE - attrs[1] = cydriver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_IS_MANAGED - attrs[2] = cydriver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL - vals[0] = &memory_type - vals[1] = &is_managed - vals[2] = &device_id - - cdef cydriver.CUresult ret - ret = cydriver.cuPointerGetAttributes(3, attrs, vals, ptr) - if ret == cydriver.CUresult.CUDA_ERROR_NOT_INITIALIZED: - with cython.gil: - # Device class handles the cuInit call internally - Device() - ret = cydriver.cuPointerGetAttributes(3, attrs, vals, ptr) - HANDLE_RETURN(ret) - - if memory_type == 0: - # unregistered host pointer - out.is_host_accessible = True - out.is_device_accessible = False - out.device_id = -1 - elif ( - is_managed - or memory_type == cydriver.CUmemorytype.CU_MEMORYTYPE_HOST - ): - # Managed memory or pinned host memory - out.is_host_accessible = True - out.is_device_accessible = True - out.device_id = device_id - elif memory_type == cydriver.CUmemorytype.CU_MEMORYTYPE_DEVICE: - out.is_host_accessible = False - out.is_device_accessible = True - out.device_id = device_id - else: - with cython.gil: - raise ValueError(f"Unsupported memory type: {memory_type}") - return 0 - - cdef class MemoryResource: """Abstract base class for memory resources that manage allocation and deallocation of buffers. @@ -483,17 +534,17 @@ cdef class MemoryResource: resource's respective property.) """ - def allocate(self, size_t size, stream: Stream | GraphBuilder | None = None) -> Buffer: + def allocate(self, size_t size, *, stream: Stream | GraphBuilder) -> Buffer: """Allocate a buffer of the requested size. Parameters ---------- size : int The size of the buffer to allocate, in bytes. - stream : :obj:`~_stream.Stream` | :obj:`~_graph.GraphBuilder`, optional - The stream on which to perform the allocation asynchronously. - If None, it is up to each memory resource implementation to decide - and document the behavior. + stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` + Keyword-only. The stream on which to perform the allocation + asynchronously. Must be passed explicitly; pass + ``device.default_stream`` to use the default stream. Returns ------- @@ -503,19 +554,25 @@ cdef class MemoryResource: """ raise TypeError("MemoryResource.allocate must be implemented by subclasses.") - def deallocate(self, ptr: DevicePointerT, size_t size, stream: Stream | GraphBuilder | None = None): + def deallocate( + self, + ptr: DevicePointerType, + size_t size, + *, + stream: Stream | GraphBuilder + ) -> None: """Deallocate a buffer previously allocated by this resource. Parameters ---------- - ptr : :obj:`~_memory.DevicePointerT` + ptr : :obj:`~_memory.DevicePointerType` The pointer or handle to the buffer to deallocate. size : int The size of the buffer to deallocate, in bytes. - stream : :obj:`~_stream.Stream` | :obj:`~_graph.GraphBuilder`, optional - The stream on which to perform the deallocation asynchronously. - If None, it is up to each memory resource implementation to decide - and document the behavior. + stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` + Keyword-only. The stream on which to perform the deallocation + asynchronously. Must be passed explicitly; pass + ``device.default_stream`` to use the default stream. """ raise TypeError("MemoryResource.deallocate must be implemented by subclasses.") @@ -529,6 +586,11 @@ cdef class MemoryResource: """Whether buffers allocated by this resource are host-accessible.""" raise TypeError("MemoryResource.is_host_accessible must be implemented by subclasses.") + @property + def is_managed(self) -> bool: + """Whether buffers allocated by this resource are CUDA managed (unified) memory.""" + return False + @property def device_id(self) -> int: """Device ID associated with this memory resource, or -1 if not applicable.""" @@ -537,20 +599,21 @@ cdef class MemoryResource: # Buffer Implementation Helpers # ----------------------------- -cdef inline Buffer Buffer_from_deviceptr_handle( +cdef Buffer Buffer_from_deviceptr_handle( DevicePtrHandle h_ptr, size_t size, MemoryResource mr, - object ipc_descriptor = None + object ipc_descriptor = None, + type cls = Buffer, ): - """Create a Buffer from an existing DevicePtrHandle.""" - cdef Buffer buf = Buffer.__new__(Buffer) + """Create a Buffer (or subclass instance) from an existing DevicePtrHandle.""" + cdef Buffer buf = cls.__new__(cls) buf._h_ptr = h_ptr buf._size = size buf._memory_resource = mr buf._ipc_data = IPCDataForBuffer(ipc_descriptor, True) if ipc_descriptor is not None else None buf._owner = None - buf._mem_attrs_inited = False + buf._mem_attrs_inited.store(False) return buf @@ -569,36 +632,3 @@ cdef inline void Buffer_close(Buffer self, object stream): self._memory_resource = None self._ipc_data = None self._owner = None - - -cdef inline int Buffer_fill_uint8(Buffer self, uint8_t value, StreamHandle h_stream) except? -1: - cdef cydriver.CUdeviceptr ptr = as_cu(self._h_ptr) - cdef cydriver.CUstream s = as_cu(h_stream) - with nogil: - HANDLE_RETURN(cydriver.cuMemsetD8Async(ptr, value, self._size, s)) - return 0 - - -cdef inline int Buffer_fill_from_ptr( - Buffer self, const char* ptr, size_t width, StreamHandle h_stream -) except? -1: - cdef size_t buffer_size = self._size - cdef cydriver.CUdeviceptr dst = as_cu(self._h_ptr) - cdef cydriver.CUstream s = as_cu(h_stream) - - if width == 1: - with nogil: - HANDLE_RETURN(cydriver.cuMemsetD8Async(dst, (ptr)[0], buffer_size, s)) - elif width == 2: - if buffer_size & 0x1: - raise ValueError(f"buffer size ({buffer_size}) must be divisible by 2") - with nogil: - HANDLE_RETURN(cydriver.cuMemsetD16Async(dst, (ptr)[0], buffer_size // 2, s)) - elif width == 4: - if buffer_size & 0x3: - raise ValueError(f"buffer size ({buffer_size}) must be divisible by 4") - with nogil: - HANDLE_RETURN(cydriver.cuMemsetD32Async(dst, (ptr)[0], buffer_size // 4, s)) - else: - raise ValueError(f"value must be 1, 2, or 4 bytes, got {width}") - return 0 diff --git a/cuda_core/cuda/core/_memory/_device_memory_resource.pxd b/cuda_core/cuda/core/_memory/_device_memory_resource.pxd index a7f3bfd9585..1c3134876eb 100644 --- a/cuda_core/cuda/core/_memory/_device_memory_resource.pxd +++ b/cuda_core/cuda/core/_memory/_device_memory_resource.pxd @@ -3,13 +3,11 @@ # SPDX-License-Identifier: Apache-2.0 from cuda.core._memory._memory_pool cimport _MemPool -from cuda.core._memory._ipc cimport IPCDataForMR cdef class DeviceMemoryResource(_MemPool): cdef: int _dev_id - object _peer_accessible_by -cpdef DMR_mempool_get_access(DeviceMemoryResource, int) +cpdef str DMR_mempool_get_access(DeviceMemoryResource, int) diff --git a/cuda_core/cuda/core/_memory/_device_memory_resource.pyi b/cuda_core/cuda/core/_memory/_device_memory_resource.pyi new file mode 100644 index 00000000000..21862b32b7a --- /dev/null +++ b/cuda_core/cuda/core/_memory/_device_memory_resource.pyi @@ -0,0 +1,235 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_memory/_device_memory_resource.pyx + +from __future__ import annotations + +import uuid +from dataclasses import dataclass + +from cuda.core._device import Device +from cuda.core._memory._ipc import IPCAllocationHandle +from cuda.core._memory._memory_pool import _MemPool +from cuda.core._memory._peer_access_utils import PeerAccessibleBySetProxy + + +@dataclass +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: bool = False + max_size: int = 0 + +class DeviceMemoryResource(_MemPool): + """ + A device memory resource managing a stream-ordered memory pool. + + Parameters + ---------- + device_id : Device | int + Device or Device ordinal for which a memory resource is constructed. + + options : DeviceMemoryResourceOptions + Memory resource creation options. + + 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. + + 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. + + Notes + ----- + To create an IPC-Enabled memory resource (MR) that is capable of sharing + allocations between processes, specify ``ipc_enabled=True`` in the initializer + option. Sharing an allocation is a two-step procedure that involves + mapping a memory resource and then mapping buffers owned by that resource. + These steps can be accomplished in several ways. + + An IPC-enabled memory resource can allocate memory buffers but cannot + receive shared buffers. Mapping an MR to another process creates a "mapped + memory resource" (MMR). An MMR cannot allocate memory buffers and can only + receive shared buffers. MRs and MMRs are both of type + :class:`DeviceMemoryResource` and can be distinguished via + :attr:`DeviceMemoryResource.is_mapped`. + + An MR is shared via an allocation handle accessed through the + :attr:`DeviceMemoryResource.allocation_handle` property. The allocation + handle has a platform-specific interpretation; however, memory IPC is + currently only supported for Linux, and in that case allocation handles + are file descriptors. After sending an allocation handle to another + process, it can be used to create an MMR by invoking + :meth:`DeviceMemoryResource.from_allocation_handle`. + + Buffers can be shared as serializable descriptors accessed through the + :attr:`Buffer.ipc_descriptor` property. In a receiving process, a shared + buffer is created by invoking :meth:`Buffer.from_ipc_descriptor` with an + MMR and buffer descriptor, where the MMR corresponds to the MR that + created the described buffer. + + To help manage the association between memory resources and buffers, a + registry is provided. Every MR has a unique identifier (UUID). MMRs can be + registered by calling :meth:`DeviceMemoryResource.register` with the UUID + of the corresponding MR. Registered MMRs can be looked up via + :meth:`DeviceMemoryResource.from_registry`. When registering MMRs in this + way, the use of buffer descriptors can be avoided. Instead, buffer objects + can themselves be serialized and transferred directly. Serialization embeds + the UUID, which is used to locate the correct MMR during reconstruction. + + IPC-enabled memory resources interoperate with the :mod:`multiprocessing` + module to provide a simplified interface. This approach can avoid direct + use of allocation handles, buffer descriptors, MMRs, and the registry. When + using :mod:`multiprocessing` to spawn processes or send objects through + communication channels such as :class:`multiprocessing.Queue`, + :class:`multiprocessing.Pipe`, or :class:`multiprocessing.Connection`, + :class:`Buffer` objects may be sent directly, and in such cases the process + for creating MMRs and mapping buffers will be handled automatically. + + For greater efficiency when transferring many buffers, one may also send + MRs and buffers separately. When an MR is sent via :mod:`multiprocessing`, + an MMR is created and registered in the receiving process. Subsequently, + buffers may be serialized and transferred using ordinary :mod:`pickle` + methods. The reconstruction procedure uses the registry to find the + associated MMR. Unpickling a :class:`Buffer` performs an IPC import from + the embedded descriptor; only unpickle buffers received from trusted peers. + + Warning + ------- + IPC descriptors and pickled buffers cross a trust boundary between + cooperating same-host processes. A malicious peer can supply crafted + descriptor fields. Use :meth:`Buffer.from_ipc_descriptor` only with + descriptors from trusted peers, and do not unpickle buffers from + untrusted sources. + """ + + def __cinit__(self, *args, **kwargs) -> None: + ... + + def __init__(self, device_id: Device | int, options: DeviceMemoryResourceOptions | dict[str, object] | None=None) -> None: + ... + + def __reduce__(self) -> tuple[object, ...]: + ... + + @staticmethod + def from_registry(uuid: uuid.UUID) -> DeviceMemoryResource: + """ + Obtain a registered mapped memory resource. + + Raises + ------ + RuntimeError + If no mapped memory resource is found in the registry. + """ + + def register(self, uuid: uuid.UUID) -> DeviceMemoryResource: + """ + Register a mapped memory resource. + + Returns + ------- + The registered mapped memory resource. If one was previously registered + with the given key, it is returned. + """ + + @classmethod + def from_allocation_handle(cls, device_id: Device | int, alloc_handle: int | 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 | IPCAllocationHandle + The shareable handle of the device memory resource to import. If an + integer is supplied, it must represent a valid platform-specific + handle. It is the caller's responsibility to close that handle. + + Returns + ------- + A new device memory resource instance with the imported handle. + """ + + @property + def allocation_handle(self) -> IPCAllocationHandle: + """Shareable handle for this memory pool (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. + """ + + @property + def device_id(self) -> int: + """The associated device ordinal.""" + + @property + def peer_accessible_by(self) -> PeerAccessibleBySetProxy: + """ + Get or set the devices that can access allocations from this memory + pool. Access can be modified at any time and affects all allocations + from this memory pool. + + Returns a set-like proxy of :obj:`~_device.Device` objects that manages + peer access. Inputs are accepted as either :obj:`~_device.Device` + objects or device-ordinal :class:`int` values. + + Examples + -------- + >>> dmr = DeviceMemoryResource(0) + >>> dmr.peer_accessible_by = {1} # grant access to device 1 + >>> assert 1 in dmr.peer_accessible_by + >>> dmr.peer_accessible_by.add(2) # update access to include device 2 + >>> dmr.peer_accessible_by = [] # revoke peer access + """ + + @peer_accessible_by.setter + def peer_accessible_by(self, devices) -> None: + ... + + @property + def is_device_accessible(self) -> bool: + """Return True. This memory resource provides device-accessible buffers.""" + + @property + def is_host_accessible(self) -> bool: + """Return False. This memory resource does not provide host-accessible buffers.""" +__all__ = ['DeviceMemoryResource', 'DeviceMemoryResourceOptions'] + +def DMR_mempool_get_access(dmr: DeviceMemoryResource, device_id: int) -> str: + """ + Probes peer access from the given device using cuMemPoolGetAccess. + + Parameters + ---------- + device_id : int or Device + The device to query access for. + + Returns + ------- + str + Access permissions: "rw" for read-write, "r" for read-only, "" for no access. + """ + +def _deep_reduce_device_memory_resource(mr) -> tuple[object, ...]: + ... \ No newline at end of file diff --git a/cuda_core/cuda/core/_memory/_device_memory_resource.pyx b/cuda_core/cuda/core/_memory/_device_memory_resource.pyx index 744c58e0216..45d8d543ac4 100644 --- a/cuda_core/cuda/core/_memory/_device_memory_resource.pyx +++ b/cuda_core/cuda/core/_memory/_device_memory_resource.pyx @@ -13,20 +13,25 @@ from cuda.core._memory._ipc cimport IPCAllocationHandle from cuda.core._resource_handles cimport ( as_cu, get_device_mempool, + get_last_error, ) from cuda.core._utils.cuda_utils cimport ( check_or_create_options, HANDLE_RETURN, ) -from cpython.mem cimport PyMem_Malloc, PyMem_Free - from dataclasses import dataclass import multiprocessing import platform # no-cython-lint import uuid +from cuda.core._memory._peer_access_utils import PeerAccessibleBySetProxy, replace_peer_accessible_by from cuda.core._utils.cuda_utils import check_multiprocessing_start_method +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from cuda.core._device import Device + __all__ = ['DeviceMemoryResource', 'DeviceMemoryResourceOptions'] @@ -88,19 +93,19 @@ cdef class DeviceMemoryResource(_MemPool): :class:`DeviceMemoryResource` and can be distinguished via :attr:`DeviceMemoryResource.is_mapped`. - An MR is shared via an allocation handle obtained by calling - :meth:`DeviceMemoryResource.get_allocation_handle`. The allocation handle - has a platform-specific interpretation; however, memory IPC is currently - only supported for Linux, and in that case allocation handles are file - descriptors. After sending an allocation handle to another process, it can - be used to create an MMR by invoking + An MR is shared via an allocation handle accessed through the + :attr:`DeviceMemoryResource.allocation_handle` property. The allocation + handle has a platform-specific interpretation; however, memory IPC is + currently only supported for Linux, and in that case allocation handles + are file descriptors. After sending an allocation handle to another + process, it can be used to create an MMR by invoking :meth:`DeviceMemoryResource.from_allocation_handle`. - Buffers can be shared as serializable descriptors obtained by calling - :meth:`Buffer.get_ipc_descriptor`. In a receiving process, a shared buffer is - created by invoking :meth:`Buffer.from_ipc_descriptor` with an MMR and - buffer descriptor, where the MMR corresponds to the MR that created the - described buffer. + Buffers can be shared as serializable descriptors accessed through the + :attr:`Buffer.ipc_descriptor` property. In a receiving process, a shared + buffer is created by invoking :meth:`Buffer.from_ipc_descriptor` with an + MMR and buffer descriptor, where the MMR corresponds to the MR that + created the described buffer. To help manage the association between memory resources and buffers, a registry is provided. Every MR has a unique identifier (UUID). MMRs can be @@ -125,17 +130,29 @@ cdef class DeviceMemoryResource(_MemPool): an MMR is created and registered in the receiving process. Subsequently, buffers may be serialized and transferred using ordinary :mod:`pickle` methods. The reconstruction procedure uses the registry to find the - associated MMR. + associated MMR. Unpickling a :class:`Buffer` performs an IPC import from + the embedded descriptor; only unpickle buffers received from trusted peers. + + Warning + ------- + IPC descriptors and pickled buffers cross a trust boundary between + cooperating same-host processes. A malicious peer can supply crafted + descriptor fields. Use :meth:`Buffer.from_ipc_descriptor` only with + descriptors from trusted peers, and do not unpickle buffers from + untrusted sources. """ - def __cinit__(self, *args, **kwargs): + def __cinit__(self, *args, **kwargs) -> None: self._dev_id = cydriver.CU_DEVICE_INVALID - self._peer_accessible_by = None - def __init__(self, device_id: Device | int, options=None): + def __init__( + self, + device_id: Device | int, + options: DeviceMemoryResourceOptions | dict[str, object] | None = None + ) -> None: _DMR_init(self, device_id, options) - def __reduce__(self): + def __reduce__(self) -> tuple[object, ...]: return DeviceMemoryResource.from_registry, (self.uuid,) @staticmethod @@ -190,18 +207,14 @@ cdef class DeviceMemoryResource(_MemPool): _ipc.MP_from_allocation_handle(cls, alloc_handle)) from .._device import Device mr._dev_id = Device(device_id).device_id - mr._peer_accessible_by = () return mr - def get_allocation_handle(self) -> IPCAllocationHandle: - """Export the memory pool handle to be shared (requires IPC). + @property + def allocation_handle(self) -> IPCAllocationHandle: + """Shareable handle for this memory pool (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") @@ -213,36 +226,29 @@ cdef class DeviceMemoryResource(_MemPool): return self._dev_id @property - def peer_accessible_by(self): + def peer_accessible_by(self) -> PeerAccessibleBySetProxy: """ Get or set the devices that can access allocations from this memory pool. Access can be modified at any time and affects all allocations from this memory pool. - Returns a tuple of sorted device IDs that currently have peer access to - allocations from this memory pool. - - When setting, accepts a sequence of Device objects or device IDs. - Setting to an empty sequence revokes all peer access. - - For non-owned pools (the default or current device pool), the state - is always queried from the driver to reflect changes made by other - wrappers or direct driver calls. + Returns a set-like proxy of :obj:`~_device.Device` objects that manages + peer access. Inputs are accepted as either :obj:`~_device.Device` + objects or device-ordinal :class:`int` values. Examples -------- >>> dmr = DeviceMemoryResource(0) - >>> dmr.peer_accessible_by = [1] # Grant access to device 1 - >>> assert dmr.peer_accessible_by == (1,) - >>> dmr.peer_accessible_by = [] # Revoke access + >>> dmr.peer_accessible_by = {1} # grant access to device 1 + >>> assert 1 in dmr.peer_accessible_by + >>> dmr.peer_accessible_by.add(2) # update access to include device 2 + >>> dmr.peer_accessible_by = [] # revoke peer access """ - if not self._mempool_owned: - _DMR_query_peer_access(self) - return self._peer_accessible_by + return PeerAccessibleBySetProxy(self) @peer_accessible_by.setter - def peer_accessible_by(self, devices): - _DMR_set_peer_accessible_by(self, devices) + def peer_accessible_by(self, devices) -> None: + replace_peer_accessible_by(self, devices) @property def is_device_accessible(self) -> bool: @@ -255,74 +261,6 @@ cdef class DeviceMemoryResource(_MemPool): return False -cdef inline _DMR_query_peer_access(DeviceMemoryResource self): - """Query the driver for the actual peer access state of this pool.""" - cdef int total - cdef cydriver.CUmemAccess_flags flags - cdef cydriver.CUmemLocation location - cdef list peers = [] - - with nogil: - HANDLE_RETURN(cydriver.cuDeviceGetCount(&total)) - - location.type = cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE - for dev_id in range(total): - if dev_id == self._dev_id: - continue - location.id = dev_id - with nogil: - HANDLE_RETURN(cydriver.cuMemPoolGetAccess(&flags, as_cu(self._h_pool), &location)) - if flags == cydriver.CUmemAccess_flags.CU_MEM_ACCESS_FLAGS_PROT_READWRITE: - peers.append(dev_id) - - self._peer_accessible_by = tuple(sorted(peers)) - - -cdef inline _DMR_set_peer_accessible_by(DeviceMemoryResource self, devices): - from .._device import Device - - cdef set[int] target_ids = {Device(dev).device_id for dev in devices} - target_ids.discard(self._dev_id) - this_dev = Device(self._dev_id) - cdef list bad = [dev for dev in target_ids if not this_dev.can_access_peer(dev)] - if bad: - raise ValueError(f"Device {self._dev_id} cannot access peer(s): {', '.join(map(str, bad))}") - if not self._mempool_owned: - _DMR_query_peer_access(self) - cdef set[int] cur_ids = set(self._peer_accessible_by) - cdef set[int] to_add = target_ids - cur_ids - cdef set[int] to_rm = cur_ids - target_ids - cdef size_t count = len(to_add) + len(to_rm) - cdef cydriver.CUmemAccessDesc* access_desc = NULL - cdef size_t i = 0 - - if count > 0: - access_desc = PyMem_Malloc(count * sizeof(cydriver.CUmemAccessDesc)) - if access_desc == NULL: - raise MemoryError("Failed to allocate memory for access descriptors") - - try: - for dev_id in to_add: - access_desc[i].flags = cydriver.CUmemAccess_flags.CU_MEM_ACCESS_FLAGS_PROT_READWRITE - access_desc[i].location.type = cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE - access_desc[i].location.id = dev_id - i += 1 - - for dev_id in to_rm: - access_desc[i].flags = cydriver.CUmemAccess_flags.CU_MEM_ACCESS_FLAGS_PROT_NONE - access_desc[i].location.type = cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE - access_desc[i].location.id = dev_id - i += 1 - - with nogil: - HANDLE_RETURN(cydriver.cuMemPoolSetAccess(as_cu(self._h_pool), access_desc, count)) - finally: - if access_desc != NULL: - PyMem_Free(access_desc) - - self._peer_accessible_by = tuple(target_ids) - - cdef inline _DMR_init(DeviceMemoryResource self, device_id, options): from .._device import Device cdef int dev_id = Device(device_id).device_id @@ -343,10 +281,17 @@ cdef inline _DMR_init(DeviceMemoryResource self, device_id, options): if opts is None: self._h_pool = get_device_mempool(dev_id) + if not self._h_pool: + HANDLE_RETURN(get_last_error()) + raise RuntimeError( + f"Failed to initialize DeviceMemoryResource for device {dev_id}: " + "cuda-core returned an empty memory pool handle without recording a CUDA error. " + "This is an internal cuda-core error; please report it with your CUDA driver, " + "CUDA Toolkit, and cuda-python versions." + ) self._mempool_owned = False MP_raise_release_threshold(self) else: - self._peer_accessible_by = () MP_init_create_pool( self, cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE, @@ -358,7 +303,7 @@ cdef inline _DMR_init(DeviceMemoryResource self, device_id, options): # Note: this is referenced in instructions to debug nvbug 5698116. -cpdef DMR_mempool_get_access(DeviceMemoryResource dmr, int device_id): +cpdef str DMR_mempool_get_access(DeviceMemoryResource dmr, int device_id): """ Probes peer access from the given device using cuMemPoolGetAccess. @@ -392,11 +337,11 @@ cpdef DMR_mempool_get_access(DeviceMemoryResource dmr, int device_id): return "" -def _deep_reduce_device_memory_resource(mr): +def _deep_reduce_device_memory_resource(mr) -> tuple[object, ...]: check_multiprocessing_start_method() from .._device import Device device = Device(mr.device_id) - alloc_handle = mr.get_allocation_handle() + alloc_handle = mr.allocation_handle return mr.from_allocation_handle, (device, alloc_handle) diff --git a/cuda_core/cuda/core/_memory/_graph_memory_resource.pyi b/cuda_core/cuda/core/_memory/_graph_memory_resource.pyi new file mode 100644 index 00000000000..b34f968fdc9 --- /dev/null +++ b/cuda_core/cuda/core/_memory/_graph_memory_resource.pyi @@ -0,0 +1,116 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_memory/_graph_memory_resource.pyx + +from __future__ import annotations + +from cuda.core._device import Device +from cuda.core._memory._buffer import Buffer, MemoryResource +from cuda.core._stream import Stream +from cuda.core.graph import GraphBuilder +from cuda.core.typing import DevicePointerType + + +class GraphMemoryResourceAttributes: + + def __init__(self, *args, **kwargs) -> None: + ... + + @classmethod + def _init(cls, device_id: int) -> GraphMemoryResourceAttributes: + ... + + def __repr__(self) -> str: + ... + + @property + def reserved_mem_current(self) -> int: + """Current amount of backing memory allocated.""" + + @property + def reserved_mem_high(self) -> int: + """ + High watermark of backing memory allocated. It can be set to zero to + reset it to the current usage. + """ + + @reserved_mem_high.setter + def reserved_mem_high(self, value: int) -> None: + ... + + @property + def used_mem_current(self) -> int: + """Current amount of memory in use.""" + + @property + def used_mem_high(self) -> int: + """ + High watermark of memory in use. It can be set to zero to reset it to + the current usage. + """ + + @used_mem_high.setter + def used_mem_high(self, value: int) -> None: + ... + +class cyGraphMemoryResource(MemoryResource): + + def __cinit__(self, device_id: int) -> None: + ... + + def allocate(self, size: int, *, stream: Stream | GraphBuilder) -> Buffer: + """ + Allocate a buffer of the requested size. See documentation for :obj:`~_memory.MemoryResource`. + """ + + def deallocate(self, ptr: DevicePointerType, size: int, *, stream: Stream | GraphBuilder) -> None: + """ + Deallocate a buffer of the requested size. See documentation for :obj:`~_memory.MemoryResource`. + """ + + def close(self) -> None: + """No operation (provided for compatibility).""" + + def trim(self) -> None: + """Free unused memory that was cached on the specified device for use with graphs back to the OS.""" + + @property + def attributes(self) -> GraphMemoryResourceAttributes: + """Asynchronous allocation attributes related to graphs.""" + + @property + def device_id(self) -> int: + """The associated device ordinal.""" + + @property + def is_device_accessible(self) -> bool: + """Return True. This memory resource provides device-accessible buffers.""" + + @property + def is_host_accessible(self) -> bool: + """Return False. This memory resource does not provide host-accessible buffers.""" + +class GraphMemoryResource(cyGraphMemoryResource): + """ + A memory resource for memory related to graphs. + + The only supported operations are allocation, deallocation, and a limited + set of status queries. + + This memory resource should be used when building graphs. Using this when + graphs capture is not enabled will result in a runtime error. + + Conversely, allocating memory from a `DeviceMemoryResource` when graph + capturing is enabled results in a runtime error. + + Parameters + ---------- + device_id: int | Device + Device or Device ordinal for which a graph memory resource is obtained. + """ + + def __new__(cls, device_id: int | Device) -> GraphMemoryResource: + ... + + @classmethod + def _create(cls, device_id: int) -> GraphMemoryResource: + ... +__all__ = ['GraphMemoryResource'] \ No newline at end of file diff --git a/cuda_core/cuda/core/_memory/_graph_memory_resource.pyx b/cuda_core/cuda/core/_memory/_graph_memory_resource.pyx index 2f8066c948b..e845a47b080 100644 --- a/cuda_core/cuda/core/_memory/_graph_memory_resource.pyx +++ b/cuda_core/cuda/core/_memory/_graph_memory_resource.pyx @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 @@ -11,13 +11,19 @@ from cuda.core._memory._buffer cimport Buffer, Buffer_from_deviceptr_handle, Mem from cuda.core._resource_handles cimport ( DevicePtrHandle, deviceptr_alloc_async, + get_last_error, as_cu, ) -from cuda.core._stream cimport default_stream, Stream_accept, Stream +from cuda.core._stream cimport Stream_accept, Stream from cuda.core._utils.cuda_utils cimport HANDLE_RETURN -from functools import cache +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from cuda.core._device import Device + from cuda.core.graph import GraphBuilder + from cuda.core.typing import DevicePointerType __all__ = ['GraphMemoryResource'] @@ -26,16 +32,16 @@ cdef class GraphMemoryResourceAttributes: cdef: int _device_id - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: raise RuntimeError("GraphMemoryResourceAttributes cannot be instantiated directly. Please use MemoryResource APIs.") @classmethod - def _init(cls, device_id: int): + def _init(cls, device_id: int) -> GraphMemoryResourceAttributes: cdef GraphMemoryResourceAttributes self = GraphMemoryResourceAttributes.__new__(cls) self._device_id = device_id return self - def __repr__(self): + def __repr__(self) -> str: return f"{self.__class__.__name__}(%s)" % ", ".join( f"{attr}={getattr(self, attr)}" for attr in dir(self) if not attr.startswith("_") @@ -52,14 +58,14 @@ cdef class GraphMemoryResourceAttributes: return 0 @property - def reserved_mem_current(self): + def reserved_mem_current(self) -> int: """Current amount of backing memory allocated.""" cdef cydriver.cuuint64_t value self._getattribute(cydriver.CUgraphMem_attribute.CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT, &value) return int(value) @property - def reserved_mem_high(self): + def reserved_mem_high(self) -> int: """ High watermark of backing memory allocated. It can be set to zero to reset it to the current usage. @@ -69,21 +75,21 @@ cdef class GraphMemoryResourceAttributes: return int(value) @reserved_mem_high.setter - def reserved_mem_high(self, value: int): + def reserved_mem_high(self, value: int) -> None: if value != 0: raise AttributeError(f"Attribute 'reserved_mem_high' may only be set to zero (got {value}).") cdef cydriver.cuuint64_t zero = 0 self._setattribute(cydriver.CUgraphMem_attribute.CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH, &zero) @property - def used_mem_current(self): + def used_mem_current(self) -> int: """Current amount of memory in use.""" cdef cydriver.cuuint64_t value self._getattribute(cydriver.CUgraphMem_attribute.CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT, &value) return int(value) @property - def used_mem_high(self): + def used_mem_high(self) -> int: """ High watermark of memory in use. It can be set to zero to reset it to the current usage. @@ -93,7 +99,7 @@ cdef class GraphMemoryResourceAttributes: return int(value) @used_mem_high.setter - def used_mem_high(self, value: int): + def used_mem_high(self, value: int) -> None: if value != 0: raise AttributeError(f"Attribute 'used_mem_high' may only be set to zero (got {value}).") cdef cydriver.cuuint64_t zero = 0 @@ -101,28 +107,34 @@ cdef class GraphMemoryResourceAttributes: cdef class cyGraphMemoryResource(MemoryResource): - def __cinit__(self, int device_id): + def __cinit__(self, int device_id) -> None: self._device_id = device_id - def allocate(self, size_t size, stream: Stream | GraphBuilder | None = None) -> Buffer: + def allocate(self, size_t size, *, stream: Stream | GraphBuilder) -> Buffer: """ Allocate a buffer of the requested size. See documentation for :obj:`~_memory.MemoryResource`. """ - stream = Stream_accept(stream) if stream is not None else default_stream() - return GMR_allocate(self, size, stream) - - def deallocate(self, ptr: DevicePointerT, size_t size, stream: Stream | GraphBuilder | None = None): + cdef Stream s = Stream_accept(stream) + return GMR_allocate(self, size, s) + + def deallocate( + self, + ptr: DevicePointerType, + size_t size, + *, + stream: Stream | GraphBuilder + ) -> None: """ Deallocate a buffer of the requested size. See documentation for :obj:`~_memory.MemoryResource`. """ - stream = Stream_accept(stream) if stream is not None else default_stream() - return GMR_deallocate(ptr, size, stream) + cdef Stream s = Stream_accept(stream) + return GMR_deallocate(ptr, size, s) - def close(self): + def close(self) -> None: """No operation (provided for compatibility).""" pass - def trim(self): + def trim(self) -> None: """Free unused memory that was cached on the specified device for use with graphs back to the OS.""" with nogil: HANDLE_RETURN(cydriver.cuDeviceGraphMemTrim(self._device_id)) @@ -148,6 +160,8 @@ cdef class cyGraphMemoryResource(MemoryResource): return False +cdef dict _mem_resource_cache = {} + class GraphMemoryResource(cyGraphMemoryResource): """ A memory resource for memory related to graphs. @@ -167,14 +181,21 @@ class GraphMemoryResource(cyGraphMemoryResource): Device or Device ordinal for which a graph memory resource is obtained. """ - def __new__(cls, device_id: int | Device): + def __new__(cls, device_id: int | Device) -> GraphMemoryResource: cdef int c_device_id = getattr(device_id, 'device_id', device_id) return cls._create(c_device_id) @classmethod - @cache - def _create(cls, int device_id): - return cyGraphMemoryResource.__new__(cls, device_id) + def _create(cls, int device_id) -> GraphMemoryResource: + # we use a dict currently, because functools.cache is currently less + # thread-safe see also: https://github.com/python/cpython/issues/150708 + res = _mem_resource_cache.get(device_id) + if res is not None: + return res + + # create new instance, but in case of a race may return another: + new = cyGraphMemoryResource.__new__(cls, device_id) + return _mem_resource_cache.setdefault(device_id, new) # Raise an exception if the given stream is capturing. @@ -194,7 +215,13 @@ cdef inline Buffer GMR_allocate(cyGraphMemoryResource self, size_t size, Stream check_capturing(s) h_ptr = deviceptr_alloc_async(size, stream._h_stream) if not h_ptr: - raise RuntimeError("Failed to allocate memory asynchronously") + HANDLE_RETURN(get_last_error()) + raise RuntimeError( + f"Failed to allocate {size} bytes from GraphMemoryResource: " + "cuda-core returned an empty allocation handle without recording a CUDA error. " + "This is an internal cuda-core error; please report it with your CUDA driver, " + "CUDA Toolkit, and cuda-python versions." + ) return Buffer_from_deviceptr_handle(h_ptr, size, self, None) diff --git a/cuda_core/cuda/core/_memory/_ipc.pxd b/cuda_core/cuda/core/_memory/_ipc.pxd index 5166aa87481..b912ace0035 100644 --- a/cuda_core/cuda/core/_memory/_ipc.pxd +++ b/cuda_core/cuda/core/_memory/_ipc.pxd @@ -1,10 +1,11 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 from cuda.bindings cimport cydriver from cuda.core._memory._buffer cimport Buffer from cuda.core._memory._memory_pool cimport _MemPool +from cuda.core._resource_handles cimport FileDescriptorHandle # Holds _MemPool objects imported by this process. This enables @@ -46,8 +47,8 @@ cdef class IPCBufferDescriptor: cdef class IPCAllocationHandle: cdef: - int _handle - object _uuid + FileDescriptorHandle _h_fd + object _uuid cpdef close(self) diff --git a/cuda_core/cuda/core/_memory/_ipc.pyi b/cuda_core/cuda/core/_memory/_ipc.pyi new file mode 100644 index 00000000000..0c912a567bd --- /dev/null +++ b/cuda_core/cuda/core/_memory/_ipc.pyi @@ -0,0 +1,93 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_memory/_ipc.pyx + +from __future__ import annotations + +import uuid + + +class IPCDataForBuffer: + """Data members related to sharing memory buffers via IPC.""" + + def __cinit__(self, ipc_descriptor: IPCBufferDescriptor, is_mapped: bool) -> None: + ... + + @property + def ipc_descriptor(self) -> IPCBufferDescriptor: + ... + + @property + def is_mapped(self) -> bool: + ... + +class IPCDataForMR: + """Data members related to sharing memory resources via IPC.""" + + def __cinit__(self, alloc_handle: IPCAllocationHandle, is_mapped: bool) -> None: + ... + + @property + def alloc_handle(self) -> IPCAllocationHandle: + ... + + @property + def is_mapped(self) -> bool: + ... + + @property + def uuid(self) -> uuid.UUID | None: + ... + +class IPCBufferDescriptor: + """Serializable object describing a buffer that can be shared between processes. + + Note + ---- + The payload and ``size`` fields are controlled by the exporting peer. + Receivers must treat them as untrusted and import only through + :meth:`Buffer.from_ipc_descriptor`. + """ + + def __init__(self, *arg, **kwargs) -> None: + ... + + @staticmethod + def _init(reserved: bytes, size: int) -> IPCBufferDescriptor: + ... + + def __reduce__(self) -> tuple[object, ...]: + ... + + @property + def size(self) -> int: + ... + +class IPCAllocationHandle: + """Shareable handle to an IPC-enabled device memory pool.""" + + def close(self): + """Close the handle.""" + + def __init__(self, *arg, **kwargs) -> None: + ... + + @classmethod + def _init(cls, handle: int, uuid: uuid.UUID | None) -> IPCAllocationHandle: + ... + + def __int__(self) -> int: + ... + + @property + def handle(self) -> int: + ... + + @property + def uuid(self) -> uuid.UUID: + ... +__all__ = ['IPCBufferDescriptor', 'IPCAllocationHandle'] + +def _reduce_allocation_handle(alloc_handle: IPCAllocationHandle) -> tuple[object, ...]: + ... + +def _reconstruct_allocation_handle(cls: type, df: object, uuid: uuid.UUID | None) -> IPCAllocationHandle: + ... \ No newline at end of file diff --git a/cuda_core/cuda/core/_memory/_ipc.pyx b/cuda_core/cuda/core/_memory/_ipc.pyx index e1174937a27..d03f51a26ce 100644 --- a/cuda_core/cuda/core/_memory/_ipc.pyx +++ b/cuda_core/cuda/core/_memory/_ipc.pyx @@ -1,22 +1,25 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 cimport cpython +from libc.stddef cimport size_t from cuda.bindings cimport cydriver from cuda.core._memory._buffer cimport Buffer, Buffer_from_deviceptr_handle from cuda.core._memory._memory_pool cimport _MemPool -from cuda.core._stream cimport Stream +from cuda.core._stream cimport Stream, Stream_accept from cuda.core._resource_handles cimport ( DevicePtrHandle, + create_fd_handle, create_mempool_handle_ipc, deviceptr_import_ipc, get_last_error, as_cu, + as_intptr, + as_py, ) -from cuda.core._stream cimport default_stream from cuda.core._utils.cuda_utils cimport HANDLE_RETURN from cuda.core._utils.cuda_utils import check_multiprocessing_start_method @@ -43,56 +46,63 @@ cdef is_supported(): cdef class IPCDataForBuffer: """Data members related to sharing memory buffers via IPC.""" - def __cinit__(self, IPCBufferDescriptor ipc_descriptor, bint is_mapped): + def __cinit__(self, IPCBufferDescriptor ipc_descriptor, bint is_mapped) -> None: self._ipc_descriptor = ipc_descriptor self._is_mapped = is_mapped @property - def ipc_descriptor(self): + def ipc_descriptor(self) -> IPCBufferDescriptor: return self._ipc_descriptor @property - def is_mapped(self): + def is_mapped(self) -> bool: return self._is_mapped cdef class IPCDataForMR: """Data members related to sharing memory resources via IPC.""" - def __cinit__(self, IPCAllocationHandle alloc_handle, bint is_mapped): + def __cinit__(self, IPCAllocationHandle alloc_handle, bint is_mapped) -> None: self._alloc_handle = alloc_handle self._is_mapped = is_mapped @property - def alloc_handle(self): + def alloc_handle(self) -> IPCAllocationHandle: return self._alloc_handle @property - def is_mapped(self): + def is_mapped(self) -> bool: return self._is_mapped @property - def uuid(self): + def uuid(self) -> uuid.UUID | None: return getattr(self._alloc_handle, 'uuid', None) cdef class IPCBufferDescriptor: - """Serializable object describing a buffer that can be shared between processes.""" + """Serializable object describing a buffer that can be shared between processes. - def __init__(self, *arg, **kwargs): + Note + ---- + The payload and ``size`` fields are controlled by the exporting peer. + Receivers must treat them as untrusted and import only through + :meth:`Buffer.from_ipc_descriptor`. + """ + + def __init__(self, *arg, **kwargs) -> None: raise RuntimeError("IPCBufferDescriptor objects cannot be instantiated directly. Please use MemoryResource APIs.") @staticmethod - def _init(reserved: bytes, size: int): + def _init(reserved: bytes, size: int) -> IPCBufferDescriptor: cdef IPCBufferDescriptor self = IPCBufferDescriptor.__new__(IPCBufferDescriptor) self._payload = reserved self._size = size return self - def __reduce__(self): + def __reduce__(self) -> tuple[object, ...]: return IPCBufferDescriptor._init, (self._payload, self._size) @property - def size(self): + def size(self) -> int: return self._size cdef const void* payload_ptr(self) noexcept: @@ -103,51 +113,45 @@ cdef class IPCBufferDescriptor: cdef class IPCAllocationHandle: """Shareable handle to an IPC-enabled device memory pool.""" - def __init__(self, *arg, **kwargs): + def __init__(self, *arg, **kwargs) -> None: raise RuntimeError("IPCAllocationHandle objects cannot be instantiated directly. Please use MemoryResource APIs.") @classmethod - def _init(cls, handle: int, uuid): # no-cython-lint + def _init(cls, handle: int, uuid: uuid.UUID | None) -> IPCAllocationHandle: # no-cython-lint cdef IPCAllocationHandle self = IPCAllocationHandle.__new__(cls) - assert handle >= 0 - self._handle = handle + if handle < 0: + raise ValueError(f"Invalid allocation handle (fd) {handle}: must be non-negative") + self._h_fd = create_fd_handle(handle) self._uuid = uuid return self cpdef close(self): """Close the handle.""" - if self._handle >= 0: - try: - os.close(self._handle) - finally: - self._handle = -1 - - def __dealloc__(self): - self.close() + self._h_fd.reset() def __int__(self) -> int: - if self._handle < 0: + if not self._h_fd or as_intptr(self._h_fd) < 0: raise ValueError( f"Cannot convert IPCAllocationHandle to int: the handle (id={id(self)}) is closed." ) - return self._handle + return as_py(self._h_fd) @property def handle(self) -> int: - return self._handle + return as_py(self._h_fd) @property def uuid(self) -> uuid.UUID: return self._uuid -def _reduce_allocation_handle(alloc_handle): +def _reduce_allocation_handle(alloc_handle: IPCAllocationHandle) -> tuple[object, ...]: check_multiprocessing_start_method() df = multiprocessing.reduction.DupFd(alloc_handle.handle) return _reconstruct_allocation_handle, (type(alloc_handle), df, alloc_handle.uuid) -def _reconstruct_allocation_handle(cls, df, uuid): # no-cython-lint +def _reconstruct_allocation_handle(cls: type, df: object, uuid: uuid.UUID | None) -> IPCAllocationHandle: # no-cython-lint return cls._init(df.detach(), uuid) @@ -175,10 +179,14 @@ cdef Buffer Buffer_from_ipc_descriptor( """Import a buffer that was exported from another process.""" if not mr.is_ipc_enabled: raise RuntimeError("Memory resource is not IPC-enabled") - if stream is None: - # Note: match this behavior to _MemPool.allocate() - stream = default_stream() - cdef Stream s = stream + cdef size_t payload_size = len(ipc_descriptor._payload) + cdef size_t expected_size = sizeof(cydriver.CUmemPoolPtrExportData) + if payload_size < expected_size: + raise ValueError( + f"IPC buffer descriptor payload is {payload_size} bytes; " + f"expected at least {expected_size}" + ) + cdef Stream s = Stream_accept(stream) cdef DevicePtrHandle h_ptr = deviceptr_import_ipc( mr._h_pool, ipc_descriptor.payload_ptr(), @@ -186,7 +194,20 @@ cdef Buffer Buffer_from_ipc_descriptor( ) if not h_ptr: HANDLE_RETURN(get_last_error()) - return Buffer_from_deviceptr_handle(h_ptr, ipc_descriptor.size, mr, ipc_descriptor) + cdef size_t mapped_size = 0 + cdef size_t claimed_size = ipc_descriptor.size + with nogil: + HANDLE_RETURN(cydriver.cuPointerGetAttribute( + &mapped_size, + cydriver.CU_POINTER_ATTRIBUTE_RANGE_SIZE, + as_cu(h_ptr))) + if claimed_size > mapped_size: + h_ptr.reset() + raise ValueError( + f"IPC buffer descriptor size ({claimed_size}) exceeds " + f"mapped allocation extent ({mapped_size} bytes)" + ) + return Buffer_from_deviceptr_handle(h_ptr, claimed_size, mr, ipc_descriptor) # _MemPool IPC Implementation @@ -219,7 +240,13 @@ cdef _MemPool MP_from_allocation_handle(cls, alloc_handle): cdef int ipc_fd = int(alloc_handle) self._h_pool = create_mempool_handle_ipc(ipc_fd, IPC_HANDLE_TYPE) if not self._h_pool: - raise RuntimeError("Failed to import memory pool from IPC handle") + HANDLE_RETURN(get_last_error()) + raise RuntimeError( + f"Failed to import {cls.__name__} from an allocation handle: " + "cuda-core returned an empty memory pool handle without recording a CUDA error. " + "This is an internal cuda-core error; please report it with your CUDA driver, " + "CUDA Toolkit, and cuda-python versions." + ) self._ipc_data = IPCDataForMR(alloc_handle, True) # Register it. diff --git a/cuda_core/cuda/core/_memory/_legacy.py b/cuda_core/cuda/core/_memory/_legacy.py index 919c37fc50d..4acbcb54e3a 100644 --- a/cuda_core/cuda/core/_memory/_legacy.py +++ b/cuda_core/cuda/core/_memory/_legacy.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 @@ -7,7 +7,9 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from cuda.core._memory._buffer import DevicePointerT + from cuda.core._stream import Stream + from cuda.core.graph import GraphBuilder + from cuda.core.typing import DevicePointerType from cuda.core._memory._buffer import Buffer, MemoryResource from cuda.core._utils.cuda_utils import ( @@ -17,7 +19,7 @@ driver, ) -__all__ = ["LegacyPinnedMemoryResource", "_SynchronousMemoryResource"] +__all__ = ["LegacyPinnedMemoryResource"] class LegacyPinnedMemoryResource(MemoryResource): @@ -27,25 +29,30 @@ class LegacyPinnedMemoryResource(MemoryResource): # TODO: support creating this MR with flags that are later passed to cuMemHostAlloc? - def allocate(self, size, stream=None) -> Buffer: + def allocate(self, size: int, *, stream: Stream | GraphBuilder | None = None) -> Buffer: """Allocate a buffer of the requested size. + ``cuMemAllocHost`` is synchronous, so this resource ignores any + supplied stream. The argument is accepted (and validated when + non-``None``) for interface conformance with stream-ordered + memory resources. + Parameters ---------- size : int The size of the buffer to allocate, in bytes. stream : Stream, optional - Currently ignored + Keyword-only. Validated when provided but otherwise unused. Returns ------- Buffer The allocated buffer object, which is accessible on both host and device. """ - if stream is None: - from cuda.core._stream import default_stream + from cuda.core._stream import Stream_accept - stream = default_stream() + if stream is not None: + Stream_accept(stream) if size: err, ptr = driver.cuMemAllocHost(size) raise_if_driver_error(err) @@ -53,20 +60,23 @@ def allocate(self, size, stream=None) -> Buffer: ptr = 0 return Buffer._init(ptr, size, self) - def deallocate(self, ptr: DevicePointerT, size, stream): + def deallocate(self, ptr: DevicePointerType, size: int, *, stream: Stream | GraphBuilder | None = None) -> None: """Deallocate a buffer previously allocated by this resource. Parameters ---------- - ptr : :obj:`~_memory.DevicePointerT` + ptr : :obj:`~_memory.DevicePointerType` The pointer or handle to the buffer to deallocate. size : int The size of the buffer to deallocate, in bytes. - stream : Stream - The stream on which to perform the deallocation synchronously. + stream : Stream, optional + Keyword-only. If provided, ``stream.sync()`` is called before the + host allocation is freed. ``None`` skips the sync. """ + from cuda.core._stream import Stream_accept + if stream is not None: - stream.sync() + Stream_accept(stream).sync() if size: (err,) = driver.cuMemFreeHost(ptr) @@ -91,16 +101,18 @@ def device_id(self) -> int: class _SynchronousMemoryResource(MemoryResource): __slots__ = ("_device_id",) - def __init__(self, device_id): + def __init__(self, device_id: int) -> None: from .._device import Device self._device_id = Device(device_id).device_id - def allocate(self, size, stream=None) -> Buffer: - if stream is None: - from cuda.core._stream import default_stream + def allocate(self, size: int, *, stream: Stream | GraphBuilder | None = None) -> Buffer: + # cuMemAlloc is synchronous; stream is accepted (and validated) + # for interface conformance but not used. + from cuda.core._stream import Stream_accept - stream = default_stream() + if stream is not None: + Stream_accept(stream) if size: err, ptr = driver.cuMemAlloc(size) raise_if_driver_error(err) @@ -108,9 +120,11 @@ def allocate(self, size, stream=None) -> Buffer: ptr = 0 return Buffer._init(ptr, size, self) - def deallocate(self, ptr, size, stream): + def deallocate(self, ptr: DevicePointerType, size: int, *, stream: Stream | GraphBuilder | None = None) -> None: + from cuda.core._stream import Stream_accept + if stream is not None: - stream.sync() + Stream_accept(stream).sync() if size: (err,) = driver.cuMemFree(ptr) raise_if_driver_error(err) diff --git a/cuda_core/cuda/core/_memory/_managed_buffer.py b/cuda_core/cuda/core/_memory/_managed_buffer.py new file mode 100644 index 00000000000..9a8333e7094 --- /dev/null +++ b/cuda_core/cuda/core/_memory/_managed_buffer.py @@ -0,0 +1,252 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from collections.abc import Iterable, Iterator, MutableSet +from typing import TYPE_CHECKING, Any + +from cuda.core._device import Device +from cuda.core._host import Host +from cuda.core._memory._buffer import Buffer +from cuda.core._memory._managed_location import _coerce_location +from cuda.core._memory._managed_memory_ops import ( + _advise_one, + _do_single_discard_prefetch_py, + _do_single_discard_py, + _do_single_prefetch_py, + _read_preferred_location_v2, +) +from cuda.core._utils.cuda_utils import driver, handle_return +from cuda.core._utils.version import binding_version, driver_version + +if TYPE_CHECKING: + from cuda.core._memory._buffer import MemoryResource + from cuda.core._stream import Stream + from cuda.core.graph import GraphBuilder + + +_INT_SIZE = 4 + +# Enum aliases — referenced once per property write, so cache the lookup. +_ADV = driver.CUmem_advise +_SET_READ_MOSTLY = _ADV.CU_MEM_ADVISE_SET_READ_MOSTLY +_UNSET_READ_MOSTLY = _ADV.CU_MEM_ADVISE_UNSET_READ_MOSTLY +_SET_PREFERRED = _ADV.CU_MEM_ADVISE_SET_PREFERRED_LOCATION +_UNSET_PREFERRED = _ADV.CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION +_SET_ACCESSED_BY = _ADV.CU_MEM_ADVISE_SET_ACCESSED_BY +_UNSET_ACCESSED_BY = _ADV.CU_MEM_ADVISE_UNSET_ACCESSED_BY + +_RANGE = driver.CUmem_range_attribute +_ATTR_READ_MOSTLY = _RANGE.CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY +_ATTR_PREFERRED = _RANGE.CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION +_ATTR_ACCESSED_BY = _RANGE.CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY + + +def _get_int_attr(buf: Buffer, attribute: Any) -> int: + return int(handle_return(driver.cuMemRangeGetAttribute(_INT_SIZE, attribute, buf.handle, buf.size))) + + +def _query_accessed_by(buf: Buffer) -> list[Device | Host]: + """Read the live ``CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY`` list. + + Driver fills an int32 array: device id, ``-1`` = host, ``-2`` = empty. + Sized to ``cuDeviceGetCount() + 1`` (every visible device plus host). + """ + num_devices = handle_return(driver.cuDeviceGetCount()) + n = num_devices + 1 + raw = handle_return(driver.cuMemRangeGetAttribute(n * _INT_SIZE, _ATTR_ACCESSED_BY, buf.handle, buf.size)) + return [Host() if v == -1 else Device(v) for v in raw if v != -2] + + +class AccessedBySetProxy(MutableSet[Device | Host]): + """Live driver-backed view of ``set_accessed_by`` advice for a managed buffer. + + Reads (``__contains__``, ``__iter__``, ``len(...)``) call + ``cuMemRangeGetAttribute``; writes (``add``, ``discard``) call + ``cuMemAdvise``. There is no in-memory mirror, so the view always + reflects the current driver state. + + Note + ---- + The driver returns integer device ordinals (``-1`` for host); host + NUMA distinctions applied via ``Host(numa_id=...)`` collapse to a + generic ``Host()`` when iterating this set. + """ + + __slots__ = ("_buf",) + + def __init__(self, buf: ManagedBuffer): + self._buf = buf + + # Operators such as &|^ produce a plain set, not another proxy. + @classmethod + def _from_iterable(cls, it: Iterable[Any]) -> set[Device | Host]: # type: ignore[override] + return set(it) + + # --- abstract methods required by MutableSet --- + + def __contains__(self, location: object) -> bool: + if not isinstance(location, (Device, Host)): + return False + return location in _query_accessed_by(self._buf) + + def __iter__(self) -> Iterator[Device | Host]: + return iter(_query_accessed_by(self._buf)) + + def __len__(self) -> int: + return len(_query_accessed_by(self._buf)) + + def add(self, location: Device | Host) -> None: + """Apply ``set_accessed_by`` advice for ``location``.""" + if not isinstance(location, (Device, Host)): + raise TypeError(f"expected Device or Host, got {type(location).__name__}") + _advise_one(self._buf, _SET_ACCESSED_BY, location) + + def discard(self, location: Device | Host) -> None: + """Apply ``unset_accessed_by`` advice for ``location``. + + Per the ``MutableSet`` contract, ``discard`` is a no-op for elements + not in the set. ``set_accessed_by`` only accepts ``Device`` and the + generic ``Host()`` — NUMA-aware host variants (``Host(numa_id=...)``, + ``Host.numa_current()``) can never enter the set, so discarding them + is silently ignored rather than forwarded to the driver. + """ + if not isinstance(location, (Device, Host)): + return + if isinstance(location, Host) and (location.numa_id is not None or location.is_numa_current): + return + _advise_one(self._buf, _UNSET_ACCESSED_BY, location) + + def __repr__(self) -> str: + return f"AccessedBySetProxy({set(_query_accessed_by(self._buf))!r})" + + +class ManagedBuffer(Buffer): + """Managed (unified) memory buffer with a property-style advice API. + + Returned by :meth:`ManagedMemoryResource.allocate`, or wrap an + existing managed-memory pointer with :meth:`ManagedBuffer.from_handle`. + + Examples + -------- + >>> buf = mr.allocate(size) + >>> buf.read_mostly = True + >>> buf.preferred_location = Device(0) + >>> buf.accessed_by.add(Device(1)) + >>> buf.prefetch(Device(0), stream=stream) + + Note + ---- + On CUDA 13 builds, ``preferred_location`` round-trips full NUMA + information. On CUDA 12 builds, ``Host(numa_id=...)`` and + ``Host.numa_current()`` are rejected with ``TypeError`` at the call + boundary — only ``Device(...)`` and the generic ``Host()`` are + accepted. Use ``Host()`` to target the host on CUDA 12. + """ + + @classmethod + def from_handle( + cls, + ptr, + size: int, + mr: MemoryResource | None = None, + owner: object | None = None, + ) -> Buffer: + """Wrap an existing managed-memory pointer in a :class:`ManagedBuffer`. + + Use this when you have an externally-allocated managed pointer + and want the property-style advice API (:attr:`read_mostly`, + :attr:`preferred_location`, :attr:`accessed_by`). + + Parameters + ---------- + ptr : :obj:`~_memory.DevicePointerT` + Pointer to a managed allocation. + size : int + Allocation size in bytes. + mr : :obj:`~_memory.MemoryResource`, optional + Memory resource that owns ``ptr``. When provided, its + ``deallocate`` is called when the buffer is closed. + owner : object, optional + An object that keeps the underlying allocation alive. + ``owner`` and ``mr`` cannot both be specified. + """ + return cls._init(ptr, size, mr=mr, owner=owner) + + @property + def read_mostly(self) -> bool: + """Whether ``set_read_mostly`` advice is currently applied.""" + return _get_int_attr(self, _ATTR_READ_MOSTLY) != 0 + + @read_mostly.setter + def read_mostly(self, value: bool) -> None: + _advise_one(self, _SET_READ_MOSTLY if value else _UNSET_READ_MOSTLY, None) + + @property + def preferred_location(self) -> Device | Host | None: + """Currently applied ``set_preferred_location`` target, or ``None``. + + On CUDA 13 builds, fully round-trips ``Host(numa_id=N)``. On CUDA 12 + the legacy attribute carries only a device ordinal (or ``-1`` for + host), so ``Host(numa_id=N)`` set via the setter round-trips back + as ``Host()``. + """ + # The v2 path uses CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_{TYPE,ID}, + # both added in CUDA 13. Require both bindings and the runtime driver + # to be 13.0+; otherwise fall back to the legacy device-ordinal path. + # See PR #2054 / #2064 for prior bindings-only-check regressions. + if binding_version() >= (13, 0, 0) and driver_version() >= (13, 0, 0): + return _read_preferred_location_v2(self) + # CUDA 12 legacy path (no NUMA info available; also taken when + # bindings are 13.x but the runtime driver is still 12.x). + loc_id = _get_int_attr(self, _ATTR_PREFERRED) + if loc_id == -2: + return None + if loc_id == -1: + return Host() + return Device(loc_id) + + @preferred_location.setter + def preferred_location(self, value: Device | Host | None) -> None: + if value is None: + _advise_one(self, _UNSET_PREFERRED, None) + else: + _advise_one(self, _SET_PREFERRED, value) + + @property + def accessed_by(self) -> AccessedBySetProxy: + """Live set-like view of ``set_accessed_by`` locations.""" + return AccessedBySetProxy(self) + + @accessed_by.setter + def accessed_by(self, locations: Iterable[Device | Host]) -> None: + # Validate every target before issuing any cuMemAdvise so an invalid + # element can't leave accessed_by partially mutated. + target: set[Device | Host] = set() + for loc in locations: + if not isinstance(loc, (Device, Host)): + raise TypeError(f"accessed_by entries must be Device or Host, got {type(loc).__name__}") + target.add(loc) + for loc in target: + spec = _coerce_location(loc) + assert spec is not None + if spec.kind not in ("device", "host"): + raise ValueError(f"advise {_SET_ACCESSED_BY.name} does not support location_type='{spec.kind}'") + current = set(_query_accessed_by(self)) + for loc in current - target: + _advise_one(self, _UNSET_ACCESSED_BY, loc) + for loc in target - current: + _advise_one(self, _SET_ACCESSED_BY, loc) + + def prefetch(self, location: Device | Host, *, stream: Stream | GraphBuilder) -> None: + """Prefetch this range to ``location`` on ``stream``.""" + _do_single_prefetch_py(self, location, stream) + + def discard(self, *, stream: Stream | GraphBuilder) -> None: + """Discard this range's resident pages on ``stream`` (CUDA 13+).""" + _do_single_discard_py(self, stream) + + def discard_prefetch(self, location: Device | Host, *, stream: Stream | GraphBuilder) -> None: + """Discard this range and prefetch to ``location`` on ``stream`` (CUDA 13+).""" + _do_single_discard_prefetch_py(self, location, stream) diff --git a/cuda_core/cuda/core/_memory/_managed_location.py b/cuda_core/cuda/core/_memory/_managed_location.py new file mode 100644 index 00000000000..336f09f2eee --- /dev/null +++ b/cuda_core/cuda/core/_memory/_managed_location.py @@ -0,0 +1,84 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from dataclasses import dataclass +from typing import TYPE_CHECKING, Literal + +from cuda.core._utils.version import binding_version, driver_version + +if TYPE_CHECKING: + from cuda.core._device import Device + from cuda.core._host import Host + +_LocationKind = Literal["device", "host", "host_numa", "host_numa_current"] + + +@dataclass(frozen=True) +class _LocSpec: + """Internal location record produced by :func:`_coerce_location`. + + Carries the discriminator (``kind``) and the integer payload (``id``) + that the Cython layer in ``_managed_memory_ops.pyx`` consumes when + building ``CUmemLocation`` structs (CUDA 13+) or legacy device + ordinals (CUDA 12). + """ + + kind: _LocationKind + id: int = 0 + + +def _reject_numa_host_on_cuda12(spec: _LocSpec) -> None: + """Reject NUMA-host kinds on CUDA 12 builds at the public boundary. + + The CUDA 12 ``cuMemPrefetchAsync`` / ``cuMemAdvise`` ABI takes a + plain device ordinal (``-1`` for host), so it cannot represent a + specific host NUMA node. Rather than letting the operation fail + deep inside the Cython layer with ``RuntimeError``, raise a + ``TypeError`` at the call boundary with actionable wording. + """ + # The host-NUMA kinds map to CU_MEM_LOCATION_TYPE_HOST_NUMA{,_CURRENT}, + # both added in CUDA 13. Require both bindings and the runtime driver to + # be 13.0+; bindings-only is insufficient (PR #2054 / #2064 precedent). + if binding_version() >= (13, 0, 0) and driver_version() >= (13, 0, 0): + return + if spec.kind in ("host_numa", "host_numa_current"): + raise TypeError( + "Host(numa_id=...) / Host.numa_current() require both cuda-bindings 13.0+ " + "and a CUDA 13+ runtime driver; use Host() instead" + ) + + +def _coerce_location(value: Device | Host | None, *, allow_none: bool = False) -> _LocSpec | None: + """Coerce :class:`Device` / :class:`Host` / ``None`` to ``_LocSpec``. + + ``Host()``, ``Host(numa_id=N)``, and ``Host.numa_current()`` map to + the corresponding NUMA-aware kinds. On a CUDA 12 build of + ``cuda.core``, NUMA-host inputs are rejected with ``TypeError`` + because the legacy ABI cannot represent them. + """ + # Local imports to avoid import cycles (Device pulls in CUDA init). + from cuda.core._device import Device + from cuda.core._host import Host + + if isinstance(value, _LocSpec): + _reject_numa_host_on_cuda12(value) + return value + if isinstance(value, Device): + return _LocSpec(kind="device", id=value.device_id) + if isinstance(value, Host): + if value.is_numa_current: + spec = _LocSpec(kind="host_numa_current") + _reject_numa_host_on_cuda12(spec) + return spec + if value.numa_id is not None: + spec = _LocSpec(kind="host_numa", id=value.numa_id) + _reject_numa_host_on_cuda12(spec) + return spec + return _LocSpec(kind="host") + if value is None: + if allow_none: + return None + raise ValueError("location is required") + raise TypeError(f"location must be a Device, Host, or None; got {type(value).__name__}") diff --git a/cuda_core/cuda/core/_memory/_managed_memory_ops.pyi b/cuda_core/cuda/core/_memory/_managed_memory_ops.pyi new file mode 100644 index 00000000000..ca29265f103 --- /dev/null +++ b/cuda_core/cuda/core/_memory/_managed_memory_ops.pyi @@ -0,0 +1,105 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_memory/_managed_memory_ops.pyx + +from __future__ import annotations + +from collections.abc import Sequence + +from cuda.core._device import Device +from cuda.core._graph import GraphBuilder +from cuda.core._host import Host +from cuda.core._memory._buffer import Buffer +from cuda.core._stream import Stream +from cuda.core._utils.cuda_utils import driver + + +def discard_batch(stream: Stream | GraphBuilder, buffers: Sequence[Buffer]) -> None: + """Discard a batch of managed-memory ranges. + + Requires CUDA 13+. For a single buffer, use + :meth:`ManagedBuffer.discard` instead. + + Parameters + ---------- + stream : :class:`~_stream.Stream` | :class:`~graph.GraphBuilder` + Stream for the asynchronous discard. First positional, required + (mirrors :func:`launch`). + buffers : Sequence[:class:`Buffer`] + Two or more managed allocations to discard. Resident pages are + released without prefetching new contents; subsequent access is + satisfied by lazy migration. + + Raises + ------ + NotImplementedError + On a CUDA 12 build of ``cuda.core``. + """ + +def _do_single_discard_py(buf: Buffer, stream: Stream | GraphBuilder | None) -> None: + """Internal: single-buffer discard for ManagedBuffer.discard().""" + +def _advise_one(buf: Buffer, advice: driver.CUmem_advise, location: Device | Host | None) -> None: + """Internal: apply managed-memory advice to a single buffer. + + Used by :class:`ManagedBuffer` property setters. Not part of the + public API. + """ + +def prefetch_batch(stream: Stream | GraphBuilder, buffers: Sequence[Buffer], locations: Device | Host | Sequence[Device | Host]) -> None: + """Prefetch a batch of managed-memory ranges to target locations. + + Requires CUDA 13+. For a single buffer, use + :meth:`ManagedBuffer.prefetch` instead. + + Parameters + ---------- + stream : :class:`~_stream.Stream` | :class:`~graph.GraphBuilder` + Stream for the asynchronous prefetch. First positional, required + (mirrors :func:`launch`). + buffers : Sequence[:class:`Buffer`] + Two or more managed allocations to operate on. + locations : :class:`~cuda.core.Device` | :class:`~cuda.core.Host` | Sequence[...] + Target location(s). A single location applies to all buffers; a + sequence must match ``len(buffers)``. + + Notes + ----- + On a CUDA 12 build, falls back to a Python-level loop calling + ``cuMemPrefetchAsync`` per buffer (no batched driver entry point on + CUDA 12). CUDA 13 builds use ``cuMemPrefetchBatchAsync`` directly. + """ + +def _do_single_prefetch_py(buf: Buffer, location: Device | Host | None, stream: Stream | GraphBuilder | None) -> None: + """Internal: single-buffer prefetch for ManagedBuffer.prefetch(). + + Uses cuMemPrefetchAsync (works on CUDA 12 and 13). + """ + +def _read_preferred_location_v2(buf: Buffer) -> Device | Host | None: + ... + +def discard_prefetch_batch(stream: Stream | GraphBuilder, buffers: Sequence[Buffer], locations: Device | Host | Sequence[Device | Host]) -> None: + """Discard a batch of managed-memory ranges and prefetch them to target locations. + + Requires CUDA 13+. For a single buffer, use + :meth:`ManagedBuffer.discard_prefetch` instead. + + Parameters + ---------- + stream : :class:`~_stream.Stream` | :class:`~graph.GraphBuilder` + Stream for the asynchronous operation. First positional, required + (mirrors :func:`launch`). + buffers : Sequence[:class:`Buffer`] + Two or more managed allocations to discard and re-prefetch. + locations : :class:`~cuda.core.Device` | :class:`~cuda.core.Host` | Sequence[...] + Target location(s). A single location applies to all buffers; + a sequence must match ``len(buffers)``. + + Raises + ------ + NotImplementedError + On a CUDA 12 build of ``cuda.core``. + """ + +def _do_single_discard_prefetch_py(buf: Buffer, location: Device | Host | None, stream: Stream | GraphBuilder | None) -> None: + """Internal: single-buffer discard+prefetch for + ManagedBuffer.discard_prefetch().""" \ No newline at end of file diff --git a/cuda_core/cuda/core/_memory/_managed_memory_ops.pyx b/cuda_core/cuda/core/_memory/_managed_memory_ops.pyx new file mode 100644 index 00000000000..c07fb719dd9 --- /dev/null +++ b/cuda_core/cuda/core/_memory/_managed_memory_ops.pyx @@ -0,0 +1,454 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from collections.abc import Sequence +from typing import TYPE_CHECKING + +IF CUDA_CORE_BUILD_MAJOR >= 13: + from libcpp.vector cimport vector + +from cuda.bindings cimport cydriver +from cuda.core._memory._buffer cimport Buffer +from cuda.core._resource_handles cimport as_cu +from cuda.core._stream cimport Stream, Stream_accept +from cuda.core._utils.cuda_utils cimport HANDLE_RETURN + +from cuda.core._host import Host +from cuda.core._utils.cuda_utils import driver +from cuda.core._memory._managed_location import _coerce_location + +if TYPE_CHECKING: + from cuda.core._graph import GraphBuilder + from cuda.core._device import Device + +cdef frozenset _ALL_LOCATION_TYPES = frozenset(("device", "host", "host_numa", "host_numa_current")) +cdef frozenset _DEVICE_HOST_NUMA = frozenset(("device", "host", "host_numa")) +cdef frozenset _DEVICE_HOST_ONLY = frozenset(("device", "host")) + +cdef set _ADVICE_IGNORES_LOCATION = { + driver.CUmem_advise.CU_MEM_ADVISE_SET_READ_MOSTLY, + driver.CUmem_advise.CU_MEM_ADVISE_UNSET_READ_MOSTLY, + driver.CUmem_advise.CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION, +} + +cdef dict _ADVICE_ALLOWED_LOCTYPES = { + driver.CUmem_advise.CU_MEM_ADVISE_SET_READ_MOSTLY: _DEVICE_HOST_NUMA, + driver.CUmem_advise.CU_MEM_ADVISE_UNSET_READ_MOSTLY: _DEVICE_HOST_NUMA, + driver.CUmem_advise.CU_MEM_ADVISE_SET_PREFERRED_LOCATION: _ALL_LOCATION_TYPES, + driver.CUmem_advise.CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION: _DEVICE_HOST_NUMA, + driver.CUmem_advise.CU_MEM_ADVISE_SET_ACCESSED_BY: _DEVICE_HOST_ONLY, + driver.CUmem_advise.CU_MEM_ADVISE_UNSET_ACCESSED_BY: _DEVICE_HOST_ONLY, +} + + +cdef void _require_managed_buffer(Buffer self, str what): + # Buffer.is_managed handles both pointer-attribute and memory-resource + # paths (e.g. pool-allocated managed memory whose pointer attribute + # does not advertise CU_POINTER_ATTRIBUTE_IS_MANAGED). + if not self.is_managed: + raise ValueError(f"{what} requires a managed-memory allocation") + + +cdef tuple _coerce_batch_buffers(object buffers, str what): + """Coerce ``buffers`` to a tuple[Buffer, ...]; rejects a single Buffer. + + For single-buffer operations, use the corresponding ManagedBuffer + instance method instead. + """ + cdef Buffer buf + cdef list out + if isinstance(buffers, Buffer): + raise TypeError( + f"{what}: pass a sequence of Buffers; for a single buffer use " + f"the ManagedBuffer instance method" + ) + if isinstance(buffers, Sequence): + if not buffers: + raise ValueError(f"{what}: empty buffers sequence") + out = [] + for t in buffers: + buf = t + out.append(buf) + return tuple(out) + raise TypeError( + f"{what}: buffers must be a sequence of Buffer, " + f"got {type(buffers).__name__}" + ) + + +cdef tuple _broadcast_locations(object location, Py_ssize_t n, bint allow_none, str what): + cdef object coerced + if isinstance(location, Sequence): + if len(location) != n: + raise ValueError( + f"{what}: location length {len(location)} does not match " + f"targets length {n}" + ) + return tuple(_coerce_location(loc, allow_none=allow_none) for loc in location) + coerced = _coerce_location(location, allow_none=allow_none) + return tuple([coerced] * n) + + +IF CUDA_CORE_BUILD_MAJOR >= 13: + # Convert a _LocSpec dataclass to a cydriver.CUmemLocation struct. + cdef inline cydriver.CUmemLocation _to_cumemlocation(object loc): + cdef cydriver.CUmemLocation out + cdef str kind = loc.kind + if kind == "device": + out.type = cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE + out.id = loc.id + elif kind == "host": + out.type = cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_HOST + out.id = 0 + elif kind == "host_numa": + out.type = cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_HOST_NUMA + out.id = loc.id + else: # host_numa_current + out.type = cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT + out.id = 0 + return out +ELSE: + # CUDA 12 cuMemPrefetchAsync takes a device ordinal (-1 = host). + cdef inline int _to_legacy_device(object loc) except? -2: + cdef str kind = loc.kind + if kind == "device": + return loc.id + if kind == "host": + return -1 + raise RuntimeError( + "Host(numa_id=...) / Host.numa_current() require both cuda-bindings 13.0+ " + "and a CUDA 13+ runtime driver; use Host() instead" + ) + + +def discard_batch(stream: Stream | GraphBuilder, buffers: Sequence[Buffer]) -> None: + """Discard a batch of managed-memory ranges. + + Requires CUDA 13+. For a single buffer, use + :meth:`ManagedBuffer.discard` instead. + + Parameters + ---------- + stream : :class:`~_stream.Stream` | :class:`~graph.GraphBuilder` + Stream for the asynchronous discard. First positional, required + (mirrors :func:`launch`). + buffers : Sequence[:class:`Buffer`] + Two or more managed allocations to discard. Resident pages are + released without prefetching new contents; subsequent access is + satisfied by lazy migration. + + Raises + ------ + NotImplementedError + On a CUDA 12 build of ``cuda.core``. + """ + cdef tuple bufs = _coerce_batch_buffers(buffers, "discard_batch") + cdef Stream s = Stream_accept(stream) + + cdef Buffer buf + for buf in bufs: + _require_managed_buffer(buf, "discard_batch") + + _do_batch_discard(bufs, s) + + +def _do_single_discard_py(Buffer buf, stream: Stream | GraphBuilder | None) -> None: + """Internal: single-buffer discard for ManagedBuffer.discard().""" + _require_managed_buffer(buf, "discard") + cdef Stream s = Stream_accept(stream) + # No single-range cuMemDiscard exists; route through the batched call + # with count=1. + cdef tuple bufs = (buf,) + _do_batch_discard(bufs, s) + + +cdef void _do_batch_discard(tuple bufs, Stream s): + IF CUDA_CORE_BUILD_MAJOR >= 13: + cdef Py_ssize_t n = len(bufs) + cdef cydriver.CUstream hstream = as_cu(s._h_stream) + cdef vector[cydriver.CUdeviceptr] ptrs + cdef vector[size_t] sizes + ptrs.resize(n) + sizes.resize(n) + cdef Buffer buf + cdef Py_ssize_t i + for i in range(n): + buf = bufs[i] + ptrs[i] = as_cu(buf._h_ptr) + sizes[i] = buf._size + with nogil: + HANDLE_RETURN(cydriver.cuMemDiscardBatchAsync( + ptrs.data(), sizes.data(), n, 0, hstream, + )) + ELSE: + raise NotImplementedError( + "discard requires a CUDA 13 build of cuda.core" + ) + + +def _advise_one(Buffer buf, advice: driver.CUmem_advise, location: Device | Host | None) -> None: + """Internal: apply managed-memory advice to a single buffer. + + Used by :class:`ManagedBuffer` property setters. Not part of the + public API. + """ + _require_managed_buffer(buf, "advise") + if not isinstance(advice, driver.CUmem_advise): + raise TypeError( + f"advice must be a cuda.bindings.driver.CUmem_advise value, " + f"got {type(advice).__name__}" + ) + cdef frozenset allowed_kinds = _ADVICE_ALLOWED_LOCTYPES.get(advice) + if allowed_kinds is None: + raise ValueError(f"Unsupported advice value: {advice!r}") + cdef bint allow_none = advice in _ADVICE_IGNORES_LOCATION + cdef object loc = _coerce_location(location, allow_none=allow_none) + if loc is not None and loc.kind not in allowed_kinds: + raise ValueError( + f"advise {advice.name} does not support location_type='{loc.kind}'" + ) + _do_single_advise(buf, advice, loc, allow_none) + + +cdef void _do_single_advise(Buffer buf, object advice_value, object loc, bint allow_none): + cdef cydriver.CUdeviceptr cu_ptr = as_cu(buf._h_ptr) + cdef size_t nbytes = buf._size + cdef cydriver.CUmem_advise advice_enum = (int(advice_value)) + IF CUDA_CORE_BUILD_MAJOR >= 13: + cdef cydriver.CUmemLocation cu_loc + if loc is None: + # Driver ignores location for read_mostly / unset_preferred_location + # advice values but still validates the CUmemLocation; pass a + # host placeholder. + cu_loc.type = cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_HOST + cu_loc.id = 0 + else: + cu_loc = _to_cumemlocation(loc) + with nogil: + HANDLE_RETURN(cydriver.cuMemAdvise(cu_ptr, nbytes, advice_enum, cu_loc)) + ELSE: + cdef int dev_int = -1 if loc is None else _to_legacy_device(loc) + with nogil: + HANDLE_RETURN(cydriver.cuMemAdvise(cu_ptr, nbytes, advice_enum, dev_int)) + + +def prefetch_batch( + stream: Stream | GraphBuilder, + buffers: Sequence[Buffer], + locations: Device | Host | Sequence[Device | Host], +) -> None: + """Prefetch a batch of managed-memory ranges to target locations. + + Requires CUDA 13+. For a single buffer, use + :meth:`ManagedBuffer.prefetch` instead. + + Parameters + ---------- + stream : :class:`~_stream.Stream` | :class:`~graph.GraphBuilder` + Stream for the asynchronous prefetch. First positional, required + (mirrors :func:`launch`). + buffers : Sequence[:class:`Buffer`] + Two or more managed allocations to operate on. + locations : :class:`~cuda.core.Device` | :class:`~cuda.core.Host` | Sequence[...] + Target location(s). A single location applies to all buffers; a + sequence must match ``len(buffers)``. + + Notes + ----- + On a CUDA 12 build, falls back to a Python-level loop calling + ``cuMemPrefetchAsync`` per buffer (no batched driver entry point on + CUDA 12). CUDA 13 builds use ``cuMemPrefetchBatchAsync`` directly. + """ + cdef tuple bufs = _coerce_batch_buffers(buffers, "prefetch_batch") + cdef Py_ssize_t n = len(bufs) + cdef tuple locs = _broadcast_locations(locations, n, False, "prefetch_batch") + cdef Stream s = Stream_accept(stream) + + cdef Buffer buf + for buf in bufs: + _require_managed_buffer(buf, "prefetch_batch") + + _do_batch_prefetch(bufs, locs, s) + + +def _do_single_prefetch_py(Buffer buf, location: Device | Host | None, stream: Stream | GraphBuilder | None) -> None: + """Internal: single-buffer prefetch for ManagedBuffer.prefetch(). + + Uses cuMemPrefetchAsync (works on CUDA 12 and 13). + """ + _require_managed_buffer(buf, "prefetch") + cdef object loc = _coerce_location(location, allow_none=False) + cdef Stream s = Stream_accept(stream) + _do_single_prefetch(buf, loc, s) + + +cdef void _do_single_prefetch(Buffer buf, object loc, Stream s): + cdef cydriver.CUdeviceptr cu_ptr = as_cu(buf._h_ptr) + cdef size_t nbytes = buf._size + cdef cydriver.CUstream hstream = as_cu(s._h_stream) + IF CUDA_CORE_BUILD_MAJOR >= 13: + cdef cydriver.CUmemLocation cu_loc = _to_cumemlocation(loc) + with nogil: + HANDLE_RETURN(cydriver.cuMemPrefetchAsync(cu_ptr, nbytes, cu_loc, 0, hstream)) + ELSE: + cdef int dev_int = _to_legacy_device(loc) + with nogil: + HANDLE_RETURN(cydriver.cuMemPrefetchAsync(cu_ptr, nbytes, dev_int, hstream)) + + +IF CUDA_CORE_BUILD_MAJOR >= 13: + # Function-pointer type for cuMemPrefetchBatchAsync / + # cuMemDiscardAndPrefetchBatchAsync; both have identical signatures. + ctypedef cydriver.CUresult (*_BatchPrefetchFn)( + cydriver.CUdeviceptr*, size_t*, size_t, + cydriver.CUmemLocation*, size_t*, size_t, + unsigned long long, cydriver.CUstream, + ) except ?cydriver.CUDA_ERROR_NOT_FOUND nogil + + + def _read_preferred_location_v2(Buffer buf) -> Device | Host | None: + """Internal: read preferred_location with full NUMA detail. + + Bypasses cuda.bindings.driver.cuMemRangeGetAttribute (whose + attribute allowlist doesn't yet include the cu13 _TYPE / _ID + attributes) by calling cydriver directly. + + Returns Device | Host | None. + """ + cdef cydriver.CUdeviceptr cu_ptr = as_cu(buf._h_ptr) + cdef size_t nbytes = buf._size + cdef int loc_type = 0 + cdef int loc_id = 0 + with nogil: + HANDLE_RETURN(cydriver.cuMemRangeGetAttribute( + &loc_type, sizeof(int), + cydriver.CUmem_range_attribute.CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_TYPE, + cu_ptr, nbytes, + )) + HANDLE_RETURN(cydriver.cuMemRangeGetAttribute( + &loc_id, sizeof(int), + cydriver.CUmem_range_attribute.CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_ID, + cu_ptr, nbytes, + )) + if loc_type == cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE: + from cuda.core._device import Device + return Device(loc_id) + if loc_type == cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_HOST: + return Host() + if loc_type == cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_HOST_NUMA: + return Host(numa_id=loc_id) + if loc_type == cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT: + return Host.numa_current() + return None # CU_MEM_LOCATION_TYPE_INVALID — no preferred location + + + cdef void _do_batch_prefetch_op(tuple bufs, tuple locs, Stream s, _BatchPrefetchFn fn): + """Shared body for batched prefetch / discard-and-prefetch.""" + cdef Py_ssize_t n = len(bufs) + cdef cydriver.CUstream hstream = as_cu(s._h_stream) + cdef vector[cydriver.CUdeviceptr] ptrs + cdef vector[size_t] sizes + cdef vector[cydriver.CUmemLocation] loc_arr + cdef vector[size_t] loc_indices + ptrs.resize(n) + sizes.resize(n) + loc_arr.resize(n) + loc_indices.resize(n) + cdef Buffer buf + cdef Py_ssize_t i + for i in range(n): + buf = bufs[i] + ptrs[i] = as_cu(buf._h_ptr) + sizes[i] = buf._size + loc_arr[i] = _to_cumemlocation(locs[i]) + loc_indices[i] = i + with nogil: + HANDLE_RETURN(fn( + ptrs.data(), sizes.data(), n, + loc_arr.data(), loc_indices.data(), n, + 0, hstream, + )) +ELSE: + def _read_preferred_location_v2(Buffer buf) -> Device | Host | None: + # Symbol exists so _managed_buffer.py can `from ... import + # _read_preferred_location_v2` unconditionally at module top. + # `ManagedBuffer.preferred_location` gates on both + # binding_version() and driver_version() >= (13, 0, 0) before + # calling, so this path is unreachable on a cu12 build. + raise NotImplementedError( + "_read_preferred_location_v2 requires a CUDA 13 build of cuda.core" + ) + + +cdef void _do_batch_prefetch(tuple bufs, tuple locs, Stream s): + IF CUDA_CORE_BUILD_MAJOR >= 13: + _do_batch_prefetch_op(bufs, locs, s, cydriver.cuMemPrefetchBatchAsync) + ELSE: + # cu12 has no cuMemPrefetchBatchAsync; loop per-range. + cdef Buffer buf + cdef Py_ssize_t i + cdef Py_ssize_t n = len(bufs) + for i in range(n): + buf = bufs[i] + _do_single_prefetch(buf, locs[i], s) + + +def discard_prefetch_batch( + stream: Stream | GraphBuilder, + buffers: Sequence[Buffer], + locations: Device | Host | Sequence[Device | Host], +) -> None: + """Discard a batch of managed-memory ranges and prefetch them to target locations. + + Requires CUDA 13+. For a single buffer, use + :meth:`ManagedBuffer.discard_prefetch` instead. + + Parameters + ---------- + stream : :class:`~_stream.Stream` | :class:`~graph.GraphBuilder` + Stream for the asynchronous operation. First positional, required + (mirrors :func:`launch`). + buffers : Sequence[:class:`Buffer`] + Two or more managed allocations to discard and re-prefetch. + locations : :class:`~cuda.core.Device` | :class:`~cuda.core.Host` | Sequence[...] + Target location(s). A single location applies to all buffers; + a sequence must match ``len(buffers)``. + + Raises + ------ + NotImplementedError + On a CUDA 12 build of ``cuda.core``. + """ + cdef tuple bufs = _coerce_batch_buffers(buffers, "discard_prefetch_batch") + cdef Py_ssize_t n = len(bufs) + cdef tuple locs = _broadcast_locations(locations, n, False, "discard_prefetch_batch") + cdef Stream s = Stream_accept(stream) + + cdef Buffer buf + for buf in bufs: + _require_managed_buffer(buf, "discard_prefetch_batch") + + _do_batch_discard_prefetch(bufs, locs, s) + + +def _do_single_discard_prefetch_py(Buffer buf, location: Device | Host | None, stream: Stream | GraphBuilder | None) -> None: + """Internal: single-buffer discard+prefetch for + ManagedBuffer.discard_prefetch().""" + _require_managed_buffer(buf, "discard_prefetch") + cdef object loc = _coerce_location(location, allow_none=False) + cdef Stream s = Stream_accept(stream) + cdef tuple bufs = (buf,) + cdef tuple locs = (loc,) + _do_batch_discard_prefetch(bufs, locs, s) + + +cdef void _do_batch_discard_prefetch(tuple bufs, tuple locs, Stream s): + IF CUDA_CORE_BUILD_MAJOR >= 13: + _do_batch_prefetch_op(bufs, locs, s, cydriver.cuMemDiscardAndPrefetchBatchAsync) + ELSE: + raise NotImplementedError( + "discard_prefetch requires a CUDA 13 build of cuda.core" + ) diff --git a/cuda_core/cuda/core/_memory/_managed_memory_resource.pyi b/cuda_core/cuda/core/_memory/_managed_memory_resource.pyi new file mode 100644 index 00000000000..7f3f584e5ca --- /dev/null +++ b/cuda_core/cuda/core/_memory/_managed_memory_resource.pyi @@ -0,0 +1,133 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_memory/_managed_memory_resource.pyx + +from __future__ import annotations + +from dataclasses import dataclass + +from cuda.core._memory._managed_buffer import ManagedBuffer +from cuda.core._memory._memory_pool import _MemPool +from cuda.core._stream import Stream +from cuda.core.graph import GraphBuilder +from cuda.core.typing import ManagedMemoryLocationType + + +@dataclass +class ManagedMemoryResourceOptions: + """Customizable :obj:`~_memory.ManagedMemoryResource` options. + + Attributes + ---------- + preferred_location : int | None, optional + A location identifier (device ordinal or NUMA node ID) whose + meaning depends on ``preferred_location_type``. + (Default to ``None``) + + preferred_location_type : ManagedMemoryLocationType | str | None, optional + Controls how ``preferred_location`` is interpreted. + + When set to ``None`` (the default), legacy behavior is used: + ``preferred_location`` is interpreted as a device ordinal, + ``-1`` for host, or ``None`` for no preference. + + When set explicitly, the type determines both the kind of + preferred location and the valid values for + ``preferred_location``: + + - ``"device"``: prefer a specific GPU. ``preferred_location`` + must be a device ordinal (``>= 0``). + - ``"host"``: prefer host memory (OS-managed NUMA placement). + ``preferred_location`` must be ``None``. + - ``"host_numa"``: prefer a specific host NUMA node. + ``preferred_location`` must be a NUMA node ID (``>= 0``), + or ``None`` to derive the NUMA node from the current CUDA + device's ``host_numa_id`` attribute (requires an active + CUDA context). + + (Default to ``None``) + """ + preferred_location: int | None = None + preferred_location_type: ManagedMemoryLocationType | str | None = None + +class ManagedMemoryResource(_MemPool): + """ + A managed memory resource managing a stream-ordered memory pool. + + Managed memory is accessible from both the host and device, with automatic + migration between them as needed. + + Parameters + ---------- + options : ManagedMemoryResourceOptions + Memory resource creation options. + + If set to `None`, the memory resource uses the driver's current + stream-ordered memory pool. If no memory pool is set as current, + the driver's default memory pool is used. + + 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 + managed memory resource does not own the pool (`is_handle_owned` is + `False`), and closing the resource has no effect. + + Notes + ----- + IPC (Inter-Process Communication) is not currently supported for managed + memory pools. + """ + + def __init__(self, options: ManagedMemoryResourceOptions | dict[str, object] | None=None) -> None: + ... + + def allocate(self, size: int, *, stream: Stream | GraphBuilder) -> ManagedBuffer: + """Allocate a managed-memory buffer of the requested size. + + Parameters + ---------- + size : int + The size of the buffer to allocate, in bytes. + stream : :obj:`~_stream.Stream` + Keyword-only. The stream on which to perform the allocation + asynchronously. Must be passed explicitly; pass + ``device.default_stream`` to use the default stream. + + Returns + ------- + ManagedBuffer + A :class:`ManagedBuffer` (a :class:`Buffer` subclass) that + exposes the property-style advice API + (``read_mostly``, ``preferred_location``, ``accessed_by``) + and instance methods (``prefetch``, ``discard``, + ``discard_prefetch``). + """ + + @property + def device_id(self) -> int: + """The preferred device ordinal, or -1 if the preferred location is not a device.""" + + @property + def preferred_location(self) -> tuple[ManagedMemoryLocationType, int | None] | None: + """The preferred location for managed memory allocations. + + Returns ``None`` if no preferred location is set (driver decides), + or a tuple ``(type, id)`` where *type* is one of ``"device"``, + ``"host"``, or ``"host_numa"``, and *id* is the device ordinal, + ``None`` (for ``"host"``), or the NUMA node ID, respectively. + """ + + @property + def is_device_accessible(self) -> bool: + """Return True. This memory resource provides device-accessible buffers.""" + + @property + def is_host_accessible(self) -> bool: + """Return True. This memory resource provides host-accessible buffers.""" + + @property + def is_managed(self) -> bool: + """Return True. This memory resource provides managed (unified) memory buffers.""" +__all__ = ['ManagedMemoryResource', 'ManagedMemoryResourceOptions'] + +def reset_concurrent_access_warning() -> None: + """Reset the concurrent access warning flag for testing purposes.""" \ No newline at end of file diff --git a/cuda_core/cuda/core/_memory/_managed_memory_resource.pyx b/cuda_core/cuda/core/_memory/_managed_memory_resource.pyx index 4f24bd8d110..41b7a992bed 100644 --- a/cuda_core/cuda/core/_memory/_managed_memory_resource.pyx +++ b/cuda_core/cuda/core/_memory/_managed_memory_resource.pyx @@ -6,16 +6,24 @@ from __future__ import annotations from cuda.bindings cimport cydriver -from cuda.core._memory._memory_pool cimport _MemPool, MP_init_create_pool, MP_init_current_pool -from cuda.core._utils.cuda_utils cimport ( - HANDLE_RETURN, - check_or_create_options, -) +from cuda.core._memory._memory_pool cimport _MemPool, _MP_allocate +from cuda.core._memory._memory_pool cimport MP_init_create_pool, MP_init_current_pool # no-cython-lint +from cuda.core._stream cimport Stream, Stream_accept +from cuda.core._utils.cuda_utils cimport HANDLE_RETURN +from cuda.core._utils.cuda_utils cimport check_or_create_options # no-cython-lint +from cuda.core._utils.cuda_utils import CUDAError # no-cython-lint from dataclasses import dataclass import threading +from typing import TYPE_CHECKING import warnings +from cuda.core._memory._managed_buffer import ManagedBuffer +from cuda.core.typing import ManagedMemoryLocationType + +if TYPE_CHECKING: + from cuda.core.graph import GraphBuilder + __all__ = ['ManagedMemoryResource', 'ManagedMemoryResourceOptions'] @@ -30,7 +38,7 @@ cdef class ManagedMemoryResourceOptions: meaning depends on ``preferred_location_type``. (Default to ``None``) - preferred_location_type : ``"device"`` | ``"host"`` | ``"host_numa"`` | None, optional + preferred_location_type : ManagedMemoryLocationType | str | None, optional Controls how ``preferred_location`` is interpreted. When set to ``None`` (the default), legacy behavior is used: @@ -54,7 +62,7 @@ cdef class ManagedMemoryResourceOptions: (Default to ``None``) """ preferred_location: int | None = None - preferred_location_type: str | None = None + preferred_location_type: ManagedMemoryLocationType | str | None = None cdef class ManagedMemoryResource(_MemPool): @@ -86,9 +94,36 @@ cdef class ManagedMemoryResource(_MemPool): memory pools. """ - def __init__(self, options=None): + def __init__(self, options: ManagedMemoryResourceOptions | dict[str, object] | None = None) -> None: _MMR_init(self, options) + def allocate(self, size_t size, *, stream: Stream | GraphBuilder) -> ManagedBuffer: + """Allocate a managed-memory buffer of the requested size. + + Parameters + ---------- + size : int + The size of the buffer to allocate, in bytes. + stream : :obj:`~_stream.Stream` + Keyword-only. The stream on which to perform the allocation + asynchronously. Must be passed explicitly; pass + ``device.default_stream`` to use the default stream. + + Returns + ------- + ManagedBuffer + A :class:`ManagedBuffer` (a :class:`Buffer` subclass) that + exposes the property-style advice API + (``read_mostly``, ``preferred_location``, ``accessed_by``) + and instance methods (``prefetch``, ``discard``, + ``discard_prefetch``). + """ + assert isinstance(stream, Stream), "Only Stream is supported for managed memory allocations" + if self.is_mapped: + raise TypeError("Cannot allocate from a mapped IPC-enabled memory resource") + cdef Stream s = Stream_accept(stream) + return _MP_allocate(self, size, s, ManagedBuffer) + @property def device_id(self) -> int: """The preferred device ordinal, or -1 if the preferred location is not a device.""" @@ -97,7 +132,7 @@ cdef class ManagedMemoryResource(_MemPool): return -1 @property - def preferred_location(self) -> tuple | None: + def preferred_location(self) -> tuple[ManagedMemoryLocationType, int | None] | None: """The preferred location for managed memory allocations. Returns ``None`` if no preferred location is set (driver decides), @@ -108,8 +143,8 @@ cdef class ManagedMemoryResource(_MemPool): if self._pref_loc_type is None: return None if self._pref_loc_type == "host": - return ("host", None) - return (self._pref_loc_type, self._pref_loc_id) + return (ManagedMemoryLocationType.HOST, None) + return (ManagedMemoryLocationType(self._pref_loc_type), self._pref_loc_id) @property def is_device_accessible(self) -> bool: @@ -121,6 +156,11 @@ cdef class ManagedMemoryResource(_MemPool): """Return True. This memory resource provides host-accessible buffers.""" return True + @property + def is_managed(self) -> bool: + """Return True. This memory resource provides managed (unified) memory buffers.""" + return True + IF CUDA_CORE_BUILD_MAJOR >= 13: cdef tuple _VALID_LOCATION_TYPES = ("device", "host", "host_numa") @@ -226,12 +266,25 @@ cdef inline _MMR_init(ManagedMemoryResource self, options): ) if opts is None: - MP_init_current_pool( - self, - loc_type, - loc_id, - cydriver.CUmemAllocationType.CU_MEM_ALLOCATION_TYPE_MANAGED, - ) + try: + MP_init_current_pool( + self, + loc_type, + loc_id, + cydriver.CUmemAllocationType.CU_MEM_ALLOCATION_TYPE_MANAGED, + ) + except CUDAError as e: + if "CUDA_ERROR_NOT_SUPPORTED" in str(e): + from .._device import Device + if not Device().properties.concurrent_managed_access: + raise RuntimeError( + "The default memory pool on this device does not support " + "managed allocations (concurrent managed access is not " + "available). Use " + "ManagedMemoryResource(options=ManagedMemoryResourceOptions(...)) " + "to create a dedicated managed pool." + ) from e + raise else: MP_init_create_pool( self, @@ -285,7 +338,7 @@ cdef inline _check_concurrent_managed_access(): _concurrent_access_warned = True -def reset_concurrent_access_warning(): +def reset_concurrent_access_warning() -> None: """Reset the concurrent access warning flag for testing purposes.""" global _concurrent_access_warned _concurrent_access_warned = False diff --git a/cuda_core/cuda/core/_memory/_memory_pool.pxd b/cuda_core/cuda/core/_memory/_memory_pool.pxd index 45062826e4d..3a6c3107cfd 100644 --- a/cuda_core/cuda/core/_memory/_memory_pool.pxd +++ b/cuda_core/cuda/core/_memory/_memory_pool.pxd @@ -3,9 +3,10 @@ # SPDX-License-Identifier: Apache-2.0 from cuda.bindings cimport cydriver -from cuda.core._memory._buffer cimport MemoryResource +from cuda.core._memory._buffer cimport Buffer, MemoryResource from cuda.core._memory._ipc cimport IPCDataForMR from cuda.core._resource_handles cimport MemoryPoolHandle +from cuda.core._stream cimport Stream cdef class _MemPool(MemoryResource): @@ -36,11 +37,7 @@ cdef int MP_init_current_pool( cdef int MP_raise_release_threshold(_MemPool self) except? -1 -cdef class _MemPoolAttributes: - cdef: - MemoryPoolHandle _h_pool - - @staticmethod - cdef _MemPoolAttributes _init(MemoryPoolHandle h_pool) - - cdef int _getattribute(self, cydriver.CUmemPool_attribute attr_enum, void* value) except? -1 +# Allocate from this pool, returning an instance of `cls` (defaulting to +# Buffer). Subclasses (e.g. ManagedMemoryResource) pass their own buffer +# subclass so their `allocate` returns the typed object. +cdef Buffer _MP_allocate(_MemPool self, size_t size, Stream stream, type cls = *) diff --git a/cuda_core/cuda/core/_memory/_memory_pool.pyi b/cuda_core/cuda/core/_memory/_memory_pool.pyi new file mode 100644 index 00000000000..7f8c64aedda --- /dev/null +++ b/cuda_core/cuda/core/_memory/_memory_pool.pyi @@ -0,0 +1,129 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_memory/_memory_pool.pyx + +from __future__ import annotations + +import uuid + +import cython +from cuda.core._memory._buffer import Buffer, MemoryResource +from cuda.core._stream import Stream +from cuda.core.graph import GraphBuilder +from cuda.core.typing import DevicePointerType + + +class _MemPoolAttributes: + """Provides access to memory pool attributes.""" + + def __init__(self, *args, **kwargs) -> None: + ... + + def __repr__(self) -> str: + ... + + @property + def reuse_follow_event_dependencies(self) -> bool: + """Allow memory to be reused when there are event dependencies between streams.""" + + @property + def reuse_allow_opportunistic(self) -> bool: + """Allow reuse of completed frees without dependencies.""" + + @property + def reuse_allow_internal_dependencies(self) -> bool: + """Allow insertion of new stream dependencies for memory reuse.""" + + @property + def release_threshold(self) -> int: + """Amount of reserved memory to hold before OS release.""" + + @property + def reserved_mem_current(self) -> int: + """Current amount of backing memory allocated.""" + + @property + def reserved_mem_high(self) -> int: + """High watermark of backing memory allocated.""" + + @property + def used_mem_current(self) -> int: + """Current amount of memory in use.""" + + @property + def used_mem_high(self) -> int: + """High watermark of memory in use.""" + +class _MemPool(MemoryResource): + + def __cinit__(self) -> None: + ... + + def close(self) -> None: + """ + Close the memory resource and destroy the associated memory pool + if owned. + """ + + def allocate(self, size: int, *, stream: Stream | GraphBuilder) -> Buffer: + """Allocate a buffer of the requested size. + + Parameters + ---------- + size : int + The size of the buffer to allocate, in bytes. + stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` + Keyword-only. The stream on which to perform the allocation + asynchronously. Must be passed explicitly; pass + ``device.default_stream`` to use the default stream. + + Returns + ------- + Buffer + The allocated buffer object, which is accessible on the device that this memory + resource was created for. + """ + + def deallocate(self, ptr: DevicePointerType, size: int, *, stream: Stream | GraphBuilder) -> None: + """Deallocate a buffer previously allocated by this resource. + + Parameters + ---------- + ptr : :obj:`~_memory.DevicePointerType` + The pointer or handle to the buffer to deallocate. + size : int + The size of the buffer to deallocate, in bytes. + stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` + Keyword-only. The stream on which to perform the deallocation + asynchronously. Must be passed explicitly; pass + ``device.default_stream`` to use the default stream. + """ + + @property + @cython.critical_section + def attributes(self) -> _MemPoolAttributes: + """Memory pool attributes.""" + + @property + def handle(self) -> object: + """Handle to the underlying memory pool.""" + + @property + def is_handle_owned(self) -> bool: + """Whether the memory resource handle is owned. If False, ``close`` has no effect.""" + + @property + def is_ipc_enabled(self) -> bool: + """Whether this memory resource has IPC enabled.""" + + @property + def is_mapped(self) -> bool: + """ + Whether this is a mapping of an IPC-enabled memory resource from + another process. If True, allocation is not permitted. + """ + + @property + def uuid(self) -> uuid.UUID | None: + """ + A universally unique identifier for this memory resource. Meaningful + only for IPC-enabled memory resources. + """ \ No newline at end of file diff --git a/cuda_core/cuda/core/_memory/_memory_pool.pyx b/cuda_core/cuda/core/_memory/_memory_pool.pyx index a37ea17ab36..cf7c48068f1 100644 --- a/cuda_core/cuda/core/_memory/_memory_pool.pyx +++ b/cuda_core/cuda/core/_memory/_memory_pool.pyx @@ -4,6 +4,7 @@ from __future__ import annotations +cimport cython from libc.limits cimport ULLONG_MAX from libc.stdint cimport uintptr_t from libc.string cimport memset @@ -11,26 +12,36 @@ from libc.string cimport memset from cuda.bindings cimport cydriver from cuda.core._memory._buffer cimport Buffer, Buffer_from_deviceptr_handle, MemoryResource from cuda.core._memory cimport _ipc -from cuda.core._stream cimport default_stream, Stream_accept, Stream +from cuda.core._stream cimport Stream_accept, Stream from cuda.core._resource_handles cimport ( MemoryPoolHandle, DevicePtrHandle, create_mempool_handle, - create_mempool_handle_ref, deviceptr_alloc_from_pool, + get_last_error, as_cu, as_py, ) +from cuda.core._resource_handles cimport create_mempool_handle_ref # no-cython-lint from cuda.core._utils.cuda_utils cimport ( HANDLE_RETURN, ) +import uuid +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from cuda.core.graph import GraphBuilder + from cuda.core.typing import DevicePointerType + cdef class _MemPoolAttributes: """Provides access to memory pool attributes.""" + cdef: + MemoryPoolHandle _h_pool - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: raise RuntimeError("_MemPoolAttributes cannot be instantiated directly. Please use MemoryResource APIs.") @staticmethod @@ -39,7 +50,7 @@ cdef class _MemPoolAttributes: self._h_pool = h_pool return self - def __repr__(self): + def __repr__(self) -> str: return f"{self.__class__.__name__}(%s)" % ", ".join( f"{attr}={getattr(self, attr)}" for attr in dir(self) if not attr.startswith("_") @@ -51,56 +62,56 @@ cdef class _MemPoolAttributes: return 0 @property - def reuse_follow_event_dependencies(self): + def reuse_follow_event_dependencies(self) -> bool: """Allow memory to be reused when there are event dependencies between streams.""" cdef int value self._getattribute(cydriver.CUmemPool_attribute.CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES, &value) return bool(value) @property - def reuse_allow_opportunistic(self): + def reuse_allow_opportunistic(self) -> bool: """Allow reuse of completed frees without dependencies.""" cdef int value self._getattribute(cydriver.CUmemPool_attribute.CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC, &value) return bool(value) @property - def reuse_allow_internal_dependencies(self): + def reuse_allow_internal_dependencies(self) -> bool: """Allow insertion of new stream dependencies for memory reuse.""" cdef int value self._getattribute(cydriver.CUmemPool_attribute.CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES, &value) return bool(value) @property - def release_threshold(self): + def release_threshold(self) -> int: """Amount of reserved memory to hold before OS release.""" cdef cydriver.cuuint64_t value self._getattribute(cydriver.CUmemPool_attribute.CU_MEMPOOL_ATTR_RELEASE_THRESHOLD, &value) return int(value) @property - def reserved_mem_current(self): + def reserved_mem_current(self) -> int: """Current amount of backing memory allocated.""" cdef cydriver.cuuint64_t value self._getattribute(cydriver.CUmemPool_attribute.CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT, &value) return int(value) @property - def reserved_mem_high(self): + def reserved_mem_high(self) -> int: """High watermark of backing memory allocated.""" cdef cydriver.cuuint64_t value self._getattribute(cydriver.CUmemPool_attribute.CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH, &value) return int(value) @property - def used_mem_current(self): + def used_mem_current(self) -> int: """Current amount of memory in use.""" cdef cydriver.cuuint64_t value self._getattribute(cydriver.CUmemPool_attribute.CU_MEMPOOL_ATTR_USED_MEM_CURRENT, &value) return int(value) @property - def used_mem_high(self): + def used_mem_high(self) -> int: """High watermark of memory in use.""" cdef cydriver.cuuint64_t value self._getattribute(cydriver.CUmemPool_attribute.CU_MEMPOOL_ATTR_USED_MEM_HIGH, &value) @@ -109,29 +120,30 @@ cdef class _MemPoolAttributes: cdef class _MemPool(MemoryResource): - def __cinit__(self): + def __cinit__(self) -> None: # Note: subclasses use MP_init_create_pool or MP_init_current_pool to initialize. self._mempool_owned = False self._ipc_data = None self._attributes = None - def close(self): + def close(self) -> None: """ Close the memory resource and destroy the associated memory pool if owned. """ _MP_close(self) - def allocate(self, size_t size, stream: Stream | GraphBuilder | None = None) -> Buffer: + def allocate(self, size_t size, *, stream: Stream | GraphBuilder) -> Buffer: """Allocate a buffer of the requested size. Parameters ---------- size : int The size of the buffer to allocate, in bytes. - stream : :obj:`~_stream.Stream` | :obj:`~_graph.GraphBuilder`, optional - The stream on which to perform the allocation asynchronously. - If None, an internal stream is used. + stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` + Keyword-only. The stream on which to perform the allocation + asynchronously. Must be passed explicitly; pass + ``device.default_stream`` to use the default stream. Returns ------- @@ -141,27 +153,34 @@ cdef class _MemPool(MemoryResource): """ if self.is_mapped: raise TypeError("Cannot allocate from a mapped IPC-enabled memory resource") - stream = Stream_accept(stream) if stream is not None else default_stream() - return _MP_allocate(self, size, stream) - - def deallocate(self, ptr: DevicePointerT, size_t size, stream: Stream | GraphBuilder | None = None): + cdef Stream s = Stream_accept(stream) + return _MP_allocate(self, size, s) + + def deallocate( + self, + ptr: DevicePointerType, + size_t size, + *, + stream: Stream | GraphBuilder + ) -> None: """Deallocate a buffer previously allocated by this resource. Parameters ---------- - ptr : :obj:`~_memory.DevicePointerT` + ptr : :obj:`~_memory.DevicePointerType` The pointer or handle to the buffer to deallocate. size : int The size of the buffer to deallocate, in bytes. - stream : :obj:`~_stream.Stream` | :obj:`~_graph.GraphBuilder`, optional - The stream on which to perform the deallocation asynchronously. - If the buffer is deallocated without an explicit stream, the allocation stream - is used. + stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` + Keyword-only. The stream on which to perform the deallocation + asynchronously. Must be passed explicitly; pass + ``device.default_stream`` to use the default stream. """ - stream = Stream_accept(stream) if stream is not None else default_stream() - _MP_deallocate(self, ptr, size, stream) + cdef Stream s = Stream_accept(stream) + _MP_deallocate(self, ptr, size, s) @property + @cython.critical_section def attributes(self) -> _MemPoolAttributes: """Memory pool attributes.""" if self._attributes is None: @@ -227,6 +246,14 @@ cdef int MP_init_create_pool( self._mempool_owned = True self._h_pool = create_mempool_handle(properties) + if not self._h_pool: + HANDLE_RETURN(get_last_error()) + raise RuntimeError( + f"Failed to initialize {self.__class__.__name__}: " + "cuda-core returned an empty memory pool handle without recording a CUDA error. " + "This is an internal cuda-core error; please report it with your CUDA driver, " + "CUDA Toolkit, and cuda-python versions." + ) if ipc_enabled: alloc_handle = _ipc.MP_export_mempool(self) @@ -257,7 +284,9 @@ cdef int MP_init_current_pool( self._h_pool = create_mempool_handle_ref(pool) self._mempool_owned = False ELSE: - raise RuntimeError("not supported") + raise RuntimeError( + "Getting the current memory pool requires CUDA 13.0 or later" + ) return 0 @@ -297,15 +326,21 @@ cdef inline int check_not_capturing(cydriver.CUstream s) except?-1 nogil: "a capturing stream (consider using GraphMemoryResource).") -cdef inline Buffer _MP_allocate(_MemPool self, size_t size, Stream stream): +cdef Buffer _MP_allocate(_MemPool self, size_t size, Stream stream, type cls = Buffer): cdef cydriver.CUstream s = as_cu(stream._h_stream) cdef DevicePtrHandle h_ptr with nogil: check_not_capturing(s) h_ptr = deviceptr_alloc_from_pool(size, self._h_pool, stream._h_stream) if not h_ptr: - raise RuntimeError("Failed to allocate memory from pool") - return Buffer_from_deviceptr_handle(h_ptr, size, self, None) + HANDLE_RETURN(get_last_error()) + raise RuntimeError( + f"Failed to allocate {size} bytes from {self.__class__.__name__}: " + "cuda-core returned an empty allocation handle without recording a CUDA error. " + "This is an internal cuda-core error; please report it with your CUDA driver, " + "CUDA Toolkit, and cuda-python versions." + ) + return Buffer_from_deviceptr_handle(h_ptr, size, self, None, cls) cdef inline void _MP_deallocate( diff --git a/cuda_core/cuda/core/_memory/_peer_access_utils.pyi b/cuda_core/cuda/core/_memory/_peer_access_utils.pyi new file mode 100644 index 00000000000..fa2b5c490a4 --- /dev/null +++ b/cuda_core/cuda/core/_memory/_peer_access_utils.pyi @@ -0,0 +1,138 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_memory/_peer_access_utils.pyx + +from __future__ import annotations + +from collections.abc import Callable, Iterable, Iterator, Set +from dataclasses import dataclass +from typing import Any + +from cuda.core._device import Device +from cuda.core._memory._device_memory_resource import DeviceMemoryResource + + +@dataclass(frozen=True) +class PeerAccessPlan: + """Normalized peer-access target state and the driver updates it requires.""" + target_ids: tuple[int, ...] + to_add: tuple[int, ...] + to_remove: tuple[int, ...] + +class PeerAccessibleBySetProxy: + """Live driver-backed view of the peer devices granted access to a memory pool. + + Reads (``__contains__``, ``__iter__``, ``len(...)``) call ``cuMemPoolGetAccess``; + writes (``add``, ``discard``, and bulk ops) call ``cuMemPoolSetAccess``. There + is no in-memory mirror, so the view always reflects the current driver state + and stays consistent across multiple wrappers around the same pool. + + Iteration yields :class:`~cuda.core.Device` objects. ``add``, ``discard``, and + ``__contains__`` accept either a :class:`~cuda.core.Device` or a device-ordinal + ``int``; the owner device is silently ignored when supplied. + + All bulk operations (``update``, ``|=``, ``&=``, ``-=``, ``^=``, ``clear``) + issue exactly one ``cuMemPoolSetAccess`` call. This matters: peer-access + transitions can take seconds per pool because every existing memory mapping + is updated, so coalescing into a single driver call lets the toolkit handle + the mappings in parallel. + """ + __slots__ = ('_mr',) + + def __init__(self, mr: DeviceMemoryResource) -> None: + ... + + @classmethod + def _from_iterable(cls, it: Iterable[Device]) -> set[Device]: + ... + + def __contains__(self, value: object) -> bool: + ... + + def __iter__(self) -> Iterator[Device]: + ... + + def __len__(self) -> int: + ... + + def add(self, value: Device | int) -> None: + """Grant peer access from ``value`` to allocations in this pool.""" + + def discard(self, value: Device | int) -> None: + """Revoke peer access from ``value`` to allocations in this pool.""" + + def clear(self) -> None: + """Revoke all peer access in a single driver call.""" + + def update(self, *others: Iterable[Device | int]) -> None: + """Grant peer access to every device in ``others`` in one driver call.""" + + def difference_update(self, *others: Iterable[Device | int]) -> None: + """Revoke peer access for every device in ``others`` in one driver call.""" + + def intersection_update(self, *others: Iterable[Device | int]) -> None: + """Restrict peer access to the intersection in a single driver call.""" + + def symmetric_difference_update(self, other: Iterable[Device | int]) -> None: + """Toggle peer access for every device in ``other`` in one driver call.""" + + def __ior__(self, other: Set[Any]) -> PeerAccessibleBySetProxy: + ... + + def __iand__(self, other: Set[Any]) -> PeerAccessibleBySetProxy: + ... + + def __isub__(self, other: Set[Any]) -> PeerAccessibleBySetProxy: + ... + + def __ixor__(self, other: Set[Any]) -> PeerAccessibleBySetProxy: + ... + + def __repr__(self) -> str: + ... + + def _apply(self, additions, removals) -> None: + """Compute the diff and issue a single ``cuMemPoolSetAccess``. + + ``additions`` and ``removals`` are user-supplied (``Device | int``); + only the owner device is filtered out. Adds are validated through + :meth:`Device.can_access_peer` via :func:`plan_peer_access_update`; + removals bypass that check (revoking is always permitted). + """ + +def replace_peer_accessible_by(mr: DeviceMemoryResource, devices: object) -> None: + """Replace the full peer-access set in a single batched driver call. + + Backs the ``mr.peer_accessible_by = [...]`` setter. Uses the same planner + as the proxy's bulk ops; the only difference is that adds and removes are + derived from the symmetric difference between current driver state and the + requested target set. + """ + +def normalize_peer_access_targets(owner_device_id: int, requested_devices: Iterable[object], *, resolve_device_id: Callable[[object], int]) -> tuple[int, ...]: + """Return sorted, unique peer device IDs, excluding the owner device.""" + +def plan_peer_access_update(owner_device_id: int, current_peer_ids: Iterable[int], requested_devices: Iterable[object], *, resolve_device_id: Callable[[object], int], can_access_peer: Callable[[int], bool]) -> PeerAccessPlan: + """Compute the peer-access target state and add/remove deltas.""" + +def _resolve_peer_device_id(value: Device | int | None) -> int: + """Coerce ``Device | int`` into a device-ordinal int.""" + +def _set_pool_access(mr: object, to_add: tuple[int, ...], to_remove: tuple[int, ...]) -> None: + """Issue one ``cuMemPoolSetAccess`` for the given add/remove deltas. + + The thin Python-callable layer that wraps the actual driver call: building + the ``CUmemAccessDesc`` array and invoking ``cuMemPoolSetAccess`` happens + in here. Tests monkeypatch this on the module to spy on real driver work + without intercepting earlier no-op paths. + + Preconditions: ``len(to_add) + len(to_remove) > 0`` (the caller is + responsible for skipping empty diffs). + """ + +def _apply_peer_access_diff(mr: DeviceMemoryResource, to_add: Iterable[int], to_remove: Iterable[int]) -> None: + """Apply a peer-access diff in at most one driver call. + + Every write path on :class:`PeerAccessibleBySetProxy` and the + ``peer_accessible_by`` setter routes through this function. Empty diffs + short-circuit here so the driver-level helper :func:`_set_pool_access` is + only invoked when there is actual work for ``cuMemPoolSetAccess`` to do. + """ \ No newline at end of file diff --git a/cuda_core/cuda/core/_memory/_peer_access_utils.pyx b/cuda_core/cuda/core/_memory/_peer_access_utils.pyx new file mode 100644 index 00000000000..9a035378ecf --- /dev/null +++ b/cuda_core/cuda/core/_memory/_peer_access_utils.pyx @@ -0,0 +1,406 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from collections.abc import Callable, Iterable, Iterator, MutableSet, Set +from dataclasses import dataclass +from typing import TYPE_CHECKING, Any + +from cuda.bindings cimport cydriver +from cuda.core._memory._device_memory_resource cimport DeviceMemoryResource +from cuda.core._resource_handles cimport as_cu +from cuda.core._utils.cuda_utils cimport HANDLE_RETURN +from cpython.mem cimport PyMem_Malloc, PyMem_Free +from libcpp.vector cimport vector + +if TYPE_CHECKING: + from cuda.core._device import Device + + +@dataclass(frozen=True) +class PeerAccessPlan: + """Normalized peer-access target state and the driver updates it requires.""" + + target_ids: tuple[int, ...] + to_add: tuple[int, ...] + to_remove: tuple[int, ...] + + +def normalize_peer_access_targets( + owner_device_id: int, + requested_devices: Iterable[object], + *, + resolve_device_id: Callable[[object], int], +) -> tuple[int, ...]: + """Return sorted, unique peer device IDs, excluding the owner device.""" + + target_ids = {resolve_device_id(device) for device in requested_devices} + target_ids.discard(owner_device_id) + return tuple(sorted(target_ids)) + + +def plan_peer_access_update( + owner_device_id: int, + current_peer_ids: Iterable[int], + requested_devices: Iterable[object], + *, + resolve_device_id: Callable[[object], int], + can_access_peer: Callable[[int], bool], +) -> PeerAccessPlan: + """Compute the peer-access target state and add/remove deltas.""" + + target_ids = normalize_peer_access_targets( + owner_device_id, + requested_devices, + resolve_device_id=resolve_device_id, + ) + bad = tuple(dev_id for dev_id in target_ids if not can_access_peer(dev_id)) + if bad: + bad_ids = ", ".join(str(dev_id) for dev_id in bad) + raise ValueError(f"Device {owner_device_id} cannot access peer(s): {bad_ids}") + + current_ids = set(current_peer_ids) + target_id_set = set(target_ids) + return PeerAccessPlan( + target_ids=target_ids, + to_add=tuple(sorted(target_id_set - current_ids)), + to_remove=tuple(sorted(current_ids - target_id_set)), + ) + + +def _resolve_peer_device_id(value: Device | int | None) -> int: + """Coerce ``Device | int`` into a device-ordinal int.""" + from cuda.core._device import Device + + return Device(value).device_id + + +# ---- driver-touching helpers (cdef inline, called from .pyx code) ----------- + +cdef inline tuple _query_peer_access_ids(DeviceMemoryResource mr): + """Return the current peer device IDs as a sorted tuple of ints. + + The full driver loop runs inside a single ``nogil`` block. Because + ``range(total)`` ascends, the result is already sorted. + """ + cdef int total + cdef int dev_id + cdef int owner_id = mr._dev_id + cdef cydriver.CUmemAccess_flags flags + cdef cydriver.CUmemLocation location + cdef cydriver.CUmemoryPool h_pool = as_cu(mr._h_pool) + cdef vector[int] peers + cdef size_t i, n + + location.type = cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE + + with nogil: + HANDLE_RETURN(cydriver.cuDeviceGetCount(&total)) + for dev_id in range(total): + if dev_id == owner_id: + continue + location.id = dev_id + HANDLE_RETURN(cydriver.cuMemPoolGetAccess(&flags, h_pool, &location)) + if flags == cydriver.CUmemAccess_flags.CU_MEM_ACCESS_FLAGS_PROT_READWRITE: + peers.push_back(dev_id) + + n = peers.size() + return tuple(peers[i] for i in range(n)) + + +cdef inline bint _peer_access_includes(DeviceMemoryResource mr, int dev_id): + """Return True if peer access from ``dev_id`` is currently granted.""" + cdef cydriver.CUmemAccess_flags flags + cdef cydriver.CUmemLocation location + + location.type = cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE + location.id = dev_id + with nogil: + HANDLE_RETURN(cydriver.cuMemPoolGetAccess(&flags, as_cu(mr._h_pool), &location)) + return flags == cydriver.CUmemAccess_flags.CU_MEM_ACCESS_FLAGS_PROT_READWRITE + + +def _set_pool_access(mr: object, to_add: tuple[int, ...], to_remove: tuple[int, ...]) -> None: + """Issue one ``cuMemPoolSetAccess`` for the given add/remove deltas. + + The thin Python-callable layer that wraps the actual driver call: building + the ``CUmemAccessDesc`` array and invoking ``cuMemPoolSetAccess`` happens + in here. Tests monkeypatch this on the module to spy on real driver work + without intercepting earlier no-op paths. + + Preconditions: ``len(to_add) + len(to_remove) > 0`` (the caller is + responsible for skipping empty diffs). + """ + cdef DeviceMemoryResource mr_typed = mr + cdef size_t count = len(to_add) + len(to_remove) + cdef cydriver.CUmemAccessDesc* access_desc = NULL + cdef size_t i = 0 + + access_desc = PyMem_Malloc(count * sizeof(cydriver.CUmemAccessDesc)) + if access_desc == NULL: + raise MemoryError("Failed to allocate memory for access descriptors") + + try: + for dev_id in to_add: + access_desc[i].flags = cydriver.CUmemAccess_flags.CU_MEM_ACCESS_FLAGS_PROT_READWRITE + access_desc[i].location.type = cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE + access_desc[i].location.id = dev_id + i += 1 + for dev_id in to_remove: + access_desc[i].flags = cydriver.CUmemAccess_flags.CU_MEM_ACCESS_FLAGS_PROT_NONE + access_desc[i].location.type = cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE + access_desc[i].location.id = dev_id + i += 1 + + with nogil: + HANDLE_RETURN(cydriver.cuMemPoolSetAccess(as_cu(mr_typed._h_pool), access_desc, count)) + finally: + if access_desc != NULL: + PyMem_Free(access_desc) + + +def _apply_peer_access_diff(mr: DeviceMemoryResource, to_add: Iterable[int], to_remove: Iterable[int]) -> None: + """Apply a peer-access diff in at most one driver call. + + Every write path on :class:`PeerAccessibleBySetProxy` and the + ``peer_accessible_by`` setter routes through this function. Empty diffs + short-circuit here so the driver-level helper :func:`_set_pool_access` is + only invoked when there is actual work for ``cuMemPoolSetAccess`` to do. + """ + add_tuple = tuple(to_add) + remove_tuple = tuple(to_remove) + if not add_tuple and not remove_tuple: + return + _set_pool_access(mr, add_tuple, remove_tuple) + + +cpdef void replace_peer_accessible_by(DeviceMemoryResource mr, object devices): + """Replace the full peer-access set in a single batched driver call. + + Backs the ``mr.peer_accessible_by = [...]`` setter. Uses the same planner + as the proxy's bulk ops; the only difference is that adds and removes are + derived from the symmetric difference between current driver state and the + requested target set. + """ + from cuda.core._device import Device + + this_dev = Device(mr._dev_id) + plan = plan_peer_access_update( + owner_device_id=mr._dev_id, + current_peer_ids=_query_peer_access_ids(mr), + requested_devices=devices, + resolve_device_id=_resolve_peer_device_id, + can_access_peer=this_dev.can_access_peer, + ) + _apply_peer_access_diff(mr, plan.to_add, plan.to_remove) + + +# ---- Python MutableSet proxy ------------------------------------------------ + +class PeerAccessibleBySetProxy(MutableSet["Device"]): + """Live driver-backed view of the peer devices granted access to a memory pool. + + Reads (``__contains__``, ``__iter__``, ``len(...)``) call ``cuMemPoolGetAccess``; + writes (``add``, ``discard``, and bulk ops) call ``cuMemPoolSetAccess``. There + is no in-memory mirror, so the view always reflects the current driver state + and stays consistent across multiple wrappers around the same pool. + + Iteration yields :class:`~cuda.core.Device` objects. ``add``, ``discard``, and + ``__contains__`` accept either a :class:`~cuda.core.Device` or a device-ordinal + ``int``; the owner device is silently ignored when supplied. + + All bulk operations (``update``, ``|=``, ``&=``, ``-=``, ``^=``, ``clear``) + issue exactly one ``cuMemPoolSetAccess`` call. This matters: peer-access + transitions can take seconds per pool because every existing memory mapping + is updated, so coalescing into a single driver call lets the toolkit handle + the mappings in parallel. + """ + + __slots__ = ("_mr",) + + def __init__(self, mr: DeviceMemoryResource) -> None: + self._mr = mr + + @classmethod + def _from_iterable(cls, it: Iterable[Device]) -> set[Device]: # type: ignore[override] + # Binary set operators (&, |, -, ^) collect their result through + # _from_iterable. Returning a plain set lets the user reason about + # the result independently of any pool's driver state. + return set(it) + + # --- abstract MutableSet methods --- + + def __contains__(self, value: object) -> bool: + try: + dev_id = _resolve_peer_device_id(value) + except (TypeError, ValueError): + return False + cdef DeviceMemoryResource mr = self._mr + if dev_id == mr._dev_id: + return False + return _peer_access_includes(mr, dev_id) + + def __iter__(self) -> Iterator[Device]: + from cuda.core._device import Device + + return iter(Device(dev_id) for dev_id in _query_peer_access_ids(self._mr)) + + def __len__(self) -> int: + return len(_query_peer_access_ids(self._mr)) + + def add(self, value: Device | int) -> None: + """Grant peer access from ``value`` to allocations in this pool.""" + dev_id = _resolve_peer_device_id(value) + cdef DeviceMemoryResource mr = self._mr + if dev_id == mr._dev_id: + return + if _peer_access_includes(mr, dev_id): + return + from cuda.core._device import Device + if not Device(mr._dev_id).can_access_peer(dev_id): + raise ValueError(f"Device {mr._dev_id} cannot access peer: {dev_id}") + _apply_peer_access_diff(mr, (dev_id,), ()) + + def discard(self, value: Device | int) -> None: + """Revoke peer access from ``value`` to allocations in this pool.""" + try: + dev_id = _resolve_peer_device_id(value) + except (TypeError, ValueError): + return + cdef DeviceMemoryResource mr = self._mr + if dev_id == mr._dev_id: + return + if not _peer_access_includes(mr, dev_id): + return + _apply_peer_access_diff(mr, (), (dev_id,)) + + # --- bulk overrides: one driver call per op --- + + def clear(self) -> None: + """Revoke all peer access in a single driver call.""" + self._apply((), _query_peer_access_ids(self._mr)) + + def update(self, *others: Iterable[Device | int]) -> None: + """Grant peer access to every device in ``others`` in one driver call.""" + to_add = [] + for other in others: + to_add.extend(other) + if to_add: + self._apply(to_add, ()) + + def difference_update(self, *others: Iterable[Device | int]) -> None: + """Revoke peer access for every device in ``others`` in one driver call.""" + revoke_ids = set() + for other in others: + for value in other: + try: + revoke_ids.add(_resolve_peer_device_id(value)) + except (TypeError, ValueError): + continue + current = set(_query_peer_access_ids(self._mr)) + to_remove = revoke_ids & current + if to_remove: + self._apply((), to_remove) + + def intersection_update(self, *others: Iterable[Device | int]) -> None: + """Restrict peer access to the intersection in a single driver call.""" + keep_ids = None + for other in others: + ids = set() + for value in other: + try: + ids.add(_resolve_peer_device_id(value)) + except (TypeError, ValueError): + continue + keep_ids = ids if keep_ids is None else keep_ids & ids + if keep_ids is None: + return # ``set.intersection_update()`` with no args is a no-op + current = set(_query_peer_access_ids(self._mr)) + to_remove = current - keep_ids + if to_remove: + self._apply((), to_remove) + + def symmetric_difference_update(self, other: Iterable[Device | int]) -> None: + """Toggle peer access for every device in ``other`` in one driver call.""" + toggle_ids = set() + for value in other: + try: + toggle_ids.add(_resolve_peer_device_id(value)) + except (TypeError, ValueError): + continue + current = set(_query_peer_access_ids(self._mr)) + to_add = toggle_ids - current + to_remove = toggle_ids & current + if to_add or to_remove: + self._apply(to_add, to_remove) + + def __ior__(self, other: Set[Any]) -> PeerAccessibleBySetProxy: + self.update(other) + return self + + def __iand__(self, other: Set[Any]) -> PeerAccessibleBySetProxy: + self.intersection_update(other) + return self + + def __isub__(self, other: Set[Any]) -> PeerAccessibleBySetProxy: + if other is self: + self.clear() + else: + self.difference_update(other) + return self + + def __ixor__(self, other: Set[Any]) -> PeerAccessibleBySetProxy: + self.symmetric_difference_update(other) + return self + + def __repr__(self) -> str: + return f"PeerAccessibleBySetProxy({set(self)!r})" + + # --- internal: route every write through one batched driver call --- + + def _apply(self, additions, removals) -> None: + """Compute the diff and issue a single ``cuMemPoolSetAccess``. + + ``additions`` and ``removals`` are user-supplied (``Device | int``); + only the owner device is filtered out. Adds are validated through + :meth:`Device.can_access_peer` via :func:`plan_peer_access_update`; + removals bypass that check (revoking is always permitted). + """ + from cuda.core._device import Device + + cdef DeviceMemoryResource mr = self._mr + owner_id = mr._dev_id + owner = Device(owner_id) + current = _query_peer_access_ids(mr) + + # Plan additions through the existing helper (validates can_access_peer). + plan = plan_peer_access_update( + owner_device_id=owner_id, + current_peer_ids=current, + # union of (current set + requested adds) so the planner emits + # exactly the to_add deltas for these additions, no removals. + requested_devices=[*current, *additions], + resolve_device_id=_resolve_peer_device_id, + can_access_peer=owner.can_access_peer, + ) + to_add = plan.to_add + + # Removals: resolve, drop owner and unknowns, intersect with current. + current_set = set(current) + revoke_ids = set() + for value in removals: + try: + dev_id = _resolve_peer_device_id(value) + except (TypeError, ValueError): + continue + if dev_id == owner_id: + continue + if dev_id in current_set: + revoke_ids.add(dev_id) + to_remove = tuple(sorted(revoke_ids)) + + if not to_add and not to_remove: + return + _apply_peer_access_diff(mr, to_add, to_remove) diff --git a/cuda_core/cuda/core/_memory/_pinned_memory_resource.pxd b/cuda_core/cuda/core/_memory/_pinned_memory_resource.pxd index fcfcfeb3465..41336d4f61a 100644 --- a/cuda_core/cuda/core/_memory/_pinned_memory_resource.pxd +++ b/cuda_core/cuda/core/_memory/_pinned_memory_resource.pxd @@ -1,9 +1,8 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 from cuda.core._memory._memory_pool cimport _MemPool -from cuda.core._memory._ipc cimport IPCDataForMR cdef class PinnedMemoryResource(_MemPool): diff --git a/cuda_core/cuda/core/_memory/_pinned_memory_resource.pyi b/cuda_core/cuda/core/_memory/_pinned_memory_resource.pyi new file mode 100644 index 00000000000..a83cd8ea581 --- /dev/null +++ b/cuda_core/cuda/core/_memory/_pinned_memory_resource.pyi @@ -0,0 +1,148 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_memory/_pinned_memory_resource.pyx + +from __future__ import annotations + +import uuid +from dataclasses import dataclass + +from cuda.core._memory._ipc import IPCAllocationHandle +from cuda.core._memory._memory_pool import _MemPool + + +@dataclass +class PinnedMemoryResourceOptions: + """Customizable :obj:`~_memory.PinnedMemoryResource` 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) + + numa_id : int or None, optional + Host NUMA node ID for pool placement. When set to None (the default), + the behavior depends on ``ipc_enabled``: + + - ``ipc_enabled=False``: OS-managed placement (location type HOST). + - ``ipc_enabled=True``: automatically derived from the current CUDA + device's ``host_numa_id`` attribute, requiring an active CUDA + context. + + When set to a non-negative integer, that NUMA node is used explicitly + regardless of ``ipc_enabled`` (location type HOST_NUMA). + """ + ipc_enabled: bool = False + max_size: int = 0 + numa_id: int | None = None + +class PinnedMemoryResource(_MemPool): + """ + A host-pinned memory resource managing a stream-ordered memory pool. + + Parameters + ---------- + options : PinnedMemoryResourceOptions + Memory resource creation options. + + If set to `None`, the memory resource uses the driver's current + stream-ordered memory pool. If no memory + pool is set as current, the driver's default memory pool + is used. + + 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 + host-pinned memory resource does not own the pool (`is_handle_owned` is + `False`), and closing the resource has no effect. + + Notes + ----- + To create an IPC-Enabled memory resource (MR) that is capable of sharing + allocations between processes, specify ``ipc_enabled=True`` in the initializer + option. When IPC is enabled and ``numa_id`` is not specified, the NUMA node + is automatically derived from the current CUDA device's ``host_numa_id`` + attribute, which requires an active CUDA context. If ``numa_id`` is + explicitly set, that value is used regardless of ``ipc_enabled``. + + See :class:`DeviceMemoryResource` for more details on IPC usage patterns. + """ + + def __init__(self, options: PinnedMemoryResourceOptions | dict[str, object] | None=None) -> None: + ... + + def __reduce__(self) -> tuple[object, ...]: + ... + + @staticmethod + def from_registry(uuid: uuid.UUID) -> PinnedMemoryResource: + """ + Obtain a registered mapped memory resource. + + Raises + ------ + RuntimeError + If no mapped memory resource is found in the registry. + """ + + def register(self, uuid: uuid.UUID) -> PinnedMemoryResource: + """ + Register a mapped memory resource. + + Returns + ------- + The registered mapped memory resource. If one was previously registered + with the given key, it is returned. + """ + + @classmethod + def from_allocation_handle(cls, alloc_handle: int | IPCAllocationHandle) -> PinnedMemoryResource: + """Create a host-pinned memory resource from an allocation handle. + + Construct a new `PinnedMemoryResource` instance that imports a memory + pool from a shareable handle. The memory pool is marked as owned. + + Parameters + ---------- + alloc_handle : int | IPCAllocationHandle + The shareable handle of the host-pinned memory resource to import. If an + integer is supplied, it must represent a valid platform-specific + handle. It is the caller's responsibility to close that handle. + + Returns + ------- + A new host-pinned memory resource instance with the imported handle. + """ + + @property + def allocation_handle(self) -> IPCAllocationHandle: + """Shareable handle for this memory pool (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. + """ + + @property + def device_id(self) -> int: + """Return -1. Pinned memory is host memory and is not associated with a specific device.""" + + @property + def numa_id(self) -> int: + """The host NUMA node ID used for pool placement, or -1 for OS-managed placement.""" + + @property + def is_device_accessible(self) -> bool: + """Return True. This memory resource provides device-accessible buffers.""" + + @property + def is_host_accessible(self) -> bool: + """Return True. This memory resource provides host-accessible buffers.""" +__all__ = ['PinnedMemoryResource', 'PinnedMemoryResourceOptions'] + +def _deep_reduce_pinned_memory_resource(mr: object) -> tuple[object, ...]: + ... \ No newline at end of file diff --git a/cuda_core/cuda/core/_memory/_pinned_memory_resource.pyx b/cuda_core/cuda/core/_memory/_pinned_memory_resource.pyx index 64ebcc7bc5d..4335fbb41c2 100644 --- a/cuda_core/cuda/core/_memory/_pinned_memory_resource.pyx +++ b/cuda_core/cuda/core/_memory/_pinned_memory_resource.pyx @@ -88,10 +88,10 @@ cdef class PinnedMemoryResource(_MemPool): See :class:`DeviceMemoryResource` for more details on IPC usage patterns. """ - def __init__(self, options=None): + def __init__(self, options: PinnedMemoryResourceOptions | dict[str, object] | None = None) -> None: _PMR_init(self, options) - def __reduce__(self): + def __reduce__(self) -> tuple[object, ...]: return PinnedMemoryResource.from_registry, (self.uuid,) @staticmethod @@ -148,15 +148,12 @@ cdef class PinnedMemoryResource(_MemPool): _ipc.MP_from_allocation_handle(cls, alloc_handle)) return mr - def get_allocation_handle(self) -> IPCAllocationHandle: - """Export the memory pool handle to be shared (requires IPC). + @property + def allocation_handle(self) -> IPCAllocationHandle: + """Shareable handle for this memory pool (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") @@ -240,9 +237,9 @@ cdef inline _PMR_init(PinnedMemoryResource self, options): ) -def _deep_reduce_pinned_memory_resource(mr): +def _deep_reduce_pinned_memory_resource(mr: object) -> tuple[object, ...]: check_multiprocessing_start_method() - alloc_handle = mr.get_allocation_handle() + alloc_handle = mr.allocation_handle return mr.from_allocation_handle, (alloc_handle,) diff --git a/cuda_core/cuda/core/_memory/_virtual_memory_resource.py b/cuda_core/cuda/core/_memory/_virtual_memory_resource.py index 7aff5709b71..f30e6e3838d 100644 --- a/cuda_core/cuda/core/_memory/_virtual_memory_resource.py +++ b/cuda_core/cuda/core/_memory/_virtual_memory_resource.py @@ -1,14 +1,15 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations from dataclasses import dataclass, field -from typing import TYPE_CHECKING, Iterable, Literal +from typing import TYPE_CHECKING, Iterable if TYPE_CHECKING: from cuda.core._stream import Stream + from cuda.core.graph import GraphBuilder from cuda.core._device import Device from cuda.core._memory._buffer import Buffer, MemoryResource @@ -16,20 +17,22 @@ Transaction, check_or_create_options, driver, - get_binding_version, ) from cuda.core._utils.cuda_utils import ( _check_driver_error as raise_if_driver_error, ) +from cuda.core._utils.version import binding_version +from cuda.core.typing import ( + DevicePointerType, + VirtualMemoryAccessType, + VirtualMemoryAllocationType, + VirtualMemoryGranularityType, + VirtualMemoryHandleType, + VirtualMemoryLocationType, +) __all__ = ["VirtualMemoryResource", "VirtualMemoryResourceOptions"] -VirtualMemoryHandleTypeT = Literal["posix_fd", "generic", "win32_kmt", "fabric"] | None -VirtualMemoryLocationTypeT = Literal["device", "host", "host_numa", "host_numa_current"] -VirtualMemoryGranularityT = Literal["minimum", "recommended"] -VirtualMemoryAccessTypeT = Literal["rw", "r"] | None -VirtualMemoryAllocationTypeT = Literal["pinned", "managed"] - @dataclass class VirtualMemoryResourceOptions: @@ -38,18 +41,18 @@ class VirtualMemoryResourceOptions: Attributes ---------- - allocation_type: :obj:`~_memory.VirtualMemoryAllocationTypeT` + allocation_type: :obj:`~_memory.VirtualMemoryAllocationType` | str Controls the type of allocation. - location_type: :obj:`~_memory.VirtualMemoryLocationTypeT` + location_type: :obj:`~_memory.VirtualMemoryLocationType` | str Controls the location of the allocation. - handle_type: :obj:`~_memory.VirtualMemoryHandleTypeT` + handle_type: :obj:`~_memory.VirtualMemoryHandleType` | str Export handle type for the physical allocation. Use ``"posix_fd"`` on Linux if you plan to import/export the allocation (required for cuMemRetainAllocationHandle). Use `None` if you don't need an exportable handle. gpu_direct_rdma: bool Hint that the allocation should be GDR-capable (if supported). - granularity: :obj:`~_memory.VirtualMemoryGranularityT` + granularity: :obj:`~_memory.VirtualMemoryGranularityType` | str Controls granularity query and size rounding. addr_hint: int A (optional) virtual address hint to try to reserve at. Setting it to 0 lets the CUDA driver decide. @@ -57,88 +60,90 @@ class VirtualMemoryResourceOptions: Alignment for the VA reservation. If `None`, use the queried granularity. peers: Iterable[int] Extra device IDs that should be granted access in addition to ``device``. - self_access: :obj:`~_memory.VirtualMemoryAccessTypeT` + self_access: :obj:`~_memory.VirtualMemoryAccessType` | None | str Access flags for the owning device. - peer_access: :obj:`~_memory.VirtualMemoryAccessTypeT` + peer_access: :obj:`~_memory.VirtualMemoryAccessType` | None | str Access flags for peers. """ - # Human-friendly strings; normalized in __post_init__ - allocation_type: VirtualMemoryAllocationTypeT = "pinned" - location_type: VirtualMemoryLocationTypeT = "device" - handle_type: VirtualMemoryHandleTypeT = "posix_fd" - granularity: VirtualMemoryGranularityT = "recommended" + allocation_type: VirtualMemoryAllocationType = VirtualMemoryAllocationType.PINNED + location_type: VirtualMemoryLocationType = VirtualMemoryLocationType.DEVICE + handle_type: VirtualMemoryHandleType = VirtualMemoryHandleType.POSIX_FD + granularity: VirtualMemoryGranularityType = VirtualMemoryGranularityType.RECOMMENDED gpu_direct_rdma: bool = False addr_hint: int | None = 0 addr_align: int | None = None peers: Iterable[int] = field(default_factory=tuple) - self_access: VirtualMemoryAccessTypeT = "rw" - peer_access: VirtualMemoryAccessTypeT = "rw" + self_access: VirtualMemoryAccessType = VirtualMemoryAccessType.READ_WRITE + peer_access: VirtualMemoryAccessType = VirtualMemoryAccessType.READ_WRITE _a = driver.CUmemAccess_flags - _access_flags = {"rw": _a.CU_MEM_ACCESS_FLAGS_PROT_READWRITE, "r": _a.CU_MEM_ACCESS_FLAGS_PROT_READ, None: 0} # noqa: RUF012 + _access_flags = { # noqa: RUF012 + VirtualMemoryAccessType.READ_WRITE: _a.CU_MEM_ACCESS_FLAGS_PROT_READWRITE, + VirtualMemoryAccessType.READ: _a.CU_MEM_ACCESS_FLAGS_PROT_READ, + None: 0, + } _h = driver.CUmemAllocationHandleType _handle_types = { # noqa: RUF012 None: _h.CU_MEM_HANDLE_TYPE_NONE, - "posix_fd": _h.CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR, - "win32_kmt": _h.CU_MEM_HANDLE_TYPE_WIN32_KMT, - "fabric": _h.CU_MEM_HANDLE_TYPE_FABRIC, + VirtualMemoryHandleType.POSIX_FD: _h.CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR, + VirtualMemoryHandleType.WIN32_KMT: _h.CU_MEM_HANDLE_TYPE_WIN32_KMT, + VirtualMemoryHandleType.FABRIC: _h.CU_MEM_HANDLE_TYPE_FABRIC, } _g = driver.CUmemAllocationGranularity_flags _granularity = { # noqa: RUF012 - "recommended": _g.CU_MEM_ALLOC_GRANULARITY_RECOMMENDED, - "minimum": _g.CU_MEM_ALLOC_GRANULARITY_MINIMUM, + VirtualMemoryGranularityType.RECOMMENDED: _g.CU_MEM_ALLOC_GRANULARITY_RECOMMENDED, + VirtualMemoryGranularityType.MINIMUM: _g.CU_MEM_ALLOC_GRANULARITY_MINIMUM, } _l = driver.CUmemLocationType _location_type = { # noqa: RUF012 - "device": _l.CU_MEM_LOCATION_TYPE_DEVICE, - "host": _l.CU_MEM_LOCATION_TYPE_HOST, - "host_numa": _l.CU_MEM_LOCATION_TYPE_HOST_NUMA, - "host_numa_current": _l.CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT, + VirtualMemoryLocationType.DEVICE: _l.CU_MEM_LOCATION_TYPE_DEVICE, + VirtualMemoryLocationType.HOST: _l.CU_MEM_LOCATION_TYPE_HOST, + VirtualMemoryLocationType.HOST_NUMA: _l.CU_MEM_LOCATION_TYPE_HOST_NUMA, + VirtualMemoryLocationType.HOST_NUMA_CURRENT: _l.CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT, } _t = driver.CUmemAllocationType # CUDA 13+ exposes MANAGED in CUmemAllocationType; older 12.x does not - _allocation_type = {"pinned": _t.CU_MEM_ALLOCATION_TYPE_PINNED} # noqa: RUF012 - ver_major, ver_minor = get_binding_version() - if ver_major >= 13: - _allocation_type["managed"] = _t.CU_MEM_ALLOCATION_TYPE_MANAGED + _allocation_type = {VirtualMemoryAllocationType.PINNED: _t.CU_MEM_ALLOCATION_TYPE_PINNED} # noqa: RUF012 + if binding_version() >= (13, 0, 0): + _allocation_type[VirtualMemoryAllocationType.MANAGED] = _t.CU_MEM_ALLOCATION_TYPE_MANAGED @staticmethod - def _access_to_flags(spec: str): + def _access_to_flags(spec: VirtualMemoryAccessType | None) -> int: flags = VirtualMemoryResourceOptions._access_flags.get(spec) if flags is None: raise ValueError(f"Unknown access spec: {spec!r}") - return flags + return flags # type: ignore[no-any-return] @staticmethod - def _allocation_type_to_driver(spec: str): + def _allocation_type_to_driver(spec: VirtualMemoryAllocationType) -> int: alloc_type = VirtualMemoryResourceOptions._allocation_type.get(spec) if alloc_type is None: raise ValueError(f"Unsupported allocation_type: {spec!r}") - return alloc_type + return alloc_type # type: ignore[no-any-return] @staticmethod - def _location_type_to_driver(spec: str): + def _location_type_to_driver(spec: VirtualMemoryLocationType) -> int: loc_type = VirtualMemoryResourceOptions._location_type.get(spec) if loc_type is None: raise ValueError(f"Unsupported location_type: {spec!r}") - return loc_type + return loc_type # type: ignore[no-any-return] @staticmethod - def _handle_type_to_driver(spec: str): + def _handle_type_to_driver(spec: VirtualMemoryHandleType | None) -> int: if spec == "win32": raise NotImplementedError("win32 is currently not supported, please reach out to the CUDA Python team") handle_type = VirtualMemoryResourceOptions._handle_types.get(spec) if handle_type is None: raise ValueError(f"Unsupported handle_type: {spec!r}") - return handle_type + return handle_type # type: ignore[no-any-return] @staticmethod - def _granularity_to_driver(spec: str): + def _granularity_to_driver(spec: VirtualMemoryGranularityType) -> int: granularity = VirtualMemoryResourceOptions._granularity.get(spec) if granularity is None: raise ValueError(f"Unsupported granularity: {spec!r}") - return granularity + return granularity # type: ignore[no-any-return] class VirtualMemoryResource(MemoryResource): @@ -149,7 +154,7 @@ class VirtualMemoryResource(MemoryResource): device_id : Device | int Device for which a memory resource is constructed. - config : VirtualMemoryResourceOptions + config : VirtualMemoryResourceOptions, optional A configuration object for the VirtualMemoryResource @@ -160,9 +165,9 @@ class VirtualMemoryResource(MemoryResource): in cuda.core should already meet the common needs. """ - def __init__(self, device_id: Device | int, config: VirtualMemoryResourceOptions = None): - self.device = Device(device_id) - self.config = check_or_create_options( + def __init__(self, device_id: Device | int, config: VirtualMemoryResourceOptions | None = None) -> None: + self.device: Device | None = Device(device_id) + self.config: VirtualMemoryResourceOptions = check_or_create_options( # type: ignore[assignment] VirtualMemoryResourceOptions, config, "VirtualMemoryResource options", keep_none=False ) # Matches ("host", "host_numa", "host_numa_current") @@ -190,7 +195,9 @@ def _align_up(size: int, gran: int) -> int: """ return (size + gran - 1) & ~(gran - 1) - def modify_allocation(self, buf: Buffer, new_size: int, config: VirtualMemoryResourceOptions = None) -> Buffer: + def modify_allocation( + self, buf: Buffer, new_size: int, config: VirtualMemoryResourceOptions | None = None + ) -> Buffer: """ Grow an existing allocation using CUDA VMM, with a configurable policy. @@ -221,6 +228,10 @@ def modify_allocation(self, buf: Buffer, new_size: int, config: VirtualMemoryRes prop = driver.CUmemAllocationProp() prop.type = VirtualMemoryResourceOptions._allocation_type_to_driver(self.config.allocation_type) prop.location.type = VirtualMemoryResourceOptions._location_type_to_driver(self.config.location_type) + # Caller must not invoke modify_allocation on a host-located resource; + # we rely on the dataclass invariant that self.device is non-None for + # device-located resources (it's only None when location is host). + assert self.device is not None, "modify_allocation requires a device-located resource" prop.location.id = self.device.device_id prop.allocFlags.gpuDirectRDMACapable = 1 if self.config.gpu_direct_rdma else 0 prop.requestedHandleTypes = VirtualMemoryResourceOptions._handle_type_to_driver(self.config.handle_type) @@ -332,7 +343,9 @@ def _grow_allocation_fast_path( trans.commit() # Update the buffer size (pointer stays the same) - buf._size = new_size + # TODO: #2049 This is a real bug, accessing _size which doesn't exist. + # Fix bug and remove the "type: ignore[attr-defined]" comment. + buf._size = new_size # type: ignore[attr-defined] return buf def _grow_allocation_slow_path( @@ -384,7 +397,7 @@ def _grow_allocation_slow_path( (result,) = driver.cuMemUnmap(int(buf.handle), aligned_prev_size) raise_if_driver_error(result) - def _remap_old(): + def _remap_old() -> None: # Try to remap the old physical memory back to the original VA range try: (res,) = driver.cuMemMap(int(buf.handle), aligned_prev_size, 0, old_handle, 0) @@ -439,7 +452,7 @@ def _remap_old(): # Return a new Buffer for the new mapping return Buffer.from_handle(ptr=new_ptr, size=new_size, mr=self) - def _build_access_descriptors(self, prop: driver.CUmemAllocationProp) -> list: + def _build_access_descriptors(self, prop: driver.CUmemAllocationProp) -> list[driver.CUmemAccessDesc]: """ Build access descriptors for memory access permissions. @@ -471,7 +484,7 @@ def _build_access_descriptors(self, prop: driver.CUmemAllocationProp) -> list: return descs - def allocate(self, size: int, stream: Stream | None = None) -> Buffer: + def allocate(self, size: int, *, stream: Stream | GraphBuilder | None = None) -> Buffer: """ Allocate a buffer of the given size using CUDA virtual memory. @@ -480,7 +493,8 @@ def allocate(self, size: int, stream: Stream | None = None) -> Buffer: size : int The size in bytes of the buffer to allocate. stream : Stream, optional - CUDA stream to associate with the allocation (not currently supported). + Keyword-only. Unused because virtual memory operations are + synchronous. Returns ------- @@ -489,8 +503,6 @@ def allocate(self, size: int, stream: Stream | None = None) -> Buffer: Raises ------ - NotImplementedError - If a stream is provided or if the location type is not device memory. CUDAError If any CUDA driver API call fails during allocation. @@ -502,14 +514,16 @@ def allocate(self, size: int, stream: Stream | None = None) -> Buffer: specified in the resource's configuration. """ if stream is not None: - raise NotImplementedError("Stream is not supported with VirtualMemoryResource") + from cuda.core._stream import Stream_accept + + Stream_accept(stream) config = self.config # ---- Build allocation properties ---- prop = driver.CUmemAllocationProp() prop.type = VirtualMemoryResourceOptions._allocation_type_to_driver(config.allocation_type) prop.location.type = VirtualMemoryResourceOptions._location_type_to_driver(config.location_type) - prop.location.id = self.device.device_id if config.location_type == "device" else -1 + prop.location.id = self.device.device_id if self.device is not None else -1 prop.allocFlags.gpuDirectRDMACapable = 1 if config.gpu_direct_rdma else 0 prop.requestedHandleTypes = VirtualMemoryResourceOptions._handle_type_to_driver(config.handle_type) prop.win32HandleMetaData = 0 @@ -555,10 +569,26 @@ def allocate(self, size: int, stream: Stream | None = None) -> Buffer: buf = Buffer.from_handle(ptr=ptr, size=aligned_size, mr=self) return buf - def deallocate(self, ptr: int, size: int, stream: Stream | None = None) -> None: # noqa: ARG002 + def deallocate(self, ptr: DevicePointerType, size: int, *, stream: Stream | GraphBuilder | None = None) -> None: """ Deallocate memory on the device using CUDA VMM APIs. + + Parameters + ---------- + ptr : DevicePointerType + The pointer to the memory to deallocate. + size : int + The size in bytes of the memory to deallocate. + stream : Stream, optional + Keyword-only. Unused because virtual memory operations are + synchronous. """ + ptr = 0 if ptr is None else int(ptr) + + if stream is not None: + from cuda.core._stream import Stream_accept + + Stream_accept(stream) result, handle = driver.cuMemRetainAllocationHandle(ptr) raise_if_driver_error(result) (result,) = driver.cuMemUnmap(ptr, size) @@ -590,7 +620,7 @@ def device_id(self) -> int: Returns: int: CUDA device ID. -1 if the memory resource allocates host memory """ - return self.device.device_id if self.config.location_type == "device" else -1 + return self.device.device_id if self.device is not None else -1 def __repr__(self) -> str: """ diff --git a/cuda_core/cuda/core/_memoryview.pxd b/cuda_core/cuda/core/_memoryview.pxd new file mode 100644 index 00000000000..5b50ae6dc71 --- /dev/null +++ b/cuda_core/cuda/core/_memoryview.pxd @@ -0,0 +1,28 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from libc.stdint cimport intptr_t + +from cuda.core._dlpack cimport DLTensor +from cuda.core._layout cimport _StridedLayout + + +cdef class StridedMemoryView: + cdef readonly: + intptr_t ptr + int device_id + bint is_device_accessible + bint readonly + object exporting_obj + + cdef: + object metadata + DLTensor* dl_tensor + _StridedLayout _layout + object _buffer + object _dtype + + cdef inline _StridedLayout get_layout(self) + cdef inline object get_buffer(self) + cdef inline object get_dtype(self) diff --git a/cuda_core/cuda/core/_memoryview.pyi b/cuda_core/cuda/core/_memoryview.pyi new file mode 100644 index 00000000000..e0ed0d3cf0d --- /dev/null +++ b/cuda_core/cuda/core/_memoryview.pyi @@ -0,0 +1,307 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_memoryview.pyx + +from __future__ import annotations + +import functools +from collections.abc import Callable +from typing import Any + +import numpy +from cuda.core._layout import _StridedLayout +from cuda.core._memory import Buffer +from cuda.core._stream import Stream + +from ._dlpack import * + + +class StridedMemoryView: + """A class holding metadata of a strided dense array/tensor. + + A :obj:`StridedMemoryView` instance can be created in three ways: + + 1. Using the :obj:`args_viewable_as_strided_memory` decorator (recommended) + 2. Explicit construction relying on DLPack or CUDA Array Interface, see below. + 3. From :obj:`~_memory.Buffer` and shape and size tuples (see + :meth:`from_buffer` classmethod) + + ``StridedMemoryView(obj, stream_ptr)`` can be used to create a view from + objects supporting either DLPack (up to v1.0) or 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. + + 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 + 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) + from the semantics of ``obj.__dlpack__(stream=None, ...)`` since ``cuda.core`` + 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. + + Parameters + ---------- + obj : Any + Any objects that supports either DLPack (up to v1.0) or CUDA Array + Interface (v3). + stream_ptr: int + The pointer address (as Python `int`) to the **consumer** stream. + Stream ordering will be properly established unless ``-1`` is passed. + + + Attributes + ----------- + ptr : int + Pointer to the tensor buffer (as a Python `int`). + device_id : int + The device ID for where the tensor is located. It is -1 for CPU tensors + (meaning those only accessible from the host). + is_device_accessible : bool + Whether the tensor data can be accessed on the GPU. + readonly: bool + Whether the tensor data can be modified in place. + exporting_obj : Any + A reference to the original tensor object that is being viewed. + If the view is created with :meth:`from_buffer`, + it will be the Buffer instance passed to the method. + + """ + + def __init__(self, obj: object=None, stream_ptr: int | None=None) -> None: + ... + + @classmethod + def from_dlpack(cls, obj: object, stream_ptr: int | None=None) -> StridedMemoryView: + """Create a view from an object supporting the `DLPack `_ protocol. + + Parameters + ---------- + obj : object + An object implementing the `DLPack `_ protocol + (via ``__dlpack__``). + stream_ptr : int, optional + Stream pointer for synchronization. If ``None``, no synchronization is performed. + """ + + @classmethod + def from_cuda_array_interface(cls, obj: object, stream_ptr: int | None=None) -> StridedMemoryView: + """Create a view from an object supporting the `__cuda_array_interface__ `_ protocol. + + Parameters + ---------- + obj : object + An object implementing the `__cuda_array_interface__ `_ protocol. + stream_ptr : int, optional + Stream pointer for synchronization. If ``None``, no synchronization is performed. + """ + + @classmethod + def from_array_interface(cls, obj: object) -> StridedMemoryView: + """Create a view from an object supporting the `__array_interface__ `_ protocol. + + Parameters + ---------- + obj : object + An object implementing the `__array_interface__ `_ protocol (e.g., a numpy array). + """ + + @classmethod + def from_any_interface(cls, obj: object, stream_ptr: int | None=None) -> StridedMemoryView: + """Create a view by automatically selecting the best available protocol. + + Tries `DLPack `_ first, then falls back to + `__cuda_array_interface__ `_. + ``torch.Tensor`` objects are transparently handled via a fast AOTI path + regardless of which protocol is selected. + + Parameters + ---------- + obj : object + An object implementing `DLPack `_ or + `__cuda_array_interface__ `_. + stream_ptr : int, optional + Stream pointer for synchronization. If ``None``, no synchronization is performed. + """ + + @classmethod + def from_buffer(cls, buffer: Buffer, shape: tuple[int, ...], strides: tuple[int, ...] | None=None, *, itemsize: int | None=None, dtype: numpy.dtype | None=None, is_readonly: bool=False) -> StridedMemoryView: + """ + Creates a :obj:`StridedMemoryView` instance from a :obj:`~_memory.Buffer` and shape and strides tuples. + The Buffer can be either allocation coming from a :obj:`MemoryResource` or an external allocation + wrapped in a :obj:`~_memory.Buffer` object with ``Buffer.from_handle(ptr, size, owner=...)``. + + .. caution:: + When creating a :obj:`StridedMemoryView` from a :obj:`~_memory.Buffer`, + no synchronization is performed. It is the user's responsibility to ensure + the data in ``buffer`` is properly synchronized when consuming the view. + + Parameters + ---------- + buffer : :obj:`~_memory.Buffer` + The buffer to create the view from. + shape : :obj:`tuple` + The layout describing the shape, strides and itemsize of the elements in + the buffer. + strides : :obj:`tuple` + The layout describing the shape, strides and itemsize of the elements in + the buffer. + dtype : :obj:`numpy.dtype` + Optional dtype. + If specified, the dtype's itemsize must match the layout's itemsize. + is_readonly : bool, optional + Whether the mark the view as readonly. + """ + + def __dealloc__(self) -> None: + ... + + def view(self, layout: _StridedLayout | None=None, dtype: numpy.dtype | None=None) -> StridedMemoryView: + """ + Creates a new view with adjusted layout and dtype. + Same as calling :meth:`from_buffer` with the current buffer. + """ + + def as_tensor_map(self, box_dim: tuple[int, ...] | None=None, *, options: object=None, element_strides: tuple[int, ...] | None=None, data_type: object=None, interleave: object=None, swizzle: object=None, l2_promotion: object=None, oob_fill: object=None) -> object: + """Create a tiled :obj:`TensorMapDescriptor` from this view. + + This is the public entry point for creating tiled tensor map + descriptors in ``cuda.core``. Pass either ``box_dim`` and the + individual keyword arguments directly, or provide bundled tiled + options via ``options=``. + """ + + def copy_from(self, other: StridedMemoryView, stream: Stream, allocator: object=None, blocking: bool | None=None) -> None: + """ + Copies the data from the other view into this view. + + The copy can be performed between following memory spaces: + host-to-device, device-to-host, device-to-device (on the same device). + + Parameters + ---------- + other : StridedMemoryView + The view to copy data from. + stream : Stream | None, optional + The stream to schedule the copy on. + allocator : MemoryResource | None, optional + If temporary buffers are needed, the specified memory resources + will be used to allocate the memory. If not specified, default + resources will be used. + blocking : bool | None, optional + Whether the call should block until the copy is complete. + * ``True``: the ``stream`` is synchronized with the host at the end of the call, + blocking until the copy is complete. + * ``False``: if possible, the call returns immediately once the copy is scheduled. + However, in some cases of host-to-device or device-to-host copies, the call may + still synchronize with the host if necessary. + * ``None`` (default): + * for device-to-device, it defaults to ``False`` (non-blocking), + * for host-to-device or device-to-host, it defaults to ``True`` (blocking). + """ + + def copy_to(self, other: StridedMemoryView, stream: Stream | None=None, allocator: object=None, blocking: bool | None=None) -> None: + """ + Copies the data from this view into the ``other`` view. + + For details, see :meth:`copy_from`. + """ + + def __dlpack__(self, *, stream: int | None=None, max_version: tuple[int, int] | None=None, dl_device: tuple[int, int] | None=None, copy: bool | None=None) -> object: + ... + + def __dlpack_device__(self) -> tuple[int, int]: + ... + + @property + def _layout(self) -> _StridedLayout: + """ + The layout of the tensor. For StridedMemoryView created from DLPack or CAI, + the layout is inferred from the tensor object's metadata. + """ + + @property + def size(self) -> int: + ... + + @property + def shape(self) -> tuple[int, ...]: + """ + Shape of the tensor. + """ + + @property + def strides(self) -> tuple[int, ...] | None: + """ + Strides of the tensor (in **counts**, not bytes). + """ + + @property + def dtype(self) -> numpy.dtype | None: + """ + Data type of the tensor. + + Supports standard NumPy dtypes as well as narrow data types (e.g., ``bfloat16``) + when the optional `ml_dtypes `_ package is + installed. If ``ml_dtypes`` is not available and such a tensor is encountered, + a :obj:`NotImplementedError` will be raised. + """ + + def __repr__(self) -> str: + ... + +class _StridedMemoryViewProxy: + + def view(self, stream_ptr=None) -> StridedMemoryView: + ... + + def __init__(self, obj: object) -> None: + ... +_SMV_DLPACK_EXCHANGE_API_CAPSULE = ... + +def view_as_cai(obj, stream_ptr, view=None) -> StridedMemoryView: + ... + +def view_as_array_interface(obj, view=None) -> StridedMemoryView: + ... + +@functools.lru_cache +def _typestr2dtype(typestr: str) -> numpy.dtype: + ... + +@functools.lru_cache +def _typestr2itemsize(typestr: str) -> int: + ... + +def args_viewable_as_strided_memory(arg_indices: tuple[int, ...]) -> Callable[[Callable[..., Any]], Callable[..., Any]]: + """ + Decorator to create proxy objects to :obj:`StridedMemoryView` for the + specified positional arguments. + + This allows array/tensor attributes to be accessed inside the function + implementation, while keeping the function body array-library-agnostic (if + desired). + + Inside the decorated function, the specified arguments become instances + of an (undocumented) proxy type, regardless of its original source. A + :obj:`StridedMemoryView` instance can be obtained by passing the (consumer) + stream pointer (as a Python `int`) to the proxies's ``view()`` method. For + example: + + .. code-block:: python + + @args_viewable_as_strided_memory((1,)) + def my_func(arg0, arg1, arg2, stream: Stream): + # arg1 can be any object supporting DLPack or CUDA Array Interface + view = arg1.view(stream.handle) + assert isinstance(view, StridedMemoryView) + ... + + Parameters + ---------- + arg_indices : tuple + The indices of the target positional arguments. + """ \ No newline at end of file diff --git a/cuda_core/cuda/core/_memoryview.pyx b/cuda_core/cuda/core/_memoryview.pyx index 0e1df726c0c..260980c1daf 100644 --- a/cuda_core/cuda/core/_memoryview.pyx +++ b/cuda_core/cuda/core/_memoryview.pyx @@ -4,13 +4,19 @@ from __future__ import annotations +cimport cython from ._dlpack cimport * +from ._dlpack import classify_dl_device from libc.stdint cimport intptr_t from cuda.core._layout cimport _StridedLayout, get_strides_ptr from cuda.core._stream import Stream +import ctypes import functools +import sys import warnings +from collections.abc import Callable # no-cython-lint # used in string annotations below +from typing import Any # no-cython-lint # used in string annotations below import numpy @@ -28,6 +34,73 @@ from cuda.core._utils.cuda_utils cimport HANDLE_RETURN from cuda.core._memory import Buffer +# --------------------------------------------------------------------------- +# Lazy tensor bridge (avoids loading _tensor_bridge.so until torch is used) +# --------------------------------------------------------------------------- + +cdef object _tensor_bridge = None +# Cache: type(obj) -> True/False for the torch tensor check. +# Once a type is seen, we never re-check. +cdef dict _torch_type_cache = {} +# Tri-state: None = not checked, True/False = result of version check +cdef object _torch_version_ok = None + +cdef inline bint _torch_version_check(): + """Return True if 2.3 <= torch <= 2.12 (known AOTI ABI range). Memoized. + + Lower bound: AOTI functions we use were introduced in PyTorch 2.3. + Upper bound: the ``pyobj_to_aten_handle`` trick relies on the + THPVariable struct layout (PyObject_HEAD followed by at::Tensor cdata) + and the identity ``AtenTensorHandle == at::Tensor*``. Both are + undocumented internals that could change in a future PyTorch version. + We cap at the latest version we have tested against; unknown versions + fall back to the standard DLPack/CAI paths. Bump the upper bound + after verifying a new PyTorch release. + """ + global _torch_version_ok + if _torch_version_ok is not None: + return _torch_version_ok + torch = sys.modules.get("torch") + if torch is None: + _torch_version_ok = False + return False + try: + major, minor = int(torch.__version__.split(".")[0]), \ + int(torch.__version__.split(".")[1]) + _torch_version_ok = (2, 3) <= (major, minor) <= (2, 12) + except (ValueError, IndexError): + _torch_version_ok = False + return _torch_version_ok + + +cdef inline bint _is_torch_tensor(object obj): + cdef type tp = type(obj) + cdef object cached = _torch_type_cache.get(tp) + if cached is not None: + return cached + cdef str mod = tp.__module__ or "" + cdef bint result = mod.startswith("torch") and hasattr(obj, "data_ptr") \ + and _torch_version_check() + _torch_type_cache[tp] = result # setdefault not needed for bools + return result + + +cdef object _get_tensor_bridge(): + """Bootstrap AOTI symbols, then import _tensor_bridge on first use.""" + global _tensor_bridge + if _tensor_bridge is not None: + return _tensor_bridge + torch_C = sys.modules.get("torch._C") + if torch_C is None: + raise RuntimeError( + "torch._C is not loaded; cannot initialise the tensor bridge. " + "Make sure PyTorch is imported before passing a torch.Tensor.") + ctypes.CDLL(torch_C.__file__, mode=ctypes.RTLD_GLOBAL) + from cuda.core import _tensor_bridge as tb + _tensor_bridge = tb + return _tensor_bridge + + try: from ml_dtypes import bfloat16 except ImportError: @@ -107,35 +180,6 @@ cdef class StridedMemoryView: it will be the Buffer instance passed to the method. """ - cdef readonly: - intptr_t ptr - int device_id - bint is_device_accessible - bint readonly - object exporting_obj - - cdef: - # 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. - object metadata - - # The tensor object if has obj has __dlpack__, otherwise must be NULL - DLTensor *dl_tensor - - # Memoized properties - # Either lazily inferred from dl_tensor/metadata, - # or explicitly provided if created with from_buffer(). - _StridedLayout _layout - # Either exporting_obj if it is a Buffer, otherwise a Buffer instance - # with owner set to the exporting object. - object _buffer - # Either lazily inferred from dl_tensor/metadata, - # or explicitly provided if created with from_buffer(). - # In the latter case, it can be None. - object _dtype - def __init__(self, obj: object = None, stream_ptr: int | None = None) -> None: cdef str clsname = self.__class__.__name__ if obj is not None: @@ -178,6 +222,9 @@ cdef class StridedMemoryView: Stream pointer for synchronization. If ``None``, no synchronization is performed. """ cdef StridedMemoryView buf = StridedMemoryView.__new__(cls) + if _is_torch_tensor(obj): + _get_tensor_bridge().view_as_torch_tensor(obj, stream_ptr, buf) + return buf view_as_dlpack(obj, stream_ptr, buf) return buf @@ -193,6 +240,9 @@ cdef class StridedMemoryView: Stream pointer for synchronization. If ``None``, no synchronization is performed. """ cdef StridedMemoryView buf = StridedMemoryView.__new__(cls) + if _is_torch_tensor(obj): + _get_tensor_bridge().view_as_torch_tensor(obj, stream_ptr, buf) + return buf view_as_cai(obj, stream_ptr, buf) return buf @@ -206,6 +256,9 @@ cdef class StridedMemoryView: An object implementing the `__array_interface__ `_ protocol (e.g., a numpy array). """ cdef StridedMemoryView buf = StridedMemoryView.__new__(cls) + if _is_torch_tensor(obj): + _get_tensor_bridge().view_as_torch_tensor(obj, None, buf) + return buf view_as_array_interface(obj, buf) return buf @@ -215,6 +268,8 @@ cdef class StridedMemoryView: Tries `DLPack `_ first, then falls back to `__cuda_array_interface__ `_. + ``torch.Tensor`` objects are transparently handled via a fast AOTI path + regardless of which protocol is selected. Parameters ---------- @@ -282,7 +337,7 @@ cdef class StridedMemoryView: ) return view - def __dealloc__(self): + def __dealloc__(self) -> None: if self.dl_tensor == NULL: return @@ -316,11 +371,51 @@ cdef class StridedMemoryView: view_buffer_strided(view, self.get_buffer(), layout, dtype, self.readonly) return view + def as_tensor_map( + self, + box_dim: tuple[int, ...] | None = None, + *, + options: object = None, + element_strides: tuple[int, ...] | None = None, + data_type: object = None, + interleave: object = None, + swizzle: object = None, + l2_promotion: object = None, + oob_fill: object = None, + ) -> object: + """Create a tiled :obj:`TensorMapDescriptor` from this view. + + This is the public entry point for creating tiled tensor map + descriptors in ``cuda.core``. Pass either ``box_dim`` and the + individual keyword arguments directly, or provide bundled tiled + options via ``options=``. + """ + from cuda.core._tensor_map import TensorMapDescriptor + + kwargs = {} + if options is not None: + kwargs["options"] = options + if element_strides is not None: + kwargs["element_strides"] = element_strides + if data_type is not None: + kwargs["data_type"] = data_type + if interleave is not None: + kwargs["interleave"] = interleave + if swizzle is not None: + kwargs["swizzle"] = swizzle + if l2_promotion is not None: + kwargs["l2_promotion"] = l2_promotion + if oob_fill is not None: + kwargs["oob_fill"] = oob_fill + return TensorMapDescriptor._from_tiled(self, box_dim, **kwargs) + def copy_from( - self, other : StridedMemoryView, stream : Stream, - allocator = None, - blocking : bool | None = None, - ): + self, + other: StridedMemoryView, + stream: Stream, + allocator: object = None, + blocking: bool | None = None, + ) -> None: """ Copies the data from the other view into this view. @@ -351,10 +446,12 @@ cdef class StridedMemoryView: raise NotImplementedError("Sorry, not supported: copy_from") def copy_to( - self, other : StridedMemoryView, stream : Stream | None = None, - allocator = None, - blocking : bool | None = None, - ): + self, + other: StridedMemoryView, + stream: Stream | None = None, + allocator: object = None, + blocking: bool | None = None, + ) -> None: """ Copies the data from this view into the ``other`` view. @@ -369,7 +466,7 @@ cdef class StridedMemoryView: max_version: tuple[int, int] | None = None, dl_device: tuple[int, int] | None = None, copy: bool | None = None, - ): + ) -> object: # Similar to Buffer.__dlpack__: no implicit synchronization is performed. if dl_device is not None: raise BufferError("Sorry, not supported: dl_device other than None") @@ -432,7 +529,7 @@ cdef class StridedMemoryView: """ return self.get_dtype() - def __repr__(self): + def __repr__(self) -> str: return (f"StridedMemoryView(ptr={self.ptr},\n" + f" shape={self.shape},\n" + f" strides={self.strides},\n" @@ -443,6 +540,7 @@ cdef class StridedMemoryView: + f" readonly={self.readonly},\n" + f" exporting_obj={get_simple_repr(self.exporting_obj)})") + @cython.critical_section cdef inline _StridedLayout get_layout(self): if self._layout is None: if self.dl_tensor: @@ -453,6 +551,7 @@ cdef class StridedMemoryView: raise ValueError("Cannot infer layout from the exporting object") return self._layout + @cython.critical_section cdef inline object get_buffer(self): """ Returns Buffer instance with the underlying data. @@ -466,10 +565,15 @@ cdef class StridedMemoryView: self._buffer = Buffer.from_handle(self.ptr, 0, owner=self.exporting_obj) return self._buffer + @cython.critical_section cdef inline object get_dtype(self): if self._dtype is None: if self.dl_tensor != NULL: self._dtype = dtype_dlpack_to_numpy(&self.dl_tensor.dtype) + elif isinstance(self.metadata, int): + # AOTI dtype code stored by the torch tensor bridge + self._dtype = _get_tensor_bridge().resolve_aoti_dtype( + self.metadata) elif self.metadata is not None: self._dtype = _typestr2dtype(self.metadata["typestr"]) return self._dtype @@ -581,8 +685,6 @@ cdef inline int _smv_get_dl_device( cdef _DLDeviceType device_type cdef int32_t device_id cdef object buf - cdef bint d - cdef bint h if view.dl_tensor != NULL: device_type = view.dl_tensor.device.device_type if device_type == _kDLCUDA: @@ -592,20 +694,9 @@ cdef inline int _smv_get_dl_device( device_id = 0 elif view.is_device_accessible: buf = view.get_buffer() - d = buf.is_device_accessible - h = buf.is_host_accessible - if d and (not h): - device_type = _kDLCUDA - device_id = buf.device_id - elif d and h: - # We do not currently differentiate pinned vs managed here. - device_type = _kDLCUDAHost - device_id = 0 - elif (not d) and h: - device_type = _kDLCPU - device_id = 0 - else: - raise BufferError("buffer is neither device-accessible nor host-accessible") + dev_type, dev_id = classify_dl_device(buf) + device_type = <_DLDeviceType>dev_type + device_id = dev_id else: device_type = _kDLCPU device_id = 0 @@ -915,7 +1006,7 @@ cdef bint check_has_dlpack(obj) except*: elif hasattr(obj, "__cuda_array_interface__"): has_dlpack = False else: - raise RuntimeError( + raise BufferError( "the input object does not support any data exchange protocol") return has_dlpack @@ -925,7 +1016,7 @@ cdef class _StridedMemoryViewProxy: object obj bint has_dlpack - def __init__(self, obj): + def __init__(self, obj: object) -> None: self.obj = obj self.has_dlpack = check_has_dlpack(obj) @@ -1009,12 +1100,12 @@ cdef StridedMemoryView view_as_dlpack(obj, stream_ptr, view=None): @functools.lru_cache -def _typestr2dtype(str typestr): +def _typestr2dtype(str typestr) -> numpy.dtype: return numpy.dtype(typestr) @functools.lru_cache -def _typestr2itemsize(str typestr): +def _typestr2itemsize(str typestr) -> int: return _typestr2dtype(typestr).itemsize @@ -1125,6 +1216,16 @@ cpdef StridedMemoryView view_as_cai(obj, stream_ptr, view=None): as_cu(h_event), producer_s)) HANDLE_RETURN(cydriver.cuStreamWaitEvent( consumer_s, as_cu(h_event), 0)) + elif _is_torch_tensor(obj): + # PyTorch's __cuda_array_interface__ reports version 2 and + # omits the "stream" field, so the standard CAI sync path + # above is a no-op for torch tensors. This is unsafe: the + # consumer has no guarantee that the producer's work is + # visible. We fix this by querying PyTorch's current CUDA + # stream via the AOTI stable C ABI and performing the same + # event-based stream ordering. + _get_tensor_bridge().sync_torch_stream( + buf.device_id, (stream_ptr)) return buf @@ -1148,7 +1249,7 @@ cpdef StridedMemoryView view_as_array_interface(obj, view=None): return buf -def args_viewable_as_strided_memory(tuple arg_indices): +def args_viewable_as_strided_memory(arg_indices: tuple[int, ...]) -> Callable[[Callable[..., Any]], Callable[..., Any]]: """ Decorator to create proxy objects to :obj:`StridedMemoryView` for the specified positional arguments. @@ -1177,9 +1278,9 @@ def args_viewable_as_strided_memory(tuple arg_indices): arg_indices : tuple The indices of the target positional arguments. """ - def wrapped_func_with_indices(func): + def wrapped_func_with_indices(func: "Callable") -> "Callable": @functools.wraps(func) - def wrapped_func(*args, **kwargs): + def wrapped_func(*args, **kwargs) -> object: args = list(args) cdef int idx for idx in arg_indices: diff --git a/cuda_core/cuda/core/_module.pxd b/cuda_core/cuda/core/_module.pxd index 1d3a0772c30..78f871b5ba2 100644 --- a/cuda_core/cuda/core/_module.pxd +++ b/cuda_core/cuda/core/_module.pxd @@ -48,10 +48,16 @@ cdef class KernelOccupancy: cdef class KernelAttributes: cdef: KernelHandle _h_kernel + # _device_id == -1 means "current device" (resolved per access). + # _device_id >= 0 means this view is bound to that specific device. + int _device_id + # Cache is shared across views for the same Kernel: the per-device + # view returned by __getitem__ inherits the parent's dict. dict _cache @staticmethod cdef KernelAttributes _init(KernelHandle h_kernel) + cdef KernelAttributes _view_for_device(self, int device_id) + cdef inline int _effective_device_id(self) except? -1 cdef int _get_cached_attribute(self, int device_id, cydriver.CUfunction_attribute attribute) except? -1 - cdef int _resolve_device_id(self, device_id) except? -1 diff --git a/cuda_core/cuda/core/_module.pyi b/cuda_core/cuda/core/_module.pyi new file mode 100644 index 00000000000..5125b99131a --- /dev/null +++ b/cuda_core/cuda/core/_module.pyi @@ -0,0 +1,498 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_module.pyx + +from __future__ import annotations + +from collections import namedtuple +from os import PathLike + +import cython +from cuda.core._device import Device +from cuda.core._launch_config import LaunchConfig +from cuda.core._stream import Stream +from cuda.core._utils.cuda_utils import driver + + +class KernelAttributes: + """Read-only view of a kernel's per-device attributes. + + The default view returned by :attr:`Kernel.attributes` is bound to + the current device, resolved at attribute-access time. Use + ``kernel.attributes[device]`` to obtain a view bound to a specific + device (an :class:`int` device ordinal or :class:`Device`). Per-device + views share the underlying cache so a value queried through one view + is visible through the others. + """ + + def __init__(self, *args, **kwargs) -> None: + ... + + def __getitem__(self, device: Device | int) -> KernelAttributes: + """Return a view of these attributes bound to a specific device. + + Parameters + ---------- + device : Device or int + The device whose attributes to query. Accepts a :class:`Device` + or a device ordinal (:class:`int`). + + Returns + ------- + KernelAttributes + A view bound to ``device`` that shares the underlying cache + with this view. + """ + + @property + def max_threads_per_block(self) -> int: + """int : The maximum number of threads per block. + This attribute is read-only.""" + + @property + def shared_size_bytes(self) -> int: + """int : The size in bytes of statically-allocated shared memory required by this function. + This attribute is read-only.""" + + @property + def const_size_bytes(self) -> int: + """int : The size in bytes of user-allocated constant memory required by this function. + This attribute is read-only.""" + + @property + def local_size_bytes(self) -> int: + """int : The size in bytes of local memory used by each thread of this function. + This attribute is read-only.""" + + @property + def num_regs(self) -> int: + """int : The number of registers used by each thread of this function. + This attribute is read-only.""" + + @property + def ptx_version(self) -> int: + """int : The PTX virtual architecture version for which the function was compiled. + This attribute is read-only.""" + + @property + def binary_version(self) -> int: + """int : The binary architecture version for which the function was compiled. + This attribute is read-only.""" + + @property + def cache_mode_ca(self) -> bool: + """bool : Whether the function has been compiled with user specified option "-Xptxas --dlcm=ca" set. + This attribute is read-only.""" + + @property + def max_dynamic_shared_size_bytes(self) -> int: + """int : The maximum size in bytes of dynamically-allocated shared memory that can be used + by this function.""" + + @property + def preferred_shared_memory_carveout(self) -> int: + """int : The shared memory carveout preference, in percent of the total shared memory.""" + + @property + def cluster_size_must_be_set(self) -> bool: + """bool : The kernel must launch with a valid cluster size specified. + This attribute is read-only.""" + + @property + def required_cluster_width(self) -> int: + """int : The required cluster width in blocks.""" + + @property + def required_cluster_height(self) -> int: + """int : The required cluster height in blocks.""" + + @property + def required_cluster_depth(self) -> int: + """int : The required cluster depth in blocks.""" + + @property + def non_portable_cluster_size_allowed(self) -> bool: + """bool : Whether the function can be launched with non-portable cluster size.""" + + @property + def cluster_scheduling_policy_preference(self) -> int: + """int : The block scheduling policy of a function.""" + +class KernelOccupancy: + """This class offers methods to query occupancy metrics that help determine optimal + launch parameters such as block size, grid size, and shared memory usage. + """ + + def __init__(self, *args, **kwargs) -> None: + ... + + def max_active_blocks_per_multiprocessor(self, block_size: int, dynamic_shared_memory_size: int) -> int: + """Occupancy of the kernel. + + Returns the maximum number of active blocks per multiprocessor for this kernel. + + Parameters + ---------- + block_size: int + Block size parameter used to launch this kernel. + dynamic_shared_memory_size: int + The amount of dynamic shared memory in bytes needed by block. + Use `0` if block does not need shared memory. + + Returns + ------- + int + The maximum number of active blocks per multiprocessor. + + Note + ---- + The fraction of the product of maximum number of active blocks per multiprocessor + and the block size to the maximum number of threads per multiprocessor is known as + theoretical multiprocessor utilization (occupancy). + + """ + + def max_potential_block_size(self, dynamic_shared_memory_needed: int | driver.CUoccupancyB2DSize, block_size_limit: int) -> MaxPotentialBlockSizeOccupancyResult: + """MaxPotentialBlockSizeOccupancyResult: Suggested launch configuration for reasonable occupancy. + + Returns the minimum grid size needed to achieve the maximum occupancy and + the maximum block size that can achieve the maximum occupancy. + + Parameters + ---------- + dynamic_shared_memory_needed: Union[int, driver.CUoccupancyB2DSize] + The amount of dynamic shared memory in bytes needed by block. + Use `0` if block does not need shared memory. Use C-callable + represented by :obj:`~driver.CUoccupancyB2DSize` to encode + amount of needed dynamic shared memory which varies depending + on tne block size. + block_size_limit: int + Known upper limit on the kernel block size. Use `0` to indicate + the maximum block size permitted by the device / kernel instead + + Returns + ------- + :obj:`~MaxPotentialBlockSizeOccupancyResult` + An object with `min_grid_size` and `max_block_size` attributes encoding + the suggested launch configuration. + + Note + ---- + Please be advised that use of C-callable that requires Python Global + Interpreter Lock may lead to deadlocks. + + """ + + def available_dynamic_shared_memory_per_block(self, num_blocks_per_multiprocessor: int, block_size: int) -> int: + """Dynamic shared memory available per block for given launch configuration. + + The amount of dynamic shared memory per block, in bytes, for given kernel launch configuration. + + Parameters + ---------- + num_blocks_per_multiprocessor: int + Number of blocks to be concurrently executing on a multiprocessor. + block_size: int + Block size parameter used to launch this kernel. + + Returns + ------- + int + Dynamic shared memory available per block for given launch configuration. + """ + + def max_potential_cluster_size(self, config: LaunchConfig, *, stream: Stream) -> int: + """Maximum potential cluster size. + + The maximum potential cluster size for this kernel and given launch configuration. + + Parameters + ---------- + config: :obj:`~_launch_config.LaunchConfig` + Kernel launch configuration. Cluster dimensions in the configuration are ignored. + stream: :obj:`~Stream` + Keyword-only. The stream on which this kernel is to be launched. + Must be passed explicitly; pass ``device.default_stream`` to + use the default stream. + + Returns + ------- + int + The maximum cluster size that can be launched for this kernel and launch configuration. + """ + + def max_active_clusters(self, config: LaunchConfig, *, stream: Stream) -> int: + """Maximum number of active clusters on the target device. + + The maximum number of clusters that could concurrently execute on the target device. + + Parameters + ---------- + config: :obj:`~_launch_config.LaunchConfig` + Kernel launch configuration. + stream: :obj:`~Stream` + Keyword-only. The stream on which this kernel is to be launched. + Must be passed explicitly; pass ``device.default_stream`` to + use the default stream. + + Returns + ------- + int + The maximum number of clusters that could co-exist on the target device. + """ + +class Kernel: + """Represent a compiled kernel that had been loaded onto the device. + + Kernel instances can execution when passed directly into the + :func:`~launch` function. + + Directly creating a :obj:`~_module.Kernel` is not supported, and they + should instead be created through a :obj:`~_module.ObjectCode` object. + + """ + + def __init__(self, *args, **kwargs) -> None: + ... + + @property + @cython.critical_section + def attributes(self) -> KernelAttributes: + """Get the read-only attributes of this kernel.""" + + @property + def num_arguments(self) -> int: + """int : The number of arguments of this function""" + + @property + def arguments_info(self) -> list[ParamInfo]: + """list[ParamInfo]: (offset, size) for each argument of this function""" + + @property + @cython.critical_section + def occupancy(self) -> KernelOccupancy: + """Get the occupancy information for launching this kernel.""" + + @property + def handle(self) -> object: + """Return the underlying kernel handle object. + + .. caution:: + + This handle is a Python object. To get the memory address of the underlying C + handle, call ``int(Kernel.handle)``. + """ + + @property + def _handle(self) -> object: + ... + + @staticmethod + def from_handle(handle, mod: ObjectCode | None=None) -> Kernel: + """Creates a new :obj:`Kernel` object from a kernel handle. + + Parameters + ---------- + handle : int + Kernel handle representing the address of a foreign + kernel object (CUkernel). + mod : :obj:`ObjectCode`, optional + The ObjectCode object associated with this kernel. Provides + library lifetime for foreign kernels not created by + cuda.core. + """ + + def __eq__(self, other: object) -> bool: + ... + + def __hash__(self) -> int: + ... + + def __repr__(self) -> str: + ... + +class ObjectCode: + """Represent a compiled program to be loaded onto the device. + + This object provides a unified interface for different types of + compiled programs that will be loaded onto the device. + + Note + ---- + This class has no default constructor. If you already have a cubin that you would + like to load, use the :meth:`from_cubin` alternative constructor. Constructing directly + from all other possible code types should be avoided in favor of compilation through + :class:`~cuda.core.Program` + """ + + def __init__(self, *args, **kwargs) -> None: + ... + + @classmethod + def _init(cls, module, code_type, *, name: str='', symbol_mapping: dict[str, str] | None=None) -> ObjectCode: + ... + + @staticmethod + def _reduce_helper(module, code_type, name, symbol_mapping): + ... + + def __reduce__(self) -> tuple[object, ...]: + ... + + @staticmethod + def from_cubin(module: bytes | str | PathLike[str], *, name: str='', symbol_mapping: dict[str, str] | None=None) -> ObjectCode: + """Create an :class:`ObjectCode` instance from an existing cubin. + + Parameters + ---------- + module : Union[bytes, str, os.PathLike] + Either a bytes object containing the in-memory cubin to load, or + a file path object (or its string representation) pointing to the + on-disk cubin to load. + name : Optional[str] + A human-readable identifier representing this code object. + symbol_mapping : Optional[dict] + A dictionary specifying how the unmangled symbol names (as keys) + should be mapped to the mangled names before trying to retrieve + them (default to no mappings). + """ + + @staticmethod + def from_ptx(module: bytes | str | PathLike[str], *, name: str='', symbol_mapping: dict[str, str] | None=None) -> ObjectCode: + """Create an :class:`ObjectCode` instance from an existing PTX. + + Parameters + ---------- + module : Union[bytes, str, os.PathLike] + Either a bytes object containing the in-memory ptx code to load, or + a file path object (or its string representation) pointing to the + on-disk ptx file to load. + name : Optional[str] + A human-readable identifier representing this code object. + symbol_mapping : Optional[dict] + A dictionary specifying how the unmangled symbol names (as keys) + should be mapped to the mangled names before trying to retrieve + them (default to no mappings). + """ + + @staticmethod + def from_ltoir(module: bytes | str | PathLike[str], *, name: str='', symbol_mapping: dict[str, str] | None=None) -> ObjectCode: + """Create an :class:`ObjectCode` instance from an existing LTOIR. + + Parameters + ---------- + module : Union[bytes, str, os.PathLike] + Either a bytes object containing the in-memory ltoir code to load, + or a file path object (or its string representation) pointing to the + on-disk ltoir file to load. + name : Optional[str] + A human-readable identifier representing this code object. + symbol_mapping : Optional[dict] + A dictionary specifying how the unmangled symbol names (as keys) + should be mapped to the mangled names before trying to retrieve + them (default to no mappings). + """ + + @staticmethod + def from_fatbin(module: bytes | str | PathLike[str], *, name: str='', symbol_mapping: dict[str, str] | None=None) -> ObjectCode: + """Create an :class:`ObjectCode` instance from an existing fatbin. + + Parameters + ---------- + module : Union[bytes, str, os.PathLike] + Either a bytes object containing the in-memory fatbin to load, or + or a file path object (or its string representation) pointing to the + on-disk fatbin to load. + name : Optional[str] + A human-readable identifier representing this code object. + symbol_mapping : Optional[dict] + A dictionary specifying how the unmangled symbol names (as keys) + should be mapped to the mangled names before trying to retrieve + them (default to no mappings). + """ + + @staticmethod + def from_object(module: bytes | str, *, name: str='', symbol_mapping: dict[str, str] | None=None) -> ObjectCode: + """Create an :class:`ObjectCode` instance from an existing object code. + + Parameters + ---------- + module : Union[bytes, str] + Either a bytes object containing the in-memory object code to load, or + a file path string pointing to the on-disk object code to load. + name : Optional[str] + A human-readable identifier representing this code object. + symbol_mapping : Optional[dict] + A dictionary specifying how the unmangled symbol names (as keys) + should be mapped to the mangled names before trying to retrieve + them (default to no mappings). + """ + + @staticmethod + def from_library(module: bytes | str, *, name: str='', symbol_mapping: dict[str, str] | None=None) -> ObjectCode: + """Create an :class:`ObjectCode` instance from an existing library. + + Parameters + ---------- + module : Union[bytes, str] + Either a bytes object containing the in-memory library to load, or + a file path string pointing to the on-disk library to load. + name : Optional[str] + A human-readable identifier representing this code object. + symbol_mapping : Optional[dict] + A dictionary specifying how the unmangled symbol names (as keys) + should be mapped to the mangled names before trying to retrieve + them (default to no mappings). + """ + + def get_kernel(self, name: str | bytes) -> Kernel: + """Return the :obj:`~_module.Kernel` of a specified name from this object code. + + Parameters + ---------- + name : str | bytes + Name of the kernel to retrieve. + + Returns + ------- + :obj:`~_module.Kernel` + Newly created kernel object. + + """ + + @property + def code(self) -> CodeTypeT: + """Return the underlying code object.""" + + @property + def name(self) -> str: + """Return a human-readable name of this code object.""" + + @property + def code_type(self) -> str: + """Return the type of the underlying code object.""" + + @property + def symbol_mapping(self) -> dict[str, str]: + """Return a copy of the symbol mapping dictionary.""" + + @property + def handle(self) -> object: + """Return the underlying handle object. + + .. caution:: + + This handle is a Python object. To get the memory address of the underlying C + handle, call ``int(ObjectCode.handle)``. + """ + + def __eq__(self, other: object) -> bool: + ... + + def __hash__(self) -> int: + ... + + def __repr__(self) -> str: + ... +__all__ = ['Kernel', 'ObjectCode'] +MaxPotentialBlockSizeOccupancyResult = namedtuple('MaxPotentialBlockSizeOccupancyResult', ('min_grid_size', 'max_block_size')) +ParamInfo = namedtuple('ParamInfo', ['offset', 'size']) +CodeTypeT = bytes | bytearray | str \ No newline at end of file diff --git a/cuda_core/cuda/core/_module.pyx b/cuda_core/cuda/core/_module.pyx index 4e8f810619b..91c8ad43895 100644 --- a/cuda_core/cuda/core/_module.pyx +++ b/cuda_core/cuda/core/_module.pyx @@ -4,16 +4,17 @@ from __future__ import annotations +cimport cython from libc.stddef cimport size_t -import functools -import threading from collections import namedtuple +from os import fsencode, fspath, PathLike from cuda.core._device import Device from cuda.core._launch_config cimport LaunchConfig from cuda.core._launch_config import LaunchConfig -from cuda.core._stream cimport Stream +from cuda.core._stream cimport Stream, Stream_accept +from cuda.core._program import ObjectCodeFormatType from cuda.core._resource_handles cimport ( LibraryHandle, KernelHandle, @@ -33,125 +34,47 @@ from cuda.core._utils.clear_error_support import ( raise_code_path_meant_to_be_unreachable, ) from cuda.core._utils.cuda_utils cimport HANDLE_RETURN -from cuda.core._utils.cuda_utils import driver, get_binding_version +from cuda.core._utils.version cimport cy_binding_version, cy_driver_version +from cuda.core._utils.cuda_utils import driver from cuda.bindings cimport cydriver __all__ = ["Kernel", "ObjectCode"] -# Lazy initialization state and synchronization -# For Python 3.13t (free-threaded builds), we use a lock to ensure thread-safe initialization. -# For regular Python builds with GIL, the lock overhead is minimal and the code remains safe. -cdef object _init_lock = threading.Lock() -cdef bint _inited = False -cdef int _py_major_ver = 0 -cdef int _py_minor_ver = 0 -cdef int _driver_ver = 0 -cdef tuple _kernel_ctypes = None -cdef bint _paraminfo_supported = False - - -cdef int _lazy_init() except -1: - """ - Initialize module-level state in a thread-safe manner. - - This function is thread-safe and suitable for both: - - Regular Python builds (with GIL) - - Python 3.13t free-threaded builds (without GIL) - - Uses double-checked locking pattern for performance: - - Fast path: check without lock if already initialized - - Slow path: acquire lock and initialize if needed - """ - global _inited - # Fast path: already initialized (no lock needed for read) - if _inited: - return 0 - - cdef int drv_ver - # Slow path: acquire lock and initialize - with _init_lock: - # Double-check: another thread might have initialized while we waited - if _inited: - return 0 - - global _py_major_ver, _py_minor_ver, _driver_ver, _kernel_ctypes, _paraminfo_supported - # binding availability depends on cuda-python version - _py_major_ver, _py_minor_ver = get_binding_version() - _kernel_ctypes = (driver.CUkernel,) - with nogil: - HANDLE_RETURN(cydriver.cuDriverGetVersion(&drv_ver)) - _driver_ver = drv_ver - _paraminfo_supported = _driver_ver >= 12040 - - # Mark as initialized (must be last to ensure all state is set) - _inited = True - - return 0 - - -# Auto-initializing accessors (cdef for internal use) -cdef inline int _get_py_major_ver() except -1: - """Get the Python binding major version, initializing if needed.""" - _lazy_init() - return _py_major_ver - - -cdef inline int _get_py_minor_ver() except -1: - """Get the Python binding minor version, initializing if needed.""" - _lazy_init() - return _py_minor_ver - - -cdef inline int _get_driver_ver() except -1: - """Get the CUDA driver version, initializing if needed.""" - _lazy_init() - return _driver_ver - - -cdef inline tuple _get_kernel_ctypes(): - """Get the kernel ctypes tuple, initializing if needed.""" - _lazy_init() - return _kernel_ctypes - - -cdef inline bint _is_paraminfo_supported() except -1: - """Return True if cuKernelGetParamInfo is available (driver >= 12.4).""" - _lazy_init() - return _paraminfo_supported - - -@functools.cache -def _is_cukernel_get_library_supported() -> bool: - """Return True when cuKernelGetLibrary is available for inverse kernel-to-library lookup. - - Requires cuda-python bindings >= 12.5 and driver >= 12.5. - """ - return ( - (_get_py_major_ver(), _get_py_minor_ver()) >= (12, 5) - and _get_driver_ver() >= 12050 - and hasattr(driver, "cuKernelGetLibrary") - ) - - -cdef inline LibraryHandle _make_empty_library_handle(): - """Create an empty LibraryHandle to indicate no library loaded.""" - return LibraryHandle() # Empty shared_ptr - cdef class KernelAttributes: - """Provides access to kernel attributes.""" + """Read-only view of a kernel's per-device attributes. + + The default view returned by :attr:`Kernel.attributes` is bound to + the current device, resolved at attribute-access time. Use + ``kernel.attributes[device]`` to obtain a view bound to a specific + device (an :class:`int` device ordinal or :class:`Device`). Per-device + views share the underlying cache so a value queried through one view + is visible through the others. + """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: raise RuntimeError("KernelAttributes cannot be instantiated directly. Please use Kernel APIs.") @staticmethod cdef KernelAttributes _init(KernelHandle h_kernel): cdef KernelAttributes self = KernelAttributes.__new__(KernelAttributes) self._h_kernel = h_kernel + self._device_id = -1 self._cache = {} - _lazy_init() return self + cdef KernelAttributes _view_for_device(self, int device_id): + cdef KernelAttributes view = KernelAttributes.__new__(KernelAttributes) + view._h_kernel = self._h_kernel + view._device_id = device_id + view._cache = self._cache + return view + + cdef inline int _effective_device_id(self) except? -1: + if self._device_id >= 0: + return self._device_id + return Device().device_id + cdef int _get_cached_attribute(self, int device_id, cydriver.CUfunction_attribute attribute) except? -1: """Helper function to get a cached attribute or fetch and cache it if not present.""" cdef tuple cache_key = (device_id, attribute) @@ -161,129 +84,160 @@ cdef class KernelAttributes: cdef int result with nogil: HANDLE_RETURN(cydriver.cuKernelGetAttribute(&result, attribute, as_cu(self._h_kernel), device_id)) - self._cache[cache_key] = result + self._cache[cache_key] = result # setdefault not needed for ints return result - cdef inline int _resolve_device_id(self, device_id) except? -1: - """Convert Device or int to device_id int.""" - return Device(device_id).device_id + def __getitem__(self, device: Device | int) -> KernelAttributes: + """Return a view of these attributes bound to a specific device. + + Parameters + ---------- + device : Device or int + The device whose attributes to query. Accepts a :class:`Device` + or a device ordinal (:class:`int`). - def max_threads_per_block(self, device_id: Device | int = None) -> int: + Returns + ------- + KernelAttributes + A view bound to ``device`` that shares the underlying cache + with this view. + """ + return self._view_for_device(Device(device).device_id) + + @property + def max_threads_per_block(self) -> int: """int : The maximum number of threads per block. This attribute is read-only.""" return self._get_cached_attribute( - self._resolve_device_id(device_id), cydriver.CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK + self._effective_device_id(), cydriver.CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK ) - def shared_size_bytes(self, device_id: Device | int = None) -> int: + @property + def shared_size_bytes(self) -> int: """int : The size in bytes of statically-allocated shared memory required by this function. This attribute is read-only.""" return self._get_cached_attribute( - self._resolve_device_id(device_id), cydriver.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES + self._effective_device_id(), cydriver.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES ) - def const_size_bytes(self, device_id: Device | int = None) -> int: + @property + def const_size_bytes(self) -> int: """int : The size in bytes of user-allocated constant memory required by this function. This attribute is read-only.""" return self._get_cached_attribute( - self._resolve_device_id(device_id), cydriver.CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES + self._effective_device_id(), cydriver.CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES ) - def local_size_bytes(self, device_id: Device | int = None) -> int: + @property + def local_size_bytes(self) -> int: """int : The size in bytes of local memory used by each thread of this function. This attribute is read-only.""" return self._get_cached_attribute( - self._resolve_device_id(device_id), cydriver.CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES + self._effective_device_id(), cydriver.CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES ) - def num_regs(self, device_id: Device | int = None) -> int: + @property + def num_regs(self) -> int: """int : The number of registers used by each thread of this function. This attribute is read-only.""" return self._get_cached_attribute( - self._resolve_device_id(device_id), cydriver.CU_FUNC_ATTRIBUTE_NUM_REGS + self._effective_device_id(), cydriver.CU_FUNC_ATTRIBUTE_NUM_REGS ) - def ptx_version(self, device_id: Device | int = None) -> int: + @property + def ptx_version(self) -> int: """int : The PTX virtual architecture version for which the function was compiled. This attribute is read-only.""" return self._get_cached_attribute( - self._resolve_device_id(device_id), cydriver.CU_FUNC_ATTRIBUTE_PTX_VERSION + self._effective_device_id(), cydriver.CU_FUNC_ATTRIBUTE_PTX_VERSION ) - def binary_version(self, device_id: Device | int = None) -> int: + @property + def binary_version(self) -> int: """int : The binary architecture version for which the function was compiled. This attribute is read-only.""" return self._get_cached_attribute( - self._resolve_device_id(device_id), cydriver.CU_FUNC_ATTRIBUTE_BINARY_VERSION + self._effective_device_id(), cydriver.CU_FUNC_ATTRIBUTE_BINARY_VERSION ) - def cache_mode_ca(self, device_id: Device | int = None) -> bool: + @property + def cache_mode_ca(self) -> bool: """bool : Whether the function has been compiled with user specified option "-Xptxas --dlcm=ca" set. This attribute is read-only.""" return bool( self._get_cached_attribute( - self._resolve_device_id(device_id), cydriver.CU_FUNC_ATTRIBUTE_CACHE_MODE_CA + self._effective_device_id(), cydriver.CU_FUNC_ATTRIBUTE_CACHE_MODE_CA ) ) - def max_dynamic_shared_size_bytes(self, device_id: Device | int = None) -> int: + @property + def max_dynamic_shared_size_bytes(self) -> int: """int : The maximum size in bytes of dynamically-allocated shared memory that can be used by this function.""" return self._get_cached_attribute( - self._resolve_device_id(device_id), cydriver.CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES + self._effective_device_id(), cydriver.CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES ) - def preferred_shared_memory_carveout(self, device_id: Device | int = None) -> int: + @property + def preferred_shared_memory_carveout(self) -> int: """int : The shared memory carveout preference, in percent of the total shared memory.""" return self._get_cached_attribute( - self._resolve_device_id(device_id), cydriver.CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT + self._effective_device_id(), cydriver.CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT ) - def cluster_size_must_be_set(self, device_id: Device | int = None) -> bool: + @property + def cluster_size_must_be_set(self) -> bool: """bool : The kernel must launch with a valid cluster size specified. This attribute is read-only.""" return bool( self._get_cached_attribute( - self._resolve_device_id(device_id), cydriver.CU_FUNC_ATTRIBUTE_CLUSTER_SIZE_MUST_BE_SET + self._effective_device_id(), cydriver.CU_FUNC_ATTRIBUTE_CLUSTER_SIZE_MUST_BE_SET ) ) - def required_cluster_width(self, device_id: Device | int = None) -> int: + @property + def required_cluster_width(self) -> int: """int : The required cluster width in blocks.""" return self._get_cached_attribute( - self._resolve_device_id(device_id), cydriver.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH + self._effective_device_id(), cydriver.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH ) - def required_cluster_height(self, device_id: Device | int = None) -> int: + @property + def required_cluster_height(self) -> int: """int : The required cluster height in blocks.""" return self._get_cached_attribute( - self._resolve_device_id(device_id), cydriver.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT + self._effective_device_id(), cydriver.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT ) - def required_cluster_depth(self, device_id: Device | int = None) -> int: + @property + def required_cluster_depth(self) -> int: """int : The required cluster depth in blocks.""" return self._get_cached_attribute( - self._resolve_device_id(device_id), cydriver.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH + self._effective_device_id(), cydriver.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH ) - def non_portable_cluster_size_allowed(self, device_id: Device | int = None) -> bool: + @property + def non_portable_cluster_size_allowed(self) -> bool: """bool : Whether the function can be launched with non-portable cluster size.""" return bool( self._get_cached_attribute( - self._resolve_device_id(device_id), + self._effective_device_id(), cydriver.CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED, ) ) - def cluster_scheduling_policy_preference(self, device_id: Device | int = None) -> int: + @property + def cluster_scheduling_policy_preference(self) -> int: """int : The block scheduling policy of a function.""" return self._get_cached_attribute( - self._resolve_device_id(device_id), + self._effective_device_id(), cydriver.CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE, ) -MaxPotentialBlockSizeOccupancyResult = namedtuple("MaxPotential", ("min_grid_size", "max_block_size")) +MaxPotentialBlockSizeOccupancyResult = namedtuple( + "MaxPotentialBlockSizeOccupancyResult", ("min_grid_size", "max_block_size") +) cdef class KernelOccupancy: @@ -291,7 +245,7 @@ cdef class KernelOccupancy: launch parameters such as block size, grid size, and shared memory usage. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: raise RuntimeError("KernelOccupancy cannot be instantiated directly. Please use Kernel APIs.") @staticmethod @@ -358,7 +312,7 @@ cdef class KernelOccupancy: Returns ------- :obj:`~MaxPotentialBlockSizeOccupancyResult` - An object with `min_grid_size` amd `max_block_size` attributes encoding + An object with `min_grid_size` and `max_block_size` attributes encoding the suggested launch configuration. Note @@ -418,7 +372,7 @@ cdef class KernelOccupancy: )) return dynamic_smem_size - def max_potential_cluster_size(self, config: LaunchConfig, stream: Stream | None = None) -> int: + def max_potential_cluster_size(self, config: LaunchConfig, *, stream: Stream) -> int: """Maximum potential cluster size. The maximum potential cluster size for this kernel and given launch configuration. @@ -427,8 +381,10 @@ cdef class KernelOccupancy: ---------- config: :obj:`~_launch_config.LaunchConfig` Kernel launch configuration. Cluster dimensions in the configuration are ignored. - stream: :obj:`~Stream`, optional - The stream on which this kernel is to be launched. + stream: :obj:`~Stream` + Keyword-only. The stream on which this kernel is to be launched. + Must be passed explicitly; pass ``device.default_stream`` to + use the default stream. Returns ------- @@ -436,17 +392,15 @@ cdef class KernelOccupancy: The maximum cluster size that can be launched for this kernel and launch configuration. """ cdef cydriver.CUlaunchConfig drv_cfg = (config)._to_native_launch_config() - cdef Stream s - if stream is not None: - s = stream - drv_cfg.hStream = as_cu(s._h_stream) + cdef Stream s = Stream_accept(stream) + drv_cfg.hStream = as_cu(s._h_stream) cdef int cluster_size cdef cydriver.CUfunction func = as_cu(self._h_kernel) with nogil: HANDLE_RETURN(cydriver.cuOccupancyMaxPotentialClusterSize(&cluster_size, func, &drv_cfg)) return cluster_size - def max_active_clusters(self, config: LaunchConfig, stream: Stream | None = None) -> int: + def max_active_clusters(self, config: LaunchConfig, *, stream: Stream) -> int: """Maximum number of active clusters on the target device. The maximum number of clusters that could concurrently execute on the target device. @@ -455,8 +409,10 @@ cdef class KernelOccupancy: ---------- config: :obj:`~_launch_config.LaunchConfig` Kernel launch configuration. - stream: :obj:`~Stream`, optional - The stream on which this kernel is to be launched. + stream: :obj:`~Stream` + Keyword-only. The stream on which this kernel is to be launched. + Must be passed explicitly; pass ``device.default_stream`` to + use the default stream. Returns ------- @@ -464,10 +420,8 @@ cdef class KernelOccupancy: The maximum number of clusters that could co-exist on the target device. """ cdef cydriver.CUlaunchConfig drv_cfg = (config)._to_native_launch_config() - cdef Stream s - if stream is not None: - s = stream - drv_cfg.hStream = as_cu(s._h_stream) + cdef Stream s = Stream_accept(stream) + drv_cfg.hStream = as_cu(s._h_stream) cdef int num_clusters cdef cydriver.CUfunction func = as_cu(self._h_kernel) with nogil: @@ -489,7 +443,7 @@ cdef class Kernel: """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: raise RuntimeError("Kernel objects cannot be instantiated directly. Please use ObjectCode APIs.") @staticmethod @@ -501,6 +455,7 @@ cdef class Kernel: return ker @property + @cython.critical_section def attributes(self) -> KernelAttributes: """Get the read-only attributes of this kernel.""" if self._attributes is None: @@ -508,11 +463,15 @@ cdef class Kernel: return self._attributes cdef tuple _get_arguments_info(self, bint param_info=False): - if not _is_paraminfo_supported(): - driver_ver = _get_driver_ver() + if cy_driver_version() < (12, 4, 0): raise NotImplementedError( "Driver version 12.4 or newer is required for this function. " - f"Using driver version {driver_ver // 1000}.{(driver_ver % 1000) // 10}" + f"Using driver version {'.'.join(map(str, cy_driver_version()))}" + ) + if cy_binding_version() < (12, 4, 0): + raise NotImplementedError( + "cuda.bindings 12.4 or newer is required for this function. " + f"Using binding version {'.'.join(map(str, cy_binding_version()))}" ) cdef size_t arg_pos = 0 cdef list param_info_data = [] @@ -544,6 +503,7 @@ cdef class Kernel: return param_info @property + @cython.critical_section def occupancy(self) -> KernelOccupancy: """Get the occupancy information for launching this kernel.""" if self._occupancy is None: @@ -551,7 +511,7 @@ cdef class Kernel: return self._occupancy @property - def handle(self): + def handle(self) -> object: """Return the underlying kernel handle object. .. caution:: @@ -562,11 +522,11 @@ cdef class Kernel: return as_py(self._h_kernel) @property - def _handle(self): + def _handle(self) -> object: return self.handle @staticmethod - def from_handle(handle, mod: ObjectCode = None) -> Kernel: + def from_handle(handle, mod: ObjectCode | None = None) -> Kernel: """Creates a new :obj:`Kernel` object from a kernel handle. Parameters @@ -607,7 +567,7 @@ cdef class Kernel: k._keepalive = mod return k - def __eq__(self, other) -> bool: + def __eq__(self, other: object) -> bool: if not isinstance(other, Kernel): return NotImplemented return as_intptr(self._h_kernel) == as_intptr((other)._h_kernel) @@ -621,7 +581,7 @@ cdef class Kernel: CodeTypeT = bytes | bytearray | str -cdef tuple _supported_code_type = ("cubin", "ptx", "ltoir", "fatbin", "object", "library") +cdef tuple _supported_code_type = tuple(ObjectCodeFormatType.__members__.values()) cdef class ObjectCode: """Represent a compiled program to be loaded onto the device. @@ -637,23 +597,28 @@ cdef class ObjectCode: :class:`~cuda.core.Program` """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: raise RuntimeError( "ObjectCode objects cannot be instantiated directly. " "Please use ObjectCode APIs (from_cubin, from_ptx) or Program APIs (compile)." ) @classmethod - def _init(cls, module, code_type, *, name: str = "", symbol_mapping: dict | None = None): + def _init(cls, module, code_type, *, name: str = "", symbol_mapping: dict[str, str] | None = None) -> ObjectCode: assert code_type in _supported_code_type, f"{code_type=} is not supported" cdef ObjectCode self = ObjectCode.__new__(ObjectCode) # _h_library is assigned during _lazy_load_module self._h_library = LibraryHandle() # Empty handle - _lazy_init() - self._code_type = code_type - self._module = module + self._code_type = str(code_type) + + if isinstance(module, (str, bytes, bytearray)): + self._module = module + elif isinstance(module, PathLike): + self._module = fspath(module) + else: + self._module = module self._sym_map = {} if symbol_mapping is None else symbol_mapping self._name = name if name else "" @@ -663,18 +628,19 @@ cdef class ObjectCode: def _reduce_helper(module, code_type, name, symbol_mapping): return ObjectCode._init(module, code_type, name=name if name else "", symbol_mapping=symbol_mapping) - def __reduce__(self): + def __reduce__(self) -> tuple[object, ...]: return ObjectCode._reduce_helper, (self._module, self._code_type, self._name, self._sym_map) @staticmethod - def from_cubin(module: bytes | str, *, name: str = "", symbol_mapping: dict | None = None) -> ObjectCode: + def from_cubin(module: bytes | str | PathLike[str], *, name: str = "", symbol_mapping: dict[str, str] | None = None) -> ObjectCode: """Create an :class:`ObjectCode` instance from an existing cubin. Parameters ---------- - module : Union[bytes, str] + module : Union[bytes, str, os.PathLike] Either a bytes object containing the in-memory cubin to load, or - a file path string pointing to the on-disk cubin to load. + a file path object (or its string representation) pointing to the + on-disk cubin to load. name : Optional[str] A human-readable identifier representing this code object. symbol_mapping : Optional[dict] @@ -682,17 +648,18 @@ cdef class ObjectCode: should be mapped to the mangled names before trying to retrieve them (default to no mappings). """ - return ObjectCode._init(module, "cubin", name=name, symbol_mapping=symbol_mapping) + return ObjectCode._init(module, ObjectCodeFormatType.CUBIN, name=name, symbol_mapping=symbol_mapping) @staticmethod - def from_ptx(module: bytes | str, *, name: str = "", symbol_mapping: dict | None = None) -> ObjectCode: + def from_ptx(module: bytes | str | PathLike[str], *, name: str = "", symbol_mapping: dict[str, str] | None = None) -> ObjectCode: """Create an :class:`ObjectCode` instance from an existing PTX. Parameters ---------- - module : Union[bytes, str] + module : Union[bytes, str, os.PathLike] Either a bytes object containing the in-memory ptx code to load, or - a file path string pointing to the on-disk ptx file to load. + a file path object (or its string representation) pointing to the + on-disk ptx file to load. name : Optional[str] A human-readable identifier representing this code object. symbol_mapping : Optional[dict] @@ -700,17 +667,18 @@ cdef class ObjectCode: should be mapped to the mangled names before trying to retrieve them (default to no mappings). """ - return ObjectCode._init(module, "ptx", name=name, symbol_mapping=symbol_mapping) + return ObjectCode._init(module, ObjectCodeFormatType.PTX, name=name, symbol_mapping=symbol_mapping) @staticmethod - def from_ltoir(module: bytes | str, *, name: str = "", symbol_mapping: dict | None = None) -> ObjectCode: + def from_ltoir(module: bytes | str | PathLike[str], *, name: str = "", symbol_mapping: dict[str, str] | None = None) -> ObjectCode: """Create an :class:`ObjectCode` instance from an existing LTOIR. Parameters ---------- - module : Union[bytes, str] - Either a bytes object containing the in-memory ltoir code to load, or - a file path string pointing to the on-disk ltoir file to load. + module : Union[bytes, str, os.PathLike] + Either a bytes object containing the in-memory ltoir code to load, + or a file path object (or its string representation) pointing to the + on-disk ltoir file to load. name : Optional[str] A human-readable identifier representing this code object. symbol_mapping : Optional[dict] @@ -718,17 +686,18 @@ cdef class ObjectCode: should be mapped to the mangled names before trying to retrieve them (default to no mappings). """ - return ObjectCode._init(module, "ltoir", name=name, symbol_mapping=symbol_mapping) + return ObjectCode._init(module, ObjectCodeFormatType.LTOIR, name=name, symbol_mapping=symbol_mapping) @staticmethod - def from_fatbin(module: bytes | str, *, name: str = "", symbol_mapping: dict | None = None) -> ObjectCode: + def from_fatbin(module: bytes | str | PathLike[str], *, name: str = "", symbol_mapping: dict[str, str] | None = None) -> ObjectCode: """Create an :class:`ObjectCode` instance from an existing fatbin. Parameters ---------- - module : Union[bytes, str] + module : Union[bytes, str, os.PathLike] Either a bytes object containing the in-memory fatbin to load, or - a file path string pointing to the on-disk fatbin to load. + or a file path object (or its string representation) pointing to the + on-disk fatbin to load. name : Optional[str] A human-readable identifier representing this code object. symbol_mapping : Optional[dict] @@ -736,10 +705,10 @@ cdef class ObjectCode: should be mapped to the mangled names before trying to retrieve them (default to no mappings). """ - return ObjectCode._init(module, "fatbin", name=name, symbol_mapping=symbol_mapping) + return ObjectCode._init(module, ObjectCodeFormatType.FATBIN, name=name, symbol_mapping=symbol_mapping) @staticmethod - def from_object(module: bytes | str, *, name: str = "", symbol_mapping: dict | None = None) -> ObjectCode: + def from_object(module: bytes | str, *, name: str = "", symbol_mapping: dict[str, str] | None = None) -> ObjectCode: """Create an :class:`ObjectCode` instance from an existing object code. Parameters @@ -754,10 +723,10 @@ cdef class ObjectCode: should be mapped to the mangled names before trying to retrieve them (default to no mappings). """ - return ObjectCode._init(module, "object", name=name, symbol_mapping=symbol_mapping) + return ObjectCode._init(module, ObjectCodeFormatType.OBJECT, name=name, symbol_mapping=symbol_mapping) @staticmethod - def from_library(module: bytes | str, *, name: str = "", symbol_mapping: dict | None = None) -> ObjectCode: + def from_library(module: bytes | str, *, name: str = "", symbol_mapping: dict[str, str] | None = None) -> ObjectCode: """Create an :class:`ObjectCode` instance from an existing library. Parameters @@ -772,31 +741,33 @@ cdef class ObjectCode: should be mapped to the mangled names before trying to retrieve them (default to no mappings). """ - return ObjectCode._init(module, "library", name=name, symbol_mapping=symbol_mapping) + return ObjectCode._init(module, ObjectCodeFormatType.LIBRARY, name=name, symbol_mapping=symbol_mapping) # TODO: do we want to unload in a finalizer? Probably not.. + @cython.critical_section cdef int _lazy_load_module(self) except -1: if self._h_library: return 0 module = self._module - assert_type_str_or_bytes_like(module) cdef bytes path_bytes if isinstance(module, str): path_bytes = module.encode() self._h_library = create_library_handle_from_file(path_bytes) - if not self._h_library: - HANDLE_RETURN(get_last_error()) - return 0 - if isinstance(module, (bytes, bytearray)): + elif isinstance(module, (bytes, bytearray)): self._h_library = create_library_handle_from_data(module) - if not self._h_library: - HANDLE_RETURN(get_last_error()) - return 0 - raise_code_path_meant_to_be_unreachable() - return -1 + elif isinstance(module, PathLike): + path_bytes = fsencode(module) + self._h_library = create_library_handle_from_file(path_bytes) + else: + assert_type_str_or_bytes_like(module) + raise_code_path_meant_to_be_unreachable() + return -1 + if not self._h_library: + HANDLE_RETURN(get_last_error()) + return 0 - def get_kernel(self, name) -> Kernel: + def get_kernel(self, name: str | bytes) -> Kernel: """Return the :obj:`~_module.Kernel` of a specified name from this object code. Parameters @@ -811,7 +782,7 @@ cdef class ObjectCode: """ self._lazy_load_module() - supported_code_types = ("cubin", "ptx", "fatbin") + supported_code_types = (ObjectCodeFormatType.CUBIN, ObjectCodeFormatType.PTX, ObjectCodeFormatType.FATBIN) if self._code_type not in supported_code_types: raise RuntimeError(f'Unsupported code type "{self._code_type}" ({supported_code_types=})') try: @@ -841,12 +812,12 @@ cdef class ObjectCode: return self._code_type @property - def symbol_mapping(self) -> dict: + def symbol_mapping(self) -> dict[str, str]: """Return a copy of the symbol mapping dictionary.""" return dict(self._sym_map) @property - def handle(self): + def handle(self) -> object: """Return the underlying handle object. .. caution:: @@ -857,7 +828,7 @@ cdef class ObjectCode: self._lazy_load_module() return as_py(self._h_library) - def __eq__(self, other) -> bool: + def __eq__(self, other: object) -> bool: if not isinstance(other, ObjectCode): return NotImplemented # Trigger lazy load for both objects to compare handles diff --git a/cuda_core/cuda/core/_program.pxd b/cuda_core/cuda/core/_program.pxd index b2feeba860d..cea430c3f20 100644 --- a/cuda_core/cuda/core/_program.pxd +++ b/cuda_core/cuda/core/_program.pxd @@ -17,5 +17,6 @@ cdef class Program: object _compile_lock # Per-instance lock for compile-time mutation bint _use_libdevice # Flag for libdevice loading bint _libdevice_added - bytes _nvrtc_code # Source code for NVRTC retry (PCH auto-resize) + bytes _code # Source code as bytes: used for key derivation and NVRTC PCH retry + str _code_type # Normalised code_type ("c++", "ptx", "nvvm") str _pch_status # PCH creation outcome after compile diff --git a/cuda_core/cuda/core/_program.pyi b/cuda_core/cuda/core/_program.pyi new file mode 100644 index 00000000000..df7ed66446a --- /dev/null +++ b/cuda_core/cuda/core/_program.pyi @@ -0,0 +1,440 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_program.pyx + +"""Compilation machinery for CUDA programs. + +This module provides :class:`Program` for compiling source code into +:class:`~cuda.core.ObjectCode`, with :class:`ProgramOptions` for configuration. +""" +from __future__ import annotations + +from dataclasses import dataclass + +from cuda.bindings import nvrtc +from cuda.core._linker import LinkerHandleT +from cuda.core._module import ObjectCode +from cuda.core.typing import (CompilerBackendType, ObjectCodeFormatType, + PCHStatusType, SourceCodeType) +from cuda.core.utils._program_cache import ProgramCacheResource + + +class Program: + """Represent a compilation machinery to process programs into + :class:`~cuda.core.ObjectCode`. + + This object provides a unified interface to multiple underlying + compiler libraries. Compilation support is enabled for a wide + range of code types and compilation types. + + Parameters + ---------- + code : str | bytes | bytearray + The source code to compile. For C++ and PTX, must be a string. + For NVVM IR, can be str, bytes, or bytearray. + code_type : SourceCodeType | str + The type of source code. Must be one of ``"c++"``, ``"ptx"``, or ``"nvvm"``. + options : :class:`ProgramOptions`, optional + Options to customize the compilation process. + """ + + def __init__(self, code: str | bytes | bytearray, code_type: SourceCodeType | str, options: ProgramOptions | None=None): + ... + + def close(self) -> None: + """Destroy this program.""" + + def compile(self, target_type: ObjectCodeFormatType | str, name_expressions: tuple[str, ...] | list[str]=..., logs: object=None, *, cache: ProgramCacheResource | None=None) -> ObjectCode: + """Compile the program to the specified target type. + + Parameters + ---------- + target_type : ObjectCodeFormatType | str + The compilation target. Must be one of ``"ptx"``, ``"cubin"``, or ``"ltoir"``. + name_expressions : tuple | list, optional + Sequence of name expressions to make accessible in the compiled code. + Used for template instantiation and similar cases. + logs : object, optional + Object with a ``write`` method to receive compilation logs. + On a cache hit no compilation runs and ``logs`` receives + nothing -- callers that rely on log output to confirm a + compile happened should compile without ``cache=``. + cache : :class:`~cuda.core.utils.ProgramCacheResource`, optional + If provided, the compiled binary is looked up in ``cache`` via a + key derived from the program's code, options, and ``target_type``. + On a hit the cached bytes are wrapped in a fresh + :class:`~cuda.core.ObjectCode` (with the same ``target_type`` + and ``ProgramOptions.name``) and returned without re-compiling; + on a miss the compile output is stored as raw bytes (the cache + extracts ``bytes(object_code.code)``). Passing a non-empty + ``name_expressions`` together with ``cache=`` raises + ``ValueError``: NVRTC populates + ``ObjectCode.symbol_mapping`` at compile time and that mapping + is not carried in the binary the cache stores, so cache hits + would silently miss ``get_kernel(name_expression)`` lookups. + Options that require an ``extra_digest`` (``include_path``, + ``pre_include``, ``pch``, ``use_pch``, ``pch_dir``, NVVM + ``use_libdevice=True``, or NVRTC ``options.name`` with a + directory component) raise ``ValueError`` via + :func:`~cuda.core.utils.make_program_cache_key`; for those + compiles, use the manual ``make_program_cache_key(...)`` + pattern directly. + + ``cache=`` is independent of ``ProgramOptions.no_cache``: the + former controls this program-level cache (compiled-output + reuse across calls), while ``no_cache`` is forwarded to the + Linker to disable its in-process JIT cache for cuLink/nvJitLink. + Setting ``options.no_cache=True`` does not bypass ``cache=``, + and vice-versa. + + Returns + ------- + :class:`~cuda.core.ObjectCode` + The compiled object code. + """ + + @property + def pch_status(self) -> PCHStatusType | None: + """PCH creation outcome from the most recent :meth:`compile` call. + + Possible values: + + * ``"created"`` — PCH file was written successfully. + * ``"not_attempted"`` — PCH creation was not attempted (e.g. the + compiler decided not to, or automatic PCH processing skipped it). + * ``"failed"`` — an error prevented PCH creation. + * ``None`` — PCH was not requested, the program has not been + compiled yet, the backend is not NVRTC (e.g. PTX or NVVM), + or the NVRTC bindings are too old to report status. + + When ``create_pch`` is set in :class:`ProgramOptions` and the PCH + heap is too small, :meth:`compile` automatically resizes the heap + and retries, so ``"created"`` should be the common outcome. + + .. note:: + + PCH is only supported for ``code_type="c++"`` programs that + use the NVRTC backend. For PTX and NVVM programs this property + always returns ``None``. + """ + + @property + def backend(self) -> CompilerBackendType: + """Return this Program instance's underlying :class:`CompilerBackendType`.""" + + @property + def handle(self) -> ProgramHandleT: + """Return the underlying handle object. + + .. note:: + + The type of the returned object depends on the backend. + + .. caution:: + + This handle is a Python object. To get the memory address of the underlying C + handle, call ``int(Program.handle)``. + """ + + def __repr__(self) -> str: + ... + +@dataclass +class ProgramOptions: + """Customizable options for configuring :class:`Program`. + + Attributes + ---------- + name : str, optional + Name of the program. If the compilation succeeds, the name is passed down to the generated :class:`ObjectCode`. + arch : str, optional + Pass the SM architecture value, such as ``sm_`` (for generating CUBIN) or + ``compute_`` (for generating PTX). If not provided, the current device's architecture + will be used. + relocatable_device_code : bool, optional + Enable (disable) the generation of relocatable device code. + Default: False + extensible_whole_program : bool, optional + Do extensible whole program compilation of device code. + Default: False + debug : bool, optional + Generate debug information. If --dopt is not specified, then turns off all optimizations. + Default: False + lineinfo: bool, optional + Generate line-number information. + Default: False + device_code_optimize : bool, optional + 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 + Specify one or more options directly to ptxas, the PTX optimizing assembler. Options should be strings. + For example ["-v", "-O2"]. + Default: None + max_register_count : int, optional + Specify the maximum amount of registers that GPU functions can use. + Default: None + ftz : bool, optional + When performing single-precision floating-point operations, flush denormal values to zero or preserve denormal + values. + Default: False + prec_sqrt : bool, optional + For single-precision floating-point square root, use IEEE round-to-nearest mode or use a faster approximation. + Default: True + prec_div : bool, optional + For single-precision floating-point division and reciprocals, use IEEE round-to-nearest mode or use a faster + approximation. + Default: True + fma : bool, optional + Enables (disables) the contraction of floating-point multiplies and adds/subtracts into floating-point + multiply-add operations. + Default: True + use_fast_math : bool, optional + Make use of fast math operations. + Default: False + extra_device_vectorization : bool, optional + Enables more aggressive device code vectorization in the NVVM optimizer. + Default: False + link_time_optimization : bool, optional + Generate intermediate code for later link-time optimization. + Default: False + 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 + 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 + Cancel any previous definition of a macro, or list of macros. + Default: None + 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 + Preinclude one or more headers during preprocessing. Can be either a string or a list of strings. + Default: None + no_source_include : bool, optional + Disable the default behavior of adding the directory of each input source to the include path. + Default: False + std : str, optional + Set language dialect to C++03, C++11, C++14, C++17 or C++20. + Default: c++17 + builtin_move_forward : bool, optional + Provide builtin definitions of std::move and std::forward. + Default: True + builtin_initializer_list : bool, optional + Provide builtin definitions of std::initializer_list class and member functions. + Default: True + disable_warnings : bool, optional + Inhibit all warning messages. + Default: False + restrict : bool, optional + Programmer assertion that all kernel pointer parameters are restrict pointers. + Default: False + device_as_default_execution_space : bool, optional + Treat entities with no execution space annotation as __device__ entities. + Default: False + device_int128 : bool, optional + Allow the __int128 type in device code. + Default: False + optimization_info : str, optional + Provide optimization reports for the specified kind of optimization. + Default: None + 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 + Emit error for a specified diagnostic message number or comma-separated list of numbers. + Default: None + 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 + Emit warning for a specified diagnostic message number or comma-separated list of numbers. + Default: None + brief_diagnostics : bool, optional + Disable or enable showing source line and column info in a diagnostic. + Default: False + time : str, optional + Generate a CSV table with the time taken by each compilation phase. + Default: None + split_compile : int, optional + Perform compiler optimizations in parallel. + Default: 1 + fdevice_syntax_only : bool, optional + Ends device compilation after front-end syntax checking. + Default: False + minimal : bool, optional + Omit certain language features to reduce compile time for small programs. + Default: False + no_cache : bool, optional + Disable compiler caching. + Default: False + fdevice_time_trace : str, optional + Generate time trace JSON for profiling compilation (NVRTC only). + Default: None + device_float128 : bool, optional + Allow __float128 type in device code (NVRTC only). + Default: False + frandom_seed : str, optional + Set random seed for randomized optimizations (NVRTC only). + Default: None + ofast_compile : str, optional + Fast compilation mode: "0", "min", "mid", or "max" (NVRTC only). + Default: None + pch : bool, optional + Use default precompiled header (NVRTC only, CUDA 12.8+). + Default: False + create_pch : str, optional + Create precompiled header file (NVRTC only, CUDA 12.8+). + Default: None + use_pch : str, optional + Use specific precompiled header file (NVRTC only, CUDA 12.8+). + Default: None + pch_dir : str, optional + PCH directory location (NVRTC only, CUDA 12.8+). + Default: None + pch_verbose : bool, optional + Verbose PCH output (NVRTC only, CUDA 12.8+). + Default: False + pch_messages : bool, optional + Control PCH diagnostic messages (NVRTC only, CUDA 12.8+). + Default: False + instantiate_templates_in_pch : bool, optional + Control template instantiation in PCH (NVRTC only, CUDA 12.8+). + Default: False + extra_sources : list of 2-tuples or tuple of 2-tuples, optional + Additional NVVM IR modules to compile together with the main program, specified as + ``((name1, source1), (name2, source2), ...)``. Each name is a string identifier used + in diagnostic messages. Each source can be a string (textual LLVM IR) or bytes/bytearray + (LLVM bitcode). Only supported for the NVVM backend. + Default: None + use_libdevice : bool, optional + Load NVIDIA's `libdevice `_ + math builtins library. Only supported for the NVVM backend. + Default: False + """ + name: str | None = 'default_program' + arch: str | None = None + relocatable_device_code: bool | None = None + extensible_whole_program: bool | None = None + debug: bool | None = None + lineinfo: bool | None = None + device_code_optimize: bool | None = None + ptxas_options: str | list[str] | tuple[str] | None = None + max_register_count: int | None = None + ftz: bool | None = None + prec_sqrt: bool | None = None + prec_div: bool | None = None + fma: bool | None = None + use_fast_math: bool | None = None + extra_device_vectorization: bool | None = None + link_time_optimization: bool | None = None + gen_opt_lto: bool | None = None + define_macro: str | tuple[str, str] | list[str | tuple[str, str]] | tuple[str | tuple[str, str], ...] | None = None + undefine_macro: str | list[str] | tuple[str] | None = None + include_path: str | list[str] | tuple[str] | None = None + pre_include: str | list[str] | tuple[str] | None = None + no_source_include: bool | None = None + std: str | None = None + builtin_move_forward: bool | None = None + builtin_initializer_list: bool | None = None + disable_warnings: bool | None = None + restrict: bool | None = None + device_as_default_execution_space: bool | None = None + device_int128: bool | None = None + optimization_info: str | None = None + no_display_error_number: bool | None = None + diag_error: int | list[int] | tuple[int] | None = None + diag_suppress: int | list[int] | tuple[int] | None = None + diag_warn: int | list[int] | tuple[int] | None = None + brief_diagnostics: bool | None = None + time: str | None = None + split_compile: int | None = None + fdevice_syntax_only: bool | None = None + minimal: bool | None = None + no_cache: bool | None = None + fdevice_time_trace: str | None = None + device_float128: bool | None = None + frandom_seed: str | None = None + ofast_compile: str | None = None + pch: bool | None = None + create_pch: str | None = None + use_pch: str | None = None + pch_dir: str | None = None + pch_verbose: bool | None = None + pch_messages: bool | None = None + instantiate_templates_in_pch: bool | None = None + extra_sources: list[tuple[str, str | bytes | bytearray]] | tuple[tuple[str, str | bytes | bytearray], ...] | None = None + use_libdevice: bool | None = None + numba_debug: bool | None = None + + def __post_init__(self) -> None: + ... + + def _prepare_nvrtc_options(self) -> list[bytes]: + ... + + def _prepare_nvvm_options(self, as_bytes: bool=True) -> list[bytes] | list[str]: + ... + + def as_bytes(self, backend: CompilerBackendType | str, target_type: ObjectCodeFormatType | str | None=None) -> list[bytes]: + """Convert program options to bytes format for the specified backend. + + This method transforms the program options into a format suitable for the + specified compiler backend. Different backends may use different option names + and formats even for the same conceptual options. + + Parameters + ---------- + backend : CompilerBackendType | str + The compiler backend to prepare options for. Must be either "nvrtc" or "nvvm". + target_type : ObjectCodeFormatType | str, optional + The compilation target type (e.g., "ptx", "cubin", "ltoir"). Some backends + require additional options based on the target type. + + Returns + ------- + list[bytes] + List of option strings encoded as bytes. + + Raises + ------ + ValueError + If an unknown backend is specified. + CUDAError + If an option incompatible with the specified backend is set. + + Examples + -------- + >>> options = ProgramOptions(arch="sm_80", debug=True) + >>> nvrtc_options = options.as_bytes("nvrtc") + """ + + def __repr__(self) -> str: + ... + + def _prepare_extra_sources_bytes(self) -> list[tuple[bytes, bytes]] | None: + """Convert extra_sources to bytes format for NVVM.""" +__all__ = ['Program', 'ProgramOptions'] +ProgramHandleT = nvrtc.nvrtcProgram | int | LinkerHandleT +_nvvm_module = None +_nvvm_import_attempted = False + +def _can_load_generated_ptx() -> bool: + """Check if the driver can load PTX generated by the current NVRTC version.""" + +def _program_compile_uncached(program, target_type, name_expressions, logs): + """Run ``Program_compile`` without the cache wrapper. + + Module-level Python function so tests can monkeypatch it from + ``cuda.core._program`` to avoid invoking NVRTC when exercising the cache + wrapper in :meth:`Program.compile`. ``Program`` itself is a ``cdef class`` + and its methods cannot be reassigned from Python, so the seam must live + outside the class. + """ + +def _get_nvvm_module() -> object: + """Get the NVVM module, importing it lazily with availability checks.""" + +def _find_libdevice_path() -> object: + """Find libdevice*.bc for NVVM compilation using cuda.pathfinder.""" \ No newline at end of file diff --git a/cuda_core/cuda/core/_program.pyx b/cuda_core/cuda/core/_program.pyx index a58f6a4ffc8..2b2e5262a2c 100644 --- a/cuda_core/cuda/core/_program.pyx +++ b/cuda_core/cuda/core/_program.pyx @@ -11,9 +11,13 @@ from __future__ import annotations from dataclasses import dataclass import threading +from typing import TYPE_CHECKING from warnings import warn -from cuda.bindings import driver, nvrtc +if TYPE_CHECKING: + from cuda.core.utils._program_cache import ProgramCacheResource # no-cython-lint + +from cuda.bindings import nvrtc from cuda.pathfinder._optional_cuda_import import _optional_cuda_import from libcpp.vector cimport vector @@ -34,11 +38,12 @@ from cuda.core._utils.cuda_utils import ( CUDAError, _handle_boolean_option, check_or_create_options, - get_binding_version, handle_return, is_nested_sequence, is_sequence, ) +from cuda.core._utils.version import binding_version, driver_version +from cuda.core.typing import ObjectCodeFormatType, CompilerBackendType, PCHStatusType, SourceCodeType __all__ = ["Program", "ProgramOptions"] @@ -67,16 +72,15 @@ cdef class Program: code : str | bytes | bytearray The source code to compile. For C++ and PTX, must be a string. For NVVM IR, can be str, bytes, or bytearray. - code_type : str + code_type : SourceCodeType | str The type of source code. Must be one of ``"c++"``, ``"ptx"``, or ``"nvvm"``. options : :class:`ProgramOptions`, optional Options to customize the compilation process. """ + def __init__(self, code: str | bytes | bytearray, code_type: SourceCodeType | str, options: ProgramOptions | None = None): + Program_init(self, code, str(code_type), options) - def __init__(self, code: str | bytes | bytearray, code_type: str, options: ProgramOptions | None = None): - Program_init(self, code, code_type, options) - - def close(self): + def close(self) -> None: """Destroy this program.""" if self._linker: self._linker.close() @@ -85,29 +89,147 @@ cdef class Program: self._h_nvvm.reset() def compile( - self, target_type: str, name_expressions: tuple | list = (), logs = None + self, + target_type: ObjectCodeFormatType | str, + name_expressions: tuple[str, ...] | list[str] = (), + logs: object = None, + *, + cache: ProgramCacheResource | None = None, ) -> ObjectCode: """Compile the program to the specified target type. Parameters ---------- - target_type : str + target_type : ObjectCodeFormatType | str The compilation target. Must be one of ``"ptx"``, ``"cubin"``, or ``"ltoir"``. name_expressions : tuple | list, optional Sequence of name expressions to make accessible in the compiled code. Used for template instantiation and similar cases. logs : object, optional Object with a ``write`` method to receive compilation logs. + On a cache hit no compilation runs and ``logs`` receives + nothing -- callers that rely on log output to confirm a + compile happened should compile without ``cache=``. + cache : :class:`~cuda.core.utils.ProgramCacheResource`, optional + If provided, the compiled binary is looked up in ``cache`` via a + key derived from the program's code, options, and ``target_type``. + On a hit the cached bytes are wrapped in a fresh + :class:`~cuda.core.ObjectCode` (with the same ``target_type`` + and ``ProgramOptions.name``) and returned without re-compiling; + on a miss the compile output is stored as raw bytes (the cache + extracts ``bytes(object_code.code)``). Passing a non-empty + ``name_expressions`` together with ``cache=`` raises + ``ValueError``: NVRTC populates + ``ObjectCode.symbol_mapping`` at compile time and that mapping + is not carried in the binary the cache stores, so cache hits + would silently miss ``get_kernel(name_expression)`` lookups. + Options that require an ``extra_digest`` (``include_path``, + ``pre_include``, ``pch``, ``use_pch``, ``pch_dir``, NVVM + ``use_libdevice=True``, or NVRTC ``options.name`` with a + directory component) raise ``ValueError`` via + :func:`~cuda.core.utils.make_program_cache_key`; for those + compiles, use the manual ``make_program_cache_key(...)`` + pattern directly. + + ``cache=`` is independent of ``ProgramOptions.no_cache``: the + former controls this program-level cache (compiled-output + reuse across calls), while ``no_cache`` is forwarded to the + Linker to disable its in-process JIT cache for cuLink/nvJitLink. + Setting ``options.no_cache=True`` does not bypass ``cache=``, + and vice-versa. Returns ------- :class:`~cuda.core.ObjectCode` The compiled object code. """ - return Program_compile(self, target_type, name_expressions, logs) + # Mirror Program_init's code_type normalization so callers can pass + # ``ObjectCodeFormatType.PTX`` or ``"PTX"`` and get the same routing + # / cache key as the lowercase string. ``Program_compile_nvrtc`` + # keys on lowercase ``target_type`` and ``make_program_cache_key`` + # lowercases too. + target_type = str(target_type).lower() + + if cache is None: + return _program_compile_uncached(self, target_type, name_expressions, logs) + + # Deferred import to avoid a circular import between _program and + # cuda.core.utils._program_cache (the cache module already imports + # ProgramOptions from this module). Import from the leaf module so + # tests that monkeypatch make_program_cache_key via that path + # intercept reliably. + from cuda.core.utils._program_cache import ( + ProgramCacheResource, + make_program_cache_key, + ) + + if not isinstance(cache, ProgramCacheResource): + raise TypeError( + "cache must be an instance of " + "cuda.core.utils.ProgramCacheResource; got " + f"{type(cache).__name__}" + ) + + # ``name_expressions`` is incompatible with the cache: NVRTC + # populates ``ObjectCode.symbol_mapping`` from name-expression + # mangling at compile time, and that mapping isn't carried in + # the binary bytes the cache stores. Without this guard the + # first call (cache miss) would return an ObjectCode with + # symbol_mapping populated, while every subsequent call (hit) + # would return one without -- silently breaking later + # ``get_kernel(name_expression)`` lookups that work on the + # uncached path. Fail loud here instead. + if name_expressions: + raise ValueError( + "Program.compile(cache=...) does not support name_expressions: " + "ObjectCode.symbol_mapping is populated by NVRTC at compile " + "time and is not preserved across a cache round-trip, so cache " + "hits would silently break get_kernel(name_expression) lookups " + "that the uncached path supports. Compile without cache= when " + "name_expressions are needed, or look up mangled symbols by " + "hand from the cached ObjectCode." + ) + + # ``self._code`` is always stored as bytes (see ``Program_init``), + # but ``make_program_cache_key`` only accepts bytes when + # ``code_type == "nvvm"`` -- c++/ptx must be ``str``. The bytes + # came from ``code.encode()`` on a ``str`` Program_init validated + # via ``assert_type(code, str)``, so this round-trip is always + # safe; no try/except needed. + code_for_key = self._code if self._code_type == "nvvm" else self._code.decode("utf-8") + + key = make_program_cache_key( + code=code_for_key, + code_type=self._code_type, + options=self._options, + target_type=target_type, + ) + hit_bytes = cache.get(key) + if hit_bytes is not None: + # The uncached NVRTC path warns when the active driver can't + # load freshly-generated PTX; that loadability is a property + # of the driver, not of how the bytes were produced, so the + # warning applies equally to cached PTX. Mirror it here so a + # cache hit doesn't silently hide an incompatibility that the + # uncached call would have surfaced. + if ( + self._backend == "NVRTC" + and target_type == "ptx" + and not _can_load_generated_ptx() + ): + warn( + "The CUDA driver version is older than the backend version. " + "The generated ptx will not be loadable by the current driver.", + stacklevel=2, + category=RuntimeWarning, + ) + return ObjectCode._init(hit_bytes, target_type, name=self._options.name) + compiled = _program_compile_uncached(self, target_type, name_expressions, logs) + cache[key] = compiled + return compiled @property - def pch_status(self) -> str | None: + def pch_status(self) -> PCHStatusType | None: """PCH creation outcome from the most recent :meth:`compile` call. Possible values: @@ -130,12 +252,14 @@ cdef class Program: use the NVRTC backend. For PTX and NVVM programs this property always returns ``None``. """ - return self._pch_status + if self._pch_status is None: + return None + return PCHStatusType(self._pch_status) @property - def backend(self) -> str: - """Return this Program instance's underlying backend.""" - return self._backend + def backend(self) -> CompilerBackendType: + """Return this Program instance's underlying :class:`CompilerBackendType`.""" + return CompilerBackendType(self._backend) @property def handle(self) -> ProgramHandleT: @@ -173,7 +297,7 @@ class ProgramOptions: Attributes ---------- name : str, optional - Name of the program. If the compilation succeeds, the name is passed down to the generated `ObjectCode`. + Name of the program. If the compilation succeeds, the name is passed down to the generated :class:`ObjectCode`. arch : str, optional Pass the SM architecture value, such as ``sm_`` (for generating CUBIN) or ``compute_`` (for generating PTX). If not provided, the current device's architecture @@ -272,13 +396,13 @@ class ProgramOptions: Disable the display of a diagnostic number for warning messages. Default: False diag_error : Union[int, list[int]], optional - Emit error for a specified diagnostic message number or comma separated list of numbers. + Emit error for a specified diagnostic message number or comma-separated list of numbers. Default: None diag_suppress : Union[int, list[int]], optional - Suppress a specified diagnostic message number or comma separated list of numbers. + Suppress a specified diagnostic message number or comma-separated list of numbers. Default: None diag_warn : Union[int, list[int]], optional - Emit warning for a specified diagnostic message number or comma separated lis of numbers. + Emit warning for a specified diagnostic message number or comma-separated list of numbers. Default: None brief_diagnostics : bool, optional Disable or enable showing source line and column info in a diagnostic. @@ -398,11 +522,36 @@ class ProgramOptions: use_libdevice: bool | None = None # For libdevice execution numba_debug: bool | None = None # Custom option for Numba debugging - def __post_init__(self): + def __post_init__(self) -> None: self._name = self.name.encode() # Set arch to default if not provided if self.arch is None: self.arch = f"sm_{Device().arch}" + if self.extra_sources is not None: + if not is_sequence(self.extra_sources): + raise TypeError( + "extra_sources must be a sequence of 2-tuples: ((name1, source1), (name2, source2), ...)" + ) + for i, module in enumerate(self.extra_sources): + if not isinstance(module, tuple) or len(module) != 2: + raise TypeError( + f"Each extra module must be a 2-tuple (name, source)" + f", got {type(module).__name__} at index {i}" + ) + + module_name, module_source = module + + if not isinstance(module_name, str): + raise TypeError(f"Module name at index {i} must be a string, got {type(module_name).__name__}") + + if not isinstance(module_source, (str, bytes, bytearray)): + raise TypeError( + f"Module source at index {i} must be str (textual LLVM IR), bytes (textual LLVM IR or bitcode), " + f"or bytearray, got {type(module_source).__name__}" + ) + + if len(module_source) == 0: + raise ValueError(f"Module source for '{module_name}' (index {i}) cannot be empty") def _prepare_nvrtc_options(self) -> list[bytes]: return _prepare_nvrtc_options_impl(self) @@ -410,7 +559,7 @@ class ProgramOptions: def _prepare_nvvm_options(self, as_bytes: bool = True) -> list[bytes] | list[str]: return _prepare_nvvm_options_impl(self, as_bytes) - def as_bytes(self, backend: str, target_type: str | None = None) -> list[bytes]: + def as_bytes(self, backend: CompilerBackendType | str, target_type: ObjectCodeFormatType | str | None = None) -> list[bytes]: """Convert program options to bytes format for the specified backend. This method transforms the program options into a format suitable for the @@ -419,9 +568,9 @@ class ProgramOptions: Parameters ---------- - backend : str + backend : CompilerBackendType | str The compiler backend to prepare options for. Must be either "nvrtc" or "nvvm". - target_type : str, optional + target_type : ObjectCodeFormatType | str, optional The compilation target type (e.g., "ptx", "cubin", "ltoir"). Some backends require additional options based on the target type. @@ -442,7 +591,7 @@ class ProgramOptions: >>> options = ProgramOptions(arch="sm_80", debug=True) >>> nvrtc_options = options.as_bytes("nvrtc") """ - backend = backend.lower() + backend = str(backend).lower() if backend == "nvrtc": return self._prepare_nvrtc_options() elif backend == "nvvm": @@ -453,20 +602,50 @@ class ProgramOptions: else: raise ValueError(f"Unknown backend '{backend}'. Must be one of: 'nvrtc', 'nvvm'") - def __repr__(self): + def __repr__(self) -> str: return f"ProgramOptions(name={self.name!r}, arch={self.arch!r})" + def _prepare_extra_sources_bytes(self) -> list[tuple[bytes, bytes]] | None: + """Convert extra_sources to bytes format for NVVM.""" + if self.extra_sources is None: + return None + + result = [] + for module_name, module_source in self.extra_sources: + name_bytes = module_name.encode("utf-8") + if isinstance(module_source, str): + source_bytes = module_source.encode("utf-8") + elif isinstance(module_source, bytearray): + source_bytes = bytes(module_source) + else: + source_bytes = module_source + result.append((name_bytes, source_bytes)) + return result + # ============================================================================= # Private Classes and Helper Functions # ============================================================================= + +def _program_compile_uncached(program, target_type, name_expressions, logs): + """Run ``Program_compile`` without the cache wrapper. + + Module-level Python function so tests can monkeypatch it from + ``cuda.core._program`` to avoid invoking NVRTC when exercising the cache + wrapper in :meth:`Program.compile`. ``Program`` itself is a ``cdef class`` + and its methods cannot be reassigned from Python, so the seam must live + outside the class. + """ + return Program_compile(program, target_type, name_expressions, logs) + + # Module-level state for NVVM lazy loading _nvvm_module = None _nvvm_import_attempted = False -def _get_nvvm_module(): +def _get_nvvm_module() -> object: """Get the NVVM module, importing it lazily with availability checks.""" global _nvvm_module, _nvvm_import_attempted @@ -478,10 +657,10 @@ def _get_nvvm_module(): _nvvm_import_attempted = True try: - version = get_binding_version() - if version < (12, 9): + version = binding_version() + if version < (12, 9, 0): raise RuntimeError( - f"NVVM bindings require cuda-bindings >= 12.9.0, but found {version[0]}.{version[1]}.x. " + f"NVVM bindings require cuda-bindings >= 12.9.0, but found {'.'.join(map(str, version))}. " "Please update cuda-bindings to use NVVM features." ) @@ -501,7 +680,7 @@ def _get_nvvm_module(): _nvvm_module = None raise -def _find_libdevice_path(): +def _find_libdevice_path() -> object: """Find libdevice*.bc for NVVM compilation using cuda.pathfinder.""" from cuda.pathfinder import find_bitcode_lib return find_bitcode_lib("device") @@ -537,9 +716,9 @@ cdef inline void _process_define_macro(list options, object macro) except *: cpdef bint _can_load_generated_ptx() except? -1: """Check if the driver can load PTX generated by the current NVRTC version.""" - driver_ver = handle_return(driver.cuDriverGetVersion()) + drv = driver_version() nvrtc_major, nvrtc_minor = handle_return(nvrtc.nvrtcVersion()) - return nvrtc_major * 1000 + nvrtc_minor * 10 <= driver_ver + return (nvrtc_major, nvrtc_minor, 0) <= drv cdef inline object _translate_program_options(object options): @@ -559,6 +738,7 @@ cdef inline object _translate_program_options(object options): split_compile=options.split_compile, ptxas_options=options.ptxas_options, no_cache=options.no_cache, + numba_debug = options.numba_debug ) @@ -576,6 +756,7 @@ cdef inline int Program_init(Program self, object code, str code_type, object op self._options = options = check_or_create_options(ProgramOptions, options, "Program options") code_type = code_type.lower() + self._code_type = code_type self._compile_lock = threading.Lock() self._use_libdevice = False self._libdevice_added = False @@ -596,18 +777,20 @@ cdef inline int Program_init(Program self, object code, str code_type, object op HANDLE_RETURN_NVRTC(NULL, cynvrtc.nvrtcCreateProgram( &nvrtc_prog, code_ptr, name_ptr, 0, NULL, NULL)) self._h_nvrtc = create_nvrtc_program_handle(nvrtc_prog) - self._nvrtc_code = code_bytes - self._backend = "NVRTC" + self._code = code_bytes + self._backend = str(CompilerBackendType.NVRTC) self._linker = None elif code_type == "ptx": assert_type(code, str) if options.extra_sources is not None: raise ValueError("extra_sources is not supported by the PTX backend.") + code_bytes = code.encode() + self._code = code_bytes self._linker = Linker( - ObjectCode._init(code.encode(), code_type), options=_translate_program_options(options) + ObjectCode._init(code_bytes, code_type), options=_translate_program_options(options) ) - self._backend = self._linker.backend + self._backend = str(Linker.which_backend()) elif code_type == "nvvm": _get_nvvm_module() # Validate NVVM availability @@ -615,10 +798,13 @@ cdef inline int Program_init(Program self, object code, str code_type, object op code = code.encode("utf-8") elif not isinstance(code, (bytes, bytearray)): raise TypeError("NVVM IR code must be provided as str, bytes, or bytearray") + self._code = bytes(code) # Coerce bytearray -> bytes so retention type is stable - code_ptr = (code) + # Use self._code (strictly bytes) for the C pointer so a bytearray + # input doesn't trip the `code` cast at runtime. + code_ptr = self._code name_ptr = options._name - code_len = len(code) + code_len = len(self._code) with nogil: HANDLE_RETURN_NVVM(NULL, cynvvm.nvvmCreateProgram(&nvvm_prog)) @@ -628,41 +814,11 @@ cdef inline int Program_init(Program self, object code, str code_type, object op # Add extra modules if provided if options.extra_sources is not None: - if not is_sequence(options.extra_sources): - raise TypeError( - "extra_sources must be a sequence of 2-tuples: ((name1, source1), (name2, source2), ...)" - ) - for i, module in enumerate(options.extra_sources): - if not isinstance(module, tuple) or len(module) != 2: - raise TypeError( - f"Each extra module must be a 2-tuple (name, source)" - f", got {type(module).__name__} at index {i}" - ) - - module_name, module_source = module - - if not isinstance(module_name, str): - raise TypeError(f"Module name at index {i} must be a string, got {type(module_name).__name__}") - - if isinstance(module_source, str): - # Textual LLVM IR - encode to UTF-8 bytes - module_source = module_source.encode("utf-8") - elif not isinstance(module_source, (bytes, bytearray)): - raise TypeError( - f"Module source at index {i} must be str (textual LLVM IR), bytes (textual LLVM IR or bitcode), " - f"or bytearray, got {type(module_source).__name__}" - ) - - if len(module_source) == 0: - raise ValueError(f"Module source for '{module_name}' (index {i}) cannot be empty") - - # Add the module using NVVM API - module_bytes = module_source if isinstance(module_source, bytes) else bytes(module_source) + extra_sources_bytes = options._prepare_extra_sources_bytes() + for module_name_bytes, module_bytes in extra_sources_bytes: module_ptr = module_bytes module_len = len(module_bytes) - module_name_bytes = module_name.encode() module_name_ptr = module_name_bytes - with nogil: HANDLE_RETURN_NVVM(nvvm_prog, cynvvm.nvvmAddModuleToProgram( nvvm_prog, module_ptr, module_len, module_name_ptr)) @@ -671,12 +827,11 @@ cdef inline int Program_init(Program self, object code, str code_type, object op if options.use_libdevice: self._use_libdevice = True - self._backend = "NVVM" + self._backend = str(CompilerBackendType.NVVM) self._linker = None else: - supported_code_types = ("c++", "ptx", "nvvm") - assert code_type not in supported_code_types, f"{code_type=}" + supported_code_types = tuple(x.value for x in SourceCodeType) if options.use_libdevice: raise ValueError("use_libdevice is only supported by the NVVM backend") raise RuntimeError(f"Unsupported {code_type=} ({supported_code_types=})") @@ -768,23 +923,18 @@ cdef bint _has_nvrtc_pch_apis(): return _nvrtc_pch_apis_cached -cdef str _PCH_STATUS_CREATED = "created" -cdef str _PCH_STATUS_NOT_ATTEMPTED = "not_attempted" -cdef str _PCH_STATUS_FAILED = "failed" - - -cdef str _read_pch_status(cynvrtc.nvrtcProgram prog): +cdef object _read_pch_status(cynvrtc.nvrtcProgram prog): """Query nvrtcGetPCHCreateStatus and translate to a high-level string.""" cdef cynvrtc.nvrtcResult err with nogil: err = cynvrtc.nvrtcGetPCHCreateStatus(prog) if err == cynvrtc.nvrtcResult.NVRTC_SUCCESS: - return _PCH_STATUS_CREATED + return PCHStatusType.CREATED if err == cynvrtc.nvrtcResult.NVRTC_ERROR_PCH_CREATE_HEAP_EXHAUSTED: return None # sentinel: caller should auto-retry if err == cynvrtc.nvrtcResult.NVRTC_ERROR_NO_PCH_CREATE_ATTEMPTED: - return _PCH_STATUS_NOT_ATTEMPTED - return _PCH_STATUS_FAILED + return PCHStatusType.NOT_ATTEMPTED + return PCHStatusType.FAILED cdef object Program_compile_nvrtc(Program self, str target_type, object name_expressions, object logs): @@ -810,7 +960,7 @@ cdef object Program_compile_nvrtc(Program self, str target_type, object name_exp ) from e if status is not None: - self._pch_status = status + self._pch_status = str(status) return result # Heap exhausted — auto-resize and retry with a fresh program @@ -820,7 +970,7 @@ cdef object Program_compile_nvrtc(Program self, str target_type, object name_exp HANDLE_RETURN_NVRTC(NULL, cynvrtc.nvrtcSetPCHHeapSize(required)) cdef cynvrtc.nvrtcProgram retry_prog - cdef const char* code_ptr = self._nvrtc_code + cdef const char* code_ptr = self._code cdef const char* name_ptr = self._options._name with nogil: HANDLE_RETURN_NVRTC(NULL, cynvrtc.nvrtcCreateProgram( @@ -832,7 +982,7 @@ cdef object Program_compile_nvrtc(Program self, str target_type, object name_exp ) status = _read_pch_status(retry_prog) - self._pch_status = status if status is not None else _PCH_STATUS_FAILED + self._pch_status = status if status is not None else str(PCHStatusType.FAILED) return result @@ -892,10 +1042,10 @@ cdef object Program_compile_nvvm(Program self, str target_type, object logs): # Supported target types per backend cdef dict SUPPORTED_TARGETS = { - "NVRTC": ("ptx", "cubin", "ltoir"), - "NVVM": ("ptx", "ltoir"), - "nvJitLink": ("cubin", "ptx"), - "driver": ("cubin", "ptx"), + CompilerBackendType.NVRTC: (ObjectCodeFormatType.PTX, ObjectCodeFormatType.CUBIN, ObjectCodeFormatType.LTOIR), + CompilerBackendType.NVVM: (ObjectCodeFormatType.PTX, ObjectCodeFormatType.LTOIR), + CompilerBackendType.NVJITLINK: (ObjectCodeFormatType.CUBIN, ObjectCodeFormatType.PTX), + CompilerBackendType.DRIVER: (ObjectCodeFormatType.CUBIN, ObjectCodeFormatType.PTX), } @@ -1078,6 +1228,8 @@ cdef inline object _prepare_nvvm_options_impl(object opts, bint as_bytes): options.append(f"-arch={arch}") if opts.debug is not None and opts.debug: options.append("-g") + if opts.numba_debug: + options.append("--numba-debug") if opts.device_code_optimize is False: options.append("-opt=0") elif opts.device_code_optimize is True: @@ -1154,8 +1306,6 @@ cdef inline object _prepare_nvvm_options_impl(object opts, bint as_bytes): unsupported.append("fdevice_syntax_only") if opts.minimal is not None and opts.minimal: unsupported.append("minimal") - if opts.numba_debug is not None and opts.numba_debug: - unsupported.append("numba_debug") if unsupported: raise CUDAError(f"The following options are not supported by NVVM backend: {', '.join(unsupported)}") diff --git a/cuda_core/cuda/core/_resource_handles.pxd b/cuda_core/cuda/core/_resource_handles.pxd index 00fe4ec8007..aaf3e75222e 100644 --- a/cuda_core/cuda/core/_resource_handles.pxd +++ b/cuda_core/cuda/core/_resource_handles.pxd @@ -20,12 +20,16 @@ from cuda.bindings cimport cynvjitlink cdef extern from "_cpp/resource_handles.hpp" namespace "cuda_core": # Handle types ctypedef shared_ptr[const cydriver.CUcontext] ContextHandle + ctypedef shared_ptr[const cydriver.CUgreenCtx] GreenCtxHandle ctypedef shared_ptr[const cydriver.CUstream] StreamHandle ctypedef shared_ptr[const cydriver.CUevent] EventHandle ctypedef shared_ptr[const cydriver.CUmemoryPool] MemoryPoolHandle ctypedef shared_ptr[const cydriver.CUdeviceptr] DevicePtrHandle ctypedef shared_ptr[const cydriver.CUlibrary] LibraryHandle ctypedef shared_ptr[const cydriver.CUkernel] KernelHandle + ctypedef shared_ptr[const cydriver.CUgraph] GraphHandle + ctypedef shared_ptr[const cydriver.CUgraphExec] GraphExecHandle + ctypedef shared_ptr[const cydriver.CUgraphNode] GraphNodeHandle ctypedef shared_ptr[const cydriver.CUgraphicsResource] GraphicsResourceHandle ctypedef shared_ptr[const cynvrtc.nvrtcProgram] NvrtcProgramHandle @@ -39,48 +43,93 @@ cdef extern from "_cpp/resource_handles.hpp" namespace "cuda_core": ctypedef shared_ptr[const NvJitLinkValue] NvJitLinkHandle ctypedef shared_ptr[const cydriver.CUlinkState] CuLinkHandle + ctypedef shared_ptr[const int] FileDescriptorHandle + ctypedef shared_ptr[const cydriver.CUarray] OpaqueArrayHandle + ctypedef shared_ptr[const cydriver.CUmipmappedArray] MipmappedArrayHandle + + # CUtexObject / CUsurfObject are both `unsigned long long` (as is CUdeviceptr), + # so they are wrapped in distinct tagged value types to keep each handle's + # as_cu/as_intptr/as_py overloads distinct. + cppclass TexObjectValue "cuda_core::TexObjectValue": + pass + cppclass SurfObjectValue "cuda_core::SurfObjectValue": + pass + ctypedef shared_ptr[const TexObjectValue] TexObjectHandle + ctypedef shared_ptr[const SurfObjectValue] SurfObjectHandle + + # Type-erased shared owner for resources attached to graph node slots. + # Typed handles above assign directly to an OpaqueHandle (shared control + # block); make_opaque_py / make_opaque_malloc cover the two cases needing a + # custom deleter. + ctypedef shared_ptr[const void] OpaqueHandle # as_cu() - extract the raw CUDA handle (inline C++) cydriver.CUcontext as_cu(ContextHandle h) noexcept nogil + cydriver.CUgreenCtx as_cu(GreenCtxHandle h) noexcept nogil cydriver.CUstream as_cu(StreamHandle h) noexcept nogil cydriver.CUevent as_cu(EventHandle h) noexcept nogil cydriver.CUmemoryPool as_cu(MemoryPoolHandle h) noexcept nogil cydriver.CUdeviceptr as_cu(DevicePtrHandle h) noexcept nogil cydriver.CUlibrary as_cu(LibraryHandle h) noexcept nogil cydriver.CUkernel as_cu(KernelHandle h) noexcept nogil + cydriver.CUgraph as_cu(GraphHandle h) noexcept nogil + cydriver.CUgraphExec as_cu(GraphExecHandle h) noexcept nogil + cydriver.CUgraphNode as_cu(GraphNodeHandle h) noexcept nogil cydriver.CUgraphicsResource as_cu(GraphicsResourceHandle h) noexcept nogil cynvrtc.nvrtcProgram as_cu(NvrtcProgramHandle h) noexcept nogil cynvvm.nvvmProgram as_cu(NvvmProgramHandle h) noexcept nogil cynvjitlink.nvJitLinkHandle as_cu(NvJitLinkHandle h) noexcept nogil cydriver.CUlinkState as_cu(CuLinkHandle h) noexcept nogil + cydriver.CUarray as_cu(OpaqueArrayHandle h) noexcept nogil + cydriver.CUmipmappedArray as_cu(MipmappedArrayHandle h) noexcept nogil + cydriver.CUtexObject as_cu(TexObjectHandle h) noexcept nogil + cydriver.CUsurfObject as_cu(SurfObjectHandle h) noexcept nogil # as_intptr() - extract handle as intptr_t for Python interop (inline C++) intptr_t as_intptr(ContextHandle h) noexcept nogil + intptr_t as_intptr(GreenCtxHandle h) noexcept nogil intptr_t as_intptr(StreamHandle h) noexcept nogil intptr_t as_intptr(EventHandle h) noexcept nogil intptr_t as_intptr(MemoryPoolHandle h) noexcept nogil intptr_t as_intptr(DevicePtrHandle h) noexcept nogil intptr_t as_intptr(LibraryHandle h) noexcept nogil intptr_t as_intptr(KernelHandle h) noexcept nogil + intptr_t as_intptr(GraphHandle h) noexcept nogil + intptr_t as_intptr(GraphExecHandle h) noexcept nogil + intptr_t as_intptr(GraphNodeHandle h) noexcept nogil intptr_t as_intptr(GraphicsResourceHandle h) noexcept nogil intptr_t as_intptr(NvrtcProgramHandle h) noexcept nogil intptr_t as_intptr(NvvmProgramHandle h) noexcept nogil intptr_t as_intptr(NvJitLinkHandle h) noexcept nogil intptr_t as_intptr(CuLinkHandle h) noexcept nogil + intptr_t as_intptr(FileDescriptorHandle h) noexcept nogil + intptr_t as_intptr(OpaqueArrayHandle h) noexcept nogil + intptr_t as_intptr(MipmappedArrayHandle h) noexcept nogil + intptr_t as_intptr(TexObjectHandle h) noexcept nogil + intptr_t as_intptr(SurfObjectHandle h) noexcept nogil # as_py() - convert handle to Python wrapper object (inline C++; requires GIL) object as_py(ContextHandle h) + object as_py(GreenCtxHandle h) object as_py(StreamHandle h) object as_py(EventHandle h) object as_py(MemoryPoolHandle h) object as_py(DevicePtrHandle h) object as_py(LibraryHandle h) object as_py(KernelHandle h) + object as_py(GraphHandle h) + object as_py(GraphExecHandle h) + object as_py(GraphNodeHandle h) object as_py(GraphicsResourceHandle h) object as_py(NvrtcProgramHandle h) object as_py(NvvmProgramHandle h) object as_py(NvJitLinkHandle h) object as_py(CuLinkHandle h) + object as_py(FileDescriptorHandle h) + object as_py(OpaqueArrayHandle h) + object as_py(MipmappedArrayHandle h) + object as_py(TexObjectHandle h) + object as_py(SurfObjectHandle h) # ============================================================================= @@ -96,6 +145,12 @@ cdef void clear_last_error() noexcept nogil # Context handles cdef ContextHandle create_context_handle_ref(cydriver.CUcontext ctx) except+ nogil +cdef ContextHandle create_context_handle_from_green_ctx(const GreenCtxHandle& h_green_ctx) except+ nogil +cdef GreenCtxHandle get_context_green_ctx(const ContextHandle& h) noexcept nogil +cdef GreenCtxHandle create_green_ctx_handle( + cydriver.CUdevResource* resources, unsigned int nbResources, + cydriver.CUdevice dev, unsigned int flags) except+ nogil +cdef GreenCtxHandle create_green_ctx_handle_ref(cydriver.CUgreenCtx ctx) except+ nogil cdef ContextHandle get_primary_context(int device_id) except+ nogil cdef ContextHandle get_current_context() except+ nogil @@ -104,22 +159,24 @@ cdef StreamHandle create_stream_handle( const ContextHandle& h_ctx, unsigned int flags, int priority) except+ nogil cdef StreamHandle create_stream_handle_ref(cydriver.CUstream stream) except+ nogil cdef StreamHandle create_stream_handle_with_owner(cydriver.CUstream stream, object owner) except+ nogil +cdef void py_object_user_object_destroy(void* py_object) noexcept nogil +cdef ContextHandle get_stream_context(const StreamHandle& h) noexcept nogil cdef StreamHandle get_legacy_stream() except+ nogil cdef StreamHandle get_per_thread_stream() except+ nogil # Event handles cdef EventHandle create_event_handle( const ContextHandle& h_ctx, unsigned int flags, - bint timing_disabled, bint busy_waited, + bint timing_enabled, bint is_blocking_sync, bint ipc_enabled, int device_id) except+ nogil cdef EventHandle create_event_handle_noctx(unsigned int flags) except+ nogil cdef EventHandle create_event_handle_ref(cydriver.CUevent event) except+ nogil cdef EventHandle create_event_handle_ipc( - const cydriver.CUipcEventHandle& ipc_handle, bint busy_waited) except+ nogil + const cydriver.CUipcEventHandle& ipc_handle, bint is_blocking_sync) except+ nogil # Event metadata getters -cdef bint get_event_timing_disabled(const EventHandle& h) noexcept nogil -cdef bint get_event_busy_waited(const EventHandle& h) noexcept nogil +cdef bint get_event_timing_enabled(const EventHandle& h) noexcept nogil +cdef bint get_event_is_blocking_sync(const EventHandle& h) noexcept nogil cdef bint get_event_ipc_enabled(const EventHandle& h) noexcept nogil cdef int get_event_device_id(const EventHandle& h) noexcept nogil cdef ContextHandle get_event_context(const EventHandle& h) noexcept nogil @@ -140,6 +197,10 @@ cdef DevicePtrHandle deviceptr_alloc(size_t size) except+ nogil cdef DevicePtrHandle deviceptr_alloc_host(size_t size) except+ nogil cdef DevicePtrHandle deviceptr_create_ref(cydriver.CUdeviceptr ptr) except+ nogil cdef DevicePtrHandle deviceptr_create_with_owner(cydriver.CUdeviceptr ptr, object owner) except+ nogil +cdef DevicePtrHandle deviceptr_create_mapped_graphics( + cydriver.CUdeviceptr ptr, + const GraphicsResourceHandle& h_resource, + const StreamHandle& h_stream) except+ nogil cdef DevicePtrHandle deviceptr_create_with_mr( cydriver.CUdeviceptr ptr, size_t size, object mr) except+ nogil @@ -164,6 +225,25 @@ cdef KernelHandle create_kernel_handle(const LibraryHandle& h_library, const cha cdef KernelHandle create_kernel_handle_ref(cydriver.CUkernel kernel) except+ nogil cdef LibraryHandle get_kernel_library(const KernelHandle& h) noexcept nogil +# Graph handles +cdef GraphHandle create_graph_handle(cydriver.CUgraph graph) except+ nogil +cdef GraphHandle create_graph_handle_ref(cydriver.CUgraph graph, const GraphHandle& h_parent) except+ nogil + +# Graph slot attachments +cdef OpaqueHandle make_opaque_py(object obj) except+ +cdef OpaqueHandle make_opaque_malloc(void* buf) except+ +cdef cydriver.CUresult graph_set_slot( + const GraphHandle& h_graph, cydriver.CUgraphNode node, + unsigned int slot, OpaqueHandle owner) except+ + +# Graph exec handles +cdef GraphExecHandle create_graph_exec_handle(cydriver.CUgraphExec graph_exec) except+ nogil + +# Graph node handles +cdef GraphNodeHandle create_graph_node_handle(cydriver.CUgraphNode node, const GraphHandle& h_graph) except+ nogil +cdef GraphHandle graph_node_get_graph(const GraphNodeHandle& h) noexcept nogil +cdef void invalidate_graph_node(const GraphNodeHandle& h) noexcept nogil + # Graphics resource handles cdef GraphicsResourceHandle create_graphics_resource_handle( cydriver.CUgraphicsResource resource) except+ nogil @@ -183,3 +263,35 @@ cdef NvJitLinkHandle create_nvjitlink_handle_ref(cynvjitlink.nvJitLinkHandle han # cuLink handles cdef CuLinkHandle create_culink_handle(cydriver.CUlinkState state) except+ nogil cdef CuLinkHandle create_culink_handle_ref(cydriver.CUlinkState state) except+ nogil + +# File descriptor handles +cdef FileDescriptorHandle create_fd_handle(int fd) except+ nogil +cdef FileDescriptorHandle create_fd_handle_ref(int fd) except+ nogil + +# Array / mipmapped-array / texture / surface handles (PR #467) +cdef OpaqueArrayHandle create_array_handle(const cydriver.CUDA_ARRAY3D_DESCRIPTOR& desc) except+ nogil +cdef OpaqueArrayHandle create_array_handle_ref(cydriver.CUarray arr) except+ nogil +cdef OpaqueArrayHandle create_array_handle_owning(cydriver.CUarray arr) except+ nogil +cdef OpaqueArrayHandle create_array_level_handle(const MipmappedArrayHandle& h_mip, unsigned int level) except+ nogil +cdef MipmappedArrayHandle create_mipmapped_array_handle( + const cydriver.CUDA_ARRAY3D_DESCRIPTOR& desc, unsigned int num_levels) except+ nogil +cdef TexObjectHandle create_tex_object_handle_array( + const cydriver.CUDA_RESOURCE_DESC& res, const cydriver.CUDA_TEXTURE_DESC& tex, + const OpaqueArrayHandle& h_backing) except+ nogil +cdef TexObjectHandle create_tex_object_handle_mipmap( + const cydriver.CUDA_RESOURCE_DESC& res, const cydriver.CUDA_TEXTURE_DESC& tex, + const MipmappedArrayHandle& h_backing) except+ nogil +cdef TexObjectHandle create_tex_object_handle_linear( + const cydriver.CUDA_RESOURCE_DESC& res, const cydriver.CUDA_TEXTURE_DESC& tex, + const DevicePtrHandle& h_backing) except+ nogil +cdef SurfObjectHandle create_surf_object_handle( + const cydriver.CUDA_RESOURCE_DESC& res, const OpaqueArrayHandle& h_backing) except+ nogil + +# SM resource split (13.1+ — calls through function pointer, safe on older bindings) +# groupParams is void* here to avoid referencing CU_DEV_SM_RESOURCE_GROUP_PARAMS +# (which doesn't exist in cuda-bindings 13.0 .pxd). The C++ side casts it. +cdef cydriver.CUresult sm_resource_split( + cydriver.CUdevResource* result, unsigned int nbGroups, + const cydriver.CUdevResource* input, cydriver.CUdevResource* remainder, + unsigned int flags, void* groupParams) nogil +cdef bint has_sm_resource_split() noexcept nogil diff --git a/cuda_core/cuda/core/_resource_handles.pyi b/cuda_core/cuda/core/_resource_handles.pyi new file mode 100644 index 00000000000..4236df5d6e9 --- /dev/null +++ b/cuda_core/cuda/core/_resource_handles.pyi @@ -0,0 +1,28 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_resource_handles.pyx + +from __future__ import annotations + +from libcpp.memory import shared_ptr + +ContextHandle = shared_ptr +GreenCtxHandle = shared_ptr +StreamHandle = shared_ptr +EventHandle = shared_ptr +MemoryPoolHandle = shared_ptr +DevicePtrHandle = shared_ptr +LibraryHandle = shared_ptr +KernelHandle = shared_ptr +GraphHandle = shared_ptr +GraphExecHandle = shared_ptr +GraphNodeHandle = shared_ptr +GraphicsResourceHandle = shared_ptr +NvrtcProgramHandle = shared_ptr +NvvmProgramHandle = shared_ptr +NvJitLinkHandle = shared_ptr +CuLinkHandle = shared_ptr +FileDescriptorHandle = shared_ptr +OpaqueArrayHandle = shared_ptr +MipmappedArrayHandle = shared_ptr +TexObjectHandle = shared_ptr +SurfObjectHandle = shared_ptr +OpaqueHandle = shared_ptr \ No newline at end of file diff --git a/cuda_core/cuda/core/_resource_handles.pyx b/cuda_core/cuda/core/_resource_handles.pyx index 1e7facbea5c..9867f5cdcb4 100644 --- a/cuda_core/cuda/core/_resource_handles.pyx +++ b/cuda_core/cuda/core/_resource_handles.pyx @@ -18,21 +18,6 @@ from cuda.bindings cimport cynvrtc from cuda.bindings cimport cynvvm from cuda.bindings cimport cynvjitlink -from ._resource_handles cimport ( - ContextHandle, - StreamHandle, - EventHandle, - MemoryPoolHandle, - DevicePtrHandle, - LibraryHandle, - KernelHandle, - GraphicsResourceHandle, - NvrtcProgramHandle, - NvvmProgramHandle, - NvJitLinkHandle, - CuLinkHandle, -) - import cuda.bindings.cydriver as cydriver import cuda.bindings.cynvrtc as cynvrtc import cuda.bindings.cynvvm as cynvvm @@ -54,6 +39,15 @@ cdef extern from "_cpp/resource_handles.hpp" namespace "cuda_core": # Context handles ContextHandle create_context_handle_ref "cuda_core::create_context_handle_ref" ( cydriver.CUcontext ctx) except+ nogil + ContextHandle create_context_handle_from_green_ctx "cuda_core::create_context_handle_from_green_ctx" ( + const GreenCtxHandle& h_green_ctx) except+ nogil + GreenCtxHandle get_context_green_ctx "cuda_core::get_context_green_ctx" ( + const ContextHandle& h) noexcept nogil + GreenCtxHandle create_green_ctx_handle "cuda_core::create_green_ctx_handle" ( + cydriver.CUdevResource* resources, unsigned int nbResources, + cydriver.CUdevice dev, unsigned int flags) except+ nogil + GreenCtxHandle create_green_ctx_handle_ref "cuda_core::create_green_ctx_handle_ref" ( + cydriver.CUgreenCtx ctx) except+ nogil ContextHandle get_primary_context "cuda_core::get_primary_context" ( int device_id) except+ nogil ContextHandle get_current_context "cuda_core::get_current_context" () except+ nogil @@ -65,25 +59,29 @@ cdef extern from "_cpp/resource_handles.hpp" namespace "cuda_core": cydriver.CUstream stream) except+ nogil StreamHandle create_stream_handle_with_owner "cuda_core::create_stream_handle_with_owner" ( cydriver.CUstream stream, object owner) except+ nogil + void py_object_user_object_destroy "cuda_core::py_object_user_object_destroy" ( + void* py_object) noexcept nogil + ContextHandle get_stream_context "cuda_core::get_stream_context" ( + const StreamHandle& h) noexcept nogil StreamHandle get_legacy_stream "cuda_core::get_legacy_stream" () except+ nogil StreamHandle get_per_thread_stream "cuda_core::get_per_thread_stream" () except+ nogil # Event handles (note: _create_event_handle* are internal due to C++ overloading) EventHandle create_event_handle "cuda_core::create_event_handle" ( const ContextHandle& h_ctx, unsigned int flags, - bint timing_disabled, bint busy_waited, + bint timing_enabled, bint is_blocking_sync, bint ipc_enabled, int device_id) except+ nogil EventHandle create_event_handle_noctx "cuda_core::create_event_handle_noctx" ( unsigned int flags) except+ nogil EventHandle create_event_handle_ref "cuda_core::create_event_handle_ref" ( cydriver.CUevent event) except+ nogil EventHandle create_event_handle_ipc "cuda_core::create_event_handle_ipc" ( - const cydriver.CUipcEventHandle& ipc_handle, bint busy_waited) except+ nogil + const cydriver.CUipcEventHandle& ipc_handle, bint is_blocking_sync) except+ nogil # Event metadata getters - bint get_event_timing_disabled "cuda_core::get_event_timing_disabled" ( + bint get_event_timing_enabled "cuda_core::get_event_timing_enabled" ( const EventHandle& h) noexcept nogil - bint get_event_busy_waited "cuda_core::get_event_busy_waited" ( + bint get_event_is_blocking_sync "cuda_core::get_event_is_blocking_sync" ( const EventHandle& h) noexcept nogil bint get_event_ipc_enabled "cuda_core::get_event_ipc_enabled" ( const EventHandle& h) noexcept nogil @@ -113,11 +111,12 @@ cdef extern from "_cpp/resource_handles.hpp" namespace "cuda_core": cydriver.CUdeviceptr ptr) except+ nogil DevicePtrHandle deviceptr_create_with_owner "cuda_core::deviceptr_create_with_owner" ( cydriver.CUdeviceptr ptr, object owner) except+ nogil + DevicePtrHandle deviceptr_create_mapped_graphics "cuda_core::deviceptr_create_mapped_graphics" ( + cydriver.CUdeviceptr ptr, + const GraphicsResourceHandle& h_resource, + const StreamHandle& h_stream) except+ nogil # MR deallocation callback - ctypedef void (*MRDeallocCallback)( - object mr, cydriver.CUdeviceptr ptr, size_t size, - const StreamHandle& stream) noexcept void register_mr_dealloc_callback "cuda_core::register_mr_dealloc_callback" ( MRDeallocCallback cb) noexcept DevicePtrHandle deviceptr_create_with_mr "cuda_core::deviceptr_create_with_mr" ( @@ -146,6 +145,31 @@ cdef extern from "_cpp/resource_handles.hpp" namespace "cuda_core": LibraryHandle get_kernel_library "cuda_core::get_kernel_library" ( const KernelHandle& h) noexcept nogil + # Graph handles + GraphHandle create_graph_handle "cuda_core::create_graph_handle" ( + cydriver.CUgraph graph) except+ nogil + GraphHandle create_graph_handle_ref "cuda_core::create_graph_handle_ref" ( + cydriver.CUgraph graph, const GraphHandle& h_parent) except+ nogil + + # Graph slot attachments + OpaqueHandle make_opaque_py "cuda_core::make_opaque_py" (object obj) except+ + OpaqueHandle make_opaque_malloc "cuda_core::make_opaque_malloc" (void* buf) except+ + cydriver.CUresult graph_set_slot "cuda_core::graph_set_slot" ( + const GraphHandle& h_graph, cydriver.CUgraphNode node, + unsigned int slot, OpaqueHandle owner) except+ + + # Graph exec handles + GraphExecHandle create_graph_exec_handle "cuda_core::create_graph_exec_handle" ( + cydriver.CUgraphExec graph_exec) except+ nogil + + # Graph node handles + GraphNodeHandle create_graph_node_handle "cuda_core::create_graph_node_handle" ( + cydriver.CUgraphNode node, const GraphHandle& h_graph) except+ nogil + GraphHandle graph_node_get_graph "cuda_core::graph_node_get_graph" ( + const GraphNodeHandle& h) noexcept nogil + void invalidate_graph_node "cuda_core::invalidate_graph_node" ( + const GraphNodeHandle& h) noexcept nogil + # Graphics resource handles GraphicsResourceHandle create_graphics_resource_handle "cuda_core::create_graphics_resource_handle" ( cydriver.CUgraphicsResource resource) except+ nogil @@ -174,6 +198,44 @@ cdef extern from "_cpp/resource_handles.hpp" namespace "cuda_core": CuLinkHandle create_culink_handle_ref "cuda_core::create_culink_handle_ref" ( cydriver.CUlinkState state) except+ nogil + # File descriptor handles + FileDescriptorHandle create_fd_handle "cuda_core::create_fd_handle" ( + int fd) except+ nogil + FileDescriptorHandle create_fd_handle_ref "cuda_core::create_fd_handle_ref" ( + int fd) except+ nogil + + # SM resource split (13.1+ wrapper — avoids direct cydriver cimport) + # groupParams is void* to avoid referencing CU_DEV_SM_RESOURCE_GROUP_PARAMS + # (which doesn't exist in cuda-bindings 13.0 .pxd). The C++ side casts it. + cydriver.CUresult sm_resource_split "cuda_core::sm_resource_split" ( + cydriver.CUdevResource* result, unsigned int nbGroups, + const cydriver.CUdevResource* input, cydriver.CUdevResource* remainder, + unsigned int flags, void* groupParams) nogil + bint has_sm_resource_split "cuda_core::has_sm_resource_split" () noexcept nogil + + # Array / mipmapped-array / texture / surface handles (PR #467) + OpaqueArrayHandle create_array_handle "cuda_core::create_array_handle" ( + const cydriver.CUDA_ARRAY3D_DESCRIPTOR& desc) except+ nogil + OpaqueArrayHandle create_array_handle_ref "cuda_core::create_array_handle_ref" ( + cydriver.CUarray arr) except+ nogil + OpaqueArrayHandle create_array_handle_owning "cuda_core::create_array_handle_owning" ( + cydriver.CUarray arr) except+ nogil + OpaqueArrayHandle create_array_level_handle "cuda_core::create_array_level_handle" ( + const MipmappedArrayHandle& h_mip, unsigned int level) except+ nogil + MipmappedArrayHandle create_mipmapped_array_handle "cuda_core::create_mipmapped_array_handle" ( + const cydriver.CUDA_ARRAY3D_DESCRIPTOR& desc, unsigned int num_levels) except+ nogil + TexObjectHandle create_tex_object_handle_array "cuda_core::create_tex_object_handle_array" ( + const cydriver.CUDA_RESOURCE_DESC& res, const cydriver.CUDA_TEXTURE_DESC& tex, + const OpaqueArrayHandle& h_backing) except+ nogil + TexObjectHandle create_tex_object_handle_mipmap "cuda_core::create_tex_object_handle_mipmap" ( + const cydriver.CUDA_RESOURCE_DESC& res, const cydriver.CUDA_TEXTURE_DESC& tex, + const MipmappedArrayHandle& h_backing) except+ nogil + TexObjectHandle create_tex_object_handle_linear "cuda_core::create_tex_object_handle_linear" ( + const cydriver.CUDA_RESOURCE_DESC& res, const cydriver.CUDA_TEXTURE_DESC& tex, + const DevicePtrHandle& h_backing) except+ nogil + SurfObjectHandle create_surf_object_handle "cuda_core::create_surf_object_handle" ( + const cydriver.CUDA_RESOURCE_DESC& res, const OpaqueArrayHandle& h_backing) except+ nogil + # ============================================================================= # CUDA Driver API capsule @@ -201,6 +263,11 @@ cdef extern from "_cpp/resource_handles.hpp" namespace "cuda_core": void* p_cuDevicePrimaryCtxRetain "reinterpret_cast(cuda_core::p_cuDevicePrimaryCtxRetain)" void* p_cuDevicePrimaryCtxRelease "reinterpret_cast(cuda_core::p_cuDevicePrimaryCtxRelease)" void* p_cuCtxGetCurrent "reinterpret_cast(cuda_core::p_cuCtxGetCurrent)" + void* p_cuGreenCtxCreate "reinterpret_cast(cuda_core::p_cuGreenCtxCreate)" + void* p_cuGreenCtxDestroy "reinterpret_cast(cuda_core::p_cuGreenCtxDestroy)" + void* p_cuCtxFromGreenCtx "reinterpret_cast(cuda_core::p_cuCtxFromGreenCtx)" + void* p_cuDevResourceGenerateDesc "reinterpret_cast(cuda_core::p_cuDevResourceGenerateDesc)" + void* p_cuGreenCtxStreamCreate "reinterpret_cast(cuda_core::p_cuGreenCtxStreamCreate)" # Stream void* p_cuStreamCreateWithPriority "reinterpret_cast(cuda_core::p_cuStreamCreateWithPriority)" @@ -241,12 +308,34 @@ cdef extern from "_cpp/resource_handles.hpp" namespace "cuda_core": void* p_cuLibraryUnload "reinterpret_cast(cuda_core::p_cuLibraryUnload)" void* p_cuLibraryGetKernel "reinterpret_cast(cuda_core::p_cuLibraryGetKernel)" + # Graph + void* p_cuGraphDestroy "reinterpret_cast(cuda_core::p_cuGraphDestroy)" + void* p_cuGraphExecDestroy "reinterpret_cast(cuda_core::p_cuGraphExecDestroy)" + void* p_cuUserObjectCreate "reinterpret_cast(cuda_core::p_cuUserObjectCreate)" + void* p_cuUserObjectRelease "reinterpret_cast(cuda_core::p_cuUserObjectRelease)" + void* p_cuGraphRetainUserObject "reinterpret_cast(cuda_core::p_cuGraphRetainUserObject)" + # Linker void* p_cuLinkDestroy "reinterpret_cast(cuda_core::p_cuLinkDestroy)" # Graphics interop + void* p_cuGraphicsUnmapResources "reinterpret_cast(cuda_core::p_cuGraphicsUnmapResources)" void* p_cuGraphicsUnregisterResource "reinterpret_cast(cuda_core::p_cuGraphicsUnregisterResource)" + # Texture / surface / array (PR #467) + void* p_cuArray3DCreate "reinterpret_cast(cuda_core::p_cuArray3DCreate)" + void* p_cuArrayDestroy "reinterpret_cast(cuda_core::p_cuArrayDestroy)" + void* p_cuMipmappedArrayCreate "reinterpret_cast(cuda_core::p_cuMipmappedArrayCreate)" + void* p_cuMipmappedArrayDestroy "reinterpret_cast(cuda_core::p_cuMipmappedArrayDestroy)" + void* p_cuMipmappedArrayGetLevel "reinterpret_cast(cuda_core::p_cuMipmappedArrayGetLevel)" + void* p_cuTexObjectCreate "reinterpret_cast(cuda_core::p_cuTexObjectCreate)" + void* p_cuTexObjectDestroy "reinterpret_cast(cuda_core::p_cuTexObjectDestroy)" + void* p_cuSurfObjectCreate "reinterpret_cast(cuda_core::p_cuSurfObjectCreate)" + void* p_cuSurfObjectDestroy "reinterpret_cast(cuda_core::p_cuSurfObjectDestroy)" + + # SM resource split (13.1+) + void* p_cuDevSmResourceSplit "reinterpret_cast(cuda_core::p_cuDevSmResourceSplit)" + # NVRTC void* p_nvrtcDestroyProgram "reinterpret_cast(cuda_core::p_nvrtcDestroyProgram)" @@ -262,55 +351,116 @@ cdef void* _get_driver_fn(str name): capsule = cydriver.__pyx_capi__[name] return PyCapsule_GetPointer(capsule, PyCapsule_GetName(capsule)) -# Context -p_cuDevicePrimaryCtxRetain = _get_driver_fn("cuDevicePrimaryCtxRetain") -p_cuDevicePrimaryCtxRelease = _get_driver_fn("cuDevicePrimaryCtxRelease") -p_cuCtxGetCurrent = _get_driver_fn("cuCtxGetCurrent") -# Stream -p_cuStreamCreateWithPriority = _get_driver_fn("cuStreamCreateWithPriority") -p_cuStreamDestroy = _get_driver_fn("cuStreamDestroy") +cdef void* _get_optional_driver_fn(str name): + try: + capsule = cydriver.__pyx_capi__[name] + except KeyError: + return NULL + return PyCapsule_GetPointer(capsule, PyCapsule_GetName(capsule)) + + +cdef void _init_driver_fn_pointers() noexcept: + global p_cuDevicePrimaryCtxRetain, p_cuDevicePrimaryCtxRelease, p_cuCtxGetCurrent + global p_cuGreenCtxCreate, p_cuGreenCtxDestroy, p_cuCtxFromGreenCtx + global p_cuDevResourceGenerateDesc, p_cuGreenCtxStreamCreate + global p_cuStreamCreateWithPriority, p_cuStreamDestroy + global p_cuEventCreate, p_cuEventDestroy, p_cuIpcOpenEventHandle + global p_cuDeviceGetCount + global p_cuMemPoolSetAccess, p_cuMemPoolDestroy, p_cuMemPoolCreate + global p_cuDeviceGetMemPool, p_cuMemPoolImportFromShareableHandle + global p_cuMemAllocFromPoolAsync, p_cuMemAllocAsync, p_cuMemAlloc, p_cuMemAllocHost + global p_cuMemFreeAsync, p_cuMemFree, p_cuMemFreeHost + global p_cuMemPoolImportPointer + global p_cuLibraryLoadFromFile, p_cuLibraryLoadData, p_cuLibraryUnload, p_cuLibraryGetKernel + global p_cuGraphDestroy, p_cuGraphExecDestroy + global p_cuUserObjectCreate, p_cuUserObjectRelease, p_cuGraphRetainUserObject + global p_cuLinkDestroy + global p_cuGraphicsUnmapResources, p_cuGraphicsUnregisterResource + global p_cuDevSmResourceSplit + global p_cuArray3DCreate, p_cuArrayDestroy + global p_cuMipmappedArrayCreate, p_cuMipmappedArrayDestroy, p_cuMipmappedArrayGetLevel + global p_cuTexObjectCreate, p_cuTexObjectDestroy + global p_cuSurfObjectCreate, p_cuSurfObjectDestroy + + # Context + p_cuDevicePrimaryCtxRetain = _get_driver_fn("cuDevicePrimaryCtxRetain") + p_cuDevicePrimaryCtxRelease = _get_driver_fn("cuDevicePrimaryCtxRelease") + p_cuCtxGetCurrent = _get_driver_fn("cuCtxGetCurrent") + p_cuGreenCtxCreate = _get_optional_driver_fn("cuGreenCtxCreate") + p_cuGreenCtxDestroy = _get_optional_driver_fn("cuGreenCtxDestroy") + p_cuCtxFromGreenCtx = _get_optional_driver_fn("cuCtxFromGreenCtx") + p_cuDevResourceGenerateDesc = _get_optional_driver_fn("cuDevResourceGenerateDesc") + p_cuGreenCtxStreamCreate = _get_optional_driver_fn("cuGreenCtxStreamCreate") + + # Stream + p_cuStreamCreateWithPriority = _get_driver_fn("cuStreamCreateWithPriority") + p_cuStreamDestroy = _get_driver_fn("cuStreamDestroy") + + # Event + p_cuEventCreate = _get_driver_fn("cuEventCreate") + p_cuEventDestroy = _get_driver_fn("cuEventDestroy") + p_cuIpcOpenEventHandle = _get_driver_fn("cuIpcOpenEventHandle") + + # Device + p_cuDeviceGetCount = _get_driver_fn("cuDeviceGetCount") -# Event -p_cuEventCreate = _get_driver_fn("cuEventCreate") -p_cuEventDestroy = _get_driver_fn("cuEventDestroy") -p_cuIpcOpenEventHandle = _get_driver_fn("cuIpcOpenEventHandle") + # Memory pool + p_cuMemPoolSetAccess = _get_driver_fn("cuMemPoolSetAccess") + p_cuMemPoolDestroy = _get_driver_fn("cuMemPoolDestroy") + p_cuMemPoolCreate = _get_driver_fn("cuMemPoolCreate") + p_cuDeviceGetMemPool = _get_driver_fn("cuDeviceGetMemPool") + p_cuMemPoolImportFromShareableHandle = _get_driver_fn("cuMemPoolImportFromShareableHandle") -# Device -p_cuDeviceGetCount = _get_driver_fn("cuDeviceGetCount") + # Memory allocation + p_cuMemAllocFromPoolAsync = _get_driver_fn("cuMemAllocFromPoolAsync") + p_cuMemAllocAsync = _get_driver_fn("cuMemAllocAsync") + p_cuMemAlloc = _get_driver_fn("cuMemAlloc") + p_cuMemAllocHost = _get_driver_fn("cuMemAllocHost") + + # Memory deallocation + p_cuMemFreeAsync = _get_driver_fn("cuMemFreeAsync") + p_cuMemFree = _get_driver_fn("cuMemFree") + p_cuMemFreeHost = _get_driver_fn("cuMemFreeHost") -# Memory pool -p_cuMemPoolSetAccess = _get_driver_fn("cuMemPoolSetAccess") -p_cuMemPoolDestroy = _get_driver_fn("cuMemPoolDestroy") -p_cuMemPoolCreate = _get_driver_fn("cuMemPoolCreate") -p_cuDeviceGetMemPool = _get_driver_fn("cuDeviceGetMemPool") -p_cuMemPoolImportFromShareableHandle = _get_driver_fn("cuMemPoolImportFromShareableHandle") + # IPC + p_cuMemPoolImportPointer = _get_driver_fn("cuMemPoolImportPointer") -# Memory allocation -p_cuMemAllocFromPoolAsync = _get_driver_fn("cuMemAllocFromPoolAsync") -p_cuMemAllocAsync = _get_driver_fn("cuMemAllocAsync") -p_cuMemAlloc = _get_driver_fn("cuMemAlloc") -p_cuMemAllocHost = _get_driver_fn("cuMemAllocHost") + # Library + p_cuLibraryLoadFromFile = _get_driver_fn("cuLibraryLoadFromFile") + p_cuLibraryLoadData = _get_driver_fn("cuLibraryLoadData") + p_cuLibraryUnload = _get_driver_fn("cuLibraryUnload") + p_cuLibraryGetKernel = _get_driver_fn("cuLibraryGetKernel") + + # Graph + p_cuGraphDestroy = _get_driver_fn("cuGraphDestroy") + p_cuGraphExecDestroy = _get_driver_fn("cuGraphExecDestroy") + p_cuUserObjectCreate = _get_driver_fn("cuUserObjectCreate") + p_cuUserObjectRelease = _get_driver_fn("cuUserObjectRelease") + p_cuGraphRetainUserObject = _get_driver_fn("cuGraphRetainUserObject") -# Memory deallocation -p_cuMemFreeAsync = _get_driver_fn("cuMemFreeAsync") -p_cuMemFree = _get_driver_fn("cuMemFree") -p_cuMemFreeHost = _get_driver_fn("cuMemFreeHost") + # Linker + p_cuLinkDestroy = _get_driver_fn("cuLinkDestroy") -# IPC -p_cuMemPoolImportPointer = _get_driver_fn("cuMemPoolImportPointer") + # Graphics interop + p_cuGraphicsUnmapResources = _get_driver_fn("cuGraphicsUnmapResources") + p_cuGraphicsUnregisterResource = _get_driver_fn("cuGraphicsUnregisterResource") -# Library -p_cuLibraryLoadFromFile = _get_driver_fn("cuLibraryLoadFromFile") -p_cuLibraryLoadData = _get_driver_fn("cuLibraryLoadData") -p_cuLibraryUnload = _get_driver_fn("cuLibraryUnload") -p_cuLibraryGetKernel = _get_driver_fn("cuLibraryGetKernel") + # Texture / surface / array (PR #467) + p_cuArray3DCreate = _get_driver_fn("cuArray3DCreate") + p_cuArrayDestroy = _get_driver_fn("cuArrayDestroy") + p_cuMipmappedArrayCreate = _get_driver_fn("cuMipmappedArrayCreate") + p_cuMipmappedArrayDestroy = _get_driver_fn("cuMipmappedArrayDestroy") + p_cuMipmappedArrayGetLevel = _get_driver_fn("cuMipmappedArrayGetLevel") + p_cuTexObjectCreate = _get_driver_fn("cuTexObjectCreate") + p_cuTexObjectDestroy = _get_driver_fn("cuTexObjectDestroy") + p_cuSurfObjectCreate = _get_driver_fn("cuSurfObjectCreate") + p_cuSurfObjectDestroy = _get_driver_fn("cuSurfObjectDestroy") -# Linker -p_cuLinkDestroy = _get_driver_fn("cuLinkDestroy") + # SM resource split (13.1+ — may not exist in older cuda-bindings) + p_cuDevSmResourceSplit = _get_optional_driver_fn("cuDevSmResourceSplit") -# Graphics interop -p_cuGraphicsUnregisterResource = _get_driver_fn("cuGraphicsUnregisterResource") +_init_driver_fn_pointers() # ============================================================================= # NVRTC function pointer initialization @@ -320,7 +470,11 @@ cdef void* _get_nvrtc_fn(str name): capsule = cynvrtc.__pyx_capi__[name] return PyCapsule_GetPointer(capsule, PyCapsule_GetName(capsule)) -p_nvrtcDestroyProgram = _get_nvrtc_fn("nvrtcDestroyProgram") +cdef void _init_nvrtc_fn_pointers() noexcept: + global p_nvrtcDestroyProgram + p_nvrtcDestroyProgram = _get_nvrtc_fn("nvrtcDestroyProgram") + +_init_nvrtc_fn_pointers() # ============================================================================= # NVVM function pointer initialization @@ -333,7 +487,11 @@ cdef void* _get_nvvm_fn(str name): capsule = cynvvm.__pyx_capi__[name] return PyCapsule_GetPointer(capsule, PyCapsule_GetName(capsule)) -p_nvvmDestroyProgram = _get_nvvm_fn("nvvmDestroyProgram") +cdef void _init_nvvm_fn_pointers() noexcept: + global p_nvvmDestroyProgram + p_nvvmDestroyProgram = _get_nvvm_fn("nvvmDestroyProgram") + +_init_nvvm_fn_pointers() # ============================================================================= # nvJitLink function pointer initialization @@ -346,4 +504,8 @@ cdef void* _get_nvjitlink_fn(str name): capsule = cynvjitlink.__pyx_capi__[name] return PyCapsule_GetPointer(capsule, PyCapsule_GetName(capsule)) -p_nvJitLinkDestroy = _get_nvjitlink_fn("nvJitLinkDestroy") +cdef void _init_nvjitlink_fn_pointers() noexcept: + global p_nvJitLinkDestroy + p_nvJitLinkDestroy = _get_nvjitlink_fn("nvJitLinkDestroy") + +_init_nvjitlink_fn_pointers() diff --git a/cuda_core/cuda/core/_stream.pxd b/cuda_core/cuda/core/_stream.pxd index c47ff1ea289..de16b84bde2 100644 --- a/cuda_core/cuda/core/_stream.pxd +++ b/cuda_core/cuda/core/_stream.pxd @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 @@ -22,4 +22,4 @@ cdef class Stream: cpdef Stream default_stream() -cdef Stream Stream_accept(arg, bint allow_stream_protocol=*) +cpdef Stream Stream_accept(arg, bint allow_stream_protocol=*) diff --git a/cuda_core/cuda/core/_stream.pyi b/cuda_core/cuda/core/_stream.pyi new file mode 100644 index 00000000000..f4d78982a1d --- /dev/null +++ b/cuda_core/cuda/core/_stream.pyi @@ -0,0 +1,230 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_stream.pyx + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Protocol + +import cuda.bindings.driver +import cython +from cuda.core._context import Context +from cuda.core._device import Device +from cuda.core._device_resources import DeviceResources +from cuda.core._event import Event, EventOptions +from cuda.core.graph import GraphBuilder + + +@dataclass +class StreamOptions: + """Customizable :obj:`~_stream.Stream` options. + + Attributes + ---------- + nonblocking : bool, optional + Stream does not synchronize with the NULL stream. (Default to True) + priority : int, optional + Stream priority where lower number represents a + higher priority. (Default to lowest priority) + + """ + nonblocking: cython.bint = True + priority: int | None = None + +class IsStreamType(Protocol): + + 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 + version number (currently ``0``) and the address of ``cudaStream_t``. Both values + should be Python `int`. + """ + +class Stream: + """Represent a queue of GPU operations that are executed in a specific order. + + Applications use streams to control the order of execution for + GPU work. Work within a single stream are executed sequentially. + Whereas work across multiple streams can be further controlled + using stream priorities and :obj:`~_event.Event` managements. + + Advanced users can utilize default streams for enforce complex + implicit synchronization behaviors. + + Directly creating a :obj:`~_stream.Stream` is not supported due to ambiguity. + New streams should instead be created through a :obj:`~_device.Device` + object, or created directly through using an existing handle + using Stream.from_handle(). + """ + + def close(self): + """Destroy the stream. + + Releases the stream handle. For owned streams, this destroys the + underlying CUDA stream. For borrowed streams, this releases the + reference and allows the Python owner to be GC'd. + """ + + def __init__(self, *args, **kwargs) -> None: + ... + + @classmethod + def _legacy_default(cls) -> Stream: + """Return the legacy default stream (supports subclassing).""" + + @classmethod + def _per_thread_default(cls) -> Stream: + """Return the per-thread default stream (supports subclassing).""" + + @classmethod + def _init(cls, obj: IsStreamType | None=None, options: object=None, device_id: int | None=None, ctx: Context | None=None) -> Stream: + ... + + def __cuda_stream__(self) -> tuple[int, int]: + """Return an instance of a __cuda_stream__ protocol.""" + + def __hash__(self) -> int: + ... + + def __eq__(self, other: object) -> bool: + ... + + def __repr__(self) -> str: + ... + + @property + def handle(self) -> cuda.bindings.driver.CUstream: + """Return the underlying ``CUstream`` object. + + .. caution:: + + This handle is a Python object. To get the memory address of the underlying C + handle, call ``int(Stream.handle)``. + """ + + @property + def is_nonblocking(self) -> bool: + """Return True if this is a nonblocking stream, otherwise False.""" + + @property + def priority(self) -> int: + """Return the stream priority.""" + + def sync(self) -> None: + """Synchronize the stream.""" + + def record(self, event: Event | None=None, options: EventOptions | None=None) -> Event: + """Record an event onto the stream. + + Creates an :obj:`~_event.Event` object (or reuses the given one) by + recording on the stream. + + Parameters + ---------- + event : :obj:`~_event.Event`, optional + Optional event object to be reused for recording. + options : :obj:`EventOptions`, optional + Customizable dataclass for event creation options. + + Returns + ------- + :obj:`~_event.Event` + Newly created event object. + + """ + + def wait(self, event_or_stream: Event | Stream) -> None: + """Wait for a CUDA event or a CUDA stream. + + Waiting for an event or a stream establishes a stream order. + + If a :obj:`~_stream.Stream` is provided, then wait until the stream's + work is completed. This is done by recording a new :obj:`~_event.Event` + on the stream and then waiting on it. + + Parameters + ---------- + event_or_stream : :obj:`~_event.Event` | :obj:`~_stream.Stream` + The event or stream to wait for. Objects supporting the + ``__cuda_stream__`` protocol are also accepted and treated as + streams. + + """ + + @property + def device(self) -> Device: + """Return the :obj:`~_device.Device` singleton associated with this stream. + + Note + ---- + The current context on the device may differ from this + stream's context. This case occurs when a different CUDA + context is set current after a stream is created. + + """ + + @property + def context(self) -> Context: + """Return the :obj:`~_context.Context` associated with this stream.""" + + @property + def resources(self) -> DeviceResources: + """Query the hardware resources provisioned for this stream's context. + + For streams created from a green context, returns the resources + that context was provisioned with. For streams on the primary + context, returns the full device resources. + """ + + @staticmethod + def from_handle(handle) -> Stream: + """Create a new :obj:`~_stream.Stream` object from a foreign stream handle. + + Uses a cudaStream_t pointer address represented as a Python int + to create a new :obj:`~_stream.Stream` object. + + Note + ---- + Stream lifetime is not managed, foreign object must remain + alive while this stream is active. + + Parameters + ---------- + handle : int + Stream handle representing the address of a foreign + stream object. + + Returns + ------- + :obj:`~_stream.Stream` + Newly created stream object. + + """ + + def create_graph_builder(self) -> GraphBuilder: + """Create a new :obj:`~graph.GraphBuilder` object. + + The new graph builder will be associated with this stream. + + Returns + ------- + :obj:`~graph.GraphBuilder` + Newly created graph builder object. + + """ +LEGACY_DEFAULT_STREAM: Stream = Stream._legacy_default() +PER_THREAD_DEFAULT_STREAM: Stream = Stream._per_thread_default() + +def default_stream() -> Stream: + """Return the default CUDA :obj:`~_stream.Stream`. + + The type of default stream returned depends on if the environment + variable CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM is set. + + If set, returns a per-thread default stream. Otherwise returns + the legacy stream. + + """ + +def Stream_accept(arg, allow_stream_protocol: bool=False) -> Stream: + ... \ No newline at end of file diff --git a/cuda_core/cuda/core/_stream.pyx b/cuda_core/cuda/core/_stream.pyx index bada70c7b97..5212ec5c7de 100644 --- a/cuda_core/cuda/core/_stream.pyx +++ b/cuda_core/cuda/core/_stream.pyx @@ -18,10 +18,12 @@ from cuda.core._utils.cuda_utils cimport ( import cython import warnings from dataclasses import dataclass -from typing import Protocol +from typing import Protocol, TYPE_CHECKING from cuda.core._context cimport Context +from cuda.core._device_resources cimport DeviceResources from cuda.core._event import Event, EventOptions + from cuda.core._resource_handles cimport ( ContextHandle, EventHandle, @@ -31,15 +33,19 @@ from cuda.core._resource_handles cimport ( create_stream_handle, create_stream_handle_with_owner, get_current_context, + get_last_error, get_legacy_stream, get_per_thread_stream, + get_stream_context, as_intptr, as_cu, as_py, ) -from cuda.core._graph import GraphBuilder - +if TYPE_CHECKING: + import cuda.bindings.driver # no-cython-lint + from cuda.core._device import Device + from cuda.core.graph import GraphBuilder @dataclass cdef class StreamOptions: @@ -59,7 +65,7 @@ cdef class StreamOptions: priority: int | None = None -class IsStreamT(Protocol): +class IsStreamType(Protocol): def __cuda_stream__(self) -> tuple[int, int]: """ For any Python object that is meant to be interpreted as a CUDA stream, the intent @@ -86,7 +92,7 @@ cdef class Stream: object, or created directly through using an existing handle using Stream.from_handle(). """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: raise RuntimeError( "Stream objects cannot be instantiated directly. " "Please use Device APIs (create_stream) or other Stream APIs (from_handle)." @@ -97,25 +103,25 @@ cdef class Stream: """Create a Stream from an existing StreamHandle (cdef-only factory).""" cdef Stream s = cls.__new__(cls) s._h_stream = h_stream - # _h_context is default-initialized to empty ContextHandle by C++ + s._h_context = get_stream_context(h_stream) s._device_id = -1 # lazy init'd (invalid sentinel) s._nonblocking = -1 # lazy init'd s._priority = INT32_MIN # lazy init'd return s @classmethod - def _legacy_default(cls): + def _legacy_default(cls) -> Stream: """Return the legacy default stream (supports subclassing).""" return Stream._from_handle(cls, get_legacy_stream()) @classmethod - def _per_thread_default(cls): + def _per_thread_default(cls) -> Stream: """Return the per-thread default stream (supports subclassing).""" return Stream._from_handle(cls, get_per_thread_stream()) @classmethod - def _init(cls, obj: IsStreamT | None = None, options=None, device_id: int = None, - ctx: Context = None): + def _init(cls, obj: IsStreamType | None = None, options: object = None, + device_id: int | None = None, ctx: Context | None = None) -> Stream: cdef StreamHandle h_stream cdef cydriver.CUstream borrowed cdef ContextHandle h_context @@ -143,8 +149,15 @@ cdef class Stream: else cydriver.CUstream_flags.CU_STREAM_DEFAULT) # TODO: we might want to consider memoizing high/low per CUDA context and avoid this call cdef int high, low + cdef cydriver.CUresult res_code with nogil: - HANDLE_RETURN(cydriver.cuCtxGetStreamPriorityRange(&high, &low)) + res_code = cydriver.cuCtxGetStreamPriorityRange(&high, &low) + if res_code != cydriver.CUresult.CUDA_SUCCESS: + if res_code == cydriver.CUresult.CUDA_ERROR_INVALID_CONTEXT: + raise RuntimeError( + "No current CUDA context. Call dev.set_current() before creating streams." + ) + HANDLE_RETURN(res_code) cdef int prio if priority is not None: prio = priority @@ -153,10 +166,25 @@ cdef class Stream: else: prio = high - # C++ creates the stream and returns owning handle with context dependency + # C++ creates the stream and returns owning handle with context dependency. + # For green contexts, the C++ layer auto-dispatches to cuGreenCtxStreamCreate. h_stream = create_stream_handle(h_context, flags, prio) if not h_stream: - raise RuntimeError("Failed to create CUDA stream") + res_code = get_last_error() + if not nonblocking and res_code == cydriver.CUresult.CUDA_ERROR_INVALID_VALUE: + # cuGreenCtxStreamCreate rejects CU_STREAM_DEFAULT; + # no need to check is_green since primary streams don't fail this way + raise ValueError( + "Green context streams must be non-blocking. " + "Use StreamOptions(nonblocking=True) or omit the option (True is the default)." + ) + elif res_code == cydriver.CUresult.CUDA_ERROR_NOT_SUPPORTED: + raise RuntimeError( + "cuGreenCtxStreamCreate is not available. " + "Green context stream creation requires CUDA 12.5 or newer." + ) + else: + HANDLE_RETURN(res_code) self = Stream._from_handle(cls, h_stream) self._nonblocking = int(nonblocking) self._priority = prio @@ -180,7 +208,7 @@ cdef class Stream: def __hash__(self) -> int: return hash(as_intptr(self._h_stream)) - def __eq__(self, other) -> bool: + def __eq__(self, other: object) -> bool: if not isinstance(other, Stream): return NotImplemented return as_intptr(self._h_stream) == as_intptr((other)._h_stream) @@ -220,15 +248,15 @@ cdef class Stream: self._priority = prio return self._priority - def sync(self): + def sync(self) -> None: """Synchronize the stream.""" with nogil: HANDLE_RETURN(cydriver.cuStreamSynchronize(as_cu(self._h_stream))) - def record(self, event: Event = None, options: EventOptions = None) -> Event: + def record(self, event: Event | None = None, options: EventOptions | None = None) -> Event: """Record an event onto the stream. - Creates an Event object (or reuses the given one) by + Creates an :obj:`~_event.Event` object (or reuses the given one) by recording on the stream. Parameters @@ -261,7 +289,7 @@ cdef class Stream: HANDLE_RETURN(cydriver.cuEventRecord(e, as_cu(self._h_stream))) return event - def wait(self, event_or_stream: Event | Stream): + def wait(self, event_or_stream: Event | Stream) -> None: """Wait for a CUDA event or a CUDA stream. Waiting for an event or a stream establishes a stream order. @@ -270,6 +298,13 @@ cdef class Stream: work is completed. This is done by recording a new :obj:`~_event.Event` on the stream and then waiting on it. + Parameters + ---------- + event_or_stream : :obj:`~_event.Event` | :obj:`~_stream.Stream` + The event or stream to wait for. Objects supporting the + ``__cuda_stream__`` protocol are also accepted and treated as + streams. + """ cdef Stream stream cdef EventHandle h_event @@ -323,8 +358,20 @@ cdef class Stream: Stream_ensure_ctx_device(self) return Context._from_handle(Context, self._h_context, self._device_id) + @property + def resources(self) -> DeviceResources: + """Query the hardware resources provisioned for this stream's context. + + For streams created from a green context, returns the resources + that context was provisioned with. For streams on the primary + context, returns the full device resources. + """ + Stream_ensure_ctx(self) + Stream_ensure_ctx_device(self) + return DeviceResources._init_from_ctx(self._h_context, self._device_id) + @staticmethod - def from_handle(handle: int) -> Stream: + def from_handle(handle) -> Stream: """Create a new :obj:`~_stream.Stream` object from a foreign stream handle. Uses a cudaStream_t pointer address represented as a Python int @@ -333,7 +380,7 @@ cdef class Stream: Note ---- Stream lifetime is not managed, foreign object must remain - alive while this steam is active. + alive while this stream is active. Parameters ---------- @@ -349,32 +396,29 @@ cdef class Stream: """ class _stream_holder: - def __cuda_stream__(self): + def __cuda_stream__(self) -> tuple[int, int]: return (0, handle) return Stream._init(obj=_stream_holder()) def create_graph_builder(self) -> GraphBuilder: - """Create a new :obj:`~_graph.GraphBuilder` object. + """Create a new :obj:`~graph.GraphBuilder` object. The new graph builder will be associated with this stream. Returns ------- - :obj:`~_graph.GraphBuilder` + :obj:`~graph.GraphBuilder` Newly created graph builder object. """ - return GraphBuilder._init(stream=self, is_stream_owner=False) + from cuda.core.graph._graph_builder import GraphBuilder + return GraphBuilder._init(self) -# c-only python objects, not public -cdef Stream C_LEGACY_DEFAULT_STREAM = Stream._legacy_default() -cdef Stream C_PER_THREAD_DEFAULT_STREAM = Stream._per_thread_default() -# standard python objects, public -LEGACY_DEFAULT_STREAM = C_LEGACY_DEFAULT_STREAM -PER_THREAD_DEFAULT_STREAM = C_PER_THREAD_DEFAULT_STREAM +LEGACY_DEFAULT_STREAM: Stream = Stream._legacy_default() +PER_THREAD_DEFAULT_STREAM: Stream = Stream._per_thread_default() cpdef Stream default_stream(): @@ -396,16 +440,20 @@ cpdef Stream default_stream(): # value is non-zero, including for weird stuff like 123foo if use_ptds: - return C_PER_THREAD_DEFAULT_STREAM + return PER_THREAD_DEFAULT_STREAM else: - return C_LEGACY_DEFAULT_STREAM + return LEGACY_DEFAULT_STREAM cdef inline int Stream_ensure_ctx(Stream self) except?-1 nogil: """Ensure the stream's context handle is populated.""" cdef cydriver.CUcontext ctx if not self._h_context: - HANDLE_RETURN(cydriver.cuStreamGetCtx(as_cu(self._h_stream), &ctx)) + self._h_context = get_stream_context(self._h_stream) + if self._h_context: + return 0 + HANDLE_RETURN(cydriver.cuStreamGetCtx(as_cu(self._h_stream), &ctx)) + if ctx != NULL: with gil: self._h_context = create_context_handle_ref(ctx) return 0 @@ -415,13 +463,15 @@ cdef inline int Stream_ensure_ctx_device(Stream self) except?-1: """Ensure the stream's context and device_id are populated.""" cdef cydriver.CUcontext ctx cdef cydriver.CUdevice target_dev + cdef ContextHandle current_context cdef bint switch_context if self._device_id < 0: with nogil: # Get device ID from context, switching context temporarily if needed Stream_ensure_ctx(self) - switch_context = (get_current_context() != self._h_context) + current_context = get_current_context() + switch_context = (as_cu(current_context) != as_cu(self._h_context)) if switch_context: HANDLE_RETURN(cydriver.cuCtxPushCurrent(as_cu(self._h_context))) HANDLE_RETURN(cydriver.cuCtxGetDevice(&target_dev)) @@ -464,8 +514,17 @@ cdef cydriver.CUstream _handle_from_stream_protocol(obj) except*: return (info[1]) # Helper for API functions that accept either Stream or GraphBuilder. Performs -# needed checks and returns the relevant stream. -cdef Stream Stream_accept(arg, bint allow_stream_protocol=False): +# needed checks and returns the relevant stream. Rejects None so that callers +# cannot rely on an implicit fallback to the default stream; if the default +# stream is wanted, pass `device.default_stream` explicitly. +cpdef Stream Stream_accept(arg, bint allow_stream_protocol=False): + from cuda.core.graph._graph_builder import GraphBuilder + + if arg is None: + raise TypeError( + "stream is required and must not be None; " + "pass device.default_stream explicitly to use the default stream." + ) if isinstance(arg, Stream): return (arg) elif isinstance(arg, GraphBuilder): diff --git a/cuda_core/cuda/core/_tensor_bridge.pyi b/cuda_core/cuda/core/_tensor_bridge.pyi new file mode 100644 index 00000000000..22948d5b864 --- /dev/null +++ b/cuda_core/cuda/core/_tensor_bridge.pyi @@ -0,0 +1,85 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_tensor_bridge.pyx + +"""Tensor bridge: extract PyTorch tensor metadata via the AOTI stable C ABI. + +PyTorch is NOT required at build time. At runtime the AOTI symbols are +resolved from ``torch._C`` (which is loaded with ``RTLD_GLOBAL``). + +The ``pyobj_to_aten_handle`` trick exploits the internal layout of +``THPVariable`` (PyTorch's Python tensor wrapper). + +In PyTorch 2.10+ ``cdata`` is ``at::Tensor`` directly:: + + struct THPVariable { + PyObject_HEAD + at::Tensor cdata; // <-- &cdata is usable as AtenTensorHandle + ... + }; + +In PyTorch 2.3–2.9 ``cdata`` was ``c10::MaybeOwned``, +whose first member is ``bool isBorrowed_`` (padded to 8 bytes), +followed by the ``at::Tensor`` union member:: + + struct THPVariable { + PyObject_HEAD + c10::MaybeOwned cdata; + // MaybeOwned layout: { bool isBorrowed_ (8 bytes); at::Tensor own_; } + ... + }; + +In both cases the address of the ``at::Tensor`` inside ``cdata`` is +accepted by the AOTI stable C ABI functions as an ``AtenTensorHandle``. +The extra 8-byte skip for the ``isBorrowed_`` member is determined +at runtime from the PyTorch version (see ``_get_cdata_extra_offset``). + +Offsetting past ``PyObject_HEAD`` gives us the handle +without any Python attribute access or method calls (~14 ns for all +7 metadata queries). + +Credit: Emilio Castillo (ecastillo@nvidia.com) – original tensor-bridge POC. + +.. note:: + + This module must NOT be imported at ``cuda.core`` load time. It is + loaded lazily (by ``_memoryview.pyx``) only when the user actually + passes a ``torch.Tensor``. The caller must ensure that + ``torch._C`` has been re-opened with ``RTLD_GLOBAL`` *before* + importing this module so that the AOTI symbols are visible. +""" +from __future__ import annotations + +import numpy +from cuda.core._memoryview import StridedMemoryView + +AOTITorchError = int + +def sync_torch_stream(device_index: int, consumer_s: int) -> int: + """Establish stream ordering between PyTorch's current CUDA stream + and the given consumer stream. + + Records an event on PyTorch's current stream (the producer) and makes + the consumer stream wait on it. This is a no-op if both streams are + the same. + """ + +def resolve_aoti_dtype(dtype_code: int) -> numpy.dtype: + """Python-callable wrapper around _get_aoti_dtype (for lazy resolution).""" + +def view_as_torch_tensor(obj: object, stream_ptr: object, view: StridedMemoryView | None=None) -> StridedMemoryView: + """Create/populate a :class:`StridedMemoryView` from a ``torch.Tensor``. + + This is a fast path that avoids DLPack/CAI protocol overhead by + reading tensor metadata directly through the AOTI stable C ABI. + + Parameters + ---------- + obj : torch.Tensor + The source tensor. + stream_ptr : int or None + Consumer stream pointer. When not ``-1``, stream ordering is + established between PyTorch's current CUDA stream (the producer) + and the consumer stream, matching the DLPack contract. + view : StridedMemoryView, optional + If provided, populate this existing view in-place. Otherwise a + new instance is created. + """ \ No newline at end of file diff --git a/cuda_core/cuda/core/_tensor_bridge.pyx b/cuda_core/cuda/core/_tensor_bridge.pyx new file mode 100644 index 00000000000..dd41c77c051 --- /dev/null +++ b/cuda_core/cuda/core/_tensor_bridge.pyx @@ -0,0 +1,449 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +"""Tensor bridge: extract PyTorch tensor metadata via the AOTI stable C ABI. + +PyTorch is NOT required at build time. At runtime the AOTI symbols are +resolved from ``torch._C`` (which is loaded with ``RTLD_GLOBAL``). + +The ``pyobj_to_aten_handle`` trick exploits the internal layout of +``THPVariable`` (PyTorch's Python tensor wrapper). + +In PyTorch 2.10+ ``cdata`` is ``at::Tensor`` directly:: + + struct THPVariable { + PyObject_HEAD + at::Tensor cdata; // <-- &cdata is usable as AtenTensorHandle + ... + }; + +In PyTorch 2.3–2.9 ``cdata`` was ``c10::MaybeOwned``, +whose first member is ``bool isBorrowed_`` (padded to 8 bytes), +followed by the ``at::Tensor`` union member:: + + struct THPVariable { + PyObject_HEAD + c10::MaybeOwned cdata; + // MaybeOwned layout: { bool isBorrowed_ (8 bytes); at::Tensor own_; } + ... + }; + +In both cases the address of the ``at::Tensor`` inside ``cdata`` is +accepted by the AOTI stable C ABI functions as an ``AtenTensorHandle``. +The extra 8-byte skip for the ``isBorrowed_`` member is determined +at runtime from the PyTorch version (see ``_get_cdata_extra_offset``). + +Offsetting past ``PyObject_HEAD`` gives us the handle +without any Python attribute access or method calls (~14 ns for all +7 metadata queries). + +Credit: Emilio Castillo (ecastillo@nvidia.com) – original tensor-bridge POC. + +.. note:: + + This module must NOT be imported at ``cuda.core`` load time. It is + loaded lazily (by ``_memoryview.pyx``) only when the user actually + passes a ``torch.Tensor``. The caller must ensure that + ``torch._C`` has been re-opened with ``RTLD_GLOBAL`` *before* + importing this module so that the AOTI symbols are visible. +""" + +from libc.stdint cimport intptr_t, int8_t, int16_t, int32_t, int64_t, uint8_t + +from cuda.core._memoryview cimport StridedMemoryView +from cuda.core._layout cimport _StridedLayout +from cuda.bindings cimport cydriver +from cuda.core._resource_handles cimport ( + EventHandle, + create_event_handle_noctx, + as_cu, +) +from cuda.core._utils.cuda_utils cimport HANDLE_RETURN + +cdef extern from "Python.h": + ctypedef struct PyObject: + pass + +cdef extern from "_include/aoti_shim.h": + ctypedef int32_t AOTITorchError + + ctypedef struct AtenTensorOpaque: + pass + ctypedef AtenTensorOpaque* AtenTensorHandle + + # tensor metadata + AOTITorchError aoti_torch_get_data_ptr(AtenTensorHandle, void**) + AOTITorchError aoti_torch_get_dim(AtenTensorHandle, int64_t*) + AOTITorchError aoti_torch_get_sizes(AtenTensorHandle, int64_t**) + AOTITorchError aoti_torch_get_strides(AtenTensorHandle, int64_t**) + + # dtype + AOTITorchError aoti_torch_get_dtype(AtenTensorHandle, int32_t*) + int32_t aoti_torch_dtype_float16() + int32_t aoti_torch_dtype_float32() + int32_t aoti_torch_dtype_float64() + int32_t aoti_torch_dtype_bfloat16() + int32_t aoti_torch_dtype_uint8() + int32_t aoti_torch_dtype_uint16() + int32_t aoti_torch_dtype_uint32() + int32_t aoti_torch_dtype_uint64() + int32_t aoti_torch_dtype_int8() + int32_t aoti_torch_dtype_int16() + int32_t aoti_torch_dtype_int32() + int32_t aoti_torch_dtype_int64() + int32_t aoti_torch_dtype_bool() + int32_t aoti_torch_dtype_complex32() + int32_t aoti_torch_dtype_complex64() + int32_t aoti_torch_dtype_complex128() + + # device + AOTITorchError aoti_torch_get_device_type(AtenTensorHandle, int32_t*) + AOTITorchError aoti_torch_get_device_index(AtenTensorHandle, int32_t*) + int32_t aoti_torch_device_type_cpu() + int32_t aoti_torch_device_type_cuda() + + # Note: aoti_torch_get_current_cuda_stream is NOT declared here because + # it lives in torch_cuda.dll (not torch_cpu.dll). It is resolved lazily + # at runtime via dlsym / GetProcAddress — see _resolve_cuda_stream_fn(). + +# Runtime resolution for aoti_torch_get_current_cuda_stream. +# This symbol lives in torch_cuda.dll (Windows) / libtorch_cuda.so (Linux), +# NOT in torch_cpu. We resolve it lazily on first use so that the module +# can be imported even with CPU-only PyTorch. +ctypedef AOTITorchError (*_get_cuda_stream_fn_t)(int32_t, void**) nogil + +cdef extern from *: + """ + #ifdef _WIN32 + #include + static void* _resolve_cuda_stream_fn(void) { + HMODULE h = LoadLibraryA("torch_cuda.dll"); + if (!h) return NULL; + return (void*)GetProcAddress(h, "aoti_torch_get_current_cuda_stream"); + } + #else + #include + #ifndef RTLD_DEFAULT + #define RTLD_DEFAULT ((void*)0) + #endif + static void* _resolve_cuda_stream_fn(void) { + return dlsym(RTLD_DEFAULT, "aoti_torch_get_current_cuda_stream"); + } + #endif + """ + void* _resolve_cuda_stream_fn() nogil + +cdef _get_cuda_stream_fn_t _cached_get_cuda_stream = NULL + +import numpy +import sys + + +# --------------------------------------------------------------------------- +# Module-level state (initialised at import time — AOTI symbols are +# guaranteed visible because _memoryview bootstraps RTLD_GLOBAL before +# importing us) +# --------------------------------------------------------------------------- + +cdef int32_t _DEVICE_TYPE_CPU = aoti_torch_device_type_cpu() +cdef int32_t _DEVICE_TYPE_CUDA = aoti_torch_device_type_cuda() +cdef dict _aoti_dtype_map = None +cdef dict _aoti_itemsize_map = None + +# Extra byte offset to skip before reaching the at::Tensor inside +# THPVariable::cdata. See _get_cdata_extra_offset() for details. +# Tri-state: -1 = not yet probed, 0 or 8 = cached result. +cdef Py_ssize_t _cdata_extra_offset = -1 + + +cdef Py_ssize_t _get_cdata_extra_offset(): + """Return the extra byte offset caused by ``MaybeOwned``'s bool member. + + In PyTorch 2.3–2.9 ``THPVariable::cdata`` is + ``c10::MaybeOwned``, whose first member is + ``bool isBorrowed_`` (padded to pointer alignment = 8 bytes). + The actual ``at::Tensor`` sits *after* that bool, so we must + skip 8 extra bytes. + + From PyTorch 2.10 onward ``cdata`` is ``at::Tensor`` directly, + so no extra offset is needed. + """ + global _cdata_extra_offset + if _cdata_extra_offset >= 0: + return _cdata_extra_offset + torch = sys.modules.get("torch") + if torch is None: + raise RuntimeError("torch must be imported before _tensor_bridge") + try: + major = int(torch.__version__.split(".")[0]) + minor = int(torch.__version__.split(".")[1]) + except (ValueError, IndexError): + raise RuntimeError( + f"Cannot parse torch version: {torch.__version__!r}") + if (major, minor) < (2, 10): + _cdata_extra_offset = 8 # skip MaybeOwned::isBorrowed_ padding + else: + _cdata_extra_offset = 0 # at::Tensor directly at base + return _cdata_extra_offset + + +# --------------------------------------------------------------------------- +# pointer extraction +# --------------------------------------------------------------------------- + +cdef inline AtenTensorHandle pyobj_to_aten_handle(object obj): + """Extract AtenTensorHandle by offsetting past PyObject_HEAD. + + In PyTorch 2.3–2.9 the first field after PyObject_HEAD is + ``c10::MaybeOwned cdata``, whose ``isBorrowed_`` + bool member (padded to 8 bytes) precedes the actual + ``at::Tensor``. From 2.10 onward ``cdata`` is ``at::Tensor`` + directly. The extra offset is determined once by + :func:`_get_cdata_extra_offset` and cached. + """ + return ( + obj + sizeof(PyObject) + _get_cdata_extra_offset()) + + +cdef inline int check_aoti(AOTITorchError err, const char* name) except? -1: + """Raise RuntimeError if an AOTI call returned a non-zero error code.""" + if err != 0: + raise RuntimeError(f"{name.decode()} failed") + return 0 + + +# --------------------------------------------------------------------------- +# dtype mapping (AOTI int32 -> numpy dtype) +# --------------------------------------------------------------------------- + +cdef dict _build_dtype_map(): + try: + from ml_dtypes import bfloat16 as _bf16 # noqa: F811 + has_bfloat16 = True + except ImportError: + has_bfloat16 = False + + cdef dict m = { + aoti_torch_dtype_float16(): numpy.dtype(numpy.float16), + aoti_torch_dtype_float32(): numpy.dtype(numpy.float32), + aoti_torch_dtype_float64(): numpy.dtype(numpy.float64), + aoti_torch_dtype_uint8(): numpy.dtype(numpy.uint8), + aoti_torch_dtype_uint16(): numpy.dtype(numpy.uint16), + aoti_torch_dtype_uint32(): numpy.dtype(numpy.uint32), + aoti_torch_dtype_uint64(): numpy.dtype(numpy.uint64), + aoti_torch_dtype_int8(): numpy.dtype(numpy.int8), + aoti_torch_dtype_int16(): numpy.dtype(numpy.int16), + aoti_torch_dtype_int32(): numpy.dtype(numpy.int32), + aoti_torch_dtype_int64(): numpy.dtype(numpy.int64), + aoti_torch_dtype_bool(): numpy.dtype(numpy.bool_), + aoti_torch_dtype_complex64(): numpy.dtype(numpy.complex64), + aoti_torch_dtype_complex128(): numpy.dtype(numpy.complex128), + } + if has_bfloat16: + m[aoti_torch_dtype_bfloat16()] = numpy.dtype(_bf16) + return m + + +cdef object _get_aoti_dtype(int32_t dtype_code): + global _aoti_dtype_map + if _aoti_dtype_map is None: + _aoti_dtype_map = _build_dtype_map() + result = _aoti_dtype_map.get(dtype_code) + if result is None: + raise TypeError(f"Unsupported AOTI dtype code: {dtype_code}") + return result + + +def resolve_aoti_dtype(int32_t dtype_code) -> numpy.dtype: + """Python-callable wrapper around _get_aoti_dtype (for lazy resolution).""" + return _get_aoti_dtype(dtype_code) + + +cdef dict _build_itemsize_map(): + return { + aoti_torch_dtype_bool(): sizeof(uint8_t), + aoti_torch_dtype_uint8(): sizeof(uint8_t), + aoti_torch_dtype_uint16(): sizeof(int16_t), + aoti_torch_dtype_uint32(): sizeof(int32_t), + aoti_torch_dtype_uint64(): sizeof(int64_t), + aoti_torch_dtype_int8(): sizeof(int8_t), + aoti_torch_dtype_float16(): sizeof(int16_t), # no C float16 + aoti_torch_dtype_bfloat16(): sizeof(int16_t), # no C bfloat16 + aoti_torch_dtype_int16(): sizeof(int16_t), + aoti_torch_dtype_complex32(): 2 * sizeof(int16_t), # no C complex32 + aoti_torch_dtype_float32(): sizeof(float), + aoti_torch_dtype_int32(): sizeof(int32_t), + aoti_torch_dtype_complex64(): 2 * sizeof(float), + aoti_torch_dtype_float64(): sizeof(double), + aoti_torch_dtype_int64(): sizeof(int64_t), + aoti_torch_dtype_complex128(): 2 * sizeof(double), + } + + +cdef int _get_aoti_itemsize(int32_t dtype_code) except -1: + global _aoti_itemsize_map + if _aoti_itemsize_map is None: + _aoti_itemsize_map = _build_itemsize_map() + result = _aoti_itemsize_map.get(dtype_code) + if result is None: + raise TypeError(f"Unsupported AOTI dtype code: {dtype_code}") + return result + + +# --------------------------------------------------------------------------- +# Stream ordering helper +# --------------------------------------------------------------------------- + +cpdef int sync_torch_stream(int32_t device_index, + intptr_t consumer_s) except? -1: + """Establish stream ordering between PyTorch's current CUDA stream + and the given consumer stream. + + Records an event on PyTorch's current stream (the producer) and makes + the consumer stream wait on it. This is a no-op if both streams are + the same. + """ + global _cached_get_cuda_stream + cdef void* producer_s + cdef EventHandle h_event + + if _cached_get_cuda_stream == NULL: + _cached_get_cuda_stream = <_get_cuda_stream_fn_t>_resolve_cuda_stream_fn() + if _cached_get_cuda_stream == NULL: + raise RuntimeError( + "Cannot resolve aoti_torch_get_current_cuda_stream from " + "torch_cuda — is CUDA-enabled PyTorch installed?") + check_aoti(_cached_get_cuda_stream(device_index, &producer_s), + b"aoti_torch_get_current_cuda_stream") + if producer_s != consumer_s: + with nogil: + h_event = create_event_handle_noctx( + cydriver.CUevent_flags.CU_EVENT_DISABLE_TIMING) + HANDLE_RETURN(cydriver.cuEventRecord( + as_cu(h_event), producer_s)) + HANDLE_RETURN(cydriver.cuStreamWaitEvent( + consumer_s, as_cu(h_event), 0)) + return 0 + + +# --------------------------------------------------------------------------- +# Public API: construct StridedMemoryView from a torch.Tensor +# --------------------------------------------------------------------------- + +def view_as_torch_tensor( + object obj, + object stream_ptr, + view: StridedMemoryView | None = None +) -> StridedMemoryView: + """Create/populate a :class:`StridedMemoryView` from a ``torch.Tensor``. + + This is a fast path that avoids DLPack/CAI protocol overhead by + reading tensor metadata directly through the AOTI stable C ABI. + + Parameters + ---------- + obj : torch.Tensor + The source tensor. + stream_ptr : int or None + Consumer stream pointer. When not ``-1``, stream ordering is + established between PyTorch's current CUDA stream (the producer) + and the consumer stream, matching the DLPack contract. + view : StridedMemoryView, optional + If provided, populate this existing view in-place. Otherwise a + new instance is created. + """ + cdef AtenTensorHandle handle = pyobj_to_aten_handle(obj) + cdef void* data_ptr + cdef int64_t ndim + cdef int64_t* sizes_ptr + cdef int64_t* strides_ptr + cdef int32_t dtype_code + cdef int32_t device_type, device_index + cdef StridedMemoryView buf + cdef int itemsize + cdef intptr_t _stream_ptr_int + cdef _StridedLayout layout + + # Note: we intentionally skip PyTorch's Python-level __dlpack__ guards + # (requires_grad, is_conj, is_neg, non-strided layout, wrong-device) + # for the same reason PyTorch's own __dlpack_c_exchange_api__ C path + # skips them — the C-level exchange path is designed for performance- + # critical consumers. See DLTensorFromPyObjectNoSync in + # torch/csrc/Module.cpp which calls toDLPackNonOwning with zero checks. + + check_aoti(aoti_torch_get_data_ptr(handle, &data_ptr), + b"aoti_torch_get_data_ptr") + check_aoti(aoti_torch_get_dim(handle, &ndim), + b"aoti_torch_get_dim") + check_aoti(aoti_torch_get_sizes(handle, &sizes_ptr), + b"aoti_torch_get_sizes") + check_aoti(aoti_torch_get_strides(handle, &strides_ptr), + b"aoti_torch_get_strides") + check_aoti(aoti_torch_get_dtype(handle, &dtype_code), + b"aoti_torch_get_dtype") + check_aoti(aoti_torch_get_device_type(handle, &device_type), + b"aoti_torch_get_device_type") + check_aoti(aoti_torch_get_device_index(handle, &device_index), + b"aoti_torch_get_device_index") + + # -- populate StridedMemoryView -- + if view is not None: + buf = view + else: + buf = StridedMemoryView.__new__(StridedMemoryView) + + buf.ptr = data_ptr + buf._dtype = None # clear cached dtype (view may be reused) + # PyTorch always reports tensors as writable via both DLPack + # (flags=0, no DLPACK_FLAG_BITMASK_READ_ONLY) and CAI + # (__cuda_array_interface__["data"] = (ptr, False)). Tensors that + # cannot be safely exported (requires_grad, conjugate, non-strided) + # are rejected with BufferError rather than marked read-only. + # The AOTI C ABI has no readonly query either, so False is correct. + buf.readonly = False + buf.exporting_obj = obj + buf.dl_tensor = NULL + buf.metadata = None + buf._buffer = None + + if device_type == _DEVICE_TYPE_CPU: + buf.device_id = -1 + buf.is_device_accessible = False + elif device_type == _DEVICE_TYPE_CUDA: + buf.device_id = device_index + buf.is_device_accessible = True + + # -- stream ordering (matches the DLPack contract) -- + # stream_ptr=None is ambiguous for CUDA tensors — the caller must + # explicitly choose -1 (no sync) or a valid stream pointer. + if stream_ptr is None: + raise BufferError( + "stream_ptr=None is ambiguous for CUDA tensors; " + "pass stream_ptr=-1 to opt out of synchronization, " + "or pass a valid stream pointer") + _stream_ptr_int = int(stream_ptr) + if _stream_ptr_int != -1: + sync_torch_stream(device_index, _stream_ptr_int) + else: + raise BufferError( + f"Unsupported device type from torch tensor " + f"(AOTI device type id: {device_type})") + + # Defer full numpy dtype resolution until first .dtype access. + # Store the raw AOTI dtype code in metadata for lazy lookup. + buf.metadata = dtype_code + + # Build _StridedLayout. init_from_ptr copies shape/strides so we are + # safe even though they are borrowed pointers. + itemsize = _get_aoti_itemsize(dtype_code) + layout = _StridedLayout.__new__(_StridedLayout) + layout.init_from_ptr( + ndim, + sizes_ptr, + strides_ptr, + itemsize, + ) + buf._layout = layout + + return buf diff --git a/cuda_core/cuda/core/_tensor_map.pxd b/cuda_core/cuda/core/_tensor_map.pxd new file mode 100644 index 00000000000..25aef566261 --- /dev/null +++ b/cuda_core/cuda/core/_tensor_map.pxd @@ -0,0 +1,19 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from cuda.bindings cimport cydriver +from libc.stdint cimport intptr_t +from cuda.core._memoryview cimport StridedMemoryView + + +cdef class TensorMapDescriptor: + cdef cydriver.CUtensorMap _tensor_map + cdef int _device_id + cdef intptr_t _context + cdef object _source_ref + cdef StridedMemoryView _view_ref + cdef object _repr_info + + cdef int _check_context_compat(self) except -1 + cdef void* _get_data_ptr(self) diff --git a/cuda_core/cuda/core/_tensor_map.pyi b/cuda_core/cuda/core/_tensor_map.pyi new file mode 100644 index 00000000000..986ab41549f --- /dev/null +++ b/cuda_core/cuda/core/_tensor_map.pyi @@ -0,0 +1,336 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_tensor_map.pyx + +from __future__ import annotations + +from dataclasses import dataclass + +import numpy +from cuda.bindings import cydriver +from cuda.core._device import Device + + +class TensorMapDataType: + """Data types for tensor map descriptors. + + These correspond to the ``CUtensorMapDataType`` driver enum values. + """ + UINT8 = cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT8 + UINT16 = cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT16 + UINT32 = cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT32 + INT32 = cydriver.CU_TENSOR_MAP_DATA_TYPE_INT32 + UINT64 = cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT64 + INT64 = cydriver.CU_TENSOR_MAP_DATA_TYPE_INT64 + FLOAT16 = cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT16 + FLOAT32 = cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT32 + FLOAT64 = cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT64 + BFLOAT16 = cydriver.CU_TENSOR_MAP_DATA_TYPE_BFLOAT16 + FLOAT32_FTZ = cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ + TFLOAT32 = cydriver.CU_TENSOR_MAP_DATA_TYPE_TFLOAT32 + TFLOAT32_FTZ = cydriver.CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ + +class TensorMapInterleave: + """Interleave layout for tensor map descriptors. + + These correspond to the ``CUtensorMapInterleave`` driver enum values. + """ + NONE = cydriver.CU_TENSOR_MAP_INTERLEAVE_NONE + INTERLEAVE_16B = cydriver.CU_TENSOR_MAP_INTERLEAVE_16B + INTERLEAVE_32B = cydriver.CU_TENSOR_MAP_INTERLEAVE_32B + +class TensorMapSwizzle: + """Swizzle mode for tensor map descriptors. + + These correspond to the ``CUtensorMapSwizzle`` driver enum values. + """ + NONE = cydriver.CU_TENSOR_MAP_SWIZZLE_NONE + SWIZZLE_32B = cydriver.CU_TENSOR_MAP_SWIZZLE_32B + SWIZZLE_64B = cydriver.CU_TENSOR_MAP_SWIZZLE_64B + SWIZZLE_128B = cydriver.CU_TENSOR_MAP_SWIZZLE_128B + +class TensorMapL2Promotion: + """L2 promotion mode for tensor map descriptors. + + These correspond to the ``CUtensorMapL2promotion`` driver enum values. + """ + NONE = cydriver.CU_TENSOR_MAP_L2_PROMOTION_NONE + L2_64B = cydriver.CU_TENSOR_MAP_L2_PROMOTION_L2_64B + L2_128B = cydriver.CU_TENSOR_MAP_L2_PROMOTION_L2_128B + L2_256B = cydriver.CU_TENSOR_MAP_L2_PROMOTION_L2_256B + +class TensorMapOOBFill: + """Out-of-bounds fill mode for tensor map descriptors. + + These correspond to the ``CUtensorMapFloatOOBfill`` driver enum values. + """ + NONE = cydriver.CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE + NAN_REQUEST_ZERO_FMA = cydriver.CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA + +class TensorMapIm2ColWideMode: + """Im2col wide mode for tensor map descriptors. + + This enum is always defined for API stability, but the + :meth:`TensorMapDescriptor._from_im2col_wide` factory requires a CUDA 13+ + build and will raise otherwise. + """ + W = 0 + W128 = 1 + +@dataclass +class TensorMapDescriptorOptions: + """Options for :meth:`cuda.core.StridedMemoryView.as_tensor_map`. + + Attributes + ---------- + box_dim : tuple[int, ...] + Tile size for each tensor dimension, expressed in elements. + element_strides : tuple[int, ...], optional + Per-dimension element traversal strides. + data_type : object, optional + Explicit dtype override. Prefer NumPy or ``ml_dtypes`` dtype objects; + :class:`TensorMapDataType` remains accepted for compatibility. + interleave : TensorMapInterleave, optional + Interleave layout. Default ``NONE``. + swizzle : TensorMapSwizzle, optional + Swizzle mode. Default ``NONE``. + l2_promotion : TensorMapL2Promotion, optional + L2 promotion mode. Default ``NONE``. + oob_fill : TensorMapOOBFill, optional + Out-of-bounds fill mode. Default ``NONE``. + """ + box_dim: tuple[int, ...] + element_strides: tuple[int, ...] | None = None + data_type: object = None + interleave: TensorMapInterleave = TensorMapInterleave.NONE + swizzle: TensorMapSwizzle = TensorMapSwizzle.NONE + l2_promotion: TensorMapL2Promotion = TensorMapL2Promotion.NONE + oob_fill: TensorMapOOBFill = TensorMapOOBFill.NONE + + def __post_init__(self) -> None: + ... + +class TensorMapDescriptor: + """Describes a TMA (Tensor Memory Accelerator) tensor map for Hopper+ GPUs. + + A ``TensorMapDescriptor`` wraps the opaque 128-byte ``CUtensorMap`` struct + used by the hardware TMA unit for efficient bulk data movement between + global and shared memory. + + Public tiled descriptors are created via + :meth:`cuda.core.StridedMemoryView.as_tensor_map`. Specialized + ``_from_*`` helpers remain private while this API surface settles, and + descriptors can be passed directly to :func:`~cuda.core.launch` as a + kernel argument. + """ + + def __init__(self): + ... + + @property + def device(self) -> Device | None: + """Return the :obj:`~cuda.core.Device` associated with this descriptor.""" + + @classmethod + def _from_tiled(cls, view, box_dim=None, *, options=None, element_strides=None, data_type=None, interleave=..., swizzle=..., l2_promotion=..., oob_fill=...): + """Create a tiled TMA descriptor from a validated view. + + Parameters + ---------- + view : StridedMemoryView + A device-accessible view with a 16-byte-aligned pointer. + box_dim : tuple of int, optional + The size of each tile dimension (in elements). Must have the + same rank as the tensor and each value must be in [1, 256]. + Specified in the same (row-major) order as the tensor shape. + Required unless ``options`` is provided. + options : TensorMapDescriptorOptions or mapping, optional + Bundled tiled-descriptor options. When provided, do not also pass + ``box_dim`` or the individual option kwargs. + element_strides : tuple of int, optional + Per-dimension element traversal strides. Default is all 1s. + Specified in the same (row-major) order as the tensor shape. + data_type : dtype-like or TensorMapDataType, optional + Explicit dtype override. If ``None``, inferred from the tensor's + dtype. Prefer NumPy or ``ml_dtypes`` dtype objects; the enum is + accepted for compatibility. + interleave : TensorMapInterleave + Interleave layout. Default ``NONE``. + swizzle : TensorMapSwizzle + Swizzle mode. Default ``NONE``. + l2_promotion : TensorMapL2Promotion + L2 promotion mode. Default ``NONE``. + oob_fill : TensorMapOOBFill + Out-of-bounds fill mode. Default ``NONE``. + + Returns + ------- + TensorMapDescriptor + + Raises + ------ + ValueError + If the tensor rank is outside [1, 5], the pointer is not + 16-byte aligned, or dimension/stride constraints are violated. + """ + + @classmethod + def _from_im2col(cls, view, pixel_box_lower_corner, pixel_box_upper_corner, channels_per_pixel, pixels_per_column, *, element_strides=None, data_type=None, interleave=..., swizzle=..., l2_promotion=..., oob_fill=...): + """Create an im2col TMA descriptor from a validated view. + + Im2col layout is used for convolution-style data access patterns. + + Parameters + ---------- + view : StridedMemoryView + A device-accessible view with a 16-byte-aligned pointer. + pixel_box_lower_corner : tuple of int + Lower corner of the pixel bounding box for each spatial + dimension (rank - 2 elements). Specified in row-major order + matching the tensor's spatial dimensions. + pixel_box_upper_corner : tuple of int + Upper corner of the pixel bounding box for each spatial + dimension (rank - 2 elements). Specified in row-major order + matching the tensor's spatial dimensions. + channels_per_pixel : int + Number of channels per pixel. + pixels_per_column : int + Number of pixels per column. + element_strides : tuple of int, optional + Per-dimension element traversal strides. Default is all 1s. + data_type : dtype-like or TensorMapDataType, optional + Explicit dtype override. If ``None``, inferred from the tensor's + dtype. Prefer NumPy or ``ml_dtypes`` dtype objects; the enum is + accepted for compatibility. + interleave : TensorMapInterleave + Interleave layout. Default ``NONE``. + swizzle : TensorMapSwizzle + Swizzle mode. Default ``NONE``. + l2_promotion : TensorMapL2Promotion + L2 promotion mode. Default ``NONE``. + oob_fill : TensorMapOOBFill + Out-of-bounds fill mode. Default ``NONE``. + + Returns + ------- + TensorMapDescriptor + + Raises + ------ + ValueError + If the tensor rank is outside [3, 5], the pointer is not + 16-byte aligned, or other constraints are violated. + """ + + @classmethod + def _from_im2col_wide(cls, view, pixel_box_lower_corner_width, pixel_box_upper_corner_width, channels_per_pixel, pixels_per_column, *, element_strides=None, data_type=None, interleave=..., mode=..., swizzle=..., l2_promotion=..., oob_fill=...): + """Create an im2col-wide TMA descriptor from a validated view. + + Im2col-wide layout loads elements exclusively along the W (width) + dimension. This variant is supported on compute capability 10.0+ + (Blackwell and later). + + Parameters + ---------- + view : StridedMemoryView + A device-accessible view with a 16-byte-aligned pointer. + pixel_box_lower_corner_width : int + Lower corner of the pixel bounding box along the W dimension. + pixel_box_upper_corner_width : int + Upper corner of the pixel bounding box along the W dimension. + channels_per_pixel : int + Number of channels per pixel. + pixels_per_column : int + Number of pixels per column. + element_strides : tuple of int, optional + Per-dimension element traversal strides. Default is all 1s. + data_type : dtype-like or TensorMapDataType, optional + Explicit dtype override. If ``None``, inferred from the tensor's + dtype. Prefer NumPy or ``ml_dtypes`` dtype objects; the enum is + accepted for compatibility. + interleave : TensorMapInterleave + Interleave layout. Default ``NONE``. + mode : TensorMapIm2ColWideMode + Im2col wide mode. Default ``W``. + swizzle : TensorMapSwizzle + Swizzle mode. Default ``SWIZZLE_128B``. + l2_promotion : TensorMapL2Promotion + L2 promotion mode. Default ``NONE``. + oob_fill : TensorMapOOBFill + Out-of-bounds fill mode. Default ``NONE``. + + Returns + ------- + TensorMapDescriptor + + Raises + ------ + ValueError + If the tensor rank is outside [3, 5], the pointer is not + 16-byte aligned, or other constraints are violated. + """ + + def replace_address(self, tensor: object) -> None: + """Replace the global memory address in this tensor map descriptor. + + This is useful when the tensor data has been reallocated but the + shape, strides, and other parameters remain the same. + + Parameters + ---------- + tensor : object + Any object supporting DLPack or ``__cuda_array_interface__``, + or a :obj:`~cuda.core.StridedMemoryView`. Must refer to + device-accessible memory with a 16-byte-aligned pointer. + """ + + def __repr__(self) -> str: + ... +_TMA_DT_UINT8 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT8) +_TMA_DT_UINT16 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT16) +_TMA_DT_UINT32 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT32) +_TMA_DT_INT32 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_INT32) +_TMA_DT_UINT64 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT64) +_TMA_DT_INT64 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_INT64) +_TMA_DT_FLOAT16 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT16) +_TMA_DT_FLOAT32 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT32) +_TMA_DT_FLOAT64 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT64) +_TMA_DT_BFLOAT16 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_BFLOAT16) +_TMA_DT_FLOAT32_FTZ = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ) +_TMA_DT_TFLOAT32 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_TFLOAT32) +_TMA_DT_TFLOAT32_FTZ = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ) +_NUMPY_DTYPE_TO_TMA = {numpy.dtype(numpy.uint8): _TMA_DT_UINT8, numpy.dtype(numpy.uint16): _TMA_DT_UINT16, numpy.dtype(numpy.uint32): _TMA_DT_UINT32, numpy.dtype(numpy.int32): _TMA_DT_INT32, numpy.dtype(numpy.uint64): _TMA_DT_UINT64, numpy.dtype(numpy.int64): _TMA_DT_INT64, numpy.dtype(numpy.float16): _TMA_DT_FLOAT16, numpy.dtype(numpy.float32): _TMA_DT_FLOAT32, numpy.dtype(numpy.float64): _TMA_DT_FLOAT64} +_TMA_DATA_TYPE_SIZE = {_TMA_DT_UINT8: 1, _TMA_DT_UINT16: 2, _TMA_DT_UINT32: 4, _TMA_DT_INT32: 4, _TMA_DT_UINT64: 8, _TMA_DT_INT64: 8, _TMA_DT_FLOAT16: 2, _TMA_DT_FLOAT32: 4, _TMA_DT_FLOAT64: 8, _TMA_DT_BFLOAT16: 2, _TMA_DT_FLOAT32_FTZ: 4, _TMA_DT_TFLOAT32: 4, _TMA_DT_TFLOAT32_FTZ: 4} + +def _normalize_tensor_map_data_type(data_type): + ... + +def _normalize_tensor_map_sequence(name, values): + ... + +def _require_tensor_map_enum(name, value, enum_type): + ... + +def _coerce_tensor_map_descriptor_options(box_dim, options, *, element_strides, data_type, interleave, swizzle, l2_promotion, oob_fill): + ... + +def _resolve_data_type(view, data_type): + """Resolve the TMA data type from an explicit value or the view's dtype.""" + +def _get_validated_view(tensor): + """Obtain a device-accessible StridedMemoryView with a 16-byte-aligned pointer.""" + +def _require_view_device(view, expected_device_id, operation): + """Ensure device-local tensors match the current CUDA device. + + DLPack reports host/managed CUDA memory as ``kDLCUDAHost`` / + ``kDLCUDAManaged`` with ``device_id=0`` regardless of the current device, + so only true ``kDLCUDA`` tensors are rejected by device-id mismatch. + """ + +def _compute_byte_strides(shape, strides, elem_size): + """Compute byte strides from element strides or C-contiguous fallback. + + Returns a tuple of byte strides in row-major order. + """ + +def _validate_element_strides(element_strides, rank): + """Validate or default element_strides to all-ones.""" \ No newline at end of file diff --git a/cuda_core/cuda/core/_tensor_map.pyx b/cuda_core/cuda/core/_tensor_map.pyx new file mode 100644 index 00000000000..7e059fe7b98 --- /dev/null +++ b/cuda_core/cuda/core/_tensor_map.pyx @@ -0,0 +1,1104 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from libc.stdint cimport intptr_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t +from libc.stddef cimport size_t +from cuda.bindings cimport cydriver +from cuda.core._utils.cuda_utils cimport HANDLE_RETURN +from cuda.core._dlpack cimport kDLInt, kDLUInt, kDLFloat, kDLBfloat, _kDLCUDA + +import enum +from dataclasses import dataclass +from typing import TYPE_CHECKING + +import numpy + +from cuda.core._memoryview import StridedMemoryView +from cuda.core._utils.cuda_utils import check_or_create_options + +if TYPE_CHECKING: + from cuda.core._device import Device + +cdef extern from "_cpp/tensor_map_cccl.h": + int cuda_core_cccl_make_tma_descriptor_tiled( + void* out_tensor_map, + void* data, + int device_type, + int device_id, + int ndim, + const int64_t* shape, + const int64_t* strides, + uint8_t dtype_code, + uint8_t dtype_bits, + uint16_t dtype_lanes, + const int* box_sizes, + const int* elem_strides, + int interleave_layout, + int swizzle, + int l2_fetch_size, + int oob_fill, + char* err, + size_t err_cap) nogil + + +try: + from ml_dtypes import bfloat16 as ml_bfloat16 +except ImportError: + ml_bfloat16 = None + + +class TensorMapDataType(enum.IntEnum): + """Data types for tensor map descriptors. + + These correspond to the ``CUtensorMapDataType`` driver enum values. + """ + UINT8 = cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT8 + UINT16 = cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT16 + UINT32 = cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT32 + INT32 = cydriver.CU_TENSOR_MAP_DATA_TYPE_INT32 + UINT64 = cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT64 + INT64 = cydriver.CU_TENSOR_MAP_DATA_TYPE_INT64 + FLOAT16 = cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT16 + FLOAT32 = cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT32 + FLOAT64 = cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT64 + BFLOAT16 = cydriver.CU_TENSOR_MAP_DATA_TYPE_BFLOAT16 + FLOAT32_FTZ = cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ + TFLOAT32 = cydriver.CU_TENSOR_MAP_DATA_TYPE_TFLOAT32 + TFLOAT32_FTZ = cydriver.CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ + + +class TensorMapInterleave(enum.IntEnum): + """Interleave layout for tensor map descriptors. + + These correspond to the ``CUtensorMapInterleave`` driver enum values. + """ + NONE = cydriver.CU_TENSOR_MAP_INTERLEAVE_NONE + INTERLEAVE_16B = cydriver.CU_TENSOR_MAP_INTERLEAVE_16B + INTERLEAVE_32B = cydriver.CU_TENSOR_MAP_INTERLEAVE_32B + + +class TensorMapSwizzle(enum.IntEnum): + """Swizzle mode for tensor map descriptors. + + These correspond to the ``CUtensorMapSwizzle`` driver enum values. + """ + NONE = cydriver.CU_TENSOR_MAP_SWIZZLE_NONE + SWIZZLE_32B = cydriver.CU_TENSOR_MAP_SWIZZLE_32B + SWIZZLE_64B = cydriver.CU_TENSOR_MAP_SWIZZLE_64B + SWIZZLE_128B = cydriver.CU_TENSOR_MAP_SWIZZLE_128B + + +class TensorMapL2Promotion(enum.IntEnum): + """L2 promotion mode for tensor map descriptors. + + These correspond to the ``CUtensorMapL2promotion`` driver enum values. + """ + NONE = cydriver.CU_TENSOR_MAP_L2_PROMOTION_NONE + L2_64B = cydriver.CU_TENSOR_MAP_L2_PROMOTION_L2_64B + L2_128B = cydriver.CU_TENSOR_MAP_L2_PROMOTION_L2_128B + L2_256B = cydriver.CU_TENSOR_MAP_L2_PROMOTION_L2_256B + + +class TensorMapOOBFill(enum.IntEnum): + """Out-of-bounds fill mode for tensor map descriptors. + + These correspond to the ``CUtensorMapFloatOOBfill`` driver enum values. + """ + NONE = cydriver.CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE + NAN_REQUEST_ZERO_FMA = cydriver.CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA + + +IF CUDA_CORE_BUILD_MAJOR >= 13: + class TensorMapIm2ColWideMode(enum.IntEnum): + """Im2col wide mode for tensor map descriptors. + + These correspond to the ``CUtensorMapIm2ColWideMode`` driver enum values. + Supported on compute capability 10.0+. + """ + W = cydriver.CU_TENSOR_MAP_IM2COL_WIDE_MODE_W + W128 = cydriver.CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128 +ELSE: + class TensorMapIm2ColWideMode(enum.IntEnum): + """Im2col wide mode for tensor map descriptors. + + This enum is always defined for API stability, but the + :meth:`TensorMapDescriptor._from_im2col_wide` factory requires a CUDA 13+ + build and will raise otherwise. + """ + W = 0 + W128 = 1 + + +_TMA_DT_UINT8 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT8) +_TMA_DT_UINT16 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT16) +_TMA_DT_UINT32 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT32) +_TMA_DT_INT32 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_INT32) +_TMA_DT_UINT64 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT64) +_TMA_DT_INT64 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_INT64) +_TMA_DT_FLOAT16 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT16) +_TMA_DT_FLOAT32 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT32) +_TMA_DT_FLOAT64 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT64) +_TMA_DT_BFLOAT16 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_BFLOAT16) +_TMA_DT_FLOAT32_FTZ = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ) +_TMA_DT_TFLOAT32 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_TFLOAT32) +_TMA_DT_TFLOAT32_FTZ = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ) + + +def _normalize_tensor_map_data_type(data_type): + if data_type is None or isinstance(data_type, TensorMapDataType): + return data_type + try: + return numpy.dtype(data_type) + except TypeError as e: + raise TypeError( + "data_type must be a TensorMapDataType or a numpy/ml_dtypes dtype, " + f"got {type(data_type)}") from e + + +def _normalize_tensor_map_sequence(name, values): + try: + values = tuple(values) + except TypeError as e: + raise TypeError(f"{name} must be a tuple of ints, got {type(values)}") from e + for i, value in enumerate(values): + if not isinstance(value, int): + raise TypeError(f"{name}[{i}] must be an int, got {type(value)}") + return values + + +def _require_tensor_map_enum(name, value, enum_type): + if not isinstance(value, enum_type): + raise TypeError(f"{name} must be a {enum_type.__name__}, got {type(value)}") + return value + + +@dataclass +class TensorMapDescriptorOptions: + """Options for :meth:`cuda.core.StridedMemoryView.as_tensor_map`. + + Attributes + ---------- + box_dim : tuple[int, ...] + Tile size for each tensor dimension, expressed in elements. + element_strides : tuple[int, ...], optional + Per-dimension element traversal strides. + data_type : object, optional + Explicit dtype override. Prefer NumPy or ``ml_dtypes`` dtype objects; + :class:`TensorMapDataType` remains accepted for compatibility. + interleave : TensorMapInterleave, optional + Interleave layout. Default ``NONE``. + swizzle : TensorMapSwizzle, optional + Swizzle mode. Default ``NONE``. + l2_promotion : TensorMapL2Promotion, optional + L2 promotion mode. Default ``NONE``. + oob_fill : TensorMapOOBFill, optional + Out-of-bounds fill mode. Default ``NONE``. + """ + + box_dim: tuple[int, ...] + element_strides: tuple[int, ...] | None = None + data_type: object = None + interleave: TensorMapInterleave = TensorMapInterleave.NONE + swizzle: TensorMapSwizzle = TensorMapSwizzle.NONE + l2_promotion: TensorMapL2Promotion = TensorMapL2Promotion.NONE + oob_fill: TensorMapOOBFill = TensorMapOOBFill.NONE + + def __post_init__(self) -> None: + self.box_dim = _normalize_tensor_map_sequence("box_dim", self.box_dim) + if self.element_strides is not None: + self.element_strides = _normalize_tensor_map_sequence("element_strides", self.element_strides) + self.data_type = _normalize_tensor_map_data_type(self.data_type) + self.interleave = _require_tensor_map_enum("interleave", self.interleave, TensorMapInterleave) + self.swizzle = _require_tensor_map_enum("swizzle", self.swizzle, TensorMapSwizzle) + self.l2_promotion = _require_tensor_map_enum("l2_promotion", self.l2_promotion, TensorMapL2Promotion) + self.oob_fill = _require_tensor_map_enum("oob_fill", self.oob_fill, TensorMapOOBFill) + + +def _coerce_tensor_map_descriptor_options( + box_dim, + options, + *, + element_strides, + data_type, + interleave, + swizzle, + l2_promotion, + oob_fill, +): + if options is not None: + if ( + box_dim is not None + or element_strides is not None + or data_type is not None + or interleave != TensorMapInterleave.NONE + or swizzle != TensorMapSwizzle.NONE + or l2_promotion != TensorMapL2Promotion.NONE + or oob_fill != TensorMapOOBFill.NONE + ): + raise TypeError( + "Specify either options or the individual tensor map arguments, not both") + return check_or_create_options( + TensorMapDescriptorOptions, + options, + "Tensor map descriptor options", + ) + + if box_dim is None: + raise TypeError("box_dim is required unless options is provided") + + return TensorMapDescriptorOptions( + box_dim=box_dim, + element_strides=element_strides, + data_type=data_type, + interleave=interleave, + swizzle=swizzle, + l2_promotion=l2_promotion, + oob_fill=oob_fill, + ) + + +# Mapping from numpy dtype to TMA data type +_NUMPY_DTYPE_TO_TMA = { + numpy.dtype(numpy.uint8): _TMA_DT_UINT8, + numpy.dtype(numpy.uint16): _TMA_DT_UINT16, + numpy.dtype(numpy.uint32): _TMA_DT_UINT32, + numpy.dtype(numpy.int32): _TMA_DT_INT32, + numpy.dtype(numpy.uint64): _TMA_DT_UINT64, + numpy.dtype(numpy.int64): _TMA_DT_INT64, + numpy.dtype(numpy.float16): _TMA_DT_FLOAT16, + numpy.dtype(numpy.float32): _TMA_DT_FLOAT32, + numpy.dtype(numpy.float64): _TMA_DT_FLOAT64, +} + +if ml_bfloat16 is not None: + _NUMPY_DTYPE_TO_TMA[numpy.dtype(ml_bfloat16)] = _TMA_DT_BFLOAT16 + + +# Mapping from TMA data type to element size in bytes +_TMA_DATA_TYPE_SIZE = { + _TMA_DT_UINT8: 1, + _TMA_DT_UINT16: 2, + _TMA_DT_UINT32: 4, + _TMA_DT_INT32: 4, + _TMA_DT_UINT64: 8, + _TMA_DT_INT64: 8, + _TMA_DT_FLOAT16: 2, + _TMA_DT_FLOAT32: 4, + _TMA_DT_FLOAT64: 8, + _TMA_DT_BFLOAT16: 2, + _TMA_DT_FLOAT32_FTZ: 4, + _TMA_DT_TFLOAT32: 4, + _TMA_DT_TFLOAT32_FTZ: 4, +} + + +def _resolve_data_type(view, data_type): + """Resolve the TMA data type from an explicit value or the view's dtype.""" + + if data_type is not None: + if isinstance(data_type, TensorMapDataType): + return int(data_type) + dt = _normalize_tensor_map_data_type(data_type) + tma_dt = _NUMPY_DTYPE_TO_TMA.get(dt) + if tma_dt is None: + raise ValueError( + f"Unsupported dtype {dt} for TMA; " + f"supported dtypes: {list(_NUMPY_DTYPE_TO_TMA.keys())}.") + return tma_dt + + dt = view.dtype + if dt is None: + raise ValueError( + "Cannot infer TMA data type from the tensor; " + "please specify data_type explicitly") + + tma_dt = _NUMPY_DTYPE_TO_TMA.get(dt) + if tma_dt is None: + raise ValueError( + f"Unsupported dtype {dt} for TMA; " + f"supported dtypes: {list(_NUMPY_DTYPE_TO_TMA.keys())}. " + "You may also specify data_type explicitly.") + + return tma_dt + + +cdef inline bint _tma_dtype_to_dlpack( + int tma_dt, + uint8_t* out_code, + uint8_t* out_bits, + uint16_t* out_lanes, +) noexcept: + if tma_dt == _TMA_DT_UINT8: + out_code[0] = kDLUInt + out_bits[0] = 8 + out_lanes[0] = 1 + return True + if tma_dt == _TMA_DT_UINT16: + out_code[0] = kDLUInt + out_bits[0] = 16 + out_lanes[0] = 1 + return True + if tma_dt == _TMA_DT_UINT32: + out_code[0] = kDLUInt + out_bits[0] = 32 + out_lanes[0] = 1 + return True + if tma_dt == _TMA_DT_UINT64: + out_code[0] = kDLUInt + out_bits[0] = 64 + out_lanes[0] = 1 + return True + if tma_dt == _TMA_DT_INT32: + out_code[0] = kDLInt + out_bits[0] = 32 + out_lanes[0] = 1 + return True + if tma_dt == _TMA_DT_INT64: + out_code[0] = kDLInt + out_bits[0] = 64 + out_lanes[0] = 1 + return True + if tma_dt == _TMA_DT_FLOAT16: + out_code[0] = kDLFloat + out_bits[0] = 16 + out_lanes[0] = 1 + return True + if tma_dt == _TMA_DT_FLOAT32: + out_code[0] = kDLFloat + out_bits[0] = 32 + out_lanes[0] = 1 + return True + if tma_dt == _TMA_DT_FLOAT64: + out_code[0] = kDLFloat + out_bits[0] = 64 + out_lanes[0] = 1 + return True + if tma_dt == _TMA_DT_BFLOAT16: + out_code[0] = kDLBfloat + out_bits[0] = 16 + out_lanes[0] = 1 + return True + return False + + +cdef inline int _validate_tensor_map_view(view) except -1: + if not view.is_device_accessible: + raise ValueError("The tensor must be device-accessible") + + if view.ptr % 16 != 0: + raise ValueError( + f"Global memory address must be 16-byte aligned, " + f"got address 0x{view.ptr:x}") + return 0 + + +def _get_validated_view(tensor): + """Obtain a device-accessible StridedMemoryView with a 16-byte-aligned pointer.""" + if isinstance(tensor, StridedMemoryView): + view = tensor + else: + # stream_ptr=-1: no stream synchronization needed because descriptor + # creation only reads tensor metadata, it does not move data. + view = StridedMemoryView.from_any_interface(tensor, stream_ptr=-1) + _validate_tensor_map_view(view) + return view + + +def _require_view_device(view, expected_device_id, operation): + """Ensure device-local tensors match the current CUDA device. + + DLPack reports host/managed CUDA memory as ``kDLCUDAHost`` / + ``kDLCUDAManaged`` with ``device_id=0`` regardless of the current device, + so only true ``kDLCUDA`` tensors are rejected by device-id mismatch. + """ + device_type, device_id = view.__dlpack_device__() + if device_type == _kDLCUDA and device_id != expected_device_id: + raise ValueError( + f"{operation} expects tensor on device {expected_device_id}, got {device_id}") +cdef inline intptr_t _get_current_context_ptr() except? 0: + cdef cydriver.CUcontext ctx + with nogil: + HANDLE_RETURN(cydriver.cuCtxGetCurrent(&ctx)) + if ctx == NULL: + raise RuntimeError("TensorMapDescriptor requires an active CUDA context") + return ctx + + +cdef inline int _get_current_device_id() except -1: + cdef cydriver.CUdevice dev + with nogil: + HANDLE_RETURN(cydriver.cuCtxGetDevice(&dev)) + return dev + +def _compute_byte_strides(shape, strides, elem_size): + """Compute byte strides from element strides or C-contiguous fallback. + + Returns a tuple of byte strides in row-major order. + """ + if strides is not None: + return tuple(s * elem_size for s in strides) + + # C-contiguous: compute byte strides from shape, innermost first + rank = len(shape) + byte_strides = [] + stride = elem_size + for i in range(rank - 1, -1, -1): + byte_strides.append(stride) + stride *= shape[i] + byte_strides.reverse() + return tuple(byte_strides) + + +def _validate_element_strides(element_strides, rank): + """Validate or default element_strides to all-ones.""" + if element_strides is not None: + if len(element_strides) != rank: + raise ValueError( + f"element_strides must have {rank} elements, got {len(element_strides)}") + return element_strides + return (1,) * rank + + +cdef class TensorMapDescriptor: + """Describes a TMA (Tensor Memory Accelerator) tensor map for Hopper+ GPUs. + + A ``TensorMapDescriptor`` wraps the opaque 128-byte ``CUtensorMap`` struct + used by the hardware TMA unit for efficient bulk data movement between + global and shared memory. + + Public tiled descriptors are created via + :meth:`cuda.core.StridedMemoryView.as_tensor_map`. Specialized + ``_from_*`` helpers remain private while this API surface settles, and + descriptors can be passed directly to :func:`~cuda.core.launch` as a + kernel argument. + """ + + def __init__(self): + raise RuntimeError( + "TensorMapDescriptor cannot be instantiated directly. " + "Use StridedMemoryView.as_tensor_map() instead.") + + cdef void* _get_data_ptr(self): + return &self._tensor_map + + cdef int _check_context_compat(self) except -1: + cdef cydriver.CUcontext current_ctx + cdef cydriver.CUdevice current_dev + cdef int current_dev_id + if self._context == 0 and self._device_id < 0: + return 0 + with nogil: + HANDLE_RETURN(cydriver.cuCtxGetCurrent(¤t_ctx)) + if current_ctx == NULL: + raise RuntimeError("TensorMapDescriptor requires an active CUDA context") + if self._context != 0 and current_ctx != self._context: + raise RuntimeError( + "TensorMapDescriptor was created in a different CUDA context") + with nogil: + HANDLE_RETURN(cydriver.cuCtxGetDevice(¤t_dev)) + current_dev_id = current_dev + if self._device_id >= 0 and current_dev_id != self._device_id: + raise RuntimeError( + f"TensorMapDescriptor belongs to device {self._device_id}, " + f"but current device is {current_dev_id}") + return 0 + + @property + def device(self) -> Device | None: + """Return the :obj:`~cuda.core.Device` associated with this descriptor.""" + if self._device_id >= 0: + from cuda.core._device import Device + return Device(self._device_id) + return None + + @classmethod + def _from_tiled(cls, view, box_dim=None, *, + options=None, + element_strides=None, + data_type=None, + interleave=TensorMapInterleave.NONE, + swizzle=TensorMapSwizzle.NONE, + l2_promotion=TensorMapL2Promotion.NONE, + oob_fill=TensorMapOOBFill.NONE): + """Create a tiled TMA descriptor from a validated view. + + Parameters + ---------- + view : StridedMemoryView + A device-accessible view with a 16-byte-aligned pointer. + box_dim : tuple of int, optional + The size of each tile dimension (in elements). Must have the + same rank as the tensor and each value must be in [1, 256]. + Specified in the same (row-major) order as the tensor shape. + Required unless ``options`` is provided. + options : TensorMapDescriptorOptions or mapping, optional + Bundled tiled-descriptor options. When provided, do not also pass + ``box_dim`` or the individual option kwargs. + element_strides : tuple of int, optional + Per-dimension element traversal strides. Default is all 1s. + Specified in the same (row-major) order as the tensor shape. + data_type : dtype-like or TensorMapDataType, optional + Explicit dtype override. If ``None``, inferred from the tensor's + dtype. Prefer NumPy or ``ml_dtypes`` dtype objects; the enum is + accepted for compatibility. + interleave : TensorMapInterleave + Interleave layout. Default ``NONE``. + swizzle : TensorMapSwizzle + Swizzle mode. Default ``NONE``. + l2_promotion : TensorMapL2Promotion + L2 promotion mode. Default ``NONE``. + oob_fill : TensorMapOOBFill + Out-of-bounds fill mode. Default ``NONE``. + + Returns + ------- + TensorMapDescriptor + + Raises + ------ + ValueError + If the tensor rank is outside [1, 5], the pointer is not + 16-byte aligned, or dimension/stride constraints are violated. + """ + cdef TensorMapDescriptor desc = cls.__new__(cls) + + opts = _coerce_tensor_map_descriptor_options( + box_dim, + options, + element_strides=element_strides, + data_type=data_type, + interleave=interleave, + swizzle=swizzle, + l2_promotion=l2_promotion, + oob_fill=oob_fill, + ) + box_dim = opts.box_dim + element_strides = opts.element_strides + data_type = opts.data_type + interleave = opts.interleave + swizzle = opts.swizzle + l2_promotion = opts.l2_promotion + oob_fill = opts.oob_fill + + _validate_tensor_map_view(view) + # Keep both the original tensor object and the validated view alive. + # For DLPack exporters, the view may hold the owning capsule whose + # deleter can free the backing allocation when released. + desc._source_ref = view.exporting_obj + desc._view_ref = view + desc._context = _get_current_context_ptr() + desc._device_id = _get_current_device_id() + _require_view_device(view, desc._device_id, "TensorMapDescriptor._from_tiled") + + tma_dt = _resolve_data_type(view, data_type) + cdef int c_data_type_int = tma_dt + cdef cydriver.CUtensorMapDataType c_data_type = c_data_type_int + + cdef intptr_t global_address = view.ptr + shape = view.shape + + cdef int rank = len(shape) + if rank < 1 or rank > 5: + raise ValueError( + f"Tensor rank must be between 1 and 5, got {rank}") + + if len(box_dim) != rank: + raise ValueError( + f"box_dim must have {rank} elements (same as tensor rank), " + f"got {len(box_dim)}") + + for i, bd in enumerate(box_dim): + if bd < 1 or bd > 256: + raise ValueError( + f"box_dim[{i}] must be in [1, 256], got {bd}") + + cdef bint elem_strides_provided = element_strides is not None + element_strides = _validate_element_strides(element_strides, rank) + + # Reuse CCCL/libcu++'s DLPack -> CUtensorMap conversion when possible. + # This avoids maintaining a second, independent validation/encoding implementation. + cdef uint8_t dl_code + cdef uint8_t dl_bits + cdef uint16_t dl_lanes + cdef int64_t c_shape[5] + cdef int64_t c_strides[5] + cdef int c_box_sizes[5] + cdef int c_elem_strides[5] + cdef const int64_t* c_strides_ptr + cdef const int* c_elem_strides_ptr + cdef char errbuf[512] + cdef int i_cccl + cdef int device_type + cdef int c_device_id + cdef int dl_device_type + cdef int dl_device_id + cdef int c_cccl_interleave_int + cdef int c_cccl_swizzle_int + cdef int c_cccl_l2_promotion_int + cdef int c_cccl_oob_fill_int + cdef int rc + if _tma_dtype_to_dlpack(tma_dt, &dl_code, &dl_bits, &dl_lanes): + c_strides_ptr = NULL + c_elem_strides_ptr = NULL + errbuf[0] = 0 + + for i_cccl in range(rank): + c_shape[i_cccl] = shape[i_cccl] + c_box_sizes[i_cccl] = box_dim[i_cccl] + if elem_strides_provided: + c_elem_strides[i_cccl] = element_strides[i_cccl] + + if view.strides is not None: + for i_cccl in range(rank): + c_strides[i_cccl] = view.strides[i_cccl] + c_strides_ptr = &c_strides[0] + + if elem_strides_provided: + c_elem_strides_ptr = &c_elem_strides[0] + + dl_device_type, dl_device_id = view.__dlpack_device__() + device_type = dl_device_type + c_device_id = dl_device_id + c_cccl_interleave_int = int(interleave) + c_cccl_swizzle_int = int(swizzle) + c_cccl_l2_promotion_int = int(l2_promotion) + c_cccl_oob_fill_int = int(oob_fill) + + with nogil: + rc = cuda_core_cccl_make_tma_descriptor_tiled( + &desc._tensor_map, + global_address, + device_type, + c_device_id, + rank, + &c_shape[0], + c_strides_ptr, + dl_code, + dl_bits, + dl_lanes, + &c_box_sizes[0], + c_elem_strides_ptr, + c_cccl_interleave_int, + c_cccl_swizzle_int, + c_cccl_l2_promotion_int, + c_cccl_oob_fill_int, + &errbuf[0], + sizeof(errbuf), + ) + + if rc == 0: + desc._repr_info = { + "method": "tiled", + "rank": rank, + "data_type": TensorMapDataType(tma_dt), + "swizzle": swizzle, + } + return desc + + msg = errbuf[:].split(b"\0", 1)[0].decode("utf-8", errors="replace") + # If CCCL isn't available at build time, fall back to the direct + # driver API path to preserve functionality on older toolchains. + if "not available at build time" not in msg: + raise ValueError(f"Failed to build TMA descriptor via CCCL: {msg}") + + cdef int elem_size = _TMA_DATA_TYPE_SIZE[tma_dt] + byte_strides = _compute_byte_strides(shape, view.strides, elem_size) + + # Reverse dimensions for column-major cuTensorMap convention + # Python/DLPack: row-major (dim 0 = outermost) + # cuTensorMap: column-major (dim 0 = innermost) + cdef uint64_t[5] c_global_dim + cdef uint64_t[4] c_global_strides # rank - 1 elements + cdef uint32_t[5] c_box_dim + cdef uint32_t[5] c_element_strides + cdef int i_c + + for i_c in range(rank): + # Reverse: Python dim i -> cuTensorMap dim (rank - 1 - i) + c_global_dim[i_c] = shape[rank - 1 - i_c] + c_box_dim[i_c] = box_dim[rank - 1 - i_c] + c_element_strides[i_c] = element_strides[rank - 1 - i_c] + + # globalStrides: rank-1 elements (byte strides for dims 1..N-1 in col-major order) + # The innermost stride (dim 0) is implicit = element size + for i_c in range(rank - 1): + c_global_strides[i_c] = byte_strides[rank - 2 - i_c] + + cdef uint32_t c_rank = rank + cdef int c_interleave_int = int(interleave) + cdef int c_swizzle_int = int(swizzle) + cdef int c_l2_promotion_int = int(l2_promotion) + cdef int c_oob_fill_int = int(oob_fill) + cdef cydriver.CUtensorMapInterleave c_interleave = c_interleave_int + cdef cydriver.CUtensorMapSwizzle c_swizzle = c_swizzle_int + cdef cydriver.CUtensorMapL2promotion c_l2_promotion = c_l2_promotion_int + cdef cydriver.CUtensorMapFloatOOBfill c_oob_fill = c_oob_fill_int + + with nogil: + HANDLE_RETURN(cydriver.cuTensorMapEncodeTiled( + &desc._tensor_map, + c_data_type, + c_rank, + global_address, + c_global_dim, + c_global_strides, + c_box_dim, + c_element_strides, + c_interleave, + c_swizzle, + c_l2_promotion, + c_oob_fill, + )) + + desc._repr_info = { + "method": "tiled", + "rank": rank, + "data_type": TensorMapDataType(tma_dt), + "swizzle": swizzle, + } + + return desc + + @classmethod + def _from_im2col(cls, view, pixel_box_lower_corner, pixel_box_upper_corner, + channels_per_pixel, pixels_per_column, *, + element_strides=None, + data_type=None, + interleave=TensorMapInterleave.NONE, + swizzle=TensorMapSwizzle.NONE, + l2_promotion=TensorMapL2Promotion.NONE, + oob_fill=TensorMapOOBFill.NONE): + """Create an im2col TMA descriptor from a validated view. + + Im2col layout is used for convolution-style data access patterns. + + Parameters + ---------- + view : StridedMemoryView + A device-accessible view with a 16-byte-aligned pointer. + pixel_box_lower_corner : tuple of int + Lower corner of the pixel bounding box for each spatial + dimension (rank - 2 elements). Specified in row-major order + matching the tensor's spatial dimensions. + pixel_box_upper_corner : tuple of int + Upper corner of the pixel bounding box for each spatial + dimension (rank - 2 elements). Specified in row-major order + matching the tensor's spatial dimensions. + channels_per_pixel : int + Number of channels per pixel. + pixels_per_column : int + Number of pixels per column. + element_strides : tuple of int, optional + Per-dimension element traversal strides. Default is all 1s. + data_type : dtype-like or TensorMapDataType, optional + Explicit dtype override. If ``None``, inferred from the tensor's + dtype. Prefer NumPy or ``ml_dtypes`` dtype objects; the enum is + accepted for compatibility. + interleave : TensorMapInterleave + Interleave layout. Default ``NONE``. + swizzle : TensorMapSwizzle + Swizzle mode. Default ``NONE``. + l2_promotion : TensorMapL2Promotion + L2 promotion mode. Default ``NONE``. + oob_fill : TensorMapOOBFill + Out-of-bounds fill mode. Default ``NONE``. + + Returns + ------- + TensorMapDescriptor + + Raises + ------ + ValueError + If the tensor rank is outside [3, 5], the pointer is not + 16-byte aligned, or other constraints are violated. + """ + cdef TensorMapDescriptor desc = cls.__new__(cls) + + _validate_tensor_map_view(view) + desc._source_ref = view.exporting_obj + desc._view_ref = view + desc._context = _get_current_context_ptr() + desc._device_id = _get_current_device_id() + _require_view_device(view, desc._device_id, "TensorMapDescriptor._from_im2col") + + tma_dt = _resolve_data_type(view, data_type) + cdef int c_data_type_int = tma_dt + cdef cydriver.CUtensorMapDataType c_data_type = c_data_type_int + + cdef intptr_t global_address = view.ptr + shape = view.shape + + cdef int rank = len(shape) + if rank < 3 or rank > 5: + raise ValueError( + f"Im2col tensor rank must be between 3 and 5, got {rank}") + + cdef int n_spatial = rank - 2 + if len(pixel_box_lower_corner) != n_spatial: + raise ValueError( + f"pixel_box_lower_corner must have {n_spatial} elements " + f"(rank - 2), got {len(pixel_box_lower_corner)}") + if len(pixel_box_upper_corner) != n_spatial: + raise ValueError( + f"pixel_box_upper_corner must have {n_spatial} elements " + f"(rank - 2), got {len(pixel_box_upper_corner)}") + + element_strides = _validate_element_strides(element_strides, rank) + + cdef int elem_size = _TMA_DATA_TYPE_SIZE[tma_dt] + byte_strides = _compute_byte_strides(shape, view.strides, elem_size) + + # Reverse all dimension arrays for column-major convention + cdef uint64_t[5] c_global_dim + cdef uint64_t[4] c_global_strides + cdef uint32_t[5] c_element_strides + cdef int[3] c_pixel_box_lower # max 3 spatial dims (rank 5 - 2) + cdef int[3] c_pixel_box_upper + cdef int i_c + + for i_c in range(3): + c_pixel_box_lower[i_c] = 0 + c_pixel_box_upper[i_c] = 0 + + for i_c in range(rank): + c_global_dim[i_c] = shape[rank - 1 - i_c] + c_element_strides[i_c] = element_strides[rank - 1 - i_c] + + for i_c in range(rank - 1): + c_global_strides[i_c] = byte_strides[rank - 2 - i_c] + + # Reverse spatial dimensions for lower/upper corners + for i_c in range(n_spatial): + c_pixel_box_lower[i_c] = pixel_box_lower_corner[n_spatial - 1 - i_c] + c_pixel_box_upper[i_c] = pixel_box_upper_corner[n_spatial - 1 - i_c] + + cdef uint32_t c_rank = rank + cdef uint32_t c_channels = channels_per_pixel + cdef uint32_t c_pixels = pixels_per_column + cdef int c_interleave_int = int(interleave) + cdef int c_swizzle_int = int(swizzle) + cdef int c_l2_promotion_int = int(l2_promotion) + cdef int c_oob_fill_int = int(oob_fill) + cdef cydriver.CUtensorMapInterleave c_interleave = c_interleave_int + cdef cydriver.CUtensorMapSwizzle c_swizzle = c_swizzle_int + cdef cydriver.CUtensorMapL2promotion c_l2_promotion = c_l2_promotion_int + cdef cydriver.CUtensorMapFloatOOBfill c_oob_fill = c_oob_fill_int + + with nogil: + HANDLE_RETURN(cydriver.cuTensorMapEncodeIm2col( + &desc._tensor_map, + c_data_type, + c_rank, + global_address, + c_global_dim, + c_global_strides, + c_pixel_box_lower, + c_pixel_box_upper, + c_channels, + c_pixels, + c_element_strides, + c_interleave, + c_swizzle, + c_l2_promotion, + c_oob_fill, + )) + + desc._repr_info = { + "method": "im2col", + "rank": rank, + "data_type": TensorMapDataType(tma_dt), + "swizzle": swizzle, + } + + return desc + + @classmethod + def _from_im2col_wide(cls, view, pixel_box_lower_corner_width, pixel_box_upper_corner_width, + channels_per_pixel, pixels_per_column, *, + element_strides=None, + data_type=None, + interleave=TensorMapInterleave.NONE, + mode=TensorMapIm2ColWideMode.W, + swizzle=TensorMapSwizzle.SWIZZLE_128B, + l2_promotion=TensorMapL2Promotion.NONE, + oob_fill=TensorMapOOBFill.NONE): + """Create an im2col-wide TMA descriptor from a validated view. + + Im2col-wide layout loads elements exclusively along the W (width) + dimension. This variant is supported on compute capability 10.0+ + (Blackwell and later). + + Parameters + ---------- + view : StridedMemoryView + A device-accessible view with a 16-byte-aligned pointer. + pixel_box_lower_corner_width : int + Lower corner of the pixel bounding box along the W dimension. + pixel_box_upper_corner_width : int + Upper corner of the pixel bounding box along the W dimension. + channels_per_pixel : int + Number of channels per pixel. + pixels_per_column : int + Number of pixels per column. + element_strides : tuple of int, optional + Per-dimension element traversal strides. Default is all 1s. + data_type : dtype-like or TensorMapDataType, optional + Explicit dtype override. If ``None``, inferred from the tensor's + dtype. Prefer NumPy or ``ml_dtypes`` dtype objects; the enum is + accepted for compatibility. + interleave : TensorMapInterleave + Interleave layout. Default ``NONE``. + mode : TensorMapIm2ColWideMode + Im2col wide mode. Default ``W``. + swizzle : TensorMapSwizzle + Swizzle mode. Default ``SWIZZLE_128B``. + l2_promotion : TensorMapL2Promotion + L2 promotion mode. Default ``NONE``. + oob_fill : TensorMapOOBFill + Out-of-bounds fill mode. Default ``NONE``. + + Returns + ------- + TensorMapDescriptor + + Raises + ------ + ValueError + If the tensor rank is outside [3, 5], the pointer is not + 16-byte aligned, or other constraints are violated. + """ + IF CUDA_CORE_BUILD_MAJOR < 13: + raise RuntimeError( + "TensorMapDescriptor._from_im2col_wide requires a CUDA 13+ build") + ELSE: + cdef TensorMapDescriptor desc = cls.__new__(cls) + + _validate_tensor_map_view(view) + desc._source_ref = view.exporting_obj + desc._view_ref = view + desc._context = _get_current_context_ptr() + desc._device_id = _get_current_device_id() + _require_view_device(view, desc._device_id, "TensorMapDescriptor._from_im2col_wide") + + tma_dt = _resolve_data_type(view, data_type) + cdef int c_data_type_int = tma_dt + cdef cydriver.CUtensorMapDataType c_data_type = c_data_type_int + + cdef intptr_t global_address = view.ptr + shape = view.shape + + cdef int rank = len(shape) + if rank < 3 or rank > 5: + raise ValueError( + f"Im2col-wide tensor rank must be between 3 and 5, got {rank}") + + element_strides = _validate_element_strides(element_strides, rank) + + cdef int elem_size = _TMA_DATA_TYPE_SIZE[tma_dt] + byte_strides = _compute_byte_strides(shape, view.strides, elem_size) + + # Reverse all dimension arrays for column-major convention + cdef uint64_t[5] c_global_dim + cdef uint64_t[4] c_global_strides + cdef uint32_t[5] c_element_strides + cdef int i_c + + for i_c in range(rank): + c_global_dim[i_c] = shape[rank - 1 - i_c] + c_element_strides[i_c] = element_strides[rank - 1 - i_c] + + for i_c in range(rank - 1): + c_global_strides[i_c] = byte_strides[rank - 2 - i_c] + + cdef uint32_t c_rank = rank + cdef int c_lower_w = pixel_box_lower_corner_width + cdef int c_upper_w = pixel_box_upper_corner_width + cdef uint32_t c_channels = channels_per_pixel + cdef uint32_t c_pixels = pixels_per_column + cdef int c_interleave_int = int(interleave) + cdef int c_mode_int = int(mode) + cdef int c_swizzle_int = int(swizzle) + cdef int c_l2_promotion_int = int(l2_promotion) + cdef int c_oob_fill_int = int(oob_fill) + cdef cydriver.CUtensorMapInterleave c_interleave = c_interleave_int + cdef cydriver.CUtensorMapIm2ColWideMode c_mode = c_mode_int + cdef cydriver.CUtensorMapSwizzle c_swizzle = c_swizzle_int + cdef cydriver.CUtensorMapL2promotion c_l2_promotion = c_l2_promotion_int + cdef cydriver.CUtensorMapFloatOOBfill c_oob_fill = c_oob_fill_int + + with nogil: + HANDLE_RETURN(cydriver.cuTensorMapEncodeIm2colWide( + &desc._tensor_map, + c_data_type, + c_rank, + global_address, + c_global_dim, + c_global_strides, + c_lower_w, + c_upper_w, + c_channels, + c_pixels, + c_element_strides, + c_interleave, + c_mode, + c_swizzle, + c_l2_promotion, + c_oob_fill, + )) + + desc._repr_info = { + "method": "im2col_wide", + "rank": rank, + "data_type": TensorMapDataType(tma_dt), + "swizzle": swizzle, + } + + return desc + + def replace_address(self, tensor: object) -> None: + """Replace the global memory address in this tensor map descriptor. + + This is useful when the tensor data has been reallocated but the + shape, strides, and other parameters remain the same. + + Parameters + ---------- + tensor : object + Any object supporting DLPack or ``__cuda_array_interface__``, + or a :obj:`~cuda.core.StridedMemoryView`. Must refer to + device-accessible memory with a 16-byte-aligned pointer. + """ + self._check_context_compat() + view = _get_validated_view(tensor) + _require_view_device(view, self._device_id, "replace_address") + + cdef intptr_t global_address = view.ptr + + with nogil: + HANDLE_RETURN(cydriver.cuTensorMapReplaceAddress( + &self._tensor_map, + global_address, + )) + + # Update the source reference only after the driver call succeeds, + # so we don't drop the old tensor (risking a dangling pointer in the + # CUtensorMap struct) if the call fails. + self._source_ref = view.exporting_obj + self._view_ref = view + + def __repr__(self) -> str: + info = self._repr_info + if info is None: + return "TensorMapDescriptor()" + parts = [] + if "method" in info: + parts.append(info["method"]) + if "rank" in info: + parts.append(f"rank={info['rank']}") + if "data_type" in info: + parts.append(f"dtype={info['data_type'].name}") + if "swizzle" in info: + parts.append(f"swizzle={info['swizzle'].name}") + return f"TensorMapDescriptor({', '.join(parts)})" diff --git a/cuda_core/cuda/core/_utils/__init__.py b/cuda_core/cuda/core/_utils/__init__.py index bd8faf14fa9..79599c77db0 100644 --- a/cuda_core/cuda/core/_utils/__init__.py +++ b/cuda_core/cuda/core/_utils/__init__.py @@ -1,3 +1,3 @@ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 diff --git a/cuda_core/cuda/core/_utils/_weak_handles.pyi b/cuda_core/cuda/core/_utils/_weak_handles.pyi new file mode 100644 index 00000000000..3cf095d7b87 --- /dev/null +++ b/cuda_core/cuda/core/_utils/_weak_handles.pyi @@ -0,0 +1,55 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_utils/_weak_handles.pyx + +"""Test-only weak handles for resource-handle lifetime checks. + +This module is **not** part of the public ``cuda.core`` API. It is built into +the package (like other private ``_utils`` modules) purely so the test suite can +observe, deterministically, when the strong references that keep a CUDA resource +alive have all been released -- without relying on driver- or hardware-specific +side effects (for example, whether freed device memory happens to remain +readable). + +Every resource handle is owned by a C++ ``std::shared_ptr``. A **weak handle** +is a non-owning ``std::weak_ptr`` observer of that control block: truthy while +some strong owner remains, falsy once the last one is gone. Use :func:`weak_handle` +to obtain a weak handle from a supported front-end object. + +To support another type, add a ``cdef _weak_from_`` that reads its ``cdef`` +handle field (see ``*.pxd``), assigns to :ctype:`OpaqueHandle`, and extend the +``isinstance`` chain in :func:`weak_handle`. Types whose slots hold arbitrary +Python owners via ``make_opaque_py`` are not covered here -- use +:class:`weakref.ref` on a weak-referenceable owner object in tests instead. +""" +from __future__ import annotations + + +class WeakHandle: + """Non-owning weak handle for a resource's shared control block. + + Truthy while some strong owner of the underlying resource handle remains, + falsy once the last strong reference is released. Obtain instances via + :func:`weak_handle` rather than constructing directly. + """ + + def __bool__(self): + ... + + def expired(self): + """Return ``True`` once every strong owner of the handle is gone.""" + + def use_count(self): + """Number of strong owners currently sharing the handle.""" + +def weak_handle(obj): + """Return a :class:`WeakHandle` observing the resource behind ``obj``. + + Currently supports :class:`~cuda.core.Buffer` (device allocation handle). + See the module docstring for how to add more types. + + Raises + ------ + ValueError + If ``obj`` is a :class:`~cuda.core.Buffer` with no active allocation. + TypeError + If ``obj`` is not a supported type. + """ \ No newline at end of file diff --git a/cuda_core/cuda/core/_utils/_weak_handles.pyx b/cuda_core/cuda/core/_utils/_weak_handles.pyx new file mode 100644 index 00000000000..65737b958a6 --- /dev/null +++ b/cuda_core/cuda/core/_utils/_weak_handles.pyx @@ -0,0 +1,106 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""Test-only weak handles for resource-handle lifetime checks. + +This module is **not** part of the public ``cuda.core`` API. It is built into +the package (like other private ``_utils`` modules) purely so the test suite can +observe, deterministically, when the strong references that keep a CUDA resource +alive have all been released -- without relying on driver- or hardware-specific +side effects (for example, whether freed device memory happens to remain +readable). + +Every resource handle is owned by a C++ ``std::shared_ptr``. A **weak handle** +is a non-owning ``std::weak_ptr`` observer of that control block: truthy while +some strong owner remains, falsy once the last one is gone. Use :func:`weak_handle` +to obtain a weak handle from a supported front-end object. + +To support another type, add a ``cdef _weak_from_`` that reads its ``cdef`` +handle field (see ``*.pxd``), assigns to :ctype:`OpaqueHandle`, and extend the +``isinstance`` chain in :func:`weak_handle`. Types whose slots hold arbitrary +Python owners via ``make_opaque_py`` are not covered here -- use +:class:`weakref.ref` on a weak-referenceable owner object in tests instead. +""" + +from cuda.core._memory._buffer cimport Buffer +from cuda.core._resource_handles cimport OpaqueHandle + + +# Cython cannot spell ``weak_ptr[const void]`` inline (the ``const void`` +# template argument fails to parse), so the weak type and its one constructor +# are provided by a small inline C++ shim local to this test-only module. This +# keeps the production resource_handles translation units untouched. +cdef extern from *: + """ + #include + namespace cuda_core_test { + using OpaqueWeakHandle = std::weak_ptr; + static inline OpaqueWeakHandle make_weak(const std::shared_ptr& h) { + return OpaqueWeakHandle(h); + } + } // namespace cuda_core_test + """ + cppclass OpaqueWeakHandle "cuda_core_test::OpaqueWeakHandle": + OpaqueWeakHandle() + bint expired() + long use_count() + OpaqueWeakHandle make_weak "cuda_core_test::make_weak" (const OpaqueHandle& h) + + +cdef class WeakHandle: + """Non-owning weak handle for a resource's shared control block. + + Truthy while some strong owner of the underlying resource handle remains, + falsy once the last strong reference is released. Obtain instances via + :func:`weak_handle` rather than constructing directly. + """ + + cdef OpaqueWeakHandle _w + + def __bool__(self): + return not self._w.expired() + + def expired(self): + """Return ``True`` once every strong owner of the handle is gone.""" + return self._w.expired() + + def use_count(self): + """Number of strong owners currently sharing the handle.""" + return self._w.use_count() + + +cdef WeakHandle _weak_from_opaque(OpaqueHandle h): + # Build the weak handle from a (temporary) strong handle. The strong copy + # lives only for the duration of this call, so it does not perturb the + # reference count the weak handle later reports. + cdef WeakHandle wh = WeakHandle.__new__(WeakHandle) + wh._w = make_weak(h) + return wh + + +cdef WeakHandle _weak_from_buffer(Buffer buf): + cdef OpaqueHandle h = buf._h_ptr + if not h: + raise ValueError("Buffer has no active allocation") + return _weak_from_opaque(h) + + +def weak_handle(obj): + """Return a :class:`WeakHandle` observing the resource behind ``obj``. + + Currently supports :class:`~cuda.core.Buffer` (device allocation handle). + See the module docstring for how to add more types. + + Raises + ------ + ValueError + If ``obj`` is a :class:`~cuda.core.Buffer` with no active allocation. + TypeError + If ``obj`` is not a supported type. + """ + if isinstance(obj, Buffer): + return _weak_from_buffer(obj) + raise TypeError( + f"weak_handle() does not support {type(obj).__name__!r}; " + "supported types: Buffer" + ) diff --git a/cuda_core/cuda/core/_utils/_wsl_locale.pyi b/cuda_core/cuda/core/_utils/_wsl_locale.pyi new file mode 100644 index 00000000000..267bdf244f0 --- /dev/null +++ b/cuda_core/cuda/core/_utils/_wsl_locale.pyi @@ -0,0 +1,20 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_utils/_wsl_locale.pyx + +from __future__ import annotations + + +class c_locale_guard: + """Context manager that pins the calling thread to the "C" locale. + + Uses POSIX newlocale/uselocale/freelocale so other threads' view of the + locale is unaffected. Restores the previous thread locale on exit. + """ + + def __cinit__(self) -> None: + ... + + def __enter__(self): + ... + + def __exit__(self, exc_type, exc_val, exc_tb): + ... \ No newline at end of file diff --git a/cuda_core/cuda/core/_utils/_wsl_locale.pyx b/cuda_core/cuda/core/_utils/_wsl_locale.pyx new file mode 100644 index 00000000000..c5d087cd28c --- /dev/null +++ b/cuda_core/cuda/core/_utils/_wsl_locale.pyx @@ -0,0 +1,53 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + + +# WSL-specific locale guard, used by cuda.core.system.get_process_name() to +# work around a bug in NVML's WSL implementation where nvmlSystemGetProcessName +# returns mojibake when the calling thread is in a non-"C" locale. See +# get_process_name() for the full backstory. +# +# This module is only compiled on Linux (build_hooks.py excludes it on Windows) +# because it uses the POSIX per-thread locale APIs (newlocale/uselocale/ +# freelocale), which are not available on MSVC. Callers must guard imports of +# this module with try/except ImportError. + + +cdef extern from "locale.h" nogil: + ctypedef void *locale_t + int LC_ALL_MASK + locale_t newlocale(int category_mask, const char *locale, locale_t base) + locale_t uselocale(locale_t newloc) + void freelocale(locale_t locobj) + + +cdef class c_locale_guard: + """Context manager that pins the calling thread to the "C" locale. + + Uses POSIX newlocale/uselocale/freelocale so other threads' view of the + locale is unaffected. Restores the previous thread locale on exit. + """ + cdef locale_t _c_locale + cdef locale_t _prev_locale + cdef bint _active + + def __cinit__(self) -> None: + self._c_locale = 0 + self._prev_locale = 0 + self._active = False + + def __enter__(self): + self._c_locale = newlocale(LC_ALL_MASK, b"C", 0) + if self._c_locale == 0: + raise RuntimeError("Failed to create C locale") + self._prev_locale = uselocale(self._c_locale) + self._active = True + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + if self._active: + uselocale(self._prev_locale) + freelocale(self._c_locale) + self._active = False + return False diff --git a/cuda_core/cuda/core/_utils/clear_error_support.py b/cuda_core/cuda/core/_utils/clear_error_support.py index 0410e7aa2f4..a9e5af86f68 100644 --- a/cuda_core/cuda/core/_utils/clear_error_support.py +++ b/cuda_core/cuda/core/_utils/clear_error_support.py @@ -1,19 +1,23 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-License-Identifier: Apache-2.0 +from __future__ import annotations -def assert_type(obj, expected_type): +from typing import NoReturn + + +def assert_type(obj: object, expected_type: type) -> None: """Ensure obj is of expected_type, else raise AssertionError with a clear message.""" if not isinstance(obj, expected_type): raise TypeError(f"Expected type {expected_type.__name__}, but got {type(obj).__name__}") -def assert_type_str_or_bytes_like(obj): +def assert_type_str_or_bytes_like(obj: object) -> None: """Ensure obj is of type str or bytes, else raise AssertionError with a clear message.""" 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(): +def raise_code_path_meant_to_be_unreachable() -> NoReturn: raise RuntimeError("This code path is meant to be unreachable.") diff --git a/cuda_core/cuda/core/_utils/cuda_utils.pxd b/cuda_core/cuda/core/_utils/cuda_utils.pxd index 478ce705af4..11e464e6381 100644 --- a/cuda_core/cuda/core/_utils/cuda_utils.pxd +++ b/cuda_core/cuda/core/_utils/cuda_utils.pxd @@ -4,7 +4,7 @@ cimport cpython from cpython.object cimport PyObject -from libc.stdint cimport int64_t, int32_t +from libc.stdint cimport int64_t, int32_t, uint8_t, uint16_t, uint32_t from cuda.bindings cimport cydriver, cynvrtc, cynvvm, cynvjitlink @@ -25,6 +25,11 @@ cdef int HANDLE_RETURN_NVJITLINK( cynvjitlink.nvJitLinkHandle handle, cynvjitlink.nvJitLinkResult err) except?-1 nogil +# Helper for retrieving the current CUDA device. Raises if no active context +# is bound to the calling thread. +cdef int _get_current_device_id() except? -1 + + # TODO: stop exposing these within the codebase? cpdef int _check_driver_error(cydriver.CUresult error) except?-1 nogil cpdef int _check_runtime_error(error) except?-1 @@ -33,6 +38,8 @@ cpdef int _check_nvrtc_error(error) except?-1 cpdef check_or_create_options(type cls, options, str options_description=*, bint keep_none=*) +cpdef tuple _parse_fill_value(value) + # Create low-level externs so Cython won't "helpfully" handle reference counting # for us. Prefixing with an underscore to distinguish it from the definition in diff --git a/cuda_core/cuda/core/_utils/cuda_utils.pyi b/cuda_core/cuda/core/_utils/cuda_utils.pyi new file mode 100644 index 00000000000..87067927724 --- /dev/null +++ b/cuda_core/cuda/core/_utils/cuda_utils.pyi @@ -0,0 +1,144 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_utils/cuda_utils.pyx + +from __future__ import annotations + +from collections import namedtuple +from typing import Any, Callable + +from cuda.bindings import cydriver +from cuda.bindings import driver as driver +from cuda.bindings import nvrtc as nvrtc +from cuda.bindings import runtime as runtime + + +class CUDAError(Exception): + ... + +class NVRTCError(CUDAError): + ... + +class Transaction: + """ + A context manager for transactional operations with undo capability. + + The Transaction class allows you to register undo actions (callbacks) that will be executed + if the transaction is not committed before exiting the context. This is useful for managing + resources or operations that need to be rolled back in case of errors or early exits. + + Usage: + with Transaction() as txn: + txn.append(some_cleanup_function, arg1, arg2) + # ... perform operations ... + txn.commit() # Disarm undo actions; nothing will be rolled back on exit + + Methods: + append(fn, *args, **kwargs): Register an undo action to be called on rollback. + commit(): Disarm all undo actions; nothing will be rolled back on exit. + """ + + def __init__(self) -> None: + ... + + def __enter__(self): + ... + + def __exit__(self, exc_type, exc, tb): + ... + + def append(self, fn: Callable[..., Any], /, *args: Any, **kwargs) -> None: + """ + Register an undo action (runs if the with-block exits without commit()). + Values are bound now via partial so late mutations don't bite you. + """ + + def commit(self) -> None: + """ + Disarm all undo actions. After this, exiting the with-block does nothing. + """ +_keep_driver_in_stub: 'driver.CUresult' +_keep_nvrtc_in_stub: 'nvrtc.nvrtcResult' +_keep_runtime_in_stub: 'runtime.cudaError_t' +ComputeCapability = namedtuple('ComputeCapability', ('major', 'minor')) +_fork_warning_checked = False + +def _check_driver_error(error: cydriver.CUresult) -> int: + ... + +def _check_runtime_error(error) -> int: + ... + +def _check_nvrtc_error(error, handle=None) -> int: + ... + +def check_or_create_options(cls: type, options: object, options_description: str='', keep_none: bool=False) -> object: + """ + Create the specified options dataclass from a dictionary of options or None. + """ + +def _parse_fill_value(value) -> tuple: + """Parse a fill/memset value into (raw_value, element_size). + + Parameters + ---------- + value : int or buffer-protocol object + - int: Must be in range [0, 256). Treated as 1-byte fill. + - bytes or buffer-protocol: Must be 1, 2, or 4 bytes. + + Returns + ------- + tuple of (int, int) + (raw_value, element_size) where element_size is 1, 2, or 4. + + Raises + ------ + OverflowError + If int value is outside [0, 256). + TypeError + If value is not an int and does not support the buffer protocol. + ValueError + If value byte length is not 1, 2, or 4. + """ + +def cast_to_3_tuple(label: str, cfg: int | tuple[int, ...]) -> tuple[int, int, int]: + ... + +def handle_return(result: tuple[Any, ...], handle: object=None) -> Any: + ... + +def _handle_boolean_option(option: bool) -> str: + """ + Convert a boolean option to a string representation. + """ + +def precondition(checker: Callable[..., None], what: str='') -> Callable[..., Any]: + """ + A decorator that adds checks to ensure any preconditions are met. + + Args: + checker: The function to call to check whether the preconditions are met. It has + the same signature as the wrapped function with the addition of the keyword argument `what`. + what: A string that is passed in to `checker` to provide context information. + + Returns: + Callable: A decorator that creates the wrapping. + """ + +def is_sequence(obj: object) -> bool: + """ + Check if the given object is a sequence (list or tuple). + """ + +def is_nested_sequence(obj: object) -> bool: + """ + Check if the given object is a nested sequence (list or tuple with atleast one list or tuple element). + """ + +def reset_fork_warning() -> None: + """Reset the fork warning check flag for testing purposes. + + This function is intended for use in tests to allow multiple test runs + to check the warning behavior. + """ + +def check_multiprocessing_start_method() -> None: + """Check if multiprocessing start method is 'fork' and warn if so.""" \ No newline at end of file diff --git a/cuda_core/cuda/core/_utils/cuda_utils.pyx b/cuda_core/cuda/core/_utils/cuda_utils.pyx index 3134308b55a..318d4466bee 100644 --- a/cuda_core/cuda/core/_utils/cuda_utils.pyx +++ b/cuda_core/cuda/core/_utils/cuda_utils.pyx @@ -4,25 +4,29 @@ import functools from functools import partial -import importlib.metadata import multiprocessing import platform import warnings from collections import namedtuple from collections.abc import Sequence from contextlib import ExitStack -from typing import Callable +from typing import Any, Callable -try: - from cuda.bindings import driver, nvrtc, runtime -except ImportError: - from cuda import cuda as driver - from cuda import cudart as runtime - from cuda import nvrtc +from cuda.bindings import driver as driver, nvrtc as nvrtc, runtime as runtime + +# Module-level annotations that reference `driver`, `nvrtc`, and `runtime` so +# that stubgen-pyx keeps these imports in the generated `.pyi` (it would +# otherwise trim them as unused). These names are not assigned, so they only +# affect __annotations__ and have no runtime cost. +_keep_driver_in_stub: 'driver.CUresult' +_keep_nvrtc_in_stub: 'nvrtc.nvrtcResult' +_keep_runtime_in_stub: 'runtime.cudaError_t' from cuda.bindings.nvvm import nvvmError from cuda.bindings.nvjitlink import nvJitLinkError +from cpython.buffer cimport PyObject_GetBuffer, PyBuffer_Release, Py_buffer, PyBUF_SIMPLE + from cuda.bindings cimport cynvrtc, cynvvm, cynvjitlink from cuda.core._utils.driver_cu_result_explanations import DRIVER_CU_RESULT_EXPLANATIONS @@ -41,7 +45,7 @@ class NVRTCError(CUDAError): ComputeCapability = namedtuple("ComputeCapability", ("major", "minor")) -def cast_to_3_tuple(label, cfg): +def cast_to_3_tuple(label: str, cfg: int | tuple[int, ...]) -> tuple[int, int, int]: cfg_orig = cfg if isinstance(cfg, int): cfg = (cfg,) @@ -59,16 +63,20 @@ def cast_to_3_tuple(label, cfg): return cfg + (1,) * (3 - len(cfg)) -def _reduce_3_tuple(t: tuple): - return t[0] * t[1] * t[2] - - cdef int HANDLE_RETURN(cydriver.CUresult err) except?-1 nogil: if err != cydriver.CUresult.CUDA_SUCCESS: return _check_driver_error(err) return 0 +cdef int _get_current_device_id() except? -1: + """Return the current thread's bound CUdevice ordinal.""" + cdef cydriver.CUdevice dev + with nogil: + HANDLE_RETURN(cydriver.cuCtxGetDevice(&dev)) + return dev + + cdef int HANDLE_RETURN_NVRTC(cynvrtc.nvrtcProgram prog, cynvrtc.nvrtcResult err) except?-1 nogil: """Handle NVRTC result codes, raising NVRTCError with program log on failure.""" if err == cynvrtc.nvrtcResult.NVRTC_SUCCESS: @@ -174,10 +182,9 @@ cpdef inline int _check_driver_error(cydriver.CUresult error) except?-1 nogil: cpdef inline int _check_runtime_error(error) except?-1: if error == _RUNTIME_SUCCESS: return 0 - name_err, name = runtime.cudaGetErrorName(error) - if name_err != _RUNTIME_SUCCESS: - raise CUDAError(f"UNEXPECTED ERROR CODE: {error}") - name = name.decode() + # `_check_error()` reaches this path only for `runtime.cudaError_t` values. + # Use the enum name directly because Windows hybrid cudart can lag that table. + name = error.name expl = RUNTIME_CUDA_ERROR_EXPLANATIONS.get(int(error)) if expl is not None: raise CUDAError(f"{name}: {expl}") @@ -211,7 +218,7 @@ cdef inline int _check_error(error, handle=None) except?-1: raise RuntimeError(f"Unknown error type: {error}") -def handle_return(tuple result, handle=None): +def handle_return(result: tuple[Any, ...], handle: object = None) -> Any: _check_error(result[0], handle=handle) cdef int out_len = len(result) if out_len == 1: @@ -222,7 +229,7 @@ def handle_return(tuple result, handle=None): return result[1:] -cpdef check_or_create_options(type cls, options, str options_description="", bint keep_none=False): +cpdef object check_or_create_options(type cls, object options, str options_description="", bint keep_none=False): """ Create the specified options dataclass from a dictionary of options or None. """ @@ -249,7 +256,7 @@ def _handle_boolean_option(option: bool) -> str: return "true" if bool(option) else "false" -def precondition(checker: Callable[..., None], str what="") -> Callable: +def precondition(checker: Callable[..., None], str what="") -> Callable[..., Any]: """ A decorator that adds checks to ensure any preconditions are met. @@ -262,13 +269,13 @@ def precondition(checker: Callable[..., None], str what="") -> Callable: Callable: A decorator that creates the wrapping. """ - def outer(wrapped_function): + def outer(wrapped_function: Callable) -> Callable: """ A decorator that actually wraps the function for checking preconditions. """ @functools.wraps(wrapped_function) - def inner(*args, **kwargs): + def inner(*args, **kwargs) -> Any: """ Check preconditions and if they are met, call the wrapped function. """ @@ -282,28 +289,20 @@ def precondition(checker: Callable[..., None], str what="") -> Callable: return outer -def is_sequence(obj): +def is_sequence(obj: object) -> bool: """ Check if the given object is a sequence (list or tuple). """ return isinstance(obj, Sequence) -def is_nested_sequence(obj): +def is_nested_sequence(obj: object) -> bool: """ Check if the given object is a nested sequence (list or tuple with atleast one list or tuple element). """ return is_sequence(obj) and any(is_sequence(elem) for elem in obj) -@functools.lru_cache -def get_binding_version(): - try: - major_minor = importlib.metadata.version("cuda-bindings").split(".")[:2] - except importlib.metadata.PackageNotFoundError: - major_minor = importlib.metadata.version("cuda-python").split(".")[:2] - return tuple(int(v) for v in major_minor) - class Transaction: """ @@ -323,7 +322,7 @@ class Transaction: append(fn, *args, **kwargs): Register an undo action to be called on rollback. commit(): Disarm all undo actions; nothing will be rolled back on exit. """ - def __init__(self): + def __init__(self) -> None: self._stack = ExitStack() self._entered = False @@ -337,7 +336,7 @@ class Transaction: self._entered = False return self._stack.__exit__(exc_type, exc, tb) - def append(self, fn, /, *args, **kwargs): + def append(self, fn: Callable[..., Any], /, *args: Any, **kwargs: Any) -> None: """ Register an undo action (runs if the with-block exits without commit()). Values are bound now via partial so late mutations don't bite you. @@ -346,7 +345,7 @@ class Transaction: raise RuntimeError("Transaction must be entered before append()") self._stack.callback(partial(fn, *args, **kwargs)) - def commit(self): + def commit(self) -> None: """ Disarm all undo actions. After this, exiting the with-block does nothing. """ @@ -358,7 +357,7 @@ class Transaction: _fork_warning_checked = False -def reset_fork_warning(): +def reset_fork_warning() -> None: """Reset the fork warning check flag for testing purposes. This function is intended for use in tests to allow multiple test runs @@ -368,7 +367,65 @@ def reset_fork_warning(): _fork_warning_checked = False -def check_multiprocessing_start_method(): +cdef inline tuple _read_fill_ptr(const char* ptr, Py_ssize_t width): + """Extract (value, element_size) from a raw pointer of known width.""" + cdef unsigned int val + if width == 1: + val = (ptr)[0] + elif width == 2: + val = (ptr)[0] + elif width == 4: + val = (ptr)[0] + else: + raise ValueError(f"value must be 1, 2, or 4 bytes, got {width}") + return (val, width) + + +cpdef tuple _parse_fill_value(value): + """Parse a fill/memset value into (raw_value, element_size). + + Parameters + ---------- + value : int or buffer-protocol object + - int: Must be in range [0, 256). Treated as 1-byte fill. + - bytes or buffer-protocol: Must be 1, 2, or 4 bytes. + + Returns + ------- + tuple of (int, int) + (raw_value, element_size) where element_size is 1, 2, or 4. + + Raises + ------ + OverflowError + If int value is outside [0, 256). + TypeError + If value is not an int and does not support the buffer protocol. + ValueError + If value byte length is not 1, 2, or 4. + """ + cdef uint8_t byte_val + cdef Py_buffer buf + + if isinstance(value, int): + byte_val = value + return (byte_val, 1) + + if isinstance(value, bytes): + return _read_fill_ptr(value, len(value)) + + if PyObject_GetBuffer(value, &buf, PyBUF_SIMPLE) != 0: + raise TypeError( + f"value must be an int or support the buffer protocol, " + f"got {type(value).__name__}" + ) + try: + return _read_fill_ptr(buf.buf, buf.len) + finally: + PyBuffer_Release(&buf) + + +def check_multiprocessing_start_method() -> None: """Check if multiprocessing start method is 'fork' and warn if so.""" global _fork_warning_checked if _fork_warning_checked: diff --git a/cuda_core/cuda/core/_utils/driver_cu_result_explanations.py b/cuda_core/cuda/core/_utils/driver_cu_result_explanations.py index 0b085520a63..d1e0a53bb00 100644 --- a/cuda_core/cuda/core/_utils/driver_cu_result_explanations.py +++ b/cuda_core/cuda/core/_utils/driver_cu_result_explanations.py @@ -1,358 +1,16 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 -# 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. +from __future__ import annotations -# CUDA Toolkit v13.2.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())." - ), - 1: ( - "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." - ), - 3: ( - "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." - ), - 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." - ), - 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." - ), - 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." - ), - 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." - ), - 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." - ), - 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." - ), - 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." - ), - 202: ( - "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."), - 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." - ), - 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."), - 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." - ), - 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."), - 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."), - 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." - ), - 300: ( - "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." - ), - 401: ( - "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." - ), - 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." - ), - 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()." - ), - 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." - ), - 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." - ), - 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." - ), - 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." - ), - 705: ( - "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."), - 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." - ), - 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." - ), - 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()." - ), - 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." - ), - 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." - ), - 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." - ), - 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." - ), - 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" - " 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." - ), - 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." - ), - 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." - ), - 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." - ), - 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."), - 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." - ), - 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." - ), - 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.", - 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." - ), - 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."), - 901: ( - "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." - ), - 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." - ), - 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." - ), - 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." - ), - 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." - ), - 911: ( - "This indicates that an error has occurred in a device outside of GPU. It can be a" - " synchronous error w.r.t. CUDA API or an asynchronous error from the external device." - " In case of asynchronous error, it means that 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." - " In case of synchronous error, it means that one or more external devices" - " have encountered an error and cannot complete the operation." - ), - 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."), - 917: ( - "This error indicates that the requested operation is not permitted because the" - " stream is in a detached state. This can occur if the green context associated" - " with the stream has been destroyed, limiting the stream's operational capabilities." - ), - 999: "This indicates that an unknown internal error has occurred.", -} +from cuda.bindings import driver +from cuda.core._utils.enum_explanations_helpers import get_best_available_explanations + + +def _load_fallback_explanations() -> dict[int, str | tuple[str, ...]]: + from cuda.core._utils.driver_cu_result_explanations_frozen import _FALLBACK_EXPLANATIONS + + return _FALLBACK_EXPLANATIONS # type: ignore[return-value] + + +DRIVER_CU_RESULT_EXPLANATIONS = get_best_available_explanations(driver.CUresult, _load_fallback_explanations) diff --git a/cuda_core/cuda/core/_utils/driver_cu_result_explanations_frozen.py b/cuda_core/cuda/core/_utils/driver_cu_result_explanations_frozen.py new file mode 100644 index 00000000000..567b9690380 --- /dev/null +++ b/cuda_core/cuda/core/_utils/driver_cu_result_explanations_frozen.py @@ -0,0 +1,350 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# CUDA Toolkit v13.1.1 +_FALLBACK_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())." + ), + 1: ( + "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." + ), + 3: ( + "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." + ), + 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." + ), + 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." + ), + 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." + ), + 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." + ), + 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." + ), + 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." + ), + 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." + ), + 202: ( + "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."), + 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." + ), + 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."), + 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." + ), + 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."), + 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."), + 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." + ), + 300: ( + "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." + ), + 401: ( + "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." + ), + 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." + ), + 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()." + ), + 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." + ), + 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." + ), + 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." + ), + 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." + ), + 705: ( + "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."), + 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." + ), + 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." + ), + 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()." + ), + 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." + ), + 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." + ), + 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." + ), + 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." + ), + 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" + " 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." + ), + 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." + ), + 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." + ), + 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." + ), + 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."), + 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." + ), + 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." + ), + 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.", + 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." + ), + 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."), + 901: ( + "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." + ), + 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." + ), + 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." + ), + 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." + ), + 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." + ), + 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: "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."), + 917: ( + "This error indicates that the requested operation is not permitted because the" + " stream is in a detached state. This can occur if the green context associated" + " with the stream has been destroyed, limiting the stream's operational capabilities." + ), + 999: "This indicates that an unknown internal error has occurred.", +} diff --git a/cuda_core/cuda/core/_utils/enum_explanations_helpers.py b/cuda_core/cuda/core/_utils/enum_explanations_helpers.py new file mode 100644 index 00000000000..0dbe6d6bb60 --- /dev/null +++ b/cuda_core/cuda/core/_utils/enum_explanations_helpers.py @@ -0,0 +1,133 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""Internal support for error-enum explanations. + +``cuda_core`` keeps frozen 13.1.1 fallback tables for older ``cuda-bindings`` +releases. Driver/runtime error enums carry usable ``__doc__`` text starting in +the 12.x backport line at ``cuda-bindings`` 12.9.6, and in the mainline 13.x +series at ``cuda-bindings`` 13.2.0. This module decides which source to use +and normalizes generated docstrings so user-facing ``CUDAError`` messages stay +presentable. + +The cleanup rules here were derived while validating generated enum docstrings +in PR #1805. Keep them narrow and remove them when codegen quirks or fallback +support are no longer needed. +""" + +from __future__ import annotations + +import importlib.metadata +import re +from collections.abc import Callable +from typing import Any + +_MIN_12X_BINDING_VERSION_FOR_ENUM_DOCSTRINGS = (12, 9, 6) +_MIN_13X_BINDING_VERSION_FOR_ENUM_DOCSTRINGS = (13, 2, 0) +_RST_INLINE_ROLE_RE = re.compile(r":(?:[a-z]+:)?[a-z]+:`([^`]+)`") +_WORDWRAP_HYPHEN_AFTER_RE = re.compile(r"(?<=[0-9A-Za-z_])- (?=[0-9A-Za-z_])") +_WORDWRAP_HYPHEN_BEFORE_RE = re.compile(r"(?<=[0-9A-Za-z_]) -(?=[0-9A-Za-z_])") +_ExplanationTable = dict[int, str | tuple[str, ...]] +_ExplanationTableLoader = Callable[[], _ExplanationTable] + + +# ``version.pyx`` cannot be reused here (circular import via ``cuda_utils``). +def _binding_version() -> tuple[int, int, int]: + """Return the installed ``cuda-bindings`` version, or a conservative old value.""" + try: + version = importlib.metadata.version("cuda-bindings") + except importlib.metadata.PackageNotFoundError: + return (0, 0, 0) # For very old versions of cuda-python + + parts = version.partition("+")[0].split(".")[:3] + parts_int = ([int(v) for v in parts] + [0, 0, 0])[:3] + return (parts_int[0], parts_int[1], parts_int[2]) + + +def _binding_version_has_usable_enum_docstrings(version: tuple[int, int, int]) -> bool: + """Whether released bindings are known to carry usable error-enum ``__doc__`` text.""" + return ( + _MIN_12X_BINDING_VERSION_FOR_ENUM_DOCSTRINGS <= version < (13, 0, 0) + or version >= _MIN_13X_BINDING_VERSION_FOR_ENUM_DOCSTRINGS + ) + + +def _fix_hyphenation_wordwrap_spacing(s: str) -> str: + """Remove spaces around hyphens introduced by line wrapping in generated ``__doc__`` text. + + This targets asymmetric wrap artifacts such as ``non- linear`` or + ``GPU- Direct`` while leaving intentional ``a - b`` separators alone. + """ + prev = None + while prev != s: + prev = s + s = _WORDWRAP_HYPHEN_AFTER_RE.sub("-", s) + s = _WORDWRAP_HYPHEN_BEFORE_RE.sub("-", s) + return s + + +def clean_enum_member_docstring(doc: str | None) -> str | None: + """Turn an enum member ``__doc__`` into plain text. + + The generated enum docstrings are already close to user-facing prose, but + they may contain Sphinx inline roles, line wrapping, or a small known + codegen defect. Normalize only those differences so the text is suitable + for error messages. + """ + if doc is None: + return None + s = doc + # Known codegen bug on cudaErrorIncompatibleDriverContext. Remove once fixed + # in cuda-bindings code generation. + s = s.replace("\n:py:obj:`~.Interactions`", ' "Interactions ') + # Drop a leading "~." or "." after removing the surrounding RST inline role. + s = _RST_INLINE_ROLE_RE.sub(lambda m: re.sub(r"^~?\.", "", m.group(1)), s) + # Strip simple bold emphasis markers. + s = re.sub(r"\*\*([^*]+)\*\*", r"\1", s) + # Strip simple italic emphasis markers. + s = re.sub(r"\*([^*]+)\*", r"\1", s) + # Collapse wrapped lines and repeated spaces. + s = re.sub(r"\s+", " ", s).strip() + s = _fix_hyphenation_wordwrap_spacing(s) + return s + + +class DocstringBackedExplanations: + """Compatibility shim exposing enum-member ``__doc__`` text via ``dict.get``. + + Keeps the existing ``.get(int(error))`` lookup shape used by ``cuda_utils.pyx``. + """ + + __slots__ = ("_enum_type",) + + def __init__(self, enum_type: Any) -> None: + self._enum_type = enum_type + + def get(self, code: int, default: str | None = None) -> str | None: + try: + member = self._enum_type(code) + except ValueError: + return default + + raw_doc = member.__doc__ + if raw_doc is None: + return default + + return clean_enum_member_docstring(raw_doc) + + +def get_best_available_explanations( + enum_type: Any, + fallback: _ExplanationTable | _ExplanationTableLoader, +) -> DocstringBackedExplanations | _ExplanationTable: + """Pick one explanation source per bindings version. + + Use enum-member ``__doc__`` only for bindings versions known to expose + usable per-member text (12.9.6+ in the 12.x backport line, 13.2.0+ in the + 13.x mainline). Otherwise keep using the frozen 13.1.1 fallback tables. + """ + if not _binding_version_has_usable_enum_docstrings(_binding_version()): + if callable(fallback): + return fallback() + return fallback + return DocstringBackedExplanations(enum_type) diff --git a/cuda_core/cuda/core/_utils/pycompat.py b/cuda_core/cuda/core/_utils/pycompat.py new file mode 100644 index 00000000000..5e685ed2db4 --- /dev/null +++ b/cuda_core/cuda/core/_utils/pycompat.py @@ -0,0 +1,23 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +""" +Compatibility shims for differences between supported Python versions. +""" + +import sys + +__all__ = ["BufferProtocol", "StrEnum"] + + +if sys.version_info >= (3, 11): + from enum import StrEnum +else: + from backports.strenum import StrEnum + + +if sys.version_info >= (3, 12): + from collections.abc import Buffer as BufferProtocol +else: + BufferProtocol = object diff --git a/cuda_core/cuda/core/_utils/runtime_cuda_error_explanations.py b/cuda_core/cuda/core/_utils/runtime_cuda_error_explanations.py index 4421d50480c..12a49d2ec96 100644 --- a/cuda_core/cuda/core/_utils/runtime_cuda_error_explanations.py +++ b/cuda_core/cuda/core/_utils/runtime_cuda_error_explanations.py @@ -1,551 +1,16 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 -# 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. +from __future__ import annotations -# CUDA Toolkit v13.2.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())." - ), - 1: ( - "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." - ), - 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." - ), - 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." - ), - 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." - ), - 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." - ), - 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." - ), - 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." - ), - 10: ( - "This indicates that the driver is newer than the runtime version" - " and returned graph node parameter information that the runtime" - " does not understand and is unable to translate." - ), - 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." - ), - 13: ("This indicates that the symbol name/identifier passed to the API call is not a valid name or identifier."), - 16: ( - "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 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."), - 19: ( - "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." - ), - 21: ( - "This indicates that the direction of the memcpy passed to the API call is" - " not one of the types specified by ::cudaMemcpyKind." - ), - 22: ( - "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 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 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 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." - ), - 27: ( - "This indicates that an attempt was made to read an unsupported data type as a" - " normalized float. This is not supported by CUDA." - ), - 28: ( - "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 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 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." - ), - 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." - ), - 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." - ), - 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." - ), - 44: ( - "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." - ), - 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." - ), - 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 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." - ), - 53: ( - "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." - ), - 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." - ), - 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." - ), - 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." - ), - 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."), - 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." - ), - 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." - ), - 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." - ), - 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."), - 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." - ), - 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."), - 216: ( - "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."), - 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." - ), - 219: "This indicates an error with the OpenGL or DirectX context.", - 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." - ), - 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." - ), - 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." - ), - 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." - ), - 300: "This indicates that the device kernel source is invalid.", - 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 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." - ), - 401: ( - "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." - ), - 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." - ), - 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()." - ), - 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." - ), - 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." - ), - 702: ( - "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."), - 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." - ), - 705: ( - "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." - ), - 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." - ), - 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." - ), - 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()." - ), - 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." - ), - 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." - ), - 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." - ), - 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." - ), - 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" - " 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." - ), - 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." - ), - 720: ( - "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." - ), - 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."), - 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." - ), - 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." - ), - 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.", - 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." - ), - 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.", - 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."), - 903: "The capture was not initiated in this 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." - ), - 906: ( - "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."), - 908: ( - "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." - ), - 911: ( - "This indicates that an error has occurred in a device outside of GPU. It can be a" - " synchronous error w.r.t. CUDA API or an asynchronous error from the external device." - " In case of asynchronous error, it means that 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." - " In case of synchronous error, it means that one or more external devices" - " have encountered an error and cannot complete the operation." - ), - 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."), - 917: ( - "This error indicates that the requested operation is not permitted because the" - " stream is in a detached state. This can occur if the green context associated" - " with the stream has been destroyed, limiting the stream's operational capabilities." - ), - 999: "This indicates that an unknown internal error has occurred.", - 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." - ), -} +from cuda.bindings import runtime +from cuda.core._utils.enum_explanations_helpers import get_best_available_explanations + + +def _load_fallback_explanations() -> dict[int, str | tuple[str, ...]]: + from cuda.core._utils.runtime_cuda_error_explanations_frozen import _FALLBACK_EXPLANATIONS + + return _FALLBACK_EXPLANATIONS # type: ignore[return-value] + + +RUNTIME_CUDA_ERROR_EXPLANATIONS = get_best_available_explanations(runtime.cudaError_t, _load_fallback_explanations) diff --git a/cuda_core/cuda/core/_utils/runtime_cuda_error_explanations_frozen.py b/cuda_core/cuda/core/_utils/runtime_cuda_error_explanations_frozen.py new file mode 100644 index 00000000000..017c4087400 --- /dev/null +++ b/cuda_core/cuda/core/_utils/runtime_cuda_error_explanations_frozen.py @@ -0,0 +1,538 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# CUDA Toolkit v13.1.1 +_FALLBACK_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())." + ), + 1: ( + "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." + ), + 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." + ), + 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." + ), + 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." + ), + 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." + ), + 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." + ), + 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." + ), + 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." + ), + 13: ("This indicates that the symbol name/identifier passed to the API call is not a valid name or identifier."), + 16: ( + "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 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."), + 19: ( + "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." + ), + 21: ( + "This indicates that the direction of the memcpy passed to the API call is" + " not one of the types specified by ::cudaMemcpyKind." + ), + 22: ( + "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 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 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 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." + ), + 27: ( + "This indicates that an attempt was made to read an unsupported data type as a" + " normalized float. This is not supported by CUDA." + ), + 28: ( + "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 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 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." + ), + 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." + ), + 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." + ), + 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." + ), + 44: ( + "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." + ), + 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." + ), + 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 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." + ), + 53: ( + "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." + ), + 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." + ), + 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." + ), + 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." + ), + 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."), + 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." + ), + 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." + ), + 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." + ), + 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."), + 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." + ), + 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."), + 216: ( + "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."), + 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." + ), + 219: "This indicates an error with the OpenGL or DirectX context.", + 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." + ), + 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." + ), + 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." + ), + 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." + ), + 300: "This indicates that the device kernel source is invalid.", + 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 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." + ), + 401: ( + "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." + ), + 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." + ), + 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()." + ), + 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." + ), + 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." + ), + 702: ( + "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."), + 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." + ), + 705: ( + "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." + ), + 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." + ), + 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." + ), + 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()." + ), + 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." + ), + 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." + ), + 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." + ), + 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." + ), + 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" + " 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." + ), + 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." + ), + 720: ( + "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." + ), + 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."), + 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." + ), + 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." + ), + 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.", + 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." + ), + 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.", + 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."), + 903: "The capture was not initiated in this 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." + ), + 906: ( + "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."), + 908: ( + "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." + ), + 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."), + 917: ( + "This error indicates that the requested operation is not permitted because the" + " stream is in a detached state. This can occur if the green context associated" + " with the stream has been destroyed, limiting the stream's operational capabilities." + ), + 999: "This indicates that an unknown internal error has occurred.", + 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/cuda/core/_utils/version.pxd b/cuda_core/cuda/core/_utils/version.pxd new file mode 100644 index 00000000000..2746d463dba --- /dev/null +++ b/cuda_core/cuda/core/_utils/version.pxd @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +cdef tuple cy_binding_version() +cdef tuple cy_driver_version() diff --git a/cuda_core/cuda/core/_utils/version.pyi b/cuda_core/cuda/core/_utils/version.pyi new file mode 100644 index 00000000000..bb7f0129917 --- /dev/null +++ b/cuda_core/cuda/core/_utils/version.pyi @@ -0,0 +1,14 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_utils/version.pyx + +from __future__ import annotations + +import functools + + +@functools.cache +def binding_version() -> tuple[int, int, int]: + """Return the cuda-bindings version as a (major, minor, patch) triple.""" + +@functools.cache +def driver_version() -> tuple[int, int, int]: + """Return the CUDA driver version as a (major, minor, patch) triple.""" \ No newline at end of file diff --git a/cuda_core/cuda/core/_utils/version.pyx b/cuda_core/cuda/core/_utils/version.pyx new file mode 100644 index 00000000000..09ea5852421 --- /dev/null +++ b/cuda_core/cuda/core/_utils/version.pyx @@ -0,0 +1,43 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +import functools +import importlib.metadata + +from cuda.core._utils.cuda_utils import driver, handle_return + + +@functools.cache +def binding_version() -> tuple[int, int, int]: + """Return the cuda-bindings version as a (major, minor, patch) triple.""" + try: + parts = importlib.metadata.version("cuda-bindings").split(".")[:3] + except importlib.metadata.PackageNotFoundError: + parts = importlib.metadata.version("cuda-python").split(".")[:3] + return tuple(int(v) for v in parts) + + +@functools.cache +def driver_version() -> tuple[int, int, int]: + """Return the CUDA driver version as a (major, minor, patch) triple.""" + cdef int ver = handle_return(driver.cuDriverGetVersion()) + return (ver // 1000, (ver // 10) % 100, ver % 10) + + +cdef tuple _cached_binding_version = None +cdef tuple _cached_driver_version = None + + +cdef tuple cy_binding_version(): + global _cached_binding_version + if _cached_binding_version is None: + _cached_binding_version = binding_version() + return _cached_binding_version + + +cdef tuple cy_driver_version(): + global _cached_driver_version + if _cached_driver_version is None: + _cached_driver_version = driver_version() + return _cached_driver_version diff --git a/cuda_core/cuda/core/checkpoint.py b/cuda_core/cuda/core/checkpoint.py new file mode 100644 index 00000000000..32fe7e26d83 --- /dev/null +++ b/cuda_core/cuda/core/checkpoint.py @@ -0,0 +1,256 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +import ctypes as _ctypes +from collections.abc import Mapping +from typing import Any + +from cuda.bindings import driver as _driver +from cuda.core._utils.cuda_utils import handle_return as _handle_cuda_return +from cuda.core._utils.version import binding_version as _binding_version +from cuda.core._utils.version import driver_version as _driver_version +from cuda.core.typing import ProcessStateType as _ProcessStateType + +_PROCESS_STATE_NAME_ATTRS: tuple[tuple[str, _ProcessStateType], ...] = ( + ("CU_PROCESS_STATE_RUNNING", "running"), + ("CU_PROCESS_STATE_LOCKED", "locked"), + ("CU_PROCESS_STATE_CHECKPOINTED", "checkpointed"), + ("CU_PROCESS_STATE_FAILED", "failed"), +) + +_REQUIRED_BINDING_ATTRS = ( + "cuCheckpointProcessCheckpoint", + "cuCheckpointProcessGetRestoreThreadId", + "cuCheckpointProcessGetState", + "cuCheckpointProcessLock", + "cuCheckpointProcessRestore", + "cuCheckpointProcessUnlock", + "CUcheckpointGpuPair", + "CUcheckpointLockArgs", + "CUprocessState", + "CUcheckpointRestoreArgs", +) +_REQUIRED_DRIVER_VERSION = (12, 8, 0) +_driver_capability_checked = False + + +class Process: + """ + CUDA process that can be locked, checkpointed, restored, and unlocked. + + Parameters + ---------- + pid : int + Process ID of the CUDA process. + """ + + __slots__ = ("_pid",) + + def __init__(self, pid: int): + self._pid = _check_pid(pid) + + @property + def pid(self) -> int: + """ + Process ID of the CUDA process. + """ + return self._pid + + @property + def state(self) -> _ProcessStateType: + """ + CUDA checkpoint state for this process. + """ + driver = _get_driver() + state = _call_driver(driver, driver.cuCheckpointProcessGetState, self._pid) + state_names = _get_process_state_names(driver) + try: + return state_names[state] + except KeyError as e: + state_value = int(state) + raise RuntimeError(f"Unknown CUDA checkpoint process state: {state_value}") from e + + @property + def restore_thread_id(self) -> int: + """ + CUDA restore thread ID for this process. + """ + driver = _get_driver() + return int(_call_driver(driver, driver.cuCheckpointProcessGetRestoreThreadId, self._pid)) + + def lock(self, timeout_ms: int = 0) -> None: + """ + Lock this process, blocking further CUDA API calls. + + Parameters + ---------- + timeout_ms : int, optional + Timeout in milliseconds. A value of 0 indicates no timeout. + """ + driver = _get_driver() + args = driver.CUcheckpointLockArgs() + args.timeoutMs = _check_timeout_ms(timeout_ms) + _call_driver(driver, driver.cuCheckpointProcessLock, self._pid, args) + + def checkpoint(self) -> None: + """ + Checkpoint the GPU memory contents of this locked process. + """ + driver = _get_driver() + _call_driver(driver, driver.cuCheckpointProcessCheckpoint, self._pid, None) + + def restore(self, gpu_mapping: Mapping[Any, Any] | None = None) -> None: + """ + Restore this checkpointed process. + + Parameters + ---------- + gpu_mapping : mapping, optional + GPU UUID remapping from each checkpointed GPU UUID to the GPU UUID + to restore onto. For migration workflows, provide mappings for + every GPU visible to the kernel-mode driver. User-space masking + such as ``CUDA_VISIBLE_DEVICES`` does not reduce this mapping + requirement. + """ + driver = _get_driver() + args = _make_restore_args(driver, gpu_mapping) + _call_driver(driver, driver.cuCheckpointProcessRestore, self._pid, args) + + def unlock(self) -> None: + """ + Unlock this locked process so it can resume CUDA API calls. + """ + driver = _get_driver() + _call_driver(driver, driver.cuCheckpointProcessUnlock, self._pid, None) + + +def _get_driver() -> Any: + global _driver_capability_checked + if _driver_capability_checked: + return _driver + + binding_ver = _binding_version() + if not _binding_version_supports_checkpoint(binding_ver): + raise RuntimeError( + "CUDA checkpointing requires cuda.bindings with CUDA checkpoint API support. " + f"Found cuda.bindings {'.'.join(str(part) for part in binding_ver[:3])}." + ) + + missing = [name for name in _REQUIRED_BINDING_ATTRS if not hasattr(_driver, name)] + if missing: + raise RuntimeError( + f"CUDA checkpointing requires cuda.bindings with CUDA checkpoint API support. Missing: {', '.join(missing)}" + ) + + driver_ver = _driver_version() + if driver_ver < _REQUIRED_DRIVER_VERSION: + raise RuntimeError( + "CUDA checkpointing is not supported by the installed NVIDIA driver. " + "Upgrade to a driver version with CUDA checkpoint API support." + ) + + _driver_capability_checked = True + return _driver + + +def _binding_version_supports_checkpoint(version: tuple[int, ...]) -> bool: + major, minor, patch = version[:3] + return (major == 12 and (minor, patch) >= (8, 0)) or (major == 13 and (minor, patch) >= (0, 2)) or major > 13 + + +def _get_process_state_names(driver: Any) -> dict[Any, _ProcessStateType]: + return {getattr(driver.CUprocessState, attr): state_name for attr, state_name in _PROCESS_STATE_NAME_ATTRS} + + +def _call_driver(driver: Any, func: Any, *args: Any) -> Any: + try: + result = func(*args) + except RuntimeError as e: + if "cuCheckpointProcess" in str(e) and "not found" in str(e): + raise RuntimeError( + "CUDA checkpointing is not supported by the installed NVIDIA driver. " + "Upgrade to a driver version with CUDA checkpoint API support." + ) from e + raise + + err = result[0] + not_supported_errors = ( + getattr(driver.CUresult, "CUDA_ERROR_NOT_FOUND", None), + getattr(driver.CUresult, "CUDA_ERROR_NOT_SUPPORTED", None), + ) + if err in not_supported_errors: + raise RuntimeError( + "CUDA checkpointing is not supported by the installed NVIDIA driver. " + "Upgrade to a driver version with CUDA checkpoint API support." + ) + + return _handle_cuda_return(result) + + +def _check_pid(pid: int) -> int: + if isinstance(pid, bool) or not isinstance(pid, int): + raise TypeError("pid must be an int") + if pid <= 0: + raise ValueError("pid must be a positive int") + return pid + + +def _check_timeout_ms(timeout_ms: int) -> int: + if isinstance(timeout_ms, bool) or not isinstance(timeout_ms, int): + raise TypeError("timeout_ms must be an int") + if timeout_ms < 0: + raise ValueError("timeout_ms must be >= 0") + return timeout_ms + + +def _make_restore_args(driver: Any, gpu_mapping: Mapping[Any, Any] | None) -> Any: + if gpu_mapping is None: + return None + if not isinstance(gpu_mapping, Mapping): + raise TypeError("gpu_mapping must be a mapping from checkpointed GPU UUID to restore GPU UUID") + + pairs = [] + for old_uuid, new_uuid in gpu_mapping.items(): + pair = driver.CUcheckpointGpuPair() + buffers: list[Any] = [] # holds ctypes string-buffer keepalives for the call below + pair.oldUuid = _as_cuuuid(driver, old_uuid, buffers) + pair.newUuid = _as_cuuuid(driver, new_uuid, buffers) + pairs.append(pair) + + if not pairs: + return None + + args = driver.CUcheckpointRestoreArgs() + args.gpuPairs = pairs + args.gpuPairsCount = len(pairs) + return args + + +def _as_cuuuid(driver: Any, value: Any, buffers: list[Any]) -> Any: + """Convert *value* to a ``CUuuid``. + + Accepts a ``CUuuid`` instance (returned as-is) or a UUID string in + the ``"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"`` format returned by + :attr:`Device.uuid`. + """ + if isinstance(value, driver.CUuuid): + return value + if isinstance(value, str): + try: + raw = bytes.fromhex(value.replace("-", "")) + except ValueError: + raise ValueError( + f"GPU UUID string must be 32 hex characters (with optional hyphens), got {value!r}" + ) from None + if len(raw) != 16: + raise ValueError(f"GPU UUID string must be 32 hex characters (with optional hyphens), got {value!r}") + buf = _ctypes.create_string_buffer(raw, 16) + buffers.append(buf) + return driver.CUuuid(_ctypes.addressof(buf)) + raise TypeError("GPU UUID values must be CUDA UUID objects or UUID strings") + + +__all__ = [ + "Process", +] diff --git a/cuda_core/cuda/core/experimental/__init__.pxd b/cuda_core/cuda/core/experimental/__init__.pxd deleted file mode 100644 index d8b3a2dc32c..00000000000 --- a/cuda_core/cuda/core/experimental/__init__.pxd +++ /dev/null @@ -1,3 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# -# SPDX-License-Identifier: Apache-2.0 diff --git a/cuda_core/cuda/core/experimental/__init__.py b/cuda_core/cuda/core/experimental/__init__.py deleted file mode 100644 index e7989f0f263..00000000000 --- a/cuda_core/cuda/core/experimental/__init__.py +++ /dev/null @@ -1,75 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# -# SPDX-License-Identifier: Apache-2.0 - -""" -Backward compatibility stubs for cuda.core.experimental namespace. - -This module provides forwarding stubs that import from the new cuda.core.* -locations and emit deprecation warnings. Users should migrate to importing -directly from cuda.core instead of cuda.core.experimental. - -The experimental namespace will be removed in v1.0.0. - -""" - - -def _warn_deprecated(): - """Emit a deprecation warning for using the experimental namespace. - - Note: This warning is only when the experimental module is first imported. - Subsequent accesses to attributes (like utils, Device, etc.) do not trigger - additional warnings since they are already set in the module namespace. - """ - import warnings - - warnings.warn( - "The cuda.core.experimental namespace is deprecated. " - "Please import directly from cuda.core instead. " - "For example, use 'from cuda.core import Device' instead of " - "'from cuda.core.experimental import Device'. " - "The experimental namespace will be removed in v1.0.0.", - DeprecationWarning, - stacklevel=3, - ) - - -# Import from new locations and re-export -_warn_deprecated() - - -from cuda.core import system, utils - -# Make utils accessible as a submodule for backward compatibility -__import__("sys").modules[__spec__.name + ".utils"] = utils - - -from cuda.core._device import Device -from cuda.core._event import Event, EventOptions -from cuda.core._graph import ( - Graph, - GraphBuilder, - GraphCompleteOptions, - GraphDebugPrintOptions, -) -from cuda.core._launch_config import LaunchConfig -from cuda.core._launcher import launch -from cuda.core._layout import _StridedLayout -from cuda.core._linker import Linker, LinkerOptions -from cuda.core._memory import ( - Buffer, - DeviceMemoryResource, - DeviceMemoryResourceOptions, - GraphMemoryResource, - LegacyPinnedMemoryResource, - ManagedMemoryResource, - ManagedMemoryResourceOptions, - MemoryResource, - PinnedMemoryResource, - PinnedMemoryResourceOptions, - VirtualMemoryResource, - VirtualMemoryResourceOptions, -) -from cuda.core._module import Kernel, ObjectCode -from cuda.core._program import Program, ProgramOptions -from cuda.core._stream import Stream, StreamOptions diff --git a/cuda_core/cuda/core/graph/__init__.pxd b/cuda_core/cuda/core/graph/__init__.pxd new file mode 100644 index 00000000000..f367745acc1 --- /dev/null +++ b/cuda_core/cuda/core/graph/__init__.pxd @@ -0,0 +1,23 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from cuda.core.graph._graph_definition cimport GraphCondition, GraphDefinition +from cuda.core.graph._graph_node cimport GraphNode +from cuda.core.graph._subclasses cimport ( + AllocNode, + ChildGraphNode, + ConditionalNode, + EmptyNode, + EventRecordNode, + EventWaitNode, + FreeNode, + HostCallbackNode, + IfElseNode, + IfNode, + KernelNode, + MemcpyNode, + MemsetNode, + SwitchNode, + WhileNode, +) diff --git a/cuda_core/cuda/core/graph/__init__.py b/cuda_core/cuda/core/graph/__init__.py new file mode 100644 index 00000000000..e1091114368 --- /dev/null +++ b/cuda_core/cuda/core/graph/__init__.py @@ -0,0 +1,8 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from ._graph_builder import * +from ._graph_definition import * +from ._graph_node import * +from ._subclasses import * diff --git a/cuda_core/cuda/core/graph/_adjacency_set_proxy.pyi b/cuda_core/cuda/core/graph/_adjacency_set_proxy.pyi new file mode 100644 index 00000000000..742b3777b04 --- /dev/null +++ b/cuda_core/cuda/core/graph/_adjacency_set_proxy.pyi @@ -0,0 +1,58 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/graph/_adjacency_set_proxy.pyx + +"""Mutable-set proxy for graph node predecessors and successors.""" +from __future__ import annotations + +from collections.abc import Iterator, Set +from typing import Any + +from cuda.core.graph._graph_node import GraphNode + + +class AdjacencySetProxy: + """Mutable set proxy for a node's predecessors or successors. Mutations + write through to the underlying CUDA graph.""" + __slots__ = ('_core',) + + def __init__(self, node: GraphNode, is_fwd: bool) -> None: + ... + + @classmethod + def _from_iterable(cls, it) -> set[GraphNode]: + ... + + def __contains__(self, x: object) -> bool: + ... + + def __iter__(self) -> Iterator[GraphNode]: + ... + + def __len__(self) -> int: + ... + + def add(self, value: GraphNode) -> None: + ... + + def discard(self, value: GraphNode) -> None: + ... + + def clear(self) -> None: + """Remove all edges in a single driver call.""" + + def __isub__(self, it: Set[Any]) -> 'AdjacencySetProxy': + """Remove edges to all nodes in *it* in a single driver call.""" + + def update(self, *others) -> None: + """Add edges to multiple nodes at once.""" + + def __ior__(self, it: Set[Any]) -> 'AdjacencySetProxy': + """Add edges to all nodes in *it* in a single driver call.""" + + def __repr__(self) -> str: + ... + +class _AdjacencySetCore: + """Cythonized core implementing AdjacencySetProxy""" + + def __init__(self, node: GraphNode, is_fwd: bool): + ... \ No newline at end of file diff --git a/cuda_core/cuda/core/graph/_adjacency_set_proxy.pyx b/cuda_core/cuda/core/graph/_adjacency_set_proxy.pyx new file mode 100644 index 00000000000..e1762321ce0 --- /dev/null +++ b/cuda_core/cuda/core/graph/_adjacency_set_proxy.pyx @@ -0,0 +1,279 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +"""Mutable-set proxy for graph node predecessors and successors.""" + +from libc.stddef cimport size_t +from libcpp.vector cimport vector +from cuda.bindings cimport cydriver +from cuda.core.graph._graph_node cimport GraphNode +from cuda.core._resource_handles cimport ( + GraphHandle, + GraphNodeHandle, + as_cu, + graph_node_get_graph, +) +from cuda.core._utils.cuda_utils cimport HANDLE_RETURN +from collections.abc import Iterator, MutableSet, Set +from typing import Any + + +# ---- Python MutableSet wrapper ---------------------------------------------- + +class AdjacencySetProxy(MutableSet[GraphNode]): + """Mutable set proxy for a node's predecessors or successors. Mutations + write through to the underlying CUDA graph.""" + + __slots__ = ("_core",) + + def __init__(self, node: GraphNode, bint is_fwd) -> None: + self._core = _AdjacencySetCore(node, is_fwd) + + # Used by operators such as &|^ to create non-proxy views when needed. + @classmethod + def _from_iterable(cls, it) -> set[GraphNode]: + return set(it) + + # --- abstract methods required by MutableSet --- + + def __contains__(self, x: object) -> bool: + if not isinstance(x, GraphNode): + return False + return (<_AdjacencySetCore>self._core).contains(x) + + def __iter__(self) -> Iterator[GraphNode]: + return iter((<_AdjacencySetCore>self._core).query()) + + def __len__(self) -> int: + return (<_AdjacencySetCore>self._core).count() + + def add(self, value: GraphNode) -> None: + if not isinstance(value, GraphNode): + raise TypeError( + f"expected GraphNode, got {type(value).__name__}") + if value in self: + return + (<_AdjacencySetCore>self._core).add_edge(value) + + def discard(self, value: GraphNode) -> None: + if not isinstance(value, GraphNode): + return + if value not in self: + return + (<_AdjacencySetCore>self._core).remove_edge(value) + + # --- override for bulk efficiency --- + + def clear(self) -> None: + """Remove all edges in a single driver call.""" + members = (<_AdjacencySetCore>self._core).query() + if members: + (<_AdjacencySetCore>self._core).remove_edges(members) + + def __isub__(self, it: Set[Any]) -> "AdjacencySetProxy": + """Remove edges to all nodes in *it* in a single driver call.""" + if it is self: + self.clear() + else: + to_remove = [v for v in it if isinstance(v, GraphNode) and v in self] + if to_remove: + (<_AdjacencySetCore>self._core).remove_edges(to_remove) + return self + + def update(self, *others) -> None: + """Add edges to multiple nodes at once.""" + nodes = [] + for other in others: + if isinstance(other, GraphNode): + nodes.append(other) + else: + for n in other: + if not isinstance(n, GraphNode): + raise TypeError( + f"expected GraphNode, got {type(n).__name__}") + nodes.append(n) + if not nodes: + return + new = [n for n in nodes if n not in self] + if new: + (<_AdjacencySetCore>self._core).add_edges(new) + + def __ior__(self, it: Set[Any]) -> "AdjacencySetProxy": + """Add edges to all nodes in *it* in a single driver call.""" + self.update(it) + return self + + def __repr__(self) -> str: + return "{" + ", ".join(repr(n) for n in self) + "}" + + +# ---- cdef core holding a function pointer ------------------------------------ + +# Signature shared by driver_get_preds and driver_get_succs. +ctypedef cydriver.CUresult (*_adj_fn_t)( + cydriver.CUgraphNode, cydriver.CUgraphNode*, size_t*) noexcept nogil + + +cdef class _AdjacencySetCore: + """Cythonized core implementing AdjacencySetProxy""" + cdef: + GraphNodeHandle _h_node + GraphHandle _h_graph + _adj_fn_t _query_fn + bint _is_fwd + + def __init__(self, GraphNode node, bint is_fwd): + self._h_node = node._h_node + self._h_graph = graph_node_get_graph(node._h_node) + self._is_fwd = is_fwd + self._query_fn = driver_get_succs if is_fwd else driver_get_preds + + cdef inline void _resolve_edge( + self, GraphNode other, + cydriver.CUgraphNode* c_from, + cydriver.CUgraphNode* c_to) noexcept: + if self._is_fwd: + c_from[0] = as_cu(self._h_node) + c_to[0] = as_cu(other._h_node) + else: + c_from[0] = as_cu(other._h_node) + c_to[0] = as_cu(self._h_node) + + cdef list query(self): + cdef cydriver.CUgraphNode c_node = as_cu(self._h_node) + if c_node == NULL: + return [] + cdef cydriver.CUgraphNode buf[16] + cdef size_t count = 16 + cdef size_t i + with nogil: + HANDLE_RETURN(self._query_fn(c_node, buf, &count)) + if count <= 16: + return [GraphNode._create(self._h_graph, buf[i]) + for i in range(count)] + cdef vector[cydriver.CUgraphNode] nodes_vec + nodes_vec.resize(count) + with nogil: + HANDLE_RETURN(self._query_fn( + c_node, nodes_vec.data(), &count)) + return [GraphNode._create(self._h_graph, nodes_vec[i]) + for i in range(count)] + + cdef bint contains(self, GraphNode other): + cdef cydriver.CUgraphNode c_node = as_cu(self._h_node) + cdef cydriver.CUgraphNode target = as_cu(other._h_node) + if c_node == NULL or target == NULL: + return False + cdef cydriver.CUgraphNode buf[16] + cdef size_t count = 16 + cdef size_t i + with nogil: + HANDLE_RETURN(self._query_fn(c_node, buf, &count)) + + # Fast path for small sets. + if count <= 16: + for i in range(count): + if buf[i] == target: + return True + return False + + # Fallback for large sets. + cdef vector[cydriver.CUgraphNode] nodes_vec + nodes_vec.resize(count) + with nogil: + HANDLE_RETURN(self._query_fn(c_node, nodes_vec.data(), &count)) + assert count == nodes_vec.size() + for i in range(count): + if nodes_vec[i] == target: + return True + return False + + cdef Py_ssize_t count(self): + cdef cydriver.CUgraphNode c_node = as_cu(self._h_node) + if c_node == NULL: + return 0 + cdef size_t n = 0 + with nogil: + HANDLE_RETURN(self._query_fn(c_node, NULL, &n)) + return n + + cdef void add_edge(self, GraphNode other): + cdef cydriver.CUgraphNode c_from, c_to + self._resolve_edge(other, &c_from, &c_to) + with nogil: + HANDLE_RETURN(driver_add_edges(as_cu(self._h_graph), &c_from, &c_to, 1)) + + cdef void add_edges(self, list nodes): + cdef size_t n = len(nodes) + cdef vector[cydriver.CUgraphNode] from_vec + cdef vector[cydriver.CUgraphNode] to_vec + from_vec.resize(n) + to_vec.resize(n) + cdef size_t i + for i in range(n): + self._resolve_edge(nodes[i], &from_vec[i], &to_vec[i]) + with nogil: + HANDLE_RETURN(driver_add_edges( + as_cu(self._h_graph), from_vec.data(), to_vec.data(), n)) + + cdef void remove_edge(self, GraphNode other): + cdef cydriver.CUgraphNode c_from, c_to + self._resolve_edge(other, &c_from, &c_to) + with nogil: + HANDLE_RETURN(driver_remove_edges(as_cu(self._h_graph), &c_from, &c_to, 1)) + + cdef void remove_edges(self, list nodes): + cdef size_t n = len(nodes) + cdef vector[cydriver.CUgraphNode] from_vec + cdef vector[cydriver.CUgraphNode] to_vec + from_vec.resize(n) + to_vec.resize(n) + cdef size_t i + for i in range(n): + self._resolve_edge(nodes[i], &from_vec[i], &to_vec[i]) + with nogil: + HANDLE_RETURN(driver_remove_edges( + as_cu(self._h_graph), from_vec.data(), to_vec.data(), n)) + + +# ---- driver wrappers: absorb CUDA version differences ---- + +cdef inline cydriver.CUresult driver_get_preds( + cydriver.CUgraphNode node, cydriver.CUgraphNode* out, + size_t* count) noexcept nogil: + IF CUDA_CORE_BUILD_MAJOR >= 13: + return cydriver.cuGraphNodeGetDependencies(node, out, NULL, count) + ELSE: + return cydriver.cuGraphNodeGetDependencies(node, out, count) + + +cdef inline cydriver.CUresult driver_get_succs( + cydriver.CUgraphNode node, cydriver.CUgraphNode* out, + size_t* count) noexcept nogil: + IF CUDA_CORE_BUILD_MAJOR >= 13: + return cydriver.cuGraphNodeGetDependentNodes(node, out, NULL, count) + ELSE: + return cydriver.cuGraphNodeGetDependentNodes(node, out, count) + + +cdef inline cydriver.CUresult driver_add_edges( + cydriver.CUgraph graph, cydriver.CUgraphNode* from_arr, + cydriver.CUgraphNode* to_arr, size_t count) noexcept nogil: + IF CUDA_CORE_BUILD_MAJOR >= 13: + return cydriver.cuGraphAddDependencies( + graph, from_arr, to_arr, NULL, count) + ELSE: + return cydriver.cuGraphAddDependencies( + graph, from_arr, to_arr, count) + + +cdef inline cydriver.CUresult driver_remove_edges( + cydriver.CUgraph graph, cydriver.CUgraphNode* from_arr, + cydriver.CUgraphNode* to_arr, size_t count) noexcept nogil: + IF CUDA_CORE_BUILD_MAJOR >= 13: + return cydriver.cuGraphRemoveDependencies( + graph, from_arr, to_arr, NULL, count) + ELSE: + return cydriver.cuGraphRemoveDependencies( + graph, from_arr, to_arr, count) diff --git a/cuda_core/cuda/core/graph/_graph_builder.pxd b/cuda_core/cuda/core/graph/_graph_builder.pxd new file mode 100644 index 00000000000..660ebe8ec7d --- /dev/null +++ b/cuda_core/cuda/core/graph/_graph_builder.pxd @@ -0,0 +1,27 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from cuda.bindings cimport cydriver + +from cuda.core._resource_handles cimport GraphExecHandle, GraphHandle, StreamHandle +from cuda.core._stream cimport Stream + + +cdef class GraphBuilder: + cdef: + GraphHandle _h_graph + StreamHandle _h_stream + int _kind + int _state + Stream _stream # cached to avoid reconstruction from _h_stream handle + object __weakref__ + + +cdef class Graph: + cdef: + GraphExecHandle _h_graph_exec + object __weakref__ + + @staticmethod + cdef Graph _init(cydriver.CUgraphExec graph_exec) diff --git a/cuda_core/cuda/core/graph/_graph_builder.pyi b/cuda_core/cuda/core/graph/_graph_builder.pyi new file mode 100644 index 00000000000..f19d4067eb2 --- /dev/null +++ b/cuda_core/cuda/core/graph/_graph_builder.pyi @@ -0,0 +1,493 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/graph/_graph_builder.pyx + +from __future__ import annotations + +from dataclasses import dataclass + +from cuda.core._stream import Stream +from cuda.core._utils.cuda_utils import driver +from cuda.core.graph._graph_definition import GraphCondition, GraphDefinition + +_BuilderKind = int +_CaptureState = int + +@dataclass +class GraphDebugPrintOptions: + """Options for debug_dot_print(). + + Attributes + ---------- + verbose : bool + Output all debug data as if every debug flag is enabled (Default to False) + runtime_types : bool + Use CUDA Runtime structures for output (Default to False) + kernel_node_params : bool + Adds kernel parameter values to output (Default to False) + memcpy_node_params : bool + Adds memcpy parameter values to output (Default to False) + memset_node_params : bool + Adds memset parameter values to output (Default to False) + host_node_params : bool + Adds host parameter values to output (Default to False) + event_node_params : bool + Adds event parameter values to output (Default to False) + ext_semas_signal_node_params : bool + Adds external semaphore signal parameter values to output (Default to False) + ext_semas_wait_node_params : bool + Adds external semaphore wait parameter values to output (Default to False) + kernel_node_attributes : bool + Adds kernel node attributes to output (Default to False) + handles : bool + Adds node handles and every kernel function handle to output (Default to False) + mem_alloc_node_params : bool + Adds memory alloc parameter values to output (Default to False) + mem_free_node_params : bool + Adds memory free parameter values to output (Default to False) + batch_mem_op_node_params : bool + Adds batch mem op parameter values to output (Default to False) + extra_topo_info : bool + Adds edge numbering information (Default to False) + conditional_node_params : bool + Adds conditional node parameter values to output (Default to False) + + """ + verbose: bool = False + runtime_types: bool = False + kernel_node_params: bool = False + memcpy_node_params: bool = False + memset_node_params: bool = False + host_node_params: bool = False + event_node_params: bool = False + ext_semas_signal_node_params: bool = False + ext_semas_wait_node_params: bool = False + kernel_node_attributes: bool = False + handles: bool = False + mem_alloc_node_params: bool = False + mem_free_node_params: bool = False + batch_mem_op_node_params: bool = False + extra_topo_info: bool = False + conditional_node_params: bool = False + + def _to_flags(self) -> int: + """Convert options to CUDA driver API flags (internal use).""" + +@dataclass +class GraphCompleteOptions: + """Options for graph instantiation. + + Attributes + ---------- + auto_free_on_launch : bool, optional + Automatically free memory allocated in a graph before relaunching. (Default to False) + upload_stream : Stream, optional + Stream to use to automatically upload the graph after completion. (Default to None) + device_launch : bool, optional + Configure the graph to be launchable from the device. This flag can only + be used on platforms which support unified addressing. This flag cannot be + used in conjunction with auto_free_on_launch. (Default to False) + use_node_priority : bool, optional + Run the graph using the per-node priority attributes rather than the + priority of the stream it is launched into. (Default to False) + + """ + auto_free_on_launch: bool = False + upload_stream: Stream | None = None + device_launch: bool = False + use_node_priority: bool = False + +class GraphBuilder: + """A graph under construction by stream capture. + + A graph groups a set of CUDA kernels and other CUDA operations together and executes + them with a specified dependency tree. It speeds up the workflow by combining the + driver activities associated with CUDA kernel launches and CUDA API calls. + + Directly creating a :obj:`~graph.GraphBuilder` is not supported due + to ambiguity. New graph builders should instead be created through a + :obj:`~_device.Device`, or a :obj:`~_stream.stream` object. + + .. note:: + + Operations recorded during capture reference your memory but do not + take ownership of it. As with ordinary stream work, you must keep the + operands alive for as long as the completed graph may execute -- for + example, the :obj:`~_memory.Buffer` objects passed to :func:`~launch` + or :meth:`~_memory.Buffer.copy_to`. Host callbacks added with + :meth:`callback` are the exception: the callable (and any copied + ``user_data``) are retained for the graph's lifetime. This differs from + building a graph explicitly with :class:`~graph.GraphDefinition`, which + retains the operands it is given. + + """ + + def __init__(self): + ... + + def __dealloc__(self): + ... + + @staticmethod + def _init(stream: Stream): + ... + + def close(self): + """Destroy the graph builder.""" + + @property + def stream(self) -> Stream: + """Returns the stream associated with the graph builder.""" + + @property + def is_join_required(self) -> bool: + """Returns True if this graph builder must be joined before building is ended.""" + + @property + def graph_definition(self) -> GraphDefinition: + """The captured graph as an explicit :class:`~graph.GraphDefinition`. + + .. versionadded:: 1.1.0 + + The returned :class:`~graph.GraphDefinition` is a view of the same + graph this builder is producing: nodes added through it appear in + subsequent :meth:`complete` and :meth:`debug_dot_print` calls, and + the view stays valid even after the builder is closed. + + This lets you mix the capture and explicit APIs on a single graph, + for example to inspect what was captured, augment it with extra + nodes, or build a conditional body entirely with the explicit API. + + Availability: + + - **Primary builders** (created by :meth:`Device.create_graph_builder` + or :meth:`Stream.create_graph_builder`): only after + :meth:`end_building`. + + - **Conditional-body builders** (returned by :meth:`if_then`, + :meth:`if_else`, :meth:`while_loop`, :meth:`switch`): both before + :meth:`begin_building` and after :meth:`end_building`. The body + graph already exists when the conditional is created, so you may + populate it through this view without ever calling + :meth:`begin_building` on the body builder. + + - **Forked builders** (returned by :meth:`split`): never. Forked + builders share the primary builder's graph; access it through the + primary instead. + + Returns + ------- + GraphDefinition + A view of the graph being built. + + Raises + ------ + RuntimeError + If the builder is closed, forked, currently building, or (for + primary builders) has not started building yet. A + :class:`~graph.GraphDefinition` obtained before :meth:`close` + keeps working; only fresh access through this property is + rejected once the builder is closed. + """ + + def begin_building(self, mode: str | None='relaxed') -> GraphBuilder: + """Begins the building process. + + Build `mode` for controlling interaction with other API calls must be one of the following: + + - `global` : Prohibit potentially unsafe operations across all streams in the process. + - `thread_local` : Prohibit potentially unsafe operations in streams created by the current thread. + - `relaxed` : The local thread is not prohibited from potentially unsafe operations. + + Parameters + ---------- + mode : str, optional + Build mode to control the interaction with other API calls that are porentially unsafe. + Default set to use relaxed. + + """ + + @property + def is_building(self) -> bool: + """Returns True if the graph builder is currently building.""" + + def end_building(self) -> GraphBuilder: + """Ends the building process.""" + + def complete(self, options: GraphCompleteOptions | None=None) -> Graph: + """Completes the graph builder and returns the built :obj:`~graph.Graph` object. + + Parameters + ---------- + options : :obj:`~graph.GraphCompleteOptions`, optional + Customizable dataclass for the graph builder completion options. + + Returns + ------- + graph : :obj:`~graph.Graph` + The newly built graph. + + """ + + def debug_dot_print(self, path: str, options: GraphDebugPrintOptions | None=None) -> None: + """Generates a DOT debug file for the graph builder. + + Parameters + ---------- + path : str + File path to use for writting debug DOT output + options : :obj:`~graph.GraphDebugPrintOptions`, optional + Customizable dataclass for the debug print options. + + """ + + def split(self, count: int) -> tuple[GraphBuilder, ...]: + """Splits the original graph builder into multiple graph builders. + + The new builders inherit work dependencies from the original builder. + The original builder is reused for the split and is returned first in the tuple. + + Parameters + ---------- + count : int + The number of graph builders to split the graph builder into. + + Returns + ------- + graph_builders : tuple[:obj:`~graph.GraphBuilder`, ...] + A tuple of split graph builders. The first graph builder in the tuple + is always the original graph builder. + + """ + + @staticmethod + def join(*graph_builders: GraphBuilder) -> GraphBuilder: + """Joins multiple graph builders into a single graph builder. + + The returned builder inherits work dependencies from the provided builders. + + Parameters + ---------- + *graph_builders : :obj:`~graph.GraphBuilder` + The graph builders to join. + + Returns + ------- + graph_builder : :obj:`~graph.GraphBuilder` + The newly joined graph builder. + + """ + + def __cuda_stream__(self) -> tuple[int, int]: + """Return an instance of a __cuda_stream__ protocol.""" + + def _get_conditional_context(self) -> driver.CUcontext: + ... + + def create_condition(self, default_value: int | None=None) -> GraphCondition: + """Create a condition variable for use with conditional nodes. + + The returned :class:`GraphCondition` object is passed to conditional-node + builder methods (:meth:`if_then`, :meth:`if_else`, :meth:`while_loop`, + :meth:`switch`). Its value is controlled at runtime by device code via + ``cudaGraphSetConditional``. + + Parameters + ---------- + default_value : int, optional + The default value to assign to the condition. If None, no + default is assigned. + + Returns + ------- + GraphCondition + A condition variable for controlling conditional execution. + """ + + def if_then(self, condition: GraphCondition) -> GraphBuilder: + """Adds an if condition branch and returns a new graph builder for it. + + The resulting if graph will only execute the branch if the + condition evaluates to true at runtime. + + The new builder inherits work dependencies from the original builder. + + Parameters + ---------- + condition : :class:`~graph.GraphCondition` + The condition variable from :meth:`create_condition` controlling + whether the branch executes. + + Returns + ------- + graph_builder : :obj:`~graph.GraphBuilder` + The newly created conditional graph builder. + + """ + + def if_else(self, condition: GraphCondition) -> tuple[GraphBuilder, GraphBuilder]: + """Adds an if-else condition branch and returns new graph builders for both branches. + + The resulting if graph will execute the branch if the condition + evaluates to true at runtime, otherwise the else branch will execute. + + The new builders inherit work dependencies from the original builder. + + Parameters + ---------- + condition : :class:`~graph.GraphCondition` + The condition variable from :meth:`create_condition` controlling + which branch executes. + + Returns + ------- + graph_builders : tuple[:obj:`~graph.GraphBuilder`, :obj:`~graph.GraphBuilder`] + A tuple of two new graph builders, one for the if branch and one for the else branch. + + """ + + def switch(self, condition: GraphCondition, count: int) -> tuple[GraphBuilder, ...]: + """Adds a switch condition branch and returns new graph builders for all cases. + + The resulting switch graph will execute the branch whose case index + matches the value of the condition at runtime. If no match is found, no + branch will be executed. + + The new builders inherit work dependencies from the original builder. + + Parameters + ---------- + condition : :class:`~graph.GraphCondition` + The condition variable from :meth:`create_condition` selecting + which case executes. + count : int + The number of cases to add to the switch conditional. + + Returns + ------- + graph_builders : tuple[:obj:`~graph.GraphBuilder`, ...] + A tuple of new graph builders, one for each branch. + + """ + + def while_loop(self, condition: GraphCondition) -> GraphBuilder: + """Adds a while loop and returns a new graph builder for it. + + The resulting while loop graph will execute the branch repeatedly at runtime + until the condition evaluates to false. + + The new builder inherits work dependencies from the original builder. + + Parameters + ---------- + condition : :class:`~graph.GraphCondition` + The condition variable from :meth:`create_condition` controlling + loop continuation. + + Returns + ------- + graph_builder : :obj:`~graph.GraphBuilder` + The newly created while loop graph builder. + + """ + + def embed(self, child: GraphBuilder): + """Embed a previously-built :obj:`~graph.GraphBuilder` as a child node. + + Parameters + ---------- + child : :obj:`~graph.GraphBuilder` + The child graph builder. Must have finished building. + """ + + def callback(self, fn, *, user_data=None) -> None: + """Add a host callback to the graph during stream capture. + + The callback runs on the host CPU when the graph reaches this point + in execution. Two modes are supported: + + - **Python callable**: Pass any callable. The GIL is acquired + automatically. The callable must take no arguments; use closures + or ``functools.partial`` to bind state. + - **ctypes function pointer**: Pass a ``ctypes.CFUNCTYPE`` instance. + The function receives a single ``void*`` argument (the + ``user_data``). The caller must keep the ctypes wrapper alive + for the lifetime of the graph. + + .. warning:: + + Callbacks must not call CUDA API functions. Doing so may + deadlock or corrupt driver state. + + Parameters + ---------- + fn : callable or ctypes function pointer + The callback function. + user_data : int or bytes-like, optional + Only for ctypes function pointers. If ``int``, passed as a raw + pointer (caller manages lifetime). If bytes-like, the data is + copied and its lifetime is tied to the graph. + """ + +class Graph: + """An executable graph. + + A graph groups a set of CUDA kernels and other CUDA operations together and executes + them with a specified dependency tree. It speeds up the workflow by combining the + driver activities associated with CUDA kernel launches and CUDA API calls. + + Graphs must be built using a :obj:`~graph.GraphBuilder` object. + + """ + + def __init__(self): + ... + + def close(self) -> None: + """Destroy the graph.""" + + @property + def handle(self) -> driver.CUgraphExec: + """Return the underlying ``CUgraphExec`` object. + + .. caution:: + + This handle is a Python object. To get the memory address of the underlying C + handle, call ``int()`` on the returned object. + + """ + + def update(self, source: 'GraphBuilder | GraphDefinition') -> None: + """Update the graph using a new graph definition. + + The topology of the provided source must be identical to this graph. + + Parameters + ---------- + source : :obj:`~graph.GraphBuilder` or :obj:`~graph.GraphDefinition` + The graph definition to update from. A GraphBuilder must have + finished building. + + """ + + def upload(self, stream: Stream) -> None: + """Uploads the graph in a stream. + + Parameters + ---------- + stream : :obj:`~_stream.Stream` + The stream in which to upload the graph + + """ + + def launch(self, stream: Stream) -> None: + """Launches the graph in a stream. + + Parameters + ---------- + stream : :obj:`~_stream.Stream` + The stream in which to launch the graph. + + """ +__all__ = ['Graph', 'GraphBuilder', 'GraphCompleteOptions', 'GraphDebugPrintOptions'] + +def _instantiate_graph(h_graph, options: GraphCompleteOptions | None=None) -> Graph: + ... \ No newline at end of file diff --git a/cuda_core/cuda/core/graph/_graph_builder.pyx b/cuda_core/cuda/core/graph/_graph_builder.pyx new file mode 100644 index 00000000000..b1e6859f549 --- /dev/null +++ b/cuda_core/cuda/core/graph/_graph_builder.pyx @@ -0,0 +1,1089 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from dataclasses import dataclass +from typing import TYPE_CHECKING + +from libc.stdint cimport intptr_t + +from cuda.bindings cimport cydriver + +from cuda.core.graph._graph_definition cimport GraphCondition, GraphDefinition +from cuda.core.graph._host_callback cimport _attach_host_callback_owners, _resolve_host_callback +from cuda.core._resource_handles cimport ( + GraphHandle, + OpaqueHandle, + as_cu, as_py, + create_graph_exec_handle, create_graph_handle, create_graph_handle_ref, +) +from cuda.core._stream cimport Stream +from cuda.core._utils.cuda_utils cimport HANDLE_RETURN +from cuda.core._utils.version cimport cy_binding_version, cy_driver_version + +from cuda.core._utils.cuda_utils import ( + CUDAError, + driver, + handle_return, +) + +if TYPE_CHECKING: + from cuda.core.graph._graph_definition import GraphDefinition + +__all__ = ['Graph', 'GraphBuilder', 'GraphCompleteOptions', 'GraphDebugPrintOptions'] + + +@dataclass +class GraphDebugPrintOptions: + """Options for debug_dot_print(). + + Attributes + ---------- + verbose : bool + Output all debug data as if every debug flag is enabled (Default to False) + runtime_types : bool + Use CUDA Runtime structures for output (Default to False) + kernel_node_params : bool + Adds kernel parameter values to output (Default to False) + memcpy_node_params : bool + Adds memcpy parameter values to output (Default to False) + memset_node_params : bool + Adds memset parameter values to output (Default to False) + host_node_params : bool + Adds host parameter values to output (Default to False) + event_node_params : bool + Adds event parameter values to output (Default to False) + ext_semas_signal_node_params : bool + Adds external semaphore signal parameter values to output (Default to False) + ext_semas_wait_node_params : bool + Adds external semaphore wait parameter values to output (Default to False) + kernel_node_attributes : bool + Adds kernel node attributes to output (Default to False) + handles : bool + Adds node handles and every kernel function handle to output (Default to False) + mem_alloc_node_params : bool + Adds memory alloc parameter values to output (Default to False) + mem_free_node_params : bool + Adds memory free parameter values to output (Default to False) + batch_mem_op_node_params : bool + Adds batch mem op parameter values to output (Default to False) + extra_topo_info : bool + Adds edge numbering information (Default to False) + conditional_node_params : bool + Adds conditional node parameter values to output (Default to False) + + """ + + verbose: bool = False + runtime_types: bool = False + kernel_node_params: bool = False + memcpy_node_params: bool = False + memset_node_params: bool = False + host_node_params: bool = False + event_node_params: bool = False + ext_semas_signal_node_params: bool = False + ext_semas_wait_node_params: bool = False + kernel_node_attributes: bool = False + handles: bool = False + mem_alloc_node_params: bool = False + mem_free_node_params: bool = False + batch_mem_op_node_params: bool = False + extra_topo_info: bool = False + conditional_node_params: bool = False + + def _to_flags(self) -> int: + """Convert options to CUDA driver API flags (internal use).""" + flags = 0 + if self.verbose: + flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_VERBOSE + if self.runtime_types: + flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_RUNTIME_TYPES + if self.kernel_node_params: + flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_PARAMS + if self.memcpy_node_params: + flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_MEMCPY_NODE_PARAMS + if self.memset_node_params: + flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_MEMSET_NODE_PARAMS + if self.host_node_params: + flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_HOST_NODE_PARAMS + if self.event_node_params: + flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_EVENT_NODE_PARAMS + if self.ext_semas_signal_node_params: + flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_SIGNAL_NODE_PARAMS + if self.ext_semas_wait_node_params: + flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_WAIT_NODE_PARAMS + if self.kernel_node_attributes: + flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_ATTRIBUTES + if self.handles: + flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_HANDLES + if self.mem_alloc_node_params: + flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_MEM_ALLOC_NODE_PARAMS + if self.mem_free_node_params: + flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_MEM_FREE_NODE_PARAMS + if self.batch_mem_op_node_params: + flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_BATCH_MEM_OP_NODE_PARAMS + if self.extra_topo_info: + flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_EXTRA_TOPO_INFO + if self.conditional_node_params: + flags |= driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_CONDITIONAL_NODE_PARAMS + return flags + + +@dataclass +class GraphCompleteOptions: + """Options for graph instantiation. + + Attributes + ---------- + auto_free_on_launch : bool, optional + Automatically free memory allocated in a graph before relaunching. (Default to False) + upload_stream : Stream, optional + Stream to use to automatically upload the graph after completion. (Default to None) + device_launch : bool, optional + Configure the graph to be launchable from the device. This flag can only + be used on platforms which support unified addressing. This flag cannot be + used in conjunction with auto_free_on_launch. (Default to False) + use_node_priority : bool, optional + Run the graph using the per-node priority attributes rather than the + priority of the stream it is launched into. (Default to False) + + """ + + auto_free_on_launch: bool = False + upload_stream: Stream | None = None + device_launch: bool = False + use_node_priority: bool = False + + +def _instantiate_graph(h_graph, options: GraphCompleteOptions | None = None) -> Graph: + cdef cydriver.CUgraphExec c_exec + params = driver.CUDA_GRAPH_INSTANTIATE_PARAMS() + if options: + flags = 0 + if options.auto_free_on_launch: + flags |= driver.CUgraphInstantiate_flags.CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH + if options.upload_stream: + flags |= driver.CUgraphInstantiate_flags.CUDA_GRAPH_INSTANTIATE_FLAG_UPLOAD + params.hUploadStream = options.upload_stream.handle + if options.device_launch: + flags |= driver.CUgraphInstantiate_flags.CUDA_GRAPH_INSTANTIATE_FLAG_DEVICE_LAUNCH + if options.use_node_priority: + flags |= driver.CUgraphInstantiate_flags.CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY + params.flags = flags + + py_exec = handle_return(driver.cuGraphInstantiateWithParams(h_graph, params)) + # Check result_out before wrapping the exec: on a non-SUCCESS result the exec + # may be invalid, and Graph._init's RAII deleter would call cuGraphExecDestroy + # on it during the exception unwind below. + if params.result_out == driver.CUgraphInstantiateResult.CUDA_GRAPH_INSTANTIATE_ERROR: + raise RuntimeError( + "Instantiation failed for an unexpected reason which is described in the return value of the function." + ) + elif params.result_out == driver.CUgraphInstantiateResult.CUDA_GRAPH_INSTANTIATE_INVALID_STRUCTURE: + raise RuntimeError("Instantiation failed due to invalid structure, such as cycles.") + elif params.result_out == driver.CUgraphInstantiateResult.CUDA_GRAPH_INSTANTIATE_NODE_OPERATION_NOT_SUPPORTED: + raise RuntimeError( + "Instantiation for device launch failed because the graph contained an unsupported operation." + ) + elif params.result_out == driver.CUgraphInstantiateResult.CUDA_GRAPH_INSTANTIATE_MULTIPLE_CTXS_NOT_SUPPORTED: + raise RuntimeError("Instantiation for device launch failed due to the nodes belonging to different contexts.") + elif ( + cy_binding_version() >= (12, 8, 0) + and params.result_out == driver.CUgraphInstantiateResult.CUDA_GRAPH_INSTANTIATE_CONDITIONAL_HANDLE_UNUSED + ): + raise RuntimeError("One or more conditional handles are not associated with conditional builders.") + elif params.result_out != driver.CUgraphInstantiateResult.CUDA_GRAPH_INSTANTIATE_SUCCESS: + raise RuntimeError(f"Graph instantiation failed with unexpected error code: {params.result_out}") + + c_exec = int(py_exec) + return Graph._init(c_exec) + + +# Distinguishes the three kinds of GraphBuilder, which differ in how they +# begin/end stream capture and whether they own the resulting CUgraph. +# Each kind progresses through _CaptureState as follows: +# +# PRIMARY: NOT_STARTED -> CAPTURING -> ENDED +# FORKED: CAPTURING (never transitions; joined and closed) +# CONDITIONAL_BODY: NOT_STARTED -> CAPTURING -> ENDED +# +cdef enum _BuilderKind: + # PRIMARY: The top-level builder created by Device or Stream. Owns the + # captured CUgraph via an owning GraphHandle. Progresses through all three + # capture states; responsible for ending capture if destroyed early. + PRIMARY = 0 + # FORKED: Created by split(). Captures on a private stream forked from the + # primary. Starts in CAPTURING state and never transitions; the user joins + # it back to the primary via join(), which closes the builder. Must NOT + # call cuStreamEndCapture (the driver requires all forked streams to be + # joined first). + FORKED = 1 + # CONDITIONAL_BODY: Created by if_then/if_else/switch/while_loop. Captures + # into a non-owned body graph via cuStreamBeginCaptureToGraph. The body + # graph's lifetime is tied to a parent graph. Progresses through all three + # capture states like PRIMARY. + CONDITIONAL_BODY = 2 + + +# Tracks the capture lifecycle of a GraphBuilder. +cdef enum _CaptureState: + CAPTURE_NOT_STARTED = 0 + CAPTURING = 1 + CAPTURE_ENDED = 2 # Finished, valid handle + CLOSED = 3 # No valid handle + + +cdef class GraphBuilder: + """A graph under construction by stream capture. + + A graph groups a set of CUDA kernels and other CUDA operations together and executes + them with a specified dependency tree. It speeds up the workflow by combining the + driver activities associated with CUDA kernel launches and CUDA API calls. + + Directly creating a :obj:`~graph.GraphBuilder` is not supported due + to ambiguity. New graph builders should instead be created through a + :obj:`~_device.Device`, or a :obj:`~_stream.stream` object. + + .. note:: + + Operations recorded during capture reference your memory but do not + take ownership of it. As with ordinary stream work, you must keep the + operands alive for as long as the completed graph may execute -- for + example, the :obj:`~_memory.Buffer` objects passed to :func:`~launch` + or :meth:`~_memory.Buffer.copy_to`. Host callbacks added with + :meth:`callback` are the exception: the callable (and any copied + ``user_data``) are retained for the graph's lifetime. This differs from + building a graph explicitly with :class:`~graph.GraphDefinition`, which + retains the operands it is given. + + """ + + def __init__(self): + raise NotImplementedError( + "directly creating a GraphBuilder object can be ambiguous. Please either " + "call Device.create_graph_builder() or stream.create_graph_builder()" + ) + + def __dealloc__(self): + GB_end_capture_if_needed(self, False) + + @staticmethod + def _init(Stream stream): + cdef GraphBuilder self = GraphBuilder.__new__(GraphBuilder) + # _h_graph set by begin_building + self._h_stream = stream._h_stream + self._kind = PRIMARY + self._state = CAPTURE_NOT_STARTED + self._stream = stream + return self + + def close(self): + """Destroy the graph builder.""" + GB_end_capture_if_needed(self, True) + self._h_graph.reset() + self._h_stream.reset() + self._state = CLOSED + self._stream = None + + @property + def stream(self) -> Stream: + """Returns the stream associated with the graph builder.""" + return self._stream + + @property + def is_join_required(self) -> bool: + """Returns True if this graph builder must be joined before building is ended.""" + return self._kind == FORKED + + @property + def graph_definition(self) -> GraphDefinition: + """The captured graph as an explicit :class:`~graph.GraphDefinition`. + + .. versionadded:: 1.1.0 + + The returned :class:`~graph.GraphDefinition` is a view of the same + graph this builder is producing: nodes added through it appear in + subsequent :meth:`complete` and :meth:`debug_dot_print` calls, and + the view stays valid even after the builder is closed. + + This lets you mix the capture and explicit APIs on a single graph, + for example to inspect what was captured, augment it with extra + nodes, or build a conditional body entirely with the explicit API. + + Availability: + + - **Primary builders** (created by :meth:`Device.create_graph_builder` + or :meth:`Stream.create_graph_builder`): only after + :meth:`end_building`. + + - **Conditional-body builders** (returned by :meth:`if_then`, + :meth:`if_else`, :meth:`while_loop`, :meth:`switch`): both before + :meth:`begin_building` and after :meth:`end_building`. The body + graph already exists when the conditional is created, so you may + populate it through this view without ever calling + :meth:`begin_building` on the body builder. + + - **Forked builders** (returned by :meth:`split`): never. Forked + builders share the primary builder's graph; access it through the + primary instead. + + Returns + ------- + GraphDefinition + A view of the graph being built. + + Raises + ------ + RuntimeError + If the builder is closed, forked, currently building, or (for + primary builders) has not started building yet. A + :class:`~graph.GraphDefinition` obtained before :meth:`close` + keeps working; only fresh access through this property is + rejected once the builder is closed. + """ + GB_check_open(self) + if self._kind == FORKED: + raise RuntimeError( + "graph_definition is unavailable on forked graph builders; " + "access it through the primary builder instead." + ) + elif self._state == CAPTURING: + raise RuntimeError( + "graph_definition is unavailable while capture is in " + "progress; call end_building() first." + ) + elif self._kind == PRIMARY: + if self._state == CAPTURE_NOT_STARTED: + raise RuntimeError( + "graph_definition is unavailable before begin_building() on " + "a primary builder; no graph has been created yet." + ) + return GraphDefinition._from_handle(self._h_graph) + + def begin_building(self, mode: str | None = "relaxed") -> GraphBuilder: + """Begins the building process. + + Build `mode` for controlling interaction with other API calls must be one of the following: + + - `global` : Prohibit potentially unsafe operations across all streams in the process. + - `thread_local` : Prohibit potentially unsafe operations in streams created by the current thread. + - `relaxed` : The local thread is not prohibited from potentially unsafe operations. + + Parameters + ---------- + mode : str, optional + Build mode to control the interaction with other API calls that are porentially unsafe. + Default set to use relaxed. + + """ + GB_check_open(self) + if self._state != CAPTURE_NOT_STARTED: + if self._state == CAPTURING: + raise RuntimeError("Graph builder is already building.") + else: + raise RuntimeError("Cannot resume building after building has ended.") + cdef cydriver.CUstreamCaptureMode c_mode + if mode == "global": + c_mode = cydriver.CU_STREAM_CAPTURE_MODE_GLOBAL + elif mode == "thread_local": + c_mode = cydriver.CU_STREAM_CAPTURE_MODE_THREAD_LOCAL + elif mode == "relaxed": + c_mode = cydriver.CU_STREAM_CAPTURE_MODE_RELAXED + else: + raise ValueError(f"Unsupported build mode: {mode}") + + cdef cydriver.CUstream c_stream = as_cu(self._h_stream) + cdef cydriver.CUgraph c_graph + cdef cydriver.CUstreamCaptureStatus c_status + if self._kind == CONDITIONAL_BODY: + c_graph = as_cu(self._h_graph) + with nogil: + HANDLE_RETURN(cydriver.cuStreamBeginCaptureToGraph( + c_stream, c_graph, NULL, NULL, 0, c_mode)) + self._state = CAPTURING + else: + with nogil: + HANDLE_RETURN(cydriver.cuStreamBeginCapture(c_stream, c_mode)) + # Capture is active now; set CAPTURING before the calls below so a + # failure in _get_capture_info/create_graph_handle still lets + # cleanup end the capture rather than leaving the stream poisoned. + self._state = CAPTURING + with nogil: + # The driver rejects a NULL captureStatus_out, so pass a + # stack-local even though we only want the graph handle. + _get_capture_info(c_stream, &c_status, &c_graph) + self._h_graph = create_graph_handle(c_graph) + return self + + @property + def is_building(self) -> bool: + """Returns True if the graph builder is currently building.""" + GB_check_open(self) + cdef cydriver.CUstream c_stream = as_cu(self._h_stream) + cdef cydriver.CUstreamCaptureStatus status + with nogil: + _get_capture_info(c_stream, &status, NULL) + if status == cydriver.CU_STREAM_CAPTURE_STATUS_NONE: + return False + elif status == cydriver.CU_STREAM_CAPTURE_STATUS_ACTIVE: + return True + elif status == cydriver.CU_STREAM_CAPTURE_STATUS_INVALIDATED: + raise RuntimeError( + "Build process encountered an error and has been invalidated. Build process must now be ended." + ) + else: + raise NotImplementedError(f"Unsupported capture status type received: {status}") + + def end_building(self) -> GraphBuilder: + """Ends the building process.""" + GB_check_open(self) + if not self.is_building: + raise RuntimeError("Graph builder is not building.") + cdef cydriver.CUstream c_stream = as_cu(self._h_stream) + cdef cydriver.CUgraph c_graph + with nogil: + HANDLE_RETURN(cydriver.cuStreamEndCapture(c_stream, &c_graph)) + + # TODO: Resolving https://github.com/NVIDIA/cuda-python/issues/617 would allow us to + # resume the build process after the first call to end_building() + self._state = CAPTURE_ENDED + return self + + def complete(self, options: GraphCompleteOptions | None = None) -> Graph: + """Completes the graph builder and returns the built :obj:`~graph.Graph` object. + + Parameters + ---------- + options : :obj:`~graph.GraphCompleteOptions`, optional + Customizable dataclass for the graph builder completion options. + + Returns + ------- + graph : :obj:`~graph.Graph` + The newly built graph. + + """ + GB_check_open(self) + if self._state != CAPTURE_ENDED: + raise RuntimeError("Graph has not finished building.") + + return _instantiate_graph(as_py(self._h_graph), options) + + def debug_dot_print(self, path: str, options: GraphDebugPrintOptions | None = None) -> None: + """Generates a DOT debug file for the graph builder. + + Parameters + ---------- + path : str + File path to use for writting debug DOT output + options : :obj:`~graph.GraphDebugPrintOptions`, optional + Customizable dataclass for the debug print options. + + """ + GB_check_open(self) + if self._state != CAPTURE_ENDED: + raise RuntimeError("Graph has not finished building.") + cdef unsigned int c_flags = options._to_flags() if options else 0 + cdef cydriver.CUgraph c_graph = as_cu(self._h_graph) + cdef bytes b_path = path.encode('utf-8') + cdef const char* c_path = b_path + with nogil: + HANDLE_RETURN(cydriver.cuGraphDebugDotPrint(c_graph, c_path, c_flags)) + + def split(self, count: int) -> tuple[GraphBuilder, ...]: + """Splits the original graph builder into multiple graph builders. + + The new builders inherit work dependencies from the original builder. + The original builder is reused for the split and is returned first in the tuple. + + Parameters + ---------- + count : int + The number of graph builders to split the graph builder into. + + Returns + ------- + graph_builders : tuple[:obj:`~graph.GraphBuilder`, ...] + A tuple of split graph builders. The first graph builder in the tuple + is always the original graph builder. + + """ + if count < 2: + raise ValueError(f"Invalid split count: expecting >= 2, got {count}") + GB_check_open(self) + if self._state != CAPTURING: + raise RuntimeError("Graph builder must be building before it can be split.") + + event = self._stream.record() + result = [self] + for i in range(count - 1): + stream = self._stream.device.create_stream() + stream.wait(event) + result.append(GB_init_forked(stream, self._h_graph)) + event.close() + return tuple(result) + + @staticmethod + def join(*graph_builders: GraphBuilder) -> GraphBuilder: + """Joins multiple graph builders into a single graph builder. + + The returned builder inherits work dependencies from the provided builders. + + Parameters + ---------- + *graph_builders : :obj:`~graph.GraphBuilder` + The graph builders to join. + + Returns + ------- + graph_builder : :obj:`~graph.GraphBuilder` + The newly joined graph builder. + + """ + if any(not isinstance(builder, GraphBuilder) for builder in graph_builders): + raise TypeError("All arguments must be GraphBuilder instances") + if len(graph_builders) < 2: + raise ValueError("Must join with at least two graph builders") + + # Discover the root builder others should join + root_idx = 0 + for i, builder in enumerate(graph_builders): + if not builder.is_join_required: + root_idx = i + break + + # Join all onto the root builder + root_bdr = graph_builders[root_idx] + for idx, builder in enumerate(graph_builders): + if idx == root_idx: + continue + root_bdr.stream.wait(builder.stream) + builder.close() + + return root_bdr + + def __cuda_stream__(self) -> tuple[int, int]: + """Return an instance of a __cuda_stream__ protocol.""" + GB_check_open(self) + return self.stream.__cuda_stream__() + + def _get_conditional_context(self) -> driver.CUcontext: + return self._stream.context.handle + + def create_condition(self, default_value: int | None = None) -> GraphCondition: + """Create a condition variable for use with conditional nodes. + + The returned :class:`GraphCondition` object is passed to conditional-node + builder methods (:meth:`if_then`, :meth:`if_else`, :meth:`while_loop`, + :meth:`switch`). Its value is controlled at runtime by device code via + ``cudaGraphSetConditional``. + + Parameters + ---------- + default_value : int, optional + The default value to assign to the condition. If None, no + default is assigned. + + Returns + ------- + GraphCondition + A condition variable for controlling conditional execution. + """ + GB_check_open(self) + if cy_driver_version() < (12, 3, 0): + raise RuntimeError(f"Driver version {'.'.join(map(str, cy_driver_version()))} does not support conditional handles") + if cy_binding_version() < (12, 3, 0): + raise RuntimeError(f"Binding version {'.'.join(map(str, cy_binding_version()))} does not support conditional handles") + if default_value is not None: + flags = driver.CU_GRAPH_COND_ASSIGN_DEFAULT + else: + default_value = 0 + flags = 0 + + status, _, graph, *_, _ = handle_return(driver.cuStreamGetCaptureInfo(self._stream.handle)) + if status != driver.CUstreamCaptureStatus.CU_STREAM_CAPTURE_STATUS_ACTIVE: + raise RuntimeError("Cannot create a condition when graph is not being built") + + raw_handle = handle_return( + driver.cuGraphConditionalHandleCreate(graph, self._get_conditional_context(), default_value, flags) + ) + return GraphCondition._from_handle(int(raw_handle)) + + def if_then(self, condition: GraphCondition) -> GraphBuilder: + """Adds an if condition branch and returns a new graph builder for it. + + The resulting if graph will only execute the branch if the + condition evaluates to true at runtime. + + The new builder inherits work dependencies from the original builder. + + Parameters + ---------- + condition : :class:`~graph.GraphCondition` + The condition variable from :meth:`create_condition` controlling + whether the branch executes. + + Returns + ------- + graph_builder : :obj:`~graph.GraphBuilder` + The newly created conditional graph builder. + + """ + GB_check_open(self) + if cy_driver_version() < (12, 3, 0): + raise RuntimeError(f"Driver version {'.'.join(map(str, cy_driver_version()))} does not support conditional if") + if cy_binding_version() < (12, 3, 0): + raise RuntimeError(f"Binding version {'.'.join(map(str, cy_binding_version()))} does not support conditional if") + if not isinstance(condition, GraphCondition): + raise TypeError( + f"condition must be a GraphCondition object (from " + f"GraphBuilder.create_condition()), got {type(condition).__name__}") + node_params = driver.CUgraphNodeParams() + node_params.type = driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_CONDITIONAL + node_params.conditional.handle = condition.handle + node_params.conditional.type = driver.CUgraphConditionalNodeType.CU_GRAPH_COND_TYPE_IF + node_params.conditional.size = 1 + node_params.conditional.ctx = self._get_conditional_context() + return GB_cond_with_params(self, node_params)[0] + + def if_else(self, condition: GraphCondition) -> tuple[GraphBuilder, GraphBuilder]: + """Adds an if-else condition branch and returns new graph builders for both branches. + + The resulting if graph will execute the branch if the condition + evaluates to true at runtime, otherwise the else branch will execute. + + The new builders inherit work dependencies from the original builder. + + Parameters + ---------- + condition : :class:`~graph.GraphCondition` + The condition variable from :meth:`create_condition` controlling + which branch executes. + + Returns + ------- + graph_builders : tuple[:obj:`~graph.GraphBuilder`, :obj:`~graph.GraphBuilder`] + A tuple of two new graph builders, one for the if branch and one for the else branch. + + """ + GB_check_open(self) + if cy_driver_version() < (12, 8, 0): + raise RuntimeError(f"Driver version {'.'.join(map(str, cy_driver_version()))} does not support conditional if-else") + if cy_binding_version() < (12, 8, 0): + raise RuntimeError(f"Binding version {'.'.join(map(str, cy_binding_version()))} does not support conditional if-else") + if not isinstance(condition, GraphCondition): + raise TypeError( + f"condition must be a GraphCondition object (from " + f"GraphBuilder.create_condition()), got {type(condition).__name__}") + node_params = driver.CUgraphNodeParams() + node_params.type = driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_CONDITIONAL + node_params.conditional.handle = condition.handle + node_params.conditional.type = driver.CUgraphConditionalNodeType.CU_GRAPH_COND_TYPE_IF + node_params.conditional.size = 2 + node_params.conditional.ctx = self._get_conditional_context() + return GB_cond_with_params(self, node_params) + + def switch(self, condition: GraphCondition, count: int) -> tuple[GraphBuilder, ...]: + """Adds a switch condition branch and returns new graph builders for all cases. + + The resulting switch graph will execute the branch whose case index + matches the value of the condition at runtime. If no match is found, no + branch will be executed. + + The new builders inherit work dependencies from the original builder. + + Parameters + ---------- + condition : :class:`~graph.GraphCondition` + The condition variable from :meth:`create_condition` selecting + which case executes. + count : int + The number of cases to add to the switch conditional. + + Returns + ------- + graph_builders : tuple[:obj:`~graph.GraphBuilder`, ...] + A tuple of new graph builders, one for each branch. + + """ + GB_check_open(self) + if cy_driver_version() < (12, 8, 0): + raise RuntimeError(f"Driver version {'.'.join(map(str, cy_driver_version()))} does not support conditional switch") + if cy_binding_version() < (12, 8, 0): + raise RuntimeError(f"Binding version {'.'.join(map(str, cy_binding_version()))} does not support conditional switch") + if not isinstance(condition, GraphCondition): + raise TypeError( + f"condition must be a GraphCondition object (from " + f"GraphBuilder.create_condition()), got {type(condition).__name__}") + node_params = driver.CUgraphNodeParams() + node_params.type = driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_CONDITIONAL + node_params.conditional.handle = condition.handle + node_params.conditional.type = driver.CUgraphConditionalNodeType.CU_GRAPH_COND_TYPE_SWITCH + node_params.conditional.size = count + node_params.conditional.ctx = self._get_conditional_context() + return GB_cond_with_params(self, node_params) + + def while_loop(self, condition: GraphCondition) -> GraphBuilder: + """Adds a while loop and returns a new graph builder for it. + + The resulting while loop graph will execute the branch repeatedly at runtime + until the condition evaluates to false. + + The new builder inherits work dependencies from the original builder. + + Parameters + ---------- + condition : :class:`~graph.GraphCondition` + The condition variable from :meth:`create_condition` controlling + loop continuation. + + Returns + ------- + graph_builder : :obj:`~graph.GraphBuilder` + The newly created while loop graph builder. + + """ + GB_check_open(self) + if cy_driver_version() < (12, 3, 0): + raise RuntimeError(f"Driver version {'.'.join(map(str, cy_driver_version()))} does not support conditional while loop") + if cy_binding_version() < (12, 3, 0): + raise RuntimeError(f"Binding version {'.'.join(map(str, cy_binding_version()))} does not support conditional while loop") + if not isinstance(condition, GraphCondition): + raise TypeError( + f"condition must be a GraphCondition object (from " + f"GraphBuilder.create_condition()), got {type(condition).__name__}") + node_params = driver.CUgraphNodeParams() + node_params.type = driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_CONDITIONAL + node_params.conditional.handle = condition.handle + node_params.conditional.type = driver.CUgraphConditionalNodeType.CU_GRAPH_COND_TYPE_WHILE + node_params.conditional.size = 1 + node_params.conditional.ctx = self._get_conditional_context() + return GB_cond_with_params(self, node_params)[0] + + def embed(self, GraphBuilder child): + """Embed a previously-built :obj:`~graph.GraphBuilder` as a child node. + + Parameters + ---------- + child : :obj:`~graph.GraphBuilder` + The child graph builder. Must have finished building. + """ + GB_check_open(self) + if child._state != CAPTURE_ENDED: + raise ValueError("Child graph has not finished building.") + + if not self.is_building: + raise ValueError("Parent graph is not being built.") + + stream_handle = self._stream.handle + _, _, graph_out, *deps_info_out, num_dependencies_out = handle_return( + 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_trimmed, num_dependencies_out, as_py(child._h_graph) + ) + ) + ] + ] + [None] * (len(deps_info_out) - 1) + handle_return( + driver.cuStreamUpdateCaptureDependencies( + stream_handle, + *deps_info_update, # dependencies, edgeData + 1, + driver.CUstreamUpdateCaptureDependencies_flags.CU_STREAM_SET_CAPTURE_DEPENDENCIES, + ) + ) + + def callback(self, fn, *, user_data=None) -> None: + """Add a host callback to the graph during stream capture. + + The callback runs on the host CPU when the graph reaches this point + in execution. Two modes are supported: + + - **Python callable**: Pass any callable. The GIL is acquired + automatically. The callable must take no arguments; use closures + or ``functools.partial`` to bind state. + - **ctypes function pointer**: Pass a ``ctypes.CFUNCTYPE`` instance. + The function receives a single ``void*`` argument (the + ``user_data``). The caller must keep the ctypes wrapper alive + for the lifetime of the graph. + + .. warning:: + + Callbacks must not call CUDA API functions. Doing so may + deadlock or corrupt driver state. + + Parameters + ---------- + fn : callable or ctypes function pointer + The callback function. + user_data : int or bytes-like, optional + Only for ctypes function pointers. If ``int``, passed as a raw + pointer (caller manages lifetime). If bytes-like, the data is + copied and its lifetime is tied to the graph. + """ + GB_check_open(self) + cdef Stream stream = self._stream + cdef cydriver.CUstream c_stream = as_cu(stream._h_stream) + cdef cydriver.CUstreamCaptureStatus capture_status + + with nogil: + _get_capture_info(c_stream, &capture_status, NULL) + + if capture_status != cydriver.CU_STREAM_CAPTURE_STATUS_ACTIVE: + raise RuntimeError("Cannot add callback when graph is not being built") + + cdef cydriver.CUhostFn c_fn + cdef void* c_user_data = NULL + cdef OpaqueHandle fn_owner, data_owner + _resolve_host_callback(fn, user_data, &c_fn, &c_user_data, &fn_owner, &data_owner) + + with nogil: + HANDLE_RETURN(cydriver.cuLaunchHostFunc(c_stream, c_fn, c_user_data)) + + # Capturing the host function added a node to the graph; it is now the + # stream's sole capture dependency. Key the callback's owners to it so + # they live in the graph's slot table like any explicitly-added node. + cdef cydriver.CUgraphNode host_node = _capture_tail_node(c_stream) + _attach_host_callback_owners(self._h_graph, host_node, fn_owner, data_owner) + + +cdef inline int GB_check_open(GraphBuilder gb) except -1: + """Reject operations on a builder that has been closed. + + A CLOSED builder has reset its stream and graph handles, so any method + that dereferences them would read a null handle (or, for the cached + Stream, a None typed as cdef Stream). Guarding here yields a clear error + instead. + """ + if gb._state == CLOSED: + raise RuntimeError("Graph builder has been closed.") + return 0 + + +cdef inline int GB_end_capture_if_needed(GraphBuilder gb, bint check_status) except -1 nogil: + """End an in-progress capture if this builder owns it. + + Only a CAPTURING PRIMARY or CONDITIONAL_BODY builder owns the live + capture. A FORKED builder must not call cuStreamEndCapture: the driver + requires forked streams to be joined first. + + check_status=True checks the driver return (close()); False ignores it + (__dealloc__). + """ + cdef cydriver.CUgraph c_graph + cdef cydriver.CUresult err + cdef cydriver.CUstream c_stream + if gb._h_stream and gb._state == CAPTURING and gb._kind != FORKED: + c_stream = as_cu(gb._h_stream) + with nogil: + err = cydriver.cuStreamEndCapture(c_stream, &c_graph) + if check_status: + HANDLE_RETURN(err) + return 0 + + +cdef inline GraphBuilder GB_init_forked(Stream stream, GraphHandle h_primary_graph): + cdef GraphBuilder gb = GraphBuilder.__new__(GraphBuilder) + # A FORKED builder captures into the primary's CUgraph. It holds the + # primary's GraphHandle so conditional bodies created on it (via + # GB_init_conditional -> create_graph_handle_ref(cond_graph, parent._h_graph)) + # have a valid parent handle to pin. + gb._h_graph = h_primary_graph + gb._h_stream = stream._h_stream + gb._kind = FORKED + gb._state = CAPTURING + gb._stream = stream + return gb + + +cdef inline GraphBuilder GB_init_conditional(Stream stream, cydriver.CUgraph cond_graph, GraphBuilder parent): + cdef GraphBuilder gb = GraphBuilder.__new__(GraphBuilder) + gb._h_graph = create_graph_handle_ref(cond_graph, parent._h_graph) + gb._h_stream = stream._h_stream + gb._kind = CONDITIONAL_BODY + gb._state = CAPTURE_NOT_STARTED + gb._stream = stream + return gb + + +cdef inline int _get_capture_info( + cydriver.CUstream stream, + cydriver.CUstreamCaptureStatus* status, + cydriver.CUgraph* graph) except?-1 nogil: + """Thin wrapper around ``cuStreamGetCaptureInfo`` that papers over the + CUDA 12 vs 13 signature change. + + ``status`` must be non-NULL: the driver rejects ``captureStatus_out=NULL`` + with ``CUDA_ERROR_INVALID_VALUE``. ``graph`` may be NULL when the caller + does not need the graph handle. + """ + IF CUDA_CORE_BUILD_MAJOR >= 13: + return HANDLE_RETURN(cydriver.cuStreamGetCaptureInfo( + stream, status, NULL, graph, NULL, NULL, NULL)) + ELSE: + return HANDLE_RETURN(cydriver.cuStreamGetCaptureInfo( + stream, status, NULL, graph, NULL, NULL)) + + +cdef inline cydriver.CUgraphNode _capture_tail_node(cydriver.CUstream stream) except *: + """Return the node a freshly-captured single-node operation left as the + stream's sole capture dependency (e.g. the host node added by + ``cuLaunchHostFunc``). The driver advances the stream's dependency set to + the new node, so the next captured op would depend on it. + """ + cdef cydriver.CUstreamCaptureStatus status + cdef const cydriver.CUgraphNode* deps = NULL + cdef size_t num_deps = 0 + with nogil: + IF CUDA_CORE_BUILD_MAJOR >= 13: + HANDLE_RETURN(cydriver.cuStreamGetCaptureInfo( + stream, &status, NULL, NULL, &deps, NULL, &num_deps)) + ELSE: + HANDLE_RETURN(cydriver.cuStreamGetCaptureInfo( + stream, &status, NULL, NULL, &deps, &num_deps)) + if num_deps != 1: + raise RuntimeError( + f"expected exactly one capture dependency after a host callback, got {num_deps}") + return deps[0] + + +cdef inline tuple GB_cond_with_params(GraphBuilder gb, node_params): + status, _, graph, *deps_info, num_dependencies = handle_return( + driver.cuStreamGetCaptureInfo(gb._stream.handle) + ) + if status != driver.CUstreamCaptureStatus.CU_STREAM_CAPTURE_STATUS_ACTIVE: + raise RuntimeError("Cannot add conditional node when not actively capturing") + + deps_info_update = [ + [handle_return(driver.cuGraphAddNode(graph, *deps_info, num_dependencies, node_params))] + ] + [None] * (len(deps_info) - 1) + + handle_return( + driver.cuStreamUpdateCaptureDependencies( + gb._stream.handle, + *deps_info_update, # dependencies, edgeData + 1, # numDependencies + driver.CUstreamUpdateCaptureDependencies_flags.CU_STREAM_SET_CAPTURE_DEPENDENCIES, + ) + ) + + return tuple( + GB_init_conditional( + gb._stream.device.create_stream(), + int(node_params.conditional.phGraph_out[i]), + gb, + ) + for i in range(node_params.conditional.size) + ) + + +cdef class Graph: + """An executable graph. + + A graph groups a set of CUDA kernels and other CUDA operations together and executes + them with a specified dependency tree. It speeds up the workflow by combining the + driver activities associated with CUDA kernel launches and CUDA API calls. + + Graphs must be built using a :obj:`~graph.GraphBuilder` object. + + """ + + def __init__(self): + raise RuntimeError("directly constructing a Graph instance is not supported") + + @staticmethod + cdef Graph _init(cydriver.CUgraphExec graph_exec): + cdef Graph self = Graph.__new__(Graph) + self._h_graph_exec = create_graph_exec_handle(graph_exec) + return self + + def close(self) -> None: + """Destroy the graph.""" + self._h_graph_exec.reset() + + @property + def handle(self) -> driver.CUgraphExec: + """Return the underlying ``CUgraphExec`` object. + + .. caution:: + + This handle is a Python object. To get the memory address of the underlying C + handle, call ``int()`` on the returned object. + + """ + return as_py(self._h_graph_exec) + + def update(self, source: "GraphBuilder | GraphDefinition") -> None: + """Update the graph using a new graph definition. + + The topology of the provided source must be identical to this graph. + + Parameters + ---------- + source : :obj:`~graph.GraphBuilder` or :obj:`~graph.GraphDefinition` + The graph definition to update from. A GraphBuilder must have + finished building. + + """ + from cuda.core.graph import GraphDefinition + + cdef cydriver.CUgraph cu_graph + cdef cydriver.CUgraphExec cu_exec = as_cu(self._h_graph_exec) + + if isinstance(source, GraphBuilder): + if (source)._state == CLOSED: + raise ValueError("Source graph builder has been closed.") + if (source)._state != CAPTURE_ENDED: + raise ValueError("Graph has not finished building.") + cu_graph = as_cu((source)._h_graph) + elif isinstance(source, GraphDefinition): + cu_graph = int(source.handle) + else: + raise TypeError( + f"expected GraphBuilder or GraphDefinition, got {type(source).__name__}") + + cdef cydriver.CUgraphExecUpdateResultInfo result_info + cdef cydriver.CUresult err + with nogil: + err = cydriver.cuGraphExecUpdate(cu_exec, cu_graph, &result_info) + if err == cydriver.CUresult.CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE: + reason = driver.CUgraphExecUpdateResult(result_info.result) + msg = f"Graph update failed: {reason.__doc__.strip()} ({reason.name})" + raise CUDAError(msg) + HANDLE_RETURN(err) + + def upload(self, stream: Stream) -> None: + """Uploads the graph in a stream. + + Parameters + ---------- + stream : :obj:`~_stream.Stream` + The stream in which to upload the graph + + """ + cdef cydriver.CUgraphExec c_exec = as_cu(self._h_graph_exec) + cdef cydriver.CUstream c_stream = int(stream.handle) + with nogil: + HANDLE_RETURN(cydriver.cuGraphUpload(c_exec, c_stream)) + + def launch(self, stream: Stream) -> None: + """Launches the graph in a stream. + + Parameters + ---------- + stream : :obj:`~_stream.Stream` + The stream in which to launch the graph. + + """ + cdef cydriver.CUgraphExec c_exec = as_cu(self._h_graph_exec) + cdef cydriver.CUstream c_stream = int(stream.handle) + with nogil: + HANDLE_RETURN(cydriver.cuGraphLaunch(c_exec, c_stream)) diff --git a/cuda_core/cuda/core/graph/_graph_definition.pxd b/cuda_core/cuda/core/graph/_graph_definition.pxd new file mode 100644 index 00000000000..6c15643c2fe --- /dev/null +++ b/cuda_core/cuda/core/graph/_graph_definition.pxd @@ -0,0 +1,24 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from cuda.bindings cimport cydriver +from cuda.core._resource_handles cimport GraphHandle + + +cdef class GraphCondition: + cdef: + cydriver.CUgraphConditionalHandle _c_handle + object __weakref__ + + @staticmethod + cdef GraphCondition _from_handle(cydriver.CUgraphConditionalHandle c_handle) + + +cdef class GraphDefinition: + cdef: + GraphHandle _h_graph + object __weakref__ + + @staticmethod + cdef GraphDefinition _from_handle(GraphHandle h_graph) diff --git a/cuda_core/cuda/core/graph/_graph_definition.pyi b/cuda_core/cuda/core/graph/_graph_definition.pyi new file mode 100644 index 00000000000..89652d879b0 --- /dev/null +++ b/cuda_core/cuda/core/graph/_graph_definition.pyi @@ -0,0 +1,244 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/graph/_graph_definition.pyx + +"""GraphDefinition: explicit CUDA graph definition.""" +from __future__ import annotations + +from cuda.core._device import Device +from cuda.core._event import Event +from cuda.core._launch_config import LaunchConfig +from cuda.core._memory._buffer import Buffer +from cuda.core._module import Kernel +from cuda.core._utils.cuda_utils import driver +from cuda.core.graph._graph_builder import (Graph, GraphCompleteOptions, + GraphDebugPrintOptions) +from cuda.core.graph._graph_node import GraphNode +from cuda.core.graph._subclasses import (AllocNode, ChildGraphNode, EmptyNode, + EventRecordNode, EventWaitNode, + FreeNode, HostCallbackNode, + IfElseNode, IfNode, KernelNode, + MemcpyNode, MemsetNode, SwitchNode, + WhileNode) +from cuda.core.typing import GraphMemoryType + + +class GraphCondition: + """A condition variable for conditional graph nodes. + + Created by :meth:`GraphDefinition.create_condition` (or + :meth:`GraphBuilder.create_condition`) and passed to + conditional-node builder methods (:meth:`~GraphDefinition.if_then`, + :meth:`~GraphDefinition.if_else`, :meth:`~GraphDefinition.while_loop`, + :meth:`~GraphDefinition.switch`). The underlying value is set at + runtime by device code via ``cudaGraphSetConditional``. + + A :class:`GraphCondition` may be passed directly as a kernel + argument to ``launch()``: the launcher unwraps it to the underlying + ``CUgraphConditionalHandle`` value so device code can update the + condition. + """ + + def __repr__(self) -> str: + ... + + def __eq__(self, other: object) -> bool: + ... + + def __hash__(self) -> int: + ... + + @property + def handle(self) -> driver.CUgraphConditionalHandle: + """The raw CUgraphConditionalHandle as an int.""" + +class GraphDefinition: + """A graph definition. + + A GraphDefinition is used to construct a graph explicitly by adding nodes + and specifying dependencies. Once construction is complete, call + instantiate() to obtain an executable Graph. + """ + + def __init__(self): + """Create a new empty graph definition.""" + + def __repr__(self) -> str: + ... + + def __eq__(self, other: object) -> bool: + ... + + def __hash__(self) -> int: + ... + + @property + def _entry(self) -> GraphNode: + """Return the internal entry-point GraphNode (no dependencies).""" + + def allocate(self, size: int, *, device: Device | int | None=None, memory_type: GraphMemoryType=..., peer_access: list[Device | int] | None=None) -> AllocNode: + """Add an entry-point memory allocation node (no dependencies). + + See :meth:`GraphNode.allocate` for full documentation. + """ + + def deallocate(self, dptr: int) -> FreeNode: + """Add an entry-point memory free node (no dependencies). + + See :meth:`GraphNode.deallocate` for full documentation. + """ + + def memset(self, dst: Buffer | int, value, width: int, height: int=1, pitch: int=0, *, dst_owner=None) -> MemsetNode: + """Add an entry-point memset node (no dependencies). + + See :meth:`GraphNode.memset` for full documentation. + """ + + def launch(self, config: LaunchConfig, kernel: Kernel, *args) -> KernelNode: + """Add an entry-point kernel launch node (no dependencies). + + See :meth:`GraphNode.launch` for full documentation. + """ + + def empty(self) -> EmptyNode: + """Add an entry-point empty node (no dependencies). + + Returns + ------- + EmptyNode + A new EmptyNode with no dependencies. + """ + + def join(self, *nodes: GraphNode) -> EmptyNode: + """Create an empty node that depends on all given nodes. + + Parameters + ---------- + *nodes : GraphNode + Nodes to merge. + + Returns + ------- + EmptyNode + A new EmptyNode that depends on all input nodes. + """ + + def memcpy(self, dst: Buffer | int, src: Buffer | int, size: int, *, dst_owner=None, src_owner=None) -> MemcpyNode: + """Add an entry-point memcpy node (no dependencies). + + See :meth:`GraphNode.memcpy` for full documentation. + """ + + def embed(self, child: GraphDefinition) -> ChildGraphNode: + """Add an entry-point child graph node (no dependencies). + + See :meth:`GraphNode.embed` for full documentation. + """ + + def record(self, event: Event) -> EventRecordNode: + """Add an entry-point event record node (no dependencies). + + See :meth:`GraphNode.record` for full documentation. + """ + + def wait(self, event: Event) -> EventWaitNode: + """Add an entry-point event wait node (no dependencies). + + See :meth:`GraphNode.wait` for full documentation. + """ + + def callback(self, fn, *, user_data=None) -> HostCallbackNode: + """Add an entry-point host callback node (no dependencies). + + See :meth:`GraphNode.callback` for full documentation. + """ + + def create_condition(self, default_value: int | None=None) -> GraphCondition: + """Create a condition variable for use with conditional nodes. + + The returned :class:`GraphCondition` object is passed to conditional-node + builder methods. Its value is controlled at runtime by device code + via ``cudaGraphSetConditional``. + + Parameters + ---------- + default_value : int, optional + The default value to assign to the condition. + If None, no default is assigned. + + Returns + ------- + GraphCondition + A condition variable for controlling conditional execution. + """ + + def if_then(self, condition: GraphCondition) -> IfNode: + """Add an entry-point if-conditional node (no dependencies). + + See :meth:`GraphNode.if_then` for full documentation. + """ + + def if_else(self, condition: GraphCondition) -> IfElseNode: + """Add an entry-point if-else conditional node (no dependencies). + + See :meth:`GraphNode.if_else` for full documentation. + """ + + def while_loop(self, condition: GraphCondition) -> WhileNode: + """Add an entry-point while-loop conditional node (no dependencies). + + See :meth:`GraphNode.while_loop` for full documentation. + """ + + def switch(self, condition: GraphCondition, count: int) -> SwitchNode: + """Add an entry-point switch conditional node (no dependencies). + + See :meth:`GraphNode.switch` for full documentation. + """ + + def instantiate(self, options: GraphCompleteOptions | None=None) -> Graph: + """Instantiate the graph definition into an executable Graph. + + Parameters + ---------- + options : :obj:`~graph.GraphCompleteOptions`, optional + Customizable dataclass for graph instantiation options. + + Returns + ------- + Graph + An executable graph that can be launched on a stream. + """ + + def debug_dot_print(self, path: str, options: GraphDebugPrintOptions | None=None) -> None: + """Write a GraphViz DOT representation of the graph to a file. + + Parameters + ---------- + path : str + File path for the DOT output. + options : GraphDebugPrintOptions, optional + Customizable options for the debug print. + """ + + def nodes(self) -> set[GraphNode]: + """Return all nodes in the graph. + + Returns + ------- + set of GraphNode + All nodes in the graph. + """ + + def edges(self) -> set[tuple[GraphNode, GraphNode]]: + """Return all edges in the graph as (from_node, to_node) pairs. + + Returns + ------- + set of tuple + Each element is a (from_node, to_node) pair representing + a dependency edge in the graph. + """ + + @property + def handle(self) -> driver.CUgraph: + """Return the underlying driver CUgraph handle.""" +__all__ = ['GraphCondition', 'GraphDefinition'] \ No newline at end of file diff --git a/cuda_core/cuda/core/graph/_graph_definition.pyx b/cuda_core/cuda/core/graph/_graph_definition.pyx new file mode 100644 index 00000000000..0bd05318caf --- /dev/null +++ b/cuda_core/cuda/core/graph/_graph_definition.pyx @@ -0,0 +1,417 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +"""GraphDefinition: explicit CUDA graph definition.""" + +from __future__ import annotations + +from libc.stddef cimport size_t + +from libcpp.vector cimport vector + +from cuda.bindings cimport cydriver + +from cuda.core.graph._graph_node cimport GraphNode +from cuda.core._resource_handles cimport ( + GraphHandle, + as_cu, + as_intptr, + as_py, + create_graph_handle, + create_graph_node_handle, +) +from cuda.core._utils.cuda_utils cimport HANDLE_RETURN + +from typing import TYPE_CHECKING + +from cuda.core._utils.cuda_utils import driver + +from cuda.core.typing import GraphMemoryType + +if TYPE_CHECKING: + from cuda.core._device import Device + from cuda.core._event import Event + from cuda.core._launch_config import LaunchConfig + from cuda.core._memory._buffer import Buffer + from cuda.core._module import Kernel + from cuda.core.graph._graph_builder import ( + Graph, + GraphCompleteOptions, + GraphDebugPrintOptions, + ) + from cuda.core.graph._subclasses import ( + AllocNode, + ChildGraphNode, + EmptyNode, + EventRecordNode, + EventWaitNode, + FreeNode, + HostCallbackNode, + IfElseNode, + IfNode, + KernelNode, + MemcpyNode, + MemsetNode, + SwitchNode, + WhileNode, + ) + +__all__ = ['GraphCondition', 'GraphDefinition'] + + +cdef class GraphCondition: + """A condition variable for conditional graph nodes. + + Created by :meth:`GraphDefinition.create_condition` (or + :meth:`GraphBuilder.create_condition`) and passed to + conditional-node builder methods (:meth:`~GraphDefinition.if_then`, + :meth:`~GraphDefinition.if_else`, :meth:`~GraphDefinition.while_loop`, + :meth:`~GraphDefinition.switch`). The underlying value is set at + runtime by device code via ``cudaGraphSetConditional``. + + A :class:`GraphCondition` may be passed directly as a kernel + argument to ``launch()``: the launcher unwraps it to the underlying + ``CUgraphConditionalHandle`` value so device code can update the + condition. + """ + + @staticmethod + cdef GraphCondition _from_handle(cydriver.CUgraphConditionalHandle c_handle): + cdef GraphCondition self = GraphCondition.__new__(GraphCondition) + self._c_handle = c_handle + return self + + def __repr__(self) -> str: + return f"self._c_handle:x}>" + + def __eq__(self, other: object) -> bool: + if not isinstance(other, GraphCondition): + return NotImplemented + return self._c_handle == (other)._c_handle + + def __hash__(self) -> int: + return hash(self._c_handle) + + @property + def handle(self) -> driver.CUgraphConditionalHandle: + """The raw CUgraphConditionalHandle as an int.""" + return self._c_handle + + +cdef class GraphDefinition: + """A graph definition. + + A GraphDefinition is used to construct a graph explicitly by adding nodes + and specifying dependencies. Once construction is complete, call + instantiate() to obtain an executable Graph. + """ + + def __init__(self): + """Create a new empty graph definition.""" + cdef cydriver.CUgraph graph = NULL + with nogil: + HANDLE_RETURN(cydriver.cuGraphCreate(&graph, 0)) + self._h_graph = create_graph_handle(graph) + + @staticmethod + cdef GraphDefinition _from_handle(GraphHandle h_graph): + """Create a GraphDefinition from an existing GraphHandle (internal use).""" + cdef GraphDefinition g = GraphDefinition.__new__(GraphDefinition) + g._h_graph = h_graph + return g + + def __repr__(self) -> str: + return f"" + + def __eq__(self, other: object) -> bool: + if not isinstance(other, GraphDefinition): + return NotImplemented + return as_intptr(self._h_graph) == as_intptr((other)._h_graph) + + def __hash__(self) -> int: + return hash(as_intptr(self._h_graph)) + + @property + def _entry(self) -> GraphNode: + """Return the internal entry-point GraphNode (no dependencies).""" + cdef GraphNode n = GraphNode.__new__(GraphNode) + n._h_node = create_graph_node_handle(NULL, self._h_graph) + return n + + def allocate(self, size_t size, *, device: Device | int | None = None, + memory_type: GraphMemoryType = GraphMemoryType.DEVICE, + peer_access: list[Device | int] | None = None) -> AllocNode: + """Add an entry-point memory allocation node (no dependencies). + + See :meth:`GraphNode.allocate` for full documentation. + """ + return self._entry.allocate(size, device=device, memory_type=memory_type, peer_access=peer_access) + + def deallocate(self, dptr: int) -> FreeNode: + """Add an entry-point memory free node (no dependencies). + + See :meth:`GraphNode.deallocate` for full documentation. + """ + return self._entry.deallocate(dptr) + + def memset( + self, + dst: Buffer | int, + value, + size_t width, + size_t height=1, + size_t pitch=0, + *, + dst_owner=None, + ) -> MemsetNode: + """Add an entry-point memset node (no dependencies). + + See :meth:`GraphNode.memset` for full documentation. + """ + return self._entry.memset( + dst, value, width, height=height, pitch=pitch, dst_owner=dst_owner + ) + + def launch(self, config: LaunchConfig, kernel: Kernel, *args) -> KernelNode: + """Add an entry-point kernel launch node (no dependencies). + + See :meth:`GraphNode.launch` for full documentation. + """ + return self._entry.launch(config, kernel, *args) + + def empty(self) -> EmptyNode: + """Add an entry-point empty node (no dependencies). + + Returns + ------- + EmptyNode + A new EmptyNode with no dependencies. + """ + return self._entry.join() + + def join(self, *nodes: GraphNode) -> EmptyNode: + """Create an empty node that depends on all given nodes. + + Parameters + ---------- + *nodes : GraphNode + Nodes to merge. + + Returns + ------- + EmptyNode + A new EmptyNode that depends on all input nodes. + """ + return self._entry.join(*nodes) + + def memcpy(self, dst: Buffer | int, src: Buffer | int, size_t size, *, dst_owner=None, src_owner=None) -> MemcpyNode: + """Add an entry-point memcpy node (no dependencies). + + See :meth:`GraphNode.memcpy` for full documentation. + """ + return self._entry.memcpy(dst, src, size, dst_owner=dst_owner, src_owner=src_owner) + + def embed(self, child: GraphDefinition) -> ChildGraphNode: + """Add an entry-point child graph node (no dependencies). + + See :meth:`GraphNode.embed` for full documentation. + """ + return self._entry.embed(child) + + def record(self, event: Event) -> EventRecordNode: + """Add an entry-point event record node (no dependencies). + + See :meth:`GraphNode.record` for full documentation. + """ + return self._entry.record(event) + + def wait(self, event: Event) -> EventWaitNode: + """Add an entry-point event wait node (no dependencies). + + See :meth:`GraphNode.wait` for full documentation. + """ + return self._entry.wait(event) + + def callback(self, fn, *, user_data=None) -> HostCallbackNode: + """Add an entry-point host callback node (no dependencies). + + See :meth:`GraphNode.callback` for full documentation. + """ + return self._entry.callback(fn, user_data=user_data) + + def create_condition(self, default_value: int | None = None) -> GraphCondition: + """Create a condition variable for use with conditional nodes. + + The returned :class:`GraphCondition` object is passed to conditional-node + builder methods. Its value is controlled at runtime by device code + via ``cudaGraphSetConditional``. + + Parameters + ---------- + default_value : int, optional + The default value to assign to the condition. + If None, no default is assigned. + + Returns + ------- + GraphCondition + A condition variable for controlling conditional execution. + """ + cdef cydriver.CUgraphConditionalHandle c_handle + cdef unsigned int flags = 0 + cdef unsigned int default_val = 0 + + if default_value is not None: + default_val = default_value + flags = cydriver.CU_GRAPH_COND_ASSIGN_DEFAULT + + cdef cydriver.CUcontext ctx = NULL + with nogil: + HANDLE_RETURN(cydriver.cuCtxGetCurrent(&ctx)) + HANDLE_RETURN(cydriver.cuGraphConditionalHandleCreate( + &c_handle, as_cu(self._h_graph), ctx, default_val, flags)) + + return GraphCondition._from_handle(c_handle) + + def if_then(self, condition: GraphCondition) -> IfNode: + """Add an entry-point if-conditional node (no dependencies). + + See :meth:`GraphNode.if_then` for full documentation. + """ + return self._entry.if_then(condition) + + def if_else(self, condition: GraphCondition) -> IfElseNode: + """Add an entry-point if-else conditional node (no dependencies). + + See :meth:`GraphNode.if_else` for full documentation. + """ + return self._entry.if_else(condition) + + def while_loop(self, condition: GraphCondition) -> WhileNode: + """Add an entry-point while-loop conditional node (no dependencies). + + See :meth:`GraphNode.while_loop` for full documentation. + """ + return self._entry.while_loop(condition) + + def switch(self, condition: GraphCondition, unsigned int count) -> SwitchNode: + """Add an entry-point switch conditional node (no dependencies). + + See :meth:`GraphNode.switch` for full documentation. + """ + return self._entry.switch(condition, count) + + def instantiate(self, options: GraphCompleteOptions | None = None) -> Graph: + """Instantiate the graph definition into an executable Graph. + + Parameters + ---------- + options : :obj:`~graph.GraphCompleteOptions`, optional + Customizable dataclass for graph instantiation options. + + Returns + ------- + Graph + An executable graph that can be launched on a stream. + """ + from cuda.core.graph._graph_builder import _instantiate_graph + + return _instantiate_graph( + driver.CUgraph(as_intptr(self._h_graph)), options) + + def debug_dot_print(self, path: str, options: GraphDebugPrintOptions | None = None) -> None: + """Write a GraphViz DOT representation of the graph to a file. + + Parameters + ---------- + path : str + File path for the DOT output. + options : GraphDebugPrintOptions, optional + Customizable options for the debug print. + """ + from cuda.core.graph._graph_builder import GraphDebugPrintOptions + + cdef unsigned int flags = 0 + if options is not None: + if not isinstance(options, GraphDebugPrintOptions): + raise TypeError("options must be a GraphDebugPrintOptions instance") + flags = options._to_flags() + + cdef bytes path_bytes = path.encode('utf-8') + cdef const char* c_path = path_bytes + with nogil: + HANDLE_RETURN(cydriver.cuGraphDebugDotPrint(as_cu(self._h_graph), c_path, flags)) + + def nodes(self) -> set[GraphNode]: + """Return all nodes in the graph. + + Returns + ------- + set of GraphNode + All nodes in the graph. + """ + cdef vector[cydriver.CUgraphNode] nodes_vec + nodes_vec.resize(128) + cdef size_t num_nodes = 128 + + with nogil: + HANDLE_RETURN(cydriver.cuGraphGetNodes(as_cu(self._h_graph), nodes_vec.data(), &num_nodes)) + + if num_nodes == 0: + return set() + + if num_nodes > 128: + nodes_vec.resize(num_nodes) + with nogil: + HANDLE_RETURN(cydriver.cuGraphGetNodes(as_cu(self._h_graph), nodes_vec.data(), &num_nodes)) + + return {GraphNode._create(self._h_graph, nodes_vec[i]) for i in range(num_nodes)} + + def edges(self) -> set[tuple[GraphNode, GraphNode]]: + """Return all edges in the graph as (from_node, to_node) pairs. + + Returns + ------- + set of tuple + Each element is a (from_node, to_node) pair representing + a dependency edge in the graph. + """ + cdef vector[cydriver.CUgraphNode] from_nodes + cdef vector[cydriver.CUgraphNode] to_nodes + from_nodes.resize(128) + to_nodes.resize(128) + cdef size_t num_edges = 128 + + with nogil: + IF CUDA_CORE_BUILD_MAJOR >= 13: + HANDLE_RETURN(cydriver.cuGraphGetEdges( + as_cu(self._h_graph), from_nodes.data(), to_nodes.data(), NULL, &num_edges)) + ELSE: + HANDLE_RETURN(cydriver.cuGraphGetEdges( + as_cu(self._h_graph), from_nodes.data(), to_nodes.data(), &num_edges)) + + if num_edges == 0: + return set() + + if num_edges > 128: + from_nodes.resize(num_edges) + to_nodes.resize(num_edges) + with nogil: + IF CUDA_CORE_BUILD_MAJOR >= 13: + HANDLE_RETURN(cydriver.cuGraphGetEdges( + as_cu(self._h_graph), from_nodes.data(), to_nodes.data(), NULL, &num_edges)) + ELSE: + HANDLE_RETURN(cydriver.cuGraphGetEdges( + as_cu(self._h_graph), from_nodes.data(), to_nodes.data(), &num_edges)) + + return { + (GraphNode._create(self._h_graph, from_nodes[i]), + GraphNode._create(self._h_graph, to_nodes[i])) + for i in range(num_edges) + } + + @property + def handle(self) -> driver.CUgraph: + """Return the underlying driver CUgraph handle.""" + return as_py(self._h_graph) diff --git a/cuda_core/cuda/core/graph/_graph_node.pxd b/cuda_core/cuda/core/graph/_graph_node.pxd new file mode 100644 index 00000000000..0a87b70ad62 --- /dev/null +++ b/cuda_core/cuda/core/graph/_graph_node.pxd @@ -0,0 +1,15 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from cuda.bindings cimport cydriver +from cuda.core._resource_handles cimport GraphHandle, GraphNodeHandle + + +cdef class GraphNode: + cdef: + GraphNodeHandle _h_node + object __weakref__ + + @staticmethod + cdef GraphNode _create(GraphHandle h_graph, cydriver.CUgraphNode node) diff --git a/cuda_core/cuda/core/graph/_graph_node.pyi b/cuda_core/cuda/core/graph/_graph_node.pyi new file mode 100644 index 00000000000..962468924b4 --- /dev/null +++ b/cuda_core/cuda/core/graph/_graph_node.pyi @@ -0,0 +1,408 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/graph/_graph_node.pyx + +"""GraphNode base class — factory, properties, and builder methods.""" +from __future__ import annotations + +import weakref +from collections.abc import Iterable + +from cuda.core._device import Device +from cuda.core._event import Event +from cuda.core._launch_config import LaunchConfig +from cuda.core._memory._buffer import Buffer +from cuda.core._module import Kernel +from cuda.core._utils.cuda_utils import driver +from cuda.core.graph._adjacency_set_proxy import AdjacencySetProxy +from cuda.core.graph._graph_definition import GraphCondition, GraphDefinition +from cuda.core.graph._subclasses import (AllocNode, ChildGraphNode, EmptyNode, + EventRecordNode, EventWaitNode, + FreeNode, IfElseNode, IfNode, + KernelNode, MemcpyNode, MemsetNode, + SwitchNode, WhileNode) +from cuda.core.typing import GraphMemoryType + + +class GraphNode: + """A node in a graph definition. + + Nodes are created by calling builder methods on GraphDefinition (for + entry-point nodes with no dependencies) or on other Nodes (for + nodes that depend on a predecessor). + """ + + def __repr__(self) -> str: + ... + + def __eq__(self, other: object) -> bool: + ... + + def __hash__(self) -> int: + ... + + @property + def type(self) -> driver.CUgraphNodeType | None: + """Return the CUDA graph node type. + + Returns + ------- + CUgraphNodeType or None + The node type enum value, or None for the entry node. + """ + + @property + def graph(self) -> GraphDefinition: + """Return the GraphDefinition this node belongs to.""" + + @property + def handle(self) -> driver.CUgraphNode: + """Return the underlying driver CUgraphNode handle. + + Returns None for the entry node. + """ + + @property + def is_valid(self) -> bool: + """Whether this node is valid (not destroyed). + + Returns ``False`` after :meth:`destroy` has been called. + """ + + def destroy(self) -> None: + """Destroy this node and remove all its edges from the parent graph. + + After this call, :attr:`is_valid` returns ``False`` and the node + cannot be re-added to any graph. Safe to call on an + already-destroyed node (no-op). + """ + + @property + def pred(self) -> AdjacencySetProxy: + """A mutable set-like view of this node's predecessors.""" + + @pred.setter + def pred(self, value: Iterable[GraphNode]) -> None: + ... + + @property + def succ(self) -> AdjacencySetProxy: + """A mutable set-like view of this node's successors.""" + + @succ.setter + def succ(self, value: Iterable[GraphNode]) -> None: + ... + + def launch(self, config: LaunchConfig, kernel: Kernel, *args) -> KernelNode: + """Add a kernel launch node depending on this node. + + Parameters + ---------- + config : LaunchConfig + Launch configuration (grid, block, shared memory, etc.) + kernel : Kernel + The kernel to launch. + *args + Kernel arguments. + + Returns + ------- + KernelNode + A new KernelNode representing the kernel launch. + """ + + def join(self, *nodes: GraphNode) -> EmptyNode: + """Create an empty node that depends on this node and all given nodes. + + This is used to synchronize multiple branches of execution. + + Parameters + ---------- + *nodes : GraphNode + Additional nodes to depend on. + + Returns + ------- + EmptyNode + A new EmptyNode that depends on all input nodes. + """ + + def allocate(self, size: int, *, device: Device | int | None=None, memory_type: GraphMemoryType=..., peer_access: list[Device | int] | None=None) -> AllocNode: + """Add a memory allocation node depending on this node. + + Parameters + ---------- + size : int + Number of bytes to allocate. + device : int or Device, optional + The device on which to allocate memory. If None (default), + uses the current CUDA context's device. + memory_type : GraphMemoryType or str, optional + Type of memory to allocate. One of: + + - ``GraphMemoryType.DEVICE`` (default): Pinned device memory, + optimal for GPU kernels. + - ``GraphMemoryType.HOST``: Pinned host memory, accessible from + both host and device. Useful for graphs containing host + callback nodes. Note: may not be supported on all + systems/drivers. + - ``GraphMemoryType.MANAGED``: Managed/unified memory that + automatically migrates between host and device. Useful for + mixed host/device access patterns. + + peer_access : list of int or Device, optional + List of devices that should have read-write access to the + allocated memory. If None (default), only the allocating + device has access. + + Returns + ------- + AllocNode + A new AllocNode representing the allocation. Access the allocated + device pointer via the dptr property. + + Notes + ----- + IPC (inter-process communication) is not supported for graph + memory allocation nodes per CUDA documentation. + """ + + def deallocate(self, dptr: int) -> FreeNode: + """Add a memory free node depending on this node. + + Parameters + ---------- + dptr : int + Device pointer to free (typically from AllocNode.dptr). + + Returns + ------- + FreeNode + A new FreeNode representing the free operation. + """ + + def memset(self, dst: Buffer | int, value, width: int, height: int=1, pitch: int=0, *, dst_owner=None) -> MemsetNode: + """Add a memset node depending on this node. + + Parameters + ---------- + dst : Buffer or int + Destination. When ``dst`` is a :class:`Buffer`, the underlying + allocation is retained for the graph's lifetime. A raw pointer + (``int``) is used as-is; the caller must keep the underlying memory + alive, or supply ``dst_owner`` to have the graph retain it. + value : int or buffer-protocol object + Fill value. int for 1-byte fill (range [0, 256)), + or buffer-protocol object of 1, 2, or 4 bytes. + width : int + Width of the row in elements. + height : int, optional + Number of rows (default 1). + pitch : int, optional + Pitch of destination in bytes (default 0, unused if height is 1). + dst_owner : object, optional + Object retained for the graph's lifetime when ``dst`` is a raw + pointer. A :class:`Buffer` owner retains its underlying allocation, + not the wrapper. Must not be passed when ``dst`` is a :class:`Buffer`. + + Returns + ------- + MemsetNode + A new MemsetNode representing the memset operation. + + Raises + ------ + ValueError + If ``dst_owner`` is given together with a :class:`Buffer` ``dst``. + """ + + def memcpy(self, dst: Buffer | int, src: Buffer | int, size: int, *, dst_owner=None, src_owner=None) -> MemcpyNode: + """Add a memcpy node depending on this node. + + Copies ``size`` bytes from ``src`` to ``dst``. Memory types are + auto-detected via the driver, so both device and pinned host + pointers are supported. + + Parameters + ---------- + dst : Buffer or int + Destination (device or pinned host). When a :class:`Buffer` is given, + the underlying allocation is retained for the graph's lifetime. A raw + pointer (``int``) is used as-is; the caller must keep the underlying + memory alive, or supply ``dst_owner`` to have the graph retain it. + src : Buffer or int + Source (device or pinned host). Same retention rules as ``dst``; + use ``src_owner`` for a raw pointer. + size : int + Number of bytes to copy. + dst_owner : object, optional + Object retained for the graph's lifetime when ``dst`` is a raw + pointer. A :class:`Buffer` owner retains its underlying allocation. + Must not be passed when ``dst`` is a :class:`Buffer`. + src_owner : object, optional + Object retained for the graph's lifetime when ``src`` is a raw + pointer. A :class:`Buffer` owner retains its underlying allocation. + Must not be passed when ``src`` is a :class:`Buffer`. + + Returns + ------- + MemcpyNode + A new MemcpyNode representing the copy operation. + + Raises + ------ + ValueError + If ``dst_owner`` or ``src_owner`` is given together with a + :class:`Buffer` ``dst`` or ``src`` respectively. + """ + + def embed(self, child: GraphDefinition) -> ChildGraphNode: + """Add a child graph node depending on this node. + + Embeds a clone of the given graph definition as a sub-graph node. + The child graph must not contain allocation, free, or conditional + nodes. + + Parameters + ---------- + child : GraphDefinition + The graph definition to embed (will be cloned). + + Returns + ------- + ChildGraphNode + A new ChildGraphNode representing the embedded sub-graph. + """ + + def record(self, event: Event) -> EventRecordNode: + """Add an event record node depending on this node. + + Parameters + ---------- + event : Event + The event to record. + + Returns + ------- + EventRecordNode + A new EventRecordNode representing the event record operation. + """ + + def wait(self, event: Event) -> EventWaitNode: + """Add an event wait node depending on this node. + + Parameters + ---------- + event : Event + The event to wait for. + + Returns + ------- + EventWaitNode + A new EventWaitNode representing the event wait operation. + """ + + def callback(self, fn, *, user_data=None) -> object: + """Add a host callback node depending on this node. + + The callback runs on the host CPU when the graph reaches this node. + Two modes are supported: + + - **Python callable**: Pass any callable. The GIL is acquired + automatically. The callable must take no arguments; use closures + or ``functools.partial`` to bind state. + - **ctypes function pointer**: Pass a ``ctypes.CFUNCTYPE`` instance. + The function receives a single ``void*`` argument (the + ``user_data``). The caller must keep the ctypes wrapper alive + for the lifetime of the graph. + + .. warning:: + + Callbacks must not call CUDA API functions. Doing so may + deadlock or corrupt driver state. + + Parameters + ---------- + fn : callable or ctypes function pointer + The callback function. + user_data : int or bytes-like, optional + Only for ctypes function pointers. If ``int``, passed as a raw + pointer (caller manages lifetime). If bytes-like, the data is + copied and its lifetime is tied to the graph. + + Returns + ------- + HostCallbackNode + A new HostCallbackNode representing the callback. + """ + + def if_then(self, condition: GraphCondition) -> IfNode: + """Add an if-conditional node depending on this node. + + The body graph executes only when the condition evaluates to + a non-zero value at runtime. + + Parameters + ---------- + condition : GraphCondition + GraphCondition from :meth:`GraphDefinition.create_condition`. + + Returns + ------- + IfNode + A new IfNode with one branch accessible via ``.then``. + """ + + def if_else(self, condition: GraphCondition) -> IfElseNode: + """Add an if-else conditional node depending on this node. + + Two body graphs: the first executes when the condition is + non-zero, the second when it is zero. + + Parameters + ---------- + condition : GraphCondition + GraphCondition from :meth:`GraphDefinition.create_condition`. + + Returns + ------- + IfElseNode + A new IfElseNode with branches accessible via + ``.then`` and ``.else_``. + """ + + def while_loop(self, condition: GraphCondition) -> WhileNode: + """Add a while-loop conditional node depending on this node. + + The body graph executes repeatedly while the condition + evaluates to a non-zero value. + + Parameters + ---------- + condition : GraphCondition + GraphCondition from :meth:`GraphDefinition.create_condition`. + + Returns + ------- + WhileNode + A new WhileNode with body accessible via ``.body``. + """ + + def switch(self, condition: GraphCondition, count: int) -> SwitchNode: + """Add a switch conditional node depending on this node. + + The condition value selects which branch to execute. If the + value is out of range, no branch executes. + + Parameters + ---------- + condition : GraphCondition + GraphCondition from :meth:`GraphDefinition.create_condition`. + count : int + Number of switch cases (branches). + + Returns + ------- + SwitchNode + A new SwitchNode with branches accessible via ``.branches``. + """ +__all__ = ['GraphNode'] +_node_registry: weakref.WeakValueDictionary[int, GraphNode] = weakref.WeakValueDictionary() \ No newline at end of file diff --git a/cuda_core/cuda/core/graph/_graph_node.pyx b/cuda_core/cuda/core/graph/_graph_node.pyx new file mode 100644 index 00000000000..077eff77ea0 --- /dev/null +++ b/cuda_core/cuda/core/graph/_graph_node.pyx @@ -0,0 +1,1115 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +"""GraphNode base class — factory, properties, and builder methods.""" + +from __future__ import annotations + +from collections.abc import Iterable +from typing import TYPE_CHECKING + +from libc.stddef cimport size_t +from libc.stdint cimport uintptr_t +from libc.string cimport memset as c_memset + +from libcpp.vector cimport vector + +from cuda.bindings cimport cydriver + +from cuda.core._event cimport Event +from cuda.core._kernel_arg_handler cimport ParamHolder +from cuda.core._launch_config cimport LaunchConfig +from cuda.core._memory._buffer cimport Buffer +from cuda.core._module cimport Kernel +from cuda.core.graph._graph_definition cimport GraphCondition, GraphDefinition +from cuda.core.graph._subclasses cimport ( + AllocNode, + ChildGraphNode, + ConditionalNode, + EmptyNode, + EventRecordNode, + EventWaitNode, + FreeNode, + HostCallbackNode, + IfElseNode, + IfNode, + KernelNode, + MemcpyNode, + MemsetNode, + SwitchNode, + WhileNode, +) +from cuda.core._resource_handles cimport ( + GraphHandle, + GraphNodeHandle, + OpaqueHandle, + as_cu, + as_intptr, + as_py, + create_graph_handle_ref, + create_graph_node_handle, + graph_node_get_graph, + graph_set_slot, + invalidate_graph_node, + make_opaque_py, +) +from cuda.core._utils.cuda_utils cimport HANDLE_RETURN, _parse_fill_value + +from cuda.core.graph._host_callback cimport ( + _attach_host_callback_owners, + _resolve_host_callback, +) + +import ctypes as ct +import weakref + +from cuda.core.graph._adjacency_set_proxy import AdjacencySetProxy +from cuda.core._utils.cuda_utils import driver +from cuda.core.typing import GraphMemoryType + +if TYPE_CHECKING: + from cuda.core._device import Device + +__all__ = ['GraphNode'] + +# See _cpp/REGISTRY_DESIGN.md (Level 2: Resource Handle -> Python Object) +_node_registry: weakref.WeakValueDictionary[int, GraphNode] = weakref.WeakValueDictionary() + + +cdef inline GraphNode _registered(GraphNode n): + return _node_registry.setdefault(n._h_node.get(), n) + + +cdef class GraphNode: + """A node in a graph definition. + + Nodes are created by calling builder methods on GraphDefinition (for + entry-point nodes with no dependencies) or on other Nodes (for + nodes that depend on a predecessor). + """ + + @staticmethod + cdef GraphNode _create(GraphHandle h_graph, cydriver.CUgraphNode node): + """Factory: dispatch to the right subclass based on node type.""" + return GN_create(h_graph, node) + + def __repr__(self) -> str: + cdef cydriver.CUgraphNode node = as_cu(self._h_node) + if node == NULL: + return "" + return f"node:x}>" + + def __eq__(self, other: object) -> bool: + if not isinstance(other, GraphNode): + return NotImplemented + cdef GraphNode o = other + cdef GraphHandle self_graph = graph_node_get_graph(self._h_node) + cdef GraphHandle other_graph = graph_node_get_graph(o._h_node) + return (as_intptr(self._h_node) == as_intptr(o._h_node) + and as_intptr(self_graph) == as_intptr(other_graph)) + + def __hash__(self) -> int: + cdef GraphHandle g = graph_node_get_graph(self._h_node) + return hash((as_intptr(self._h_node), as_intptr(g))) + + @property + def type(self) -> driver.CUgraphNodeType | None: + """Return the CUDA graph node type. + + Returns + ------- + CUgraphNodeType or None + The node type enum value, or None for the entry node. + """ + cdef cydriver.CUgraphNode node = as_cu(self._h_node) + if node == NULL: + return None + cdef cydriver.CUgraphNodeType node_type + with nogil: + HANDLE_RETURN(cydriver.cuGraphNodeGetType(node, &node_type)) + return driver.CUgraphNodeType(node_type) + + @property + def graph(self) -> GraphDefinition: + """Return the GraphDefinition this node belongs to.""" + return GraphDefinition._from_handle(graph_node_get_graph(self._h_node)) + + @property + def handle(self) -> driver.CUgraphNode: + """Return the underlying driver CUgraphNode handle. + + Returns None for the entry node. + """ + return as_py(self._h_node) + + @property + def is_valid(self) -> bool: + """Whether this node is valid (not destroyed). + + Returns ``False`` after :meth:`destroy` has been called. + """ + return as_intptr(self._h_node) != 0 + + def destroy(self) -> None: + """Destroy this node and remove all its edges from the parent graph. + + After this call, :attr:`is_valid` returns ``False`` and the node + cannot be re-added to any graph. Safe to call on an + already-destroyed node (no-op). + """ + cdef cydriver.CUgraphNode node = as_cu(self._h_node) + if node == NULL: + return + + _node_registry.pop(self._h_node.get(), None) + invalidate_graph_node(self._h_node) + with nogil: + HANDLE_RETURN(cydriver.cuGraphDestroyNode(node)) + + @property + def pred(self) -> AdjacencySetProxy: + """A mutable set-like view of this node's predecessors.""" + return AdjacencySetProxy(self, False) + + @pred.setter + def pred(self, value: Iterable[GraphNode]) -> None: + p = AdjacencySetProxy(self, False) + p.clear() + p.update(value) + + @property + def succ(self) -> AdjacencySetProxy: + """A mutable set-like view of this node's successors.""" + return AdjacencySetProxy(self, True) + + @succ.setter + def succ(self, value: Iterable[GraphNode]) -> None: + s = AdjacencySetProxy(self, True) + s.clear() + s.update(value) + + def launch(self, config: LaunchConfig, kernel: Kernel, *args) -> KernelNode: + """Add a kernel launch node depending on this node. + + Parameters + ---------- + config : LaunchConfig + Launch configuration (grid, block, shared memory, etc.) + kernel : Kernel + The kernel to launch. + *args + Kernel arguments. + + Returns + ------- + KernelNode + A new KernelNode representing the kernel launch. + """ + return GN_launch(self, config, kernel, ParamHolder(args)) + + def join(self, *nodes: GraphNode) -> EmptyNode: + """Create an empty node that depends on this node and all given nodes. + + This is used to synchronize multiple branches of execution. + + Parameters + ---------- + *nodes : GraphNode + Additional nodes to depend on. + + Returns + ------- + EmptyNode + A new EmptyNode that depends on all input nodes. + """ + return GN_join(self, nodes) + + def allocate(self, size_t size, *, device: Device | int | None = None, + memory_type: GraphMemoryType = GraphMemoryType.DEVICE, + peer_access: list[Device | int] | None = None) -> AllocNode: + """Add a memory allocation node depending on this node. + + Parameters + ---------- + size : int + Number of bytes to allocate. + device : int or Device, optional + The device on which to allocate memory. If None (default), + uses the current CUDA context's device. + memory_type : GraphMemoryType or str, optional + Type of memory to allocate. One of: + + - ``GraphMemoryType.DEVICE`` (default): Pinned device memory, + optimal for GPU kernels. + - ``GraphMemoryType.HOST``: Pinned host memory, accessible from + both host and device. Useful for graphs containing host + callback nodes. Note: may not be supported on all + systems/drivers. + - ``GraphMemoryType.MANAGED``: Managed/unified memory that + automatically migrates between host and device. Useful for + mixed host/device access patterns. + + peer_access : list of int or Device, optional + List of devices that should have read-write access to the + allocated memory. If None (default), only the allocating + device has access. + + Returns + ------- + AllocNode + A new AllocNode representing the allocation. Access the allocated + device pointer via the dptr property. + + Notes + ----- + IPC (inter-process communication) is not supported for graph + memory allocation nodes per CUDA documentation. + """ + return GN_alloc(self, size, device, memory_type, peer_access) + + def deallocate(self, dptr: int) -> FreeNode: + """Add a memory free node depending on this node. + + Parameters + ---------- + dptr : int + Device pointer to free (typically from AllocNode.dptr). + + Returns + ------- + FreeNode + A new FreeNode representing the free operation. + """ + return GN_free(self, dptr) + + def memset( + self, + dst: Buffer | int, + value, + size_t width, + size_t height=1, + size_t pitch=0, + *, + dst_owner=None, + ) -> MemsetNode: + """Add a memset node depending on this node. + + Parameters + ---------- + dst : Buffer or int + Destination. When ``dst`` is a :class:`Buffer`, the underlying + allocation is retained for the graph's lifetime. A raw pointer + (``int``) is used as-is; the caller must keep the underlying memory + alive, or supply ``dst_owner`` to have the graph retain it. + value : int or buffer-protocol object + Fill value. int for 1-byte fill (range [0, 256)), + or buffer-protocol object of 1, 2, or 4 bytes. + width : int + Width of the row in elements. + height : int, optional + Number of rows (default 1). + pitch : int, optional + Pitch of destination in bytes (default 0, unused if height is 1). + dst_owner : object, optional + Object retained for the graph's lifetime when ``dst`` is a raw + pointer. A :class:`Buffer` owner retains its underlying allocation, + not the wrapper. Must not be passed when ``dst`` is a :class:`Buffer`. + + Returns + ------- + MemsetNode + A new MemsetNode representing the memset operation. + + Raises + ------ + ValueError + If ``dst_owner`` is given together with a :class:`Buffer` ``dst``. + """ + cdef cydriver.CUdeviceptr c_dst + cdef unsigned int val + cdef unsigned int elem_size + cdef OpaqueHandle dst_slot_owner + dst_slot_owner = _resolve_memcpy_operand(dst, dst_owner, "dst", &c_dst) + val, elem_size = _parse_fill_value(value) + return GN_memset(self, c_dst, dst_slot_owner, val, elem_size, width, height, pitch) + + def memcpy( + self, + dst: Buffer | int, + src: Buffer | int, + size_t size, + *, + dst_owner=None, + src_owner=None, + ) -> MemcpyNode: + """Add a memcpy node depending on this node. + + Copies ``size`` bytes from ``src`` to ``dst``. Memory types are + auto-detected via the driver, so both device and pinned host + pointers are supported. + + Parameters + ---------- + dst : Buffer or int + Destination (device or pinned host). When a :class:`Buffer` is given, + the underlying allocation is retained for the graph's lifetime. A raw + pointer (``int``) is used as-is; the caller must keep the underlying + memory alive, or supply ``dst_owner`` to have the graph retain it. + src : Buffer or int + Source (device or pinned host). Same retention rules as ``dst``; + use ``src_owner`` for a raw pointer. + size : int + Number of bytes to copy. + dst_owner : object, optional + Object retained for the graph's lifetime when ``dst`` is a raw + pointer. A :class:`Buffer` owner retains its underlying allocation. + Must not be passed when ``dst`` is a :class:`Buffer`. + src_owner : object, optional + Object retained for the graph's lifetime when ``src`` is a raw + pointer. A :class:`Buffer` owner retains its underlying allocation. + Must not be passed when ``src`` is a :class:`Buffer`. + + Returns + ------- + MemcpyNode + A new MemcpyNode representing the copy operation. + + Raises + ------ + ValueError + If ``dst_owner`` or ``src_owner`` is given together with a + :class:`Buffer` ``dst`` or ``src`` respectively. + """ + cdef cydriver.CUdeviceptr c_dst + cdef cydriver.CUdeviceptr c_src + cdef OpaqueHandle dst_slot_owner, src_slot_owner + dst_slot_owner = _resolve_memcpy_operand(dst, dst_owner, "dst", &c_dst) + src_slot_owner = _resolve_memcpy_operand(src, src_owner, "src", &c_src) + return GN_memcpy(self, c_dst, dst_slot_owner, c_src, src_slot_owner, size) + + def embed(self, child: GraphDefinition) -> ChildGraphNode: + """Add a child graph node depending on this node. + + Embeds a clone of the given graph definition as a sub-graph node. + The child graph must not contain allocation, free, or conditional + nodes. + + Parameters + ---------- + child : GraphDefinition + The graph definition to embed (will be cloned). + + Returns + ------- + ChildGraphNode + A new ChildGraphNode representing the embedded sub-graph. + """ + return GN_embed(self, child) + + def record(self, event: Event) -> EventRecordNode: + """Add an event record node depending on this node. + + Parameters + ---------- + event : Event + The event to record. + + Returns + ------- + EventRecordNode + A new EventRecordNode representing the event record operation. + """ + return GN_record_event(self, event) + + def wait(self, event: Event) -> EventWaitNode: + """Add an event wait node depending on this node. + + Parameters + ---------- + event : Event + The event to wait for. + + Returns + ------- + EventWaitNode + A new EventWaitNode representing the event wait operation. + """ + return GN_wait_event(self, event) + + def callback(self, fn, *, user_data=None) -> object: + """Add a host callback node depending on this node. + + The callback runs on the host CPU when the graph reaches this node. + Two modes are supported: + + - **Python callable**: Pass any callable. The GIL is acquired + automatically. The callable must take no arguments; use closures + or ``functools.partial`` to bind state. + - **ctypes function pointer**: Pass a ``ctypes.CFUNCTYPE`` instance. + The function receives a single ``void*`` argument (the + ``user_data``). The caller must keep the ctypes wrapper alive + for the lifetime of the graph. + + .. warning:: + + Callbacks must not call CUDA API functions. Doing so may + deadlock or corrupt driver state. + + Parameters + ---------- + fn : callable or ctypes function pointer + The callback function. + user_data : int or bytes-like, optional + Only for ctypes function pointers. If ``int``, passed as a raw + pointer (caller manages lifetime). If bytes-like, the data is + copied and its lifetime is tied to the graph. + + Returns + ------- + HostCallbackNode + A new HostCallbackNode representing the callback. + """ + return GN_callback(self, fn, user_data) + + def if_then(self, condition: GraphCondition) -> IfNode: + """Add an if-conditional node depending on this node. + + The body graph executes only when the condition evaluates to + a non-zero value at runtime. + + Parameters + ---------- + condition : GraphCondition + GraphCondition from :meth:`GraphDefinition.create_condition`. + + Returns + ------- + IfNode + A new IfNode with one branch accessible via ``.then``. + """ + return _make_conditional_node( + self, condition, + cydriver.CU_GRAPH_COND_TYPE_IF, 1, IfNode) + + def if_else(self, condition: GraphCondition) -> IfElseNode: + """Add an if-else conditional node depending on this node. + + Two body graphs: the first executes when the condition is + non-zero, the second when it is zero. + + Parameters + ---------- + condition : GraphCondition + GraphCondition from :meth:`GraphDefinition.create_condition`. + + Returns + ------- + IfElseNode + A new IfElseNode with branches accessible via + ``.then`` and ``.else_``. + """ + return _make_conditional_node( + self, condition, + cydriver.CU_GRAPH_COND_TYPE_IF, 2, IfElseNode) + + def while_loop(self, condition: GraphCondition) -> WhileNode: + """Add a while-loop conditional node depending on this node. + + The body graph executes repeatedly while the condition + evaluates to a non-zero value. + + Parameters + ---------- + condition : GraphCondition + GraphCondition from :meth:`GraphDefinition.create_condition`. + + Returns + ------- + WhileNode + A new WhileNode with body accessible via ``.body``. + """ + return _make_conditional_node( + self, condition, + cydriver.CU_GRAPH_COND_TYPE_WHILE, 1, WhileNode) + + def switch(self, condition: GraphCondition, unsigned int count) -> SwitchNode: + """Add a switch conditional node depending on this node. + + The condition value selects which branch to execute. If the + value is out of range, no branch executes. + + Parameters + ---------- + condition : GraphCondition + GraphCondition from :meth:`GraphDefinition.create_condition`. + count : int + Number of switch cases (branches). + + Returns + ------- + SwitchNode + A new SwitchNode with branches accessible via ``.branches``. + """ + return _make_conditional_node( + self, condition, + cydriver.CU_GRAPH_COND_TYPE_SWITCH, count, SwitchNode) + + +cdef inline ConditionalNode _make_conditional_node( + GraphNode pred, + GraphCondition condition, + cydriver.CUgraphConditionalNodeType cond_type, + unsigned int size, + type node_cls): + if not isinstance(condition, GraphCondition): + raise TypeError( + f"condition must be a GraphCondition object (from " + f"GraphDefinition.create_condition()), got {type(condition).__name__}") + cdef cydriver.CUgraphNodeParams params + cdef cydriver.CUgraphNode new_node = NULL + + c_memset(¶ms, 0, sizeof(params)) + params.type = cydriver.CU_GRAPH_NODE_TYPE_CONDITIONAL + params.conditional.handle = condition._c_handle + params.conditional.type = cond_type + params.conditional.size = size + + cdef cydriver.CUcontext ctx = NULL + cdef GraphHandle h_graph = graph_node_get_graph(pred._h_node) + cdef cydriver.CUgraphNode pred_node = as_cu(pred._h_node) + cdef cydriver.CUgraphNode* deps = NULL + cdef size_t num_deps = 0 + + if pred_node != NULL: + deps = &pred_node + num_deps = 1 + + with nogil: + HANDLE_RETURN(cydriver.cuCtxGetCurrent(&ctx)) + params.conditional.ctx = ctx + + with nogil: + IF CUDA_CORE_BUILD_MAJOR >= 13: + HANDLE_RETURN(cydriver.cuGraphAddNode( + &new_node, as_cu(h_graph), deps, NULL, num_deps, ¶ms)) + ELSE: + HANDLE_RETURN(cydriver.cuGraphAddNode( + &new_node, as_cu(h_graph), deps, num_deps, ¶ms)) + + cdef list branch_list = [] + cdef unsigned int i + cdef cydriver.CUgraph bg + cdef GraphHandle h_branch + for i in range(size): + bg = params.conditional.phGraph_out[i] + h_branch = create_graph_handle_ref(bg, h_graph) + branch_list.append(GraphDefinition._from_handle(h_branch)) + cdef tuple branches = tuple(branch_list) + + cdef ConditionalNode n = node_cls.__new__(node_cls) + n._h_node = create_graph_node_handle(new_node, h_graph) + n._condition = condition + n._cond_type = cond_type + n._branches = branches + + return _registered(n) + +cdef inline GraphNode GN_create(GraphHandle h_graph, cydriver.CUgraphNode node): + cdef GraphNodeHandle h_node = create_graph_node_handle(node, h_graph) + + # Sentinel: virtual node to represent the graph entry point. + if node == NULL: + n = GraphNode.__new__(GraphNode) + (n)._h_node = h_node + return n + + # Return a registered object or create and register a new one. + registered = _node_registry.get(h_node.get()) + if registered is not None: + return registered + else: + return _registered(GN_create_impl(h_node)) + + +cdef inline GraphNode GN_create_impl(GraphNodeHandle h_node): + cdef cydriver.CUgraphNodeType node_type + with nogil: + HANDLE_RETURN(cydriver.cuGraphNodeGetType(as_cu(h_node), &node_type)) + + if node_type == cydriver.CU_GRAPH_NODE_TYPE_EMPTY: + return EmptyNode._create_impl(h_node) + elif node_type == cydriver.CU_GRAPH_NODE_TYPE_KERNEL: + return KernelNode._create_from_driver(h_node) + elif node_type == cydriver.CU_GRAPH_NODE_TYPE_MEM_ALLOC: + return AllocNode._create_from_driver(h_node) + elif node_type == cydriver.CU_GRAPH_NODE_TYPE_MEM_FREE: + return FreeNode._create_from_driver(h_node) + elif node_type == cydriver.CU_GRAPH_NODE_TYPE_MEMSET: + return MemsetNode._create_from_driver(h_node) + elif node_type == cydriver.CU_GRAPH_NODE_TYPE_MEMCPY: + return MemcpyNode._create_from_driver(h_node) + elif node_type == cydriver.CU_GRAPH_NODE_TYPE_GRAPH: + return ChildGraphNode._create_from_driver(h_node) + elif node_type == cydriver.CU_GRAPH_NODE_TYPE_EVENT_RECORD: + return EventRecordNode._create_from_driver(h_node) + elif node_type == cydriver.CU_GRAPH_NODE_TYPE_WAIT_EVENT: + return EventWaitNode._create_from_driver(h_node) + elif node_type == cydriver.CU_GRAPH_NODE_TYPE_HOST: + return HostCallbackNode._create_from_driver(h_node) + elif node_type == cydriver.CU_GRAPH_NODE_TYPE_CONDITIONAL: + return ConditionalNode._create_from_driver(h_node) + else: + n = GraphNode.__new__(GraphNode) + (n)._h_node = h_node + return n + + +cdef inline KernelNode GN_launch(GraphNode self, LaunchConfig conf, Kernel ker, ParamHolder ker_args): + cdef cydriver.CUDA_KERNEL_NODE_PARAMS node_params + cdef cydriver.CUgraphNode new_node = NULL + cdef GraphHandle h_graph = graph_node_get_graph(self._h_node) + cdef cydriver.CUgraphNode pred_node = as_cu(self._h_node) + cdef cydriver.CUgraphNode* deps = NULL + cdef size_t num_deps = 0 + cdef OpaqueHandle owner + + if pred_node != NULL: + deps = &pred_node + num_deps = 1 + + node_params.kern = as_cu(ker._h_kernel) + node_params.func = NULL + node_params.gridDimX = conf.grid[0] + node_params.gridDimY = conf.grid[1] + node_params.gridDimZ = conf.grid[2] + node_params.blockDimX = conf.block[0] + node_params.blockDimY = conf.block[1] + node_params.blockDimZ = conf.block[2] + node_params.sharedMemBytes = conf.shmem_size + node_params.kernelParams = (ker_args.ptr) + node_params.extra = NULL + node_params.ctx = NULL + + with nogil: + HANDLE_RETURN(cydriver.cuGraphAddKernelNode( + &new_node, as_cu(h_graph), deps, num_deps, &node_params)) + + # Slot 0 keeps the kernel loaded; slot 1 keeps the Python kernel-argument + # objects (notably device Buffers) alive for the graph's lifetime. The + # driver copies argument values into the node at add time but does not own + # the device memory they reference. + owner = ker._h_kernel + try: + HANDLE_RETURN(graph_set_slot(h_graph, new_node, 0, owner)) + kernel_args = ker_args.kernel_args + if kernel_args is not None: + owner = make_opaque_py(kernel_args) + HANDLE_RETURN(graph_set_slot(h_graph, new_node, 1, owner)) + except: + cydriver.cuGraphDestroyNode(new_node) # best effort + raise + + return _registered(KernelNode._create_with_params( + create_graph_node_handle(new_node, h_graph), + conf.grid, conf.block, conf.shmem_size, + ker._h_kernel)) + + +cdef inline EmptyNode GN_join(GraphNode self, tuple nodes): + cdef vector[cydriver.CUgraphNode] deps + cdef cydriver.CUgraphNode new_node = NULL + cdef GraphHandle h_graph = graph_node_get_graph(self._h_node) + cdef GraphNode other + cdef cydriver.CUgraphNode* deps_ptr = NULL + cdef size_t num_deps = 0 + cdef cydriver.CUgraphNode pred_node = as_cu(self._h_node) + + if pred_node != NULL: + deps.push_back(pred_node) + for other in nodes: + if as_cu((other)._h_node) != NULL: + deps.push_back(as_cu((other)._h_node)) + + num_deps = deps.size() + if num_deps > 0: + deps_ptr = deps.data() + + with nogil: + HANDLE_RETURN(cydriver.cuGraphAddEmptyNode( + &new_node, as_cu(h_graph), deps_ptr, num_deps)) + + return _registered(EmptyNode._create_impl(create_graph_node_handle(new_node, h_graph))) + + +cdef inline AllocNode GN_alloc(GraphNode self, size_t size, object device, + object memory_type, object peer_access): + cdef int device_id + cdef cydriver.CUdevice dev + + if device is None: + with nogil: + HANDLE_RETURN(cydriver.cuCtxGetDevice(&dev)) + device_id = dev + else: + device_id = getattr(device, 'device_id', device) + + cdef cydriver.CUDA_MEM_ALLOC_NODE_PARAMS alloc_params + cdef cydriver.CUgraphNode new_node = NULL + cdef GraphHandle h_graph = graph_node_get_graph(self._h_node) + cdef cydriver.CUgraphNode pred_node = as_cu(self._h_node) + cdef cydriver.CUgraphNode* deps = NULL + cdef size_t num_deps = 0 + + if pred_node != NULL: + deps = &pred_node + num_deps = 1 + + cdef vector[cydriver.CUmemAccessDesc] access_descs + cdef int peer_id + cdef list peer_ids = [] + + if peer_access is not None: + for peer_dev in peer_access: + peer_id = getattr(peer_dev, 'device_id', peer_dev) + peer_ids.append(peer_id) + access_descs.push_back(cydriver.CUmemAccessDesc_st( + cydriver.CUmemLocation_st( + cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE, + peer_id + ), + cydriver.CUmemAccess_flags.CU_MEM_ACCESS_FLAGS_PROT_READWRITE + )) + + cdef str memory_type_str = "device" if memory_type is None else str(memory_type) + + c_memset(&alloc_params, 0, sizeof(alloc_params)) + alloc_params.poolProps.handleTypes = cydriver.CUmemAllocationHandleType.CU_MEM_HANDLE_TYPE_NONE + alloc_params.bytesize = size + + if memory_type_str == "device": + alloc_params.poolProps.allocType = cydriver.CUmemAllocationType.CU_MEM_ALLOCATION_TYPE_PINNED + alloc_params.poolProps.location.type = cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE + alloc_params.poolProps.location.id = device_id + elif memory_type_str == "host": + alloc_params.poolProps.allocType = cydriver.CUmemAllocationType.CU_MEM_ALLOCATION_TYPE_PINNED + alloc_params.poolProps.location.type = cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_HOST + alloc_params.poolProps.location.id = 0 + elif memory_type_str == "managed": + IF CUDA_CORE_BUILD_MAJOR >= 13: + alloc_params.poolProps.allocType = cydriver.CUmemAllocationType.CU_MEM_ALLOCATION_TYPE_MANAGED + alloc_params.poolProps.location.type = cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE + alloc_params.poolProps.location.id = device_id + ELSE: + raise ValueError("memory_type='managed' requires CUDA 13.0 or later") + else: + raise ValueError(f"Invalid memory_type: {memory_type_str!r}. " + "Must be 'device', 'host', or 'managed'.") + + if access_descs.size() > 0: + alloc_params.accessDescs = access_descs.data() + alloc_params.accessDescCount = access_descs.size() + + with nogil: + HANDLE_RETURN(cydriver.cuGraphAddMemAllocNode( + &new_node, as_cu(h_graph), deps, num_deps, &alloc_params)) + + return _registered(AllocNode._create_with_params( + create_graph_node_handle(new_node, h_graph), alloc_params.dptr, size, + device_id, memory_type_str, tuple(peer_ids))) + + +cdef inline FreeNode GN_free(GraphNode self, cydriver.CUdeviceptr c_dptr): + cdef cydriver.CUgraphNode new_node = NULL + cdef GraphHandle h_graph = graph_node_get_graph(self._h_node) + cdef cydriver.CUgraphNode pred_node = as_cu(self._h_node) + cdef cydriver.CUgraphNode* deps = NULL + cdef size_t num_deps = 0 + + if pred_node != NULL: + deps = &pred_node + num_deps = 1 + + with nogil: + HANDLE_RETURN(cydriver.cuGraphAddMemFreeNode( + &new_node, as_cu(h_graph), deps, num_deps, c_dptr)) + + return _registered(FreeNode._create_with_params(create_graph_node_handle(new_node, h_graph), c_dptr)) + + +cdef inline OpaqueHandle _buffer_slot_owner(Buffer buf, str label): + """Copy a Buffer's device-pointer handle into a graph slot owner.""" + cdef OpaqueHandle slot_owner + if not buf._h_ptr: + raise ValueError(f"{label} Buffer has no active allocation") + slot_owner = buf._h_ptr + return slot_owner + + +cdef inline OpaqueHandle _resolve_memcpy_operand( + object operand, object owner, str side, cydriver.CUdeviceptr* out_ptr): + """Resolve a memcpy/memset operand to a pointer and optional slot owner. + + ``operand`` is a :class:`Buffer` or a raw integer address; its device + pointer is written to ``out_ptr``. For a :class:`Buffer` operand, returns an + owner that retains the underlying allocation (not the wrapper). For a raw + pointer, returns an owner built from ``owner`` (or an empty handle when + ``owner`` is ``None``). + + Raises + ------ + ValueError + If ``operand`` is a :class:`Buffer` and ``owner`` is not ``None``. + If a :class:`Buffer` operand or ``*_owner`` has no active allocation. + """ + cdef Buffer buf + + if isinstance(operand, Buffer): + if owner is not None: + raise ValueError( + f"{side}_owner cannot be used when {side} is a Buffer" + ) + buf = operand + slot_owner = _buffer_slot_owner(buf, side) + out_ptr[0] = as_cu(buf._h_ptr) + return slot_owner + out_ptr[0] = operand + if owner is None: + return OpaqueHandle() + if isinstance(owner, Buffer): + return _buffer_slot_owner(owner, f"{side}_owner") + return make_opaque_py(owner) + + +cdef inline MemsetNode GN_memset( + GraphNode self, cydriver.CUdeviceptr c_dst, OpaqueHandle dst_owner, + unsigned int val, unsigned int elem_size, + size_t width, size_t height, size_t pitch): + cdef cydriver.CUDA_MEMSET_NODE_PARAMS memset_params + cdef cydriver.CUgraphNode new_node = NULL + cdef GraphHandle h_graph = graph_node_get_graph(self._h_node) + cdef cydriver.CUgraphNode pred_node = as_cu(self._h_node) + cdef cydriver.CUgraphNode* deps = NULL + cdef size_t num_deps = 0 + + if pred_node != NULL: + deps = &pred_node + num_deps = 1 + + cdef cydriver.CUcontext ctx = NULL + with nogil: + HANDLE_RETURN(cydriver.cuCtxGetCurrent(&ctx)) + + c_memset(&memset_params, 0, sizeof(memset_params)) + memset_params.dst = c_dst + memset_params.value = val + memset_params.elementSize = elem_size + memset_params.width = width + memset_params.height = height + memset_params.pitch = pitch + + with nogil: + HANDLE_RETURN(cydriver.cuGraphAddMemsetNode( + &new_node, as_cu(h_graph), deps, num_deps, + &memset_params, ctx)) + + # Retain the destination allocation for the graph's lifetime (slot 0). Roll + # the node back if slot attachment fails, so it cannot outlive an + # unretained allocation. + if dst_owner: + try: + HANDLE_RETURN(graph_set_slot(h_graph, new_node, 0, dst_owner)) + except: + cydriver.cuGraphDestroyNode(new_node) # best effort + raise + + return _registered(MemsetNode._create_with_params( + create_graph_node_handle(new_node, h_graph), c_dst, + val, elem_size, width, height, pitch)) + + +cdef inline MemcpyNode GN_memcpy( + GraphNode self, cydriver.CUdeviceptr c_dst, OpaqueHandle dst_owner, + cydriver.CUdeviceptr c_src, OpaqueHandle src_owner, size_t size): + cdef unsigned int dst_mem_type = cydriver.CU_MEMORYTYPE_DEVICE + cdef unsigned int src_mem_type = cydriver.CU_MEMORYTYPE_DEVICE + cdef cydriver.CUresult ret + with nogil: + ret = cydriver.cuPointerGetAttribute( + &dst_mem_type, + cydriver.CU_POINTER_ATTRIBUTE_MEMORY_TYPE, + c_dst) + if ret != cydriver.CUDA_SUCCESS and ret != cydriver.CUDA_ERROR_INVALID_VALUE: + HANDLE_RETURN(ret) + ret = cydriver.cuPointerGetAttribute( + &src_mem_type, + cydriver.CU_POINTER_ATTRIBUTE_MEMORY_TYPE, + c_src) + if ret != cydriver.CUDA_SUCCESS and ret != cydriver.CUDA_ERROR_INVALID_VALUE: + HANDLE_RETURN(ret) + + cdef cydriver.CUmemorytype c_dst_type = dst_mem_type + cdef cydriver.CUmemorytype c_src_type = src_mem_type + + cdef cydriver.CUDA_MEMCPY3D params + c_memset(¶ms, 0, sizeof(params)) + + params.srcMemoryType = c_src_type + params.dstMemoryType = c_dst_type + if c_src_type == cydriver.CU_MEMORYTYPE_HOST: + params.srcHost = c_src + else: + params.srcDevice = c_src + if c_dst_type == cydriver.CU_MEMORYTYPE_HOST: + params.dstHost = c_dst + else: + params.dstDevice = c_dst + params.WidthInBytes = size + params.Height = 1 + params.Depth = 1 + + cdef cydriver.CUgraphNode new_node = NULL + cdef GraphHandle h_graph = graph_node_get_graph(self._h_node) + cdef cydriver.CUgraphNode pred_node = as_cu(self._h_node) + cdef cydriver.CUgraphNode* deps = NULL + cdef size_t num_deps = 0 + + if pred_node != NULL: + deps = &pred_node + num_deps = 1 + + cdef cydriver.CUcontext ctx = NULL + with nogil: + HANDLE_RETURN(cydriver.cuCtxGetCurrent(&ctx)) + HANDLE_RETURN(cydriver.cuGraphAddMemcpyNode( + &new_node, as_cu(h_graph), deps, num_deps, ¶ms, ctx)) + + # Retain operand allocations for the graph's lifetime (dst -> slot 0, src -> + # slot 1). Roll the node back if slot attachment fails. + try: + if dst_owner: + HANDLE_RETURN(graph_set_slot(h_graph, new_node, 0, dst_owner)) + if src_owner: + HANDLE_RETURN(graph_set_slot(h_graph, new_node, 1, src_owner)) + except: + cydriver.cuGraphDestroyNode(new_node) # best effort + raise + + return _registered(MemcpyNode._create_with_params( + create_graph_node_handle(new_node, h_graph), c_dst, c_src, size, + c_dst_type, c_src_type)) + + +cdef inline ChildGraphNode GN_embed(GraphNode self, GraphDefinition child_def): + cdef cydriver.CUgraphNode new_node = NULL + cdef GraphHandle h_graph = graph_node_get_graph(self._h_node) + cdef cydriver.CUgraphNode pred_node = as_cu(self._h_node) + cdef cydriver.CUgraphNode* deps = NULL + cdef size_t num_deps = 0 + + if pred_node != NULL: + deps = &pred_node + num_deps = 1 + + with nogil: + HANDLE_RETURN(cydriver.cuGraphAddChildGraphNode( + &new_node, as_cu(h_graph), deps, num_deps, as_cu(child_def._h_graph))) + + cdef cydriver.CUgraph embedded_graph = NULL + with nogil: + HANDLE_RETURN(cydriver.cuGraphChildGraphNodeGetGraph( + new_node, &embedded_graph)) + + cdef GraphHandle h_embedded = create_graph_handle_ref(embedded_graph, h_graph) + + return _registered(ChildGraphNode._create_with_params( + create_graph_node_handle(new_node, h_graph), h_embedded)) + + +cdef inline EventRecordNode GN_record_event(GraphNode self, Event ev): + cdef cydriver.CUgraphNode new_node = NULL + cdef GraphHandle h_graph = graph_node_get_graph(self._h_node) + cdef cydriver.CUgraphNode pred_node = as_cu(self._h_node) + cdef cydriver.CUgraphNode* deps = NULL + cdef size_t num_deps = 0 + cdef OpaqueHandle owner + + if pred_node != NULL: + deps = &pred_node + num_deps = 1 + + with nogil: + HANDLE_RETURN(cydriver.cuGraphAddEventRecordNode( + &new_node, as_cu(h_graph), deps, num_deps, as_cu(ev._h_event))) + + owner = ev._h_event + try: + HANDLE_RETURN(graph_set_slot(h_graph, new_node, 0, owner)) + except: + cydriver.cuGraphDestroyNode(new_node) # best effort + raise + + return _registered(EventRecordNode._create_with_params( + create_graph_node_handle(new_node, h_graph), ev._h_event)) + + +cdef inline EventWaitNode GN_wait_event(GraphNode self, Event ev): + cdef cydriver.CUgraphNode new_node = NULL + cdef GraphHandle h_graph = graph_node_get_graph(self._h_node) + cdef cydriver.CUgraphNode pred_node = as_cu(self._h_node) + cdef cydriver.CUgraphNode* deps = NULL + cdef size_t num_deps = 0 + cdef OpaqueHandle owner + + if pred_node != NULL: + deps = &pred_node + num_deps = 1 + + with nogil: + HANDLE_RETURN(cydriver.cuGraphAddEventWaitNode( + &new_node, as_cu(h_graph), deps, num_deps, as_cu(ev._h_event))) + + owner = ev._h_event + try: + HANDLE_RETURN(graph_set_slot(h_graph, new_node, 0, owner)) + except: + cydriver.cuGraphDestroyNode(new_node) # best effort + raise + + return _registered(EventWaitNode._create_with_params( + create_graph_node_handle(new_node, h_graph), ev._h_event)) + + +cdef inline HostCallbackNode GN_callback(GraphNode self, object fn, object user_data): + cdef cydriver.CUDA_HOST_NODE_PARAMS node_params + cdef cydriver.CUgraphNode new_node = NULL + cdef GraphHandle h_graph = graph_node_get_graph(self._h_node) + cdef cydriver.CUgraphNode pred_node = as_cu(self._h_node) + cdef cydriver.CUgraphNode* deps = NULL + cdef size_t num_deps = 0 + cdef OpaqueHandle fn_owner, data_owner + + if pred_node != NULL: + deps = &pred_node + num_deps = 1 + + _resolve_host_callback( + fn, user_data, &node_params.fn, &node_params.userData, + &fn_owner, &data_owner) + + with nogil: + HANDLE_RETURN(cydriver.cuGraphAddHostNode( + &new_node, as_cu(h_graph), deps, num_deps, &node_params)) + + # Roll the node back if owner attachment fails: an unretained host node + # leaves the driver holding a raw pointer into freed Python memory. + try: + _attach_host_callback_owners(h_graph, new_node, fn_owner, data_owner) + except: + cydriver.cuGraphDestroyNode(new_node) # best effort + raise + + cdef object callable_obj = fn if not isinstance(fn, ct._CFuncPtr) else None + return _registered(HostCallbackNode._create_with_params( + create_graph_node_handle(new_node, h_graph), callable_obj, + node_params.fn, node_params.userData)) diff --git a/cuda_core/cuda/core/graph/_host_callback.pxd b/cuda_core/cuda/core/graph/_host_callback.pxd new file mode 100644 index 00000000000..dac249c74ed --- /dev/null +++ b/cuda_core/cuda/core/graph/_host_callback.pxd @@ -0,0 +1,19 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from cuda.bindings cimport cydriver + +from cuda.core._resource_handles cimport GraphHandle, OpaqueHandle + + +cdef bint _is_py_host_trampoline(cydriver.CUhostFn fn) noexcept nogil + +cdef void _resolve_host_callback( + object fn, object user_data, + cydriver.CUhostFn* out_fn, void** out_user_data, + OpaqueHandle* out_fn_owner, OpaqueHandle* out_data_owner) except * + +cdef int _attach_host_callback_owners( + const GraphHandle& h_graph, cydriver.CUgraphNode node, + OpaqueHandle fn_owner, OpaqueHandle data_owner) except -1 diff --git a/cuda_core/cuda/core/graph/_host_callback.pyi b/cuda_core/cuda/core/graph/_host_callback.pyi new file mode 100644 index 00000000000..6c9d0ead317 --- /dev/null +++ b/cuda_core/cuda/core/graph/_host_callback.pyi @@ -0,0 +1,3 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/graph/_host_callback.pyx + +from __future__ import annotations \ No newline at end of file diff --git a/cuda_core/cuda/core/graph/_host_callback.pyx b/cuda_core/cuda/core/graph/_host_callback.pyx new file mode 100644 index 00000000000..bed2d8152f5 --- /dev/null +++ b/cuda_core/cuda/core/graph/_host_callback.pyx @@ -0,0 +1,79 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from libc.stdint cimport uintptr_t +from libc.stdlib cimport malloc +from libc.string cimport memcpy as c_memcpy + +from cuda.bindings cimport cydriver + +from cuda.core._resource_handles cimport ( + GraphHandle, + OpaqueHandle, + graph_set_slot, + make_opaque_malloc, + make_opaque_py, +) +from cuda.core._utils.cuda_utils cimport HANDLE_RETURN + +import ctypes as ct + + +cdef void _py_host_trampoline(void* data) noexcept with gil: + (data)() + + +cdef bint _is_py_host_trampoline(cydriver.CUhostFn fn) noexcept nogil: + return fn == _py_host_trampoline + + +cdef void _resolve_host_callback( + object fn, object user_data, + cydriver.CUhostFn* out_fn, void** out_user_data, + OpaqueHandle* out_fn_owner, OpaqueHandle* out_data_owner) except *: + """Resolve a Python callable or ctypes CFuncPtr into a C callback pair and + the owners that keep it alive. + + On return ``*out_fn`` / ``*out_user_data`` are ready to pass to + ``cuGraphAddHostNode`` or ``cuLaunchHostFunc``. ``*out_fn_owner`` owns the + callback object; ``*out_data_owner`` owns a copied ``user_data`` buffer and + is left null otherwise. The caller attaches the owners to the node's graph + slots. + """ + if isinstance(fn, ct._CFuncPtr): + out_fn[0] = ct.cast(fn, ct.c_void_p).value + if user_data is None: + out_user_data[0] = NULL + elif isinstance(user_data, int): + out_user_data[0] = user_data + else: + buf = bytes(user_data) + if len(buf): + out_user_data[0] = malloc(len(buf)) + if out_user_data[0] == NULL: + raise MemoryError("failed to allocate user_data buffer") + c_memcpy(out_user_data[0], buf, len(buf)) + out_data_owner[0] = make_opaque_malloc(out_user_data[0]) + else: + out_user_data[0] = NULL + else: + if user_data is not None: + raise ValueError( + "user_data is only supported with ctypes function pointers") + out_fn[0] = _py_host_trampoline + out_user_data[0] = fn + + out_fn_owner[0] = make_opaque_py(fn) + + +cdef int _attach_host_callback_owners( + const GraphHandle& h_graph, cydriver.CUgraphNode node, + OpaqueHandle fn_owner, OpaqueHandle data_owner) except -1: + """Attach a resolved host callback's owners to its node's graph slots: the + callback in slot 0 and any copied ``user_data`` buffer in slot 1. + """ + HANDLE_RETURN(graph_set_slot(h_graph, node, 0, fn_owner)) + if data_owner: + HANDLE_RETURN(graph_set_slot(h_graph, node, 1, data_owner)) + return 0 diff --git a/cuda_core/cuda/core/graph/_subclasses.pxd b/cuda_core/cuda/core/graph/_subclasses.pxd new file mode 100644 index 00000000000..7f84b713429 --- /dev/null +++ b/cuda_core/cuda/core/graph/_subclasses.pxd @@ -0,0 +1,174 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from libc.stddef cimport size_t + +from cuda.bindings cimport cydriver +from cuda.core.graph._graph_definition cimport GraphCondition +from cuda.core.graph._graph_node cimport GraphNode +from cuda.core._resource_handles cimport EventHandle, GraphHandle, GraphNodeHandle, KernelHandle + + +cdef class EmptyNode(GraphNode): + @staticmethod + cdef EmptyNode _create_impl(GraphNodeHandle h_node) + + +cdef class KernelNode(GraphNode): + cdef: + tuple _grid + tuple _block + unsigned int _shmem_size + KernelHandle _h_kernel + + @staticmethod + cdef KernelNode _create_with_params(GraphNodeHandle h_node, + tuple grid, tuple block, unsigned int shmem_size, + KernelHandle h_kernel) + + @staticmethod + cdef KernelNode _create_from_driver(GraphNodeHandle h_node) + + +cdef class AllocNode(GraphNode): + cdef: + cydriver.CUdeviceptr _dptr + size_t _bytesize + int _device_id + str _memory_type + tuple _peer_access + + @staticmethod + cdef AllocNode _create_with_params(GraphNodeHandle h_node, + cydriver.CUdeviceptr dptr, size_t bytesize, + int device_id, str memory_type, tuple peer_access) + + @staticmethod + cdef AllocNode _create_from_driver(GraphNodeHandle h_node) + + +cdef class FreeNode(GraphNode): + cdef: + cydriver.CUdeviceptr _dptr + + @staticmethod + cdef FreeNode _create_with_params(GraphNodeHandle h_node, + cydriver.CUdeviceptr dptr) + + @staticmethod + cdef FreeNode _create_from_driver(GraphNodeHandle h_node) + + +cdef class MemsetNode(GraphNode): + cdef: + cydriver.CUdeviceptr _dptr + unsigned int _value + unsigned int _element_size + size_t _width + size_t _height + size_t _pitch + + @staticmethod + cdef MemsetNode _create_with_params(GraphNodeHandle h_node, + cydriver.CUdeviceptr dptr, unsigned int value, + unsigned int element_size, size_t width, + size_t height, size_t pitch) + + @staticmethod + cdef MemsetNode _create_from_driver(GraphNodeHandle h_node) + + +cdef class MemcpyNode(GraphNode): + cdef: + cydriver.CUdeviceptr _dst + cydriver.CUdeviceptr _src + size_t _size + cydriver.CUmemorytype _dst_type + cydriver.CUmemorytype _src_type + + @staticmethod + cdef MemcpyNode _create_with_params(GraphNodeHandle h_node, + cydriver.CUdeviceptr dst, cydriver.CUdeviceptr src, + size_t size, cydriver.CUmemorytype dst_type, + cydriver.CUmemorytype src_type) + + @staticmethod + cdef MemcpyNode _create_from_driver(GraphNodeHandle h_node) + + +cdef class ChildGraphNode(GraphNode): + cdef: + GraphHandle _h_child_graph + + @staticmethod + cdef ChildGraphNode _create_with_params(GraphNodeHandle h_node, + GraphHandle h_child_graph) + + @staticmethod + cdef ChildGraphNode _create_from_driver(GraphNodeHandle h_node) + + +cdef class EventRecordNode(GraphNode): + cdef: + EventHandle _h_event + + @staticmethod + cdef EventRecordNode _create_with_params(GraphNodeHandle h_node, + EventHandle h_event) + + @staticmethod + cdef EventRecordNode _create_from_driver(GraphNodeHandle h_node) + + +cdef class EventWaitNode(GraphNode): + cdef: + EventHandle _h_event + + @staticmethod + cdef EventWaitNode _create_with_params(GraphNodeHandle h_node, + EventHandle h_event) + + @staticmethod + cdef EventWaitNode _create_from_driver(GraphNodeHandle h_node) + + +cdef class HostCallbackNode(GraphNode): + cdef: + object _callable + cydriver.CUhostFn _fn + void* _user_data + + @staticmethod + cdef HostCallbackNode _create_with_params(GraphNodeHandle h_node, + object callable_obj, cydriver.CUhostFn fn, + void* user_data) + + @staticmethod + cdef HostCallbackNode _create_from_driver(GraphNodeHandle h_node) + + +cdef class ConditionalNode(GraphNode): + cdef: + GraphCondition _condition + cydriver.CUgraphConditionalNodeType _cond_type + tuple _branches + + @staticmethod + cdef ConditionalNode _create_from_driver(GraphNodeHandle h_node) + + +cdef class IfNode(ConditionalNode): + pass + + +cdef class IfElseNode(ConditionalNode): + pass + + +cdef class WhileNode(ConditionalNode): + pass + + +cdef class SwitchNode(ConditionalNode): + pass diff --git a/cuda_core/cuda/core/graph/_subclasses.pyi b/cuda_core/cuda/core/graph/_subclasses.pyi new file mode 100644 index 00000000000..345e6417c4d --- /dev/null +++ b/cuda_core/cuda/core/graph/_subclasses.pyi @@ -0,0 +1,339 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/graph/_subclasses.pyx + +"""GraphNode subclasses — EmptyNode through SwitchNode.""" +from __future__ import annotations + +from cuda.core._event import Event +from cuda.core._launch_config import LaunchConfig +from cuda.core._module import Kernel +from cuda.core.graph._graph_definition import GraphCondition, GraphDefinition +from cuda.core.graph._graph_node import GraphNode +from cuda.core.typing import GraphConditionalType + + +class EmptyNode(GraphNode): + """An empty (synchronization) node.""" + + def __repr__(self) -> str: + ... + +class KernelNode(GraphNode): + """A kernel launch node. + + Properties + ---------- + grid : tuple of int + Grid dimensions (gridDimX, gridDimY, gridDimZ). + block : tuple of int + Block dimensions (blockDimX, blockDimY, blockDimZ). + shmem_size : int + Dynamic shared memory size in bytes. + kernel : Kernel + The kernel object for this launch node. + config : LaunchConfig + A LaunchConfig reconstructed from this node's parameters. + """ + + def __repr__(self) -> str: + ... + + @property + def grid(self) -> tuple[int, int, int]: + """Grid dimensions as a 3-tuple (gridDimX, gridDimY, gridDimZ).""" + + @property + def block(self) -> tuple[int, int, int]: + """Block dimensions as a 3-tuple (blockDimX, blockDimY, blockDimZ).""" + + @property + def shmem_size(self) -> int: + """Dynamic shared memory size in bytes.""" + + @property + def kernel(self) -> Kernel: + """The Kernel object for this launch node.""" + + @property + def config(self) -> LaunchConfig: + """A LaunchConfig reconstructed from this node's grid, block, and shmem_size. + + Note: cluster dimensions and is_cooperative are not preserved + by the CUDA driver's kernel node params, so they are not included. + """ + +class AllocNode(GraphNode): + """A memory allocation node. + + Properties + ---------- + dptr : int + The device pointer for the allocation. + bytesize : int + The number of bytes allocated. + device_id : int + The device on which the allocation was made. + memory_type : GraphMemoryType | str + The type of memory allocated. + peer_access : tuple of int + Device IDs that have read-write access to this allocation. + """ + + def __repr__(self) -> str: + ... + + @property + def dptr(self) -> int: + """The device pointer for the allocation.""" + + @property + def bytesize(self) -> int: + """The number of bytes allocated.""" + + @property + def device_id(self) -> int: + """The device on which the allocation was made.""" + + @property + def memory_type(self) -> str: + """The type of memory: ``"device"``, ``"host"``, or ``"managed"``.""" + + @property + def peer_access(self) -> tuple[int, ...]: + """Device IDs with read-write access to this allocation.""" + +class FreeNode(GraphNode): + """A memory deallocation node. + + Properties + ---------- + dptr : int + The device pointer being freed. + """ + + def __repr__(self) -> str: + ... + + @property + def dptr(self) -> int: + """The device pointer being freed.""" + +class MemsetNode(GraphNode): + """A memset node. + + Properties + ---------- + dptr : int + The destination device pointer. + value : int + The fill value. + element_size : int + Element size in bytes (1, 2, or 4). + width : int + Width of the row in elements. + height : int + Number of rows. + pitch : int + Pitch in bytes (unused if height is 1). + """ + + def __repr__(self) -> str: + ... + + @property + def dptr(self) -> int: + """The destination device pointer.""" + + @property + def value(self) -> int: + """The fill value.""" + + @property + def element_size(self) -> int: + """Element size in bytes (1, 2, or 4).""" + + @property + def width(self) -> int: + """Width of the row in elements.""" + + @property + def height(self) -> int: + """Number of rows.""" + + @property + def pitch(self) -> int: + """Pitch in bytes (unused if height is 1).""" + +class MemcpyNode(GraphNode): + """A memcpy node. + + Properties + ---------- + dst : int + The destination pointer. + src : int + The source pointer. + size : int + The number of bytes copied. + """ + + def __repr__(self) -> str: + ... + + @property + def dst(self) -> int: + """The destination pointer.""" + + @property + def src(self) -> int: + """The source pointer.""" + + @property + def size(self) -> int: + """The number of bytes copied.""" + +class ChildGraphNode(GraphNode): + """A child graph node. + + Properties + ---------- + child_graph : GraphDefinition + The embedded graph definition (non-owning wrapper). + """ + + def __repr__(self) -> str: + ... + + @property + def child_graph(self) -> GraphDefinition: + """The embedded graph definition (non-owning wrapper).""" + +class EventRecordNode(GraphNode): + """An event record node. + + Properties + ---------- + event : Event + The event being recorded. + """ + + def __repr__(self) -> str: + ... + + @property + def event(self) -> Event: + """The event being recorded.""" + +class EventWaitNode(GraphNode): + """An event wait node. + + Properties + ---------- + event : Event + The event being waited on. + """ + + def __repr__(self) -> str: + ... + + @property + def event(self) -> Event: + """The event being waited on.""" + +class HostCallbackNode(GraphNode): + """A host callback node. + + Properties + ---------- + callback : callable or None + The Python callable (None for ctypes function pointer callbacks). + """ + + def __repr__(self) -> str: + ... + + @property + def callback(self): + """The Python callable, or None for ctypes function pointer callbacks.""" + +class ConditionalNode(GraphNode): + """Base class for conditional nodes. + + When created via builder methods (if_then, if_else, while_loop, switch), + a specific subclass (IfNode, IfElseNode, WhileNode, SwitchNode) is + returned. When reconstructed from the driver on CUDA 13.2+, the + correct subclass is determined via cuGraphNodeGetParams. On older + drivers, this base class is used as a fallback. + + Properties + ---------- + condition : GraphCondition or None + The condition variable controlling execution (None pre-13.2). + cond_type : str or None + The conditional type ("if", "while", or "switch"; None pre-13.2). + branches : tuple of GraphDefinition + The body graphs for each branch (empty pre-13.2). + """ + + def __repr__(self) -> str: + ... + + @property + def condition(self) -> GraphCondition | None: + """The condition variable controlling execution.""" + + @property + def cond_type(self) -> GraphConditionalType | None: + """The conditional type: GraphConditionalType.IF, .WHILE, or .SWITCH + + Returns None when reconstructed from the driver pre-CUDA 13.2, + as the conditional type cannot be determined. + """ + + @property + def branches(self) -> tuple[GraphDefinition, ...]: + """The body graphs for each branch as a tuple of GraphDefinition. + + Returns an empty tuple when reconstructed from the driver + pre-CUDA 13.2. + """ + +class IfNode(ConditionalNode): + """An if-conditional node.""" + + def __repr__(self) -> str: + ... + + @property + def then(self) -> GraphDefinition: + """The 'then' branch graph.""" + +class IfElseNode(ConditionalNode): + """An if-else conditional node.""" + + def __repr__(self) -> str: + ... + + @property + def then(self) -> GraphDefinition: + """The ``then`` branch graph (executed when condition is non-zero).""" + + @property + def else_(self) -> GraphDefinition: + """The ``else`` branch graph (executed when condition is zero).""" + +class WhileNode(ConditionalNode): + """A while-loop conditional node.""" + + def __repr__(self) -> str: + ... + + @property + def body(self) -> GraphDefinition: + """The loop body graph.""" + +class SwitchNode(ConditionalNode): + """A switch conditional node.""" + + def __repr__(self) -> str: + ... +__all__ = ['AllocNode', 'ChildGraphNode', 'ConditionalNode', 'EmptyNode', 'EventRecordNode', 'EventWaitNode', 'FreeNode', 'HostCallbackNode', 'IfElseNode', 'IfNode', 'KernelNode', 'MemcpyNode', 'MemsetNode', 'SwitchNode', 'WhileNode'] \ No newline at end of file diff --git a/cuda_core/cuda/core/graph/_subclasses.pyx b/cuda_core/cuda/core/graph/_subclasses.pyx new file mode 100644 index 00000000000..a393dfff693 --- /dev/null +++ b/cuda_core/cuda/core/graph/_subclasses.pyx @@ -0,0 +1,766 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +"""GraphNode subclasses — EmptyNode through SwitchNode.""" + +from __future__ import annotations + +from libc.stddef cimport size_t +from libc.stdint cimport uintptr_t + +from cuda.bindings cimport cydriver + +from cuda.core._event cimport Event +from cuda.core._launch_config cimport LaunchConfig +from cuda.core._module cimport Kernel +from cuda.core.graph._graph_definition cimport GraphCondition, GraphDefinition +from cuda.core.graph._graph_node cimport GraphNode +from cuda.core._resource_handles cimport ( + EventHandle, + GraphHandle, + KernelHandle, + GraphNodeHandle, + as_cu, + as_intptr, + create_event_handle_ref, + create_graph_handle_ref, + create_kernel_handle_ref, + graph_node_get_graph, +) +from cuda.core._utils.cuda_utils cimport HANDLE_RETURN + +from cuda.core.graph._host_callback cimport _is_py_host_trampoline + +from cuda.core._utils.cuda_utils import driver, handle_return +from cuda.core.typing import GraphConditionalType + +__all__ = [ + 'AllocNode', + 'ChildGraphNode', + 'ConditionalNode', + 'EmptyNode', + 'EventRecordNode', + 'EventWaitNode', + 'FreeNode', + 'HostCallbackNode', + 'IfElseNode', + 'IfNode', + 'KernelNode', + 'MemcpyNode', + 'MemsetNode', + 'SwitchNode', + 'WhileNode', +] + + +cdef bint _has_cuGraphNodeGetParams = False +cdef bint _version_checked = False + +cdef bint _check_node_get_params(): + global _has_cuGraphNodeGetParams, _version_checked + if not _version_checked: + from cuda.core._utils.version import binding_version, driver_version + _has_cuGraphNodeGetParams = ( + driver_version() >= (13, 2, 0) and binding_version() >= (13, 2, 0) + ) + _version_checked = True + return _has_cuGraphNodeGetParams + + +cdef class EmptyNode(GraphNode): + """An empty (synchronization) node.""" + + @staticmethod + cdef EmptyNode _create_impl(GraphNodeHandle h_node): + cdef EmptyNode n = EmptyNode.__new__(EmptyNode) + n._h_node = h_node + return n + + def __repr__(self) -> str: + return f"" + + +cdef class KernelNode(GraphNode): + """A kernel launch node. + + Properties + ---------- + grid : tuple of int + Grid dimensions (gridDimX, gridDimY, gridDimZ). + block : tuple of int + Block dimensions (blockDimX, blockDimY, blockDimZ). + shmem_size : int + Dynamic shared memory size in bytes. + kernel : Kernel + The kernel object for this launch node. + config : LaunchConfig + A LaunchConfig reconstructed from this node's parameters. + """ + + @staticmethod + cdef KernelNode _create_with_params(GraphNodeHandle h_node, + tuple grid, tuple block, unsigned int shmem_size, + KernelHandle h_kernel): + """Create from known params (called by launch() builder).""" + cdef KernelNode n = KernelNode.__new__(KernelNode) + n._h_node = h_node + n._grid = grid + n._block = block + n._shmem_size = shmem_size + n._h_kernel = h_kernel + return n + + @staticmethod + cdef KernelNode _create_from_driver(GraphNodeHandle h_node): + """Create by fetching params from the driver (called by _create factory).""" + cdef cydriver.CUgraphNode node = as_cu(h_node) + cdef cydriver.CUDA_KERNEL_NODE_PARAMS params + with nogil: + HANDLE_RETURN(cydriver.cuGraphKernelNodeGetParams(node, ¶ms)) + cdef KernelHandle h_kernel = create_kernel_handle_ref(params.kern) + return KernelNode._create_with_params( + h_node, + (params.gridDimX, params.gridDimY, params.gridDimZ), + (params.blockDimX, params.blockDimY, params.blockDimZ), + params.sharedMemBytes, + h_kernel) + + def __repr__(self) -> str: + return (f"") + + @property + def grid(self) -> tuple[int, int, int]: + """Grid dimensions as a 3-tuple (gridDimX, gridDimY, gridDimZ).""" + return self._grid + + @property + def block(self) -> tuple[int, int, int]: + """Block dimensions as a 3-tuple (blockDimX, blockDimY, blockDimZ).""" + return self._block + + @property + def shmem_size(self) -> int: + """Dynamic shared memory size in bytes.""" + return self._shmem_size + + @property + def kernel(self) -> Kernel: + """The Kernel object for this launch node.""" + return Kernel._from_handle(self._h_kernel) + + @property + def config(self) -> LaunchConfig: + """A LaunchConfig reconstructed from this node's grid, block, and shmem_size. + + Note: cluster dimensions and is_cooperative are not preserved + by the CUDA driver's kernel node params, so they are not included. + """ + return LaunchConfig(grid=self._grid, block=self._block, + shmem_size=self._shmem_size) + + +cdef class AllocNode(GraphNode): + """A memory allocation node. + + Properties + ---------- + dptr : int + The device pointer for the allocation. + bytesize : int + The number of bytes allocated. + device_id : int + The device on which the allocation was made. + memory_type : GraphMemoryType | str + The type of memory allocated. + peer_access : tuple of int + Device IDs that have read-write access to this allocation. + """ + + @staticmethod + cdef AllocNode _create_with_params(GraphNodeHandle h_node, + cydriver.CUdeviceptr dptr, size_t bytesize, + int device_id, str memory_type, tuple peer_access): + """Create from known params (called by allocate() builder).""" + cdef AllocNode n = AllocNode.__new__(AllocNode) + n._h_node = h_node + n._dptr = dptr + n._bytesize = bytesize + n._device_id = device_id + n._memory_type = memory_type + n._peer_access = peer_access + return n + + @staticmethod + cdef AllocNode _create_from_driver(GraphNodeHandle h_node): + """Create by fetching params from the driver (called by _create factory).""" + cdef cydriver.CUgraphNode node = as_cu(h_node) + cdef cydriver.CUDA_MEM_ALLOC_NODE_PARAMS params + with nogil: + HANDLE_RETURN(cydriver.cuGraphMemAllocNodeGetParams(node, ¶ms)) + + cdef str memory_type + if params.poolProps.allocType == cydriver.CUmemAllocationType.CU_MEM_ALLOCATION_TYPE_PINNED: + if params.poolProps.location.type == cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_HOST: + memory_type = "host" + else: + memory_type = "device" + else: + IF CUDA_CORE_BUILD_MAJOR >= 13: + if params.poolProps.allocType == cydriver.CUmemAllocationType.CU_MEM_ALLOCATION_TYPE_MANAGED: + memory_type = "managed" + else: + memory_type = "device" + ELSE: + memory_type = "device" + + cdef list peer_ids = [] + cdef size_t i + for i in range(params.accessDescCount): + peer_ids.append(params.accessDescs[i].location.id) + + return AllocNode._create_with_params( + h_node, params.dptr, params.bytesize, + params.poolProps.location.id, memory_type, tuple(peer_ids)) + + def __repr__(self) -> str: + return (f"") + + @property + def dptr(self) -> int: + """The device pointer for the allocation.""" + return self._dptr + + @property + def bytesize(self) -> int: + """The number of bytes allocated.""" + return self._bytesize + + @property + def device_id(self) -> int: + """The device on which the allocation was made.""" + return self._device_id + + @property + def memory_type(self) -> str: + """The type of memory: ``"device"``, ``"host"``, or ``"managed"``.""" + return self._memory_type + + @property + def peer_access(self) -> tuple[int, ...]: + """Device IDs with read-write access to this allocation.""" + return self._peer_access + + +cdef class FreeNode(GraphNode): + """A memory deallocation node. + + Properties + ---------- + dptr : int + The device pointer being freed. + """ + + @staticmethod + cdef FreeNode _create_with_params(GraphNodeHandle h_node, + cydriver.CUdeviceptr dptr): + """Create from known params (called by deallocate() builder).""" + cdef FreeNode n = FreeNode.__new__(FreeNode) + n._h_node = h_node + n._dptr = dptr + return n + + @staticmethod + cdef FreeNode _create_from_driver(GraphNodeHandle h_node): + """Create by fetching params from the driver (called by _create factory).""" + cdef cydriver.CUgraphNode node = as_cu(h_node) + cdef cydriver.CUdeviceptr dptr + with nogil: + HANDLE_RETURN(cydriver.cuGraphMemFreeNodeGetParams(node, &dptr)) + return FreeNode._create_with_params(h_node, dptr) + + def __repr__(self) -> str: + return f"" + + @property + def dptr(self) -> int: + """The device pointer being freed.""" + return self._dptr + + +cdef class MemsetNode(GraphNode): + """A memset node. + + Properties + ---------- + dptr : int + The destination device pointer. + value : int + The fill value. + element_size : int + Element size in bytes (1, 2, or 4). + width : int + Width of the row in elements. + height : int + Number of rows. + pitch : int + Pitch in bytes (unused if height is 1). + """ + + @staticmethod + cdef MemsetNode _create_with_params(GraphNodeHandle h_node, + cydriver.CUdeviceptr dptr, unsigned int value, + unsigned int element_size, size_t width, + size_t height, size_t pitch): + """Create from known params (called by memset() builder).""" + cdef MemsetNode n = MemsetNode.__new__(MemsetNode) + n._h_node = h_node + n._dptr = dptr + n._value = value + n._element_size = element_size + n._width = width + n._height = height + n._pitch = pitch + return n + + @staticmethod + cdef MemsetNode _create_from_driver(GraphNodeHandle h_node): + """Create by fetching params from the driver (called by _create factory).""" + cdef cydriver.CUgraphNode node = as_cu(h_node) + cdef cydriver.CUDA_MEMSET_NODE_PARAMS params + with nogil: + HANDLE_RETURN(cydriver.cuGraphMemsetNodeGetParams(node, ¶ms)) + return MemsetNode._create_with_params( + h_node, params.dst, params.value, + params.elementSize, params.width, params.height, params.pitch) + + def __repr__(self) -> str: + return (f"") + + @property + def dptr(self) -> int: + """The destination device pointer.""" + return self._dptr + + @property + def value(self) -> int: + """The fill value.""" + return self._value + + @property + def element_size(self) -> int: + """Element size in bytes (1, 2, or 4).""" + return self._element_size + + @property + def width(self) -> int: + """Width of the row in elements.""" + return self._width + + @property + def height(self) -> int: + """Number of rows.""" + return self._height + + @property + def pitch(self) -> int: + """Pitch in bytes (unused if height is 1).""" + return self._pitch + + +cdef class MemcpyNode(GraphNode): + """A memcpy node. + + Properties + ---------- + dst : int + The destination pointer. + src : int + The source pointer. + size : int + The number of bytes copied. + """ + + @staticmethod + cdef MemcpyNode _create_with_params(GraphNodeHandle h_node, + cydriver.CUdeviceptr dst, cydriver.CUdeviceptr src, + size_t size, cydriver.CUmemorytype dst_type, + cydriver.CUmemorytype src_type): + """Create from known params (called by memcpy() builder).""" + cdef MemcpyNode n = MemcpyNode.__new__(MemcpyNode) + n._h_node = h_node + n._dst = dst + n._src = src + n._size = size + n._dst_type = dst_type + n._src_type = src_type + return n + + @staticmethod + cdef MemcpyNode _create_from_driver(GraphNodeHandle h_node): + """Create by fetching params from the driver (called by _create factory).""" + cdef cydriver.CUgraphNode node = as_cu(h_node) + cdef cydriver.CUDA_MEMCPY3D params + with nogil: + HANDLE_RETURN(cydriver.cuGraphMemcpyNodeGetParams(node, ¶ms)) + + cdef cydriver.CUdeviceptr dst + cdef cydriver.CUdeviceptr src + if params.dstMemoryType == cydriver.CU_MEMORYTYPE_HOST: + dst = params.dstHost + else: + dst = params.dstDevice + if params.srcMemoryType == cydriver.CU_MEMORYTYPE_HOST: + src = params.srcHost + else: + src = params.srcDevice + + return MemcpyNode._create_with_params( + h_node, dst, src, params.WidthInBytes, + params.dstMemoryType, params.srcMemoryType) + + def __repr__(self) -> str: + cdef str dt = "H" if self._dst_type == cydriver.CU_MEMORYTYPE_HOST else "D" + cdef str st = "H" if self._src_type == cydriver.CU_MEMORYTYPE_HOST else "D" + return (f"") + + @property + def dst(self) -> int: + """The destination pointer.""" + return self._dst + + @property + def src(self) -> int: + """The source pointer.""" + return self._src + + @property + def size(self) -> int: + """The number of bytes copied.""" + return self._size + + +cdef class ChildGraphNode(GraphNode): + """A child graph node. + + Properties + ---------- + child_graph : GraphDefinition + The embedded graph definition (non-owning wrapper). + """ + + @staticmethod + cdef ChildGraphNode _create_with_params(GraphNodeHandle h_node, + GraphHandle h_child_graph): + """Create from known params (called by embed() builder).""" + cdef ChildGraphNode n = ChildGraphNode.__new__(ChildGraphNode) + n._h_node = h_node + n._h_child_graph = h_child_graph + return n + + @staticmethod + cdef ChildGraphNode _create_from_driver(GraphNodeHandle h_node): + """Create by fetching params from the driver (called by _create factory).""" + cdef cydriver.CUgraphNode node = as_cu(h_node) + cdef cydriver.CUgraph child_graph = NULL + with nogil: + HANDLE_RETURN(cydriver.cuGraphChildGraphNodeGetGraph(node, &child_graph)) + cdef GraphHandle h_graph = graph_node_get_graph(h_node) + cdef GraphHandle h_child = create_graph_handle_ref(child_graph, h_graph) + return ChildGraphNode._create_with_params(h_node, h_child) + + def __repr__(self) -> str: + return (f"") + + @property + def child_graph(self) -> GraphDefinition: + """The embedded graph definition (non-owning wrapper).""" + return GraphDefinition._from_handle(self._h_child_graph) + + +cdef class EventRecordNode(GraphNode): + """An event record node. + + Properties + ---------- + event : Event + The event being recorded. + """ + + @staticmethod + cdef EventRecordNode _create_with_params(GraphNodeHandle h_node, + EventHandle h_event): + """Create from known params (called by record() builder).""" + cdef EventRecordNode n = EventRecordNode.__new__(EventRecordNode) + n._h_node = h_node + n._h_event = h_event + return n + + @staticmethod + cdef EventRecordNode _create_from_driver(GraphNodeHandle h_node): + """Create by fetching params from the driver (called by _create factory).""" + cdef cydriver.CUgraphNode node = as_cu(h_node) + cdef cydriver.CUevent event + with nogil: + HANDLE_RETURN(cydriver.cuGraphEventRecordNodeGetEvent(node, &event)) + cdef EventHandle h_event = create_event_handle_ref(event) + return EventRecordNode._create_with_params(h_node, h_event) + + def __repr__(self) -> str: + return (f"") + + @property + def event(self) -> Event: + """The event being recorded.""" + return Event._from_handle(self._h_event) + + +cdef class EventWaitNode(GraphNode): + """An event wait node. + + Properties + ---------- + event : Event + The event being waited on. + """ + + @staticmethod + cdef EventWaitNode _create_with_params(GraphNodeHandle h_node, + EventHandle h_event): + """Create from known params (called by wait() builder).""" + cdef EventWaitNode n = EventWaitNode.__new__(EventWaitNode) + n._h_node = h_node + n._h_event = h_event + return n + + @staticmethod + cdef EventWaitNode _create_from_driver(GraphNodeHandle h_node): + """Create by fetching params from the driver (called by _create factory).""" + cdef cydriver.CUgraphNode node = as_cu(h_node) + cdef cydriver.CUevent event + with nogil: + HANDLE_RETURN(cydriver.cuGraphEventWaitNodeGetEvent(node, &event)) + cdef EventHandle h_event = create_event_handle_ref(event) + return EventWaitNode._create_with_params(h_node, h_event) + + def __repr__(self) -> str: + return (f"") + + @property + def event(self) -> Event: + """The event being waited on.""" + return Event._from_handle(self._h_event) + + +cdef class HostCallbackNode(GraphNode): + """A host callback node. + + Properties + ---------- + callback : callable or None + The Python callable (None for ctypes function pointer callbacks). + """ + + @staticmethod + cdef HostCallbackNode _create_with_params(GraphNodeHandle h_node, + object callable_obj, cydriver.CUhostFn fn, + void* user_data): + """Create from known params (called by callback() builder).""" + cdef HostCallbackNode n = HostCallbackNode.__new__(HostCallbackNode) + n._h_node = h_node + n._callable = callable_obj + n._fn = fn + n._user_data = user_data + return n + + @staticmethod + cdef HostCallbackNode _create_from_driver(GraphNodeHandle h_node): + """Create by fetching params from the driver (called by _create factory).""" + cdef cydriver.CUgraphNode node = as_cu(h_node) + cdef cydriver.CUDA_HOST_NODE_PARAMS params + with nogil: + HANDLE_RETURN(cydriver.cuGraphHostNodeGetParams(node, ¶ms)) + + cdef object callable_obj = None + if _is_py_host_trampoline(params.fn): + callable_obj = params.userData + + return HostCallbackNode._create_with_params( + h_node, callable_obj, params.fn, params.userData) + + def __repr__(self) -> str: + if self._callable is not None: + name = getattr(self._callable, '__name__', '?') + return (f"") + return (f"self._fn:x}>") + + @property + def callback(self): + """The Python callable, or None for ctypes function pointer callbacks.""" + return self._callable + + +cdef class ConditionalNode(GraphNode): + """Base class for conditional nodes. + + When created via builder methods (if_then, if_else, while_loop, switch), + a specific subclass (IfNode, IfElseNode, WhileNode, SwitchNode) is + returned. When reconstructed from the driver on CUDA 13.2+, the + correct subclass is determined via cuGraphNodeGetParams. On older + drivers, this base class is used as a fallback. + + Properties + ---------- + condition : GraphCondition or None + The condition variable controlling execution (None pre-13.2). + cond_type : str or None + The conditional type ("if", "while", or "switch"; None pre-13.2). + branches : tuple of GraphDefinition + The body graphs for each branch (empty pre-13.2). + """ + + @staticmethod + cdef ConditionalNode _create_from_driver(GraphNodeHandle h_node): + cdef ConditionalNode n + if not _check_node_get_params(): + n = ConditionalNode.__new__(ConditionalNode) + n._h_node = h_node + n._condition = None + n._cond_type = cydriver.CU_GRAPH_COND_TYPE_IF + n._branches = () + return n + + cdef cydriver.CUgraphNode node = as_cu(h_node) + params = handle_return(driver.cuGraphNodeGetParams( + node)) + cond_params = params.conditional + cdef int cond_type_int = int(cond_params.type) + cdef unsigned int size = int(cond_params.size) + + cdef GraphCondition condition = GraphCondition.__new__(GraphCondition) + condition._c_handle = ( + int(cond_params.handle)) + + cdef GraphHandle h_graph = graph_node_get_graph(h_node) + cdef list branch_list = [] + cdef unsigned int i + cdef GraphHandle h_branch + if cond_params.phGraph_out is not None: + for i in range(size): + h_branch = create_graph_handle_ref( + int(cond_params.phGraph_out[i]), + h_graph) + branch_list.append(GraphDefinition._from_handle(h_branch)) + cdef tuple branches = tuple(branch_list) + + cdef type cls + if cond_type_int == cydriver.CU_GRAPH_COND_TYPE_IF: + if size == 1: + cls = IfNode + else: + cls = IfElseNode + elif cond_type_int == cydriver.CU_GRAPH_COND_TYPE_WHILE: + cls = WhileNode + else: + cls = SwitchNode + + n = cls.__new__(cls) + n._h_node = h_node + n._condition = condition + n._cond_type = cond_type_int + n._branches = branches + return n + + def __repr__(self) -> str: + return f"" + + @property + def condition(self) -> GraphCondition | None: + """The condition variable controlling execution.""" + return self._condition + + @property + def cond_type(self) -> GraphConditionalType | None: + """The conditional type: GraphConditionalType.IF, .WHILE, or .SWITCH + + Returns None when reconstructed from the driver pre-CUDA 13.2, + as the conditional type cannot be determined. + """ + if self._condition is None: + return None + if self._cond_type == cydriver.CU_GRAPH_COND_TYPE_IF: + return GraphConditionalType("if") + elif self._cond_type == cydriver.CU_GRAPH_COND_TYPE_WHILE: + return GraphConditionalType("while") + else: + return GraphConditionalType("switch") + + @property + def branches(self) -> tuple[GraphDefinition, ...]: + """The body graphs for each branch as a tuple of GraphDefinition. + + Returns an empty tuple when reconstructed from the driver + pre-CUDA 13.2. + """ + return self._branches + + +cdef class IfNode(ConditionalNode): + """An if-conditional node.""" + + def __repr__(self) -> str: + return (f"self._condition._c_handle:x}>") + + @property + def then(self) -> GraphDefinition: + """The 'then' branch graph.""" + return self._branches[0] + + +cdef class IfElseNode(ConditionalNode): + """An if-else conditional node.""" + + def __repr__(self) -> str: + return (f"self._condition._c_handle:x}>") + + @property + def then(self) -> GraphDefinition: + """The ``then`` branch graph (executed when condition is non-zero).""" + return self._branches[0] + + @property + def else_(self) -> GraphDefinition: + """The ``else`` branch graph (executed when condition is zero).""" + return self._branches[1] + + +cdef class WhileNode(ConditionalNode): + """A while-loop conditional node.""" + + def __repr__(self) -> str: + return (f"self._condition._c_handle:x}>") + + @property + def body(self) -> GraphDefinition: + """The loop body graph.""" + return self._branches[0] + + +cdef class SwitchNode(ConditionalNode): + """A switch conditional node.""" + + def __repr__(self) -> str: + return (f"self._condition._c_handle:x}>") diff --git a/cuda_core/cuda/core/py.typed b/cuda_core/cuda/core/py.typed new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cuda_core/cuda/core/system/__init__.py b/cuda_core/cuda/core/system/__init__.py index 918d135901f..685519f9b80 100644 --- a/cuda_core/cuda/core/system/__init__.py +++ b/cuda_core/cuda/core/system/__init__.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 @@ -8,19 +8,31 @@ # contexts created, so that a user can use NVML to explore things about their # system without loading CUDA. +from typing import TYPE_CHECKING __all__ = [ "CUDA_BINDINGS_NVML_IS_COMPATIBLE", - "get_driver_version", - "get_driver_version_full", + "get_kernel_mode_driver_version", "get_num_devices", "get_process_name", + "get_user_mode_driver_version", ] +from cuda.core.system import typing + from ._system import * -if CUDA_BINDINGS_NVML_IS_COMPATIBLE: +# The TYPE_CHECKING branch is split out from the runtime branch so that +# stubgen-pyx, which only recognizes the literal `if TYPE_CHECKING:` form, +# preserves these imports in the generated .pyi. When +# CUDA_BINDINGS_NVML_IS_COMPATIBLE is no longer necessary, this complexity can +# be removed. +if TYPE_CHECKING: + from ._device import * + from ._system_events import * + from .exceptions import * +elif CUDA_BINDINGS_NVML_IS_COMPATIBLE: from ._device import * from ._device import __all__ as _device_all from ._system_events import * diff --git a/cuda_core/cuda/core/system/_clock.pxi b/cuda_core/cuda/core/system/_clock.pxi index 89e9020f4c9..56889e37d29 100644 --- a/cuda_core/cuda/core/system/_clock.pxi +++ b/cuda_core/cuda/core/system/_clock.pxi @@ -3,9 +3,32 @@ # SPDX-License-Identifier: Apache-2.0 -ClockId = nvml.ClockId -ClocksEventReasons = nvml.ClocksEventReasons -ClockType = nvml.ClockType +_CLOCK_ID_MAPPING = { + ClockId.CURRENT: nvml.ClockId.CURRENT, + ClockId.CUSTOMER_BOOST_MAX: nvml.ClockId.CUSTOMER_BOOST_MAX, +} + + +_CLOCKS_EVENT_REASONS_MAPPING = { + nvml.ClocksEventReasons.EVENT_REASON_NONE: ClocksEventReasons.NONE, + nvml.ClocksEventReasons.EVENT_REASON_GPU_IDLE: ClocksEventReasons.GPU_IDLE, + nvml.ClocksEventReasons.EVENT_REASON_APPLICATIONS_CLOCKS_SETTING: ClocksEventReasons.APPLICATIONS_CLOCKS_SETTING, + nvml.ClocksEventReasons.EVENT_REASON_SW_POWER_CAP: ClocksEventReasons.SW_POWER_CAP, + nvml.ClocksEventReasons.THROTTLE_REASON_HW_SLOWDOWN: ClocksEventReasons.HW_SLOWDOWN, + nvml.ClocksEventReasons.EVENT_REASON_SYNC_BOOST: ClocksEventReasons.SYNC_BOOST, + nvml.ClocksEventReasons.EVENT_REASON_SW_THERMAL_SLOWDOWN: ClocksEventReasons.SW_THERMAL_SLOWDOWN, + nvml.ClocksEventReasons.THROTTLE_REASON_HW_THERMAL_SLOWDOWN: ClocksEventReasons.HW_THERMAL_SLOWDOWN, + nvml.ClocksEventReasons.THROTTLE_REASON_HW_POWER_BRAKE_SLOWDOWN: ClocksEventReasons.HW_POWER_BRAKE_SLOWDOWN, + nvml.ClocksEventReasons.EVENT_REASON_DISPLAY_CLOCK_SETTING: ClocksEventReasons.DISPLAY_CLOCK_SETTING, +} + + +_CLOCK_TYPE_MAPPING = { + ClockType.GRAPHICS: nvml.ClockType.CLOCK_GRAPHICS, + ClockType.SM: nvml.ClockType.CLOCK_SM, + ClockType.MEMORY: nvml.ClockType.CLOCK_MEM, + ClockType.VIDEO: nvml.ClockType.CLOCK_VIDEO, +} cdef class ClockOffsets: @@ -48,11 +71,18 @@ cdef class ClockInfo: cdef intptr_t _handle cdef int _clock_type - def __init__(self, handle, clock_type: ClockType): + def __init__(self, handle: int, clock_type: ClockType | str): self._handle = handle + try: + clock_type = _CLOCK_TYPE_MAPPING[clock_type] + except KeyError: + raise ValueError( + f"Invalid clock type: {clock_type}. " + f"Must be one of {list(ClockType.__members__.values())}" + ) from None self._clock_type = int(clock_type) - def get_current_mhz(self, clock_id: ClockId = ClockId.CURRENT) -> int: + def get_current_mhz(self, clock_id: ClockId | str = ClockId.CURRENT) -> int: """ Get the current clock speed of a specific clock domain, in MHz. @@ -60,14 +90,21 @@ cdef class ClockInfo: Parameters ---------- - clock_id: :class:`ClockId` - The clock ID to query. + clock_id: :class:`ClockId` | str + The clock ID to query. Defaults to the current clock value. Returns ------- int The clock speed in MHz. """ + try: + clock_id = _CLOCK_ID_MAPPING[clock_id] + except KeyError: + raise ValueError( + f"Invalid clock ID: {clock_id}. " + f"Must be one of {list(ClockId.__members__.values())}" + ) from None return nvml.device_get_clock(self._handle, self._clock_type, clock_id) def get_max_mhz(self) -> int: @@ -99,24 +136,26 @@ cdef class ClockInfo: """ return nvml.device_get_max_customer_boost_clock(self._handle, self._clock_type) - def get_min_max_clock_of_pstate_mhz(self, pstate: Pstates) -> tuple[int, int]: + def get_min_max_clock_of_pstate_mhz(self, pstate: int) -> tuple[int, int]: """ Get the minimum and maximum clock speeds for this clock domain at a given performance state (Pstate), in MHz. Parameters ---------- - pstate: :class:`Pstates` - The performance state to query. + pstate: int + The performance state to query. Must be an int between 0 and 15, + where 0 is the highest performance state (P0) and 15 is the lowest + (P15). Returns ------- tuple[int, int] A tuple containing the minimum and maximum clock speeds in MHz. """ - return nvml.device_get_min_max_clock_of_p_state(self._handle, self._clock_type, pstate) + return nvml.device_get_min_max_clock_of_p_state(self._handle, self._clock_type, _pstate_to_enum(pstate)) - def get_offsets(self, pstate: Pstates) -> ClockOffsets: + def get_offsets(self, pstate: int) -> ClockOffsets: """ Retrieve min, max and current clock offset of some clock domain for a given Pstate. @@ -124,12 +163,14 @@ cdef class ClockInfo: Parameters ---------- - pstate: :class:`Pstates` - The performance state to query. + pstate: int + The performance state to query. Must be an int between 0 and 15, + where 0 is the highest performance state (P0) and 15 is the lowest + (P15). Returns ------- - ClockOffsets + :obj:`~_device.ClockOffsets` An object with the min, max and current clock offset. """ - return ClockOffsets(nvml.device_get_clock_offsets(self._handle, self._clock_type, pstate)) + return ClockOffsets(nvml.device_get_clock_offsets(self._handle, self._clock_type, _pstate_to_enum(pstate))) diff --git a/cuda_core/cuda/core/system/_cooler.pxi b/cuda_core/cuda/core/system/_cooler.pxi index b3ab76939e8..b24f9252822 100644 --- a/cuda_core/cuda/core/system/_cooler.pxi +++ b/cuda_core/cuda/core/system/_cooler.pxi @@ -3,8 +3,18 @@ # SPDX-License-Identifier: Apache-2.0 -CoolerControl = nvml.CoolerControl -CoolerTarget = nvml.CoolerTarget +_COOLER_CONTROL_MAPPING = { + nvml.CoolerControl.THERMAL_COOLER_SIGNAL_TOGGLE: CoolerControl.TOGGLE, + nvml.CoolerControl.THERMAL_COOLER_SIGNAL_VARIABLE: CoolerControl.VARIABLE, +} + + +_COOLER_TARGET_MAPPING = { + nvml.CoolerTarget.THERMAL_NONE: CoolerTarget.NONE, + nvml.CoolerTarget.THERMAL_GPU: CoolerTarget.GPU, + nvml.CoolerTarget.THERMAL_MEMORY: CoolerTarget.MEMORY, + nvml.CoolerTarget.THERMAL_POWER_SUPPLY: CoolerTarget.POWER_SUPPLY, +} cdef class CoolerInfo: @@ -14,14 +24,13 @@ cdef class CoolerInfo: self._cooler_info = cooler_info @property - def signal_type(self) -> CoolerControl: + def signal_type(self) -> CoolerControl | None: """ The cooler's control signal characteristics. - The possible types are restricted, variable and toggle. See - :class:`CoolerControl` for details. + The possible types are variable and toggle. """ - return CoolerControl(self._cooler_info.signal_type) + return _COOLER_CONTROL_MAPPING.get(self._cooler_info.signal_type, None) @property def target(self) -> list[CoolerTarget]: @@ -32,4 +41,11 @@ cdef class CoolerInfo: :class:`CoolerTarget` for details. """ cdef uint64_t[1] targets = [self._cooler_info.target] - return [CoolerTarget(1 << ev) for ev in _unpack_bitmask(targets)] + output_targets = [] + for target in _unpack_bitmask(targets): + try: + output_target = _COOLER_TARGET_MAPPING[1 << target] + except KeyError: + raise ValueError(f"Unknown cooler target bit: {1 << target}") + output_targets.append(output_target) + return output_targets diff --git a/cuda_core/cuda/core/system/_device.pyi b/cuda_core/cuda/core/system/_device.pyi new file mode 100644 index 00000000000..0a51e5c9928 --- /dev/null +++ b/cuda_core/cuda/core/system/_device.pyi @@ -0,0 +1,1952 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/system/_device.pyx + +from __future__ import annotations + +from typing import Iterable + +import cuda.core +from cuda.bindings import nvml +from cuda.core.system.typing import (AddressingMode, AffinityScope, ClockId, + ClocksEventReasons, ClockType, + CoolerControl, CoolerTarget, DeviceArch, + EventType, FanControlPolicy, FieldId, + GpuP2PCapsIndex, GpuP2PStatus, + GpuTopologyLevel, InforomObject, + TemperatureThresholds, ThermalController, + ThermalTarget) + + +class ClockOffsets: + """ + Contains clock offset information. + """ + + def __init__(self, clock_offset: nvml.ClockOffset): + ... + + @property + def clock_offset_mhz(self) -> int: + """ + The current clock offset in MHz. + """ + + @property + def max_offset_mhz(self) -> int: + """ + The maximum clock offset in MHz. + """ + + @property + def min_offset_mhz(self) -> int: + """ + The minimum clock offset in MHz. + """ + +class ClockInfo: + """ + Accesses various clock information about a device. + """ + + def __init__(self, handle: int, clock_type: ClockType | str): + ... + + def get_current_mhz(self, clock_id: ClockId | str=...) -> int: + """ + Get the current clock speed of a specific clock domain, in MHz. + + For Kepler™ or newer fully supported devices. + + Parameters + ---------- + clock_id: :class:`ClockId` | str + The clock ID to query. Defaults to the current clock value. + + Returns + ------- + int + The clock speed in MHz. + """ + + def get_max_mhz(self) -> int: + """ + Get the maximum clock speed of a specific clock domain, in MHz. + + For Fermi™ or newer fully supported devices. + + Current P0 clocks (reported by :meth:`get_current_mhz` can differ from + max clocks by a few MHz. + + Returns + ------- + int + The maximum clock speed in MHz. + """ + + def get_max_customer_boost_mhz(self) -> int: + """ + Get the maximum customer boost clock speed of a specific clock, in MHz. + + For Pascal™ or newer fully supported devices. + + Returns + ------- + int + The maximum customer boost clock speed in MHz. + """ + + def get_min_max_clock_of_pstate_mhz(self, pstate: int) -> tuple[int, int]: + """ + Get the minimum and maximum clock speeds for this clock domain + at a given performance state (Pstate), in MHz. + + Parameters + ---------- + pstate: int + The performance state to query. Must be an int between 0 and 15, + where 0 is the highest performance state (P0) and 15 is the lowest + (P15). + + Returns + ------- + tuple[int, int] + A tuple containing the minimum and maximum clock speeds in MHz. + """ + + def get_offsets(self, pstate: int) -> ClockOffsets: + """ + Retrieve min, max and current clock offset of some clock domain for a given Pstate. + + For Maxwell™ or newer fully supported devices. + + Parameters + ---------- + pstate: int + The performance state to query. Must be an int between 0 and 15, + where 0 is the highest performance state (P0) and 15 is the lowest + (P15). + + Returns + ------- + :obj:`~_device.ClockOffsets` + An object with the min, max and current clock offset. + """ + +class CoolerInfo: + + def __init__(self, cooler_info: nvml.CoolerInfo): + ... + + @property + def signal_type(self) -> CoolerControl | None: + """ + The cooler's control signal characteristics. + + The possible types are variable and toggle. + """ + + @property + def target(self) -> list[CoolerTarget]: + """ + The target that cooler controls. + + Targets may be GPU, Memory, Power Supply, or all of these. See + :class:`CoolerTarget` for details. + """ + +class DeviceAttributes: + """ + Various device attributes. + """ + + def __init__(self, attributes: nvml.DeviceAttributes): + ... + + @property + def multiprocessor_count(self) -> int: + """ + The streaming multiprocessor count + """ + + @property + def shared_copy_engine_count(self) -> int: + """ + The shared copy engine count + """ + + @property + def shared_decoder_count(self) -> int: + """ + The shared decoder engine count + """ + + @property + def shared_encoder_count(self) -> int: + """ + The shared encoder engine count + """ + + @property + def shared_jpeg_count(self) -> int: + """ + The shared JPEG engine count + """ + + @property + def shared_ofa_count(self) -> int: + """ + The shared optical flow accelerator (OFA) engine count + """ + + @property + def gpu_instance_slice_count(self) -> int: + """ + The GPU instance slice count + """ + + @property + def compute_instance_slice_count(self) -> int: + """ + The compute instance slice count + """ + + @property + def memory_size_mb(self) -> int: + """ + Device memory size in MiB + """ + +class EventData: + """ + Data about a single event. + """ + + def __init__(self, event_data: nvml.EventData): + ... + + @property + def device(self) -> Device: + """ + The device on which the event occurred. + """ + + @property + def event_type(self) -> EventType: + """ + The type of event that was triggered. + """ + + @property + def event_data(self) -> int: + """ + Returns Xid error for the device in the event of + :attr:`~cuda.core.system.EventType.XID_CRITICAL_ERROR`. + + Raises :class:`ValueError` for other event types. + """ + + @property + def gpu_instance_id(self) -> int: + """ + The GPU instance ID for MIG devices. + + Only valid for events of type :attr:`EventType.XID_CRITICAL_ERROR`. + + Raises :class:`ValueError` for other event types. + """ + + @property + def compute_instance_id(self) -> int: + """ + The Compute instance ID for MIG devices. + + Only valid for events of type :attr:`EventType.XID_CRITICAL_ERROR`. + + Raises :class:`ValueError` for other event types. + """ + +class DeviceEvents: + """ + Represents a set of events that can be waited on for a specific device. + """ + + def __init__(self, device_handle: int, events: EventType | str | list[EventType | str]): + ... + + def __dealloc__(self) -> None: + ... + + def wait(self, timeout_ms: int=0) -> EventData: + """ + Wait for events in the event set. + + For Fermi™ or newer fully supported devices. + + If some events are ready to be delivered at the time of the call, + function returns immediately. If there are no events ready to be + delivered, function sleeps until event arrives but not longer than + specified timeout. If timeout passes, a + :class:`cuda.core.system.TimeoutError` is raised. This function in + certain conditions can return before specified timeout passes (e.g. when + interrupt arrives). + + On Windows, in case of Xid error, the function returns the most recent + Xid error type seen by the system. If there are multiple Xid errors + generated before ``wait`` is invoked, then the last seen Xid + error type is returned for all Xid error events. + + On Linux, every Xid error event would return the associated event data + and other information if applicable. + + In MIG mode, if device handle is provided, the API reports all the + events for the available instances, only if the caller has appropriate + privileges. In absence of required privileges, only the events which + affect all the instances (i.e. whole device) are reported. + + This API does not currently support per-instance event reporting using + MIG device handles. + + Parameters + ---------- + timeout_ms: int + The timeout in milliseconds. A value of 0 means to wait indefinitely. + + Raises + ------ + :class:`cuda.core.system.TimeoutError` + If the timeout expires before an event is received. + :class:`cuda.core.system.GpuIsLostError` + If the GPU has fallen off the bus or is otherwise inaccessible. + """ + +class FanInfo: + """ + Manages information related to a specific fan on a specific device. + """ + + def __init__(self, handle: int, fan: int): + ... + + @property + def speed(self) -> int: + """ + Get/set the intended operating speed of the device's fan. + + For all discrete products with dedicated fans. + + Note: The reported speed is the intended fan speed. If the fan is + physically blocked and unable to spin, the output will not match the + actual fan speed. + + The fan speed is expressed as a percentage of the product's maximum + noise tolerance fan speed. This value may exceed 100% in certain cases. + """ + + @speed.setter + def speed(self, speed: int) -> None: + ... + + @property + def speed_rpm(self) -> int: + """ + The intended operating speed of the device's fan in rotations per minute + (RPM). + + For Maxwell™ or newer fully supported devices. + + For all discrete products with dedicated fans. + + Note: The reported speed is the intended fan speed. If the fan is + physically blocked and unable to spin, the output will not match the + actual fan speed. + """ + + @property + def target_speed(self) -> int: + """ + Retrieves the intended target speed of the device's specified fan. + + For all discrete products with dedicated fans. + + Normally, the driver dynamically adjusts the fan based on + the needs of the GPU. But when users set fan speed using ``speed``, + the driver will attempt to make the fan achieve that setting. + The actual current speed of the fan is reported in ``speed``. + + The fan speed is expressed as a percentage of the product's maximum + noise tolerance fan speed. This value may exceed 100% in certain cases. + """ + + @property + def min_max_speed(self) -> tuple[int, int]: + """ + Retrieves the minimum and maximum fan speed all of the device's fans. + + For all discrete products with dedicated fans. + + Returns + ------- + tuple[int, int] + A tuple of (min_speed, max_speed) + """ + + @property + def control_policy(self) -> FanControlPolicy: + """ + The current fan control policy. + + For Maxwell™ or newer fully supported devices. + + For all CUDA-capable discrete products with fans. + """ + + def set_default_speed(self) -> None: + """ + Set the speed of the fan control policy to default. + + For all CUDA-capable discrete products with fans. + """ + +class FieldValue: + """ + Represents the data from a single field value. + + Use :meth:`Device.get_field_values` to get multiple field values at once. + """ + + def __init__(self, field_value: nvml.FieldValue): + ... + + @property + def field_id(self) -> FieldId: + """ + The field ID. + """ + + @property + def scope_id(self) -> int: + """ + The scope ID. + """ + + @property + def timestamp(self) -> int: + """ + The CPU timestamp (in microseconds since 1970) at which the value was + sampled. + """ + + @property + def latency_usec(self) -> int: + """ + How long this field value took to update (in usec) within NVML. This may + be averaged across several fields that are serviced by the same driver + call. + """ + + @property + def value(self) -> int | float: + """ + The field value. + + Raises + ------ + :class:`cuda.core.system.NvmlError` + If there was an error retrieving the field value. + """ + +class FieldValues: + """ + Container of multiple field values. + """ + + def __init__(self, field_values: nvml.FieldValue): + ... + + def __getitem__(self, idx: int) -> FieldValue: + ... + + def __len__(self) -> int: + ... + + def validate(self) -> None: + """ + Validate that there are no issues in any of the contained field values. + + Raises an exception for the first issue found, if any. + + Raises + ------ + :class:`cuda.core.system.NvmlError` + If any of the contained field values has an associated exception. + """ + + def get_all_values(self) -> list[int | float]: + """ + Get all field values as a list. + + This will validate each of the values and include just the core value in + the list. + + Returns + ------- + list[int | float] + List of all field values. + + Raises + ------ + :class:`cuda.core.system.NvmlError` + If any of the contained field values has an associated exception. + """ + +class InforomInfo: + + def __init__(self, device: Device): + ... + + def get_version(self, inforom: InforomObject | str) -> str: + """ + Retrieves the InfoROM version for a given InfoROM object. + + For all products with an InfoROM. + + Fermi™ and higher parts have non-volatile on-board memory for persisting + device info, such as aggregate ECC counts. + + Parameters + ---------- + inforom: :class:`InforomObject` + The InfoROM object to query. + + Returns + ------- + str + The InfoROM version. + """ + + @property + def image_version(self) -> str: + """ + Retrieves the global InfoROM image version. + + For all products with an InfoROM. + + Image version just like VBIOS version uniquely describes the exact + version of the InfoROM flashed on the board in contrast to InfoROM + object version which is only an indicator of supported features. + + Returns + ------- + str + The InfoROM image version. + """ + + @property + def configuration_checksum(self) -> int: + """ + Retrieves the checksum of the configuration stored in the device's InfoROM. + + For all products with an InfoROM. + + Can be used to make sure that two GPUs have the exact same + configuration. Current checksum takes into account configuration stored + in PWR and ECC InfoROM objects. Checksum can change between driver + releases or when user changes configuration (e.g. disable/enable ECC) + + Returns + ------- + int + The InfoROM checksum. + """ + + def validate(self) -> None: + """ + Reads the InfoROM from the flash and verifies the checksums. + + For all products with an InfoROM. + + Raises + ------ + :class:`cuda.core.system.CorruptedInforomError` + If the device's InfoROM is corrupted. + """ + + @property + def bbx_flush_time(self) -> tuple[int, int]: + """ + Retrieves the timestamp and duration of the last flush of the BBX + (blackbox) InfoROM object during the current run. + + For all products with an InfoROM. + + Returns + ------- + tuple[int, int] + - timestamp: The start timestamp of the last BBX flush + - duration_us: The duration (in μs) of the last BBX flush + """ + + @property + def board_part_number(self) -> str: + """ + The device board part number which is programmed into the board's InfoROM. + """ + +class MemoryInfo: + """ + Memory allocation information for a device. + """ + + def __init__(self, memory_info: nvml.Memory_v2): + ... + + @property + def free(self) -> int: + """ + Unallocated device memory (in bytes) + """ + + @property + def total(self) -> int: + """ + Total physical device memory (in bytes) + """ + + @property + def used(self) -> int: + """ + Allocated device memory (in bytes) + """ + + @property + def reserved(self) -> int: + """ + Device memory (in bytes) reserved for system use (driver or firmware) + """ + +class BAR1MemoryInfo(MemoryInfo): + """ + BAR1 Memory allocation information for a device. + """ + + def __init__(self, memory_info: nvml.BAR1Memory): + ... + + @property + def free(self) -> int: + """ + Unallocated BAR1 memory (in bytes) + """ + + @property + def total(self) -> int: + """ + Total BAR1 memory (in bytes) + """ + + @property + def used(self) -> int: + """ + Allocated used memory (in bytes) + """ + +class MigInfo: + + def __init__(self, device: Device): + ... + + @property + def is_mig_device(self) -> bool: + """ + Whether this device is a MIG (Multi-Instance GPU) device. + + A MIG device handle is an NVML abstraction which maps to a MIG compute + instance. These overloaded references can be used (with some + restrictions) interchangeably with a GPU device handle to execute + queries at a per-compute instance granularity. + + For Ampere™ or newer fully supported devices. + """ + + @property + def mode(self) -> bool: + """ + Get current MIG mode for the device. + + For Ampere™ or newer fully supported devices. + + Changing MIG modes may require device unbind or reset. The "pending" MIG + mode refers to the target mode following the next activation trigger. + + Returns + ------- + bool + `True` if current MIG mode is enabled. + """ + + @mode.setter + def mode(self, mode: bool) -> None: + """ + Set the MIG mode for the device. + + For Ampere™ or newer fully supported devices. + + Changing MIG modes may require device unbind or reset. The "pending" MIG + mode refers to the target mode following the next activation trigger. + + Parameters + ---------- + mode: bool + `True` to enable MIG mode, `False` to disable MIG mode. + """ + + @property + def pending_mode(self) -> bool: + """ + Get pending MIG mode for the device. + + For Ampere™ or newer fully supported devices. + + Changing MIG modes may require device unbind or reset. The "pending" MIG + mode refers to the target mode following the next activation trigger. + + If the device is not a MIG device, returns `False`. + + Returns + ------- + bool + `True` if pending MIG mode is enabled. + """ + + @property + def device_count(self) -> int: + """ + Get the maximum number of MIG devices that can exist under this device. + + Returns zero if MIG is not supported or enabled. + + For Ampere™ or newer fully supported devices. + + Returns + ------- + int + The number of MIG devices (compute instances) on this GPU. + """ + + @property + def parent(self) -> Device: + """ + For MIG devices, get the parent GPU device. + + For Ampere™ or newer fully supported devices. + + Returns + ------- + Device + The parent GPU device for this MIG device. + """ + + def get_device_by_index(self, index: int) -> Device: + """ + Get MIG device for the given index under its parent device. + + If the compute instance is destroyed either explicitly or by destroying, + resetting or unbinding the parent GPU instance or the GPU device itself + the MIG device handle would remain invalid and must be requested again + using this API. Handles may be reused and their properties can change in + the process. + + For Ampere™ or newer fully supported devices. + + Parameters + ---------- + index: int + The index of the MIG device (compute instance) to retrieve. Must be + between 0 and the value returned by `device_count - 1`. + + Returns + ------- + Device + The MIG device corresponding to the given index. + """ + + def get_all_devices(self) -> Iterable[Device]: + """ + Get all MIG devices under its parent device. + + If the compute instance is destroyed either explicitly or by destroying, + resetting or unbinding the parent GPU instance or the GPU device itself + the MIG device handle would remain invalid and must be requested again + using this API. Handles may be reused and their properties can change in + the process. + + For Ampere™ or newer fully supported devices. + + Returns + ------- + list[Device] + A list of all MIG devices corresponding to this GPU. + """ + +class _NvlinkInfoMeta(type): + + @property + def max_links(cls): + """ + The statically-defined maximum number of Nvlinks available. Defined in + upstream NVML as ``NVML_NVLINK_MAX_LINKS``. + + To find the actual number of Nvlinks available on a device, use + :py:attr:`Device.get_nvlink_count`. + + .. version-deprecated:: 1.1.0 + This property is deprecated and will be removed in a future release. + Use :py:attr:`Device.get_nvlink_count` instead. + """ + +class _NvlinkInfo: + """ + Nvlink information for a device. + """ + + def __init__(self, device: Device, link: int): + ... + + @property + def version(self) -> tuple[int, int]: + """ + Retrieves the NvLink version for the device and link. + + For all products with NvLink support. + + Returns + ------- + tuple[int, int] + The Nvlink version as a tuple of (major, minor). + """ + + @property + def state(self) -> bool: + """ + Retrieves the state of the device's Nvlink for the device and link specified. + + For Pascal™ or newer fully supported devices. + + For all products with Nvlink support. + + Returns + ------- + bool + `True` if the Nvlink is active. + """ + +class NvlinkInfo(_NvlinkInfo, metaclass=_NvlinkInfoMeta): + ... + +class PciInfo: + """ + PCI information about a GPU device. + """ + + def __init__(self, pci_info_ext: nvml.PciInfoExt_v1, handle: int): + ... + + @property + def bus(self) -> int: + """ + The bus on which the device resides, 0 to 255 + """ + + @property + def bus_id(self) -> str: + """ + The tuple domain:bus:device.function PCI identifier string + """ + + @property + def device(self) -> int: + """ + The device's id on the bus, 0 to 31 + """ + + @property + def domain(self) -> int: + """ + The PCI domain on which the device's bus resides, 0 to 0xffffffff + """ + + @property + def vendor_id(self) -> int: + """ + The PCI vendor id of the device + """ + + @property + def device_id(self) -> int: + """ + The PCI device id of the device + """ + + @property + def subsystem_id(self) -> int: + """ + The subsystem device ID + """ + + @property + def base_class(self) -> int: + """ + The 8-bit PCI base class code + """ + + @property + def sub_class(self) -> int: + """ + The 8-bit PCI sub class code + """ + + @property + def link_generation(self) -> int: + """ + Retrieve the maximum PCIe link generation possible with this device and system. + + For Fermi™ or newer fully supported devices. + + For example, for a generation 2 PCIe device attached to a generation 1 + PCIe bus, the max link generation this function will report is + generation 1. + """ + + @property + def max_link_generation(self) -> int: + """ + Retrieve the maximum PCIe link generation supported by this GPU device. + + For Fermi™ or newer fully supported devices. + """ + + @property + def max_link_width(self) -> int: + """ + Retrieve the maximum PCIe link width possible with this device and system. + + For Fermi™ or newer fully supported devices. + + For example, for a device with a 16x PCIe bus width attached to a 8x + PCIe system bus this function will report + a max link width of 8. + """ + + @property + def current_link_generation(self) -> int: + """ + Retrieve the current PCIe link generation. + + For Fermi™ or newer fully supported devices. + """ + + @property + def current_link_width(self) -> int: + """ + Retrieve the current PCIe link width. + + For Fermi™ or newer fully supported devices. + """ + + @property + def rx_throughput(self) -> int: + """ + Retrieve PCIe reception throughput, in KB/s. + + This function is querying a byte counter over a 20ms interval, and thus + is the PCIe throughput over that interval. + + For Maxwell™ or newer fully supported devices. + + This method is not supported in virtual machines running virtual GPU + (vGPU). + """ + + @property + def tx_throughput(self) -> int: + """ + Retrieve PCIe transmission throughput, in KB/s. + + This function is querying a byte counter over a 20ms interval, and thus + is the PCIe throughput over that interval. + + For Maxwell™ or newer fully supported devices. + + This method is not supported in virtual machines running virtual GPU + (vGPU). + """ + + @property + def replay_counter(self) -> int: + """ + Retrieve the PCIe replay counter. + + For Kepler™ or newer fully supported devices. + """ + +class GpuDynamicPstatesUtilization: + + def __init__(self, ptr: int, owner: object): + ... + + @property + def is_present(self) -> bool: + """ + Set if the utilization domain is present on this GPU. + """ + + @property + def percentage(self) -> int: + """ + Percentage of time where the domain is considered busy in the last 1-second interval. + """ + + @property + def inc_threshold(self) -> int: + """ + Utilization threshold that can trigger a perf-increasing P-State change when crossed. + """ + + @property + def dec_threshold(self) -> int: + """ + Utilization threshold that can trigger a perf-decreasing P-State change when crossed. + """ + +class GpuDynamicPstatesInfo: + """ + Handles performance monitor samples from the device. + """ + + def __init__(self, gpu_dynamic_pstates_info: nvml.GpuDynamicPstatesInfo): + ... + + def __len__(self) -> int: + ... + + def __getitem__(self, idx: int) -> GpuDynamicPstatesUtilization: + ... + +class ProcessInfo: + """ + Information about running compute processes on the GPU. + """ + + def __init__(self, device: 'Device', process_info: nvml.ProcessInfo): + ... + + @property + def pid(self) -> int: + """ + The PID of the process. + """ + + @property + def used_gpu_memory(self) -> int: + """ + The amount of GPU memory (in bytes) used by the process. + """ + + @property + def gpu_instance_id(self) -> int: + """ + The GPU instance ID for MIG devices. + + Only valid for processes running on MIG devices. + """ + + @property + def compute_instance_id(self) -> int: + """ + The Compute instance ID for MIG devices. + + Only valid for processes running on MIG devices. + """ + +class RepairStatus: + """ + Repair status for TPC/Channel repair. + """ + + def __init__(self, handle: int): + ... + + @property + def channel_repair_pending(self) -> bool: + """ + `True` if a channel repair is pending. + """ + + @property + def tpc_repair_pending(self) -> bool: + """ + `True` if a TPC repair is pending. + """ + +class ThermalSensor: + + def __init__(self, ptr: int, owner: object): + ... + + @property + def controller(self) -> ThermalController: + ... + + @property + def default_min_temp(self) -> int: + ... + + @property + def default_max_temp(self) -> int: + ... + + @property + def current_temp(self) -> int: + ... + + @property + def target(self) -> ThermalTarget: + ... + +class ThermalSettings: + + def __init__(self, thermal_settings: nvml.ThermalSettings): + ... + + def __len__(self) -> int: + ... + + def __getitem__(self, idx: int) -> nvml.ThermalSensor: + ... + +class Temperature: + + def __init__(self, handle: int): + ... + + def get_sensor(self) -> int: + """ + Get the temperature reading from a specific sensor on the device, in + degrees Celsius. + + The only sensor currently supported is the GPU temperature sensor. + + Returns + ------- + int + The temperature in degrees Celsius. + """ + + def get_threshold(self, threshold_type: TemperatureThresholds | str) -> int: + """ + Retrieves the temperature threshold for this GPU with the specified + threshold type, in degrees Celsius. + + For Kepler™ or newer fully supported devices. + + See :class:`TemperatureThresholds` for possible threshold types. + + Note: This API is no longer the preferred interface for retrieving the + following temperature thresholds on Ada and later architectures: + ``NVML_TEMPERATURE_THRESHOLD_SHUTDOWN``, + ``NVML_TEMPERATURE_THRESHOLD_SLOWDOWN``, + ``NVML_TEMPERATURE_THRESHOLD_MEM_MAX`` and + ``NVML_TEMPERATURE_THRESHOLD_GPU_MAX``. + + Support for reading these temperature thresholds for Ada and later + architectures would be removed from this API in future releases. Please + use :meth:`get_field_values` with ``NVML_FI_DEV_TEMPERATURE_*`` fields + to retrieve temperature thresholds on these architectures. + """ + + @property + def margin(self) -> int: + """ + The thermal margin temperature (distance to nearest slowdown threshold) for the device. + """ + + def get_thermal_settings(self, sensor_index: ThermalTarget | str) -> ThermalSettings: + """ + Used to execute a list of thermal system instructions. + + Parameters + ---------- + sensor_index: ThermalTarget + The index of the thermal sensor. + + Returns + ------- + :obj:`~_device.ThermalSettings` + The thermal settings for the specified sensor. + """ + +class Utilization: + """ + Utilization rates for a device. + + For devices with compute capability 2.0 or higher. + """ + + def __init__(self, utilization: nvml.Utilization): + ... + + @property + def gpu(self) -> int: + """ + Percent of time over the past sample period during which one or more kernels was executing on the GPU. + """ + + @property + def memory(self) -> int: + """ + Percent of time over the past sample period during which global (device) memory was being read or written. + """ + +class Device: + """ + Representation of a device. + + :class:`cuda.core.system.Device` provides access to various pieces of metadata + about devices and their topology, as provided by the NVIDIA Management + Library (NVML). To use CUDA with a device, use :class:`cuda.core.Device`. + + Creating a device instance causes NVML to initialize the target GPU. + NVML may initialize additional GPUs if the target GPU is an SLI slave. + + Parameters + ---------- + index: int, optional + Integer representing the CUDA device index to get a handle to. Valid + values are between ``0`` and ``cuda.core.system.get_num_devices() - 1``. + + The order in which devices are enumerated has no guarantees of + consistency between reboots. For that reason, it is recommended that + devices are looked up by their PCI ids or UUID. + + uuid: bytes or str, optional + UUID of a CUDA device to get a handle to. + + pci_bus_id: bytes or str, optional + PCI bus ID of a CUDA device to get a handle to. + + Raises + ------ + ValueError + If anything other than a single `index`, `uuid` or `pci_bus_id` are specified. + """ + _handle: int + + def __init__(self, *, index: int | None=None, uuid: bytes | str | None=None, pci_bus_id: bytes | str | None=None) -> None: + ... + + @property + def index(self) -> int: + """ + The NVML index of this device. + + Valid indices are derived from the count returned by + :meth:`Device.get_device_count`. For example, if ``get_device_count()`` + returns 2, the valid indices are 0 and 1, corresponding to GPU 0 and GPU + 1. + + The order in which NVML enumerates devices has no guarantees of + consistency between reboots. For that reason, it is recommended that + devices be looked up by their PCI ids or GPU UUID. + + Note: The NVML index may not correlate with other APIs, such as the CUDA + device index. + """ + + @property + def uuid(self) -> str: + """ + Retrieves the globally unique immutable UUID associated with this + device, as a 5 part hexadecimal string, that augments the immutable, + board serial identifier. + + In the upstream NVML C++ API, the UUID includes a ``gpu-`` or ``mig-`` + prefix. If you need a `uuid` without that prefix (for example, to + interact with CUDA), use the `uuid_without_prefix` property. + """ + + @property + def uuid_without_prefix(self) -> str: + """ + Retrieves the globally unique immutable UUID associated with this + device, as a 5 part hexadecimal string, that augments the immutable, + board serial identifier. + + In the upstream NVML C++ API, the UUID includes a ``gpu-`` or ``mig-`` + prefix. This property returns it without the prefix, to match the UUIDs + used in CUDA. If you need the prefix, use the `uuid` property. + """ + + @property + def pci_bus_id(self) -> str: + """ + Retrieves the PCI bus ID of this device. + """ + + @property + def numa_node_id(self) -> int: + """ + The NUMA node of the given GPU device. + + This only applies to platforms where the GPUs are NUMA nodes. + """ + + @property + def arch(self) -> DeviceArch: + """ + :obj:`~DeviceArch` device architecture. + + For example, a Tesla V100 will report ``DeviceArchitecture.name == + "VOLTA"``, and RTX A6000 will report ``DeviceArchitecture.name == + "AMPERE"``. + """ + + @property + def name(self) -> str: + """ + Name of the device, e.g.: `"Tesla V100-SXM2-32GB"` + """ + + @property + def brand(self) -> str: + """ + The brand of the device. + + Returns "Unknown" if the brand is unknown. + """ + + @property + def serial(self) -> str: + """ + Retrieves the globally unique board serial number associated with this + device's board. + + For all products with an InfoROM. + """ + + @property + def module_id(self) -> int: + """ + Get a unique identifier for the device module on the baseboard. + + This API retrieves a unique identifier for each GPU module that exists + on a given baseboard. For non-baseboard products, this ID would always + be 0. + """ + + @property + def minor_number(self) -> int: + """ + The minor number of this device. + + For Linux only. + + The minor number is used by the Linux device driver to identify the + device node in ``/dev/nvidiaX``. + """ + + @property + def is_c2c_enabled(self) -> bool: + """ + Whether the C2C (Chip-to-Chip) mode is enabled for this device. + """ + + @property + def is_persistence_mode_enabled(self) -> bool: + """ + Whether persistence mode is enabled for this device. + + For Linux only. + """ + + @is_persistence_mode_enabled.setter + def is_persistence_mode_enabled(self, enabled: bool) -> None: + ... + + @property + def cuda_compute_capability(self) -> tuple[int, int]: + """ + CUDA compute capability of the device, e.g.: `(7, 0)` for a Tesla V100. + + Returns a tuple `(major, minor)`. + """ + + def to_cuda_device(self) -> 'cuda.core.Device': + """ + Get the corresponding :class:`cuda.core.Device` (which is used for CUDA + access) for this :class:`cuda.core.system.Device` (which is used for + NVIDIA Management Library (NVML) access). + + The devices are mapped to one another by their UUID. + + Returns + ------- + cuda.core.Device + The corresponding CUDA device. + + Raises + ------ + RuntimeError + No corresponding CUDA device is found for this NVML device. + + For example, on a MIG system, the physical GPU will not have an + available CUDA device, since it can not be used directly, even + though it can be enumerated from NVML. + """ + + @classmethod + def get_device_count(cls) -> int: + """ + Get the number of available devices. + + Returns + ------- + int + The number of available devices. + """ + + @classmethod + def get_all_devices(cls) -> Iterable[Device]: + """ + Query the available device instances. + + Returns + ------- + Iterator over :obj:`~Device` + An iterator over available devices. + """ + + @property + def addressing_mode(self) -> AddressingMode | None: + """ + Get the :obj:`~AddressingMode` of the device. + """ + + @property + def mig(self) -> MigInfo: + """ + Get :obj:`~MigInfo` accessor for MIG (Multi-Instance GPU) information. + + For Ampere™ or newer fully supported devices. + """ + + @classmethod + def get_all_devices_with_cpu_affinity(cls, cpu_index: int) -> Iterable[Device]: + """ + Retrieve the set of GPUs that have a CPU affinity with the given CPU number. + + Supported on Linux only. + + Parameters + ---------- + cpu_index: int + The CPU index. + + Returns + ------- + Iterator of :obj:`~Device` + An iterator over available devices. + """ + + def get_memory_affinity(self, scope: AffinityScope | str=...) -> list[int]: + """ + Retrieves a list of indices of NUMA nodes or CPU sockets with the ideal + memory affinity for the device. + + For Kepler™ or newer fully supported devices. + + Supported on Linux only. + + If requested scope is not applicable to the target topology, the API + will fall back to reporting the memory affinity for the immediate non-I/O + ancestor of the device. + + Parameters + ---------- + scope: AffinityScope | str, optional + The scope of the affinity query. Must be one of the values of + :class:`AffinityScope`. Default is :attr:`AffinityScope.NODE`. + + Returns + ------- + list[int] + A list of indices of NUMA nodes or CPU sockets with the ideal memory + affinity for the device. + """ + + def get_cpu_affinity(self, scope: AffinityScope | str=...) -> list[int]: + """ + Retrieves a list of indices of NUMA nodes or CPU sockets with the ideal + CPU affinity for the device. + + For Kepler™ or newer fully supported devices. + + Supported on Linux only. + + If requested scope is not applicable to the target topology, the API + will fall back to reporting the memory affinity for the immediate non-I/O + ancestor of the device. + + Parameters + ---------- + scope: AffinityScope | str, optional + The scope of the affinity query. Must be one of the values of + :class:`AffinityScope`. Default is :attr:`AffinityScope.NODE`. + + Returns + ------- + list[int] + A list of indices of NUMA nodes or CPU sockets with the ideal memory + affinity for the device. + """ + + def set_cpu_affinity(self) -> None: + """ + Sets the ideal affinity for the calling thread and device. + + For Kepler™ or newer fully supported devices. + + Supported on Linux only. + """ + + def clear_cpu_affinity(self) -> None: + """ + Clear all affinity bindings for the calling thread. + + For Kepler™ or newer fully supported devices. + + Supported on Linux only. + """ + + def get_clock(self, clock_type: ClockType | str) -> ClockInfo: + """ + :obj:`~_device.ClockInfo` object to get information about and manage a specific clock on a device. + """ + + @property + def is_auto_boosted_clocks_enabled(self) -> tuple[bool, bool]: + """ + Retrieve the current state of auto boosted clocks on a device. + + For Kepler™ or newer fully supported devices. + + Auto Boosted clocks are enabled by default on some hardware, allowing + the GPU to run at higher clock rates to maximize performance as thermal + limits allow. + + On Pascal™ and newer hardware, Auto Boosted clocks are controlled + through application clocks. Use :meth:`set_application_clocks` and + :meth:`reset_application_clocks` to control Auto Boost behavior. + + Returns + ------- + bool + The current state of Auto Boosted clocks + bool + The default Auto Boosted clocks behavior + + """ + + @property + def current_clock_event_reasons(self) -> list[ClocksEventReasons]: + """ + Retrieves the current :obj:`~ClocksEventReasons`. + + For all fully supported products. + """ + + @property + def supported_clock_event_reasons(self) -> list[ClocksEventReasons]: + """ + Retrieves supported :obj:`~ClocksEventReasons` that can be returned by + :meth:`get_current_clock_event_reasons`. + + For all fully supported products. + + This method is not supported in virtual machines running virtual GPU (vGPU). + """ + + @property + def cooler(self) -> CoolerInfo: + """ + :obj:`~_device.CoolerInfo` object with cooler information for the device. + """ + + @property + def attributes(self) -> DeviceAttributes: + """ + :obj:`~_device.DeviceAttributes` object with various device attributes. + + For Ampere™ or newer fully supported devices. Only available on Linux + systems. + """ + + @property + def is_display_connected(self) -> bool: + """ + The display mode for this device. + + Indicates whether a physical display (e.g. monitor) is currently connected to + any of the device's connectors. + """ + + @property + def is_display_active(self) -> bool: + """ + The display active status for this device. + + Indicates whether a display is initialized on the device. For example, + whether X Server is attached to this device and has allocated memory for + the screen. + + Display can be active even when no monitor is physically attached. + """ + + def register_events(self, events: EventType | str | list[EventType | str]) -> DeviceEvents: + """ + Starts recording events on this device. + + For Fermi™ or newer fully supported devices. For Linux only. + + ECC events are available only on ECC-enabled devices (see + :meth:`Device.get_total_ecc_errors`). Power capping events are + available only on Power Management enabled devices (see + :meth:`Device.get_power_management_mode`). + + This call starts recording of events on specific device. All events + that occurred before this call are not recorded. Wait for events using + the :meth:`DeviceEvents.wait` method on the result. + + Examples + -------- + >>> device = Device(index=0) + >>> events = device.register_events([ + ... EventType.XID_CRITICAL_ERROR, + ... ]) + >>> while event := events.wait(timeout_ms=10000): + ... print(f"Event {event.event_type} occurred on device {event.device.uuid}") + + Parameters + ---------- + events: EventType, str, or list of EventType or str + The event type or list of event types to register for this device. + + Returns + ------- + :obj:`~_device.DeviceEvents` + An object representing the registered events. Call + :meth:`~_device.DeviceEvents.wait` on this object to wait for events. + + Raises + ------ + :class:`cuda.core.system.NotSupportedError` + None of the requested event types are registered. + """ + + def get_supported_event_types(self) -> list[EventType]: + """ + Get the list of event types supported by this device. + + For Fermi™ or newer fully supported devices. For Linux only (returns an + empty list on Windows). + + Returns + ------- + list[EventType] + The list of supported event types. + """ + + def get_fan(self, fan: int=0) -> FanInfo: + """ + :obj:`~_device.FanInfo` object to get information and manage a specific fan on a device. + """ + + @property + def num_fans(self) -> int: + """ + The number of fans on the device. + """ + + def get_field_values(self, field_ids: list[int | tuple[int, int]]) -> FieldValues: + """ + Get multiple field values from the device. + + Each value specified can raise its own exception. That exception will + be raised when attempting to access the corresponding ``value`` from the + returned :obj:`~_device.FieldValues` container. + + To confirm that there are no exceptions in the entire container, call + :meth:`~_device.FieldValues.validate`. + + Parameters + ---------- + field_ids: list[int | tuple[int, int]] + List of field IDs to query. + + Each item may be either a single value from the :class:`FieldId` + enum, or a pair of (:class:`FieldId`, scope ID). + + Returns + ------- + :obj:`~_device.FieldValues` + Container of field values corresponding to the requested field IDs. + """ + + def clear_field_values(self, field_ids: list[int | tuple[int, int]]) -> None: + """ + Clear multiple field values from the device. + + Parameters + ---------- + field_ids: list[int | tuple[int, int]] + List of field IDs to clear. + + Each item may be either a single value from the :class:`FieldId` + enum, or a pair of (:class:`FieldId`, scope ID). + """ + + @property + def inforom(self) -> InforomInfo: + """ + :obj:`~_device.InforomInfo` object with InfoROM information. + + For all products with an InfoROM. + """ + + @property + def bar1_memory_info(self) -> BAR1MemoryInfo: + """ + :obj:`~_device.BAR1MemoryInfo` object with BAR1 memory information. + + BAR1 is used to map the FB (device memory) so that it can be directly + accessed by the CPU or by 3rd party devices (peer-to-peer on the PCIE + bus). + """ + + @property + def memory_info(self) -> MemoryInfo: + """ + :obj:`~_device.MemoryInfo` object with memory information. + """ + + def get_nvlink(self, link: int) -> NvlinkInfo: + """ + Get :obj:`~NvlinkInfo` about this device. + + For devices with NVLink support. + + .. version-changed:: 1.1.0 + Any link number not supported by this specific device will raise a `ValueError`. + """ + + def get_nvlink_count(self) -> int: + """ + Get the number of NVLink links on this device. + + For devices with NVLink support. + + .. version-added:: 1.1.0 + """ + + def get_nvlinks(self) -> Iterable[NvlinkInfo]: + """ + Get :obj:`~NvlinkInfo` about all NVLink links on this device. + + For devices with NVLink support. + + .. version-added:: 1.1.0 + """ + + @property + def pci_info(self) -> PciInfo: + """ + :obj:`~_device.PciInfo` object with the PCI attributes of this device. + + Non-physical devices, such as MIG devices, may not have PCI attributes. + In that case, this property will raise a `RuntimeError`. + """ + + @property + def performance_state(self) -> int | None: + """ + The current performance state of the device. + + For Fermi™ or newer fully supported devices. + + Returns + ------- + int | None + The current performance state of the device, as an integer between 0 and 15, + where 0 is maximum performance and higher numbers are lower performance. + Returns `None` if the performance state is unknown. + """ + + @property + def dynamic_pstates_info(self) -> GpuDynamicPstatesInfo: + """ + :obj:`~_device.GpuDynamicPstatesInfo` object with performance monitor samples from the associated subdevice. + """ + + @property + def supported_pstates(self) -> list[int]: + """ + Get all supported Performance States (P-States) for the device. + + The returned list contains a contiguous list of valid P-States supported by + the device. + + Return + ------ + list[int] + A list of supported performance state of the device, as an integer + between 0 and 15, where 0 is maximum performance and higher numbers + are lower performance. + """ + + @property + def compute_running_processes(self) -> list[ProcessInfo]: + """ + Get information about processes with a compute context on a device + + For Fermi™ or newer fully supported devices. + + This function returns information only about compute running processes + (e.g. CUDA application which have active context). Any graphics + applications (e.g. using OpenGL, DirectX) won't be listed by this + function. + + Keep in mind that information returned by this call is dynamic and the + number of elements might change in time. + + In MIG mode, if device handle is provided, the API returns aggregate + information, only if the caller has appropriate privileges. Per-instance + information can be queried by using specific MIG device handles. + Querying per-instance information using MIG device handles is not + supported if the device is in vGPU Host virtualization mode. + """ + + @property + def repair_status(self) -> RepairStatus: + """ + :obj:`~_device.RepairStatus` object with TPC/Channel repair status. + + For Ampere™ or newer fully supported devices. + """ + + @property + def temperature(self) -> Temperature: + """ + :obj:`~_device.Temperature` object with temperature information for the device. + """ + + def get_topology_nearest_gpus(self, level: GpuTopologyLevel | str) -> Iterable[Device]: + """ + Retrieve the GPUs that are nearest to this device at a specific interconnectivity level. + + Supported on Linux only. + + Parameters + ---------- + level: :class:`GpuTopologyLevel` + The topology level. + + Returns + ------- + Iterable of :class:`Device` + The nearest devices at the given topology level. + """ + + @property + def utilization(self) -> Utilization: + """ + Retrieves the current :obj:`~Utilization` rates for the device's major + subsystems. + + For Fermi™ or newer fully supported devices. + + Note: During driver initialization when ECC is enabled one can see high + GPU and Memory Utilization readings. This is caused by ECC Memory + Scrubbing mechanism that is performed during driver initialization. + + Note: On MIG-enabled GPUs, querying device utilization rates is not + currently supported. + + Returns + ------- + Utilization + An object containing the current utilization rates for the device. + """ +_CLOCK_ID_MAPPING = {ClockId.CURRENT: nvml.ClockId.CURRENT, ClockId.CUSTOMER_BOOST_MAX: nvml.ClockId.CUSTOMER_BOOST_MAX} +_CLOCKS_EVENT_REASONS_MAPPING = {nvml.ClocksEventReasons.EVENT_REASON_NONE: ClocksEventReasons.NONE, nvml.ClocksEventReasons.EVENT_REASON_GPU_IDLE: ClocksEventReasons.GPU_IDLE, nvml.ClocksEventReasons.EVENT_REASON_APPLICATIONS_CLOCKS_SETTING: ClocksEventReasons.APPLICATIONS_CLOCKS_SETTING, nvml.ClocksEventReasons.EVENT_REASON_SW_POWER_CAP: ClocksEventReasons.SW_POWER_CAP, nvml.ClocksEventReasons.THROTTLE_REASON_HW_SLOWDOWN: ClocksEventReasons.HW_SLOWDOWN, nvml.ClocksEventReasons.EVENT_REASON_SYNC_BOOST: ClocksEventReasons.SYNC_BOOST, nvml.ClocksEventReasons.EVENT_REASON_SW_THERMAL_SLOWDOWN: ClocksEventReasons.SW_THERMAL_SLOWDOWN, nvml.ClocksEventReasons.THROTTLE_REASON_HW_THERMAL_SLOWDOWN: ClocksEventReasons.HW_THERMAL_SLOWDOWN, nvml.ClocksEventReasons.THROTTLE_REASON_HW_POWER_BRAKE_SLOWDOWN: ClocksEventReasons.HW_POWER_BRAKE_SLOWDOWN, nvml.ClocksEventReasons.EVENT_REASON_DISPLAY_CLOCK_SETTING: ClocksEventReasons.DISPLAY_CLOCK_SETTING} +_CLOCK_TYPE_MAPPING = {ClockType.GRAPHICS: nvml.ClockType.CLOCK_GRAPHICS, ClockType.SM: nvml.ClockType.CLOCK_SM, ClockType.MEMORY: nvml.ClockType.CLOCK_MEM, ClockType.VIDEO: nvml.ClockType.CLOCK_VIDEO} +_COOLER_CONTROL_MAPPING = {nvml.CoolerControl.THERMAL_COOLER_SIGNAL_TOGGLE: CoolerControl.TOGGLE, nvml.CoolerControl.THERMAL_COOLER_SIGNAL_VARIABLE: CoolerControl.VARIABLE} +_COOLER_TARGET_MAPPING = {nvml.CoolerTarget.THERMAL_NONE: CoolerTarget.NONE, nvml.CoolerTarget.THERMAL_GPU: CoolerTarget.GPU, nvml.CoolerTarget.THERMAL_MEMORY: CoolerTarget.MEMORY, nvml.CoolerTarget.THERMAL_POWER_SUPPLY: CoolerTarget.POWER_SUPPLY} +_EVENT_TYPE_MAPPING = {nvml.EventType.NONE: EventType.NONE, nvml.EventType.SINGLE_BIT_ECC_ERROR: EventType.SINGLE_BIT_ECC_ERROR, nvml.EventType.DOUBLE_BIT_ECC_ERROR: EventType.DOUBLE_BIT_ECC_ERROR, nvml.EventType.PSTATE: EventType.PSTATE, nvml.EventType.XID_CRITICAL_ERROR: EventType.XID_CRITICAL_ERROR, nvml.EventType.CLOCK: EventType.CLOCK, nvml.EventType.POWER_SOURCE_CHANGE: EventType.POWER_SOURCE_CHANGE, nvml.EventType.MIG_CONFIG_CHANGE: EventType.MIG_CONFIG_CHANGE, nvml.EventType.SINGLE_BIT_ECC_ERROR_STORM: EventType.SINGLE_BIT_ECC_ERROR_STORM, nvml.EventType.DRAM_RETIREMENT_EVENT: EventType.DRAM_RETIREMENT_EVENT, nvml.EventType.DRAM_RETIREMENT_FAILURE: EventType.DRAM_RETIREMENT_FAILURE, nvml.EventType.NON_FATAL_POISON_ERROR: EventType.NON_FATAL_POISON_ERROR, nvml.EventType.FATAL_POISON_ERROR: EventType.FATAL_POISON_ERROR, nvml.EventType.GPU_UNAVAILABLE_ERROR: EventType.GPU_UNAVAILABLE_ERROR, nvml.EventType.GPU_RECOVERY_ACTION: EventType.GPU_RECOVERY_ACTION} +_EVENT_TYPE_INV_MAPPING = {v: k for k, v in _EVENT_TYPE_MAPPING.items()} +_FAN_CONTROL_POLICY_MAPPING = {nvml.FanControlPolicy.TEMPERATURE_CONTINUOUS_SW: FanControlPolicy.TEMPERATURE_CONTROLLED, nvml.FanControlPolicy.MANUAL: FanControlPolicy.MANUAL} +_INFOROM_OBJECT_MAPPING = {InforomObject.OEM: nvml.InforomObject.INFOROM_OEM, InforomObject.ECC: nvml.InforomObject.INFOROM_ECC, InforomObject.POWER: nvml.InforomObject.INFOROM_POWER, InforomObject.DEN: nvml.InforomObject.INFOROM_DEN} +_NVLINK_VERSION_MAPPING = {nvml.NvlinkVersion.VERSION_1_0: (1, 0), nvml.NvlinkVersion.VERSION_2_0: (2, 0), nvml.NvlinkVersion.VERSION_2_2: (2, 2), nvml.NvlinkVersion.VERSION_3_0: (3, 0), nvml.NvlinkVersion.VERSION_3_1: (3, 1), nvml.NvlinkVersion.VERSION_4_0: (4, 0), nvml.NvlinkVersion.VERSION_5_0: (5, 0)} +_NVLINK_VERSION_6_0 = getattr(nvml.NvlinkVersion, 'VERSION_6_0', None) +_TEMPERATURE_THRESHOLD_MAPPING = {TemperatureThresholds.SHUTDOWN: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_SHUTDOWN, TemperatureThresholds.SLOWDOWN: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_SLOWDOWN, TemperatureThresholds.MEM_MAX: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_MEM_MAX, TemperatureThresholds.GPU_MAX: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_GPU_MAX, TemperatureThresholds.ACOUSTIC_MIN: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_ACOUSTIC_MIN, TemperatureThresholds.ACOUSTIC_CURR: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_ACOUSTIC_CURR, TemperatureThresholds.ACOUSTIC_MAX: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_ACOUSTIC_MAX, TemperatureThresholds.GPS_CURR: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_GPS_CURR} +_THERMAL_CONTROLLER_MAPPING = {nvml.ThermalController.GPU_INTERNAL: ThermalController.GPU_INTERNAL, nvml.ThermalController.ADM1032: ThermalController.ADM1032, nvml.ThermalController.ADT7461: ThermalController.ADT7461, nvml.ThermalController.MAX6649: ThermalController.MAX6649, nvml.ThermalController.MAX1617: ThermalController.MAX1617, nvml.ThermalController.LM99: ThermalController.LM99, nvml.ThermalController.LM89: ThermalController.LM89, nvml.ThermalController.LM64: ThermalController.LM64, nvml.ThermalController.G781: ThermalController.G781, nvml.ThermalController.ADT7473: ThermalController.ADT7473, nvml.ThermalController.SBMAX6649: ThermalController.SBMAX6649, nvml.ThermalController.VBIOSEVT: ThermalController.VBIOSEVT, nvml.ThermalController.OS: ThermalController.OS, nvml.ThermalController.NVSYSCON_CANOAS: ThermalController.NVSYSCON_CANOAS, nvml.ThermalController.NVSYSCON_E551: ThermalController.NVSYSCON_E551, nvml.ThermalController.MAX6649R: ThermalController.MAX6649R, nvml.ThermalController.ADT7473S: ThermalController.ADT7473S, nvml.ThermalController.UNKNOWN: ThermalController.UNKNOWN} +_THERMAL_TARGET_MAPPING = {nvml.ThermalTarget.NONE: ThermalTarget.NONE, nvml.ThermalTarget.GPU: ThermalTarget.GPU, nvml.ThermalTarget.MEMORY: ThermalTarget.MEMORY, nvml.ThermalTarget.POWER_SUPPLY: ThermalTarget.POWER_SUPPLY, nvml.ThermalTarget.BOARD: ThermalTarget.BOARD, nvml.ThermalTarget.VCD_BOARD: ThermalTarget.VCD_BOARD, nvml.ThermalTarget.VCD_INLET: ThermalTarget.VCD_INLET, nvml.ThermalTarget.VCD_OUTLET: ThermalTarget.VCD_OUTLET, nvml.ThermalTarget.ALL: ThermalTarget.ALL} +_THERMAL_TARGET_INV_MAPPING = {v: k for k, v in _THERMAL_TARGET_MAPPING.items()} +_ADDRESSING_MODE_MAPPING = {nvml.DeviceAddressingModeType.DEVICE_ADDRESSING_MODE_HMM: AddressingMode.HMM, nvml.DeviceAddressingModeType.DEVICE_ADDRESSING_MODE_ATS: AddressingMode.ATS} +_AFFINITY_SCOPE_MAPPING = {AffinityScope.NODE: nvml.AffinityScope.NODE, AffinityScope.SOCKET: nvml.AffinityScope.SOCKET} +_BRAND_TYPE_MAPPING = {nvml.BrandType.BRAND_UNKNOWN: 'Unknown', nvml.BrandType.BRAND_QUADRO: 'Quadro', nvml.BrandType.BRAND_TESLA: 'Tesla', nvml.BrandType.BRAND_NVS: 'NVS', nvml.BrandType.BRAND_GRID: 'GRID', nvml.BrandType.BRAND_GEFORCE: 'GeForce', nvml.BrandType.BRAND_TITAN: 'Titan', nvml.BrandType.BRAND_NVIDIA_VAPPS: 'NVIDIA vApps', nvml.BrandType.BRAND_NVIDIA_VPC: 'NVIDIA VPC', nvml.BrandType.BRAND_NVIDIA_VCS: 'NVIDIA VCS', nvml.BrandType.BRAND_NVIDIA_VWS: 'NVIDIA VWS', nvml.BrandType.BRAND_NVIDIA_CLOUD_GAMING: 'NVIDIA Cloud Gaming', nvml.BrandType.BRAND_NVIDIA_VGAMING: 'NVIDIA vGaming', nvml.BrandType.BRAND_QUADRO_RTX: 'Quadro RTX', nvml.BrandType.BRAND_NVIDIA_RTX: 'NVIDIA RTX', nvml.BrandType.BRAND_NVIDIA: 'NVIDIA', nvml.BrandType.BRAND_GEFORCE_RTX: 'GeForce RTX', nvml.BrandType.BRAND_TITAN_RTX: 'Titan RTX'} +_GPU_P2P_CAPS_INDEX_MAPPING = {GpuP2PCapsIndex.READ: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_READ, GpuP2PCapsIndex.WRITE: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_WRITE, GpuP2PCapsIndex.NVLINK: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_NVLINK, GpuP2PCapsIndex.ATOMICS: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_ATOMICS, GpuP2PCapsIndex.PCI: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_PCI, GpuP2PCapsIndex.PROP: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_PROP, GpuP2PCapsIndex.UNKNOWN: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_UNKNOWN} +_GPU_P2P_STATUS_MAPPING = {nvml.GpuP2PStatus.P2P_STATUS_OK: GpuP2PStatus.OK, nvml.GpuP2PStatus.P2P_STATUS_CHIPSET_NOT_SUPPORTED: GpuP2PStatus.CHIPSET_NOT_SUPPORTED, nvml.GpuP2PStatus.P2P_STATUS_GPU_NOT_SUPPORTED: GpuP2PStatus.GPU_NOT_SUPPORTED, nvml.GpuP2PStatus.P2P_STATUS_IOH_TOPOLOGY_NOT_SUPPORTED: GpuP2PStatus.IOH_TOPOLOGY_NOT_SUPPORTED, nvml.GpuP2PStatus.P2P_STATUS_DISABLED_BY_REGKEY: GpuP2PStatus.DISABLED_BY_REGKEY, nvml.GpuP2PStatus.P2P_STATUS_NOT_SUPPORTED: GpuP2PStatus.NOT_SUPPORTED, nvml.GpuP2PStatus.P2P_STATUS_UNKNOWN: GpuP2PStatus.UNKNOWN} +_GPU_TOPOLOGY_LEVEL_MAPPING = {GpuTopologyLevel.INTERNAL: nvml.GpuTopologyLevel.TOPOLOGY_INTERNAL, GpuTopologyLevel.SINGLE: nvml.GpuTopologyLevel.TOPOLOGY_SINGLE, GpuTopologyLevel.MULTIPLE: nvml.GpuTopologyLevel.TOPOLOGY_MULTIPLE, GpuTopologyLevel.HOSTBRIDGE: nvml.GpuTopologyLevel.TOPOLOGY_HOSTBRIDGE, GpuTopologyLevel.NODE: nvml.GpuTopologyLevel.TOPOLOGY_NODE, GpuTopologyLevel.SYSTEM: nvml.GpuTopologyLevel.TOPOLOGY_SYSTEM} +_GPU_TOPOLOGY_LEVEL_INV_MAPPING = {v: k for k, v in _GPU_TOPOLOGY_LEVEL_MAPPING.items()} +__all__ = ['Device', 'get_p2p_status', 'get_topology_common_ancestor', 'NvlinkInfo'] + +def _unpack_bitmask(arr: object) -> list[int]: + """ + Unpack a list of integers containing bitmasks. + """ + +def get_topology_common_ancestor(device1: Device, device2: Device) -> GpuTopologyLevel: + """ + Retrieve the common ancestor for two devices. + + For Linux only. + + Parameters + ---------- + device1: :class:`Device` + The first device. + device2: :class:`Device` + The second device. + + Returns + ------- + :class:`GpuTopologyLevel` + The common ancestor level of the two devices. + """ + +def get_p2p_status(device1: Device, device2: Device, index: GpuP2PCapsIndex | str) -> GpuP2PStatus: + """ + Retrieve the P2P status between two devices. + + Parameters + ---------- + device1: :class:`Device` + The first device. + device2: :class:`Device` + The second device. + index: :class:`GpuP2PCapsIndex` | str + The P2P capability index being looked for between ``device1`` and ``device2``. + + Returns + ------- + :class:`GpuP2PStatus` + The P2P status between the two devices. + """ \ No newline at end of file diff --git a/cuda_core/cuda/core/system/_device.pyx b/cuda_core/cuda/core/system/_device.pyx index f661c4e685b..73f51cad8e3 100644 --- a/cuda_core/cuda/core/system/_device.pyx +++ b/cuda_core/cuda/core/system/_device.pyx @@ -6,21 +6,51 @@ from libc.stdint cimport intptr_t, uint64_t from libc.math cimport ceil from multiprocessing import cpu_count -from typing import Iterable +from typing import Iterable, TYPE_CHECKING +import warnings from cuda.bindings import nvml from ._nvml_context cimport initialize - - -AddressingMode = nvml.DeviceAddressingModeType -AffinityScope = nvml.AffinityScope -BrandType = nvml.BrandType -DeviceArch = nvml.DeviceArch -GpuP2PCapsIndex = nvml.GpuP2PCapsIndex -GpuP2PStatus = nvml.GpuP2PStatus -GpuTopologyLevel = nvml.GpuTopologyLevel -Pstates = nvml.Pstates +from cuda.core.system.typing import ( + AddressingMode, + AffinityScope, + DeviceArch, + ClockId, + ClocksEventReasons, + ClockType, + CoolerControl, + CoolerTarget, + DeviceArch, + EventType, + FanControlPolicy, + FieldId, + GpuP2PCapsIndex, + GpuP2PStatus, + GpuTopologyLevel, + InforomObject, + TemperatureThresholds, + ThermalController, + ThermalTarget, +) + +if TYPE_CHECKING: + import cuda.core # no-cython-lint + + +cdef object _pstate_to_int(object pstate): + if pstate == nvml.Pstates.PSTATE_UNKNOWN: + return None + assert ( + int(pstate) >= 0 and int(pstate) <= 15 + ), f"Invalid P-state: {pstate}. Must be between 0 and 15 inclusive, or PSTATE_UNKNOWN." + return int(pstate) - int(nvml.Pstates.PSTATE_0) + + +cdef int _pstate_to_enum(int pstate): + if pstate < 0 or pstate > 15: + raise ValueError(f"Invalid P-state: {pstate}. Must be between 0 and 15 inclusive.") + return int(pstate) + int(nvml.Pstates.PSTATE_0) include "_clock.pxi" @@ -32,10 +62,84 @@ include "_fan.pxi" include "_field_values.pxi" include "_inforom.pxi" include "_memory.pxi" +include "_mig.pxi" +include "_nvlink.pxi" include "_pci_info.pxi" include "_performance.pxi" +include "_process.pxi" include "_repair_status.pxi" include "_temperature.pxi" +include "_utilization.pxi" + + +_ADDRESSING_MODE_MAPPING = { + nvml.DeviceAddressingModeType.DEVICE_ADDRESSING_MODE_HMM: AddressingMode.HMM, + nvml.DeviceAddressingModeType.DEVICE_ADDRESSING_MODE_ATS: AddressingMode.ATS, +} + + +_AFFINITY_SCOPE_MAPPING = { + AffinityScope.NODE: nvml.AffinityScope.NODE, + AffinityScope.SOCKET: nvml.AffinityScope.SOCKET, +} + + +_BRAND_TYPE_MAPPING = { + nvml.BrandType.BRAND_UNKNOWN: "Unknown", + nvml.BrandType.BRAND_QUADRO: "Quadro", + nvml.BrandType.BRAND_TESLA: "Tesla", + nvml.BrandType.BRAND_NVS: "NVS", + nvml.BrandType.BRAND_GRID: "GRID", + nvml.BrandType.BRAND_GEFORCE: "GeForce", + nvml.BrandType.BRAND_TITAN: "Titan", + nvml.BrandType.BRAND_NVIDIA_VAPPS: "NVIDIA vApps", + nvml.BrandType.BRAND_NVIDIA_VPC: "NVIDIA VPC", + nvml.BrandType.BRAND_NVIDIA_VCS: "NVIDIA VCS", + nvml.BrandType.BRAND_NVIDIA_VWS: "NVIDIA VWS", + nvml.BrandType.BRAND_NVIDIA_CLOUD_GAMING: "NVIDIA Cloud Gaming", + nvml.BrandType.BRAND_NVIDIA_VGAMING: "NVIDIA vGaming", + nvml.BrandType.BRAND_QUADRO_RTX: "Quadro RTX", + nvml.BrandType.BRAND_NVIDIA_RTX: "NVIDIA RTX", + nvml.BrandType.BRAND_NVIDIA: "NVIDIA", + nvml.BrandType.BRAND_GEFORCE_RTX: "GeForce RTX", + nvml.BrandType.BRAND_TITAN_RTX: "Titan RTX", +} + + +_GPU_P2P_CAPS_INDEX_MAPPING = { + GpuP2PCapsIndex.READ: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_READ, + GpuP2PCapsIndex.WRITE: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_WRITE, + GpuP2PCapsIndex.NVLINK: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_NVLINK, + GpuP2PCapsIndex.ATOMICS: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_ATOMICS, + GpuP2PCapsIndex.PCI: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_PCI, + GpuP2PCapsIndex.PROP: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_PROP, + GpuP2PCapsIndex.UNKNOWN: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_UNKNOWN, +} + + +_GPU_P2P_STATUS_MAPPING = { + nvml.GpuP2PStatus.P2P_STATUS_OK: GpuP2PStatus.OK, + nvml.GpuP2PStatus.P2P_STATUS_CHIPSET_NOT_SUPPORTED: GpuP2PStatus.CHIPSET_NOT_SUPPORTED, + nvml.GpuP2PStatus.P2P_STATUS_GPU_NOT_SUPPORTED: GpuP2PStatus.GPU_NOT_SUPPORTED, + nvml.GpuP2PStatus.P2P_STATUS_IOH_TOPOLOGY_NOT_SUPPORTED: GpuP2PStatus.IOH_TOPOLOGY_NOT_SUPPORTED, + nvml.GpuP2PStatus.P2P_STATUS_DISABLED_BY_REGKEY: GpuP2PStatus.DISABLED_BY_REGKEY, + nvml.GpuP2PStatus.P2P_STATUS_NOT_SUPPORTED: GpuP2PStatus.NOT_SUPPORTED, + nvml.GpuP2PStatus.P2P_STATUS_UNKNOWN: GpuP2PStatus.UNKNOWN, +} + + +_GPU_TOPOLOGY_LEVEL_MAPPING = { + GpuTopologyLevel.INTERNAL: nvml.GpuTopologyLevel.TOPOLOGY_INTERNAL, + GpuTopologyLevel.SINGLE: nvml.GpuTopologyLevel.TOPOLOGY_SINGLE, + GpuTopologyLevel.MULTIPLE: nvml.GpuTopologyLevel.TOPOLOGY_MULTIPLE, + GpuTopologyLevel.HOSTBRIDGE: nvml.GpuTopologyLevel.TOPOLOGY_HOSTBRIDGE, + GpuTopologyLevel.NODE: nvml.GpuTopologyLevel.TOPOLOGY_NODE, + GpuTopologyLevel.SYSTEM: nvml.GpuTopologyLevel.TOPOLOGY_SYSTEM, +} + + +_GPU_TOPOLOGY_LEVEL_INV_MAPPING = {v: k for k, v in _GPU_TOPOLOGY_LEVEL_MAPPING.items()} + cdef class Device: @@ -80,7 +184,7 @@ cdef class Device: index: int | None = None, uuid: bytes | str | None = None, pci_bus_id: bytes | str | None = None, - ): + ) -> None: args = [index, uuid, pci_bus_id] cdef int arg_count = sum(arg is not None for arg in args) @@ -132,12 +236,23 @@ cdef class Device: board serial identifier. In the upstream NVML C++ API, the UUID includes a ``gpu-`` or ``mig-`` - prefix. That is not included in ``cuda.core.system``. + prefix. If you need a `uuid` without that prefix (for example, to + interact with CUDA), use the `uuid_without_prefix` property. + """ + return nvml.device_get_uuid(self._handle) + + @property + def uuid_without_prefix(self) -> str: """ - # NVML UUIDs have a `GPU-` or `MIG-` prefix. We remove that here. + Retrieves the globally unique immutable UUID associated with this + device, as a 5 part hexadecimal string, that augments the immutable, + board serial identifier. - # TODO: If the user cares about the prefix, we will expose that in the - # future using the MIG-related APIs in NVML. + In the upstream NVML C++ API, the UUID includes a ``gpu-`` or ``mig-`` + prefix. This property returns it without the prefix, to match the UUIDs + used in CUDA. If you need the prefix, use the `uuid` property. + """ + # NVML UUIDs have a `gpu-` or `mig-` prefix. We remove that here. return nvml.device_get_uuid(self._handle)[4:] @property @@ -159,13 +274,17 @@ cdef class Device: @property def arch(self) -> DeviceArch: """ - Device architecture. + :obj:`~DeviceArch` device architecture. For example, a Tesla V100 will report ``DeviceArchitecture.name == "VOLTA"``, and RTX A6000 will report ``DeviceArchitecture.name == "AMPERE"``. """ - return DeviceArch(nvml.device_get_architecture(self._handle)) + arch = nvml.device_get_architecture(self._handle) + try: + return DeviceArch(arch) + except ValueError: + return DeviceArch.UNKNOWN @property def name(self) -> str: @@ -175,11 +294,13 @@ cdef class Device: return nvml.device_get_name(self._handle) @property - def brand(self) -> BrandType: + def brand(self) -> str: """ - Brand of the device + The brand of the device. + + Returns "Unknown" if the brand is unknown. """ - return BrandType(nvml.device_get_brand(self._handle)) + return _BRAND_TYPE_MAPPING.get(nvml.device_get_brand(self._handle), "Unknown") @property def serial(self) -> str: @@ -215,14 +336,14 @@ cdef class Device: return nvml.device_get_minor_number(self._handle) @property - def is_c2c_mode_enabled(self) -> bool: + def is_c2c_enabled(self) -> bool: """ Whether the C2C (Chip-to-Chip) mode is enabled for this device. """ return bool(nvml.device_get_c2c_mode_info_v(self._handle).is_c2c_enabled) @property - def persistence_mode_enabled(self) -> bool: + def is_persistence_mode_enabled(self) -> bool: """ Whether persistence mode is enabled for this device. @@ -230,8 +351,8 @@ cdef class Device: """ return nvml.device_get_persistence_mode(self._handle) == nvml.EnableState.FEATURE_ENABLED - @persistence_mode_enabled.setter - def persistence_mode_enabled(self, enabled: bool) -> None: + @is_persistence_mode_enabled.setter + def is_persistence_mode_enabled(self, enabled: bool) -> None: nvml.device_set_persistence_mode( self._handle, nvml.EnableState.FEATURE_ENABLED if enabled else nvml.EnableState.FEATURE_DISABLED @@ -250,7 +371,7 @@ cdef class Device: """ Get the corresponding :class:`cuda.core.Device` (which is used for CUDA access) for this :class:`cuda.core.system.Device` (which is used for - NVIDIA machine library (NVML) access). + NVIDIA Management Library (NVML) access). The devices are mapped to one another by their UUID. @@ -258,6 +379,15 @@ cdef class Device: ------- cuda.core.Device The corresponding CUDA device. + + Raises + ------ + RuntimeError + No corresponding CUDA device is found for this NVML device. + + For example, on a MIG system, the physical GPU will not have an + available CUDA device, since it can not be used directly, even + though it can be enumerated from NVML. """ from cuda.core import Device as CudaDevice @@ -265,7 +395,7 @@ cdef class Device: # search all the devices for one with a matching UUID. for cuda_device in CudaDevice.get_all_devices(): - if cuda_device.uuid == self.uuid: + if cuda_device.uuid == self.uuid_without_prefix: return cuda_device raise RuntimeError("No corresponding CUDA device found for this NVML device.") @@ -280,6 +410,8 @@ cdef class Device: int The number of available devices. """ + initialize() + return nvml.device_get_count_v2() @classmethod @@ -289,9 +421,11 @@ cdef class Device: Returns ------- - Iterator of Device + Iterator over :obj:`~Device` An iterator over available devices. """ + initialize() + for device_id in range(nvml.device_get_count_v2()): yield cls(index=device_id) @@ -299,23 +433,23 @@ cdef class Device: # ADDRESSING MODE @property - def addressing_mode(self) -> AddressingMode: + def addressing_mode(self) -> AddressingMode | None: + """ + Get the :obj:`~AddressingMode` of the device. """ - Get the addressing mode of the device. + return _ADDRESSING_MODE_MAPPING.get(nvml.device_get_addressing_mode(self._handle).value, None) - Addressing modes can be one of: + ######################################################################### + # MIG (MULTI-INSTANCE GPU) DEVICES - - :attr:`AddressingMode.DEVICE_ADDRESSING_MODE_HMM`: System allocated - memory (``malloc``, ``mmap``) is addressable from the device (GPU), via - software-based mirroring of the CPU's page tables, on the GPU. - - :attr:`AddressingMode.DEVICE_ADDRESSING_MODE_ATS`: System allocated - memory (``malloc``, ``mmap``) is addressable from the device (GPU), via - Address Translation Services. This means that there is (effectively) a - single set of page tables, and the CPU and GPU both use them. - - :attr:`AddressingMode.DEVICE_ADDRESSING_MODE_NONE`: Neither HMM nor ATS - is active. + @property + def mig(self) -> MigInfo: """ - return AddressingMode(nvml.device_get_addressing_mode(self._handle).value) + Get :obj:`~MigInfo` accessor for MIG (Multi-Instance GPU) information. + + For Ampere™ or newer fully supported devices. + """ + return MigInfo(self) ######################################################################### # AFFINITY @@ -334,7 +468,7 @@ cdef class Device: Returns ------- - Iterator of Device + Iterator of :obj:`~Device` An iterator over available devices. """ cdef Device device @@ -343,7 +477,7 @@ cdef class Device: device._handle = handle yield device - def get_memory_affinity(self, scope: AffinityScope=AffinityScope.NODE) -> list[int]: + def get_memory_affinity(self, scope: AffinityScope | str=AffinityScope.NODE) -> list[int]: """ Retrieves a list of indices of NUMA nodes or CPU sockets with the ideal memory affinity for the device. @@ -355,16 +489,35 @@ cdef class Device: If requested scope is not applicable to the target topology, the API will fall back to reporting the memory affinity for the immediate non-I/O ancestor of the device. - """ + + Parameters + ---------- + scope: AffinityScope | str, optional + The scope of the affinity query. Must be one of the values of + :class:`AffinityScope`. Default is :attr:`AffinityScope.NODE`. + + Returns + ------- + list[int] + A list of indices of NUMA nodes or CPU sockets with the ideal memory + affinity for the device. + """ + try: + scope = _AFFINITY_SCOPE_MAPPING[scope] + except KeyError: + raise ValueError( + f"Invalid affinity scope: {scope}. " + f"Must be one of {list(AffinityScope.__members__.values())}" + ) from None return _unpack_bitmask( nvml.device_get_memory_affinity( self._handle, ceil(cpu_count() / 64), - scope + scope, ) ) - def get_cpu_affinity(self, scope: AffinityScope=AffinityScope.NODE) -> list[int]: + def get_cpu_affinity(self, scope: AffinityScope | str=AffinityScope.NODE) -> list[int]: """ Retrieves a list of indices of NUMA nodes or CPU sockets with the ideal CPU affinity for the device. @@ -376,7 +529,26 @@ cdef class Device: If requested scope is not applicable to the target topology, the API will fall back to reporting the memory affinity for the immediate non-I/O ancestor of the device. - """ + + Parameters + ---------- + scope: AffinityScope | str, optional + The scope of the affinity query. Must be one of the values of + :class:`AffinityScope`. Default is :attr:`AffinityScope.NODE`. + + Returns + ------- + list[int] + A list of indices of NUMA nodes or CPU sockets with the ideal memory + affinity for the device. + """ + try: + scope = _AFFINITY_SCOPE_MAPPING[scope] + except KeyError: + raise ValueError( + f"Invalid affinity scope: {scope}. " + f"Must be one of {list(AffinityScope.__members__.values())}" + ) from None return _unpack_bitmask( nvml.device_get_cpu_affinity_within_scope( self._handle, @@ -385,7 +557,7 @@ cdef class Device: ) ) - def set_cpu_affinity(self): + def set_cpu_affinity(self) -> None: """ Sets the ideal affinity for the calling thread and device. @@ -395,7 +567,7 @@ cdef class Device: """ nvml.device_set_cpu_affinity(self._handle) - def clear_cpu_affinity(self): + def clear_cpu_affinity(self) -> None: """ Clear all affinity bindings for the calling thread. @@ -409,13 +581,14 @@ cdef class Device: # CLOCK # See external class definitions in _clock.pxi - def clock(self, clock_type: ClockType) -> ClockInfo: + def get_clock(self, clock_type: ClockType | str) -> ClockInfo: """ - Get information about and manage a specific clock on a device. + :obj:`~_device.ClockInfo` object to get information about and manage a specific clock on a device. """ return ClockInfo(self._handle, clock_type) - def get_auto_boosted_clocks_enabled(self) -> tuple[bool, bool]: + @property + def is_auto_boosted_clocks_enabled(self) -> tuple[bool, bool]: """ Retrieve the current state of auto boosted clocks on a device. @@ -440,19 +613,28 @@ cdef class Device: current, default = nvml.device_get_auto_boosted_clocks_enabled(self._handle) return current == nvml.EnableState.FEATURE_ENABLED, default == nvml.EnableState.FEATURE_ENABLED - def get_current_clock_event_reasons(self) -> list[ClocksEventReasons]: + @property + def current_clock_event_reasons(self) -> list[ClocksEventReasons]: """ - Retrieves the current clocks event reasons. + Retrieves the current :obj:`~ClocksEventReasons`. For all fully supported products. """ cdef uint64_t[1] reasons reasons[0] = nvml.device_get_current_clocks_event_reasons(self._handle) - return [ClocksEventReasons(1 << reason) for reason in _unpack_bitmask(reasons)] + output_reasons = [] + for reason in _unpack_bitmask(reasons): + try: + output_reason = _CLOCKS_EVENT_REASONS_MAPPING[1 << reason] + except KeyError: + raise ValueError(f"Unknown clock event reason bit: {1 << reason}") + output_reasons.append(output_reason) + return output_reasons - def get_supported_clock_event_reasons(self) -> list[ClocksEventReasons]: + @property + def supported_clock_event_reasons(self) -> list[ClocksEventReasons]: """ - Retrieves supported clocks event reasons that can be returned by + Retrieves supported :obj:`~ClocksEventReasons` that can be returned by :meth:`get_current_clock_event_reasons`. For all fully supported products. @@ -461,7 +643,14 @@ cdef class Device: """ cdef uint64_t[1] reasons reasons[0] = nvml.device_get_supported_clocks_event_reasons(self._handle) - return [ClocksEventReasons(1 << reason) for reason in _unpack_bitmask(reasons)] + output_reasons = [] + for reason in _unpack_bitmask(reasons): + try: + output_reason = _CLOCKS_EVENT_REASONS_MAPPING[1 << reason] + except KeyError: + raise ValueError(f"Unknown clock event reason bit: {1 << reason}") + output_reasons.append(output_reason) + return output_reasons ########################################################################## # COOLER @@ -470,7 +659,7 @@ cdef class Device: @property def cooler(self) -> CoolerInfo: """ - Get information about cooler on a device. + :obj:`~_device.CoolerInfo` object with cooler information for the device. """ return CoolerInfo(nvml.device_get_cooler_info(self._handle)) @@ -481,7 +670,7 @@ cdef class Device: @property def attributes(self) -> DeviceAttributes: """ - Get various device attributes. + :obj:`~_device.DeviceAttributes` object with various device attributes. For Ampere™ or newer fully supported devices. Only available on Linux systems. @@ -492,17 +681,17 @@ cdef class Device: # DISPLAY @property - def display_mode(self) -> bool: + def is_display_connected(self) -> bool: """ The display mode for this device. Indicates whether a physical display (e.g. monitor) is currently connected to any of the device's connectors. """ - return True if nvml.device_get_display_mode(self._handle) == nvml.EnableState.FEATURE_ENABLED else False + return nvml.device_get_display_mode(self._handle) == nvml.EnableState.FEATURE_ENABLED @property - def display_active(self) -> bool: + def is_display_active(self) -> bool: """ The display active status for this device. @@ -512,13 +701,13 @@ cdef class Device: Display can be active even when no monitor is physically attached. """ - return True if nvml.device_get_display_active(self._handle) == nvml.EnableState.FEATURE_ENABLED else False + return nvml.device_get_display_active(self._handle) == nvml.EnableState.FEATURE_ENABLED ########################################################################## # EVENTS # See external class definitions in _event.pxi - def register_events(self, events: EventType | int | list[EventType | int]) -> DeviceEvents: + def register_events(self, events: EventType | str | list[EventType | str]) -> DeviceEvents: """ Starts recording events on this device. @@ -537,21 +726,21 @@ cdef class Device: -------- >>> device = Device(index=0) >>> events = device.register_events([ - ... EventType.EVENT_TYPE_XID_CRITICAL_ERROR, + ... EventType.XID_CRITICAL_ERROR, ... ]) >>> while event := events.wait(timeout_ms=10000): ... print(f"Event {event.event_type} occurred on device {event.device.uuid}") Parameters ---------- - events: EventType, int, or list of EventType or int + events: EventType, str, or list of EventType or str The event type or list of event types to register for this device. Returns ------- - :class:`DeviceEvents` + :obj:`~_device.DeviceEvents` An object representing the registered events. Call - :meth:`DeviceEvents.wait` on this object to wait for events. + :meth:`~_device.DeviceEvents.wait` on this object to wait for events. Raises ------ @@ -574,15 +763,22 @@ cdef class Device: """ cdef uint64_t[1] bitmask bitmask[0] = nvml.device_get_supported_event_types(self._handle) - return [EventType(1 << ev) for ev in _unpack_bitmask(bitmask)] + events = [] + for ev in _unpack_bitmask(bitmask): + try: + ev_enum = _EVENT_TYPE_MAPPING[1 << ev] + except KeyError: + raise ValueError(f"Unknown event type bit: {1 << ev}") + events.append(ev_enum) + return events ########################################################################## # FAN # See external class definitions in _fan.pxi - def fan(self, fan: int = 0) -> FanInfo: + def get_fan(self, fan: int = 0) -> FanInfo: """ - Get information and manage a specific fan on a device. + :obj:`~_device.FanInfo` object to get information and manage a specific fan on a device. """ if fan < 0 or fan >= self.num_fans: raise ValueError(f"Fan index {fan} is out of range [0, {self.num_fans})") @@ -605,14 +801,14 @@ cdef class Device: Each value specified can raise its own exception. That exception will be raised when attempting to access the corresponding ``value`` from the - returned :class:`FieldValues` container. + returned :obj:`~_device.FieldValues` container. To confirm that there are no exceptions in the entire container, call - :meth:`FieldValues.validate`. + :meth:`~_device.FieldValues.validate`. Parameters ---------- - field_ids: list of int or tuple of (int, int) + field_ids: list[int | tuple[int, int]] List of field IDs to query. Each item may be either a single value from the :class:`FieldId` @@ -620,9 +816,14 @@ cdef class Device: Returns ------- - :class:`FieldValues` + :obj:`~_device.FieldValues` Container of field values corresponding to the requested field IDs. """ + # Passing a field_ids array of length 0 raises an InvalidArgumentError, + # so avoid that. + if len(field_ids) == 0: + return FieldValues(nvml.FieldValue(0)) + return FieldValues(nvml.device_get_field_values(self._handle, field_ids)) def clear_field_values(self, field_ids: list[int | tuple[int, int]]) -> None: @@ -631,12 +832,17 @@ cdef class Device: Parameters ---------- - field_ids: list of int or tuple of (int, int) + field_ids: list[int | tuple[int, int]] List of field IDs to clear. Each item may be either a single value from the :class:`FieldId` enum, or a pair of (:class:`FieldId`, scope ID). """ + # Passing a field_ids array of length 0 raises an InvalidArgumentError, + # so avoid that. + if len(field_ids) == 0: + return + nvml.device_clear_field_values(self._handle, field_ids) ########################################################################## @@ -646,7 +852,7 @@ cdef class Device: @property def inforom(self) -> InforomInfo: """ - Accessor for InfoROM information. + :obj:`~_device.InforomInfo` object with InfoROM information. For all products with an InfoROM. """ @@ -659,7 +865,7 @@ cdef class Device: @property def bar1_memory_info(self) -> BAR1MemoryInfo: """ - Get information about BAR1 memory. + :obj:`~_device.BAR1MemoryInfo` object with BAR1 memory information. BAR1 is used to map the FB (device memory) so that it can be directly accessed by the CPU or by 3rd party devices (peer-to-peer on the PCIE @@ -670,10 +876,49 @@ cdef class Device: @property def memory_info(self) -> MemoryInfo: """ - Object with memory information. + :obj:`~_device.MemoryInfo` object with memory information. """ return MemoryInfo(nvml.device_get_memory_info_v2(self._handle)) + ########################################################################## + # NVLINK + # See external class definitions in _nvlink.pxi + + def get_nvlink(self, link: int) -> NvlinkInfo: + """ + Get :obj:`~NvlinkInfo` about this device. + + For devices with NVLink support. + + .. version-changed:: 1.1.0 + Any link number not supported by this specific device will raise a `ValueError`. + """ + link_count = self.get_nvlink_count() + if link < 0 or link >= link_count: + raise ValueError(f"Link index {link} is out of range [0, {link_count})") + return NvlinkInfo(self, link) + + def get_nvlink_count(self) -> int: + """ + Get the number of NVLink links on this device. + + For devices with NVLink support. + + .. version-added:: 1.1.0 + """ + return self.get_field_values([FieldId.DEV_NVLINK_LINK_COUNT])[0].value + + def get_nvlinks(self) -> Iterable[NvlinkInfo]: + """ + Get :obj:`~NvlinkInfo` about all NVLink links on this device. + + For devices with NVLink support. + + .. version-added:: 1.1.0 + """ + for link in range(self.get_nvlink_count()): + yield self.get_nvlink(link) + ########################################################################## # PCI INFO # See external class definitions in _pci_info.pxi @@ -681,40 +926,99 @@ cdef class Device: @property def pci_info(self) -> PciInfo: """ - The PCI attributes of this device. + :obj:`~_device.PciInfo` object with the PCI attributes of this device. + + Non-physical devices, such as MIG devices, may not have PCI attributes. + In that case, this property will raise a `RuntimeError`. """ - return PciInfo(nvml.device_get_pci_info_ext(self._handle), self._handle) + try: + pci_info = nvml.device_get_pci_info_ext(self._handle) + except nvml.InvalidArgumentError: + raise RuntimeError("This device does not have PCI attributes") from None + else: + return PciInfo(pci_info, self._handle) ########################################################################## # PERFORMANCE # See external class definitions in _performance.pxi @property - def performance_state(self) -> Pstates: + def performance_state(self) -> int | None: """ The current performance state of the device. For Fermi™ or newer fully supported devices. - See :class:`Pstates` for possible performance states. + Returns + ------- + int | None + The current performance state of the device, as an integer between 0 and 15, + where 0 is maximum performance and higher numbers are lower performance. + Returns `None` if the performance state is unknown. """ - return Pstates(nvml.device_get_performance_state(self._handle)) + return _pstate_to_int(nvml.device_get_performance_state(self._handle)) @property def dynamic_pstates_info(self) -> GpuDynamicPstatesInfo: """ - Retrieve performance monitor samples from the associated subdevice. + :obj:`~_device.GpuDynamicPstatesInfo` object with performance monitor samples from the associated subdevice. """ return GpuDynamicPstatesInfo(nvml.device_get_dynamic_pstates_info(self._handle)) - def get_supported_pstates(self) -> list[Pstates]: + @property + def supported_pstates(self) -> list[int]: """ Get all supported Performance States (P-States) for the device. The returned list contains a contiguous list of valid P-States supported by the device. + + Return + ------ + list[int] + A list of supported performance state of the device, as an integer + between 0 and 15, where 0 is maximum performance and higher numbers + are lower performance. + """ + # From nvml.h: + # The returned array would contain a contiguous list of valid P-States + # supported by the device. If the number of supported P-States is fewer + # than the size of the array supplied missing elements would contain \a + # NVML_PSTATE_UNKNOWN. + + pstates = [] + for pstate in nvml.device_get_supported_performance_states(self._handle): + pstate_value = _pstate_to_int(pstate) + if pstate_value is not None: + pstates.append(pstate_value) + return pstates + + ########################################################################## + # PROCESS + # See external class definitions in _process.pxi + + @property + def compute_running_processes(self) -> list[ProcessInfo]: + """ + Get information about processes with a compute context on a device + + For Fermi™ or newer fully supported devices. + + This function returns information only about compute running processes + (e.g. CUDA application which have active context). Any graphics + applications (e.g. using OpenGL, DirectX) won't be listed by this + function. + + Keep in mind that information returned by this call is dynamic and the + number of elements might change in time. + + In MIG mode, if device handle is provided, the API returns aggregate + information, only if the caller has appropriate privileges. Per-instance + information can be queried by using specific MIG device handles. + Querying per-instance information using MIG device handles is not + supported if the device is in vGPU Host virtualization mode. """ - return [Pstates(x) for x in nvml.device_get_supported_performance_states(self._handle)] + return [ProcessInfo(self, proc) for proc in nvml.device_get_compute_running_processes_v3(self._handle)] ########################################################################## # REPAIR STATUS @@ -723,7 +1027,7 @@ cdef class Device: @property def repair_status(self) -> RepairStatus: """ - Get the repair status for TPC/Channel repair. + :obj:`~_device.RepairStatus` object with TPC/Channel repair status. For Ampere™ or newer fully supported devices. """ @@ -736,14 +1040,14 @@ cdef class Device: @property def temperature(self) -> Temperature: """ - Get information about temperatures on a device. + :obj:`~_device.Temperature` object with temperature information for the device. """ return Temperature(self._handle) ####################################################################### # TOPOLOGY - def get_topology_nearest_gpus(self, level: GpuTopologyLevel) -> Iterable[Device]: + def get_topology_nearest_gpus(self, level: GpuTopologyLevel | str) -> Iterable[Device]: """ Retrieve the GPUs that are nearest to this device at a specific interconnectivity level. @@ -760,11 +1064,43 @@ cdef class Device: The nearest devices at the given topology level. """ cdef Device device + try: + level = _GPU_TOPOLOGY_LEVEL_MAPPING[level] + except KeyError: + raise ValueError( + f"Invalid topology level: {level}. " + f"Must be one of {list(GpuTopologyLevel.__members__.values())}" + ) from None for handle in nvml.device_get_topology_nearest_gpus(self._handle, level): device = Device.__new__(Device) device._handle = handle yield device + ####################################################################### + # UTILIZATION + + @property + def utilization(self) -> Utilization: + """ + Retrieves the current :obj:`~Utilization` rates for the device's major + subsystems. + + For Fermi™ or newer fully supported devices. + + Note: During driver initialization when ECC is enabled one can see high + GPU and Memory Utilization readings. This is caused by ECC Memory + Scrubbing mechanism that is performed during driver initialization. + + Note: On MIG-enabled GPUs, querying device utilization rates is not + currently supported. + + Returns + ------- + Utilization + An object containing the current utilization rates for the device. + """ + return Utilization(nvml.device_get_utilization_rates(self._handle)) + def get_topology_common_ancestor(device1: Device, device2: Device) -> GpuTopologyLevel: """ @@ -784,15 +1120,15 @@ def get_topology_common_ancestor(device1: Device, device2: Device) -> GpuTopolog :class:`GpuTopologyLevel` The common ancestor level of the two devices. """ - return GpuTopologyLevel( + return _GPU_TOPOLOGY_LEVEL_INV_MAPPING[ nvml.device_get_topology_common_ancestor( device1._handle, device2._handle, ) - ) + ] -def get_p2p_status(device1: Device, device2: Device, index: GpuP2PCapsIndex) -> GpuP2PStatus: +def get_p2p_status(device1: Device, device2: Device, index: GpuP2PCapsIndex | str) -> GpuP2PStatus: """ Retrieve the P2P status between two devices. @@ -802,7 +1138,7 @@ def get_p2p_status(device1: Device, device2: Device, index: GpuP2PCapsIndex) -> The first device. device2: :class:`Device` The second device. - index: :class:`GpuP2PCapsIndex` + index: :class:`GpuP2PCapsIndex` | str The P2P capability index being looked for between ``device1`` and ``device2``. Returns @@ -810,58 +1146,26 @@ def get_p2p_status(device1: Device, device2: Device, index: GpuP2PCapsIndex) -> :class:`GpuP2PStatus` The P2P status between the two devices. """ - return GpuP2PStatus( + try: + index_enum = _GPU_P2P_CAPS_INDEX_MAPPING[index] + except KeyError: + raise ValueError( + f"Invalid P2P caps index: {index}. " + f"Must be one of {list(GpuP2PCapsIndex.__members__.values())}" + ) from None + return _GPU_P2P_STATUS_MAPPING.get( nvml.device_get_p2p_status( device1._handle, device2._handle, - index, - ) + index_enum, + ), + GpuP2PStatus.UNKNOWN ) __all__ = [ - "AddressingMode", - "AffinityScope", - "BAR1MemoryInfo", - "BrandType", - "ClockId", - "ClockInfo", - "ClockOffsets", - "ClocksEventReasons", - "ClockType", - "CoolerControl", - "CoolerInfo", - "CoolerTarget", "Device", - "DeviceArch", - "DeviceAttributes", - "DeviceEvents", - "EventData", - "EventType", - "FanControlPolicy", - "FanInfo", - "FieldId", - "FieldValue", - "FieldValues", "get_p2p_status", "get_topology_common_ancestor", - "GpuDynamicPstatesInfo", - "GpuDynamicPstatesUtilization", - "GpuP2PCapsIndex", - "GpuP2PStatus", - "GpuTopologyLevel", - "InforomInfo", - "InforomObject", - "MemoryInfo", - "PcieUtilCounter", - "PciInfo", - "Pstates", - "RepairStatus", - "Temperature", - "TemperatureSensors", - "TemperatureThresholds", - "ThermalController", - "ThermalSensor", - "ThermalSettings", - "ThermalTarget", + "NvlinkInfo", ] diff --git a/cuda_core/cuda/core/system/_device_utils.pxi b/cuda_core/cuda/core/system/_device_utils.pxi index a9eccc73cc6..f7cf91a37c5 100644 --- a/cuda_core/cuda/core/system/_device_utils.pxi +++ b/cuda_core/cuda/core/system/_device_utils.pxi @@ -1,11 +1,11 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 from libc.stdint cimport uint64_t -cpdef inline list[int] _unpack_bitmask(uint64_t[:] arr): +def _unpack_bitmask(arr: object) -> list[int]: """ Unpack a list of integers containing bitmasks. """ diff --git a/cuda_core/cuda/core/system/_event.pxi b/cuda_core/cuda/core/system/_event.pxi index b3bf4f0ec12..f81e5934aa7 100644 --- a/cuda_core/cuda/core/system/_event.pxi +++ b/cuda_core/cuda/core/system/_event.pxi @@ -3,7 +3,26 @@ # SPDX-License-Identifier: Apache-2.0 -EventType = nvml.EventType +_EVENT_TYPE_MAPPING = { + nvml.EventType.NONE: EventType.NONE, + nvml.EventType.SINGLE_BIT_ECC_ERROR: EventType.SINGLE_BIT_ECC_ERROR, + nvml.EventType.DOUBLE_BIT_ECC_ERROR: EventType.DOUBLE_BIT_ECC_ERROR, + nvml.EventType.PSTATE: EventType.PSTATE, + nvml.EventType.XID_CRITICAL_ERROR: EventType.XID_CRITICAL_ERROR, + nvml.EventType.CLOCK: EventType.CLOCK, + nvml.EventType.POWER_SOURCE_CHANGE: EventType.POWER_SOURCE_CHANGE, + nvml.EventType.MIG_CONFIG_CHANGE: EventType.MIG_CONFIG_CHANGE, + nvml.EventType.SINGLE_BIT_ECC_ERROR_STORM: EventType.SINGLE_BIT_ECC_ERROR_STORM, + nvml.EventType.DRAM_RETIREMENT_EVENT: EventType.DRAM_RETIREMENT_EVENT, + nvml.EventType.DRAM_RETIREMENT_FAILURE: EventType.DRAM_RETIREMENT_FAILURE, + nvml.EventType.NON_FATAL_POISON_ERROR: EventType.NON_FATAL_POISON_ERROR, + nvml.EventType.FATAL_POISON_ERROR: EventType.FATAL_POISON_ERROR, + nvml.EventType.GPU_UNAVAILABLE_ERROR: EventType.GPU_UNAVAILABLE_ERROR, + nvml.EventType.GPU_RECOVERY_ACTION: EventType.GPU_RECOVERY_ACTION, +} + + +_EVENT_TYPE_INV_MAPPING = {v: k for k, v in _EVENT_TYPE_MAPPING.items()} cdef class EventData: @@ -18,7 +37,7 @@ cdef class EventData: """ The device on which the event occurred. """ - device = Device.__new__() + device = Device.__new__(Device) device._handle = self._event_data.device return device @@ -27,17 +46,17 @@ cdef class EventData: """ The type of event that was triggered. """ - return EventType(self._event_data.event_type) + return _EVENT_TYPE_MAPPING[self._event_data.event_type] @property def event_data(self) -> int: """ Returns Xid error for the device in the event of - :member:`EventType.EVENT_TYPE_XID_CRITICAL_ERROR`. + :attr:`~cuda.core.system.EventType.XID_CRITICAL_ERROR`. Raises :class:`ValueError` for other event types. """ - if self.event_type != EventType.EVENT_TYPE_XID_CRITICAL_ERROR: + if self._event_data.event_type != nvml.EventType.XID_CRITICAL_ERROR: raise ValueError("event_data is only available for Xid critical error events.") return self._event_data.event_data @@ -46,11 +65,11 @@ cdef class EventData: """ The GPU instance ID for MIG devices. - Only valid for events of type :attr:`EventType.EVENT_TYPE_XID_CRITICAL_ERROR`. + Only valid for events of type :attr:`EventType.XID_CRITICAL_ERROR`. Raises :class:`ValueError` for other event types. """ - if self.event_type != EventType.EVENT_TYPE_XID_CRITICAL_ERROR: + if self._event_data.event_type != nvml.EventType.XID_CRITICAL_ERROR: raise ValueError("gpu_instance_id is only available for Xid critical error events.") return self._event_data.gpu_instance_id @@ -59,11 +78,11 @@ cdef class EventData: """ The Compute instance ID for MIG devices. - Only valid for events of type :attr:`EventType.EVENT_TYPE_XID_CRITICAL_ERROR`. + Only valid for events of type :attr:`EventType.XID_CRITICAL_ERROR`. Raises :class:`ValueError` for other event types. """ - if self.event_type != EventType.EVENT_TYPE_XID_CRITICAL_ERROR: + if self._event_data.event_type != nvml.EventType.XID_CRITICAL_ERROR: raise ValueError("compute_instance_id is only available for Xid critical error events.") return self._event_data.compute_instance_id @@ -75,16 +94,26 @@ cdef class DeviceEvents: cdef intptr_t _event_set cdef intptr_t _device_handle - def __init__(self, device_handle: intptr_t, events: EventType | int | list[EventType | int]): + def __init__(self, device_handle: intptr_t, events: EventType | str | list[EventType | str]): + self._event_set = 0 + cdef unsigned long long event_bitmask - if isinstance(events, (int, EventType)): - event_bitmask = int(events) - elif isinstance(events, list): + if isinstance(events, (str, EventType)): + events = [events] + + if isinstance(events, list): event_bitmask = 0 for ev in events: - event_bitmask |= int(ev) + try: + ev_enum = _EVENT_TYPE_INV_MAPPING[ev] + except KeyError: + raise ValueError( + f"Invalid event type: {ev}. " + f"Must be one of {list(EventType.__members__.values())}" + ) from None + event_bitmask |= int(ev_enum) else: - raise TypeError("events must be an EventType, int, or list of EventType or int") + raise TypeError("events must be an EventType, str, or list of EventType or str") self._device_handle = device_handle self._event_set = nvml.event_set_create() @@ -92,8 +121,9 @@ cdef class DeviceEvents: # this class's __dealloc__ method. nvml.device_register_events(self._device_handle, event_bitmask, self._event_set) - def __dealloc__(self): - nvml.event_set_free(self._event_set) + def __dealloc__(self) -> None: + if self._event_set != 0: + nvml.event_set_free(self._event_set) def wait(self, timeout_ms: int = 0) -> EventData: """ diff --git a/cuda_core/cuda/core/system/_fan.pxi b/cuda_core/cuda/core/system/_fan.pxi index 8818c4d6809..06fa4c1919b 100644 --- a/cuda_core/cuda/core/system/_fan.pxi +++ b/cuda_core/cuda/core/system/_fan.pxi @@ -3,7 +3,10 @@ # SPDX-License-Identifier: Apache-2.0 -FanControlPolicy = nvml.FanControlPolicy +_FAN_CONTROL_POLICY_MAPPING = { + nvml.FanControlPolicy.TEMPERATURE_CONTINUOUS_SW: FanControlPolicy.TEMPERATURE_CONTROLLED, + nvml.FanControlPolicy.MANUAL: FanControlPolicy.MANUAL, +} cdef class FanInfo: @@ -35,7 +38,7 @@ cdef class FanInfo: return nvml.device_get_fan_speed_v2(self._handle, self._fan) @speed.setter - def speed(self, speed: int): + def speed(self, speed: int) -> None: nvml.device_set_fan_speed_v2(self._handle, self._fan, speed) @property @@ -62,10 +65,9 @@ cdef class FanInfo: For all discrete products with dedicated fans. Normally, the driver dynamically adjusts the fan based on - the needs of the GPU. But when user set fan speed using :property:`speed` - the driver will attempt to make the fan achieve the setting in - :property:`speed`. The actual current speed of the fan - is reported in :property:`speed`. + the needs of the GPU. But when users set fan speed using ``speed``, + the driver will attempt to make the fan achieve that setting. + The actual current speed of the fan is reported in ``speed``. The fan speed is expressed as a percentage of the product's maximum noise tolerance fan speed. This value may exceed 100% in certain cases. @@ -95,9 +97,9 @@ cdef class FanInfo: For all CUDA-capable discrete products with fans. """ - return FanControlPolicy(nvml.device_get_fan_control_policy_v2(self._handle, self._fan)) + return _FAN_CONTROL_POLICY_MAPPING[nvml.device_get_fan_control_policy_v2(self._handle, self._fan)] - def set_default_fan_speed(self): + def set_default_speed(self) -> None: """ Set the speed of the fan control policy to default. diff --git a/cuda_core/cuda/core/system/_field_values.pxi b/cuda_core/cuda/core/system/_field_values.pxi index e8840160359..4a9e5cc748f 100644 --- a/cuda_core/cuda/core/system/_field_values.pxi +++ b/cuda_core/cuda/core/system/_field_values.pxi @@ -3,9 +3,6 @@ # SPDX-License-Identifier: Apache-2.0 -FieldId = nvml.FieldId - - cdef class FieldValue: """ Represents the data from a single field value. diff --git a/cuda_core/cuda/core/system/_inforom.pxi b/cuda_core/cuda/core/system/_inforom.pxi index 43fb076f7ac..f5ab70408d2 100644 --- a/cuda_core/cuda/core/system/_inforom.pxi +++ b/cuda_core/cuda/core/system/_inforom.pxi @@ -3,7 +3,12 @@ # SPDX-License-Identifier: Apache-2.0 -InforomObject = nvml.InforomObject +_INFOROM_OBJECT_MAPPING = { + InforomObject.OEM: nvml.InforomObject.INFOROM_OEM, + InforomObject.ECC: nvml.InforomObject.INFOROM_ECC, + InforomObject.POWER: nvml.InforomObject.INFOROM_POWER, + InforomObject.DEN: nvml.InforomObject.INFOROM_DEN, +} cdef class InforomInfo: @@ -12,7 +17,7 @@ cdef class InforomInfo: def __init__(self, device: Device): self._device = device - def get_version(self, inforom: InforomObject) -> str: + def get_version(self, inforom: InforomObject | str) -> str: """ Retrieves the InfoROM version for a given InfoROM object. @@ -31,7 +36,14 @@ cdef class InforomInfo: str The InfoROM version. """ - return nvml.device_get_inforom_version(self._device._handle, inforom) + try: + inforom_enum = _INFOROM_OBJECT_MAPPING[inforom] + except KeyError: + raise ValueError( + f"Invalid InfoROM object: {inforom}. " + f"Must be one of {list(InforomObject.__members__.values())}" + ) from None + return nvml.device_get_inforom_version(self._device._handle, inforom_enum) @property def image_version(self) -> str: diff --git a/cuda_core/cuda/core/system/_mig.pxi b/cuda_core/cuda/core/system/_mig.pxi new file mode 100644 index 00000000000..7a5d4e51058 --- /dev/null +++ b/cuda_core/cuda/core/system/_mig.pxi @@ -0,0 +1,170 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + + +from typing import Iterable + + +cdef class MigInfo: + cdef Device _device + + def __init__(self, device: Device): + self._device = device + + @property + def is_mig_device(self) -> bool: + """ + Whether this device is a MIG (Multi-Instance GPU) device. + + A MIG device handle is an NVML abstraction which maps to a MIG compute + instance. These overloaded references can be used (with some + restrictions) interchangeably with a GPU device handle to execute + queries at a per-compute instance granularity. + + For Ampere™ or newer fully supported devices. + """ + return bool(nvml.device_is_mig_device_handle(self._device._handle)) + + @property + def mode(self) -> bool: + """ + Get current MIG mode for the device. + + For Ampere™ or newer fully supported devices. + + Changing MIG modes may require device unbind or reset. The "pending" MIG + mode refers to the target mode following the next activation trigger. + + Returns + ------- + bool + `True` if current MIG mode is enabled. + """ + current, _ = nvml.device_get_mig_mode(self._device._handle) + return current == nvml.EnableState.FEATURE_ENABLED + + @mode.setter + def mode(self, mode: bool) -> None: + """ + Set the MIG mode for the device. + + For Ampere™ or newer fully supported devices. + + Changing MIG modes may require device unbind or reset. The "pending" MIG + mode refers to the target mode following the next activation trigger. + + Parameters + ---------- + mode: bool + `True` to enable MIG mode, `False` to disable MIG mode. + """ + nvml.device_set_mig_mode( + self._device._handle, + nvml.EnableState.FEATURE_ENABLED if mode else nvml.EnableState.FEATURE_DISABLED + ) + + @property + def pending_mode(self) -> bool: + """ + Get pending MIG mode for the device. + + For Ampere™ or newer fully supported devices. + + Changing MIG modes may require device unbind or reset. The "pending" MIG + mode refers to the target mode following the next activation trigger. + + If the device is not a MIG device, returns `False`. + + Returns + ------- + bool + `True` if pending MIG mode is enabled. + """ + _, pending = nvml.device_get_mig_mode(self._device._handle) + return pending == nvml.EnableState.FEATURE_ENABLED + + @property + def device_count(self) -> int: + """ + Get the maximum number of MIG devices that can exist under this device. + + Returns zero if MIG is not supported or enabled. + + For Ampere™ or newer fully supported devices. + + Returns + ------- + int + The number of MIG devices (compute instances) on this GPU. + """ + return nvml.device_get_max_mig_device_count(self._device._handle) + + @property + def parent(self) -> Device: + """ + For MIG devices, get the parent GPU device. + + For Ampere™ or newer fully supported devices. + + Returns + ------- + Device + The parent GPU device for this MIG device. + """ + parent_handle = nvml.device_get_device_handle_from_mig_device_handle(self._device._handle) + parent_device = Device.__new__(Device) + parent_device._handle = parent_handle + return parent_device + + def get_device_by_index(self, index: int) -> Device: + """ + Get MIG device for the given index under its parent device. + + If the compute instance is destroyed either explicitly or by destroying, + resetting or unbinding the parent GPU instance or the GPU device itself + the MIG device handle would remain invalid and must be requested again + using this API. Handles may be reused and their properties can change in + the process. + + For Ampere™ or newer fully supported devices. + + Parameters + ---------- + index: int + The index of the MIG device (compute instance) to retrieve. Must be + between 0 and the value returned by `device_count - 1`. + + Returns + ------- + Device + The MIG device corresponding to the given index. + """ + mig_device_handle = nvml.device_get_mig_device_handle_by_index(self._device._handle, index) + mig_device = Device.__new__(Device) + mig_device._handle = mig_device_handle + return mig_device + + def get_all_devices(self) -> Iterable[Device]: + """ + Get all MIG devices under its parent device. + + If the compute instance is destroyed either explicitly or by destroying, + resetting or unbinding the parent GPU instance or the GPU device itself + the MIG device handle would remain invalid and must be requested again + using this API. Handles may be reused and their properties can change in + the process. + + For Ampere™ or newer fully supported devices. + + Returns + ------- + list[Device] + A list of all MIG devices corresponding to this GPU. + """ + for i in range(self.device_count): + try: + yield self.get_device_by_index(i) + except nvml.NotFoundError: + # Not all MIG devices may be available + continue diff --git a/cuda_core/cuda/core/system/_nvlink.pxi b/cuda_core/cuda/core/system/_nvlink.pxi new file mode 100644 index 00000000000..49ac1b75ba1 --- /dev/null +++ b/cuda_core/cuda/core/system/_nvlink.pxi @@ -0,0 +1,96 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + + +_NVLINK_VERSION_MAPPING = { + nvml.NvlinkVersion.VERSION_1_0: (1, 0), + nvml.NvlinkVersion.VERSION_2_0: (2, 0), + nvml.NvlinkVersion.VERSION_2_2: (2, 2), + nvml.NvlinkVersion.VERSION_3_0: (3, 0), + nvml.NvlinkVersion.VERSION_3_1: (3, 1), + nvml.NvlinkVersion.VERSION_4_0: (4, 0), + nvml.NvlinkVersion.VERSION_5_0: (5, 0), +} + +_NVLINK_VERSION_6_0 = getattr(nvml.NvlinkVersion, "VERSION_6_0", None) +if _NVLINK_VERSION_6_0 is not None: + _NVLINK_VERSION_MAPPING[_NVLINK_VERSION_6_0] = (6, 0) + + +class _NvlinkInfoMeta(type): + @property + def max_links(cls): + """ + The statically-defined maximum number of Nvlinks available. Defined in + upstream NVML as ``NVML_NVLINK_MAX_LINKS``. + + To find the actual number of Nvlinks available on a device, use + :py:attr:`Device.get_nvlink_count`. + + .. version-deprecated:: 1.1.0 + This property is deprecated and will be removed in a future release. + Use :py:attr:`Device.get_nvlink_count` instead. + """ + warnings.warn( + "The `max_links` property is deprecated and will be removed in a future release. " + "Use `Device.get_nvlink_count` instead.", + DeprecationWarning, + ) + + # This will always return 18, even on CTK 13.3 where it should be 36. + return nvml.NVLINK_MAX_LINKS + + +cdef class _NvlinkInfo: + """ + Nvlink information for a device. + """ + cdef Device _device + cdef int _link + + def __init__(self, device: Device, link: int): + self._device = device + self._link = link + + @property + def version(self) -> tuple[int, int]: + """ + Retrieves the NvLink version for the device and link. + + For all products with NvLink support. + + Returns + ------- + tuple[int, int] + The Nvlink version as a tuple of (major, minor). + """ + version = nvml.device_get_nvlink_version(self._device._handle, self._link) + if version == nvml.NvlinkVersion.VERSION_INVALID: + raise RuntimeError("Invalid NvLink version returned for device") + try: + return _NVLINK_VERSION_MAPPING[version] + except KeyError: + raise RuntimeError(f"Unknown NvLink version {version} returned for device") from None + + @property + def state(self) -> bool: + """ + Retrieves the state of the device's Nvlink for the device and link specified. + + For Pascal™ or newer fully supported devices. + + For all products with Nvlink support. + + Returns + ------- + bool + `True` if the Nvlink is active. + """ + return ( + nvml.device_get_nvlink_state(self._device._handle, self._link) == nvml.EnableState.FEATURE_ENABLED + ) + + +class NvlinkInfo(_NvlinkInfo, metaclass=_NvlinkInfoMeta): + pass diff --git a/cuda_core/cuda/core/system/_nvml_context.pxd b/cuda_core/cuda/core/system/_nvml_context.pxd index 64dbe705f58..dc8875bc4bc 100644 --- a/cuda_core/cuda/core/system/_nvml_context.pxd +++ b/cuda_core/cuda/core/system/_nvml_context.pxd @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 @@ -28,12 +28,12 @@ cdef _NVMLState _NVML_STATE cdef int _NVML_OWNER_PID -cpdef _initialize() +cpdef void _initialize() except * cpdef inline initialize(): """ - Initializes Nvidia Management Library (NVML), ensuring it only happens once per process. + Initializes NVIDIA Management Library (NVML), ensuring it only happens once per process. """ if _NVML_STATE == _NVMLState.DISABLED_LIBRARY_NOT_FOUND or ( _NVML_STATE == _NVMLState.INITIALIZED and getpid() == _NVML_OWNER_PID @@ -55,4 +55,4 @@ cpdef inline bint is_initialized(): return _NVML_STATE == _NVMLState.INITIALIZED and getpid() == _NVML_OWNER_PID -cpdef validate() +cpdef void validate() except * diff --git a/cuda_core/cuda/core/system/_nvml_context.pyi b/cuda_core/cuda/core/system/_nvml_context.pyi new file mode 100644 index 00000000000..e52a803b346 --- /dev/null +++ b/cuda_core/cuda/core/system/_nvml_context.pyi @@ -0,0 +1,33 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/system/_nvml_context.pyx + +from __future__ import annotations + +import threading + +_NVMLState = int +_lock = threading.Lock() + +def _initialize() -> None: + """ + Initializes NVIDIA Management Library (NVML), ensuring it only happens once per process. + """ + +def validate() -> None: + """ + Validate NVML state. + + Validate that NVML is initialized, functional and that the system has at + least one GPU available. + + Raises + ------ + nvml.UninitializedError + If NVML hasn't been initialized. + nvml.LibraryNotFoundError + If the NVML library could not be found. + nvml.GpuNotFoundError + If no GPUs are available. + """ + +def _get_nvml_state() -> _NVMLState: + ... \ No newline at end of file diff --git a/cuda_core/cuda/core/system/_nvml_context.pyx b/cuda_core/cuda/core/system/_nvml_context.pyx index e32ff518351..66309049144 100644 --- a/cuda_core/cuda/core/system/_nvml_context.pyx +++ b/cuda_core/cuda/core/system/_nvml_context.pyx @@ -6,26 +6,26 @@ import threading from cuda.bindings import nvml -from . import exceptions +from cuda.core.system import exceptions -_NVML_STATE = _NVMLState.UNINITIALIZED +cdef _NVMLState _NVML_STATE = _NVMLState.UNINITIALIZED -_NVML_OWNER_PID = 0 +cdef int _NVML_OWNER_PID = 0 _lock = threading.Lock() # For testing -def _get_nvml_state(): +def _get_nvml_state() -> _NVMLState: return _NVML_STATE -cpdef _initialize(): +cpdef void _initialize() except *: """ - Initializes Nvidia Management Library (NVML), ensuring it only happens once per process. + Initializes NVIDIA Management Library (NVML), ensuring it only happens once per process. """ global _NVML_STATE, _NVML_OWNER_PID @@ -55,7 +55,7 @@ cpdef _initialize(): raise RuntimeError(f"Unhandled initialisation state ({_NVML_STATE=}, {_NVML_OWNER_PID=})") -cpdef validate(): +cpdef void validate() except *: """ Validate NVML state. diff --git a/cuda_core/cuda/core/system/_pci_info.pxi b/cuda_core/cuda/core/system/_pci_info.pxi index e5f1bb287e9..55922b767ad 100644 --- a/cuda_core/cuda/core/system/_pci_info.pxi +++ b/cuda_core/cuda/core/system/_pci_info.pxi @@ -3,9 +3,6 @@ # SPDX-License-Identifier: Apache-2.0 -PcieUtilCounter = nvml.PcieUtilCounter - - cdef class PciInfo: """ PCI information about a GPU device. @@ -81,7 +78,8 @@ cdef class PciInfo: """ return self._pci_info_ext.sub_class - def get_max_pcie_link_generation(self) -> int: + @property + def link_generation(self) -> int: """ Retrieve the maximum PCIe link generation possible with this device and system. @@ -93,7 +91,8 @@ cdef class PciInfo: """ return nvml.device_get_max_pcie_link_generation(self._handle) - def get_gpu_max_pcie_link_generation(self) -> int: + @property + def max_link_generation(self) -> int: """ Retrieve the maximum PCIe link generation supported by this GPU device. @@ -101,7 +100,8 @@ cdef class PciInfo: """ return nvml.device_get_gpu_max_pcie_link_generation(self._handle) - def get_max_pcie_link_width(self) -> int: + @property + def max_link_width(self) -> int: """ Retrieve the maximum PCIe link width possible with this device and system. @@ -113,7 +113,8 @@ cdef class PciInfo: """ return nvml.device_get_max_pcie_link_width(self._handle) - def get_current_pcie_link_generation(self) -> int: + @property + def current_link_generation(self) -> int: """ Retrieve the current PCIe link generation. @@ -121,7 +122,8 @@ cdef class PciInfo: """ return nvml.device_get_curr_pcie_link_generation(self._handle) - def get_current_pcie_link_width(self) -> int: + @property + def current_link_width(self) -> int: """ Retrieve the current PCIe link width. @@ -129,9 +131,10 @@ cdef class PciInfo: """ return nvml.device_get_curr_pcie_link_width(self._handle) - def get_pcie_throughput(self, counter: PcieUtilCounter) -> int: + @property + def rx_throughput(self) -> int: """ - Retrieve PCIe utilization information, in KB/s. + Retrieve PCIe reception throughput, in KB/s. This function is querying a byte counter over a 20ms interval, and thus is the PCIe throughput over that interval. @@ -141,9 +144,25 @@ cdef class PciInfo: This method is not supported in virtual machines running virtual GPU (vGPU). """ - return nvml.device_get_pcie_throughput(self._handle, counter) + return nvml.device_get_pcie_throughput(self._handle, nvml.PcieUtilCounter.PCIE_UTIL_RX_BYTES) + + @property + def tx_throughput(self) -> int: + """ + Retrieve PCIe transmission throughput, in KB/s. - def get_pcie_replay_counter(self) -> int: + This function is querying a byte counter over a 20ms interval, and thus + is the PCIe throughput over that interval. + + For Maxwell™ or newer fully supported devices. + + This method is not supported in virtual machines running virtual GPU + (vGPU). + """ + return nvml.device_get_pcie_throughput(self._handle, nvml.PcieUtilCounter.PCIE_UTIL_TX_BYTES) + + @property + def replay_counter(self) -> int: """ Retrieve the PCIe replay counter. diff --git a/cuda_core/cuda/core/system/_performance.pxi b/cuda_core/cuda/core/system/_performance.pxi index 6ba1d40f9c2..ae045ccd1ea 100644 --- a/cuda_core/cuda/core/system/_performance.pxi +++ b/cuda_core/cuda/core/system/_performance.pxi @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 @@ -62,7 +62,7 @@ cdef class GpuDynamicPstatesInfo: def __init__(self, gpu_dynamic_pstates_info: nvml.GpuDynamicPstatesInfo): self._gpu_dynamic_pstates_info = gpu_dynamic_pstates_info - def __len__(self): + def __len__(self) -> int: return nvml.MAX_GPU_UTILIZATIONS def __getitem__(self, idx: int) -> GpuDynamicPstatesUtilization: diff --git a/cuda_core/cuda/core/system/_process.pxi b/cuda_core/cuda/core/system/_process.pxi new file mode 100644 index 00000000000..019ebf5c323 --- /dev/null +++ b/cuda_core/cuda/core/system/_process.pxi @@ -0,0 +1,48 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + + +class ProcessInfo: + """ + Information about running compute processes on the GPU. + """ + def __init__(self, device: "Device", process_info: nvml.ProcessInfo): + self._device = device + self._process_info = process_info + + @property + def pid(self) -> int: + """ + The PID of the process. + """ + return self._process_info.pid + + @property + def used_gpu_memory(self) -> int: + """ + The amount of GPU memory (in bytes) used by the process. + """ + return self._process_info.used_gpu_memory + + @property + def gpu_instance_id(self) -> int: + """ + The GPU instance ID for MIG devices. + + Only valid for processes running on MIG devices. + """ + if not self._device.mig.is_mig_device: + raise nvml.NotSupportedError(nvml.Return.ERROR_NOT_SUPPORTED) + return self._process_info.gpu_instance_id + + @property + def compute_instance_id(self) -> int: + """ + The Compute instance ID for MIG devices. + + Only valid for processes running on MIG devices. + """ + if not self._device.mig.is_mig_device: + raise nvml.NotSupportedError(nvml.Return.ERROR_NOT_SUPPORTED) + return self._process_info.compute_instance_id diff --git a/cuda_core/cuda/core/system/_system.pyi b/cuda_core/cuda/core/system/_system.pyi new file mode 100644 index 00000000000..f25ce35be7f --- /dev/null +++ b/cuda_core/cuda/core/system/_system.pyi @@ -0,0 +1,75 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/system/_system.pyx + +from __future__ import annotations + +CUDA_BINDINGS_NVML_IS_COMPATIBLE: bool +__all__ = ['get_driver_branch', 'get_kernel_mode_driver_version', 'get_user_mode_driver_version', 'get_nvml_version', 'get_num_devices', 'get_process_name', 'CUDA_BINDINGS_NVML_IS_COMPATIBLE'] + +def get_user_mode_driver_version() -> tuple[int, ...]: + """ + Get the user-mode (UMD / CUDA) driver version. + + This is the most commonly needed version when checking CUDA driver + compatibility. It works with all ``cuda-bindings`` versions. + + Returns + ------- + version : tuple[int, ...] + A 2-tuple ``(MAJOR, MINOR)``, e.g. ``(13, 0)`` for CUDA 13.0. + """ + +def get_kernel_mode_driver_version() -> tuple[int, ...]: + """ + Get the kernel-mode (KMD / GPU) driver version, e.g. 580.65.06. + + Returns + ------- + version : tuple[int, ...] + Typically a 3-tuple ``(MAJOR, MINOR, PATCH)`` + (2-tuple on WSL), e.g. ``(580, 65, 6)``. + + Raises + ------ + RuntimeError + If the NVML library is not available. + """ + +def get_nvml_version() -> tuple[int, ...]: + """ + The version of the NVML library. + + Returns + ------- + version: tuple[int, ...] + Tuple of integers representing the NVML version components. + """ + +def get_driver_branch() -> str: + """ + Retrieves the driver branch of the NVIDIA driver installed on the system. + + Returns + ------- + branch: str + The driver branch string (e.g., ``"560"``, ``"open"``, etc.). + """ + +def get_num_devices() -> int: + """ + Return the number of devices in the system. + """ + +def get_process_name(pid: int) -> str: + """ + The name of process with given PID. + + Parameters + ---------- + pid: int + The PID of the process for which to get the name. + + Returns + ------- + name: str + The process name. + """ \ No newline at end of file diff --git a/cuda_core/cuda/core/system/_system.pyx b/cuda_core/cuda/core/system/_system.pyx index f306c036b8c..2a6c8ffc23d 100644 --- a/cuda_core/cuda/core/system/_system.pyx +++ b/cuda_core/cuda/core/system/_system.pyx @@ -10,12 +10,38 @@ CUDA_BINDINGS_NVML_IS_COMPATIBLE: bool + +# Please keep in sync with the equivalent implementation in +# cuda_python_test_helpers/cuda_python_test_helpers/__init__.py. +cdef bint _detect_wsl(): + try: + with open("/proc/sys/kernel/osrelease") as f: + data = f.read().lower() + except OSError: + return False + return "microsoft" in data or "wsl" in data + + +cdef bint _IS_WSL = _detect_wsl() + + +# The WSL locale guard lives in a separate module that is only compiled on +# Linux (build_hooks.py excludes it on Windows), because it relies on POSIX +# per-thread locale APIs that MSVC does not provide. On non-Linux platforms +# the import fails and we fall back to a no-op guard; _IS_WSL is then False +# so the guard is never entered anyway. +if _IS_WSL: + from cuda.core._utils._wsl_locale import c_locale_guard +else: + c_locale_guard = None + + try: from cuda.bindings._version import __version_tuple__ as _BINDINGS_VERSION except ImportError: CUDA_BINDINGS_NVML_IS_COMPATIBLE = False else: - CUDA_BINDINGS_NVML_IS_COMPATIBLE = _BINDINGS_VERSION >= (13, 1, 2) or (_BINDINGS_VERSION[0] == 12 and _BINDINGS_VERSION[1:3] >= (9, 6)) + CUDA_BINDINGS_NVML_IS_COMPATIBLE = _BINDINGS_VERSION >= (13, 2, 0) or (_BINDINGS_VERSION[0] == 12 and _BINDINGS_VERSION[1:3] >= (9, 6)) if CUDA_BINDINGS_NVML_IS_COMPATIBLE: @@ -23,71 +49,64 @@ if CUDA_BINDINGS_NVML_IS_COMPATIBLE: from cuda.bindings import nvml except ImportError: CUDA_BINDINGS_NVML_IS_COMPATIBLE = False - else: - # TODO: We need to be even more specific than version numbers for development. - # This can be removed once we have a release including everything we need. - for member in ["FieldId", "ClocksEventReasons"]: - if not hasattr(nvml, member): - CUDA_BINDINGS_NVML_IS_COMPATIBLE = False - break -if CUDA_BINDINGS_NVML_IS_COMPATIBLE: - from ._nvml_context import initialize + from cuda.core.system._nvml_context import initialize else: from cuda.core._utils.cuda_utils import driver, handle_return, runtime -def get_driver_version(kernel_mode: bool = False) -> tuple[int, int]: +def get_user_mode_driver_version() -> tuple[int, ...]: """ - Get the driver version. + Get the user-mode (UMD / CUDA) driver version. - Parameters - ---------- - kernel_mode: bool - When `True`, return the kernel-mode driver version, e.g. 580.65.06. - Otherwise, return the user-mode driver version, e.g. 13.0.1. + This is the most commonly needed version when checking CUDA driver + compatibility. It works with all ``cuda-bindings`` versions. Returns ------- - version: tuple[int, int] - Tuple in the format `(MAJOR, MINOR)`. + version : tuple[int, ...] + A 2-tuple ``(MAJOR, MINOR)``, e.g. ``(13, 0)`` for CUDA 13.0. """ - return get_driver_version_full(kernel_mode)[:2] + cdef int v + if CUDA_BINDINGS_NVML_IS_COMPATIBLE: + initialize() + v = nvml.system_get_cuda_driver_version() + else: + v = handle_return(driver.cuDriverGetVersion()) + return (v // 1000, (v // 10) % 100) -def get_driver_version_full(kernel_mode: bool = False) -> tuple[int, int, int]: +def get_kernel_mode_driver_version() -> tuple[int, ...]: """ - Get the full driver version. - - Parameters - ---------- - kernel_mode: bool - When `True`, return the kernel-mode driver version, e.g. 580.65.06. - Otherwise, return the user-mode driver version, e.g. 13.0.1. + Get the kernel-mode (KMD / GPU) driver version, e.g. 580.65.06. Returns ------- - version: tuple[int, int, int] - Tuple in the format `(MAJOR, MINOR, PATCH)`. + version : tuple[int, ...] + Typically a 3-tuple ``(MAJOR, MINOR, PATCH)`` + (2-tuple on WSL), e.g. ``(580, 65, 6)``. + + Raises + ------ + RuntimeError + If the NVML library is not available. """ - cdef int v - if kernel_mode: - if not CUDA_BINDINGS_NVML_IS_COMPATIBLE: - raise ValueError("Kernel-mode driver version requires NVML support") - initialize() - return tuple(int(v) for v in nvml.system_get_driver_version().split(".")) - else: - if CUDA_BINDINGS_NVML_IS_COMPATIBLE: - initialize() - v = nvml.system_get_cuda_driver_version() - else: - v = handle_return(driver.cuDriverGetVersion()) - return (v // 1000, (v // 10) % 100, v % 10) + if not CUDA_BINDINGS_NVML_IS_COMPATIBLE: + raise RuntimeError( + "get_kernel_mode_driver_version requires NVML support" + ) + initialize() + return tuple(int(x) for x in nvml.system_get_driver_version().split(".")) def get_nvml_version() -> tuple[int, ...]: """ The version of the NVML library. + + Returns + ------- + version: tuple[int, ...] + Tuple of integers representing the NVML version components. """ if not CUDA_BINDINGS_NVML_IS_COMPATIBLE: raise RuntimeError("NVML library is not available") @@ -97,6 +116,11 @@ def get_nvml_version() -> tuple[int, ...]: def get_driver_branch() -> str: """ Retrieves the driver branch of the NVIDIA driver installed on the system. + + Returns + ------- + branch: str + The driver branch string (e.g., ``"560"``, ``"open"``, etc.). """ if not CUDA_BINDINGS_NVML_IS_COMPATIBLE: raise RuntimeError("NVML library is not available") @@ -129,14 +153,43 @@ def get_process_name(pid: int) -> str: name: str The process name. """ + def _get_process_name(pid) -> str: + # NVML caches process names on a per-PID basis when queried via + # nvmlSystemGetProcessName, and the cache is populated when enumerating + # running processes on devices. To ensure the name is cached for the + # requested PID, we walk all devices and query their running processes. + for i in range(nvml.device_get_count_v2()): + try: + dev_h = nvml.device_get_handle_by_index_v2(i) + nvml.device_get_compute_running_processes_v3(dev_h) + except nvml.NvmlError: + continue + return nvml.system_get_process_name(pid) + initialize() - return nvml.system_get_process_name(pid) + if not _IS_WSL: + return _get_process_name(pid) + + # WSL workaround: nvmlSystemGetProcessName on WSL takes a wide-char + # conversion path when the calling thread's locale is non-"C". That path + # walks a UTF-16LE source buffer with a 4-byte stride (as if it were + # UTF-32LE) and emits 5-byte UTF-8 sequences that look like garbage + # preceding the trailing basename of /proc//exe. CPython's startup + # unconditionally calls setlocale(LC_ALL, ""), so essentially every + # cuda.core caller hits this. The cached entry for the PID is set the + # first time NVML resolves it (typically inside + # nvmlDeviceGetComputeRunningProcesses_v3), so to recover a correct value + # we re-prime the cache under the "C" locale before reading the name. + # c_locale_guard uses POSIX per-thread locale APIs (see _wsl_locale.pyx) + # so other threads' view of the locale is unaffected. + with c_locale_guard(): # no-cython-lint + return _get_process_name(pid) __all__ = [ "get_driver_branch", - "get_driver_version", - "get_driver_version_full", + "get_kernel_mode_driver_version", + "get_user_mode_driver_version", "get_nvml_version", "get_num_devices", "get_process_name", diff --git a/cuda_core/cuda/core/system/_system_events.pyi b/cuda_core/cuda/core/system/_system_events.pyi new file mode 100644 index 00000000000..5ae5b86bc57 --- /dev/null +++ b/cuda_core/cuda/core/system/_system_events.pyi @@ -0,0 +1,133 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/system/_system_events.pyx + +from __future__ import annotations + +from cuda.bindings import nvml +from cuda.core.system.typing import SystemEventType + +from . import _device + + +class SystemEvent: + """ + Data about a collection of system events. + """ + + def __init__(self, event_data: nvml.SystemEventData_v1): + ... + + @property + def event_type(self) -> SystemEventType: + """ + The :obj:`~SystemEventType` that was triggered. + """ + + @property + def gpu_id(self) -> int: + """ + The GPU ID in PCI ID format. + """ + + @property + def device(self) -> _device.Device: + """ + The :obj:`~_device.Device` associated with this event. + """ + +class SystemEvents: + """ + Data about a collection of system events. + """ + + def __init__(self, event_data: nvml.SystemEventData_v1): + ... + + def __len__(self) -> int: + ... + + def __getitem__(self, idx: int) -> SystemEvent: + """ + Get the :obj:`~_system_events.SystemEvent` at the specified index. + """ + +class RegisteredSystemEvents: + """ + Represents a set of events that can be waited on for a specific device. + """ + + def __init__(self, events: SystemEventType | str | list[SystemEventType | str]): + ... + + def __dealloc__(self) -> None: + ... + + def wait(self, timeout_ms: int=0, buffer_size: int=1) -> SystemEvents: + """ + Wait for events in the system event set. + + For Fermi™ or newer fully supported devices. + + If some events are ready to be delivered at the time of the call, + function returns immediately. If there are no events ready to be + delivered, function sleeps till event arrives but not longer than + specified timeout. If timeout passes, a + :class:`cuda.core.system.TimeoutError` is raised. This function in + certain conditions can return before specified timeout passes (e.g. when + interrupt arrives) + + Parameters + ---------- + timeout_ms: int + The timeout in milliseconds. A value of 0 means to wait indefinitely. + buffer_size: int + The maximum number of events to retrieve. Must be at least 1. + + Returns + ------- + :obj:`~_system_events.SystemEvents` + A set of events that were received. The number of events returned may + be less than the specified buffer size if fewer events were available. + + Raises + ------ + :class:`cuda.core.system.TimeoutError` + If the timeout expires before an event is received. + :class:`cuda.core.system.GpuIsLostError` + If the GPU has fallen off the bus or is otherwise inaccessible. + """ +_SYSTEM_EVENT_TYPE_MAPPING = {nvml.SystemEventType.GPU_DRIVER_UNBIND: SystemEventType.UNBIND, nvml.SystemEventType.GPU_DRIVER_BIND: SystemEventType.BIND} +_SYSTEM_EVENT_TYPE_INV_MAPPING = {v: k for k, v in _SYSTEM_EVENT_TYPE_MAPPING.items()} +__all__ = ['register_events'] + +def register_events(events: SystemEventType | str | list[SystemEventType | str]) -> RegisteredSystemEvents: + """ + Starts recording of events on test system. + + For Linux only. + + All events that occurred before this call are not recorded. Wait for events + using the :meth:`RegisteredSystemEvents.wait` method on the result. + + Examples + -------- + >>> from cuda.core import system + >>> events = system.register_events([SystemEventType.UNBIND]) + >>> while event := events.wait(timeout_ms=10000): + ... print(f"Event {event.event_type} occurred.") + + Parameters + ---------- + events: SystemEventType, str, or list of SystemEventType or str + The event type or list of event types to register for this device. + + Returns + ------- + :obj:`~_system_events.RegisteredSystemEvents` + An object representing the registered events. Call + :meth:`~_system_events.RegisteredSystemEvents.wait` on this object to wait for events. + + Raises + ------ + :class:`cuda.core.system.NotSupportedError` + None of the requested event types are registered. + """ \ No newline at end of file diff --git a/cuda_core/cuda/core/system/_system_events.pyx b/cuda_core/cuda/core/system/_system_events.pyx index d8a64b619b7..87a3dfcf1ef 100644 --- a/cuda_core/cuda/core/system/_system_events.pyx +++ b/cuda_core/cuda/core/system/_system_events.pyx @@ -10,9 +10,16 @@ from cuda.bindings import nvml from ._nvml_context cimport initialize from . import _device +from cuda.core.system.typing import SystemEventType -SystemEventType = nvml.SystemEventType +_SYSTEM_EVENT_TYPE_MAPPING = { + nvml.SystemEventType.GPU_DRIVER_UNBIND: SystemEventType.UNBIND, + nvml.SystemEventType.GPU_DRIVER_BIND: SystemEventType.BIND, +} + + +_SYSTEM_EVENT_TYPE_INV_MAPPING = {v: k for k, v in _SYSTEM_EVENT_TYPE_MAPPING.items()} cdef class SystemEvent: @@ -26,9 +33,9 @@ cdef class SystemEvent: @property def event_type(self) -> SystemEventType: """ - The type of event that was triggered. + The :obj:`~SystemEventType` that was triggered. """ - return SystemEventType(self._event_data.event_type) + return _SYSTEM_EVENT_TYPE_MAPPING[self._event_data.event_type] @property def gpu_id(self) -> int: @@ -40,7 +47,7 @@ cdef class SystemEvent: @property def device(self) -> _device.Device: """ - The device associated with this event. + The :obj:`~_device.Device` associated with this event. """ return _device.Device(pci_bus_id=self.gpu_id) @@ -52,10 +59,13 @@ cdef class SystemEvents: def __init__(self, event_data: nvml.SystemEventData_v1): self._event_data = event_data - def __len__(self): + def __len__(self) -> int: return len(self._event_data) def __getitem__(self, idx: int) -> SystemEvent: + """ + Get the :obj:`~_system_events.SystemEvent` at the specified index. + """ return SystemEvent(self._event_data[idx]) @@ -65,26 +75,36 @@ cdef class RegisteredSystemEvents: """ cdef intptr_t _event_set - def __init__(self, events: SystemEventType | int | list[SystemEventType | int]): + def __init__(self, events: SystemEventType | str | list[SystemEventType | str]): cdef unsigned long long event_bitmask - if isinstance(events, (int, SystemEventType)): - event_bitmask = int(events) - elif isinstance(events, list): + if isinstance(events, (str, SystemEventType)): + events = [events] + + if isinstance(events, list): event_bitmask = 0 for ev in events: - event_bitmask |= int(ev) + try: + ev_enum = _SYSTEM_EVENT_TYPE_INV_MAPPING[ev] + except KeyError: + raise ValueError( + f"Invalid event type: {ev}. " + f"Must be one of {list(SystemEventType.__members__.values())}" + ) from None + event_bitmask |= int(ev_enum) else: - raise TypeError("events must be an SystemEventType, int, or list of SystemEventType or int") + raise TypeError("events must be an SystemEventType, str, or list of SystemEventType or str") initialize() + self._event_set = 0 self._event_set = nvml.system_event_set_create() # If this raises, the event needs to be freed and this is handled by # this class's __dealloc__ method. nvml.system_register_events(event_bitmask, self._event_set) - def __dealloc__(self): - nvml.system_event_set_free(self._event_set) + def __dealloc__(self) -> None: + if self._event_set != 0: + nvml.system_event_set_free(self._event_set) def wait(self, timeout_ms: int = 0, buffer_size: int = 1) -> SystemEvents: """ @@ -107,6 +127,12 @@ cdef class RegisteredSystemEvents: buffer_size: int The maximum number of events to retrieve. Must be at least 1. + Returns + ------- + :obj:`~_system_events.SystemEvents` + A set of events that were received. The number of events returned may + be less than the specified buffer size if fewer events were available. + Raises ------ :class:`cuda.core.system.TimeoutError` @@ -117,7 +143,7 @@ cdef class RegisteredSystemEvents: return SystemEvents(nvml.system_event_set_wait(self._event_set, timeout_ms, buffer_size)) -def register_events(events: SystemEventType | int | list[SystemEventType | int]) -> RegisteredSystemEvents: +def register_events(events: SystemEventType | str | list[SystemEventType | str]) -> RegisteredSystemEvents: """ Starts recording of events on test system. @@ -129,22 +155,20 @@ def register_events(events: SystemEventType | int | list[SystemEventType | int]) Examples -------- >>> from cuda.core import system - >>> events = system.register_events([ - ... SystemEventType.SYSTEM_EVENT_TYPE_GPU_DRIVER_UNBIND, - ... ]) + >>> events = system.register_events([SystemEventType.UNBIND]) >>> while event := events.wait(timeout_ms=10000): ... print(f"Event {event.event_type} occurred.") Parameters ---------- - events: SystemEventType, int, or list of SystemEventType or int + events: SystemEventType, str, or list of SystemEventType or str The event type or list of event types to register for this device. Returns ------- - :class:`RegisteredSystemEvents` + :obj:`~_system_events.RegisteredSystemEvents` An object representing the registered events. Call - :meth:`RegisteredSystemEvents.wait` on this object to wait for events. + :meth:`~_system_events.RegisteredSystemEvents.wait` on this object to wait for events. Raises ------ @@ -156,8 +180,4 @@ def register_events(events: SystemEventType | int | list[SystemEventType | int]) __all__ = [ "register_events", - "RegisteredSystemEvents", - "SystemEvent", - "SystemEvents", - "SystemEventType", ] diff --git a/cuda_core/cuda/core/system/_temperature.pxi b/cuda_core/cuda/core/system/_temperature.pxi index c56eb719d18..f5eed73de2c 100644 --- a/cuda_core/cuda/core/system/_temperature.pxi +++ b/cuda_core/cuda/core/system/_temperature.pxi @@ -3,10 +3,54 @@ # SPDX-License-Identifier: Apache-2.0 -TemperatureSensors = nvml.TemperatureSensors -TemperatureThresholds = nvml.TemperatureThresholds -ThermalController = nvml.ThermalController -ThermalTarget = nvml.ThermalTarget +_TEMPERATURE_THRESHOLD_MAPPING = { + TemperatureThresholds.SHUTDOWN: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_SHUTDOWN, + TemperatureThresholds.SLOWDOWN: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_SLOWDOWN, + TemperatureThresholds.MEM_MAX: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_MEM_MAX, + TemperatureThresholds.GPU_MAX: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_GPU_MAX, + TemperatureThresholds.ACOUSTIC_MIN: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_ACOUSTIC_MIN, + TemperatureThresholds.ACOUSTIC_CURR: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_ACOUSTIC_CURR, + TemperatureThresholds.ACOUSTIC_MAX: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_ACOUSTIC_MAX, + TemperatureThresholds.GPS_CURR: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_GPS_CURR, +} + + +_THERMAL_CONTROLLER_MAPPING = { + nvml.ThermalController.GPU_INTERNAL: ThermalController.GPU_INTERNAL, + nvml.ThermalController.ADM1032: ThermalController.ADM1032, + nvml.ThermalController.ADT7461: ThermalController.ADT7461, + nvml.ThermalController.MAX6649: ThermalController.MAX6649, + nvml.ThermalController.MAX1617: ThermalController.MAX1617, + nvml.ThermalController.LM99: ThermalController.LM99, + nvml.ThermalController.LM89: ThermalController.LM89, + nvml.ThermalController.LM64: ThermalController.LM64, + nvml.ThermalController.G781: ThermalController.G781, + nvml.ThermalController.ADT7473: ThermalController.ADT7473, + nvml.ThermalController.SBMAX6649: ThermalController.SBMAX6649, + nvml.ThermalController.VBIOSEVT: ThermalController.VBIOSEVT, + nvml.ThermalController.OS: ThermalController.OS, + nvml.ThermalController.NVSYSCON_CANOAS: ThermalController.NVSYSCON_CANOAS, + nvml.ThermalController.NVSYSCON_E551: ThermalController.NVSYSCON_E551, + nvml.ThermalController.MAX6649R: ThermalController.MAX6649R, + nvml.ThermalController.ADT7473S: ThermalController.ADT7473S, + nvml.ThermalController.UNKNOWN: ThermalController.UNKNOWN, +} + + +_THERMAL_TARGET_MAPPING = { + nvml.ThermalTarget.NONE: ThermalTarget.NONE, + nvml.ThermalTarget.GPU: ThermalTarget.GPU, + nvml.ThermalTarget.MEMORY: ThermalTarget.MEMORY, + nvml.ThermalTarget.POWER_SUPPLY: ThermalTarget.POWER_SUPPLY, + nvml.ThermalTarget.BOARD: ThermalTarget.BOARD, + nvml.ThermalTarget.VCD_BOARD: ThermalTarget.VCD_BOARD, + nvml.ThermalTarget.VCD_INLET: ThermalTarget.VCD_INLET, + nvml.ThermalTarget.VCD_OUTLET: ThermalTarget.VCD_OUTLET, + nvml.ThermalTarget.ALL: ThermalTarget.ALL, +} + + +_THERMAL_TARGET_INV_MAPPING = {v: k for k, v in _THERMAL_TARGET_MAPPING.items()} # In cuda.bindings.nvml, this is an anonymous struct inside nvmlThermalSettings_t. @@ -33,7 +77,7 @@ cdef class ThermalSensor: @property def controller(self) -> ThermalController: - return ThermalController(self._ptr[0].controller) + return _THERMAL_CONTROLLER_MAPPING.get(self._ptr[0].controller, ThermalController.UNKNOWN) @property def default_min_temp(self) -> int: @@ -49,7 +93,7 @@ cdef class ThermalSensor: @property def target(self) -> ThermalTarget: - return ThermalTarget(self._ptr[0].target) + return _THERMAL_TARGET_MAPPING.get(self._ptr[0].target, ThermalTarget.NONE) cdef class ThermalSettings: @@ -58,7 +102,7 @@ cdef class ThermalSettings: def __init__(self, thermal_settings: nvml.ThermalSettings): self._thermal_settings = thermal_settings - def __len__(self): + def __len__(self) -> int: # MAX_THERMAL_SENSORS_PER_GPU is 3 return min(self._thermal_settings.count, 3) @@ -77,27 +121,25 @@ cdef class Temperature: def __init__(self, handle: int): self._handle = handle - def sensor( - self, - sensor: TemperatureSensors = TemperatureSensors.TEMPERATURE_GPU - ) -> int: + def get_sensor(self) -> int: """ Get the temperature reading from a specific sensor on the device, in degrees Celsius. - Parameters - ---------- - sensor: :class:`TemperatureSensors`, optional - The temperature sensor to query. + The only sensor currently supported is the GPU temperature sensor. Returns ------- int The temperature in degrees Celsius. """ - return nvml.device_get_temperature_v(self._handle, sensor) + # NOTE: nvml.device_get_temperature_v takes a sensor type from the + # TemperatorSensors enum, but there is only one value in that enum. For + # future compatibility if there are other values for that enum, this is + # a method, not a property + return nvml.device_get_temperature_v(self._handle, nvml.TemperatureSensors.TEMPERATURE_GPU) - def threshold(self, threshold_type: TemperatureThresholds) -> int: + def get_threshold(self, threshold_type: TemperatureThresholds | str) -> int: """ Retrieves the temperature threshold for this GPU with the specified threshold type, in degrees Celsius. @@ -118,7 +160,29 @@ cdef class Temperature: use :meth:`get_field_values` with ``NVML_FI_DEV_TEMPERATURE_*`` fields to retrieve temperature thresholds on these architectures. """ - return nvml.device_get_temperature_threshold(self._handle, threshold_type) + try: + threshold_type_enum = _TEMPERATURE_THRESHOLD_MAPPING[threshold_type] + except KeyError: + raise ValueError( + f"Invalid temperature threshold type: {threshold_type}. " + f"Must be one of {list(TemperatureThresholds.__members__.values())}" + ) from None + if threshold_type_enum in ( + nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_SHUTDOWN, + nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_SLOWDOWN, + nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_MEM_MAX, + nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_GPU_MAX + ): + device_arch = nvml.DeviceArch(nvml.device_get_architecture(self._handle)) + if device_arch >= nvml.DeviceArch.ADA: + warnings.warn( + f"{threshold_type} is no longer recommended for Ada and later architectures. " + "Use get_field_values with NVML_FI_DEV_TEMPERATURE_* fields to retrieve this " + "threshold on these architectures.", + DeprecationWarning, + stacklevel=2 + ) + return nvml.device_get_temperature_threshold(self._handle, threshold_type_enum) @property def margin(self) -> int: @@ -127,12 +191,10 @@ cdef class Temperature: """ return nvml.device_get_margin_temperature(self._handle) - def thermal_settings(self, sensor_index: ThermalTarget) -> ThermalSettings: + def get_thermal_settings(self, sensor_index: ThermalTarget | str) -> ThermalSettings: """ Used to execute a list of thermal system instructions. - TODO: The above docstring is from the NVML header, but it doesn't seem to make sense. - Parameters ---------- sensor_index: ThermalTarget @@ -140,7 +202,16 @@ cdef class Temperature: Returns ------- - :class:`ThermalSettings` + :obj:`~_device.ThermalSettings` The thermal settings for the specified sensor. """ - return ThermalSettings(nvml.device_get_thermal_settings(self._handle, sensor_index)) + # TODO: The above docstring is from the NVML header, but it doesn't seem to make sense. + try: + sensor_index_enum = _THERMAL_TARGET_INV_MAPPING[sensor_index] + except KeyError: + raise ValueError( + f"Invalid thermal sensor index: {sensor_index}. " + f"Must be one of {list(ThermalTarget.__members__.values())}" + ) from None + + return ThermalSettings(nvml.device_get_thermal_settings(self._handle, sensor_index_enum)) diff --git a/cuda_core/cuda/core/system/_utilization.pxi b/cuda_core/cuda/core/system/_utilization.pxi new file mode 100644 index 00000000000..689b7dc67f2 --- /dev/null +++ b/cuda_core/cuda/core/system/_utilization.pxi @@ -0,0 +1,29 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + + +cdef class Utilization: + """ + Utilization rates for a device. + + For devices with compute capability 2.0 or higher. + """ + cdef object _utilization + + def __init__(self, utilization: nvml.Utilization): + self._utilization = utilization + + @property + def gpu(self) -> int: + """ + Percent of time over the past sample period during which one or more kernels was executing on the GPU. + """ + return self._utilization.gpu + + @property + def memory(self) -> int: + """ + Percent of time over the past sample period during which global (device) memory was being read or written. + """ + return self._utilization.memory diff --git a/cuda_core/cuda/core/system/typing.py b/cuda_core/cuda/core/system/typing.py new file mode 100644 index 00000000000..02246714a39 --- /dev/null +++ b/cuda_core/cuda/core/system/typing.py @@ -0,0 +1,361 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from cuda.core._utils.pycompat import StrEnum + +__all__ = [ + "AddressingMode", + "AffinityScope", + "ClockId", + "ClockType", + "ClocksEventReasons", + "CoolerControl", + "CoolerTarget", + "EventType", + "FanControlPolicy", + "GpuP2PCapsIndex", + "GpuP2PStatus", + "GpuTopologyLevel", + "InforomObject", + "SystemEventType", + "TemperatureThresholds", + "ThermalController", + "ThermalTarget", +] + + +class AddressingMode(StrEnum): + """ + Addressing mode of a device. + + For Kepler™ or newer fully supported devices. + """ + + HMM = "hmm" + ATS = "ats" + + +AddressingMode.HMM.__doc__ = """ + System allocated memory (``malloc``, ``mmap``) is addressable from the device + (GPU), via software-based mirroring of the CPU's page tables, on the GPU. +""" + +AddressingMode.ATS.__doc__ = """ + System allocated memory (``malloc``, ``mmap``) is addressable from the device + (GPU), via Address Translation Services. This means that there is (effectively) + a single set of page tables, and the CPU and GPU both use them. +""" + + +class AffinityScope(StrEnum): + """ + Scope for affinity queries. + """ + + NODE = "node" + SOCKET = "socket" + + +AffinityScope.NODE.__doc__ = """ +The NUMA node is the scope of the affinity query. This is the default scope. +""" + +AffinityScope.SOCKET.__doc__ = """ +The CPU socket is the scope of the affinity query. +""" + + +class ClockId(StrEnum): + """ + Clock Ids. These are used in combination with :class:`ClockType` to specify a single clock value. + """ + + CURRENT = "current" + CUSTOMER_BOOST_MAX = "customer_boost_max" + # APP_CLOCK_TARGET and APP_CLOCK_DEFAULT are deprecated so not included here + + +ClockId.CURRENT.__doc__ = "Current actual clock value." +ClockId.CUSTOMER_BOOST_MAX.__doc__ = "OEM-defined maximum clock rate" + + +class ClocksEventReasons(StrEnum): + """ + Reasons for a clocks event. These are used in combination with :class:`ClockType` to specify the reason + for a clocks event. + """ + + NONE = "none" + GPU_IDLE = "gpu_idle" + APPLICATIONS_CLOCKS_SETTING = "applications_clocks_setting" + SW_POWER_CAP = "sw_power_cap" + HW_SLOWDOWN = "hw_slowdown" + SYNC_BOOST = "sync_boost" + SW_THERMAL_SLOWDOWN = "sw_thermal_slowdown" + HW_THERMAL_SLOWDOWN = "hw_thermal_slowdown" + HW_POWER_BRAKE_SLOWDOWN = "hw_power_brake_slowdown" + DISPLAY_CLOCK_SETTING = "display_clock_setting" + + +class ClockType(StrEnum): + """ + Clock types. All speeds are in Mhz. + """ + + GRAPHICS = "graphics" + SM = "sm" + MEMORY = "memory" + VIDEO = "video" + + +class CoolerControl(StrEnum): + """ + Cooler control type. + """ + + TOGGLE = "toggle" + VARIABLE = "variable" + + +CoolerControl.TOGGLE.__doc__ = """ +This cooler can only be toggled either ON or OFF (e.g. a switch). +""" + +CoolerControl.VARIABLE.__doc__ = """ +This cooler's level can be adjusted from some minimum to some maximum (e.g. a knob). +""" + + +class CoolerTarget(StrEnum): + """ + Cooler target. + """ + + NONE = "none" + GPU = "gpu" + MEMORY = "memory" + POWER_SUPPLY = "power_supply" + # THERMAL_GPU_RELATED is a composite target, so it is omitted here and will + # get returned as 3 separate targets: GPU, MEMORY, and POWER_SUPPLY. + + +CoolerTarget.NONE.__doc__ = "This cooler controls nothing." +CoolerTarget.GPU.__doc__ = "This cooler can cool the GPU." +CoolerTarget.MEMORY.__doc__ = "This cooler can cool the memory." +CoolerTarget.POWER_SUPPLY.__doc__ = "This cooler can cool the power supply." + + +class EventType(StrEnum): + """ + Event types that can be waited on with :class:`DeviceEvents`. + """ + + NONE = "none" + SINGLE_BIT_ECC_ERROR = "single_bit_ecc_error" + DOUBLE_BIT_ECC_ERROR = "double_bit_ecc_error" + PSTATE = "pstate" + XID_CRITICAL_ERROR = "xid_critical_error" + CLOCK = "clock" + POWER_SOURCE_CHANGE = "power_source_change" + MIG_CONFIG_CHANGE = "mig_config_change" + SINGLE_BIT_ECC_ERROR_STORM = "single_bit_ecc_error_storm" + DRAM_RETIREMENT_EVENT = "dram_retirement_event" + DRAM_RETIREMENT_FAILURE = "dram_retirement_failure" + NON_FATAL_POISON_ERROR = "non_fatal_poison_error" + FATAL_POISON_ERROR = "fatal_poison_error" + GPU_UNAVAILABLE_ERROR = "gpu_unavailable_error" + GPU_RECOVERY_ACTION = "gpu_recovery_action" + + +EventType.PSTATE.__doc__ = """ +Event about PState changes + +On Fermi™ architecture, PState changes are also an indicator that GPU is throttling down due to +no work being executed on the GPU, power capping or thermal capping. In a typical situation, +Fermi-based GPU should stay in P0 for the duration of the execution of the compute process. +""" + + +class FanControlPolicy(StrEnum): + """ + Fan control policies. + """ + + TEMPERATURE_CONTROLLED = "temperature_controlled" + MANUAL = "manual" + + +class GpuP2PCapsIndex(StrEnum): + """ + GPU peer-to-peer capabilities index. + """ + + READ = "read" + WRITE = "write" + NVLINK = "nvlink" + ATOMICS = "atomics" + PCI = "pci" + PROP = "prop" + UNKNOWN = "unknown" + + +class GpuP2PStatus(StrEnum): + """ + GPU peer-to-peer status. + """ + + OK = "ok" + CHIPSET_NOT_SUPPORTED = "chipset not supported" + GPU_NOT_SUPPORTED = "GPU not supported" + IOH_TOPOLOGY_NOT_SUPPORTED = "IOH topology not supported" + DISABLED_BY_REGKEY = "disabled by regkey" + NOT_SUPPORTED = "not supported" + UNKNOWN = "unknown" + + +class GpuTopologyLevel(StrEnum): + """ + Represents level relationships within a system between two GPUs. + """ + + INTERNAL = "internal" + SINGLE = "single" + MULTIPLE = "multiple" + HOSTBRIDGE = "hostbridge" + NODE = "node" + SYSTEM = "system" + + +class InforomObject(StrEnum): + """ + InfoROM objects types. + """ + + OEM = "oem" + ECC = "ecc" + POWER = "power" + DEN = "den" + + +InforomObject.OEM.__doc__ = "An object defined by OEM." +InforomObject.ECC.__doc__ = "The ECC object determining the level of ECC support." +InforomObject.POWER.__doc__ = "The power management object." +InforomObject.DEN.__doc__ = "DRAM Encryption object." + + +class SystemEventType(StrEnum): + """ + System event types. + """ + + UNBIND = "unbind" + BIND = "bind" + + +class TemperatureThresholds(StrEnum): + """ + Temperature threshold types. + """ + + SHUTDOWN = "shutdown" + SLOWDOWN = "slowdown" + MEM_MAX = "mem_max" + GPU_MAX = "gpu_max" + ACOUSTIC_MIN = "acoustic_min" + ACOUSTIC_CURR = "acoustic_curr" + ACOUSTIC_MAX = "acoustic_max" + GPS_CURR = "gps_curr" + + +class ThermalController(StrEnum): + """ + Thermal controller types. + """ + + GPU_INTERNAL = "gpu_internal" + ADM1032 = "adm1032" + ADT7461 = "adt7461" + MAX6649 = "max6649" + MAX1617 = "max1617" + LM99 = "lm99" + LM89 = "lm89" + LM64 = "lm64" + G781 = "g781" + ADT7473 = "adt7473" + SBMAX6649 = "sbmax6649" + VBIOSEVT = "vbiosevt" + OS = "os" + NVSYSCON_CANOAS = "nvsyscon_canoas" + NVSYSCON_E551 = "nvsyscon_e551" + MAX6649R = "max6649r" + ADT7473S = "adt7473s" + UNKNOWN = "unknown" + + +class ThermalTarget(StrEnum): + """ + Thermal sensor targets. + """ + + NONE = "none" + GPU = "gpu" + MEMORY = "memory" + POWER_SUPPLY = "power_supply" + BOARD = "board" + VCD_BOARD = "vcd_board" + VCD_INLET = "vcd_inlet" + VCD_OUTLET = "vcd_outlet" + ALL = "all" + + +ThermalTarget.GPU.__doc__ = "GPU core temperature requires physical GPU handle." +ThermalTarget.MEMORY.__doc__ = "GPU memory temperature requires physical GPU handle." +ThermalTarget.POWER_SUPPLY.__doc__ = "GPU power supply temperature requires physical GPU handle." +ThermalTarget.BOARD.__doc__ = "GPU board ambient temperature requires physical GPU handle." +ThermalTarget.VCD_BOARD.__doc__ = "Visual Computing Device Board temperature requires visual computing device handle." +ThermalTarget.VCD_INLET.__doc__ = "Visual Computing Device Inlet temperature requires visual computing device handle." +ThermalTarget.VCD_OUTLET.__doc__ = "Visual Computing Device Outlet temperature requires visual computing device handle." + + +# DeviceArch values are derived from cuda.bindings.nvml at definition time, so +# the class can only be defined when nvml is importable. +try: + from cuda.bindings import nvml as _nvml + + try: + from cuda.bindings._internal._fast_enum import FastEnum as _FastEnum + except ImportError: + from enum import IntEnum as _FastEnum + + # This uses FastEnum instead of StrEnum because the ordering of the values is + # meaningful, e.g. Kepler "or later" + class DeviceArch(_FastEnum): + """ + Device architecture. + """ + + KEPLER = int(_nvml.DeviceArch.KEPLER) + MAXWELL = int(_nvml.DeviceArch.MAXWELL) + PASCAL = int(_nvml.DeviceArch.PASCAL) + VOLTA = int(_nvml.DeviceArch.VOLTA) + TURING = int(_nvml.DeviceArch.TURING) + AMPERE = int(_nvml.DeviceArch.AMPERE) + ADA = int(_nvml.DeviceArch.ADA) + HOPPER = int(_nvml.DeviceArch.HOPPER) + BLACKWELL = int(_nvml.DeviceArch.BLACKWELL) + UNKNOWN = int(_nvml.DeviceArch.UNKNOWN) + + __all__.append("DeviceArch") + + FieldId = _nvml.FieldId + + __all__.append("FieldId") + + del _nvml, _FastEnum + +except ImportError: + pass + + +del StrEnum diff --git a/cuda_core/cuda/core/texture/__init__.py b/cuda_core/cuda/core/texture/__init__.py new file mode 100644 index 00000000000..cd3e355f324 --- /dev/null +++ b/cuda_core/cuda/core/texture/__init__.py @@ -0,0 +1,40 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +"""Texture and surface APIs for ``cuda.core``. + +This subpackage groups the CUDA "Texture and Surface" object model — opaque +array storage and the bindless texture/surface handles built on it — under a +single namespace, mirroring how the CUDA driver documentation organizes them. + +Import these types from here, e.g.:: + + from cuda.core.texture import OpaqueArray, TextureObject, TextureObjectOptions + +The associated enumerations (:class:`~cuda.core.typing.ArrayFormatType`, +:class:`~cuda.core.typing.AddressModeType`, +:class:`~cuda.core.typing.FilterModeType`, +:class:`~cuda.core.typing.ReadModeType`) live in :mod:`cuda.core.typing` +alongside the other ``cuda.core`` enumerations. +""" + +from cuda.core.texture._array import OpaqueArray, OpaqueArrayOptions +from cuda.core.texture._mipmapped_array import MipmappedArray, MipmappedArrayOptions +from cuda.core.texture._surface import SurfaceObject +from cuda.core.texture._texture import ( + ResourceDescriptor, + TextureObject, + TextureObjectOptions, +) + +__all__ = [ + "MipmappedArray", + "MipmappedArrayOptions", + "OpaqueArray", + "OpaqueArrayOptions", + "ResourceDescriptor", + "SurfaceObject", + "TextureObject", + "TextureObjectOptions", +] diff --git a/cuda_core/cuda/core/texture/_array.pxd b/cuda_core/cuda/core/texture/_array.pxd new file mode 100644 index 00000000000..5e380c8885a --- /dev/null +++ b/cuda_core/cuda/core/texture/_array.pxd @@ -0,0 +1,27 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from cuda.bindings cimport cydriver +from cuda.core._resource_handles cimport OpaqueArrayHandle + + +cdef class OpaqueArray: + + cdef: + # Owning/non-owning + any parent (mipmap) dependency are encoded + # structurally in the C++ box behind this handle, not in Python state. + OpaqueArrayHandle _handle + tuple _shape # (w,), (w, h), or (w, h, d) + cydriver.CUarray_format _format + unsigned int _num_channels # 1, 2, or 4 + int _device_id + bint _surface_load_store + + cpdef close(self) + + +# Wrap an existing OpaqueArrayHandle as a OpaqueArray, querying the driver for the +# array's shape/format/channels/surface-flag metadata. Used by get_level and +# the graphics-interop _from_handle path. +cdef OpaqueArray _array_from_handle(OpaqueArrayHandle h, int device_id) diff --git a/cuda_core/cuda/core/texture/_array.pyi b/cuda_core/cuda/core/texture/_array.pyi new file mode 100644 index 00000000000..380c2fe1c10 --- /dev/null +++ b/cuda_core/cuda/core/texture/_array.pyi @@ -0,0 +1,196 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/texture/_array.pyx + +from __future__ import annotations + +from dataclasses import dataclass + +import numpy +from cuda.bindings import cydriver +from cuda.core.typing import ArrayFormatType + + +@dataclass +class OpaqueArrayOptions: + """Options for :meth:`cuda.core.Device.create_opaque_array`. + + Attributes + ---------- + shape : tuple of int + ``(width,)``, ``(width, height)``, or ``(width, height, depth)`` in + elements. + format : ArrayFormatType, str, or numpy.dtype + Element format. Accepts an :class:`~cuda.core.typing.ArrayFormatType`, + a plain string (e.g. ``"float32"``), or a NumPy dtype object. + num_channels : int + Channels per element. Must be 1, 2, or 4. + is_surface_load_store : bool + If True, allocate with ``CUDA_ARRAY3D_SURFACE_LDST`` so the array can be + bound as a :class:`~cuda.core.texture.SurfaceObject` for kernel-side + writes. Default False. + + .. versionadded:: 1.1.0 + """ + shape: tuple[int, ...] + format: object + num_channels: int + is_surface_load_store: bool = False + + def __post_init__(self): + ... + +class OpaqueArray: + """An opaque, hardware-laid-out GPU allocation for texture/surface access. + + Distinct from :class:`Buffer`: a ``CUarray`` has no exposed device pointer + and can only be accessed from kernels through a :class:`TextureObject` or + :class:`SurfaceObject`. Its memory layout is chosen by the driver for 2D/3D + spatial locality. + + **Copy-only interop.** Because the layout is opaque and there is no linear + device pointer, a ``OpaqueArray`` cannot expose ``__cuda_array_interface__`` / + DLPack and cannot be shared zero-copy with NumPy, CuPy, numba-cuda, or + PyTorch. Moving data in or out is therefore always a copy: use + :meth:`copy_from` / :meth:`copy_to` against a linear :class:`Buffer` or a + host buffer-protocol object. There is no allocation helper — allocate the + linear :class:`Buffer` yourself (e.g. ``mr.allocate(arr.size_bytes, + stream=s)``) and copy. + + Construct via :meth:`cuda.core.Device.create_opaque_array`. Only plain + 1D/2D/3D allocations are supported in this initial version; layered/cubemap/ + sparse variants will follow once their shape semantics are settled. + + .. versionadded:: 1.1.0 + """ + + def close(self): + """Release this object's reference to the underlying ``CUarray``. + + Destruction (``cuArrayDestroy``) happens via the handle's deleter when + the last reference is dropped; for a non-owning handle (graphics interop + or a mipmap-level view) nothing is destroyed. Idempotent: a second call + (or destruction after ``close()``) is a no-op. + """ + + def __init__(self, *args, **kwargs): + ... + + @classmethod + def _from_handle(cls, handle: int, owning: bool, *, device_id=None): + """Wrap an externally-allocated ``CUarray``. + + Intended for graphics interop (``cuGraphicsSubResourceGetMappedArray``) + where the array is owned by the graphics API. With ``owning=False`` the + underlying ``CUarray`` is never destroyed by this object. Shape, format, + and channel count are queried from the driver. + """ + + @property + def handle(self): + """The underlying ``CUarray`` as an integer.""" + + @property + def shape(self): + """Allocation shape, in elements.""" + + @property + def format(self): + """The element :class:`~cuda.core.typing.ArrayFormatType`.""" + + @property + def num_channels(self): + """Channels per element (1, 2, or 4).""" + + @property + def element_bytes(self): + """Bytes per element (format size * channels).""" + + @property + def device(self): + """The :class:`Device` this array was allocated on.""" + + @property + def is_surface_load_store(self): + """True if this array was created with ``CUDA_ARRAY3D_SURFACE_LDST`` + and can be bound as a :class:`SurfaceObject`.""" + + def _extent_bytes(self): + """Return (width_bytes, height, depth) for cuMemcpy3D, with height/depth + normalized to >=1 for lower-rank arrays.""" + + def copy_from(self, src, *, stream) -> None: + """Copy a full-array's worth of data into this array. + + Parameters + ---------- + src : Buffer or buffer-protocol object + Source data. Must contain at least ``self.size_bytes`` bytes + of contiguous data. + stream : Stream or GraphBuilder + Stream to issue the copy on. A :class:`~cuda.core.graph.GraphBuilder` + is accepted so the copy can be captured into a graph. + """ + + def copy_to(self, dst, *, stream): + """Copy a full-array's worth of data out of this array. + + Parameters + ---------- + dst : Buffer or writable buffer-protocol object + Destination. Must have at least ``self.size_bytes`` bytes of + writable, contiguous space. + stream : Stream or GraphBuilder + Stream to issue the copy on. A :class:`~cuda.core.graph.GraphBuilder` + is accepted so the copy can be captured into a graph. + + Returns + ------- + The ``dst`` object, for parity with :meth:`Buffer.copy_to`. + """ + + @property + def size_bytes(self): + """Total bytes of array storage (``prod(shape) * element_bytes``).""" + + def __enter__(self): + ... + + def __exit__(self, exc_type, exc, tb): + ... + + def __repr__(self): + ... +_ARRAYFORMAT_TO_CU = {ArrayFormatType.UINT8: int(cydriver.CU_AD_FORMAT_UNSIGNED_INT8), ArrayFormatType.UINT16: int(cydriver.CU_AD_FORMAT_UNSIGNED_INT16), ArrayFormatType.UINT32: int(cydriver.CU_AD_FORMAT_UNSIGNED_INT32), ArrayFormatType.INT8: int(cydriver.CU_AD_FORMAT_SIGNED_INT8), ArrayFormatType.INT16: int(cydriver.CU_AD_FORMAT_SIGNED_INT16), ArrayFormatType.INT32: int(cydriver.CU_AD_FORMAT_SIGNED_INT32), ArrayFormatType.FLOAT16: int(cydriver.CU_AD_FORMAT_HALF), ArrayFormatType.FLOAT32: int(cydriver.CU_AD_FORMAT_FLOAT)} +_CU_TO_ARRAYFORMAT = {cu: fmt for fmt, cu in _ARRAYFORMAT_TO_CU.items()} +_NUMPY_DTYPE_TO_ARRAYFORMAT = {numpy.dtype(fmt.value): fmt for fmt in ArrayFormatType} +_FORMAT_ELEM_SIZE = {_ARRAYFORMAT_TO_CU[ArrayFormatType.UINT8]: 1, _ARRAYFORMAT_TO_CU[ArrayFormatType.INT8]: 1, _ARRAYFORMAT_TO_CU[ArrayFormatType.UINT16]: 2, _ARRAYFORMAT_TO_CU[ArrayFormatType.INT16]: 2, _ARRAYFORMAT_TO_CU[ArrayFormatType.FLOAT16]: 2, _ARRAYFORMAT_TO_CU[ArrayFormatType.UINT32]: 4, _ARRAYFORMAT_TO_CU[ArrayFormatType.INT32]: 4, _ARRAYFORMAT_TO_CU[ArrayFormatType.FLOAT32]: 4} + +def _normalize_array_format(format): + """Coerce ``format`` to an :class:`ArrayFormatType`. + + Accepts, in order of preference: + + * an :class:`ArrayFormatType`; + * a plain ``str`` naming one of its values (e.g. ``"float32"``); + * a NumPy dtype object (or anything ``numpy.dtype()`` accepts, such as + ``numpy.float32``) whose canonical dtype maps 1:1 to one of the eight + supported formats. + + Raises :class:`ValueError` on anything else.""" + +def _validate_format_channels(format, num_channels): + """Validate the ``(format, num_channels)`` pair shared by the array, + mipmap, and texture factories. Returns the normalized + :class:`ArrayFormatType`. Raises on an invalid combination.""" + +def _validate_array_shape(shape): + """Coerce ``shape`` to a tuple of ints and validate rank (1-3) and that + every extent is >= 1. Returns the normalized tuple.""" + +def _create_opaque_array(options): + """Allocate a new :class:`OpaqueArray` on the current device. + + Backs :meth:`cuda.core.Device.create_opaque_array`. ``options`` is an + :class:`OpaqueArrayOptions` (or a mapping accepted by it); it is validated + at construction, so ``shape`` is already a normalized tuple and ``format`` + an :class:`~cuda.core.typing.ArrayFormatType`. + """ \ No newline at end of file diff --git a/cuda_core/cuda/core/texture/_array.pyx b/cuda_core/cuda/core/texture/_array.pyx new file mode 100644 index 00000000000..0a1cb671daf --- /dev/null +++ b/cuda_core/cuda/core/texture/_array.pyx @@ -0,0 +1,552 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +cimport cpython +from libc.stdint cimport intptr_t +from libc.string cimport memset + +from cuda.bindings cimport cydriver +from cuda.core._memory._buffer cimport Buffer +from cuda.core._resource_handles cimport ( + OpaqueArrayHandle, + as_cu, + as_intptr, + create_array_handle, + create_array_handle_owning, + create_array_handle_ref, + get_last_error, +) +from cuda.core._stream cimport Stream, Stream_accept +from cuda.core._utils.cuda_utils cimport ( + HANDLE_RETURN, + _get_current_device_id, +) + +import numpy + +from dataclasses import dataclass + +from cuda.core._utils.cuda_utils import check_or_create_options +from cuda.core.typing import ArrayFormatType + + +# Bridge between the public ArrayFormatType StrEnum and the driver +# CUarray_format integer values. OpaqueArray stores the driver int internally +# (see ._format), so all conversions funnel through these two maps. +_ARRAYFORMAT_TO_CU = { + ArrayFormatType.UINT8: int(cydriver.CU_AD_FORMAT_UNSIGNED_INT8), + ArrayFormatType.UINT16: int(cydriver.CU_AD_FORMAT_UNSIGNED_INT16), + ArrayFormatType.UINT32: int(cydriver.CU_AD_FORMAT_UNSIGNED_INT32), + ArrayFormatType.INT8: int(cydriver.CU_AD_FORMAT_SIGNED_INT8), + ArrayFormatType.INT16: int(cydriver.CU_AD_FORMAT_SIGNED_INT16), + ArrayFormatType.INT32: int(cydriver.CU_AD_FORMAT_SIGNED_INT32), + ArrayFormatType.FLOAT16: int(cydriver.CU_AD_FORMAT_HALF), + ArrayFormatType.FLOAT32: int(cydriver.CU_AD_FORMAT_FLOAT), +} +_CU_TO_ARRAYFORMAT = {cu: fmt for fmt, cu in _ARRAYFORMAT_TO_CU.items()} + + +# Every ArrayFormatType value is spelled as a NumPy dtype name, so the eight +# formats map 1:1 to NumPy dtypes. This lets callers pass a dtype object (or +# anything numpy.dtype() accepts) instead of the enum, matching the precedent +# set by TensorMapDescriptorOptions.data_type. +_NUMPY_DTYPE_TO_ARRAYFORMAT = { + numpy.dtype(fmt.value): fmt for fmt in ArrayFormatType +} + + +# Bytes per element (single channel), keyed by the driver CUarray_format int. +_FORMAT_ELEM_SIZE = { + _ARRAYFORMAT_TO_CU[ArrayFormatType.UINT8]: 1, + _ARRAYFORMAT_TO_CU[ArrayFormatType.INT8]: 1, + _ARRAYFORMAT_TO_CU[ArrayFormatType.UINT16]: 2, + _ARRAYFORMAT_TO_CU[ArrayFormatType.INT16]: 2, + _ARRAYFORMAT_TO_CU[ArrayFormatType.FLOAT16]: 2, + _ARRAYFORMAT_TO_CU[ArrayFormatType.UINT32]: 4, + _ARRAYFORMAT_TO_CU[ArrayFormatType.INT32]: 4, + _ARRAYFORMAT_TO_CU[ArrayFormatType.FLOAT32]: 4, +} + + +def _normalize_array_format(format): + """Coerce ``format`` to an :class:`ArrayFormatType`. + + Accepts, in order of preference: + + * an :class:`ArrayFormatType`; + * a plain ``str`` naming one of its values (e.g. ``"float32"``); + * a NumPy dtype object (or anything ``numpy.dtype()`` accepts, such as + ``numpy.float32``) whose canonical dtype maps 1:1 to one of the eight + supported formats. + + Raises :class:`ValueError` on anything else.""" + if isinstance(format, ArrayFormatType): + return format + if isinstance(format, str): + try: + return ArrayFormatType(format) + except ValueError as e: + valid = ", ".join(repr(f.value) for f in ArrayFormatType) + raise ValueError( + f"format must be an ArrayFormatType or one of {{{valid}}}, got {format!r}" + ) from e + # Fall back to interpreting ``format`` as a NumPy dtype (dtype object, + # scalar type, etc.). Unknown dtypes are reported against the supported set. + try: + dt = numpy.dtype(format) + except TypeError as e: + raise ValueError( + f"format must be an ArrayFormatType, str, or NumPy dtype, got {format!r}" + ) from e + try: + return _NUMPY_DTYPE_TO_ARRAYFORMAT[dt] + except KeyError as e: + valid = ", ".join(repr(f.value) for f in ArrayFormatType) + raise ValueError( + f"NumPy dtype {dt!r} has no ArrayFormatType equivalent; " + f"supported formats: {{{valid}}}" + ) from e + + +def _validate_format_channels(format, num_channels): + """Validate the ``(format, num_channels)`` pair shared by the array, + mipmap, and texture factories. Returns the normalized + :class:`ArrayFormatType`. Raises on an invalid combination.""" + fmt = _normalize_array_format(format) + if isinstance(num_channels, bool) or num_channels not in (1, 2, 4): + raise ValueError(f"num_channels must be 1, 2, or 4, got {num_channels!r}") + return fmt + + +def _validate_array_shape(shape): + """Coerce ``shape`` to a tuple of ints and validate rank (1-3) and that + every extent is >= 1. Returns the normalized tuple.""" + try: + shape_t = tuple(int(s) for s in shape) + except TypeError as e: + raise TypeError(f"shape must be a tuple of ints, got {type(shape).__name__}") from e + if not 1 <= len(shape_t) <= 3: + raise ValueError(f"shape rank must be 1, 2, or 3, got {len(shape_t)}") + for i, dim in enumerate(shape_t): + if dim < 1: + raise ValueError(f"shape[{i}] must be >= 1, got {dim}") + return shape_t + + +@dataclass +class OpaqueArrayOptions: + """Options for :meth:`cuda.core.Device.create_opaque_array`. + + Attributes + ---------- + shape : tuple of int + ``(width,)``, ``(width, height)``, or ``(width, height, depth)`` in + elements. + format : ArrayFormatType, str, or numpy.dtype + Element format. Accepts an :class:`~cuda.core.typing.ArrayFormatType`, + a plain string (e.g. ``"float32"``), or a NumPy dtype object. + num_channels : int + Channels per element. Must be 1, 2, or 4. + is_surface_load_store : bool + If True, allocate with ``CUDA_ARRAY3D_SURFACE_LDST`` so the array can be + bound as a :class:`~cuda.core.texture.SurfaceObject` for kernel-side + writes. Default False. + + .. versionadded:: 1.1.0 + """ + + shape: tuple[int, ...] + format: object + num_channels: int + is_surface_load_store: bool = False + + def __post_init__(self): + self.format = _validate_format_channels(self.format, self.num_channels) + self.shape = _validate_array_shape(self.shape) + + +cdef void _fill_array_endpoint( + cydriver.CUDA_MEMCPY3D* p, OpaqueArray arr, bint is_src +) noexcept: + """Populate the src or dst array fields of a CUDA_MEMCPY3D struct.""" + if is_src: + p.srcMemoryType = cydriver.CU_MEMORYTYPE_ARRAY + p.srcArray = as_cu(arr._handle) + p.srcXInBytes = 0 + p.srcY = 0 + p.srcZ = 0 + else: + p.dstMemoryType = cydriver.CU_MEMORYTYPE_ARRAY + p.dstArray = as_cu(arr._handle) + p.dstXInBytes = 0 + p.dstY = 0 + p.dstZ = 0 + + +cdef int _fill_host_endpoint( + cydriver.CUDA_MEMCPY3D* p, + object obj, + bint is_src, + size_t width_bytes, + size_t height, + size_t required, + cpython.Py_buffer* pybuf_out, +) except -1: + """Populate src/dst host fields from a buffer-protocol ``obj``. + + Acquires a Py_buffer view; the caller is responsible for releasing it + (this function always returns with the view held when it returns 1). + """ + cdef int flags = cpython.PyBUF_SIMPLE + if not is_src: + flags |= cpython.PyBUF_WRITABLE + if cpython.PyObject_GetBuffer(obj, pybuf_out, flags) != 0: + raise TypeError( + f"Source/destination must be a Buffer or a contiguous " + f"buffer-protocol object, got {type(obj).__name__}" + ) + if pybuf_out.len < required: + cpython.PyBuffer_Release(pybuf_out) + raise ValueError( + f"Host buffer has {pybuf_out.len} bytes, smaller than the array " + f"extent ({required} bytes)" + ) + if is_src: + p.srcMemoryType = cydriver.CU_MEMORYTYPE_HOST + p.srcHost = pybuf_out.buf + p.srcPitch = width_bytes + p.srcHeight = height + p.srcXInBytes = 0 + p.srcY = 0 + p.srcZ = 0 + else: + p.dstMemoryType = cydriver.CU_MEMORYTYPE_HOST + p.dstHost = pybuf_out.buf + p.dstPitch = width_bytes + p.dstHeight = height + p.dstXInBytes = 0 + p.dstY = 0 + p.dstZ = 0 + return 1 + + +cdef int _fill_linear_endpoint( + cydriver.CUDA_MEMCPY3D* p, + object obj, + bint is_src, + size_t width_bytes, + size_t height, + size_t depth, + cpython.Py_buffer* pybuf_out, +) except -1: + """Populate the src or dst linear fields. Returns 1 if pybuf_out was + filled (caller must release it), 0 otherwise. + """ + cdef intptr_t ptr + cdef size_t required = width_bytes * height * depth + if isinstance(obj, Buffer): + if (obj).size < required: + raise ValueError( + f"Buffer size ({(obj).size} bytes) is smaller than " + f"the array extent ({required} bytes)" + ) + ptr = int((obj).handle) + if is_src: + p.srcMemoryType = cydriver.CU_MEMORYTYPE_DEVICE + p.srcDevice = ptr + p.srcPitch = width_bytes + p.srcHeight = height + p.srcXInBytes = 0 + p.srcY = 0 + p.srcZ = 0 + else: + p.dstMemoryType = cydriver.CU_MEMORYTYPE_DEVICE + p.dstDevice = ptr + p.dstPitch = width_bytes + p.dstHeight = height + p.dstXInBytes = 0 + p.dstY = 0 + p.dstZ = 0 + return 0 + return _fill_host_endpoint( + p, obj, is_src, width_bytes, height, required, pybuf_out + ) + + +cdef _copy3d(OpaqueArray arr, object other, Stream stream, bint to_array): + """Issue a full-array async 3D memcpy between ``arr`` and ``other``. + + Direction is determined by ``to_array``: True copies *into* arr, False + copies *out of* arr. ``stream`` must already be a concrete :class:`Stream` + (callers coerce via :func:`Stream_accept`). + """ + cdef cydriver.CUDA_MEMCPY3D params + cdef cpython.Py_buffer pybuf + cdef int got_buffer = 0 + cdef intptr_t stream_handle + cdef cydriver.CUstream c_stream + + memset(¶ms, 0, sizeof(params)) + width_bytes, height, depth = arr._extent_bytes() + params.WidthInBytes = width_bytes + params.Height = height + params.Depth = depth + + try: + if to_array: + got_buffer = _fill_linear_endpoint( + ¶ms, other, True, width_bytes, height, depth, &pybuf + ) + _fill_array_endpoint(¶ms, arr, False) + else: + _fill_array_endpoint(¶ms, arr, True) + got_buffer = _fill_linear_endpoint( + ¶ms, other, False, width_bytes, height, depth, &pybuf + ) + + stream_handle = int((stream).handle) + c_stream = stream_handle + with nogil: + HANDLE_RETURN(cydriver.cuMemcpy3DAsync(¶ms, c_stream)) + finally: + if got_buffer: + cpython.PyBuffer_Release(&pybuf) + + +cdef class OpaqueArray: + """An opaque, hardware-laid-out GPU allocation for texture/surface access. + + Distinct from :class:`Buffer`: a ``CUarray`` has no exposed device pointer + and can only be accessed from kernels through a :class:`TextureObject` or + :class:`SurfaceObject`. Its memory layout is chosen by the driver for 2D/3D + spatial locality. + + **Copy-only interop.** Because the layout is opaque and there is no linear + device pointer, a ``OpaqueArray`` cannot expose ``__cuda_array_interface__`` / + DLPack and cannot be shared zero-copy with NumPy, CuPy, numba-cuda, or + PyTorch. Moving data in or out is therefore always a copy: use + :meth:`copy_from` / :meth:`copy_to` against a linear :class:`Buffer` or a + host buffer-protocol object. There is no allocation helper — allocate the + linear :class:`Buffer` yourself (e.g. ``mr.allocate(arr.size_bytes, + stream=s)``) and copy. + + Construct via :meth:`cuda.core.Device.create_opaque_array`. Only plain + 1D/2D/3D allocations are supported in this initial version; layered/cubemap/ + sparse variants will follow once their shape semantics are settled. + + .. versionadded:: 1.1.0 + """ + + def __init__(self, *args, **kwargs): + raise RuntimeError( + "OpaqueArray cannot be instantiated directly. " + "Use Device.create_opaque_array()." + ) + + @classmethod + def _from_handle(cls, intptr_t handle, bint owning, *, device_id=None): + """Wrap an externally-allocated ``CUarray``. + + Intended for graphics interop (``cuGraphicsSubResourceGetMappedArray``) + where the array is owned by the graphics API. With ``owning=False`` the + underlying ``CUarray`` is never destroyed by this object. Shape, format, + and channel count are queried from the driver. + """ + cdef cydriver.CUarray raw = handle + cdef OpaqueArrayHandle h + if owning: + h = create_array_handle_owning(raw) + else: + h = create_array_handle_ref(raw) + cdef int dev = _get_current_device_id() if device_id is None else int(device_id) + return _array_from_handle(h, dev) + + @property + def handle(self): + """The underlying ``CUarray`` as an integer.""" + return as_intptr(self._handle) + + @property + def shape(self): + """Allocation shape, in elements.""" + return self._shape + + @property + def format(self): + """The element :class:`~cuda.core.typing.ArrayFormatType`.""" + return _CU_TO_ARRAYFORMAT[self._format] + + @property + def num_channels(self): + """Channels per element (1, 2, or 4).""" + return self._num_channels + + @property + def element_bytes(self): + """Bytes per element (format size * channels).""" + return _FORMAT_ELEM_SIZE[self._format] * self._num_channels + + @property + def device(self): + """The :class:`Device` this array was allocated on.""" + from cuda.core._device import Device + return Device(self._device_id) + + @property + def is_surface_load_store(self): + """True if this array was created with ``CUDA_ARRAY3D_SURFACE_LDST`` + and can be bound as a :class:`SurfaceObject`.""" + return self._surface_load_store + + def _extent_bytes(self): + """Return (width_bytes, height, depth) for cuMemcpy3D, with height/depth + normalized to >=1 for lower-rank arrays.""" + cdef int rank = len(self._shape) + cdef size_t w = self._shape[0] * ( + _FORMAT_ELEM_SIZE[self._format] * self._num_channels + ) + cdef size_t h = (self._shape[1] if rank >= 2 else 1) + cdef size_t d = (self._shape[2] if rank >= 3 else 1) + return w, h, d + + def copy_from(self, src, *, stream) -> None: + """Copy a full-array's worth of data into this array. + + Parameters + ---------- + src : Buffer or buffer-protocol object + Source data. Must contain at least ``self.size_bytes`` bytes + of contiguous data. + stream : Stream or GraphBuilder + Stream to issue the copy on. A :class:`~cuda.core.graph.GraphBuilder` + is accepted so the copy can be captured into a graph. + """ + _copy3d(self, src, Stream_accept(stream), to_array=True) + + def copy_to(self, dst, *, stream): + """Copy a full-array's worth of data out of this array. + + Parameters + ---------- + dst : Buffer or writable buffer-protocol object + Destination. Must have at least ``self.size_bytes`` bytes of + writable, contiguous space. + stream : Stream or GraphBuilder + Stream to issue the copy on. A :class:`~cuda.core.graph.GraphBuilder` + is accepted so the copy can be captured into a graph. + + Returns + ------- + The ``dst`` object, for parity with :meth:`Buffer.copy_to`. + """ + _copy3d(self, dst, Stream_accept(stream), to_array=False) + return dst + + @property + def size_bytes(self): + """Total bytes of array storage (``prod(shape) * element_bytes``).""" + cdef size_t n = 1 + for s in self._shape: + n *= s + return n * (_FORMAT_ELEM_SIZE[self._format] * self._num_channels) + + cpdef close(self): + """Release this object's reference to the underlying ``CUarray``. + + Destruction (``cuArrayDestroy``) happens via the handle's deleter when + the last reference is dropped; for a non-owning handle (graphics interop + or a mipmap-level view) nothing is destroyed. Idempotent: a second call + (or destruction after ``close()``) is a no-op. + """ + self._handle.reset() + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc, tb): + self.close() + + def __repr__(self): + return ( + f"OpaqueArray(shape={self._shape}, " + f"format={_CU_TO_ARRAYFORMAT[self._format].name}, " + f"num_channels={self._num_channels})" + ) + + +cdef OpaqueArray _array_from_handle(OpaqueArrayHandle h, int device_id): + """Wrap an existing OpaqueArrayHandle as a OpaqueArray, querying the driver for the + array's shape/format/channels/surface-flag metadata. + + Any owning/non-owning semantics and parent (mipmap) dependency are already + captured structurally inside ``h``'s C++ box. + """ + if not h: + HANDLE_RETURN(get_last_error()) + + cdef OpaqueArray self = OpaqueArray.__new__(OpaqueArray) + self._handle = h + self._device_id = device_id + + cdef cydriver.CUDA_ARRAY3D_DESCRIPTOR desc + cdef cydriver.CUarray raw = as_cu(h) + with nogil: + HANDLE_RETURN(cydriver.cuArray3DGetDescriptor(&desc, raw)) + + if desc.Depth > 0: + self._shape = (int(desc.Width), int(desc.Height), int(desc.Depth)) + elif desc.Height > 0: + self._shape = (int(desc.Width), int(desc.Height)) + else: + self._shape = (int(desc.Width),) + self._format = desc.Format + self._num_channels = desc.NumChannels + self._surface_load_store = bool(desc.Flags & cydriver.CUDA_ARRAY3D_SURFACE_LDST) + return self + + +def _create_opaque_array(options): + """Allocate a new :class:`OpaqueArray` on the current device. + + Backs :meth:`cuda.core.Device.create_opaque_array`. ``options`` is an + :class:`OpaqueArrayOptions` (or a mapping accepted by it); it is validated + at construction, so ``shape`` is already a normalized tuple and ``format`` + an :class:`~cuda.core.typing.ArrayFormatType`. + """ + cdef object opts = check_or_create_options( + OpaqueArrayOptions, options, "Opaque array options" + ) + shape_t = opts.shape + + cdef cydriver.CUarray_format c_format = _ARRAYFORMAT_TO_CU[opts.format] + cdef cydriver.CUDA_ARRAY3D_DESCRIPTOR desc3d + cdef int rank = len(shape_t) + cdef unsigned int flags = ( + cydriver.CUDA_ARRAY3D_SURFACE_LDST if opts.is_surface_load_store else 0 + ) + + # cuArray3DCreate handles 1D/2D/3D uniformly (Height/Depth 0 sentinels), + # so a single descriptor + create_array_handle covers every shape. + memset(&desc3d, 0, sizeof(desc3d)) + desc3d.Width = shape_t[0] + desc3d.Height = (shape_t[1] if rank >= 2 else 0) + desc3d.Depth = (shape_t[2] if rank >= 3 else 0) + desc3d.Format = c_format + desc3d.NumChannels = opts.num_channels + desc3d.Flags = flags + + cdef OpaqueArrayHandle h = create_array_handle(desc3d) + if not h: + HANDLE_RETURN(get_last_error()) + + cdef OpaqueArray self = OpaqueArray.__new__(OpaqueArray) + self._handle = h + self._shape = shape_t + self._format = c_format + self._num_channels = opts.num_channels + self._surface_load_store = bool(opts.is_surface_load_store) + self._device_id = _get_current_device_id() + return self diff --git a/cuda_core/cuda/core/texture/_mipmapped_array.pxd b/cuda_core/cuda/core/texture/_mipmapped_array.pxd new file mode 100644 index 00000000000..be0d8f00966 --- /dev/null +++ b/cuda_core/cuda/core/texture/_mipmapped_array.pxd @@ -0,0 +1,20 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from cuda.bindings cimport cydriver +from cuda.core._resource_handles cimport MipmappedArrayHandle + + +cdef class MipmappedArray: + + cdef: + MipmappedArrayHandle _handle + tuple _shape # (w,), (w, h), or (w, h, d) + cydriver.CUarray_format _format + unsigned int _num_channels # 1, 2, or 4 + unsigned int _num_levels + int _device_id + bint _surface_load_store + + cpdef close(self) diff --git a/cuda_core/cuda/core/texture/_mipmapped_array.pyi b/cuda_core/cuda/core/texture/_mipmapped_array.pyi new file mode 100644 index 00000000000..db4413dbaf4 --- /dev/null +++ b/cuda_core/cuda/core/texture/_mipmapped_array.pyi @@ -0,0 +1,131 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/texture/_mipmapped_array.pyx + +from __future__ import annotations + +from dataclasses import dataclass + + +@dataclass +class MipmappedArrayOptions: + """Options for :meth:`cuda.core.Device.create_mipmapped_array`. + + Attributes + ---------- + shape : tuple of int + ``(width,)``, ``(width, height)``, or ``(width, height, depth)`` in + elements, for the base (level 0) mip. + format : ArrayFormatType, str, or numpy.dtype + Element format. Accepts an :class:`~cuda.core.typing.ArrayFormatType`, + a plain string (e.g. ``"float32"``), or a NumPy dtype object. + num_channels : int + Channels per element. Must be 1, 2, or 4. + num_levels : int + Number of mip levels to allocate; must be >= 1. The driver caps this at + the log2 of the largest dimension; passing a larger value yields a + driver error. + is_surface_load_store : bool + If True, allocate with ``CUDA_ARRAY3D_SURFACE_LDST`` so individual + levels (obtained via :meth:`MipmappedArray.get_level`) can be bound as + a :class:`~cuda.core.texture.SurfaceObject` for kernel-side writes. + Default False. + + .. versionadded:: 1.1.0 + """ + shape: tuple[int, ...] + format: object + num_channels: int + num_levels: int + is_surface_load_store: bool = False + + def __post_init__(self): + ... + +class MipmappedArray: + """A mipmapped CUDA array for texture/surface access across levels. + + Wraps ``CUmipmappedArray``. Each mip level is a distinct, hardware-laid-out + allocation accessible only via a :class:`TextureObject` (or by retrieving + the level's :class:`OpaqueArray` and binding it as a :class:`SurfaceObject`). + Destroying the :class:`MipmappedArray` destroys all level arrays + implicitly, so the :class:`OpaqueArray` instances returned by :meth:`get_level` + are non-owning and hold a strong reference back to their parent. + + Construct via :meth:`cuda.core.Device.create_mipmapped_array`. + + .. versionadded:: 1.1.0 + """ + + def close(self): + """Release this object's reference to the underlying ``CUmipmappedArray``. + + Destruction (``cuMipmappedArrayDestroy``) happens via the handle's + deleter when the last reference is dropped. A level :class:`OpaqueArray` + from :meth:`get_level` holds its own reference to this mipmap's storage, + so it stays valid until both it and this object are released. Idempotent. + """ + + def __init__(self, *args, **kwargs): + ... + + def get_level(self, level): + """Return a non-owning :class:`OpaqueArray` view of the given mip level. + + Parameters + ---------- + level : int + Mip level index in ``[0, num_levels)``. + + Returns + ------- + OpaqueArray + A non-owning :class:`OpaqueArray` wrapping the level's ``CUarray``. + The :class:`MipmappedArray` is kept alive for the lifetime of the + returned :class:`OpaqueArray`; the underlying storage is released only + when this :class:`MipmappedArray` is destroyed. + """ + + @property + def handle(self): + """The underlying ``CUmipmappedArray`` as an integer.""" + + @property + def shape(self): + """Base-level (level 0) allocation shape, in elements.""" + + @property + def format(self): + """The element :class:`~cuda.core.typing.ArrayFormatType`.""" + + @property + def num_channels(self): + """Channels per element (1, 2, or 4).""" + + @property + def num_levels(self): + """Number of mip levels.""" + + @property + def is_surface_load_store(self): + """True if this mipmap (and each of its levels) was created with + ``CUDA_ARRAY3D_SURFACE_LDST`` and can back a :class:`SurfaceObject`.""" + + @property + def device(self): + """The :class:`Device` this mipmap was allocated on.""" + + def __enter__(self): + ... + + def __exit__(self, exc_type, exc, tb): + ... + + def __repr__(self): + ... + +def _create_mipmapped_array(options): + """Allocate a new :class:`MipmappedArray` on the current device. + + Backs :meth:`cuda.core.Device.create_mipmapped_array`. ``options`` is a + :class:`MipmappedArrayOptions` (or a mapping accepted by it); its fields are + validated at construction. + """ \ No newline at end of file diff --git a/cuda_core/cuda/core/texture/_mipmapped_array.pyx b/cuda_core/cuda/core/texture/_mipmapped_array.pyx new file mode 100644 index 00000000000..3f151f7bb9f --- /dev/null +++ b/cuda_core/cuda/core/texture/_mipmapped_array.pyx @@ -0,0 +1,233 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from libc.string cimport memset + +from cuda.bindings cimport cydriver +from cuda.core.texture._array cimport _array_from_handle +from cuda.core.texture._array import ( + _ARRAYFORMAT_TO_CU, + _CU_TO_ARRAYFORMAT, + _validate_array_shape, + _validate_format_channels, +) +from cuda.core._resource_handles cimport ( + OpaqueArrayHandle, + MipmappedArrayHandle, + as_intptr, + create_array_level_handle, + create_mipmapped_array_handle, + get_last_error, +) +from cuda.core._utils.cuda_utils cimport ( + HANDLE_RETURN, + _get_current_device_id, +) + +from dataclasses import dataclass + +from cuda.core._utils.cuda_utils import check_or_create_options + + +@dataclass +class MipmappedArrayOptions: + """Options for :meth:`cuda.core.Device.create_mipmapped_array`. + + Attributes + ---------- + shape : tuple of int + ``(width,)``, ``(width, height)``, or ``(width, height, depth)`` in + elements, for the base (level 0) mip. + format : ArrayFormatType, str, or numpy.dtype + Element format. Accepts an :class:`~cuda.core.typing.ArrayFormatType`, + a plain string (e.g. ``"float32"``), or a NumPy dtype object. + num_channels : int + Channels per element. Must be 1, 2, or 4. + num_levels : int + Number of mip levels to allocate; must be >= 1. The driver caps this at + the log2 of the largest dimension; passing a larger value yields a + driver error. + is_surface_load_store : bool + If True, allocate with ``CUDA_ARRAY3D_SURFACE_LDST`` so individual + levels (obtained via :meth:`MipmappedArray.get_level`) can be bound as + a :class:`~cuda.core.texture.SurfaceObject` for kernel-side writes. + Default False. + + .. versionadded:: 1.1.0 + """ + + shape: tuple[int, ...] + format: object + num_channels: int + num_levels: int + is_surface_load_store: bool = False + + def __post_init__(self): + self.format = _validate_format_channels(self.format, self.num_channels) + self.shape = _validate_array_shape(self.shape) + self.num_levels = int(self.num_levels) + if self.num_levels < 1: + raise ValueError(f"num_levels must be >= 1, got {self.num_levels}") + + +cdef class MipmappedArray: + """A mipmapped CUDA array for texture/surface access across levels. + + Wraps ``CUmipmappedArray``. Each mip level is a distinct, hardware-laid-out + allocation accessible only via a :class:`TextureObject` (or by retrieving + the level's :class:`OpaqueArray` and binding it as a :class:`SurfaceObject`). + Destroying the :class:`MipmappedArray` destroys all level arrays + implicitly, so the :class:`OpaqueArray` instances returned by :meth:`get_level` + are non-owning and hold a strong reference back to their parent. + + Construct via :meth:`cuda.core.Device.create_mipmapped_array`. + + .. versionadded:: 1.1.0 + """ + + def __init__(self, *args, **kwargs): + raise RuntimeError( + "MipmappedArray cannot be instantiated directly. " + "Use Device.create_mipmapped_array()." + ) + + def get_level(self, level): + """Return a non-owning :class:`OpaqueArray` view of the given mip level. + + Parameters + ---------- + level : int + Mip level index in ``[0, num_levels)``. + + Returns + ------- + OpaqueArray + A non-owning :class:`OpaqueArray` wrapping the level's ``CUarray``. + The :class:`MipmappedArray` is kept alive for the lifetime of the + returned :class:`OpaqueArray`; the underlying storage is released only + when this :class:`MipmappedArray` is destroyed. + """ + lvl = int(level) + if lvl < 0: + raise ValueError(f"level must be >= 0, got {lvl}") + if lvl >= self._num_levels: + raise ValueError( + f"level ({lvl}) must be < num_levels ({self._num_levels})" + ) + + cdef OpaqueArrayHandle h_level = create_array_level_handle(self._handle, lvl) + if not h_level: + HANDLE_RETURN(get_last_error()) + # The returned OpaqueArray is non-owning; its C++ box embeds this mipmap's + # handle, so the parent's storage structurally outlives the level view + # (no Python parent reference needed). + return _array_from_handle(h_level, self._device_id) + + @property + def handle(self): + """The underlying ``CUmipmappedArray`` as an integer.""" + return as_intptr(self._handle) + + @property + def shape(self): + """Base-level (level 0) allocation shape, in elements.""" + return self._shape + + @property + def format(self): + """The element :class:`~cuda.core.typing.ArrayFormatType`.""" + return _CU_TO_ARRAYFORMAT[self._format] + + @property + def num_channels(self): + """Channels per element (1, 2, or 4).""" + return self._num_channels + + @property + def num_levels(self): + """Number of mip levels.""" + return int(self._num_levels) + + @property + def is_surface_load_store(self): + """True if this mipmap (and each of its levels) was created with + ``CUDA_ARRAY3D_SURFACE_LDST`` and can back a :class:`SurfaceObject`.""" + return self._surface_load_store + + @property + def device(self): + """The :class:`Device` this mipmap was allocated on.""" + from cuda.core._device import Device + return Device(self._device_id) + + cpdef close(self): + """Release this object's reference to the underlying ``CUmipmappedArray``. + + Destruction (``cuMipmappedArrayDestroy``) happens via the handle's + deleter when the last reference is dropped. A level :class:`OpaqueArray` + from :meth:`get_level` holds its own reference to this mipmap's storage, + so it stays valid until both it and this object are released. Idempotent. + """ + self._handle.reset() + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc, tb): + self.close() + + def __repr__(self): + return ( + f"MipmappedArray(shape={self._shape}, " + f"format={_CU_TO_ARRAYFORMAT[self._format].name}, " + f"num_channels={self._num_channels}, " + f"num_levels={self._num_levels})" + ) + + +def _create_mipmapped_array(options): + """Allocate a new :class:`MipmappedArray` on the current device. + + Backs :meth:`cuda.core.Device.create_mipmapped_array`. ``options`` is a + :class:`MipmappedArrayOptions` (or a mapping accepted by it); its fields are + validated at construction. + """ + cdef object opts = check_or_create_options( + MipmappedArrayOptions, options, "Mipmapped array options" + ) + shape_t = opts.shape + + cdef cydriver.CUarray_format c_format = _ARRAYFORMAT_TO_CU[opts.format] + cdef cydriver.CUDA_ARRAY3D_DESCRIPTOR desc3d + cdef int rank = len(shape_t) + cdef unsigned int flags = ( + cydriver.CUDA_ARRAY3D_SURFACE_LDST if opts.is_surface_load_store else 0 + ) + cdef unsigned int c_levels = opts.num_levels + + # Mipmap creation uses the 3D descriptor regardless of rank; lower-rank + # shapes use Height=0/Depth=0 sentinels, matching cuArray3DCreate. + memset(&desc3d, 0, sizeof(desc3d)) + desc3d.Width = shape_t[0] + desc3d.Height = (shape_t[1] if rank >= 2 else 0) + desc3d.Depth = (shape_t[2] if rank >= 3 else 0) + desc3d.Format = c_format + desc3d.NumChannels = opts.num_channels + desc3d.Flags = flags + + cdef MipmappedArrayHandle h = create_mipmapped_array_handle(desc3d, c_levels) + if not h: + HANDLE_RETURN(get_last_error()) + + cdef MipmappedArray self = MipmappedArray.__new__(MipmappedArray) + self._handle = h + self._shape = shape_t + self._format = c_format + self._num_channels = opts.num_channels + self._num_levels = opts.num_levels + self._surface_load_store = bool(opts.is_surface_load_store) + self._device_id = _get_current_device_id() + return self diff --git a/cuda_core/cuda/core/texture/_surface.pxd b/cuda_core/cuda/core/texture/_surface.pxd new file mode 100644 index 00000000000..d6702061e79 --- /dev/null +++ b/cuda_core/cuda/core/texture/_surface.pxd @@ -0,0 +1,18 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from cuda.bindings cimport cydriver +from cuda.core._resource_handles cimport SurfObjectHandle + + +cdef class SurfaceObject: + + cdef: + # The backing OpaqueArray is kept alive structurally by the C++ box behind + # this handle, not by _source_ref. + SurfObjectHandle _handle + object _source_ref # ResourceDescriptor, retained for introspection + int _device_id + + cpdef close(self) diff --git a/cuda_core/cuda/core/texture/_surface.pyi b/cuda_core/cuda/core/texture/_surface.pyi new file mode 100644 index 00000000000..977268abd5f --- /dev/null +++ b/cuda_core/cuda/core/texture/_surface.pyi @@ -0,0 +1,62 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/texture/_surface.pyx + +from __future__ import annotations + + +class SurfaceObject: + """A bindless surface handle for kernel-side typed load/store. + + Wraps ``cuSurfObjectCreate``. Unlike a :class:`TextureObject`, a surface + has no sampling state (no filtering, no addressing modes, no normalization); + kernels read and write through it using integer pixel coordinates. + + The backing :class:`OpaqueArray` must have been created with + ``is_surface_load_store=True`` and is kept alive for the lifetime of this + object to prevent dangling handles. + + Construct via :meth:`cuda.core.Device.create_surface_object`. Passes to + kernels as a 64-bit handle (via the ``handle`` property). + + .. versionadded:: 1.1.0 + """ + + def close(self): + """Release this object's reference to the underlying ``CUsurfObject``. + + Destruction (``cuSurfObjectDestroy``) and release of the backing array + happen via the handle's deleter when the last reference is dropped. + Idempotent. + """ + + def __init__(self, *args, **kwargs): + ... + + @property + def handle(self): + """The underlying ``CUsurfObject`` as an integer (64-bit kernel arg).""" + + @property + def resource(self): + """The :class:`ResourceDescriptor` this surface was built from.""" + + @property + def device(self): + ... + + def __enter__(self): + ... + + def __exit__(self, exc_type, exc, tb): + ... + + def __repr__(self): + ... + +def _create_surface_object(resource): + """Create a :class:`SurfaceObject` on the current device. + + Backs :meth:`cuda.core.Device.create_surface_object`. ``resource`` must be a + :class:`ResourceDescriptor` wrapping an :class:`OpaqueArray` allocated with + ``is_surface_load_store=True``; linear/pitch2d resources are not valid + surface backings. + """ \ No newline at end of file diff --git a/cuda_core/cuda/core/texture/_surface.pyx b/cuda_core/cuda/core/texture/_surface.pyx new file mode 100644 index 00000000000..ac61fddd357 --- /dev/null +++ b/cuda_core/cuda/core/texture/_surface.pyx @@ -0,0 +1,122 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from libc.string cimport memset + +from cuda.bindings cimport cydriver +from cuda.core.texture._array cimport OpaqueArray +from cuda.core._resource_handles cimport ( + SurfObjectHandle, + as_cu, + as_intptr, + create_surf_object_handle, + get_last_error, +) +from cuda.core.texture._texture import ResourceDescriptor +from cuda.core._utils.cuda_utils cimport ( + HANDLE_RETURN, + _get_current_device_id, +) + + +cdef class SurfaceObject: + """A bindless surface handle for kernel-side typed load/store. + + Wraps ``cuSurfObjectCreate``. Unlike a :class:`TextureObject`, a surface + has no sampling state (no filtering, no addressing modes, no normalization); + kernels read and write through it using integer pixel coordinates. + + The backing :class:`OpaqueArray` must have been created with + ``is_surface_load_store=True`` and is kept alive for the lifetime of this + object to prevent dangling handles. + + Construct via :meth:`cuda.core.Device.create_surface_object`. Passes to + kernels as a 64-bit handle (via the ``handle`` property). + + .. versionadded:: 1.1.0 + """ + + def __init__(self, *args, **kwargs): + raise RuntimeError( + "SurfaceObject cannot be instantiated directly. " + "Use Device.create_surface_object()." + ) + + @property + def handle(self): + """The underlying ``CUsurfObject`` as an integer (64-bit kernel arg).""" + return as_intptr(self._handle) + + @property + def resource(self): + """The :class:`ResourceDescriptor` this surface was built from.""" + return self._source_ref + + @property + def device(self): + from cuda.core._device import Device + return Device(self._device_id) + + cpdef close(self): + """Release this object's reference to the underlying ``CUsurfObject``. + + Destruction (``cuSurfObjectDestroy``) and release of the backing array + happen via the handle's deleter when the last reference is dropped. + Idempotent. + """ + self._handle.reset() + self._source_ref = None + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc, tb): + self.close() + + def __repr__(self): + return f"SurfaceObject(handle=0x{as_intptr(self._handle):x})" + + +def _create_surface_object(resource): + """Create a :class:`SurfaceObject` on the current device. + + Backs :meth:`cuda.core.Device.create_surface_object`. ``resource`` must be a + :class:`ResourceDescriptor` wrapping an :class:`OpaqueArray` allocated with + ``is_surface_load_store=True``; linear/pitch2d resources are not valid + surface backings. + """ + if not isinstance(resource, ResourceDescriptor): + raise TypeError( + f"resource must be a ResourceDescriptor, got " + f"{type(resource).__name__}" + ) + if resource.kind != "array": + raise ValueError( + f"SurfaceObject requires an array-backed ResourceDescriptor, " + f"got kind={resource.kind!r}" + ) + + cdef OpaqueArray arr = resource.source + if not arr.is_surface_load_store: + raise ValueError( + "OpaqueArray must be created with is_surface_load_store=True to be " + "bound as a SurfaceObject" + ) + + cdef cydriver.CUDA_RESOURCE_DESC res_desc + memset(&res_desc, 0, sizeof(res_desc)) + res_desc.resType = cydriver.CU_RESOURCE_TYPE_ARRAY + res_desc.res.array.hArray = as_cu(arr._handle) + + cdef SurfObjectHandle h = create_surf_object_handle(res_desc, arr._handle) + if not h: + HANDLE_RETURN(get_last_error()) + + cdef SurfaceObject self = SurfaceObject.__new__(SurfaceObject) + self._handle = h + self._source_ref = resource + self._device_id = _get_current_device_id() + return self diff --git a/cuda_core/cuda/core/texture/_texture.pxd b/cuda_core/cuda/core/texture/_texture.pxd new file mode 100644 index 00000000000..6d0871fe848 --- /dev/null +++ b/cuda_core/cuda/core/texture/_texture.pxd @@ -0,0 +1,19 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from cuda.bindings cimport cydriver +from cuda.core._resource_handles cimport TexObjectHandle + + +cdef class TextureObject: + + cdef: + # The backing resource (array / mipmap / device pointer) is kept alive + # structurally by the C++ box behind this handle, not by _source_ref. + TexObjectHandle _handle + object _source_ref # ResourceDescriptor, retained for introspection + object _options # original TextureObjectOptions for introspection + int _device_id + + cpdef close(self) diff --git a/cuda_core/cuda/core/texture/_texture.pyi b/cuda_core/cuda/core/texture/_texture.pyi new file mode 100644 index 00000000000..7840585bb4d --- /dev/null +++ b/cuda_core/cuda/core/texture/_texture.pyi @@ -0,0 +1,257 @@ +# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/texture/_texture.pyx + +from __future__ import annotations + +from dataclasses import dataclass + +from cuda.bindings import cydriver +from cuda.core.typing import AddressModeType, FilterModeType, ReadModeType + + +class ResourceDescriptor: + """Describes the memory backing a :class:`TextureObject`. + + Construct via the ``from_*`` classmethods: + + - :meth:`from_opaque_array` wraps a :class:`OpaqueArray` (works for both + :class:`TextureObject` and :class:`SurfaceObject`). + - :meth:`from_mipmapped_array` wraps a :class:`MipmappedArray` for mipmapped + sampling (texture only, not surface). + - :meth:`from_linear` wraps a :class:`Buffer` as a typed 1D fetch. Texture + objects built from a linear resource do not support filtering, + normalized coordinates, or addressing modes. + - :meth:`from_pitch2d` wraps a :class:`Buffer` as a row-pitched 2D image. + Supports filtering and 2D addressing, but only 2D access. + + Linear and pitch2D resources cannot back a :class:`SurfaceObject` — those + require an :class:`OpaqueArray` allocated with ``is_surface_load_store=True``. + + .. versionadded:: 1.1.0 + """ + __slots__ = ('_kind', '_source', '_format', '_num_channels', '_size_bytes', '_width', '_height', '_pitch_bytes') + + def __init__(self): + ... + + @classmethod + def from_opaque_array(cls, array): + """Build a resource descriptor backed by a :class:`OpaqueArray`.""" + + @classmethod + def from_mipmapped_array(cls, mipmapped_array): + """Build a resource descriptor backed by a :class:`MipmappedArray`. + + Suitable for binding to a :class:`TextureObject` for mipmapped + sampling. Not valid as a :class:`SurfaceObject` backing: surfaces + require a single :class:`OpaqueArray` level (obtain via + :meth:`MipmappedArray.get_level`). + """ + + @classmethod + def from_linear(cls, buffer, *, format, num_channels, size_bytes=None): + """Build a resource descriptor for a linear (typed 1D) texture fetch. + + Parameters + ---------- + buffer : Buffer + Device-memory backing. Must remain alive for the lifetime of any + :class:`TextureObject` built from this descriptor. + format : ArrayFormatType, str, or numpy.dtype + Element format. Accepts an :class:`~cuda.core.typing.ArrayFormatType`, + a plain string (e.g. ``"float32"``), or a NumPy dtype object. + num_channels : int + Channels per element. Must be 1, 2, or 4. + size_bytes : int, optional + Bytes of ``buffer`` to bind. Defaults to ``buffer.size``. Must not + exceed it. + + Notes + ----- + Texture objects built from a linear resource ignore the + :class:`TextureObjectOptions` addressing/filtering fields — kernels read + through a typed 1D fetch with bounds checking only. + """ + + @classmethod + def from_pitch2d(cls, buffer, *, format, num_channels, width, height, pitch_bytes): + """Build a resource descriptor for a row-pitched 2D image. + + Parameters + ---------- + buffer : Buffer + Device-memory backing. Must remain alive for the lifetime of any + :class:`TextureObject` built from this descriptor. + format : ArrayFormatType, str, or numpy.dtype + Element format. Accepts an :class:`~cuda.core.typing.ArrayFormatType`, + a plain string (e.g. ``"float32"``), or a NumPy dtype object. + num_channels : int + Channels per element. Must be 1, 2, or 4. + width : int + Image width, in elements. + height : int + Image height, in rows. + pitch_bytes : int + Distance between consecutive rows, in bytes. Must be at least + ``width * format_size * num_channels`` and meet the driver's + ``CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT``. + """ + + @property + def kind(self): + ... + + @property + def source(self): + ... + + @property + def format(self): + """The element :class:`~cuda.core.typing.ArrayFormatType` (``None`` for array-backed).""" + + @property + def num_channels(self): + """Channels per element (``None`` for array-backed).""" + + @property + def size_bytes(self): + """Bytes bound for a linear resource (``None`` for other kinds).""" + + @property + def width(self): + """Pitch2D image width, in elements (``None`` for other kinds).""" + + @property + def height(self): + """Pitch2D image height, in rows (``None`` for other kinds).""" + + @property + def pitch_bytes(self): + """Pitch2D row pitch, in bytes (``None`` for other kinds).""" + + def __repr__(self): + ... + +@dataclass +class TextureObjectOptions: + """Sampling state for a :class:`TextureObject` (mirrors ``CUDA_TEXTURE_DESC``). + + Attributes + ---------- + address_mode : AddressModeType or tuple of AddressModeType + Boundary behavior per axis. May be a single + :class:`~cuda.core.typing.AddressModeType` (applied to all axes) or a + tuple of 1-3 entries (one per dimension). Plain strings are accepted. + filter_mode : FilterModeType + Texel sampling mode. Default ``POINT``. Plain strings are accepted. + read_mode : ReadModeType + How sampled integer values are returned. Default ``ELEMENT_TYPE``. + Plain strings are accepted. + normalized_coords : bool + If True, coordinates are in ``[0, 1]`` instead of pixel indices. + srgb : bool + If True, perform sRGB → linear conversion on read (8-bit formats only). + disable_trilinear_optimization : bool + If True, request exact trilinear filtering. + seamless_cubemap : bool + If True, enable seamless cubemap edge filtering. + max_anisotropy : int + Maximum anisotropy; 0 disables anisotropic filtering. + mipmap_filter_mode : FilterModeType + Filtering between mipmap levels. Default ``POINT``. Plain strings are + accepted. + mipmap_level_bias : float + min_mipmap_level_clamp : float + max_mipmap_level_clamp : float + border_color : tuple of float or None + 4-tuple used when ``address_mode`` includes ``BORDER``; ``None`` means + zero. + + .. versionadded:: 1.1.0 + """ + address_mode: AddressModeType | str | tuple[AddressModeType | str, ...] = AddressModeType.CLAMP + filter_mode: FilterModeType | str = FilterModeType.POINT + read_mode: ReadModeType | str = ReadModeType.ELEMENT_TYPE + normalized_coords: bool = False + srgb: bool = False + disable_trilinear_optimization: bool = False + seamless_cubemap: bool = False + max_anisotropy: int = 0 + mipmap_filter_mode: FilterModeType | str = FilterModeType.POINT + mipmap_level_bias: float = 0.0 + min_mipmap_level_clamp: float = 0.0 + max_mipmap_level_clamp: float = 0.0 + border_color: tuple[float, ...] | None = None + + def __post_init__(self): + ... + +class TextureObject: + """A bindless texture handle for kernel-side sampled reads. + + Wraps ``cuTexObjectCreate``. The underlying memory resource (e.g. the + :class:`OpaqueArray` referenced by the descriptor) is kept alive for the + lifetime of this object to prevent dangling handles. + + Construct via :meth:`cuda.core.Device.create_texture_object`. Passes to + kernels as a 64-bit handle (via the ``handle`` property). + + .. versionadded:: 1.1.0 + """ + + def close(self): + """Release this object's reference to the underlying ``CUtexObject``. + + Destruction (``cuTexObjectDestroy``) and release of the backing resource + happen via the handle's deleter when the last reference is dropped. + Idempotent. + """ + + def __init__(self, *args, **kwargs): + ... + + @property + def handle(self): + """The underlying ``CUtexObject`` as an integer (64-bit kernel arg).""" + + @property + def resource(self): + """The :class:`ResourceDescriptor` this texture was built from.""" + + @property + def options(self): + """The :class:`TextureObjectOptions` this texture was built from.""" + + @property + def device(self): + ... + + def __enter__(self): + ... + + def __exit__(self, exc_type, exc, tb): + ... + + def __repr__(self): + ... +_TRSF_READ_AS_INTEGER = 1 +_TRSF_NORMALIZED_COORDINATES = 2 +_TRSF_SRGB = 16 +_TRSF_DISABLE_TRILINEAR_OPTIMIZATION = 32 +_TRSF_SEAMLESS_CUBEMAP = 64 +_ADDRESSMODE_TO_CU = {AddressModeType.WRAP: int(cydriver.CU_TR_ADDRESS_MODE_WRAP), AddressModeType.CLAMP: int(cydriver.CU_TR_ADDRESS_MODE_CLAMP), AddressModeType.MIRROR: int(cydriver.CU_TR_ADDRESS_MODE_MIRROR), AddressModeType.BORDER: int(cydriver.CU_TR_ADDRESS_MODE_BORDER)} +_FILTERMODE_TO_CU = {FilterModeType.POINT: int(cydriver.CU_TR_FILTER_MODE_POINT), FilterModeType.LINEAR: int(cydriver.CU_TR_FILTER_MODE_LINEAR)} + +def _normalize_enum(name, value, enum_type): + """Coerce ``value`` to ``enum_type`` (a StrEnum), accepting a plain str.""" + +def _normalize_address_modes(address_mode): + """Return a 3-tuple of :class:`AddressModeType` values from a scalar or + 1-3 tuple. Individual entries may be plain strings.""" + +def _create_texture_object(resource, options): + """Create a :class:`TextureObject` on the current device. + + Backs :meth:`cuda.core.Device.create_texture_object`. ``resource`` is a + :class:`ResourceDescriptor`; ``options`` is a :class:`TextureObjectOptions` + (or a mapping accepted by it). + """ \ No newline at end of file diff --git a/cuda_core/cuda/core/texture/_texture.pyx b/cuda_core/cuda/core/texture/_texture.pyx new file mode 100644 index 00000000000..8d09c727c31 --- /dev/null +++ b/cuda_core/cuda/core/texture/_texture.pyx @@ -0,0 +1,588 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from libc.stdint cimport intptr_t +from libc.string cimport memset + +from cuda.bindings cimport cydriver +from cuda.core.texture._array cimport OpaqueArray +from cuda.core.texture._array import ( + _ARRAYFORMAT_TO_CU, + _CU_TO_ARRAYFORMAT, + _FORMAT_ELEM_SIZE, + _validate_format_channels, +) +from cuda.core._memory._buffer cimport Buffer +from cuda.core.texture._mipmapped_array cimport MipmappedArray +from cuda.core.texture._mipmapped_array import MipmappedArray as _PyMipmappedArray +from cuda.core._resource_handles cimport ( + TexObjectHandle, + as_cu, + as_intptr, + create_tex_object_handle_array, + create_tex_object_handle_linear, + create_tex_object_handle_mipmap, + get_last_error, +) +from cuda.core._utils.cuda_utils cimport ( + HANDLE_RETURN, + _get_current_device_id, +) + +from cuda.core.typing import AddressModeType, FilterModeType, ReadModeType + +from dataclasses import dataclass + +from cuda.core._utils.cuda_utils import check_or_create_options + + +# Driver texture-descriptor flag bits (CU_TRSF_*). +_TRSF_READ_AS_INTEGER = 0x01 +_TRSF_NORMALIZED_COORDINATES = 0x02 +_TRSF_SRGB = 0x10 +_TRSF_DISABLE_TRILINEAR_OPTIMIZATION = 0x20 +_TRSF_SEAMLESS_CUBEMAP = 0x40 + + +# Bridge between the public sampling StrEnums and the driver integer values. +_ADDRESSMODE_TO_CU = { + AddressModeType.WRAP: int(cydriver.CU_TR_ADDRESS_MODE_WRAP), + AddressModeType.CLAMP: int(cydriver.CU_TR_ADDRESS_MODE_CLAMP), + AddressModeType.MIRROR: int(cydriver.CU_TR_ADDRESS_MODE_MIRROR), + AddressModeType.BORDER: int(cydriver.CU_TR_ADDRESS_MODE_BORDER), +} +_FILTERMODE_TO_CU = { + FilterModeType.POINT: int(cydriver.CU_TR_FILTER_MODE_POINT), + FilterModeType.LINEAR: int(cydriver.CU_TR_FILTER_MODE_LINEAR), +} + + +def _normalize_enum(name, value, enum_type): + """Coerce ``value`` to ``enum_type`` (a StrEnum), accepting a plain str.""" + if isinstance(value, enum_type): + return value + try: + return enum_type(value) + except ValueError as e: + valid = ", ".join(repr(m.value) for m in enum_type) + raise ValueError( + f"{name} must be a {enum_type.__name__} or one of {{{valid}}}, got {value!r}" + ) from e + + +class ResourceDescriptor: + """Describes the memory backing a :class:`TextureObject`. + + Construct via the ``from_*`` classmethods: + + - :meth:`from_opaque_array` wraps a :class:`OpaqueArray` (works for both + :class:`TextureObject` and :class:`SurfaceObject`). + - :meth:`from_mipmapped_array` wraps a :class:`MipmappedArray` for mipmapped + sampling (texture only, not surface). + - :meth:`from_linear` wraps a :class:`Buffer` as a typed 1D fetch. Texture + objects built from a linear resource do not support filtering, + normalized coordinates, or addressing modes. + - :meth:`from_pitch2d` wraps a :class:`Buffer` as a row-pitched 2D image. + Supports filtering and 2D addressing, but only 2D access. + + Linear and pitch2D resources cannot back a :class:`SurfaceObject` — those + require an :class:`OpaqueArray` allocated with ``is_surface_load_store=True``. + + .. versionadded:: 1.1.0 + """ + + __slots__ = ( + "_kind", "_source", + "_format", "_num_channels", + "_size_bytes", + "_width", "_height", "_pitch_bytes", + ) + + def __init__(self): + raise RuntimeError( + "ResourceDescriptor cannot be instantiated directly. " + "Use ResourceDescriptor.from_* factories." + ) + + @classmethod + def from_opaque_array(cls, array): + """Build a resource descriptor backed by a :class:`OpaqueArray`.""" + if not isinstance(array, OpaqueArray): + raise TypeError(f"array must be a OpaqueArray, got {type(array).__name__}") + self = cls.__new__(cls) + self._kind = "array" + self._source = array + self._format = None + self._num_channels = None + self._size_bytes = None + self._width = None + self._height = None + self._pitch_bytes = None + return self + + @classmethod + def from_mipmapped_array(cls, mipmapped_array): + """Build a resource descriptor backed by a :class:`MipmappedArray`. + + Suitable for binding to a :class:`TextureObject` for mipmapped + sampling. Not valid as a :class:`SurfaceObject` backing: surfaces + require a single :class:`OpaqueArray` level (obtain via + :meth:`MipmappedArray.get_level`). + """ + if not isinstance(mipmapped_array, _PyMipmappedArray): + raise TypeError( + f"mipmapped_array must be a MipmappedArray, got " + f"{type(mipmapped_array).__name__}" + ) + self = cls.__new__(cls) + self._kind = "mipmapped_array" + self._source = mipmapped_array + self._format = None + self._num_channels = None + self._size_bytes = None + self._width = None + self._height = None + self._pitch_bytes = None + return self + + @classmethod + def from_linear(cls, buffer, *, format, num_channels, size_bytes=None): + """Build a resource descriptor for a linear (typed 1D) texture fetch. + + Parameters + ---------- + buffer : Buffer + Device-memory backing. Must remain alive for the lifetime of any + :class:`TextureObject` built from this descriptor. + format : ArrayFormatType, str, or numpy.dtype + Element format. Accepts an :class:`~cuda.core.typing.ArrayFormatType`, + a plain string (e.g. ``"float32"``), or a NumPy dtype object. + num_channels : int + Channels per element. Must be 1, 2, or 4. + size_bytes : int, optional + Bytes of ``buffer`` to bind. Defaults to ``buffer.size``. Must not + exceed it. + + Notes + ----- + Texture objects built from a linear resource ignore the + :class:`TextureObjectOptions` addressing/filtering fields — kernels read + through a typed 1D fetch with bounds checking only. + """ + if not isinstance(buffer, Buffer): + raise TypeError(f"buffer must be a Buffer, got {type(buffer).__name__}") + fmt = _validate_format_channels(format, num_channels) + cu_format = _ARRAYFORMAT_TO_CU[fmt] + + buf_size = int(buffer.size) + elem = _FORMAT_ELEM_SIZE[cu_format] * int(num_channels) + if size_bytes is None: + size = buf_size + else: + size = int(size_bytes) + if size > buf_size: + raise ValueError( + f"size_bytes ({size}) exceeds buffer.size ({buf_size})" + ) + if size < elem: + raise ValueError( + f"size_bytes ({size}) must be at least one element ({elem} bytes)" + ) + if size % elem != 0: + raise ValueError( + f"size_bytes ({size}) must be a multiple of element size " + f"({elem} bytes for {fmt.name} x {num_channels})" + ) + + self = cls.__new__(cls) + self._kind = "linear" + self._source = buffer + self._format = cu_format + self._num_channels = int(num_channels) + self._size_bytes = size + self._width = None + self._height = None + self._pitch_bytes = None + return self + + @classmethod + def from_pitch2d( + cls, buffer, *, format, num_channels, width, height, pitch_bytes + ): + """Build a resource descriptor for a row-pitched 2D image. + + Parameters + ---------- + buffer : Buffer + Device-memory backing. Must remain alive for the lifetime of any + :class:`TextureObject` built from this descriptor. + format : ArrayFormatType, str, or numpy.dtype + Element format. Accepts an :class:`~cuda.core.typing.ArrayFormatType`, + a plain string (e.g. ``"float32"``), or a NumPy dtype object. + num_channels : int + Channels per element. Must be 1, 2, or 4. + width : int + Image width, in elements. + height : int + Image height, in rows. + pitch_bytes : int + Distance between consecutive rows, in bytes. Must be at least + ``width * format_size * num_channels`` and meet the driver's + ``CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT``. + """ + if not isinstance(buffer, Buffer): + raise TypeError(f"buffer must be a Buffer, got {type(buffer).__name__}") + fmt = _validate_format_channels(format, num_channels) + cu_format = _ARRAYFORMAT_TO_CU[fmt] + + w = int(width) + h = int(height) + p = int(pitch_bytes) + if w < 1: + raise ValueError(f"width must be >= 1, got {w}") + if h < 1: + raise ValueError(f"height must be >= 1, got {h}") + elem = _FORMAT_ELEM_SIZE[cu_format] * int(num_channels) + min_pitch = w * elem + if p < min_pitch: + raise ValueError( + f"pitch_bytes ({p}) must be >= width * element_bytes ({min_pitch})" + ) + if p * h > int(buffer.size): + raise ValueError( + f"pitch_bytes * height ({p * h}) exceeds buffer.size ({int(buffer.size)})" + ) + + self = cls.__new__(cls) + self._kind = "pitch2d" + self._source = buffer + self._format = cu_format + self._num_channels = int(num_channels) + self._size_bytes = None + self._width = w + self._height = h + self._pitch_bytes = p + return self + + @property + def kind(self): + return self._kind + + @property + def source(self): + return self._source + + @property + def format(self): + """The element :class:`~cuda.core.typing.ArrayFormatType` (``None`` for array-backed).""" + return None if self._format is None else _CU_TO_ARRAYFORMAT[self._format] + + @property + def num_channels(self): + """Channels per element (``None`` for array-backed).""" + return self._num_channels + + @property + def size_bytes(self): + """Bytes bound for a linear resource (``None`` for other kinds).""" + return self._size_bytes + + @property + def width(self): + """Pitch2D image width, in elements (``None`` for other kinds).""" + return self._width + + @property + def height(self): + """Pitch2D image height, in rows (``None`` for other kinds).""" + return self._height + + @property + def pitch_bytes(self): + """Pitch2D row pitch, in bytes (``None`` for other kinds).""" + return self._pitch_bytes + + def __repr__(self): + if self._kind == "linear": + return ( + f"ResourceDescriptor(kind='linear', format={self.format.name}, " + f"num_channels={self._num_channels}, size_bytes={self._size_bytes})" + ) + if self._kind == "pitch2d": + return ( + f"ResourceDescriptor(kind='pitch2d', format={self.format.name}, " + f"num_channels={self._num_channels}, " + f"width={self._width}, height={self._height}, " + f"pitch_bytes={self._pitch_bytes})" + ) + return f"ResourceDescriptor(kind={self._kind!r})" + + +@dataclass +class TextureObjectOptions: + """Sampling state for a :class:`TextureObject` (mirrors ``CUDA_TEXTURE_DESC``). + + Attributes + ---------- + address_mode : AddressModeType or tuple of AddressModeType + Boundary behavior per axis. May be a single + :class:`~cuda.core.typing.AddressModeType` (applied to all axes) or a + tuple of 1-3 entries (one per dimension). Plain strings are accepted. + filter_mode : FilterModeType + Texel sampling mode. Default ``POINT``. Plain strings are accepted. + read_mode : ReadModeType + How sampled integer values are returned. Default ``ELEMENT_TYPE``. + Plain strings are accepted. + normalized_coords : bool + If True, coordinates are in ``[0, 1]`` instead of pixel indices. + srgb : bool + If True, perform sRGB → linear conversion on read (8-bit formats only). + disable_trilinear_optimization : bool + If True, request exact trilinear filtering. + seamless_cubemap : bool + If True, enable seamless cubemap edge filtering. + max_anisotropy : int + Maximum anisotropy; 0 disables anisotropic filtering. + mipmap_filter_mode : FilterModeType + Filtering between mipmap levels. Default ``POINT``. Plain strings are + accepted. + mipmap_level_bias : float + min_mipmap_level_clamp : float + max_mipmap_level_clamp : float + border_color : tuple of float or None + 4-tuple used when ``address_mode`` includes ``BORDER``; ``None`` means + zero. + + .. versionadded:: 1.1.0 + """ + + address_mode: AddressModeType | str | tuple[AddressModeType | str, ...] = AddressModeType.CLAMP + filter_mode: FilterModeType | str = FilterModeType.POINT + read_mode: ReadModeType | str = ReadModeType.ELEMENT_TYPE + normalized_coords: bool = False + srgb: bool = False + disable_trilinear_optimization: bool = False + seamless_cubemap: bool = False + max_anisotropy: int = 0 + mipmap_filter_mode: FilterModeType | str = FilterModeType.POINT + mipmap_level_bias: float = 0.0 + min_mipmap_level_clamp: float = 0.0 + max_mipmap_level_clamp: float = 0.0 + border_color: tuple[float, ...] | None = None + + def __post_init__(self): + self.filter_mode = _normalize_enum("filter_mode", self.filter_mode, FilterModeType) + self.read_mode = _normalize_enum("read_mode", self.read_mode, ReadModeType) + self.mipmap_filter_mode = _normalize_enum( + "mipmap_filter_mode", self.mipmap_filter_mode, FilterModeType + ) + + +def _normalize_address_modes(address_mode): + """Return a 3-tuple of :class:`AddressModeType` values from a scalar or + 1-3 tuple. Individual entries may be plain strings.""" + if isinstance(address_mode, (AddressModeType, str)): + m = _normalize_enum("address_mode", address_mode, AddressModeType) + return (m, m, m) + try: + modes = tuple(address_mode) + except TypeError as e: + raise TypeError( + "address_mode must be an AddressModeType or a tuple of AddressModeType" + ) from e + if not 1 <= len(modes) <= 3: + raise ValueError( + f"address_mode tuple must have 1-3 entries, got {len(modes)}" + ) + modes = tuple( + _normalize_enum(f"address_mode[{i}]", m, AddressModeType) + for i, m in enumerate(modes) + ) + # Pad to 3 entries by repeating the last one. + padded = list(modes) + [modes[-1]] * (3 - len(modes)) + return tuple(padded) + + +cdef class TextureObject: + """A bindless texture handle for kernel-side sampled reads. + + Wraps ``cuTexObjectCreate``. The underlying memory resource (e.g. the + :class:`OpaqueArray` referenced by the descriptor) is kept alive for the + lifetime of this object to prevent dangling handles. + + Construct via :meth:`cuda.core.Device.create_texture_object`. Passes to + kernels as a 64-bit handle (via the ``handle`` property). + + .. versionadded:: 1.1.0 + """ + + def __init__(self, *args, **kwargs): + raise RuntimeError( + "TextureObject cannot be instantiated directly. " + "Use Device.create_texture_object()." + ) + + @property + def handle(self): + """The underlying ``CUtexObject`` as an integer (64-bit kernel arg).""" + return as_intptr(self._handle) + + @property + def resource(self): + """The :class:`ResourceDescriptor` this texture was built from.""" + return self._source_ref + + @property + def options(self): + """The :class:`TextureObjectOptions` this texture was built from.""" + return self._options + + @property + def device(self): + from cuda.core._device import Device + return Device(self._device_id) + + cpdef close(self): + """Release this object's reference to the underlying ``CUtexObject``. + + Destruction (``cuTexObjectDestroy``) and release of the backing resource + happen via the handle's deleter when the last reference is dropped. + Idempotent. + """ + self._handle.reset() + self._source_ref = None + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc, tb): + self.close() + + def __repr__(self): + return f"TextureObject(handle=0x{as_intptr(self._handle):x})" + + +def _create_texture_object(resource, options): + """Create a :class:`TextureObject` on the current device. + + Backs :meth:`cuda.core.Device.create_texture_object`. ``resource`` is a + :class:`ResourceDescriptor`; ``options`` is a :class:`TextureObjectOptions` + (or a mapping accepted by it). + """ + if not isinstance(resource, ResourceDescriptor): + raise TypeError( + f"resource must be a ResourceDescriptor, got " + f"{type(resource).__name__}" + ) + cdef object opts = check_or_create_options( + TextureObjectOptions, options, "Texture object options" + ) + + cdef cydriver.CUDA_RESOURCE_DESC res_desc + cdef cydriver.CUDA_TEXTURE_DESC tex_desc + memset(&res_desc, 0, sizeof(res_desc)) + memset(&tex_desc, 0, sizeof(tex_desc)) + + # --- Resource descriptor --- + cdef OpaqueArray arr + cdef MipmappedArray mip + cdef Buffer buf + cdef intptr_t devptr + if resource.kind == "array": + arr = resource.source + res_desc.resType = cydriver.CU_RESOURCE_TYPE_ARRAY + res_desc.res.array.hArray = as_cu(arr._handle) + elif resource.kind == "mipmapped_array": + mip = resource.source + res_desc.resType = cydriver.CU_RESOURCE_TYPE_MIPMAPPED_ARRAY + res_desc.res.mipmap.hMipmappedArray = as_cu(mip._handle) + elif resource.kind == "linear": + buf = resource.source + devptr = int(buf.handle) + res_desc.resType = cydriver.CU_RESOURCE_TYPE_LINEAR + res_desc.res.linear.devPtr = devptr + res_desc.res.linear.format = resource._format + res_desc.res.linear.numChannels = resource._num_channels + res_desc.res.linear.sizeInBytes = resource._size_bytes + elif resource.kind == "pitch2d": + buf = resource.source + devptr = int(buf.handle) + res_desc.resType = cydriver.CU_RESOURCE_TYPE_PITCH2D + res_desc.res.pitch2D.devPtr = devptr + res_desc.res.pitch2D.format = resource._format + res_desc.res.pitch2D.numChannels = resource._num_channels + res_desc.res.pitch2D.width = resource._width + res_desc.res.pitch2D.height = resource._height + res_desc.res.pitch2D.pitchInBytes = resource._pitch_bytes + else: + raise NotImplementedError( + f"ResourceDescriptor kind {resource.kind!r} is not yet supported" + ) + + # --- Texture descriptor --- + # filter_mode/read_mode/mipmap_filter_mode are normalized to their + # StrEnum types by TextureObjectOptions.__post_init__; address_mode is + # normalized (and str-coerced) here. + modes = _normalize_address_modes(opts.address_mode) + tex_desc.addressMode[0] = _ADDRESSMODE_TO_CU[modes[0]] + tex_desc.addressMode[1] = _ADDRESSMODE_TO_CU[modes[1]] + tex_desc.addressMode[2] = _ADDRESSMODE_TO_CU[modes[2]] + + tex_desc.filterMode = _FILTERMODE_TO_CU[opts.filter_mode] + + cdef unsigned int flags = 0 + # CU_TRSF_READ_AS_INTEGER suppresses normalization, so it maps to + # ReadModeType.ELEMENT_TYPE. + if opts.read_mode == ReadModeType.ELEMENT_TYPE: + flags |= _TRSF_READ_AS_INTEGER + if opts.normalized_coords: + flags |= _TRSF_NORMALIZED_COORDINATES + if opts.srgb: + flags |= _TRSF_SRGB + if opts.disable_trilinear_optimization: + flags |= _TRSF_DISABLE_TRILINEAR_OPTIMIZATION + if opts.seamless_cubemap: + flags |= _TRSF_SEAMLESS_CUBEMAP + tex_desc.flags = flags + + if opts.max_anisotropy < 0: + raise ValueError("max_anisotropy must be >= 0") + tex_desc.maxAnisotropy = opts.max_anisotropy + + tex_desc.mipmapFilterMode = _FILTERMODE_TO_CU[opts.mipmap_filter_mode] + tex_desc.mipmapLevelBias = opts.mipmap_level_bias + tex_desc.minMipmapLevelClamp = opts.min_mipmap_level_clamp + tex_desc.maxMipmapLevelClamp = opts.max_mipmap_level_clamp + + cdef int i + if opts.border_color is None: + for i in range(4): + tex_desc.borderColor[i] = 0.0 + else: + bc = tuple(opts.border_color) + if len(bc) != 4: + raise ValueError( + f"border_color must have 4 elements, got {len(bc)}" + ) + for i in range(4): + tex_desc.borderColor[i] = bc[i] + + cdef TexObjectHandle h + if resource.kind == "array": + h = create_tex_object_handle_array(res_desc, tex_desc, arr._handle) + elif resource.kind == "mipmapped_array": + h = create_tex_object_handle_mipmap(res_desc, tex_desc, mip._handle) + else: # linear or pitch2d — both backed by a device Buffer + h = create_tex_object_handle_linear(res_desc, tex_desc, buf._h_ptr) + if not h: + HANDLE_RETURN(get_last_error()) + + cdef TextureObject self = TextureObject.__new__(TextureObject) + self._handle = h + self._source_ref = resource + self._options = opts + self._device_id = _get_current_device_id() + return self diff --git a/cuda_core/cuda/core/typing.py b/cuda_core/cuda/core/typing.py new file mode 100644 index 00000000000..1bf9bb7c0d2 --- /dev/null +++ b/cuda_core/cuda/core/typing.py @@ -0,0 +1,315 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +"""Public type aliases, protocols, and enumerations used in cuda.core API signatures.""" + +import sys +from typing import TYPE_CHECKING +from typing import Literal as _Literal +from typing import TypeAlias as _TypeAlias + +if TYPE_CHECKING: + # `backports.strenum` ships no type stubs and typeshed conditionally gates + # `enum.StrEnum` behind `sys.version_info >= (3, 11)`. Declaring a minimal + # local shape here (mirroring typeshed's 3.11 StrEnum) lets mypy at + # `python_version = "3.10"` infer subclass members as `Literal[Foo.MEMBER]` + # rather than bare `str`. + from enum import Enum + + class StrEnum(str, Enum): + _value_: str + + +if not TYPE_CHECKING: + if sys.version_info >= (3, 11): + from enum import StrEnum + else: + from backports.strenum import StrEnum + +from cuda.core._context import DeviceResourcesType +from cuda.core._stream import IsStreamType +from cuda.core._utils.cuda_utils import driver + +__all__ = [ + "AddressModeType", + "ArrayFormatType", + "CompilerBackendType", + "DevicePointerType", + "DeviceResourcesType", + "FilterModeType", + "GraphConditionalType", + "GraphMemoryType", + "IsStreamType", + "ManagedMemoryLocationType", + "ObjectCodeFormatType", + "PCHStatusType", + "ProcessStateType", + "ReadModeType", + "SourceCodeType", + "VirtualMemoryAccessType", + "VirtualMemoryAllocationType", + "VirtualMemoryGranularityType", + "VirtualMemoryHandleType", + "VirtualMemoryLocationType", + "WorkqueueSharingScopeType", +] + + +# A type union of :obj:`~driver.CUdeviceptr`, `int` and `None` for hinting +# :attr:`Buffer.handle`. +DevicePointerType: _TypeAlias = driver.CUdeviceptr | int | None + + +ProcessStateType = _Literal["running", "locked", "checkpointed", "failed"] + + +class SourceCodeType(StrEnum): + """Source language passed to :class:`~cuda.core.Program`. + + * ``CXX`` — CUDA C++ source. + * ``PTX`` — PTX assembly text. + * ``NVVM`` — NVVM IR (LLVM bitcode). + """ + + CXX = "c++" + PTX = "ptx" + NVVM = "nvvm" + + +class ObjectCodeFormatType(StrEnum): + """Output format for :meth:`~cuda.core.Program.compile`, :meth:`~cuda.core.Linker.link`, and :meth:`~cuda.core.Program.as_bytes`. + + * ``PTX`` — PTX assembly text. + * ``CUBIN`` — device-native CUDA binary. + * ``LTOIR`` — LTO (link-time optimization) IR for later linking. + * ``FATBIN`` — fat binary bundling multiple device images. + * ``OBJECT`` — relocatable device object. + * ``LIBRARY`` — device code library. + """ + + PTX = "ptx" + CUBIN = "cubin" + LTOIR = "ltoir" + FATBIN = "fatbin" + OBJECT = "object" + LIBRARY = "library" + + +class CompilerBackendType(StrEnum): + """Compiler backend inferred from the program's code type and exposed on :attr:`~cuda.core.Program.backend`. + + * ``NVRTC`` — NVIDIA Runtime Compilation. + * ``NVVM`` — NVVM LLVM backend. + * ``NVJITLINK`` — nvJitLink device-side linker. + * ``DRIVER`` — CUDA driver PTX JIT compiler. + """ + + NVRTC = "NVRTC" + NVVM = "NVVM" + NVJITLINK = "nvJitLink" + DRIVER = "driver" + + +class PCHStatusType(StrEnum): + """Precompiled-header (PCH) outcome reported by :meth:`~cuda.core.Program.compile`. + + * ``CREATED`` — PCH was successfully written. + * ``NOT_ATTEMPTED`` — PCH creation was skipped (backend does not support it or the option was not requested). + * ``FAILED`` — PCH creation was attempted but failed. + """ + + CREATED = "created" + NOT_ATTEMPTED = "not_attempted" + FAILED = "failed" + + +class GraphConditionalType(StrEnum): + """Conditional node flavor for :class:`~cuda.core.graph.GraphBuilder`. + + * ``IF`` — body graph executes at most once based on a condition. + * ``WHILE`` — body graph loops while the condition is true. + * ``SWITCH`` — selects one child graph by an integer index. + """ + + IF = "if" + WHILE = "while" + SWITCH = "switch" + + +class GraphMemoryType(StrEnum): + """Memory space for a graph memory-allocation or free node. + + * ``DEVICE`` — GPU device memory. + * ``HOST`` — pinned host memory. + * ``MANAGED`` — CUDA managed (unified) memory. + """ + + DEVICE = "device" + HOST = "host" + MANAGED = "managed" + + +class ManagedMemoryLocationType(StrEnum): + """Destination type for managed-memory prefetch and advise operations. + + * ``DEVICE`` — target a GPU device. + * ``HOST`` — target the CPU host (any NUMA node). + * ``HOST_NUMA`` — target a specific host NUMA node. + """ + + DEVICE = "device" + HOST = "host" + HOST_NUMA = "host_numa" + + +class VirtualMemoryHandleType(StrEnum): + """OS handle type for exporting virtual memory allocations across processes. + + * ``POSIX_FD`` — POSIX file descriptor (Linux). + * ``WIN32_KMT`` — Win32 kernel-mode handle (Windows). + * ``FABRIC`` — NVLink/NVSwitch fabric handle for multi-node topologies. + """ + + POSIX_FD = "posix_fd" + WIN32_KMT = "win32_kmt" + FABRIC = "fabric" + + +class VirtualMemoryLocationType(StrEnum): + """Physical backing location for a virtual memory allocation. + + * ``DEVICE`` — GPU device memory. + * ``HOST`` — pinned host memory. + * ``HOST_NUMA`` — host memory pinned to a specific NUMA node. + * ``HOST_NUMA_CURRENT`` — host memory on the calling thread's NUMA node. + """ + + DEVICE = "device" + HOST = "host" + HOST_NUMA = "host_numa" + HOST_NUMA_CURRENT = "host_numa_current" + + +class VirtualMemoryGranularityType(StrEnum): + """Granularity query type for virtual memory allocations. + + * ``MINIMUM`` — smallest allocation size supported by the device. + * ``RECOMMENDED`` — granularity that yields best performance on the device. + """ + + MINIMUM = "minimum" + RECOMMENDED = "recommended" + + +class VirtualMemoryAccessType(StrEnum): + """Access permissions for a virtual memory mapping. + + * ``READ_WRITE`` — both read and write access. + * ``READ`` — read-only access. + """ + + READ_WRITE = "rw" + READ = "r" + + +class VirtualMemoryAllocationType(StrEnum): + """Physical memory type for a virtual memory backing allocation. + + * ``PINNED`` — pinned/non-migratable physical allocation (placement via :class:`VirtualMemoryLocationType`). + * ``MANAGED`` — CUDA managed (unified) memory (CUDA 13+ only). + """ + + PINNED = "pinned" + MANAGED = "managed" + + +class ArrayFormatType(StrEnum): + """Element format for an :class:`~cuda.core.texture.OpaqueArray` allocation. + + Corresponds to ``CUarray_format`` from the CUDA driver API. Each value maps + 1:1 to a NumPy dtype; the enum is retained as an explicit escape hatch. + + * ``UINT8`` / ``UINT16`` / ``UINT32`` — unsigned integer elements. + * ``INT8`` / ``INT16`` / ``INT32`` — signed integer elements. + * ``FLOAT16`` / ``FLOAT32`` — half- and single-precision float elements. + + .. versionadded:: 1.1.0 + """ + + UINT8 = "uint8" + UINT16 = "uint16" + UINT32 = "uint32" + INT8 = "int8" + INT16 = "int16" + INT32 = "int32" + FLOAT16 = "float16" + FLOAT32 = "float32" + + +class AddressModeType(StrEnum): + """Boundary behavior for out-of-range texture coordinates. + + Corresponds to ``CUaddress_mode`` from the CUDA driver API. + + * ``WRAP`` — wrap coordinates around (tiling). + * ``CLAMP`` — clamp to the edge texel. + * ``MIRROR`` — reflect coordinates at the boundary. + * ``BORDER`` — return the configured border color. + + .. versionadded:: 1.1.0 + """ + + WRAP = "wrap" + CLAMP = "clamp" + MIRROR = "mirror" + BORDER = "border" + + +class FilterModeType(StrEnum): + """Texel sampling mode for a :class:`~cuda.core.texture.TextureObject`. + + Corresponds to ``CUfilter_mode`` from the CUDA driver API. + + * ``POINT`` — nearest-texel sampling. + * ``LINEAR`` — (bi/tri)linear interpolation. + + .. versionadded:: 1.1.0 + """ + + POINT = "point" + LINEAR = "linear" + + +class ReadModeType(StrEnum): + """How sampled values are returned to the kernel. + + * ``ELEMENT_TYPE`` — return the raw element value (integer formats stay + integer, float stays float). + * ``NORMALIZED_FLOAT`` — integer formats are promoted to a normalized + ``float`` in ``[0, 1]`` (unsigned) or ``[-1, 1]`` (signed). Float + formats are unaffected. + + .. versionadded:: 1.1.0 + """ + + ELEMENT_TYPE = "element_type" + NORMALIZED_FLOAT = "normalized_float" + + +class WorkqueueSharingScopeType(StrEnum): + """Sharing scope for :class:`~cuda.core.WorkqueueResource`. + + * ``DEVICE_CTX`` — use all shared workqueue resources across all + contexts (default driver behavior). + * ``GREEN_CTX_BALANCED`` — when possible, use non-overlapping + workqueue resources with other balanced green contexts. + + .. versionadded:: 1.1.0 + """ + + DEVICE_CTX = "device_ctx" + GREEN_CTX_BALANCED = "green_ctx_balanced" + + +del StrEnum diff --git a/cuda_core/cuda/core/utils.py b/cuda_core/cuda/core/utils.py deleted file mode 100644 index f15d9242778..00000000000 --- a/cuda_core/cuda/core/utils.py +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# -# SPDX-License-Identifier: Apache-2.0 - -from cuda.core._memoryview import ( - StridedMemoryView, # noqa: F401 - args_viewable_as_strided_memory, # noqa: F401 -) diff --git a/cuda_core/cuda/core/utils/__init__.py b/cuda_core/cuda/core/utils/__init__.py new file mode 100644 index 00000000000..93a4c14c083 --- /dev/null +++ b/cuda_core/cuda/core/utils/__init__.py @@ -0,0 +1,31 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from cuda.core._memory._managed_memory_ops import ( + discard_batch, + discard_prefetch_batch, + prefetch_batch, +) +from cuda.core._memoryview import ( + StridedMemoryView, + args_viewable_as_strided_memory, +) +from cuda.core.utils._program_cache import ( + FileStreamProgramCache, + InMemoryProgramCache, + ProgramCacheResource, + make_program_cache_key, +) + +__all__ = [ + "FileStreamProgramCache", + "InMemoryProgramCache", + "ProgramCacheResource", + "StridedMemoryView", + "args_viewable_as_strided_memory", + "discard_batch", + "discard_prefetch_batch", + "make_program_cache_key", + "prefetch_batch", +] diff --git a/cuda_core/cuda/core/utils/_program_cache/__init__.py b/cuda_core/cuda/core/utils/_program_cache/__init__.py new file mode 100644 index 00000000000..a233ad31ad5 --- /dev/null +++ b/cuda_core/cuda/core/utils/_program_cache/__init__.py @@ -0,0 +1,36 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +"""Persistent program cache for cuda.core. + +Public surface: + +* :class:`ProgramCacheResource` -- bytes-in / bytes-out ABC. +* :class:`InMemoryProgramCache` -- thread-safe LRU dict-backed cache. +* :class:`FileStreamProgramCache` -- atomic, multi-process directory cache. +* :func:`make_program_cache_key` -- key derivation for arbitrary + ``Program`` configurations. + +The package is split into submodules by concern. Tests that need to +monkeypatch internals (Windows flag, version probes, helpers, ...) +should reach into the owning submodule (e.g. +``_program_cache._file_stream._IS_WINDOWS``, +``_program_cache._keys._linker_backend_and_version``) rather than the +package object: the symbols re-exported here are only convenience +aliases and don't intercept calls within the submodules. +""" + +from __future__ import annotations + +from ._abc import ProgramCacheResource +from ._file_stream import FileStreamProgramCache +from ._in_memory import InMemoryProgramCache +from ._keys import make_program_cache_key + +__all__ = [ + "FileStreamProgramCache", + "InMemoryProgramCache", + "ProgramCacheResource", + "make_program_cache_key", +] diff --git a/cuda_core/cuda/core/utils/_program_cache/_abc.py b/cuda_core/cuda/core/utils/_program_cache/_abc.py new file mode 100644 index 00000000000..82233540eb3 --- /dev/null +++ b/cuda_core/cuda/core/utils/_program_cache/_abc.py @@ -0,0 +1,204 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +"""Abstract base class and value-coercion helpers shared by every cache backend.""" + +from __future__ import annotations + +import abc +import collections.abc +from pathlib import Path + +from cuda.core._module import ObjectCode + + +def _extract_bytes(value: object) -> bytes: + """Return the raw binary bytes to store on disk. + + Accepts ``bytes``, ``bytearray``, ``memoryview``, or any + :class:`ObjectCode`. Path-backed ``ObjectCode`` (created via + ``ObjectCode.from_cubin('/path')`` etc.) is read from the filesystem + at write time so the cached entry is the binary content itself, not + a path that could later be moved or modified. + """ + if isinstance(value, (bytes, bytearray, memoryview)): + return bytes(value) + if isinstance(value, ObjectCode): + code = value.code + if isinstance(code, str): + try: + return Path(code).read_bytes() + except FileNotFoundError: + # Avoid ``{code!r}``: on Windows it doubles every backslash in + # the path, which breaks naive ``str(path) in str(exc)`` checks + # callers (and tests) write against the raw filesystem string. + raise FileNotFoundError( + f"cannot store path-backed ObjectCode in cache: {code} no longer exists" + ) from None + return bytes(code) + raise TypeError(f"cache values must be bytes-like or ObjectCode, got {type(value).__name__}") + + +def _as_key_bytes(key: object) -> bytes: + if isinstance(key, (bytes, bytearray)): + return bytes(key) + if isinstance(key, str): + return key.encode("utf-8") + raise TypeError(f"cache keys must be bytes or str, got {type(key).__name__}") + + +class ProgramCacheResource(abc.ABC): + """Abstract base class for compiled-program caches. + + Concrete implementations store and retrieve **raw binary bytes** keyed + by ``bytes`` or ``str``. A ``str`` key is encoded as UTF-8 before + being used, so ``"k"`` and ``b"k"`` refer to the same entry. A typical + key is produced by :func:`make_program_cache_key`, which returns + ``bytes``. + + The values written are the compiled program bytes themselves -- + cubin, PTX, LTO-IR, etc. Reads return raw bytes so cache files + remain consumable by external NVIDIA tools (``cuobjdump``, + ``nvdisasm``, ``cuda-gdb``, ...). + + Most callers don't interact with this object directly. The + recommended usage is :meth:`cuda.core.Program.compile`'s ``cache=`` + keyword, which derives the key, returns a fresh + :class:`~cuda.core.ObjectCode` on hit, and stores the compile + result on miss:: + + with FileStreamProgramCache() as cache: + obj = program.compile("cubin", cache=cache) + + The escape hatch -- only needed when the compile inputs require an + ``extra_digest`` (header / PCH content fingerprints, NVVM + libdevice) -- is to call :func:`make_program_cache_key` yourself + and use the cache as a plain ``bytes`` mapping:: + + from cuda.core import ObjectCode + + key = make_program_cache_key( + code=source, + code_type="c++", + options=options, + target_type="cubin", + extra_digest=header_fingerprint(), + ) + data = cache.get(key) + if data is None: + obj = program.compile("cubin") + cache[key] = obj # extracts bytes(obj.code) + else: + obj = ObjectCode.from_cubin(data) + + The cache layer does no payload validation; bytes go in and come + back out unchanged. Symbol-mapping metadata that + :class:`~cuda.core.ObjectCode` carries when produced with NVRTC + name expressions is **not** preserved across a cache round-trip -- + the binary alone is stored. Callers that need ``symbol_mapping`` + for ``get_kernel(name_expression)`` should compile fresh, or look + the mangled symbol up by hand. + + .. note:: **Concurrent-access idiom.** + + Use :meth:`get` (or ``data = cache[key]`` inside a ``try / + except KeyError``) for lookups. There is intentionally no + ``__contains__``: the obvious ``if key in cache: data = + cache[key]`` idiom is racy across processes (another writer + can ``os.replace`` over the entry, or eviction can unlink + it, between the check and the read), and exposing + ``__contains__`` invites that pattern. ``get`` answers + both questions in one filesystem-level operation, so a + successful return always carries the bytes. + """ + + @abc.abstractmethod + def __getitem__(self, key: bytes | str) -> bytes: + """Retrieve the cached binary bytes. + + Raises + ------ + KeyError + If ``key`` is not in the cache. + """ + + @abc.abstractmethod + def __setitem__(self, key: bytes | str, value: bytes | bytearray | memoryview | ObjectCode) -> None: + """Store ``value`` under ``key``. + + Path-backed :class:`~cuda.core.ObjectCode` is read from disk at + write time so the cached entry holds the bytes, not a path. + """ + + @abc.abstractmethod + def __delitem__(self, key: bytes | str) -> None: + """Remove the entry associated with ``key``. + + Raises + ------ + KeyError + If ``key`` is not in the cache. + """ + + @abc.abstractmethod + def __len__(self) -> int: + """Return the number of entries currently in the cache. + + Implementations that store entries on disk by hashed key may + count orphaned files (entries from a previous + ``_KEY_SCHEMA_VERSION`` that are still on disk but no longer + reachable by post-bump lookups) until eviction reaps them. + Callers that need an exact count of live entries should not + rely on ``__len__`` across schema bumps. + """ + + @abc.abstractmethod + def clear(self) -> None: + """Remove every entry from the cache.""" + + def get(self, key: bytes | str, default: bytes | None = None) -> bytes | None: + """Return ``self[key]`` or ``default`` if absent.""" + try: + return self[key] + except KeyError: + return default + + def update( + self, + items: ( + collections.abc.Mapping[bytes | str, bytes | bytearray | memoryview | ObjectCode] + | collections.abc.Iterable[tuple[bytes | str, bytes | bytearray | memoryview | ObjectCode]] + ), + /, + ) -> None: + """Bulk ``__setitem__``. + + Accepts a mapping or an iterable of ``(key, value)`` pairs. Each + write goes through ``__setitem__`` so backend-specific value + coercion (e.g. extracting bytes from an :class:`~cuda.core.ObjectCode`) + and size-cap enforcement run on every entry. Not transactional -- + a failure mid-iteration leaves earlier writes committed. + """ + if isinstance(items, collections.abc.Mapping): + items = items.items() + for key, value in items: + self[key] = value + + def close(self) -> None: # noqa: B027 + """Release backend resources. + + The default implementation does nothing. Subclasses that hold + long-lived state (open file handles, database connections, + network sockets, ...) should override this to release them. + + Callers should use the context-manager form (``with cache:``) + or call :meth:`close` explicitly when finished, so code stays + portable across backends that do hold resources. + """ + + def __enter__(self) -> ProgramCacheResource: + return self + + def __exit__(self, exc_type, exc_value, traceback) -> None: + self.close() diff --git a/cuda_core/cuda/core/utils/_program_cache/_file_stream.py b/cuda_core/cuda/core/utils/_program_cache/_file_stream.py new file mode 100644 index 00000000000..1e22a739ae0 --- /dev/null +++ b/cuda_core/cuda/core/utils/_program_cache/_file_stream.py @@ -0,0 +1,759 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +"""On-disk bytes-in / bytes-out program cache. + +Atomic writes via :func:`os.replace`. Concurrent readers see either the +old entry or the new one, never a partial file. Each entry is the raw +compiled binary so files are directly consumable by external NVIDIA +tools (``cuobjdump``, ``nvdisasm``, ``cuda-gdb``). +""" + +from __future__ import annotations + +import contextlib +import errno +import hashlib +import os +import tempfile +import threading +import time +from pathlib import Path +from typing import Any, Callable, Iterable + +from cuda.core._module import ObjectCode + +from ._abc import ProgramCacheResource, _as_key_bytes, _extract_bytes + +_ENTRIES_SUBDIR = "entries" +_TMP_SUBDIR = "tmp" +# Temp files older than this are assumed to belong to a crashed writer and +# are eligible for cleanup. Picked large enough that no real ``os.replace`` +# write should still be in flight (writes are bounded by mkstemp + write + +# fsync + replace, all fast on healthy disks). +_TMP_STALE_AGE_SECONDS = 3600 + + +_SHARING_VIOLATION_WINERRORS = (5, 32, 33) # ERROR_ACCESS_DENIED, ERROR_SHARING_VIOLATION, ERROR_LOCK_VIOLATION +_REPLACE_RETRY_DELAYS = (0.0, 0.005, 0.010, 0.020, 0.050, 0.100) # ~185ms budget + + +# Exposed as a module-level flag so tests can toggle it without monkeypatching +# ``os.name`` itself (pathlib reads ``os.name`` at instantiation time). +_IS_WINDOWS = os.name == "nt" + + +def _stat_key(st: os.stat_result) -> tuple[int, int, int]: + """Stat fingerprint used by every stat-guarded path. + + ``(st_ino, st_size, st_mtime_ns)`` is the smallest triple that + distinguishes "same file" from "file replaced under us": ``st_ino`` + catches replacement, ``st_size`` and ``st_mtime_ns`` catch a write + that happens to land on the same inode (e.g. truncate-and-write in + place). Centralised so all four readers compare the same fields. + """ + return (st.st_ino, st.st_size, st.st_mtime_ns) + + +def _default_cache_dir() -> Path: + """OS-conventional default location for the file-stream cache. + + Resolves to the user-cache root for the calling user, with a + ``program-cache`` leaf so future tooling can place sibling caches + under the same ``cuda-python`` vendor directory: + + * Linux: ``$XDG_CACHE_HOME/cuda-python/program-cache`` + (default ``~/.cache/cuda-python/program-cache`` per the XDG Base + Directory spec). + * Windows: ``%LOCALAPPDATA%\\cuda-python\\program-cache`` + (Windows uses local AppData -- caches don't roam; falls back to + ``~/AppData/Local`` if the env var is unset). + + CUDA does not support macOS, so no macOS branch is provided. + """ + if _IS_WINDOWS: + local_app_data = os.environ.get("LOCALAPPDATA") + root = Path(local_app_data) if local_app_data else Path.home() / "AppData" / "Local" + else: + xdg = os.environ.get("XDG_CACHE_HOME") + root = Path(xdg) if xdg else Path.home() / ".cache" + return root / "cuda-python" / "program-cache" + + +def _with_sharing_retry( + op: Callable[..., Any], *args: Any, on_exhausted: Callable[..., Any] | None = None, **kwargs: Any +) -> Any: + """Run ``op(*args, **kwargs)`` retrying transient Windows sharing + violations under the bounded ``_REPLACE_RETRY_DELAYS`` budget. + + On Windows, ``os.replace``/``read_bytes``/``unlink`` can surface + winerror 5/32/33 (or bare EACCES via ``_is_windows_sharing_violation``) + while another process briefly holds the file open without share-delete + rights. The retry hides that contention. Other ``PermissionError``s + (real ACLs, unexpected winerror) propagate immediately. + + Successful returns and any non-``PermissionError`` exceptions + (including ``FileNotFoundError``) bubble up unchanged. After the + budget is exhausted, the helper either calls ``on_exhausted(last_exc)`` + if provided, or re-raises the last sharing-violation exception. + """ + last_exc: PermissionError | None = None + for delay in _REPLACE_RETRY_DELAYS: + if delay: + time.sleep(delay) + try: + return op(*args, **kwargs) + except PermissionError as exc: + if not _is_windows_sharing_violation(exc): + raise + last_exc = exc + if on_exhausted is not None: + return on_exhausted(last_exc) + assert last_exc is not None # at least one iteration ran and caught a PermissionError + raise last_exc + + +def _replace_with_sharing_retry(tmp_path: Path, target: Path) -> bool: + """Atomic rename with Windows-specific retry on sharing/lock violations. + + Returns True on success. Returns False only after the retry budget is + exhausted on Windows with a genuine sharing violation -- the caller then + treats the cache write as dropped. Any other ``PermissionError`` (ACLs, + read-only dir, unexpected winerror, or any POSIX failure) propagates. + + ``ERROR_ACCESS_DENIED`` (winerror 5) is treated as a sharing violation + because Windows surfaces it when a file is held open without + ``FILE_SHARE_WRITE`` (Python's default for ``open(p, "wb")``) or while + a previous unlink is in ``PENDING_DELETE`` -- both are transient. + """ + + def _do_replace() -> bool: + os.replace(tmp_path, target) + return True + + return bool(_with_sharing_retry(_do_replace, on_exhausted=lambda _exc: False)) + + +def _stat_and_read_with_sharing_retry(path: Path) -> tuple[os.stat_result, bytes]: + """Snapshot stat and read bytes, retrying briefly on Windows transient + sharing-violation ``PermissionError``. + + Reads race the rewriter's ``os.replace``: on Windows, the destination + can be momentarily inaccessible (winerror 5/32/33) while the rename + completes. Mirroring ``_replace_with_sharing_retry``'s budget keeps + transient contention from being mistaken for a real read failure. + + Raises ``FileNotFoundError`` on miss or after exhausting the Windows + sharing-retry budget. Non-Windows ``PermissionError`` propagates. + + On Windows, EACCES (errno 13) is treated as transient too: ``io.open`` + sometimes surfaces a pending-delete or share-mode mismatch as bare + EACCES with no ``winerror`` attribute, indistinguishable here from + a true sharing violation. Real ACL problems on a path the cache owns + would surface consistently; the bounded retry budget keeps the cost + of treating them as transient negligible. + """ + + def _do_stat_and_read() -> tuple[os.stat_result, bytes]: + return path.stat(), path.read_bytes() + + def _exhausted(last_exc: PermissionError) -> None: + raise FileNotFoundError(path) from last_exc + + return _with_sharing_retry(_do_stat_and_read, on_exhausted=_exhausted) # type: ignore[no-any-return] + + +_UTIME_SUPPORTS_FD = os.utime in os.supports_fd + + +def _touch_atime(path: Path, st_before: os.stat_result) -> None: + """Bump ``path``'s atime to "now", preserving its mtime, iff the + file's stat still matches ``st_before``. + + Eviction sorts by ``st_atime`` so reads must reliably refresh atime + regardless of OS or filesystem default behavior: + + * Linux ``relatime`` (default) only updates atime when the existing + atime is older than mtime, which would skew LRU once an entry has + been read once. + * NTFS on Windows Vista+ disables atime updates by default + (``NtfsDisableLastAccessUpdate``) and most modern installations + keep that off, so a bare read never bumps atime. + * ``noatime``-mounted filesystems disable updates entirely. + + Calling ``os.utime`` with explicit times bypasses all of the above + and writes atime directly. The stat-guard is critical: if another + process ``os.replace``-d a fresh entry into ``path`` between the + read and this touch, blindly applying ``st_before.st_mtime_ns`` + would roll the new entry's mtime back to the old value and confuse + the eviction stat-guard (which checks ``(ino, size, mtime_ns)``) + into deleting a freshly-committed file. + + Where ``os.utime`` supports file descriptors (Linux, macOS), the + fstat-then-utime pair runs against the same open fd: even if another + writer replaces the path between our ``os.open`` and the ``fstat``, + the fd still refers to the file we opened, so the comparison and the + utime both target the same inode. This closes the residual TOCTOU + window that a path-based stat + path-based utime would have. + + On Windows, ``os.utime`` is path-only; the fallback re-stats the + path and accepts a small TOCTOU window between the second stat and + the utime. That window is microseconds and the worst-case outcome + is the racing writer's mtime being rolled back by a few hundred + nanoseconds -- the eviction stat-guard would then refuse to evict + the slightly-stale entry, costing one cache miss (recompile) but + not a corrupt eviction. + + Best-effort: any ``OSError`` (read-only mount, restrictive ACLs, + ...) is swallowed -- size enforcement still bounds the cache, but + eviction degrades toward FIFO. + """ + new_atime_ns = time.time_ns() + if _UTIME_SUPPORTS_FD: + try: + fd = os.open(path, os.O_RDONLY) + except OSError: + return + try: + try: + st_now = os.fstat(fd) + except OSError: + return + if _stat_key(st_now) != _stat_key(st_before): + return + with contextlib.suppress(OSError): + os.utime(fd, ns=(new_atime_ns, st_before.st_mtime_ns)) + finally: + os.close(fd) + return + + # Path-based fallback (Windows). Best-effort -- residual TOCTOU window + # documented above. + try: + st_now = path.stat() + except OSError: + return + if _stat_key(st_now) != _stat_key(st_before): + return + with contextlib.suppress(OSError): + os.utime(path, ns=(new_atime_ns, st_before.st_mtime_ns)) + + +def _is_windows_sharing_violation(exc: BaseException) -> bool: + """Return True if ``exc`` is a Windows sharing/lock violation that + :func:`_unlink_with_sharing_retry` would have retried. + + Used by best-effort callers to filter out the exhausted-retry case + while letting other ``PermissionError`` instances (POSIX ACL + issues, Windows non-sharing winerrors) propagate -- those are real + configuration problems, not transient contention. + + The ``EACCES`` fallback only fires when ``winerror`` is absent: a + bare ``EACCES`` (no winerror attached) is the way ``io.open`` + surfaces a pending-delete or share-mode mismatch on Windows. When + ``winerror`` IS set but is NOT in the sharing set, the OS told us + exactly what failed and it isn't a sharing violation -- treating it + as transient would silently swallow real errors like a corrupt + ACL. + """ + if not _IS_WINDOWS: + return False + if not isinstance(exc, PermissionError): + return False + winerror = getattr(exc, "winerror", None) + if winerror in _SHARING_VIOLATION_WINERRORS: + return True + return winerror is None and exc.errno == errno.EACCES + + +def _unlink_with_sharing_retry(path: Path) -> None: + """Unlink with Windows-specific retry on sharing/lock violations. + + On Windows, ``Path.unlink`` raises ``PermissionError`` (winerror 5, + 32, or 33; sometimes bare ``EACCES``) when another process holds + the file open without ``FILE_SHARE_DELETE``. Python's default + ``open(p, "rb")`` does not pass that flag, so a reader from another + process briefly blocks our unlink while it reads. Retry with the + same backoff budget as :func:`_replace_with_sharing_retry` so + transient contention is not turned into a propagated error. + + Raises ``FileNotFoundError`` if the file is absent; the last + ``PermissionError`` if the Windows retry budget is exhausted; and + propagates any non-sharing ``PermissionError`` (or any non-Windows + ``PermissionError``) immediately. Best-effort callers should use + :func:`_is_windows_sharing_violation` to filter the exhausted-retry + case and re-raise any other ``PermissionError``. + """ + _with_sharing_retry(path.unlink) + + +def _prune_if_stat_unchanged(path: Path, st_before: os.stat_result) -> None: + """Unlink ``path`` iff its stat still matches ``st_before``. + + Guards against a cross-process race: a reader that sees a corrupt + record can have it atomically replaced (via ``os.replace``) by a + writer before the reader decides to prune. Comparing + ``(ino, size, mtime_ns)`` before and after rules out that case -- + any mismatch means someone else wrote a new file and we must not + delete their work. The residual TOCTOU window between stat and + unlink is narrow; worst case, a very-recently-written entry is + removed and the next read recompiles. + + Best-effort: a Windows sharing violation that survives the retry + budget leaves the file in place. The caller is in an eviction or + cleanup pass, so re-trying on the next pass is the right outcome. + """ + try: + st_now = path.stat() + except FileNotFoundError: + return + if _stat_key(st_before) != _stat_key(st_now): + return + try: + _unlink_with_sharing_retry(path) + except FileNotFoundError: + pass + except PermissionError as exc: + # Swallow only the exhausted-Windows-sharing case. POSIX ACL + # errors and Windows non-sharing winerrors are real configuration + # problems and must surface, not be silently lost during a prune. + if not _is_windows_sharing_violation(exc): + raise + + +class FileStreamProgramCache(ProgramCacheResource): + """Persistent program cache backed by a directory of atomic files. + + Designed for multi-process use: writes stage a temporary file and then + :func:`os.replace` it into place, so concurrent readers never observe a + partially-written entry. Each entry on disk is the raw compiled binary + -- cubin / PTX / LTO-IR -- with no header, framing, or pickle wrapper, + so the files are directly consumable by external NVIDIA tools + (``cuobjdump``, ``nvdisasm``, ``cuda-gdb``). + + Eviction is by least-recently-*read* time: every successful read bumps + the entry's ``atime``, and the size enforcer evicts oldest atime + first. + + .. note:: **Best-effort writes.** + + On Windows, ``os.replace`` raises ``PermissionError`` (winerror + 32 / 33) when another process holds the target file open. This + backend retries with bounded backoff (~185 ms) and, if still + failing, drops the cache write silently and returns success-shaped + control flow. The next call will see no entry and recompile. POSIX + and other ``PermissionError`` codes propagate. + + .. note:: **Atomic for readers, not crash-durable.** + + Each entry's temp file is ``fsync``-ed before ``os.replace``, but + the containing directory is **not** ``fsync``-ed. A host crash + between write and the next directory commit may lose recently + added entries; surviving entries remain consistent. + + .. note:: **Cross-version sharing.** + + The cache is safe to share across ``cuda.core`` patch releases: + every key produced by :func:`make_program_cache_key` encodes the + relevant backend/compiler/runtime fingerprints for its + compilation path (NVRTC entries pin the NVRTC version, NVVM + entries pin the libNVVM library and IR versions, PTX/linker + entries pin the chosen linker backend and its version -- and, + when the cuLink/driver backend is selected, the driver version + too; nvJitLink-backed PTX entries are deliberately + driver-version independent). Bumping ``_KEY_SCHEMA_VERSION`` + (mixed into the digest by ``make_program_cache_key``) produces + new keys that don't collide with old entries: post-bump + lookups miss the old on-disk paths, and the orphaned files + are reaped on the next size-cap eviction pass. Entries are + stored verbatim as the compiled binary, so cross-patch sharing + only requires that the compiler-pinning surface above stays + stable -- there is no Python-pickle compatibility involved. + + Parameters + ---------- + path: + Directory that owns the cache. Created if missing. If omitted, + the OS-conventional user cache directory is used: + ``$XDG_CACHE_HOME/cuda-python/program-cache`` (Linux, defaulting + to ``~/.cache/cuda-python/program-cache``) or + ``%LOCALAPPDATA%\\cuda-python\\program-cache`` (Windows). + max_size_bytes: + Optional soft cap on total on-disk size. Enforced opportunistically + on writes; concurrent writers may briefly exceed it. Eviction is by + least-recently-read time (oldest ``st_atime`` first). + """ + + def __init__( + self, + path: str | os.PathLike[str] | None = None, + *, + max_size_bytes: int | None = None, + ) -> None: + if max_size_bytes is not None and max_size_bytes <= 0: + raise ValueError("max_size_bytes must be positive or None (0 would evict every write)") + self._root = Path(path) if path is not None else _default_cache_dir() + self._entries = self._root / _ENTRIES_SUBDIR + self._tmp = self._root / _TMP_SUBDIR + self._max_size_bytes = max_size_bytes + self._root.mkdir(parents=True, exist_ok=True) + self._entries.mkdir(exist_ok=True) + self._tmp.mkdir(exist_ok=True) + # Opportunistic startup sweep of orphaned temp files left by any + # crashed writers. Age-based so concurrent in-flight writes from + # other processes are preserved. + self._sweep_stale_tmp_files() + # Incremental size tracker. Without it every ``__setitem__`` would + # walk ``entries/`` + ``tmp/`` to compute the total -- O(n) per + # write. With it: writes update the tracker by the net delta in O(1) + # and only walk on eviction (which already needs the scan to sort + # entries by atime). The tracker is seeded by one full scan at open + # time and refreshed on every eviction pass; cross-process drift + # (other writers/deleters) self-corrects the next time eviction + # fires. The lock guards mutations so multi-threaded writers in + # the same process don't interleave the read-modify-write on the + # int. Skipped entirely when ``max_size_bytes is None`` -- without + # a cap the tracker is dead weight. + self._size_lock = threading.Lock() + self._tracked_size_bytes = self._compute_total_size() if max_size_bytes is not None else 0 + + # -- key-to-path helpers ------------------------------------------------- + + def _path_for_key(self, key: object) -> Path: + k = _as_key_bytes(key) + # Hash the key to a fixed-length identifier so arbitrary-length user + # keys never exceed per-component filename limits (typically 255 on + # ext4 / NTFS). + # + # FIPS: must use a FIPS-approved hash algorithm. FIPS-enforcing + # systems can disable non-approved hashlib algorithms (for example + # blake2b) at the OpenSSL level. See #2043. + # + # With a 256-bit SHA-256 digest, the cache relies on collision + # resistance for key uniqueness -- two distinct keys hashing to the + # same path is astronomically unlikely (~2^128 practical collision + # work). + digest = hashlib.sha256(k, usedforsecurity=False).hexdigest() + return self._entries / digest[:2] / digest[2:] + + # -- mapping API --------------------------------------------------------- + + def __getitem__(self, key: object) -> bytes: + path = self._path_for_key(key) + try: + # The helper retries on Windows transient sharing-violation + # PermissionErrors so a racing rewriter doesn't turn a hit + # into a spurious propagated error. + st, data = _stat_and_read_with_sharing_retry(path) + except FileNotFoundError: + raise KeyError(key) from None + # Bump atime to "now" so eviction (which sorts by st_atime) treats + # this read as the entry's most recent use. Best-effort: filesystems + # mounted ``noatime`` or with restrictive ACLs may refuse, in which + # case the cap still bounds size but eviction degrades toward FIFO + # rather than true LRU. + _touch_atime(path, st) + return data + + def __setitem__(self, key: object, value: bytes | bytearray | memoryview | ObjectCode) -> None: + data = _extract_bytes(value) + target = self._path_for_key(key) + target.parent.mkdir(parents=True, exist_ok=True) + # Re-create ``tmp/`` if something deleted it after ``__init__`` + # (operators clearing the cache by hand, ``rm -rf cache_dir/tmp``, + # another process's overzealous wipe). Cheap and idempotent; + # without it, every subsequent write would crash with + # FileNotFoundError even though we could trivially recover. + self._tmp.mkdir(parents=True, exist_ok=True) + + # Stat the existing entry (if any) BEFORE the replace so we can + # update the tracker by the net delta. A racing writer that lands + # an ``os.replace`` between this stat and our own makes ``old_size`` + # slightly off; the next ``_enforce_size_cap`` reconciles by + # re-scanning. Skipped when ``max_size_bytes is None`` (no tracker). + old_size = 0 + if self._max_size_bytes is not None: + try: + old_size = target.stat().st_size + except FileNotFoundError: + old_size = 0 + + fd, tmp_name = tempfile.mkstemp(prefix="entry-", dir=self._tmp) + tmp_path = Path(tmp_name) + try: + with os.fdopen(fd, "wb") as fh: + fh.write(data) + fh.flush() + os.fsync(fh.fileno()) + # Retry os.replace under Windows sharing/lock violations; only + # give up (and drop the cache write) after a bounded backoff, so + # transient contention is not turned into a silent miss. + # Non-sharing PermissionErrors and all POSIX PermissionErrors + # propagate immediately (real config problem). + if not _replace_with_sharing_retry(tmp_path, target): + with contextlib.suppress(FileNotFoundError): + tmp_path.unlink() + return + except BaseException: + with contextlib.suppress(FileNotFoundError): + tmp_path.unlink() + raise + + if self._max_size_bytes is None: + return + + # O(1) tracker update. Only run the scan-heavy ``_enforce_size_cap`` + # when this write actually pushes the running total above the cap. + new_size = len(data) + with self._size_lock: + self._tracked_size_bytes += new_size - old_size + over_cap = self._tracked_size_bytes > self._max_size_bytes + if over_cap: + self._enforce_size_cap() + + def __delitem__(self, key: object) -> None: + path = self._path_for_key(key) + # Stat before unlink so we can decrement the tracker by the actual + # on-disk size. Best-effort: if the file vanishes between stat and + # unlink (concurrent eviction), we treat the delete as a miss -- + # matching the behaviour callers expect (KeyError) and leaving the + # tracker untouched (the racing eviction already accounted for it). + size = 0 + if self._max_size_bytes is not None: + try: + size = path.stat().st_size + except FileNotFoundError: + raise KeyError(key) from None + try: + _unlink_with_sharing_retry(path) + except FileNotFoundError: + raise KeyError(key) from None + if self._max_size_bytes is not None: + with self._size_lock: + # Clamp at zero. A racing ``_enforce_size_cap`` can re-seed the + # tracker between our stat and our subtract; if its scan ran + # AFTER we unlinked, its reseed value didn't include ``size``, + # so subtracting ``size`` again here would undercount reality + # by ``size``. Repeated under contention, an unclamped subtract + # walks the tracker negative -- and once negative, the + # ``tracker > cap`` check that gates ``_enforce_size_cap`` + # never fires, so eviction dies silently and there is no + # self-healing path (the only reseed point is the function + # that no longer runs). Clamping leaves us at worst + # undercounting (the next reseed corrects it) instead of + # entering the permanently-broken negative state. + self._tracked_size_bytes = max(0, self._tracked_size_bytes - size) + + def __len__(self) -> int: + """Return the number of files currently in ``entries/``. + + This is a count of on-disk files, not of keys reachable through + ``make_program_cache_key``. After a ``_KEY_SCHEMA_VERSION`` bump + old entries become unreachable by lookup but remain on disk + until eviction reaps them; ``__len__`` keeps counting them + until then. The same is true for entries written by callers + using arbitrary user keys -- the backend has no way to tell a + live entry from an orphan without knowing the caller's keying + scheme. + """ + # ``_iter_entry_paths`` already filters with ``entry.is_file()``, + # so don't stat each path a second time here. + return sum(1 for _ in self._iter_entry_paths()) + + def clear(self) -> None: + # Snapshot stat alongside path so we can refuse to unlink an entry + # that was concurrently replaced by another process between the + # snapshot scan and the unlink. Same stat-guard contract as + # ``_prune_if_stat_unchanged`` and ``_enforce_size_cap``. + snapshot = [] + for path in self._iter_entry_paths(): + try: + snapshot.append((path, path.stat())) + except FileNotFoundError: + continue + for path, st_before in snapshot: + _prune_if_stat_unchanged(path, st_before) + # Sweep ONLY stale temp files. Deleting a young temp would race with + # another process between ``mkstemp`` and ``os.replace`` and turn its + # write into ``FileNotFoundError`` instead of a successful commit. + self._sweep_stale_tmp_files() + # Remove empty subdirs (best-effort; concurrent writers may re-create). + if self._entries.exists(): + for sub in sorted(self._entries.iterdir(), reverse=True): + if sub.is_dir(): + with contextlib.suppress(OSError): + sub.rmdir() + # The directory is now (almost) empty -- but a concurrent writer may + # have landed a fresh entry between the snapshot and the unlink, and + # young temp files were intentionally preserved. Re-derive the + # tracker from the post-clear state instead of zeroing blindly. + if self._max_size_bytes is not None: + actual = self._compute_total_size() + with self._size_lock: + self._tracked_size_bytes = actual + + # -- internals ----------------------------------------------------------- + + def _iter_entry_paths(self) -> Iterable[Path]: + # ``os.scandir`` returns ``DirEntry`` objects whose ``is_dir`` / + # ``is_file`` methods consult the cached dirent type from the + # ``readdir`` result on filesystems that report it (ext4, NTFS, ...), + # avoiding a per-entry ``stat`` syscall. ``Path.iterdir`` also wraps + # ``scandir`` but discards the cached type, forcing a separate + # ``stat`` for every ``Path.is_dir`` / ``Path.is_file``. The ``with`` + # blocks release the underlying directory handle deterministically + # when the consumer stops early -- otherwise a leaked handle blocks + # deletes/renames on Windows until GC. + try: + with os.scandir(self._entries) as outer: + for sub in outer: + if not sub.is_dir(follow_symlinks=False): + continue + try: + with os.scandir(sub.path) as inner: + yield from (Path(entry.path) for entry in inner if entry.is_file(follow_symlinks=False)) + except FileNotFoundError: + continue + except FileNotFoundError: + return + + def _compute_total_size(self) -> int: + """Walk ``entries/`` + ``tmp/`` and return the on-disk byte total. + + Used to seed the tracker at open time and to refresh it after every + eviction pass. Best-effort: files that vanish under us during the + walk (concurrent eviction by this or another process) are skipped. + Tracked total may briefly differ from this scan's result under + cross-process contention; the next eviction will reconcile. + """ + total = 0 + for path in self._iter_entry_paths(): + try: + total += path.stat().st_size + except FileNotFoundError: + continue + return total + self._sum_tmp_sizes() + + def _iter_tmp_entries(self) -> Iterable[os.DirEntry[str]]: + # Mirror ``_iter_entry_paths``: scandir + cached d_type for the + # file/dir filter + deterministic handle close on early exit. + # Yields ``DirEntry`` (not Path) so callers can use ``entry.stat`` + # / ``entry.path`` directly without an extra wrap. + try: + with os.scandir(self._tmp) as it: + yield from (entry for entry in it if entry.is_file(follow_symlinks=False)) + except FileNotFoundError: + return + + def _sum_tmp_sizes(self) -> int: + """Sum sizes of every file in ``tmp/``, skipping vanished entries. + + Both ``_compute_total_size`` (open-time seed) and + ``_enforce_size_cap`` (eviction reconciliation) need this -- + temp files occupy disk too, so undercounting them would let + bursts of in-flight writes silently exceed ``max_size_bytes``. + """ + total = 0 + for entry in self._iter_tmp_entries(): + try: + total += entry.stat(follow_symlinks=False).st_size + except FileNotFoundError: + continue + return total + + def _sweep_stale_tmp_files(self) -> None: + """Remove temp files left behind by crashed writers. + + Age threshold is conservative (``_TMP_STALE_AGE_SECONDS``) so an + in-flight write from another process is not interrupted. Best + effort: a missing file or a permission failure is ignored. + """ + cutoff = time.time() - _TMP_STALE_AGE_SECONDS + for entry in self._iter_tmp_entries(): + try: + if entry.stat(follow_symlinks=False).st_mtime < cutoff: + os.unlink(entry.path) + except (FileNotFoundError, PermissionError): + continue + + def _enforce_size_cap(self) -> None: + if self._max_size_bytes is None: + return + # Sweep stale temp files first so a long-dead writer's leftovers + # don't drag the apparent size up and force needless eviction. + self._sweep_stale_tmp_files() + entries = [] + total = 0 + # Count both committed entries AND surviving temp files: temp files + # occupy disk too, even if they're young. Without this the soft cap + # silently undercounts in-flight writes. + # + # Trade-off under burst concurrency: many young temp files (each + # below the stale-sweep threshold) can push ``total`` above + # ``max_size_bytes`` with only committed entries left to evict. + # That can over-evict committed entries during the burst; once + # the burst subsides and the temps land via ``os.replace`` (or + # are reaped by a later sweep), the cap re-stabilises. This is + # consistent with the documented soft-cap contract -- callers + # that need a hard bound should leave the cap None and prune + # externally. + for path in self._iter_entry_paths(): + try: + st = path.stat() + except FileNotFoundError: + continue + # Carry the full stat so eviction can guard against a concurrent + # os.replace that swapped a fresh entry into this path between + # snapshot and unlink. Eviction below sorts by ``st_atime`` so + # entries that callers actually read recently survive + # write-only churn (true LRU instead of FIFO). + entries.append((st.st_atime, st.st_size, path, st)) + total += st.st_size + total += self._sum_tmp_sizes() + if total <= self._max_size_bytes: + # Re-seed the tracker from the scan: catches drift from + # cross-process writers/deleters that the per-write delta + # accounting wouldn't have observed. Reaching here means the + # tracker was over-cap but the disk truth is under-cap, so + # this assignment is the cheapest reconciliation point we get. + with self._size_lock: + self._tracked_size_bytes = total + return + entries.sort(key=lambda e: e[0]) # oldest atime first + for _atime, size, path, st_before in entries: + if total <= self._max_size_bytes: + break + # _prune_if_stat_unchanged refuses if a writer replaced the file + # between snapshot and now, so eviction can't silently delete a + # freshly-committed entry from another process. + try: + stat_now = path.stat() + except FileNotFoundError: + total -= size + continue + if _stat_key(stat_now) != _stat_key(st_before): + # File was replaced -- don't unlink, but update ``total`` to + # reflect the replacement's actual size or the cap check + # below could declare us done while still over the limit. + total += stat_now.st_size - size + continue + # Tolerate Windows sharing violations during eviction: another + # process may briefly hold the file open for a read. Skip this + # entry; a later eviction pass will retry. Same outcome as if + # the stat-guard above had triggered. Other PermissionErrors + # (POSIX ACL, Windows non-sharing winerrors) are real config + # problems -- surface them rather than silently exceed the cap. + try: + _unlink_with_sharing_retry(path) + total -= size + except FileNotFoundError: + pass + except PermissionError as exc: + if not _is_windows_sharing_violation(exc): + raise + # Reconcile: after the eviction pass, ``total`` reflects what we + # believe the disk now holds. Re-seed the tracker so the next write + # accumulates from a fresh baseline. + with self._size_lock: + self._tracked_size_bytes = total diff --git a/cuda_core/cuda/core/utils/_program_cache/_in_memory.py b/cuda_core/cuda/core/utils/_program_cache/_in_memory.py new file mode 100644 index 00000000000..6a25e2afbc6 --- /dev/null +++ b/cuda_core/cuda/core/utils/_program_cache/_in_memory.py @@ -0,0 +1,127 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +"""In-memory bytes-in / bytes-out program cache.""" + +from __future__ import annotations + +import collections +import threading + +from cuda.core._module import ObjectCode + +from ._abc import ProgramCacheResource, _as_key_bytes, _extract_bytes + + +class InMemoryProgramCache(ProgramCacheResource): + """In-memory program cache with LRU eviction. + + Suitable for single-process workflows that want to avoid disk I/O -- + a typical application compiles its kernels once per process and + looks them up many times. Entries live only for the lifetime of + the process; use :class:`FileStreamProgramCache` when the cache + should persist across runs. + + Like :class:`FileStreamProgramCache`, this backend is bytes-in / + bytes-out: ``__setitem__`` accepts ``bytes``, ``bytearray``, + ``memoryview``, or any :class:`~cuda.core.ObjectCode` (path-backed + too -- the file is read at write time so the cached entry holds the + binary content, not a path). ``__getitem__`` returns ``bytes``. + + Parameters + ---------- + max_size_bytes: + Optional cap on the sum of stored payload sizes. When exceeded, + LRU eviction runs until the total fits. ``None`` means + unbounded. The size-only bound mirrors + :class:`FileStreamProgramCache`. + + Notes + ----- + Recency is updated on :meth:`__getitem__`; ``get`` is the + recommended lookup since the cache deliberately omits + ``__contains__`` (the ``if key in cache: ...`` idiom is racy + across processes; see :class:`ProgramCacheResource`). + + Thread safety: a :class:`threading.RLock` serialises every method, + so the cache can be shared across threads without external + locking. + """ + + def __init__( + self, + *, + max_size_bytes: int | None = None, + ) -> None: + if max_size_bytes is not None and max_size_bytes <= 0: + raise ValueError("max_size_bytes must be positive or None (0 would evict every write)") + self._max_size_bytes = max_size_bytes + # Key insertion order encodes LRU order: oldest first, newest last. + # Each value is ``(payload_bytes, payload_size)``; caching the size + # avoids recomputing ``len(data)`` on every eviction pass. + self._entries: collections.OrderedDict[bytes, tuple[bytes, int]] = collections.OrderedDict() + self._total_bytes = 0 + # Reentrant so helper methods that also take the lock can nest + # without deadlocking. + self._lock = threading.RLock() + + def __getitem__(self, key: object) -> bytes: + k = _as_key_bytes(key) + with self._lock: + try: + data, _size = self._entries[k] + except KeyError: + raise KeyError(key) from None + # Touch LRU: a real read promotes the entry to "most recent" + # so eviction prefers genuinely cold entries. + self._entries.move_to_end(k) + return data + + def __setitem__(self, key: object, value: bytes | bytearray | memoryview | ObjectCode) -> None: + data = _extract_bytes(value) + size = len(data) + k = _as_key_bytes(key) + with self._lock: + existing = self._entries.pop(k, None) + if existing is not None: + self._total_bytes -= existing[1] + self._entries[k] = (data, size) + self._total_bytes += size + self._evict_to_caps() + + def __delitem__(self, key: object) -> None: + k = _as_key_bytes(key) + with self._lock: + try: + _data, size = self._entries.pop(k) + except KeyError: + raise KeyError(key) from None + self._total_bytes -= size + + def __len__(self) -> int: + with self._lock: + return len(self._entries) + + def clear(self) -> None: + with self._lock: + self._entries.clear() + self._total_bytes = 0 + + # -- eviction ------------------------------------------------------------ + + def _evict_to_caps(self) -> None: + """Evict oldest entries until the size cap is satisfied. + + Called from ``__setitem__`` after an insert/update. Pops from + the front of the OrderedDict (oldest first). If the + just-inserted entry on its own exceeds ``max_size_bytes``, the + loop will evict it too -- mirroring + :class:`FileStreamProgramCache` (a write that cannot fit does + not survive its own size-cap pass). + """ + if self._max_size_bytes is None: + return + while self._entries and self._total_bytes > self._max_size_bytes: + _k, (_data, size) = self._entries.popitem(last=False) + self._total_bytes -= size diff --git a/cuda_core/cuda/core/utils/_program_cache/_keys.py b/cuda_core/cuda/core/utils/_program_cache/_keys.py new file mode 100644 index 00000000000..668a26257fb --- /dev/null +++ b/cuda_core/cuda/core/utils/_program_cache/_keys.py @@ -0,0 +1,819 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +"""Cache-key construction. + +A backend-strategy hierarchy (:class:`_KeyBackend`) owns the per-code-type +guard / fingerprint / version-probe logic; :func:`make_program_cache_key` +dispatches to the right backend and assembles the digest. +""" + +from __future__ import annotations + +import abc +import collections.abc +import hashlib +from typing import Any, Callable, Sequence + +# Mutual-dependency contract: this module imports ProgramOptions from +# cuda.core._program at module level, and cuda.core._program imports +# ProgramCacheResource / make_program_cache_key from cuda.core.utils +# only via deferred imports inside ``Program.compile``. Adding a +# top-level ``from cuda.core.utils import ...`` to _program.pyx would +# turn this into a real import cycle -- keep the import in _program.pyx +# deferred (or import the symbols from the leaf submodule directly). +from cuda.core._program import ProgramOptions +from cuda.core._utils.cuda_utils import ( + driver as _driver, +) +from cuda.core._utils.cuda_utils import ( + handle_return as _handle_return, +) +from cuda.core._utils.cuda_utils import ( + nvrtc as _nvrtc, +) + +# Bump when the key schema changes in a way that invalidates existing caches. +_KEY_SCHEMA_VERSION = 2 + +_VALID_CODE_TYPES = frozenset({"c++", "ptx", "nvvm"}) +_VALID_TARGET_TYPES = frozenset({"ptx", "cubin", "ltoir"}) + +# code_type -> allowed target_type set, mirroring Program.compile's +# SUPPORTED_TARGETS matrix in _program.pyx. +_SUPPORTED_TARGETS_BY_CODE_TYPE = { + "c++": frozenset({"ptx", "cubin", "ltoir"}), + "ptx": frozenset({"cubin", "ptx"}), + "nvvm": frozenset({"ptx", "ltoir"}), +} + + +# Map each ProgramOptions field that reaches the Linker via +# _translate_program_options (see cuda_core/cuda/core/_program.pyx) to the +# gate the Linker uses to turn it into a flag (see +# ``_prepare_nvjitlink_options`` and ``_prepare_driver_options`` in +# _linker.pyx). All other fields on ProgramOptions are NVRTC-only and must +# NOT perturb a PTX cache key: a PTX compile with a shared ProgramOptions +# that happens to set include_path/pch/frandom_seed would otherwise miss the +# cache unnecessarily. Collapsing inputs through these gates means +# semantically-equivalent configurations (``debug=False`` vs ``None``, +# ``time=True`` vs ``time="path"``) hash to the same cache key instead of +# forcing spurious misses. Single source of truth: every reader iterates +# this dict, so adding a field here is enough -- there is no parallel +# field-name list to keep in sync. +def _gate_presence(v: Any) -> bool: + return v is not None + + +def _gate_truthy(v: Any) -> bool: + return bool(v) + + +def _gate_is_true(v: Any) -> bool: + return v is True + + +def _gate_tristate_bool(v: Any) -> bool | None: + return None if v is None else bool(v) + + +def _gate_identity(v: Any) -> Any: + return v + + +def _gate_ptxas_options(v: Any) -> Any: + # ``_prepare_nvjitlink_options`` emits one ``-Xptxas=`` per element, and + # treats ``str`` as a single-element sequence. Canonicalize to a tuple so + # ``"-v"`` / ``["-v"]`` / ``("-v",)`` all hash the same. An empty sequence + # emits no flags, so collapse it to ``None`` too. + # + # Order is preserved on purpose: ptxas accepts ordering-sensitive flag + # pairs (e.g. ``-O2`` after ``-O3`` lowers the active level), so + # ``["-v", "-O2"]`` and ``["-O2", "-v"]`` are not guaranteed to produce + # identical bytes. We accept the spurious miss when callers reorder + # flags; treating order as semantic keeps the cache safe in the + # ordering-sensitive case. + if v is None: + return None + if isinstance(v, str): + return ("-Xptxas=" + v,) + if isinstance(v, collections.abc.Sequence): + if len(v) == 0: + return None + return tuple(f"-Xptxas={s}" for s in v) + return v + + +_LINKER_FIELD_GATES = { + "name": _gate_identity, + "arch": _gate_identity, + "max_register_count": _gate_identity, + "time": _gate_presence, # linker emits ``-time`` iff value is not None + "link_time_optimization": _gate_truthy, + "debug": _gate_truthy, + "lineinfo": _gate_truthy, + "ftz": _gate_tristate_bool, + "prec_div": _gate_tristate_bool, + "prec_sqrt": _gate_tristate_bool, + "fma": _gate_tristate_bool, + "split_compile": _gate_identity, + "ptxas_options": _gate_ptxas_options, + "no_cache": _gate_is_true, +} + + +# LinkerOptions fields the ``cuLink`` driver backend silently ignores +# (emits only a DeprecationWarning; no actual flag reaches the compiler). +# When the driver backend is active, collapse them to a single sentinel in +# the fingerprint so nvJitLink<->driver parity of ``ObjectCode`` doesn't +# cause cache misses from otherwise-equivalent configurations. +_DRIVER_IGNORED_LINKER_FIELDS = frozenset({"ftz", "prec_div", "prec_sqrt", "fma"}) + + +def _linker_option_fingerprint(options: ProgramOptions, *, use_driver_linker: bool | None) -> list[bytes]: + """Backend-aware fingerprint of ProgramOptions fields consumed by the Linker. + + Each field passes through the gate the Linker itself uses so equivalent + inputs (e.g. ``debug=False`` / ``None``) hash to the same bytes. When + the driver (cuLink) linker backend is in use, fields it silently + ignores collapse to one sentinel so those options don't perturb the + key on driver-backed hosts either. ``use_driver_linker=None`` means we + couldn't probe the backend; we don't collapse driver-ignored fields in + that case, to stay conservative. + """ + parts = [] + driver_ignored = use_driver_linker is True + for name, gate in _LINKER_FIELD_GATES.items(): + if driver_ignored and name in _DRIVER_IGNORED_LINKER_FIELDS: + parts.append(f"{name}=".encode()) + continue + gated = gate(getattr(options, name, None)) + parts.append(f"{name}={gated!r}".encode()) + return parts + + +# ProgramOptions fields that map to LinkerOptions fields the cuLink (driver) +# backend rejects outright (see _prepare_driver_options in _linker.pyx). +# ``split_compile_extended`` exists on LinkerOptions but is not exposed via +# ProgramOptions / _translate_program_options, so it cannot reach the driver +# linker from the cache path and is omitted here. +_DRIVER_LINKER_UNSUPPORTED_FIELDS = ("time", "ptxas_options", "split_compile") + + +def _driver_version() -> int: + return int(_handle_return(_driver.cuDriverGetVersion())) + + +def _nvrtc_version() -> tuple[int, int]: + major, minor = _handle_return(_nvrtc.nvrtcVersion()) + return int(major), int(minor) + + +def _linker_backend_and_version(use_driver: bool) -> tuple[str, str]: + """Return ``(backend, version)`` for the linker used on PTX inputs. + + ``use_driver`` is the result of ``_decide_nvjitlink_or_driver()`` and + must be passed in so a single ``make_program_cache_key`` call shares + one probe across :meth:`_LinkerBackend.validate`, + :meth:`option_fingerprint`, and :meth:`hash_version_probe` (otherwise + a transient probe flap could write inconsistent fields into the same + key). + + Raises any underlying probe exception. ``make_program_cache_key`` catches + and mixes the exception's class name into the digest, so the same probe + failure produces the same key across processes -- the cache stays + persistent in broken environments, while never sharing a key with a + working probe (``_probe_failed`` label vs. ``driver``/``nvrtc``/...). + + nvJitLink version lookup goes through ``sys.modules`` first so we hit the + same module ``_decide_nvjitlink_or_driver()`` already loaded. That keeps + fingerprinting aligned with whichever ``cuda.bindings.nvjitlink`` import + path the linker actually uses. + """ + import sys + + if use_driver: + return ("driver", str(_driver_version())) + nvjitlink = sys.modules.get("cuda.bindings.nvjitlink") + if nvjitlink is None: + from cuda.bindings import nvjitlink as _nvjitlink + + nvjitlink = _nvjitlink + + return ("nvJitLink", str(nvjitlink.version())) + + +def _nvvm_fingerprint() -> str: + """Stable identifier for the loaded NVVM toolchain. + + Combines the libNVVM library version (``module.version()``) with the IR + version reported by ``module.ir_version()``. The library version is the + primary invalidation lever: a libNVVM patch upgrade can change codegen + while keeping the same IR major/minor, so keying only on the IR pair + would silently reuse stale entries. Paired with cuda-core, the IR pair + adds defence in depth without making the key any less stable. + + Both calls go through ``_get_nvvm_module()`` so this fingerprint follows + the same availability / cuda-bindings-version gate that real NVVM + compilation does -- if NVVM is unusable at compile time, the probe + fails the same way and ``_probe`` mixes the failure label into the key. + """ + from cuda.core._program import _get_nvvm_module + + module = _get_nvvm_module() + lib_major, lib_minor = module.version() # type: ignore[attr-defined] + major, minor, debug_major, debug_minor = module.ir_version() # type: ignore[attr-defined] + return f"lib={lib_major}.{lib_minor};ir={major}.{minor}.{debug_major}.{debug_minor}" + + +# ProgramOptions fields that reference external files whose *contents* the +# cache key cannot observe without reading the filesystem. Callers that set +# any of these must supply an ``extra_digest`` covering the dependency surface +# (e.g. a hash over all reachable headers / PCH bytes). +_EXTERNAL_CONTENT_OPTIONS = ( + "include_path", + "pre_include", + "pch", + "use_pch", + "pch_dir", +) + +# ProgramOptions fields whose compilation effect is not captured in the +# returned ``ObjectCode`` -- they produce a filesystem artifact as a side +# effect. A cache hit skips compilation, so that artifact would never be +# written. Reject these outright: the persistent cache is for pure ObjectCode +# reuse, not for replaying compile-time side effects. +# * create_pch -- writes a PCH file (NVRTC). +# * time -- writes NVRTC timing info to a file. +# * fdevice_time_trace -- writes a device-compilation time trace file (NVRTC). +# These are all NVRTC-specific; the Linker's ``-time`` logs to the info log +# (not a file) and NVVM explicitly rejects all three at compile time. The +# side-effect guard is therefore gated on ``backend == "nvrtc"`` below. +_SIDE_EFFECT_OPTIONS = ("create_pch", "time", "fdevice_time_trace") + + +# ProgramOptions fields gated by plain truthiness in ``_program.pyx`` (the +# compiler writes the flag only when the value is truthy). +_BOOLEAN_OPTION_FIELDS = frozenset({"pch"}) + +# Fields whose compiler emission requires ``isinstance(value, str)`` or a +# non-empty sequence; anything else (``False``, ``int``, ``None``, ``[]``) +# is silently ignored at compile time. +_STR_OR_SEQUENCE_OPTION_FIELDS = frozenset({"include_path", "pre_include"}) + + +def _option_is_set(options: ProgramOptions, name: str) -> bool: + """Match how ``_program.pyx`` gates option emission, per field shape. + + - Boolean flags (``pch``): truthy only. + - str-or-sequence fields (``include_path``, ``pre_include``): ``str`` + (including empty) or a non-empty ``collections.abc.Sequence`` (list, + tuple, range, user subclass, ...); everything else (``False``, ``int``, + empty sequence, ``None``) is ignored by the compiler and must not + trigger a cache-time guard. + - Path/string-shaped fields (``create_pch``, ``time``, + ``fdevice_time_trace``, ``use_pch``, ``pch_dir``): ``is not None`` -- + the compiler emits ``--flag=`` for any non-None value, so + ``False`` / ``""`` / ``0`` must still count as set. + """ + value = getattr(options, name, None) + if value is None: + return False + if name in _BOOLEAN_OPTION_FIELDS: + return bool(value) + if name in _STR_OR_SEQUENCE_OPTION_FIELDS: + # Mirror ``_prepare_nvrtc_options_impl``: it checks ``isinstance(v, str)`` + # first, then ``is_sequence(v)`` (which is ``isinstance(v, Sequence)``). + # We therefore accept any ``collections.abc.Sequence`` (range, deque, + # user subclass, etc.), not just list/tuple. + if isinstance(value, str): + return True + if isinstance(value, collections.abc.Sequence): + return len(value) > 0 + return False + return True + + +def _hash_probe_failure(update: Callable[[str, bytes], None], label: str, exc: BaseException) -> None: + """Mix a probe failure into the digest under a stable, content-free label. + + Hashing only the exception's CLASS NAME (not its message) keeps the + digest stable across repeated calls within one process (e.g. NVVM's + loader reports different messages on first vs. cached-failure attempts) + AND across processes that hit the same failure mode. The + ``_probe_failed`` label differs from every backend's success label, so a + broken environment never collides with a working one -- the cache + "fails closed" between broken and working environments while staying + persistent within either. + """ + update(f"{label}_probe_failed", type(exc).__name__.encode()) + + +class _KeyBackend(abc.ABC): + """Strategy for deriving the cache key for one ``Program`` ``code_type``. + + Each subclass owns the backend-specific guard logic, code coercion, + option fingerprinting, name-expression handling, version probing, and + extra-payload hashing. The orchestrator :func:`make_program_cache_key` + validates the code_type / target_type pair, dispatches to the right + backend, and assembles the digest. + """ + + @abc.abstractmethod + def validate(self, options: ProgramOptions, target_type: str, extra_digest: bytes | None) -> None: + """Reject inputs the cache cannot key safely. + + Raises ``ValueError`` for options that have compile-time side + effects, options that pull in external file content the cache + can't observe, or any other backend-specific invariants. + """ + + def encode_code(self, code: object, code_type: str) -> bytes: + """Coerce ``code`` to bytes. Default rejects bytes-like input + (only NVVM accepts it; ``Program()`` does the same).""" + if isinstance(code, str): + return code.encode("utf-8") + if isinstance(code, (bytes, bytearray)): + raise TypeError( + f"code must be str for code_type={code_type!r}; bytes/bytearray are only accepted for code_type='nvvm'." + ) + raise TypeError(f"code must be str or bytes, got {type(code).__name__}") + + @abc.abstractmethod + def option_fingerprint(self, options: ProgramOptions, target_type: str) -> list[bytes]: + """Fingerprint of the ``ProgramOptions`` fields that reach the compiler.""" + + def encode_name_expressions(self, name_expressions: Sequence[Any]) -> tuple[bytes, ...] | None: # noqa: ARG002 + """Sorted, type-tagged name expressions, or ``None`` if the + backend does not consume them. + + ``None`` means the orchestrator emits no ``names_count`` / + ``name`` entries at all (a backend that ignores + ``name_expressions`` should never have them perturb its key). An + empty tuple means the backend supports them but the caller + passed none -- the orchestrator still emits ``names_count=0`` so + the schema is stable across "absent" and "empty". + """ + return None + + @abc.abstractmethod + def hash_version_probe(self, update: Callable[[str, bytes], None]) -> None: + """Mix the runtime/compiler version probe into the digest via + ``update(label, payload)``. On probe failure, mix + ``_hash_probe_failure(update, "